package
0.9.0
Repository: https://github.com/noisysockets/netstack.git
Documentation: pkg.go.dev

# Packages

Package parse provides utilities to parse packets.

# Functions

Acceptable checks if a segment that starts at segSeq and has length segLen is "acceptable" for arriving in a receive window that starts at rcvNxt and ends before rcvAcc, according to the table on page 26 and 69 of RFC 793.
AddTCPOptionPadding adds the required number of TCPOptionNOP to quad align the option buffer.
AppendOpaqueInterfaceIdentifier appends a 64 bit opaque interface identifier (IID) to buf as outlined by RFC 7217 and returns the extended buffer.
DecisecondToDuration converts a value representing deci-seconds to a time.Duration.
EncodeMSSOption encodes the MSS TCP option with the provided MSS values in the supplied buffer.
EncodeNOP adds an explicit NOP to the option list.
EncodeSACKBlocks encodes the provided SACK blocks as a TCP SACK option block in the provided slice.
EncodeSACKPermittedOption encodes a SACKPermitted option into the provided buffer.
EncodeTSOption encodes the provided tsVal and tsEcr values as a TCP timestamp option into the provided buffer.
EncodeWSOption encodes the WS TCP option with the WS value in the provided buffer.
EthernetAdddressToModifiedEUI64IntoBuf populates buf with a modified EUI-64 from a 48-bit Ethernet/MAC address, as per RFC 4291 section 2.5.1.
EthernetAddressFromMulticastIPv4Address returns a multicast Ethernet address for a multicast IPv4 address.
EthernetAddressFromMulticastIPv6Address returns a multicast Ethernet address for a multicast IPv6 address.
EthernetAddressToModifiedEUI64 computes a modified EUI-64 from a 48-bit Ethernet/MAC address, as per RFC 4291 section 2.5.1.
GenerateTempIPv6SLAACAddr generates a temporary SLAAC IPv6 address for an associated stable/permanent SLAAC address.
ICMPv4Checksum calculates the ICMP checksum over the provided ICMP header, and payload.
ICMPv6Checksum calculates the ICMP checksum over the provided ICMPv6 header, IPv6 src/dst addresses and the payload.
IGMPCalculateChecksum calculates the IGMP checksum over the provided IGMP header.
IGMPv3MaximumResponseDelay returns the Maximum Response Delay in an IGMPv3 Maximum Response Code.
InitialTempIID generates the initial temporary IID history value to generate temporary SLAAC addresses with.
IPVersion returns the version of IP used in the given packet.
IsMulticastEthernetAddress returns true if the address is a multicast ethernet address.
IsSolicitedNodeAddr determines whether the address is a solicited-node multicast address.
IsV4LinkLocalMulticastAddress determines if the provided address is an IPv4 link-local multicast address.
IsV4LinkLocalUnicastAddress determines if the provided address is an IPv4 link-local unicast address.
IsV4LoopbackAddress determines if the provided address is an IPv4 loopback address (belongs to 127.0.0.0/8 subnet).
IsV4MappedAddress determines if the provided address is an IPv4 mapped address by checking if its prefix is 0:0:0:0:0:ffff::/96.
IsV4MulticastAddress determines if the provided address is an IPv4 multicast address (range 224.0.0.0 to 239.255.255.255).
IsV6LinkLocalMulticastAddress returns true iff the provided address is an IPv6 link-local multicast address, as defined by RFC 4291 section 2.7.
IsV6LinkLocalUnicastAddress returns true iff the provided address is an IPv6 link-local unicast address, as defined by RFC 4291 section 2.5.6.
IsV6LoopbackAddress returns true iff the provided address is an IPv6 loopback address, as defined by RFC 4291 section 2.5.3.
IsV6MulticastAddress determines if the provided address is an IPv6 multicast address (anything starting with FF).
IsV6UnicastAddress determines if the provided address is a valid IPv6 unicast (and specified) address.
IsValidUnicastEthernetAddress returns true if the address is a unicast ethernet address.
LinkLocalAddr computes the default IPv6 link-local address from a link-layer (MAC) address.
LinkLocalAddrWithOpaqueIID computes the default IPv6 link-local address with an opaque IID.
MakeAddressIterator returns an AddressIterator.
MakeIPv6PayloadIterator returns an iterator over the IPv6 payload containing extension headers, or a raw payload if the payload cannot be parsed.
MLDv2MaximumResponseDelay returns the Maximum Response Delay in an MLDv2 Maximum Response Code.
ParseSynOptions parses the options received in a SYN segment and returns the relevant ones.
ParseTCPOptions extracts and stores all known options in the provided byte slice in a TCPOptions structure.
PseudoHeaderChecksum calculates the pseudo-header checksum for the given destination protocol and network address.
ScopeForIPv6Address returns the scope for an IPv6 address.
SolicitedNodeAddr computes the solicited-node multicast address.
TCPValid returns true if the pkt has a valid TCP header.
UDPValid returns true if the pkt has a valid UDP header.
V6MulticastScope returns the scope of a multicast address.

