layers

package
v1.3.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 23, 2023 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package layers provides decoding layers for many common protocols.

The layers package contains decode implementations for a number of different types of packet layers. Users of gopacket will almost always want to also use layers to actually decode packet data into useful pieces. To see the set of protocols that gopacket/layers is currently able to decode, look at the set of LayerTypes defined in the Variables sections. The layers package also defines endpoints for many of the common packet layers that have source/destination addresses associated with them, for example IPv4/6 (IPs) and TCP/UDP (ports). Finally, layers contains a number of useful enumerations (IPProtocol, EthernetType, LinkType, PPPType, etc...). Many of these implement the gopacket.Decoder interface, so they can be passed into gopacket as decoders.

Most common protocol layers are named using acronyms or other industry-common names (IPv4, TCP, PPP). Some of the less common ones have their names expanded (CiscoDiscoveryProtocol). For certain protocols, sub-parts of the protocol are split out into their own layers (SCTP, for example). This is done mostly in cases where portions of the protocol may fulfill the capabilities of interesting layers (SCTPData implements ApplicationLayer, while base SCTP implements TransportLayer), or possibly because splitting a protocol into a few layers makes decoding easier.

This package is meant to be used with its parent, http://github.com/Doridian/gopacket.

Port Types

Instead of using raw uint16 or uint8 values for ports, we use a different port type for every protocol, for example TCPPort and UDPPort. This allows us to override string behavior for each port, which we do by setting up port name maps (TCPPortNames, UDPPortNames, etc...). Well-known ports are annotated with their protocol names, and their String function displays these names:

p := TCPPort(80)
fmt.Printf("Number: %d  String: %v", p, p)
// Prints: "Number: 80  String: 80(http)"

Modifying Decode Behavior

layers links together decoding through its enumerations. For example, after decoding layer type Ethernet, it uses Ethernet.EthernetType as its next decoder. All enumerations that act as decoders, like EthernetType, can be modified by users depending on their preferences. For example, if you have a spiffy new IPv4 decoder that works way better than the one built into layers, you can do this:

var mySpiffyIPv4Decoder gopacket.Decoder = ...
layers.EthernetTypeMetadata[EthernetTypeIPv4].DecodeWith = mySpiffyIPv4Decoder

This will make all future ethernet packets use your new decoder to decode IPv4 packets, instead of the built-in decoder used by gopacket.

Index

Constants

View Source
const (
	ARPRequest = 1
	ARPReply   = 2
)

Potential values for ARP.Operation.

View Source
const (
	// ASFDCMIEnterprise is the IANA-assigned Enterprise Number of the Data
	// Center Manageability Interface Forum. The Presence Pong response's
	// Enterprise field being set to this value indicates support for DCMI. The
	// DCMI spec regards the OEM field as reserved, so these should be null.
	ASFDCMIEnterprise uint32 = 36465

	// ASFPresencePongEntityIPMI ANDs with Presence Pong's supported entities
	// field if the managed system supports IPMI.
	ASFPresencePongEntityIPMI ASFEntity = 1 << 7

	// ASFPresencePongEntityASFv1 ANDs with Presence Pong's supported entities
	// field if the managed system supports ASF v1.0.
	ASFPresencePongEntityASFv1 ASFEntity = 1

	// ASFPresencePongInteractionSecurityExtensions ANDs with Presence Pong's
	// supported interactions field if the managed system supports RMCP v2.0
	// security extensions. See section 3.2.3.
	ASFPresencePongInteractionSecurityExtensions ASFInteraction = 1 << 7

	// ASFPresencePongInteractionDASH ANDs with Presence Pong's supported
	// interactions field if the managed system supports DMTF DASH. See
	// https://www.dmtf.org/standards/dash.
	ASFPresencePongInteractionDASH ASFInteraction = 1 << 5
)
View Source
const (
	CDPPoEFourWire  byte = 0x01
	CDPPoEPDArch    byte = 0x02
	CDPPoEPDRequest byte = 0x04
	CDPPoEPSE       byte = 0x08
)

CDP Power-over-Ethernet values.

View Source
const (
	CDPProtocolTypeNLPID byte = 1
	CDPProtocolType802_2 byte = 2
)

CDP Protocol Types

View Source
const (
	// DecOptionNotEnoughData is returned when there is not enough data during option's decode process
	DecOptionNotEnoughData = DHCPv4Error("Not enough data to decode")
	// DecOptionMalformed is returned when the option is malformed
	DecOptionMalformed = DHCPv4Error("Option is malformed")
	// InvalidMagicCookie is returned when Magic cookie is missing into BOOTP header
	InvalidMagicCookie = DHCPv4Error("Bad DHCP header")
)
View Source
const (
	Dot11CodingTypeBCC  = 0
	Dot11CodingTypeLDPC = 1
)
View Source
const (
	EAPCodeRequest  EAPCode = 1
	EAPCodeResponse EAPCode = 2
	EAPCodeSuccess  EAPCode = 3
	EAPCodeFailure  EAPCode = 4

	// EAPTypeNone means that this EAP layer has no Type or TypeData.
	// Success and Failure EAPs will have this set.
	EAPTypeNone EAPType = 0

	EAPTypeIdentity     EAPType = 1
	EAPTypeNotification EAPType = 2
	EAPTypeNACK         EAPType = 3
	EAPTypeOTP          EAPType = 4
	EAPTypeTokenCard    EAPType = 5
)
View Source
const (
	//ERSPANIIVersionObsolete - The obsolete value for the version field
	ERSPANIIVersionObsolete = 0x0
	// ERSPANIIVersion - The current value for the version field
	ERSPANIIVersion = 0x1
)
View Source
const (
	ICMPv4TypeEchoReply              = 0
	ICMPv4TypeDestinationUnreachable = 3
	ICMPv4TypeSourceQuench           = 4
	ICMPv4TypeRedirect               = 5
	ICMPv4TypeEchoRequest            = 8
	ICMPv4TypeRouterAdvertisement    = 9
	ICMPv4TypeRouterSolicitation     = 10
	ICMPv4TypeTimeExceeded           = 11
	ICMPv4TypeParameterProblem       = 12
	ICMPv4TypeTimestampRequest       = 13
	ICMPv4TypeTimestampReply         = 14
	ICMPv4TypeInfoRequest            = 15
	ICMPv4TypeInfoReply              = 16
	ICMPv4TypeAddressMaskRequest     = 17
	ICMPv4TypeAddressMaskReply       = 18
)
View Source
const (
	// DestinationUnreachable
	ICMPv4CodeNet                 = 0
	ICMPv4CodeHost                = 1
	ICMPv4CodeProtocol            = 2
	ICMPv4CodePort                = 3
	ICMPv4CodeFragmentationNeeded = 4
	ICMPv4CodeSourceRoutingFailed = 5
	ICMPv4CodeNetUnknown          = 6
	ICMPv4CodeHostUnknown         = 7
	ICMPv4CodeSourceIsolated      = 8
	ICMPv4CodeNetAdminProhibited  = 9
	ICMPv4CodeHostAdminProhibited = 10
	ICMPv4CodeNetTOS              = 11
	ICMPv4CodeHostTOS             = 12
	ICMPv4CodeCommAdminProhibited = 13
	ICMPv4CodeHostPrecedence      = 14
	ICMPv4CodePrecedenceCutoff    = 15

	// TimeExceeded
	ICMPv4CodeTTLExceeded                    = 0
	ICMPv4CodeFragmentReassemblyTimeExceeded = 1

	// ParameterProblem
	ICMPv4CodePointerIndicatesError = 0
	ICMPv4CodeMissingOption         = 1
	ICMPv4CodeBadLength             = 2

	// Redirect
	// ICMPv4CodeNet  = same as for DestinationUnreachable
	// ICMPv4CodeHost = same as for DestinationUnreachable
	ICMPv4CodeTOSNet  = 2
	ICMPv4CodeTOSHost = 3
)
View Source
const (
	// The following are from RFC 4443
	ICMPv6TypeDestinationUnreachable = 1
	ICMPv6TypePacketTooBig           = 2
	ICMPv6TypeTimeExceeded           = 3
	ICMPv6TypeParameterProblem       = 4
	ICMPv6TypeEchoRequest            = 128
	ICMPv6TypeEchoReply              = 129

	// The following are from RFC 4861
	ICMPv6TypeRouterSolicitation    = 133
	ICMPv6TypeRouterAdvertisement   = 134
	ICMPv6TypeNeighborSolicitation  = 135
	ICMPv6TypeNeighborAdvertisement = 136
	ICMPv6TypeRedirect              = 137

	// The following are from RFC 2710
	ICMPv6TypeMLDv1MulticastListenerQueryMessage  = 130
	ICMPv6TypeMLDv1MulticastListenerReportMessage = 131
	ICMPv6TypeMLDv1MulticastListenerDoneMessage   = 132

	// The following are from RFC 3810
	ICMPv6TypeMLDv2MulticastListenerReportMessageV2 = 143
)
View Source
const (
	// DestinationUnreachable
	ICMPv6CodeNoRouteToDst           = 0
	ICMPv6CodeAdminProhibited        = 1
	ICMPv6CodeBeyondScopeOfSrc       = 2
	ICMPv6CodeAddressUnreachable     = 3
	ICMPv6CodePortUnreachable        = 4
	ICMPv6CodeSrcAddressFailedPolicy = 5
	ICMPv6CodeRejectRouteToDst       = 6

	// TimeExceeded
	ICMPv6CodeHopLimitExceeded               = 0
	ICMPv6CodeFragmentReassemblyTimeExceeded = 1

	// ParameterProblem
	ICMPv6CodeErroneousHeaderField   = 0
	ICMPv6CodeUnrecognizedNextHeader = 1
	ICMPv6CodeUnrecognizedIPv6Option = 2
)
View Source
const (
	// LCMShortHeaderMagic is the LCM small message header magic number
	LCMShortHeaderMagic uint32 = 0x4c433032
	// LCMFragmentedHeaderMagic is the LCM fragmented message header magic number
	LCMFragmentedHeaderMagic uint32 = 0x4c433033
)
View Source
const (
	LLDPCapsOther       uint16 = 1 << 0
	LLDPCapsRepeater    uint16 = 1 << 1
	LLDPCapsBridge      uint16 = 1 << 2
	LLDPCapsWLANAP      uint16 = 1 << 3
	LLDPCapsRouter      uint16 = 1 << 4
	LLDPCapsPhone       uint16 = 1 << 5
	LLDPCapsDocSis      uint16 = 1 << 6
	LLDPCapsStationOnly uint16 = 1 << 7
	LLDPCapsCVLAN       uint16 = 1 << 8
	LLDPCapsSVLAN       uint16 = 1 << 9
	LLDPCapsTmpr        uint16 = 1 << 10
)

LLDPCapabilities Types

View Source
const (
	LLDP8021SubtypePortVLANID       uint8 = 1
	LLDP8021SubtypeProtocolVLANID   uint8 = 2
	LLDP8021SubtypeVLANName         uint8 = 3
	LLDP8021SubtypeProtocolIdentity uint8 = 4
	LLDP8021SubtypeVDIUsageDigest   uint8 = 5
	LLDP8021SubtypeManagementVID    uint8 = 6
	LLDP8021SubtypeLinkAggregation  uint8 = 7
)

/ IEEE 802.1 TLV Subtypes

View Source
const (
	LLDPProtocolVLANIDCapability byte = 1 << 1
	LLDPProtocolVLANIDStatus     byte = 1 << 2
)

VLAN Port Protocol ID options

View Source
const (
	LLDPAggregationCapability byte = 1 << 0
	LLDPAggregationStatus     byte = 1 << 1
)

LACP options

View Source
const (
	LLDP8023SubtypeMACPHY          uint8 = 1
	LLDP8023SubtypeMDIPower        uint8 = 2
	LLDP8023SubtypeLinkAggregation uint8 = 3
	LLDP8023SubtypeMTU             uint8 = 4
)

IEEE 802.3 TLV Subtypes

View Source
const (
	LLDPMACPHYCapability byte = 1 << 0
	LLDPMACPHYStatus     byte = 1 << 1
)

MACPHY options

View Source
const (
	LLDPMAUTypeUnknown         uint16 = 0
	LLDPMAUTypeAUI             uint16 = 1
	LLDPMAUType10Base5         uint16 = 2
	LLDPMAUTypeFOIRL           uint16 = 3
	LLDPMAUType10Base2         uint16 = 4
	LLDPMAUType10BaseT         uint16 = 5
	LLDPMAUType10BaseFP        uint16 = 6
	LLDPMAUType10BaseFB        uint16 = 7
	LLDPMAUType10BaseFL        uint16 = 8
	LLDPMAUType10BROAD36       uint16 = 9
	LLDPMAUType10BaseT_HD      uint16 = 10
	LLDPMAUType10BaseT_FD      uint16 = 11
	LLDPMAUType10BaseFL_HD     uint16 = 12
	LLDPMAUType10BaseFL_FD     uint16 = 13
	LLDPMAUType100BaseT4       uint16 = 14
	LLDPMAUType100BaseTX_HD    uint16 = 15
	LLDPMAUType100BaseTX_FD    uint16 = 16
	LLDPMAUType100BaseFX_HD    uint16 = 17
	LLDPMAUType100BaseFX_FD    uint16 = 18
	LLDPMAUType100BaseT2_HD    uint16 = 19
	LLDPMAUType100BaseT2_FD    uint16 = 20
	LLDPMAUType1000BaseX_HD    uint16 = 21
	LLDPMAUType1000BaseX_FD    uint16 = 22
	LLDPMAUType1000BaseLX_HD   uint16 = 23
	LLDPMAUType1000BaseLX_FD   uint16 = 24
	LLDPMAUType1000BaseSX_HD   uint16 = 25
	LLDPMAUType1000BaseSX_FD   uint16 = 26
	LLDPMAUType1000BaseCX_HD   uint16 = 27
	LLDPMAUType1000BaseCX_FD   uint16 = 28
	LLDPMAUType1000BaseT_HD    uint16 = 29
	LLDPMAUType1000BaseT_FD    uint16 = 30
	LLDPMAUType10GBaseX        uint16 = 31
	LLDPMAUType10GBaseLX4      uint16 = 32
	LLDPMAUType10GBaseR        uint16 = 33
	LLDPMAUType10GBaseER       uint16 = 34
	LLDPMAUType10GBaseLR       uint16 = 35
	LLDPMAUType10GBaseSR       uint16 = 36
	LLDPMAUType10GBaseW        uint16 = 37
	LLDPMAUType10GBaseEW       uint16 = 38
	LLDPMAUType10GBaseLW       uint16 = 39
	LLDPMAUType10GBaseSW       uint16 = 40
	LLDPMAUType10GBaseCX4      uint16 = 41
	LLDPMAUType2BaseTL         uint16 = 42
	LLDPMAUType10PASS_TS       uint16 = 43
	LLDPMAUType100BaseBX10D    uint16 = 44
	LLDPMAUType100BaseBX10U    uint16 = 45
	LLDPMAUType100BaseLX10     uint16 = 46
	LLDPMAUType1000BaseBX10D   uint16 = 47
	LLDPMAUType1000BaseBX10U   uint16 = 48
	LLDPMAUType1000BaseLX10    uint16 = 49
	LLDPMAUType1000BasePX10D   uint16 = 50
	LLDPMAUType1000BasePX10U   uint16 = 51
	LLDPMAUType1000BasePX20D   uint16 = 52
	LLDPMAUType1000BasePX20U   uint16 = 53
	LLDPMAUType10GBaseT        uint16 = 54
	LLDPMAUType10GBaseLRM      uint16 = 55
	LLDPMAUType1000BaseKX      uint16 = 56
	LLDPMAUType10GBaseKX4      uint16 = 57
	LLDPMAUType10GBaseKR       uint16 = 58
	LLDPMAUType10_1GBasePRX_D1 uint16 = 59
	LLDPMAUType10_1GBasePRX_D2 uint16 = 60
	LLDPMAUType10_1GBasePRX_D3 uint16 = 61
	LLDPMAUType10_1GBasePRX_U1 uint16 = 62
	LLDPMAUType10_1GBasePRX_U2 uint16 = 63
	LLDPMAUType10_1GBasePRX_U3 uint16 = 64
	LLDPMAUType10GBasePR_D1    uint16 = 65
	LLDPMAUType10GBasePR_D2    uint16 = 66
	LLDPMAUType10GBasePR_D3    uint16 = 67
	LLDPMAUType10GBasePR_U1    uint16 = 68
	LLDPMAUType10GBasePR_U3    uint16 = 69
)

From IANA-MAU-MIB (introduced by RFC 4836) - dot3MauType

View Source
const (
	LLDPMAUPMDOther        uint16 = 1 << 15
	LLDPMAUPMD10BaseT      uint16 = 1 << 14
	LLDPMAUPMD10BaseT_FD   uint16 = 1 << 13
	LLDPMAUPMD100BaseT4    uint16 = 1 << 12
	LLDPMAUPMD100BaseTX    uint16 = 1 << 11
	LLDPMAUPMD100BaseTX_FD uint16 = 1 << 10
	LLDPMAUPMD100BaseT2    uint16 = 1 << 9
	LLDPMAUPMD100BaseT2_FD uint16 = 1 << 8
	LLDPMAUPMDFDXPAUSE     uint16 = 1 << 7
	LLDPMAUPMDFDXAPAUSE    uint16 = 1 << 6
	LLDPMAUPMDFDXSPAUSE    uint16 = 1 << 5
	LLDPMAUPMDFDXBPAUSE    uint16 = 1 << 4
	LLDPMAUPMD1000BaseX    uint16 = 1 << 3
	LLDPMAUPMD1000BaseX_FD uint16 = 1 << 2
	LLDPMAUPMD1000BaseT    uint16 = 1 << 1
	LLDPMAUPMD1000BaseT_FD uint16 = 1 << 0
)

From RFC 3636 - ifMauAutoNegCapAdvertisedBits

View Source
const (
	LLDPMAUPMDOtherInv        uint16 = 1 << 0
	LLDPMAUPMD10BaseTInv      uint16 = 1 << 1
	LLDPMAUPMD10BaseT_FDInv   uint16 = 1 << 2
	LLDPMAUPMD100BaseT4Inv    uint16 = 1 << 3
	LLDPMAUPMD100BaseTXInv    uint16 = 1 << 4
	LLDPMAUPMD100BaseTX_FDInv uint16 = 1 << 5
	LLDPMAUPMD100BaseT2Inv    uint16 = 1 << 6
	LLDPMAUPMD100BaseT2_FDInv uint16 = 1 << 7
	LLDPMAUPMDFDXPAUSEInv     uint16 = 1 << 8
	LLDPMAUPMDFDXAPAUSEInv    uint16 = 1 << 9
	LLDPMAUPMDFDXSPAUSEInv    uint16 = 1 << 10
	LLDPMAUPMDFDXBPAUSEInv    uint16 = 1 << 11
	LLDPMAUPMD1000BaseXInv    uint16 = 1 << 12
	LLDPMAUPMD1000BaseX_FDInv uint16 = 1 << 13
	LLDPMAUPMD1000BaseTInv    uint16 = 1 << 14
	LLDPMAUPMD1000BaseT_FDInv uint16 = 1 << 15
)

Inverted ifMauAutoNegCapAdvertisedBits if required (Some manufacturers misinterpreted the spec - see https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1455)

View Source
const (
	LLDPMDIPowerPortClass    byte = 1 << 0
	LLDPMDIPowerCapability   byte = 1 << 1
	LLDPMDIPowerStatus       byte = 1 << 2
	LLDPMDIPowerPairsAbility byte = 1 << 3
)

MDI Power options

View Source
const (
	LLDP8021QbgEVB   uint8 = 0
	LLDP8021QbgCDCP  uint8 = 1
	LLDP8021QbgVDP   uint8 = 2
	LLDP8021QbgEVB22 uint8 = 13
)

IEEE 802.1Qbg TLV Subtypes

View Source
const (
	LLDPEVBCapsSTD uint16 = 1 << 7
	LLDPEVBCapsRR  uint16 = 1 << 6
	LLDPEVBCapsRTE uint16 = 1 << 2
	LLDPEVBCapsECP uint16 = 1 << 1
	LLDPEVBCapsVDP uint16 = 1 << 0
)

LLDPEVBCapabilities Types

View Source
const (
	LLDPMediaCapsLLDP      uint16 = 1 << 0
	LLDPMediaCapsNetwork   uint16 = 1 << 1
	LLDPMediaCapsLocation  uint16 = 1 << 2
	LLDPMediaCapsPowerPSE  uint16 = 1 << 3
	LLDPMediaCapsPowerPD   uint16 = 1 << 4
	LLDPMediaCapsInventory uint16 = 1 << 5
)

LLDPMediaCapabilities Types

View Source
const (
	LLDPCiscoPSESupport   uint8 = 1 << 0
	LLDPCiscoArchShared   uint8 = 1 << 1
	LLDPCiscoPDSparePair  uint8 = 1 << 2
	LLDPCiscoPSESparePair uint8 = 1 << 3
)
View Source
const (
	RouterLSAtypeV2         = 0x1
	RouterLSAtype           = 0x2001
	NetworkLSAtypeV2        = 0x2
	NetworkLSAtype          = 0x2002
	SummaryLSANetworktypeV2 = 0x3
	InterAreaPrefixLSAtype  = 0x2003
	SummaryLSAASBRtypeV2    = 0x4
	InterAreaRouterLSAtype  = 0x2004
	ASExternalLSAtypeV2     = 0x5
	ASExternalLSAtype       = 0x4005
	NSSALSAtype             = 0x2007
	NSSALSAtypeV2           = 0x7
	LinkLSAtype             = 0x0008
	IntraAreaPrefixLSAtype  = 0x2009
)

LSA Function Codes for LSAheader.LSType

View Source
const (
	PrismType1MessageCode uint16 = 0x00000044
	PrismType2MessageCode uint16 = 0x00000041
)
View Source
const (
	RadioTapMCSFlagsBandwidthMask RadioTapMCSFlags = 0x03
	RadioTapMCSFlagsShortGI                        = 0x04
	RadioTapMCSFlagsGreenfield                     = 0x08
	RadioTapMCSFlagsFECLDPC                        = 0x10
	RadioTapMCSFlagsSTBCMask                       = 0x60
	RadioTapMCSFlagsNESS0                          = 0x80
)
View Source
const (
	// RMCPVersion1 identifies RMCP v1.0 in the Version header field. Lower
	// values are considered legacy, while higher values are reserved by the
	// specification.
	RMCPVersion1 uint8 = 0x06

	// RMCPNormal indicates a "normal" message, i.e. not an acknowledgement.
	RMCPNormal uint8 = 0

	// RMCPAck indicates a message is acknowledging a received normal message.
	RMCPAck uint8 = 1 << 7

	// RMCPClassASF identifies an RMCP message as containing an ASF-RMCP
	// payload.
	RMCPClassASF RMCPClass = 0x06

	// RMCPClassIPMI identifies an RMCP message as containing an IPMI payload.
	RMCPClassIPMI RMCPClass = 0x07

	// RMCPClassOEM identifies an RMCP message as containing an OEM-defined
	// payload.
	RMCPClassOEM RMCPClass = 0x08
)
View Source
const (
	SCTPProtocolReserved  SCTPPayloadProtocol = 0
	SCTPPayloadUIA                            = 1
	SCTPPayloadM2UA                           = 2
	SCTPPayloadM3UA                           = 3
	SCTPPayloadSUA                            = 4
	SCTPPayloadM2PA                           = 5
	SCTPPayloadV5UA                           = 6
	SCTPPayloadH248                           = 7
	SCTPPayloadBICC                           = 8
	SCTPPayloadTALI                           = 9
	SCTPPayloadDUA                            = 10
	SCTPPayloadASAP                           = 11
	SCTPPayloadENRP                           = 12
	SCTPPayloadH323                           = 13
	SCTPPayloadQIPC                           = 14
	SCTPPayloadSIMCO                          = 15
	SCTPPayloadDDPSegment                     = 16
	SCTPPayloadDDPStream                      = 17
	SCTPPayloadS1AP                           = 18
)

SCTPPayloadProtocol constonts from http://www.iana.org/assignments/sctp-parameters/sctp-parameters.xhtml

View Source
const (
	TCPOptionKindEndList                         = 0
	TCPOptionKindNop                             = 1
	TCPOptionKindMSS                             = 2  // len = 4
	TCPOptionKindWindowScale                     = 3  // len = 3
	TCPOptionKindSACKPermitted                   = 4  // len = 2
	TCPOptionKindSACK                            = 5  // len = n
	TCPOptionKindEcho                            = 6  // len = 6, obsolete
	TCPOptionKindEchoReply                       = 7  // len = 6, obsolete
	TCPOptionKindTimestamps                      = 8  // len = 10
	TCPOptionKindPartialOrderConnectionPermitted = 9  // len = 2, obsolete
	TCPOptionKindPartialOrderServiceProfile      = 10 // len = 3, obsolete
	TCPOptionKindCC                              = 11 // obsolete
	TCPOptionKindCCNew                           = 12 // obsolete
	TCPOptionKindCCEcho                          = 13 // obsolete
	TCPOptionKindAltChecksum                     = 14 // len = 3, obsolete
	TCPOptionKindAltChecksumData                 = 15 // len = n, obsolete
)
View Source
const (
	TLSAlertWarning      TLSAlertLevel = 1
	TLSAlertFatal        TLSAlertLevel = 2
	TLSAlertUnknownLevel TLSAlertLevel = 255

	TLSAlertCloseNotify               TLSAlertDescr = 0
	TLSAlertUnexpectedMessage         TLSAlertDescr = 10
	TLSAlertBadRecordMac              TLSAlertDescr = 20
	TLSAlertDecryptionFailedRESERVED  TLSAlertDescr = 21
	TLSAlertRecordOverflow            TLSAlertDescr = 22
	TLSAlertDecompressionFailure      TLSAlertDescr = 30
	TLSAlertHandshakeFailure          TLSAlertDescr = 40
	TLSAlertNoCertificateRESERVED     TLSAlertDescr = 41
	TLSAlertBadCertificate            TLSAlertDescr = 42
	TLSAlertUnsupportedCertificate    TLSAlertDescr = 43
	TLSAlertCertificateRevoked        TLSAlertDescr = 44
	TLSAlertCertificateExpired        TLSAlertDescr = 45
	TLSAlertCertificateUnknown        TLSAlertDescr = 46
	TLSAlertIllegalParameter          TLSAlertDescr = 47
	TLSAlertUnknownCa                 TLSAlertDescr = 48
	TLSAlertAccessDenied              TLSAlertDescr = 49
	TLSAlertDecodeError               TLSAlertDescr = 50
	TLSAlertDecryptError              TLSAlertDescr = 51
	TLSAlertExportRestrictionRESERVED TLSAlertDescr = 60
	TLSAlertProtocolVersion           TLSAlertDescr = 70
	TLSAlertInsufficientSecurity      TLSAlertDescr = 71
	TLSAlertInternalError             TLSAlertDescr = 80
	TLSAlertUserCanceled              TLSAlertDescr = 90
	TLSAlertNoRenegotiation           TLSAlertDescr = 100
	TLSAlertUnsupportedExtension      TLSAlertDescr = 110
	TLSAlertUnknownDescription        TLSAlertDescr = 255
)
View Source
const (
	// ASFRMCPEnterprise is the IANA-assigned Enterprise Number of the ASF-RMCP.
	ASFRMCPEnterprise uint32 = 4542
)
View Source
const (
	// IPv6HopByHopOptionJumbogram code as defined in RFC 2675
	IPv6HopByHopOptionJumbogram = 0xC2
)

Variables

View Source
var (
	// ASFDataIdentifierPresencePong is the message type of the response to a
	// Presence Ping message. It indicates the sender is ASF-RMCP-aware.
	ASFDataIdentifierPresencePong = ASFDataIdentifier{
		Enterprise: ASFRMCPEnterprise,
		Type:       0x40,
	}

	// ASFDataIdentifierPresencePing is a message type sent to a managed client
	// to solicit a Presence Pong response. Clients may ignore this if the RMCP
	// version is unsupported. Sending this message with a sequence number <255
	// is the recommended way of finding out whether an implementation sends
	// RMCP ACKs (e.g. iDRAC does, Super Micro does not).
	//
	// Systems implementing IPMI must respond to this ping to conform to the
	// spec, so it is a good substitute for an ICMP ping.
	ASFDataIdentifierPresencePing = ASFDataIdentifier{
		Enterprise: ASFRMCPEnterprise,
		Type:       0x80,
	}
)
View Source
var (
	// We use two different endpoint types for IPv4 vs IPv6 addresses, so that
	// ordering with endpointA.LessThan(endpointB) sanely groups all IPv4
	// addresses and all IPv6 addresses, such that IPv6 > IPv4 for all addresses.
	EndpointIPv4 = gopacket.RegisterEndpointType(1, gopacket.EndpointTypeMetadata{Name: "IPv4", Formatter: func(b []byte) string {
		return net.IP(b).String()
	}})
	EndpointIPv6 = gopacket.RegisterEndpointType(2, gopacket.EndpointTypeMetadata{Name: "IPv6", Formatter: func(b []byte) string {
		return net.IP(b).String()
	}})

	EndpointMAC = gopacket.RegisterEndpointType(3, gopacket.EndpointTypeMetadata{Name: "MAC", Formatter: func(b []byte) string {
		return net.HardwareAddr(b).String()
	}})
	EndpointTCPPort = gopacket.RegisterEndpointType(4, gopacket.EndpointTypeMetadata{Name: "TCP", Formatter: func(b []byte) string {
		return strconv.Itoa(int(binary.BigEndian.Uint16(b)))
	}})
	EndpointUDPPort = gopacket.RegisterEndpointType(5, gopacket.EndpointTypeMetadata{Name: "UDP", Formatter: func(b []byte) string {
		return strconv.Itoa(int(binary.BigEndian.Uint16(b)))
	}})
	EndpointSCTPPort = gopacket.RegisterEndpointType(6, gopacket.EndpointTypeMetadata{Name: "SCTP", Formatter: func(b []byte) string {
		return strconv.Itoa(int(binary.BigEndian.Uint16(b)))
	}})
	EndpointRUDPPort = gopacket.RegisterEndpointType(7, gopacket.EndpointTypeMetadata{Name: "RUDP", Formatter: func(b []byte) string {
		return strconv.Itoa(int(b[0]))
	}})
	EndpointUDPLitePort = gopacket.RegisterEndpointType(8, gopacket.EndpointTypeMetadata{Name: "UDPLite", Formatter: func(b []byte) string {
		return strconv.Itoa(int(binary.BigEndian.Uint16(b)))
	}})
	EndpointPPP = gopacket.RegisterEndpointType(9, gopacket.EndpointTypeMetadata{Name: "PPP", Formatter: func([]byte) string {
		return "point"
	}})
)
View Source
var (
	LayerTypeARP                          = gopacket.RegisterLayerType(10, gopacket.LayerTypeMetadata{Name: "ARP", Decoder: gopacket.DecodeFunc(decodeARP)})
	LayerTypeCiscoDiscovery               = gopacket.RegisterLayerType(11, gopacket.LayerTypeMetadata{Name: "CiscoDiscovery", Decoder: gopacket.DecodeFunc(decodeCiscoDiscovery)})
	LayerTypeEthernetCTP                  = gopacket.RegisterLayerType(12, gopacket.LayerTypeMetadata{Name: "EthernetCTP", Decoder: gopacket.DecodeFunc(decodeEthernetCTP)})
	LayerTypeEthernetCTPForwardData       = gopacket.RegisterLayerType(13, gopacket.LayerTypeMetadata{Name: "EthernetCTPForwardData", Decoder: nil})
	LayerTypeEthernetCTPReply             = gopacket.RegisterLayerType(14, gopacket.LayerTypeMetadata{Name: "EthernetCTPReply", Decoder: nil})
	LayerTypeDot1Q                        = gopacket.RegisterLayerType(15, gopacket.LayerTypeMetadata{Name: "Dot1Q", Decoder: gopacket.DecodeFunc(decodeDot1Q)})
	LayerTypeEtherIP                      = gopacket.RegisterLayerType(16, gopacket.LayerTypeMetadata{Name: "EtherIP", Decoder: gopacket.DecodeFunc(decodeEtherIP)})
	LayerTypeEthernet                     = gopacket.RegisterLayerType(17, gopacket.LayerTypeMetadata{Name: "Ethernet", Decoder: gopacket.DecodeFunc(decodeEthernet)})
	LayerTypeGRE                          = gopacket.RegisterLayerType(18, gopacket.LayerTypeMetadata{Name: "GRE", Decoder: gopacket.DecodeFunc(decodeGRE)})
	LayerTypeICMPv4                       = gopacket.RegisterLayerType(19, gopacket.LayerTypeMetadata{Name: "ICMPv4", Decoder: gopacket.DecodeFunc(decodeICMPv4)})
	LayerTypeIPv4                         = gopacket.RegisterLayerType(20, gopacket.LayerTypeMetadata{Name: "IPv4", Decoder: gopacket.DecodeFunc(decodeIPv4)})
	LayerTypeIPv6                         = gopacket.RegisterLayerType(21, gopacket.LayerTypeMetadata{Name: "IPv6", Decoder: gopacket.DecodeFunc(decodeIPv6)})
	LayerTypeLLC                          = gopacket.RegisterLayerType(22, gopacket.LayerTypeMetadata{Name: "LLC", Decoder: gopacket.DecodeFunc(decodeLLC)})
	LayerTypeSNAP                         = gopacket.RegisterLayerType(23, gopacket.LayerTypeMetadata{Name: "SNAP", Decoder: gopacket.DecodeFunc(decodeSNAP)})
	LayerTypeMPLS                         = gopacket.RegisterLayerType(24, gopacket.LayerTypeMetadata{Name: "MPLS", Decoder: gopacket.DecodeFunc(decodeMPLS)})
	LayerTypePPP                          = gopacket.RegisterLayerType(25, gopacket.LayerTypeMetadata{Name: "PPP", Decoder: gopacket.DecodeFunc(decodePPP)})
	LayerTypePPPoE                        = gopacket.RegisterLayerType(26, gopacket.LayerTypeMetadata{Name: "PPPoE", Decoder: gopacket.DecodeFunc(decodePPPoE)})
	LayerTypeRUDP                         = gopacket.RegisterLayerType(27, gopacket.LayerTypeMetadata{Name: "RUDP", Decoder: gopacket.DecodeFunc(decodeRUDP)})
	LayerTypeSCTP                         = gopacket.RegisterLayerType(28, gopacket.LayerTypeMetadata{Name: "SCTP", Decoder: gopacket.DecodeFunc(decodeSCTP)})
	LayerTypeSCTPUnknownChunkType         = gopacket.RegisterLayerType(29, gopacket.LayerTypeMetadata{Name: "SCTPUnknownChunkType", Decoder: nil})
	LayerTypeSCTPData                     = gopacket.RegisterLayerType(30, gopacket.LayerTypeMetadata{Name: "SCTPData", Decoder: nil})
	LayerTypeSCTPInit                     = gopacket.RegisterLayerType(31, gopacket.LayerTypeMetadata{Name: "SCTPInit", Decoder: nil})
	LayerTypeSCTPSack                     = gopacket.RegisterLayerType(32, gopacket.LayerTypeMetadata{Name: "SCTPSack", Decoder: nil})
	LayerTypeSCTPHeartbeat                = gopacket.RegisterLayerType(33, gopacket.LayerTypeMetadata{Name: "SCTPHeartbeat", Decoder: nil})
	LayerTypeSCTPError                    = gopacket.RegisterLayerType(34, gopacket.LayerTypeMetadata{Name: "SCTPError", Decoder: nil})
	LayerTypeSCTPShutdown                 = gopacket.RegisterLayerType(35, gopacket.LayerTypeMetadata{Name: "SCTPShutdown", Decoder: nil})
	LayerTypeSCTPShutdownAck              = gopacket.RegisterLayerType(36, gopacket.LayerTypeMetadata{Name: "SCTPShutdownAck", Decoder: nil})
	LayerTypeSCTPCookieEcho               = gopacket.RegisterLayerType(37, gopacket.LayerTypeMetadata{Name: "SCTPCookieEcho", Decoder: nil})
	LayerTypeSCTPEmptyLayer               = gopacket.RegisterLayerType(38, gopacket.LayerTypeMetadata{Name: "SCTPEmptyLayer", Decoder: nil})
	LayerTypeSCTPInitAck                  = gopacket.RegisterLayerType(39, gopacket.LayerTypeMetadata{Name: "SCTPInitAck", Decoder: nil})
	LayerTypeSCTPHeartbeatAck             = gopacket.RegisterLayerType(40, gopacket.LayerTypeMetadata{Name: "SCTPHeartbeatAck", Decoder: nil})
	LayerTypeSCTPAbort                    = gopacket.RegisterLayerType(41, gopacket.LayerTypeMetadata{Name: "SCTPAbort", Decoder: nil})
	LayerTypeSCTPShutdownComplete         = gopacket.RegisterLayerType(42, gopacket.LayerTypeMetadata{Name: "SCTPShutdownComplete", Decoder: nil})
	LayerTypeSCTPCookieAck                = gopacket.RegisterLayerType(43, gopacket.LayerTypeMetadata{Name: "SCTPCookieAck", Decoder: nil})
	LayerTypeTCP                          = gopacket.RegisterLayerType(44, gopacket.LayerTypeMetadata{Name: "TCP", Decoder: gopacket.DecodeFunc(decodeTCP)})
	LayerTypeUDP                          = gopacket.RegisterLayerType(45, gopacket.LayerTypeMetadata{Name: "UDP", Decoder: gopacket.DecodeFunc(decodeUDP)})
	LayerTypeIPv6HopByHop                 = gopacket.RegisterLayerType(46, gopacket.LayerTypeMetadata{Name: "IPv6HopByHop", Decoder: gopacket.DecodeFunc(decodeIPv6HopByHop)})
	LayerTypeIPv6Routing                  = gopacket.RegisterLayerType(47, gopacket.LayerTypeMetadata{Name: "IPv6Routing", Decoder: gopacket.DecodeFunc(decodeIPv6Routing)})
	LayerTypeIPv6Fragment                 = gopacket.RegisterLayerType(48, gopacket.LayerTypeMetadata{Name: "IPv6Fragment", Decoder: gopacket.DecodeFunc(decodeIPv6Fragment)})
	LayerTypeIPv6Destination              = gopacket.RegisterLayerType(49, gopacket.LayerTypeMetadata{Name: "IPv6Destination", Decoder: gopacket.DecodeFunc(decodeIPv6Destination)})
	LayerTypeIPSecAH                      = gopacket.RegisterLayerType(50, gopacket.LayerTypeMetadata{Name: "IPSecAH", Decoder: gopacket.DecodeFunc(decodeIPSecAH)})
	LayerTypeIPSecESP                     = gopacket.RegisterLayerType(51, gopacket.LayerTypeMetadata{Name: "IPSecESP", Decoder: gopacket.DecodeFunc(decodeIPSecESP)})
	LayerTypeUDPLite                      = gopacket.RegisterLayerType(52, gopacket.LayerTypeMetadata{Name: "UDPLite", Decoder: gopacket.DecodeFunc(decodeUDPLite)})
	LayerTypeFDDI                         = gopacket.RegisterLayerType(53, gopacket.LayerTypeMetadata{Name: "FDDI", Decoder: gopacket.DecodeFunc(decodeFDDI)})
	LayerTypeLoopback                     = gopacket.RegisterLayerType(54, gopacket.LayerTypeMetadata{Name: "Loopback", Decoder: gopacket.DecodeFunc(decodeLoopback)})
	LayerTypeEAP                          = gopacket.RegisterLayerType(55, gopacket.LayerTypeMetadata{Name: "EAP", Decoder: gopacket.DecodeFunc(decodeEAP)})
	LayerTypeEAPOL                        = gopacket.RegisterLayerType(56, gopacket.LayerTypeMetadata{Name: "EAPOL", Decoder: gopacket.DecodeFunc(decodeEAPOL)})
	LayerTypeICMPv6                       = gopacket.RegisterLayerType(57, gopacket.LayerTypeMetadata{Name: "ICMPv6", Decoder: gopacket.DecodeFunc(decodeICMPv6)})
	LayerTypeLinkLayerDiscovery           = gopacket.RegisterLayerType(58, gopacket.LayerTypeMetadata{Name: "LinkLayerDiscovery", Decoder: gopacket.DecodeFunc(decodeLinkLayerDiscovery)})
	LayerTypeCiscoDiscoveryInfo           = gopacket.RegisterLayerType(59, gopacket.LayerTypeMetadata{Name: "CiscoDiscoveryInfo", Decoder: gopacket.DecodeFunc(decodeCiscoDiscoveryInfo)})
	LayerTypeLinkLayerDiscoveryInfo       = gopacket.RegisterLayerType(60, gopacket.LayerTypeMetadata{Name: "LinkLayerDiscoveryInfo", Decoder: nil})
	LayerTypeNortelDiscovery              = gopacket.RegisterLayerType(61, gopacket.LayerTypeMetadata{Name: "NortelDiscovery", Decoder: gopacket.DecodeFunc(decodeNortelDiscovery)})
	LayerTypeIGMP                         = gopacket.RegisterLayerType(62, gopacket.LayerTypeMetadata{Name: "IGMP", Decoder: gopacket.DecodeFunc(decodeIGMP)})
	LayerTypePFLog                        = gopacket.RegisterLayerType(63, gopacket.LayerTypeMetadata{Name: "PFLog", Decoder: gopacket.DecodeFunc(decodePFLog)})
	LayerTypeRadioTap                     = gopacket.RegisterLayerType(64, gopacket.LayerTypeMetadata{Name: "RadioTap", Decoder: gopacket.DecodeFunc(decodeRadioTap)})
	LayerTypeDot11                        = gopacket.RegisterLayerType(65, gopacket.LayerTypeMetadata{Name: "Dot11", Decoder: gopacket.DecodeFunc(decodeDot11)})
	LayerTypeDot11Ctrl                    = gopacket.RegisterLayerType(66, gopacket.LayerTypeMetadata{Name: "Dot11Ctrl", Decoder: gopacket.DecodeFunc(decodeDot11Ctrl)})
	LayerTypeDot11Data                    = gopacket.RegisterLayerType(67, gopacket.LayerTypeMetadata{Name: "Dot11Data", Decoder: gopacket.DecodeFunc(decodeDot11Data)})
	LayerTypeDot11DataCFAck               = gopacket.RegisterLayerType(68, gopacket.LayerTypeMetadata{Name: "Dot11DataCFAck", Decoder: gopacket.DecodeFunc(decodeDot11DataCFAck)})
	LayerTypeDot11DataCFPoll              = gopacket.RegisterLayerType(69, gopacket.LayerTypeMetadata{Name: "Dot11DataCFPoll", Decoder: gopacket.DecodeFunc(decodeDot11DataCFPoll)})
	LayerTypeDot11DataCFAckPoll           = gopacket.RegisterLayerType(70, gopacket.LayerTypeMetadata{Name: "Dot11DataCFAckPoll", Decoder: gopacket.DecodeFunc(decodeDot11DataCFAckPoll)})
	LayerTypeDot11DataNull                = gopacket.RegisterLayerType(71, gopacket.LayerTypeMetadata{Name: "Dot11DataNull", Decoder: gopacket.DecodeFunc(decodeDot11DataNull)})
	LayerTypeDot11DataCFAckNoData         = gopacket.RegisterLayerType(72, gopacket.LayerTypeMetadata{Name: "Dot11DataCFAck", Decoder: gopacket.DecodeFunc(decodeDot11DataCFAck)})
	LayerTypeDot11DataCFPollNoData        = gopacket.RegisterLayerType(73, gopacket.LayerTypeMetadata{Name: "Dot11DataCFPoll", Decoder: gopacket.DecodeFunc(decodeDot11DataCFPoll)})
	LayerTypeDot11DataCFAckPollNoData     = gopacket.RegisterLayerType(74, gopacket.LayerTypeMetadata{Name: "Dot11DataCFAckPoll", Decoder: gopacket.DecodeFunc(decodeDot11DataCFAckPoll)})
	LayerTypeDot11DataQOSData             = gopacket.RegisterLayerType(75, gopacket.LayerTypeMetadata{Name: "Dot11DataQOSData", Decoder: gopacket.DecodeFunc(decodeDot11DataQOSData)})
	LayerTypeDot11DataQOSDataCFAck        = gopacket.RegisterLayerType(76, gopacket.LayerTypeMetadata{Name: "Dot11DataQOSDataCFAck", Decoder: gopacket.DecodeFunc(decodeDot11DataQOSDataCFAck)})
	LayerTypeDot11DataQOSDataCFPoll       = gopacket.RegisterLayerType(77, gopacket.LayerTypeMetadata{Name: "Dot11DataQOSDataCFPoll", Decoder: gopacket.DecodeFunc(decodeDot11DataQOSDataCFPoll)})
	LayerTypeDot11DataQOSDataCFAckPoll    = gopacket.RegisterLayerType(78, gopacket.LayerTypeMetadata{Name: "Dot11DataQOSDataCFAckPoll", Decoder: gopacket.DecodeFunc(decodeDot11DataQOSDataCFAckPoll)})
	LayerTypeDot11DataQOSNull             = gopacket.RegisterLayerType(79, gopacket.LayerTypeMetadata{Name: "Dot11DataQOSNull", Decoder: gopacket.DecodeFunc(decodeDot11DataQOSNull)})
	LayerTypeDot11DataQOSCFPollNoData     = gopacket.RegisterLayerType(80, gopacket.LayerTypeMetadata{Name: "Dot11DataQOSCFPoll", Decoder: gopacket.DecodeFunc(decodeDot11DataQOSCFPollNoData)})
	LayerTypeDot11DataQOSCFAckPollNoData  = gopacket.RegisterLayerType(81, gopacket.LayerTypeMetadata{Name: "Dot11DataQOSCFAckPoll", Decoder: gopacket.DecodeFunc(decodeDot11DataQOSCFAckPollNoData)})
	LayerTypeDot11InformationElement      = gopacket.RegisterLayerType(82, gopacket.LayerTypeMetadata{Name: "Dot11InformationElement", Decoder: gopacket.DecodeFunc(decodeDot11InformationElement)})
	LayerTypeDot11CtrlCTS                 = gopacket.RegisterLayerType(83, gopacket.LayerTypeMetadata{Name: "Dot11CtrlCTS", Decoder: gopacket.DecodeFunc(decodeDot11CtrlCTS)})
	LayerTypeDot11CtrlRTS                 = gopacket.RegisterLayerType(84, gopacket.LayerTypeMetadata{Name: "Dot11CtrlRTS", Decoder: gopacket.DecodeFunc(decodeDot11CtrlRTS)})
	LayerTypeDot11CtrlBlockAckReq         = gopacket.RegisterLayerType(85, gopacket.LayerTypeMetadata{Name: "Dot11CtrlBlockAckReq", Decoder: gopacket.DecodeFunc(decodeDot11CtrlBlockAckReq)})
	LayerTypeDot11CtrlBlockAck            = gopacket.RegisterLayerType(86, gopacket.LayerTypeMetadata{Name: "Dot11CtrlBlockAck", Decoder: gopacket.DecodeFunc(decodeDot11CtrlBlockAck)})
	LayerTypeDot11CtrlPowersavePoll       = gopacket.RegisterLayerType(87, gopacket.LayerTypeMetadata{Name: "Dot11CtrlPowersavePoll", Decoder: gopacket.DecodeFunc(decodeDot11CtrlPowersavePoll)})
	LayerTypeDot11CtrlAck                 = gopacket.RegisterLayerType(88, gopacket.LayerTypeMetadata{Name: "Dot11CtrlAck", Decoder: gopacket.DecodeFunc(decodeDot11CtrlAck)})
	LayerTypeDot11CtrlCFEnd               = gopacket.RegisterLayerType(89, gopacket.LayerTypeMetadata{Name: "Dot11CtrlCFEnd", Decoder: gopacket.DecodeFunc(decodeDot11CtrlCFEnd)})
	LayerTypeDot11CtrlCFEndAck            = gopacket.RegisterLayerType(90, gopacket.LayerTypeMetadata{Name: "Dot11CtrlCFEndAck", Decoder: gopacket.DecodeFunc(decodeDot11CtrlCFEndAck)})
	LayerTypeDot11MgmtAssociationReq      = gopacket.RegisterLayerType(91, gopacket.LayerTypeMetadata{Name: "Dot11MgmtAssociationReq", Decoder: gopacket.DecodeFunc(decodeDot11MgmtAssociationReq)})
	LayerTypeDot11MgmtAssociationResp     = gopacket.RegisterLayerType(92, gopacket.LayerTypeMetadata{Name: "Dot11MgmtAssociationResp", Decoder: gopacket.DecodeFunc(decodeDot11MgmtAssociationResp)})
	LayerTypeDot11MgmtReassociationReq    = gopacket.RegisterLayerType(93, gopacket.LayerTypeMetadata{Name: "Dot11MgmtReassociationReq", Decoder: gopacket.DecodeFunc(decodeDot11MgmtReassociationReq)})
	LayerTypeDot11MgmtReassociationResp   = gopacket.RegisterLayerType(94, gopacket.LayerTypeMetadata{Name: "Dot11MgmtReassociationResp", Decoder: gopacket.DecodeFunc(decodeDot11MgmtReassociationResp)})
	LayerTypeDot11MgmtProbeReq            = gopacket.RegisterLayerType(95, gopacket.LayerTypeMetadata{Name: "Dot11MgmtProbeReq", Decoder: gopacket.DecodeFunc(decodeDot11MgmtProbeReq)})
	LayerTypeDot11MgmtProbeResp           = gopacket.RegisterLayerType(96, gopacket.LayerTypeMetadata{Name: "Dot11MgmtProbeResp", Decoder: gopacket.DecodeFunc(decodeDot11MgmtProbeResp)})
	LayerTypeDot11MgmtMeasurementPilot    = gopacket.RegisterLayerType(97, gopacket.LayerTypeMetadata{Name: "Dot11MgmtMeasurementPilot", Decoder: gopacket.DecodeFunc(decodeDot11MgmtMeasurementPilot)})
	LayerTypeDot11MgmtBeacon              = gopacket.RegisterLayerType(98, gopacket.LayerTypeMetadata{Name: "Dot11MgmtBeacon", Decoder: gopacket.DecodeFunc(decodeDot11MgmtBeacon)})
	LayerTypeDot11MgmtATIM                = gopacket.RegisterLayerType(99, gopacket.LayerTypeMetadata{Name: "Dot11MgmtATIM", Decoder: gopacket.DecodeFunc(decodeDot11MgmtATIM)})
	LayerTypeDot11MgmtDisassociation      = gopacket.RegisterLayerType(100, gopacket.LayerTypeMetadata{Name: "Dot11MgmtDisassociation", Decoder: gopacket.DecodeFunc(decodeDot11MgmtDisassociation)})
	LayerTypeDot11MgmtAuthentication      = gopacket.RegisterLayerType(101, gopacket.LayerTypeMetadata{Name: "Dot11MgmtAuthentication", Decoder: gopacket.DecodeFunc(decodeDot11MgmtAuthentication)})
	LayerTypeDot11MgmtDeauthentication    = gopacket.RegisterLayerType(102, gopacket.LayerTypeMetadata{Name: "Dot11MgmtDeauthentication", Decoder: gopacket.DecodeFunc(decodeDot11MgmtDeauthentication)})
	LayerTypeDot11MgmtAction              = gopacket.RegisterLayerType(103, gopacket.LayerTypeMetadata{Name: "Dot11MgmtAction", Decoder: gopacket.DecodeFunc(decodeDot11MgmtAction)})
	LayerTypeDot11MgmtActionNoAck         = gopacket.RegisterLayerType(104, gopacket.LayerTypeMetadata{Name: "Dot11MgmtActionNoAck", Decoder: gopacket.DecodeFunc(decodeDot11MgmtActionNoAck)})
	LayerTypeDot11MgmtArubaWLAN           = gopacket.RegisterLayerType(105, gopacket.LayerTypeMetadata{Name: "Dot11MgmtArubaWLAN", Decoder: gopacket.DecodeFunc(decodeDot11MgmtArubaWLAN)})
	LayerTypeDot11WEP                     = gopacket.RegisterLayerType(106, gopacket.LayerTypeMetadata{Name: "Dot11WEP", Decoder: gopacket.DecodeFunc(decodeDot11WEP)})
	LayerTypeDNS                          = gopacket.RegisterLayerType(107, gopacket.LayerTypeMetadata{Name: "DNS", Decoder: gopacket.DecodeFunc(decodeDNS)})
	LayerTypeUSB                          = gopacket.RegisterLayerType(108, gopacket.LayerTypeMetadata{Name: "USB", Decoder: gopacket.DecodeFunc(decodeUSB)})
	LayerTypeUSBRequestBlockSetup         = gopacket.RegisterLayerType(109, gopacket.LayerTypeMetadata{Name: "USBRequestBlockSetup", Decoder: gopacket.DecodeFunc(decodeUSBRequestBlockSetup)})
	LayerTypeUSBControl                   = gopacket.RegisterLayerType(110, gopacket.LayerTypeMetadata{Name: "USBControl", Decoder: gopacket.DecodeFunc(decodeUSBControl)})
	LayerTypeUSBInterrupt                 = gopacket.RegisterLayerType(111, gopacket.LayerTypeMetadata{Name: "USBInterrupt", Decoder: gopacket.DecodeFunc(decodeUSBInterrupt)})
	LayerTypeUSBBulk                      = gopacket.RegisterLayerType(112, gopacket.LayerTypeMetadata{Name: "USBBulk", Decoder: gopacket.DecodeFunc(decodeUSBBulk)})
	LayerTypeLinuxSLL                     = gopacket.RegisterLayerType(113, gopacket.LayerTypeMetadata{Name: "Linux SLL", Decoder: gopacket.DecodeFunc(decodeLinuxSLL)})
	LayerTypeSFlow                        = gopacket.RegisterLayerType(114, gopacket.LayerTypeMetadata{Name: "SFlow", Decoder: gopacket.DecodeFunc(decodeSFlow)})
	LayerTypePrismHeader                  = gopacket.RegisterLayerType(115, gopacket.LayerTypeMetadata{Name: "Prism monitor mode header", Decoder: gopacket.DecodeFunc(decodePrismHeader)})
	LayerTypeVXLAN                        = gopacket.RegisterLayerType(116, gopacket.LayerTypeMetadata{Name: "VXLAN", Decoder: gopacket.DecodeFunc(decodeVXLAN)})
	LayerTypeNTP                          = gopacket.RegisterLayerType(117, gopacket.LayerTypeMetadata{Name: "NTP", Decoder: gopacket.DecodeFunc(decodeNTP)})
	LayerTypeDHCPv4                       = gopacket.RegisterLayerType(118, gopacket.LayerTypeMetadata{Name: "DHCPv4", Decoder: gopacket.DecodeFunc(decodeDHCPv4)})
	LayerTypeVRRP                         = gopacket.RegisterLayerType(119, gopacket.LayerTypeMetadata{Name: "VRRP", Decoder: gopacket.DecodeFunc(decodeVRRP)})
	LayerTypeGeneve                       = gopacket.RegisterLayerType(120, gopacket.LayerTypeMetadata{Name: "Geneve", Decoder: gopacket.DecodeFunc(decodeGeneve)})
	LayerTypeSTP                          = gopacket.RegisterLayerType(121, gopacket.LayerTypeMetadata{Name: "STP", Decoder: gopacket.DecodeFunc(decodeSTP)})
	LayerTypeBFD                          = gopacket.RegisterLayerType(122, gopacket.LayerTypeMetadata{Name: "BFD", Decoder: gopacket.DecodeFunc(decodeBFD)})
	LayerTypeOSPF                         = gopacket.RegisterLayerType(123, gopacket.LayerTypeMetadata{Name: "OSPF", Decoder: gopacket.DecodeFunc(decodeOSPF)})
	LayerTypeICMPv6RouterSolicitation     = gopacket.RegisterLayerType(124, gopacket.LayerTypeMetadata{Name: "ICMPv6RouterSolicitation", Decoder: gopacket.DecodeFunc(decodeICMPv6RouterSolicitation)})
	LayerTypeICMPv6RouterAdvertisement    = gopacket.RegisterLayerType(125, gopacket.LayerTypeMetadata{Name: "ICMPv6RouterAdvertisement", Decoder: gopacket.DecodeFunc(decodeICMPv6RouterAdvertisement)})
	LayerTypeICMPv6NeighborSolicitation   = gopacket.RegisterLayerType(126, gopacket.LayerTypeMetadata{Name: "ICMPv6NeighborSolicitation", Decoder: gopacket.DecodeFunc(decodeICMPv6NeighborSolicitation)})
	LayerTypeICMPv6NeighborAdvertisement  = gopacket.RegisterLayerType(127, gopacket.LayerTypeMetadata{Name: "ICMPv6NeighborAdvertisement", Decoder: gopacket.DecodeFunc(decodeICMPv6NeighborAdvertisement)})
	LayerTypeICMPv6Redirect               = gopacket.RegisterLayerType(128, gopacket.LayerTypeMetadata{Name: "ICMPv6Redirect", Decoder: gopacket.DecodeFunc(decodeICMPv6Redirect)})
	LayerTypeGTPv1U                       = gopacket.RegisterLayerType(129, gopacket.LayerTypeMetadata{Name: "GTPv1U", Decoder: gopacket.DecodeFunc(decodeGTPv1u)})
	LayerTypeEAPOLKey                     = gopacket.RegisterLayerType(130, gopacket.LayerTypeMetadata{Name: "EAPOLKey", Decoder: gopacket.DecodeFunc(decodeEAPOLKey)})
	LayerTypeLCM                          = gopacket.RegisterLayerType(131, gopacket.LayerTypeMetadata{Name: "LCM", Decoder: gopacket.DecodeFunc(decodeLCM)})
	LayerTypeICMPv6Echo                   = gopacket.RegisterLayerType(132, gopacket.LayerTypeMetadata{Name: "ICMPv6Echo", Decoder: gopacket.DecodeFunc(decodeICMPv6Echo)})
	LayerTypeSIP                          = gopacket.RegisterLayerType(133, gopacket.LayerTypeMetadata{Name: "SIP", Decoder: gopacket.DecodeFunc(decodeSIP)})
	LayerTypeDHCPv6                       = gopacket.RegisterLayerType(134, gopacket.LayerTypeMetadata{Name: "DHCPv6", Decoder: gopacket.DecodeFunc(decodeDHCPv6)})
	LayerTypeMLDv1MulticastListenerReport = gopacket.RegisterLayerType(135, gopacket.LayerTypeMetadata{Name: "MLDv1MulticastListenerReport", Decoder: gopacket.DecodeFunc(decodeMLDv1MulticastListenerReport)})
	LayerTypeMLDv1MulticastListenerDone   = gopacket.RegisterLayerType(136, gopacket.LayerTypeMetadata{Name: "MLDv1MulticastListenerDone", Decoder: gopacket.DecodeFunc(decodeMLDv1MulticastListenerDone)})
	LayerTypeMLDv1MulticastListenerQuery  = gopacket.RegisterLayerType(137, gopacket.LayerTypeMetadata{Name: "MLDv1MulticastListenerQuery", Decoder: gopacket.DecodeFunc(decodeMLDv1MulticastListenerQuery)})
	LayerTypeMLDv2MulticastListenerReport = gopacket.RegisterLayerType(138, gopacket.LayerTypeMetadata{Name: "MLDv2MulticastListenerReport", Decoder: gopacket.DecodeFunc(decodeMLDv2MulticastListenerReport)})
	LayerTypeMLDv2MulticastListenerQuery  = gopacket.RegisterLayerType(139, gopacket.LayerTypeMetadata{Name: "MLDv2MulticastListenerQuery", Decoder: gopacket.DecodeFunc(decodeMLDv2MulticastListenerQuery)})
	LayerTypeTLS                          = gopacket.RegisterLayerType(140, gopacket.LayerTypeMetadata{Name: "TLS", Decoder: gopacket.DecodeFunc(decodeTLS)})
	LayerTypeModbusTCP                    = gopacket.RegisterLayerType(141, gopacket.LayerTypeMetadata{Name: "ModbusTCP", Decoder: gopacket.DecodeFunc(decodeModbusTCP)})
	LayerTypeRMCP                         = gopacket.RegisterLayerType(142, gopacket.LayerTypeMetadata{Name: "RMCP", Decoder: gopacket.DecodeFunc(decodeRMCP)})
	LayerTypeASF                          = gopacket.RegisterLayerType(143, gopacket.LayerTypeMetadata{Name: "ASF", Decoder: gopacket.DecodeFunc(decodeASF)})
	LayerTypeASFPresencePong              = gopacket.RegisterLayerType(144, gopacket.LayerTypeMetadata{Name: "ASFPresencePong", Decoder: gopacket.DecodeFunc(decodeASFPresencePong)})
	LayerTypeERSPANII                     = gopacket.RegisterLayerType(145, gopacket.LayerTypeMetadata{Name: "ERSPAN Type II", Decoder: gopacket.DecodeFunc(decodeERSPANII)})
	LayerTypeRADIUS                       = gopacket.RegisterLayerType(146, gopacket.LayerTypeMetadata{Name: "RADIUS", Decoder: gopacket.DecodeFunc(decodeRADIUS)})
)
View Source
var (
	// LayerClassIPNetwork contains TCP/IP network layer types.
	LayerClassIPNetwork = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeIPv4,
		LayerTypeIPv6,
	})
	// LayerClassIPTransport contains TCP/IP transport layer types.
	LayerClassIPTransport = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeTCP,
		LayerTypeUDP,
		LayerTypeSCTP,
	})
	// LayerClassIPControl contains TCP/IP control protocols.
	LayerClassIPControl = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeICMPv4,
		LayerTypeICMPv6,
	})
	// LayerClassSCTPChunk contains SCTP chunk types (not the top-level SCTP
	// layer).
	LayerClassSCTPChunk = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeSCTPUnknownChunkType,
		LayerTypeSCTPData,
		LayerTypeSCTPInit,
		LayerTypeSCTPSack,
		LayerTypeSCTPHeartbeat,
		LayerTypeSCTPError,
		LayerTypeSCTPShutdown,
		LayerTypeSCTPShutdownAck,
		LayerTypeSCTPCookieEcho,
		LayerTypeSCTPEmptyLayer,
		LayerTypeSCTPInitAck,
		LayerTypeSCTPHeartbeatAck,
		LayerTypeSCTPAbort,
		LayerTypeSCTPShutdownComplete,
		LayerTypeSCTPCookieAck,
	})
	// LayerClassIPv6Extension contains IPv6 extension headers.
	LayerClassIPv6Extension = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeIPv6HopByHop,
		LayerTypeIPv6Routing,
		LayerTypeIPv6Fragment,
		LayerTypeIPv6Destination,
	})
	LayerClassIPSec = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeIPSecAH,
		LayerTypeIPSecESP,
	})
	// LayerClassICMPv6NDP contains ICMPv6 neighbor discovery protocol
	// messages.
	LayerClassICMPv6NDP = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeICMPv6RouterSolicitation,
		LayerTypeICMPv6RouterAdvertisement,
		LayerTypeICMPv6NeighborSolicitation,
		LayerTypeICMPv6NeighborAdvertisement,
		LayerTypeICMPv6Redirect,
	})
	// LayerClassMLDv1 contains multicast listener discovery protocol
	LayerClassMLDv1 = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeMLDv1MulticastListenerQuery,
		LayerTypeMLDv1MulticastListenerReport,
		LayerTypeMLDv1MulticastListenerDone,
	})
	// LayerClassMLDv2 contains multicast listener discovery protocol v2
	LayerClassMLDv2 = gopacket.NewLayerClass([]gopacket.LayerType{
		LayerTypeMLDv1MulticastListenerReport,
		LayerTypeMLDv1MulticastListenerDone,
		LayerTypeMLDv2MulticastListenerReport,
		LayerTypeMLDv1MulticastListenerQuery,
		LayerTypeMLDv2MulticastListenerQuery,
	})
)
View Source
var DHCPMagic uint32 = 0x63825363

DHCPMagic is the RFC 2131 "magic cooke" for DHCP.

View Source
var Dot11TypeMetadata [256]EnumMetadata
View Source
var EAPOLTypeMetadata [256]EnumMetadata
View Source
var ErrPrismExpectedMoreData = errors.New("Expected more data.")
View Source
var ErrPrismInvalidCode = errors.New("Invalid header code.")
View Source
var EthernetBroadcast = net.HardwareAddr{0xff, 0xff, 0xff, 0xff, 0xff, 0xff}

EthernetBroadcast is the broadcast MAC address used by Ethernet.

View Source
var EthernetTypeMetadata [65536]EnumMetadata
View Source
var FDDIFrameControlMetadata [256]EnumMetadata
View Source
var IPProtocolMetadata [256]EnumMetadata
View Source
var LinkTypeMetadata [256]EnumMetadata

MPLSPayloadDecoder is the decoder used to data encapsulated by each MPLS layer. MPLS contains no type information, so we have to explicitly decide which decoder to use. This is initially set to ProtocolGuessingDecoder, our simple attempt at guessing protocols based on the first few bytes of data available to us. However, if you know that in your environment MPLS always encapsulates a specific protocol, you may reset this.

PPPEndpoint is a singleton endpoint for PPP. Since there is no actual addressing for the two ends of a PPP connection, we use a singleton value named 'point' for each endpoint.

PPPFlow is a singleton flow for PPP. Since there is no actual addressing for the two ends of a PPP connection, we use a singleton value to represent the flow for all PPP connections.

View Source
var PPPTypeMetadata [65536]EnumMetadata
View Source
var PPPoECodeMetadata [256]EnumMetadata
View Source
var ProtocolFamilyMetadata [256]EnumMetadata
View Source
var RUDPPortNames = map[RUDPPort]string{}

RUDPPortNames contains the string names for all RUDP ports.

View Source
var SCTPChunkTypeMetadata [256]EnumMetadata
View Source
var SCTPPortNames = sctpPortNames

SCTPPortNames contains the port names for all SCTP ports.

View Source
var TCPPortNames = tcpPortNames

TCPPortNames contains the port names for all TCP ports.

View Source
var UDPLitePortNames = map[UDPLitePort]string{}

UDPLitePortNames contains the string names for all UDPLite ports.

View Source
var UDPPortNames = udpPortNames

UDPPortNames contains the port names for all UDP ports.

View Source
var USBTransportTypeMetadata [256]EnumMetadata

Functions

func FuzzLayer

func FuzzLayer(data []byte) int

FuzzLayer is a fuzz target for the layers package of gopacket A fuzz target is a function processing a binary blob (byte slice) The process here is to interpret this data as a packet, and print the layers contents. The decoding options and the starting layer are encoded in the first bytes. The function returns 1 if this is a valid packet (no error layer)

func GetLCMLayerType

func GetLCMLayerType(fingerprint LCMFingerprint) gopacket.LayerType

GetLCMLayerType returns the underlying LCM message's LayerType. This LayerType has to be registered by using RegisterLCMLayerType.

func NewIPEndpoint

func NewIPEndpoint(a net.IP) gopacket.Endpoint

NewIPEndpoint creates a new IP (v4 or v6) endpoint from a net.IP address. It returns gopacket.InvalidEndpoint if the IP address is invalid.

func NewMACEndpoint

func NewMACEndpoint(a net.HardwareAddr) gopacket.Endpoint

NewMACEndpoint returns a new MAC address endpoint.

func NewRUDPPortEndpoint

func NewRUDPPortEndpoint(p RUDPPort) gopacket.Endpoint

NewRUDPPortEndpoint returns an endpoint based on a RUDP port.

func NewSCTPPortEndpoint

func NewSCTPPortEndpoint(p SCTPPort) gopacket.Endpoint

NewSCTPPortEndpoint returns an endpoint based on a SCTP port.

func NewTCPPortEndpoint

func NewTCPPortEndpoint(p TCPPort) gopacket.Endpoint

NewTCPPortEndpoint returns an endpoint based on a TCP port.

func NewUDPLitePortEndpoint

func NewUDPLitePortEndpoint(p UDPLitePort) gopacket.Endpoint

NewUDPLitePortEndpoint returns an endpoint based on a UDPLite port.

func NewUDPPortEndpoint

func NewUDPPortEndpoint(p UDPPort) gopacket.Endpoint

NewUDPPortEndpoint returns an endpoint based on a UDP port.

func RegisterASFLayerType

func RegisterASFLayerType(a ASFDataIdentifier, l gopacket.LayerType)

RegisterASFLayerType allows specifying that the data block of ASF packets with a given enterprise number and type should be processed by a given layer type. This overrides any existing registrations, including defaults.

func RegisterLCMLayerType

func RegisterLCMLayerType(num int, name string, fingerprint LCMFingerprint,
	decoder gopacket.Decoder) gopacket.LayerType

RegisterLCMLayerType allows users to register decoders for the underlying LCM payload. This is done based on the fingerprint that every LCM message contains and which identifies it uniquely. If num is not the zero value it will be used when registering with RegisterLayerType towards gopacket, otherwise an incremental value starting from 1001 will be used.

func RegisterRMCPLayerType

func RegisterRMCPLayerType(c RMCPClass, l gopacket.LayerType)

RegisterRMCPLayerType allows specifying that the payload of a RMCP packet of a certain class should processed by the provided layer type. This overrides any existing registrations, including defaults.

func RegisterTCPPortLayerType

func RegisterTCPPortLayerType(port TCPPort, layerType gopacket.LayerType)

RegisterTCPPortLayerType creates a new mapping between a TCPPort and an underlaying LayerType.

func RegisterUDPPortLayerType

func RegisterUDPPortLayerType(port UDPPort, layerType gopacket.LayerType)

RegisterUDPPortLayerType creates a new mapping between a UDPPort and an underlaying LayerType.

Types

type ARP

type ARP struct {
	BaseLayer
	AddrType          LinkType
	Protocol          EthernetType
	HwAddressSize     uint8
	ProtAddressSize   uint8
	Operation         uint16
	SourceHwAddress   []byte
	SourceProtAddress []byte
	DstHwAddress      []byte
	DstProtAddress    []byte
}

ARP is a ARP packet header.

func (*ARP) CanDecode

func (arp *ARP) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ARP) DecodeFromBytes

func (arp *ARP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ARP) LayerType

func (arp *ARP) LayerType() gopacket.LayerType

LayerType returns LayerTypeARP

func (*ARP) NextLayerType

func (arp *ARP) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ARP) SerializeTo

func (arp *ARP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ASExternalLSA

type ASExternalLSA struct {
	Flags             uint8
	Metric            uint32
	PrefixLength      uint8
	PrefixOptions     uint8
	RefLSType         uint16
	AddressPrefix     []byte
	ForwardingAddress []byte
	ExternalRouteTag  uint32
	RefLinkStateID    uint32
}

ASExternalLSA is the struct from RFC 5340 A.4.7.

type ASExternalLSAV2

type ASExternalLSAV2 struct {
	NetworkMask       uint32
	ExternalBit       uint8
	Metric            uint32
	ForwardingAddress uint32
	ExternalRouteTag  uint32
}

ASExternalLSAV2 is the struct from RFC 2328 A.4.5.

type ASF

type ASF struct {
	BaseLayer
	ASFDataIdentifier

	// Tag is used to match request/response pairs. The tag of a response is set
	// to that of the message it is responding to. If a message is
	// unidirectional, i.e. not part of a request/response pair, this is set to
	// 255.
	Tag uint8

	// Length is the length of this layer's payload in bytes.
	Length uint8
}

ASF defines ASF's generic RMCP message Data block format. See section 3.2.2.3.

func (*ASF) CanDecode

func (a *ASF) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeASF. It partially satisfies DecodingLayer.

func (*ASF) DecodeFromBytes

func (a *ASF) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes makes the layer represent the provided bytes. It partially satisfies DecodingLayer.

func (*ASF) LayerType

func (*ASF) LayerType() gopacket.LayerType

LayerType returns LayerTypeASF. It partially satisfies Layer and SerializableLayer.

func (*ASF) NextLayerType

func (a *ASF) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type corresponding to the message type of this ASF data layer. This partially satisfies DecodingLayer.

func (*ASF) SerializeTo

func (a *ASF) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized fom of this layer into the SerializeBuffer, partially satisfying SerializableLayer.

type ASFDataIdentifier

type ASFDataIdentifier struct {

	// Enterprise is the IANA Enterprise Number associated with the entity that
	// defines the message type. A list can be found at
	// https://www.iana.org/assignments/enterprise-numbers/enterprise-numbers.
	// This can be thought of as the namespace for the message type.
	Enterprise uint32

	// Type is the message type, defined by the entity associated with the
	// enterprise above. No pressure, but in the context of EN 4542, 1 byte is
	// the difference between sending a ping and telling a machine to do an
	// unconditional power down (0x80 and 0x12 respectively).
	Type uint8
}

ASFDataIdentifier encapsulates fields used to uniquely identify the format of the data block.

While the enterprise number is almost always 4542 (ASF-RMCP), we support registering layers using structs of this type as a key in case any users are using OEM-extensions.

func (ASFDataIdentifier) LayerType

func (a ASFDataIdentifier) LayerType() gopacket.LayerType

LayerType returns the payload layer type corresponding to an ASF message type.

type ASFEntity

type ASFEntity uint8

ASFEntity is the type of individual entities that a Presence Pong response can indicate support of. The entities currently implemented by the spec are IPMI and ASFv1.

type ASFInteraction

type ASFInteraction uint8

ASFInteraction is the type of individual interactions that a Presence Pong response can indicate support for. The interactions currently implemented by the spec are RMCP security extensions. Although not specified, IPMI uses this field to indicate support for DASH, which is supported as well.

type ASFPresencePong

type ASFPresencePong struct {
	BaseLayer

	// Enterprise is the IANA Enterprise Number of an entity that has defined
	// OEM-specific capabilities for the managed client. If no such capabilities
	// exist, this is set to ASF's IANA Enterprise Number.
	Enterprise uint32

	// OEM identifies OEM-specific capabilities. Its structure is defined by the
	// OEM. This is set to 0s if no OEM-specific capabilities exist. This
	// implementation does not change byte order from the wire for this field.
	OEM [4]byte

	// IPMI is true if IPMI is supported by the managed system. There is no
	// explicit version in the specification, however given the dates, this is
	// assumed to be IPMI v1.0.  Support for IPMI is contained in the "supported
	// entities" field of the presence pong payload.
	IPMI bool

	// ASFv1 indicates support for ASF v1.0. This seems somewhat redundant as
	// ASF must be supported in order to receive a response. This is contained
	// in the "supported entities" field of the presence pong payload.
	ASFv1 bool

	// SecurityExtensions indicates support for RMCP Security Extensions,
	// specified in ASF v2.0. This will always be false for v1.x
	// implementations. This is contained in the "supported interactions" field
	// of the presence pong payload. This field is defined in ASF v1.0, but has
	// no useful value.
	SecurityExtensions bool

	// DASH is true if DMTF DASH is supported. This is not specified in ASF
	// v2.0, but in IPMI v2.0, however the former does not preclude it, so we
	// support it.
	DASH bool
}

ASFPresencePong defines the structure of a Presence Pong message's payload. See section 3.2.4.3.

func (*ASFPresencePong) CanDecode

func (a *ASFPresencePong) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeASFPresencePong. It partially satisfies DecodingLayer.

func (*ASFPresencePong) DecodeFromBytes

func (a *ASFPresencePong) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes makes the layer represent the provided bytes. It partially satisfies DecodingLayer.

func (*ASFPresencePong) LayerType

func (*ASFPresencePong) LayerType() gopacket.LayerType

LayerType returns LayerTypeASFPresencePong. It partially satisfies Layer and SerializableLayer.

func (*ASFPresencePong) NextLayerType

func (a *ASFPresencePong) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypePayload, as there are no further layers to decode. This partially satisfies DecodingLayer.

func (*ASFPresencePong) SerializeTo

SerializeTo writes the serialized fom of this layer into the SerializeBuffer, partially satisfying SerializableLayer.

func (*ASFPresencePong) SupportsDCMI

func (a *ASFPresencePong) SupportsDCMI() bool

SupportsDCMI returns whether the Presence Pong message indicates support for the Data Center Management Interface, which is an extension of IPMI v2.0.

type BFD

type BFD struct {
	BaseLayer // Stores the packet bytes and payload bytes.

	Version                   BFDVersion          // Version of the BFD protocol.
	Diagnostic                BFDDiagnostic       // Diagnostic code for last state change
	State                     BFDState            // Current state
	Poll                      bool                // Requesting verification
	Final                     bool                // Responding to a received BFD Control packet that had the Poll (P) bit set.
	ControlPlaneIndependent   bool                // BFD implementation does not share fate with its control plane
	AuthPresent               bool                // Authentication Section is present and the session is to be authenticated
	Demand                    bool                // Demand mode is active
	Multipoint                bool                // For future point-to-multipoint extensions. Must always be zero
	DetectMultiplier          BFDDetectMultiplier // Detection time multiplier
	MyDiscriminator           BFDDiscriminator    // A unique, nonzero discriminator value
	YourDiscriminator         BFDDiscriminator    // discriminator received from the remote system.
	DesiredMinTxInterval      BFDTimeInterval     // Minimum interval, in microseconds,  the local system would like to use when transmitting BFD Control packets
	RequiredMinRxInterval     BFDTimeInterval     // Minimum interval, in microseconds, between received BFD Control packets that this system is capable of supporting
	RequiredMinEchoRxInterval BFDTimeInterval     // Minimum interval, in microseconds, between received BFD Echo packets that this system is capable of supporting
	AuthHeader                *BFDAuthHeader      // Authentication data, variable length.
}

BFD represents a BFD control message packet whose payload contains the control information required to for a BFD session.

References ----------

Wikipedia's BFD entry:

https://en.wikipedia.org/wiki/Bidirectional_Forwarding_Detection
This is the best place to get an overview of BFD.

RFC 5880 "Bidirectional Forwarding Detection (BFD)" (2010)

https://tools.ietf.org/html/rfc5880
This is the original BFD specification.

RFC 5881 "Bidirectional Forwarding Detection (BFD) for IPv4 and IPv6 (Single Hop)" (2010)

https://tools.ietf.org/html/rfc5881
Describes the use of the Bidirectional Forwarding Detection (BFD)
protocol over IPv4 and IPv6 for single IP hops.

func (*BFD) CanDecode

func (d *BFD) CanDecode() gopacket.LayerClass

CanDecode returns a set of layers that BFD objects can decode. As BFD objects can only decide the BFD layer, we can return just that layer. Apparently a single layer type implements LayerClass.

func (*BFD) DecodeFromBytes

func (d *BFD) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes analyses a byte slice and attempts to decode it as a BFD control packet.

Upon succeeds, it loads the BFD object with information about the packet and returns nil. Upon failure, it returns an error (non nil).

func (*BFD) LayerType

func (d *BFD) LayerType() gopacket.LayerType

LayerType returns the layer type of the BFD object, which is LayerTypeBFD.

func (*BFD) Length

func (d *BFD) Length() int

Length returns the data length of a BFD Control message which changes based on the presence and type of authentication contained in the message

func (*BFD) NextLayerType

func (d *BFD) NextLayerType() gopacket.LayerType

NextLayerType specifies the next layer that GoPacket should attempt to analyse after this (BFD) layer. As BFD packets do not contain any payload bytes, there are no further layers to analyse.

func (*BFD) Payload

func (d *BFD) Payload() []byte

Payload returns an empty byte slice as BFD packets do not carry a payload

func (*BFD) SerializeTo

func (d *BFD) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type BFDAuthData

type BFDAuthData []byte

BFDAuthData represents the authentication key or digest

type BFDAuthHeader

type BFDAuthHeader struct {
	AuthType       BFDAuthType
	KeyID          BFDAuthKeyID
	SequenceNumber BFDAuthSequenceNumber
	Data           BFDAuthData
}

BFDAuthHeader represents authentication data used in the BFD session

func (*BFDAuthHeader) Length

func (h *BFDAuthHeader) Length() int

Length returns the data length of the BFDAuthHeader based on the authentication type

type BFDAuthKeyID

type BFDAuthKeyID uint8

BFDAuthKeyID represents the authentication key ID in use for this packet. This allows multiple keys to be active simultaneously.

type BFDAuthSequenceNumber

type BFDAuthSequenceNumber uint32

BFDAuthSequenceNumber represents the sequence number for this packet. For Keyed Authentication, this value is incremented occasionally. For Meticulous Keyed Authentication, this value is incremented for each successive packet transmitted for a session. This provides protection against replay attacks.

type BFDAuthType

type BFDAuthType uint8

BFDAuthType represents the authentication used in the BFD session

const (
	BFDAuthTypeNone                BFDAuthType = 0 // No Auth
	BFDAuthTypePassword            BFDAuthType = 1 // Simple Password
	BFDAuthTypeKeyedMD5            BFDAuthType = 2 // Keyed MD5
	BFDAuthTypeMeticulousKeyedMD5  BFDAuthType = 3 // Meticulous Keyed MD5
	BFDAuthTypeKeyedSHA1           BFDAuthType = 4 // Keyed SHA1
	BFDAuthTypeMeticulousKeyedSHA1 BFDAuthType = 5 // Meticulous Keyed SHA1
)

constants that define the BFDAuthType

func (BFDAuthType) String

func (at BFDAuthType) String() string

String returns a string version of BFDAuthType

type BFDDetectMultiplier

type BFDDetectMultiplier uint8

BFDDetectMultiplier represents the negotiated transmit interval, multiplied by this value, provides the Detection Time for the receiving system in Asynchronous mode.

type BFDDiagnostic

type BFDDiagnostic uint8

BFDDiagnostic represents diagnostic infomation about a BFD session

const (
	BFDDiagnosticNone               BFDDiagnostic = 0 // No Diagnostic
	BFDDiagnosticTimeExpired        BFDDiagnostic = 1 // Control Detection Time Expired
	BFDDiagnosticEchoFailed         BFDDiagnostic = 2 // Echo Function Failed
	BFDDiagnosticNeighborSignalDown BFDDiagnostic = 3 // Neighbor Signaled Session Down
	BFDDiagnosticForwardPlaneReset  BFDDiagnostic = 4 // Forwarding Plane Reset
	BFDDiagnosticPathDown           BFDDiagnostic = 5 // Path Down
	BFDDiagnosticConcatPathDown     BFDDiagnostic = 6 // Concatenated Path Down
	BFDDiagnosticAdminDown          BFDDiagnostic = 7 // Administratively Down
	BFDDiagnosticRevConcatPathDown  BFDDiagnostic = 8 // Reverse Concatenated Path Dow
)

constants that define BFDDiagnostic flags

func (BFDDiagnostic) String

func (bd BFDDiagnostic) String() string

String returns a string version of BFDDiagnostic

type BFDDiscriminator

type BFDDiscriminator uint32

BFDDiscriminator is a unique, nonzero discriminator value used to demultiplex multiple BFD sessions between the same pair of systems.

type BFDState

type BFDState uint8

BFDState represents the state of a BFD session

const (
	BFDStateAdminDown BFDState = 0
	BFDStateDown      BFDState = 1
	BFDStateInit      BFDState = 2
	BFDStateUp        BFDState = 3
)

constants that define BFDState

func (BFDState) String

func (s BFDState) String() string

String returns a string version of BFDState

type BFDTimeInterval

type BFDTimeInterval uint32

BFDTimeInterval represents a time interval in microseconds

type BFDVersion

type BFDVersion uint8

BFDVersion represents the version as decoded from the BFD control message

type BaseLayer

type BaseLayer struct {
	// Contents is the set of bytes that make up this layer.  IE: for an
	// Ethernet packet, this would be the set of bytes making up the
	// Ethernet frame.
	Contents []byte
	// Payload is the set of bytes contained by (but not part of) this
	// Layer.  Again, to take Ethernet as an example, this would be the
	// set of bytes encapsulated by the Ethernet protocol.
	Payload []byte
}

BaseLayer is a convenience struct which implements the LayerData and LayerPayload functions of the Layer interface.

func (*BaseLayer) LayerContents

func (b *BaseLayer) LayerContents() []byte

LayerContents returns the bytes of the packet layer.

func (*BaseLayer) LayerPayload

func (b *BaseLayer) LayerPayload() []byte

LayerPayload returns the bytes contained within the packet layer.

type CDPAddressType

type CDPAddressType uint64

CDPAddressType is used to define TLV values within CDP addresses.

const (
	CDPAddressTypeCLNP      CDPAddressType = 0x81
	CDPAddressTypeIPV4      CDPAddressType = 0xcc
	CDPAddressTypeIPV6      CDPAddressType = 0xaaaa030000000800
	CDPAddressTypeDECNET    CDPAddressType = 0xaaaa030000006003
	CDPAddressTypeAPPLETALK CDPAddressType = 0xaaaa03000000809b
	CDPAddressTypeIPX       CDPAddressType = 0xaaaa030000008137
	CDPAddressTypeVINES     CDPAddressType = 0xaaaa0300000080c4
	CDPAddressTypeXNS       CDPAddressType = 0xaaaa030000000600
	CDPAddressTypeAPOLLO    CDPAddressType = 0xaaaa030000008019
)

CDP Address types.

func (CDPAddressType) String

func (a CDPAddressType) String() (s string)

type CDPCapabilities

type CDPCapabilities struct {
	L3Router        bool
	TBBridge        bool
	SPBridge        bool
	L2Switch        bool
	IsHost          bool
	IGMPFilter      bool
	L1Repeater      bool
	IsPhone         bool
	RemotelyManaged bool
}

CDPCapabilities represents the capabilities of a device

type CDPCapability

type CDPCapability uint32

CDPCapability is the set of capabilities advertised by a CDP device.

const (
	CDPCapMaskRouter     CDPCapability = 0x0001
	CDPCapMaskTBBridge   CDPCapability = 0x0002
	CDPCapMaskSPBridge   CDPCapability = 0x0004
	CDPCapMaskSwitch     CDPCapability = 0x0008
	CDPCapMaskHost       CDPCapability = 0x0010
	CDPCapMaskIGMPFilter CDPCapability = 0x0020
	CDPCapMaskRepeater   CDPCapability = 0x0040
	CDPCapMaskPhone      CDPCapability = 0x0080
	CDPCapMaskRemote     CDPCapability = 0x0100
)

CDPCapability values.

type CDPEnergyWise

type CDPEnergyWise struct {
	EncryptedData  []byte
	Unknown1       uint32
	SequenceNumber uint32
	ModelNumber    string
	Unknown2       uint16
	HardwareID     string
	SerialNum      string
	Unknown3       []byte
	Role           string
	Domain         string
	Name           string
	ReplyUnknown1  []byte
	ReplyPort      []byte
	ReplyAddress   []byte
	ReplyUnknown2  []byte
	ReplyUnknown3  []byte
}

CDPEnergyWise is used by CDP to monitor and control power usage.

type CDPEnergyWiseSubtype

type CDPEnergyWiseSubtype uint32

CDPEnergyWiseSubtype is used within CDP to define TLV values.

const (
	CDPEnergyWiseRole    CDPEnergyWiseSubtype = 0x00000007
	CDPEnergyWiseDomain  CDPEnergyWiseSubtype = 0x00000008
	CDPEnergyWiseName    CDPEnergyWiseSubtype = 0x00000009
	CDPEnergyWiseReplyTo CDPEnergyWiseSubtype = 0x00000017
)

CDPEnergyWiseSubtype values.

func (CDPEnergyWiseSubtype) String

func (t CDPEnergyWiseSubtype) String() (s string)

type CDPHello

type CDPHello struct {
	OUI              []byte
	ProtocolID       uint16
	ClusterMaster    net.IP
	Unknown1         net.IP
	Version          byte
	SubVersion       byte
	Status           byte
	Unknown2         byte
	ClusterCommander net.HardwareAddr
	SwitchMAC        net.HardwareAddr
	Unknown3         byte
	ManagementVLAN   uint16
}

CDPHello is a Cisco Hello message (undocumented, hence the "Unknown" fields)

type CDPLocation

type CDPLocation struct {
	Type     uint8 // Undocumented
	Location string
}

CDPLocation provides location information for a CDP device.

type CDPPowerDialogue

type CDPPowerDialogue struct {
	ID     uint16
	MgmtID uint16
	Values []uint32
}

CDPPowerDialogue encapsulates a Power Query/Reply

type CDPSparePairPoE

type CDPSparePairPoE struct {
	PSEFourWire  bool // Supported / Not supported
	PDArchShared bool // Shared / Independent
	PDRequestOn  bool // On / Off
	PSEOn        bool // On / Off
}

CDPSparePairPoE provides information on PoE.

type CDPTLVType

type CDPTLVType uint16

CDPTLVType is the type of each TLV value in a CiscoDiscovery packet.

const (
	CDPTLVDevID              CDPTLVType = 0x0001
	CDPTLVAddress            CDPTLVType = 0x0002
	CDPTLVPortID             CDPTLVType = 0x0003
	CDPTLVCapabilities       CDPTLVType = 0x0004
	CDPTLVVersion            CDPTLVType = 0x0005
	CDPTLVPlatform           CDPTLVType = 0x0006
	CDPTLVIPPrefix           CDPTLVType = 0x0007
	CDPTLVHello              CDPTLVType = 0x0008
	CDPTLVVTPDomain          CDPTLVType = 0x0009
	CDPTLVNativeVLAN         CDPTLVType = 0x000a
	CDPTLVFullDuplex         CDPTLVType = 0x000b
	CDPTLVVLANReply          CDPTLVType = 0x000e
	CDPTLVVLANQuery          CDPTLVType = 0x000f
	CDPTLVPower              CDPTLVType = 0x0010
	CDPTLVMTU                CDPTLVType = 0x0011
	CDPTLVExtendedTrust      CDPTLVType = 0x0012
	CDPTLVUntrustedCOS       CDPTLVType = 0x0013
	CDPTLVSysName            CDPTLVType = 0x0014
	CDPTLVSysOID             CDPTLVType = 0x0015
	CDPTLVMgmtAddresses      CDPTLVType = 0x0016
	CDPTLVLocation           CDPTLVType = 0x0017
	CDPTLVExternalPortID     CDPTLVType = 0x0018
	CDPTLVPowerRequested     CDPTLVType = 0x0019
	CDPTLVPowerAvailable     CDPTLVType = 0x001a
	CDPTLVPortUnidirectional CDPTLVType = 0x001b
	CDPTLVEnergyWise         CDPTLVType = 0x001d
	CDPTLVSparePairPOE       CDPTLVType = 0x001f
)

CDPTLVType values.

func (CDPTLVType) String

func (t CDPTLVType) String() (s string)

type CDPVLANDialogue

type CDPVLANDialogue struct {
	ID   uint8
	VLAN uint16
}

CDPVLANDialogue encapsulates a VLAN Query/Reply

type CiscoDiscovery

type CiscoDiscovery struct {
	BaseLayer
	Version  byte
	TTL      byte
	Checksum uint16
	Values   []CiscoDiscoveryValue
}

CiscoDiscovery is a packet layer containing the Cisco Discovery Protocol. See http://www.cisco.com/univercd/cc/td/doc/product/lan/trsrb/frames.htm#31885

func (*CiscoDiscovery) LayerType

func (c *CiscoDiscovery) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeCiscoDiscovery.

type CiscoDiscoveryInfo

type CiscoDiscoveryInfo struct {
	BaseLayer
	CDPHello
	DeviceID         string
	Addresses        []net.IP
	PortID           string
	Capabilities     CDPCapabilities
	Version          string
	Platform         string
	IPPrefixes       []net.IPNet
	VTPDomain        string
	NativeVLAN       uint16
	FullDuplex       bool
	VLANReply        CDPVLANDialogue
	VLANQuery        CDPVLANDialogue
	PowerConsumption uint16
	MTU              uint32
	ExtendedTrust    uint8
	UntrustedCOS     uint8
	SysName          string
	SysOID           string
	MgmtAddresses    []net.IP
	Location         CDPLocation
	PowerRequest     CDPPowerDialogue
	PowerAvailable   CDPPowerDialogue
	SparePairPoe     CDPSparePairPoE
	EnergyWise       CDPEnergyWise
	Unknown          []CiscoDiscoveryValue
}

CiscoDiscoveryInfo represents the decoded details for a set of CiscoDiscoveryValues

func (*CiscoDiscoveryInfo) LayerType

func (c *CiscoDiscoveryInfo) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeCiscoDiscoveryInfo.

type CiscoDiscoveryValue

type CiscoDiscoveryValue struct {
	Type   CDPTLVType
	Length uint16
	Value  []byte
}

CiscoDiscoveryValue is a TLV value inside a CiscoDiscovery packet layer.

type DHCPMsgType

type DHCPMsgType byte

DHCPMsgType represents a DHCP operation

const (
	DHCPMsgTypeUnspecified DHCPMsgType = iota
	DHCPMsgTypeDiscover
	DHCPMsgTypeOffer
	DHCPMsgTypeRequest
	DHCPMsgTypeDecline
	DHCPMsgTypeAck
	DHCPMsgTypeNak
	DHCPMsgTypeRelease
	DHCPMsgTypeInform
)

Constants that represent DHCP operations

func (DHCPMsgType) String

func (o DHCPMsgType) String() string

String returns a string version of a DHCPMsgType.

type DHCPOp

type DHCPOp byte

DHCPOp rerprents a bootp operation

const (
	DHCPOpRequest DHCPOp = 1
	DHCPOpReply   DHCPOp = 2
)

bootp operations

func (DHCPOp) String

func (o DHCPOp) String() string

String returns a string version of a DHCPOp.

type DHCPOpt

type DHCPOpt byte

DHCPOpt represents a DHCP option or parameter from RFC-2132

const (
	DHCPOptPad                   DHCPOpt = 0
	DHCPOptSubnetMask            DHCPOpt = 1   // 4, net.IP
	DHCPOptTimeOffset            DHCPOpt = 2   // 4, int32 (signed seconds from UTC)
	DHCPOptRouter                DHCPOpt = 3   // n*4, [n]net.IP
	DHCPOptTimeServer            DHCPOpt = 4   // n*4, [n]net.IP
	DHCPOptNameServer            DHCPOpt = 5   // n*4, [n]net.IP
	DHCPOptDNS                   DHCPOpt = 6   // n*4, [n]net.IP
	DHCPOptLogServer             DHCPOpt = 7   // n*4, [n]net.IP
	DHCPOptCookieServer          DHCPOpt = 8   // n*4, [n]net.IP
	DHCPOptLPRServer             DHCPOpt = 9   // n*4, [n]net.IP
	DHCPOptImpressServer         DHCPOpt = 10  // n*4, [n]net.IP
	DHCPOptResLocServer          DHCPOpt = 11  // n*4, [n]net.IP
	DHCPOptHostname              DHCPOpt = 12  // n, string
	DHCPOptBootfileSize          DHCPOpt = 13  // 2, uint16
	DHCPOptMeritDumpFile         DHCPOpt = 14  // >1, string
	DHCPOptDomainName            DHCPOpt = 15  // n, string
	DHCPOptSwapServer            DHCPOpt = 16  // n*4, [n]net.IP
	DHCPOptRootPath              DHCPOpt = 17  // n, string
	DHCPOptExtensionsPath        DHCPOpt = 18  // n, string
	DHCPOptIPForwarding          DHCPOpt = 19  // 1, bool
	DHCPOptSourceRouting         DHCPOpt = 20  // 1, bool
	DHCPOptPolicyFilter          DHCPOpt = 21  // 8*n, [n]{net.IP/net.IP}
	DHCPOptDatagramMTU           DHCPOpt = 22  // 2, uint16
	DHCPOptDefaultTTL            DHCPOpt = 23  // 1, byte
	DHCPOptPathMTUAgingTimeout   DHCPOpt = 24  // 4, uint32
	DHCPOptPathPlateuTableOption DHCPOpt = 25  // 2*n, []uint16
	DHCPOptInterfaceMTU          DHCPOpt = 26  // 2, uint16
	DHCPOptAllSubsLocal          DHCPOpt = 27  // 1, bool
	DHCPOptBroadcastAddr         DHCPOpt = 28  // 4, net.IP
	DHCPOptMaskDiscovery         DHCPOpt = 29  // 1, bool
	DHCPOptMaskSupplier          DHCPOpt = 30  // 1, bool
	DHCPOptRouterDiscovery       DHCPOpt = 31  // 1, bool
	DHCPOptSolicitAddr           DHCPOpt = 32  // 4, net.IP
	DHCPOptStaticRoute           DHCPOpt = 33  // n*8, [n]{net.IP/net.IP} -- note the 2nd is router not mask
	DHCPOptARPTrailers           DHCPOpt = 34  // 1, bool
	DHCPOptARPTimeout            DHCPOpt = 35  // 4, uint32
	DHCPOptEthernetEncap         DHCPOpt = 36  // 1, bool
	DHCPOptTCPTTL                DHCPOpt = 37  // 1, byte
	DHCPOptTCPKeepAliveInt       DHCPOpt = 38  // 4, uint32
	DHCPOptTCPKeepAliveGarbage   DHCPOpt = 39  // 1, bool
	DHCPOptNISDomain             DHCPOpt = 40  // n, string
	DHCPOptNISServers            DHCPOpt = 41  // 4*n,  [n]net.IP
	DHCPOptNTPServers            DHCPOpt = 42  // 4*n, [n]net.IP
	DHCPOptVendorOption          DHCPOpt = 43  // n, [n]byte // may be encapsulated.
	DHCPOptNetBIOSTCPNS          DHCPOpt = 44  // 4*n, [n]net.IP
	DHCPOptNetBIOSTCPDDS         DHCPOpt = 45  // 4*n, [n]net.IP
	DHCPOptNETBIOSTCPNodeType    DHCPOpt = 46  // 1, magic byte
	DHCPOptNetBIOSTCPScope       DHCPOpt = 47  // n, string
	DHCPOptXFontServer           DHCPOpt = 48  // n, string
	DHCPOptXDisplayManager       DHCPOpt = 49  // n, string
	DHCPOptRequestIP             DHCPOpt = 50  // 4, net.IP
	DHCPOptLeaseTime             DHCPOpt = 51  // 4, uint32
	DHCPOptExtOptions            DHCPOpt = 52  // 1, 1/2/3
	DHCPOptMessageType           DHCPOpt = 53  // 1, 1-7
	DHCPOptServerID              DHCPOpt = 54  // 4, net.IP
	DHCPOptParamsRequest         DHCPOpt = 55  // n, []byte
	DHCPOptMessage               DHCPOpt = 56  // n, 3
	DHCPOptMaxMessageSize        DHCPOpt = 57  // 2, uint16
	DHCPOptT1                    DHCPOpt = 58  // 4, uint32
	DHCPOptT2                    DHCPOpt = 59  // 4, uint32
	DHCPOptClassID               DHCPOpt = 60  // n, []byte
	DHCPOptClientID              DHCPOpt = 61  // n >=  2, []byte
	DHCPOptDomainSearch          DHCPOpt = 119 // n, string
	DHCPOptSIPServers            DHCPOpt = 120 // n, url
	DHCPOptClasslessStaticRoute  DHCPOpt = 121 //
	DHCPOptMUDURLV4              DHCPOpt = 161 // n, string
	DHCPOptEnd                   DHCPOpt = 255
)

Constants for the DHCPOpt options.

func (DHCPOpt) String

func (o DHCPOpt) String() string

String returns a string version of a DHCPOpt.

type DHCPOption

type DHCPOption struct {
	Type   DHCPOpt
	Length uint8
	Data   []byte
}

DHCPOption rerpresents a DHCP option.

func NewDHCPOption

func NewDHCPOption(t DHCPOpt, data []byte) DHCPOption

NewDHCPOption constructs a new DHCPOption with a given type and data.

func (DHCPOption) String

func (o DHCPOption) String() string

String returns a string version of a DHCP Option.

type DHCPOptions

type DHCPOptions []DHCPOption

DHCPOptions is used to get nicely printed option lists which would normally be cut off after 5 options.

func (DHCPOptions) String

func (o DHCPOptions) String() string

String returns a string version of the options list.

type DHCPv4

type DHCPv4 struct {
	BaseLayer
	Operation    DHCPOp
	HardwareType LinkType
	HardwareLen  uint8
	HardwareOpts uint8
	Xid          uint32
	Secs         uint16
	Flags        uint16
	ClientIP     net.IP
	YourClientIP net.IP
	NextServerIP net.IP
	RelayAgentIP net.IP
	ClientHWAddr net.HardwareAddr
	ServerName   []byte
	File         []byte
	Options      DHCPOptions
}

DHCPv4 contains data for a single DHCP packet.

func (*DHCPv4) CanDecode

func (d *DHCPv4) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*DHCPv4) DecodeFromBytes

func (d *DHCPv4) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*DHCPv4) LayerType

func (d *DHCPv4) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeDHCPv4

func (*DHCPv4) Len

func (d *DHCPv4) Len() uint16

Len returns the length of a DHCPv4 packet.

func (*DHCPv4) NextLayerType

func (d *DHCPv4) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*DHCPv4) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type DHCPv4Error

type DHCPv4Error string

DHCPv4Error is used for constant errors for DHCPv4. It is needed for test asserts.

func (DHCPv4Error) Error

func (d DHCPv4Error) Error() string

DHCPv4Error implements error interface.

type DHCPv6

type DHCPv6 struct {
	BaseLayer
	MsgType       DHCPv6MsgType
	HopCount      uint8
	LinkAddr      net.IP
	PeerAddr      net.IP
	TransactionID []byte
	Options       DHCPv6Options
}

DHCPv6 contains data for a single DHCP packet.

func (*DHCPv6) CanDecode

func (d *DHCPv6) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*DHCPv6) DecodeFromBytes

func (d *DHCPv6) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*DHCPv6) LayerType

func (d *DHCPv6) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeDHCPv6

func (*DHCPv6) Len

func (d *DHCPv6) Len() int

Len returns the length of a DHCPv6 packet.

func (*DHCPv6) NextLayerType

func (d *DHCPv6) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*DHCPv6) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type DHCPv6DUID

type DHCPv6DUID struct {
	Type DHCPv6DUIDType
	// LLT, LL
	HardwareType []byte
	// EN
	EnterpriseNumber []byte
	// LLT
	Time []byte
	// LLT, LL
	LinkLayerAddress net.HardwareAddr
	// EN
	Identifier []byte
}

DHCPv6DUID means DHCP Unique Identifier as stated in RFC 3315, section 9 (https://tools.ietf.org/html/rfc3315#page-19)

func (*DHCPv6DUID) DecodeFromBytes

func (d *DHCPv6DUID) DecodeFromBytes(data []byte) error

DecodeFromBytes decodes the given bytes into a DHCPv6DUID

func (*DHCPv6DUID) Encode

func (d *DHCPv6DUID) Encode() []byte

Encode encodes the DHCPv6DUID in a slice of bytes

func (*DHCPv6DUID) Len

func (d *DHCPv6DUID) Len() int

Len returns the length of the DHCPv6DUID, respecting the type

func (*DHCPv6DUID) String

func (d *DHCPv6DUID) String() string

type DHCPv6DUIDType

type DHCPv6DUIDType uint16

DHCPv6DUIDType represents a DHCP DUID - RFC-3315

const (
	DHCPv6DUIDTypeLLT DHCPv6DUIDType = iota + 1
	DHCPv6DUIDTypeEN
	DHCPv6DUIDTypeLL
)

Constants for the DHCPv6DUIDType.

func (DHCPv6DUIDType) String

func (o DHCPv6DUIDType) String() string

String returns a string version of a DHCPv6DUIDType.

type DHCPv6MsgType

type DHCPv6MsgType byte

DHCPv6MsgType represents a DHCPv6 operation

const (
	DHCPv6MsgTypeUnspecified DHCPv6MsgType = iota
	DHCPv6MsgTypeSolicit
	DHCPv6MsgTypeAdvertise
	DHCPv6MsgTypeRequest
	DHCPv6MsgTypeConfirm
	DHCPv6MsgTypeRenew
	DHCPv6MsgTypeRebind
	DHCPv6MsgTypeReply
	DHCPv6MsgTypeRelease
	DHCPv6MsgTypeDecline
	DHCPv6MsgTypeReconfigure
	DHCPv6MsgTypeInformationRequest
	DHCPv6MsgTypeRelayForward
	DHCPv6MsgTypeRelayReply
)

Constants that represent DHCP operations

func (DHCPv6MsgType) String

func (o DHCPv6MsgType) String() string

String returns a string version of a DHCPv6MsgType.

type DHCPv6Opt

type DHCPv6Opt uint16

DHCPv6Opt represents a DHCP option or parameter from RFC-3315

const (
	DHCPv6OptClientID           DHCPv6Opt = 1
	DHCPv6OptServerID           DHCPv6Opt = 2
	DHCPv6OptIANA               DHCPv6Opt = 3
	DHCPv6OptIATA               DHCPv6Opt = 4
	DHCPv6OptIAAddr             DHCPv6Opt = 5
	DHCPv6OptOro                DHCPv6Opt = 6
	DHCPv6OptPreference         DHCPv6Opt = 7
	DHCPv6OptElapsedTime        DHCPv6Opt = 8
	DHCPv6OptRelayMessage       DHCPv6Opt = 9
	DHCPv6OptAuth               DHCPv6Opt = 11
	DHCPv6OptUnicast            DHCPv6Opt = 12
	DHCPv6OptStatusCode         DHCPv6Opt = 13
	DHCPv6OptRapidCommit        DHCPv6Opt = 14
	DHCPv6OptUserClass          DHCPv6Opt = 15
	DHCPv6OptVendorClass        DHCPv6Opt = 16
	DHCPv6OptVendorOpts         DHCPv6Opt = 17
	DHCPv6OptInterfaceID        DHCPv6Opt = 18
	DHCPv6OptReconfigureMessage DHCPv6Opt = 19
	DHCPv6OptReconfigureAccept  DHCPv6Opt = 20

	// RFC 3319 Session Initiation Protocol (SIP)
	DHCPv6OptSIPServersDomainList  DHCPv6Opt = 21
	DHCPv6OptSIPServersAddressList DHCPv6Opt = 22

	// RFC 3646 DNS Configuration
	DHCPv6OptDNSServers DHCPv6Opt = 23
	DHCPv6OptDomainList DHCPv6Opt = 24

	// RFC 3633 Prefix Delegation
	DHCPv6OptIAPD     DHCPv6Opt = 25
	DHCPv6OptIAPrefix DHCPv6Opt = 26

	// RFC 3898 Network Information Service (NIS)
	DHCPv6OptNISServers     DHCPv6Opt = 27
	DHCPv6OptNISPServers    DHCPv6Opt = 28
	DHCPv6OptNISDomainName  DHCPv6Opt = 29
	DHCPv6OptNISPDomainName DHCPv6Opt = 30

	// RFC 4075 Simple Network Time Protocol (SNTP)
	DHCPv6OptSNTPServers DHCPv6Opt = 31

	// RFC 4242 Information Refresh Time Option
	DHCPv6OptInformationRefreshTime DHCPv6Opt = 32

	// RFC 4280 Broadcast and Multicast Control Servers
	DHCPv6OptBCMCSServerDomainNameList DHCPv6Opt = 33
	DHCPv6OptBCMCSServerAddressList    DHCPv6Opt = 34

	// RFC 4776 Civic Address ConfigurationOption
	DHCPv6OptGeoconfCivic DHCPv6Opt = 36

	// RFC 4649 Relay Agent Remote-ID
	DHCPv6OptRemoteID DHCPv6Opt = 37

	// RFC 4580 Relay Agent Subscriber-ID
	DHCPv6OptSubscriberID DHCPv6Opt = 38

	// RFC 4704 Client Full Qualified Domain Name (FQDN)
	DHCPv6OptClientFQDN DHCPv6Opt = 39

	// RFC 5192 Protocol for Carrying Authentication for Network Access (PANA)
	DHCPv6OptPanaAgent DHCPv6Opt = 40

	// RFC 4833 Timezone Options
	DHCPv6OptNewPOSIXTimezone DHCPv6Opt = 41
	DHCPv6OptNewTZDBTimezone  DHCPv6Opt = 42

	// RFC 4994 Relay Agent Echo Request
	DHCPv6OptEchoRequestOption DHCPv6Opt = 43

	// RFC 5007 Leasequery
	DHCPv6OptLQQuery      DHCPv6Opt = 44
	DHCPv6OptCLTTime      DHCPv6Opt = 45
	DHCPv6OptClientData   DHCPv6Opt = 46
	DHCPv6OptLQRelayData  DHCPv6Opt = 47
	DHCPv6OptLQClientLink DHCPv6Opt = 48

	// RFC 6610 Home Information Discovery in Mobile IPv6 (MIPv6)
	DHCPv6OptMIP6HNIDF DHCPv6Opt = 49
	DHCPv6OptMIP6VDINF DHCPv6Opt = 50
	DHCPv6OptMIP6IDINF DHCPv6Opt = 69
	DHCPv6OptMIP6UDINF DHCPv6Opt = 70
	DHCPv6OptMIP6HNP   DHCPv6Opt = 71
	DHCPv6OptMIP6HAA   DHCPv6Opt = 72
	DHCPv6OptMIP6HAF   DHCPv6Opt = 73

	// RFC 5223 Discovering Location-to-Service Translation (LoST) Servers
	DHCPv6OptV6LOST DHCPv6Opt = 51

	// RFC 5417 Control And Provisioning of Wireless Access Points (CAPWAP)
	DHCPv6OptCAPWAPACV6 DHCPv6Opt = 52

	// RFC 5460 Bulk Leasequery
	DHCPv6OptRelayID DHCPv6Opt = 53

	// RFC 5678 IEEE 802.21 Mobility Services (MoS) Discovery
	DHCPv6OptIPv6AddressMoS DHCPv6Opt = 54
	DHCPv6OptIPv6FQDNMoS    DHCPv6Opt = 55

	// RFC 5908 NTP Server Option
	DHCPv6OptNTPServer DHCPv6Opt = 56

	// RFC 5986 Discovering the Local Location Information Server (LIS)
	DHCPv6OptV6AccessDomain DHCPv6Opt = 57

	// RFC 5986 SIP User Agent
	DHCPv6OptSIPUACSList DHCPv6Opt = 58

	// RFC 5970 Options for Network Boot
	DHCPv6OptBootFileURL    DHCPv6Opt = 59
	DHCPv6OptBootFileParam  DHCPv6Opt = 60
	DHCPv6OptClientArchType DHCPv6Opt = 61
	DHCPv6OptNII            DHCPv6Opt = 62

	// RFC 6225 Coordinate-Based Location Configuration Information
	DHCPv6OptGeolocation DHCPv6Opt = 63

	// RFC 6334 Dual-Stack Lite
	DHCPv6OptAFTRName DHCPv6Opt = 64

	// RFC 6440 EAP Re-authentication Protocol (ERP)
	DHCPv6OptERPLocalDomainName DHCPv6Opt = 65

	// RFC 6422 Relay-Supplied DHCP Options
	DHCPv6OptRSOO DHCPv6Opt = 66

	// RFC 6603 Prefix Exclude Option for DHCPv6-based Prefix Delegation
	DHCPv6OptPDExclude DHCPv6Opt = 67

	// RFC 6607 Virtual Subnet Selection
	DHCPv6OptVSS DHCPv6Opt = 68

	// RFC 6731 Improved Recursive DNS Server Selection for Multi-Interfaced Nodes
	DHCPv6OptRDNSSSelection DHCPv6Opt = 74

	// RFC 6784 Kerberos Options for DHCPv6
	DHCPv6OptKRBPrincipalName DHCPv6Opt = 75
	DHCPv6OptKRBRealmName     DHCPv6Opt = 76
	DHCPv6OptKRBKDC           DHCPv6Opt = 77

	// RFC 6939 Client Link-Layer Address Option
	DHCPv6OptClientLinkLayerAddress DHCPv6Opt = 79

	// RFC 6977 Triggering DHCPv6 Reconfiguration from Relay Agents
	DHCPv6OptLinkAddress DHCPv6Opt = 80

	// RFC 7037 RADIUS Option for the DHCPv6 Relay Agent
	DHCPv6OptRADIUS DHCPv6Opt = 81

	// RFC 7083 Modification to Default Values of SOL_MAX_RT and INF_MAX_RT
	DHCPv6OptSolMaxRt DHCPv6Opt = 82
	DHCPv6OptInfMaxRt DHCPv6Opt = 83

	// RFC 7078 Distributing Address Selection Policy
	DHCPv6OptAddrSel      DHCPv6Opt = 84
	DHCPv6OptAddrSelTable DHCPv6Opt = 85

	// RFC 7291 DHCP Options for the Port Control Protocol (PCP)
	DHCPv6OptV6PCPServer DHCPv6Opt = 86

	// RFC 7341 DHCPv4-over-DHCPv6 (DHCP 4o6) Transport
	DHCPv6OptDHCPv4Message          DHCPv6Opt = 87
	DHCPv6OptDHCPv4OverDHCPv6Server DHCPv6Opt = 88

	// RFC 7598 Configuration of Softwire Address and Port-Mapped Clients
	DHCPv6OptS46Rule           DHCPv6Opt = 89
	DHCPv6OptS46BR             DHCPv6Opt = 90
	DHCPv6OptS46DMR            DHCPv6Opt = 91
	DHCPv6OptS46V4V4Bind       DHCPv6Opt = 92
	DHCPv6OptS46PortParameters DHCPv6Opt = 93
	DHCPv6OptS46ContMAPE       DHCPv6Opt = 94
	DHCPv6OptS46ContMAPT       DHCPv6Opt = 95
	DHCPv6OptS46ContLW         DHCPv6Opt = 96

	// RFC 7600 IPv4 Residual Deployment via IPv6
	DHCPv6Opt4RD           DHCPv6Opt = 97
	DHCPv6Opt4RDMapRule    DHCPv6Opt = 98
	DHCPv6Opt4RDNonMapRule DHCPv6Opt = 99

	// RFC 7653 Active Leasequery
	DHCPv6OptLQBaseTime  DHCPv6Opt = 100
	DHCPv6OptLQStartTime DHCPv6Opt = 101
	DHCPv6OptLQEndTime   DHCPv6Opt = 102

	// RFC 7710 Captive-Portal Identification
	DHCPv6OptCaptivePortal DHCPv6Opt = 103

	// RFC 7774 Multicast Protocol for Low-Power and Lossy Networks (MPL) Parameter Configuration
	DHCPv6OptMPLParameters DHCPv6Opt = 104

	// RFC 7839 Access-Network-Identifier (ANI)
	DHCPv6OptANIATT           DHCPv6Opt = 105
	DHCPv6OptANINetworkName   DHCPv6Opt = 106
	DHCPv6OptANIAPName        DHCPv6Opt = 107
	DHCPv6OptANIAPBSSID       DHCPv6Opt = 108
	DHCPv6OptANIOperatorID    DHCPv6Opt = 109
	DHCPv6OptANIOperatorRealm DHCPv6Opt = 110

	// RFC 8026 Unified IPv4-in-IPv6 Softwire Customer Premises Equipment (CPE)
	DHCPv6OptS46Priority DHCPv6Opt = 111

	// draft-ietf-opsawg-mud-25 Manufacturer Usage Description (MUD)
	DHCPv6OptMUDURLV6 DHCPv6Opt = 112

	// RFC 8115 IPv4-Embedded Multicast and Unicast IPv6 Prefixes
	DHCPv6OptV6Prefix64 DHCPv6Opt = 113

	// RFC 8156 DHCPv6 Failover Protocol
	DHCPv6OptFBindingStatus           DHCPv6Opt = 114
	DHCPv6OptFConnectFlags            DHCPv6Opt = 115
	DHCPv6OptFDNSRemovalInfo          DHCPv6Opt = 116
	DHCPv6OptFDNSHostName             DHCPv6Opt = 117
	DHCPv6OptFDNSZoneName             DHCPv6Opt = 118
	DHCPv6OptFDNSFlags                DHCPv6Opt = 119
	DHCPv6OptFExpirationTime          DHCPv6Opt = 120
	DHCPv6OptFMaxUnacknowledgedBNDUPD DHCPv6Opt = 121
	DHCPv6OptFMCLT                    DHCPv6Opt = 122
	DHCPv6OptFPartnerLifetime         DHCPv6Opt = 123
	DHCPv6OptFPartnerLifetimeSent     DHCPv6Opt = 124
	DHCPv6OptFPartnerDownTime         DHCPv6Opt = 125
	DHCPv6OptFPartnerRawCltTime       DHCPv6Opt = 126
	DHCPv6OptFProtocolVersion         DHCPv6Opt = 127
	DHCPv6OptFKeepaliveTime           DHCPv6Opt = 128
	DHCPv6OptFReconfigureData         DHCPv6Opt = 129
	DHCPv6OptFRelationshipName        DHCPv6Opt = 130
	DHCPv6OptFServerFlags             DHCPv6Opt = 131
	DHCPv6OptFServerState             DHCPv6Opt = 132
	DHCPv6OptFStartTimeOfState        DHCPv6Opt = 133
	DHCPv6OptFStateExpirationTime     DHCPv6Opt = 134

	// RFC 8357 Generalized UDP Source Port for DHCP Relay
	DHCPv6OptRelayPort DHCPv6Opt = 135

	// draft-ietf-netconf-zerotouch-25 Zero Touch Provisioning for Networking Devices
	DHCPv6OptV6ZeroTouchRedirect DHCPv6Opt = 136

	// RFC 6153 Access Network Discovery and Selection Function (ANDSF) Discovery
	DHCPv6OptIPV6AddressANDSF DHCPv6Opt = 143
)

Constants for the DHCPv6Opt options.

func (DHCPv6Opt) String

func (o DHCPv6Opt) String() string

String returns a string version of a DHCPv6Opt.

type DHCPv6Option

type DHCPv6Option struct {
	Code   DHCPv6Opt
	Length uint16
	Data   []byte
}

DHCPv6Option rerpresents a DHCP option.

func NewDHCPv6Option

func NewDHCPv6Option(code DHCPv6Opt, data []byte) DHCPv6Option

NewDHCPv6Option constructs a new DHCPv6Option with a given type and data.

func (DHCPv6Option) String

func (o DHCPv6Option) String() string

String returns a string version of a DHCP Option.

type DHCPv6Options

type DHCPv6Options []DHCPv6Option

DHCPv6Options is used to get nicely printed option lists which would normally be cut off after 5 options.

func (DHCPv6Options) String

func (o DHCPv6Options) String() string

String returns a string version of the options list.

type DHCPv6StatusCode

type DHCPv6StatusCode uint16

DHCPv6StatusCode represents a DHCP status code - RFC-3315

const (
	DHCPv6StatusCodeSuccess DHCPv6StatusCode = iota
	DHCPv6StatusCodeUnspecFail
	DHCPv6StatusCodeNoAddrsAvail
	DHCPv6StatusCodeNoBinding
	DHCPv6StatusCodeNotOnLink
	DHCPv6StatusCodeUseMulticast
)

Constants for the DHCPv6StatusCode.

func (DHCPv6StatusCode) String

func (o DHCPv6StatusCode) String() string

String returns a string version of a DHCPv6StatusCode.

type DNS

type DNS struct {
	BaseLayer

	// Header fields
	ID     uint16
	QR     bool
	OpCode DNSOpCode

	AA bool  // Authoritative answer
	TC bool  // Truncated
	RD bool  // Recursion desired
	RA bool  // Recursion available
	Z  uint8 // Reserved for future use

	ResponseCode DNSResponseCode
	QDCount      uint16 // Number of questions to expect
	ANCount      uint16 // Number of answers to expect
	NSCount      uint16 // Number of authorities to expect
	ARCount      uint16 // Number of additional records to expect

	// Entries
	Questions   []DNSQuestion
	Answers     []DNSResourceRecord
	Authorities []DNSResourceRecord
	Additionals []DNSResourceRecord
	// contains filtered or unexported fields
}

DNS contains data from a single Domain Name Service packet.

func (*DNS) CanDecode

func (d *DNS) CanDecode() gopacket.LayerClass

CanDecode implements gopacket.DecodingLayer.

func (*DNS) DecodeFromBytes

func (d *DNS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the slice into the DNS struct.

func (*DNS) LayerType

func (d *DNS) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeDNS.

func (*DNS) NextLayerType

func (d *DNS) NextLayerType() gopacket.LayerType

NextLayerType implements gopacket.DecodingLayer.

func (*DNS) Payload

func (d *DNS) Payload() []byte

Payload returns nil.

func (*DNS) SerializeTo

func (d *DNS) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer.

type DNSClass

type DNSClass uint16

DNSClass defines the class associated with a request/response. Different DNS classes can be thought of as an array of parallel namespace trees.

const (
	DNSClassIN  DNSClass = 1   // Internet
	DNSClassCS  DNSClass = 2   // the CSNET class (Obsolete)
	DNSClassCH  DNSClass = 3   // the CHAOS class
	DNSClassHS  DNSClass = 4   // Hesiod [Dyer 87]
	DNSClassAny DNSClass = 255 // AnyClass
)

DNSClass known values.

func (DNSClass) String

func (dc DNSClass) String() string

type DNSMX

type DNSMX struct {
	Preference uint16
	Name       []byte
}

DNSMX is a mail exchange record, defining a mail server for a recipient's domain.

type DNSOPT

type DNSOPT struct {
	Code DNSOptionCode
	Data []byte
}

DNSOPT is a DNS Option, see RFC6891, section 6.1.2

func (DNSOPT) String

func (opt DNSOPT) String() string

type DNSOpCode

type DNSOpCode uint8

DNSOpCode defines a set of different operation types.

const (
	DNSOpCodeQuery  DNSOpCode = 0 // Query                  [RFC1035]
	DNSOpCodeIQuery DNSOpCode = 1 // Inverse Query Obsolete [RFC3425]
	DNSOpCodeStatus DNSOpCode = 2 // Status                 [RFC1035]
	DNSOpCodeNotify DNSOpCode = 4 // Notify                 [RFC1996]
	DNSOpCodeUpdate DNSOpCode = 5 // Update                 [RFC2136]
)

DNSOpCode known values.

func (DNSOpCode) String

func (doc DNSOpCode) String() string

type DNSOptionCode

type DNSOptionCode uint16

DNSOptionCode represents the code of a DNS Option, see RFC6891, section 6.1.2

const (
	DNSOptionCodeNSID             DNSOptionCode = 3
	DNSOptionCodeDAU              DNSOptionCode = 5
	DNSOptionCodeDHU              DNSOptionCode = 6
	DNSOptionCodeN3U              DNSOptionCode = 7
	DNSOptionCodeEDNSClientSubnet DNSOptionCode = 8
	DNSOptionCodeEDNSExpire       DNSOptionCode = 9
	DNSOptionCodeCookie           DNSOptionCode = 10
	DNSOptionCodeEDNSKeepAlive    DNSOptionCode = 11
	DNSOptionCodePadding          DNSOptionCode = 12
	DNSOptionCodeChain            DNSOptionCode = 13
	DNSOptionCodeEDNSKeyTag       DNSOptionCode = 14
	DNSOptionCodeEDNSClientTag    DNSOptionCode = 16
	DNSOptionCodeEDNSServerTag    DNSOptionCode = 17
	DNSOptionCodeDeviceID         DNSOptionCode = 26946
)

DNSOptionCode known values. See IANA

func (DNSOptionCode) String

func (doc DNSOptionCode) String() string

type DNSQuestion

type DNSQuestion struct {
	Name  []byte
	Type  DNSType
	Class DNSClass
}

DNSQuestion wraps a single request (question) within a DNS query.

type DNSResourceRecord

type DNSResourceRecord struct {
	// Header
	Name  []byte
	Type  DNSType
	Class DNSClass
	TTL   uint32

	// RDATA Raw Values
	DataLength uint16
	Data       []byte

	// RDATA Decoded Values
	IP             net.IP
	NS, CNAME, PTR []byte
	TXTs           [][]byte
	SOA            DNSSOA
	SRV            DNSSRV
	MX             DNSMX
	OPT            []DNSOPT // See RFC 6891, section 6.1.2
	URI            DNSURI

	// Undecoded TXT for backward compatibility
	TXT []byte
}

DNSResourceRecord wraps the data from a single DNS resource within a response.

func (*DNSResourceRecord) String

func (rr *DNSResourceRecord) String() string

type DNSResponseCode

type DNSResponseCode uint8

DNSResponseCode provides response codes for question answers.

const (
	DNSResponseCodeNoErr     DNSResponseCode = 0  // No error
	DNSResponseCodeFormErr   DNSResponseCode = 1  // Format Error                       [RFC1035]
	DNSResponseCodeServFail  DNSResponseCode = 2  // Server Failure                     [RFC1035]
	DNSResponseCodeNXDomain  DNSResponseCode = 3  // Non-Existent Domain                [RFC1035]
	DNSResponseCodeNotImp    DNSResponseCode = 4  // Not Implemented                    [RFC1035]
	DNSResponseCodeRefused   DNSResponseCode = 5  // Query Refused                      [RFC1035]
	DNSResponseCodeYXDomain  DNSResponseCode = 6  // Name Exists when it should not     [RFC2136]
	DNSResponseCodeYXRRSet   DNSResponseCode = 7  // RR Set Exists when it should not   [RFC2136]
	DNSResponseCodeNXRRSet   DNSResponseCode = 8  // RR Set that should exist does not  [RFC2136]
	DNSResponseCodeNotAuth   DNSResponseCode = 9  // Server Not Authoritative for zone  [RFC2136]
	DNSResponseCodeNotZone   DNSResponseCode = 10 // Name not contained in zone         [RFC2136]
	DNSResponseCodeBadVers   DNSResponseCode = 16 // Bad OPT Version                    [RFC2671]
	DNSResponseCodeBadSig    DNSResponseCode = 16 // TSIG Signature Failure             [RFC2845]
	DNSResponseCodeBadKey    DNSResponseCode = 17 // Key not recognized                 [RFC2845]
	DNSResponseCodeBadTime   DNSResponseCode = 18 // Signature out of time window       [RFC2845]
	DNSResponseCodeBadMode   DNSResponseCode = 19 // Bad TKEY Mode                      [RFC2930]
	DNSResponseCodeBadName   DNSResponseCode = 20 // Duplicate key name                 [RFC2930]
	DNSResponseCodeBadAlg    DNSResponseCode = 21 // Algorithm not supported            [RFC2930]
	DNSResponseCodeBadTruc   DNSResponseCode = 22 // Bad Truncation                     [RFC4635]
	DNSResponseCodeBadCookie DNSResponseCode = 23 // Bad/missing Server Cookie          [RFC7873]
)

DNSResponseCode known values.

func (DNSResponseCode) String

func (drc DNSResponseCode) String() string

type DNSSOA

type DNSSOA struct {
	MName, RName                            []byte
	Serial, Refresh, Retry, Expire, Minimum uint32
}

DNSSOA is a Start of Authority record. Each domain requires a SOA record at the cutover where a domain is delegated from its parent.

type DNSSRV

type DNSSRV struct {
	Priority, Weight, Port uint16
	Name                   []byte
}

DNSSRV is a Service record, defining a location (hostname/port) of a server/service.

type DNSType

type DNSType uint16

DNSType defines the type of data being requested/returned in a question/answer.

const (
	DNSTypeA     DNSType = 1   // a host address
	DNSTypeNS    DNSType = 2   // an authoritative name server
	DNSTypeMD    DNSType = 3   // a mail destination (Obsolete - use MX)
	DNSTypeMF    DNSType = 4   // a mail forwarder (Obsolete - use MX)
	DNSTypeCNAME DNSType = 5   // the canonical name for an alias
	DNSTypeSOA   DNSType = 6   // marks the start of a zone of authority
	DNSTypeMB    DNSType = 7   // a mailbox domain name (EXPERIMENTAL)
	DNSTypeMG    DNSType = 8   // a mail group member (EXPERIMENTAL)
	DNSTypeMR    DNSType = 9   // a mail rename domain name (EXPERIMENTAL)
	DNSTypeNULL  DNSType = 10  // a null RR (EXPERIMENTAL)
	DNSTypeWKS   DNSType = 11  // a well known service description
	DNSTypePTR   DNSType = 12  // a domain name pointer
	DNSTypeHINFO DNSType = 13  // host information
	DNSTypeMINFO DNSType = 14  // mailbox or mail list information
	DNSTypeMX    DNSType = 15  // mail exchange
	DNSTypeTXT   DNSType = 16  // text strings
	DNSTypeAAAA  DNSType = 28  // a IPv6 host address [RFC3596]
	DNSTypeSRV   DNSType = 33  // server discovery [RFC2782] [RFC6195]
	DNSTypeOPT   DNSType = 41  // OPT Pseudo-RR [RFC6891]
	DNSTypeURI   DNSType = 256 // URI RR [RFC7553]
)

DNSType known values.

func (DNSType) String

func (dt DNSType) String() string

type DNSURI

type DNSURI struct {
	Priority, Weight uint16
	Target           []byte
}

DNSURI is a URI record, defining a target (URI) of a server/service

type DbDescPkg

type DbDescPkg struct {
	Options      uint32
	InterfaceMTU uint16
	Flags        uint16
	DDSeqNumber  uint32
	LSAinfo      []LSAheader
}

DbDescPkg is the struct from RFC 5340 A.3.3.

type Dot11

type Dot11 struct {
	BaseLayer
	Type           Dot11Type
	Proto          uint8
	Flags          Dot11Flags
	DurationID     uint16
	Address1       net.HardwareAddr
	Address2       net.HardwareAddr
	Address3       net.HardwareAddr
	Address4       net.HardwareAddr
	SequenceNumber uint16
	FragmentNumber uint16
	Checksum       uint32
	QOS            *Dot11QOS
	HTControl      *Dot11HTControl
	DataLayer      gopacket.Layer
}

Dot11 provides an IEEE 802.11 base packet header. See http://standards.ieee.org/findstds/standard/802.11-2012.html for excruciating detail.

func (*Dot11) CanDecode

func (m *Dot11) CanDecode() gopacket.LayerClass

func (*Dot11) ChecksumValid

func (m *Dot11) ChecksumValid() bool

func (*Dot11) DecodeFromBytes

func (m *Dot11) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11) LayerType

func (m *Dot11) LayerType() gopacket.LayerType

func (*Dot11) NextLayerType

func (m *Dot11) NextLayerType() gopacket.LayerType

func (Dot11) SerializeTo

type Dot11ASEL

type Dot11ASEL struct {
	Command uint8
	Data    uint8
}

type Dot11AckPolicy

type Dot11AckPolicy uint8
const (
	Dot11AckPolicyNormal     Dot11AckPolicy = 0
	Dot11AckPolicyNone       Dot11AckPolicy = 1
	Dot11AckPolicyNoExplicit Dot11AckPolicy = 2
	Dot11AckPolicyBlock      Dot11AckPolicy = 3
)

func (Dot11AckPolicy) String

func (a Dot11AckPolicy) String() string

String provides a human readable string for Dot11AckPolicy. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the Dot11AckPolicy value, not its string.

type Dot11Algorithm

type Dot11Algorithm uint16
const (
	Dot11AlgorithmOpen      Dot11Algorithm = 0
	Dot11AlgorithmSharedKey Dot11Algorithm = 1
)

func (Dot11Algorithm) String

func (a Dot11Algorithm) String() string

String provides a human readable string for Dot11Algorithm. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the Dot11Algorithm value, not its string.

type Dot11CodingType

type Dot11CodingType uint8

func (Dot11CodingType) String

func (a Dot11CodingType) String() string

type Dot11Ctrl

type Dot11Ctrl struct {
	BaseLayer
}

Dot11Ctrl is a base for all IEEE 802.11 control layers.

func (*Dot11Ctrl) CanDecode

func (m *Dot11Ctrl) CanDecode() gopacket.LayerClass

func (*Dot11Ctrl) DecodeFromBytes

func (m *Dot11Ctrl) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11Ctrl) LayerType

func (m *Dot11Ctrl) LayerType() gopacket.LayerType

func (*Dot11Ctrl) NextLayerType

func (m *Dot11Ctrl) NextLayerType() gopacket.LayerType

type Dot11CtrlAck

type Dot11CtrlAck struct {
	Dot11Ctrl
}

func (*Dot11CtrlAck) CanDecode

func (m *Dot11CtrlAck) CanDecode() gopacket.LayerClass

func (*Dot11CtrlAck) DecodeFromBytes

func (m *Dot11CtrlAck) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11CtrlAck) LayerType

func (m *Dot11CtrlAck) LayerType() gopacket.LayerType

type Dot11CtrlBlockAck

type Dot11CtrlBlockAck struct {
	Dot11Ctrl
}

func (*Dot11CtrlBlockAck) CanDecode

func (m *Dot11CtrlBlockAck) CanDecode() gopacket.LayerClass

func (*Dot11CtrlBlockAck) DecodeFromBytes

func (m *Dot11CtrlBlockAck) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11CtrlBlockAck) LayerType

func (m *Dot11CtrlBlockAck) LayerType() gopacket.LayerType

type Dot11CtrlBlockAckReq

type Dot11CtrlBlockAckReq struct {
	Dot11Ctrl
}

func (*Dot11CtrlBlockAckReq) CanDecode

func (m *Dot11CtrlBlockAckReq) CanDecode() gopacket.LayerClass

func (*Dot11CtrlBlockAckReq) DecodeFromBytes

func (m *Dot11CtrlBlockAckReq) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11CtrlBlockAckReq) LayerType

func (m *Dot11CtrlBlockAckReq) LayerType() gopacket.LayerType

type Dot11CtrlCFEnd

type Dot11CtrlCFEnd struct {
	Dot11Ctrl
}

func (*Dot11CtrlCFEnd) CanDecode

func (m *Dot11CtrlCFEnd) CanDecode() gopacket.LayerClass

func (*Dot11CtrlCFEnd) DecodeFromBytes

func (m *Dot11CtrlCFEnd) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11CtrlCFEnd) LayerType

func (m *Dot11CtrlCFEnd) LayerType() gopacket.LayerType

type Dot11CtrlCFEndAck

type Dot11CtrlCFEndAck struct {
	Dot11Ctrl
}

func (*Dot11CtrlCFEndAck) CanDecode

func (m *Dot11CtrlCFEndAck) CanDecode() gopacket.LayerClass

func (*Dot11CtrlCFEndAck) DecodeFromBytes

func (m *Dot11CtrlCFEndAck) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11CtrlCFEndAck) LayerType

func (m *Dot11CtrlCFEndAck) LayerType() gopacket.LayerType

type Dot11CtrlCTS

type Dot11CtrlCTS struct {
	Dot11Ctrl
}

func (*Dot11CtrlCTS) CanDecode

func (m *Dot11CtrlCTS) CanDecode() gopacket.LayerClass

func (*Dot11CtrlCTS) DecodeFromBytes

func (m *Dot11CtrlCTS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11CtrlCTS) LayerType

func (m *Dot11CtrlCTS) LayerType() gopacket.LayerType

type Dot11CtrlPowersavePoll

type Dot11CtrlPowersavePoll struct {
	Dot11Ctrl
}

func (*Dot11CtrlPowersavePoll) CanDecode

func (*Dot11CtrlPowersavePoll) DecodeFromBytes

func (m *Dot11CtrlPowersavePoll) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11CtrlPowersavePoll) LayerType

func (m *Dot11CtrlPowersavePoll) LayerType() gopacket.LayerType

type Dot11CtrlRTS

type Dot11CtrlRTS struct {
	Dot11Ctrl
}

func (*Dot11CtrlRTS) CanDecode

func (m *Dot11CtrlRTS) CanDecode() gopacket.LayerClass

func (*Dot11CtrlRTS) DecodeFromBytes

func (m *Dot11CtrlRTS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11CtrlRTS) LayerType

func (m *Dot11CtrlRTS) LayerType() gopacket.LayerType

type Dot11Data

type Dot11Data struct {
	BaseLayer
}

Dot11Data is a base for all IEEE 802.11 data layers.

func (*Dot11Data) CanDecode

func (m *Dot11Data) CanDecode() gopacket.LayerClass

func (*Dot11Data) DecodeFromBytes

func (m *Dot11Data) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11Data) LayerType

func (m *Dot11Data) LayerType() gopacket.LayerType

func (*Dot11Data) NextLayerType

func (m *Dot11Data) NextLayerType() gopacket.LayerType

type Dot11DataCFAck

type Dot11DataCFAck struct {
	Dot11Data
}

func (*Dot11DataCFAck) CanDecode

func (m *Dot11DataCFAck) CanDecode() gopacket.LayerClass

func (*Dot11DataCFAck) DecodeFromBytes

func (m *Dot11DataCFAck) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11DataCFAck) LayerType

func (m *Dot11DataCFAck) LayerType() gopacket.LayerType

type Dot11DataCFAckNoData

type Dot11DataCFAckNoData struct {
	Dot11Data
}

func (*Dot11DataCFAckNoData) CanDecode

func (m *Dot11DataCFAckNoData) CanDecode() gopacket.LayerClass

func (*Dot11DataCFAckNoData) DecodeFromBytes

func (m *Dot11DataCFAckNoData) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11DataCFAckNoData) LayerType

func (m *Dot11DataCFAckNoData) LayerType() gopacket.LayerType

type Dot11DataCFAckPoll

type Dot11DataCFAckPoll struct {
	Dot11Data
}

func (*Dot11DataCFAckPoll) CanDecode

func (m *Dot11DataCFAckPoll) CanDecode() gopacket.LayerClass

func (*Dot11DataCFAckPoll) DecodeFromBytes

func (m *Dot11DataCFAckPoll) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11DataCFAckPoll) LayerType

func (m *Dot11DataCFAckPoll) LayerType() gopacket.LayerType

type Dot11DataCFAckPollNoData

type Dot11DataCFAckPollNoData struct {
	Dot11Data
}

func (*Dot11DataCFAckPollNoData) CanDecode

func (*Dot11DataCFAckPollNoData) DecodeFromBytes

func (m *Dot11DataCFAckPollNoData) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11DataCFAckPollNoData) LayerType

type Dot11DataCFPoll

type Dot11DataCFPoll struct {
	Dot11Data
}

func (*Dot11DataCFPoll) CanDecode

func (m *Dot11DataCFPoll) CanDecode() gopacket.LayerClass

func (*Dot11DataCFPoll) DecodeFromBytes

func (m *Dot11DataCFPoll) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11DataCFPoll) LayerType

func (m *Dot11DataCFPoll) LayerType() gopacket.LayerType

type Dot11DataCFPollNoData

type Dot11DataCFPollNoData struct {
	Dot11Data
}

func (*Dot11DataCFPollNoData) CanDecode

func (m *Dot11DataCFPollNoData) CanDecode() gopacket.LayerClass

func (*Dot11DataCFPollNoData) DecodeFromBytes

func (m *Dot11DataCFPollNoData) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11DataCFPollNoData) LayerType

func (m *Dot11DataCFPollNoData) LayerType() gopacket.LayerType

type Dot11DataNull

type Dot11DataNull struct {
	Dot11Data
}

func (*Dot11DataNull) CanDecode

func (m *Dot11DataNull) CanDecode() gopacket.LayerClass

func (*Dot11DataNull) DecodeFromBytes

func (m *Dot11DataNull) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11DataNull) LayerType

func (m *Dot11DataNull) LayerType() gopacket.LayerType

type Dot11DataQOS

type Dot11DataQOS struct {
	Dot11Ctrl
}

func (*Dot11DataQOS) DecodeFromBytes

func (m *Dot11DataQOS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

type Dot11DataQOSCFAckPollNoData

type Dot11DataQOSCFAckPollNoData struct {
	Dot11DataQOS
}

func (*Dot11DataQOSCFAckPollNoData) CanDecode

func (*Dot11DataQOSCFAckPollNoData) LayerType

func (*Dot11DataQOSCFAckPollNoData) NextLayerType

func (m *Dot11DataQOSCFAckPollNoData) NextLayerType() gopacket.LayerType

type Dot11DataQOSCFPollNoData

type Dot11DataQOSCFPollNoData struct {
	Dot11DataQOS
}

func (*Dot11DataQOSCFPollNoData) CanDecode

func (*Dot11DataQOSCFPollNoData) LayerType

func (*Dot11DataQOSCFPollNoData) NextLayerType

func (m *Dot11DataQOSCFPollNoData) NextLayerType() gopacket.LayerType

type Dot11DataQOSData

type Dot11DataQOSData struct {
	Dot11DataQOS
}

func (*Dot11DataQOSData) CanDecode

func (m *Dot11DataQOSData) CanDecode() gopacket.LayerClass

func (*Dot11DataQOSData) LayerType

func (m *Dot11DataQOSData) LayerType() gopacket.LayerType

func (*Dot11DataQOSData) NextLayerType

func (m *Dot11DataQOSData) NextLayerType() gopacket.LayerType

type Dot11DataQOSDataCFAck

type Dot11DataQOSDataCFAck struct {
	Dot11DataQOS
}

func (*Dot11DataQOSDataCFAck) CanDecode

func (m *Dot11DataQOSDataCFAck) CanDecode() gopacket.LayerClass

func (*Dot11DataQOSDataCFAck) LayerType

func (m *Dot11DataQOSDataCFAck) LayerType() gopacket.LayerType

func (*Dot11DataQOSDataCFAck) NextLayerType

func (m *Dot11DataQOSDataCFAck) NextLayerType() gopacket.LayerType

type Dot11DataQOSDataCFAckPoll

type Dot11DataQOSDataCFAckPoll struct {
	Dot11DataQOS
}

func (*Dot11DataQOSDataCFAckPoll) CanDecode

func (*Dot11DataQOSDataCFAckPoll) LayerType

func (*Dot11DataQOSDataCFAckPoll) NextLayerType

func (m *Dot11DataQOSDataCFAckPoll) NextLayerType() gopacket.LayerType

type Dot11DataQOSDataCFPoll

type Dot11DataQOSDataCFPoll struct {
	Dot11DataQOS
}

func (*Dot11DataQOSDataCFPoll) CanDecode

func (*Dot11DataQOSDataCFPoll) LayerType

func (m *Dot11DataQOSDataCFPoll) LayerType() gopacket.LayerType

func (*Dot11DataQOSDataCFPoll) NextLayerType

func (m *Dot11DataQOSDataCFPoll) NextLayerType() gopacket.LayerType

type Dot11DataQOSNull

type Dot11DataQOSNull struct {
	Dot11DataQOS
}

func (*Dot11DataQOSNull) CanDecode

func (m *Dot11DataQOSNull) CanDecode() gopacket.LayerClass

func (*Dot11DataQOSNull) LayerType

func (m *Dot11DataQOSNull) LayerType() gopacket.LayerType

func (*Dot11DataQOSNull) NextLayerType

func (m *Dot11DataQOSNull) NextLayerType() gopacket.LayerType

type Dot11Flags

type Dot11Flags uint8

Dot11Flags contains the set of 8 flags in the IEEE 802.11 frame control header, all in one place.

const (
	Dot11FlagsToDS Dot11Flags = 1 << iota
	Dot11FlagsFromDS
	Dot11FlagsMF
	Dot11FlagsRetry
	Dot11FlagsPowerManagement
	Dot11FlagsMD
	Dot11FlagsWEP
	Dot11FlagsOrder
)

func (Dot11Flags) FromDS

func (d Dot11Flags) FromDS() bool

func (Dot11Flags) MD

func (d Dot11Flags) MD() bool

func (Dot11Flags) MF

func (d Dot11Flags) MF() bool

func (Dot11Flags) Order

func (d Dot11Flags) Order() bool

func (Dot11Flags) PowerManagement

func (d Dot11Flags) PowerManagement() bool

func (Dot11Flags) Retry

func (d Dot11Flags) Retry() bool

func (Dot11Flags) String

func (a Dot11Flags) String() string

String provides a human readable string for Dot11Flags. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the Dot11Flags value, not its string.

func (Dot11Flags) ToDS

func (d Dot11Flags) ToDS() bool

func (Dot11Flags) WEP

func (d Dot11Flags) WEP() bool

type Dot11HTControl

type Dot11HTControl struct {
	ACConstraint bool
	RDGMorePPDU  bool

	VHT *Dot11HTControlVHT
	HT  *Dot11HTControlHT
}

type Dot11HTControlHT

type Dot11HTControlHT struct {
	LinkAdapationControl *Dot11LinkAdapationControl
	CalibrationPosition  uint8
	CalibrationSequence  uint8
	CSISteering          uint8
	NDPAnnouncement      bool
	DEI                  bool
}

type Dot11HTControlMFB

type Dot11HTControlMFB struct {
	NumSTS uint8
	VHTMCS uint8
	BW     uint8
	SNR    int8
}

func (*Dot11HTControlMFB) NoFeedBackPresent

func (m *Dot11HTControlMFB) NoFeedBackPresent() bool

type Dot11HTControlVHT

type Dot11HTControlVHT struct {
	MRQ            bool
	UnsolicitedMFB bool
	MSI            *uint8
	MFB            Dot11HTControlMFB
	CompressedMSI  *uint8
	STBCIndication bool
	MFSI           *uint8
	GID            *uint8
	CodingType     *Dot11CodingType
	FbTXBeamformed bool
}

type Dot11InformationElement

type Dot11InformationElement struct {
	BaseLayer
	ID     Dot11InformationElementID
	Length uint8
	OUI    []byte
	Info   []byte
}

func (*Dot11InformationElement) CanDecode

func (*Dot11InformationElement) DecodeFromBytes

func (m *Dot11InformationElement) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11InformationElement) LayerType

func (*Dot11InformationElement) NextLayerType

func (m *Dot11InformationElement) NextLayerType() gopacket.LayerType

func (Dot11InformationElement) SerializeTo

func (*Dot11InformationElement) String

func (d *Dot11InformationElement) String() string

type Dot11InformationElementID

type Dot11InformationElementID uint8
const (
	Dot11InformationElementIDSSID                      Dot11InformationElementID = 0
	Dot11InformationElementIDRates                     Dot11InformationElementID = 1
	Dot11InformationElementIDFHSet                     Dot11InformationElementID = 2
	Dot11InformationElementIDDSSet                     Dot11InformationElementID = 3
	Dot11InformationElementIDCFSet                     Dot11InformationElementID = 4
	Dot11InformationElementIDTIM                       Dot11InformationElementID = 5
	Dot11InformationElementIDIBSSSet                   Dot11InformationElementID = 6
	Dot11InformationElementIDCountryInfo               Dot11InformationElementID = 7
	Dot11InformationElementIDHoppingPatternParam       Dot11InformationElementID = 8
	Dot11InformationElementIDHoppingPatternTable       Dot11InformationElementID = 9
	Dot11InformationElementIDRequest                   Dot11InformationElementID = 10
	Dot11InformationElementIDQBSSLoadElem              Dot11InformationElementID = 11
	Dot11InformationElementIDEDCAParamSet              Dot11InformationElementID = 12
	Dot11InformationElementIDTrafficSpec               Dot11InformationElementID = 13
	Dot11InformationElementIDTrafficClass              Dot11InformationElementID = 14
	Dot11InformationElementIDSchedule                  Dot11InformationElementID = 15
	Dot11InformationElementIDChallenge                 Dot11InformationElementID = 16
	Dot11InformationElementIDPowerConst                Dot11InformationElementID = 32
	Dot11InformationElementIDPowerCapability           Dot11InformationElementID = 33
	Dot11InformationElementIDTPCRequest                Dot11InformationElementID = 34
	Dot11InformationElementIDTPCReport                 Dot11InformationElementID = 35
	Dot11InformationElementIDSupportedChannels         Dot11InformationElementID = 36
	Dot11InformationElementIDSwitchChannelAnnounce     Dot11InformationElementID = 37
	Dot11InformationElementIDMeasureRequest            Dot11InformationElementID = 38
	Dot11InformationElementIDMeasureReport             Dot11InformationElementID = 39
	Dot11InformationElementIDQuiet                     Dot11InformationElementID = 40
	Dot11InformationElementIDIBSSDFS                   Dot11InformationElementID = 41
	Dot11InformationElementIDERPInfo                   Dot11InformationElementID = 42
	Dot11InformationElementIDTSDelay                   Dot11InformationElementID = 43
	Dot11InformationElementIDTCLASProcessing           Dot11InformationElementID = 44
	Dot11InformationElementIDHTCapabilities            Dot11InformationElementID = 45
	Dot11InformationElementIDQOSCapability             Dot11InformationElementID = 46
	Dot11InformationElementIDERPInfo2                  Dot11InformationElementID = 47
	Dot11InformationElementIDRSNInfo                   Dot11InformationElementID = 48
	Dot11InformationElementIDESRates                   Dot11InformationElementID = 50
	Dot11InformationElementIDAPChannelReport           Dot11InformationElementID = 51
	Dot11InformationElementIDNeighborReport            Dot11InformationElementID = 52
	Dot11InformationElementIDRCPI                      Dot11InformationElementID = 53
	Dot11InformationElementIDMobilityDomain            Dot11InformationElementID = 54
	Dot11InformationElementIDFastBSSTrans              Dot11InformationElementID = 55
	Dot11InformationElementIDTimeoutInt                Dot11InformationElementID = 56
	Dot11InformationElementIDRICData                   Dot11InformationElementID = 57
	Dot11InformationElementIDDSERegisteredLoc          Dot11InformationElementID = 58
	Dot11InformationElementIDSuppOperatingClass        Dot11InformationElementID = 59
	Dot11InformationElementIDExtChanSwitchAnnounce     Dot11InformationElementID = 60
	Dot11InformationElementIDHTInfo                    Dot11InformationElementID = 61
	Dot11InformationElementIDSecChanOffset             Dot11InformationElementID = 62
	Dot11InformationElementIDBSSAverageAccessDelay     Dot11InformationElementID = 63
	Dot11InformationElementIDAntenna                   Dot11InformationElementID = 64
	Dot11InformationElementIDRSNI                      Dot11InformationElementID = 65
	Dot11InformationElementIDMeasurePilotTrans         Dot11InformationElementID = 66
	Dot11InformationElementIDBSSAvailAdmCapacity       Dot11InformationElementID = 67
	Dot11InformationElementIDBSSACAccDelayWAPIParam    Dot11InformationElementID = 68
	Dot11InformationElementIDTimeAdvertisement         Dot11InformationElementID = 69
	Dot11InformationElementIDRMEnabledCapabilities     Dot11InformationElementID = 70
	Dot11InformationElementIDMultipleBSSID             Dot11InformationElementID = 71
	Dot11InformationElementID2040BSSCoExist            Dot11InformationElementID = 72
	Dot11InformationElementID2040BSSIntChanReport      Dot11InformationElementID = 73
	Dot11InformationElementIDOverlapBSSScanParam       Dot11InformationElementID = 74
	Dot11InformationElementIDRICDescriptor             Dot11InformationElementID = 75
	Dot11InformationElementIDManagementMIC             Dot11InformationElementID = 76
	Dot11InformationElementIDEventRequest              Dot11InformationElementID = 78
	Dot11InformationElementIDEventReport               Dot11InformationElementID = 79
	Dot11InformationElementIDDiagnosticRequest         Dot11InformationElementID = 80
	Dot11InformationElementIDDiagnosticReport          Dot11InformationElementID = 81
	Dot11InformationElementIDLocationParam             Dot11InformationElementID = 82
	Dot11InformationElementIDNonTransBSSIDCapability   Dot11InformationElementID = 83
	Dot11InformationElementIDSSIDList                  Dot11InformationElementID = 84
	Dot11InformationElementIDMultipleBSSIDIndex        Dot11InformationElementID = 85
	Dot11InformationElementIDFMSDescriptor             Dot11InformationElementID = 86
	Dot11InformationElementIDFMSRequest                Dot11InformationElementID = 87
	Dot11InformationElementIDFMSResponse               Dot11InformationElementID = 88
	Dot11InformationElementIDQOSTrafficCapability      Dot11InformationElementID = 89
	Dot11InformationElementIDBSSMaxIdlePeriod          Dot11InformationElementID = 90
	Dot11InformationElementIDTFSRequest                Dot11InformationElementID = 91
	Dot11InformationElementIDTFSResponse               Dot11InformationElementID = 92
	Dot11InformationElementIDWNMSleepMode              Dot11InformationElementID = 93
	Dot11InformationElementIDTIMBroadcastRequest       Dot11InformationElementID = 94
	Dot11InformationElementIDTIMBroadcastResponse      Dot11InformationElementID = 95
	Dot11InformationElementIDCollInterferenceReport    Dot11InformationElementID = 96
	Dot11InformationElementIDChannelUsage              Dot11InformationElementID = 97
	Dot11InformationElementIDTimeZone                  Dot11InformationElementID = 98
	Dot11InformationElementIDDMSRequest                Dot11InformationElementID = 99
	Dot11InformationElementIDDMSResponse               Dot11InformationElementID = 100
	Dot11InformationElementIDLinkIdentifier            Dot11InformationElementID = 101
	Dot11InformationElementIDWakeupSchedule            Dot11InformationElementID = 102
	Dot11InformationElementIDChannelSwitchTiming       Dot11InformationElementID = 104
	Dot11InformationElementIDPTIControl                Dot11InformationElementID = 105
	Dot11InformationElementIDPUBufferStatus            Dot11InformationElementID = 106
	Dot11InformationElementIDInterworking              Dot11InformationElementID = 107
	Dot11InformationElementIDAdvertisementProtocol     Dot11InformationElementID = 108
	Dot11InformationElementIDExpBWRequest              Dot11InformationElementID = 109
	Dot11InformationElementIDQOSMapSet                 Dot11InformationElementID = 110
	Dot11InformationElementIDRoamingConsortium         Dot11InformationElementID = 111
	Dot11InformationElementIDEmergencyAlertIdentifier  Dot11InformationElementID = 112
	Dot11InformationElementIDMeshConfiguration         Dot11InformationElementID = 113
	Dot11InformationElementIDMeshID                    Dot11InformationElementID = 114
	Dot11InformationElementIDMeshLinkMetricReport      Dot11InformationElementID = 115
	Dot11InformationElementIDCongestionNotification    Dot11InformationElementID = 116
	Dot11InformationElementIDMeshPeeringManagement     Dot11InformationElementID = 117
	Dot11InformationElementIDMeshChannelSwitchParam    Dot11InformationElementID = 118
	Dot11InformationElementIDMeshAwakeWindows          Dot11InformationElementID = 119
	Dot11InformationElementIDBeaconTiming              Dot11InformationElementID = 120
	Dot11InformationElementIDMCCAOPSetupRequest        Dot11InformationElementID = 121
	Dot11InformationElementIDMCCAOPSetupReply          Dot11InformationElementID = 122
	Dot11InformationElementIDMCCAOPAdvertisement       Dot11InformationElementID = 123
	Dot11InformationElementIDMCCAOPTeardown            Dot11InformationElementID = 124
	Dot11InformationElementIDGateAnnouncement          Dot11InformationElementID = 125
	Dot11InformationElementIDRootAnnouncement          Dot11InformationElementID = 126
	Dot11InformationElementIDExtCapability             Dot11InformationElementID = 127
	Dot11InformationElementIDAgereProprietary          Dot11InformationElementID = 128
	Dot11InformationElementIDPathRequest               Dot11InformationElementID = 130
	Dot11InformationElementIDPathReply                 Dot11InformationElementID = 131
	Dot11InformationElementIDPathError                 Dot11InformationElementID = 132
	Dot11InformationElementIDCiscoCCX1CKIPDeviceName   Dot11InformationElementID = 133
	Dot11InformationElementIDCiscoCCX2                 Dot11InformationElementID = 136
	Dot11InformationElementIDProxyUpdate               Dot11InformationElementID = 137
	Dot11InformationElementIDProxyUpdateConfirmation   Dot11InformationElementID = 138
	Dot11InformationElementIDAuthMeshPerringExch       Dot11InformationElementID = 139
	Dot11InformationElementIDMIC                       Dot11InformationElementID = 140
	Dot11InformationElementIDDestinationURI            Dot11InformationElementID = 141
	Dot11InformationElementIDUAPSDCoexistence          Dot11InformationElementID = 142
	Dot11InformationElementIDWakeupSchedule80211ad     Dot11InformationElementID = 143
	Dot11InformationElementIDExtendedSchedule          Dot11InformationElementID = 144
	Dot11InformationElementIDSTAAvailability           Dot11InformationElementID = 145
	Dot11InformationElementIDDMGTSPEC                  Dot11InformationElementID = 146
	Dot11InformationElementIDNextDMGATI                Dot11InformationElementID = 147
	Dot11InformationElementIDDMSCapabilities           Dot11InformationElementID = 148
	Dot11InformationElementIDCiscoUnknown95            Dot11InformationElementID = 149
	Dot11InformationElementIDVendor2                   Dot11InformationElementID = 150
	Dot11InformationElementIDDMGOperating              Dot11InformationElementID = 151
	Dot11InformationElementIDDMGBSSParamChange         Dot11InformationElementID = 152
	Dot11InformationElementIDDMGBeamRefinement         Dot11InformationElementID = 153
	Dot11InformationElementIDChannelMeasFeedback       Dot11InformationElementID = 154
	Dot11InformationElementIDAwakeWindow               Dot11InformationElementID = 157
	Dot11InformationElementIDMultiBand                 Dot11InformationElementID = 158
	Dot11InformationElementIDADDBAExtension            Dot11InformationElementID = 159
	Dot11InformationElementIDNEXTPCPList               Dot11InformationElementID = 160
	Dot11InformationElementIDPCPHandover               Dot11InformationElementID = 161
	Dot11InformationElementIDDMGLinkMargin             Dot11InformationElementID = 162
	Dot11InformationElementIDSwitchingStream           Dot11InformationElementID = 163
	Dot11InformationElementIDSessionTransmission       Dot11InformationElementID = 164
	Dot11InformationElementIDDynamicTonePairReport     Dot11InformationElementID = 165
	Dot11InformationElementIDClusterReport             Dot11InformationElementID = 166
	Dot11InformationElementIDRelayCapabilities         Dot11InformationElementID = 167
	Dot11InformationElementIDRelayTransferParameter    Dot11InformationElementID = 168
	Dot11InformationElementIDBeamlinkMaintenance       Dot11InformationElementID = 169
	Dot11InformationElementIDMultipleMacSublayers      Dot11InformationElementID = 170
	Dot11InformationElementIDUPID                      Dot11InformationElementID = 171
	Dot11InformationElementIDDMGLinkAdaptionAck        Dot11InformationElementID = 172
	Dot11InformationElementIDSymbolProprietary         Dot11InformationElementID = 173
	Dot11InformationElementIDMCCAOPAdvertOverview      Dot11InformationElementID = 174
	Dot11InformationElementIDQuietPeriodRequest        Dot11InformationElementID = 175
	Dot11InformationElementIDQuietPeriodResponse       Dot11InformationElementID = 177
	Dot11InformationElementIDECPACPolicy               Dot11InformationElementID = 182
	Dot11InformationElementIDClusterTimeOffset         Dot11InformationElementID = 183
	Dot11InformationElementIDAntennaSectorID           Dot11InformationElementID = 190
	Dot11InformationElementIDVHTCapabilities           Dot11InformationElementID = 191
	Dot11InformationElementIDVHTOperation              Dot11InformationElementID = 192
	Dot11InformationElementIDExtendedBSSLoad           Dot11InformationElementID = 193
	Dot11InformationElementIDWideBWChannelSwitch       Dot11InformationElementID = 194
	Dot11InformationElementIDVHTTxPowerEnvelope        Dot11InformationElementID = 195
	Dot11InformationElementIDChannelSwitchWrapper      Dot11InformationElementID = 196
	Dot11InformationElementIDOperatingModeNotification Dot11InformationElementID = 199
	Dot11InformationElementIDUPSIM                     Dot11InformationElementID = 200
	Dot11InformationElementIDReducedNeighborReport     Dot11InformationElementID = 201
	Dot11InformationElementIDTVHTOperation             Dot11InformationElementID = 202
	Dot11InformationElementIDDeviceLocation            Dot11InformationElementID = 204
	Dot11InformationElementIDWhiteSpaceMap             Dot11InformationElementID = 205
	Dot11InformationElementIDFineTuningMeasureParams   Dot11InformationElementID = 206
	Dot11InformationElementIDVendor                    Dot11InformationElementID = 221
)

func (Dot11InformationElementID) String

func (a Dot11InformationElementID) String() string

String provides a human readable string for Dot11InformationElementID. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the Dot11InformationElementID value, not its string.

type Dot11LinkAdapationControl

type Dot11LinkAdapationControl struct {
	TRQ  bool
	MRQ  bool
	MSI  uint8
	MFSI uint8
	ASEL *Dot11ASEL
	MFB  *uint8
}

type Dot11Mgmt

type Dot11Mgmt struct {
	BaseLayer
}

Dot11Mgmt is a base for all IEEE 802.11 management layers.

func (*Dot11Mgmt) DecodeFromBytes

func (m *Dot11Mgmt) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11Mgmt) NextLayerType

func (m *Dot11Mgmt) NextLayerType() gopacket.LayerType

type Dot11MgmtATIM

type Dot11MgmtATIM struct {
	Dot11Mgmt
}

func (*Dot11MgmtATIM) CanDecode

func (m *Dot11MgmtATIM) CanDecode() gopacket.LayerClass

func (*Dot11MgmtATIM) LayerType

func (m *Dot11MgmtATIM) LayerType() gopacket.LayerType

type Dot11MgmtAction

type Dot11MgmtAction struct {
	Dot11Mgmt
}

func (*Dot11MgmtAction) CanDecode

func (m *Dot11MgmtAction) CanDecode() gopacket.LayerClass

func (*Dot11MgmtAction) LayerType

func (m *Dot11MgmtAction) LayerType() gopacket.LayerType

type Dot11MgmtActionNoAck

type Dot11MgmtActionNoAck struct {
	Dot11Mgmt
}

func (*Dot11MgmtActionNoAck) CanDecode

func (m *Dot11MgmtActionNoAck) CanDecode() gopacket.LayerClass

func (*Dot11MgmtActionNoAck) LayerType

func (m *Dot11MgmtActionNoAck) LayerType() gopacket.LayerType

type Dot11MgmtArubaWLAN

type Dot11MgmtArubaWLAN struct {
	Dot11Mgmt
}

func (*Dot11MgmtArubaWLAN) CanDecode

func (m *Dot11MgmtArubaWLAN) CanDecode() gopacket.LayerClass

func (*Dot11MgmtArubaWLAN) LayerType

func (m *Dot11MgmtArubaWLAN) LayerType() gopacket.LayerType

type Dot11MgmtAssociationReq

type Dot11MgmtAssociationReq struct {
	Dot11Mgmt
	CapabilityInfo uint16
	ListenInterval uint16
}

func (*Dot11MgmtAssociationReq) CanDecode

func (*Dot11MgmtAssociationReq) DecodeFromBytes

func (m *Dot11MgmtAssociationReq) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11MgmtAssociationReq) LayerType

func (*Dot11MgmtAssociationReq) NextLayerType

func (m *Dot11MgmtAssociationReq) NextLayerType() gopacket.LayerType

func (Dot11MgmtAssociationReq) SerializeTo

type Dot11MgmtAssociationResp

type Dot11MgmtAssociationResp struct {
	Dot11Mgmt
	CapabilityInfo uint16
	Status         Dot11Status
	AID            uint16
}

func (*Dot11MgmtAssociationResp) CanDecode

func (*Dot11MgmtAssociationResp) DecodeFromBytes

func (m *Dot11MgmtAssociationResp) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11MgmtAssociationResp) LayerType

func (*Dot11MgmtAssociationResp) NextLayerType

func (m *Dot11MgmtAssociationResp) NextLayerType() gopacket.LayerType

func (Dot11MgmtAssociationResp) SerializeTo

type Dot11MgmtAuthentication

type Dot11MgmtAuthentication struct {
	Dot11Mgmt
	Algorithm Dot11Algorithm
	Sequence  uint16
	Status    Dot11Status
}

func (*Dot11MgmtAuthentication) CanDecode

func (*Dot11MgmtAuthentication) DecodeFromBytes

func (m *Dot11MgmtAuthentication) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11MgmtAuthentication) LayerType

func (*Dot11MgmtAuthentication) NextLayerType

func (m *Dot11MgmtAuthentication) NextLayerType() gopacket.LayerType

func (Dot11MgmtAuthentication) SerializeTo

type Dot11MgmtBeacon

type Dot11MgmtBeacon struct {
	Dot11Mgmt
	Timestamp uint64
	Interval  uint16
	Flags     uint16
}

func (*Dot11MgmtBeacon) CanDecode

func (m *Dot11MgmtBeacon) CanDecode() gopacket.LayerClass

func (*Dot11MgmtBeacon) DecodeFromBytes

func (m *Dot11MgmtBeacon) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11MgmtBeacon) LayerType

func (m *Dot11MgmtBeacon) LayerType() gopacket.LayerType

func (*Dot11MgmtBeacon) NextLayerType

func (m *Dot11MgmtBeacon) NextLayerType() gopacket.LayerType

func (Dot11MgmtBeacon) SerializeTo

type Dot11MgmtDeauthentication

type Dot11MgmtDeauthentication struct {
	Dot11Mgmt
	Reason Dot11Reason
}

func (*Dot11MgmtDeauthentication) CanDecode

func (*Dot11MgmtDeauthentication) DecodeFromBytes

func (m *Dot11MgmtDeauthentication) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11MgmtDeauthentication) LayerType

func (Dot11MgmtDeauthentication) SerializeTo

type Dot11MgmtDisassociation

type Dot11MgmtDisassociation struct {
	Dot11Mgmt
	Reason Dot11Reason
}

func (*Dot11MgmtDisassociation) CanDecode

func (*Dot11MgmtDisassociation) DecodeFromBytes

func (m *Dot11MgmtDisassociation) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11MgmtDisassociation) LayerType

func (Dot11MgmtDisassociation) SerializeTo

type Dot11MgmtMeasurementPilot

type Dot11MgmtMeasurementPilot struct {
	Dot11Mgmt
}

func (*Dot11MgmtMeasurementPilot) CanDecode

func (*Dot11MgmtMeasurementPilot) LayerType

type Dot11MgmtProbeReq

type Dot11MgmtProbeReq struct {
	Dot11Mgmt
}

func (*Dot11MgmtProbeReq) CanDecode

func (m *Dot11MgmtProbeReq) CanDecode() gopacket.LayerClass

func (*Dot11MgmtProbeReq) LayerType

func (m *Dot11MgmtProbeReq) LayerType() gopacket.LayerType

func (*Dot11MgmtProbeReq) NextLayerType

func (m *Dot11MgmtProbeReq) NextLayerType() gopacket.LayerType

type Dot11MgmtProbeResp

type Dot11MgmtProbeResp struct {
	Dot11Mgmt
	Timestamp uint64
	Interval  uint16
	Flags     uint16
}

func (*Dot11MgmtProbeResp) CanDecode

func (m *Dot11MgmtProbeResp) CanDecode() gopacket.LayerClass

func (*Dot11MgmtProbeResp) DecodeFromBytes

func (m *Dot11MgmtProbeResp) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11MgmtProbeResp) LayerType

func (m *Dot11MgmtProbeResp) LayerType() gopacket.LayerType

func (*Dot11MgmtProbeResp) NextLayerType

func (m *Dot11MgmtProbeResp) NextLayerType() gopacket.LayerType

func (Dot11MgmtProbeResp) SerializeTo

type Dot11MgmtReassociationReq

type Dot11MgmtReassociationReq struct {
	Dot11Mgmt
	CapabilityInfo   uint16
	ListenInterval   uint16
	CurrentApAddress net.HardwareAddr
}

func (*Dot11MgmtReassociationReq) CanDecode

func (*Dot11MgmtReassociationReq) DecodeFromBytes

func (m *Dot11MgmtReassociationReq) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11MgmtReassociationReq) LayerType

func (*Dot11MgmtReassociationReq) NextLayerType

func (m *Dot11MgmtReassociationReq) NextLayerType() gopacket.LayerType

func (Dot11MgmtReassociationReq) SerializeTo

type Dot11MgmtReassociationResp

type Dot11MgmtReassociationResp struct {
	Dot11Mgmt
}

func (*Dot11MgmtReassociationResp) CanDecode

func (*Dot11MgmtReassociationResp) LayerType

func (*Dot11MgmtReassociationResp) NextLayerType

func (m *Dot11MgmtReassociationResp) NextLayerType() gopacket.LayerType

type Dot11QOS

type Dot11QOS struct {
	TID       uint8 /* Traffic IDentifier */
	EOSP      bool  /* End of service period */
	AckPolicy Dot11AckPolicy
	TXOP      uint8
}

type Dot11Reason

type Dot11Reason uint16
const (
	Dot11ReasonReserved          Dot11Reason = 1
	Dot11ReasonUnspecified       Dot11Reason = 2
	Dot11ReasonAuthExpired       Dot11Reason = 3
	Dot11ReasonDeauthStLeaving   Dot11Reason = 4
	Dot11ReasonInactivity        Dot11Reason = 5
	Dot11ReasonApFull            Dot11Reason = 6
	Dot11ReasonClass2FromNonAuth Dot11Reason = 7
	Dot11ReasonClass3FromNonAss  Dot11Reason = 8
	Dot11ReasonDisasStLeaving    Dot11Reason = 9
	Dot11ReasonStNotAuth         Dot11Reason = 10
)

func (Dot11Reason) String

func (a Dot11Reason) String() string

String provides a human readable string for Dot11Reason. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the Dot11Reason value, not its string.

type Dot11Status

type Dot11Status uint16
const (
	Dot11StatusSuccess                      Dot11Status = 0
	Dot11StatusFailure                      Dot11Status = 1  // Unspecified failure
	Dot11StatusCannotSupportAllCapabilities Dot11Status = 10 // Cannot support all requested capabilities in the Capability Information field
	Dot11StatusInabilityExistsAssociation   Dot11Status = 11 // Reassociation denied due to inability to confirm that association exists
	Dot11StatusAssociationDenied            Dot11Status = 12 // Association denied due to reason outside the scope of this standard
	Dot11StatusAlgorithmUnsupported         Dot11Status = 13 // Responding station does not support the specified authentication algorithm
	Dot11StatusOufOfExpectedSequence        Dot11Status = 14 // Received an Authentication frame with authentication transaction sequence number out of expected sequence
	Dot11StatusChallengeFailure             Dot11Status = 15 // Authentication rejected because of challenge failure
	Dot11StatusTimeout                      Dot11Status = 16 // Authentication rejected due to timeout waiting for next frame in sequence
	Dot11StatusAPUnableToHandle             Dot11Status = 17 // Association denied because AP is unable to handle additional associated stations
	Dot11StatusRateUnsupported              Dot11Status = 18 // Association denied due to requesting station not supporting all of the data rates in the BSSBasicRateSet parameter
)

func (Dot11Status) String

func (a Dot11Status) String() string

String provides a human readable string for Dot11Status. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the Dot11Status value, not its string.

type Dot11Type

type Dot11Type uint8

Dot11Type is a combination of IEEE 802.11 frame's Type and Subtype fields. By combining these two fields together into a single type, we're able to provide a String function that correctly displays the subtype given the top-level type.

If you just care about the top-level type, use the MainType function.

const (
	Dot11TypeMgmt     Dot11Type = 0x00
	Dot11TypeCtrl     Dot11Type = 0x01
	Dot11TypeData     Dot11Type = 0x02
	Dot11TypeReserved Dot11Type = 0x03

	// Management
	Dot11TypeMgmtAssociationReq    Dot11Type = 0x00
	Dot11TypeMgmtAssociationResp   Dot11Type = 0x04
	Dot11TypeMgmtReassociationReq  Dot11Type = 0x08
	Dot11TypeMgmtReassociationResp Dot11Type = 0x0c
	Dot11TypeMgmtProbeReq          Dot11Type = 0x10
	Dot11TypeMgmtProbeResp         Dot11Type = 0x14
	Dot11TypeMgmtMeasurementPilot  Dot11Type = 0x18
	Dot11TypeMgmtBeacon            Dot11Type = 0x20
	Dot11TypeMgmtATIM              Dot11Type = 0x24
	Dot11TypeMgmtDisassociation    Dot11Type = 0x28
	Dot11TypeMgmtAuthentication    Dot11Type = 0x2c
	Dot11TypeMgmtDeauthentication  Dot11Type = 0x30
	Dot11TypeMgmtAction            Dot11Type = 0x34
	Dot11TypeMgmtActionNoAck       Dot11Type = 0x38

	// Control
	Dot11TypeCtrlWrapper       Dot11Type = 0x1d
	Dot11TypeCtrlBlockAckReq   Dot11Type = 0x21
	Dot11TypeCtrlBlockAck      Dot11Type = 0x25
	Dot11TypeCtrlPowersavePoll Dot11Type = 0x29
	Dot11TypeCtrlRTS           Dot11Type = 0x2d
	Dot11TypeCtrlCTS           Dot11Type = 0x31
	Dot11TypeCtrlAck           Dot11Type = 0x35
	Dot11TypeCtrlCFEnd         Dot11Type = 0x39
	Dot11TypeCtrlCFEndAck      Dot11Type = 0x3d

	// Data
	Dot11TypeDataCFAck              Dot11Type = 0x06
	Dot11TypeDataCFPoll             Dot11Type = 0x0a
	Dot11TypeDataCFAckPoll          Dot11Type = 0x0e
	Dot11TypeDataNull               Dot11Type = 0x12
	Dot11TypeDataCFAckNoData        Dot11Type = 0x16
	Dot11TypeDataCFPollNoData       Dot11Type = 0x1a
	Dot11TypeDataCFAckPollNoData    Dot11Type = 0x1e
	Dot11TypeDataQOSData            Dot11Type = 0x22
	Dot11TypeDataQOSDataCFAck       Dot11Type = 0x26
	Dot11TypeDataQOSDataCFPoll      Dot11Type = 0x2a
	Dot11TypeDataQOSDataCFAckPoll   Dot11Type = 0x2e
	Dot11TypeDataQOSNull            Dot11Type = 0x32
	Dot11TypeDataQOSCFPollNoData    Dot11Type = 0x3a
	Dot11TypeDataQOSCFAckPollNoData Dot11Type = 0x3e
)

func (Dot11Type) Decode

func (a Dot11Type) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls Dot11TypeMetadata.DecodeWith's decoder.

func (Dot11Type) LayerType

func (a Dot11Type) LayerType() gopacket.LayerType

LayerType returns Dot11TypeMetadata.LayerType.

func (Dot11Type) MainType

func (d Dot11Type) MainType() Dot11Type

MainType strips the subtype information from the given type, returning just the overarching type (Mgmt, Ctrl, Data, Reserved).

func (Dot11Type) QOS

func (d Dot11Type) QOS() bool

func (Dot11Type) String

func (a Dot11Type) String() string

String returns Dot11TypeMetadata.Name.

type Dot11WEP

type Dot11WEP struct {
	BaseLayer
}

Dot11WEP contains WEP encrpted IEEE 802.11 data.

func (*Dot11WEP) CanDecode

func (m *Dot11WEP) CanDecode() gopacket.LayerClass

func (*Dot11WEP) DecodeFromBytes

func (m *Dot11WEP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Dot11WEP) LayerType

func (m *Dot11WEP) LayerType() gopacket.LayerType

func (*Dot11WEP) NextLayerType

func (m *Dot11WEP) NextLayerType() gopacket.LayerType

type Dot1Q

type Dot1Q struct {
	BaseLayer
	Priority       uint8
	DropEligible   bool
	VLANIdentifier uint16
	Type           EthernetType
}

Dot1Q is the packet layer for 802.1Q VLAN headers.

func (*Dot1Q) CanDecode

func (d *Dot1Q) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*Dot1Q) DecodeFromBytes

func (d *Dot1Q) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*Dot1Q) LayerType

func (d *Dot1Q) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeDot1Q

func (*Dot1Q) NextLayerType

func (d *Dot1Q) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*Dot1Q) SerializeTo

func (d *Dot1Q) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type EAP

type EAP struct {
	BaseLayer
	Code     EAPCode
	Id       uint8
	Length   uint16
	Type     EAPType
	TypeData []byte
}

EAP defines an Extensible Authentication Protocol (rfc 3748) layer.

func (*EAP) CanDecode

func (e *EAP) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*EAP) DecodeFromBytes

func (e *EAP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*EAP) LayerType

func (e *EAP) LayerType() gopacket.LayerType

LayerType returns LayerTypeEAP.

func (*EAP) NextLayerType

func (e *EAP) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*EAP) SerializeTo

func (e *EAP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type EAPCode

type EAPCode uint8

type EAPOL

type EAPOL struct {
	BaseLayer
	Version uint8
	Type    EAPOLType
	Length  uint16
}

EAPOL defines an EAP over LAN (802.1x) layer.

func (*EAPOL) CanDecode

func (e *EAPOL) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*EAPOL) DecodeFromBytes

func (e *EAPOL) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*EAPOL) LayerType

func (e *EAPOL) LayerType() gopacket.LayerType

LayerType returns LayerTypeEAPOL.

func (*EAPOL) NextLayerType

func (e *EAPOL) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*EAPOL) SerializeTo

func (e *EAPOL) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer

type EAPOLKey

type EAPOLKey struct {
	BaseLayer
	KeyDescriptorType    EAPOLKeyDescriptorType
	KeyDescriptorVersion EAPOLKeyDescriptorVersion
	KeyType              EAPOLKeyType
	KeyIndex             uint8
	Install              bool
	KeyACK               bool
	KeyMIC               bool
	Secure               bool
	MICError             bool
	Request              bool
	HasEncryptedKeyData  bool
	SMKMessage           bool
	KeyLength            uint16
	ReplayCounter        uint64
	Nonce                []byte
	IV                   []byte
	RSC                  uint64
	ID                   uint64
	MIC                  []byte
	KeyDataLength        uint16
	EncryptedKeyData     []byte
}

EAPOLKey defines an EAPOL-Key frame for 802.1x authentication

func (*EAPOLKey) CanDecode

func (ek *EAPOLKey) CanDecode() gopacket.LayerType

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*EAPOLKey) DecodeFromBytes

func (ek *EAPOLKey) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*EAPOLKey) LayerType

func (ek *EAPOLKey) LayerType() gopacket.LayerType

LayerType returns LayerTypeEAPOLKey.

func (*EAPOLKey) NextLayerType

func (ek *EAPOLKey) NextLayerType() gopacket.LayerType

NextLayerType returns layers.LayerTypeDot11InformationElement if the key data exists and is unencrypted, otherwise it does not expect a next layer.

func (*EAPOLKey) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type EAPOLKeyDescriptorType

type EAPOLKeyDescriptorType uint8

EAPOLKeyDescriptorType is an enumeration of key descriptor types as specified by 802.1x in the EAPOL-Key frame

const (
	EAPOLKeyDescriptorTypeRC4   EAPOLKeyDescriptorType = 1
	EAPOLKeyDescriptorTypeDot11 EAPOLKeyDescriptorType = 2
	EAPOLKeyDescriptorTypeWPA   EAPOLKeyDescriptorType = 254
)

Enumeration of EAPOLKeyDescriptorType

func (EAPOLKeyDescriptorType) String

func (kdt EAPOLKeyDescriptorType) String() string

type EAPOLKeyDescriptorVersion

type EAPOLKeyDescriptorVersion uint8

EAPOLKeyDescriptorVersion is an enumeration of versions specifying the encryption algorithm for the key data and the authentication for the message integrity code (MIC)

const (
	EAPOLKeyDescriptorVersionOther       EAPOLKeyDescriptorVersion = 0
	EAPOLKeyDescriptorVersionRC4HMACMD5  EAPOLKeyDescriptorVersion = 1
	EAPOLKeyDescriptorVersionAESHMACSHA1 EAPOLKeyDescriptorVersion = 2
	EAPOLKeyDescriptorVersionAES128CMAC  EAPOLKeyDescriptorVersion = 3
)

Enumeration of EAPOLKeyDescriptorVersion

func (EAPOLKeyDescriptorVersion) String

func (v EAPOLKeyDescriptorVersion) String() string

type EAPOLKeyType

type EAPOLKeyType uint8

EAPOLKeyType is an enumeration of key derivation types describing the purpose of the keys being derived.

const (
	EAPOLKeyTypeGroupSMK EAPOLKeyType = 0
	EAPOLKeyTypePairwise EAPOLKeyType = 1
)

Enumeration of EAPOLKeyType

func (EAPOLKeyType) String

func (kt EAPOLKeyType) String() string

type EAPOLType

type EAPOLType uint8

EAPOLType is an enumeration of EAPOL packet types.

const (
	EAPOLTypeEAP      EAPOLType = 0
	EAPOLTypeStart    EAPOLType = 1
	EAPOLTypeLogOff   EAPOLType = 2
	EAPOLTypeKey      EAPOLType = 3
	EAPOLTypeASFAlert EAPOLType = 4
)

func (EAPOLType) Decode

func (a EAPOLType) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls EAPOLTypeMetadata.DecodeWith's decoder.

func (EAPOLType) LayerType

func (a EAPOLType) LayerType() gopacket.LayerType

LayerType returns EAPOLTypeMetadata.LayerType.

func (EAPOLType) String

func (a EAPOLType) String() string

String returns EAPOLTypeMetadata.Name.

type EAPType

type EAPType uint8

type ERSPANII

type ERSPANII struct {
	BaseLayer
	IsTruncated                         bool
	Version, CoS, TrunkEncap            uint8
	VLANIdentifier, SessionID, Reserved uint16
	Index                               uint32
}

ERSPANII contains all of the fields found in an ERSPAN Type II header https://tools.ietf.org/html/draft-foschiano-erspan-03

func (*ERSPANII) CanDecode

func (erspan2 *ERSPANII) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ERSPANII) DecodeFromBytes

func (erspan2 *ERSPANII) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ERSPANII) LayerType

func (erspan2 *ERSPANII) LayerType() gopacket.LayerType

func (*ERSPANII) NextLayerType

func (erspan2 *ERSPANII) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ERSPANII) SerializeTo

func (erspan2 *ERSPANII) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type EnumMetadata

type EnumMetadata struct {
	// DecodeWith is the decoder to use to decode this protocol's data.
	DecodeWith gopacket.Decoder
	// Name is the name of the enumeration value.
	Name string
	// LayerType is the layer type implied by the given enum.
	LayerType gopacket.LayerType
}

EnumMetadata keeps track of a set of metadata for each enumeration value for protocol enumerations.

type EtherIP

type EtherIP struct {
	BaseLayer
	Version  uint8
	Reserved uint16
}

EtherIP is the struct for storing RFC 3378 EtherIP packet headers.

func (*EtherIP) CanDecode

func (e *EtherIP) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*EtherIP) DecodeFromBytes

func (e *EtherIP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*EtherIP) LayerType

func (e *EtherIP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeEtherIP.

func (*EtherIP) NextLayerType

func (e *EtherIP) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

type Ethernet

type Ethernet struct {
	BaseLayer
	SrcMAC, DstMAC net.HardwareAddr
	EthernetType   EthernetType
	// Length is only set if a length field exists within this header.  Ethernet
	// headers follow two different standards, one that uses an EthernetType, the
	// other which defines a length the follows with a LLC header (802.3).  If the
	// former is the case, we set EthernetType and Length stays 0.  In the latter
	// case, we set Length and EthernetType = EthernetTypeLLC.
	Length uint16
}

Ethernet is the layer for Ethernet frame headers.

func (*Ethernet) CanDecode

func (eth *Ethernet) CanDecode() gopacket.LayerClass

func (*Ethernet) DecodeFromBytes

func (eth *Ethernet) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Ethernet) LayerType

func (e *Ethernet) LayerType() gopacket.LayerType

LayerType returns LayerTypeEthernet

func (*Ethernet) LinkFlow

func (e *Ethernet) LinkFlow() gopacket.Flow

func (*Ethernet) NextLayerType

func (eth *Ethernet) NextLayerType() gopacket.LayerType

func (*Ethernet) SerializeTo

func (eth *Ethernet) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type EthernetCTP

type EthernetCTP struct {
	BaseLayer
	SkipCount uint16
}

EthernetCTP implements the EthernetCTP protocol, see http://www.mit.edu/people/jhawk/ctp.html. We split EthernetCTP up into the top-level EthernetCTP layer, followed by zero or more EthernetCTPForwardData layers, followed by a final EthernetCTPReply layer.

func (*EthernetCTP) LayerType

func (c *EthernetCTP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeEthernetCTP.

type EthernetCTPForwardData

type EthernetCTPForwardData struct {
	BaseLayer
	Function       EthernetCTPFunction
	ForwardAddress []byte
}

EthernetCTPForwardData is the ForwardData layer inside EthernetCTP. See EthernetCTP's docs for more details.

func (*EthernetCTPForwardData) ForwardEndpoint

func (c *EthernetCTPForwardData) ForwardEndpoint() gopacket.Endpoint

ForwardEndpoint returns the EthernetCTPForwardData ForwardAddress as an endpoint.

func (*EthernetCTPForwardData) LayerType

func (c *EthernetCTPForwardData) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeEthernetCTPForwardData.

type EthernetCTPFunction

type EthernetCTPFunction uint16

EthernetCTPFunction is the function code used by the EthernetCTP protocol to identify each EthernetCTP layer.

const (
	EthernetCTPFunctionReply       EthernetCTPFunction = 1
	EthernetCTPFunctionForwardData EthernetCTPFunction = 2
)

EthernetCTPFunction values.

type EthernetCTPReply

type EthernetCTPReply struct {
	BaseLayer
	Function      EthernetCTPFunction
	ReceiptNumber uint16
	Data          []byte
}

EthernetCTPReply is the Reply layer inside EthernetCTP. See EthernetCTP's docs for more details.

func (*EthernetCTPReply) LayerType

func (c *EthernetCTPReply) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeEthernetCTPReply.

func (*EthernetCTPReply) Payload

func (c *EthernetCTPReply) Payload() []byte

Payload returns the EthernetCTP reply's Data bytes.

type EthernetType

type EthernetType uint16

EthernetType is an enumeration of ethernet type values, and acts as a decoder for any type it supports.

const (
	// EthernetTypeLLC is not an actual ethernet type.  It is instead a
	// placeholder we use in Ethernet frames that use the 802.3 standard of
	// srcmac|dstmac|length|LLC instead of srcmac|dstmac|ethertype.
	EthernetTypeLLC                         EthernetType = 0
	EthernetTypeIPv4                        EthernetType = 0x0800
	EthernetTypeARP                         EthernetType = 0x0806
	EthernetTypeIPv6                        EthernetType = 0x86DD
	EthernetTypeCiscoDiscovery              EthernetType = 0x2000
	EthernetTypeNortelDiscovery             EthernetType = 0x01a2
	EthernetTypeTransparentEthernetBridging EthernetType = 0x6558
	EthernetTypeDot1Q                       EthernetType = 0x8100
	EthernetTypePPP                         EthernetType = 0x880b
	EthernetTypePPPoEDiscovery              EthernetType = 0x8863
	EthernetTypePPPoESession                EthernetType = 0x8864
	EthernetTypeMPLSUnicast                 EthernetType = 0x8847
	EthernetTypeMPLSMulticast               EthernetType = 0x8848
	EthernetTypeEAPOL                       EthernetType = 0x888e
	EthernetTypeERSPAN                      EthernetType = 0x88be
	EthernetTypeQinQ                        EthernetType = 0x88a8
	EthernetTypeLinkLayerDiscovery          EthernetType = 0x88cc
	EthernetTypeEthernetCTP                 EthernetType = 0x9000
)

func (EthernetType) Decode

func (a EthernetType) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls EthernetTypeMetadata.DecodeWith's decoder.

func (EthernetType) LayerType

func (a EthernetType) LayerType() gopacket.LayerType

LayerType returns EthernetTypeMetadata.LayerType.

func (EthernetType) String

func (a EthernetType) String() string

String returns EthernetTypeMetadata.Name.

type FDDI

type FDDI struct {
	BaseLayer
	FrameControl   FDDIFrameControl
	Priority       uint8
	SrcMAC, DstMAC net.HardwareAddr
}

FDDI contains the header for FDDI frames.

func (*FDDI) LayerType

func (f *FDDI) LayerType() gopacket.LayerType

LayerType returns LayerTypeFDDI.

func (*FDDI) LinkFlow

func (f *FDDI) LinkFlow() gopacket.Flow

LinkFlow returns a new flow of type EndpointMAC.

type FDDIFrameControl

type FDDIFrameControl uint8

FDDIFrameControl is an enumeration of FDDI frame control bytes.

const (
	FDDIFrameControlLLC FDDIFrameControl = 0x50
)

func (FDDIFrameControl) Decode

func (a FDDIFrameControl) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls FDDIFrameControlMetadata.DecodeWith's decoder.

func (FDDIFrameControl) LayerType

func (a FDDIFrameControl) LayerType() gopacket.LayerType

LayerType returns FDDIFrameControlMetadata.LayerType.

func (FDDIFrameControl) String

func (a FDDIFrameControl) String() string

String returns FDDIFrameControlMetadata.Name.

type GRE

type GRE struct {
	BaseLayer
	ChecksumPresent, RoutingPresent, KeyPresent, SeqPresent, StrictSourceRoute, AckPresent bool
	RecursionControl, Flags, Version                                                       uint8
	Protocol                                                                               EthernetType
	Checksum, Offset                                                                       uint16
	Key, Seq, Ack                                                                          uint32
	*GRERouting
}

GRE is a Generic Routing Encapsulation header.

func (*GRE) CanDecode

func (g *GRE) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*GRE) DecodeFromBytes

func (g *GRE) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*GRE) LayerType

func (g *GRE) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeGRE.

func (*GRE) NextLayerType

func (g *GRE) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*GRE) SerializeTo

func (g *GRE) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type GRERouting

type GRERouting struct {
	AddressFamily        uint16
	SREOffset, SRELength uint8
	RoutingInformation   []byte
	Next                 *GRERouting
}

GRERouting is GRE routing information, present if the RoutingPresent flag is set.

type GTPExtensionHeader

type GTPExtensionHeader struct {
	Type    uint8
	Content []byte
}

GTPExtensionHeader is used to carry extra data and enable future extensions of the GTP without the need to use another version number.

type GTPv1U

type GTPv1U struct {
	BaseLayer
	Version             uint8
	ProtocolType        uint8
	Reserved            uint8
	ExtensionHeaderFlag bool
	SequenceNumberFlag  bool
	NPDUFlag            bool
	MessageType         uint8
	MessageLength       uint16
	TEID                uint32
	SequenceNumber      uint16
	NPDU                uint8
	GTPExtensionHeaders []GTPExtensionHeader
}

GTPv1U protocol is used to exchange user data over GTP tunnels across the Sx interfaces. Defined in https://portal.3gpp.org/desktopmodules/Specifications/SpecificationDetails.aspx?specificationId=1595

func (*GTPv1U) CanDecode

func (g *GTPv1U) CanDecode() gopacket.LayerClass

CanDecode returns a set of layers that GTP objects can decode.

func (*GTPv1U) DecodeFromBytes

func (g *GTPv1U) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes analyses a byte slice and attempts to decode it as a GTPv1U packet

func (*GTPv1U) LayerType

func (g *GTPv1U) LayerType() gopacket.LayerType

LayerType returns LayerTypeGTPV1U

func (*GTPv1U) NextLayerType

func (g *GTPv1U) NextLayerType() gopacket.LayerType

NextLayerType specifies the next layer that GoPacket should attempt to

func (*GTPv1U) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type Geneve

type Geneve struct {
	BaseLayer
	Version        uint8        // 2 bits
	OptionsLength  uint8        // 6 bits
	OAMPacket      bool         // 1 bits
	CriticalOption bool         // 1 bits
	Protocol       EthernetType // 16 bits
	VNI            uint32       // 24bits
	Options        []*GeneveOption
}

Geneve is specifed here https://tools.ietf.org/html/draft-ietf-nvo3-geneve-03 Geneve Header: +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ |Ver| Opt Len |O|C| Rsvd. | Protocol Type | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Virtual Network Identifier (VNI) | Reserved | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Variable Length Options | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

func (*Geneve) DecodeFromBytes

func (gn *Geneve) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*Geneve) LayerType

func (gn *Geneve) LayerType() gopacket.LayerType

LayerType returns LayerTypeGeneve

func (*Geneve) NextLayerType

func (gn *Geneve) NextLayerType() gopacket.LayerType

func (*Geneve) SerializeTo

func (gn *Geneve) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type GeneveOption

type GeneveOption struct {
	Class  uint16 // 16 bits
	Type   uint8  // 8 bits
	Flags  uint8  // 3 bits
	Length uint8  // 5 bits
	Data   []byte
}

Geneve Tunnel Options +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Option Class | Type |R|R|R| Length | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Variable Option Data | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

type HelloPkg

type HelloPkg struct {
	InterfaceID              uint32
	RtrPriority              uint8
	Options                  uint32
	HelloInterval            uint16
	RouterDeadInterval       uint32
	DesignatedRouterID       uint32
	BackupDesignatedRouterID uint32
	NeighborID               []uint32
}

HelloPkg is the struct from RFC 5340 A.3.2.

type HelloPkgV2

type HelloPkgV2 struct {
	HelloPkg
	NetworkMask uint32
}

HelloPkgV2 extends the HelloPkg struct with OSPFv2 information

type IANAAddressFamily

type IANAAddressFamily byte
const (
	IANAAddressFamilyReserved IANAAddressFamily = 0
	IANAAddressFamilyIPV4     IANAAddressFamily = 1
	IANAAddressFamilyIPV6     IANAAddressFamily = 2
	IANAAddressFamilyNSAP     IANAAddressFamily = 3
	IANAAddressFamilyHDLC     IANAAddressFamily = 4
	IANAAddressFamilyBBN1822  IANAAddressFamily = 5
	IANAAddressFamily802      IANAAddressFamily = 6
	IANAAddressFamilyE163     IANAAddressFamily = 7
	IANAAddressFamilyE164     IANAAddressFamily = 8
	IANAAddressFamilyF69      IANAAddressFamily = 9
	IANAAddressFamilyX121     IANAAddressFamily = 10
	IANAAddressFamilyIPX      IANAAddressFamily = 11
	IANAAddressFamilyAtalk    IANAAddressFamily = 12
	IANAAddressFamilyDecnet   IANAAddressFamily = 13
	IANAAddressFamilyBanyan   IANAAddressFamily = 14
	IANAAddressFamilyE164NSAP IANAAddressFamily = 15
	IANAAddressFamilyDNS      IANAAddressFamily = 16
	IANAAddressFamilyDistname IANAAddressFamily = 17
	IANAAddressFamilyASNumber IANAAddressFamily = 18
	IANAAddressFamilyXTPIPV4  IANAAddressFamily = 19
	IANAAddressFamilyXTPIPV6  IANAAddressFamily = 20
	IANAAddressFamilyXTP      IANAAddressFamily = 21
	IANAAddressFamilyFcWWPN   IANAAddressFamily = 22
	IANAAddressFamilyFcWWNN   IANAAddressFamily = 23
	IANAAddressFamilyGWID     IANAAddressFamily = 24
	IANAAddressFamilyL2VPN    IANAAddressFamily = 25
)

LLDP Management Address Subtypes http://www.iana.org/assignments/address-family-numbers/address-family-numbers.xml

func (IANAAddressFamily) String

func (t IANAAddressFamily) String() (s string)

type ICMPv4

type ICMPv4 struct {
	BaseLayer
	TypeCode ICMPv4TypeCode
	Checksum uint16
	Id       uint16
	Seq      uint16
}

ICMPv4 is the layer for IPv4 ICMP packet data.

func (*ICMPv4) CanDecode

func (i *ICMPv4) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ICMPv4) DecodeFromBytes

func (i *ICMPv4) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv4) LayerType

func (i *ICMPv4) LayerType() gopacket.LayerType

LayerType returns LayerTypeICMPv4.

func (*ICMPv4) NextLayerType

func (i *ICMPv4) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ICMPv4) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ICMPv4TypeCode

type ICMPv4TypeCode uint16

func CreateICMPv4TypeCode

func CreateICMPv4TypeCode(typ uint8, code uint8) ICMPv4TypeCode

CreateICMPv4TypeCode is a convenience function to create an ICMPv4TypeCode gopacket type from the ICMPv4 type and code values.

func (ICMPv4TypeCode) Code

func (a ICMPv4TypeCode) Code() uint8

Code returns the ICMPv4 code field.

func (ICMPv4TypeCode) GoString

func (a ICMPv4TypeCode) GoString() string

func (ICMPv4TypeCode) SerializeTo

func (a ICMPv4TypeCode) SerializeTo(bytes []byte)

SerializeTo writes the ICMPv4TypeCode value to the 'bytes' buffer.

func (ICMPv4TypeCode) String

func (a ICMPv4TypeCode) String() string

func (ICMPv4TypeCode) Type

func (a ICMPv4TypeCode) Type() uint8

Type returns the ICMPv4 type field.

type ICMPv6

type ICMPv6 struct {
	BaseLayer
	TypeCode ICMPv6TypeCode
	Checksum uint16
	// TypeBytes is deprecated and always nil. See the different ICMPv6 message types
	// instead (e.g. ICMPv6TypeRouterSolicitation).
	TypeBytes []byte
	// contains filtered or unexported fields
}

ICMPv6 is the layer for IPv6 ICMP packet data

func (*ICMPv6) CanDecode

func (i *ICMPv6) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ICMPv6) DecodeFromBytes

func (i *ICMPv6) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv6) LayerType

func (i *ICMPv6) LayerType() gopacket.LayerType

LayerType returns LayerTypeICMPv6.

func (*ICMPv6) NextLayerType

func (i *ICMPv6) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ICMPv6) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

func (*ICMPv6) SetNetworkLayerForChecksum

func (i *ICMPv6) SetNetworkLayerForChecksum(l gopacket.NetworkLayer) error

SetNetworkLayerForChecksum tells this layer which network layer is wrapping it. This is needed for computing the checksum when serializing, since TCP/IP transport layer checksums depends on fields in the IPv4 or IPv6 layer that contains it. The passed in layer must be an *IPv4 or *IPv6.

type ICMPv6Echo

type ICMPv6Echo struct {
	BaseLayer
	Identifier uint16
	SeqNumber  uint16
}

ICMPv6Echo represents the structure of a ping.

func (*ICMPv6Echo) CanDecode

func (i *ICMPv6Echo) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ICMPv6Echo) DecodeFromBytes

func (i *ICMPv6Echo) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv6Echo) LayerType

func (i *ICMPv6Echo) LayerType() gopacket.LayerType

LayerType returns LayerTypeICMPv6Echo.

func (*ICMPv6Echo) NextLayerType

func (i *ICMPv6Echo) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ICMPv6Echo) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ICMPv6NeighborAdvertisement

type ICMPv6NeighborAdvertisement struct {
	BaseLayer
	Flags         uint8
	TargetAddress net.IP
	Options       ICMPv6Options
}

ICMPv6NeighborAdvertisement is sent by nodes in response to Solicitation.

func (*ICMPv6NeighborAdvertisement) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ICMPv6NeighborAdvertisement) DecodeFromBytes

func (i *ICMPv6NeighborAdvertisement) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv6NeighborAdvertisement) LayerType

LayerType returns LayerTypeICMPv6NeighborAdvertisement.

func (*ICMPv6NeighborAdvertisement) NextLayerType

func (i *ICMPv6NeighborAdvertisement) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ICMPv6NeighborAdvertisement) Override

func (i *ICMPv6NeighborAdvertisement) Override() bool

Override indicates whether the advertisement should Override an existing cache entry.

func (*ICMPv6NeighborAdvertisement) Router

func (i *ICMPv6NeighborAdvertisement) Router() bool

Router indicates whether the sender is a router or not.

func (*ICMPv6NeighborAdvertisement) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

func (*ICMPv6NeighborAdvertisement) Solicited

func (i *ICMPv6NeighborAdvertisement) Solicited() bool

Solicited indicates whether the advertisement was solicited or not.

type ICMPv6NeighborSolicitation

type ICMPv6NeighborSolicitation struct {
	BaseLayer
	TargetAddress net.IP
	Options       ICMPv6Options
}

ICMPv6NeighborSolicitation is sent to request the link-layer address of a target node.

func (*ICMPv6NeighborSolicitation) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ICMPv6NeighborSolicitation) DecodeFromBytes

func (i *ICMPv6NeighborSolicitation) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv6NeighborSolicitation) LayerType

LayerType returns LayerTypeICMPv6NeighborSolicitation.

func (*ICMPv6NeighborSolicitation) NextLayerType

func (i *ICMPv6NeighborSolicitation) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ICMPv6NeighborSolicitation) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ICMPv6Opt

type ICMPv6Opt uint8

ICMPv6Opt indicate how to decode the data associated with each ICMPv6Option.

const (

	// ICMPv6OptSourceAddress contains the link-layer address of the sender of
	// the packet. It is used in the Neighbor Solicitation, Router
	// Solicitation, and Router Advertisement packets. Must be ignored for other
	// Neighbor discovery messages.
	ICMPv6OptSourceAddress ICMPv6Opt

	// ICMPv6OptTargetAddress contains the link-layer address of the target. It
	// is used in Neighbor Advertisement and Redirect packets. Must be ignored
	// for other Neighbor discovery messages.
	ICMPv6OptTargetAddress

	// ICMPv6OptPrefixInfo provides hosts with on-link prefixes and prefixes
	// for Address Autoconfiguration. The Prefix Information option appears in
	// Router Advertisement packets and MUST be silently ignored for other
	// messages.
	ICMPv6OptPrefixInfo

	// ICMPv6OptRedirectedHeader is used in Redirect messages and contains all
	// or part of the packet that is being redirected.
	ICMPv6OptRedirectedHeader

	// ICMPv6OptMTU is used in Router Advertisement messages to ensure that all
	// nodes on a link use the same MTU value in those cases where the link MTU
	// is not well known. This option MUST be silently ignored for other
	// Neighbor Discovery messages.
	ICMPv6OptMTU
)

func (ICMPv6Opt) String

func (i ICMPv6Opt) String() string

type ICMPv6Option

type ICMPv6Option struct {
	Type ICMPv6Opt
	Data []byte
}

ICMPv6Option contains the type and data for a single option.

func (ICMPv6Option) String

func (i ICMPv6Option) String() string

type ICMPv6Options

type ICMPv6Options []ICMPv6Option

ICMPv6Options is a slice of ICMPv6Option.

func (*ICMPv6Options) DecodeFromBytes

func (i *ICMPv6Options) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv6Options) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ICMPv6Redirect

type ICMPv6Redirect struct {
	BaseLayer
	TargetAddress      net.IP
	DestinationAddress net.IP
	Options            ICMPv6Options
}

ICMPv6Redirect is sent by routers to inform hosts of a better first-hop node on the path to a destination.

func (*ICMPv6Redirect) CanDecode

func (i *ICMPv6Redirect) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ICMPv6Redirect) DecodeFromBytes

func (i *ICMPv6Redirect) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv6Redirect) LayerType

func (i *ICMPv6Redirect) LayerType() gopacket.LayerType

LayerType returns LayerTypeICMPv6Redirect.

func (*ICMPv6Redirect) NextLayerType

func (i *ICMPv6Redirect) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ICMPv6Redirect) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ICMPv6RouterAdvertisement

type ICMPv6RouterAdvertisement struct {
	BaseLayer
	HopLimit       uint8
	Flags          uint8
	RouterLifetime uint16
	ReachableTime  uint32
	RetransTimer   uint32
	Options        ICMPv6Options
}

ICMPv6RouterAdvertisement is sent by routers in response to Solicitation.

func (*ICMPv6RouterAdvertisement) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ICMPv6RouterAdvertisement) DecodeFromBytes

func (i *ICMPv6RouterAdvertisement) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv6RouterAdvertisement) LayerType

LayerType returns LayerTypeICMPv6RouterAdvertisement.

func (*ICMPv6RouterAdvertisement) ManagedAddressConfig

func (i *ICMPv6RouterAdvertisement) ManagedAddressConfig() bool

ManagedAddressConfig is true when addresses are available via DHCPv6. If set, the OtherConfig flag is redundant.

func (*ICMPv6RouterAdvertisement) NextLayerType

func (i *ICMPv6RouterAdvertisement) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ICMPv6RouterAdvertisement) OtherConfig

func (i *ICMPv6RouterAdvertisement) OtherConfig() bool

OtherConfig is true when there is other configuration information available via DHCPv6. For example, DNS-related information.

func (*ICMPv6RouterAdvertisement) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ICMPv6RouterSolicitation

type ICMPv6RouterSolicitation struct {
	BaseLayer
	Options ICMPv6Options
}

ICMPv6RouterSolicitation is sent by hosts to find routers.

func (*ICMPv6RouterSolicitation) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*ICMPv6RouterSolicitation) DecodeFromBytes

func (i *ICMPv6RouterSolicitation) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*ICMPv6RouterSolicitation) LayerType

LayerType returns LayerTypeICMPv6.

func (*ICMPv6RouterSolicitation) NextLayerType

func (i *ICMPv6RouterSolicitation) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*ICMPv6RouterSolicitation) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ICMPv6TypeCode

type ICMPv6TypeCode uint16

func CreateICMPv6TypeCode

func CreateICMPv6TypeCode(typ uint8, code uint8) ICMPv6TypeCode

CreateICMPv6TypeCode is a convenience function to create an ICMPv6TypeCode gopacket type from the ICMPv6 type and code values.

func (ICMPv6TypeCode) Code

func (a ICMPv6TypeCode) Code() uint8

Code returns the ICMPv6 code field.

func (ICMPv6TypeCode) GoString

func (a ICMPv6TypeCode) GoString() string

func (ICMPv6TypeCode) SerializeTo

func (a ICMPv6TypeCode) SerializeTo(bytes []byte)

SerializeTo writes the ICMPv6TypeCode value to the 'bytes' buffer.

func (ICMPv6TypeCode) String

func (a ICMPv6TypeCode) String() string

func (ICMPv6TypeCode) Type

func (a ICMPv6TypeCode) Type() uint8

Type returns the ICMPv6 type field.

type IEEEOUI

type IEEEOUI uint32
const (
	IEEEOUI8021     IEEEOUI = 0x0080c2
	IEEEOUI8023     IEEEOUI = 0x00120f
	IEEEOUI80211    IEEEOUI = 0x000fac
	IEEEOUI8021Qbg  IEEEOUI = 0x0013BF
	IEEEOUICisco2   IEEEOUI = 0x000142
	IEEEOUIMedia    IEEEOUI = 0x0012bb // TR-41
	IEEEOUIProfinet IEEEOUI = 0x000ecf
	IEEEOUIDCBX     IEEEOUI = 0x001b21
)

http://standards.ieee.org/develop/regauth/oui/oui.txt

type IGMP

type IGMP struct {
	BaseLayer
	Type                    IGMPType
	MaxResponseTime         time.Duration
	Checksum                uint16
	GroupAddress            net.IP
	SupressRouterProcessing bool
	RobustnessValue         uint8
	IntervalTime            time.Duration
	SourceAddresses         []net.IP
	NumberOfGroupRecords    uint16
	NumberOfSources         uint16
	GroupRecords            []IGMPv3GroupRecord
	Version                 uint8 // IGMP protocol version
}

IGMP represents an IGMPv3 message.

func (*IGMP) CanDecode

func (i *IGMP) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*IGMP) DecodeFromBytes

func (i *IGMP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*IGMP) LayerType

func (i *IGMP) LayerType() gopacket.LayerType

LayerType returns LayerTypeIGMP for the V1,2,3 message protocol formats.

func (*IGMP) NextLayerType

func (i *IGMP) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

type IGMPType

type IGMPType uint8
const (
	IGMPMembershipQuery    IGMPType = 0x11 // General or group specific query
	IGMPMembershipReportV1 IGMPType = 0x12 // Version 1 Membership Report
	IGMPMembershipReportV2 IGMPType = 0x16 // Version 2 Membership Report
	IGMPLeaveGroup         IGMPType = 0x17 // Leave Group
	IGMPMembershipReportV3 IGMPType = 0x22 // Version 3 Membership Report
)

func (IGMPType) String

func (i IGMPType) String() string

String conversions for IGMP message types

type IGMPv1or2

type IGMPv1or2 struct {
	BaseLayer
	Type            IGMPType      // IGMP message type
	MaxResponseTime time.Duration // meaningful only in Membership Query messages
	Checksum        uint16        // 16-bit checksum of entire ip payload
	GroupAddress    net.IP        // either 0 or an IP multicast address
	Version         uint8
}

IGMPv1or2 stores header details for an IGMPv1 or IGMPv2 packet.

0                   1                   2                   3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1

+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Type | Max Resp Time | Checksum | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ | Group Address | +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

func (*IGMPv1or2) CanDecode

func (i *IGMPv1or2) CanDecode() gopacket.LayerClass

func (*IGMPv1or2) DecodeFromBytes

func (i *IGMPv1or2) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*IGMPv1or2) LayerType

func (i *IGMPv1or2) LayerType() gopacket.LayerType

func (*IGMPv1or2) NextLayerType

func (i *IGMPv1or2) NextLayerType() gopacket.LayerType

type IGMPv3GroupRecord

type IGMPv3GroupRecord struct {
	Type             IGMPv3GroupRecordType
	AuxDataLen       uint8 // this should always be 0 as per IGMPv3 spec.
	NumberOfSources  uint16
	MulticastAddress net.IP
	SourceAddresses  []net.IP
	AuxData          uint32 // NOT USED
}

IGMPv3GroupRecord stores individual group records for a V3 Membership Report message.

type IGMPv3GroupRecordType

type IGMPv3GroupRecordType uint8
const (
	IGMPIsIn  IGMPv3GroupRecordType = 0x01 // Type MODE_IS_INCLUDE, source addresses x
	IGMPIsEx  IGMPv3GroupRecordType = 0x02 // Type MODE_IS_EXCLUDE, source addresses x
	IGMPToIn  IGMPv3GroupRecordType = 0x03 // Type CHANGE_TO_INCLUDE_MODE, source addresses x
	IGMPToEx  IGMPv3GroupRecordType = 0x04 // Type CHANGE_TO_EXCLUDE_MODE, source addresses x
	IGMPAllow IGMPv3GroupRecordType = 0x05 // Type ALLOW_NEW_SOURCES, source addresses x
	IGMPBlock IGMPv3GroupRecordType = 0x06 // Type BLOCK_OLD_SOURCES, source addresses x
)

func (IGMPv3GroupRecordType) String

func (i IGMPv3GroupRecordType) String() string

type IPProtocol

type IPProtocol uint8

IPProtocol is an enumeration of IP protocol values, and acts as a decoder for any type it supports.

const (
	IPProtocolIPv6HopByHop    IPProtocol = 0
	IPProtocolICMPv4          IPProtocol = 1
	IPProtocolIGMP            IPProtocol = 2
	IPProtocolIPv4            IPProtocol = 4
	IPProtocolTCP             IPProtocol = 6
	IPProtocolUDP             IPProtocol = 17
	IPProtocolRUDP            IPProtocol = 27
	IPProtocolIPv6            IPProtocol = 41
	IPProtocolIPv6Routing     IPProtocol = 43
	IPProtocolIPv6Fragment    IPProtocol = 44
	IPProtocolGRE             IPProtocol = 47
	IPProtocolESP             IPProtocol = 50
	IPProtocolAH              IPProtocol = 51
	IPProtocolICMPv6          IPProtocol = 58
	IPProtocolNoNextHeader    IPProtocol = 59
	IPProtocolIPv6Destination IPProtocol = 60
	IPProtocolOSPF            IPProtocol = 89
	IPProtocolIPIP            IPProtocol = 94
	IPProtocolEtherIP         IPProtocol = 97
	IPProtocolVRRP            IPProtocol = 112
	IPProtocolSCTP            IPProtocol = 132
	IPProtocolUDPLite         IPProtocol = 136
	IPProtocolMPLSInIP        IPProtocol = 137
)

func (IPProtocol) Decode

func (a IPProtocol) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls IPProtocolMetadata.DecodeWith's decoder.

func (IPProtocol) LayerType

func (a IPProtocol) LayerType() gopacket.LayerType

LayerType returns IPProtocolMetadata.LayerType.

func (IPProtocol) String

func (a IPProtocol) String() string

String returns IPProtocolMetadata.Name.

type IPSecAH

type IPSecAH struct {
	Reserved           uint16
	SPI, Seq           uint32
	AuthenticationData []byte
	// contains filtered or unexported fields
}

IPSecAH is the authentication header for IPv4/6 defined in http://tools.ietf.org/html/rfc2402

func (*IPSecAH) LayerType

func (i *IPSecAH) LayerType() gopacket.LayerType

LayerType returns LayerTypeIPSecAH.

type IPSecESP

type IPSecESP struct {
	BaseLayer
	SPI, Seq uint32
	// Encrypted contains the encrypted set of bytes sent in an ESP
	Encrypted []byte
}

IPSecESP is the encapsulating security payload defined in http://tools.ietf.org/html/rfc2406

func (*IPSecESP) LayerType

func (i *IPSecESP) LayerType() gopacket.LayerType

LayerType returns LayerTypeIPSecESP.

type IPv4

type IPv4 struct {
	BaseLayer
	Version    uint8
	IHL        uint8
	TOS        uint8
	Length     uint16
	Id         uint16
	Flags      IPv4Flag
	FragOffset uint16
	TTL        uint8
	Protocol   IPProtocol
	Checksum   uint16
	SrcIP      net.IP
	DstIP      net.IP
	Options    []IPv4Option
	Padding    []byte
}

IPv4 is the header of an IP packet.

func (*IPv4) AddressTo4

func (ip *IPv4) AddressTo4() error

func (*IPv4) CanDecode

func (i *IPv4) CanDecode() gopacket.LayerClass

func (*IPv4) DecodeFromBytes

func (ip *IPv4) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*IPv4) LayerType

func (i *IPv4) LayerType() gopacket.LayerType

LayerType returns LayerTypeIPv4

func (*IPv4) NetworkFlow

func (i *IPv4) NetworkFlow() gopacket.Flow

func (*IPv4) NextLayerType

func (i *IPv4) NextLayerType() gopacket.LayerType

func (*IPv4) SerializeTo

func (ip *IPv4) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer.

type IPv4Flag

type IPv4Flag uint8
const (
	IPv4EvilBit       IPv4Flag = 1 << 2 // http://tools.ietf.org/html/rfc3514 ;)
	IPv4DontFragment  IPv4Flag = 1 << 1
	IPv4MoreFragments IPv4Flag = 1 << 0
)

func (IPv4Flag) String

func (f IPv4Flag) String() string

type IPv4Option

type IPv4Option struct {
	OptionType   uint8
	OptionLength uint8
	OptionData   []byte
}

func (IPv4Option) String

func (i IPv4Option) String() string

type IPv6

type IPv6 struct {
	// http://www.networksorcery.com/enp/protocol/ipv6.htm
	BaseLayer
	Version      uint8
	TrafficClass uint8
	FlowLabel    uint32
	Length       uint16
	NextHeader   IPProtocol
	HopLimit     uint8
	SrcIP        net.IP
	DstIP        net.IP
	HopByHop     *IPv6HopByHop
	// contains filtered or unexported fields
}

IPv6 is the layer for the IPv6 header.

func (*IPv6) AddressTo16

func (ipv6 *IPv6) AddressTo16() error

AddressTo16 ensures IPv6.SrcIP and IPv6.DstIP are actually IPv6 addresses (i.e. 16 byte addresses)

func (*IPv6) CanDecode

func (ipv6 *IPv6) CanDecode() gopacket.LayerClass

CanDecode implementation according to gopacket.DecodingLayer

func (*IPv6) DecodeFromBytes

func (ipv6 *IPv6) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes implementation according to gopacket.DecodingLayer

func (*IPv6) LayerType

func (ipv6 *IPv6) LayerType() gopacket.LayerType

LayerType returns LayerTypeIPv6

func (*IPv6) NetworkFlow

func (ipv6 *IPv6) NetworkFlow() gopacket.Flow

NetworkFlow returns this new Flow (EndpointIPv6, SrcIP, DstIP)

func (*IPv6) NextLayerType

func (ipv6 *IPv6) NextLayerType() gopacket.LayerType

NextLayerType implementation according to gopacket.DecodingLayer

func (*IPv6) SerializeTo

func (ipv6 *IPv6) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type IPv6Destination

type IPv6Destination struct {
	Options []*IPv6DestinationOption
	// contains filtered or unexported fields
}

IPv6Destination is the IPv6 destination options header.

func (*IPv6Destination) DecodeFromBytes

func (i *IPv6Destination) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes implementation according to gopacket.DecodingLayer

func (*IPv6Destination) LayerType

func (i *IPv6Destination) LayerType() gopacket.LayerType

LayerType returns LayerTypeIPv6Destination.

func (*IPv6Destination) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type IPv6DestinationOption

type IPv6DestinationOption ipv6HeaderTLVOption

IPv6DestinationOption is a TLV option present in an IPv6 destination options extension.

type IPv6ExtensionSkipper

type IPv6ExtensionSkipper struct {
	NextHeader IPProtocol
	BaseLayer
}

IPv6ExtensionSkipper is a DecodingLayer which decodes and ignores v6 extensions. You can use it with a DecodingLayerParser to handle IPv6 stacks which may or may not have extensions.

func (*IPv6ExtensionSkipper) CanDecode

func (i *IPv6ExtensionSkipper) CanDecode() gopacket.LayerClass

CanDecode implementation according to gopacket.DecodingLayer

func (*IPv6ExtensionSkipper) DecodeFromBytes

func (i *IPv6ExtensionSkipper) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes implementation according to gopacket.DecodingLayer

func (*IPv6ExtensionSkipper) NextLayerType

func (i *IPv6ExtensionSkipper) NextLayerType() gopacket.LayerType

NextLayerType implementation according to gopacket.DecodingLayer

type IPv6Fragment

type IPv6Fragment struct {
	BaseLayer
	NextHeader IPProtocol
	// Reserved1 is bits [8-16), from least to most significant, 0-indexed
	Reserved1      uint8
	FragmentOffset uint16
	// Reserved2 is bits [29-31), from least to most significant, 0-indexed
	Reserved2      uint8
	MoreFragments  bool
	Identification uint32
}

IPv6Fragment is the IPv6 fragment header, used for packet fragmentation/defragmentation.

func (*IPv6Fragment) LayerType

func (i *IPv6Fragment) LayerType() gopacket.LayerType

LayerType returns LayerTypeIPv6Fragment.

type IPv6HopByHop

type IPv6HopByHop struct {
	Options []*IPv6HopByHopOption
	// contains filtered or unexported fields
}

IPv6HopByHop is the IPv6 hop-by-hop extension.

func (*IPv6HopByHop) DecodeFromBytes

func (i *IPv6HopByHop) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes implementation according to gopacket.DecodingLayer

func (*IPv6HopByHop) LayerType

func (i *IPv6HopByHop) LayerType() gopacket.LayerType

LayerType returns LayerTypeIPv6HopByHop.

func (*IPv6HopByHop) SerializeTo

SerializeTo implementation according to gopacket.SerializableLayer

type IPv6HopByHopOption

type IPv6HopByHopOption ipv6HeaderTLVOption

IPv6HopByHopOption is a TLV option present in an IPv6 hop-by-hop extension.

func (*IPv6HopByHopOption) SetJumboLength

func (o *IPv6HopByHopOption) SetJumboLength(len uint32)

SetJumboLength adds the IPv6HopByHopOptionJumbogram with the given length

type IPv6Routing

type IPv6Routing struct {
	RoutingType  uint8
	SegmentsLeft uint8
	// This segment is supposed to be zero according to RFC2460, the second set of
	// 4 bytes in the extension.
	Reserved []byte
	// SourceRoutingIPs is the set of IPv6 addresses requested for source routing,
	// set only if RoutingType == 0.
	SourceRoutingIPs []net.IP
	// contains filtered or unexported fields
}

IPv6Routing is the IPv6 routing extension.

func (*IPv6Routing) LayerType

func (i *IPv6Routing) LayerType() gopacket.LayerType

LayerType returns LayerTypeIPv6Routing.

type InterAreaPrefixLSA

type InterAreaPrefixLSA struct {
	Metric        uint32
	PrefixLength  uint8
	PrefixOptions uint8
	AddressPrefix []byte
}

InterAreaPrefixLSA is the struct from RFC 5340 A.4.5.

type InterAreaRouterLSA

type InterAreaRouterLSA struct {
	Options             uint32
	Metric              uint32
	DestinationRouterID uint32
}

InterAreaRouterLSA is the struct from RFC 5340 A.4.6.

type IntraAreaPrefixLSA

type IntraAreaPrefixLSA struct {
	NumOfPrefixes  uint16
	RefLSType      uint16
	RefLinkStateID uint32
	RefAdvRouter   uint32
	Prefixes       []Prefix
}

IntraAreaPrefixLSA is the struct from RFC 5340 A.4.10.

type LCM

type LCM struct {
	// Common (short & fragmented header) fields
	Magic          uint32
	SequenceNumber uint32
	// Fragmented header only fields
	PayloadSize    uint32
	FragmentOffset uint32
	FragmentNumber uint16
	TotalFragments uint16
	// Common field
	ChannelName string
	// Gopacket helper fields
	Fragmented bool
	// contains filtered or unexported fields
}

LCM (Lightweight Communications and Marshalling) is a set of libraries and tools for message passing and data marshalling, targeted at real-time systems where high-bandwidth and low latency are critical. It provides a publish/subscribe message passing model and automatic marshalling/unmarshalling code generation with bindings for applications in a variety of programming languages.

References

https://lcm-proj.github.io/
https://github.com/lcm-proj/lcm

func (LCM) CanDecode

func (lcm LCM) CanDecode() gopacket.LayerClass

CanDecode returns a set of layers that LCM objects can decode. As LCM objects can only decode the LCM layer, we just return that layer.

func (*LCM) DecodeFromBytes

func (lcm *LCM) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (LCM) Fingerprint

func (lcm LCM) Fingerprint() LCMFingerprint

Fingerprint returns the LCM fingerprint of the underlying message.

func (LCM) LayerContents

func (lcm LCM) LayerContents() []byte

LayerContents returns the contents of the LCM header.

func (LCM) LayerPayload

func (lcm LCM) LayerPayload() []byte

LayerPayload returns the payload following this LCM header.

func (LCM) LayerType

func (lcm LCM) LayerType() gopacket.LayerType

LayerType returns LayerTypeLCM

func (LCM) NextLayerType

func (lcm LCM) NextLayerType() gopacket.LayerType

NextLayerType specifies the LCM payload layer type following this header. As LCM packets are serialized structs with uniq fingerprints for each uniq combination of data types, lookup of correct layer type is based on that fingerprint.

func (LCM) Payload

func (lcm LCM) Payload() []byte

Payload returns the payload following this LCM header.

type LCMFingerprint

type LCMFingerprint uint64

LCMFingerprint is the type of a LCM fingerprint.

func SupportedLCMFingerprints

func SupportedLCMFingerprints() []LCMFingerprint

SupportedLCMFingerprints returns a slice of all LCM fingerprints that has been registered so far.

type LLC

type LLC struct {
	BaseLayer
	DSAP    uint8
	IG      bool // true means group, false means individual
	SSAP    uint8
	CR      bool // true means response, false means command
	Control uint16
}

LLC is the layer used for 802.2 Logical Link Control headers. See http://standards.ieee.org/getieee802/download/802.2-1998.pdf

func (*LLC) CanDecode

func (l *LLC) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*LLC) DecodeFromBytes

func (l *LLC) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*LLC) LayerType

func (l *LLC) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeLLC.

func (*LLC) NextLayerType

func (l *LLC) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*LLC) SerializeTo

func (l *LLC) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type LLDPApplicationType

type LLDPApplicationType uint8
const (
	LLDPAppTypeReserved            LLDPApplicationType = 0
	LLDPAppTypeVoice               LLDPApplicationType = 1
	LLDPappTypeVoiceSignaling      LLDPApplicationType = 2
	LLDPappTypeGuestVoice          LLDPApplicationType = 3
	LLDPappTypeGuestVoiceSignaling LLDPApplicationType = 4
	LLDPappTypeSoftphoneVoice      LLDPApplicationType = 5
	LLDPappTypeVideoConferencing   LLDPApplicationType = 6
	LLDPappTypeStreamingVideo      LLDPApplicationType = 7
	LLDPappTypeVideoSignaling      LLDPApplicationType = 8
)

func (LLDPApplicationType) String

func (t LLDPApplicationType) String() (s string)

type LLDPCapabilities

type LLDPCapabilities struct {
	Other       bool
	Repeater    bool
	Bridge      bool
	WLANAP      bool
	Router      bool
	Phone       bool
	DocSis      bool
	StationOnly bool
	CVLAN       bool
	SVLAN       bool
	TMPR        bool
}

LLDPCapabilities represents the capabilities of a device

type LLDPChassisID

type LLDPChassisID struct {
	Subtype LLDPChassisIDSubType
	ID      []byte
}

type LLDPChassisIDSubType

type LLDPChassisIDSubType byte

LLDPChassisIDSubType specifies the value type for a single LLDPChassisID.ID

const (
	LLDPChassisIDSubTypeReserved    LLDPChassisIDSubType = 0
	LLDPChassisIDSubTypeChassisComp LLDPChassisIDSubType = 1
	LLDPChassisIDSubtypeIfaceAlias  LLDPChassisIDSubType = 2
	LLDPChassisIDSubTypePortComp    LLDPChassisIDSubType = 3
	LLDPChassisIDSubTypeMACAddr     LLDPChassisIDSubType = 4
	LLDPChassisIDSubTypeNetworkAddr LLDPChassisIDSubType = 5
	LLDPChassisIDSubtypeIfaceName   LLDPChassisIDSubType = 6
	LLDPChassisIDSubTypeLocal       LLDPChassisIDSubType = 7
)

LLDP Chassis Types

func (LLDPChassisIDSubType) String

func (t LLDPChassisIDSubType) String() (s string)

type LLDPCisco2Subtype

type LLDPCisco2Subtype uint8
const (
	LLDPCisco2PowerViaMDI LLDPCisco2Subtype = 1
)

Cisco2 TLV Subtypes

type LLDPEVBCapabilities

type LLDPEVBCapabilities struct {
	StandardBridging            bool
	ReflectiveRelay             bool
	RetransmissionTimerExponent bool
	EdgeControlProtocol         bool
	VSIDiscoveryProtocol        bool
}

LLDPEVBCapabilities represents the EVB capabilities of a device

type LLDPEVBSettings

type LLDPEVBSettings struct {
	Supported      LLDPEVBCapabilities
	Enabled        LLDPEVBCapabilities
	SupportedVSIs  uint16
	ConfiguredVSIs uint16
	RTEExponent    uint8
}

type LLDPInfo8021

type LLDPInfo8021 struct {
	PVID               uint16
	PPVIDs             []PortProtocolVLANID
	VLANNames          []VLANName
	ProtocolIdentities []ProtocolIdentity
	VIDUsageDigest     uint32
	ManagementVID      uint16
	LinkAggregation    LLDPLinkAggregation
}

LLDPInfo8021 represents the information carried in 802.1 Org-specific TLVs

type LLDPInfo8021Qbg

type LLDPInfo8021Qbg struct {
	EVBSettings LLDPEVBSettings
}

LLDPInfo8021Qbg represents the information carried in 802.1Qbg Org-specific TLVs

type LLDPInfo8023

type LLDPInfo8023 struct {
	MACPHYConfigStatus LLDPMACPHYConfigStatus
	PowerViaMDI        LLDPPowerViaMDI8023
	LinkAggregation    LLDPLinkAggregation
	MTU                uint16
}

LLDPInfo8023 represents the information carried in 802.3 Org-specific TLVs

type LLDPInfoCisco2

type LLDPInfoCisco2 struct {
	PSEFourWirePoESupported       bool
	PDSparePairArchitectureShared bool
	PDRequestSparePairPoEOn       bool
	PSESparePairPoEOn             bool
}

LLDPInfoCisco2 represents the information carried in Cisco Org-specific TLVs

type LLDPInfoMedia

type LLDPInfoMedia struct {
	MediaCapabilities LLDPMediaCapabilities
	NetworkPolicy     LLDPNetworkPolicy
	Location          LLDPLocation
	PowerViaMDI       LLDPPowerViaMDI
	HardwareRevision  string
	FirmwareRevision  string
	SoftwareRevision  string
	SerialNumber      string
	Manufacturer      string
	Model             string
	AssetID           string
}

LLDPInfoMedia represents the information carried in TR-41 Org-specific TLVs

type LLDPInfoProfinet

type LLDPInfoProfinet struct {
	PNIODelay         LLDPPNIODelay
	PNIOPortStatus    LLDPPNIOPortStatus
	PNIOMRPPortStatus LLDPPNIOMRPPortStatus
	ChassisMAC        []byte
	PNIOPTCPStatus    LLDPPNIOPTCPStatus
}

LLDPInfoProfinet represents the information carried in Profinet Org-specific TLVs

type LLDPInterfaceSubtype

type LLDPInterfaceSubtype byte
const (
	LLDPInterfaceSubtypeUnknown LLDPInterfaceSubtype = 1
	LLDPInterfaceSubtypeifIndex LLDPInterfaceSubtype = 2
	LLDPInterfaceSubtypeSysPort LLDPInterfaceSubtype = 3
)

LLDP Interface Subtypes

func (LLDPInterfaceSubtype) String

func (t LLDPInterfaceSubtype) String() (s string)

type LLDPLinkAggregation

type LLDPLinkAggregation struct {
	Supported bool
	Enabled   bool
	PortID    uint32
}

IEEE 802 Link Aggregation parameters

type LLDPLocation

type LLDPLocation struct {
	Format     LLDPLocationFormat
	Coordinate LLDPLocationCoordinate
	Address    LLDPLocationAddress
	ECS        LLDPLocationECS
}

LLDP represents a physical location. Only one of the embedded types will contain values, depending on Format.

type LLDPLocationAddress

type LLDPLocationAddress struct {
	What         LLDPLocationAddressWhat
	CountryCode  string
	AddressLines []LLDPLocationAddressLine
}

type LLDPLocationAddressLine

type LLDPLocationAddressLine struct {
	Type  LLDPLocationAddressType
	Value string
}

type LLDPLocationAddressType

type LLDPLocationAddressType uint8
const (
	LLDPLocationAddressTypeLanguage       LLDPLocationAddressType = 0
	LLDPLocationAddressTypeNational       LLDPLocationAddressType = 1
	LLDPLocationAddressTypeCounty         LLDPLocationAddressType = 2
	LLDPLocationAddressTypeCity           LLDPLocationAddressType = 3
	LLDPLocationAddressTypeCityDivision   LLDPLocationAddressType = 4
	LLDPLocationAddressTypeNeighborhood   LLDPLocationAddressType = 5
	LLDPLocationAddressTypeStreet         LLDPLocationAddressType = 6
	LLDPLocationAddressTypeLeadingStreet  LLDPLocationAddressType = 16
	LLDPLocationAddressTypeTrailingStreet LLDPLocationAddressType = 17
	LLDPLocationAddressTypeStreetSuffix   LLDPLocationAddressType = 18
	LLDPLocationAddressTypeHouseNum       LLDPLocationAddressType = 19
	LLDPLocationAddressTypeHouseSuffix    LLDPLocationAddressType = 20
	LLDPLocationAddressTypeLandmark       LLDPLocationAddressType = 21
	LLDPLocationAddressTypeAdditional     LLDPLocationAddressType = 22
	LLDPLocationAddressTypeName           LLDPLocationAddressType = 23
	LLDPLocationAddressTypePostal         LLDPLocationAddressType = 24
	LLDPLocationAddressTypeBuilding       LLDPLocationAddressType = 25
	LLDPLocationAddressTypeUnit           LLDPLocationAddressType = 26
	LLDPLocationAddressTypeFloor          LLDPLocationAddressType = 27
	LLDPLocationAddressTypeRoom           LLDPLocationAddressType = 28
	LLDPLocationAddressTypePlace          LLDPLocationAddressType = 29
	LLDPLocationAddressTypeScript         LLDPLocationAddressType = 128
)

func (LLDPLocationAddressType) String

func (t LLDPLocationAddressType) String() (s string)

type LLDPLocationAddressWhat

type LLDPLocationAddressWhat uint8
const (
	LLDPLocationAddressWhatDHCP    LLDPLocationAddressWhat = 0
	LLDPLocationAddressWhatNetwork LLDPLocationAddressWhat = 1
	LLDPLocationAddressWhatClient  LLDPLocationAddressWhat = 2
)

type LLDPLocationCoordinate

type LLDPLocationCoordinate struct {
	LatitudeResolution  uint8
	Latitude            uint64
	LongitudeResolution uint8
	Longitude           uint64
	AltitudeType        uint8
	AltitudeResolution  uint16
	Altitude            uint32
	Datum               uint8
}

type LLDPLocationECS

type LLDPLocationECS struct {
	ELIN string
}

type LLDPLocationFormat

type LLDPLocationFormat uint8
const (
	LLDPLocationFormatInvalid    LLDPLocationFormat = 0
	LLDPLocationFormatCoordinate LLDPLocationFormat = 1
	LLDPLocationFormatAddress    LLDPLocationFormat = 2
	LLDPLocationFormatECS        LLDPLocationFormat = 3
)

func (LLDPLocationFormat) String

func (t LLDPLocationFormat) String() (s string)

type LLDPMACPHYConfigStatus

type LLDPMACPHYConfigStatus struct {
	AutoNegSupported  bool
	AutoNegEnabled    bool
	AutoNegCapability uint16
	MAUType           uint16
}

type LLDPMediaCapabilities

type LLDPMediaCapabilities struct {
	Capabilities  bool
	NetworkPolicy bool
	Location      bool
	PowerPSE      bool
	PowerPD       bool
	Inventory     bool
	Class         LLDPMediaClass
}

LLDPMediaCapabilities represents the LLDP Media capabilities of a device

type LLDPMediaClass

type LLDPMediaClass uint8
const (
	LLDPMediaClassUndefined   LLDPMediaClass = 0
	LLDPMediaClassEndpointI   LLDPMediaClass = 1
	LLDPMediaClassEndpointII  LLDPMediaClass = 2
	LLDPMediaClassEndpointIII LLDPMediaClass = 3
	LLDPMediaClassNetwork     LLDPMediaClass = 4
)

Media Class Values

func (LLDPMediaClass) String

func (t LLDPMediaClass) String() (s string)

type LLDPMediaSubtype

type LLDPMediaSubtype uint8
const (
	LLDPMediaTypeCapabilities LLDPMediaSubtype = 1
	LLDPMediaTypeNetwork      LLDPMediaSubtype = 2
	LLDPMediaTypeLocation     LLDPMediaSubtype = 3
	LLDPMediaTypePower        LLDPMediaSubtype = 4
	LLDPMediaTypeHardware     LLDPMediaSubtype = 5
	LLDPMediaTypeFirmware     LLDPMediaSubtype = 6
	LLDPMediaTypeSoftware     LLDPMediaSubtype = 7
	LLDPMediaTypeSerial       LLDPMediaSubtype = 8
	LLDPMediaTypeManufacturer LLDPMediaSubtype = 9
	LLDPMediaTypeModel        LLDPMediaSubtype = 10
	LLDPMediaTypeAssetID      LLDPMediaSubtype = 11
)

Media TLV Subtypes

func (LLDPMediaSubtype) String

func (t LLDPMediaSubtype) String() (s string)

type LLDPMgmtAddress

type LLDPMgmtAddress struct {
	Subtype          IANAAddressFamily
	Address          []byte
	InterfaceSubtype LLDPInterfaceSubtype
	InterfaceNumber  uint32
	OID              string
}

type LLDPNetworkPolicy

type LLDPNetworkPolicy struct {
	ApplicationType LLDPApplicationType
	Defined         bool
	Tagged          bool
	VLANId          uint16
	L2Priority      uint16
	DSCPValue       uint8
}

type LLDPOrgSpecificTLV

type LLDPOrgSpecificTLV struct {
	OUI     IEEEOUI
	SubType uint8
	Info    []byte
}

LLDPOrgSpecificTLV is an Organisation-specific TLV

type LLDPPNIODelay

type LLDPPNIODelay struct {
	RXLocal    uint32
	RXRemote   uint32
	TXLocal    uint32
	TXRemote   uint32
	CableLocal uint32
}

type LLDPPNIOMRPPortStatus

type LLDPPNIOMRPPortStatus struct {
	UUID   []byte
	Status uint16
}

type LLDPPNIOPTCPStatus

type LLDPPNIOPTCPStatus struct {
	MasterAddress     []byte
	SubdomainUUID     []byte
	IRDataUUID        []byte
	PeriodValid       bool
	PeriodLength      uint32
	RedPeriodValid    bool
	RedPeriodBegin    uint32
	OrangePeriodValid bool
	OrangePeriodBegin uint32
	GreenPeriodValid  bool
	GreenPeriodBegin  uint32
}

type LLDPPNIOPortStatus

type LLDPPNIOPortStatus struct {
	Class2 uint16
	Class3 uint16
}

type LLDPPortID

type LLDPPortID struct {
	Subtype LLDPPortIDSubType
	ID      []byte
}

type LLDPPortIDSubType

type LLDPPortIDSubType byte

LLDPPortIDSubType specifies the value type for a single LLDPPortID.ID

const (
	LLDPPortIDSubtypeReserved       LLDPPortIDSubType = 0
	LLDPPortIDSubtypeIfaceAlias     LLDPPortIDSubType = 1
	LLDPPortIDSubtypePortComp       LLDPPortIDSubType = 2
	LLDPPortIDSubtypeMACAddr        LLDPPortIDSubType = 3
	LLDPPortIDSubtypeNetworkAddr    LLDPPortIDSubType = 4
	LLDPPortIDSubtypeIfaceName      LLDPPortIDSubType = 5
	LLDPPortIDSubtypeAgentCircuitID LLDPPortIDSubType = 6
	LLDPPortIDSubtypeLocal          LLDPPortIDSubType = 7
)

LLDP PortID types

func (LLDPPortIDSubType) String

func (t LLDPPortIDSubType) String() (s string)

type LLDPPowerPriority

type LLDPPowerPriority byte
const (
	LLDPPowerPriorityUnknown LLDPPowerPriority = 0
	LLDPPowerPriorityMedium  LLDPPowerPriority = 1
	LLDPPowerPriorityHigh    LLDPPowerPriority = 2
	LLDPPowerPriorityLow     LLDPPowerPriority = 3
)

func (LLDPPowerPriority) String

func (t LLDPPowerPriority) String() (s string)

type LLDPPowerSource

type LLDPPowerSource byte

func (LLDPPowerSource) String

func (t LLDPPowerSource) String() (s string)

type LLDPPowerType

type LLDPPowerType byte

func (LLDPPowerType) String

func (t LLDPPowerType) String() (s string)

type LLDPPowerViaMDI

type LLDPPowerViaMDI struct {
	Type     LLDPPowerType
	Source   LLDPPowerSource
	Priority LLDPPowerPriority
	Value    uint16
}

type LLDPPowerViaMDI8023

type LLDPPowerViaMDI8023 struct {
	PortClassPSE    bool // false = PD
	PSESupported    bool
	PSEEnabled      bool
	PSEPairsAbility bool
	PSEPowerPair    uint8
	PSEClass        uint8
	Type            LLDPPowerType
	Source          LLDPPowerSource
	Priority        LLDPPowerPriority
	Requested       uint16 // 1-510 Watts
	Allocated       uint16 // 1-510 Watts
}

type LLDPProfinetSubtype

type LLDPProfinetSubtype uint8

Profinet Subtypes

const (
	LLDPProfinetPNIODelay         LLDPProfinetSubtype = 1
	LLDPProfinetPNIOPortStatus    LLDPProfinetSubtype = 2
	LLDPProfinetPNIOMRPPortStatus LLDPProfinetSubtype = 4
	LLDPProfinetPNIOChassisMAC    LLDPProfinetSubtype = 5
	LLDPProfinetPNIOPTCPStatus    LLDPProfinetSubtype = 6
)

type LLDPSysCapabilities

type LLDPSysCapabilities struct {
	SystemCap  LLDPCapabilities
	EnabledCap LLDPCapabilities
}

type LLDPTLVType

type LLDPTLVType byte

LLDPTLVType is the type of each TLV value in a LinkLayerDiscovery packet.

const (
	LLDPTLVEnd             LLDPTLVType = 0
	LLDPTLVChassisID       LLDPTLVType = 1
	LLDPTLVPortID          LLDPTLVType = 2
	LLDPTLVTTL             LLDPTLVType = 3
	LLDPTLVPortDescription LLDPTLVType = 4
	LLDPTLVSysName         LLDPTLVType = 5
	LLDPTLVSysDescription  LLDPTLVType = 6
	LLDPTLVSysCapabilities LLDPTLVType = 7
	LLDPTLVMgmtAddress     LLDPTLVType = 8
	LLDPTLVOrgSpecific     LLDPTLVType = 127
)

func (LLDPTLVType) String

func (t LLDPTLVType) String() (s string)

type LSA

type LSA struct {
	LSAheader
	Content interface{}
}

LSA links LSAheader with the structs from RFC 5340 A.4.

type LSAheader

type LSAheader struct {
	LSAge       uint16
	LSType      uint16
	LinkStateID uint32
	AdvRouter   uint32
	LSSeqNumber uint32
	LSChecksum  uint16
	Length      uint16
	LSOptions   uint8
}

LSAheader is the struct from RFC 5340 A.4.2 and RFC 2328 A.4.1.

type LSReq

type LSReq struct {
	LSType    uint16
	LSID      uint32
	AdvRouter uint32
}

LSReq is the struct from RFC 5340 A.3.4.

type LSUpdate

type LSUpdate struct {
	NumOfLSAs uint32
	LSAs      []LSA
}

LSUpdate is the struct from RFC 5340 A.3.5.

type LinkLSA

type LinkLSA struct {
	RtrPriority      uint8
	Options          uint32
	LinkLocalAddress []byte
	NumOfPrefixes    uint32
	Prefixes         []Prefix
}

LinkLSA is the struct from RFC 5340 A.4.9.

type LinkLayerDiscovery

type LinkLayerDiscovery struct {
	BaseLayer
	ChassisID LLDPChassisID
	PortID    LLDPPortID
	TTL       uint16
	Values    []LinkLayerDiscoveryValue
}

LinkLayerDiscovery is a packet layer containing the LinkLayer Discovery Protocol. See http:http://standards.ieee.org/getieee802/download/802.1AB-2009.pdf ChassisID, PortID and TTL are mandatory TLV's. Other values can be decoded with DecodeValues()

func (*LinkLayerDiscovery) LayerType

func (c *LinkLayerDiscovery) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeLinkLayerDiscovery.

func (*LinkLayerDiscovery) SerializeTo

SerializeTo serializes LLDP packet to bytes and writes on SerializeBuffer.

type LinkLayerDiscoveryInfo

type LinkLayerDiscoveryInfo struct {
	BaseLayer
	PortDescription string
	SysName         string
	SysDescription  string
	SysCapabilities LLDPSysCapabilities
	MgmtAddress     LLDPMgmtAddress
	OrgTLVs         []LLDPOrgSpecificTLV      // Private TLVs
	Unknown         []LinkLayerDiscoveryValue // undecoded TLVs
}

LinkLayerDiscoveryInfo represents the decoded details for a set of LinkLayerDiscoveryValues Organisation-specific TLV's can be decoded using the various Decode() methods

func (*LinkLayerDiscoveryInfo) Decode8021

func (l *LinkLayerDiscoveryInfo) Decode8021() (info LLDPInfo8021, err error)

func (*LinkLayerDiscoveryInfo) Decode8021Qbg

func (l *LinkLayerDiscoveryInfo) Decode8021Qbg() (info LLDPInfo8021Qbg, err error)

func (*LinkLayerDiscoveryInfo) Decode8023

func (l *LinkLayerDiscoveryInfo) Decode8023() (info LLDPInfo8023, err error)

func (*LinkLayerDiscoveryInfo) DecodeCisco2

func (l *LinkLayerDiscoveryInfo) DecodeCisco2() (info LLDPInfoCisco2, err error)

func (*LinkLayerDiscoveryInfo) DecodeMedia

func (l *LinkLayerDiscoveryInfo) DecodeMedia() (info LLDPInfoMedia, err error)

func (*LinkLayerDiscoveryInfo) DecodeProfinet

func (l *LinkLayerDiscoveryInfo) DecodeProfinet() (info LLDPInfoProfinet, err error)

func (*LinkLayerDiscoveryInfo) LayerType

func (c *LinkLayerDiscoveryInfo) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeLinkLayerDiscoveryInfo.

type LinkLayerDiscoveryValue

type LinkLayerDiscoveryValue struct {
	Type   LLDPTLVType
	Length uint16
	Value  []byte
}

LinkLayerDiscoveryValue is a TLV value inside a LinkLayerDiscovery packet layer.

type LinkType

type LinkType uint8

LinkType is an enumeration of link types, and acts as a decoder for any link type it supports.

const (
	// According to pcap-linktype(7) and http://www.tcpdump.org/linktypes.html
	LinkTypeNull           LinkType = 0
	LinkTypeEthernet       LinkType = 1
	LinkTypeAX25           LinkType = 3
	LinkTypeTokenRing      LinkType = 6
	LinkTypeArcNet         LinkType = 7
	LinkTypeSLIP           LinkType = 8
	LinkTypePPP            LinkType = 9
	LinkTypeFDDI           LinkType = 10
	LinkTypePPP_HDLC       LinkType = 50
	LinkTypePPPEthernet    LinkType = 51
	LinkTypeATM_RFC1483    LinkType = 100
	LinkTypeRaw            LinkType = 101
	LinkTypeC_HDLC         LinkType = 104
	LinkTypeIEEE802_11     LinkType = 105
	LinkTypeFRelay         LinkType = 107
	LinkTypeLoop           LinkType = 108
	LinkTypeLinuxSLL       LinkType = 113
	LinkTypeLTalk          LinkType = 114
	LinkTypePFLog          LinkType = 117
	LinkTypePrismHeader    LinkType = 119
	LinkTypeIPOverFC       LinkType = 122
	LinkTypeSunATM         LinkType = 123
	LinkTypeIEEE80211Radio LinkType = 127
	LinkTypeARCNetLinux    LinkType = 129
	LinkTypeIPOver1394     LinkType = 138
	LinkTypeMTP2Phdr       LinkType = 139
	LinkTypeMTP2           LinkType = 140
	LinkTypeMTP3           LinkType = 141
	LinkTypeSCCP           LinkType = 142
	LinkTypeDOCSIS         LinkType = 143
	LinkTypeLinuxIRDA      LinkType = 144
	LinkTypeLinuxLAPD      LinkType = 177
	LinkTypeLinuxUSB       LinkType = 220
	LinkTypeFC2            LinkType = 224
	LinkTypeFC2Framed      LinkType = 225
	LinkTypeIPv4           LinkType = 228
	LinkTypeIPv6           LinkType = 229
)

func (LinkType) Decode

func (a LinkType) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls LinkTypeMetadata.DecodeWith's decoder.

func (LinkType) LayerType

func (a LinkType) LayerType() gopacket.LayerType

LayerType returns LinkTypeMetadata.LayerType.

func (LinkType) String

func (a LinkType) String() string

String returns LinkTypeMetadata.Name.

type LinuxSLL

type LinuxSLL struct {
	BaseLayer
	PacketType   LinuxSLLPacketType
	AddrLen      uint16
	Addr         net.HardwareAddr
	EthernetType EthernetType
	AddrType     uint16
}

func (*LinuxSLL) CanDecode

func (sll *LinuxSLL) CanDecode() gopacket.LayerClass

func (*LinuxSLL) DecodeFromBytes

func (sll *LinuxSLL) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*LinuxSLL) LayerType

func (sll *LinuxSLL) LayerType() gopacket.LayerType

LayerType returns LayerTypeLinuxSLL.

func (*LinuxSLL) LinkFlow

func (sll *LinuxSLL) LinkFlow() gopacket.Flow

func (*LinuxSLL) NextLayerType

func (sll *LinuxSLL) NextLayerType() gopacket.LayerType

type LinuxSLLPacketType

type LinuxSLLPacketType uint16
const (
	LinuxSLLPacketTypeHost      LinuxSLLPacketType = 0 // To us
	LinuxSLLPacketTypeBroadcast LinuxSLLPacketType = 1 // To all
	LinuxSLLPacketTypeMulticast LinuxSLLPacketType = 2 // To group
	LinuxSLLPacketTypeOtherhost LinuxSLLPacketType = 3 // To someone else
	LinuxSLLPacketTypeOutgoing  LinuxSLLPacketType = 4 // Outgoing of any type
	// These ones are invisible by user level
	LinuxSLLPacketTypeLoopback  LinuxSLLPacketType = 5 // MC/BRD frame looped back
	LinuxSLLPacketTypeFastroute LinuxSLLPacketType = 6 // Fastrouted frame
)

func (LinuxSLLPacketType) String

func (l LinuxSLLPacketType) String() string

type Loopback

type Loopback struct {
	BaseLayer
	Family ProtocolFamily
}

Loopback contains the header for loopback encapsulation. This header is used by both BSD and OpenBSD style loopback decoding (pcap's DLT_NULL and DLT_LOOP, respectively).

func (*Loopback) CanDecode

func (l *Loopback) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*Loopback) DecodeFromBytes

func (l *Loopback) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*Loopback) LayerType

func (l *Loopback) LayerType() gopacket.LayerType

LayerType returns LayerTypeLoopback.

func (*Loopback) NextLayerType

func (l *Loopback) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*Loopback) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer.

type MLDv1Message

type MLDv1Message struct {
	BaseLayer
	// 3.4. Maximum Response Delay
	MaximumResponseDelay time.Duration
	// 3.6. Multicast Address
	// Zero in general query
	// Specific IPv6 multicast address otherwise
	MulticastAddress net.IP
}

MLDv1Message represents the common structure of all MLDv1 messages

func (*MLDv1Message) DecodeFromBytes

func (m *MLDv1Message) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*MLDv1Message) NextLayerType

func (*MLDv1Message) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*MLDv1Message) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

func (*MLDv1Message) String

func (m *MLDv1Message) String() string

Sums this layer up nicely formatted

type MLDv1MulticastListenerDoneMessage

type MLDv1MulticastListenerDoneMessage struct {
	MLDv1Message
}

MLDv1MulticastListenerDoneMessage should be sent by a client when it ceases to listen to a multicast address on an interface. https://tools.ietf.org/html/rfc2710 Page 7

func (*MLDv1MulticastListenerDoneMessage) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*MLDv1MulticastListenerDoneMessage) LayerType

LayerType returns LayerTypeMLDv1MulticastListenerDone.

type MLDv1MulticastListenerQueryMessage

type MLDv1MulticastListenerQueryMessage struct {
	MLDv1Message
}

MLDv1MulticastListenerQueryMessage are sent by the router to determine whether there are multicast listeners on the link. https://tools.ietf.org/html/rfc2710 Page 5

func (*MLDv1MulticastListenerQueryMessage) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*MLDv1MulticastListenerQueryMessage) DecodeFromBytes

func (m *MLDv1MulticastListenerQueryMessage) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*MLDv1MulticastListenerQueryMessage) IsGeneralQuery

func (m *MLDv1MulticastListenerQueryMessage) IsGeneralQuery() bool

IsGeneralQuery is true when this is a general query. In a Query message, the Multicast Address field is set to zero when sending a General Query. https://tools.ietf.org/html/rfc2710#section-3.6

func (*MLDv1MulticastListenerQueryMessage) IsSpecificQuery

func (m *MLDv1MulticastListenerQueryMessage) IsSpecificQuery() bool

IsSpecificQuery is true when this is not a general query. In a Query message, the Multicast Address field is set to a specific IPv6 multicast address when sending a Multicast-Address-Specific Query. https://tools.ietf.org/html/rfc2710#section-3.6

func (*MLDv1MulticastListenerQueryMessage) LayerType

LayerType returns LayerTypeMLDv1MulticastListenerQuery.

type MLDv1MulticastListenerReportMessage

type MLDv1MulticastListenerReportMessage struct {
	MLDv1Message
}

MLDv1MulticastListenerReportMessage is sent by a client listening on a specific multicast address to indicate that it is (still) listening on the specific multicast address. https://tools.ietf.org/html/rfc2710 Page 6

func (*MLDv1MulticastListenerReportMessage) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*MLDv1MulticastListenerReportMessage) LayerType

LayerType returns LayerTypeMLDv1MulticastListenerReport.

type MLDv2MulticastAddressRecord

type MLDv2MulticastAddressRecord struct {
	// 5.2.5. Record Type
	RecordType MLDv2MulticastAddressRecordType
	// 5.2.6. Auxiliary Data Length (number of 32-bit words)
	AuxDataLen uint8
	// 5.2.7. Number Of Sources (N)
	N uint16
	// 5.2.8. Multicast Address
	MulticastAddress net.IP
	// 5.2.9 Source Address [i]
	SourceAddresses []net.IP
	// 5.2.10 Auxiliary Data
	AuxiliaryData []byte
}

MLDv2MulticastAddressRecord contains information on the sender listening to a single multicast address on the interface the report is sent. https://tools.ietf.org/html/rfc3810#section-5.2.4

func (*MLDv2MulticastAddressRecord) String

func (m *MLDv2MulticastAddressRecord) String() string

String sums this layer up nicely formatted

type MLDv2MulticastAddressRecordType

type MLDv2MulticastAddressRecordType uint8

MLDv2MulticastAddressRecordType holds the type of a Multicast Address Record, according to https://tools.ietf.org/html/rfc3810#section-5.2.5 and https://tools.ietf.org/html/rfc3810#section-5.2.12

const (
	// MLDv2MulticastAddressRecordTypeModeIsIncluded stands for
	// MODE_IS_INCLUDE - indicates that the interface has a filter
	// mode of INCLUDE for the specified multicast address.
	MLDv2MulticastAddressRecordTypeModeIsIncluded MLDv2MulticastAddressRecordType = 1
	// MLDv2MulticastAddressRecordTypeModeIsExcluded stands for
	// MODE_IS_EXCLUDE - indicates that the interface has a filter
	// mode of EXCLUDE for the specified multicast address.
	MLDv2MulticastAddressRecordTypeModeIsExcluded MLDv2MulticastAddressRecordType = 2
	// MLDv2MulticastAddressRecordTypeChangeToIncludeMode stands for
	// CHANGE_TO_INCLUDE_MODE - indicates that the interface has
	// changed to INCLUDE filter mode for the specified multicast
	// address.
	MLDv2MulticastAddressRecordTypeChangeToIncludeMode MLDv2MulticastAddressRecordType = 3
	// MLDv2MulticastAddressRecordTypeChangeToExcludeMode stands for
	// CHANGE_TO_EXCLUDE_MODE - indicates that the interface has
	// changed to EXCLUDE filter mode for the specified multicast
	// address
	MLDv2MulticastAddressRecordTypeChangeToExcludeMode MLDv2MulticastAddressRecordType = 4
	// MLDv2MulticastAddressRecordTypeAllowNewSources stands for
	// ALLOW_NEW_SOURCES - indicates that the Source Address [i]
	// fields in this Multicast Address Record contain a list of
	// the additional sources that the node wishes to listen to,
	// for packets sent to the specified multicast address.
	MLDv2MulticastAddressRecordTypeAllowNewSources MLDv2MulticastAddressRecordType = 5
	// MLDv2MulticastAddressRecordTypeBlockOldSources stands for
	// BLOCK_OLD_SOURCES - indicates that the Source Address [i]
	// fields in this Multicast Address Record contain a list of
	// the sources that the node no longer wishes to listen to,
	// for packets sent to the specified multicast address.
	MLDv2MulticastAddressRecordTypeBlockOldSources MLDv2MulticastAddressRecordType = 6
)

func (MLDv2MulticastAddressRecordType) String

Human readable record types Naming follows https://tools.ietf.org/html/rfc3810#section-5.2.12

type MLDv2MulticastListenerQueryMessage

type MLDv2MulticastListenerQueryMessage struct {
	BaseLayer
	// 5.1.3. Maximum Response Delay COde
	MaximumResponseCode uint16
	// 5.1.5. Multicast Address
	// Zero in general query
	// Specific IPv6 multicast address otherwise
	MulticastAddress net.IP
	// 5.1.7. S Flag (Suppress Router-Side Processing)
	SuppressRoutersideProcessing bool
	// 5.1.8. QRV (Querier's Robustness Variable)
	QueriersRobustnessVariable uint8
	// 5.1.9. QQIC (Querier's Query Interval Code)
	QueriersQueryIntervalCode uint8
	// 5.1.10. Number of Sources (N)
	NumberOfSources uint16
	// 5.1.11 Source Address [i]
	SourceAddresses []net.IP
}

MLDv2MulticastListenerQueryMessage are sent by multicast routers to query the multicast listening state of neighboring interfaces. https://tools.ietf.org/html/rfc3810#section-5.1

Some information, like Maximum Response Code and Multicast Address are in the previous layer LayerTypeMLDv1MulticastListenerQuery

func (*MLDv2MulticastListenerQueryMessage) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*MLDv2MulticastListenerQueryMessage) DecodeFromBytes

func (m *MLDv2MulticastListenerQueryMessage) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*MLDv2MulticastListenerQueryMessage) LayerType

LayerType returns LayerTypeMLDv2MulticastListenerQuery.

func (*MLDv2MulticastListenerQueryMessage) MaximumResponseDelay

func (m *MLDv2MulticastListenerQueryMessage) MaximumResponseDelay() time.Duration

MaximumResponseDelay returns the Maximum Response Delay based on the Maximum Response Code according to https://tools.ietf.org/html/rfc3810#section-5.1.3

func (*MLDv2MulticastListenerQueryMessage) NextLayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*MLDv2MulticastListenerQueryMessage) QQI

QQI calculates the Querier's Query Interval based on the QQIC according to https://tools.ietf.org/html/rfc3810#section-5.1.9

func (*MLDv2MulticastListenerQueryMessage) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

func (*MLDv2MulticastListenerQueryMessage) SetMLDv2MaximumResponseDelay

func (m *MLDv2MulticastListenerQueryMessage) SetMLDv2MaximumResponseDelay(d time.Duration) error

SetMLDv2MaximumResponseDelay updates the Maximum Response Code according to https://tools.ietf.org/html/rfc3810#section-5.1.3

func (*MLDv2MulticastListenerQueryMessage) SetQQI

SetQQI calculates and updates the Querier's Query Interval Code (QQIC) according to https://tools.ietf.org/html/rfc3810#section-5.1.9

func (*MLDv2MulticastListenerQueryMessage) String

String sums this layer up nicely formatted

type MLDv2MulticastListenerReportMessage

type MLDv2MulticastListenerReportMessage struct {
	BaseLayer
	// 5.2.3. Nr of Mcast Address Records
	NumberOfMulticastAddressRecords uint16
	// 5.2.4. Multicast Address Record [i]
	MulticastAddressRecords []MLDv2MulticastAddressRecord
}

MLDv2MulticastListenerReportMessage is sent by an IP node to report the current multicast listening state, or changes therein. https://tools.ietf.org/html/rfc3810#section-5.2

func (*MLDv2MulticastListenerReportMessage) CanDecode

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*MLDv2MulticastListenerReportMessage) DecodeFromBytes

func (m *MLDv2MulticastListenerReportMessage) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*MLDv2MulticastListenerReportMessage) LayerType

LayerType returns LayerTypeMLDv2MulticastListenerQuery.

func (*MLDv2MulticastListenerReportMessage) NextLayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*MLDv2MulticastListenerReportMessage) SerializeTo

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

func (*MLDv2MulticastListenerReportMessage) String

Sums this layer up nicely formatted

type MPLS

type MPLS struct {
	BaseLayer
	Label        uint32
	TrafficClass uint8
	StackBottom  bool
	TTL          uint8
}

MPLS is the MPLS packet header.

func (*MPLS) LayerType

func (m *MPLS) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeMPLS.

func (*MPLS) SerializeTo

func (m *MPLS) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type ModbusProtocol

type ModbusProtocol uint16

ModbusProtocol type

const (
	ModbusProtocolModbus ModbusProtocol = 0
)

ModbusProtocol known values.

func (ModbusProtocol) String

func (mp ModbusProtocol) String() string

type ModbusTCP

type ModbusTCP struct {
	BaseLayer // Stores the packet bytes and payload (Modbus PDU) bytes .

	TransactionIdentifier uint16         // Identification of a MODBUS Request/Response transaction
	ProtocolIdentifier    ModbusProtocol // It is used for intra-system multiplexing
	Length                uint16         // Number of following bytes (includes 1 byte for UnitIdentifier + Modbus data length
	UnitIdentifier        uint8          // Identification of a remote slave connected on a serial line or on other buses
}

ModbusTCP Type -------- Type ModbusTCP implements the DecodingLayer interface. Each ModbusTCP object represents in a structured form the MODBUS Application Protocol header (MBAP) record present as the TCP payload in an ModbusTCP TCP packet.

func (*ModbusTCP) CanDecode

func (s *ModbusTCP) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode

func (*ModbusTCP) DecodeFromBytes

func (d *ModbusTCP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes analyses a byte slice and attempts to decode it as an ModbusTCP record of a TCP packet.

Upon succeeds, it loads the ModbusTCP object with information about the packet and returns nil. Upon failure, it returns an error (non nil).

func (*ModbusTCP) LayerType

func (d *ModbusTCP) LayerType() gopacket.LayerType

LayerType returns the layer type of the ModbusTCP object, which is LayerTypeModbusTCP.

func (*ModbusTCP) NextLayerType

func (d *ModbusTCP) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type of the ModbusTCP payload, which is LayerTypePayload.

func (*ModbusTCP) Payload

func (d *ModbusTCP) Payload() []byte

Payload returns Modbus Protocol Data Unit (PDU) composed by Function Code and Data, it is carried within ModbusTCP packets

type NDPBackplaneType

type NDPBackplaneType uint8
const (
	NDPBackplaneOther                                       NDPBackplaneType = 1
	NDPBackplaneEthernet                                    NDPBackplaneType = 2
	NDPBackplaneEthernetTokenring                           NDPBackplaneType = 3
	NDPBackplaneEthernetFDDI                                NDPBackplaneType = 4
	NDPBackplaneEthernetTokenringFDDI                       NDPBackplaneType = 5
	NDPBackplaneEthernetTokenringRedundantPower             NDPBackplaneType = 6
	NDPBackplaneEthernetTokenringFDDIRedundantPower         NDPBackplaneType = 7
	NDPBackplaneTokenRing                                   NDPBackplaneType = 8
	NDPBackplaneEthernetTokenringFastEthernet               NDPBackplaneType = 9
	NDPBackplaneEthernetFastEthernet                        NDPBackplaneType = 10
	NDPBackplaneEthernetTokenringFastEthernetRedundantPower NDPBackplaneType = 11
	NDPBackplaneEthernetFastEthernetGigabitEthernet         NDPBackplaneType = 12
)

Nortel Backplane Types

func (NDPBackplaneType) String

func (t NDPBackplaneType) String() (s string)

type NDPChassisType

type NDPChassisType uint8
const (
	NDPChassisother                                       NDPChassisType = 1
	NDPChassis3000                                        NDPChassisType = 2
	NDPChassis3030                                        NDPChassisType = 3
	NDPChassis2310                                        NDPChassisType = 4
	NDPChassis2810                                        NDPChassisType = 5
	NDPChassis2912                                        NDPChassisType = 6
	NDPChassis2914                                        NDPChassisType = 7
	NDPChassis271x                                        NDPChassisType = 8
	NDPChassis2813                                        NDPChassisType = 9
	NDPChassis2814                                        NDPChassisType = 10
	NDPChassis2915                                        NDPChassisType = 11
	NDPChassis5000                                        NDPChassisType = 12
	NDPChassis2813SA                                      NDPChassisType = 13
	NDPChassis2814SA                                      NDPChassisType = 14
	NDPChassis810M                                        NDPChassisType = 15
	NDPChassisEthercell                                   NDPChassisType = 16
	NDPChassis5005                                        NDPChassisType = 17
	NDPChassisAlcatelEWC                                  NDPChassisType = 18
	NDPChassis2715SA                                      NDPChassisType = 20
	NDPChassis2486                                        NDPChassisType = 21
	NDPChassis28000series                                 NDPChassisType = 22
	NDPChassis23000series                                 NDPChassisType = 23
	NDPChassis5DN00xseries                                NDPChassisType = 24
	NDPChassisBayStackEthernet                            NDPChassisType = 25
	NDPChassis23100series                                 NDPChassisType = 26
	NDPChassis100BaseTHub                                 NDPChassisType = 27
	NDPChassis3000FastEthernet                            NDPChassisType = 28
	NDPChassisOrionSwitch                                 NDPChassisType = 29
	NDPChassisDDS                                         NDPChassisType = 31
	NDPChassisCentillion6slot                             NDPChassisType = 32
	NDPChassisCentillion12slot                            NDPChassisType = 33
	NDPChassisCentillion1slot                             NDPChassisType = 34
	NDPChassisBayStack301                                 NDPChassisType = 35
	NDPChassisBayStackTokenRingHub                        NDPChassisType = 36
	NDPChassisFVCMultimediaSwitch                         NDPChassisType = 37
	NDPChassisSwitchNode                                  NDPChassisType = 38
	NDPChassisBayStack302Switch                           NDPChassisType = 39
	NDPChassisBayStack350Switch                           NDPChassisType = 40
	NDPChassisBayStack150EthernetHub                      NDPChassisType = 41
	NDPChassisCentillion50NSwitch                         NDPChassisType = 42
	NDPChassisCentillion50TSwitch                         NDPChassisType = 43
	NDPChassisBayStack303304Switches                      NDPChassisType = 44
	NDPChassisBayStack200EthernetHub                      NDPChassisType = 45
	NDPChassisBayStack25010100EthernetHub                 NDPChassisType = 46
	NDPChassisBayStack450101001000Switches                NDPChassisType = 48
	NDPChassisBayStack41010100Switches                    NDPChassisType = 49
	NDPChassisPassport1200L3Switch                        NDPChassisType = 50
	NDPChassisPassport1250L3Switch                        NDPChassisType = 51
	NDPChassisPassport1100L3Switch                        NDPChassisType = 52
	NDPChassisPassport1150L3Switch                        NDPChassisType = 53
	NDPChassisPassport1050L3Switch                        NDPChassisType = 54
	NDPChassisPassport1051L3Switch                        NDPChassisType = 55
	NDPChassisPassport8610L3Switch                        NDPChassisType = 56
	NDPChassisPassport8606L3Switch                        NDPChassisType = 57
	NDPChassisPassport8010                                NDPChassisType = 58
	NDPChassisPassport8006                                NDPChassisType = 59
	NDPChassisBayStack670wirelessaccesspoint              NDPChassisType = 60
	NDPChassisPassport740                                 NDPChassisType = 61
	NDPChassisPassport750                                 NDPChassisType = 62
	NDPChassisPassport790                                 NDPChassisType = 63
	NDPChassisBusinessPolicySwitch200010100Switches       NDPChassisType = 64
	NDPChassisPassport8110L2Switch                        NDPChassisType = 65
	NDPChassisPassport8106L2Switch                        NDPChassisType = 66
	NDPChassisBayStack3580GigSwitch                       NDPChassisType = 67
	NDPChassisBayStack10PowerSupplyUnit                   NDPChassisType = 68
	NDPChassisBayStack42010100Switch                      NDPChassisType = 69
	NDPChassisOPTeraMetro1200EthernetServiceModule        NDPChassisType = 70
	NDPChassisOPTera8010co                                NDPChassisType = 71
	NDPChassisOPTera8610coL3Switch                        NDPChassisType = 72
	NDPChassisOPTera8110coL2Switch                        NDPChassisType = 73
	NDPChassisOPTera8003                                  NDPChassisType = 74
	NDPChassisOPTera8603L3Switch                          NDPChassisType = 75
	NDPChassisOPTera8103L2Switch                          NDPChassisType = 76
	NDPChassisBayStack380101001000Switch                  NDPChassisType = 77
	NDPChassisEthernetSwitch47048T                        NDPChassisType = 78
	NDPChassisOPTeraMetro1450EthernetServiceModule        NDPChassisType = 79
	NDPChassisOPTeraMetro1400EthernetServiceModule        NDPChassisType = 80
	NDPChassisAlteonSwitchFamily                          NDPChassisType = 81
	NDPChassisEthernetSwitch46024TPWR                     NDPChassisType = 82
	NDPChassisOPTeraMetro8010OPML2Switch                  NDPChassisType = 83
	NDPChassisOPTeraMetro8010coOPML2Switch                NDPChassisType = 84
	NDPChassisOPTeraMetro8006OPML2Switch                  NDPChassisType = 85
	NDPChassisOPTeraMetro8003OPML2Switch                  NDPChassisType = 86
	NDPChassisAlteon180e                                  NDPChassisType = 87
	NDPChassisAlteonAD3                                   NDPChassisType = 88
	NDPChassisAlteon184                                   NDPChassisType = 89
	NDPChassisAlteonAD4                                   NDPChassisType = 90
	NDPChassisPassport1424L3Switch                        NDPChassisType = 91
	NDPChassisPassport1648L3Switch                        NDPChassisType = 92
	NDPChassisPassport1612L3Switch                        NDPChassisType = 93
	NDPChassisPassport1624L3Switch                        NDPChassisType = 94
	NDPChassisBayStack38024FFiber1000Switch               NDPChassisType = 95
	NDPChassisEthernetRoutingSwitch551024T                NDPChassisType = 96
	NDPChassisEthernetRoutingSwitch551048T                NDPChassisType = 97
	NDPChassisEthernetSwitch47024T                        NDPChassisType = 98
	NDPChassisNortelNetworksWirelessLANAccessPoint2220    NDPChassisType = 99
	NDPChassisPassportRBS2402L3Switch                     NDPChassisType = 100
	NDPChassisAlteonApplicationSwitch2424                 NDPChassisType = 101
	NDPChassisAlteonApplicationSwitch2224                 NDPChassisType = 102
	NDPChassisAlteonApplicationSwitch2208                 NDPChassisType = 103
	NDPChassisAlteonApplicationSwitch2216                 NDPChassisType = 104
	NDPChassisAlteonApplicationSwitch3408                 NDPChassisType = 105
	NDPChassisAlteonApplicationSwitch3416                 NDPChassisType = 106
	NDPChassisNortelNetworksWirelessLANSecuritySwitch2250 NDPChassisType = 107
	NDPChassisEthernetSwitch42548T                        NDPChassisType = 108
	NDPChassisEthernetSwitch42524T                        NDPChassisType = 109
	NDPChassisNortelNetworksWirelessLANAccessPoint2221    NDPChassisType = 110
	NDPChassisNortelMetroEthernetServiceUnit24TSPFswitch  NDPChassisType = 111
	NDPChassisNortelMetroEthernetServiceUnit24TLXDCswitch NDPChassisType = 112
	NDPChassisPassport830010slotchassis                   NDPChassisType = 113
	NDPChassisPassport83006slotchassis                    NDPChassisType = 114
	NDPChassisEthernetRoutingSwitch552024TPWR             NDPChassisType = 115
	NDPChassisEthernetRoutingSwitch552048TPWR             NDPChassisType = 116
	NDPChassisNortelNetworksVPNGateway3050                NDPChassisType = 117
	NDPChassisAlteonSSL31010100                           NDPChassisType = 118
	NDPChassisAlteonSSL31010100Fiber                      NDPChassisType = 119
	NDPChassisAlteonSSL31010100FIPS                       NDPChassisType = 120
	NDPChassisAlteonSSL410101001000                       NDPChassisType = 121
	NDPChassisAlteonSSL410101001000Fiber                  NDPChassisType = 122
	NDPChassisAlteonApplicationSwitch2424SSL              NDPChassisType = 123
	NDPChassisEthernetSwitch32524T                        NDPChassisType = 124
	NDPChassisEthernetSwitch32524G                        NDPChassisType = 125
	NDPChassisNortelNetworksWirelessLANAccessPoint2225    NDPChassisType = 126
	NDPChassisNortelNetworksWirelessLANSecuritySwitch2270 NDPChassisType = 127
	NDPChassis24portEthernetSwitch47024TPWR               NDPChassisType = 128
	NDPChassis48portEthernetSwitch47048TPWR               NDPChassisType = 129
	NDPChassisEthernetRoutingSwitch553024TFD              NDPChassisType = 130
	NDPChassisEthernetSwitch351024T                       NDPChassisType = 131
	NDPChassisNortelMetroEthernetServiceUnit12GACL3Switch NDPChassisType = 132
	NDPChassisNortelMetroEthernetServiceUnit12GDCL3Switch NDPChassisType = 133
	NDPChassisNortelSecureAccessSwitch                    NDPChassisType = 134
	NDPChassisNortelNetworksVPNGateway3070                NDPChassisType = 135
	NDPChassisOPTeraMetro3500                             NDPChassisType = 136
	NDPChassisSMBBES101024T                               NDPChassisType = 137
	NDPChassisSMBBES101048T                               NDPChassisType = 138
	NDPChassisSMBBES102024TPWR                            NDPChassisType = 139
	NDPChassisSMBBES102048TPWR                            NDPChassisType = 140
	NDPChassisSMBBES201024T                               NDPChassisType = 141
	NDPChassisSMBBES201048T                               NDPChassisType = 142
	NDPChassisSMBBES202024TPWR                            NDPChassisType = 143
	NDPChassisSMBBES202048TPWR                            NDPChassisType = 144
	NDPChassisSMBBES11024T                                NDPChassisType = 145
	NDPChassisSMBBES11048T                                NDPChassisType = 146
	NDPChassisSMBBES12024TPWR                             NDPChassisType = 147
	NDPChassisSMBBES12048TPWR                             NDPChassisType = 148
	NDPChassisSMBBES21024T                                NDPChassisType = 149
	NDPChassisSMBBES21048T                                NDPChassisType = 150
	NDPChassisSMBBES22024TPWR                             NDPChassisType = 151
	NDPChassisSMBBES22048TPWR                             NDPChassisType = 152
	NDPChassisOME6500                                     NDPChassisType = 153
	NDPChassisEthernetRoutingSwitch4548GT                 NDPChassisType = 154
	NDPChassisEthernetRoutingSwitch4548GTPWR              NDPChassisType = 155
	NDPChassisEthernetRoutingSwitch4550T                  NDPChassisType = 156
	NDPChassisEthernetRoutingSwitch4550TPWR               NDPChassisType = 157
	NDPChassisEthernetRoutingSwitch4526FX                 NDPChassisType = 158
	NDPChassisEthernetRoutingSwitch250026T                NDPChassisType = 159
	NDPChassisEthernetRoutingSwitch250026TPWR             NDPChassisType = 160
	NDPChassisEthernetRoutingSwitch250050T                NDPChassisType = 161
	NDPChassisEthernetRoutingSwitch250050TPWR             NDPChassisType = 162
)

Nortel Chassis Types

func (NDPChassisType) String

func (t NDPChassisType) String() (s string)

type NDPState

type NDPState uint8
const (
	NDPStateTopology  NDPState = 1
	NDPStateHeartbeat NDPState = 2
	NDPStateNew       NDPState = 3
)

Device State

func (NDPState) String

func (t NDPState) String() (s string)

type NTP

type NTP struct {
	BaseLayer // Stores the packet bytes and payload bytes.

	LeapIndicator      NTPLeapIndicator  // [0,3]. Indicates whether leap second(s) is to be added.
	Version            NTPVersion        // [0,7]. Version of the NTP protocol.
	Mode               NTPMode           // [0,7]. Mode.
	Stratum            NTPStratum        // [0,255]. Stratum of time server in the server tree.
	Poll               NTPLog2Seconds    // [-128,127]. The maximum interval between successive messages, in log2 seconds.
	Precision          NTPLog2Seconds    // [-128,127]. The precision of the system clock, in log2 seconds.
	RootDelay          NTPFixed16Seconds // [0,2^32-1]. Total round trip delay to the reference clock in seconds times 2^16.
	RootDispersion     NTPFixed16Seconds // [0,2^32-1]. Total dispersion to the reference clock, in seconds times 2^16.
	ReferenceID        NTPReferenceID    // ID code of reference clock [0,2^32-1].
	ReferenceTimestamp NTPTimestamp      // Most recent timestamp from the reference clock.
	OriginTimestamp    NTPTimestamp      // Local time when request was sent from local host.
	ReceiveTimestamp   NTPTimestamp      // Local time (on server) that request arrived at server host.
	TransmitTimestamp  NTPTimestamp      // Local time (on server) that request departed server host.

	// FIX: This package should analyse the extension fields and represent the extension fields too.
	ExtensionBytes []byte // Just put extensions in a byte slice.
}

func (*NTP) CanDecode

func (d *NTP) CanDecode() gopacket.LayerClass

CanDecode returns a set of layers that NTP objects can decode. As NTP objects can only decide the NTP layer, we can return just that layer. Apparently a single layer type implements LayerClass.

func (*NTP) DecodeFromBytes

func (d *NTP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes analyses a byte slice and attempts to decode it as an NTP record of a UDP packet.

Upon succeeds, it loads the NTP object with information about the packet and returns nil. Upon failure, it returns an error (non nil).

func (*NTP) LayerType

func (d *NTP) LayerType() gopacket.LayerType

LayerType returns the layer type of the NTP object, which is LayerTypeNTP.

func (*NTP) NextLayerType

func (d *NTP) NextLayerType() gopacket.LayerType

NextLayerType specifies the next layer that GoPacket should attempt to analyse after this (NTP) layer. As NTP packets do not contain any payload bytes, there are no further layers to analyse.

func (*NTP) Payload

func (d *NTP) Payload() []byte

NTP packets do not carry any data payload, so the empty byte slice is retured. In Go, a nil slice is functionally identical to an empty slice, so we return nil to avoid a heap allocation.

func (*NTP) SerializeTo

func (d *NTP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type NTPFixed16Seconds

type NTPFixed16Seconds uint32

type NTPLeapIndicator

type NTPLeapIndicator uint8

type NTPLog2Seconds

type NTPLog2Seconds int8

type NTPMode

type NTPMode uint8

type NTPReferenceID

type NTPReferenceID uint32

type NTPStratum

type NTPStratum uint8

type NTPTimestamp

type NTPTimestamp uint64

type NTPVersion

type NTPVersion uint8

type NetworkLSA

type NetworkLSA struct {
	Options        uint32
	AttachedRouter []uint32
}

NetworkLSA is the struct from RFC 5340 A.4.4.

type NetworkLSAV2

type NetworkLSAV2 struct {
	NetworkMask    uint32
	AttachedRouter []uint32
}

NetworkLSAV2 is the struct from RFC 2328 A.4.3.

type NortelDiscovery

type NortelDiscovery struct {
	BaseLayer
	IPAddress net.IP
	SegmentID []byte
	Chassis   NDPChassisType
	Backplane NDPBackplaneType
	State     NDPState
	NumLinks  uint8
}

NortelDiscovery is a packet layer containing the Nortel Discovery Protocol.

func (*NortelDiscovery) LayerType

func (c *NortelDiscovery) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeNortelDiscovery.

type OSPF

type OSPF struct {
	Version      uint8
	Type         OSPFType
	PacketLength uint16
	RouterID     uint32
	AreaID       uint32
	Checksum     uint16
	Content      interface{}
}

OSPF is a basic OSPF packet header with common fields of Version 2 and Version 3.

type OSPFType

type OSPFType uint8

OSPFType denotes what kind of OSPF type it is

const (
	OSPFHello                   OSPFType = 1
	OSPFDatabaseDescription     OSPFType = 2
	OSPFLinkStateRequest        OSPFType = 3
	OSPFLinkStateUpdate         OSPFType = 4
	OSPFLinkStateAcknowledgment OSPFType = 5
)

Potential values for OSPF.Type.

func (OSPFType) String

func (i OSPFType) String() string

String conversions for OSPFType

type OSPFv2

type OSPFv2 struct {
	BaseLayer
	OSPF
	AuType         uint16
	Authentication uint64
}

OSPFv2 extend the OSPF head with version 2 specific fields

func (*OSPFv2) CanDecode

func (ospf *OSPFv2) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*OSPFv2) DecodeFromBytes

func (ospf *OSPFv2) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into the OSPF layer.

func (*OSPFv2) LayerType

func (ospf *OSPFv2) LayerType() gopacket.LayerType

LayerType returns LayerTypeOSPF

func (*OSPFv2) NextLayerType

func (ospf *OSPFv2) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

type OSPFv3

type OSPFv3 struct {
	BaseLayer
	OSPF
	Instance uint8
	Reserved uint8
}

OSPFv3 extend the OSPF head with version 3 specific fields

func (*OSPFv3) CanDecode

func (ospf *OSPFv3) CanDecode() gopacket.LayerClass

func (*OSPFv3) DecodeFromBytes

func (ospf *OSPFv3) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into the OSPF layer.

func (*OSPFv3) LayerType

func (ospf *OSPFv3) LayerType() gopacket.LayerType

func (*OSPFv3) NextLayerType

func (ospf *OSPFv3) NextLayerType() gopacket.LayerType

type PFDirection

type PFDirection uint8
const (
	PFDirectionInOut PFDirection = 0
	PFDirectionIn    PFDirection = 1
	PFDirectionOut   PFDirection = 2
)

type PFLog

type PFLog struct {
	BaseLayer
	Length              uint8
	Family              ProtocolFamily
	Action, Reason      uint8
	IFName, Ruleset     []byte
	RuleNum, SubruleNum uint32
	UID                 uint32
	PID                 int32
	RuleUID             uint32
	RulePID             int32
	Direction           PFDirection
}

PFLog provides the layer for 'pf' packet-filter logging, as described at http://www.freebsd.org/cgi/man.cgi?query=pflog&sektion=4

func (*PFLog) CanDecode

func (pf *PFLog) CanDecode() gopacket.LayerClass

func (*PFLog) DecodeFromBytes

func (pf *PFLog) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*PFLog) LayerType

func (pf *PFLog) LayerType() gopacket.LayerType

LayerType returns layers.LayerTypePFLog

func (*PFLog) NextLayerType

func (pf *PFLog) NextLayerType() gopacket.LayerType

type PPP

type PPP struct {
	BaseLayer
	PPPType       PPPType
	HasPPTPHeader bool
}

PPP is the layer for PPP encapsulation headers.

func (*PPP) LayerType

func (p *PPP) LayerType() gopacket.LayerType

LayerType returns LayerTypePPP

func (*PPP) LinkFlow

func (p *PPP) LinkFlow() gopacket.Flow

LinkFlow returns PPPFlow.

func (*PPP) SerializeTo

func (p *PPP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type PPPType

type PPPType uint16

PPPType is an enumeration of PPP type values, and acts as a decoder for any type it supports.

const (
	PPPTypeIPv4          PPPType = 0x0021
	PPPTypeIPv6          PPPType = 0x0057
	PPPTypeMPLSUnicast   PPPType = 0x0281
	PPPTypeMPLSMulticast PPPType = 0x0283
)

func (PPPType) Decode

func (a PPPType) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls PPPTypeMetadata.DecodeWith's decoder.

func (PPPType) LayerType

func (a PPPType) LayerType() gopacket.LayerType

LayerType returns PPPTypeMetadata.LayerType.

func (PPPType) String

func (a PPPType) String() string

String returns PPPTypeMetadata.Name.

type PPPoE

type PPPoE struct {
	BaseLayer
	Version   uint8
	Type      uint8
	Code      PPPoECode
	SessionId uint16
	Length    uint16
}

PPPoE is the layer for PPPoE encapsulation headers.

func (*PPPoE) LayerType

func (p *PPPoE) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypePPPoE.

func (*PPPoE) SerializeTo

func (p *PPPoE) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type PPPoECode

type PPPoECode uint8

PPPoECode is the PPPoE code enum, taken from http://tools.ietf.org/html/rfc2516

const (
	PPPoECodePADI    PPPoECode = 0x09
	PPPoECodePADO    PPPoECode = 0x07
	PPPoECodePADR    PPPoECode = 0x19
	PPPoECodePADS    PPPoECode = 0x65
	PPPoECodePADT    PPPoECode = 0xA7
	PPPoECodeSession PPPoECode = 0x00
)

func (PPPoECode) Decode

func (a PPPoECode) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls PPPoECodeMetadata.DecodeWith's decoder.

func (PPPoECode) LayerType

func (a PPPoECode) LayerType() gopacket.LayerType

LayerType returns PPPoECodeMetadata.LayerType.

func (PPPoECode) String

func (a PPPoECode) String() string

String returns PPPoECodeMetadata.Name.

type PortProtocolVLANID

type PortProtocolVLANID struct {
	Supported bool
	Enabled   bool
	ID        uint16
}

type Prefix

type Prefix struct {
	PrefixLength  uint8
	PrefixOptions uint8
	Metric        uint16
	AddressPrefix []byte
}

Prefix extends IntraAreaPrefixLSA

type PrismDID

type PrismDID uint32
const (
	PrismDIDType1HostTime                  PrismDID = 0x10044
	PrismDIDType2HostTime                  PrismDID = 0x01041
	PrismDIDType1MACTime                   PrismDID = 0x20044
	PrismDIDType2MACTime                   PrismDID = 0x02041
	PrismDIDType1Channel                   PrismDID = 0x30044
	PrismDIDType2Channel                   PrismDID = 0x03041
	PrismDIDType1RSSI                      PrismDID = 0x40044
	PrismDIDType2RSSI                      PrismDID = 0x04041
	PrismDIDType1SignalQuality             PrismDID = 0x50044
	PrismDIDType2SignalQuality             PrismDID = 0x05041
	PrismDIDType1Signal                    PrismDID = 0x60044
	PrismDIDType2Signal                    PrismDID = 0x06041
	PrismDIDType1Noise                     PrismDID = 0x70044
	PrismDIDType2Noise                     PrismDID = 0x07041
	PrismDIDType1Rate                      PrismDID = 0x80044
	PrismDIDType2Rate                      PrismDID = 0x08041
	PrismDIDType1TransmittedFrameIndicator PrismDID = 0x90044
	PrismDIDType2TransmittedFrameIndicator PrismDID = 0x09041
	PrismDIDType1FrameLength               PrismDID = 0xA0044
	PrismDIDType2FrameLength               PrismDID = 0x0A041
)

func (PrismDID) String

func (p PrismDID) String() string

type PrismHeader

type PrismHeader struct {
	BaseLayer
	Code       uint16
	Length     uint16
	DeviceName string
	Values     []PrismValue
}

func (*PrismHeader) CanDecode

func (m *PrismHeader) CanDecode() gopacket.LayerClass

func (*PrismHeader) DecodeFromBytes

func (m *PrismHeader) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*PrismHeader) LayerType

func (m *PrismHeader) LayerType() gopacket.LayerType

func (*PrismHeader) NextLayerType

func (m *PrismHeader) NextLayerType() gopacket.LayerType

type PrismValue

type PrismValue struct {
	DID    PrismDID
	Status uint16
	Length uint16
	Data   []byte
}

func (*PrismValue) IsSupplied

func (pv *PrismValue) IsSupplied() bool

type ProtocolFamily

type ProtocolFamily uint8

ProtocolFamily is the set of values defined as PF_* in sys/socket.h

const (
	ProtocolFamilyIPv4 ProtocolFamily = 2
	// BSDs use different values for INET6... glory be.  These values taken from
	// tcpdump 4.3.0.
	ProtocolFamilyIPv6BSD     ProtocolFamily = 24
	ProtocolFamilyIPv6FreeBSD ProtocolFamily = 28
	ProtocolFamilyIPv6Darwin  ProtocolFamily = 30
	ProtocolFamilyIPv6Linux   ProtocolFamily = 10
)

func (ProtocolFamily) Decode

func (a ProtocolFamily) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls ProtocolFamilyMetadata.DecodeWith's decoder.

func (ProtocolFamily) LayerType

func (a ProtocolFamily) LayerType() gopacket.LayerType

LayerType returns ProtocolFamilyMetadata.LayerType.

func (ProtocolFamily) String

func (a ProtocolFamily) String() string

String returns ProtocolFamilyMetadata.Name.

type ProtocolGuessingDecoder

type ProtocolGuessingDecoder struct{}

ProtocolGuessingDecoder attempts to guess the protocol of the bytes it's given, then decode the packet accordingly. Its algorithm for guessing is:

If the packet starts with byte 0x45-0x4F: IPv4
If the packet starts with byte 0x60-0x6F: IPv6
Otherwise:  Error

See draft-hsmit-isis-aal5mux-00.txt for more detail on this approach.

func (ProtocolGuessingDecoder) Decode

type ProtocolIdentity

type ProtocolIdentity []byte

type RADIUS

type RADIUS struct {
	BaseLayer

	Code          RADIUSCode
	Identifier    RADIUSIdentifier
	Length        RADIUSLength
	Authenticator RADIUSAuthenticator
	Attributes    []RADIUSAttribute
}

RADIUS represents a Remote Authentication Dial In User Service layer.

func (*RADIUS) CanDecode

func (radius *RADIUS) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*RADIUS) DecodeFromBytes

func (radius *RADIUS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*RADIUS) LayerType

func (radius *RADIUS) LayerType() gopacket.LayerType

LayerType returns LayerTypeRADIUS.

func (*RADIUS) Len

func (radius *RADIUS) Len() (int, error)

Len returns the length of a RADIUS packet.

func (*RADIUS) NextLayerType

func (radius *RADIUS) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*RADIUS) Payload

func (radius *RADIUS) Payload() []byte

Payload returns the EAP Type-Data for EAP-Message attributes.

func (*RADIUS) SerializeTo

func (radius *RADIUS) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type RADIUSAttribute

type RADIUSAttribute struct {
	Type   RADIUSAttributeType
	Length RADIUSAttributeLength
	Value  RADIUSAttributeValue
}

RADIUSAttribute represents attributes.

type RADIUSAttributeLength

type RADIUSAttributeLength uint8

RADIUSAttributeType represents attribute length.

type RADIUSAttributeType

type RADIUSAttributeType uint8

RADIUSAttributeType represents attribute type.

const (
	RADIUSAttributeTypeUserName               RADIUSAttributeType = 1  // RFC2865  5.1.  User-Name
	RADIUSAttributeTypeUserPassword           RADIUSAttributeType = 2  // RFC2865  5.2.  User-Password
	RADIUSAttributeTypeCHAPPassword           RADIUSAttributeType = 3  // RFC2865  5.3.  CHAP-Password
	RADIUSAttributeTypeNASIPAddress           RADIUSAttributeType = 4  // RFC2865  5.4.  NAS-IP-Address
	RADIUSAttributeTypeNASPort                RADIUSAttributeType = 5  // RFC2865  5.5.  NAS-Port
	RADIUSAttributeTypeServiceType            RADIUSAttributeType = 6  // RFC2865  5.6.  Service-Type
	RADIUSAttributeTypeFramedProtocol         RADIUSAttributeType = 7  // RFC2865  5.7.  Framed-Protocol
	RADIUSAttributeTypeFramedIPAddress        RADIUSAttributeType = 8  // RFC2865  5.8.  Framed-IP-Address
	RADIUSAttributeTypeFramedIPNetmask        RADIUSAttributeType = 9  // RFC2865  5.9.  Framed-IP-Netmask
	RADIUSAttributeTypeFramedRouting          RADIUSAttributeType = 10 // RFC2865 5.10.  Framed-Routing
	RADIUSAttributeTypeFilterId               RADIUSAttributeType = 11 // RFC2865 5.11.  Filter-Id
	RADIUSAttributeTypeFramedMTU              RADIUSAttributeType = 12 // RFC2865 5.12.  Framed-MTU
	RADIUSAttributeTypeFramedCompression      RADIUSAttributeType = 13 // RFC2865 5.13.  Framed-Compression
	RADIUSAttributeTypeLoginIPHost            RADIUSAttributeType = 14 // RFC2865 5.14.  Login-IP-Host
	RADIUSAttributeTypeLoginService           RADIUSAttributeType = 15 // RFC2865 5.15.  Login-Service
	RADIUSAttributeTypeLoginTCPPort           RADIUSAttributeType = 16 // RFC2865 5.16.  Login-TCP-Port
	RADIUSAttributeTypeReplyMessage           RADIUSAttributeType = 18 // RFC2865 5.18.  Reply-Message
	RADIUSAttributeTypeCallbackNumber         RADIUSAttributeType = 19 // RFC2865 5.19.  Callback-Number
	RADIUSAttributeTypeCallbackId             RADIUSAttributeType = 20 // RFC2865 5.20.  Callback-Id
	RADIUSAttributeTypeFramedRoute            RADIUSAttributeType = 22 // RFC2865 5.22.  Framed-Route
	RADIUSAttributeTypeFramedIPXNetwork       RADIUSAttributeType = 23 // RFC2865 5.23.  Framed-IPX-Network
	RADIUSAttributeTypeState                  RADIUSAttributeType = 24 // RFC2865 5.24.  State
	RADIUSAttributeTypeClass                  RADIUSAttributeType = 25 // RFC2865 5.25.  Class
	RADIUSAttributeTypeVendorSpecific         RADIUSAttributeType = 26 // RFC2865 5.26.  Vendor-Specific
	RADIUSAttributeTypeSessionTimeout         RADIUSAttributeType = 27 // RFC2865 5.27.  Session-Timeout
	RADIUSAttributeTypeIdleTimeout            RADIUSAttributeType = 28 // RFC2865 5.28.  Idle-Timeout
	RADIUSAttributeTypeTerminationAction      RADIUSAttributeType = 29 // RFC2865 5.29.  Termination-Action
	RADIUSAttributeTypeCalledStationId        RADIUSAttributeType = 30 // RFC2865 5.30.  Called-Station-Id
	RADIUSAttributeTypeCallingStationId       RADIUSAttributeType = 31 // RFC2865 5.31.  Calling-Station-Id
	RADIUSAttributeTypeNASIdentifier          RADIUSAttributeType = 32 // RFC2865 5.32.  NAS-Identifier
	RADIUSAttributeTypeProxyState             RADIUSAttributeType = 33 // RFC2865 5.33.  Proxy-State
	RADIUSAttributeTypeLoginLATService        RADIUSAttributeType = 34 // RFC2865 5.34.  Login-LAT-Service
	RADIUSAttributeTypeLoginLATNode           RADIUSAttributeType = 35 // RFC2865 5.35.  Login-LAT-Node
	RADIUSAttributeTypeLoginLATGroup          RADIUSAttributeType = 36 // RFC2865 5.36.  Login-LAT-Group
	RADIUSAttributeTypeFramedAppleTalkLink    RADIUSAttributeType = 37 // RFC2865 5.37.  Framed-AppleTalk-Link
	RADIUSAttributeTypeFramedAppleTalkNetwork RADIUSAttributeType = 38 // RFC2865 5.38.  Framed-AppleTalk-Network
	RADIUSAttributeTypeFramedAppleTalkZone    RADIUSAttributeType = 39 // RFC2865 5.39.  Framed-AppleTalk-Zone
	RADIUSAttributeTypeAcctStatusType         RADIUSAttributeType = 40 // RFC2866  5.1.  Acct-Status-Type
	RADIUSAttributeTypeAcctDelayTime          RADIUSAttributeType = 41 // RFC2866  5.2.  Acct-Delay-Time
	RADIUSAttributeTypeAcctInputOctets        RADIUSAttributeType = 42 // RFC2866  5.3.  Acct-Input-Octets
	RADIUSAttributeTypeAcctOutputOctets       RADIUSAttributeType = 43 // RFC2866  5.4.  Acct-Output-Octets
	RADIUSAttributeTypeAcctSessionId          RADIUSAttributeType = 44 // RFC2866  5.5.  Acct-Session-Id
	RADIUSAttributeTypeAcctAuthentic          RADIUSAttributeType = 45 // RFC2866  5.6.  Acct-Authentic
	RADIUSAttributeTypeAcctSessionTime        RADIUSAttributeType = 46 // RFC2866  5.7.  Acct-Session-Time
	RADIUSAttributeTypeAcctInputPackets       RADIUSAttributeType = 47 // RFC2866  5.8.  Acct-Input-Packets
	RADIUSAttributeTypeAcctOutputPackets      RADIUSAttributeType = 48 // RFC2866  5.9.  Acct-Output-Packets
	RADIUSAttributeTypeAcctTerminateCause     RADIUSAttributeType = 49 // RFC2866 5.10.  Acct-Terminate-Cause
	RADIUSAttributeTypeAcctMultiSessionId     RADIUSAttributeType = 50 // RFC2866 5.11.  Acct-Multi-Session-Id
	RADIUSAttributeTypeAcctLinkCount          RADIUSAttributeType = 51 // RFC2866 5.12.  Acct-Link-Count
	RADIUSAttributeTypeAcctInputGigawords     RADIUSAttributeType = 52 // RFC2869  5.1.  Acct-Input-Gigawords
	RADIUSAttributeTypeAcctOutputGigawords    RADIUSAttributeType = 53 // RFC2869  5.2.  Acct-Output-Gigawords
	RADIUSAttributeTypeEventTimestamp         RADIUSAttributeType = 55 // RFC2869  5.3.  Event-Timestamp
	RADIUSAttributeTypeCHAPChallenge          RADIUSAttributeType = 60 // RFC2865 5.40.  CHAP-Challenge
	RADIUSAttributeTypeNASPortType            RADIUSAttributeType = 61 // RFC2865 5.41.  NAS-Port-Type
	RADIUSAttributeTypePortLimit              RADIUSAttributeType = 62 // RFC2865 5.42.  Port-Limit
	RADIUSAttributeTypeLoginLATPort           RADIUSAttributeType = 63 // RFC2865 5.43.  Login-LAT-Port
	RADIUSAttributeTypeTunnelType             RADIUSAttributeType = 64 // RFC2868  3.1.  Tunnel-Type
	RADIUSAttributeTypeTunnelMediumType       RADIUSAttributeType = 65 // RFC2868  3.2.  Tunnel-Medium-Type
	RADIUSAttributeTypeTunnelClientEndpoint   RADIUSAttributeType = 66 // RFC2868  3.3.  Tunnel-Client-Endpoint
	RADIUSAttributeTypeTunnelServerEndpoint   RADIUSAttributeType = 67 // RFC2868  3.4.  Tunnel-Server-Endpoint
	RADIUSAttributeTypeAcctTunnelConnection   RADIUSAttributeType = 68 // RFC2867  4.1.  Acct-Tunnel-Connection
	RADIUSAttributeTypeTunnelPassword         RADIUSAttributeType = 69 // RFC2868  3.5.  Tunnel-Password
	RADIUSAttributeTypeARAPPassword           RADIUSAttributeType = 70 // RFC2869  5.4.  ARAP-Password
	RADIUSAttributeTypeARAPFeatures           RADIUSAttributeType = 71 // RFC2869  5.5.  ARAP-Features
	RADIUSAttributeTypeARAPZoneAccess         RADIUSAttributeType = 72 // RFC2869  5.6.  ARAP-Zone-Access
	RADIUSAttributeTypeARAPSecurity           RADIUSAttributeType = 73 // RFC2869  5.7.  ARAP-Security
	RADIUSAttributeTypeARAPSecurityData       RADIUSAttributeType = 74 // RFC2869  5.8.  ARAP-Security-Data
	RADIUSAttributeTypePasswordRetry          RADIUSAttributeType = 75 // RFC2869  5.9.  Password-Retry
	RADIUSAttributeTypePrompt                 RADIUSAttributeType = 76 // RFC2869 5.10.  Prompt
	RADIUSAttributeTypeConnectInfo            RADIUSAttributeType = 77 // RFC2869 5.11.  Connect-Info
	RADIUSAttributeTypeConfigurationToken     RADIUSAttributeType = 78 // RFC2869 5.12.  Configuration-Token
	RADIUSAttributeTypeEAPMessage             RADIUSAttributeType = 79 // RFC2869 5.13.  EAP-Message
	RADIUSAttributeTypeMessageAuthenticator   RADIUSAttributeType = 80 // RFC2869 5.14.  Message-Authenticator
	RADIUSAttributeTypeTunnelPrivateGroupID   RADIUSAttributeType = 81 // RFC2868  3.6.  Tunnel-Private-Group-ID
	RADIUSAttributeTypeTunnelAssignmentID     RADIUSAttributeType = 82 // RFC2868  3.7.  Tunnel-Assignment-ID
	RADIUSAttributeTypeTunnelPreference       RADIUSAttributeType = 83 // RFC2868  3.8.  Tunnel-Preference
	RADIUSAttributeTypeARAPChallengeResponse  RADIUSAttributeType = 84 // RFC2869 5.15.  ARAP-Challenge-Response
	RADIUSAttributeTypeAcctInterimInterval    RADIUSAttributeType = 85 // RFC2869 5.16.  Acct-Interim-Interval
	RADIUSAttributeTypeAcctTunnelPacketsLost  RADIUSAttributeType = 86 // RFC2867  4.2.  Acct-Tunnel-Packets-Lost
	RADIUSAttributeTypeNASPortId              RADIUSAttributeType = 87 // RFC2869 5.17.  NAS-Port-Id
	RADIUSAttributeTypeFramedPool             RADIUSAttributeType = 88 // RFC2869 5.18.  Framed-Pool
	RADIUSAttributeTypeTunnelClientAuthID     RADIUSAttributeType = 90 // RFC2868  3.9.  Tunnel-Client-Auth-ID
	RADIUSAttributeTypeTunnelServerAuthID     RADIUSAttributeType = 91 // RFC2868 3.10.  Tunnel-Server-Auth-ID
)

constants that define RADIUSAttributeType.

func (RADIUSAttributeType) String

func (t RADIUSAttributeType) String() (s string)

String returns a string version of a RADIUSAttributeType.

type RADIUSAttributeValue

type RADIUSAttributeValue []byte

RADIUSAttributeType represents attribute value.

type RADIUSAuthenticator

type RADIUSAuthenticator [16]byte

RADIUSAuthenticator represents authenticator.

type RADIUSCode

type RADIUSCode uint8

RADIUSCode represents packet type.

const (
	RADIUSCodeAccessRequest      RADIUSCode = 1   // RFC2865 3.  Packet Format
	RADIUSCodeAccessAccept       RADIUSCode = 2   // RFC2865 3.  Packet Format
	RADIUSCodeAccessReject       RADIUSCode = 3   // RFC2865 3.  Packet Format
	RADIUSCodeAccountingRequest  RADIUSCode = 4   // RFC2865 3.  Packet Format
	RADIUSCodeAccountingResponse RADIUSCode = 5   // RFC2865 3.  Packet Format
	RADIUSCodeAccessChallenge    RADIUSCode = 11  // RFC2865 3.  Packet Format
	RADIUSCodeStatusServer       RADIUSCode = 12  // RFC2865 3.  Packet Format (experimental)
	RADIUSCodeStatusClient       RADIUSCode = 13  // RFC2865 3.  Packet Format (experimental)
	RADIUSCodeReserved           RADIUSCode = 255 // RFC2865 3.  Packet Format
)

constants that define RADIUSCode.

func (RADIUSCode) String

func (t RADIUSCode) String() (s string)

String returns a string version of a RADIUSCode.

type RADIUSIdentifier

type RADIUSIdentifier uint8

RADIUSIdentifier represents packet identifier.

type RADIUSLength

type RADIUSLength uint16

RADIUSLength represents packet length.

type RMCP

type RMCP struct {
	BaseLayer

	// Version identifies the version of the RMCP header. 0x06 indicates RMCP
	// v1.0; lower values are legacy, higher values are reserved.
	Version uint8

	// Sequence is the sequence number assicated with the message. Note that
	// this rolls over to 0 after 254, not 255. Seq num 255 indicates the
	// receiver must not send an ACK.
	Sequence uint8

	// Ack indicates whether this packet is an acknowledgement. If it is, the
	// payload will be empty.
	Ack bool

	// Class idicates the structure of the payload. There are only 2^4 valid
	// values, however there is no uint4 data type. N.B. the Ack bit has been
	// split off into another field. The most significant 4 bits of this field
	// will always be 0.
	Class RMCPClass
}

RMCP describes the format of an RMCP header, which forms a UDP payload. See section 3.2.2.2.

func (*RMCP) CanDecode

func (r *RMCP) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeRMCP. It partially satisfies DecodingLayer.

func (*RMCP) DecodeFromBytes

func (r *RMCP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes makes the layer represent the provided bytes. It partially satisfies DecodingLayer.

func (*RMCP) LayerType

func (*RMCP) LayerType() gopacket.LayerType

LayerType returns LayerTypeRMCP. It partially satisfies Layer and SerializableLayer.

func (*RMCP) NextLayerType

func (r *RMCP) NextLayerType() gopacket.LayerType

NextLayerType returns the data layer of this RMCP layer. This partially satisfies DecodingLayer.

func (*RMCP) Payload

func (r *RMCP) Payload() []byte

Payload returns the data layer. It partially satisfies ApplicationLayer.

func (*RMCP) SerializeTo

SerializeTo writes the serialized fom of this layer into the SerializeBuffer, partially satisfying SerializableLayer.

type RMCPClass

type RMCPClass uint8

RMCPClass is the class of a RMCP layer's payload, e.g. ASF or IPMI. This is a 4-bit unsigned int on the wire; all but 6 (ASF), 7 (IPMI) and 8 (OEM-defined) are currently reserved.

func (RMCPClass) LayerType

func (c RMCPClass) LayerType() gopacket.LayerType

LayerType returns the payload layer type corresponding to a RMCP class.

func (RMCPClass) String

func (c RMCPClass) String() string

type RUDP

type RUDP struct {
	BaseLayer
	SYN, ACK, EACK, RST, NUL bool
	Version                  uint8
	HeaderLength             uint8
	SrcPort, DstPort         RUDPPort
	DataLength               uint16
	Seq, Ack, Checksum       uint32
	VariableHeaderArea       []byte
	// RUDPHeaderSyn contains SYN information for the RUDP packet,
	// if the SYN flag is set
	*RUDPHeaderSYN
	// RUDPHeaderEack contains EACK information for the RUDP packet,
	// if the EACK flag is set.
	*RUDPHeaderEACK
}

func (*RUDP) LayerType

func (r *RUDP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeRUDP.

func (*RUDP) TransportFlow

func (r *RUDP) TransportFlow() gopacket.Flow

type RUDPHeaderEACK

type RUDPHeaderEACK struct {
	SeqsReceivedOK []uint32
}

type RUDPHeaderSYN

type RUDPHeaderSYN struct {
	MaxOutstandingSegments, MaxSegmentSize, OptionFlags uint16
}

type RUDPPort

type RUDPPort uint8

RUDPPort is a port in a RUDP layer.

func (RUDPPort) String

func (a RUDPPort) String() string

String returns the port as "number(name)" if there's a well-known port name, or just "number" if there isn't. Well-known names are stored in RUDPPortNames.

type RadioTap

type RadioTap struct {
	BaseLayer

	// Version 0. Only increases for drastic changes, introduction of compatible new fields does not count.
	Version uint8
	// Length of the whole header in bytes, including it_version, it_pad, it_len, and data fields.
	Length uint16
	// Present is a bitmap telling which fields are present. Set bit 31 (0x80000000) to extend the bitmap by another 32 bits. Additional extensions are made by setting bit 31.
	Present RadioTapPresent
	// TSFT: value in microseconds of the MAC's 64-bit 802.11 Time Synchronization Function timer when the first bit of the MPDU arrived at the MAC. For received frames, only.
	TSFT  uint64
	Flags RadioTapFlags
	// Rate Tx/Rx data rate
	Rate RadioTapRate
	// ChannelFrequency Tx/Rx frequency in MHz, followed by flags
	ChannelFrequency RadioTapChannelFrequency
	ChannelFlags     RadioTapChannelFlags
	// FHSS For frequency-hopping radios, the hop set (first byte) and pattern (second byte).
	FHSS uint16
	// DBMAntennaSignal RF signal power at the antenna, decibel difference from one milliwatt.
	DBMAntennaSignal int8
	// DBMAntennaNoise RF noise power at the antenna, decibel difference from one milliwatt.
	DBMAntennaNoise int8
	// LockQuality Quality of Barker code lock. Unitless. Monotonically nondecreasing with "better" lock strength. Called "Signal Quality" in datasheets.
	LockQuality uint16
	// TxAttenuation Transmit power expressed as unitless distance from max power set at factory calibration.  0 is max power. Monotonically nondecreasing with lower power levels.
	TxAttenuation uint16
	// DBTxAttenuation Transmit power expressed as decibel distance from max power set at factory calibration.  0 is max power.  Monotonically nondecreasing with lower power levels.
	DBTxAttenuation uint16
	// DBMTxPower Transmit power expressed as dBm (decibels from a 1 milliwatt reference). This is the absolute power level measured at the antenna port.
	DBMTxPower int8
	// Antenna Unitless indication of the Rx/Tx antenna for this packet. The first antenna is antenna 0.
	Antenna uint8
	// DBAntennaSignal RF signal power at the antenna, decibel difference from an arbitrary, fixed reference.
	DBAntennaSignal uint8
	// DBAntennaNoise RF noise power at the antenna, decibel difference from an arbitrary, fixed reference point.
	DBAntennaNoise uint8
	//
	RxFlags     RadioTapRxFlags
	TxFlags     RadioTapTxFlags
	RtsRetries  uint8
	DataRetries uint8
	MCS         RadioTapMCS
	AMPDUStatus RadioTapAMPDUStatus
	VHT         RadioTapVHT
}

func (*RadioTap) CanDecode

func (m *RadioTap) CanDecode() gopacket.LayerClass

func (*RadioTap) DecodeFromBytes

func (m *RadioTap) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*RadioTap) LayerType

func (m *RadioTap) LayerType() gopacket.LayerType

func (*RadioTap) NextLayerType

func (m *RadioTap) NextLayerType() gopacket.LayerType

func (RadioTap) SerializeTo

type RadioTapAMPDUStatus

type RadioTapAMPDUStatus struct {
	Reference uint32
	Flags     RadioTapAMPDUStatusFlags
	CRC       uint8
}

func (RadioTapAMPDUStatus) String

func (self RadioTapAMPDUStatus) String() string

type RadioTapAMPDUStatusFlags

type RadioTapAMPDUStatusFlags uint16
const (
	RadioTapAMPDUStatusFlagsReportZerolen RadioTapAMPDUStatusFlags = 1 << iota
	RadioTapAMPDUIsZerolen
	RadioTapAMPDULastKnown
	RadioTapAMPDUIsLast
	RadioTapAMPDUDelimCRCErr
	RadioTapAMPDUDelimCRCKnown
)

func (RadioTapAMPDUStatusFlags) DelimCRCErr

func (self RadioTapAMPDUStatusFlags) DelimCRCErr() bool

func (RadioTapAMPDUStatusFlags) DelimCRCKnown

func (self RadioTapAMPDUStatusFlags) DelimCRCKnown() bool

func (RadioTapAMPDUStatusFlags) IsLast

func (self RadioTapAMPDUStatusFlags) IsLast() bool

func (RadioTapAMPDUStatusFlags) IsZerolen

func (self RadioTapAMPDUStatusFlags) IsZerolen() bool

func (RadioTapAMPDUStatusFlags) LastKnown

func (self RadioTapAMPDUStatusFlags) LastKnown() bool

func (RadioTapAMPDUStatusFlags) ReportZerolen

func (self RadioTapAMPDUStatusFlags) ReportZerolen() bool

type RadioTapChannelFlags

type RadioTapChannelFlags uint16
const (
	RadioTapChannelFlagsTurbo   RadioTapChannelFlags = 0x0010 // Turbo channel
	RadioTapChannelFlagsCCK     RadioTapChannelFlags = 0x0020 // CCK channel
	RadioTapChannelFlagsOFDM    RadioTapChannelFlags = 0x0040 // OFDM channel
	RadioTapChannelFlagsGhz2    RadioTapChannelFlags = 0x0080 // 2 GHz spectrum channel.
	RadioTapChannelFlagsGhz5    RadioTapChannelFlags = 0x0100 // 5 GHz spectrum channel
	RadioTapChannelFlagsPassive RadioTapChannelFlags = 0x0200 // Only passive scan allowed
	RadioTapChannelFlagsDynamic RadioTapChannelFlags = 0x0400 // Dynamic CCK-OFDM channel
	RadioTapChannelFlagsGFSK    RadioTapChannelFlags = 0x0800 // GFSK channel (FHSS PHY)
)

func (RadioTapChannelFlags) CCK

func (r RadioTapChannelFlags) CCK() bool

func (RadioTapChannelFlags) Dynamic

func (r RadioTapChannelFlags) Dynamic() bool

func (RadioTapChannelFlags) GFSK

func (r RadioTapChannelFlags) GFSK() bool

func (RadioTapChannelFlags) Ghz2

func (r RadioTapChannelFlags) Ghz2() bool

func (RadioTapChannelFlags) Ghz5

func (r RadioTapChannelFlags) Ghz5() bool

func (RadioTapChannelFlags) OFDM

func (r RadioTapChannelFlags) OFDM() bool

func (RadioTapChannelFlags) Passive

func (r RadioTapChannelFlags) Passive() bool

func (RadioTapChannelFlags) String

func (a RadioTapChannelFlags) String() string

String provides a human readable string for RadioTapChannelFlags. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the RadioTapChannelFlags value, not its string.

func (RadioTapChannelFlags) Turbo

func (r RadioTapChannelFlags) Turbo() bool

type RadioTapChannelFrequency

type RadioTapChannelFrequency uint16

func (RadioTapChannelFrequency) String

func (a RadioTapChannelFrequency) String() string

type RadioTapFlags

type RadioTapFlags uint8
const (
	RadioTapFlagsCFP           RadioTapFlags = 1 << iota // sent/received during CFP
	RadioTapFlagsShortPreamble                           // sent/received * with short * preamble
	RadioTapFlagsWEP                                     // sent/received * with WEP encryption
	RadioTapFlagsFrag                                    // sent/received * with fragmentation
	RadioTapFlagsFCS                                     // frame includes FCS
	RadioTapFlagsDatapad                                 // frame has padding between * 802.11 header and payload * (to 32-bit boundary)
	RadioTapFlagsBadFCS                                  // does not pass FCS check
	RadioTapFlagsShortGI                                 // HT short GI
)

func (RadioTapFlags) BadFCS

func (r RadioTapFlags) BadFCS() bool

func (RadioTapFlags) CFP

func (r RadioTapFlags) CFP() bool

func (RadioTapFlags) Datapad

func (r RadioTapFlags) Datapad() bool

func (RadioTapFlags) FCS

func (r RadioTapFlags) FCS() bool

func (RadioTapFlags) Frag

func (r RadioTapFlags) Frag() bool

func (RadioTapFlags) ShortGI

func (r RadioTapFlags) ShortGI() bool

func (RadioTapFlags) ShortPreamble

func (r RadioTapFlags) ShortPreamble() bool

func (RadioTapFlags) String

func (a RadioTapFlags) String() string

String provides a human readable string for RadioTapFlags. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the RadioTapFlags value, not its string.

func (RadioTapFlags) WEP

func (r RadioTapFlags) WEP() bool

type RadioTapMCS

type RadioTapMCS struct {
	Known RadioTapMCSKnown
	Flags RadioTapMCSFlags
	MCS   uint8
}

func (RadioTapMCS) String

func (self RadioTapMCS) String() string

type RadioTapMCSFlags

type RadioTapMCSFlags uint8

func (RadioTapMCSFlags) Bandwidth

func (self RadioTapMCSFlags) Bandwidth() int

func (RadioTapMCSFlags) FECLDPC

func (self RadioTapMCSFlags) FECLDPC() bool

func (RadioTapMCSFlags) Greenfield

func (self RadioTapMCSFlags) Greenfield() bool

func (RadioTapMCSFlags) NESS0

func (self RadioTapMCSFlags) NESS0() bool

func (RadioTapMCSFlags) STBC

func (self RadioTapMCSFlags) STBC() int

func (RadioTapMCSFlags) ShortGI

func (self RadioTapMCSFlags) ShortGI() bool

type RadioTapMCSKnown

type RadioTapMCSKnown uint8
const (
	RadioTapMCSKnownBandwidth RadioTapMCSKnown = 1 << iota
	RadioTapMCSKnownMCSIndex
	RadioTapMCSKnownGuardInterval
	RadioTapMCSKnownHTFormat
	RadioTapMCSKnownFECType
	RadioTapMCSKnownSTBC
	RadioTapMCSKnownNESS
	RadioTapMCSKnownNESS1
)

func (RadioTapMCSKnown) Bandwidth

func (self RadioTapMCSKnown) Bandwidth() bool

func (RadioTapMCSKnown) FECType

func (self RadioTapMCSKnown) FECType() bool

func (RadioTapMCSKnown) GuardInterval

func (self RadioTapMCSKnown) GuardInterval() bool

func (RadioTapMCSKnown) HTFormat

func (self RadioTapMCSKnown) HTFormat() bool

func (RadioTapMCSKnown) MCSIndex

func (self RadioTapMCSKnown) MCSIndex() bool

func (RadioTapMCSKnown) NESS

func (self RadioTapMCSKnown) NESS() bool

func (RadioTapMCSKnown) NESS1

func (self RadioTapMCSKnown) NESS1() bool

func (RadioTapMCSKnown) STBC

func (self RadioTapMCSKnown) STBC() bool

type RadioTapPresent

type RadioTapPresent uint32
const (
	RadioTapPresentTSFT RadioTapPresent = 1 << iota
	RadioTapPresentFlags
	RadioTapPresentRate
	RadioTapPresentChannel
	RadioTapPresentFHSS
	RadioTapPresentDBMAntennaSignal
	RadioTapPresentDBMAntennaNoise
	RadioTapPresentLockQuality
	RadioTapPresentTxAttenuation
	RadioTapPresentDBTxAttenuation
	RadioTapPresentDBMTxPower
	RadioTapPresentAntenna
	RadioTapPresentDBAntennaSignal
	RadioTapPresentDBAntennaNoise
	RadioTapPresentRxFlags
	RadioTapPresentTxFlags
	RadioTapPresentRtsRetries
	RadioTapPresentDataRetries

	RadioTapPresentMCS
	RadioTapPresentAMPDUStatus
	RadioTapPresentVHT
	RadioTapPresentEXT RadioTapPresent = 1 << 31
)

func (RadioTapPresent) AMPDUStatus

func (r RadioTapPresent) AMPDUStatus() bool

func (RadioTapPresent) Antenna

func (r RadioTapPresent) Antenna() bool

func (RadioTapPresent) Channel

func (r RadioTapPresent) Channel() bool

func (RadioTapPresent) DBAntennaNoise

func (r RadioTapPresent) DBAntennaNoise() bool

func (RadioTapPresent) DBAntennaSignal

func (r RadioTapPresent) DBAntennaSignal() bool

func (RadioTapPresent) DBMAntennaNoise

func (r RadioTapPresent) DBMAntennaNoise() bool

func (RadioTapPresent) DBMAntennaSignal

func (r RadioTapPresent) DBMAntennaSignal() bool

func (RadioTapPresent) DBMTxPower

func (r RadioTapPresent) DBMTxPower() bool

func (RadioTapPresent) DBTxAttenuation

func (r RadioTapPresent) DBTxAttenuation() bool

func (RadioTapPresent) DataRetries

func (r RadioTapPresent) DataRetries() bool

func (RadioTapPresent) EXT

func (r RadioTapPresent) EXT() bool

func (RadioTapPresent) FHSS

func (r RadioTapPresent) FHSS() bool

func (RadioTapPresent) Flags

func (r RadioTapPresent) Flags() bool

func (RadioTapPresent) LockQuality

func (r RadioTapPresent) LockQuality() bool

func (RadioTapPresent) MCS

func (r RadioTapPresent) MCS() bool

func (RadioTapPresent) Rate

func (r RadioTapPresent) Rate() bool

func (RadioTapPresent) RtsRetries

func (r RadioTapPresent) RtsRetries() bool

func (RadioTapPresent) RxFlags

func (r RadioTapPresent) RxFlags() bool

func (RadioTapPresent) TSFT

func (r RadioTapPresent) TSFT() bool

func (RadioTapPresent) TxAttenuation

func (r RadioTapPresent) TxAttenuation() bool

func (RadioTapPresent) TxFlags

func (r RadioTapPresent) TxFlags() bool

func (RadioTapPresent) VHT

func (r RadioTapPresent) VHT() bool

type RadioTapRate

type RadioTapRate uint8

func (RadioTapRate) String

func (a RadioTapRate) String() string

type RadioTapRxFlags

type RadioTapRxFlags uint16
const (
	RadioTapRxFlagsBadPlcp RadioTapRxFlags = 0x0002
)

func (RadioTapRxFlags) BadPlcp

func (self RadioTapRxFlags) BadPlcp() bool

func (RadioTapRxFlags) String

func (self RadioTapRxFlags) String() string

type RadioTapTxFlags

type RadioTapTxFlags uint16
const (
	RadioTapTxFlagsFail RadioTapTxFlags = 1 << iota
	RadioTapTxFlagsCTS
	RadioTapTxFlagsRTS
	RadioTapTxFlagsNoACK
)

func (RadioTapTxFlags) CTS

func (self RadioTapTxFlags) CTS() bool

func (RadioTapTxFlags) Fail

func (self RadioTapTxFlags) Fail() bool

func (RadioTapTxFlags) NoACK

func (self RadioTapTxFlags) NoACK() bool

func (RadioTapTxFlags) RTS

func (self RadioTapTxFlags) RTS() bool

func (RadioTapTxFlags) String

func (self RadioTapTxFlags) String() string

type RadioTapVHT

type RadioTapVHT struct {
	Known      RadioTapVHTKnown
	Flags      RadioTapVHTFlags
	Bandwidth  uint8
	MCSNSS     [4]RadioTapVHTMCSNSS
	Coding     uint8
	GroupId    uint8
	PartialAID uint16
}

func (RadioTapVHT) String

func (self RadioTapVHT) String() string

type RadioTapVHTFlags

type RadioTapVHTFlags uint8
const (
	RadioTapVHTFlagsSTBC RadioTapVHTFlags = 1 << iota
	RadioTapVHTFlagsTXOPPSNotAllowed
	RadioTapVHTFlagsSGI
	RadioTapVHTFlagsSGINSYMMod
	RadioTapVHTFlagsLDPCExtraOFDMSymbol
	RadioTapVHTFlagsBeamformed
)

func (RadioTapVHTFlags) Beamformed

func (self RadioTapVHTFlags) Beamformed() bool

func (RadioTapVHTFlags) LDPCExtraOFDMSymbol

func (self RadioTapVHTFlags) LDPCExtraOFDMSymbol() bool

func (RadioTapVHTFlags) SGI

func (self RadioTapVHTFlags) SGI() bool

func (RadioTapVHTFlags) SGINSYMMod

func (self RadioTapVHTFlags) SGINSYMMod() bool

func (RadioTapVHTFlags) STBC

func (self RadioTapVHTFlags) STBC() bool

func (RadioTapVHTFlags) TXOPPSNotAllowed

func (self RadioTapVHTFlags) TXOPPSNotAllowed() bool

type RadioTapVHTKnown

type RadioTapVHTKnown uint16
const (
	RadioTapVHTKnownSTBC RadioTapVHTKnown = 1 << iota
	RadioTapVHTKnownTXOPPSNotAllowed
	RadioTapVHTKnownGI
	RadioTapVHTKnownSGINSYMDisambiguation
	RadioTapVHTKnownLDPCExtraOFDMSymbol
	RadioTapVHTKnownBeamformed
	RadioTapVHTKnownBandwidth
	RadioTapVHTKnownGroupId
	RadioTapVHTKnownPartialAID
)

func (RadioTapVHTKnown) Bandwidth

func (self RadioTapVHTKnown) Bandwidth() bool

func (RadioTapVHTKnown) Beamformed

func (self RadioTapVHTKnown) Beamformed() bool

func (RadioTapVHTKnown) GI

func (self RadioTapVHTKnown) GI() bool

func (RadioTapVHTKnown) GroupId

func (self RadioTapVHTKnown) GroupId() bool

func (RadioTapVHTKnown) LDPCExtraOFDMSymbol

func (self RadioTapVHTKnown) LDPCExtraOFDMSymbol() bool

func (RadioTapVHTKnown) PartialAID

func (self RadioTapVHTKnown) PartialAID() bool

func (RadioTapVHTKnown) SGINSYMDisambiguation

func (self RadioTapVHTKnown) SGINSYMDisambiguation() bool

func (RadioTapVHTKnown) STBC

func (self RadioTapVHTKnown) STBC() bool

func (RadioTapVHTKnown) TXOPPSNotAllowed

func (self RadioTapVHTKnown) TXOPPSNotAllowed() bool

type RadioTapVHTMCSNSS

type RadioTapVHTMCSNSS uint8

func (RadioTapVHTMCSNSS) Present

func (self RadioTapVHTMCSNSS) Present() bool

func (RadioTapVHTMCSNSS) String

func (self RadioTapVHTMCSNSS) String() string

type Router

type Router struct {
	Type                uint8
	Metric              uint16
	InterfaceID         uint32
	NeighborInterfaceID uint32
	NeighborRouterID    uint32
}

Router extends RouterLSA

type RouterLSA

type RouterLSA struct {
	Flags   uint8
	Options uint32
	Routers []Router
}

RouterLSA is the struct from RFC 5340 A.4.3.

type RouterLSAV2

type RouterLSAV2 struct {
	Flags   uint8
	Links   uint16
	Routers []RouterV2
}

RouterLSAV2 is the struct from RFC 2328 A.4.2.

type RouterV2

type RouterV2 struct {
	Type     uint8
	LinkID   uint32
	LinkData uint32
	Metric   uint16
}

RouterV2 extends RouterLSAV2

type SCTP

type SCTP struct {
	BaseLayer
	SrcPort, DstPort SCTPPort
	VerificationTag  uint32
	Checksum         uint32
	// contains filtered or unexported fields
}

SCTP contains information on the top level of an SCTP packet.

func (*SCTP) CanDecode

func (t *SCTP) CanDecode() gopacket.LayerClass

func (*SCTP) DecodeFromBytes

func (sctp *SCTP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*SCTP) LayerType

func (s *SCTP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSCTP

func (*SCTP) NextLayerType

func (t *SCTP) NextLayerType() gopacket.LayerType

func (SCTP) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

func (*SCTP) TransportFlow

func (s *SCTP) TransportFlow() gopacket.Flow

TransportFlow returns a flow based on the source and destination SCTP port.

type SCTPChunk

type SCTPChunk struct {
	BaseLayer
	Type   SCTPChunkType
	Flags  uint8
	Length uint16
	// ActualLength is the total length of an SCTP chunk, including padding.
	// SCTP chunks start and end on 4-byte boundaries.  So if a chunk has a length
	// of 18, it means that it has data up to and including byte 18, then padding
	// up to the next 4-byte boundary, 20.  In this case, Length would be 18, and
	// ActualLength would be 20.
	ActualLength int
}

SCTPChunk contains the common fields in all SCTP chunks.

type SCTPChunkType

type SCTPChunkType uint8

SCTPChunkType is an enumeration of chunk types inside SCTP packets.

const (
	SCTPChunkTypeData             SCTPChunkType = 0
	SCTPChunkTypeInit             SCTPChunkType = 1
	SCTPChunkTypeInitAck          SCTPChunkType = 2
	SCTPChunkTypeSack             SCTPChunkType = 3
	SCTPChunkTypeHeartbeat        SCTPChunkType = 4
	SCTPChunkTypeHeartbeatAck     SCTPChunkType = 5
	SCTPChunkTypeAbort            SCTPChunkType = 6
	SCTPChunkTypeShutdown         SCTPChunkType = 7
	SCTPChunkTypeShutdownAck      SCTPChunkType = 8
	SCTPChunkTypeError            SCTPChunkType = 9
	SCTPChunkTypeCookieEcho       SCTPChunkType = 10
	SCTPChunkTypeCookieAck        SCTPChunkType = 11
	SCTPChunkTypeShutdownComplete SCTPChunkType = 14
)

func (SCTPChunkType) Decode

func (a SCTPChunkType) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls SCTPChunkTypeMetadata.DecodeWith's decoder.

func (SCTPChunkType) LayerType

func (a SCTPChunkType) LayerType() gopacket.LayerType

LayerType returns SCTPChunkTypeMetadata.LayerType.

func (SCTPChunkType) String

func (a SCTPChunkType) String() string

String returns SCTPChunkTypeMetadata.Name.

type SCTPCookieEcho

type SCTPCookieEcho struct {
	SCTPChunk
	Cookie []byte
}

SCTPCookieEcho is the SCTP Cookie Echo layer.

func (*SCTPCookieEcho) LayerType

func (sc *SCTPCookieEcho) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSCTPCookieEcho.

func (SCTPCookieEcho) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPData

type SCTPData struct {
	SCTPChunk
	Unordered, BeginFragment, EndFragment bool
	TSN                                   uint32
	StreamId                              uint16
	StreamSequence                        uint16
	PayloadProtocol                       SCTPPayloadProtocol
}

SCTPData is the SCTP Data chunk layer.

func (*SCTPData) LayerType

func (s *SCTPData) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSCTPData.

func (SCTPData) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPEmptyLayer

type SCTPEmptyLayer struct {
	SCTPChunk
}

This struct is used by all empty SCTP chunks (currently CookieAck and ShutdownComplete).

func (*SCTPEmptyLayer) LayerType

func (sc *SCTPEmptyLayer) LayerType() gopacket.LayerType

LayerType returns either gopacket.LayerTypeSCTPShutdownComplete or LayerTypeSCTPCookieAck.

func (SCTPEmptyLayer) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPError

type SCTPError struct {
	SCTPChunk
	Parameters []SCTPErrorParameter
}

SCTPError is the SCTP error layer, also used for SCTP aborts.

func (*SCTPError) LayerType

func (sc *SCTPError) LayerType() gopacket.LayerType

LayerType returns LayerTypeSCTPAbort or LayerTypeSCTPError.

func (SCTPError) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPErrorParameter

type SCTPErrorParameter SCTPParameter

SCTPErrorParameter is the parameter type used by SCTP Abort and Error layers.

type SCTPHeartbeat

type SCTPHeartbeat struct {
	SCTPChunk
	Parameters []SCTPHeartbeatParameter
}

SCTPHeartbeat is the SCTP heartbeat layer, also used for heatbeat ack.

func (*SCTPHeartbeat) LayerType

func (sc *SCTPHeartbeat) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSCTPHeartbeat.

func (SCTPHeartbeat) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPHeartbeatParameter

type SCTPHeartbeatParameter SCTPParameter

SCTPHeartbeatParameter is the parameter type used by SCTP heartbeat and heartbeat ack layers.

type SCTPInit

type SCTPInit struct {
	SCTPChunk
	InitiateTag                     uint32
	AdvertisedReceiverWindowCredit  uint32
	OutboundStreams, InboundStreams uint16
	InitialTSN                      uint32
	Parameters                      []SCTPInitParameter
}

SCTPInit is used as the return value for both SCTPInit and SCTPInitAck messages.

func (*SCTPInit) LayerType

func (sc *SCTPInit) LayerType() gopacket.LayerType

LayerType returns either gopacket.LayerTypeSCTPInit or gopacket.LayerTypeSCTPInitAck.

func (SCTPInit) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPInitParameter

type SCTPInitParameter SCTPParameter

SCTPInitParameter is a parameter for an SCTP Init or InitAck packet.

type SCTPParameter

type SCTPParameter struct {
	Type         uint16
	Length       uint16
	ActualLength int
	Value        []byte
}

SCTPParameter is a TLV parameter inside a SCTPChunk.

func (SCTPParameter) Bytes

func (p SCTPParameter) Bytes() []byte

type SCTPPayloadProtocol

type SCTPPayloadProtocol uint32

SCTPPayloadProtocol represents a payload protocol

func (SCTPPayloadProtocol) String

func (p SCTPPayloadProtocol) String() string

type SCTPPort

type SCTPPort uint16

SCTPPort is a port in a SCTP layer.

func (SCTPPort) String

func (a SCTPPort) String() string

String returns the port as "number(name)" if there's a well-known port name, or just "number" if there isn't. Well-known names are stored in SCTPPortNames.

type SCTPSack

type SCTPSack struct {
	SCTPChunk
	CumulativeTSNAck               uint32
	AdvertisedReceiverWindowCredit uint32
	NumGapACKs, NumDuplicateTSNs   uint16
	GapACKs                        []uint16
	DuplicateTSNs                  []uint32
}

SCTPSack is the SCTP Selective ACK chunk layer.

func (*SCTPSack) LayerType

func (sc *SCTPSack) LayerType() gopacket.LayerType

LayerType return LayerTypeSCTPSack

func (SCTPSack) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPShutdown

type SCTPShutdown struct {
	SCTPChunk
	CumulativeTSNAck uint32
}

SCTPShutdown is the SCTP shutdown layer.

func (*SCTPShutdown) LayerType

func (sc *SCTPShutdown) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSCTPShutdown.

func (SCTPShutdown) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPShutdownAck

type SCTPShutdownAck struct {
	SCTPChunk
}

SCTPShutdownAck is the SCTP shutdown layer.

func (*SCTPShutdownAck) LayerType

func (sc *SCTPShutdownAck) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSCTPShutdownAck.

func (SCTPShutdownAck) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SCTPUnknownChunkType

type SCTPUnknownChunkType struct {
	SCTPChunk
	// contains filtered or unexported fields
}

SCTPUnknownChunkType is the layer type returned when we don't recognize the chunk type. Since there's a length in a known location, we can skip over it even if we don't know what it is, and continue parsing the rest of the chunks. This chunk is stored as an ErrorLayer in the packet.

func (*SCTPUnknownChunkType) Error

func (s *SCTPUnknownChunkType) Error() error

Error implements ErrorLayer.

func (*SCTPUnknownChunkType) LayerType

func (s *SCTPUnknownChunkType) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSCTPUnknownChunkType.

func (*SCTPUnknownChunkType) Payload

func (s *SCTPUnknownChunkType) Payload() []byte

Payload returns all bytes in this header, including the decoded Type, Length, and Flags.

func (SCTPUnknownChunkType) SerializeTo

SerializeTo is for gopacket.SerializableLayer.

type SFLLACPPortState

type SFLLACPPortState struct {
	PortStateAll uint32
}

SFLLACPportState : SFlow LACP Port State (All(4) - 32 bit)

type SFlowASDestination

type SFlowASDestination struct {
	Type    SFlowASPathType
	Count   uint32
	Members []uint32
}

func (SFlowASDestination) String

func (asd SFlowASDestination) String() string

type SFlowASPathType

type SFlowASPathType uint32
const (
	SFlowASSet      SFlowASPathType = 1
	SFlowASSequence SFlowASPathType = 2
)

func (SFlowASPathType) String

func (apt SFlowASPathType) String() string

type SFlowAppresourcesCounters

type SFlowAppresourcesCounters struct {
	SFlowBaseCounterRecord
	UserTime   uint32
	SystemTime uint32
	MemUsed    uint64
	MemMax     uint64
	FdOpen     uint32
	FdMax      uint32
	ConnOpen   uint32
	ConnMax    uint32
}

SFlowAppresourcesCounters : OVS_Sflow App Resources Counter ( 48 Bytes )

type SFlowBaseCounterRecord

type SFlowBaseCounterRecord struct {
	EnterpriseID   SFlowEnterpriseID
	Format         SFlowCounterRecordType
	FlowDataLength uint32
}

func (SFlowBaseCounterRecord) GetType

type SFlowBaseFlowRecord

type SFlowBaseFlowRecord struct {
	EnterpriseID   SFlowEnterpriseID
	Format         SFlowFlowRecordType
	FlowDataLength uint32
}

SFlowBaseFlowRecord holds the fields common to all records of type SFlowFlowRecordType

func (SFlowBaseFlowRecord) GetType

type SFlowCharSet

type SFlowCharSet uint32
const (
	SFlowCSunknown                 SFlowCharSet = 2
	SFlowCSASCII                   SFlowCharSet = 3
	SFlowCSISOLatin1               SFlowCharSet = 4
	SFlowCSISOLatin2               SFlowCharSet = 5
	SFlowCSISOLatin3               SFlowCharSet = 6
	SFlowCSISOLatin4               SFlowCharSet = 7
	SFlowCSISOLatinCyrillic        SFlowCharSet = 8
	SFlowCSISOLatinArabic          SFlowCharSet = 9
	SFlowCSISOLatinGreek           SFlowCharSet = 10
	SFlowCSISOLatinHebrew          SFlowCharSet = 11
	SFlowCSISOLatin5               SFlowCharSet = 12
	SFlowCSISOLatin6               SFlowCharSet = 13
	SFlowCSISOTextComm             SFlowCharSet = 14
	SFlowCSHalfWidthKatakana       SFlowCharSet = 15
	SFlowCSJISEncoding             SFlowCharSet = 16
	SFlowCSShiftJIS                SFlowCharSet = 17
	SFlowCSEUCPkdFmtJapanese       SFlowCharSet = 18
	SFlowCSEUCFixWidJapanese       SFlowCharSet = 19
	SFlowCSISO4UnitedKingdom       SFlowCharSet = 20
	SFlowCSISO11SwedishForNames    SFlowCharSet = 21
	SFlowCSISO15Italian            SFlowCharSet = 22
	SFlowCSISO17Spanish            SFlowCharSet = 23
	SFlowCSISO21German             SFlowCharSet = 24
	SFlowCSISO60DanishNorwegian    SFlowCharSet = 25
	SFlowCSISO69French             SFlowCharSet = 26
	SFlowCSISO10646UTF1            SFlowCharSet = 27
	SFlowCSISO646basic1983         SFlowCharSet = 28
	SFlowCSINVARIANT               SFlowCharSet = 29
	SFlowCSISO2IntlRefVersion      SFlowCharSet = 30
	SFlowCSNATSSEFI                SFlowCharSet = 31
	SFlowCSNATSSEFIADD             SFlowCharSet = 32
	SFlowCSNATSDANO                SFlowCharSet = 33
	SFlowCSNATSDANOADD             SFlowCharSet = 34
	SFlowCSISO10Swedish            SFlowCharSet = 35
	SFlowCSKSC56011987             SFlowCharSet = 36
	SFlowCSISO2022KR               SFlowCharSet = 37
	SFlowCSEUCKR                   SFlowCharSet = 38
	SFlowCSISO2022JP               SFlowCharSet = 39
	SFlowCSISO2022JP2              SFlowCharSet = 40
	SFlowCSISO13JISC6220jp         SFlowCharSet = 41
	SFlowCSISO14JISC6220ro         SFlowCharSet = 42
	SFlowCSISO16Portuguese         SFlowCharSet = 43
	SFlowCSISO18Greek7Old          SFlowCharSet = 44
	SFlowCSISO19LatinGreek         SFlowCharSet = 45
	SFlowCSISO25French             SFlowCharSet = 46
	SFlowCSISO27LatinGreek1        SFlowCharSet = 47
	SFlowCSISO5427Cyrillic         SFlowCharSet = 48
	SFlowCSISO42JISC62261978       SFlowCharSet = 49
	SFlowCSISO47BSViewdata         SFlowCharSet = 50
	SFlowCSISO49INIS               SFlowCharSet = 51
	SFlowCSISO50INIS8              SFlowCharSet = 52
	SFlowCSISO51INISCyrillic       SFlowCharSet = 53
	SFlowCSISO54271981             SFlowCharSet = 54
	SFlowCSISO5428Greek            SFlowCharSet = 55
	SFlowCSISO57GB1988             SFlowCharSet = 56
	SFlowCSISO58GB231280           SFlowCharSet = 57
	SFlowCSISO61Norwegian2         SFlowCharSet = 58
	SFlowCSISO70VideotexSupp1      SFlowCharSet = 59
	SFlowCSISO84Portuguese2        SFlowCharSet = 60
	SFlowCSISO85Spanish2           SFlowCharSet = 61
	SFlowCSISO86Hungarian          SFlowCharSet = 62
	SFlowCSISO87JISX0208           SFlowCharSet = 63
	SFlowCSISO88Greek7             SFlowCharSet = 64
	SFlowCSISO89ASMO449            SFlowCharSet = 65
	SFlowCSISO90                   SFlowCharSet = 66
	SFlowCSISO91JISC62291984a      SFlowCharSet = 67
	SFlowCSISO92JISC62991984b      SFlowCharSet = 68
	SFlowCSISO93JIS62291984badd    SFlowCharSet = 69
	SFlowCSISO94JIS62291984hand    SFlowCharSet = 70
	SFlowCSISO95JIS62291984handadd SFlowCharSet = 71
	SFlowCSISO96JISC62291984kana   SFlowCharSet = 72
	SFlowCSISO2033                 SFlowCharSet = 73
	SFlowCSISO99NAPLPS             SFlowCharSet = 74
	SFlowCSISO102T617bit           SFlowCharSet = 75
	SFlowCSISO103T618bit           SFlowCharSet = 76
	SFlowCSISO111ECMACyrillic      SFlowCharSet = 77
	SFlowCSa71                     SFlowCharSet = 78
	SFlowCSa72                     SFlowCharSet = 79
	SFlowCSISO123CSAZ24341985gr    SFlowCharSet = 80
	SFlowCSISO88596E               SFlowCharSet = 81
	SFlowCSISO88596I               SFlowCharSet = 82
	SFlowCSISO128T101G2            SFlowCharSet = 83
	SFlowCSISO88598E               SFlowCharSet = 84
	SFlowCSISO88598I               SFlowCharSet = 85
	SFlowCSISO139CSN369103         SFlowCharSet = 86
	SFlowCSISO141JUSIB1002         SFlowCharSet = 87
	SFlowCSISO143IECP271           SFlowCharSet = 88
	SFlowCSISO146Serbian           SFlowCharSet = 89
	SFlowCSISO147Macedonian        SFlowCharSet = 90
	SFlowCSISO150                  SFlowCharSet = 91
	SFlowCSISO151Cuba              SFlowCharSet = 92
	SFlowCSISO6937Add              SFlowCharSet = 93
	SFlowCSISO153GOST1976874       SFlowCharSet = 94
	SFlowCSISO8859Supp             SFlowCharSet = 95
	SFlowCSISO10367Box             SFlowCharSet = 96
	SFlowCSISO158Lap               SFlowCharSet = 97
	SFlowCSISO159JISX02121990      SFlowCharSet = 98
	SFlowCSISO646Danish            SFlowCharSet = 99
	SFlowCSUSDK                    SFlowCharSet = 100
	SFlowCSDKUS                    SFlowCharSet = 101
	SFlowCSKSC5636                 SFlowCharSet = 102
	SFlowCSUnicode11UTF7           SFlowCharSet = 103
	SFlowCSISO2022CN               SFlowCharSet = 104
	SFlowCSISO2022CNEXT            SFlowCharSet = 105
	SFlowCSUTF8                    SFlowCharSet = 106
	SFlowCSISO885913               SFlowCharSet = 109
	SFlowCSISO885914               SFlowCharSet = 110
	SFlowCSISO885915               SFlowCharSet = 111
	SFlowCSISO885916               SFlowCharSet = 112
	SFlowCSGBK                     SFlowCharSet = 113
	SFlowCSGB18030                 SFlowCharSet = 114
	SFlowCSOSDEBCDICDF0415         SFlowCharSet = 115
	SFlowCSOSDEBCDICDF03IRV        SFlowCharSet = 116
	SFlowCSOSDEBCDICDF041          SFlowCharSet = 117
	SFlowCSISO115481               SFlowCharSet = 118
	SFlowCSKZ1048                  SFlowCharSet = 119
	SFlowCSUnicode                 SFlowCharSet = 1000
	SFlowCSUCS4                    SFlowCharSet = 1001
	SFlowCSUnicodeASCII            SFlowCharSet = 1002
	SFlowCSUnicodeLatin1           SFlowCharSet = 1003
	SFlowCSUnicodeJapanese         SFlowCharSet = 1004
	SFlowCSUnicodeIBM1261          SFlowCharSet = 1005
	SFlowCSUnicodeIBM1268          SFlowCharSet = 1006
	SFlowCSUnicodeIBM1276          SFlowCharSet = 1007
	SFlowCSUnicodeIBM1264          SFlowCharSet = 1008
	SFlowCSUnicodeIBM1265          SFlowCharSet = 1009
	SFlowCSUnicode11               SFlowCharSet = 1010
	SFlowCSSCSU                    SFlowCharSet = 1011
	SFlowCSUTF7                    SFlowCharSet = 1012
	SFlowCSUTF16BE                 SFlowCharSet = 1013
	SFlowCSUTF16LE                 SFlowCharSet = 1014
	SFlowCSUTF16                   SFlowCharSet = 1015
	SFlowCSCESU8                   SFlowCharSet = 1016
	SFlowCSUTF32                   SFlowCharSet = 1017
	SFlowCSUTF32BE                 SFlowCharSet = 1018
	SFlowCSUTF32LE                 SFlowCharSet = 1019
	SFlowCSBOCU1                   SFlowCharSet = 1020
	SFlowCSWindows30Latin1         SFlowCharSet = 2000
	SFlowCSWindows31Latin1         SFlowCharSet = 2001
	SFlowCSWindows31Latin2         SFlowCharSet = 2002
	SFlowCSWindows31Latin5         SFlowCharSet = 2003
	SFlowCSHPRoman8                SFlowCharSet = 2004
	SFlowCSAdobeStandardEncoding   SFlowCharSet = 2005
	SFlowCSVenturaUS               SFlowCharSet = 2006
	SFlowCSVenturaInternational    SFlowCharSet = 2007
	SFlowCSDECMCS                  SFlowCharSet = 2008
	SFlowCSPC850Multilingual       SFlowCharSet = 2009
	SFlowCSPCp852                  SFlowCharSet = 2010
	SFlowCSPC8CodePage437          SFlowCharSet = 2011
	SFlowCSPC8DanishNorwegian      SFlowCharSet = 2012
	SFlowCSPC862LatinHebrew        SFlowCharSet = 2013
	SFlowCSPC8Turkish              SFlowCharSet = 2014
	SFlowCSIBMSymbols              SFlowCharSet = 2015
	SFlowCSIBMThai                 SFlowCharSet = 2016
	SFlowCSHPLegal                 SFlowCharSet = 2017
	SFlowCSHPPiFont                SFlowCharSet = 2018
	SFlowCSHPMath8                 SFlowCharSet = 2019
	SFlowCSHPPSMath                SFlowCharSet = 2020
	SFlowCSHPDesktop               SFlowCharSet = 2021
	SFlowCSVenturaMath             SFlowCharSet = 2022
	SFlowCSMicrosoftPublishing     SFlowCharSet = 2023
	SFlowCSWindows31J              SFlowCharSet = 2024
	SFlowCSGB2312                  SFlowCharSet = 2025
	SFlowCSBig5                    SFlowCharSet = 2026
	SFlowCSMacintosh               SFlowCharSet = 2027
	SFlowCSIBM037                  SFlowCharSet = 2028
	SFlowCSIBM038                  SFlowCharSet = 2029
	SFlowCSIBM273                  SFlowCharSet = 2030
	SFlowCSIBM274                  SFlowCharSet = 2031
	SFlowCSIBM275                  SFlowCharSet = 2032
	SFlowCSIBM277                  SFlowCharSet = 2033
	SFlowCSIBM278                  SFlowCharSet = 2034
	SFlowCSIBM280                  SFlowCharSet = 2035
	SFlowCSIBM281                  SFlowCharSet = 2036
	SFlowCSIBM284                  SFlowCharSet = 2037
	SFlowCSIBM285                  SFlowCharSet = 2038
	SFlowCSIBM290                  SFlowCharSet = 2039
	SFlowCSIBM297                  SFlowCharSet = 2040
	SFlowCSIBM420                  SFlowCharSet = 2041
	SFlowCSIBM423                  SFlowCharSet = 2042
	SFlowCSIBM424                  SFlowCharSet = 2043
	SFlowCSIBM500                  SFlowCharSet = 2044
	SFlowCSIBM851                  SFlowCharSet = 2045
	SFlowCSIBM855                  SFlowCharSet = 2046
	SFlowCSIBM857                  SFlowCharSet = 2047
	SFlowCSIBM860                  SFlowCharSet = 2048
	SFlowCSIBM861                  SFlowCharSet = 2049
	SFlowCSIBM863                  SFlowCharSet = 2050
	SFlowCSIBM864                  SFlowCharSet = 2051
	SFlowCSIBM865                  SFlowCharSet = 2052
	SFlowCSIBM868                  SFlowCharSet = 2053
	SFlowCSIBM869                  SFlowCharSet = 2054
	SFlowCSIBM870                  SFlowCharSet = 2055
	SFlowCSIBM871                  SFlowCharSet = 2056
	SFlowCSIBM880                  SFlowCharSet = 2057
	SFlowCSIBM891                  SFlowCharSet = 2058
	SFlowCSIBM903                  SFlowCharSet = 2059
	SFlowCSIBBM904                 SFlowCharSet = 2060
	SFlowCSIBM905                  SFlowCharSet = 2061
	SFlowCSIBM918                  SFlowCharSet = 2062
	SFlowCSIBM1026                 SFlowCharSet = 2063
	SFlowCSIBMEBCDICATDE           SFlowCharSet = 2064
	SFlowCSEBCDICATDEA             SFlowCharSet = 2065
	SFlowCSEBCDICCAFR              SFlowCharSet = 2066
	SFlowCSEBCDICDKNO              SFlowCharSet = 2067
	SFlowCSEBCDICDKNOA             SFlowCharSet = 2068
	SFlowCSEBCDICFISE              SFlowCharSet = 2069
	SFlowCSEBCDICFISEA             SFlowCharSet = 2070
	SFlowCSEBCDICFR                SFlowCharSet = 2071
	SFlowCSEBCDICIT                SFlowCharSet = 2072
	SFlowCSEBCDICPT                SFlowCharSet = 2073
	SFlowCSEBCDICES                SFlowCharSet = 2074
	SFlowCSEBCDICESA               SFlowCharSet = 2075
	SFlowCSEBCDICESS               SFlowCharSet = 2076
	SFlowCSEBCDICUK                SFlowCharSet = 2077
	SFlowCSEBCDICUS                SFlowCharSet = 2078
	SFlowCSUnknown8BiT             SFlowCharSet = 2079
	SFlowCSMnemonic                SFlowCharSet = 2080
	SFlowCSMnem                    SFlowCharSet = 2081
	SFlowCSVISCII                  SFlowCharSet = 2082
	SFlowCSVIQR                    SFlowCharSet = 2083
	SFlowCSKOI8R                   SFlowCharSet = 2084
	SFlowCSHZGB2312                SFlowCharSet = 2085
	SFlowCSIBM866                  SFlowCharSet = 2086
	SFlowCSPC775Baltic             SFlowCharSet = 2087
	SFlowCSKOI8U                   SFlowCharSet = 2088
	SFlowCSIBM00858                SFlowCharSet = 2089
	SFlowCSIBM00924                SFlowCharSet = 2090
	SFlowCSIBM01140                SFlowCharSet = 2091
	SFlowCSIBM01141                SFlowCharSet = 2092
	SFlowCSIBM01142                SFlowCharSet = 2093
	SFlowCSIBM01143                SFlowCharSet = 2094
	SFlowCSIBM01144                SFlowCharSet = 2095
	SFlowCSIBM01145                SFlowCharSet = 2096
	SFlowCSIBM01146                SFlowCharSet = 2097
	SFlowCSIBM01147                SFlowCharSet = 2098
	SFlowCSIBM01148                SFlowCharSet = 2099
	SFlowCSIBM01149                SFlowCharSet = 2100
	SFlowCSBig5HKSCS               SFlowCharSet = 2101
	SFlowCSIBM1047                 SFlowCharSet = 2102
	SFlowCSPTCP154                 SFlowCharSet = 2103
	SFlowCSAmiga1251               SFlowCharSet = 2104
	SFlowCSKOI7switched            SFlowCharSet = 2105
	SFlowCSBRF                     SFlowCharSet = 2106
	SFlowCSTSCII                   SFlowCharSet = 2107
	SFlowCSCP51932                 SFlowCharSet = 2108
	SFlowCSWindows874              SFlowCharSet = 2109
	SFlowCSWindows1250             SFlowCharSet = 2250
	SFlowCSWindows1251             SFlowCharSet = 2251
	SFlowCSWindows1252             SFlowCharSet = 2252
	SFlowCSWindows1253             SFlowCharSet = 2253
	SFlowCSWindows1254             SFlowCharSet = 2254
	SFlowCSWindows1255             SFlowCharSet = 2255
	SFlowCSWindows1256             SFlowCharSet = 2256
	SFlowCSWindows1257             SFlowCharSet = 2257
	SFlowCSWindows1258             SFlowCharSet = 2258
	SFlowCSTIS620                  SFlowCharSet = 2259
	SFlowCS50220                   SFlowCharSet = 2260
	SFlowCSreserved                SFlowCharSet = 3000
)

type SFlowCounterDataFormat

type SFlowCounterDataFormat uint32

type SFlowCounterRecordType

type SFlowCounterRecordType uint32
const (
	SFlowTypeGenericInterfaceCounters   SFlowCounterRecordType = 1
	SFlowTypeEthernetInterfaceCounters  SFlowCounterRecordType = 2
	SFlowTypeTokenRingInterfaceCounters SFlowCounterRecordType = 3
	SFlowType100BaseVGInterfaceCounters SFlowCounterRecordType = 4
	SFlowTypeVLANCounters               SFlowCounterRecordType = 5
	SFlowTypeLACPCounters               SFlowCounterRecordType = 7
	SFlowTypeProcessorCounters          SFlowCounterRecordType = 1001
	SFlowTypeOpenflowPortCounters       SFlowCounterRecordType = 1004
	SFlowTypePORTNAMECounters           SFlowCounterRecordType = 1005
	SFLowTypeAPPRESOURCESCounters       SFlowCounterRecordType = 2203
	SFlowTypeOVSDPCounters              SFlowCounterRecordType = 2207
)

func (SFlowCounterRecordType) String

func (cr SFlowCounterRecordType) String() string

type SFlowCounterSample

type SFlowCounterSample struct {
	EnterpriseID   SFlowEnterpriseID
	Format         SFlowSampleType
	SampleLength   uint32
	SequenceNumber uint32
	SourceIDClass  SFlowSourceFormat
	SourceIDIndex  SFlowSourceValue
	RecordCount    uint32
	Records        []SFlowRecord
}

Counter samples report information about various counter objects. Typically these are items like IfInOctets, or CPU / Memory stats, etc. SFlow will report these at regular intervals as configured on the agent. If one were sufficiently industrious, this could be used to replace the typical SNMP polling used for such things.

func (SFlowCounterSample) GetRecords

func (cs SFlowCounterSample) GetRecords() []SFlowRecord

GetRecords will return a slice of interface types representing records. A type switch can be used to get at the underlying SFlowCounterRecordType.

func (SFlowCounterSample) GetType

func (cs SFlowCounterSample) GetType() SFlowSampleType

GetType will report the type of sample. Only the compact form of counter samples is supported

type SFlowDataFormat

type SFlowDataFormat uint32

SFlowDataFormat encodes the EnterpriseID in the most significant 12 bits, and the SampleType in the least significant 20 bits.

type SFlowDataSource

type SFlowDataSource int32

SFlowDataSource encodes a 2-bit SFlowSourceFormat in its most significant 2 bits, and an SFlowSourceValue in its least significant 30 bits. These types and values define the meaning of the inteface information presented in the sample metadata.

type SFlowDataSourceExpanded

type SFlowDataSourceExpanded struct {
	SourceIDClass SFlowSourceFormat
	SourceIDIndex SFlowSourceValue
}

type SFlowDatagram

type SFlowDatagram struct {
	BaseLayer

	DatagramVersion uint32
	AgentAddress    net.IP
	SubAgentID      uint32
	SequenceNumber  uint32
	AgentUptime     uint32
	SampleCount     uint32
	FlowSamples     []SFlowFlowSample
	CounterSamples  []SFlowCounterSample
}

SFlowDatagram is the outermost container which holds some basic information about the reporting agent, and holds at least one sample record

func (*SFlowDatagram) CanDecode

func (d *SFlowDatagram) CanDecode() gopacket.LayerClass

func (*SFlowDatagram) DecodeFromBytes

func (s *SFlowDatagram) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*SFlowDatagram) LayerType

func (s *SFlowDatagram) LayerType() gopacket.LayerType

func (*SFlowDatagram) NextLayerType

func (d *SFlowDatagram) NextLayerType() gopacket.LayerType

func (*SFlowDatagram) Payload

func (d *SFlowDatagram) Payload() []byte

type SFlowEnterpriseID

type SFlowEnterpriseID uint32

SFlowEnterpriseID is used to differentiate between the official SFlow standard, and other, vendor-specific types of flow data. (Similiar to SNMP's enterprise MIB OIDs) Only the office SFlow Enterprise ID is decoded here.

const (
	SFlowStandard SFlowEnterpriseID = 0
)

func (SFlowEnterpriseID) GetType

func (eid SFlowEnterpriseID) GetType() SFlowEnterpriseID

func (SFlowEnterpriseID) String

func (eid SFlowEnterpriseID) String() string

type SFlowEthernetCounters

type SFlowEthernetCounters struct {
	SFlowBaseCounterRecord
	AlignmentErrors           uint32
	FCSErrors                 uint32
	SingleCollisionFrames     uint32
	MultipleCollisionFrames   uint32
	SQETestErrors             uint32
	DeferredTransmissions     uint32
	LateCollisions            uint32
	ExcessiveCollisions       uint32
	InternalMacTransmitErrors uint32
	CarrierSenseErrors        uint32
	FrameTooLongs             uint32
	InternalMacReceiveErrors  uint32
	SymbolErrors              uint32
}

type SFlowEthernetFrameFlowRecord

type SFlowEthernetFrameFlowRecord struct {
	SFlowBaseFlowRecord
	FrameLength uint32
	SrcMac      net.HardwareAddr
	DstMac      net.HardwareAddr
	Type        uint32
}

SFlowEthernetFrameFlowRecord give additional information about the sampled packet if it's available. An agent may or may not provide this information.

type SFlowExtendedDecapsulateEgressRecord

type SFlowExtendedDecapsulateEgressRecord struct {
	SFlowBaseFlowRecord
	InnerHeaderOffset uint32
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Inner Header Offset | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedDecapsulateIngressRecord

type SFlowExtendedDecapsulateIngressRecord struct {
	SFlowBaseFlowRecord
	InnerHeaderOffset uint32
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Inner Header Offset | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedGatewayFlowRecord

type SFlowExtendedGatewayFlowRecord struct {
	SFlowBaseFlowRecord
	NextHop     net.IP
	AS          uint32
	SourceAS    uint32
	PeerAS      uint32
	ASPathCount uint32
	ASPath      []SFlowASDestination
	Communities []uint32
	LocalPref   uint32
}

type SFlowExtendedIpv4TunnelEgressRecord

type SFlowExtendedIpv4TunnelEgressRecord struct {
	SFlowBaseFlowRecord
	SFlowIpv4Record SFlowIpv4Record
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ / Packet IP version 4 Record / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedIpv4TunnelIngressRecord

type SFlowExtendedIpv4TunnelIngressRecord struct {
	SFlowBaseFlowRecord
	SFlowIpv4Record SFlowIpv4Record
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ / Packet IP version 4 Record / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedIpv6TunnelEgressRecord

type SFlowExtendedIpv6TunnelEgressRecord struct {
	SFlowBaseFlowRecord
	SFlowIpv6Record
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ / Packet IP version 6 Record / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedIpv6TunnelIngressRecord

type SFlowExtendedIpv6TunnelIngressRecord struct {
	SFlowBaseFlowRecord
	SFlowIpv6Record
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ / Packet IP version 6 Record / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedRouterFlowRecord

type SFlowExtendedRouterFlowRecord struct {
	SFlowBaseFlowRecord
	NextHop                net.IP
	NextHopSourceMask      uint32
	NextHopDestinationMask uint32
}

SFlowExtendedRouterFlowRecord gives additional information about the layer 3 routing information used to forward the packet

type SFlowExtendedSwitchFlowRecord

type SFlowExtendedSwitchFlowRecord struct {
	SFlowBaseFlowRecord
	IncomingVLAN         uint32
	IncomingVLANPriority uint32
	OutgoingVLAN         uint32
	OutgoingVLANPriority uint32
}

SFlowExtendedSwitchFlowRecord give additional information about the sampled packet if it's available. It's mainly useful for getting at the incoming and outgoing VLANs An agent may or may not provide this information.

type SFlowExtendedURLRecord

type SFlowExtendedURLRecord struct {
	SFlowBaseFlowRecord
	Direction SFlowURLDirection
	URL       string
	Host      string
}

type SFlowExtendedUserFlow

type SFlowExtendedUserFlow struct {
	SFlowBaseFlowRecord
	SourceCharSet      SFlowCharSet
	SourceUserID       string
	DestinationCharSet SFlowCharSet
	DestinationUserID  string
}

type SFlowExtendedVniEgressRecord

type SFlowExtendedVniEgressRecord struct {
	SFlowBaseFlowRecord
	VNI uint32
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | VNI | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedVniIngressRecord

type SFlowExtendedVniIngressRecord struct {
	SFlowBaseFlowRecord
	VNI uint32
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 20 bit Interprise (0) |12 bit format | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | record length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | VNI | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowFlowDataFormat

type SFlowFlowDataFormat uint32

type SFlowFlowRecordType

type SFlowFlowRecordType uint32

SFlowFlowRecordType denotes what kind of Flow Record is represented. See RFC 3176

const (
	SFlowTypeRawPacketFlow                  SFlowFlowRecordType = 1
	SFlowTypeEthernetFrameFlow              SFlowFlowRecordType = 2
	SFlowTypeIpv4Flow                       SFlowFlowRecordType = 3
	SFlowTypeIpv6Flow                       SFlowFlowRecordType = 4
	SFlowTypeExtendedSwitchFlow             SFlowFlowRecordType = 1001
	SFlowTypeExtendedRouterFlow             SFlowFlowRecordType = 1002
	SFlowTypeExtendedGatewayFlow            SFlowFlowRecordType = 1003
	SFlowTypeExtendedUserFlow               SFlowFlowRecordType = 1004
	SFlowTypeExtendedUrlFlow                SFlowFlowRecordType = 1005
	SFlowTypeExtendedMlpsFlow               SFlowFlowRecordType = 1006
	SFlowTypeExtendedNatFlow                SFlowFlowRecordType = 1007
	SFlowTypeExtendedMlpsTunnelFlow         SFlowFlowRecordType = 1008
	SFlowTypeExtendedMlpsVcFlow             SFlowFlowRecordType = 1009
	SFlowTypeExtendedMlpsFecFlow            SFlowFlowRecordType = 1010
	SFlowTypeExtendedMlpsLvpFecFlow         SFlowFlowRecordType = 1011
	SFlowTypeExtendedVlanFlow               SFlowFlowRecordType = 1012
	SFlowTypeExtendedIpv4TunnelEgressFlow   SFlowFlowRecordType = 1023
	SFlowTypeExtendedIpv4TunnelIngressFlow  SFlowFlowRecordType = 1024
	SFlowTypeExtendedIpv6TunnelEgressFlow   SFlowFlowRecordType = 1025
	SFlowTypeExtendedIpv6TunnelIngressFlow  SFlowFlowRecordType = 1026
	SFlowTypeExtendedDecapsulateEgressFlow  SFlowFlowRecordType = 1027
	SFlowTypeExtendedDecapsulateIngressFlow SFlowFlowRecordType = 1028
	SFlowTypeExtendedVniEgressFlow          SFlowFlowRecordType = 1029
	SFlowTypeExtendedVniIngressFlow         SFlowFlowRecordType = 1030
)

func (SFlowFlowRecordType) String

func (rt SFlowFlowRecordType) String() string

type SFlowFlowSample

type SFlowFlowSample struct {
	EnterpriseID          SFlowEnterpriseID
	Format                SFlowSampleType
	SampleLength          uint32
	SequenceNumber        uint32
	SourceIDClass         SFlowSourceFormat
	SourceIDIndex         SFlowSourceValue
	SamplingRate          uint32
	SamplePool            uint32
	Dropped               uint32
	InputInterfaceFormat  uint32
	InputInterface        uint32
	OutputInterfaceFormat uint32
	OutputInterface       uint32
	RecordCount           uint32
	Records               []SFlowRecord
}

SFlowFlowSample represents a sampled packet and contains one or more records describing the packet

func (SFlowFlowSample) GetRecords

func (fs SFlowFlowSample) GetRecords() []SFlowRecord

func (SFlowFlowSample) GetType

func (fs SFlowFlowSample) GetType() SFlowSampleType

type SFlowGenericInterfaceCounters

type SFlowGenericInterfaceCounters struct {
	SFlowBaseCounterRecord
	IfIndex            uint32
	IfType             uint32
	IfSpeed            uint64
	IfDirection        uint32
	IfStatus           uint32
	IfInOctets         uint64
	IfInUcastPkts      uint32
	IfInMulticastPkts  uint32
	IfInBroadcastPkts  uint32
	IfInDiscards       uint32
	IfInErrors         uint32
	IfInUnknownProtos  uint32
	IfOutOctets        uint64
	IfOutUcastPkts     uint32
	IfOutMulticastPkts uint32
	IfOutBroadcastPkts uint32
	IfOutDiscards      uint32
	IfOutErrors        uint32
	IfPromiscuousMode  uint32
}

type SFlowIPType

type SFlowIPType uint32

SFlowIPType determines what form the IP address being decoded will take. This is an XDR union type allowing for both IPv4 and IPv6

const (
	SFlowIPv4 SFlowIPType = 1
	SFlowIPv6 SFlowIPType = 2
)

func (SFlowIPType) Length

func (s SFlowIPType) Length() int

func (SFlowIPType) String

func (s SFlowIPType) String() string

type SFlowIpv4Record

type SFlowIpv4Record struct {
	// The length of the IP packet excluding ower layer encapsulations
	Length uint32
	// IP Protocol type (for example, TCP = 6, UDP = 17)
	Protocol uint32
	// Source IP Address
	IPSrc net.IP
	// Destination IP Address
	IPDst net.IP
	// TCP/UDP source port number or equivalent
	PortSrc uint32
	// TCP/UDP destination port number or equivalent
	PortDst uint32
	// TCP flags
	TCPFlags uint32
	// IP type of service
	TOS uint32
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Protocol | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Source IPv4 | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Destination IPv4 | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Source Port | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Destionation Port | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | TCP Flags | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | TOS | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowIpv6Record

type SFlowIpv6Record struct {
	// The length of the IP packet excluding ower layer encapsulations
	Length uint32
	// IP Protocol type (for example, TCP = 6, UDP = 17)
	Protocol uint32
	// Source IP Address
	IPSrc net.IP
	// Destination IP Address
	IPDst net.IP
	// TCP/UDP source port number or equivalent
	PortSrc uint32
	// TCP/UDP destination port number or equivalent
	PortDst uint32
	// TCP flags
	TCPFlags uint32
	// IP priority
	Priority uint32
}

0 15 31 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Length | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Protocol | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Source IPv4 | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Destination IPv4 | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Source Port | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Destionation Port | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | TCP Flags | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | Priority | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowLACPCounters

type SFlowLACPCounters struct {
	SFlowBaseCounterRecord
	ActorSystemID        net.HardwareAddr
	PartnerSystemID      net.HardwareAddr
	AttachedAggID        uint32
	LacpPortState        SFLLACPPortState
	LACPDUsRx            uint32
	MarkerPDUsRx         uint32
	MarkerResponsePDUsRx uint32
	UnknownRx            uint32
	IllegalRx            uint32
	LACPDUsTx            uint32
	MarkerPDUsTx         uint32
	MarkerResponsePDUsTx uint32
}

LACPcounters : LACP SFlow Counters ( 64 Bytes )

type SFlowOVSDPCounters

type SFlowOVSDPCounters struct {
	SFlowBaseCounterRecord
	NHit     uint32
	NMissed  uint32
	NLost    uint32
	NMaskHit uint32
	NFlows   uint32
	NMasks   uint32
}

SFlowOVSDPCounters : OVS-Sflow DataPath Counter ( 32 Bytes )

type SFlowOpenflowPortCounters

type SFlowOpenflowPortCounters struct {
	SFlowBaseCounterRecord
	DatapathID uint64
	PortNo     uint32
}

SFlowOpenflowPortCounters : OVS-Sflow OpenFlow Port Counter ( 20 Bytes )

type SFlowPORTNAME

type SFlowPORTNAME struct {
	SFlowBaseCounterRecord
	Len uint32
	Str string
}

SFlowPORTNAME : OVS-Sflow PORTNAME Counter Sampletype ( 20 Bytes )

type SFlowProcessorCounters

type SFlowProcessorCounters struct {
	SFlowBaseCounterRecord
	FiveSecCpu  uint32 // 5 second average CPU utilization
	OneMinCpu   uint32 // 1 minute average CPU utilization
	FiveMinCpu  uint32 // 5 minute average CPU utilization
	TotalMemory uint64 // total memory (in bytes)
	FreeMemory  uint64 // free memory (in bytes)
}

type SFlowRawHeaderProtocol

type SFlowRawHeaderProtocol uint32
const (
	SFlowProtoEthernet   SFlowRawHeaderProtocol = 1
	SFlowProtoISO88024   SFlowRawHeaderProtocol = 2
	SFlowProtoISO88025   SFlowRawHeaderProtocol = 3
	SFlowProtoFDDI       SFlowRawHeaderProtocol = 4
	SFlowProtoFrameRelay SFlowRawHeaderProtocol = 5
	SFlowProtoX25        SFlowRawHeaderProtocol = 6
	SFlowProtoPPP        SFlowRawHeaderProtocol = 7
	SFlowProtoSMDS       SFlowRawHeaderProtocol = 8
	SFlowProtoAAL5       SFlowRawHeaderProtocol = 9
	SFlowProtoAAL5_IP    SFlowRawHeaderProtocol = 10 /* e.g. Cisco AAL5 mux */
	SFlowProtoIPv4       SFlowRawHeaderProtocol = 11
	SFlowProtoIPv6       SFlowRawHeaderProtocol = 12
	SFlowProtoMPLS       SFlowRawHeaderProtocol = 13
	SFlowProtoPOS        SFlowRawHeaderProtocol = 14 /* RFC 1662, 2615 */
)

func (SFlowRawHeaderProtocol) String

func (sfhp SFlowRawHeaderProtocol) String() string

type SFlowRawPacketFlowRecord

type SFlowRawPacketFlowRecord struct {
	SFlowBaseFlowRecord
	HeaderProtocol SFlowRawHeaderProtocol
	FrameLength    uint32
	PayloadRemoved uint32
	HeaderLength   uint32
	Header         gopacket.Packet
}

SFlowRawPacketFlowRecords hold information about a sampled packet grabbed as it transited the agent. This is perhaps the most useful and interesting record type, as it holds the headers of the sampled packet and can be used to build up a complete picture of the traffic patterns on a network.

The raw packet header is sent back into gopacket for decoding, and the resulting gopackt.Packet is stored in the Header member

type SFlowRecord

type SFlowRecord interface {
}

SFlowRecord holds both flow sample records and counter sample records. A Record is the structure that actually holds the sampled data and / or counters.

type SFlowSampleType

type SFlowSampleType uint32

SFlowSampleType specifies the type of sample. Only flow samples and counter samples are supported

const (
	SFlowTypeFlowSample            SFlowSampleType = 1
	SFlowTypeCounterSample         SFlowSampleType = 2
	SFlowTypeExpandedFlowSample    SFlowSampleType = 3
	SFlowTypeExpandedCounterSample SFlowSampleType = 4
)

func (SFlowSampleType) GetType

func (st SFlowSampleType) GetType() SFlowSampleType

func (SFlowSampleType) String

func (st SFlowSampleType) String() string

type SFlowSourceFormat

type SFlowSourceFormat uint32
const (
	SFlowTypeSingleInterface      SFlowSourceFormat = 0
	SFlowTypePacketDiscarded      SFlowSourceFormat = 1
	SFlowTypeMultipleDestinations SFlowSourceFormat = 2
)

func (SFlowSourceFormat) String

func (sdf SFlowSourceFormat) String() string

type SFlowSourceValue

type SFlowSourceValue uint32

type SFlowURLDirection

type SFlowURLDirection uint32
const (
	SFlowURLsrc SFlowURLDirection = 1
	SFlowURLdst SFlowURLDirection = 2
)

func (SFlowURLDirection) String

func (urld SFlowURLDirection) String() string

type SFlowVLANCounters

type SFlowVLANCounters struct {
	SFlowBaseCounterRecord
	VlanID        uint32
	Octets        uint64
	UcastPkts     uint32
	MulticastPkts uint32
	BroadcastPkts uint32
	Discards      uint32
}

type SIP

type SIP struct {
	BaseLayer

	// Base information
	Version SIPVersion
	Method  SIPMethod
	Headers map[string][]string

	// Request
	RequestURI string

	// Response
	IsResponse     bool
	ResponseCode   int
	ResponseStatus string
	// contains filtered or unexported fields
}

SIP object will contains information about decoded SIP packet. -> The SIP Version -> The SIP Headers (in a map[string][]string because of multiple headers with the same name -> The SIP Method -> The SIP Response code (if it's a response) -> The SIP Status line (if it's a response) You can easily know the type of the packet with the IsResponse boolean

func NewSIP

func NewSIP() *SIP

NewSIP instantiates a new empty SIP object

func (*SIP) CanDecode

func (s *SIP) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode

func (*SIP) DecodeFromBytes

func (s *SIP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the slice into the SIP struct.

func (*SIP) GetAllHeaders

func (s *SIP) GetAllHeaders() map[string][]string

GetAllHeaders will return the full headers of the current SIP packets in a map[string][]string

func (*SIP) GetAuthorization

func (s *SIP) GetAuthorization() string

GetAuthorization will return the Authorization header of the current SIP packet

func (*SIP) GetCSeq

func (s *SIP) GetCSeq() int64

GetCSeq will return the parsed integer CSeq header header of the current SIP packet

func (*SIP) GetCallID

func (s *SIP) GetCallID() string

GetCallID will return the Call-ID header of the current SIP packet

func (*SIP) GetContact

func (s *SIP) GetContact() string

GetContact will return the Contact header of the current SIP packet

func (*SIP) GetContentLength

func (s *SIP) GetContentLength() int64

GetContentLength will return the parsed integer Content-Length header of the current SIP packet

func (*SIP) GetFirstHeader

func (s *SIP) GetFirstHeader(headerName string) string

GetFirstHeader will return the first header with the specified name. If the current SIP packet has multiple headers with the same name, it returns the first.

func (*SIP) GetFrom

func (s *SIP) GetFrom() string

GetFrom will return the From header of the current SIP packet

func (*SIP) GetHeader

func (s *SIP) GetHeader(headerName string) []string

GetHeader will return all the headers with the specified name.

func (*SIP) GetTo

func (s *SIP) GetTo() string

GetTo will return the To header of the current SIP packet

func (*SIP) GetUserAgent

func (s *SIP) GetUserAgent() string

GetUserAgent will return the User-Agent header of the current SIP packet

func (*SIP) LayerType

func (s *SIP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSIP.

func (*SIP) NextLayerType

func (s *SIP) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer

func (*SIP) ParseFirstLine

func (s *SIP) ParseFirstLine(firstLine []byte) error

ParseFirstLine will compute the first line of a SIP packet. The first line will tell us if it's a request or a response.

Examples of first line of SIP Prococol :

Request 	: INVITE bob@example.com SIP/2.0
Response 	: SIP/2.0 200 OK
Response	: SIP/2.0 501 Not Implemented

func (*SIP) ParseHeader

func (s *SIP) ParseHeader(header []byte) (err error)

ParseHeader will parse a SIP Header SIP Headers are quite simple, there are colon separated name and value Headers can be spread over multiple lines

Examples of header :

 CSeq: 1 REGISTER
 Via: SIP/2.0/UDP there.com:5060
 Authorization:Digest username="UserB",
	  realm="MCI WorldCom SIP",
   nonce="1cec4341ae6cbe5a359ea9c8e88df84f", opaque="",
   uri="sip:ss2.wcom.com", response="71ba27c64bd01de719686aa4590d5824"

func (*SIP) ParseSpecificHeaders

func (s *SIP) ParseSpecificHeaders(headerName string, headerValue string) (err error)

ParseSpecificHeaders will parse some specific key values from specific headers like CSeq or Content-Length integer values

func (*SIP) Payload

func (s *SIP) Payload() []byte

Payload returns the base layer payload

type SIPMethod

type SIPMethod uint16

SIPMethod defines the different methods of the SIP Protocol defined in the different RFC's

const (
	SIPMethodInvite    SIPMethod = 1  // INVITE	[RFC3261]
	SIPMethodAck       SIPMethod = 2  // ACK	[RFC3261]
	SIPMethodBye       SIPMethod = 3  // BYE	[RFC3261]
	SIPMethodCancel    SIPMethod = 4  // CANCEL	[RFC3261]
	SIPMethodOptions   SIPMethod = 5  // OPTIONS	[RFC3261]
	SIPMethodRegister  SIPMethod = 6  // REGISTER	[RFC3261]
	SIPMethodPrack     SIPMethod = 7  // PRACK	[RFC3262]
	SIPMethodSubscribe SIPMethod = 8  // SUBSCRIBE	[RFC6665]
	SIPMethodNotify    SIPMethod = 9  // NOTIFY	[RFC6665]
	SIPMethodPublish   SIPMethod = 10 // PUBLISH	[RFC3903]
	SIPMethodInfo      SIPMethod = 11 // INFO	[RFC6086]
	SIPMethodRefer     SIPMethod = 12 // REFER	[RFC3515]
	SIPMethodMessage   SIPMethod = 13 // MESSAGE	[RFC3428]
	SIPMethodUpdate    SIPMethod = 14 // UPDATE	[RFC3311]
	SIPMethodPing      SIPMethod = 15 // PING	[https://tools.ietf.org/html/draft-fwmiller-ping-03]
)

Here are all the SIP methods

func GetSIPMethod

func GetSIPMethod(method string) (SIPMethod, error)

GetSIPMethod returns the constant of a SIP method from its string

func (SIPMethod) String

func (sm SIPMethod) String() string

type SIPVersion

type SIPVersion uint8

SIPVersion defines the different versions of the SIP Protocol

const (
	SIPVersion1 SIPVersion = 1
	SIPVersion2 SIPVersion = 2
)

Represents all the versions of SIP protocol

func GetSIPVersion

func GetSIPVersion(version string) (SIPVersion, error)

GetSIPVersion is used to get SIP version constant

func (SIPVersion) String

func (sv SIPVersion) String() string

type SNAP

type SNAP struct {
	BaseLayer
	OrganizationalCode []byte
	Type               EthernetType
}

SNAP is used inside LLC. See http://standards.ieee.org/getieee802/download/802-2001.pdf. From http://en.wikipedia.org/wiki/Subnetwork_Access_Protocol:

"[T]he Subnetwork Access Protocol (SNAP) is a mechanism for multiplexing,
on networks using IEEE 802.2 LLC, more protocols than can be distinguished
by the 8-bit 802.2 Service Access Point (SAP) fields."

func (*SNAP) CanDecode

func (s *SNAP) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*SNAP) DecodeFromBytes

func (s *SNAP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*SNAP) LayerType

func (s *SNAP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSNAP.

func (*SNAP) NextLayerType

func (s *SNAP) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*SNAP) SerializeTo

func (s *SNAP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type STP

type STP struct {
	BaseLayer
	ProtocolID        uint16
	Version           uint8
	Type              uint8
	TC, TCA           bool // TC: Topologie change ; TCA: Topologie change ack
	RouteID, BridgeID STPSwitchID
	Cost              uint32
	PortID            uint16
	MessageAge        uint16
	MaxAge            uint16
	HelloTime         uint16
	FDelay            uint16
}

STP decode spanning tree protocol packets to transport BPDU (bridge protocol data unit) message.

func (*STP) CanDecode

func (s *STP) CanDecode() gopacket.LayerClass

CanDecode returns the set of layer types that this DecodingLayer can decode.

func (*STP) DecodeFromBytes

func (stp *STP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*STP) LayerType

func (s *STP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeSTP.

func (*STP) NextLayerType

func (stp *STP) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type contained by this DecodingLayer.

func (*STP) SerializeTo

func (s *STP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

type STPSwitchID

type STPSwitchID struct {
	Priority uint16 // Bridge priority
	SysID    uint16 // VLAN ID
	HwAddr   net.HardwareAddr
}

type TCP

type TCP struct {
	BaseLayer
	SrcPort, DstPort                           TCPPort
	Seq                                        uint32
	Ack                                        uint32
	DataOffset                                 uint8
	FIN, SYN, RST, PSH, ACK, URG, ECE, CWR, NS bool
	Window                                     uint16
	Checksum                                   uint16
	Urgent                                     uint16

	Options []TCPOption
	Padding []byte
	// contains filtered or unexported fields
}

TCP is the layer for TCP headers.

func (*TCP) CanDecode

func (t *TCP) CanDecode() gopacket.LayerClass

func (*TCP) ComputeChecksum

func (t *TCP) ComputeChecksum() (uint16, error)

func (*TCP) DecodeFromBytes

func (tcp *TCP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*TCP) LayerType

func (t *TCP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeTCP

func (*TCP) NextLayerType

func (t *TCP) NextLayerType() gopacket.LayerType

func (*TCP) SerializeTo

func (t *TCP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

func (*TCP) SetInternalPortsForTesting

func (t *TCP) SetInternalPortsForTesting()

For testing only

func (*TCP) SetNetworkLayerForChecksum

func (i *TCP) SetNetworkLayerForChecksum(l gopacket.NetworkLayer) error

SetNetworkLayerForChecksum tells this layer which network layer is wrapping it. This is needed for computing the checksum when serializing, since TCP/IP transport layer checksums depends on fields in the IPv4 or IPv6 layer that contains it. The passed in layer must be an *IPv4 or *IPv6.

func (*TCP) TransportFlow

func (t *TCP) TransportFlow() gopacket.Flow

type TCPOption

type TCPOption struct {
	OptionType   TCPOptionKind
	OptionLength uint8
	OptionData   []byte
}

func (TCPOption) String

func (t TCPOption) String() string

type TCPOptionKind

type TCPOptionKind uint8

TCPOptionKind represents a TCP option code.

func (TCPOptionKind) String

func (k TCPOptionKind) String() string

type TCPPort

type TCPPort uint16

TCPPort is a port in a TCP layer.

func (TCPPort) LayerType

func (a TCPPort) LayerType() gopacket.LayerType

LayerType returns a LayerType that would be able to decode the application payload. It uses some well-known ports such as 53 for DNS.

Returns gopacket.LayerTypePayload for unknown/unsupported port numbers.

func (TCPPort) String

func (a TCPPort) String() string

String returns the port as "number(name)" if there's a well-known port name, or just "number" if there isn't. Well-known names are stored in TCPPortNames.

type TLS

type TLS struct {
	BaseLayer

	// TLS Records
	ChangeCipherSpec []TLSChangeCipherSpecRecord
	Handshake        []TLSHandshakeRecord
	AppData          []TLSAppDataRecord
	Alert            []TLSAlertRecord
}

TLS is actually a slide of TLSrecord structures

func (*TLS) CanDecode

func (t *TLS) CanDecode() gopacket.LayerClass

CanDecode implements gopacket.DecodingLayer.

func (*TLS) DecodeFromBytes

func (t *TLS) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the slice into the TLS struct.

func (*TLS) LayerType

func (t *TLS) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeTLS.

func (*TLS) NextLayerType

func (t *TLS) NextLayerType() gopacket.LayerType

NextLayerType implements gopacket.DecodingLayer.

func (*TLS) Payload

func (t *TLS) Payload() []byte

Payload returns nil, since TLS encrypted payload is inside TLSAppDataRecord

func (*TLS) SerializeTo

func (t *TLS) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer.

type TLSAlertDescr

type TLSAlertDescr uint8

TLSAlertDescr defines the alert descrption data type

func (TLSAlertDescr) String

func (ad TLSAlertDescr) String() string

Strings shows the TLS alert description nicely formatted

type TLSAlertLevel

type TLSAlertLevel uint8

TLSAlertLevel defines the alert level data type

func (TLSAlertLevel) String

func (al TLSAlertLevel) String() string

Strings shows the TLS alert level nicely formatted

type TLSAlertRecord

type TLSAlertRecord struct {
	TLSRecordHeader

	Level       TLSAlertLevel
	Description TLSAlertDescr

	EncryptedMsg []byte
}

TLSAlertRecord contains all the information that each Alert Record type should have

type TLSAppDataRecord

type TLSAppDataRecord struct {
	TLSRecordHeader
	Payload []byte
}

TLSAppDataRecord contains all the information that each AppData Record types should have

type TLSChangeCipherSpecRecord

type TLSChangeCipherSpecRecord struct {
	TLSRecordHeader

	Message TLSchangeCipherSpec
}

TLSChangeCipherSpecRecord defines the type of data inside ChangeCipherSpec Record

type TLSHandshakeRecord

type TLSHandshakeRecord struct {
	TLSRecordHeader
}

TLSHandshakeRecord defines the structure of a Handshare Record

type TLSRecordHeader

type TLSRecordHeader struct {
	ContentType TLSType
	Version     TLSVersion
	Length      uint16
}

TLSRecordHeader contains all the information that each TLS Record types should have

type TLSType

type TLSType uint8

TLSType defines the type of data after the TLS Record

const (
	TLSChangeCipherSpec TLSType = 20
	TLSAlert            TLSType = 21
	TLSHandshake        TLSType = 22
	TLSApplicationData  TLSType = 23
	TLSUnknown          TLSType = 255
)

TLSType known values.

func (TLSType) String

func (tt TLSType) String() string

String shows the register type nicely formatted

type TLSVersion

type TLSVersion uint16

TLSVersion represents the TLS version in numeric format

func (TLSVersion) String

func (tv TLSVersion) String() string

Strings shows the TLS version nicely formatted

type TLSchangeCipherSpec

type TLSchangeCipherSpec uint8

TLSchangeCipherSpec defines the message value inside ChangeCipherSpec Record

const (
	TLSChangecipherspecMessage TLSchangeCipherSpec = 1
	TLSChangecipherspecUnknown TLSchangeCipherSpec = 255
)

func (TLSchangeCipherSpec) String

func (ccs TLSchangeCipherSpec) String() string

String shows the message value nicely formatted

type UDP

type UDP struct {
	BaseLayer
	SrcPort, DstPort UDPPort
	Length           uint16
	Checksum         uint16
	// contains filtered or unexported fields
}

UDP is the layer for UDP headers.

func (*UDP) CanDecode

func (u *UDP) CanDecode() gopacket.LayerClass

func (*UDP) DecodeFromBytes

func (udp *UDP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*UDP) LayerType

func (u *UDP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeUDP

func (*UDP) NextLayerType

func (u *UDP) NextLayerType() gopacket.LayerType

NextLayerType use the destination port to select the right next decoder. It tries first to decode via the destination port, then the source port.

func (*UDP) SerializeTo

func (u *UDP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

func (*UDP) SetInternalPortsForTesting

func (u *UDP) SetInternalPortsForTesting()

For testing only

func (*UDP) SetNetworkLayerForChecksum

func (i *UDP) SetNetworkLayerForChecksum(l gopacket.NetworkLayer) error

SetNetworkLayerForChecksum tells this layer which network layer is wrapping it. This is needed for computing the checksum when serializing, since TCP/IP transport layer checksums depends on fields in the IPv4 or IPv6 layer that contains it. The passed in layer must be an *IPv4 or *IPv6.

func (*UDP) TransportFlow

func (u *UDP) TransportFlow() gopacket.Flow

type UDPLite

type UDPLite struct {
	BaseLayer
	SrcPort, DstPort UDPLitePort
	ChecksumCoverage uint16
	Checksum         uint16
	// contains filtered or unexported fields
}

UDPLite is the layer for UDP-Lite headers (rfc 3828).

func (*UDPLite) LayerType

func (u *UDPLite) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeUDPLite

func (*UDPLite) TransportFlow

func (u *UDPLite) TransportFlow() gopacket.Flow

type UDPLitePort

type UDPLitePort uint16

UDPLitePort is a port in a UDPLite layer.

func (UDPLitePort) String

func (a UDPLitePort) String() string

String returns the port as "number(name)" if there's a well-known port name, or just "number" if there isn't. Well-known names are stored in UDPLitePortNames.

type UDPPort

type UDPPort uint16

UDPPort is a port in a UDP layer.

func (UDPPort) LayerType

func (a UDPPort) LayerType() gopacket.LayerType

LayerType returns a LayerType that would be able to decode the application payload. It uses some well-known ports such as 53 for DNS.

Returns gopacket.LayerTypePayload for unknown/unsupported port numbers.

func (UDPPort) String

func (a UDPPort) String() string

String returns the port as "number(name)" if there's a well-known port name, or just "number" if there isn't. Well-known names are stored in UDPPortNames.

type USB

type USB struct {
	BaseLayer
	ID             uint64
	EventType      USBEventType
	TransferType   USBTransportType
	Direction      USBDirectionType
	EndpointNumber uint8
	DeviceAddress  uint8
	BusID          uint16
	TimestampSec   int64
	TimestampUsec  int32
	Setup          bool
	Data           bool
	Status         int32
	UrbLength      uint32
	UrbDataLength  uint32

	UrbInterval            uint32
	UrbStartFrame          uint32
	UrbCopyOfTransferFlags uint32
	IsoNumDesc             uint32
}

The reference at http://www.beyondlogic.org/usbnutshell/usb1.shtml contains more information about the protocol.

func (*USB) DecodeFromBytes

func (m *USB) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*USB) LayerType

func (u *USB) LayerType() gopacket.LayerType

func (*USB) NextLayerType

func (m *USB) NextLayerType() gopacket.LayerType

type USBBulk

type USBBulk struct {
	BaseLayer
}

func (*USBBulk) DecodeFromBytes

func (m *USBBulk) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*USBBulk) LayerType

func (u *USBBulk) LayerType() gopacket.LayerType

func (*USBBulk) NextLayerType

func (m *USBBulk) NextLayerType() gopacket.LayerType

type USBControl

type USBControl struct {
	BaseLayer
}

func (*USBControl) DecodeFromBytes

func (m *USBControl) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*USBControl) LayerType

func (u *USBControl) LayerType() gopacket.LayerType

func (*USBControl) NextLayerType

func (m *USBControl) NextLayerType() gopacket.LayerType

type USBDirectionType

type USBDirectionType uint8
const (
	USBDirectionTypeUnknown USBDirectionType = iota
	USBDirectionTypeIn
	USBDirectionTypeOut
)

func (USBDirectionType) String

func (a USBDirectionType) String() string

type USBEventType

type USBEventType uint8
const (
	USBEventTypeSubmit   USBEventType = 'S'
	USBEventTypeComplete USBEventType = 'C'
	USBEventTypeError    USBEventType = 'E'
)

func (USBEventType) String

func (a USBEventType) String() string

type USBInterrupt

type USBInterrupt struct {
	BaseLayer
}

func (*USBInterrupt) DecodeFromBytes

func (m *USBInterrupt) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*USBInterrupt) LayerType

func (u *USBInterrupt) LayerType() gopacket.LayerType

func (*USBInterrupt) NextLayerType

func (m *USBInterrupt) NextLayerType() gopacket.LayerType

type USBRequestBlockSetup

type USBRequestBlockSetup struct {
	BaseLayer
	RequestType uint8
	Request     USBRequestBlockSetupRequest
	Value       uint16
	Index       uint16
	Length      uint16
}

func (*USBRequestBlockSetup) DecodeFromBytes

func (m *USBRequestBlockSetup) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*USBRequestBlockSetup) LayerType

func (u *USBRequestBlockSetup) LayerType() gopacket.LayerType

func (*USBRequestBlockSetup) NextLayerType

func (m *USBRequestBlockSetup) NextLayerType() gopacket.LayerType

type USBRequestBlockSetupRequest

type USBRequestBlockSetupRequest uint8
const (
	USBRequestBlockSetupRequestGetStatus        USBRequestBlockSetupRequest = 0x00
	USBRequestBlockSetupRequestClearFeature     USBRequestBlockSetupRequest = 0x01
	USBRequestBlockSetupRequestSetFeature       USBRequestBlockSetupRequest = 0x03
	USBRequestBlockSetupRequestSetAddress       USBRequestBlockSetupRequest = 0x05
	USBRequestBlockSetupRequestGetDescriptor    USBRequestBlockSetupRequest = 0x06
	USBRequestBlockSetupRequestSetDescriptor    USBRequestBlockSetupRequest = 0x07
	USBRequestBlockSetupRequestGetConfiguration USBRequestBlockSetupRequest = 0x08
	USBRequestBlockSetupRequestSetConfiguration USBRequestBlockSetupRequest = 0x09
	USBRequestBlockSetupRequestSetIdle          USBRequestBlockSetupRequest = 0x0a
)

func (USBRequestBlockSetupRequest) String

type USBTransportType

type USBTransportType uint8
const (
	USBTransportTypeTransferIn  USBTransportType = 0x80 // Indicates send or receive
	USBTransportTypeIsochronous USBTransportType = 0x00 // Isochronous transfers occur continuously and periodically. They typically contain time sensitive information, such as an audio or video stream.
	USBTransportTypeInterrupt   USBTransportType = 0x01 // Interrupt transfers are typically non-periodic, small device "initiated" communication requiring bounded latency, such as pointing devices or keyboards.
	USBTransportTypeControl     USBTransportType = 0x02 // Control transfers are typically used for command and status operations.
	USBTransportTypeBulk        USBTransportType = 0x03 // Bulk transfers can be used for large bursty data, using all remaining available bandwidth, no guarantees on bandwidth or latency, such as file transfers.
)

func (USBTransportType) Decode

func (a USBTransportType) Decode(data []byte, p gopacket.PacketBuilder) error

Decoder calls USBTransportTypeMetadata.DecodeWith's decoder.

func (USBTransportType) LayerType

func (a USBTransportType) LayerType() gopacket.LayerType

LayerType returns USBTransportTypeMetadata.LayerType.

func (USBTransportType) String

func (a USBTransportType) String() string

String returns USBTransportTypeMetadata.Name.

type VLANName

type VLANName struct {
	ID   uint16
	Name string
}

type VRRPv2

type VRRPv2 struct {
	BaseLayer
	Version      uint8          // The version field specifies the VRRP protocol version of this packet (v2)
	Type         VRRPv2Type     // The type field specifies the type of this VRRP packet.  The only type defined in v2 is ADVERTISEMENT
	VirtualRtrID uint8          // identifies the virtual router this packet is reporting status for
	Priority     uint8          // specifies the sending VRRP router's priority for the virtual router (100 = default)
	CountIPAddr  uint8          // The number of IP addresses contained in this VRRP advertisement.
	AuthType     VRRPv2AuthType // identifies the authentication method being utilized
	AdverInt     uint8          // The Advertisement interval indicates the time interval (in seconds) between ADVERTISEMENTS.  The default is 1 second
	Checksum     uint16         // used to detect data corruption in the VRRP message.
	IPAddress    []net.IP       // one or more IP addresses associated with the virtual router. Specified in the CountIPAddr field.
}

VRRPv2 represents an VRRP v2 message.

func (*VRRPv2) CanDecode

func (v *VRRPv2) CanDecode() gopacket.LayerClass

CanDecode specifies the layer type in which we are attempting to unwrap.

func (*VRRPv2) DecodeFromBytes

func (v *VRRPv2) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

func (*VRRPv2) LayerType

func (v *VRRPv2) LayerType() gopacket.LayerType

LayerType returns LayerTypeVRRP for VRRP v2 message.

func (*VRRPv2) NextLayerType

func (v *VRRPv2) NextLayerType() gopacket.LayerType

NextLayerType specifies the next layer that should be decoded. VRRP does not contain any further payload, so we set to 0

func (*VRRPv2) Payload

func (v *VRRPv2) Payload() []byte

The VRRP packet does not include payload data. Setting byte slice to nil

type VRRPv2AuthType

type VRRPv2AuthType uint8
const (
	VRRPv2AuthNoAuth    VRRPv2AuthType = 0x00 // No Authentication
	VRRPv2AuthReserved1 VRRPv2AuthType = 0x01 // Reserved field 1
	VRRPv2AuthReserved2 VRRPv2AuthType = 0x02 // Reserved field 2
)

func (VRRPv2AuthType) String

func (v VRRPv2AuthType) String() string

type VRRPv2Type

type VRRPv2Type uint8
const (
	VRRPv2Advertisement VRRPv2Type = 0x01 // router advertisement
)

func (VRRPv2Type) String

func (v VRRPv2Type) String() string

String conversions for VRRP message types

type VXLAN

type VXLAN struct {
	BaseLayer
	ValidIDFlag      bool   // 'I' bit per RFC 7348
	VNI              uint32 // 'VXLAN Network Identifier' 24 bits per RFC 7348
	GBPExtension     bool   // 'G' bit per Group Policy https://tools.ietf.org/html/draft-smith-vxlan-group-policy-00
	GBPDontLearn     bool   // 'D' bit per Group Policy
	GBPApplied       bool   // 'A' bit per Group Policy
	GBPGroupPolicyID uint16 // 'Group Policy ID' 16 bits per Group Policy
}

VXLAN is a VXLAN packet header

func (*VXLAN) CanDecode

func (vx *VXLAN) CanDecode() gopacket.LayerClass

CanDecode returns the layer type this DecodingLayer can decode

func (*VXLAN) DecodeFromBytes

func (vx *VXLAN) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes takes a byte buffer and decodes

func (*VXLAN) LayerType

func (vx *VXLAN) LayerType() gopacket.LayerType

LayerType returns LayerTypeVXLAN

func (*VXLAN) NextLayerType

func (vx *VXLAN) NextLayerType() gopacket.LayerType

NextLayerType retuns the next layer we should see after vxlan

func (*VXLAN) SerializeTo

func (vx *VXLAN) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

SerializeTo writes the serialized form of this layer into the SerializationBuffer, implementing gopacket.SerializableLayer. See the docs for gopacket.SerializableLayer for more info.

Notes

Bugs

  • When decoding SNAP, we treat the SNAP type as an Ethernet type. This may not actually be an ethernet type in all cases, depending on the organizational code. Right now, we don't check.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL