Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrInvalidLength is an error returned when the packet length is // too small. ErrInvalidLength = errors.New("Length field is too small") // ErrInvalidChecksum is an error returned when the packet checksum // is incorrect. ErrInvalidChecksum = errors.New("Checksum field is incorrect") )
Functions ¶
This section is empty.
Types ¶
type Header ¶
Header is the UDP packet header.
type Packet ¶
type Packet struct { Header Payload []byte // Address is either the source or destination address Address ipv4.Address }
Packet is a UDP packet
func (Packet) CalculateChecksum ¶
CalculateChecksum calculates the correct checksum of the packet.
Click to show internal directories.
Click to hide internal directories.