# Constants

ARPHardwareEther specifically is the HTYPE for Ethernet as specified in the IANA list here: https://www.iana.org/assignments/arp-parameters/arp-parameters.xhtml#arp-parameters-2.
Typical ARP HardwareType values.
Typical ARP HardwareType values.
ARPProtocolNumber is the ARP network protocol number.
Typical ARP opcodes defined in RFC 826.
Typical ARP opcodes defined in RFC 826.
ARPSize is the size of an IPv4-over-Ethernet ARP packet.
65KB.
EthernetAddressSize is the size, in bytes, of an ethernet address.
EthernetBroadcastAddress is an ethernet address that addresses every node on a local link.
EthernetMaximumSize is the maximum size of a valid ethernet frame.
EthernetMinimumSize is the minimum size of a valid ethernet frame.
EthernetProtocolAll is a catch-all for all protocols carried inside an ethernet frame.
EthernetProtocolPUP is the PARC Universal Packet protocol ethertype.
GlobalScope indicates a global address.
GUEMinimumSize is the minimum size of a valid GUE packet.
HighRoutePreference indicates a high preference, as per RFC 4191 section 2.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
Typical values of ICMPv4Type defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
Typical values of ICMPv4Type defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
ICMPv4MinimumErrorPayloadSize Is the smallest number of bytes of an errant packet's transport layer that an ICMP error type packet should attempt to send as per RFC 792 (see each type) and RFC 1122 section 3.2.2 which states: Every ICMP error message includes the Internet header and at least the first 8 data octets of the datagram that triggered the error; more than 8 octets MAY be sent; this header and data MUST be unchanged from the received datagram.
ICMPv4MinimumSize is the minimum size of a valid ICMP packet.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
Typical values of ICMPv4Type defined in RFC 792.
ICMPv4PayloadOffset defines the start of ICMP payload.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMPv4ProtocolNumber is the ICMP transport protocol number.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Time Exceeded messages as defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
ICMP codes for ICMPv4 Destination Unreachable messages as defined in RFC 792, RFC 1122 section 3.2.2.1 and RFC 1812 section 5.2.7.1.
Typical values of ICMPv4Type defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
ICMP codes for ICMPv4 Time Exceeded messages as defined in RFC 792.
ICMPv4UnusedCode is a code to use in ICMP messages where no code is needed.
ICMP codes used with Destination Unreachable (Type 1).
ICMP codes used with Destination Unreachable (Type 1).
ICMPv6ChecksumOffset is the offset of the checksum field in an ICMPv6 message.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
ICMPv6DstUnreachableMinimumSize is the minimum size of a valid ICMP destination unreachable packet.
ICMPv6EchoMinimumSize is the minimum size of a valid echo packet.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
ICMPv6ErroneousHeader indicates an erroneous header field was encountered.
ICMPv6ErrorHeaderSize is the size of an ICMP error packet header, as per RFC 4443, Appendix A, item 4 and the errata.
ICMPv6HeaderSize is the size of the ICMPv6 header.
ICMP codes used with Time Exceeded (Type 3).
ICMPv6MinimumSize is the minimum size of a valid ICMP packet.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
ICMPv6NeighborAdvertMinimumSize is the minimum size of a neighbor advertisement packet.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
ICMPv6NeighborSolicitMinimumSize is the minimum size of a neighbor solicitation packet.
ICMP codes used with Destination Unreachable (Type 1).
Values for use in the Type field of ICMPv6 packet from RFC 4433.
ICMPv6PacketTooBigMinimumSize is the minimum size of a valid ICMP packet-too-big packet.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
ICMPv6PayloadOffset is the offset of the payload in an ICMP packet.
ICMP codes used with Destination Unreachable (Type 1).
ICMP codes used with Destination Unreachable (Type 1).
ICMP codes used with Destination Unreachable (Type 1).
ICMPv6ProtocolNumber is the ICMP transport protocol number.
ICMP codes used with Time Exceeded (Type 3).
Values for use in the Type field of ICMPv6 packet from RFC 4433.
ICMP codes used with Destination Unreachable (Type 1).
Values for use in the Type field of ICMPv6 packet from RFC 4433.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
Values for use in the Type field of ICMPv6 packet from RFC 4433.
ICMPv6UnknownHeader indicates an unrecognized Next Header type encountered.
ICMPv6UnknownOption indicates an unrecognized IPv6 option was encountered.
ICMPv6UnusedCode is the code value used with ICMPv6 messages which don't use the code field.
IGMPLeaveGroup indicates that the message type is a Leave Group notification message.
IGMPLeaveMessageMinimumSize is the minimum size of a valid Leave Message in bytes, as per RFC 2236, Section 2, Page 2.
IGMPMembershipQuery indicates that the message type is Membership Query.
IGMPMinimumSize is the minimum size of a valid IGMP packet in bytes, as per RFC 2236, Section 2, Page 2.
IGMPProtocolNumber is IGMP's transport protocol number.
IGMPQueryMinimumSize is the minimum size of a valid Membership Query Message in bytes, as per RFC 2236, Section 2, Page 2.
IGMPReportMinimumSize is the minimum size of a valid Report Message in bytes, as per RFC 2236, Section 2, Page 2.
IGMPTTL is the TTL for all IGMP messages, as per RFC 2236, Section 3, Page 3.
IGMPv1MembershipReport indicates that the message is a Membership Report generated by a host using the IGMPv1 protocol: "an additional type of message, for backwards-compatibility with IGMPv1".
IGMPv2MembershipReport indicates that the Message type is a Membership Report generated by a host using the IGMPv2 protocol.
IGMPv3MembershipReport indicates that the message type is a IGMPv3 report.
IGMPv3QueryMinimumSize is the mimum size of a valid IGMPv3 query, as per RFC 3376 section 4.1.
IGMPv3ReportGroupAddressRecordIteratorNextDone indicates that the iterator has been exhausted.
IGMPv3ReportGroupAddressRecordIteratorNextErrBufferTooShort indicates that the iterator expected another record, but the buffer ended prematurely.
IGMPv3ReportGroupAddressRecordIteratorNextOk indicates that a multicast address record was yielded.
IGMPv3 multicast address record types, as per RFC 3810 section 5.2.12.
IGMPv3 multicast address record types, as per RFC 3810 section 5.2.12.
IGMPv3 multicast address record types, as per RFC 3810 section 5.2.12.
IGMPv3 multicast address record types, as per RFC 3810 section 5.2.12.
IGMPv3 multicast address record types, as per RFC 3810 section 5.2.12.
IGMPv3 multicast address record types, as per RFC 3810 section 5.2.12.
IIDOffsetInIPv6Address is the offset, in bytes, from the start of an IPv6 address to the beginning of the interface identifier (IID) for auto-generated addresses.
IIDSize is the size of an interface identifier (IID), in bytes, as defined by RFC 4291 section 2.5.1.
IPv4AddressSize is the size, in bytes, of an IPv4 address.
IPv4AddressSizeBits is the size, in bits, of an IPv4 address.
Flags that may be set in an IPv4 packet.
Flags that may be set in an IPv4 packet.
RFC 791 page 11 shows the header length (IHL) is in the lower 4 bits of the first byte, and is counted in multiples of 4 bytes.
IPv4MaximumHeaderSize is the maximum size of an IPv4 header.
IPv4MaximumOptionsSize is the largest size the IPv4 options can be.
IPv4MaximumPayloadSize is the maximum size of a valid IPv4 payload.
IPv4MinimumMTU is the minimum MTU required by IPv4, per RFC 791, section 3.2: Every internet module must be able to forward a datagram of 68 octets without further fragmentation.
IPv4MinimumProcessableDatagramSize is the minimum size of an IP packet that every IPv4 capable host must be able to process/reassemble.
IPv4MinimumSize is the minimum size of a valid IPv4 packet; i.e.
IPv4OptionLengthOffset is the offset in an option of its length field.
IPv4OptionListEndType is the option type for the End Of Option List option.
IPv4OptionNOPType is the No-Operation option.
IPv4OptionRecordRouteHdrLength is the length of the Record Route option header.
IPv4OptionRecordRouteType is used by each router on the path of the packet to record its path.
IPv4OptionRouterAlertLength is the length of a Router Alert option.
IPv4OptionRouterAlertType is the option type for the Router Alert option, defined in RFC 2113 Section 2.1.
IPv4OptionRouterAlertValue is the only permissible value of the 16 bit payload of the router alert option.
IPv4OptionRouterAlertValueOffset is the offset for the value of a RouterAlert option.
IPv4OptionTimestampHdrLength is the length of the timestamp option header.
IPv4OptionTimestampMaxSize is limited by space for options.
IPv4OptionTimestampOnlyFlag is a flag indicating that only timestamp is present.
IPv4OptionTimestampSize is the size of an IP timestamp.
IPv4OptionTimestampType is the option type for the Timestamp option.
IPv4OptionTimestampWithAddrSize is the size of an IP timestamp + Address.
IPv4OptionTimestampWithIPFlag is a flag indicating that both timestamps and IP are present.
IPv4OptionTimestampWithPredefinedIPFlag is a flag indicating that predefined IP is present.
IPv4OptRRPointerOffset is the offset to the pointer field in an RR option, which points to the next free slot in the list of addresses.
IPv4OptTSPointerOffset is the offset of the combined Flag and Overflow fields, (each being 4 bits).
IPv4OptTSPointerOffset is the offset of the Timestamp pointer field.
IPv4ProtocolNumber is IPv4's network protocol number.
IPv4TotalLenOffset is the offset of the total length field in the IPv4 header.
IPv4Version is the version of the IPv4 protocol.
IPv6AddressSize is the size, in bytes, of an IPv6 address.
IPv6AddressSizeBits is the size, in bits, of an IPv6 address.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
IPv6DestinationOptionsExtHdrIdentifier is the header identifier of a Destination Options extension header, as per RFC 8200 section 4.6.
IPv6FixedHeaderSize is the size of the fixed header.
IPv6FragmentExtHdrFragmentOffsetBytesPerUnit is the unit size of a Fragment extension header's Fragment Offset field.
IPv6FragmentExtHdrIdentifier is the header identifier of a Fragment extension header, as per RFC 8200 section 4.5.
IPv6FragmentExtHdrLength is the length of an IPv6 extension header, in bytes.
IPv6FragmentHeader header is the number used to specify that the next header is a fragment header, per RFC 2460.
IPv6FragmentHeaderSize is the size of the fragment header.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
IPv6HopByHopOptionsExtHdrIdentifier is the header identifier of a Hop by Hop Options extension header, as per RFC 8200 section 4.3.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
IPv6MaximumPayloadSize is the maximum size of a valid IPv6 payload per RFC 8200 Section 4.5.
IPv6MinimumMTU is the minimum MTU required by IPv6, per RFC 8200, section 5: IPv6 requires that every link in the Internet have an MTU of 1280 octets or greater.
IPv6MinimumSize is the minimum size of a valid IPv6 packet.
IPv6NextHeaderOffset is the offset of the NextHeader field in IPv6 header.
IPv6NoNextHeaderIdentifier is the header identifier used to signify the end of an IPv6 payload, as per RFC 8200 section 4.7.
IPv6OptionUnknownActionDiscard indicates that the packet must be silently discarded.
IPv6OptionUnknownActionDiscardSendICMP indicates that the packet must be discarded and the node must send an ICMP Parameter Problem, Code 2, message to the packet's source, regardless of whether or not the packet's Destination was a multicast address.
IPv6OptionUnknownActionDiscardSendICMPNoMulticastDest indicates that the packet must be discarded and the node must send an ICMP Parameter Problem, Code 2, message to the packet's source only if the packet's Destination was not a multicast address.
IPv6OptionUnknownActionSkip indicates that the unrecognized option must be skipped and the node should continue processing the header.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
IPv6PayloadLenOffset is the offset of the PayloadLength field in IPv6 header.
IPv6ProtocolNumber is IPv6's network protocol number.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
IPv6RouterAlertActiveNetworks indicates a datagram containing an Active Networks message as defined in RFC 2711 section 2.1.
IPv6RouterAlertMLD indicates a datagram containing a Multicast Listener Discovery message as defined in RFC 2711 section 2.1.
IPv6RouterAlertRSVP indicates a datagram containing an RSVP message as defined in RFC 2711 section 2.1.
IPv6RoutingExtHdrIdentifier is the header identifier of a Routing extension header, as per RFC 8200 section 4.4.
The various values for IPv6 multicast scopes, as per RFC 7346 section 2: +------+--------------------------+-------------------------+ | scop | NAME | REFERENCE | +------+--------------------------+-------------------------+ | 0 | Reserved | [RFC4291], RFC 7346 | | 1 | Interface-Local scope | [RFC4291], RFC 7346 | | 2 | Link-Local scope | [RFC4291], RFC 7346 | | 3 | Realm-Local scope | [RFC4291], RFC 7346 | | 4 | Admin-Local scope | [RFC4291], RFC 7346 | | 5 | Site-Local scope | [RFC4291], RFC 7346 | | 6 | Unassigned | | | 7 | Unassigned | | | 8 | Organization-Local scope | [RFC4291], RFC 7346 | | 9 | Unassigned | | | A | Unassigned | | | B | Unassigned | | | C | Unassigned | | | D | Unassigned | | | E | Global scope | [RFC4291], RFC 7346 | | F | Reserved | [RFC4291], RFC 7346 | +------+--------------------------+-------------------------+.
IPv6UnknownExtHdrIdentifier is reserved by IANA.
IPv6Version is the version of the ipv6 protocol.
LinkLocalScope indicates a link-local address.
LowRoutePreference indicates a low preference, as per RFC 4191 section 2.1.
MaxIPPacketSize is the maximum supported IP packet size, excluding jumbograms.
MaxWndScale is maximum allowed window scaling, as described in RFC 1323, section 2.3, page 11.
MediumRoutePreference indicates a medium preference, as per RFC 4191 section 2.1.
MinIPFragmentPayloadSize is the minimum number of payload bytes that the first fragment must carry when an IPv4 packet is fragmented.
MLDHopLimit is the Hop Limit for all IPv6 packets with an MLD message, as per RFC 2710 section 3.
MLDMinimumSize is the minimum size for an MLD message.
MLDv2QueryMinimumSize is the minimum size for an MLDv2 message.
MLDv2ReportMinimumSize is the minimum size of an MLDv2 report.
MLDv2ReportMulticastAddressRecordIteratorNextDone indicates that the iterator has been exhausted.
MLDv2ReportMulticastAddressRecordIteratorNextErrBufferTooShort indicates that the iterator expected another record, but the buffer ended prematurely.
MLDv2ReportMulticastAddressRecordIteratorNextOk indicates that a multicast address record was yielded.
MLDv2 multicast address record types, as per RFC 3810 section 5.2.12.
MLDv2 multicast address record types, as per RFC 3810 section 5.2.12.
MLDv2 multicast address record types, as per RFC 3810 section 5.2.12.
MLDv2 multicast address record types, as per RFC 3810 section 5.2.12.
MLDv2 multicast address record types, as per RFC 3810 section 5.2.12.
MLDv2 multicast address record types, as per RFC 3810 section 5.2.12.
NDPHopLimit is the expected IP hop limit value of 255 for received NDP packets, as per RFC 4861 sections 4.1 - 4.5, 6.1.1, 6.1.2, 7.1.1, 7.1.2 and 8.1.
NDPInfiniteLifetime is a value that represents infinity for the 4-byte lifetime fields found in various NDP options.
NDPLinkLayerAddressSize is the size of a Source or Target Link Layer Address option for an Ethernet address.
NDPNAMinimumSize is the minimum size of a valid NDP Neighbor Advertisement message (body of an ICMPv6 packet).
NDPNSMinimumSize is the minimum size of a valid NDP Neighbor Solicitation message (body of an ICMPv6 packet).
NDPRAMinimumSize is the minimum size of a valid NDP Router Advertisement message (body of an ICMPv6 packet).
NDPRSMinimumSize is the minimum size of a valid NDP Router Solicitation message (body of an ICMPv6 packet).
OpaqueIIDSecretKeyMinBytes is the recommended minimum number of bytes for the secret key used to generate an opaque interface identifier as outlined by RFC 7217.
ReservedRoutePreference is a reserved preference value, as per RFC 4191 section 2.1.
These constants are the offsets of the respective fields in the TCP header.
These constants are the offsets of the respective fields in the TCP header.
These constants are the offsets of the respective fields in the TCP header.
TCPDefaultMSS is the MSS value that should be used if an MSS option is not received from the peer.
These constants are the offsets of the respective fields in the TCP header.
Flags that may be set in a TCP segment.
Flags that may be set in a TCP segment.
Flags that may be set in a TCP segment.
Flags that may be set in a TCP segment.
Flags that may be set in a TCP segment.
Flags that may be set in a TCP segment.
These constants are the offsets of the respective fields in the TCP header.
Flags that may be set in a TCP segment.
Flags that may be set in a TCP segment.
TCPHeaderMaximumSize is the maximum header size of a TCP packet.
TCPMaximumMSS is the maximum acceptable value for MSS.
TCPMaxSACKBlocks is the maximum number of SACK blocks that can be encoded in a TCP option field.
TCPMinimumMSS is the minimum acceptable value for MSS.
TCPMinimumSendMSS is the minimum value for MSS in a sender.
TCPMinimumSize is the minimum size of a valid TCP packet.
Options that may be present in a TCP segment.
Options that may be present in a TCP segment.
Option Lengths.
Options that may be present in a TCP segment.
Options that may be present in a TCP segment.
Options that may be present in a TCP segment.
Option Lengths.
TCPOptionsMaximumSize is the maximum size of TCP options.
Options that may be present in a TCP segment.
Option Lengths.
Options that may be present in a TCP segment.
Option Lengths.
TCPProtocolNumber is TCP's transport protocol number.
These constants are the offsets of the respective fields in the TCP header.
These constants are the offsets of the respective fields in the TCP header.
TCPTotalHeaderMaximumSize is the maximum size of headers from all layers in a TCP packet.
These constants are the offsets of the respective fields in the TCP header.
These constants are the offsets of the respective fields in the TCP header.
UDPMaximumPacketSize is the largest possible UDP packet.
UDPMaximumSize is the maximum size of a valid UDP packet.
UDPMinimumSize is the minimum size of a valid UDP packet.
UDPProtocolNumber is UDP's transport protocol number.
UnspecifiedEthernetAddress is the unspecified ethernet address (all bits set to 0).
VirtioNetHeaderSize is the size of VirtioNetHeader in bytes.

