Versions in this module Expand all Collapse all v1 v1.11.0 Nov 21, 2023 v1.2.0 Nov 21, 2023 v0 v0.0.5 Nov 24, 2023 Changes in this version + const ARPProtocolNumber + const ARPSize + const EthernetAddressSize + const EthernetMinimumSize + const EthernetProtocolAll + const EthernetProtocolPUP + const GUEMinimumSize + const ICMPv4FragmentationNeeded + const ICMPv4MinimumSize + const ICMPv4PayloadOffset + const ICMPv4PortUnreachable + const ICMPv4ProtocolNumber + const ICMPv6DstUnreachableMinimumSize + const ICMPv6EchoMinimumSize + const ICMPv6HeaderSize + const ICMPv6MinimumSize + const ICMPv6NeighborAdvertMinimumSize + const ICMPv6NeighborAdvertSize + const ICMPv6NeighborSolicitMinimumSize + const ICMPv6PacketTooBigMinimumSize + const ICMPv6PayloadOffset + const ICMPv6PortUnreachable + const ICMPv6ProtocolNumber + const IPv4AddressSize + const IPv4Any + const IPv4Broadcast + const IPv4FlagDontFragment + const IPv4FlagMoreFragments + const IPv4MaximumHeaderSize + const IPv4MinimumProcessableDatagramSize + const IPv4MinimumSize + const IPv4ProtocolNumber + const IPv4TotalLenOffset + const IPv4Version + const IPv6AddressSize + const IPv6AllNodesMulticastAddress + const IPv6Any + const IPv6FragmentHeader + const IPv6FragmentHeaderSize + const IPv6MinimumMTU + const IPv6MinimumSize + const IPv6PayloadLenOffset + const IPv6ProtocolNumber + const IPv6Version + const MaxIPPacketSize + const MaxWndScale + const MinIPFragmentPayloadSize + const NDPHopLimit + const NDPNAMinimumSize + const NDPNSMinimumSize + const NDPPrefixInformationType + const NDPRAMinimumSize + const NDPTargetLinkLayerAddressOptionType + const TCPAckNumOffset + const TCPChecksumOffset + const TCPDataOffset + const TCPDefaultMSS + const TCPDstPortOffset + const TCPFlagAck + const TCPFlagFin + const TCPFlagPsh + const TCPFlagRst + const TCPFlagSyn + const TCPFlagUrg + const TCPFlagsOffset + const TCPHeaderMaximumSize + const TCPMaxSACKBlocks + const TCPMaximumMSS + const TCPMinimumMSS + const TCPMinimumSize + const TCPOptionEOL + const TCPOptionMSS + const TCPOptionNOP + const TCPOptionSACK + const TCPOptionSACKPermitted + const TCPOptionTS + const TCPOptionWS + const TCPOptionsMaximumSize + const TCPProtocolNumber + const TCPSeqNumOffset + const TCPSrcPortOffset + const TCPUrgentPtrOffset + const TCPWinSizeOffset + const UDPMaximumPacketSize + const UDPMinimumSize + const UDPProtocolNumber + var ErrNDPOptBufExhausted = errors.New("Buffer unexpectedly exhausted") + var ErrNDPOptMalformedBody = errors.New("NDP option has a malformed body") + var ErrNDPOptZeroLength = errors.New("NDP option has zero-valued Length field") + var Ethertypes = []tcpip.NetworkProtocolNumber + var IPv4EmptySubnet = func() tcpip.Subnet { ... }() + var IPv6EmptySubnet = func() tcpip.Subnet { ... }() + var IPv6LinkLocalPrefix = tcpip.AddressWithPrefix + var NDPPrefixInformationInfiniteLifetime = time.Second * 4294967295 + func AddTCPOptionPadding(options []byte, offset int) int + func Checksum(buf []byte, initial uint16) uint16 + func ChecksumCombine(a, b uint16) uint16 + func ChecksumVV(vv buffer.VectorisedView, initial uint16) uint16 + func ChecksumVVWithOffset(vv buffer.VectorisedView, initial uint16, off int, size int) uint16 + func EncodeMSSOption(mss uint32, b []byte) int + func EncodeNOP(b []byte) int + func EncodeSACKBlocks(sackBlocks []SACKBlock, b []byte) int + func EncodeSACKPermittedOption(b []byte) int + func EncodeTSOption(tsVal, tsEcr uint32, b []byte) int + func EncodeWSOption(ws int, b []byte) int + func ICMPv4Checksum(h ICMPv4, vv buffer.VectorisedView) uint16 + func ICMPv6Checksum(h ICMPv6, src, dst tcpip.Address, vv buffer.VectorisedView) uint16 + func IPVersion(b []byte) int + func IsV4MappedAddress(addr tcpip.Address) bool + func IsV4MulticastAddress(addr tcpip.Address) bool + func IsV6LinkLocalAddress(addr tcpip.Address) bool + func IsV6MulticastAddress(addr tcpip.Address) bool + func IsV6UnicastAddress(addr tcpip.Address) bool + func IsValidUnicastEthernetAddress(addr tcpip.LinkAddress) bool + func LinkLocalAddr(linkAddr tcpip.LinkAddress) tcpip.Address + func PseudoHeaderChecksum(protocol tcpip.TransportProtocolNumber, srcAddr tcpip.Address, ...) uint16 + func SolicitedNodeAddr(addr tcpip.Address) tcpip.Address + type ARP []byte + func (a ARP) HardwareAddressSender() []byte + func (a ARP) HardwareAddressTarget() []byte + func (a ARP) IsValid() bool + func (a ARP) Op() ARPOp + func (a ARP) ProtocolAddressSender() []byte + func (a ARP) ProtocolAddressTarget() []byte + func (a ARP) SetIPv4OverEthernet() + func (a ARP) SetOp(op ARPOp) + type ARPOp uint16 + const ARPReply + const ARPRequest + type Ethernet []byte + func (b Ethernet) DestinationAddress() tcpip.LinkAddress + func (b Ethernet) Encode(e *EthernetFields) + func (b Ethernet) SourceAddress() tcpip.LinkAddress + func (b Ethernet) Type() tcpip.NetworkProtocolNumber + type EthernetFields struct + DstAddr tcpip.LinkAddress + SrcAddr tcpip.LinkAddress + Type tcpip.NetworkProtocolNumber + type GUE []byte + func (b GUE) Encode(i *GUEFields) + func (b GUE) HeaderLength() uint8 + func (b GUE) Protocol() uint8 + func (b GUE) TypeAndControl() uint8 + type GUEFields struct + Control bool + HeaderLength uint8 + Protocol uint8 + Type uint8 + type ICMPv4 []byte + func (ICMPv4) DestinationPort() uint16 + func (ICMPv4) SetDestinationPort(uint16) + func (ICMPv4) SetSourcePort(uint16) + func (ICMPv4) SourcePort() uint16 + func (b ICMPv4) Checksum() uint16 + func (b ICMPv4) Code() byte + func (b ICMPv4) Ident() uint16 + func (b ICMPv4) MTU() uint16 + func (b ICMPv4) Payload() []byte + func (b ICMPv4) Sequence() uint16 + func (b ICMPv4) SetChecksum(checksum uint16) + func (b ICMPv4) SetCode(c byte) + func (b ICMPv4) SetIdent(ident uint16) + func (b ICMPv4) SetMTU(mtu uint16) + func (b ICMPv4) SetSequence(sequence uint16) + func (b ICMPv4) SetType(t ICMPv4Type) + func (b ICMPv4) Type() ICMPv4Type + type ICMPv4Type byte + const ICMPv4DstUnreachable + const ICMPv4Echo + const ICMPv4EchoReply + const ICMPv4InfoReply + const ICMPv4InfoRequest + const ICMPv4ParamProblem + const ICMPv4Redirect + const ICMPv4SrcQuench + const ICMPv4TimeExceeded + const ICMPv4Timestamp + const ICMPv4TimestampReply + type ICMPv6 []byte + func (ICMPv6) DestinationPort() uint16 + func (ICMPv6) SetDestinationPort(uint16) + func (ICMPv6) SetSourcePort(uint16) + func (ICMPv6) SourcePort() uint16 + func (b ICMPv6) Checksum() uint16 + func (b ICMPv6) Code() byte + func (b ICMPv6) Ident() uint16 + func (b ICMPv6) MTU() uint32 + func (b ICMPv6) NDPPayload() []byte + func (b ICMPv6) Payload() []byte + func (b ICMPv6) Sequence() uint16 + func (b ICMPv6) SetChecksum(checksum uint16) + func (b ICMPv6) SetCode(c byte) + func (b ICMPv6) SetIdent(ident uint16) + func (b ICMPv6) SetMTU(mtu uint32) + func (b ICMPv6) SetSequence(sequence uint16) + func (b ICMPv6) SetType(t ICMPv6Type) + func (b ICMPv6) Type() ICMPv6Type + type ICMPv6Type byte + const ICMPv6DstUnreachable + const ICMPv6EchoReply + const ICMPv6EchoRequest + const ICMPv6NeighborAdvert + const ICMPv6NeighborSolicit + const ICMPv6PacketTooBig + const ICMPv6ParamProblem + const ICMPv6RedirectMsg + const ICMPv6RouterAdvert + const ICMPv6RouterSolicit + const ICMPv6TimeExceeded + type IPv4 []byte + func (b IPv4) CalculateChecksum() uint16 + func (b IPv4) Checksum() uint16 + func (b IPv4) DestinationAddress() tcpip.Address + func (b IPv4) Encode(i *IPv4Fields) + func (b IPv4) EncodePartial(partialChecksum, totalLength uint16) + func (b IPv4) Flags() uint8 + func (b IPv4) FragmentOffset() uint16 + func (b IPv4) HeaderLength() uint8 + func (b IPv4) ID() uint16 + func (b IPv4) IsValid(pktSize int) bool + func (b IPv4) Payload() []byte + func (b IPv4) PayloadLength() uint16 + func (b IPv4) Protocol() uint8 + func (b IPv4) SetChecksum(v uint16) + func (b IPv4) SetDestinationAddress(addr tcpip.Address) + func (b IPv4) SetFlagsFragmentOffset(flags uint8, offset uint16) + func (b IPv4) SetID(v uint16) + func (b IPv4) SetSourceAddress(addr tcpip.Address) + func (b IPv4) SetTOS(v uint8, _ uint32) + func (b IPv4) SetTotalLength(totalLength uint16) + func (b IPv4) SourceAddress() tcpip.Address + func (b IPv4) TOS() (uint8, uint32) + func (b IPv4) TTL() uint8 + func (b IPv4) TotalLength() uint16 + func (b IPv4) TransportProtocol() tcpip.TransportProtocolNumber + type IPv4Fields struct + Checksum uint16 + DstAddr tcpip.Address + Flags uint8 + FragmentOffset uint16 + ID uint16 + IHL uint8 + Protocol uint8 + SrcAddr tcpip.Address + TOS uint8 + TTL uint8 + TotalLength uint16 + type IPv6 []byte + func (IPv6) Checksum() uint16 + func (IPv6) SetChecksum(uint16) + func (b IPv6) DestinationAddress() tcpip.Address + func (b IPv6) Encode(i *IPv6Fields) + func (b IPv6) HopLimit() uint8 + func (b IPv6) IsValid(pktSize int) bool + func (b IPv6) NextHeader() uint8 + func (b IPv6) Payload() []byte + func (b IPv6) PayloadLength() uint16 + func (b IPv6) SetDestinationAddress(addr tcpip.Address) + func (b IPv6) SetNextHeader(v uint8) + func (b IPv6) SetPayloadLength(payloadLength uint16) + func (b IPv6) SetSourceAddress(addr tcpip.Address) + func (b IPv6) SetTOS(t uint8, l uint32) + func (b IPv6) SourceAddress() tcpip.Address + func (b IPv6) TOS() (uint8, uint32) + func (b IPv6) TransportProtocol() tcpip.TransportProtocolNumber + type IPv6Fields struct + DstAddr tcpip.Address + FlowLabel uint32 + HopLimit uint8 + NextHeader uint8 + PayloadLength uint16 + SrcAddr tcpip.Address + TrafficClass uint8 + type IPv6Fragment []byte + func (b IPv6Fragment) Checksum() uint16 + func (b IPv6Fragment) DestinationAddress() tcpip.Address + func (b IPv6Fragment) Encode(i *IPv6FragmentFields) + func (b IPv6Fragment) FragmentOffset() uint16 + func (b IPv6Fragment) ID() uint32 + func (b IPv6Fragment) IsValid() bool + func (b IPv6Fragment) More() bool + func (b IPv6Fragment) NextHeader() uint8 + func (b IPv6Fragment) Payload() []byte + func (b IPv6Fragment) SetChecksum(uint16) + func (b IPv6Fragment) SetDestinationAddress(tcpip.Address) + func (b IPv6Fragment) SetSourceAddress(tcpip.Address) + func (b IPv6Fragment) SetTOS(t uint8, l uint32) + func (b IPv6Fragment) SourceAddress() tcpip.Address + func (b IPv6Fragment) TOS() (uint8, uint32) + func (b IPv6Fragment) TransportProtocol() tcpip.TransportProtocolNumber + type IPv6FragmentFields struct + FragmentOffset uint16 + Identification uint32 + M bool + NextHeader uint8 + type NDPNeighborAdvert []byte + func (b NDPNeighborAdvert) Options() NDPOptions + func (b NDPNeighborAdvert) OverrideFlag() bool + func (b NDPNeighborAdvert) RouterFlag() bool + func (b NDPNeighborAdvert) SetOverrideFlag(f bool) + func (b NDPNeighborAdvert) SetRouterFlag(f bool) + func (b NDPNeighborAdvert) SetSolicitedFlag(f bool) + func (b NDPNeighborAdvert) SetTargetAddress(addr tcpip.Address) + func (b NDPNeighborAdvert) SolicitedFlag() bool + func (b NDPNeighborAdvert) TargetAddress() tcpip.Address + type NDPNeighborSolicit []byte + func (b NDPNeighborSolicit) Options() NDPOptions + func (b NDPNeighborSolicit) SetTargetAddress(addr tcpip.Address) + func (b NDPNeighborSolicit) TargetAddress() tcpip.Address + type NDPOption interface + Length func() int + Type func() uint8 + type NDPOptionIterator struct + func (i *NDPOptionIterator) Next() (NDPOption, bool, error) + type NDPOptions []byte + func (b NDPOptions) Iter(check bool) (NDPOptionIterator, error) + func (b NDPOptions) Serialize(s NDPOptionsSerializer) int + type NDPOptionsSerializer []NDPOption + func (b NDPOptionsSerializer) Length() int + type NDPPrefixInformation []byte + func (o NDPPrefixInformation) AutonomousAddressConfigurationFlag() bool + func (o NDPPrefixInformation) Length() int + func (o NDPPrefixInformation) OnLinkFlag() bool + func (o NDPPrefixInformation) PreferredLifetime() time.Duration + func (o NDPPrefixInformation) Prefix() tcpip.Address + func (o NDPPrefixInformation) PrefixLength() uint8 + func (o NDPPrefixInformation) Subnet() tcpip.Subnet + func (o NDPPrefixInformation) Type() uint8 + func (o NDPPrefixInformation) ValidLifetime() time.Duration + type NDPRouterAdvert []byte + func (b NDPRouterAdvert) CurrHopLimit() uint8 + func (b NDPRouterAdvert) ManagedAddrConfFlag() bool + func (b NDPRouterAdvert) Options() NDPOptions + func (b NDPRouterAdvert) OtherConfFlag() bool + func (b NDPRouterAdvert) ReachableTime() time.Duration + func (b NDPRouterAdvert) RetransTimer() time.Duration + func (b NDPRouterAdvert) RouterLifetime() time.Duration + type NDPTargetLinkLayerAddressOption tcpip.LinkAddress + func (o NDPTargetLinkLayerAddressOption) EthernetAddress() tcpip.LinkAddress + func (o NDPTargetLinkLayerAddressOption) Length() int + func (o NDPTargetLinkLayerAddressOption) Type() uint8 + type Network interface + Checksum func() uint16 + DestinationAddress func() tcpip.Address + Payload func() []byte + SetChecksum func(uint16) + SetDestinationAddress func(tcpip.Address) + SetSourceAddress func(tcpip.Address) + SetTOS func(t uint8, l uint32) + SourceAddress func() tcpip.Address + TOS func() (uint8, uint32) + TransportProtocol func() tcpip.TransportProtocolNumber + type SACKBlock struct + End seqnum.Value + Start seqnum.Value + func (r SACKBlock) Contains(b SACKBlock) bool + func (r SACKBlock) Less(b btree.Item) bool + type TCP []byte + func (b TCP) AckNumber() uint32 + func (b TCP) CalculateChecksum(partialChecksum uint16) uint16 + func (b TCP) Checksum() uint16 + func (b TCP) DataOffset() uint8 + func (b TCP) DestinationPort() uint16 + func (b TCP) Encode(t *TCPFields) + func (b TCP) EncodePartial(partialChecksum, length uint16, seqnum, acknum uint32, flags byte, ...) + func (b TCP) Flags() uint8 + func (b TCP) Options() []byte + func (b TCP) ParsedOptions() TCPOptions + func (b TCP) Payload() []byte + func (b TCP) SequenceNumber() uint32 + func (b TCP) SetChecksum(checksum uint16) + func (b TCP) SetDestinationPort(port uint16) + func (b TCP) SetSourcePort(port uint16) + func (b TCP) SourcePort() uint16 + func (b TCP) WindowSize() uint16 + type TCPFields struct + AckNum uint32 + Checksum uint16 + DataOffset uint8 + DstPort uint16 + Flags uint8 + SeqNum uint32 + SrcPort uint16 + UrgentPointer uint16 + WindowSize uint16 + type TCPOptions struct + SACKBlocks []SACKBlock + TS bool + TSEcr uint32 + TSVal uint32 + func ParseTCPOptions(b []byte) TCPOptions + type TCPSynOptions struct + MSS uint16 + SACKPermitted bool + TS bool + TSEcr uint32 + TSVal uint32 + WS int + func ParseSynOptions(opts []byte, isAck bool) TCPSynOptions + type Transport interface + Checksum func() uint16 + DestinationPort func() uint16 + Payload func() []byte + SetChecksum func(uint16) + SetDestinationPort func(uint16) + SetSourcePort func(uint16) + SourcePort func() uint16 + type UDP []byte + func (b UDP) CalculateChecksum(partialChecksum uint16) uint16 + func (b UDP) Checksum() uint16 + func (b UDP) DestinationPort() uint16 + func (b UDP) Encode(u *UDPFields) + func (b UDP) Length() uint16 + func (b UDP) Payload() []byte + func (b UDP) SetChecksum(checksum uint16) + func (b UDP) SetDestinationPort(port uint16) + func (b UDP) SetSourcePort(port uint16) + func (b UDP) SourcePort() uint16 + type UDPFields struct + Checksum uint16 + DstPort uint16 + Length uint16 + SrcPort uint16