Documentation ¶
Index ¶
- Constants
- type Packet
- func (p *Packet) CheckSum() bool
- func (p *Packet) GetDestinationIPv4() (net.IP, error)
- func (p *Packet) GetSourceIPv4() (net.IP, error)
- func (p *Packet) IsACK() bool
- func (p *Packet) IsERR() bool
- func (p *Packet) IsFIN() bool
- func (p *Packet) IsSYN() bool
- func (p *Packet) Serialize() []byte
- func (p *Packet) SetAckNo(ack uint32)
- func (p *Packet) SetDestinationIPv4(ip net.IP)
- func (p *Packet) SetFlagACK()
- func (p *Packet) SetFlagERR()
- func (p *Packet) SetFlagFIN()
- func (p *Packet) SetFlagSYN()
- func (p *Packet) SetSeqNo(seq uint32)
- func (p *Packet) SetSourceIPv4(ip net.IP)
- func (p *Packet) SetSum()
Constants ¶
View Source
const ( // MaxPacketBytes is the maximum size of an RDTP packet incl. header MaxPacketBytes = 1500 // will chunk otherwise // HeaderByteSize is the byte size of an RDTP header HeaderByteSize = 17 // MaxPayloadBytes is the maximum size of a payload that // a single RDTP packet can carry MaxPayloadBytes = MaxPacketBytes - HeaderByteSize )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Packet ¶
type Packet struct { // connection identifyers SrcPort uint16 DstPort uint16 // processing and integrity Length uint16 Checksum uint16 // reliability SeqNo uint32 AckNo uint32 // control Flags uint8 // {SYN, FIN, ACK, ERR, XXXX, XXXX, XXXX, XXXX} // data Payload []byte // contains filtered or unexported fields }
Packet is an RDTP packet
func Deserialize ¶
Deserialize byte decodes an RDTP packet
func (*Packet) GetDestinationIPv4 ¶
GetDestinationIPv4 returns the destination IPv4 set on the packet or an error if none is set
func (*Packet) GetSourceIPv4 ¶
GetSourceIPv4 returns the source IPv4 set on the packet or an error if none is set
func (*Packet) Serialize ¶
Serialize byte-encodes an RDTP packet ready to be encapsulated in a network layer protocol packet (i.e. IP datagram)
func (*Packet) SetDestinationIPv4 ¶
SetDestinationIPv4 sets the destination IPv4 on the packet
func (*Packet) SetSourceIPv4 ¶
SetSourceIPv4 sets the source IPv4 on the packet
Click to show internal directories.
Click to hide internal directories.