# Variables

ErrMalformedIPv6ExtHdrOption indicates that an IPv6 extension header option is malformed.
Potential errors when iterating over an NDPOptions.
Potential errors when iterating over an NDPOptions.
Ethertypes holds the protocol numbers describing the payload of an ethernet frame.
IGMPv3RoutersAddress is the address to send IGMPv3 reports to.
IPv4AllRoutersGroup is a multicast address for all routers.
IPv4AllSystems is the all systems IPv4 multicast address as per IANA's IPv4 Multicast Address Space Registry.
IPv4Any is the non-routable IPv4 "any" meta address.
IPv4Broadcast is the broadcast address of the IPv4 procotol.
IPv4CurrentNetworkSubnet is the subnet of addresses for the current network, per RFC 6890 section 2.2.2, +----------------------+----------------------------+ | Attribute | Value | +----------------------+----------------------------+ | Address Block | 0.0.0.0/8 | | Name | "This host on this network"| | RFC | [RFC1122], Section 3.2.1.3 | | Allocation Date | September 1981 | | Termination Date | N/A | | Source | True | | Destination | False | | Forwardable | False | | Global | False | | Reserved-by-Protocol | True | +----------------------+----------------------------+.
IPv4EmptySubnet is the empty IPv4 subnet.
IPv4Loopback is the loopback IPv4 address.
IPv4LoopbackSubnet is the loopback subnet for IPv4.
IPv4MappedIPv6Subnet is the prefix for an IPv4 mapped IPv6 address as defined by RFC 4291 section 2.5.5.
IPv6AllNodesMulticastAddress is a link-local multicast group that all IPv6 nodes MUST join, as per RFC 4291, section 2.8.
IPv6AllRoutersInterfaceLocalMulticastAddress is an interface-local multicast group that all IPv6 routers MUST join, as per RFC 4291, section 2.8.
IPv6AllRoutersLinkLocalMulticastAddress is a link-local multicast group that all IPv6 routers MUST join, as per RFC 4291, section 2.8.
IPv6AllRoutersSiteLocalMulticastAddress is a site-local multicast group that all IPv6 routers MUST join, as per RFC 4291, section 2.8.
IPv6Any is the non-routable IPv6 "any" meta address.
IPv6EmptySubnet is the empty IPv6 subnet.
IPv6LinkLocalPrefix is the prefix for IPv6 link-local addresses, as defined by RFC 4291 section 2.5.6.
IPv6Loopback is the IPv6 Loopback address.
MLDv2RoutersAddress is the address to send MLDv2 reports to.

