Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ARP ¶
type ARP struct { HWType uint16 ProtoType uint16 HWLength uint8 ProtoLength uint8 Operation uint16 SHA net.HardwareAddr // Sender Hardware Address SPA net.IP // Sender Protocol Address THA net.HardwareAddr // Target Hardware Address TPA net.IP // Target Protocol Address }
func NewARPReply ¶
func NewARPReply(sha, tha net.HardwareAddr, spa, tpa net.IP) *ARP
func NewARPRequest ¶
func NewARPRequest(sha net.HardwareAddr, spa, tpa net.IP) *ARP
func (ARP) MarshalBinary ¶
func (*ARP) UnmarshalBinary ¶
type Ethernet ¶
type Ethernet struct {
SrcMAC, DstMAC net.HardwareAddr
Type uint16
Payload []byte
}
func (Ethernet) MarshalBinary ¶
func (*Ethernet) UnmarshalBinary ¶
type ICMPEcho ¶
func NewICMPEchoReply ¶
func NewICMPEchoRequest ¶
func (ICMPEcho) MarshalBinary ¶
func (*ICMPEcho) UnmarshalBinary ¶
type IPv4 ¶
type IPv4 struct { Version uint8 IHL uint8 DSCP uint8 ECN uint8 Length uint16 ID uint16 Flags uint8 Offset uint16 TTL uint8 Protocol uint8 Checksum uint16 SrcIP net.IP DstIP net.IP Payload []byte }
func (IPv4) MarshalBinary ¶
func (*IPv4) UnmarshalBinary ¶
type LLDP ¶
type LLDP struct { ChassisID LLDPChassisID PortID LLDPPortID TTL uint16 }
func (*LLDP) MarshalBinary ¶
func (*LLDP) UnmarshalBinary ¶
type LLDPChassisID ¶
type LLDPPortID ¶
type TCP ¶
type TCP struct { SrcPort uint16 DstPort uint16 Sequence uint32 Acknowledgment uint32 // From LSB, FIN, SYN, RST, PSH, ACK, URG, ECE, CWR, and NS. Flags uint16 WindowSize uint16 Checksum uint16 Urgent uint16 Payload []byte // contains filtered or unexported fields }
func (TCP) MarshalBinary ¶
func (*TCP) SetPseudoHeader ¶
TCP checksum needs a pseudo header that has src and dst IPv4 addresses.
func (*TCP) UnmarshalBinary ¶
type UDP ¶
type UDP struct { SrcPort uint16 DstPort uint16 Length uint16 Checksum uint16 Payload []byte // contains filtered or unexported fields }
func (UDP) MarshalBinary ¶
func (*UDP) SetPseudoHeader ¶
UDP checksum needs a pseudo header that has src and dst IPv4 addresses.
func (*UDP) UnmarshalBinary ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.