Documentation ¶
Overview ¶
Package packet implements the Katzenpost server side packet structure.
Index ¶
- func ParseForwardPacket(pkt *Packet) ([]byte, []byte, error)
- type Packet
- func (pkt *Packet) CmdsToString() string
- func (pkt *Packet) Dispose()
- func (pkt *Packet) IsForward() bool
- func (pkt *Packet) IsSURBReply() bool
- func (pkt *Packet) IsToUser() bool
- func (pkt *Packet) IsUnreliableToUser() bool
- func (pkt *Packet) Set(payload []byte, cmds []commands.RoutingCommand) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Packet ¶
type Packet struct { Raw []byte Payload []byte // The parsed out routing commands. NextNodeHop *commands.NextNodeHop NodeDelay *commands.NodeDelay Recipient *commands.Recipient SurbReply *commands.SURBReply ID uint64 Delay time.Duration RecvAt time.Duration DispatchAt time.Duration MustForward bool MustTerminate bool }
func NewWithID ¶
NewWithID allocates a new Packet, with the specified raw payload and ID. Most callers should use New, this exists to support serializing packets to external memory.
func (*Packet) CmdsToString ¶
CmdsToString returns an abbreviated list of the packet's routing commands, suitable for debugging.
func (*Packet) Dispose ¶
func (pkt *Packet) Dispose()
Dispose clears the packet structure and returns it to the allocation pool.
func (*Packet) IsForward ¶
IsForward returns true iff the packet has routing commands indicating it is a forward packet destined for another hop.
func (*Packet) IsSURBReply ¶
IsSURBReply returns true iff the packet has routing commands indicating it is a SURB Reply destined for a local user.
func (*Packet) IsToUser ¶
IsToUser returns true iff the packet has routing commands indicating it is a forward packet destined for a local user.
func (*Packet) IsUnreliableToUser ¶
IsUnreliableToUser returns true iff the packet has routing commands indicating it is an unreliable forward packet destined for a local user.