# Structs

AddressIterator is an iterator over IPv6 addresses.
EthernetFields contains the fields of an ethernet frame header.
GUEFields contains the fields of a GUE packet.
ICMPv6ChecksumParams contains parameters to calculate ICMPv6 checksum.
IGMPv3ReportGroupAddressRecordIterator is an iterator over IGMPv3 Multicast Address Records.
IGMPv3ReportGroupAddressRecordSerializer is an IGMPv3 Multicast Address Record serializer.
IGMPv3ReportSerializer is an MLD Version 2 Report serializer.
IPv4Fields contains the fields of an IPv4 packet.
IPv4OptionIterator is an iterator pointing to a specific IP option at any point of time.
IPv4OptParameterProblem indicates that a Parameter Problem message should be generated, and gives the offset in the current entity that should be used in that packet.
IPv4SerializableListEndOption provides serialization for the IPv4 List End option.
IPv4SerializableNOPOption provides serialization for the IPv4 no-op option.
IPv4SerializableRouterAlertOption provides serialization of the Router Alert IPv4 option according to RFC 2113.
IPv6DestinationOptionsExtHdr is a buffer holding the Destination Options extension header.
IPv6Fields contains the fields of an IPv6 packet.
IPv6HopByHopOptionsExtHdr is a buffer holding the Hop By Hop Options extension header.
IPv6OptionsExtHdrOptionsIterator is an iterator over IPv6 extension header options.
IPv6PayloadIterator is an iterator over the contents of an IPv6 payload.
IPv6RawPayloadHeader the remainder of an IPv6 payload after an iterator encounters a Next Header field it does not recognize as an IPv6 extension header.
IPv6RouterAlertOption is the IPv6 Router alert Hop by Hop option defined in RFC 2711 section 2.1.
IPv6RoutingExtHdr is a buffer holding the Routing extension header specific data as outlined in RFC 8200 section 4.4.
IPv6SerializableFragmentExtHdr is used to serialize an IPv6 fragment extension header as defined in RFC 8200 section 4.5.
IPv6UnknownExtHdrOption holds the identifier and data for an IPv6 extension header option that is unknown by the parsing utilities.
MLDv2ReportMulticastAddressRecordIterator is an iterator over MLDv2 Multicast Address Records.
MLDv2ReportMulticastAddressRecordSerializer is an MLDv2 Multicast Address Record serializer.
MLDv2ReportSerializer is an MLD Version 2 Report serializer.
NDPOptionIterator is an iterator of NDPOption.
SACKBlock represents a single contiguous SACK block.
TCPFields contains the fields of a TCP packet.
TCPOptions are used to parse and cache the TCP segment options for a non syn/syn-ack segment.
TCPSynOptions is used to return the parsed TCP Options in a syn segment.
UDPFields contains the fields of a UDP packet.
VirtioNetHeaderFields is the Go equivalent of the struct declared in linux/virtio_net.h.

