Documentation
¶
Index ¶
Constants ¶
View Source
const ( EthTypeArp uint16 = 0x0806 EthTypeIpv4 uint16 = 0x0800 EthTypeIpv6 uint16 = 0x86dd )
View Source
const ( DstMacLength = 6 SrcMacLength = 6 ProtocolTypeLength = 2 Etherlen = DstMacLength + SrcMacLength + ProtocolTypeLength )
Ether packet length.
View Source
const ( DstMACAddrOffset = 0 SrcMACAddrOffset = 6 Protocoloffset = 12 )
View Source
const ( ICMPv4TimeStampLength = 8 ICMPv4DataLength = 48 )
View Source
const ( SrcIPv4Length = 4 DstIPv4Length = 4 )
View Source
const ( IPv4offsetTotalLength = 2 // IPv4offsetPayloadLength is IPv4 offset payload length. IPv4offsetSrc = 12 // IPv4offsetSrc is IPv4 offset src length. IPv4offsetDst = IPv4offsetSrc + net.IPv4len // IPv4offsetDst is IPv4 offset dst length. )
IPv4 offset length.
View Source
const ( IPv6offsetPayloadLength = 4 // IPv6offsetPayloadLength is IPv6 offset payload length. IPv6offsetSrc = 8 // IPv6offsetSrc is IPv6 offset src length. IPv6offsetDst = IPv6offsetSrc + net.IPv6len // IPv6offsetDst is IPv6 offset dst length. )
IPv6 offset length.
View Source
const ( SrcUDPLength = 2 DstUDPLength = 2 )
View Source
const ( SrcUDPPortOffset = 20 DstUDPPortOffset = 22 )
View Source
const (
ICMPv4Dataoffset = 42
)
Variables ¶
This section is empty.
Functions ¶
func DebugICMPv4Message ¶
func DebugICMPv4Message(b []byte)
func DebugICMPv4Packet ¶
func DebugICMPv4Packet(b []byte)
func DebugIPv4Packet ¶
func DebugIPv4Packet(b []byte)
func DebugUDPMessage ¶
func DebugUDPMessage(b []byte)
func UnmarshalEtherPacket ¶
func UnmarshalEtherPacket(b []byte)
func UnmarshalICMPv4Packet ¶
func UnmarshalICMPv4Packet(b []byte)
func UnmarshalIPv4Packet ¶
func UnmarshalIPv4Packet(b []byte)
func UnmarshalUDPPacket ¶
func UnmarshalUDPPacket(b []byte)
Types ¶
type EtherHeader ¶
type EtherHeader struct { DstMacAddr net.HardwareAddr SrcMacAddr net.HardwareAddr ProtoType uint16 }
Click to show internal directories.
Click to hide internal directories.