package
0.0.0-20180524224622-583358ac5197
Repository: https://github.com/costinm/netstack.git
Documentation: pkg.go.dev

# Functions

AddTCPOptionPadding adds the required number of TCPOptionNOP to quad align the option buffer.
Checksum calculates the checksum (as defined in RFC 1071) of the bytes in the given byte array.
ChecksumCombine combines the two uint16 to form their checksum.
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.
IPVersion returns the version of IP used in the given packet.
IsV4MappedAddress determines if the provided address is an IPv4 mapped address by checking if its prefix is 0:0:0:0:0:ffff::/96.
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, ignoring the length field.

# Constants

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.
EthernetAddressSize is the size, in bytes, of an ethernet address.
EthernetMinimumSize is the minimum size of a valid ethernet frame.
GUEMinimumSize is the minimum size of a valid GUE packet.
Typical values of ICMPv4Type defined in RFC 792.
ICMPv4DstUnreachableMinimumSize is the minimum size of a valid ICMP destination unreachable packet.
Typical values of ICMPv4Type defined in RFC 792.
ICMPv4EchoMinimumSize is the minimum size of a valid ICMP echo packet.
Typical values of ICMPv4Type defined in RFC 792.
Values for ICMP code as defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
Typical values of ICMPv4Type defined in RFC 792.
ICMPv4MinimumSize is the minimum size of a valid ICMP packet.
Typical values of ICMPv4Type defined in RFC 792.
Values for ICMP code as defined in RFC 792.
ICMPv4ProtocolNumber is the ICMP transport protocol number.
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.
Typical values of ICMPv4Type defined in RFC 792.
Typical values of ICMPv6Type defined in RFC 4443.
ICMPv6DstUnreachableMinimumSize is the minimum size of a valid ICMP destination unreachable packet.
ICMPv6EchoMinimumSize is the minimum size of a valid ICMP echo packet.
Typical values of ICMPv6Type defined in RFC 4443.
Typical values of ICMPv6Type defined in RFC 4443.
ICMPv6MinimumSize is the minimum size of a valid ICMP packet.
Typical values of ICMPv6Type defined in RFC 4443.
ICMPv6NeighborAdvertSize is size of a neighbor advertisement.
Typical values of ICMPv6Type defined in RFC 4443.
ICMPv6NeighborSolicitMinimumSize is the minimum size of a neighbor solicitation packet.
Typical values of ICMPv6Type defined in RFC 4443.
ICMPv6PacketTooBigMinimumSize is the minimum size of a valid ICMP packet-too-big packet.
Typical values of ICMPv6Type defined in RFC 4443.
Values for ICMP code as defined in RFC 4443.
ICMPv6ProtocolNumber is the ICMP transport protocol number.
Typical values of ICMPv6Type defined in RFC 4443.
Typical values of ICMPv6Type defined in RFC 4443.
Typical values of ICMPv6Type defined in RFC 4443.
Typical values of ICMPv6Type defined in RFC 4443.
IPv4AddressSize is the size, in bytes, of an IPv4 address.
Flags that may be set in an IPv4 packet.
Flags that may be set in an IPv4 packet.
IPv4MaximumHeaderSize is the maximum size of an IPv4 header.
IPv4MinimumSize is the minimum size of a valid IPv4 packet.
IPv4ProtocolNumber is IPv4's network protocol number.
IPv4Version is the version of the ipv4 protocol.
IPv6AddressSize is the size, in bytes, of an IPv6 address.
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.
IPv6MinimumMTU is the minimum MTU required by IPv6, per RFC 2460, section 5.
IPv6MinimumSize is the minimum size of a valid IPv6 packet.
IPv6ProtocolNumber is IPv6's network protocol number.
IPv6Version is the version of the ipv6 protocol.
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.
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.
TCPMaxSACKBlocks is the maximum number of SACK blocks that can be encoded in a TCP option field.
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.
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.
Options that may be present in a TCP segment.
Options that may be present in a TCP segment.
TCPProtocolNumber is TCP's transport protocol number.
UDPMinimumSize is the minimum size of a valid UDP packet.
UDPProtocolNumber is UDP's transport protocol number.

# Structs

EthernetFields contains the fields of an ethernet frame header.
GUEFields contains the fields of a GUE packet.
IPv4Fields contains the fields of an IPv4 packet.
IPv6Fields contains the fields of an IPv6 packet.
IPv6FragmentFields contains the fields of an IPv6 fragment.
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.

# Interfaces

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.
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.
ICMPv4Type is the ICMP type field described in RFC 792.
ICMPv6 represents an ICMPv6 header stored in a byte array.
ICMPv6Type is the ICMP type field described in RFC 4443 and friends.
IPv4 represents an ipv4 header stored in a byte array.
IPv6 represents an ipv6 header stored in a byte array.
IPv6Fragment represents an ipv6 fragment header stored in a byte array.
TCP represents a TCP header stored in a byte array.
UDP represents a UDP header stored in a byte array.