# Interfaces

ChecksummableNetwork is a Network that supports checksumming.
ChecksummableTransport is a Transport that supports checksumming.
IPv4Option is an interface representing various option types.
IPv4SerializableOption is an interface to represent serializable IPv4 option types.
IPv4SerializableOptionPayload is an interface providing serialization of the payload of an IPv4 option.
IPv6ExtHdrOption is implemented by the various IPv6 extension header options.
IPv6PayloadHeader is implemented by the various headers that can be found in an IPv6 payload.
IPv6SerializableExtHdr provides serialization for IPv6 extension headers.
IPv6SerializableHopByHopOption provides serialization for hop by hop options.
NDPOption is the set of functions to be implemented by all NDP option types.
Network offers generic methods to query and/or update the fields of the header of a network protocol buffer.
Transport offers generic methods to query and/or update the fields of the header of a transport protocol buffer.

# Type aliases

ARP is an ARP packet stored in a byte array as described in RFC 826.
ARPHardwareType is the hardware type for LinkEndpoint in an ARP header.
ARPOp is an ARP opcode.
Ethernet represents an ethernet frame header stored in a byte array.
GUE represents a Generic UDP Encapsulation header stored in a byte array, the fields are described in https://tools.ietf.org/html/draft-ietf-nvo3-gue-01.
ICMPv4 represents an ICMPv4 header stored in a byte array.
ICMPv4Code is the ICMP code field described in RFC 792.
ICMPv4Type is the ICMP type field described in RFC 792.
ICMPv6 represents an ICMPv6 header stored in a byte array.
ICMPv6Code is the ICMP Code field described in RFC 4443.
ICMPv6Type is the ICMP type field described in RFC 4443.
IGMP represents an IGMP header stored in a byte array.
IGMPType is the IGMP type field as per RFC 2236.
IGMPv3Query is an IGMPv3 query message.
IGMPv3Report is an IGMPv3 Report.
IGMPv3ReportGroupAddressRecord is an IGMPv3 record.
IGMPv3ReportGroupAddressRecordIteratorNextDisposition is the possible return values from IGMPv3ReportGroupAddressRecordIterator.Next.
IGMPv3ReportRecordType is the type of an IGMPv3 multicast address record found in an IGMPv3 report, as per RFC 3810 section 5.2.12.
IPv4 is an IPv4 header.
IPv4OptionGeneric is an IPv4 Option of unknown type.
IPv4OptionRecordRoute is an IPv4 RecordRoute option defined by RFC 791.
IPv4OptionRouterAlert is an IPv4 RouterAlert option defined by RFC 2113.
IPv4Options is a buffer that holds all the raw IP options.
IPv4OptionsSerializer is a serializer for IPv4 options.
IPv4OptionTimestamp is a Timestamp option from RFC 791.
An IPv4OptionType can hold the value for the Type in an IPv4 option.
IPv4OptTSFlags sefines the values expected in the Timestamp option Flags field.
IPv6 represents an ipv6 header stored in a byte array.
IPv6AddressScope is the scope of an IPv6 address.
IPv6ExtensionHeaderIdentifier is an IPv6 extension header identifier.
IPv6ExtHdrOptionIdentifier is an IPv6 extension header option identifier.
IPv6ExtHdrSerializer provides serialization of IPv6 extension headers.
IPv6Fragment represents an ipv6 fragment header stored in a byte array.
IPv6FragmentExtHdr is a buffer holding the Fragment extension header specific data as outlined in RFC 8200 section 4.5.
IPv6MulticastScope is the scope of a multicast IPv6 address, as defined by RFC 7346 section 2.
IPv6OptionUnknownAction is the action that must be taken if the processing IPv6 node does not recognize the option, as outlined in RFC 8200 section 4.2.
IPv6RouterAlertValue is the payload of an IPv6 Router Alert option.
IPv6SerializableHopByHopExtHdr implements serialization of the Hop by Hop options extension header.
MLD is a Multicast Listener Discovery message in an ICMPv6 packet.
MLDv2Query is a Multicast Listener Discovery Version 2 Query message in an ICMPv6 packet.
MLDv2Report is an MLDv2 Report.
MLDv2ReportMulticastAddressRecord is an MLDv2 record.
MLDv2ReportMulticastAddressRecordIteratorNextDisposition is the possible return values from MLDv2ReportMulticastAddressRecordIterator.Next.
MLDv2ReportRecordType is the type of an MLDv2 multicast address record found in an MLDv2 report, as per RFC 3810 section 5.2.12.
NDPDNSSearchList is the NDP DNS Search List option, as defined by RFC 8106 section 5.2.
NDPNeighborAdvert is an NDP Neighbor Advertisement message.
NDPNeighborSolicit is an NDP Neighbor Solicitation message.
NDPNonceOption is the NDP Nonce Option as defined by RFC 3971 section 5.3.2.
NDPOptions is a buffer of NDP options as defined by RFC 4861 section 4.6.
NDPOptionsSerializer is a serializer for NDP options.
NDPPrefixInformation is the NDP Prefix Information option as defined by RFC 4861 section 4.6.2.
NDPRecursiveDNSServer is the NDP Recursive DNS Server option, as defined by RFC 8106 section 5.1.
NDPRouteInformation is the NDP Router Information option, as defined by RFC 4191 section 2.3.
NDPRoutePreference is the preference values for default routers or more-specific routes.
NDPRouterAdvert is an NDP Router Advertisement message.
NDPRouterSolicit is an NDP Router Solicitation message.
NDPSourceLinkLayerAddressOption is the NDP Source Link Layer Option as defined by RFC 4861 section 4.6.1.
NDPTargetLinkLayerAddressOption is the NDP Target Link Layer Option as defined by RFC 4861 section 4.6.1.
TCP represents a TCP header stored in a byte array.
TCPFlags is the dedicated type for TCP flags.
UDP represents a UDP header stored in a byte array.
VirtioNetHeader represents a virtio net header stored in a byte array.