layers

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: BSD-3-Clause Imports: 20 Imported by: 147 modules, 171 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Copyright 2025 Google, Inc. All rights reserved.

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file in the root of the source tree. Copyright 2025 The GoPacket Authors. All rights reserved.

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file in the root of the source tree.

Copyright 2025 Google, Inc. All rights reserved.

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file in the root of the source tree. Copyright 2025 The GoPacket Authors. All rights reserved.

Use of this source code is governed by a BSD-style license that can be found in the LICENSE file in the root of the source tree.

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/gopacket/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 (
	// BACnetSegmentDefaultMaxSize caps one reassembled APDU, in octets.
	BACnetSegmentDefaultMaxSize = 1 << 20
	// BACnetSegmentDefaultMaxPending caps the messages in reassembly.
	BACnetSegmentDefaultMaxPending = 64
)

Limits of a BACnetSegmentAssembler left at its zero value.

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 (
	// DNP3MaxFragment is the largest application fragment devices are
	// required to accept (IEEE 1815-2012 clause 4.2.2.5).
	DNP3MaxFragment = 2048
	// DNP3MaxStreams is the default number of streams tracked at once.
	DNP3MaxStreams = 256
	// DNP3MaxMessage is the default number of fragments kept of one
	// application message.
	DNP3MaxMessage = 16
)

Default limits of a DNP3Assembler.

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 (

	// TCPPortENIP is the TCP port used to transport EtherNet/IP packets
	TCPPortENIP uint16 = 44818
	// UDPPortENIP is the UDP port used to transport EtherNet/IP packets
	UDPPortENIP uint16 = 2222
)
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 (
	// EtherCATAssemblerMaxBytes is the default cap of one transfer.
	EtherCATAssemblerMaxBytes = 1 << 20

	// EtherCATAssemblerMaxOpen is the default cap of open transfers.
	EtherCATAssemblerMaxOpen = 16
)

Assembler limits.

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 (
	MdpTlvType uint8 = iota
	MdpTlvLength
	MdpTlvDeviceInfo
	MdpTlvNetworkInfo
	MdpTlvLongitude
	MdpTlvLatitude
	MdpTlvType6
	MdpTlvType7
	MdpTlvIP          = 11
	MdpTlvUnknownBool = 13
	MdpTlvEnd         = 255
)
View Source
const (
	MBAPHeaderLen      int    = 7
	MinModbusPacketLen int    = MBAPHeaderLen + 1
	ModbusPort         uint16 = 502
)
View Source
const (
	MPTCPSubtypeMPCAPABLE   = 0x0
	MPTCPSubtypeMPJOIN      = 0x1
	MPTCPSubtypeDSS         = 0x2
	MPTCPSubtypeADDADDR     = 0x3
	MPTCPSubtypeREMOVEADDR  = 0x4
	MPTCPSubtypeMPPRIO      = 0x5
	MPTCPSubtypeMPFAIL      = 0x6
	MPTCPSubtypeMPFASTCLOSE = 0x7
	MPTCPSubtypeMPTCPRST    = 0x8
)

MPTCP Subtypes constonts from https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xml#mptcp-option-subtypes

View Source
const (
	MptcpVersion0 = 0
	MptcpVersion1 = 1
)
View Source
const (
	OptionLenMpCapableSyn         = 4
	OptionLenMpCapableSynAck      = 12
	OptionLenMpCapableAck         = 20
	OptionLenMpCapableAckData     = 22
	OptionLenMpCapableAckDataCSum = 24
	OptionLenMpJoinSyn            = 12
	OptionLenMpJoinSynAck         = 16
	OptionLenMpJoinAck            = 24
	OptionLenDssAck               = 4
	OptionLenDssAck64             = 8
	OptionLenDssDSN               = 4
	OptionLenDssDSN64             = 8
	OptionLenDssSSN               = 4
	OptionLenDssDataLen           = 2
	OptionLenDssCSum              = 2
	OptionLenAddAddrv4            = 8
	OptionLenAddAddrv6            = 20
	OptionLenAddAddrPort          = 2
	OptionLenAddAddrHmac          = 8
	OptionLenRemAddr              = 4
	OptionLenMpPrio               = 3
	OptionLenMpPrioAddr           = 4
	OptionLenMpFail               = 12
	OptionLenMpFClose             = 12
	OptionLenMpTcpRst             = 4
)
View Source
const (
	// OPCUADefaultMaxMessageSize is the joined body size an
	// OPCUAChunkAssembler accepts when MaxMessageSize is 0.
	OPCUADefaultMaxMessageSize = 4 << 20
	// OPCUADefaultMaxPending is the count of unfinished messages an
	// OPCUAChunkAssembler keeps when MaxPending is 0.
	OPCUADefaultMaxPending = 8
)

Chunk reassembly limits.

View Source
const (
	OPCUASecurityPolicyBasic128Rsa15   = "http://opcfoundation.org/UA/SecurityPolicy#Basic128Rsa15"
	OPCUASecurityPolicyBasic256        = "http://opcfoundation.org/UA/SecurityPolicy#Basic256"
	OPCUASecurityPolicyBasic256Sha256  = "http://opcfoundation.org/UA/SecurityPolicy#Basic256Sha256"
	OPCUASecurityPolicyAes128Sha256Oae = "http://opcfoundation.org/UA/SecurityPolicy#Aes128_Sha256_RsaOaep"
	OPCUASecurityPolicyAes256Sha256Pss = "http://opcfoundation.org/UA/SecurityPolicy#Aes256_Sha256_RsaPss"
	OPCUASecurityPolicyECCNistP256     = "http://opcfoundation.org/UA/SecurityPolicy#ECC_nistP256"
	OPCUASecurityPolicyECCNistP384     = "http://opcfoundation.org/UA/SecurityPolicy#ECC_nistP384"
	OPCUASecurityPolicyECCBrainpool256 = "http://opcfoundation.org/UA/SecurityPolicy#ECC_brainpoolP256r1"
	OPCUASecurityPolicyECCBrainpool384 = "http://opcfoundation.org/UA/SecurityPolicy#ECC_brainpoolP384r1"
	OPCUASecurityPolicyECCCurve25519   = "http://opcfoundation.org/UA/SecurityPolicy#ECC_curve25519"
	OPCUASecurityPolicyECCCurve448     = "http://opcfoundation.org/UA/SecurityPolicy#ECC_curve448"
)

Security policy URIs of OPC 10000-7, beside OPCUASecurityPolicyNone.

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 (
	PKTRecNone   = 0
	PKTRecPacket = 1
)

pktap v1 record types

View Source
const (
	PTHFlagDirIn  = 0x00000001
	PTHFlagDirOut = 0x00000002
)

pktap v1 direction flags (lower 2 bits of pkt_flags)

View Source
const (
	PrismType1MessageCode uint16 = 0x00000044
	PrismType2MessageCode uint16 = 0x00000041
)
View Source
const (
	ProfinetRPCFlagLastFragment uint8 = 0x02
	ProfinetRPCFlagFragment     uint8 = 0x04
	ProfinetRPCFlagNoFack       uint8 = 0x08
	ProfinetRPCFlagMaybe        uint8 = 0x10
	ProfinetRPCFlagIdempotent   uint8 = 0x20
	ProfinetRPCFlagBroadcast    uint8 = 0x40
)

DCE/RPC Flags1 bits.

View Source
const (
	// UDPPortPTPEvent carries timestamped PTP event messages.
	UDPPortPTPEvent uint16 = 319
	// UDPPortPTPGeneral carries PTP general messages.
	UDPPortPTPGeneral uint16 = 320
	// EthernetTypePTP carries PTP directly over Ethernet (IEEE 1588 Annex F).
	EthernetTypePTP EthernetType = 0x88F7
)

PTP transports.

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
	SCTPPayloadDiameter                       = 46
)

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
	TCPOptionKindMultipathTCP                    = 30
)

TCP Option Kind constonts from https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xml#tcp-parameters-1

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 (
	TLSHandshakeHelloRequest        = 0
	TLSHandshakeClientHello         = 1
	TLSHandshakeServerHello         = 2
	TLSHandsharkHelloVerirfyRequest = 3
	TLSHandshakeCertificate         = 11
	TLSHandshakeServerKeyExchange   = 12
	TLSHandshakeCertificateRequest  = 13
	TLSHandshakeServerHelloDone     = 14
	TLSHandshakeCertificateVerify   = 15
	TLSHandshakeClientKeyExchange   = 16
	TLSHandshakeFinished            = 20
)

refer to https://datatracker.ietf.org/doc/html/rfc5246#appendix-A.4

View Source
const (
	// TCPPortTPKT is the TCP port RFC 1006 assigns to ISO transport.
	TCPPortTPKT uint16 = 102

	// TPKTVersion is the only TPKT version RFC 1006 defines.
	TPKTVersion uint8 = 3
)
View Source
const (
	// ASFRMCPEnterprise is the IANA-assigned Enterprise Number of the ASF-RMCP.
	ASFRMCPEnterprise uint32 = 4542
)
View Source
const ApspLen = 40

ApspLen is the sum of the header fields above, by length

View Source
const BACnetNoArrayIndex uint32 = math.MaxUint32

BACnetNoArrayIndex is the ArrayIndex of a property reference that names the whole property rather than one array element.

View Source
const BACnetUnspecified uint8 = 0xFF

BACnetUnspecified marks an unspecified ("any") Date or Time field.

View Source
const COTPDefaultMaxTSDU = 1 << 20

COTPDefaultMaxTSDU is the TSDU size cap of a COTPAssembler whose MaxSize is zero: 1 MiB, far above what MMS negotiates.

View Source
const DNP3Port uint16 = 20000

DNP3Port is the IANA port for DNP3 over TCP and UDP.

View Source
const EtherCATMailboxErrCommand uint16 = 0x0001

EtherCATMailboxErrCommand is the only error reply type defined.

View Source
const (
	// IPv6HopByHopOptionJumbogram code as defined in RFC 2675
	IPv6HopByHopOptionJumbogram = 0xC2
)
View Source
const ModbusMaxTransactions = 1024

ModbusMaxTransactions is the default number of requests a ModbusTransactions keeps waiting for their response.

View Source
const OPCUASecurityPolicyNone = "http://opcfoundation.org/UA/SecurityPolicy#None"

OPCUASecurityPolicyNone is the URI of the policy without security, the one policy whose OpenSecureChannel body is plaintext.

View Source
const PTPSMPTELeapChange = 0x01

PTPSMPTELeapChange is the bit of leapSecondJump that announces a change in the number of leap seconds.

View Source
const S7CommPlusDefaultMaxPDU = 1 << 20

S7CommPlusDefaultMaxPDU is the PDU size cap of an S7CommPlusAssembler whose MaxSize is zero: 1 MiB.

View Source
const S7CommPlusIDSubscriptionRefs = 1048

S7CommPlusIDSubscriptionRefs is the attribute ID of a subscription reference list.

View Source
const (
	// S7CommPlusProtocolID is the first octet of every S7comm-plus frame
	// and of its trailer.
	S7CommPlusProtocolID uint8 = 0x72
)
View Source
const (
	// S7CommProtocolID is the first octet of every S7comm PDU.
	S7CommProtocolID uint8 = 0x32
)
View Source
const S7CommUDDefaultMaxSize = 1 << 20

S7CommUDDefaultMaxSize is the cap on the octets an S7CommUDAssembler holds when its MaxSize is zero: 1 MiB. An S7 PDU carries at most 64 KiB and a list takes a handful of them.

View Source
const TCPPortIEC104 uint16 = 2404

TCPPortIEC104 is the TCP port IEC 60870-5-104 runs on.

View Source
const TCPPortOPCUA uint16 = 4840

TCPPortOPCUA is the IANA registered OPC UA TCP port.

View Source
const UDPPortBACnet uint16 = 47808

UDPPortBACnet is the default BACnet/IP UDP port (0xBAC0).

View Source
const UDPPortOPCUAPubSub uint16 = 4840

UDPPortOPCUAPubSub is the port of UADP over UDP (OPC 10000-14 §7.3.4.2), the number of opc.tcp.

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 (
	// LayerTypeBVLC is the BACnet/IP (IPv4) Virtual Link Control layer. Its
	// decoder also hands a BACnet/IPv6 frame to BVLC6, so one port mapping
	// serves both.
	LayerTypeBVLC = gopacket.RegisterLayerType(175, gopacket.LayerTypeMetadata{Name: "BVLC", Decoder: gopacket.DecodeFunc(decodeBVLC)})
	// LayerTypeBVLC6 is the BACnet/IPv6 Virtual Link Control layer.
	LayerTypeBVLC6 = gopacket.RegisterLayerType(176, gopacket.LayerTypeMetadata{Name: "BVLC6", Decoder: gopacket.DecodeFunc(decodeBVLC6)})
	// LayerTypeBACnetNPDU is the BACnet network layer.
	LayerTypeBACnetNPDU = gopacket.RegisterLayerType(177, gopacket.LayerTypeMetadata{Name: "BACnetNPDU", Decoder: gopacket.DecodeFunc(decodeBACnetNPDU)})
	// LayerTypeBACnetAPDU is the BACnet application layer.
	LayerTypeBACnetAPDU = gopacket.RegisterLayerType(178, gopacket.LayerTypeMetadata{Name: "BACnetAPDU", Decoder: gopacket.DecodeFunc(decodeBACnetAPDU)})
)

BACnet layer types, from the block reserved for BACnet and OPC UA.

View Source
var (
	// ErrBACnetTruncated is returned when a BACnet PDU is shorter than its
	// header or than a length it declares.
	ErrBACnetTruncated = errors.New("BACnet PDU truncated")
	// ErrBVLCType is returned for a BVLC type octet that is not BACnet/IP.
	ErrBVLCType = errors.New("BVLC type is not BACnet/IP")
	// ErrBACnetNPDUVersion is returned for an NPDU version other than 1.
	ErrBACnetNPDUVersion = errors.New("BACnet NPDU version is not 1")
	// ErrBACnetMalformed is returned for a field that breaks the encoding rules.
	ErrBACnetMalformed = errors.New("BACnet PDU malformed")
)

BACnet decoding errors.

View Source
var (
	// ErrCOTPTooShort is returned when data is shorter than the header
	// its length indicator announces.
	ErrCOTPTooShort = errors.New("COTP TPDU truncated")
	// ErrCOTPBadLength is returned when the length indicator cannot hold
	// the fixed part of the TPDU type, or is the reserved value 255.
	ErrCOTPBadLength = errors.New("COTP length indicator invalid for TPDU type")
	// ErrCOTPUnknownType is returned for a TPDU code ISO 8073 does not define.
	ErrCOTPUnknownType = errors.New("COTP unknown TPDU type")
	// ErrCOTPBadParameter is returned when a variable parameter overruns
	// the header.
	ErrCOTPBadParameter = errors.New("COTP parameter overruns header")
)
View Source
var (
	ErrDNP3TooShort     = errors.New("DNP3 frame shorter than its link header")
	ErrDNP3BadStart     = errors.New("DNP3 frame does not start with 0x0564")
	ErrDNP3BadLength    = errors.New("DNP3 link length below minimum")
	ErrDNP3Truncated    = errors.New("DNP3 frame shorter than its link length")
	ErrDNP3AppTooShort  = errors.New("DNP3 application header cut short")
	ErrDNP3ObjTruncated = errors.New("DNP3 object header or data cut short")
	ErrDNP3BadRange     = errors.New("DNP3 object range stop below start")
)

Errors returned by DNP3 decoding.

View Source
var (
	ErrDNP3AsmBadCRC   = errors.New("DNP3 assembler: frame fails its CRC")
	ErrDNP3AsmNoStart  = errors.New("DNP3 assembler: segment without a fragment in progress")
	ErrDNP3AsmSequence = errors.New("DNP3 assembler: transport sequence number out of order")
	ErrDNP3AsmTooLong  = errors.New("DNP3 assembler: fragment exceeds the size limit")
	ErrDNP3AsmMessage  = errors.New("DNP3 assembler: application fragment out of order or past the message limit")
)

Errors returned by DNP3Assembler.Add. Each names why a frame, and the fragment it belonged to, was dropped.

View Source
var (
	ErrDNP3NoValue      = errors.New("DNP3 object carries no value")
	ErrDNP3ValueShort   = errors.New("DNP3 object value cut short")
	ErrDNP3UnknownValue = errors.New("DNP3 object type has no value decoder")
	ErrDNP3BadObject    = errors.New("DNP3 object or header number out of range")
	ErrDNP3NoCTO        = errors.New("DNP3 fragment has no CTO before this header")
	ErrDNP3NoTime       = errors.New("DNP3 object carries no time")
	ErrDNP3AttrType     = errors.New("DNP3 attribute holds another type or width")
	ErrDNP3BadBCD       = errors.New("DNP3 BCD value holds a digit above 9")
)

Errors returned by value accessors.

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: portString})
	EndpointUDPPort  = gopacket.RegisterEndpointType(5, gopacket.EndpointTypeMetadata{Name: "UDP", Formatter: portString})
	EndpointSCTPPort = gopacket.RegisterEndpointType(6, gopacket.EndpointTypeMetadata{Name: "SCTP", Formatter: portString})
	EndpointRUDPPort = gopacket.RegisterEndpointType(7, gopacket.EndpointTypeMetadata{Name: "RUDP", Formatter: func(b []byte) string {
		if len(b) < 1 {
			return ""
		}
		return strconv.Itoa(int(b[0]))
	}})
	EndpointUDPLitePort = gopacket.RegisterEndpointType(8, gopacket.EndpointTypeMetadata{Name: "UDPLite", Formatter: portString})
	EndpointPPP         = gopacket.RegisterEndpointType(9, gopacket.EndpointTypeMetadata{Name: "PPP", Formatter: func([]byte) string {
		return "point"
	}})
)
View Source
var (
	// ErrENIPDataTooSmall is returned if an EtherNet/IP packet is truncated
	ErrENIPDataTooSmall = errors.New("ENIP packet data truncated")
	// ErrENIPUnknownDataFormat is returned if an unknown data format ID is encountered
	ErrENIPUnknownDataFormat = errors.New("ENIP unknown data format ID")
)
View Source
var (
	// ErrEtherCATTooShort is returned when the frame header is truncated.
	ErrEtherCATTooShort = errors.New("EtherCAT frame too short")
	// ErrEtherCATDatagram is returned when a datagram runs past the frame.
	ErrEtherCATDatagram = errors.New("EtherCAT datagram exceeds frame")
)
View Source
var (
	// ErrIEC104TooShort is returned when the data ends before the APDU does.
	ErrIEC104TooShort = errors.New("IEC 104 APDU truncated")
	// ErrIEC104BadStart is returned when an APDU does not open with 0x68.
	ErrIEC104BadStart = errors.New("IEC 104 APDU has no start octet")
	// ErrIEC104BadLength is returned when the APDU length does not fit its
	// frame format.
	ErrIEC104BadLength = errors.New("IEC 104 APDU length invalid")
)
View Source
var (
	// ErrIEC104ASDUTooShort is returned when an I-format frame is too short
	// for a data unit identifier.
	ErrIEC104ASDUTooShort = errors.New("IEC 104 ASDU too short")
	// ErrIEC104ObjectsTooLong is returned when the information objects an
	// ASDU announces do not fit in it.
	ErrIEC104ObjectsTooLong = errors.New("IEC 104 information objects exceed ASDU")
	// ErrIEC104BadSequence is returned when SQ is set on a run of objects
	// whose type has no information elements, such as C_RD_NA_1.
	ErrIEC104BadSequence = errors.New("IEC 104 SQ set on objects without elements")
)
View Source
var (
	// ErrIEC104SecurityTooShort is returned when a secure authentication
	// body ends before its fields do.
	ErrIEC104SecurityTooShort = errors.New("IEC 104 security ASDU truncated")
	// ErrIEC104BadOptions is returned for field sizes IEC 60870-5-101 does
	// not allow.
	ErrIEC104BadOptions = errors.New("IEC 104 ASDU field sizes invalid")
	// ErrIEC104SecurityTooLong is returned when the segments of a body
	// exceed the assembler's limit.
	ErrIEC104SecurityTooLong = errors.New("IEC 104 security ASDU exceeds limit")
	// ErrIEC104SecuritySequence is returned for a segment that does not
	// continue the body being assembled.
	ErrIEC104SecuritySequence = errors.New("IEC 104 security segment out of sequence")
)
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)})
	LayerTypeGTPv2                        = gopacket.RegisterLayerType(1010, gopacket.LayerTypeMetadata{Name: "GTPv2", Decoder: gopacket.DecodeFunc(decodeGTPv2)})
	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)})
	LayerTypeMDP                          = gopacket.RegisterLayerType(147, gopacket.LayerTypeMetadata{Name: "MDP", Decoder: gopacket.DecodeFunc(decodeMDP)})
	LayerTypeAGUEVar0                     = gopacket.RegisterLayerType(148, gopacket.LayerTypeMetadata{Name: "AGUEVar0", Decoder: gopacket.DecodeFunc(decodeAGUE)})
	LayerTypeAGUEVar1                     = gopacket.RegisterLayerType(149, gopacket.LayerTypeMetadata{Name: "AGUEVar1", Decoder: gopacket.DecodeFunc(decodeAGUE)})
	LayerTypeAPSP                         = gopacket.RegisterLayerType(150, gopacket.LayerTypeMetadata{Name: "APSP", Decoder: gopacket.DecodeFunc(decodeAPSP)})
	LayerTypeENIP                         = gopacket.RegisterLayerType(151, gopacket.LayerTypeMetadata{Name: "ENIP", Decoder: gopacket.DecodeFunc(decodeENIP)})
	LayerTypeCIP                          = gopacket.RegisterLayerType(152, gopacket.LayerTypeMetadata{Name: "CIP", Decoder: gopacket.DecodeFunc(decodeCIP)})
	LayerTypeModbus                       = gopacket.RegisterLayerType(153, gopacket.LayerTypeMetadata{Name: "Modbus", Decoder: gopacket.DecodeFunc(decodeModbus)})
	LayerTypeDiameter                     = gopacket.RegisterLayerType(154, gopacket.LayerTypeMetadata{Name: "Diameter", Decoder: gopacket.DecodeFunc(decodeDiameter)})
	LayerTypeLinuxSLL2                    = gopacket.RegisterLayerType(276, gopacket.LayerTypeMetadata{Name: "Linux SLL2", Decoder: gopacket.DecodeFunc(decodeLinuxSLL2)})
	LayerTypePktap                        = gopacket.RegisterLayerType(300, gopacket.LayerTypeMetadata{Name: "ApplePktap", Decoder: gopacket.DecodeFunc(decodePktapV1)})
)
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 (
	ErrModbusDataTooSmall    = errors.New("data too small for Modbus")
	ErrModbusInvalidProtocol = errors.New("invalid Modbus protocol ID (expected 0)")
)
View Source
var (
	ErrModbusPDUTooShort  = errors.New("modbus PDU has no function code")
	ErrModbusPDULength    = errors.New("modbus PDU length does not fit its function")
	ErrModbusPDUByteCount = errors.New("modbus PDU byte count does not match its data")
	ErrModbusPDUQuantity  = errors.New("modbus PDU quantity out of range")
	ErrModbusPDUValue     = errors.New("modbus PDU field value not allowed")
	ErrModbusPDUTrailing  = errors.New("modbus PDU has bytes past its function data")
)

Errors returned by Modbus PDU decoding. Each is wrapped with detail, so test for them with errors.Is.

View Source
var (
	ErrModbusDevIDDone  = errors.New("modbus device identification already complete")
	ErrModbusDevIDOrder = errors.New("modbus device identification response out of order")
)

Errors returned by ModbusDeviceInfo.Add.

View Source
var (
	// ErrOPCUATruncated is returned when a message is shorter than its
	// header or than the size it declares.
	ErrOPCUATruncated = errors.New("OPC UA message truncated")
	// ErrOPCUAMalformed is returned for an unknown message type, a field
	// that overruns its message, or a length that breaks the encoding rules.
	ErrOPCUAMalformed = errors.New("OPC UA message malformed")
)

OPC UA decoding errors.

View Source
var (
	// ErrOPCUAMessageTooLarge is returned for a chunk that takes its
	// message past the size limit of the assembler.
	ErrOPCUAMessageTooLarge = errors.New("OPC UA chunked message too large")
	// ErrOPCUAChunkLost is returned for the final chunk of a message that
	// lost a chunk, by the sequence numbers.
	ErrOPCUAChunkLost = errors.New("OPC UA chunk lost")
)

Chunk reassembly errors.

View Source
var (
	// ErrOTStreamBadHeader is returned by a stream splitter when the
	// next PDU header is invalid and the protocol has no start octets to
	// resynchronise on. The stream cannot be split any further.
	ErrOTStreamBadHeader = errors.New("OT stream: invalid PDU header")
	// ErrOTStreamTooLong is returned by a stream splitter when a PDU
	// claims a length above its protocol maximum.
	ErrOTStreamTooLong = errors.New("OT stream: PDU above protocol maximum")
	// ErrOTStreamTruncated is returned by a stream splitter at EOF when
	// the stream ends inside a PDU.
	ErrOTStreamTruncated = errors.New("OT stream: ends inside a PDU")
)
View Source
var (
	// LayerTypeProfinet is the PROFINET real-time (PN-RT) frame layer.
	LayerTypeProfinet = gopacket.RegisterLayerType(185, gopacket.LayerTypeMetadata{Name: "Profinet", Decoder: gopacket.DecodeFunc(decodeProfinet)})
	// LayerTypeProfinetDCP is the PROFINET Discovery and basic Configuration Protocol layer.
	LayerTypeProfinetDCP = gopacket.RegisterLayerType(186, gopacket.LayerTypeMetadata{Name: "ProfinetDCP", Decoder: gopacket.DecodeFunc(decodeProfinetDCP)})
	// LayerTypeProfinetAlarm is the PROFINET IO alarm (RTA) layer.
	LayerTypeProfinetAlarm = gopacket.RegisterLayerType(187, gopacket.LayerTypeMetadata{Name: "ProfinetAlarm", Decoder: gopacket.DecodeFunc(decodeProfinetAlarm)})
	// LayerTypeProfinetPTCP is the PROFINET Precision Transparent Clock Protocol layer.
	LayerTypeProfinetPTCP = gopacket.RegisterLayerType(188, gopacket.LayerTypeMetadata{Name: "ProfinetPTCP", Decoder: gopacket.DecodeFunc(decodeProfinetPTCP)})
	// LayerTypeProfinetIORPC is the PROFINET IO connection management layer (DCE/RPC over UDP).
	LayerTypeProfinetIORPC = gopacket.RegisterLayerType(190, gopacket.LayerTypeMetadata{Name: "ProfinetIORPC", Decoder: gopacket.DecodeFunc(decodeProfinetIORPC)})
)

PROFINET layer types, registered in the 185-194 block.

View Source
var (
	// ErrProfinetBlockTooShort is returned when a block header is truncated.
	ErrProfinetBlockTooShort = errors.New("PROFINET block header too short")
	// ErrProfinetBlockLength is returned when BlockLength does not cover
	// the version bytes.
	ErrProfinetBlockLength = errors.New("PROFINET block length below 2")
)
View Source
var (
	// ErrProfinetDCPTooShort is returned when a DCP header is truncated.
	ErrProfinetDCPTooShort = errors.New("PROFINET DCP header too short")
	// ErrProfinetDCPBlock is returned when a DCP block runs past the DCP data.
	ErrProfinetDCPBlock = errors.New("PROFINET DCP block exceeds DCP data length")
)
View Source
var (
	// ErrProfinetFragOrder is returned when a fragment does not continue
	// the reassembly in progress; that reassembly is dropped.
	ErrProfinetFragOrder = errors.New("PROFINET fragment out of order")
	// ErrProfinetFragTooBig is returned when a reassembly would exceed the
	// assembler's size cap; it is dropped.
	ErrProfinetFragTooBig = errors.New("PROFINET reassembly exceeds size cap")
	// ErrProfinetFragShort is returned when a fragment holds fewer bytes
	// than its FragDataLength says.
	ErrProfinetFragShort = errors.New("PROFINET fragment shorter than FragDataLength")
	// ErrProfinetNotFragment is returned when a frame handed to the
	// assembler is not a fragment.
	ErrProfinetNotFragment = errors.New("not a PROFINET fragment")
)
View Source
var (
	// ErrProfinetPTCPTooShort is returned when a PTCP header is truncated.
	ErrProfinetPTCPTooShort = errors.New("PROFINET PTCP header too short")
	// ErrProfinetPTCPTLV is returned when a PTCP TLV runs past the data.
	ErrProfinetPTCPTLV = errors.New("PROFINET PTCP TLV exceeds data")
)
View Source
var (
	// ErrProfinetRPCTooShort is returned when the DCE/RPC header is
	// truncated.
	ErrProfinetRPCTooShort = errors.New("PROFINET IO RPC header too short")
	// ErrProfinetRPCVersion is returned when the data is not a
	// connectionless DCE/RPC version 4 PDU.
	ErrProfinetRPCVersion = errors.New("PROFINET IO RPC: not DCE/RPC version 4")
)
View Source
var (
	// ErrPTPTooShort is returned when the data ends before the message does.
	ErrPTPTooShort = errors.New("PTP message truncated")
	// ErrPTPVersion is returned for a message that is not PTP version 2.
	ErrPTPVersion = errors.New("PTP version not 2")
	// ErrPTPBadLength is returned when messageLength is too small for the
	// message type.
	ErrPTPBadLength = errors.New("PTP messageLength too small")
	// ErrPTPBadTLV is returned when a TLV runs past the message.
	ErrPTPBadTLV = errors.New("PTP TLV exceeds message")
)
View Source
var (
	// ErrS7CommTooShort is returned when data is shorter than the S7comm
	// header or than the parameter and data lengths it announces.
	ErrS7CommTooShort = errors.New("S7comm PDU truncated")
	// ErrS7CommBadProtocol is returned when the first octet is not 0x32.
	ErrS7CommBadProtocol = errors.New("S7comm protocol ID is not 0x32")
	// ErrS7CommUnknownROSCTR is returned for a message type S7comm does
	// not define.
	ErrS7CommUnknownROSCTR = errors.New("S7comm unknown ROSCTR")
	// ErrS7CommMalformed is returned when parameter or data content
	// overruns its part or disagrees with its own counts.
	ErrS7CommMalformed = errors.New("S7comm malformed PDU")
)
View Source
var (
	// ErrS7CommPlusTooShort is returned when data is shorter than the
	// frame header or than the data length it announces.
	ErrS7CommPlusTooShort = errors.New("S7comm-plus frame truncated")
	// ErrS7CommPlusBadProtocol is returned when the first octet is not
	// 0x72.
	ErrS7CommPlusBadProtocol = errors.New("S7comm-plus protocol ID is not 0x72")
	// ErrS7CommPlusMalformed is returned when the integrity part
	// overruns the frame.
	ErrS7CommPlusMalformed = errors.New("S7comm-plus malformed frame")
	// ErrVLQTruncated is returned when a VLQ integer runs past its data.
	ErrVLQTruncated = errors.New("S7comm-plus VLQ truncated")
	// ErrVLQTooLong is returned when a 32-bit VLQ integer has more than
	// five octets.
	ErrVLQTooLong = errors.New("S7comm-plus VLQ too long")
)
View Source
var (
	// ErrS7CommPlusPDUTooLong is returned by S7CommPlusAssembler.Feed
	// when the frames of a PDU exceed the assembler's size cap.
	ErrS7CommPlusPDUTooLong = errors.New("S7comm-plus PDU above the assembler size cap")

	// ErrS7CommPlusNoStart is returned by S7CommPlusAssembler.Feed for a
	// frame that continues a PDU whose first frame was not fed.
	ErrS7CommPlusNoStart = errors.New("S7comm-plus fragment without a first frame")
)
View Source
var (
	// ErrS7CommPlusFragment is returned by DecodeBody for a frame that is
	// not a whole PDU: a fragment, a frame cut before its trailer, or a
	// keep-alive.
	ErrS7CommPlusFragment = errors.New("S7comm-plus frame is not a whole PDU")
	// ErrS7CommPlusUnsupported is returned for opcodes and functions
	// whose body layout is unknown: AddLink, RemoveLink,
	// GetVariablesAddress and Abort. No public capture or dissector
	// describes them, so their octets stay raw in Rest.
	ErrS7CommPlusUnsupported = errors.New("S7comm-plus body layout unknown")
)
View Source
var (
	// ErrS7CommPlusTooDeep is returned when structs, blobs or objects
	// nest deeper than the decoder follows.
	ErrS7CommPlusTooDeep = errors.New("S7comm-plus data nested too deep")
	// ErrS7CommPlusUnknownType is returned for a datatype, blob type or
	// notification item code whose layout is unknown: what follows it
	// cannot be located.
	ErrS7CommPlusUnknownType = errors.New("S7comm-plus unknown value type")
)
View Source
var (
	// ErrTPKTTooShort is returned when data cannot hold a TPKT header or
	// the frame its length announces.
	ErrTPKTTooShort = errors.New("TPKT frame truncated")
	// ErrTPKTBadVersion is returned when the version octet is not 3.
	ErrTPKTBadVersion = errors.New("TPKT version is not 3")
	// ErrTPKTBadLength is returned when the length field is below the
	// RFC 1006 minimum of 7.
	ErrTPKTBadLength = errors.New("TPKT length below minimum")
)
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 ErrBACnetSegmentsTooLarge = errors.New("BACnet segmented message exceeds the size cap")

ErrBACnetSegmentsTooLarge is returned when a segmented message outgrows the MaxSize of its assembler; the message is dropped.

View Source
var ErrBACnetTag = errors.New("BACnet tag encoding malformed")

ErrBACnetTag is returned for a tag stream that breaks Clause 20.2: a bad length, unbalanced opening and closing tags, or nesting past the limit.

View Source
var (
	// ErrCIPDataTooSmall indicates that a CIP packet has been truncated
	ErrCIPDataTooSmall = errors.New("CIP packet data truncated")
)
View Source
var ErrCOTPTSDUTooLong = errors.New("COTP TSDU above the assembler size cap")

ErrCOTPTSDUTooLong is returned by COTPAssembler.Feed when the segments of a TSDU exceed the assembler's size cap.

View Source
var ErrEtherCATAMSTCP = errors.New("AMS/TCP header truncated")

ErrEtherCATAMSTCP is returned when a segment is too short for an AMS/TCP header.

View Source
var ErrEtherCATMailbox = errors.New("EtherCAT mailbox truncated")

ErrEtherCATMailbox is returned when a mailbox header or its declared length does not fit the data.

View Source
var ErrModbusPDUNoView = errors.New("modbus PDU does not hold what was asked for")

ErrModbusPDUNoView is returned by a view asked of a PDU of another function, direction or MEI type, or of an exception.

View Source
var ErrOPCUAPubSubUnsupported = errors.New("OPC UA PubSub payload not decoded")

ErrOPCUAPubSubUnsupported is the PayloadError of a NetworkMessage whose payload this layer does not decode: one with an ActionHeader, a reserved NetworkMessage type, or an announcement of a type other than endpoints, DataSetMetaData and application information.

View Source
var ErrPTPTLVValue = errors.New("PTP TLV value too short")

ErrPTPTLVValue is returned when a TLV value is shorter than its type needs.

View Source
var ErrPrismExpectedMoreData = errors.New("Expected more data.")
View Source
var ErrPrismInvalidCode = errors.New("Invalid header code.")
View Source
var ErrProfinetAlarmTooShort = errors.New("PROFINET alarm header too short")

ErrProfinetAlarmTooShort is returned when an RTA-PDU header is truncated.

View Source
var ErrProfinetTooShort = errors.New("PROFINET frame too short")

ErrProfinetTooShort is returned when a PROFINET frame is shorter than its fixed header or trailer.

View Source
var ErrS7CommUDTooLong = errors.New("S7comm Userdata above the assembler size cap")

ErrS7CommUDTooLong is returned by S7CommUDAssembler.Feed when the data units it holds would exceed its size cap.

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 LayerTypeACSE = gopacket.RegisterLayerType(197, gopacket.LayerTypeMetadata{Name: "ACSE", Decoder: gopacket.DecodeFunc(decodeACSE)})

LayerTypeACSE is the ISO 8650-1 Association Control Service Element.

View Source
var LayerTypeBACnetMSTP = gopacket.RegisterLayerType(181, gopacket.LayerTypeMetadata{Name: "BACnetMSTP", Decoder: gopacket.DecodeFunc(decodeBACnetMSTP)})

LayerTypeBACnetMSTP is the BACnet MS/TP data link layer.

View Source
var LayerTypeBACnetSC = gopacket.RegisterLayerType(180, gopacket.LayerTypeMetadata{Name: "BACnetSC", Decoder: gopacket.DecodeFunc(decodeBACnetSC)})

LayerTypeBACnetSC is the BACnet/SC Virtual Link Control layer.

View Source
var LayerTypeCOTP = gopacket.RegisterLayerType(161, gopacket.LayerTypeMetadata{Name: "COTP", Decoder: gopacket.DecodeFunc(decodeCOTP)})

LayerTypeCOTP is the layer type of an ISO 8073 transport TPDU.

View Source
var LayerTypeDNP3 = gopacket.RegisterLayerType(155, gopacket.LayerTypeMetadata{Name: "DNP3", Decoder: gopacket.DecodeFunc(decodeDNP3)})

LayerTypeDNP3 is the layer type of a DNP3 link frame.

View Source
var LayerTypeEtherCAT = gopacket.RegisterLayerType(189, gopacket.LayerTypeMetadata{Name: "EtherCAT", Decoder: gopacket.DecodeFunc(decodeEtherCAT)})

LayerTypeEtherCAT is the EtherCAT frame layer.

View Source
var LayerTypeEtherCATAMSTCP = gopacket.RegisterLayerType(192, gopacket.LayerTypeMetadata{Name: "EtherCATAMSTCP", Decoder: gopacket.DecodeFunc(decodeEtherCATAMSTCP)})

LayerTypeEtherCATAMSTCP is the AMS over TCP layer.

View Source
var LayerTypeGOOSE = gopacket.RegisterLayerType(199, gopacket.LayerTypeMetadata{Name: "GOOSE", Decoder: gopacket.DecodeFunc(decodeGOOSE)})

LayerTypeGOOSE is the IEC 61850-8-1 GOOSE layer (EtherType 0x88B8).

View Source
var LayerTypeIEC104 = gopacket.RegisterLayerType(170, gopacket.LayerTypeMetadata{Name: "IEC104", Decoder: gopacket.DecodeFunc(decodeIEC104)})

LayerTypeIEC104 is one IEC 60870-5-104 APDU.

View Source
var LayerTypeISOPresentation = gopacket.RegisterLayerType(196, gopacket.LayerTypeMetadata{Name: "ISOPresentation", Decoder: gopacket.DecodeFunc(decodeISOPresentation)})

LayerTypeISOPresentation is the ISO 8823 connection oriented presentation layer.

View Source
var LayerTypeISOSession = gopacket.RegisterLayerType(195, gopacket.LayerTypeMetadata{Name: "ISOSession", Decoder: gopacket.DecodeFunc(decodeISOSession)})

LayerTypeISOSession is the ISO 8327 session layer carried in COTP data.

View Source
var LayerTypeMMS = gopacket.RegisterLayerType(198, gopacket.LayerTypeMetadata{Name: "MMS", Decoder: gopacket.DecodeFunc(decodeMMS)})

LayerTypeMMS is the ISO 9506 Manufacturing Message Specification layer.

View Source
var LayerTypeOPCUA = gopacket.RegisterLayerType(179, gopacket.LayerTypeMetadata{Name: "OPCUA", Decoder: gopacket.DecodeFunc(decodeOPCUA)})

LayerTypeOPCUA is one OPC UA Binary transport message.

View Source
var LayerTypeOPCUAPubSub = gopacket.RegisterLayerType(191, gopacket.LayerTypeMetadata{Name: "OPCUAPubSub", Decoder: gopacket.DecodeFunc(decodeOPCUAPubSub)})

LayerTypeOPCUAPubSub is one UADP NetworkMessage.

View Source
var LayerTypePTP = gopacket.RegisterLayerType(171, gopacket.LayerTypeMetadata{Name: "PTP", Decoder: gopacket.DecodeFunc(decodePTP)})

LayerTypePTP is a PTPv2 message.

View Source
var LayerTypeS7Comm = gopacket.RegisterLayerType(162, gopacket.LayerTypeMetadata{Name: "S7comm", Decoder: gopacket.DecodeFunc(decodeS7Comm)})

LayerTypeS7Comm is the layer type of a Siemens S7comm PDU.

View Source
var LayerTypeS7CommPlus = gopacket.RegisterLayerType(163, gopacket.LayerTypeMetadata{Name: "S7comm-plus", Decoder: gopacket.DecodeFunc(decodeS7CommPlus)})

LayerTypeS7CommPlus is the layer type of a Siemens S7comm-plus frame.

View Source
var LayerTypeSV = gopacket.RegisterLayerType(200, gopacket.LayerTypeMetadata{Name: "SV", Decoder: gopacket.DecodeFunc(decodeSV)})

LayerTypeSV is the IEC 61850-9-2 Sampled Values layer (EtherType 0x88BA).

View Source
var LayerTypeTPKT = gopacket.RegisterLayerType(160, gopacket.LayerTypeMetadata{Name: "TPKT", Decoder: gopacket.DecodeFunc(decodeTPKT)})

LayerTypeTPKT is the layer type of an RFC 1006 TPKT frame.

View Source
var LinkTypeMetadata [277]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 UDPLitePortNames = map[UDPLitePort]string{}

UDPLitePortNames contains the string names for all UDPLite ports.

View Source
var USBTransportTypeMetadata [256]EnumMetadata

Functions

func DNP3CRC

func DNP3CRC(b []byte) uint16

DNP3CRC returns the CRC-16/DNP of b as it is carried on the wire (sent little endian). For example DNP3CRC([]byte("123456789")) is 0xEA82.

func DNP3Time

func DNP3Time(b []byte) time.Time

DNP3Time converts the absolute time at the start of b, as carried by g50v1, g51 or g2v2 after its flags octet, to a time.Time. It returns the zero Time when b is shorter than 6 bytes.

func ESCDCTime

func ESCDCTime(ns uint64) time.Time

ESCDCTime converts a 64-bit distributed clock time to wall time. Times too far out for time.Duration (after the year 2292) saturate.

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 GetVendorName added in v1.6.0

func GetVendorName(vendorID uint32) string

GetVendorName returns the vendor name for a vendor ID

func ModbusDirOf

func ModbusDirOf(src, dst TCPPort, pdu []byte) (ModbusDirection, ModbusDirConfidence)

ModbusDirOf tells the direction of a Modbus/TCP PDU: from its ports when exactly one is 502, as ModbusDirFromPorts does, else from the shape of the PDU, as ModbusGuessDir does.

func ModbusGuessDir

func ModbusGuessDir(pdu []byte) (ModbusDirection, ModbusDirConfidence)

ModbusGuessDir guesses the direction of a raw PDU from its shape alone: it is decoded both ways and the way that fits wins. It is a best effort for traffic on other ports than 502. Many PDUs fit both ways, e.g. a write single register and its echo, or five bytes that are a read request and a read response of three data bytes; pairing by transaction, or the side that opened the connection, tells more.

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 OPCUASignatureSize

func OPCUASignatureSize(policyURI string) (int, bool)

OPCUASignatureSize returns the size in bytes of the symmetric signature that ends the chunks of a channel with the given security policy, and whether the policy is one of the standard ones.

func OTStreamDecoder

func OTStreamDecoder(port TCPPort) (split bufio.SplitFunc, layer gopacket.LayerType, ok bool)

OTStreamDecoder returns the splitter and the layer type to decode its tokens with for a TCP port of an OT protocol in this package: 102 (TPKT), 502 (Modbus/TCP), 2404 (IEC 104), 4840 (OPC UA), 20000 (DNP3) and 48898 (AMS/TCP). ok is false for any other port.

func PTPWRDelayPs

func PTPWRDelayPs(scaled uint64) float64

PTPWRDelayPs converts a White Rabbit fixed delay to picoseconds.

func ProfinetDFPHeaderCRC

func ProfinetDFPHeaderCRC(dst, src net.HardwareAddr, id ProfinetFrameID) uint16

ProfinetDFPHeaderCRC computes the header CRC of a DFP frame: a CRC-16 over the destination and source addresses, the PROFINET EtherType and the Frame ID.

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 RegisterOTDecoders

func RegisterOTDecoders()

RegisterOTDecoders maps the well-known ports and EtherTypes of the industrial protocols in this package to their decoders:

TCP 102          TPKT -> COTP -> S7comm / S7comm-plus / ISO session (MMS)
TCP/UDP 20000    DNP3
TCP 2404         IEC 60870-5-104
TCP 4840         OPC UA
UDP 47808        BACnet/IP
UDP 319, 320     PTP
UDP 34980        EtherCAT
EtherType 0x8892 PROFINET
EtherType 0x88A4 EtherCAT
EtherType 0x88B8 IEC 61850 GOOSE
EtherType 0x88BA IEC 61850 Sampled Values
EtherType 0x88F7 PTP

It is opt-in: without it these frames decode as before (Payload, or a decode failure for the EtherTypes), so existing callers, including DecodingLayerParser users, see no change. Call it once at start-up, before decoding. Calling it again is harmless.

The TCP-based decoders work per packet, so a PDU split across segments only decodes after stream reassembly (see the reassembly package); pass the reassembled bytes to gopacket.NewPacket with the protocol's layer type.

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 RegisterSCTPPortLayerType added in v1.6.0

func RegisterSCTPPortLayerType(port SCTPPort, layerType gopacket.LayerType)

RegisterSCTPPortLayerType creates a new mapping between a SCTPPort and an underlying LayerType.

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.

func S7CommPlusVarInt32

func S7CommPlusVarInt32(b []byte) (int32, int, error)

S7CommPlusVarInt32 reads a signed VLQ integer of at most five octets. Bit 6 of the first octet is the sign.

func S7CommPlusVarInt64

func S7CommPlusVarInt64(b []byte) (int64, int, error)

S7CommPlusVarInt64 reads a signed VLQ integer of at most nine octets. Bit 6 of the first octet is the sign.

func S7CommPlusVarUint32

func S7CommPlusVarUint32(b []byte) (uint32, int, error)

S7CommPlusVarUint32 reads an unsigned VLQ integer of at most five octets from b and returns it with the octets consumed.

func S7CommPlusVarUint64

func S7CommPlusVarUint64(b []byte) (uint64, int, error)

S7CommPlusVarUint64 reads an unsigned VLQ integer of at most nine octets: eight carry 7 value bits each, a ninth carries a full 8.

func SCTPPortNames

func SCTPPortNames(port SCTPPort) (string, bool)

SCTPPortNames contains the port names for all SCTP ports.

func ScanDNP3

func ScanDNP3(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanDNP3 is a bufio.SplitFunc returning one DNP3 link frame per token, block CRCs included, decodable as LayerTypeDNP3. The 8 bit length field bounds a frame to 292 octets.

It resynchronises rather than fail: octets before the next 0x05 0x64 are skipped, and so is a start whose length is below 5 or whose header CRC does not match, since its length cannot be trusted. Frames with a corrupt header are therefore dropped; user data CRCs are left for the decoder to check.

func ScanEtherCATAMSTCP

func ScanEtherCATAMSTCP(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanEtherCATAMSTCP is a bufio.SplitFunc returning one AMS/TCP packet per token, decodable as LayerTypeEtherCATAMSTCP. AMS/TCP has no start marker to resynchronise on: a length above 16 MiB returns ErrOTStreamTooLong, and a stream that ends inside a packet ErrOTStreamTruncated. Tokens alias the input.

func ScanIEC104

func ScanIEC104(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanIEC104 is a bufio.SplitFunc returning one IEC 60870-5-104 APDU per token, decodable as LayerTypeIEC104. An APDU holds at most 255 octets.

It resynchronises rather than fail: octets before the next 0x68 are skipped, and so is a 0x68 whose length does not fit the frame format (S and U frames are exactly 4 octets long, I frames longer, none above 253). 0x68 also occurs inside ASDUs, so after a gap the first APDUs found may be false.

func ScanIEC104Resync

func ScanIEC104Resync(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanIEC104Resync is a bufio.SplitFunc like ScanIEC104 that drops no octet: garbage before an APDU comes in front of it in the same token,

stream  | garbage | APDU | APDU | garbage ... | APDU |
tokens  |<------ 1 ----->|<- 2 >|<-------- 3 ------->|

and decoding the token as LayerTypeIEC104 gives the APDU with the garbage counted in IEC104.Skipped. It accepts a start octet only for an APDU whose control field is sound, which ScanIEC104 does not check: an I frame with an even N(R) octet, an S frame of 01 00 and N(R), a U frame with one function bit and three zero octets.

Garbage is cut into tokens of 1024 octets when no APDU follows that soon, so a token holds 1279 octets at most. A token without APDU, and what is left at EOF, decodes to an error and whatever damaged APDUs the decoder makes out. It never returns an error itself.

func ScanModbusTCP

func ScanModbusTCP(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanModbusTCP is a bufio.SplitFunc returning one Modbus/TCP ADU per token, decodable as LayerTypeModbus. The MBAP protocol identifier must be 0 and the length at least 2, else ErrOTStreamBadHeader: Modbus has no start marker to resynchronise on. A length above 254 (an ADU above 260 octets) returns ErrOTStreamTooLong.

func ScanOPCUA

func ScanOPCUA(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanOPCUA is a bufio.SplitFunc returning one OPC UA Binary transport message per token, decodable as LayerTypeOPCUA. A message must carry a known type (HEL, ACK, ERR, RHE, OPN, MSG, CLO), a chunk type of F, C or A and a size of at least 8, else ErrOTStreamBadHeader: OPC UA has no start marker to resynchronise on. A size above 16 MiB returns ErrOTStreamTooLong. A bufio.Scanner holds 64 KiB tokens by default; call its Buffer method to accept larger messages.

func ScanTPKT

func ScanTPKT(data []byte, atEOF bool) (advance int, token []byte, err error)

ScanTPKT is a bufio.SplitFunc returning one RFC 1006 TPKT frame per token, decodable as LayerTypeTPKT. The 16 bit length field bounds a frame to 65535 octets. TPKT has no start marker to resynchronise on, so a version other than 3 or a length below 7 returns ErrOTStreamBadHeader.

func SerializeDiameterAVP added in v1.6.0

func SerializeDiameterAVP(avp *DiameterAVP) []byte

SerializeDiameterAVP serializes a Diameter AVP to bytes

func SerializedAVPLength added in v1.6.0

func SerializedAVPLength(avp *DiameterAVP) int

SerializedAVPLength returns the length of the AVP when serialized

func TCPPortNames

func TCPPortNames(port TCPPort) (string, bool)

TCPPortNames contains the port names for all TCP ports.

func UDPPortNames

func UDPPortNames(port UDPPort) (string, bool)

UDPPortNames contains the port names for all UDP ports.

Types

type ACSE

type ACSE struct {
	BaseLayer
	Type               ACSEAPDUType
	ApplicationContext string
	Called             ACSEAETitle
	Calling            ACSEAETitle
	Responding         ACSEAETitle
	Result             ACSEResult
	DiagnosticSource   ACSEDiagnosticSource
	Diagnostic         int64
	// Reason is the RLRQ/RLRE reason; HasReason tells it was present.
	Reason    int64
	HasReason bool
	// AbortSource is 0 for acse-service-user, 1 for acse-service-provider.
	AbortSource     int64
	AbortDiagnostic int64
	MechanismName   string
	// Authentication is the raw Authentication-value CHOICE element; for
	// the charstring alternative it holds a password in clear.
	Authentication  []byte
	Implementation  string
	UserInformation []ISOPresentationPDV

	CalledInfo     ACSEAEInfo
	CallingInfo    ACSEAEInfo
	RespondingInfo ACSEAEInfo

	// AuthenticationKind and AuthenticationValue are the alternative and
	// value of Authentication: the password of a charstring, the BIT
	// STRING value, or the body of the EXTERNAL or other SEQUENCE. They
	// are best effort, like the fields below: malformed ones stay unset.
	AuthenticationKind  ACSEAuthenticationKind
	AuthenticationValue []byte
	// Requirements is the sender- or responder-acse-requirements.
	Requirements    ACSERequirements
	HasRequirements bool
	// ProtocolVersion is the protocol-version BIT STRING: 0x80 version1.
	ProtocolVersion    uint8
	HasProtocolVersion bool
	// ContextNames is the application-context-name-list.
	ContextNames []string
}

ACSE is an ISO 8650-1 APDU. The layer payload is the single-ASN1-type of the first user-information EXTERNAL, normally an MMS initiate PDU; UserLayer decodes any of them.

CalledInfo, CallingInfo and RespondingInfo are best effort: a malformed form 1 name or invocation identifier leaves them unset.

func (*ACSE) CanDecode

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

CanDecode returns LayerTypeACSE.

func (*ACSE) DecodeFromBytes

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

DecodeFromBytes decodes one ACSE APDU.

func (*ACSE) LayerType

func (a *ACSE) LayerType() gopacket.LayerType

LayerType returns LayerTypeACSE.

func (*ACSE) NextLayerType

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

NextLayerType returns LayerTypeMMS when user-information holds an MMS PDU, gopacket.LayerTypePayload for other data, else LayerTypeZero.

func (*ACSE) UserLayer

func (a *ACSE) UserLayer(i int) (gopacket.Layer, error)

UserLayer decodes user-information EXTERNAL i as an MMS PDU, or as ACSE when it holds one. It returns nil, nil for other data.

type ACSEAEInfo

type ACSEAEInfo struct {
	APTitleName       []ACSEAttribute
	AEQualifierName   []ACSEAttribute
	APInvocationID    int64
	HasAPInvocationID bool
	AEInvocationID    int64
	HasAEInvocationID bool
}

ACSEAEInfo holds the parts of an AE title that ACSEAETitle leaves out: the form 1 AP-title (a directory Name) and AE-qualifier (a RelativeDistinguishedName), and the AP and AE invocation identifiers.

type ACSEAETitle

type ACSEAETitle struct {
	APTitle        string
	APTitleRaw     []byte
	AEQualifier    int64
	HasAEQualifier bool
}

ACSEAETitle is an AP-title / AE-qualifier pair in their form 2 encoding (OBJECT IDENTIFIER and INTEGER). Form 1 (directory name) is kept raw.

type ACSEAPDUType

type ACSEAPDUType uint8

ACSEAPDUType is the APPLICATION tag of an ACSE APDU.

const (
	ACSEAARQ ACSEAPDUType = 0
	ACSEAARE ACSEAPDUType = 1
	ACSERLRQ ACSEAPDUType = 2
	ACSERLRE ACSEAPDUType = 3
	ACSEABRT ACSEAPDUType = 4
)

ACSE APDUs.

func (ACSEAPDUType) String

func (t ACSEAPDUType) String() string

String returns the APDU name.

type ACSEAttribute

type ACSEAttribute struct {
	RDN   int
	Type  string
	Value []byte
}

ACSEAttribute is one AttributeTypeAndValue of a directory Name, e.g. type "2.5.4.3" (commonName) and value "IED1". RDN is the index of its RelativeDistinguishedName; Value holds the value octets of the attribute value element.

type ACSEAuthenticationKind

type ACSEAuthenticationKind uint8

ACSEAuthenticationKind is the Authentication-value CHOICE tag.

const (
	ACSEAuthNone ACSEAuthenticationKind = iota
	ACSEAuthCharString
	ACSEAuthBitString
	ACSEAuthExternal
	ACSEAuthOther
)

Authentication-value alternatives. ACSEAuthNone means no value, or one that does not parse.

func (ACSEAuthenticationKind) String

func (k ACSEAuthenticationKind) String() string

String returns the ASN.1 name of the alternative.

type ACSEDiagnosticSource

type ACSEDiagnosticSource uint8

ACSEDiagnosticSource tells who produced an AARE result-source-diagnostic.

const (
	ACSEDiagnosticNone            ACSEDiagnosticSource = 0
	ACSEDiagnosticServiceUser     ACSEDiagnosticSource = 1
	ACSEDiagnosticServiceProvider ACSEDiagnosticSource = 2
)

Associate-source-diagnostic alternatives.

func (ACSEDiagnosticSource) String

func (s ACSEDiagnosticSource) String() string

String returns the source name.

type ACSERequirements

type ACSERequirements uint8

ACSERequirements is the ACSE-requirements BIT STRING.

const (
	ACSERequireAuthentication     ACSERequirements = 0x80
	ACSERequireContextNegotiation ACSERequirements = 0x40
)

ACSE functional units; bit 0 is the most significant.

type ACSEResult

type ACSEResult int64

ACSEResult is the AARE Associate-result.

const (
	ACSEAccepted          ACSEResult = 0
	ACSERejectedPermanent ACSEResult = 1
	ACSERejectedTransient ACSEResult = 2
)

Associate-result values.

func (ACSEResult) String

func (r ACSEResult) String() string

String returns the result name.

type AGUEVar0 added in v1.5.0

type AGUEVar0 struct {
	Version    uint8
	C          bool
	Protocol   IPProtocol
	Flags      uint16
	Extensions []byte
	Data       []byte
}

AGUEVar0 represents a packet encoded with Generic UDP Encapsulation. It should sit "under" a UDP layer with dest port 666.

For more information about the meaning of the fields, see https://tools.ietf.org/html/draft-ietf-intarea-gue-04#section-3.1

func (AGUEVar0) CanDecode added in v1.5.0

func (l AGUEVar0) CanDecode() gopacket.LayerClass

CanDecode returns the type of layer we can decode.

func (*AGUEVar0) DecodeFromBytes added in v1.5.0

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

DecodeFromBytes extracts our header data from a serialized packet.

func (AGUEVar0) LayerContents added in v1.5.0

func (l AGUEVar0) LayerContents() []byte

LayerContents returns a byte array containing our serialized header.

func (AGUEVar0) LayerPayload added in v1.5.0

func (l AGUEVar0) LayerPayload() []byte

LayerPayload returns an IPv4 or IPv6 packet in serialized form.

func (AGUEVar0) LayerType added in v1.5.0

func (l AGUEVar0) LayerType() gopacket.LayerType

LayerType returns this pseudo-header's type as defined in layertypes.go

func (AGUEVar0) NextLayerType added in v1.5.0

func (l AGUEVar0) NextLayerType() gopacket.LayerType

NextLayerType returns the next layer type, e.g. LayerTypeIPv4

func (AGUEVar0) SerializeTo added in v1.5.0

SerializeTo writes our header into SerializeBuffer.

type AGUEVar1 added in v1.5.0

type AGUEVar1 struct {
	Protocol IPProtocol
	Data     []byte
}

An AGUEVar1 header is mostly imaginary, having a length of 0 in its serialized form. IPProtocol value is either IPProtocolIPv4 or IPProtocolIPv6, depending on the encapped IP header contained in Data, which must begin with the high-order bits 01.

func (AGUEVar1) CanDecode added in v1.5.0

func (l AGUEVar1) CanDecode() gopacket.LayerClass

CanDecode returns the type of layer we can decode.

func (*AGUEVar1) DecodeFromBytes added in v1.5.0

func (l *AGUEVar1) DecodeFromBytes(data []byte, _ gopacket.DecodeFeedback) error

DecodeFromBytes extracts our pseudo-header data from a serialized packet. There's only one thing, the next header type, which is either IPv4 or IPv6. They are crafted to keep their own header type in the first nibble. So we peek into the IP header to get the next-layer protocol type.

func (AGUEVar1) LayerContents added in v1.5.0

func (l AGUEVar1) LayerContents() []byte

LayerContents returns an empty byte array, because this header has no length.

func (AGUEVar1) LayerPayload added in v1.5.0

func (l AGUEVar1) LayerPayload() []byte

LayerPayload returns an IPv4 or IPv6 packet in serialized form.

func (AGUEVar1) LayerType added in v1.5.0

func (l AGUEVar1) LayerType() gopacket.LayerType

LayerType returns this pseudo-header's type as defined in layertypes.go

func (AGUEVar1) NextLayerType added in v1.5.0

func (l AGUEVar1) NextLayerType() gopacket.LayerType

NextLayerType returns the next layer type, e.g. LayerTypeIPv4

func (AGUEVar1) SerializeTo added in v1.5.0

SerializeTo writes our imaginary header into SerializeBuffer. This amount to a noop.

type APSP added in v1.5.0

type APSP struct {
	BaseLayer
	NextHeader    uint8
	HdrExtLen     uint8
	CryptOffset   uint8 // lower 6 bits are offset, 2 high bits are reserved
	SDVersVirt    uint8 // see go/andromeda-psp-format for bitfield breakdown
	SecParamIdx   uint32
	InitVector    uint64
	SecTokenV2    uint32
	VirtKey       uint32
	SrcEndpointID uint64
	DstEndpointID uint64
}

APSP represents a packet encrypted with the Andromeda Paddywhack Security Protocol. It should sit "under" a UDP layer with dest port 1000. For more information about the meaning of the fields, see go/andromeda-psp-format This is a remix and extension of the basic PSP header, see go/psp-format Field order and packing don't really matter, because we serialize explicitly, in SerializeTo()

func (APSP) CanDecode added in v1.5.0

func (l APSP) CanDecode() gopacket.LayerClass

CanDecode returns the type of layer we can decode.

func (*APSP) DecodeFromBytes added in v1.5.0

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

DecodeFromBytes extracts our header data from a serialized packet.

func (APSP) LayerContents added in v1.5.0

func (l APSP) LayerContents() []byte

LayerContents returns a byte array containing our serialized header.

func (APSP) LayerPayload added in v1.5.0

func (l APSP) LayerPayload() []byte

LayerPayload returns an IPv4 or IPv6 packet in serialized form.

func (APSP) LayerType added in v1.5.0

func (l APSP) LayerType() gopacket.LayerType

LayerType returns LayerTypeAPSP.

func (APSP) NextLayerType added in v1.5.0

func (l APSP) NextLayerType() gopacket.LayerType

NextLayerType returns the next layer type, either IPv4 or IPv6.

func (APSP) SerializeTo added in v1.5.0

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

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 ARPHardwareType

type ARPHardwareType uint16

The ARPHardwareType contains a Linux ARPHRD_ value for the link-layer device type

const (
	ARPHardwareTypeEthernet      ARPHardwareType = 1
	ARPHardwareTypeFRAD          ARPHardwareType = 770
	ARPHardwareTypeLoopback      ARPHardwareType = 772
	ARPHardwareTypeIPGRE         ARPHardwareType = 778
	ARPHardwareTypeDot11Radiotap ARPHardwareType = 803
)

func (ARPHardwareType) String

func (l ARPHardwareType) String() string

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 AVPKey added in v1.6.0

type AVPKey struct {
	Code     uint32
	VendorID uint32
}

AVPKey uniquely identifies an AVP by its code and optional vendor ID

type AddAddr added in v1.3.1

type AddAddr struct {
	BaseLayer
	IPVer    uint8
	E        bool
	AddrID   uint8
	Address  net.IP
	Port     uint16
	SendHMAC []byte
}

AddAddr contains the fields from the ADD_ADDR MPTCP Option

type BACnetAPDU

type BACnetAPDU struct {
	BaseLayer
	PDUType BACnetPDUType

	// Header flags: SEG, MOR and SA of requests and ComplexACK, NAK and SRV
	// of SegmentACK, SRV of Abort.
	Segmented                 bool
	MoreFollows               bool
	SegmentedResponseAccepted bool
	NegativeACK               bool
	Server                    bool

	MaxSegments BACnetMaxSegments
	MaxAPDU     BACnetMaxAPDU
	InvokeID    uint8
	// SequenceNumber and WindowSize are set by segmented messages (the
	// proposed window) and by SegmentACK (the actual window).
	SequenceNumber uint8
	WindowSize     uint8

	// ConfirmedService is the service of a confirmed request or of its
	// SimpleACK, ComplexACK or Error; UnconfirmedService that of an
	// unconfirmed request.
	ConfirmedService   BACnetConfirmedService
	UnconfirmedService BACnetUnconfirmedService

	RejectReason BACnetRejectReason
	AbortReason  BACnetAbortReason
	// Error is set by an Error PDU: its first error class and code.
	Error BACnetError

	Parameters []byte
	Tags       []BACnetTag
	// ServiceData holds the typed parameters of a decoded service, or nil.
	ServiceData BACnetServiceData
	// contains filtered or unexported fields
}

BACnetAPDU is a BACnet application layer PDU (Clause 20.1). Header fields are set according to PDUType. The service parameters are kept raw in Parameters and, unless the message is segmented, split into Tags; the common services are decoded further into ServiceData.

func (*BACnetAPDU) CanDecode

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

CanDecode returns LayerTypeBACnetAPDU.

func (*BACnetAPDU) DecodeFromBytes

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

DecodeFromBytes decodes an APDU. A malformed tag stream is an error; parameters that are well tagged but do not match the service leave ServiceData nil.

The vendor block of a private transfer (request, ACK or Error) is the exception: when it is not tag encoded the vendor identifier and service number are still decoded, and the block is the []byte Value of the last parameter.

func (*BACnetAPDU) LayerType

func (a *BACnetAPDU) LayerType() gopacket.LayerType

LayerType returns LayerTypeBACnetAPDU.

func (*BACnetAPDU) NextLayerType

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

NextLayerType returns LayerTypeZero: the APDU is the last BACnet layer.

func (*BACnetAPDU) Values

func (a *BACnetAPDU) Values() []BACnetValue

Values returns the service parameters as typed values, named after the Clause 21 production of the service. For the services whose ServiceData is a type of their own it decodes them on demand, with their property values typed; for the others it returns the Fields of ServiceData. It returns nil when the parameters do not match the service.

type BACnetAbortReason

type BACnetAbortReason uint8

BACnetAbortReason is the reason of an Abort PDU (Clause 18.9). Values from 64 are proprietary.

const (
	BACnetAbortOther                         BACnetAbortReason = 0
	BACnetAbortBufferOverflow                BACnetAbortReason = 1
	BACnetAbortInvalidAPDUInThisState        BACnetAbortReason = 2
	BACnetAbortPreemptedByHigherPriorityTask BACnetAbortReason = 3
	BACnetAbortSegmentationNotSupported      BACnetAbortReason = 4
	BACnetAbortSecurityError                 BACnetAbortReason = 5
	BACnetAbortInsufficientSecurity          BACnetAbortReason = 6
	BACnetAbortWindowSizeOutOfRange          BACnetAbortReason = 7
	BACnetAbortApplicationExceededReplyTime  BACnetAbortReason = 8
	BACnetAbortOutOfResources                BACnetAbortReason = 9
	BACnetAbortTSMTimeout                    BACnetAbortReason = 10
	BACnetAbortAPDUTooLong                   BACnetAbortReason = 11
)

BACnetAbortReason values.

func (BACnetAbortReason) String

func (r BACnetAbortReason) String() string

String returns the Clause 18 name of the reason.

type BACnetApplicationTag

type BACnetApplicationTag uint8

BACnetApplicationTag is the data type of an application tag (Clause 20.2.1.4).

const (
	BACnetAppTagNull             BACnetApplicationTag = 0
	BACnetAppTagBoolean          BACnetApplicationTag = 1
	BACnetAppTagUnsigned         BACnetApplicationTag = 2
	BACnetAppTagSigned           BACnetApplicationTag = 3
	BACnetAppTagReal             BACnetApplicationTag = 4
	BACnetAppTagDouble           BACnetApplicationTag = 5
	BACnetAppTagOctetString      BACnetApplicationTag = 6
	BACnetAppTagCharacterString  BACnetApplicationTag = 7
	BACnetAppTagBitString        BACnetApplicationTag = 8
	BACnetAppTagEnumerated       BACnetApplicationTag = 9
	BACnetAppTagDate             BACnetApplicationTag = 10
	BACnetAppTagTime             BACnetApplicationTag = 11
	BACnetAppTagObjectIdentifier BACnetApplicationTag = 12
)

BACnetApplicationTag values.

func (BACnetApplicationTag) String

func (t BACnetApplicationTag) String() string

String returns the data type name.

type BACnetBitString

type BACnetBitString struct {
	Unused uint8
	Bytes  []byte
}

BACnetBitString is a decoded BitString: the bits, most significant first, minus the unused bits of the last octet.

func (BACnetBitString) Bit

func (b BACnetBitString) Bit(i int) bool

Bit returns bit i, counting from the first bit on the wire.

func (BACnetBitString) Len

func (b BACnetBitString) Len() int

Len returns the number of bits.

func (BACnetBitString) String

func (b BACnetBitString) String() string

String returns the bits as a string of 0 and 1, first bit first.

type BACnetCOVNotification

type BACnetCOVNotification struct {
	ProcessID uint32
	Device    BACnetObjectIdentifier
	Object    BACnetObjectIdentifier
	// TimeRemaining is the subscription time left, in seconds.
	TimeRemaining uint32
	Values        []BACnetPropertyValue
}

BACnetCOVNotification is the ConfirmedCOVNotification or UnconfirmedCOVNotification request (Clause 13.6, 13.7).

type BACnetChallengeRequest

type BACnetChallengeRequest struct {
	// Challenge says why: 1 in response to a message, other values a
	// challenge of the sender's own making.
	Challenge uint8
	// OriginalMessageID and OriginalTimestamp name the challenged message.
	OriginalMessageID uint32
	OriginalTimestamp uint32
}

BACnetChallengeRequest is a Challenge-Request (Clause 24.3.1): it asks the source of a message to prove that it sent it.

type BACnetCharacterSet

type BACnetCharacterSet uint8

BACnetCharacterSet is the character set octet of a CharacterString (Clause 20.2.9).

const (
	BACnetCharsetUTF8      BACnetCharacterSet = 0
	BACnetCharsetDBCS      BACnetCharacterSet = 1
	BACnetCharsetJISX0208  BACnetCharacterSet = 2
	BACnetCharsetUCS4      BACnetCharacterSet = 3
	BACnetCharsetUCS2      BACnetCharacterSet = 4
	BACnetCharsetISO8859_1 BACnetCharacterSet = 5
)

BACnetCharacterSet values.

type BACnetConfirmedService

type BACnetConfirmedService uint8

BACnetConfirmedService is a confirmed service choice (Clause 21).

const (
	BACnetConfirmedServiceAcknowledgeAlarm                 BACnetConfirmedService = 0
	BACnetConfirmedServiceConfirmedCOVNotification         BACnetConfirmedService = 1
	BACnetConfirmedServiceConfirmedEventNotification       BACnetConfirmedService = 2
	BACnetConfirmedServiceGetAlarmSummary                  BACnetConfirmedService = 3
	BACnetConfirmedServiceGetEnrollmentSummary             BACnetConfirmedService = 4
	BACnetConfirmedServiceSubscribeCOV                     BACnetConfirmedService = 5
	BACnetConfirmedServiceAtomicReadFile                   BACnetConfirmedService = 6
	BACnetConfirmedServiceAtomicWriteFile                  BACnetConfirmedService = 7
	BACnetConfirmedServiceAddListElement                   BACnetConfirmedService = 8
	BACnetConfirmedServiceRemoveListElement                BACnetConfirmedService = 9
	BACnetConfirmedServiceCreateObject                     BACnetConfirmedService = 10
	BACnetConfirmedServiceDeleteObject                     BACnetConfirmedService = 11
	BACnetConfirmedServiceReadProperty                     BACnetConfirmedService = 12
	BACnetConfirmedServiceReadPropertyConditional          BACnetConfirmedService = 13
	BACnetConfirmedServiceReadPropertyMultiple             BACnetConfirmedService = 14
	BACnetConfirmedServiceWriteProperty                    BACnetConfirmedService = 15
	BACnetConfirmedServiceWritePropertyMultiple            BACnetConfirmedService = 16
	BACnetConfirmedServiceDeviceCommunicationControl       BACnetConfirmedService = 17
	BACnetConfirmedServiceConfirmedPrivateTransfer         BACnetConfirmedService = 18
	BACnetConfirmedServiceConfirmedTextMessage             BACnetConfirmedService = 19
	BACnetConfirmedServiceReinitializeDevice               BACnetConfirmedService = 20
	BACnetConfirmedServiceVTOpen                           BACnetConfirmedService = 21
	BACnetConfirmedServiceVTClose                          BACnetConfirmedService = 22
	BACnetConfirmedServiceVTData                           BACnetConfirmedService = 23
	BACnetConfirmedServiceAuthenticate                     BACnetConfirmedService = 24
	BACnetConfirmedServiceRequestKey                       BACnetConfirmedService = 25
	BACnetConfirmedServiceReadRange                        BACnetConfirmedService = 26
	BACnetConfirmedServiceLifeSafetyOperation              BACnetConfirmedService = 27
	BACnetConfirmedServiceSubscribeCOVProperty             BACnetConfirmedService = 28
	BACnetConfirmedServiceGetEventInformation              BACnetConfirmedService = 29
	BACnetConfirmedServiceSubscribeCOVPropertyMultiple     BACnetConfirmedService = 30
	BACnetConfirmedServiceConfirmedCOVNotificationMultiple BACnetConfirmedService = 31
	BACnetConfirmedServiceConfirmedAuditNotification       BACnetConfirmedService = 32
	BACnetConfirmedServiceAuditLogQuery                    BACnetConfirmedService = 33
	BACnetConfirmedServiceAuthRequest                      BACnetConfirmedService = 34
)

BACnetConfirmedService values.

func (BACnetConfirmedService) String

func (s BACnetConfirmedService) String() string

String returns the Clause 21 name of the service.

type BACnetDataType

type BACnetDataType uint16

BACnetDataType names a datatype of Clause 21: a primitive type, an enumeration, a named bit string or a constructed production.

const (
	BACnetDataTypePropertyIdentifier BACnetDataType = bacnetDataTypeNamedBase + iota
	BACnetDataTypeObjectType
	BACnetDataTypeErrorClass
	BACnetDataTypeErrorCode
	BACnetDataTypeSegmentation
	BACnetDataTypeEngineeringUnits
	BACnetDataTypeReliability
	BACnetDataTypeEventState
	BACnetDataTypeEventType
	BACnetDataTypeNotifyType
	BACnetDataTypeDeviceStatus
	BACnetDataTypePolarity
	BACnetDataTypeBinaryPV
	BACnetDataTypeAction
	BACnetDataTypeProgramError
	BACnetDataTypeProgramRequest
	BACnetDataTypeProgramState
	BACnetDataTypeFileAccessMethod
	BACnetDataTypeLifeSafetyMode
	BACnetDataTypeLifeSafetyOperation
	BACnetDataTypeLifeSafetyState
	BACnetDataTypeSilencedState
	BACnetDataTypeMaintenance
	BACnetDataTypeNodeType
	BACnetDataTypeLoggingType
	BACnetDataTypeDoorStatus
	BACnetDataTypeDoorValue
	BACnetDataTypeLockStatus
	BACnetDataTypeDoorSecuredStatus
	BACnetDataTypeDoorAlarmState
	BACnetDataTypeShedState
	BACnetDataTypeRestartReason
	BACnetDataTypeBackupState
	BACnetDataTypeWriteStatus
	BACnetDataTypeLightingOperation
	BACnetDataTypeLightingInProgress
	BACnetDataTypeLightingTransition
	BACnetDataTypeBinaryLightingPV
	BACnetDataTypeTimerState
	BACnetDataTypeTimerTransition
	BACnetDataTypeIPMode
	BACnetDataTypeNetworkPortCommand
	BACnetDataTypeNetworkType
	BACnetDataTypeNetworkNumberQuality
	BACnetDataTypeProtocolLevel
	BACnetDataTypeAccessEvent
	BACnetDataTypeAccessZoneOccupancyState
	BACnetDataTypeAccessPassbackMode
	BACnetDataTypeAccessCredentialDisableReason
	BACnetDataTypeAccessCredentialDisable
	BACnetDataTypeAccessUserType
	BACnetDataTypeAuthenticationStatus
	BACnetDataTypeAuthorizationMode
	BACnetDataTypeAuthorizationExemption
	BACnetDataTypeSecurityLevel
	BACnetDataTypeFaultType
	BACnetDataTypeAccumulatorStatus
	BACnetDataTypeVTClass
	BACnetDataTypeEnableDisable
	BACnetDataTypeReinitializedState
	BACnetDataTypeMessagePriority
	BACnetDataTypeAcknowledgmentFilter
	BACnetDataTypeEventStateFilter
	BACnetDataTypeEscalatorFault
	BACnetDataTypeEscalatorMode
	BACnetDataTypeEscalatorOperationDirection
	BACnetDataTypeLiftCarDirection
	BACnetDataTypeLiftCarDoorCommand
	BACnetDataTypeLiftCarDriveStatus
	BACnetDataTypeLiftCarMode
	BACnetDataTypeLiftFault
	BACnetDataTypeLiftGroupMode
	BACnetDataTypeRelationship
	BACnetDataTypeAuditLevel
	BACnetDataTypeAuditOperation
	BACnetDataTypeSuccessFilter
	BACnetDataTypeStatusFlags
	BACnetDataTypeEventTransitionBits
	BACnetDataTypeLimitEnable
	BACnetDataTypeDaysOfWeek
	BACnetDataTypeLogStatus
	BACnetDataTypeResultFlags
	BACnetDataTypeServicesSupported
	BACnetDataTypeObjectTypesSupported
	BACnetDataTypeColorOperation
	BACnetDataTypeAuthenticationFactorType
	BACnetDataTypeAuthorizationOrigin
	BACnetDataTypeAuthorizationMethod
	BACnetDataTypeAuthorizationScopes
)

BACnetDataType values of the enumerations and the named bit strings.

const (
	// BACnetDataTypeAny is data whose type is not known.
	BACnetDataTypeAny BACnetDataType = iota
	BACnetDataTypeNull
	BACnetDataTypeBoolean
	BACnetDataTypeUnsigned
	BACnetDataTypeSigned
	BACnetDataTypeReal
	BACnetDataTypeDouble
	BACnetDataTypeOctetString
	BACnetDataTypeCharacterString
	BACnetDataTypeBitString
	BACnetDataTypeEnumerated
	BACnetDataTypeDate
	BACnetDataTypeTime
	BACnetDataTypeObjectIdentifier
	// BACnetDataTypeSequence and BACnetDataTypeChoice are the SEQUENCE and
	// CHOICE productions that Clause 21 nests without naming them.
	BACnetDataTypeSequence
	BACnetDataTypeChoice
	BACnetDataTypeWeekNDay
	BACnetDataTypeDateTime
	BACnetDataTypeDateRange
	BACnetDataTypeCalendarEntry
	BACnetDataTypeTimeValue
	BACnetDataTypeDailySchedule
	BACnetDataTypeSpecialEvent
	BACnetDataTypeDeviceObjectReference
	BACnetDataTypeDeviceObjectPropertyReference
	BACnetDataTypeObjectPropertyReference
	BACnetDataTypeDeviceObjectPropertyValue
	BACnetDataTypePropertyReference
	BACnetDataTypePropertyValue
	BACnetDataTypeAddress
	BACnetDataTypeAddressBinding
	BACnetDataTypeRecipient
	BACnetDataTypeRecipientProcess
	BACnetDataTypeDestination
	BACnetDataTypeCOVSubscription
	BACnetDataTypePriorityValue
	BACnetDataTypeTimeStamp
	BACnetDataTypePropertyStates
	BACnetDataTypeEventParameter
	BACnetDataTypeNotificationParameters
	BACnetDataTypeFaultParameter
	BACnetDataTypeLogRecord
	BACnetDataTypeEventLogRecord
	BACnetDataTypeLogMultipleRecord
	BACnetDataTypeError
	BACnetDataTypeReadAccessSpecification
	BACnetDataTypeReadAccessResult
	BACnetDataTypeWriteAccessSpecification
	BACnetDataTypeScale
	BACnetDataTypePrescale
	BACnetDataTypeAccumulatorRecord
	BACnetDataTypeActionCommand
	BACnetDataTypeActionList
	BACnetDataTypeSetpointReference
	BACnetDataTypeShedLevel
	BACnetDataTypeVTSession
	BACnetDataTypeClientCOV
	BACnetDataTypeLightingCommand
	BACnetDataTypeHostNPort
	BACnetDataTypeBDTEntry
	BACnetDataTypeFDTEntry
	BACnetDataTypeVMACEntry
	BACnetDataTypeRouterEntry
	BACnetDataTypeValueSource
	BACnetDataTypeChannelValue
	BACnetDataTypeGroupChannelValue
	BACnetDataTypeEventNotification
	BACnetDataTypeEventNotificationSubscription
	BACnetDataTypeNameValue
	BACnetDataTypeAuditNotification
	BACnetDataTypeAuditLogRecord
	BACnetDataTypeColorCommand
	BACnetDataTypeXYColor
	BACnetDataTypeAuthenticationFactor
	BACnetDataTypeAuthorizationConstraint
	BACnetDataTypeAuthorizationScope
	BACnetDataTypeAccessToken
)

BACnetDataType values of the primitive and constructed datatypes. The enumerations and named bit strings follow from bacnetDataTypeNamedBase.

func (BACnetDataType) BitName

func (t BACnetDataType) BitName(i int) string

BitName returns the Clause 21 name of bit i of named bit string t, or its number.

func (BACnetDataType) EnumName

func (t BACnetDataType) EnumName(v uint32) string

EnumName returns the Clause 21 name of value v of enumeration t, or its number when t does not name it.

func (BACnetDataType) String

func (t BACnetDataType) String() string

String returns the Clause 21 name of the datatype.

type BACnetDate

type BACnetDate struct {
	Year    uint16
	Month   uint8
	Day     uint8
	Weekday uint8
}

BACnetDate is a Date (Clause 20.2.12). Any field may be BACnetUnspecified; Year is then 0xFF too, else the full year.

func (BACnetDate) String

func (d BACnetDate) String() string

String returns the date as year-month-day, with * for unspecified fields.

type BACnetEnumerated

type BACnetEnumerated struct {
	Type  BACnetDataType
	Value uint32
}

BACnetEnumerated is the value of an Enumerated together with the enumeration it belongs to, which names it.

func (BACnetEnumerated) String

func (e BACnetEnumerated) String() string

String returns the Clause 21 name of the value, or its number.

type BACnetError

type BACnetError struct {
	Class BACnetErrorClass
	Code  BACnetErrorCode
}

BACnetError is an error class and code pair.

type BACnetErrorClass

type BACnetErrorClass uint32

BACnetErrorClass is the class of a BACnet error (Clause 18).

const (
	BACnetErrorClassDevice        BACnetErrorClass = 0
	BACnetErrorClassObject        BACnetErrorClass = 1
	BACnetErrorClassProperty      BACnetErrorClass = 2
	BACnetErrorClassResources     BACnetErrorClass = 3
	BACnetErrorClassSecurity      BACnetErrorClass = 4
	BACnetErrorClassServices      BACnetErrorClass = 5
	BACnetErrorClassVT            BACnetErrorClass = 6
	BACnetErrorClassCommunication BACnetErrorClass = 7
)

BACnetErrorClass values.

func (BACnetErrorClass) String

func (c BACnetErrorClass) String() string

String returns the Clause 18 name of the class.

type BACnetErrorCode

type BACnetErrorCode uint32

BACnetErrorCode is the error code of a BACnet Error PDU (Clause 18).

const (
	BACnetErrorCodeOther                              BACnetErrorCode = 0
	BACnetErrorCodeAuthenticationFailed               BACnetErrorCode = 1
	BACnetErrorCodeConfigurationInProgress            BACnetErrorCode = 2
	BACnetErrorCodeDeviceBusy                         BACnetErrorCode = 3
	BACnetErrorCodeDynamicCreationNotSupported        BACnetErrorCode = 4
	BACnetErrorCodeFileAccessDenied                   BACnetErrorCode = 5
	BACnetErrorCodeIncompatibleSecurityLevels         BACnetErrorCode = 6
	BACnetErrorCodeInconsistentParameters             BACnetErrorCode = 7
	BACnetErrorCodeInconsistentSelectionCriterion     BACnetErrorCode = 8
	BACnetErrorCodeInvalidDataType                    BACnetErrorCode = 9
	BACnetErrorCodeInvalidFileAccessMethod            BACnetErrorCode = 10
	BACnetErrorCodeInvalidFileStartPosition           BACnetErrorCode = 11
	BACnetErrorCodeInvalidOperatorName                BACnetErrorCode = 12
	BACnetErrorCodeInvalidParameterDataType           BACnetErrorCode = 13
	BACnetErrorCodeInvalidTimeStamp                   BACnetErrorCode = 14
	BACnetErrorCodeKeyGenerationError                 BACnetErrorCode = 15
	BACnetErrorCodeMissingRequiredParameter           BACnetErrorCode = 16
	BACnetErrorCodeNoObjectsOfSpecifiedType           BACnetErrorCode = 17
	BACnetErrorCodeNoSpaceForObject                   BACnetErrorCode = 18
	BACnetErrorCodeNoSpaceToAddListElement            BACnetErrorCode = 19
	BACnetErrorCodeNoSpaceToWriteProperty             BACnetErrorCode = 20
	BACnetErrorCodeNoVtSessionsAvailable              BACnetErrorCode = 21
	BACnetErrorCodePropertyIsNotAList                 BACnetErrorCode = 22
	BACnetErrorCodeObjectDeletionNotPermitted         BACnetErrorCode = 23
	BACnetErrorCodeObjectIdentifierAlreadyExists      BACnetErrorCode = 24
	BACnetErrorCodeOperationalProblem                 BACnetErrorCode = 25
	BACnetErrorCodePasswordFailure                    BACnetErrorCode = 26
	BACnetErrorCodeReadAccessDenied                   BACnetErrorCode = 27
	BACnetErrorCodeSecurityNotSupported               BACnetErrorCode = 28
	BACnetErrorCodeServiceRequestDenied               BACnetErrorCode = 29
	BACnetErrorCodeTimeout                            BACnetErrorCode = 30
	BACnetErrorCodeUnknownObject                      BACnetErrorCode = 31
	BACnetErrorCodeUnknownProperty                    BACnetErrorCode = 32
	BACnetErrorCodeUnknownVtClass                     BACnetErrorCode = 34
	BACnetErrorCodeUnknownVtSession                   BACnetErrorCode = 35
	BACnetErrorCodeUnsupportedObjectType              BACnetErrorCode = 36
	BACnetErrorCodeValueOutOfRange                    BACnetErrorCode = 37
	BACnetErrorCodeVtSessionAlreadyClosed             BACnetErrorCode = 38
	BACnetErrorCodeVtSessionTerminationFailure        BACnetErrorCode = 39
	BACnetErrorCodeWriteAccessDenied                  BACnetErrorCode = 40
	BACnetErrorCodeCharacterSetNotSupported           BACnetErrorCode = 41
	BACnetErrorCodeInvalidArrayIndex                  BACnetErrorCode = 42
	BACnetErrorCodeCovSubscriptionFailed              BACnetErrorCode = 43
	BACnetErrorCodeNotCovProperty                     BACnetErrorCode = 44
	BACnetErrorCodeOptionalFunctionalityNotSupported  BACnetErrorCode = 45
	BACnetErrorCodeInvalidConfigurationData           BACnetErrorCode = 46
	BACnetErrorCodeDatatypeNotSupported               BACnetErrorCode = 47
	BACnetErrorCodeDuplicateName                      BACnetErrorCode = 48
	BACnetErrorCodeDuplicateObjectID                  BACnetErrorCode = 49
	BACnetErrorCodePropertyIsNotAnArray               BACnetErrorCode = 50
	BACnetErrorCodeAbortBufferOverflow                BACnetErrorCode = 51
	BACnetErrorCodeAbortInvalidApduInThisState        BACnetErrorCode = 52
	BACnetErrorCodeAbortPreemptedByHigherPriorityTask BACnetErrorCode = 53
	BACnetErrorCodeAbortSegmentationNotSupported      BACnetErrorCode = 54
	BACnetErrorCodeAbortProprietary                   BACnetErrorCode = 55
	BACnetErrorCodeAbortOther                         BACnetErrorCode = 56
	BACnetErrorCodeInvalidTag                         BACnetErrorCode = 57
	BACnetErrorCodeNetworkDown                        BACnetErrorCode = 58
	BACnetErrorCodeRejectBufferOverflow               BACnetErrorCode = 59
	BACnetErrorCodeRejectInconsistentParameters       BACnetErrorCode = 60
	BACnetErrorCodeRejectInvalidParameterDataType     BACnetErrorCode = 61
	BACnetErrorCodeRejectInvalidTag                   BACnetErrorCode = 62
	BACnetErrorCodeRejectMissingRequiredParameter     BACnetErrorCode = 63
	BACnetErrorCodeRejectParameterOutOfRange          BACnetErrorCode = 64
	BACnetErrorCodeRejectTooManyArguments             BACnetErrorCode = 65
	BACnetErrorCodeRejectUndefinedEnumeration         BACnetErrorCode = 66
	BACnetErrorCodeRejectUnrecognizedService          BACnetErrorCode = 67
	BACnetErrorCodeRejectProprietary                  BACnetErrorCode = 68
	BACnetErrorCodeRejectOther                        BACnetErrorCode = 69
	BACnetErrorCodeUnknownDevice                      BACnetErrorCode = 70
	BACnetErrorCodeUnknownRoute                       BACnetErrorCode = 71
	BACnetErrorCodeValueNotInitialized                BACnetErrorCode = 72
	BACnetErrorCodeInvalidEventState                  BACnetErrorCode = 73
	BACnetErrorCodeNoAlarmConfigured                  BACnetErrorCode = 74
	BACnetErrorCodeLogBufferFull                      BACnetErrorCode = 75
	BACnetErrorCodeLoggedValuePurged                  BACnetErrorCode = 76
	BACnetErrorCodeNoPropertySpecified                BACnetErrorCode = 77
	BACnetErrorCodeNotConfiguredForTriggeredLogging   BACnetErrorCode = 78
	BACnetErrorCodeUnknownSubscription                BACnetErrorCode = 79
	BACnetErrorCodeParameterOutOfRange                BACnetErrorCode = 80
	BACnetErrorCodeListElementNotFound                BACnetErrorCode = 81
	BACnetErrorCodeBusy                               BACnetErrorCode = 82
	BACnetErrorCodeCommunicationDisabled              BACnetErrorCode = 83
	BACnetErrorCodeSuccess                            BACnetErrorCode = 84
	BACnetErrorCodeAccessDenied                       BACnetErrorCode = 85
	BACnetErrorCodeBadDestinationAddress              BACnetErrorCode = 86
	BACnetErrorCodeBadDestinationDeviceID             BACnetErrorCode = 87
	BACnetErrorCodeBadSignature                       BACnetErrorCode = 88
	BACnetErrorCodeBadSourceAddress                   BACnetErrorCode = 89
	BACnetErrorCodeBadTimestamp                       BACnetErrorCode = 90
	BACnetErrorCodeCannotUseKey                       BACnetErrorCode = 91
	BACnetErrorCodeCannotVerifyMessageID              BACnetErrorCode = 92
	BACnetErrorCodeCorrectKeyRevision                 BACnetErrorCode = 93
	BACnetErrorCodeDestinationDeviceIDRequired        BACnetErrorCode = 94
	BACnetErrorCodeDuplicateMessage                   BACnetErrorCode = 95
	BACnetErrorCodeEncryptionNotConfigured            BACnetErrorCode = 96
	BACnetErrorCodeEncryptionRequired                 BACnetErrorCode = 97
	BACnetErrorCodeIncorrectKey                       BACnetErrorCode = 98
	BACnetErrorCodeInvalidKeyData                     BACnetErrorCode = 99
	BACnetErrorCodeKeyUpdateInProgress                BACnetErrorCode = 100
	BACnetErrorCodeMalformedMessage                   BACnetErrorCode = 101
	BACnetErrorCodeNotKeyServer                       BACnetErrorCode = 102
	BACnetErrorCodeSecurityNotConfigured              BACnetErrorCode = 103
	BACnetErrorCodeSourceSecurityRequired             BACnetErrorCode = 104
	BACnetErrorCodeTooManyKeys                        BACnetErrorCode = 105
	BACnetErrorCodeUnknownAuthenticationType          BACnetErrorCode = 106
	BACnetErrorCodeUnknownKey                         BACnetErrorCode = 107
	BACnetErrorCodeUnknownKeyRevision                 BACnetErrorCode = 108
	BACnetErrorCodeUnknownSourceMessage               BACnetErrorCode = 109
	BACnetErrorCodeNotRouterToDnet                    BACnetErrorCode = 110
	BACnetErrorCodeRouterBusy                         BACnetErrorCode = 111
	BACnetErrorCodeUnknownNetworkMessage              BACnetErrorCode = 112
	BACnetErrorCodeMessageTooLong                     BACnetErrorCode = 113
	BACnetErrorCodeSecurityError                      BACnetErrorCode = 114
	BACnetErrorCodeAddressingError                    BACnetErrorCode = 115
	BACnetErrorCodeWriteBdtFailed                     BACnetErrorCode = 116
	BACnetErrorCodeReadBdtFailed                      BACnetErrorCode = 117
	BACnetErrorCodeRegisterForeignDeviceFailed        BACnetErrorCode = 118
	BACnetErrorCodeReadFdtFailed                      BACnetErrorCode = 119
	BACnetErrorCodeDeleteFdtEntryFailed               BACnetErrorCode = 120
	BACnetErrorCodeDistributeBroadcastFailed          BACnetErrorCode = 121
	BACnetErrorCodeUnknownFileSize                    BACnetErrorCode = 122
	BACnetErrorCodeAbortApduTooLong                   BACnetErrorCode = 123
	BACnetErrorCodeAbortApplicationExceededReplyTime  BACnetErrorCode = 124
	BACnetErrorCodeAbortOutOfResources                BACnetErrorCode = 125
	BACnetErrorCodeAbortTsmTimeout                    BACnetErrorCode = 126
	BACnetErrorCodeAbortWindowSizeOutOfRange          BACnetErrorCode = 127
	BACnetErrorCodeFileFull                           BACnetErrorCode = 128
	BACnetErrorCodeInconsistentConfiguration          BACnetErrorCode = 129
	BACnetErrorCodeInconsistentObjectType             BACnetErrorCode = 130
	BACnetErrorCodeInternalError                      BACnetErrorCode = 131
	BACnetErrorCodeNotConfigured                      BACnetErrorCode = 132
	BACnetErrorCodeOutOfMemory                        BACnetErrorCode = 133
	BACnetErrorCodeValueTooLong                       BACnetErrorCode = 134
	BACnetErrorCodeAbortInsufficientSecurity          BACnetErrorCode = 135
	BACnetErrorCodeAbortSecurityError                 BACnetErrorCode = 136
	BACnetErrorCodeDuplicateEntry                     BACnetErrorCode = 137
	BACnetErrorCodeInvalidValueInThisState            BACnetErrorCode = 138
	BACnetErrorCodeInvalidOperationInThisState        BACnetErrorCode = 139
	BACnetErrorCodeListItemNotNumbered                BACnetErrorCode = 140
	BACnetErrorCodeListItemNotTimestamped             BACnetErrorCode = 141
	BACnetErrorCodeInvalidDataEncoding                BACnetErrorCode = 142
	BACnetErrorCodeBvlcFunctionUnknown                BACnetErrorCode = 143
	BACnetErrorCodeBvlcProprietaryFunctionUnknown     BACnetErrorCode = 144
	BACnetErrorCodeHeaderEncodingError                BACnetErrorCode = 145
	BACnetErrorCodeHeaderNotUnderstood                BACnetErrorCode = 146
	BACnetErrorCodeMessageIncomplete                  BACnetErrorCode = 147
	BACnetErrorCodeNotABACnetScHub                    BACnetErrorCode = 148
	BACnetErrorCodePayloadExpected                    BACnetErrorCode = 149
	BACnetErrorCodeUnexpectedData                     BACnetErrorCode = 150
	BACnetErrorCodeNodeDuplicateVmac                  BACnetErrorCode = 151
	BACnetErrorCodeHTTPUnexpectedResponseCode         BACnetErrorCode = 152
	BACnetErrorCodeHTTPNoUpgrade                      BACnetErrorCode = 153
	BACnetErrorCodeHTTPResourceNotLocal               BACnetErrorCode = 154
	BACnetErrorCodeHTTPProxyAuthenticationFailed      BACnetErrorCode = 155
	BACnetErrorCodeHTTPResponseTimeout                BACnetErrorCode = 156
	BACnetErrorCodeHTTPResponseSyntaxError            BACnetErrorCode = 157
	BACnetErrorCodeHTTPResponseValueError             BACnetErrorCode = 158
	BACnetErrorCodeHTTPResponseMissingHeader          BACnetErrorCode = 159
	BACnetErrorCodeHTTPWebsocketHeaderError           BACnetErrorCode = 160
	BACnetErrorCodeHTTPUpgradeRequired                BACnetErrorCode = 161
	BACnetErrorCodeHTTPUpgradeError                   BACnetErrorCode = 162
	BACnetErrorCodeHTTPTemporaryUnavailable           BACnetErrorCode = 163
	BACnetErrorCodeHTTPNotAServer                     BACnetErrorCode = 164
	BACnetErrorCodeHTTPError                          BACnetErrorCode = 165
	BACnetErrorCodeWebsocketSchemeNotSupported        BACnetErrorCode = 166
	BACnetErrorCodeWebsocketUnknownControlMessage     BACnetErrorCode = 167
	BACnetErrorCodeWebsocketCloseError                BACnetErrorCode = 168
	BACnetErrorCodeWebsocketClosedByPeer              BACnetErrorCode = 169
	BACnetErrorCodeWebsocketEndpointLeaves            BACnetErrorCode = 170
	BACnetErrorCodeWebsocketProtocolError             BACnetErrorCode = 171
	BACnetErrorCodeWebsocketDataNotAccepted           BACnetErrorCode = 172
	BACnetErrorCodeWebsocketClosedAbnormally          BACnetErrorCode = 173
	BACnetErrorCodeWebsocketDataInconsistent          BACnetErrorCode = 174
	BACnetErrorCodeWebsocketDataAgainstPolicy         BACnetErrorCode = 175
	BACnetErrorCodeWebsocketFrameTooLong              BACnetErrorCode = 176
	BACnetErrorCodeWebsocketExtensionMissing          BACnetErrorCode = 177
	BACnetErrorCodeWebsocketRequestUnavailable        BACnetErrorCode = 178
	BACnetErrorCodeWebsocketError                     BACnetErrorCode = 179
	BACnetErrorCodeTLSClientCertificateError          BACnetErrorCode = 180
	BACnetErrorCodeTLSServerCertificateError          BACnetErrorCode = 181
	BACnetErrorCodeTLSClientAuthenticationFailed      BACnetErrorCode = 182
	BACnetErrorCodeTLSServerAuthenticationFailed      BACnetErrorCode = 183
	BACnetErrorCodeTLSClientCertificateExpired        BACnetErrorCode = 184
	BACnetErrorCodeTLSServerCertificateExpired        BACnetErrorCode = 185
	BACnetErrorCodeTLSClientCertificateRevoked        BACnetErrorCode = 186
	BACnetErrorCodeTLSServerCertificateRevoked        BACnetErrorCode = 187
	BACnetErrorCodeTLSError                           BACnetErrorCode = 188
	BACnetErrorCodeDNSUnavailable                     BACnetErrorCode = 189
	BACnetErrorCodeDNSNameResolutionFailed            BACnetErrorCode = 190
	BACnetErrorCodeDNSResolverFailure                 BACnetErrorCode = 191
	BACnetErrorCodeDNSError                           BACnetErrorCode = 192
	BACnetErrorCodeTCPConnectTimeout                  BACnetErrorCode = 193
	BACnetErrorCodeTCPConnectionRefused               BACnetErrorCode = 194
	BACnetErrorCodeTCPClosedByLocal                   BACnetErrorCode = 195
	BACnetErrorCodeTCPClosedOther                     BACnetErrorCode = 196
	BACnetErrorCodeTCPError                           BACnetErrorCode = 197
	BACnetErrorCodeIPAddressNotReachable              BACnetErrorCode = 198
	BACnetErrorCodeIPError                            BACnetErrorCode = 199
	BACnetErrorCodeCertificateExpired                 BACnetErrorCode = 200
	BACnetErrorCodeCertificateInvalid                 BACnetErrorCode = 201
	BACnetErrorCodeCertificateMalformed               BACnetErrorCode = 202
	BACnetErrorCodeCertificateRevoked                 BACnetErrorCode = 203
	BACnetErrorCodeReferencedPortInError              BACnetErrorCode = 205
	BACnetErrorCodeNotEnabled                         BACnetErrorCode = 206
	BACnetErrorCodeAdjustScopeRequired                BACnetErrorCode = 207
	BACnetErrorCodeAuthScopeRequired                  BACnetErrorCode = 208
	BACnetErrorCodeBindScopeRequired                  BACnetErrorCode = 209
	BACnetErrorCodeConfigScopeRequired                BACnetErrorCode = 210
	BACnetErrorCodeControlScopeRequired               BACnetErrorCode = 211
	BACnetErrorCodeExtendedScopeRequired              BACnetErrorCode = 212
	BACnetErrorCodeIncorrectClient                    BACnetErrorCode = 213
	BACnetErrorCodeInstallScopeRequired               BACnetErrorCode = 214
	BACnetErrorCodeInsufficientScope                  BACnetErrorCode = 215
	BACnetErrorCodeNoDefaultScope                     BACnetErrorCode = 216
	BACnetErrorCodeNoPolicy                           BACnetErrorCode = 217
	BACnetErrorCodeRevokedToken                       BACnetErrorCode = 218
	BACnetErrorCodeOverrideScopeRequired              BACnetErrorCode = 219
	BACnetErrorCodeInactiveToken                      BACnetErrorCode = 220
	BACnetErrorCodeUnknownAudience                    BACnetErrorCode = 221
	BACnetErrorCodeUnknownClient                      BACnetErrorCode = 222
	BACnetErrorCodeUnknownScope                       BACnetErrorCode = 223
	BACnetErrorCodeViewScopeRequired                  BACnetErrorCode = 224
	BACnetErrorCodeIncorrectAudience                  BACnetErrorCode = 225
	BACnetErrorCodeIncorrectClientOrigin              BACnetErrorCode = 226
	BACnetErrorCodeInvalidArraySize                   BACnetErrorCode = 227
	BACnetErrorCodeIncorrectIssuer                    BACnetErrorCode = 228
	BACnetErrorCodeInvalidToken                       BACnetErrorCode = 229
)

BACnetErrorCode values (ASHRAE 135).

func (BACnetErrorCode) String

func (c BACnetErrorCode) String() string

String returns the Clause 18 name of the code.

type BACnetIAm

type BACnetIAm struct {
	Device        BACnetObjectIdentifier
	MaxAPDULength uint32
	Segmentation  BACnetSegmentation
	VendorID      uint32
}

BACnetIAm is the I-Am request (Clause 16.10).

type BACnetIHave

type BACnetIHave struct {
	Device     BACnetObjectIdentifier
	Object     BACnetObjectIdentifier
	ObjectName string
}

BACnetIHave is the I-Have request (Clause 16.9).

type BACnetIPAddress

type BACnetIPAddress struct {
	IP   net.IP
	Port uint16
}

BACnetIPAddress is a B/IP or B/IPv6 address: an IP address and UDP port.

func (BACnetIPAddress) String

func (a BACnetIPAddress) String() string

String returns the address as host:port.

type BACnetKeySetFlags

type BACnetKeySetFlags uint8

BACnetKeySetFlags is the control octet of an Update-Key-Set (Clause 24.3.5).

func (BACnetKeySetFlags) ClearSet1

func (f BACnetKeySetFlags) ClearSet1() bool

ClearSet1 reports whether key set 1 is cleared before the update.

func (BACnetKeySetFlags) ClearSet2

func (f BACnetKeySetFlags) ClearSet2() bool

ClearSet2 reports whether key set 2 is cleared before the update.

func (BACnetKeySetFlags) MoreFollows

func (f BACnetKeySetFlags) MoreFollows() bool

MoreFollows reports whether further Update-Key-Set messages follow.

func (BACnetKeySetFlags) RemoveAllKeys

func (f BACnetKeySetFlags) RemoveAllKeys() bool

RemoveAllKeys reports whether every key of both sets is removed.

type BACnetKeySetTiming

type BACnetKeySetTiming struct {
	Revision       uint8
	ActivationTime uint32
	ExpirationTime uint32
}

BACnetKeySetTiming is the revision and validity period of a key set; the times are in seconds since 1970-01-01 UTC.

type BACnetKeySetUpdate

type BACnetKeySetUpdate struct {
	// HasTiming is set when the message carries Timing, HasKeys when it
	// carries Keys, which may then be empty.
	HasTiming bool
	HasKeys   bool
	Timing    BACnetKeySetTiming
	Keys      []BACnetSecurityKey
}

BACnetKeySetUpdate is what an Update-Key-Set says of one key set.

type BACnetMSTP

type BACnetMSTP struct {
	BaseLayer
	FrameType   BACnetMSTPFrameType
	Destination uint8
	Source      uint8
	// Length is the length field: the octets of data, or for an extended
	// frame the encoded octets less two.
	Length uint16

	HeaderCRC uint8
	// HeaderCRCValid is set when HeaderCRC is the CRC-8 of the header.
	HeaderCRCValid bool

	// Data is the data of the frame, COBS decoded for an extended frame
	// (in memory of its own then). It is nil when Length is 0.
	Data []byte
	// DataCRC is the CRC-16 after the data, or the CRC-32K of an extended
	// frame.
	DataCRC uint32
	// DataCRCValid is set when DataCRC is the CRC of the data as sent.
	DataCRCValid bool

	// VendorID starts the data of a proprietary frame.
	VendorID uint16
}

BACnetMSTP is a BACnet MS/TP frame (Clause 9.3). A wrong CRC is flagged, not an error, since a capture is where one looks for them.

func (*BACnetMSTP) Broadcast

func (m *BACnetMSTP) Broadcast() bool

Broadcast reports whether the frame is sent to every node.

func (*BACnetMSTP) CanDecode

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

CanDecode returns LayerTypeBACnetMSTP.

func (*BACnetMSTP) DecodeFromBytes

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

DecodeFromBytes decodes an MS/TP frame that starts at its preamble. Octets after the frame, such as the optional pad, are ignored.

func (*BACnetMSTP) LayerType

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

LayerType returns LayerTypeBACnetMSTP.

func (*BACnetMSTP) NextLayerType

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

NextLayerType returns LayerTypeBACnetNPDU for a BACnet data frame whose CRCs are right. Corrupt data is left in Data.

type BACnetMSTPFrameType

type BACnetMSTPFrameType uint8

BACnetMSTPFrameType is the type of an MS/TP frame (Clause 9.3).

const (
	BACnetMSTPToken                      BACnetMSTPFrameType = 0
	BACnetMSTPPollForMaster              BACnetMSTPFrameType = 1
	BACnetMSTPReplyToPollForMaster       BACnetMSTPFrameType = 2
	BACnetMSTPTestRequest                BACnetMSTPFrameType = 3
	BACnetMSTPTestResponse               BACnetMSTPFrameType = 4
	BACnetMSTPDataExpectingReply         BACnetMSTPFrameType = 5
	BACnetMSTPDataNotExpectingReply      BACnetMSTPFrameType = 6
	BACnetMSTPReplyPostponed             BACnetMSTPFrameType = 7
	BACnetMSTPExtendedDataExpectingReply BACnetMSTPFrameType = 32
	BACnetMSTPExtendedDataNoReply        BACnetMSTPFrameType = 33
	BACnetMSTPIPv6Encapsulation          BACnetMSTPFrameType = 34
)

BACnetMSTPFrameType values.

func (BACnetMSTPFrameType) Extended

func (t BACnetMSTPFrameType) Extended() bool

Extended reports whether frames of the type are COBS encoded and protected by a CRC-32K (Clause 9.10).

func (BACnetMSTPFrameType) Proprietary

func (t BACnetMSTPFrameType) Proprietary() bool

Proprietary reports whether the type is a vendor's, in which case the data starts with the vendor identifier.

func (BACnetMSTPFrameType) String

func (t BACnetMSTPFrameType) String() string

String returns the Clause 9.3 name of the frame type.

type BACnetMaxAPDU

type BACnetMaxAPDU uint8

BACnetMaxAPDU is the encoded maximum APDU length a client accepts (Clause 20.1.2.5).

const (
	BACnetMaxAPDU50   BACnetMaxAPDU = 0
	BACnetMaxAPDU128  BACnetMaxAPDU = 1
	BACnetMaxAPDU206  BACnetMaxAPDU = 2
	BACnetMaxAPDU480  BACnetMaxAPDU = 3
	BACnetMaxAPDU1024 BACnetMaxAPDU = 4
	BACnetMaxAPDU1476 BACnetMaxAPDU = 5
)

BACnetMaxAPDU values.

func (BACnetMaxAPDU) Octets

func (m BACnetMaxAPDU) Octets() int

Octets returns the length in octets, or 0 for a reserved value.

func (BACnetMaxAPDU) String

func (m BACnetMaxAPDU) String() string

String returns the length in octets.

type BACnetMaxSegments

type BACnetMaxSegments uint8

BACnetMaxSegments is the encoded number of segments a client accepts in a response (Clause 20.1.2.4).

const (
	BACnetMaxSegmentsUnspecified BACnetMaxSegments = 0
	BACnetMaxSegments2           BACnetMaxSegments = 1
	BACnetMaxSegments4           BACnetMaxSegments = 2
	BACnetMaxSegments8           BACnetMaxSegments = 3
	BACnetMaxSegments16          BACnetMaxSegments = 4
	BACnetMaxSegments32          BACnetMaxSegments = 5
	BACnetMaxSegments64          BACnetMaxSegments = 6
	BACnetMaxSegmentsMore64      BACnetMaxSegments = 7
)

BACnetMaxSegments values.

func (BACnetMaxSegments) Segments

func (m BACnetMaxSegments) Segments() int

Segments returns the number of segments, 0 when unspecified and -1 for more than 64.

func (BACnetMaxSegments) String

func (m BACnetMaxSegments) String() string

String returns the segment count.

type BACnetNPDU

type BACnetNPDU struct {
	BaseLayer
	Version uint8
	Control BACnetNPDUControl

	// DNET and DADR name the destination network and MAC address; an empty
	// DADR is a broadcast on DNET, and DNET 0xFFFF a global broadcast.
	DNET     uint16
	DADR     []byte
	SNET     uint16
	SADR     []byte
	HopCount uint8

	MessageType BACnetNetworkMessageType
	// VendorID is set for proprietary message types.
	VendorID uint16
	// Body is the raw network layer message after its type (and vendor ID).
	Body []byte
	// Security is the security wrapper of the network security messages,
	// Challenge-Request to Set-Master-Key, or nil when Body is not a whole
	// wrapper. What the wrapper secures is its Message, unless encrypted.
	Security *BACnetSecurityWrapper

	// Networks is the DNET list of Who-Is-Router (at most one),
	// I-Am-Router, Router-Busy and Router-Available, and the single network
	// of I-Could-Be-Router, Reject-Message, Establish-Connection,
	// Disconnect-Connection and Network-Number-Is.
	Networks []uint16
	// PerformanceIndex is set by I-Could-Be-Router-To-Network.
	PerformanceIndex uint8
	// RejectReason is set by Reject-Message-To-Network.
	RejectReason BACnetNetworkRejectReason
	// TerminationTime is the Establish-Connection-To-Network time, in seconds.
	TerminationTime uint8
	// NetworkNumberStatus is set by Network-Number-Is.
	NetworkNumberStatus BACnetNetworkNumberStatus
	// RoutingTable holds the Initialize-Routing-Table(-Ack) entries.
	RoutingTable []BACnetRoutingEntry
}

BACnetNPDU is the BACnet network layer header (Clause 6.2). The destination, source and network message fields are set only when the control octet says they are present.

func (*BACnetNPDU) CanDecode

func (n *BACnetNPDU) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeBACnetNPDU.

func (*BACnetNPDU) DecodeFromBytes

func (n *BACnetNPDU) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes an NPDU.

func (*BACnetNPDU) LayerType

func (n *BACnetNPDU) LayerType() gopacket.LayerType

LayerType returns LayerTypeBACnetNPDU.

func (*BACnetNPDU) NextLayerType

func (n *BACnetNPDU) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeBACnetAPDU when the NPDU carries an APDU: directly, or in a Security-Payload that is not encrypted. The other network layer messages end the packet.

type BACnetNPDUControl

type BACnetNPDUControl uint8

BACnetNPDUControl is the NPCI control octet (Clause 6.2.2).

func (BACnetNPDUControl) ExpectingReply

func (c BACnetNPDUControl) ExpectingReply() bool

ExpectingReply reports whether the sender expects a reply.

func (BACnetNPDUControl) HasDestination

func (c BACnetNPDUControl) HasDestination() bool

HasDestination reports whether DNET, DLEN, DADR and the hop count are present.

func (BACnetNPDUControl) HasSource

func (c BACnetNPDUControl) HasSource() bool

HasSource reports whether SNET, SLEN and SADR are present.

func (BACnetNPDUControl) NetworkMessage

func (c BACnetNPDUControl) NetworkMessage() bool

NetworkMessage reports whether the NPDU carries a network layer message instead of an APDU.

func (BACnetNPDUControl) Priority

func (c BACnetNPDUControl) Priority() BACnetPriority

Priority returns the network priority.

type BACnetNetworkMessageType

type BACnetNetworkMessageType uint8

BACnetNetworkMessageType is a network layer message type (Clause 6.2.4).

const (
	BACnetNetworkMessageWhoIsRouterToNetwork          BACnetNetworkMessageType = 0x00
	BACnetNetworkMessageIAmRouterToNetwork            BACnetNetworkMessageType = 0x01
	BACnetNetworkMessageICouldBeRouterToNetwork       BACnetNetworkMessageType = 0x02
	BACnetNetworkMessageRejectMessageToNetwork        BACnetNetworkMessageType = 0x03
	BACnetNetworkMessageRouterBusyToNetwork           BACnetNetworkMessageType = 0x04
	BACnetNetworkMessageRouterAvailableToNetwork      BACnetNetworkMessageType = 0x05
	BACnetNetworkMessageInitializeRoutingTable        BACnetNetworkMessageType = 0x06
	BACnetNetworkMessageInitializeRoutingTableAck     BACnetNetworkMessageType = 0x07
	BACnetNetworkMessageEstablishConnectionToNetwork  BACnetNetworkMessageType = 0x08
	BACnetNetworkMessageDisconnectConnectionToNetwork BACnetNetworkMessageType = 0x09
	BACnetNetworkMessageChallengeRequest              BACnetNetworkMessageType = 0x0A
	BACnetNetworkMessageSecurityPayload               BACnetNetworkMessageType = 0x0B
	BACnetNetworkMessageSecurityResponse              BACnetNetworkMessageType = 0x0C
	BACnetNetworkMessageRequestKeyUpdate              BACnetNetworkMessageType = 0x0D
	BACnetNetworkMessageUpdateKeySet                  BACnetNetworkMessageType = 0x0E
	BACnetNetworkMessageUpdateDistributionKey         BACnetNetworkMessageType = 0x0F
	BACnetNetworkMessageRequestMasterKey              BACnetNetworkMessageType = 0x10
	BACnetNetworkMessageSetMasterKey                  BACnetNetworkMessageType = 0x11
	BACnetNetworkMessageWhatIsNetworkNumber           BACnetNetworkMessageType = 0x12
	BACnetNetworkMessageNetworkNumberIs               BACnetNetworkMessageType = 0x13
)

BACnetNetworkMessageType values. Types from 0x80 are proprietary and carry a vendor ID.

func (BACnetNetworkMessageType) String

func (t BACnetNetworkMessageType) String() string

String returns the Clause 6 name of the message type.

type BACnetNetworkNumberStatus

type BACnetNetworkNumberStatus uint8

BACnetNetworkNumberStatus tells how a router knows the number of the network in a Network-Number-Is (Clause 6.4.20).

const (
	BACnetNetworkNumberLearned    BACnetNetworkNumberStatus = 0
	BACnetNetworkNumberConfigured BACnetNetworkNumberStatus = 1
)

BACnetNetworkNumberStatus values.

type BACnetNetworkRejectReason

type BACnetNetworkRejectReason uint8

BACnetNetworkRejectReason is the reason of a Reject-Message-To-Network (Clause 6.4.4).

const (
	BACnetNetworkRejectOther           BACnetNetworkRejectReason = 0
	BACnetNetworkRejectUnknownNetwork  BACnetNetworkRejectReason = 1
	BACnetNetworkRejectRouterBusy      BACnetNetworkRejectReason = 2
	BACnetNetworkRejectUnknownMessage  BACnetNetworkRejectReason = 3
	BACnetNetworkRejectMessageTooLong  BACnetNetworkRejectReason = 4
	BACnetNetworkRejectSecurityError   BACnetNetworkRejectReason = 5
	BACnetNetworkRejectAddressingError BACnetNetworkRejectReason = 6
)

BACnetNetworkRejectReason values.

func (BACnetNetworkRejectReason) String

func (r BACnetNetworkRejectReason) String() string

String returns the description of the reject reason.

type BACnetObjectIdentifier

type BACnetObjectIdentifier struct {
	Type     BACnetObjectType
	Instance uint32
}

BACnetObjectIdentifier names an object: a 10-bit type and a 22-bit instance number (Clause 20.2.14).

func (BACnetObjectIdentifier) String

func (o BACnetObjectIdentifier) String() string

String returns the identifier as type,instance.

type BACnetObjectType

type BACnetObjectType uint16

BACnetObjectType is the object type of a BACnetObjectIdentifier (Clause 21).

const (
	BACnetObjectTypeAnalogInput           BACnetObjectType = 0
	BACnetObjectTypeAnalogOutput          BACnetObjectType = 1
	BACnetObjectTypeAnalogValue           BACnetObjectType = 2
	BACnetObjectTypeBinaryInput           BACnetObjectType = 3
	BACnetObjectTypeBinaryOutput          BACnetObjectType = 4
	BACnetObjectTypeBinaryValue           BACnetObjectType = 5
	BACnetObjectTypeCalendar              BACnetObjectType = 6
	BACnetObjectTypeCommand               BACnetObjectType = 7
	BACnetObjectTypeDevice                BACnetObjectType = 8
	BACnetObjectTypeEventEnrollment       BACnetObjectType = 9
	BACnetObjectTypeFile                  BACnetObjectType = 10
	BACnetObjectTypeGroup                 BACnetObjectType = 11
	BACnetObjectTypeLoop                  BACnetObjectType = 12
	BACnetObjectTypeMultiStateInput       BACnetObjectType = 13
	BACnetObjectTypeMultiStateOutput      BACnetObjectType = 14
	BACnetObjectTypeNotificationClass     BACnetObjectType = 15
	BACnetObjectTypeProgram               BACnetObjectType = 16
	BACnetObjectTypeSchedule              BACnetObjectType = 17
	BACnetObjectTypeAveraging             BACnetObjectType = 18
	BACnetObjectTypeMultiStateValue       BACnetObjectType = 19
	BACnetObjectTypeTrendLog              BACnetObjectType = 20
	BACnetObjectTypeLifeSafetyPoint       BACnetObjectType = 21
	BACnetObjectTypeLifeSafetyZone        BACnetObjectType = 22
	BACnetObjectTypeAccumulator           BACnetObjectType = 23
	BACnetObjectTypePulseConverter        BACnetObjectType = 24
	BACnetObjectTypeEventLog              BACnetObjectType = 25
	BACnetObjectTypeGlobalGroup           BACnetObjectType = 26
	BACnetObjectTypeTrendLogMultiple      BACnetObjectType = 27
	BACnetObjectTypeLoadControl           BACnetObjectType = 28
	BACnetObjectTypeStructuredView        BACnetObjectType = 29
	BACnetObjectTypeAccessDoor            BACnetObjectType = 30
	BACnetObjectTypeTimer                 BACnetObjectType = 31
	BACnetObjectTypeAccessCredential      BACnetObjectType = 32
	BACnetObjectTypeAccessPoint           BACnetObjectType = 33
	BACnetObjectTypeAccessRights          BACnetObjectType = 34
	BACnetObjectTypeAccessUser            BACnetObjectType = 35
	BACnetObjectTypeAccessZone            BACnetObjectType = 36
	BACnetObjectTypeCredentialDataInput   BACnetObjectType = 37
	BACnetObjectTypeNetworkSecurity       BACnetObjectType = 38
	BACnetObjectTypeBitstringValue        BACnetObjectType = 39
	BACnetObjectTypeCharacterstringValue  BACnetObjectType = 40
	BACnetObjectTypeDatePatternValue      BACnetObjectType = 41
	BACnetObjectTypeDateValue             BACnetObjectType = 42
	BACnetObjectTypeDatetimePatternValue  BACnetObjectType = 43
	BACnetObjectTypeDatetimeValue         BACnetObjectType = 44
	BACnetObjectTypeIntegerValue          BACnetObjectType = 45
	BACnetObjectTypeLargeAnalogValue      BACnetObjectType = 46
	BACnetObjectTypeOctetstringValue      BACnetObjectType = 47
	BACnetObjectTypePositiveIntegerValue  BACnetObjectType = 48
	BACnetObjectTypeTimePatternValue      BACnetObjectType = 49
	BACnetObjectTypeTimeValue             BACnetObjectType = 50
	BACnetObjectTypeNotificationForwarder BACnetObjectType = 51
	BACnetObjectTypeAlertEnrollment       BACnetObjectType = 52
	BACnetObjectTypeChannel               BACnetObjectType = 53
	BACnetObjectTypeLightingOutput        BACnetObjectType = 54
	BACnetObjectTypeBinaryLightingOutput  BACnetObjectType = 55
	BACnetObjectTypeNetworkPort           BACnetObjectType = 56
	BACnetObjectTypeElevatorGroup         BACnetObjectType = 57
	BACnetObjectTypeEscalator             BACnetObjectType = 58
	BACnetObjectTypeLift                  BACnetObjectType = 59
	BACnetObjectTypeStaging               BACnetObjectType = 60
	BACnetObjectTypeAuditLog              BACnetObjectType = 61
	BACnetObjectTypeAuditReporter         BACnetObjectType = 62
	BACnetObjectTypeColor                 BACnetObjectType = 63
	BACnetObjectTypeColorTemperature      BACnetObjectType = 64
)

BACnetObjectType values (ASHRAE 135).

func (BACnetObjectType) String

func (t BACnetObjectType) String() string

String returns the Clause 21 name of the object type; types from 128 are proprietary.

type BACnetPDUType

type BACnetPDUType uint8

BACnetPDUType is the APDU type (Clause 20.1.1).

const (
	BACnetPDUConfirmedRequest   BACnetPDUType = 0
	BACnetPDUUnconfirmedRequest BACnetPDUType = 1
	BACnetPDUSimpleACK          BACnetPDUType = 2
	BACnetPDUComplexACK         BACnetPDUType = 3
	BACnetPDUSegmentACK         BACnetPDUType = 4
	BACnetPDUError              BACnetPDUType = 5
	BACnetPDUReject             BACnetPDUType = 6
	BACnetPDUAbort              BACnetPDUType = 7
)

BACnetPDUType values.

func (BACnetPDUType) String

func (t BACnetPDUType) String() string

String returns the Clause 20 name of the PDU type.

type BACnetParameters

type BACnetParameters struct {
	Fields []BACnetValue
}

BACnetParameters is the ServiceData of the services that have no type of their own: the parameters as named, typed values, in the order and under the names of the service's Clause 21 production.

func (*BACnetParameters) Field

func (p *BACnetParameters) Field(name string) *BACnetValue

Field returns the first parameter named name, or nil.

type BACnetPriority

type BACnetPriority uint8

BACnetPriority is the network priority of an NPDU (Clause 6.2.2).

const (
	BACnetPriorityNormal            BACnetPriority = 0
	BACnetPriorityUrgent            BACnetPriority = 1
	BACnetPriorityCriticalEquipment BACnetPriority = 2
	BACnetPriorityLifeSafety        BACnetPriority = 3
)

BACnetPriority values.

func (BACnetPriority) String

func (p BACnetPriority) String() string

String returns the name of the priority.

type BACnetPropertyIdentifier

type BACnetPropertyIdentifier uint32

BACnetPropertyIdentifier is a BACnetPropertyIdentifier (Clause 21).

const (
	BACnetPropertyAckedTransition                  BACnetPropertyIdentifier = 0
	BACnetPropertyAckRequired                      BACnetPropertyIdentifier = 1
	BACnetPropertyAction                           BACnetPropertyIdentifier = 2
	BACnetPropertyActionText                       BACnetPropertyIdentifier = 3
	BACnetPropertyActiveText                       BACnetPropertyIdentifier = 4
	BACnetPropertyActiveVtSession                  BACnetPropertyIdentifier = 5
	BACnetPropertyAlarmValue                       BACnetPropertyIdentifier = 6
	BACnetPropertyAlarmValues                      BACnetPropertyIdentifier = 7
	BACnetPropertyAll                              BACnetPropertyIdentifier = 8
	BACnetPropertyAllWritesSuccessful              BACnetPropertyIdentifier = 9
	BACnetPropertyApduSegmentTimeout               BACnetPropertyIdentifier = 10
	BACnetPropertyApduTimeout                      BACnetPropertyIdentifier = 11
	BACnetPropertyApplicationSoftwareVersion       BACnetPropertyIdentifier = 12
	BACnetPropertyArchive                          BACnetPropertyIdentifier = 13
	BACnetPropertyBias                             BACnetPropertyIdentifier = 14
	BACnetPropertyChangeOfStateCount               BACnetPropertyIdentifier = 15
	BACnetPropertyChangeOfStateTime                BACnetPropertyIdentifier = 16
	BACnetPropertyNotificationClass                BACnetPropertyIdentifier = 17
	BACnetPropertyThePropertyInThisPlaceWasDeleted BACnetPropertyIdentifier = 18
	BACnetPropertyControlledVariableReference      BACnetPropertyIdentifier = 19
	BACnetPropertyControlledVariableUnits          BACnetPropertyIdentifier = 20
	BACnetPropertyControlledVariableValue          BACnetPropertyIdentifier = 21
	BACnetPropertyCovIncrement                     BACnetPropertyIdentifier = 22
	BACnetPropertyDatelist                         BACnetPropertyIdentifier = 23
	BACnetPropertyDaylightsSavingsStatus           BACnetPropertyIdentifier = 24
	BACnetPropertyDeadband                         BACnetPropertyIdentifier = 25
	BACnetPropertyDerivativeConstant               BACnetPropertyIdentifier = 26
	BACnetPropertyDerivativeConstantUnits          BACnetPropertyIdentifier = 27
	BACnetPropertyDescription                      BACnetPropertyIdentifier = 28
	BACnetPropertyDescriptionOfHalt                BACnetPropertyIdentifier = 29
	BACnetPropertyDeviceAddressBinding             BACnetPropertyIdentifier = 30
	BACnetPropertyDeviceType                       BACnetPropertyIdentifier = 31
	BACnetPropertyEffectivePeriod                  BACnetPropertyIdentifier = 32
	BACnetPropertyElapsedActiveTime                BACnetPropertyIdentifier = 33
	BACnetPropertyErrorLimit                       BACnetPropertyIdentifier = 34
	BACnetPropertyEventEnable                      BACnetPropertyIdentifier = 35
	BACnetPropertyEventState                       BACnetPropertyIdentifier = 36
	BACnetPropertyEventType                        BACnetPropertyIdentifier = 37
	BACnetPropertyExceptionSchedule                BACnetPropertyIdentifier = 38
	BACnetPropertyFaultValues                      BACnetPropertyIdentifier = 39
	BACnetPropertyFeedbackValue                    BACnetPropertyIdentifier = 40
	BACnetPropertyFileAccessMethod                 BACnetPropertyIdentifier = 41
	BACnetPropertyFileSize                         BACnetPropertyIdentifier = 42
	BACnetPropertyFileType                         BACnetPropertyIdentifier = 43
	BACnetPropertyFirmwareRevision                 BACnetPropertyIdentifier = 44
	BACnetPropertyHighLimit                        BACnetPropertyIdentifier = 45
	BACnetPropertyInactiveText                     BACnetPropertyIdentifier = 46
	BACnetPropertyInProcess                        BACnetPropertyIdentifier = 47
	BACnetPropertyInstanceOf                       BACnetPropertyIdentifier = 48
	BACnetPropertyIntegralConstant                 BACnetPropertyIdentifier = 49
	BACnetPropertyIntegralConstantUnits            BACnetPropertyIdentifier = 50
	BACnetPropertyIssueConfirmedNotifications      BACnetPropertyIdentifier = 51
	BACnetPropertyLimitEnable                      BACnetPropertyIdentifier = 52
	BACnetPropertyListOfGroupMembers               BACnetPropertyIdentifier = 53
	BACnetPropertyListOfObjectPropertyReferences   BACnetPropertyIdentifier = 54
	BACnetPropertyListOfSessionKeys                BACnetPropertyIdentifier = 55
	BACnetPropertyLocalDate                        BACnetPropertyIdentifier = 56
	BACnetPropertyLocalTime                        BACnetPropertyIdentifier = 57
	BACnetPropertyLocation                         BACnetPropertyIdentifier = 58
	BACnetPropertyLowLimit                         BACnetPropertyIdentifier = 59
	BACnetPropertyManipulatedVariableReference     BACnetPropertyIdentifier = 60
	BACnetPropertyMaximumOutput                    BACnetPropertyIdentifier = 61
	BACnetPropertyMaxApduLengthAccepted            BACnetPropertyIdentifier = 62
	BACnetPropertyMaxInfoFrames                    BACnetPropertyIdentifier = 63
	BACnetPropertyMaxMaster                        BACnetPropertyIdentifier = 64
	BACnetPropertyMaxPresValue                     BACnetPropertyIdentifier = 65
	BACnetPropertyMinimumOffTime                   BACnetPropertyIdentifier = 66
	BACnetPropertyMinimumOnTime                    BACnetPropertyIdentifier = 67
	BACnetPropertyMinimumOutput                    BACnetPropertyIdentifier = 68
	BACnetPropertyMinPresValue                     BACnetPropertyIdentifier = 69
	BACnetPropertyModelName                        BACnetPropertyIdentifier = 70
	BACnetPropertyModificationDate                 BACnetPropertyIdentifier = 71
	BACnetPropertyNotifyType                       BACnetPropertyIdentifier = 72
	BACnetPropertyNumberOfAPDURetries              BACnetPropertyIdentifier = 73
	BACnetPropertyNumberOfStates                   BACnetPropertyIdentifier = 74
	BACnetPropertyObjectIdentifier                 BACnetPropertyIdentifier = 75
	BACnetPropertyObjectList                       BACnetPropertyIdentifier = 76
	BACnetPropertyObjectName                       BACnetPropertyIdentifier = 77
	BACnetPropertyObjectPropertyReference          BACnetPropertyIdentifier = 78
	BACnetPropertyObjectType                       BACnetPropertyIdentifier = 79
	BACnetPropertyOptional                         BACnetPropertyIdentifier = 80
	BACnetPropertyOutOfService                     BACnetPropertyIdentifier = 81
	BACnetPropertyOutputUnits                      BACnetPropertyIdentifier = 82
	BACnetPropertyEventParameters                  BACnetPropertyIdentifier = 83
	BACnetPropertyPolarity                         BACnetPropertyIdentifier = 84
	BACnetPropertyPresentValue                     BACnetPropertyIdentifier = 85
	BACnetPropertyPriority                         BACnetPropertyIdentifier = 86
	BACnetPropertyPriorityArray                    BACnetPropertyIdentifier = 87
	BACnetPropertyPriorityForWriting               BACnetPropertyIdentifier = 88
	BACnetPropertyProcessIdentifier                BACnetPropertyIdentifier = 89
	BACnetPropertyProgramChange                    BACnetPropertyIdentifier = 90
	BACnetPropertyProgramLocation                  BACnetPropertyIdentifier = 91
	BACnetPropertyProgramState                     BACnetPropertyIdentifier = 92
	BACnetPropertyProportionalConstant             BACnetPropertyIdentifier = 93
	BACnetPropertyProportionalConstantUnits        BACnetPropertyIdentifier = 94
	BACnetPropertyProtocolConformanceClass         BACnetPropertyIdentifier = 95
	BACnetPropertyProtocolObjectTypesSupported     BACnetPropertyIdentifier = 96
	BACnetPropertyProtocolServicesSupported        BACnetPropertyIdentifier = 97
	BACnetPropertyProtocolVersion                  BACnetPropertyIdentifier = 98
	BACnetPropertyReadOnly                         BACnetPropertyIdentifier = 99
	BACnetPropertyReasonForHalt                    BACnetPropertyIdentifier = 100
	BACnetPropertyRecipient                        BACnetPropertyIdentifier = 101
	BACnetPropertyRecipientList                    BACnetPropertyIdentifier = 102
	BACnetPropertyReliability                      BACnetPropertyIdentifier = 103
	BACnetPropertyRelinquishDefault                BACnetPropertyIdentifier = 104
	BACnetPropertyRequired                         BACnetPropertyIdentifier = 105
	BACnetPropertyResolution                       BACnetPropertyIdentifier = 106
	BACnetPropertySegmentationSupported            BACnetPropertyIdentifier = 107
	BACnetPropertySetpoint                         BACnetPropertyIdentifier = 108
	BACnetPropertySetpointReference                BACnetPropertyIdentifier = 109
	BACnetPropertyStateText                        BACnetPropertyIdentifier = 110
	BACnetPropertyStatusFlags                      BACnetPropertyIdentifier = 111
	BACnetPropertySystemStatus                     BACnetPropertyIdentifier = 112
	BACnetPropertyTimeDelay                        BACnetPropertyIdentifier = 113
	BACnetPropertyTimeOfActiveTimeReset            BACnetPropertyIdentifier = 114
	BACnetPropertyTimeOfStateCountReset            BACnetPropertyIdentifier = 115
	BACnetPropertyTimeSynchronizationRecipients    BACnetPropertyIdentifier = 116
	BACnetPropertyUnits                            BACnetPropertyIdentifier = 117
	BACnetPropertyUpdateInterval                   BACnetPropertyIdentifier = 118
	BACnetPropertyUtcOffset                        BACnetPropertyIdentifier = 119
	BACnetPropertyVendorIdentifier                 BACnetPropertyIdentifier = 120
	BACnetPropertyVendorName                       BACnetPropertyIdentifier = 121
	BACnetPropertyVtClassSupported                 BACnetPropertyIdentifier = 122
	BACnetPropertyWeeklySchedule                   BACnetPropertyIdentifier = 123
	BACnetPropertyAttemptedSamples                 BACnetPropertyIdentifier = 124
	BACnetPropertyAverageValue                     BACnetPropertyIdentifier = 125
	BACnetPropertyBufferSize                       BACnetPropertyIdentifier = 126
	BACnetPropertyClientCovIncrement               BACnetPropertyIdentifier = 127
	BACnetPropertyCovResubscriptionInterval        BACnetPropertyIdentifier = 128
	BACnetPropertyCurrentNotifyTime                BACnetPropertyIdentifier = 129
	BACnetPropertyEventTimeStamp                   BACnetPropertyIdentifier = 130
	BACnetPropertyLogBuffer                        BACnetPropertyIdentifier = 131
	BACnetPropertyLogDeviceObjectProperty          BACnetPropertyIdentifier = 132
	BACnetPropertyEnable                           BACnetPropertyIdentifier = 133
	BACnetPropertyLogInterval                      BACnetPropertyIdentifier = 134
	BACnetPropertyMaximumValue                     BACnetPropertyIdentifier = 135
	BACnetPropertyMinimumValue                     BACnetPropertyIdentifier = 136
	BACnetPropertyNotificationThreshold            BACnetPropertyIdentifier = 137
	BACnetPropertyPreviousNotifyTime               BACnetPropertyIdentifier = 138
	BACnetPropertyProtocolRevision                 BACnetPropertyIdentifier = 139
	BACnetPropertyRecordsSinceNotification         BACnetPropertyIdentifier = 140
	BACnetPropertyRecordCount                      BACnetPropertyIdentifier = 141
	BACnetPropertyStartTime                        BACnetPropertyIdentifier = 142
	BACnetPropertyStopTime                         BACnetPropertyIdentifier = 143
	BACnetPropertyStopWhenFull                     BACnetPropertyIdentifier = 144
	BACnetPropertyTotalRecordCount                 BACnetPropertyIdentifier = 145
	BACnetPropertyValidSamples                     BACnetPropertyIdentifier = 146
	BACnetPropertyWindowInterval                   BACnetPropertyIdentifier = 147
	BACnetPropertyWindowSamples                    BACnetPropertyIdentifier = 148
	BACnetPropertyMaximumValueTimeStamp            BACnetPropertyIdentifier = 149
	BACnetPropertyMinimumValueTimeStamp            BACnetPropertyIdentifier = 150
	BACnetPropertyVarianceValue                    BACnetPropertyIdentifier = 151
	BACnetPropertyActiveCovSubscriptions           BACnetPropertyIdentifier = 152
	BACnetPropertyBackupFailureTimeout             BACnetPropertyIdentifier = 153
	BACnetPropertyConfigurationFiles               BACnetPropertyIdentifier = 154
	BACnetPropertyDatabaseRevision                 BACnetPropertyIdentifier = 155
	BACnetPropertyDirectReading                    BACnetPropertyIdentifier = 156
	BACnetPropertyLastRestoreTime                  BACnetPropertyIdentifier = 157
	BACnetPropertyMaintenanceRequired              BACnetPropertyIdentifier = 158
	BACnetPropertyMemberOf                         BACnetPropertyIdentifier = 159
	BACnetPropertyMode                             BACnetPropertyIdentifier = 160
	BACnetPropertyOperationExpected                BACnetPropertyIdentifier = 161
	BACnetPropertySetting                          BACnetPropertyIdentifier = 162
	BACnetPropertySilenced                         BACnetPropertyIdentifier = 163
	BACnetPropertyTrackingValue                    BACnetPropertyIdentifier = 164
	BACnetPropertyZoneMembers                      BACnetPropertyIdentifier = 165
	BACnetPropertyLifeSafetyAlarmValues            BACnetPropertyIdentifier = 166
	BACnetPropertyMaxSegmentsAccepted              BACnetPropertyIdentifier = 167
	BACnetPropertyProfileName                      BACnetPropertyIdentifier = 168
	BACnetPropertyAutoSlaveDiscovery               BACnetPropertyIdentifier = 169
	BACnetPropertyManualSlaveAddressBinding        BACnetPropertyIdentifier = 170
	BACnetPropertySlaveAddressBinding              BACnetPropertyIdentifier = 171
	BACnetPropertySlaveProxyEnable                 BACnetPropertyIdentifier = 172
	BACnetPropertyLastNotifyRecord                 BACnetPropertyIdentifier = 173
	BACnetPropertyScheduleDefault                  BACnetPropertyIdentifier = 174
	BACnetPropertyAcceptedModes                    BACnetPropertyIdentifier = 175
	BACnetPropertyAdjustValue                      BACnetPropertyIdentifier = 176
	BACnetPropertyCount                            BACnetPropertyIdentifier = 177
	BACnetPropertyCountBeforeChange                BACnetPropertyIdentifier = 178
	BACnetPropertyCountChangeTime                  BACnetPropertyIdentifier = 179
	BACnetPropertyCovPeriod                        BACnetPropertyIdentifier = 180
	BACnetPropertyInputReference                   BACnetPropertyIdentifier = 181
	BACnetPropertyLimitMonitoringInterval          BACnetPropertyIdentifier = 182
	BACnetPropertyLoggingObject                    BACnetPropertyIdentifier = 183
	BACnetPropertyLoggingRecord                    BACnetPropertyIdentifier = 184
	BACnetPropertyPrescale                         BACnetPropertyIdentifier = 185
	BACnetPropertyPulseRate                        BACnetPropertyIdentifier = 186
	BACnetPropertyScale                            BACnetPropertyIdentifier = 187
	BACnetPropertyScaleFactor                      BACnetPropertyIdentifier = 188
	BACnetPropertyUpdateTime                       BACnetPropertyIdentifier = 189
	BACnetPropertyValueBeforeChange                BACnetPropertyIdentifier = 190
	BACnetPropertyValueSet                         BACnetPropertyIdentifier = 191
	BACnetPropertyValueChangeTime                  BACnetPropertyIdentifier = 192
	BACnetPropertyAlignIntervals                   BACnetPropertyIdentifier = 193
	BACnetPropertyIntervalOffset                   BACnetPropertyIdentifier = 195
	BACnetPropertyLastRestartReason                BACnetPropertyIdentifier = 196
	BACnetPropertyLoggingType                      BACnetPropertyIdentifier = 197
	BACnetPropertyNotificationPeriod               BACnetPropertyIdentifier = 199
	BACnetPropertyPreviousNotifyRecord             BACnetPropertyIdentifier = 200
	BACnetPropertyRestartNotificationRecipients    BACnetPropertyIdentifier = 202
	BACnetPropertyTimeOfDeviceRestart              BACnetPropertyIdentifier = 203
	BACnetPropertyTimeSynchronizationInterval      BACnetPropertyIdentifier = 204
	BACnetPropertyTrigger                          BACnetPropertyIdentifier = 205
	BACnetPropertyUTCTimeSynchronizationRecipients BACnetPropertyIdentifier = 206
	BACnetPropertyNodeSubtype                      BACnetPropertyIdentifier = 207
	BACnetPropertyNodeType                         BACnetPropertyIdentifier = 208
	BACnetPropertyStructuredObjectList             BACnetPropertyIdentifier = 209
	BACnetPropertySubordinateAnnotations           BACnetPropertyIdentifier = 210
	BACnetPropertySubordinateList                  BACnetPropertyIdentifier = 211
	BACnetPropertyActualShedLevel                  BACnetPropertyIdentifier = 212
	BACnetPropertyDutyWindow                       BACnetPropertyIdentifier = 213
	BACnetPropertyExpectedShedLevel                BACnetPropertyIdentifier = 214
	BACnetPropertyFullDutyBaseline                 BACnetPropertyIdentifier = 215
	BACnetPropertyRequestedShedLevel               BACnetPropertyIdentifier = 218
	BACnetPropertyShedDuration                     BACnetPropertyIdentifier = 219
	BACnetPropertyShedLevelDescriptions            BACnetPropertyIdentifier = 220
	BACnetPropertyShedLevels                       BACnetPropertyIdentifier = 221
	BACnetPropertyStateDescription                 BACnetPropertyIdentifier = 222
	BACnetPropertyDoorAlarmState                   BACnetPropertyIdentifier = 226
	BACnetPropertyDoorExtendedPulseTime            BACnetPropertyIdentifier = 227
	BACnetPropertyDoorMembers                      BACnetPropertyIdentifier = 228
	BACnetPropertyDoorOpenTooLongTime              BACnetPropertyIdentifier = 229
	BACnetPropertyDoorPulseTime                    BACnetPropertyIdentifier = 230
	BACnetPropertyDoorStatus                       BACnetPropertyIdentifier = 231
	BACnetPropertyDoorUnlockDelayTime              BACnetPropertyIdentifier = 232
	BACnetPropertyLockStatus                       BACnetPropertyIdentifier = 233
	BACnetPropertyMaskedAlarmValues                BACnetPropertyIdentifier = 234
	BACnetPropertySecuredStatus                    BACnetPropertyIdentifier = 235
	BACnetPropertyAbsenteeLimit                    BACnetPropertyIdentifier = 244
	BACnetPropertyAccessAlarmEvents                BACnetPropertyIdentifier = 245
	BACnetPropertyAccessDoors                      BACnetPropertyIdentifier = 246
	BACnetPropertyAccessEvent                      BACnetPropertyIdentifier = 247
	BACnetPropertyAccessEventAuthenticationFactor  BACnetPropertyIdentifier = 248
	BACnetPropertyAccessEventCredential            BACnetPropertyIdentifier = 249
	BACnetPropertyAccessEventTime                  BACnetPropertyIdentifier = 250
	BACnetPropertyAccessTransactionEvents          BACnetPropertyIdentifier = 251
	BACnetPropertyAccompaniment                    BACnetPropertyIdentifier = 252
	BACnetPropertyAccompanimentTime                BACnetPropertyIdentifier = 253
	BACnetPropertyActivationTime                   BACnetPropertyIdentifier = 254
	BACnetPropertyActiveAuthenticationPolicy       BACnetPropertyIdentifier = 255
	BACnetPropertyAssignedAccessRights             BACnetPropertyIdentifier = 256
	BACnetPropertyAuthenticationFactors            BACnetPropertyIdentifier = 257
	BACnetPropertyAuthenticationPolicyList         BACnetPropertyIdentifier = 258
	BACnetPropertyAuthenticationPolicyNames        BACnetPropertyIdentifier = 259
	BACnetPropertyAuthenticationStatus             BACnetPropertyIdentifier = 260
	BACnetPropertyAuthorizationMode                BACnetPropertyIdentifier = 261
	BACnetPropertyBelongsTo                        BACnetPropertyIdentifier = 262
	BACnetPropertyCredentialDisable                BACnetPropertyIdentifier = 263
	BACnetPropertyCredentialStatus                 BACnetPropertyIdentifier = 264
	BACnetPropertyCredentials                      BACnetPropertyIdentifier = 265
	BACnetPropertyCredentialsInZone                BACnetPropertyIdentifier = 266
	BACnetPropertyDaysRemaining                    BACnetPropertyIdentifier = 267
	BACnetPropertyEntryPoints                      BACnetPropertyIdentifier = 268
	BACnetPropertyExitPoints                       BACnetPropertyIdentifier = 269
	BACnetPropertyExpirationTime                   BACnetPropertyIdentifier = 270
	BACnetPropertyExtendedTimeEnable               BACnetPropertyIdentifier = 271
	BACnetPropertyFailedAttemptEvents              BACnetPropertyIdentifier = 272
	BACnetPropertyFailedAttempts                   BACnetPropertyIdentifier = 273
	BACnetPropertyFailedAttemptsTime               BACnetPropertyIdentifier = 274
	BACnetPropertyLastAccessEvent                  BACnetPropertyIdentifier = 275
	BACnetPropertyLastAccessPoint                  BACnetPropertyIdentifier = 276
	BACnetPropertyLastCredentialAdded              BACnetPropertyIdentifier = 277
	BACnetPropertyLastCredentialAddedTime          BACnetPropertyIdentifier = 278
	BACnetPropertyLastCredentialRemoved            BACnetPropertyIdentifier = 279
	BACnetPropertyLastCredentialRemovedTime        BACnetPropertyIdentifier = 280
	BACnetPropertyLastUseTime                      BACnetPropertyIdentifier = 281
	BACnetPropertyLockout                          BACnetPropertyIdentifier = 282
	BACnetPropertyLockoutRelinquishTime            BACnetPropertyIdentifier = 283
	BACnetPropertyMasterExemption                  BACnetPropertyIdentifier = 284
	BACnetPropertyMaxFailedAttempts                BACnetPropertyIdentifier = 285
	BACnetPropertyMembers                          BACnetPropertyIdentifier = 286
	BACnetPropertyMusterPoint                      BACnetPropertyIdentifier = 287
	BACnetPropertyNegativeAccessRules              BACnetPropertyIdentifier = 288
	BACnetPropertyNumberOfAuthenticationPolicies   BACnetPropertyIdentifier = 289
	BACnetPropertyOccupancyCount                   BACnetPropertyIdentifier = 290
	BACnetPropertyOccupancyCountAdjust             BACnetPropertyIdentifier = 291
	BACnetPropertyOccupancyCountEnable             BACnetPropertyIdentifier = 292
	BACnetPropertyOccupancyExemption               BACnetPropertyIdentifier = 293
	BACnetPropertyOccupancyLowerLimit              BACnetPropertyIdentifier = 294
	BACnetPropertyOccupancyLowerLimitEnforced      BACnetPropertyIdentifier = 295
	BACnetPropertyOccupancyState                   BACnetPropertyIdentifier = 296
	BACnetPropertyOccupancyUpperLimit              BACnetPropertyIdentifier = 297
	BACnetPropertyOccupancyUpperLimitEnforced      BACnetPropertyIdentifier = 298
	BACnetPropertyPassbackExemption                BACnetPropertyIdentifier = 299
	BACnetPropertyPassbackMode                     BACnetPropertyIdentifier = 300
	BACnetPropertyPassbackTimeout                  BACnetPropertyIdentifier = 301
	BACnetPropertyPositiveAccessRules              BACnetPropertyIdentifier = 302
	BACnetPropertyReasonForDisable                 BACnetPropertyIdentifier = 303
	BACnetPropertySupportedFormats                 BACnetPropertyIdentifier = 304
	BACnetPropertySupportedFormatClasses           BACnetPropertyIdentifier = 305
	BACnetPropertyThreatAuthority                  BACnetPropertyIdentifier = 306
	BACnetPropertyThreatLevel                      BACnetPropertyIdentifier = 307
	BACnetPropertyTraceFlag                        BACnetPropertyIdentifier = 308
	BACnetPropertyTransactionNotificationClass     BACnetPropertyIdentifier = 309
	BACnetPropertyUserExternalIdentifier           BACnetPropertyIdentifier = 310
	BACnetPropertyUserInformationReference         BACnetPropertyIdentifier = 311
	BACnetPropertyUserName                         BACnetPropertyIdentifier = 317
	BACnetPropertyUserType                         BACnetPropertyIdentifier = 318
	BACnetPropertyUsesRemaining                    BACnetPropertyIdentifier = 319
	BACnetPropertyZoneFrom                         BACnetPropertyIdentifier = 320
	BACnetPropertyZoneTo                           BACnetPropertyIdentifier = 321
	BACnetPropertyAccessEventTag                   BACnetPropertyIdentifier = 322
	BACnetPropertyGlobalIdentifier                 BACnetPropertyIdentifier = 323
	BACnetPropertyVerificationTime                 BACnetPropertyIdentifier = 326
	BACnetPropertyBaseDeviceSecurityPolicy         BACnetPropertyIdentifier = 327
	BACnetPropertyDistributionKeyRevision          BACnetPropertyIdentifier = 328
	BACnetPropertyDoNotHide                        BACnetPropertyIdentifier = 329
	BACnetPropertyKeySets                          BACnetPropertyIdentifier = 330
	BACnetPropertyLastKeyServer                    BACnetPropertyIdentifier = 331
	BACnetPropertyNetworkAccessSecurityPolicies    BACnetPropertyIdentifier = 332
	BACnetPropertyPacketReorderTime                BACnetPropertyIdentifier = 333
	BACnetPropertySecurityPduTimeout               BACnetPropertyIdentifier = 334
	BACnetPropertySecurityTimeWindow               BACnetPropertyIdentifier = 335
	BACnetPropertySupportedSecurityAlgorithms      BACnetPropertyIdentifier = 336
	BACnetPropertyUpdateKeySetTimeout              BACnetPropertyIdentifier = 337
	BACnetPropertyBackupAndRestoreState            BACnetPropertyIdentifier = 338
	BACnetPropertyBackupPreparationTime            BACnetPropertyIdentifier = 339
	BACnetPropertyRestoreCompletionTime            BACnetPropertyIdentifier = 340
	BACnetPropertyRestorePreparationTime           BACnetPropertyIdentifier = 341
	BACnetPropertyBitMask                          BACnetPropertyIdentifier = 342
	BACnetPropertyBitText                          BACnetPropertyIdentifier = 343
	BACnetPropertyIsUtc                            BACnetPropertyIdentifier = 344
	BACnetPropertyGroupMembers                     BACnetPropertyIdentifier = 345
	BACnetPropertyGroupMemberNames                 BACnetPropertyIdentifier = 346
	BACnetPropertyMemberStatusFlags                BACnetPropertyIdentifier = 347
	BACnetPropertyRequestedUpdateInterval          BACnetPropertyIdentifier = 348
	BACnetPropertyCovuPeriod                       BACnetPropertyIdentifier = 349
	BACnetPropertyCovuRecipients                   BACnetPropertyIdentifier = 350
	BACnetPropertyEventMessageTexts                BACnetPropertyIdentifier = 351
	BACnetPropertyEventMessageTextsConfig          BACnetPropertyIdentifier = 352
	BACnetPropertyEventDetectionEnable             BACnetPropertyIdentifier = 353
	BACnetPropertyEventAlgorithmInhibit            BACnetPropertyIdentifier = 354
	BACnetPropertyEventAlgorithmInhibitRef         BACnetPropertyIdentifier = 355
	BACnetPropertyTimeDelayNormal                  BACnetPropertyIdentifier = 356
	BACnetPropertyReliabilityEvaluationInhibit     BACnetPropertyIdentifier = 357
	BACnetPropertyFaultParameters                  BACnetPropertyIdentifier = 358
	BACnetPropertyFaultType                        BACnetPropertyIdentifier = 359
	BACnetPropertyLocalForwardingOnly              BACnetPropertyIdentifier = 360
	BACnetPropertyProcessIdentifierFilter          BACnetPropertyIdentifier = 361
	BACnetPropertySubscribedRecipients             BACnetPropertyIdentifier = 362
	BACnetPropertyPortFilter                       BACnetPropertyIdentifier = 363
	BACnetPropertyAuthorizationExemptions          BACnetPropertyIdentifier = 364
	BACnetPropertyAllowGroupDelayInhibit           BACnetPropertyIdentifier = 365
	BACnetPropertyChannelNumber                    BACnetPropertyIdentifier = 366
	BACnetPropertyControlGroups                    BACnetPropertyIdentifier = 367
	BACnetPropertyExecutionDelay                   BACnetPropertyIdentifier = 368
	BACnetPropertyLastPriority                     BACnetPropertyIdentifier = 369
	BACnetPropertyWriteStatus                      BACnetPropertyIdentifier = 370
	BACnetPropertyPropertyList                     BACnetPropertyIdentifier = 371
	BACnetPropertySerialNumber                     BACnetPropertyIdentifier = 372
	BACnetPropertyBlinkWarnEnable                  BACnetPropertyIdentifier = 373
	BACnetPropertyDefaultFadeTime                  BACnetPropertyIdentifier = 374
	BACnetPropertyDefaultRampRate                  BACnetPropertyIdentifier = 375
	BACnetPropertyDefaultStepIncrement             BACnetPropertyIdentifier = 376
	BACnetPropertyEgressTime                       BACnetPropertyIdentifier = 377
	BACnetPropertyInProgress                       BACnetPropertyIdentifier = 378
	BACnetPropertyInstantaneousPower               BACnetPropertyIdentifier = 379
	BACnetPropertyLightingCommand                  BACnetPropertyIdentifier = 380
	BACnetPropertyLightingCommandDefaultPriority   BACnetPropertyIdentifier = 381
	BACnetPropertyMaxActualValue                   BACnetPropertyIdentifier = 382
	BACnetPropertyMinActualValue                   BACnetPropertyIdentifier = 383
	BACnetPropertyPower                            BACnetPropertyIdentifier = 384
	BACnetPropertyTransition                       BACnetPropertyIdentifier = 385
	BACnetPropertyEgressActive                     BACnetPropertyIdentifier = 386
	BACnetPropertyInterfaceValue                   BACnetPropertyIdentifier = 387
	BACnetPropertyFaultHighLimit                   BACnetPropertyIdentifier = 388
	BACnetPropertyFaultLowLimit                    BACnetPropertyIdentifier = 389
	BACnetPropertyLowDiffLimit                     BACnetPropertyIdentifier = 390
	BACnetPropertyStrikeCount                      BACnetPropertyIdentifier = 391
	BACnetPropertyTimeOfStrikeCountReset           BACnetPropertyIdentifier = 392
	BACnetPropertyDefaultTimeout                   BACnetPropertyIdentifier = 393
	BACnetPropertyInitialTimeout                   BACnetPropertyIdentifier = 394
	BACnetPropertyLastStateChange                  BACnetPropertyIdentifier = 395
	BACnetPropertyStateChangeValues                BACnetPropertyIdentifier = 396
	BACnetPropertyTimerRunning                     BACnetPropertyIdentifier = 397
	BACnetPropertyTimerState                       BACnetPropertyIdentifier = 398
	BACnetPropertyApduLength                       BACnetPropertyIdentifier = 399
	BACnetPropertyBACnetIPAddress                  BACnetPropertyIdentifier = 400
	BACnetPropertyBACnetIPDefaultGateway           BACnetPropertyIdentifier = 401
	BACnetPropertyBACnetIPDhcpEnable               BACnetPropertyIdentifier = 402
	BACnetPropertyBACnetIPDhcpLeaseTime            BACnetPropertyIdentifier = 403
	BACnetPropertyBACnetIPDhcpLeaseTimeRemaining   BACnetPropertyIdentifier = 404
	BACnetPropertyBACnetIPDhcpServer               BACnetPropertyIdentifier = 405
	BACnetPropertyBACnetIPDNSServer                BACnetPropertyIdentifier = 406
	BACnetPropertyBACnetIPGlobalAddress            BACnetPropertyIdentifier = 407
	BACnetPropertyBACnetIPMode                     BACnetPropertyIdentifier = 408
	BACnetPropertyBACnetIPMulticastAddress         BACnetPropertyIdentifier = 409
	BACnetPropertyBACnetIPNatTraversal             BACnetPropertyIdentifier = 410
	BACnetPropertyBACnetIPSubnetMask               BACnetPropertyIdentifier = 411
	BACnetPropertyBACnetIPUDPPort                  BACnetPropertyIdentifier = 412
	BACnetPropertyBbmdAcceptFdRegistrations        BACnetPropertyIdentifier = 413
	BACnetPropertyBbmdBroadcastDistributionTable   BACnetPropertyIdentifier = 414
	BACnetPropertyBbmdForeignDeviceTable           BACnetPropertyIdentifier = 415
	BACnetPropertyChangesPending                   BACnetPropertyIdentifier = 416
	BACnetPropertyCommand                          BACnetPropertyIdentifier = 417
	BACnetPropertyFdBbmdAddress                    BACnetPropertyIdentifier = 418
	BACnetPropertyFdSubscriptionLifetime           BACnetPropertyIdentifier = 419
	BACnetPropertyLinkSpeed                        BACnetPropertyIdentifier = 420
	BACnetPropertyLinkSpeeds                       BACnetPropertyIdentifier = 421
	BACnetPropertyLinkSpeedAutonegotiate           BACnetPropertyIdentifier = 422
	BACnetPropertyMacAddress                       BACnetPropertyIdentifier = 423
	BACnetPropertyNetworkInterfaceName             BACnetPropertyIdentifier = 424
	BACnetPropertyNetworkNumber                    BACnetPropertyIdentifier = 425
	BACnetPropertyNetworkNumberQuality             BACnetPropertyIdentifier = 426
	BACnetPropertyNetworkType                      BACnetPropertyIdentifier = 427
	BACnetPropertyRoutingTable                     BACnetPropertyIdentifier = 428
	BACnetPropertyVirtualMacAddressTable           BACnetPropertyIdentifier = 429
	BACnetPropertyCommandTimeArray                 BACnetPropertyIdentifier = 430
	BACnetPropertyCurrentCommandPriority           BACnetPropertyIdentifier = 431
	BACnetPropertyLastCommandTime                  BACnetPropertyIdentifier = 432
	BACnetPropertyValueSource                      BACnetPropertyIdentifier = 433
	BACnetPropertyValueSourceArray                 BACnetPropertyIdentifier = 434
	BACnetPropertyBACnetIpv6Mode                   BACnetPropertyIdentifier = 435
	BACnetPropertyIpv6Address                      BACnetPropertyIdentifier = 436
	BACnetPropertyIpv6PrefixLength                 BACnetPropertyIdentifier = 437
	BACnetPropertyBACnetIpv6UDPPort                BACnetPropertyIdentifier = 438
	BACnetPropertyIpv6DefaultGateway               BACnetPropertyIdentifier = 439
	BACnetPropertyBACnetIpv6MulticastAddress       BACnetPropertyIdentifier = 440
	BACnetPropertyIpv6DNSServer                    BACnetPropertyIdentifier = 441
	BACnetPropertyIpv6AutoAddressingEnable         BACnetPropertyIdentifier = 442
	BACnetPropertyIpv6DhcpLeaseTime                BACnetPropertyIdentifier = 443
	BACnetPropertyIpv6DhcpLeaseTimeRemaining       BACnetPropertyIdentifier = 444
	BACnetPropertyIpv6DhcpServer                   BACnetPropertyIdentifier = 445
	BACnetPropertyIpv6ZoneIndex                    BACnetPropertyIdentifier = 446
	BACnetPropertyAssignedLandingCalls             BACnetPropertyIdentifier = 447
	BACnetPropertyCarAssignedDirection             BACnetPropertyIdentifier = 448
	BACnetPropertyCarDoorCommand                   BACnetPropertyIdentifier = 449
	BACnetPropertyCarDoorStatus                    BACnetPropertyIdentifier = 450
	BACnetPropertyCarDoorText                      BACnetPropertyIdentifier = 451
	BACnetPropertyCarDoorZone                      BACnetPropertyIdentifier = 452
	BACnetPropertyCarDriveStatus                   BACnetPropertyIdentifier = 453
	BACnetPropertyCarLoad                          BACnetPropertyIdentifier = 454
	BACnetPropertyCarLoadUnits                     BACnetPropertyIdentifier = 455
	BACnetPropertyCarMode                          BACnetPropertyIdentifier = 456
	BACnetPropertyCarMovingDirection               BACnetPropertyIdentifier = 457
	BACnetPropertyCarPosition                      BACnetPropertyIdentifier = 458
	BACnetPropertyElevatorGroup                    BACnetPropertyIdentifier = 459
	BACnetPropertyEnergyMeter                      BACnetPropertyIdentifier = 460
	BACnetPropertyEnergyMeterRef                   BACnetPropertyIdentifier = 461
	BACnetPropertyEscalatorMode                    BACnetPropertyIdentifier = 462
	BACnetPropertyFaultSignals                     BACnetPropertyIdentifier = 463
	BACnetPropertyFloorText                        BACnetPropertyIdentifier = 464
	BACnetPropertyGroupID                          BACnetPropertyIdentifier = 465
	BACnetPropertyEnumerationValue466IsUnassigned  BACnetPropertyIdentifier = 466
	BACnetPropertyGroupMode                        BACnetPropertyIdentifier = 467
	BACnetPropertyHigherDeck                       BACnetPropertyIdentifier = 468
	BACnetPropertyInstallationID                   BACnetPropertyIdentifier = 469
	BACnetPropertyLandingCalls                     BACnetPropertyIdentifier = 470
	BACnetPropertyLandingCallControl               BACnetPropertyIdentifier = 471
	BACnetPropertyLandingDoorStatus                BACnetPropertyIdentifier = 472
	BACnetPropertyLowerDeck                        BACnetPropertyIdentifier = 473
	BACnetPropertyMachineRoomID                    BACnetPropertyIdentifier = 474
	BACnetPropertyMakingCarCall                    BACnetPropertyIdentifier = 475
	BACnetPropertyNextStoppingFloor                BACnetPropertyIdentifier = 476
	BACnetPropertyOperationDirection               BACnetPropertyIdentifier = 477
	BACnetPropertyPassengerAlarm                   BACnetPropertyIdentifier = 478
	BACnetPropertyPowerMode                        BACnetPropertyIdentifier = 479
	BACnetPropertyRegisteredCarCall                BACnetPropertyIdentifier = 480
	BACnetPropertyActiveCovMultipleSubscriptions   BACnetPropertyIdentifier = 481
	BACnetPropertyProtocolLevel                    BACnetPropertyIdentifier = 482
	BACnetPropertyReferencePort                    BACnetPropertyIdentifier = 483
	BACnetPropertyDeployedProfileLocation          BACnetPropertyIdentifier = 484
	BACnetPropertyProfileLocation                  BACnetPropertyIdentifier = 485
	BACnetPropertyTags                             BACnetPropertyIdentifier = 486
	BACnetPropertySubordinateNodeTypes             BACnetPropertyIdentifier = 487
	BACnetPropertySubordinateTags                  BACnetPropertyIdentifier = 488
	BACnetPropertySubordinateRelationship          BACnetPropertyIdentifier = 489
	BACnetPropertyDefaultSubordinateRelationship   BACnetPropertyIdentifier = 490
	BACnetPropertyRepresents                       BACnetPropertyIdentifier = 491
	BACnetPropertyDefaultPresentValue              BACnetPropertyIdentifier = 492
	BACnetPropertyPresentStage                     BACnetPropertyIdentifier = 493
	BACnetPropertyStages                           BACnetPropertyIdentifier = 494
	BACnetPropertyStageNames                       BACnetPropertyIdentifier = 495
	BACnetPropertyTargetReferences                 BACnetPropertyIdentifier = 496
	BACnetPropertyAuditSourceReporter              BACnetPropertyIdentifier = 497
	BACnetPropertyAuditLevel                       BACnetPropertyIdentifier = 498
	BACnetPropertyAuditNotificationRecipient       BACnetPropertyIdentifier = 499
	BACnetPropertyAuditPriorityFilter              BACnetPropertyIdentifier = 500
	BACnetPropertyAuditableOperations              BACnetPropertyIdentifier = 501
	BACnetPropertyDeleteOnForward                  BACnetPropertyIdentifier = 502
	BACnetPropertyMaximumSendDelay                 BACnetPropertyIdentifier = 503
	BACnetPropertyMonitoredObjects                 BACnetPropertyIdentifier = 504
	BACnetPropertySendNow                          BACnetPropertyIdentifier = 505
	BACnetPropertyFloorNumber                      BACnetPropertyIdentifier = 506
	BACnetPropertyDeviceUUID                       BACnetPropertyIdentifier = 507
	BACnetPropertyAdditionalReferencePorts         BACnetPropertyIdentifier = 508
	BACnetPropertyCertificateSigningRequestFile    BACnetPropertyIdentifier = 509
	BACnetPropertyCommandValidationResult          BACnetPropertyIdentifier = 510
	BACnetPropertyIssuerCertificateFiles           BACnetPropertyIdentifier = 511
	BACnetPropertyMaxBvlcLengthAccepted            BACnetPropertyIdentifier = 4194304
	BACnetPropertyMaxNpduLengthAccepted            BACnetPropertyIdentifier = 4194305
	BACnetPropertyOperationalCertificateFile       BACnetPropertyIdentifier = 4194306
	BACnetPropertyCurrentHealth                    BACnetPropertyIdentifier = 4194307
	BACnetPropertyScConnectWaitTimeout             BACnetPropertyIdentifier = 4194308
	BACnetPropertyScDirectConnectAcceptEnable      BACnetPropertyIdentifier = 4194309
	BACnetPropertyScDirectConnectAcceptUris        BACnetPropertyIdentifier = 4194310
	BACnetPropertySscDirectConnectBinding          BACnetPropertyIdentifier = 4194311
	BACnetPropertyScDirectConnectConnectionStatus  BACnetPropertyIdentifier = 4194312
	BACnetPropertyScDirectConnectInitiateEnable    BACnetPropertyIdentifier = 4194313
	BACnetPropertyScDisconnectWaitTimeout          BACnetPropertyIdentifier = 4194314
	BACnetPropertyScFailedConnectionRequest        BACnetPropertyIdentifier = 4194315
	BACnetPropertyScFailoverHubConnectionStatus    BACnetPropertyIdentifier = 4194316
	BACnetPropertyScFailoverHubURI                 BACnetPropertyIdentifier = 4194317
	BACnetPropertyScHubConnectorState              BACnetPropertyIdentifier = 4194318
	BACnetPropertyScHubFunctionAcceptUris          BACnetPropertyIdentifier = 4194319
	BACnetPropertyScHubFunctionBinding             BACnetPropertyIdentifier = 4194320
	BACnetPropertyScHubFunctionConnectionStatus    BACnetPropertyIdentifier = 4194321
	BACnetPropertyScHubFunctionEnable              BACnetPropertyIdentifier = 4194322
	BACnetPropertyScHeartbeatTimeout               BACnetPropertyIdentifier = 4194323
	BACnetPropertyScPrimaryHubConnectionStatus     BACnetPropertyIdentifier = 4194324
	BACnetPropertyScPrimaryHubURI                  BACnetPropertyIdentifier = 4194325
	BACnetPropertyScMaximumReconnectTime           BACnetPropertyIdentifier = 4194326
	BACnetPropertyScMinimumReconnectTime           BACnetPropertyIdentifier = 4194327
	BACnetPropertyColorOverride                    BACnetPropertyIdentifier = 4194328
	BACnetPropertyColorReference                   BACnetPropertyIdentifier = 4194329
	BACnetPropertyDefaultColor                     BACnetPropertyIdentifier = 4194330
	BACnetPropertyDefaultColorTemperature          BACnetPropertyIdentifier = 4194331
	BACnetPropertyOverrideColorReference           BACnetPropertyIdentifier = 4194332
	BACnetPropertyColorCommand                     BACnetPropertyIdentifier = 4194334
	BACnetPropertyHighEndTrim                      BACnetPropertyIdentifier = 4194335
	BACnetPropertyLowEndTrim                       BACnetPropertyIdentifier = 4194336
	BACnetPropertyTrimFadeTime                     BACnetPropertyIdentifier = 4194337
	BACnetPropertyDeviceAddressProxyEnable         BACnetPropertyIdentifier = 4194338
	BACnetPropertyDeviceAddressProxyTable          BACnetPropertyIdentifier = 4194339
	BACnetPropertyDeviceAddressProxyTimeout        BACnetPropertyIdentifier = 4194340
	BACnetPropertyDefaultOnValue                   BACnetPropertyIdentifier = 4194341
	BACnetPropertyLastOnValue                      BACnetPropertyIdentifier = 4194342
	BACnetPropertyAuthorizationCache               BACnetPropertyIdentifier = 4194343
	BACnetPropertyAuthorizationGroups              BACnetPropertyIdentifier = 4194344
	BACnetPropertyAuthorizationPolicy              BACnetPropertyIdentifier = 4194345
	BACnetPropertyAuthorizationScope               BACnetPropertyIdentifier = 4194346
	BACnetPropertyAuthorizationServer              BACnetPropertyIdentifier = 4194347
	BACnetPropertyAuthorizationStatus              BACnetPropertyIdentifier = 4194348
	BACnetPropertyMaxProxiedIAmsPerSecond          BACnetPropertyIdentifier = 4194349
)

BACnetPropertyIdentifier values (ASHRAE 135).

func (BACnetPropertyIdentifier) String

func (p BACnetPropertyIdentifier) String() string

String returns the Clause 21 name of the property; identifiers 512 to 4194303 are proprietary.

type BACnetPropertyReference

type BACnetPropertyReference struct {
	Property   BACnetPropertyIdentifier
	ArrayIndex uint32
}

BACnetPropertyReference names a property and, optionally, one element.

type BACnetPropertyValue

type BACnetPropertyValue struct {
	Property   BACnetPropertyIdentifier
	ArrayIndex uint32
	Value      []BACnetTag
	// Priority is 1 to 16, or 0 when absent.
	Priority uint8
}

BACnetPropertyValue is one changed property of a COV notification.

type BACnetReadAccessResult

type BACnetReadAccessResult struct {
	Object  BACnetObjectIdentifier
	Results []BACnetReadResult
}

BACnetReadAccessResult is one object of a ReadPropertyMultiple ACK.

type BACnetReadAccessSpec

type BACnetReadAccessSpec struct {
	Object     BACnetObjectIdentifier
	Properties []BACnetPropertyReference
}

BACnetReadAccessSpec is one object of a ReadPropertyMultiple request.

type BACnetReadProperty

type BACnetReadProperty struct {
	Object   BACnetObjectIdentifier
	Property BACnetPropertyIdentifier
	// ArrayIndex is BACnetNoArrayIndex when absent.
	ArrayIndex uint32
}

BACnetReadProperty is the ReadProperty request (Clause 15.5).

type BACnetReadPropertyAck

type BACnetReadPropertyAck struct {
	Object     BACnetObjectIdentifier
	Property   BACnetPropertyIdentifier
	ArrayIndex uint32
	// Value holds the tags of the property value.
	Value []BACnetTag
}

BACnetReadPropertyAck is the ReadProperty ComplexACK (Clause 15.5).

type BACnetReadPropertyMultiple

type BACnetReadPropertyMultiple struct {
	Specs []BACnetReadAccessSpec
}

BACnetReadPropertyMultiple is the ReadPropertyMultiple request (Clause 15.7).

type BACnetReadPropertyMultipleAck

type BACnetReadPropertyMultipleAck struct {
	Results []BACnetReadAccessResult
}

BACnetReadPropertyMultipleAck is the ReadPropertyMultiple ComplexACK (Clause 15.7).

type BACnetReadResult

type BACnetReadResult struct {
	Property   BACnetPropertyIdentifier
	ArrayIndex uint32
	Value      []BACnetTag
	// Error is set, and Value empty, when the property could not be read.
	Error *BACnetError
}

BACnetReadResult is one property of a ReadPropertyMultiple ACK: its value, or the error that reading it raised.

type BACnetRejectReason

type BACnetRejectReason uint8

BACnetRejectReason is the reason of a Reject PDU (Clause 18.8). Values from 64 are proprietary.

const (
	BACnetRejectOther                    BACnetRejectReason = 0
	BACnetRejectBufferOverflow           BACnetRejectReason = 1
	BACnetRejectInconsistentParameters   BACnetRejectReason = 2
	BACnetRejectInvalidParameterDataType BACnetRejectReason = 3
	BACnetRejectInvalidTag               BACnetRejectReason = 4
	BACnetRejectMissingRequiredParameter BACnetRejectReason = 5
	BACnetRejectParameterOutOfRange      BACnetRejectReason = 6
	BACnetRejectTooManyArguments         BACnetRejectReason = 7
	BACnetRejectUndefinedEnumeration     BACnetRejectReason = 8
	BACnetRejectUnrecognizedService      BACnetRejectReason = 9
)

BACnetRejectReason values.

func (BACnetRejectReason) String

func (r BACnetRejectReason) String() string

String returns the Clause 18 name of the reason.

type BACnetRequestKeyUpdate

type BACnetRequestKeyUpdate struct {
	Set1                    BACnetKeySetTiming
	Set2                    BACnetKeySetTiming
	DistributionKeyRevision uint8
}

BACnetRequestKeyUpdate is a Request-Key-Update (Clause 24.3.4): the key sets a device holds, sent to the key server.

type BACnetRequestMasterKey

type BACnetRequestMasterKey struct {
	Algorithms []uint8
}

BACnetRequestMasterKey is a Request-Master-Key (Clause 24.3.7): the key algorithms (encryption and signature) the device supports.

type BACnetRoutingEntry

type BACnetRoutingEntry struct {
	DNET     uint16
	PortID   uint8
	PortInfo []byte
}

BACnetRoutingEntry is one entry of an Initialize-Routing-Table(-Ack) (Clause 6.4.7).

type BACnetSC

type BACnetSC struct {
	BaseLayer
	Function  BACnetSCFunction
	Control   BACnetSCControl
	MessageID uint16

	// OriginVMAC and DestinationVMAC are set when Control says so.
	OriginVMAC      BACnetSCVMAC
	DestinationVMAC BACnetSCVMAC
	// DestinationOptions and DataOptions hold at most 64 options each;
	// more are skipped.
	DestinationOptions []BACnetSCOption
	DataOptions        []BACnetSCOption

	// ResultFunction, ResultCode, Error and ErrorDetails belong to
	// BVLC-Result: the function answered, ACK or NAK, and for a NAK the
	// error and its UTF-8 details. ErrorMarker is the header marker of the
	// option that caused the NAK, 0 if none did.
	ResultFunction BACnetSCFunction
	ResultCode     BACnetSCResultCode
	ErrorMarker    uint8
	Error          BACnetError
	ErrorDetails   string

	// URIs is the space-separated WebSocket URI list of an
	// Address-Resolution-ACK.
	URIs string

	// HubConnection and AcceptsConnections (direct connections) belong to
	// Advertisement.
	HubConnection      BACnetSCHubConnection
	AcceptsConnections bool
	// MaxBVLCLength and MaxNPDULength are what the sender accepts, set by
	// Advertisement, Connect-Request and Connect-Accept.
	MaxBVLCLength uint16
	MaxNPDULength uint16
	// ConnectVMAC and DeviceUUID identify the sender of Connect-Request
	// and Connect-Accept.
	ConnectVMAC BACnetSCVMAC
	DeviceUUID  [bacnetSCUUIDLen]byte

	// VendorID, ProprietaryFunction and ProprietaryData belong to
	// Proprietary-Message.
	VendorID            uint16
	ProprietaryFunction uint8
	ProprietaryData     []byte
}

BACnetSC is a BACnet/SC BVLC message (Annex AB.2). The header fields are set according to Control, the others only by the decoded function.

func (*BACnetSC) CanDecode

func (b *BACnetSC) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeBACnetSC.

func (*BACnetSC) DecodeFromBytes

func (b *BACnetSC) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a BACnet/SC BVLC message, which takes all of data: the WebSocket message gives its length.

func (*BACnetSC) LayerType

func (b *BACnetSC) LayerType() gopacket.LayerType

LayerType returns LayerTypeBACnetSC.

func (*BACnetSC) NextLayerType

func (b *BACnetSC) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeBACnetNPDU for an Encapsulated-NPDU.

func (*BACnetSC) SecurePath

func (b *BACnetSC) SecurePath() bool

SecurePath reports whether the message carries the Secure Path data option: it never left BACnet/SC on its way.

func (*BACnetSC) URIList

func (b *BACnetSC) URIList() []string

URIList returns the WebSocket URIs of an Address-Resolution-ACK, which a single space separates on the wire; nil when there are none.

type BACnetSCControl

type BACnetSCControl uint8

BACnetSCControl is the control flags octet (Annex AB.2.2).

func (BACnetSCControl) HasDataOptions

func (c BACnetSCControl) HasDataOptions() bool

HasDataOptions reports whether data options are present.

func (BACnetSCControl) HasDestination

func (c BACnetSCControl) HasDestination() bool

HasDestination reports whether the destination virtual address is present.

func (BACnetSCControl) HasDestinationOptions

func (c BACnetSCControl) HasDestinationOptions() bool

HasDestinationOptions reports whether destination options are present.

func (BACnetSCControl) HasOrigin

func (c BACnetSCControl) HasOrigin() bool

HasOrigin reports whether the originating virtual address is present.

type BACnetSCFunction

type BACnetSCFunction uint8

BACnetSCFunction is a BACnet/SC BVLC function (Annex AB.2.1).

const (
	BACnetSCFunctionResult                    BACnetSCFunction = 0x00
	BACnetSCFunctionEncapsulatedNPDU          BACnetSCFunction = 0x01
	BACnetSCFunctionAddressResolution         BACnetSCFunction = 0x02
	BACnetSCFunctionAddressResolutionAck      BACnetSCFunction = 0x03
	BACnetSCFunctionAdvertisement             BACnetSCFunction = 0x04
	BACnetSCFunctionAdvertisementSolicitation BACnetSCFunction = 0x05
	BACnetSCFunctionConnectRequest            BACnetSCFunction = 0x06
	BACnetSCFunctionConnectAccept             BACnetSCFunction = 0x07
	BACnetSCFunctionDisconnectRequest         BACnetSCFunction = 0x08
	BACnetSCFunctionDisconnectAck             BACnetSCFunction = 0x09
	BACnetSCFunctionHeartbeatRequest          BACnetSCFunction = 0x0A
	BACnetSCFunctionHeartbeatAck              BACnetSCFunction = 0x0B
	BACnetSCFunctionProprietaryMessage        BACnetSCFunction = 0x0C
)

BACnetSCFunction values.

func (BACnetSCFunction) String

func (f BACnetSCFunction) String() string

String returns the Annex AB name of the function.

type BACnetSCHubConnection

type BACnetSCHubConnection uint8

BACnetSCHubConnection is the hub connection status of an Advertisement (Annex AB.2.8).

const (
	BACnetSCHubNone     BACnetSCHubConnection = 0
	BACnetSCHubPrimary  BACnetSCHubConnection = 1
	BACnetSCHubFailover BACnetSCHubConnection = 2
)

BACnetSCHubConnection values.

func (BACnetSCHubConnection) String

func (c BACnetSCHubConnection) String() string

String returns the Annex AB name of the hub connection status.

type BACnetSCOption

type BACnetSCOption struct {
	Type BACnetSCOptionType
	// MustUnderstand tells a node that does not know the option to
	// reject the message.
	MustUnderstand bool
	// Data is the option data, nil when the marker says there is none.
	Data []byte

	// VendorID, ProprietaryType and ProprietaryData are Data decoded for
	// a Proprietary option: the vendor, the option type the vendor chose
	// and the data that goes with it.
	VendorID        uint16
	ProprietaryType uint8
	ProprietaryData []byte
}

BACnetSCOption is one header option (Annex AB.2.3). The standard defines two: Secure Path, a data option without data that marks a message which only ever travelled over secure links, and Proprietary.

type BACnetSCOptionType

type BACnetSCOptionType uint8

BACnetSCOptionType is the type of a header option (Annex AB.2.3).

const (
	BACnetSCOptionSecurePath  BACnetSCOptionType = 1
	BACnetSCOptionProprietary BACnetSCOptionType = 31
)

BACnetSCOptionType values.

func (BACnetSCOptionType) String

func (t BACnetSCOptionType) String() string

String returns the Annex AB name of the option type.

type BACnetSCResultCode

type BACnetSCResultCode uint8

BACnetSCResultCode is the result code of a BVLC-Result (Annex AB.2.4).

const (
	BACnetSCResultACK BACnetSCResultCode = 0
	BACnetSCResultNAK BACnetSCResultCode = 1
)

BACnetSCResultCode values.

func (BACnetSCResultCode) String

func (r BACnetSCResultCode) String() string

String returns the Annex AB name of the result code.

type BACnetSCVMAC

type BACnetSCVMAC [bacnetSCVMACLen]byte

BACnetSCVMAC is the 6-octet virtual MAC address of a BACnet/SC node.

type BACnetSecurityControl

type BACnetSecurityControl uint8

BACnetSecurityControl is the control octet of a security wrapper (Clause 24.2.2).

func (BACnetSecurityControl) AuthenticationPresent

func (c BACnetSecurityControl) AuthenticationPresent() bool

AuthenticationPresent reports whether authentication data follows the addresses.

func (BACnetSecurityControl) DoNotDecrypt

func (c BACnetSecurityControl) DoNotDecrypt() bool

DoNotDecrypt reports whether routers must pass the message on encrypted.

func (BACnetSecurityControl) DoNotUnwrap

func (c BACnetSecurityControl) DoNotUnwrap() bool

DoNotUnwrap reports whether routers must pass the message on wrapped.

func (BACnetSecurityControl) Encrypted

func (c BACnetSecurityControl) Encrypted() bool

Encrypted reports whether the wrapper is encrypted from the destination device instance on.

func (BACnetSecurityControl) NetworkMessage

func (c BACnetSecurityControl) NetworkMessage() bool

NetworkMessage reports whether the wrapped message is a network layer message rather than an APDU.

func (BACnetSecurityControl) NonTrustedSource

func (c BACnetSecurityControl) NonTrustedSource() bool

NonTrustedSource reports whether the message came from a non-trusted source.

func (BACnetSecurityControl) SecuredByRouter

func (c BACnetSecurityControl) SecuredByRouter() bool

SecuredByRouter reports whether a router, not the source, secured the message.

type BACnetSecurityKey

type BACnetSecurityKey struct {
	Identifier uint16
	Value      []byte
}

BACnetSecurityKey is a key as distributed: its identifier (algorithm in the high octet, key number in the low one) and its octets.

type BACnetSecurityMessage

type BACnetSecurityMessage interface {
	// contains filtered or unexported methods
}

BACnetSecurityMessage is the decoded service data of a security wrapper: a *BACnetChallengeRequest, *BACnetSecurityPayload, *BACnetSecurityResponse, *BACnetRequestKeyUpdate, *BACnetUpdateKeySet, *BACnetUpdateDistributionKey, *BACnetRequestMasterKey or *BACnetSetMasterKey.

type BACnetSecurityPayload

type BACnetSecurityPayload struct {
	// Payload is the secured message. When the wrapper control says it is
	// a network layer message it starts with the message type; else it is
	// an APDU, which BACnetNPDU hands to the APDU decoder.
	Payload []byte
	// NetworkMessage is Payload decoded when it is a network layer
	// message: only the message fields of the NPDU are set.
	NetworkMessage *BACnetNPDU
}

BACnetSecurityPayload is a Security-Payload (Clause 24.3.2): the secured APDU or network layer message.

type BACnetSecurityResponse

type BACnetSecurityResponse struct {
	Code BACnetSecurityResponseCode
	// OriginalMessageID and OriginalTimestamp name the message answered.
	OriginalMessageID uint32
	OriginalTimestamp uint32
	// Details is the response specific parameters, as octets.
	Details []byte

	// ExpectedTimestamp is set by badTimestamp.
	ExpectedTimestamp uint32
	// Keys holds the key identifier of cannotUseKey, invalidKeyData and
	// unknownKey, and the identifiers the device knows of incorrectKey.
	Keys []uint16
	// MaxKeys is set by tooManyKeys.
	MaxKeys uint8
	// AuthenticationMechanism and VendorID are set by
	// unknownAuthenticationType.
	AuthenticationMechanism uint8
	VendorID                uint16
	// KeyRevision is set by unknownKeyRevision.
	KeyRevision uint8
}

BACnetSecurityResponse is a Security-Response (Clause 24.3.3): the answer to a Challenge-Request, or the report of a security error. The fields after Details are set according to Code.

type BACnetSecurityResponseCode

type BACnetSecurityResponseCode uint8

BACnetSecurityResponseCode is the response code of a Security-Response (Clause 24.3.3).

const (
	BACnetSecurityResponseSuccess                     BACnetSecurityResponseCode = 0x00
	BACnetSecurityResponseAccessDenied                BACnetSecurityResponseCode = 0x01
	BACnetSecurityResponseBadDestinationAddress       BACnetSecurityResponseCode = 0x02
	BACnetSecurityResponseBadDestinationDeviceID      BACnetSecurityResponseCode = 0x03
	BACnetSecurityResponseBadSignature                BACnetSecurityResponseCode = 0x04
	BACnetSecurityResponseBadSourceAddress            BACnetSecurityResponseCode = 0x05
	BACnetSecurityResponseBadTimestamp                BACnetSecurityResponseCode = 0x06
	BACnetSecurityResponseCannotUseKey                BACnetSecurityResponseCode = 0x07
	BACnetSecurityResponseCannotVerifyMessageID       BACnetSecurityResponseCode = 0x08
	BACnetSecurityResponseCorrectKeyRevision          BACnetSecurityResponseCode = 0x09
	BACnetSecurityResponseDestinationDeviceIDRequired BACnetSecurityResponseCode = 0x0A
	BACnetSecurityResponseDuplicateMessage            BACnetSecurityResponseCode = 0x0B
	BACnetSecurityResponseEncryptionNotConfigured     BACnetSecurityResponseCode = 0x0C
	BACnetSecurityResponseEncryptionRequired          BACnetSecurityResponseCode = 0x0D
	BACnetSecurityResponseIncorrectKey                BACnetSecurityResponseCode = 0x0E
	BACnetSecurityResponseInvalidKeyData              BACnetSecurityResponseCode = 0x0F
	BACnetSecurityResponseKeyUpdateInProgress         BACnetSecurityResponseCode = 0x10
	BACnetSecurityResponseMalformedMessage            BACnetSecurityResponseCode = 0x11
	BACnetSecurityResponseNotKeyServer                BACnetSecurityResponseCode = 0x12
	BACnetSecurityResponseSecurityNotConfigured       BACnetSecurityResponseCode = 0x13
	BACnetSecurityResponseSourceSecurityRequired      BACnetSecurityResponseCode = 0x14
	BACnetSecurityResponseTooManyKeys                 BACnetSecurityResponseCode = 0x15
	BACnetSecurityResponseUnknownAuthenticationType   BACnetSecurityResponseCode = 0x16
	BACnetSecurityResponseUnknownKey                  BACnetSecurityResponseCode = 0x17
	BACnetSecurityResponseUnknownKeyRevision          BACnetSecurityResponseCode = 0x18
	BACnetSecurityResponseUnknownSourceMessage        BACnetSecurityResponseCode = 0x19
)

BACnetSecurityResponseCode values.

func (BACnetSecurityResponseCode) String

String returns the Clause 24.3.3 name of the response code.

type BACnetSecurityWrapper

type BACnetSecurityWrapper struct {
	Control     BACnetSecurityControl
	KeyRevision uint8
	// KeyIdentifier is the key algorithm (high octet) and key number.
	KeyIdentifier uint16
	// SourceDevice is the device instance of the source.
	SourceDevice uint32
	MessageID    uint32
	// Timestamp is the time the message was secured, in seconds since
	// 1970-01-01 UTC.
	Timestamp uint32

	DestinationDevice uint32
	DNET              uint16
	DADR              []byte
	SNET              uint16
	SADR              []byte

	// AuthenticationMechanism, UserID and UserRole are set when the
	// control octet says authentication data is present.
	AuthenticationMechanism uint8
	UserID                  uint16
	UserRole                uint8
	// AuthenticationVendorID names the vendor of a mechanism from 200 on.
	AuthenticationVendorID uint16
	// AuthenticationData belongs to a mechanism other than 0.
	AuthenticationData []byte

	// ServiceData is what the wrapper secures, as octets: the message, or
	// for an encrypted wrapper (Control.Encrypted) every octet from the
	// destination device instance to the padding, still encrypted.
	ServiceData []byte
	// Message is ServiceData decoded as the network security message that
	// carries the wrapper. It is nil when the wrapper is encrypted, when
	// it is the body of a Secure-BVLL, and when ServiceData is too short
	// for the message.
	Message BACnetSecurityMessage
	// Signature is the HMAC that ends the wrapper.
	Signature []byte
}

BACnetSecurityWrapper is the header and trailer that secure a BACnet message (Clause 24.2). The fields from DestinationDevice to AuthenticationData, and Message, are readable only when the wrapper is not encrypted.

control | key rev | key id | source device | message id | timestamp
  | destination device | DNET DLEN DADR | SNET SLEN SADR
  | [mechanism | user id | user role | [length | [vendor id] | data]]
  | service data | [padding] | signature (16)

type BACnetSegmentAssembler

type BACnetSegmentAssembler struct {
	// MaxSize caps the service data of one message, in octets; 0 means
	// BACnetSegmentDefaultMaxSize.
	MaxSize int
	// MaxPending caps the messages in reassembly; 0 means
	// BACnetSegmentDefaultMaxPending.
	MaxPending int
	// contains filtered or unexported fields
}

BACnetSegmentAssembler joins the segments of segmented BACnet APDUs into whole ones. Messages are told apart by source address, invoke ID and direction; their segments are joined in sequence number order, duplicates are ignored, and segments that overtake others are held until the gap closes.

Memory is bounded: a message that would exceed MaxSize is dropped, and starting one more than MaxPending messages drops the one that has been silent the longest, so at most MaxSize*MaxPending octets are held. The zero value is ready to use. An assembler is not safe for concurrent use.

func NewBACnetSegmentAssembler

func NewBACnetSegmentAssembler() *BACnetSegmentAssembler

NewBACnetSegmentAssembler returns an assembler with the default limits.

func (*BACnetSegmentAssembler) Add

func (s *BACnetSegmentAssembler) Add(source []byte, a *BACnetAPDU) (*BACnetAPDU, error)

Add takes one decoded APDU sent from the source address (the octets of the IP, MAC or NPDU source address, as long as it is the same choice for every call). An unsegmented APDU is returned as it is. A segment returns nil until it completes its message, and then the whole APDU, decoded as if it had been sent unsegmented, in memory of its own.

The error is ErrBACnetSegmentsTooLarge, or what decoding the joined message gave.

func (*BACnetSegmentAssembler) Pending

func (s *BACnetSegmentAssembler) Pending() int

Pending returns the number of messages in reassembly.

type BACnetSegmentation

type BACnetSegmentation uint8

BACnetSegmentation is the segmentation a device supports (Clause 21).

const (
	BACnetSegmentedBoth     BACnetSegmentation = 0
	BACnetSegmentedTransmit BACnetSegmentation = 1
	BACnetSegmentedReceive  BACnetSegmentation = 2
	BACnetNoSegmentation    BACnetSegmentation = 3
)

BACnetSegmentation values.

func (BACnetSegmentation) String

func (s BACnetSegmentation) String() string

String returns the Clause 21 name of the segmentation.

type BACnetServiceData

type BACnetServiceData interface {
	// contains filtered or unexported methods
}

BACnetServiceData is the typed parameters of a decoded service, one of *BACnetWhoIs, *BACnetIAm, *BACnetWhoHas, *BACnetIHave, *BACnetReadProperty, *BACnetReadPropertyAck, *BACnetWriteProperty, *BACnetReadPropertyMultiple, *BACnetReadPropertyMultipleAck, *BACnetSubscribeCOV, *BACnetCOVNotification, *BACnetTimeSynchronization or, for every other service and for Error PDUs, *BACnetParameters.

type BACnetSetMasterKey

type BACnetSetMasterKey struct {
	Key BACnetSecurityKey
}

BACnetSetMasterKey is a Set-Master-Key (Clause 24.3.8).

type BACnetSubscribeCOV

type BACnetSubscribeCOV struct {
	ProcessID      uint32
	Object         BACnetObjectIdentifier
	Cancel         bool
	IssueConfirmed bool
	// Lifetime is in seconds; 0 is indefinite.
	Lifetime uint32
}

BACnetSubscribeCOV is the SubscribeCOV request (Clause 13.14). Without the two optional parameters it cancels the subscription.

type BACnetTag

type BACnetTag struct {
	Class BACnetTagClass
	Kind  BACnetTagKind
	// Number is the context tag number, or the BACnetApplicationTag of an
	// application tag.
	Number uint8
	Depth  uint8
	// Length is the content length, or for an application Boolean, which
	// has no content, the value itself.
	Length uint32
	Data   []byte
}

BACnetTag is one tag of a service parameter stream. Tags come in a flat list in wire order; Depth counts the opening tags around a tag, so the opening and closing tags of a constructed value sit at the depth of its container and its contents one deeper.

func (*BACnetTag) BitString

func (t *BACnetTag) BitString() (BACnetBitString, error)

BitString returns the value of a BitString.

func (*BACnetTag) Boolean

func (t *BACnetTag) Boolean() (bool, error)

Boolean returns the value of an application or context Boolean.

func (*BACnetTag) CharacterString

func (t *BACnetTag) CharacterString() (BACnetCharacterSet, string, error)

CharacterString returns the character set and text of a CharacterString. UTF-8, ISO 8859-1, UCS-2 and UCS-4 are converted to UTF-8; the double byte sets are returned as raw bytes.

The text is every character after the character set octet (Clause 20.2.9), which knows no terminator: a NUL or a line feed that a device sends at the end of a name is part of the string and stays in it. The octets as sent are in Data.

func (*BACnetTag) Date

func (t *BACnetTag) Date() (BACnetDate, error)

Date returns the value of a Date.

func (*BACnetTag) Double

func (t *BACnetTag) Double() (float64, error)

Double returns the value of a double precision Double.

func (*BACnetTag) IsApplication

func (t *BACnetTag) IsApplication(a BACnetApplicationTag) bool

IsApplication reports whether t is an application tag of type a.

func (*BACnetTag) IsContext

func (t *BACnetTag) IsContext(n uint8) bool

IsContext reports whether t is a primitive context tag numbered n.

func (*BACnetTag) ObjectIdentifier

func (t *BACnetTag) ObjectIdentifier() (BACnetObjectIdentifier, error)

ObjectIdentifier returns the value of an ObjectIdentifier.

func (*BACnetTag) Real

func (t *BACnetTag) Real() (float32, error)

Real returns the value of a single precision Real.

func (*BACnetTag) Signed

func (t *BACnetTag) Signed() (int64, error)

Signed returns the value of a two's complement Signed, up to 64 bits.

func (*BACnetTag) Time

func (t *BACnetTag) Time() (BACnetTime, error)

Time returns the value of a Time.

func (*BACnetTag) Unsigned

func (t *BACnetTag) Unsigned() (uint64, error)

Unsigned returns the value of an Unsigned or Enumerated, up to 64 bits.

func (*BACnetTag) Value

func (t *BACnetTag) Value() (interface{}, error)

Value returns the typed value of an application tag: nil for Null, bool, uint64 (Unsigned and Enumerated), int64, float32, float64, []byte (OctetString), string, BACnetBitString, BACnetDate, BACnetTime or BACnetObjectIdentifier. A context tag has no self-described type and returns its raw Data.

type BACnetTagClass

type BACnetTagClass uint8

BACnetTagClass tells application tags from context specific ones.

const (
	BACnetTagClassApplication BACnetTagClass = 0
	BACnetTagClassContext     BACnetTagClass = 1
)

BACnetTagClass values.

func (BACnetTagClass) String

func (c BACnetTagClass) String() string

String returns the class name.

type BACnetTagKind

type BACnetTagKind uint8

BACnetTagKind tells primitive tags from the opening and closing tags that bracket constructed data.

const (
	BACnetTagPrimitive BACnetTagKind = 0
	BACnetTagOpening   BACnetTagKind = 1
	BACnetTagClosing   BACnetTagKind = 2
)

BACnetTagKind values.

func (BACnetTagKind) String

func (k BACnetTagKind) String() string

String returns the kind name.

type BACnetTime

type BACnetTime struct {
	Hour       uint8
	Minute     uint8
	Second     uint8
	Hundredths uint8
}

BACnetTime is a Time (Clause 20.2.13). Any field may be BACnetUnspecified.

func (BACnetTime) String

func (t BACnetTime) String() string

String returns the time as hh:mm:ss.hh, with * for unspecified fields.

type BACnetTimeSynchronization

type BACnetTimeSynchronization struct {
	Date BACnetDate
	Time BACnetTime
}

BACnetTimeSynchronization is the TimeSynchronization or UTCTimeSynchronization request (Clause 16.7, 16.8).

type BACnetUnconfirmedService

type BACnetUnconfirmedService uint8

BACnetUnconfirmedService is an unconfirmed service choice (Clause 21).

const (
	BACnetUnconfirmedServiceIAm                                BACnetUnconfirmedService = 0
	BACnetUnconfirmedServiceIHave                              BACnetUnconfirmedService = 1
	BACnetUnconfirmedServiceUnconfirmedCOVNotification         BACnetUnconfirmedService = 2
	BACnetUnconfirmedServiceUnconfirmedEventNotification       BACnetUnconfirmedService = 3
	BACnetUnconfirmedServiceUnconfirmedPrivateTransfer         BACnetUnconfirmedService = 4
	BACnetUnconfirmedServiceUnconfirmedTextMessage             BACnetUnconfirmedService = 5
	BACnetUnconfirmedServiceTimeSynchronization                BACnetUnconfirmedService = 6
	BACnetUnconfirmedServiceWhoHas                             BACnetUnconfirmedService = 7
	BACnetUnconfirmedServiceWhoIs                              BACnetUnconfirmedService = 8
	BACnetUnconfirmedServiceUTCTimeSynchronization             BACnetUnconfirmedService = 9
	BACnetUnconfirmedServiceWriteGroup                         BACnetUnconfirmedService = 10
	BACnetUnconfirmedServiceUnconfirmedCOVNotificationMultiple BACnetUnconfirmedService = 11
	BACnetUnconfirmedServiceUnconfirmedAuditNotification       BACnetUnconfirmedService = 12
	BACnetUnconfirmedServiceWhoAmI                             BACnetUnconfirmedService = 13
	BACnetUnconfirmedServiceYouAre                             BACnetUnconfirmedService = 14
)

BACnetUnconfirmedService values.

func (BACnetUnconfirmedService) String

func (s BACnetUnconfirmedService) String() string

String returns the Clause 21 name of the service.

type BACnetUpdateDistributionKey

type BACnetUpdateDistributionKey struct {
	KeyRevision uint8
	Key         BACnetSecurityKey
}

BACnetUpdateDistributionKey is an Update-Distribution-Key (Clause 24.3.6).

type BACnetUpdateKeySet

type BACnetUpdateKeySet struct {
	Flags BACnetKeySetFlags
	Set1  BACnetKeySetUpdate
	Set2  BACnetKeySetUpdate
}

BACnetUpdateKeySet is an Update-Key-Set (Clause 24.3.5), by which the key server distributes keys. It is normally encrypted.

type BACnetVMAC

type BACnetVMAC [bvlc6VMACLen]byte

BACnetVMAC is the 3-octet virtual MAC address of a BACnet/IPv6 node.

type BACnetValue

type BACnetValue struct {
	// Name is the Clause 21 name of the field, such as "object-identifier";
	// list elements and untyped data have none.
	Name string
	Type BACnetDataType
	// List is set when Fields holds the elements of a SEQUENCE OF Type.
	List   bool
	Value  interface{}
	Fields []BACnetValue
	// Tags are the tags the value was read from, brackets included.
	Tags []BACnetTag
}

BACnetValue is one decoded value: a service parameter, a member of a constructed value or a property value.

A primitive holds its Go value in Value: nil (Null), bool, uint64 (Unsigned), int64, float32, float64, []byte (OctetString), string, BACnetBitString, BACnetEnumerated, BACnetDate, BACnetTime, BACnetObjectIdentifier or BACnetWeekNDay. A constructed value holds its parts in Fields: the members of a SEQUENCE, the one chosen alternative of a CHOICE, the elements when List is set, or the value or values of a property.

Type BACnetDataTypeAny marks data of unknown type: a primitive context tag (its octets are Tags[0].Data) or, with Fields, a bracketed run. The vendor block of a private transfer that is not tag encoded is one too, with the block as a []byte Value and no Fields.

func DecodeBACnetProperty

func DecodeBACnetProperty(object BACnetObjectType, property BACnetPropertyIdentifier, arrayIndex uint32, tags []BACnetTag) []BACnetValue

DecodeBACnetProperty types the tags of a property value, such as the Value of a BACnetReadPropertyAck, by the datatype Clause 12 gives the property of that object type. It returns one value per element of an array or list. Pass BACnetNoArrayIndex when no element was named. A property that is unknown, or whose tags do not fit its datatype, is returned untyped.

func (*BACnetValue) Field

func (v *BACnetValue) Field(name string) *BACnetValue

Field returns the first part of v named name, or nil.

func (*BACnetValue) String

func (v *BACnetValue) String() string

String renders the value on one line: name=value for a primitive, name{...} for a constructed value and name[...] for a list, such as

timestamp{date-time{date=2024-01-31 time=10:00:00.00}}

type BACnetWeekNDay

type BACnetWeekNDay struct {
	Month       uint8
	WeekOfMonth uint8
	DayOfWeek   uint8
}

BACnetWeekNDay is a BACnetWeekNDay: a month (1-12, 13 odd, 14 even), a week of the month (1-5, 6 last 7 days, 7-9 the weeks before) and a day of the week (1 Monday to 7 Sunday). Any field may be BACnetUnspecified.

func (BACnetWeekNDay) String

func (w BACnetWeekNDay) String() string

String returns the pattern as month/week/day, with * for any.

type BACnetWhoHas

type BACnetWhoHas struct {
	Limited    bool
	LowLimit   uint32
	HighLimit  uint32
	ByName     bool
	Object     BACnetObjectIdentifier
	ObjectName string
}

BACnetWhoHas is the Who-Has request (Clause 16.9), for an object named by identifier or, when ByName is set, by ObjectName.

type BACnetWhoIs

type BACnetWhoIs struct {
	Limited   bool
	LowLimit  uint32
	HighLimit uint32
}

BACnetWhoIs is the Who-Is request (Clause 16.10). Without limits it asks every device.

type BACnetWriteProperty

type BACnetWriteProperty struct {
	Object     BACnetObjectIdentifier
	Property   BACnetPropertyIdentifier
	ArrayIndex uint32
	Value      []BACnetTag
	// Priority is the command priority, 1 to 16, or 0 when absent.
	Priority uint8
}

BACnetWriteProperty is the WriteProperty request (Clause 15.9).

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 BVLC

type BVLC struct {
	BaseLayer
	Type     uint8
	Function BVLCFunction
	// Length is the BVLL length, header included.
	Length uint16

	// ResultCode is set by BVLC-Result.
	ResultCode BVLCResultCode
	// TTL is the time-to-live, in seconds, of Register-Foreign-Device.
	TTL uint16
	// Address is the original source of Forwarded-NPDU, or the entry that
	// Delete-Foreign-Device-Table-Entry removes.
	Address BACnetIPAddress
	// BDT holds the entries of Write-BDT and Read-BDT-Ack.
	BDT []BVLCBDTEntry
	// FDT holds the entries of Read-FDT-Ack.
	FDT []BVLCFDTEntry
	// Secured is the security wrapper of Secure-BVLL, raw.
	Secured []byte
	// Security is Secured decoded, or nil when it is not a whole wrapper.
	Security *BACnetSecurityWrapper
}

BVLC is the BACnet/IP Virtual Link Control header (Annex J). Only the fields of the decoded function are set.

func (*BVLC) CanDecode

func (b *BVLC) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeBVLC.

func (*BVLC) DecodeFromBytes

func (b *BVLC) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a BACnet/IP BVLL. A BACnet/IPv6 frame is rejected with ErrBVLCType; decode it with BVLC6. gopacket.NewPacket does that by itself; a DecodingLayerParser needs BVLCAny for it.

func (*BVLC) LayerType

func (b *BVLC) LayerType() gopacket.LayerType

LayerType returns LayerTypeBVLC.

func (*BVLC) NextLayerType

func (b *BVLC) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeBACnetNPDU when the function carries an NPDU.

type BVLC6

type BVLC6 struct {
	BaseLayer
	Type     uint8
	Function BVLC6Function
	// Length is the BVLL length, header included.
	Length uint16

	SourceVMAC BACnetVMAC
	// DestinationVMAC is the destination, or the target of an address
	// resolution.
	DestinationVMAC BACnetVMAC
	// ResultCode is set by BVLC-Result.
	ResultCode BVLC6ResultCode
	// TTL is the time-to-live, in seconds, of Register-Foreign-Device.
	TTL uint16
	// Address is the original source of a forwarded message, or the entry
	// that Delete-Foreign-Device-Table-Entry removes.
	Address BACnetIPAddress
	// Secured is the security wrapper of Secure-BVLL, raw.
	Secured []byte
	// Security is Secured decoded, or nil when it is not a whole wrapper.
	Security *BACnetSecurityWrapper
}

BVLC6 is the BACnet/IPv6 Virtual Link Control header (Annex U). Only the fields of the decoded function are set.

func (*BVLC6) CanDecode

func (b *BVLC6) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeBVLC6.

func (*BVLC6) DecodeFromBytes

func (b *BVLC6) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a BACnet/IPv6 BVLL.

func (*BVLC6) LayerType

func (b *BVLC6) LayerType() gopacket.LayerType

LayerType returns LayerTypeBVLC6.

func (*BVLC6) NextLayerType

func (b *BVLC6) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeBACnetNPDU when the function carries an NPDU.

type BVLC6Function

type BVLC6Function uint8

BVLC6Function is a BACnet/IPv6 BVLC function (Annex U.2).

const (
	BVLC6FunctionResult                       BVLC6Function = 0x00
	BVLC6FunctionOriginalUnicastNPDU          BVLC6Function = 0x01
	BVLC6FunctionOriginalBroadcastNPDU        BVLC6Function = 0x02
	BVLC6FunctionAddressResolution            BVLC6Function = 0x03
	BVLC6FunctionForwardedAddressResolution   BVLC6Function = 0x04
	BVLC6FunctionAddressResolutionAck         BVLC6Function = 0x05
	BVLC6FunctionVirtualAddressResolution     BVLC6Function = 0x06
	BVLC6FunctionVirtualAddressResolutionAck  BVLC6Function = 0x07
	BVLC6FunctionForwardedNPDU                BVLC6Function = 0x08
	BVLC6FunctionRegisterForeignDevice        BVLC6Function = 0x09
	BVLC6FunctionDeleteFDTEntry               BVLC6Function = 0x0A
	BVLC6FunctionSecureBVLL                   BVLC6Function = 0x0B
	BVLC6FunctionDistributeBroadcastToNetwork BVLC6Function = 0x0C
)

BVLC6Function values.

func (BVLC6Function) String

func (f BVLC6Function) String() string

String returns the Annex U name of the function.

type BVLC6ResultCode

type BVLC6ResultCode uint16

BVLC6ResultCode is the result code of a BACnet/IPv6 BVLC-Result (Annex U.2.1).

const (
	BVLC6ResultSuccess                     BVLC6ResultCode = 0x0000
	BVLC6ResultAddressResolutionNAK        BVLC6ResultCode = 0x0030
	BVLC6ResultVirtualAddressResolutionNAK BVLC6ResultCode = 0x0060
	BVLC6ResultRegisterForeignDeviceNAK    BVLC6ResultCode = 0x0090
	BVLC6ResultDeleteFDTEntryNAK           BVLC6ResultCode = 0x00A0
	BVLC6ResultDistributeBroadcastNAK      BVLC6ResultCode = 0x00C0
)

BVLC6ResultCode values.

func (BVLC6ResultCode) String

func (r BVLC6ResultCode) String() string

String returns the Annex U name of the result code.

type BVLCAny

type BVLCAny struct {
	BVLC  BVLC
	BVLC6 BVLC6
	// IPv6 tells which of the two the last frame filled.
	IPv6 bool
}

BVLCAny decodes either BVLL on the BACnet/IP port, so that a DecodingLayerParser reaches BACnet/IPv6 as well: it can decode LayerTypeBVLC, looks at the type octet and fills BVLC or BVLC6.

var any layers.BVLCAny
parser := gopacket.NewDecodingLayerParser(layers.LayerTypeEthernet, &eth, &ip6, &udp, &any, &npdu, &apdu)

The parser reports LayerTypeBVLC as decoded for both; IPv6 tells which of the two embedded layers the frame filled.

func (*BVLCAny) CanDecode

func (b *BVLCAny) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeBVLC, what the BACnet/IP port maps to.

func (*BVLCAny) DecodeFromBytes

func (b *BVLCAny) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a BACnet/IP or BACnet/IPv6 BVLL.

func (*BVLCAny) LayerPayload

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

LayerPayload returns the NPDU, if the function carries one.

func (*BVLCAny) NextLayerType

func (b *BVLCAny) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeBACnetNPDU when the function carries an NPDU.

type BVLCBDTEntry

type BVLCBDTEntry struct {
	Address BACnetIPAddress
	Mask    net.IPMask
}

BVLCBDTEntry is one Broadcast Distribution Table entry (Annex J.4.3.1).

type BVLCFDTEntry

type BVLCFDTEntry struct {
	Address BACnetIPAddress
	// TTL is the time-to-live the foreign device registered with, in seconds.
	TTL uint16
	// Remaining is the number of seconds before the entry is purged.
	Remaining uint16
}

BVLCFDTEntry is one Foreign Device Table entry (Annex J.5.2.1).

type BVLCFunction

type BVLCFunction uint8

BVLCFunction is a BACnet/IP BVLC function (Annex J.2).

const (
	BVLCFunctionResult                       BVLCFunction = 0x00
	BVLCFunctionWriteBDT                     BVLCFunction = 0x01
	BVLCFunctionReadBDT                      BVLCFunction = 0x02
	BVLCFunctionReadBDTAck                   BVLCFunction = 0x03
	BVLCFunctionForwardedNPDU                BVLCFunction = 0x04
	BVLCFunctionRegisterForeignDevice        BVLCFunction = 0x05
	BVLCFunctionReadFDT                      BVLCFunction = 0x06
	BVLCFunctionReadFDTAck                   BVLCFunction = 0x07
	BVLCFunctionDeleteFDTEntry               BVLCFunction = 0x08
	BVLCFunctionDistributeBroadcastToNetwork BVLCFunction = 0x09
	BVLCFunctionOriginalUnicastNPDU          BVLCFunction = 0x0A
	BVLCFunctionOriginalBroadcastNPDU        BVLCFunction = 0x0B
	BVLCFunctionSecureBVLL                   BVLCFunction = 0x0C
)

BVLCFunction values.

func (BVLCFunction) String

func (f BVLCFunction) String() string

String returns the Annex J name of the function.

type BVLCResultCode

type BVLCResultCode uint16

BVLCResultCode is the result code of a BVLC-Result (Annex J.2.1).

const (
	BVLCResultSuccess                     BVLCResultCode = 0x0000
	BVLCResultWriteBDTNAK                 BVLCResultCode = 0x0010
	BVLCResultReadBDTNAK                  BVLCResultCode = 0x0020
	BVLCResultRegisterForeignDeviceNAK    BVLCResultCode = 0x0030
	BVLCResultReadFDTNAK                  BVLCResultCode = 0x0040
	BVLCResultDeleteFDTEntryNAK           BVLCResultCode = 0x0050
	BVLCResultDistributeBroadcastToNetNAK BVLCResultCode = 0x0060
)

BVLCResultCode values.

func (BVLCResultCode) String

func (r BVLCResultCode) String() string

String returns the Annex J name of the result code.

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 = 0xaaaa0300000086dd
	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 CIP added in v1.5.0

type CIP struct {
	BaseLayer
	Response         bool     // false if request, true if response
	ServiceID        byte     // The service specified for the request
	ClassID          uint16   // request only
	InstanceID       uint16   // request only
	Status           byte     // Response only
	AdditionalStatus []uint16 // Response only
	Data             []byte   // Command data for request, reply data for response
}

CIP implements encoding/decoding for the Common Industrial Protocol, as defined by ODVA (odva.org). Refer to https://www.rockwellautomation.com/resources/downloads/rockwellautomation/pdf/sales-partners/technology-licensing/eipexp1_2.pdf for more information about the protocol.

func (*CIP) CanDecode added in v1.5.0

func (cip *CIP) CanDecode() gopacket.LayerClass

CanDecode returns gopacket.LayerTypeCIP

func (*CIP) DecodeFromBytes added in v1.5.0

func (cip *CIP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes unpacks a CIP packet in the `data` argument into the receiver.

func (*CIP) IsRequest added in v1.6.0

func (cip *CIP) IsRequest() bool

IsRequest returns true if this is a CIP request (not a response)

func (*CIP) IsResponse added in v1.6.0

func (cip *CIP) IsResponse() bool

IsResponse returns true if this is a CIP response

func (*CIP) IsSuccess added in v1.6.0

func (cip *CIP) IsSuccess() bool

IsSuccess returns true if this is a response with success status

func (*CIP) LayerType added in v1.5.0

func (cip *CIP) LayerType() gopacket.LayerType

LayerType returns gopacket.LayerTypeCIP

func (*CIP) NextLayerType added in v1.5.0

func (cip *CIP) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypePayload, the only possible next layer type for a CIP packet.

type CIPService added in v1.5.0

type CIPService byte

CIPService represents a CIP service code

const (
	CIPServiceGetAttributesAll       CIPService = 0x01
	CIPServiceSetAttributesAll       CIPService = 0x02
	CIPServiceGetAttributeList       CIPService = 0x03
	CIPServiceSetAttributeList       CIPService = 0x04
	CIPServiceReset                  CIPService = 0x05
	CIPServiceStart                  CIPService = 0x06
	CIPServiceStop                   CIPService = 0x07
	CIPServiceCreate                 CIPService = 0x08
	CIPServiceDelete                 CIPService = 0x09
	CIPServiceMultipleServicePacket  CIPService = 0x0A
	CIPServiceApplyAttributes        CIPService = 0x0D
	CIPServiceGetAttributeSingle     CIPService = 0x0E
	CIPServiceSetAttributeSingle     CIPService = 0x10
	CIPServiceFindNextObjectInstance CIPService = 0x11
	CIPServiceRestore                CIPService = 0x15
	CIPServiceSave                   CIPService = 0x16
	CIPServiceGetMember              CIPService = 0x18
	CIPServiceSetMember              CIPService = 0x19
	CIPServiceInsertMember           CIPService = 0x1A
	CIPServiceRemoveMember           CIPService = 0x1B
	CIPServiceGroupSync              CIPService = 0x1C
	// Connection Manager Services
	CIPServiceForwardOpen          CIPService = 0x54
	CIPServiceForwardClose         CIPService = 0x4E
	CIPServiceUnconnectedSend      CIPService = 0x52
	CIPServiceGetConnectionData    CIPService = 0x56
	CIPServiceSearchConnectionData CIPService = 0x57
	CIPServiceGetConnectionOwner   CIPService = 0x5A
	// Response bit (OR'd with service code for responses)
	CIPServiceResponseMask CIPService = 0x80
)

CIP Service Code constants

func (CIPService) String added in v1.5.0

func (cs CIPService) String() string

String returns a human-readable string representation of the CIP service

type CIPStatus added in v1.5.0

type CIPStatus byte

CIPStatus represents a CIP status code

const (
	CIPStatusSuccess                       CIPStatus = 0x00
	CIPStatusConnectionFailure             CIPStatus = 0x01
	CIPStatusResourceUnavailable           CIPStatus = 0x02
	CIPStatusInvalidParameterValue         CIPStatus = 0x03
	CIPStatusPathSegmentError              CIPStatus = 0x04
	CIPStatusPathDestinationUnknown        CIPStatus = 0x05
	CIPStatusPartialTransfer               CIPStatus = 0x06
	CIPStatusConnectionLost                CIPStatus = 0x07
	CIPStatusServiceNotSupported           CIPStatus = 0x08
	CIPStatusInvalidAttributeValue         CIPStatus = 0x09
	CIPStatusAttributeListError            CIPStatus = 0x0A
	CIPStatusAlreadyInRequestedMode        CIPStatus = 0x0B
	CIPStatusObjectStateConflict           CIPStatus = 0x0C
	CIPStatusObjectAlreadyExists           CIPStatus = 0x0D
	CIPStatusAttributeNotSettable          CIPStatus = 0x0E
	CIPStatusPrivilegeViolation            CIPStatus = 0x0F
	CIPStatusDeviceStateConflict           CIPStatus = 0x10
	CIPStatusReplyDataTooLarge             CIPStatus = 0x11
	CIPStatusFragmentationOfPrimitiveValue CIPStatus = 0x12
	CIPStatusNotEnoughData                 CIPStatus = 0x13
	CIPStatusAttributeNotSupported         CIPStatus = 0x14
	CIPStatusTooMuchData                   CIPStatus = 0x15
	CIPStatusObjectDoesNotExist            CIPStatus = 0x16
	CIPStatusServiceFragmentationSequence  CIPStatus = 0x17
	CIPStatusNoStoredAttributeData         CIPStatus = 0x18
	CIPStatusStoreOperationFailure         CIPStatus = 0x19
	CIPStatusRoutingFailure                CIPStatus = 0x1A
	CIPStatusRoutingFailureBadSize         CIPStatus = 0x1B
	CIPStatusRoutingFailureBadService      CIPStatus = 0x1C
	CIPStatusInvalidParameter              CIPStatus = 0x20
)

CIP Status Code constants

func (CIPStatus) String added in v1.5.0

func (cs CIPStatus) String() string

String returns a human-readable string representation of the CIP status

type COTP

type COTP struct {
	BaseLayer
	Length     uint8 // length indicator: header octets after this one
	Type       COTPType
	Credit     uint8 // low nibble of the type octet: CDT, or ROA for DT
	DstRef     uint16
	SrcRef     uint16
	Class      uint8 // CR, CC: preferred or selected protocol class
	Options    uint8 // CR, CC: option bits, low nibble of the class octet
	Reason     uint8 // DR: disconnect reason; ER: reject cause
	TPDUNumber uint8 // DT, ED, AK, EA, RJ: 7-bit sequence number
	EOT        bool  // DT, ED: last TPDU of the TSDU
	Parameters []COTPParameter

	// Extended is set for a DT in extended format (classes 2 to 4,
	// ISO 8073 13.7.3), whose 31-bit number is ExtTPDUNumber;
	// TPDUNumber holds its low 7 bits.
	Extended      bool
	ExtTPDUNumber uint32
}

COTP is an ISO 8073 TPDU. Which fixed fields are set depends on Type:

CR, CC     DstRef, SrcRef, Class, Options
DR         DstRef, SrcRef, Reason
DC         DstRef, SrcRef
ER         DstRef, Reason (reject cause)
DT         TPDUNumber, EOT (and DstRef above class 1; Extended and
           ExtTPDUNumber in extended format)
ED         DstRef, TPDUNumber, EOT
AK, EA, RJ DstRef, TPDUNumber

Payload is the user data. A DT without EOT is one segment of a longer TSDU and goes to LayerTypeFragment rather than to an upper layer; COTPAssembler joins the segments.

func (*COTP) CanDecode

func (c *COTP) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeCOTP.

func (*COTP) DecodeFromBytes

func (c *COTP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a COTP TPDU from data.

func (*COTP) LayerType

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

LayerType returns LayerTypeCOTP.

func (*COTP) NextLayerType

func (c *COTP) NextLayerType() gopacket.LayerType

NextLayerType picks the decoder for the user data. A complete DT goes to S7comm, S7comm-plus or the ISO session layer by its first octets; a DT segment goes to LayerTypeFragment.

func (*COTP) Parameter

func (c *COTP) Parameter(code COTPParamCode) ([]byte, bool)

Parameter returns the value of the first parameter with code.

func (*COTP) TPDUSize

func (c *COTP) TPDUSize() int

TPDUSize returns the size in octets the TPDU size parameter announces, or 0 when it is absent or out of the 128-8192 range.

type COTPAssembler

type COTPAssembler struct {
	// MaxSize caps a TSDU in octets. Zero or less means
	// COTPDefaultMaxTSDU.
	MaxSize int
	// contains filtered or unexported fields
}

COTPAssembler joins the DT TPDUs of one direction of a transport connection into TSDUs. The zero value is ready to use. It holds at most MaxSize octets and is not safe for concurrent use.

Classes 2 to 4 may multiplex transport connections over one network connection; use one assembler per DST-REF then. TPDU numbers are not checked: class 0 does not use them, class 2 without flow control may send any value, and over TPKT the order is that of the TCP stream.

func (*COTPAssembler) Feed

func (a *COTPAssembler) Feed(c *COTP) ([]byte, gopacket.LayerType, error)

Feed takes the next TPDU of the direction, in order. When c is the last DT of a TSDU, Feed returns the TSDU and the layer type that decodes it: LayerTypeS7Comm, LayerTypeS7CommPlus or LayerTypeISOSession, chosen as COTP.NextLayerType does. Otherwise, and for an empty TSDU, it returns nil and gopacket.LayerTypeZero.

A TSDU carried by a single DT aliases c.Payload. A joined TSDU is a new buffer owned by the caller.

TPDUs other than DT leave an unfinished TSDU alone, except CR, CC, DR and DC, which open or close the connection and drop it. A TSDU above the size cap returns ErrCOTPTSDUTooLong once; its remaining segments are then skipped.

func (*COTPAssembler) Pending

func (a *COTPAssembler) Pending() int

Pending returns how many octets of an unfinished TSDU are held.

func (*COTPAssembler) Reset

func (a *COTPAssembler) Reset()

Reset drops the unfinished TSDU, e.g. after a gap in the TCP stream.

type COTPParamCode

type COTPParamCode uint8

COTPParamCode identifies a COTP variable part parameter.

const (
	COTPParamAckTime            COTPParamCode = 0x85
	COTPParamResidualErrorRate  COTPParamCode = 0x86
	COTPParamPriority           COTPParamCode = 0x87
	COTPParamTransitDelay       COTPParamCode = 0x88
	COTPParamThroughput         COTPParamCode = 0x89
	COTPParamSubsequenceNumber  COTPParamCode = 0x8A
	COTPParamReassignmentTime   COTPParamCode = 0x8B
	COTPParamFlowControlConfirm COTPParamCode = 0x8C
	COTPParamSelectiveAck       COTPParamCode = 0x8F
	COTPParamTPDUSize           COTPParamCode = 0xC0
	COTPParamCallingTSAP        COTPParamCode = 0xC1 // invalid TPDU in an ER
	COTPParamCalledTSAP         COTPParamCode = 0xC2
	COTPParamChecksum           COTPParamCode = 0xC3
	COTPParamVersion            COTPParamCode = 0xC4
	COTPParamProtection         COTPParamCode = 0xC5
	COTPParamAdditionalOptions  COTPParamCode = 0xC6
	COTPParamAlternativeClasses COTPParamCode = 0xC7
	COTPParamAdditionalInfo     COTPParamCode = 0xE0
	COTPParamPreferredTPDUSize  COTPParamCode = 0xF0
	COTPParamInactivityTimer    COTPParamCode = 0xF2
)

Variable part parameter codes from ISO 8073 13.3.4 and later clauses.

func (COTPParamCode) String

func (c COTPParamCode) String() string

String returns a human-readable name of the parameter code.

type COTPParameter

type COTPParameter struct {
	Code  COTPParamCode
	Value []byte
}

COTPParameter is one variable part TLV. Value aliases the packet data.

type COTPType

type COTPType uint8

COTPType is the TPDU code, the high nibble of the type octet.

const (
	COTPTypeED COTPType = 0x10 // expedited data
	COTPTypeEA COTPType = 0x20 // expedited data acknowledgement
	COTPTypeRJ COTPType = 0x50 // reject
	COTPTypeAK COTPType = 0x60 // data acknowledgement
	COTPTypeER COTPType = 0x70 // TPDU error
	COTPTypeDR COTPType = 0x80 // disconnect request
	COTPTypeDC COTPType = 0xC0 // disconnect confirm
	COTPTypeCC COTPType = 0xD0 // connection confirm
	COTPTypeCR COTPType = 0xE0 // connection request
	COTPTypeDT COTPType = 0xF0 // data
)

TPDU codes from ISO 8073 table 8.

func (COTPType) String

func (t COTPType) String() string

String returns the ISO 8073 abbreviation of the TPDU type.

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
	RelayHops    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
	// contains filtered or unexported fields
}

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. The result wraps for a packet longer than 65535 bytes, which only a UDP jumbogram can carry.

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 DNP3

type DNP3 struct {
	BaseLayer
	Link        DNP3Link
	LinkIssues  DNP3LinkIssue
	HeaderCRCOK bool
	BadBlocks   int // user data blocks whose CRC does not match
	UserData    []byte
	Transport   DNP3Transport // valid when UserData is not empty
	Application *DNP3Application
}

DNP3 is one DNP3 data link frame. UserData is the user data with the block CRCs removed: the transport header then an application fragment or a piece of one. Application is set when the frame begins a fragment (transport FIR). Payload of the embedded BaseLayer holds the bytes after this frame, which may be more frames. LinkIssues flags what a receiver would reject the frame for; it is never a decoding error.

func (*DNP3) CRCValid

func (d *DNP3) CRCValid() bool

CRCValid reports whether the header and every user data block CRC match.

func (*DNP3) CanDecode

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

CanDecode returns LayerTypeDNP3.

func (*DNP3) DecodeFromBytes

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

DecodeFromBytes decodes one link frame from the start of data. When only the application data is malformed, the error is returned with Link, Transport and the part of Application that decoded filled in, much as Wireshark shows a malformed frame.

func (*DNP3) LayerType

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

LayerType returns LayerTypeDNP3.

func (*DNP3) NextLayerType

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

NextLayerType returns LayerTypeZero: later frames of a segment are decoded by decodeDNP3 itself, as Modbus does.

func (*DNP3) Payload

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

Payload returns the application bytes of this frame: UserData without its transport header.

type DNP3ActivateStatus

type DNP3ActivateStatus struct {
	Delay    time.Duration
	Statuses []DNP3OperationStatus
}

DNP3ActivateStatus is the status of a requested operation (g91v1): how long the device stays busy, and one status per requested object.

type DNP3Analog

type DNP3Analog struct {
	Flags  DNP3Flags
	Value  float64
	Format DNP3NumFormat
	Time   DNP3Timestamp
}

DNP3Analog is an analog input, frozen input, event or deadband (g30 to g34), or an analog output status or event (g40, g42). Value holds any format exactly: int32 and float32 fit a float64.

type DNP3AnalogCommand

type DNP3AnalogCommand struct {
	Value  float64
	Format DNP3NumFormat
	Status DNP3ControlStatus
	Time   DNP3Timestamp
}

DNP3AnalogCommand is an analog output block (g41) or an analog output command event (g43).

type DNP3AppControl

type DNP3AppControl struct {
	FIR bool
	FIN bool
	CON bool
	UNS bool
	Seq uint8
}

DNP3AppControl is the application control octet.

type DNP3AppFunc

type DNP3AppFunc uint8

DNP3AppFunc is an application layer function code.

const (
	DNP3FuncConfirm            DNP3AppFunc = 0
	DNP3FuncRead               DNP3AppFunc = 1
	DNP3FuncWrite              DNP3AppFunc = 2
	DNP3FuncSelect             DNP3AppFunc = 3
	DNP3FuncOperate            DNP3AppFunc = 4
	DNP3FuncDirectOperate      DNP3AppFunc = 5
	DNP3FuncDirectOperateNR    DNP3AppFunc = 6
	DNP3FuncImmedFreeze        DNP3AppFunc = 7
	DNP3FuncImmedFreezeNR      DNP3AppFunc = 8
	DNP3FuncFreezeClear        DNP3AppFunc = 9
	DNP3FuncFreezeClearNR      DNP3AppFunc = 10
	DNP3FuncFreezeAtTime       DNP3AppFunc = 11
	DNP3FuncFreezeAtTimeNR     DNP3AppFunc = 12
	DNP3FuncColdRestart        DNP3AppFunc = 13
	DNP3FuncWarmRestart        DNP3AppFunc = 14
	DNP3FuncInitializeData     DNP3AppFunc = 15
	DNP3FuncInitializeAppl     DNP3AppFunc = 16
	DNP3FuncStartAppl          DNP3AppFunc = 17
	DNP3FuncStopAppl           DNP3AppFunc = 18
	DNP3FuncSaveConfig         DNP3AppFunc = 19
	DNP3FuncEnableUnsolicited  DNP3AppFunc = 20
	DNP3FuncDisableUnsolicited DNP3AppFunc = 21
	DNP3FuncAssignClass        DNP3AppFunc = 22
	DNP3FuncDelayMeasure       DNP3AppFunc = 23
	DNP3FuncRecordCurrentTime  DNP3AppFunc = 24
	DNP3FuncOpenFile           DNP3AppFunc = 25
	DNP3FuncCloseFile          DNP3AppFunc = 26
	DNP3FuncDeleteFile         DNP3AppFunc = 27
	DNP3FuncGetFileInfo        DNP3AppFunc = 28
	DNP3FuncAuthenticateFile   DNP3AppFunc = 29
	DNP3FuncAbortFile          DNP3AppFunc = 30
	DNP3FuncActivateConfig     DNP3AppFunc = 31
	DNP3FuncAuthRequest        DNP3AppFunc = 32
	DNP3FuncAuthRequestNoAck   DNP3AppFunc = 33
	DNP3FuncResponse           DNP3AppFunc = 129
	DNP3FuncUnsolicited        DNP3AppFunc = 130
	DNP3FuncAuthResponse       DNP3AppFunc = 131
)

DNP3AppFunc values from IEEE 1815-2012 table 4-1.

func (DNP3AppFunc) IsResponse

func (f DNP3AppFunc) IsResponse() bool

IsResponse reports whether f is sent by an outstation, and so is followed by internal indications.

func (DNP3AppFunc) String

func (f DNP3AppFunc) String() string

String returns the function name.

type DNP3AppID

type DNP3AppID struct {
	Name string
}

DNP3AppID names an application (g90v1).

type DNP3Application

type DNP3Application struct {
	Control  DNP3AppControl
	Function DNP3AppFunc
	IIN      DNP3IIN // responses only
	Objects  []DNP3ObjectHeader
	Unparsed []byte
}

DNP3Application is the application layer of a frame that begins a fragment. Objects lists the object headers in order. When the parse stops early, the last one is the header that stopped it, its State saying why: an object whose size this decoder does not know, a reserved qualifier code, a bad range, or objects continuing in the next frame of the fragment. Unparsed holds the bytes from that header on.

func (*DNP3Application) CTO

func (a *DNP3Application) CTO(h int) (time.Time, error)

CTO returns the common time of occurrence for header h of the fragment: the last g51 object of the nearest g51 header before it.

func (*DNP3Application) ResolveTime

func (a *DNP3Application) ResolveTime(h int, t DNP3Timestamp) (time.Time, error)

ResolveTime returns the absolute time of t, a timestamp of an object of header h: t.Time, or the fragment's CTO plus t.Relative. For example a g2v3 event 1011 ms after a CTO of 10:16:34.018 happened at 10:16:35.029.

type DNP3Assembler

type DNP3Assembler struct {
	// MaxFragment caps the bytes of one fragment. 0 means
	// DNP3MaxFragment.
	MaxFragment int
	// MaxStreams caps the streams tracked at once. 0 means
	// DNP3MaxStreams.
	MaxStreams int
	// MaxMessage caps the fragments kept of one application message. 0
	// means DNP3MaxMessage.
	MaxMessage int
	// CRC says what to do with frames that fail a CRC.
	CRC DNP3CRCPolicy
	// contains filtered or unexported fields
}

DNP3Assembler assembles the application fragments of any number of DNP3 links. The zero value is ready to use with the default limits. It is not safe for concurrent use.

Memory is bounded: at most MaxStreams streams, each holding one fragment of at most MaxFragment bytes in progress and at most MaxMessage decoded fragments of a message. The stream idle the longest is dropped to make room for a new one.

func (*DNP3Assembler) Add

func (a *DNP3Assembler) Add(d *DNP3) (*DNP3Fragment, error)

Add takes the next link frame of a capture, in order, and returns the fragment it completes. It returns nil, nil for a frame that completes none: a link control frame, or a segment of a fragment still in progress. It returns an error when the frame is dropped; the assembler then waits for the next start of a fragment on that stream.

d may be reused after Add returns: its user data is copied.

func (*DNP3Assembler) Streams

func (a *DNP3Assembler) Streams() int

Streams returns how many streams the assembler tracks.

type DNP3AttrEntry

type DNP3AttrEntry struct {
	Variation  uint8
	Properties uint8 // bit 0: writable
}

DNP3AttrEntry is one entry of a list of attribute variations (g0v255).

type DNP3AttrType

type DNP3AttrType uint8

DNP3AttrType is the data type code of a device attribute.

const (
	DNP3AttrNone       DNP3AttrType = 0
	DNP3AttrVString    DNP3AttrType = 1 // visible ASCII string
	DNP3AttrUint       DNP3AttrType = 2
	DNP3AttrInt        DNP3AttrType = 3
	DNP3AttrFloat      DNP3AttrType = 4
	DNP3AttrOctets     DNP3AttrType = 5
	DNP3AttrBits       DNP3AttrType = 6
	DNP3AttrTime       DNP3AttrType = 7
	DNP3AttrUnicode    DNP3AttrType = 8
	DNP3AttrList       DNP3AttrType = 254 // variation and properties pairs
	DNP3AttrListExtend DNP3AttrType = 255
)

DNP3AttrType values.

func (DNP3AttrType) String

func (t DNP3AttrType) String() string

String returns the data type name.

type DNP3Attribute

type DNP3Attribute struct {
	Type DNP3AttrType
	Data []byte
}

DNP3Attribute is a device attribute (g0): the variation of its header is the attribute number.

func (DNP3Attribute) Bit

func (a DNP3Attribute) Bit(n int) (bool, error)

Bit returns bit n of a BSTR value.

func (DNP3Attribute) Bits

func (a DNP3Attribute) Bits() ([]byte, error)

Bits returns a BSTR value: bit n of the string is bit n%8 of octet n/8. Bit reads one of them.

func (DNP3Attribute) Float

func (a DNP3Attribute) Float() (float64, error)

Float returns a FLT value of 4 or 8 octets.

func (DNP3Attribute) Int

func (a DNP3Attribute) Int() (int64, error)

Int returns an INT value of 1 to 8 octets, sign extended.

func (DNP3Attribute) List

func (a DNP3Attribute) List() ([]DNP3AttrEntry, error)

List returns the entries of a U8BS8LIST value, as g0v255 carries, or of a U8BS8EXLIST value, read as the same pairs.

func (DNP3Attribute) Octets

func (a DNP3Attribute) Octets() ([]byte, error)

Octets returns an OSTR value.

func (DNP3Attribute) Text

func (a DNP3Attribute) Text() string

Text returns the value octets as a string, as for VSTR.

func (DNP3Attribute) Time

func (a DNP3Attribute) Time() (time.Time, error)

Time returns a TIME value.

func (DNP3Attribute) Uint

func (a DNP3Attribute) Uint() (uint64, error)

Uint returns a UINT value of 1 to 8 octets.

func (DNP3Attribute) Unicode

func (a DNP3Attribute) Unicode() (string, error)

Unicode returns a UNCD value. The octets are read as UTF-16, low octet first; this decoder has no capture that confirms the encoding.

type DNP3AuthAggressive

type DNP3AuthAggressive struct {
	Seq  uint32
	User uint16
}

DNP3AuthAggressive is an aggressive mode request (g120v3).

type DNP3AuthChallenge

type DNP3AuthChallenge struct {
	Seq          uint32 // CSQ
	User         uint16
	MACAlgorithm uint8
	Reason       uint8
	Data         []byte
}

DNP3AuthChallenge is a secure authentication challenge (g120v1).

type DNP3AuthError

type DNP3AuthError struct {
	Seq         uint32
	User        uint16
	Association uint16
	Code        uint8
	Time        time.Time
	Text        []byte
}

DNP3AuthError is a secure authentication error (g120v7).

type DNP3AuthKeyChange

type DNP3AuthKeyChange struct {
	Seq     uint32 // KSQ
	User    uint16
	KeyData []byte
}

DNP3AuthKeyChange is a session key change (g120v6).

type DNP3AuthKeyStatus

type DNP3AuthKeyStatus struct {
	Seq          uint32 // KSQ
	User         uint16
	KeyWrap      uint8
	KeyStatus    uint8
	MACAlgorithm uint8
	Challenge    []byte
	MAC          []byte
}

DNP3AuthKeyStatus is a session key status (g120v5).

type DNP3AuthKeyStatusReq

type DNP3AuthKeyStatusReq struct {
	User uint16
}

DNP3AuthKeyStatusReq is a session key status request (g120v4).

type DNP3AuthMAC

type DNP3AuthMAC struct {
	MAC []byte
}

DNP3AuthMAC is a message authentication code (g120v9).

type DNP3AuthReply

type DNP3AuthReply struct {
	Seq  uint32
	User uint16
	MAC  []byte
}

DNP3AuthReply is a secure authentication reply (g120v2).

type DNP3AuthSignature

type DNP3AuthSignature struct {
	Signature []byte
}

DNP3AuthSignature is an update key change signature (g120v14).

type DNP3AuthUpdateKey

type DNP3AuthUpdateKey struct {
	Seq     uint32 // KSQ
	User    uint16
	KeyData []byte
}

DNP3AuthUpdateKey is an update key change (g120v13).

type DNP3AuthUpdateKeyReply

type DNP3AuthUpdateKeyReply struct {
	Seq       uint32 // KSQ
	User      uint16
	Challenge []byte
}

DNP3AuthUpdateKeyReply is an update key change reply (g120v12).

type DNP3AuthUpdateKeyReq

type DNP3AuthUpdateKeyReq struct {
	Method    uint8 // key change method
	UserName  string
	Challenge []byte
}

DNP3AuthUpdateKeyReq is an update key change request (g120v11).

type DNP3AuthUserCert

type DNP3AuthUserCert struct {
	Method      uint8 // key change method
	CertType    uint8
	Certificate []byte
}

DNP3AuthUserCert is a user certificate (g120v8).

type DNP3AuthUserStatus

type DNP3AuthUserStatus struct {
	Method     uint8 // key change method
	Operation  uint8
	Seq        uint32 // SCS
	Role       uint16
	RoleExpiry uint16 // days
	UserName   string
	PublicKey  []byte
	CertData   []byte
}

DNP3AuthUserStatus is a user status change (g120v10).

type DNP3BCD

type DNP3BCD struct {
	Raw    uint64
	Digits uint8
}

DNP3BCD is a binary-coded decimal integer (g101) of 4, 8 or 16 digits. Raw holds the digits as sent, four bits each, the lowest digit in the lowest bits: 0x1234 is 1234.

func (DNP3BCD) Uint

func (b DNP3BCD) Uint() (uint64, error)

Uint returns the decimal value. It errors when a digit is above 9.

type DNP3Binary

type DNP3Binary struct {
	Flags DNP3Flags
	State bool
	Time  DNP3Timestamp
}

DNP3Binary is a binary input or output point (g1, g2, g10, g11), a pattern mask bit (g12v3) or an internal indication bit (g80v1). Packed objects have no flags: Flags.Family is DNP3FlagsAbsent.

type DNP3BinaryCommandEvent

type DNP3BinaryCommandEvent struct {
	State  bool
	Status DNP3ControlStatus
	Time   DNP3Timestamp
}

DNP3BinaryCommandEvent is a binary output command event (g13): the commanded state and the control status.

type DNP3BufferFill

type DNP3BufferFill struct {
	Overflow  bool
	Percent   uint8
	Group     DNP3Group
	Variation uint8
}

DNP3BufferFill is the fill status of an event buffer (g81v1) for the objects of Group and Variation.

type DNP3CRCPolicy

type DNP3CRCPolicy uint8

DNP3CRCPolicy says what a DNP3Assembler does with a frame that fails a CRC.

const (
	// DNP3CRCDrop drops the frame and the fragment in progress, as a
	// device does. It is the default.
	DNP3CRCDrop DNP3CRCPolicy = iota
	// DNP3CRCKeep assembles the frame all the same, e.g. for captures
	// whose checksums were rewritten.
	DNP3CRCKeep
)

DNP3CRCPolicy values.

type DNP3CROB

type DNP3CROB struct {
	Code    DNP3ControlCode
	Count   uint8
	OnTime  uint32
	OffTime uint32
	Status  DNP3ControlStatus
}

DNP3CROB is a control relay output block (g12v1) or pattern control block (g12v2). On and off times are in milliseconds.

type DNP3ControlCode

type DNP3ControlCode uint8

DNP3ControlCode is the control code octet of a CROB or PCB.

func (DNP3ControlCode) Clear

func (c DNP3ControlCode) Clear() bool

Clear reports the clear bit.

func (DNP3ControlCode) Op

func (c DNP3ControlCode) Op() DNP3OpType

Op returns the operation type, bits 0-3.

func (DNP3ControlCode) Queue

func (c DNP3ControlCode) Queue() bool

Queue reports the queue bit (obsolete).

func (DNP3ControlCode) String

func (c DNP3ControlCode) String() string

String returns e.g. "LATCH_ON" or "PULSE_ON|CLOSE|Clear".

func (DNP3ControlCode) TripClose

func (c DNP3ControlCode) TripClose() DNP3TripClose

TripClose returns the trip-close code, bits 6-7.

type DNP3ControlStatus

type DNP3ControlStatus uint8

DNP3ControlStatus is the status code of a control or command event (IEEE 1815-2012 table 11-21).

const (
	DNP3StatusSuccess            DNP3ControlStatus = 0
	DNP3StatusTimeout            DNP3ControlStatus = 1
	DNP3StatusNoSelect           DNP3ControlStatus = 2
	DNP3StatusFormatError        DNP3ControlStatus = 3
	DNP3StatusNotSupported       DNP3ControlStatus = 4
	DNP3StatusAlreadyActive      DNP3ControlStatus = 5
	DNP3StatusHardwareError      DNP3ControlStatus = 6
	DNP3StatusLocal              DNP3ControlStatus = 7
	DNP3StatusTooManyObjs        DNP3ControlStatus = 8
	DNP3StatusNotAuthorized      DNP3ControlStatus = 9
	DNP3StatusAutomationInhibit  DNP3ControlStatus = 10
	DNP3StatusProcessingLimited  DNP3ControlStatus = 11
	DNP3StatusOutOfRange         DNP3ControlStatus = 12
	DNP3StatusDownstreamLocal    DNP3ControlStatus = 13
	DNP3StatusAlreadyComplete    DNP3ControlStatus = 14
	DNP3StatusBlocked            DNP3ControlStatus = 15
	DNP3StatusCanceled           DNP3ControlStatus = 16
	DNP3StatusBlockedOtherMaster DNP3ControlStatus = 17
	DNP3StatusDownstreamFail     DNP3ControlStatus = 18
	DNP3StatusNonParticipating   DNP3ControlStatus = 126
	DNP3StatusUndefined          DNP3ControlStatus = 127
)

DNP3ControlStatus values.

func (DNP3ControlStatus) String

func (s DNP3ControlStatus) String() string

String returns the status name.

type DNP3Counter

type DNP3Counter struct {
	Flags  DNP3Flags
	Value  uint32
	Format DNP3NumFormat
	Time   DNP3Timestamp
}

DNP3Counter is a counter, frozen counter or counter event (g20 to g23). 16 bit values are widened.

type DNP3DataSet

type DNP3DataSet struct {
	Elements [][]byte
}

DNP3DataSet is the present value of a data set (g87v1) or a snapshot of one (g88v1): its values in the order its descriptor lists them, each sent as a length octet and that many octets. The first value is the data set identifier; a snapshot follows it with its time. The descriptor, sent apart, says how to read each value.

type DNP3DataSetDescriptor

type DNP3DataSetDescriptor struct {
	Elements []DNP3DescriptorElement
}

DNP3DataSetDescriptor is a data set prototype (g85v1) or the contents of a data set descriptor (g86v1): the elements that describe the values of a data set, in order. Each is a length octet counting what follows it, a descriptor code, a data type code, the maximum length of the value and an ancillary value: 06 04 01 00 41 42 43 is the NAME "ABC".

type DNP3DataSetTraits

type DNP3DataSetTraits uint8

DNP3DataSetTraits is the characteristics octet of a data set descriptor (g86v2).

const (
	DNP3DataSetReadable DNP3DataSetTraits = 0x01 // RD
	DNP3DataSetWritable DNP3DataSetTraits = 0x02 // WR
	DNP3DataSetStatic   DNP3DataSetTraits = 0x04 // ST: has static data
	DNP3DataSetEvents   DNP3DataSetTraits = 0x08 // EV: generates events
	DNP3DataSetDynamic  DNP3DataSetTraits = 0x10 // DF: defined by the master

)

DNP3DataSetTraits bits.

func (DNP3DataSetTraits) Has

Has reports whether every bit of t2 is set.

func (DNP3DataSetTraits) String

func (t DNP3DataSetTraits) String() string

String lists the set bits, e.g. "RD|ST", and reserved bits as Reserved(0x20).

type DNP3DescriptorCode

type DNP3DescriptorCode uint8

DNP3DescriptorCode says what an element of a data set prototype or descriptor describes.

const (
	DNP3DescriptorID            DNP3DescriptorCode = 1
	DNP3DescriptorUUID          DNP3DescriptorCode = 2
	DNP3DescriptorNamespace     DNP3DescriptorCode = 3
	DNP3DescriptorName          DNP3DescriptorCode = 4
	DNP3DescriptorDataElement   DNP3DescriptorCode = 5
	DNP3DescriptorPrototype     DNP3DescriptorCode = 6
	DNP3DescriptorControlValue  DNP3DescriptorCode = 7
	DNP3DescriptorControlStatus DNP3DescriptorCode = 8
)

DNP3DescriptorCode values.

func (DNP3DescriptorCode) String

func (c DNP3DescriptorCode) String() string

String returns the descriptor code name.

type DNP3DescriptorElement

type DNP3DescriptorElement struct {
	Code      DNP3DescriptorCode
	Type      DNP3AttrType
	MaxLength uint8
	Ancillary []byte
}

DNP3DescriptorElement is one element of a data set prototype or descriptor. Ancillary is the name or identifier the element carries.

type DNP3DeviceProfile

type DNP3DeviceProfile struct {
	Functions uint64
	Headers   []DNP3ProfileHeader
}

DNP3DeviceProfile is a device profile (g82v1). Bit n of Functions is set when the device supports function code n.

type DNP3DoubleBit

type DNP3DoubleBit uint8

DNP3DoubleBit is the state of a double-bit binary input.

const (
	DNP3DoubleBitIntermediate  DNP3DoubleBit = 0
	DNP3DoubleBitOff           DNP3DoubleBit = 1
	DNP3DoubleBitOn            DNP3DoubleBit = 2
	DNP3DoubleBitIndeterminate DNP3DoubleBit = 3
)

DNP3DoubleBit values.

func (DNP3DoubleBit) String

func (d DNP3DoubleBit) String() string

String returns the state name.

type DNP3DoubleBitInput

type DNP3DoubleBitInput struct {
	Flags DNP3Flags
	State DNP3DoubleBit
	Time  DNP3Timestamp
}

DNP3DoubleBitInput is a double-bit binary input point (g3, g4).

type DNP3FileAuth

type DNP3FileAuth struct {
	AuthKey  uint32
	UserName string
	Password string
}

DNP3FileAuth is a file authentication object (g70v2).

type DNP3FileCommand

type DNP3FileCommand struct {
	Created     time.Time
	Permissions uint16
	AuthKey     uint32
	Size        uint32
	Mode        uint16 // 0 NULL, 1 READ, 2 WRITE, 3 APPEND
	MaxBlock    uint16
	RequestID   uint16
	Name        string
}

DNP3FileCommand is a file command (g70v3): open, create or delete.

type DNP3FileDescriptor

type DNP3FileDescriptor struct {
	FileType    uint16 // 0 directory, 1 simple file
	Size        uint32
	Created     time.Time
	Permissions uint16
	RequestID   uint16
	Name        string
}

DNP3FileDescriptor is a file descriptor (g70v7).

type DNP3FileID

type DNP3FileID struct {
	FileType    uint8
	Attributes  uint8
	StartRecord uint16
	EndRecord   uint16
	Size        uint32
	Created     time.Time
	Permissions uint16
	FileID      uint32
	OwnerID     uint32
	GroupID     uint32
	Function    uint8
	Status      uint8
	Name        string
	Data        []byte // the records that follow the name, size field included
}

DNP3FileID is the obsolete file identifier (g70v1).

type DNP3FileSpec

type DNP3FileSpec struct {
	Name string
}

DNP3FileSpec is a file specification string (g70v8).

type DNP3FileStatus

type DNP3FileStatus struct {
	Handle    uint32
	Size      uint32
	MaxBlock  uint16
	RequestID uint16
	Status    uint8
	Text      []byte
}

DNP3FileStatus is a file command status (g70v4).

type DNP3FileTransport

type DNP3FileTransport struct {
	Handle uint32
	Block  uint32 // bits 0-30 of the block number
	Last   bool   // bit 31: the last block
	Data   []byte
}

DNP3FileTransport is a block of file data (g70v5).

type DNP3FileTransportStatus

type DNP3FileTransportStatus struct {
	Handle uint32
	Block  uint32
	Last   bool
	Status uint8
	Text   []byte
}

DNP3FileTransportStatus is a file transport status (g70v6).

type DNP3Flag

type DNP3Flag uint8

DNP3Flag is one bit of a flags octet. Constants that share a bit name it for different families.

const (
	DNP3FlagOnline        DNP3Flag = 0x01
	DNP3FlagRestart       DNP3Flag = 0x02
	DNP3FlagCommLost      DNP3Flag = 0x04
	DNP3FlagRemoteForced  DNP3Flag = 0x08
	DNP3FlagLocalForced   DNP3Flag = 0x10
	DNP3FlagChatterFilter DNP3Flag = 0x20 // binary and double-bit inputs
	DNP3FlagRollover      DNP3Flag = 0x20 // counters, obsolete
	DNP3FlagOverRange     DNP3Flag = 0x20 // analog inputs
	DNP3FlagDiscontinuity DNP3Flag = 0x40 // counters
	DNP3FlagReferenceErr  DNP3Flag = 0x40 // analog inputs
	DNP3FlagState         DNP3Flag = 0x80 // binary inputs and outputs
)

DNP3Flag values.

type DNP3FlagFamily

type DNP3FlagFamily uint8

DNP3FlagFamily says which flag names a flags octet carries: the bits past LOCAL_FORCED mean different things per group family.

const (
	DNP3FlagsAbsent       DNP3FlagFamily = iota // the object has no flags octet
	DNP3FlagsBinaryInput                        // g1, g2
	DNP3FlagsDoubleBit                          // g3, g4: state in bits 6-7
	DNP3FlagsBinaryOutput                       // g10, g11
	DNP3FlagsCounter                            // g20 to g23
	DNP3FlagsAnalogInput                        // g30 to g33
	DNP3FlagsAnalogOutput                       // g40, g42
)

DNP3FlagFamily values.

type DNP3Flags

type DNP3Flags struct {
	Family DNP3FlagFamily
	Raw    uint8
}

DNP3Flags is a flags octet and the family that names its bits.

func (DNP3Flags) Has

func (f DNP3Flags) Has(flag DNP3Flag) bool

Has reports whether every bit of flag is set and defined for the family: DNP3FlagState is never reported for an analog input, whatever its reserved bit 7 holds. It is false when the object has no flags octet.

func (DNP3Flags) String

func (f DNP3Flags) String() string

String lists the set bits in wire order, e.g. "Online|Restart", and any reserved bit as Reserved(0x40).

type DNP3Fragment

type DNP3Fragment struct {
	Source      uint16
	Destination uint16
	Dir         bool // sent by a master
	Segments    int  // link frames the fragment came in
	Data        []byte
	Application *DNP3Application
	Err         error
	Message     []*DNP3Application
}

DNP3Fragment is one application fragment, assembled.

Application is the fragment decoded whole. Err is the error of that decode: the fragment is still returned, with the part that decoded.

Message is set on the fragment that ends an application message (application FIN): the decoded fragments of the message in order, this one last, also when the message is this fragment alone. It is nil when the start of the message was not seen or its fragments arrived out of order. Objects of one fragment never continue in the next, so nothing is joined across them.

type DNP3Group

type DNP3Group uint8

DNP3Group is an object group number.

const (
	DNP3GroupDeviceAttributes   DNP3Group = 0
	DNP3GroupBinaryInput        DNP3Group = 1
	DNP3GroupBinaryInputEvent   DNP3Group = 2
	DNP3GroupDoubleBitInput     DNP3Group = 3
	DNP3GroupDoubleBitEvent     DNP3Group = 4
	DNP3GroupBinaryOutput       DNP3Group = 10
	DNP3GroupBinaryOutputEvent  DNP3Group = 11
	DNP3GroupBinaryCommand      DNP3Group = 12
	DNP3GroupBinaryCommandEvent DNP3Group = 13
	DNP3GroupCounter            DNP3Group = 20
	DNP3GroupFrozenCounter      DNP3Group = 21
	DNP3GroupCounterEvent       DNP3Group = 22
	DNP3GroupFrozenCounterEvent DNP3Group = 23
	DNP3GroupAnalogInput        DNP3Group = 30
	DNP3GroupFrozenAnalogInput  DNP3Group = 31
	DNP3GroupAnalogInputEvent   DNP3Group = 32
	DNP3GroupFrozenAnalogEvent  DNP3Group = 33
	DNP3GroupAnalogDeadband     DNP3Group = 34
	DNP3GroupAnalogOutputStatus DNP3Group = 40
	DNP3GroupAnalogOutput       DNP3Group = 41
	DNP3GroupAnalogOutputEvent  DNP3Group = 42
	DNP3GroupAnalogCommandEvent DNP3Group = 43
	DNP3GroupTime               DNP3Group = 50
	DNP3GroupCTO                DNP3Group = 51
	DNP3GroupTimeDelay          DNP3Group = 52
	DNP3GroupClassData          DNP3Group = 60
	DNP3GroupFile               DNP3Group = 70
	DNP3GroupIIN                DNP3Group = 80
	DNP3GroupDeviceStorage      DNP3Group = 81
	DNP3GroupDeviceProfile      DNP3Group = 82
	DNP3GroupPrivateObject      DNP3Group = 83
	DNP3GroupDataSetPrototype   DNP3Group = 85
	DNP3GroupDataSetDescriptor  DNP3Group = 86
	DNP3GroupDataSet            DNP3Group = 87
	DNP3GroupDataSetEvent       DNP3Group = 88
	DNP3GroupApplication        DNP3Group = 90
	DNP3GroupOperationStatus    DNP3Group = 91
	DNP3GroupBCD                DNP3Group = 101
	DNP3GroupUint8              DNP3Group = 102
	DNP3GroupOctetString        DNP3Group = 110
	DNP3GroupOctetStringEvent   DNP3Group = 111
	DNP3GroupVTOutput           DNP3Group = 112
	DNP3GroupVTEvent            DNP3Group = 113
	DNP3GroupAuthentication     DNP3Group = 120
	DNP3GroupSecurityStat       DNP3Group = 121
	DNP3GroupSecurityStatEvent  DNP3Group = 122
)

DNP3Group values for the groups this decoder sizes, plus a few others.

func (DNP3Group) String

func (g DNP3Group) String() string

String returns the group name.

type DNP3HeaderState

type DNP3HeaderState uint8

DNP3HeaderState says how far an object header decoded.

const (
	// DNP3HeaderDecoded: the header and every object it covers decoded.
	DNP3HeaderDecoded DNP3HeaderState = iota
	// DNP3HeaderReserved: the qualifier holds a reserved prefix or range
	// code, so the range field and the objects cannot be delimited.
	DNP3HeaderReserved
	// DNP3HeaderUnsized: the range decoded, the objects are of a size
	// this decoder cannot tell.
	DNP3HeaderUnsized
	// DNP3HeaderTruncated: the range field or the objects run past the
	// end of the fragment, or of the segment when more segments follow.
	DNP3HeaderTruncated
	// DNP3HeaderBadRange: the stop of the range is below its start.
	DNP3HeaderBadRange
)

DNP3HeaderState values.

func (DNP3HeaderState) String

func (s DNP3HeaderState) String() string

String returns the state name.

type DNP3IIN

type DNP3IIN uint16

DNP3IIN holds the internal indications of a response: IIN1 in the high byte, IIN2 in the low byte, as they appear on the wire.

const (
	DNP3IINBroadcast        DNP3IIN = 0x0100
	DNP3IINClass1Events     DNP3IIN = 0x0200
	DNP3IINClass2Events     DNP3IIN = 0x0400
	DNP3IINClass3Events     DNP3IIN = 0x0800
	DNP3IINNeedTime         DNP3IIN = 0x1000
	DNP3IINLocalControl     DNP3IIN = 0x2000
	DNP3IINDeviceTrouble    DNP3IIN = 0x4000
	DNP3IINDeviceRestart    DNP3IIN = 0x8000
	DNP3IINNoFuncSupport    DNP3IIN = 0x0001
	DNP3IINObjectUnknown    DNP3IIN = 0x0002
	DNP3IINParameterError   DNP3IIN = 0x0004
	DNP3IINEventOverflow    DNP3IIN = 0x0008
	DNP3IINAlreadyExecuting DNP3IIN = 0x0010
	DNP3IINConfigCorrupt    DNP3IIN = 0x0020
	DNP3IINReserved2        DNP3IIN = 0x0040
	DNP3IINReserved1        DNP3IIN = 0x0080
)

DNP3IIN bits.

func (DNP3IIN) Has

func (i DNP3IIN) Has(flag DNP3IIN) bool

Has reports whether every bit of flag is set.

func (DNP3IIN) String

func (i DNP3IIN) String() string

String lists the set bits, e.g. "DeviceRestart|NeedTime".

type DNP3IntervalUnit

type DNP3IntervalUnit uint8

DNP3IntervalUnit is the unit of a g50v4 interval.

const (
	DNP3IntervalNone          DNP3IntervalUnit = 0 // no repeat
	DNP3IntervalMilliseconds  DNP3IntervalUnit = 1
	DNP3IntervalSeconds       DNP3IntervalUnit = 2
	DNP3IntervalMinutes       DNP3IntervalUnit = 3
	DNP3IntervalHours         DNP3IntervalUnit = 4
	DNP3IntervalDays          DNP3IntervalUnit = 5
	DNP3IntervalWeeks         DNP3IntervalUnit = 6
	DNP3IntervalMonths        DNP3IntervalUnit = 7  // same day of month
	DNP3IntervalMonthsWeekday DNP3IntervalUnit = 8  // same weekday, from month start
	DNP3IntervalMonthsLastDay DNP3IntervalUnit = 9  // same weekday, from month end
	DNP3IntervalSeasons       DNP3IntervalUnit = 10 // defined by the device
	DNP3IntervalDeviceDefined DNP3IntervalUnit = 128
)

DNP3IntervalUnit values.

func (DNP3IntervalUnit) String

func (u DNP3IntervalUnit) String() string

String returns the unit name.

type DNP3Link struct {
	Length      uint8 // octets from Control to the end of user data, CRCs excluded
	Control     uint8
	Dir         bool // set when sent by a master
	Primary     bool // PRM
	FCB         bool
	FCV         bool
	DFC         bool
	Function    DNP3LinkFunc
	Destination uint16
	Source      uint16
	CRC         uint16
}

DNP3Link is the data link header. FCB and FCV are only set in primary frames and DFC only in secondary frames, where the spec defines them.

type DNP3LinkFunc

type DNP3LinkFunc uint8

DNP3LinkFunc is a data link function code. Primary (PRM=1) and secondary (PRM=0) frames share the 4 bit code space, so the value keeps the PRM bit (0x40) to tell them apart; Code returns the bare 4 bits.

const (
	DNP3LinkResetLinkStates  DNP3LinkFunc = dnp3CtlPrm | 0x00
	DNP3LinkResetUserProcess DNP3LinkFunc = dnp3CtlPrm | 0x01 // obsolete
	DNP3LinkTestLinkStates   DNP3LinkFunc = dnp3CtlPrm | 0x02
	DNP3LinkConfirmedData    DNP3LinkFunc = dnp3CtlPrm | 0x03
	DNP3LinkUnconfirmedData  DNP3LinkFunc = dnp3CtlPrm | 0x04
	DNP3LinkRequestStatus    DNP3LinkFunc = dnp3CtlPrm | 0x09
	DNP3LinkAck              DNP3LinkFunc = 0x00
	DNP3LinkNack             DNP3LinkFunc = 0x01
	DNP3LinkStatus           DNP3LinkFunc = 0x0B
	DNP3LinkNotFunctioning   DNP3LinkFunc = 0x0E // obsolete
	DNP3LinkNotSupported     DNP3LinkFunc = 0x0F
)

DNP3LinkFunc values. Primary codes have the PRM bit set.

func (DNP3LinkFunc) Code

func (f DNP3LinkFunc) Code() uint8

Code returns the 4 bit function code without the PRM bit.

func (DNP3LinkFunc) Primary

func (f DNP3LinkFunc) Primary() bool

Primary reports whether f is a primary (PRM=1) function.

func (DNP3LinkFunc) String

func (f DNP3LinkFunc) String() string

String returns the function name.

type DNP3LinkIssue

type DNP3LinkIssue uint16

DNP3LinkIssue is a set of link layer inconsistencies of one frame. They are the conditions for which a device discards a frame (DNP3 application note AN2013-004b table 1, IEEE 1815-2012 clause 9.2.4) that can be told from the frame alone. A passive decoder still decodes such a frame: none of them is a decoding error.

const (
	// DNP3LinkBadFunction: the function code is not defined for the PRM
	// bit of the frame, or is obsolete.
	DNP3LinkBadFunction DNP3LinkIssue = 1 << iota
	// DNP3LinkBadFCV: the FCV bit of a primary frame is not the one its
	// function requires, e.g. clear in CONFIRMED_USER_DATA.
	DNP3LinkBadFCV
	// DNP3LinkReservedBit: bit 5 is set in a secondary frame, which has
	// no FCB.
	DNP3LinkReservedBit
	// DNP3LinkUnexpectedData: user data follows a function that carries
	// none, e.g. an ACK with LENGTH above 5.
	DNP3LinkUnexpectedData
	// DNP3LinkMissingData: a user data function carries no user data.
	DNP3LinkMissingData
	// DNP3LinkBadDestination: the destination is reserved (0xFFF0 to
	// 0xFFFB).
	DNP3LinkBadDestination
	// DNP3LinkBadSource: the source is reserved or a broadcast address
	// (0xFFF0 to 0xFFFF).
	DNP3LinkBadSource
	// DNP3LinkBadBroadcast: a frame to a broadcast address is not user
	// data.
	DNP3LinkBadBroadcast
	// DNP3LinkBadDirection: the DIR bit disagrees with the application
	// function of the fragment the frame begins: a request with DIR
	// clear, or a response with DIR set.
	DNP3LinkBadDirection
)

DNP3LinkIssue bits.

func (DNP3LinkIssue) Has

func (i DNP3LinkIssue) Has(issue DNP3LinkIssue) bool

Has reports whether every bit of issue is set.

func (DNP3LinkIssue) String

func (i DNP3LinkIssue) String() string

String lists the issues, e.g. "BadFCV|UnexpectedData". It is empty for a consistent frame.

type DNP3NumFormat

type DNP3NumFormat uint8

DNP3NumFormat is the wire format of a numeric value.

const (
	DNP3NumNone DNP3NumFormat = iota
	DNP3NumInt16
	DNP3NumInt32
	DNP3NumUint16
	DNP3NumUint32
	DNP3NumFloat32
	DNP3NumFloat64
	DNP3NumUint8
)

DNP3NumFormat values.

type DNP3Object

type DNP3Object struct {
	Index uint32
	Data  []byte
}

DNP3Object is one object of a header. Index is the point index from the object prefix, or start+n for a range, or n otherwise. Data holds the object value with its prefix removed; it is empty in a request that lists indexes only.

type DNP3ObjectHeader

type DNP3ObjectHeader struct {
	Group         DNP3Group
	Variation     uint8
	Qualifier     uint8
	Prefix        DNP3PrefixCode
	Range         DNP3RangeCode
	Start         uint32
	Stop          uint32
	Count         uint64
	Data          []byte
	Objects       []DNP3Object
	BitsPerObject uint8
	State         DNP3HeaderState
}

DNP3ObjectHeader is one object header and the objects it covers.

Count is the number of objects (stop-start+1 for a start/stop range), or 0 for DNP3RangeAll. Data is every byte the objects take, prefixes included. Headers that carry no values, such as those of a READ request or class data, leave it empty, except that index-prefixed qualifiers (0x17, 0x28) keep their index prefixes in it. Objects slices Data per object for byte aligned objects. Packed objects (one bit per binary input, two per double-bit input) are not sliced: BitsPerObject is set and PackedValue reads them out of Data.

State is DNP3HeaderDecoded for every header but the last of a fragment whose parse stopped there: that one names the object that stopped it and has neither Data nor Objects. Wireshark lists such a header too.

func (*DNP3ObjectHeader) PackedValue

func (h *DNP3ObjectHeader) PackedValue(i uint64) uint8

PackedValue returns object i of a packed header (BitsPerObject 1 or 2), first object in the low bits of the first byte. It returns 0 past the end of Data or for a header that is not packed.

func (*DNP3ObjectHeader) ReservedBit

func (h *DNP3ObjectHeader) ReservedBit() bool

ReservedBit reports whether bit 7 of the qualifier, reserved and sent as 0, is set. The prefix and range codes are read all the same.

func (*DNP3ObjectHeader) Value

func (h *DNP3ObjectHeader) Value(i int) (DNP3Value, error)

Value decodes object i of the header: the i-th entry of Objects, or the i-th packed point when BitsPerObject is set. It errors, never panics, on an object cut short or a type it cannot decode.

type DNP3OctetString

type DNP3OctetString []byte

DNP3OctetString is an octet string or virtual terminal object (g110 to g113).

type DNP3OpType

type DNP3OpType uint8

DNP3OpType is the operation of a CROB control code.

const (
	DNP3OpNul      DNP3OpType = 0
	DNP3OpPulseOn  DNP3OpType = 1
	DNP3OpPulseOff DNP3OpType = 2
	DNP3OpLatchOn  DNP3OpType = 3
	DNP3OpLatchOff DNP3OpType = 4
)

DNP3OpType values.

func (DNP3OpType) String

func (o DNP3OpType) String() string

String returns the operation name.

type DNP3OperationStatus

type DNP3OperationStatus struct {
	Status    uint8
	Ancillary []byte
}

DNP3OperationStatus is the status of one object of an activate configuration request.

type DNP3PrefixCode

type DNP3PrefixCode uint8

DNP3PrefixCode is the object prefix code of a qualifier: what, if anything, precedes each object.

const (
	DNP3PrefixNone   DNP3PrefixCode = 0
	DNP3PrefixIndex1 DNP3PrefixCode = 1 // 1 octet index
	DNP3PrefixIndex2 DNP3PrefixCode = 2
	DNP3PrefixIndex4 DNP3PrefixCode = 3
	DNP3PrefixSize1  DNP3PrefixCode = 4 // 1 octet object size
	DNP3PrefixSize2  DNP3PrefixCode = 5
	DNP3PrefixSize4  DNP3PrefixCode = 6
)

DNP3PrefixCode values.

func (DNP3PrefixCode) IsSize

func (c DNP3PrefixCode) IsSize() bool

IsSize reports whether the prefix gives the object size, not its index.

func (DNP3PrefixCode) Len

func (c DNP3PrefixCode) Len() int

Len returns the prefix width in bytes, or -1 for the reserved code 7.

func (DNP3PrefixCode) String

func (c DNP3PrefixCode) String() string

String returns the prefix code name.

type DNP3PrivateDescriptor

type DNP3PrivateDescriptor struct {
	Vendor   string
	ObjectID uint16
	Specs    []DNP3PrivateSpec
}

DNP3PrivateDescriptor is a private registration object descriptor (g83v2).

type DNP3PrivateObject

type DNP3PrivateObject struct {
	Vendor   string
	ObjectID uint16
	Data     []byte
}

DNP3PrivateObject is a private registration object (g83v1). Data holds the objects the vendor defines for ObjectID.

type DNP3PrivateSpec

type DNP3PrivateSpec struct {
	Quantity  uint16
	Group     DNP3Group
	Variation uint8
}

DNP3PrivateSpec is one entry of a private registration object descriptor: Quantity objects of Group and Variation.

type DNP3ProfileHeader

type DNP3ProfileHeader struct {
	Group     DNP3Group
	Variation uint8
	Qualifier uint8
	Range     uint8
}

DNP3ProfileHeader is one object header a device profile lists.

type DNP3RangeCode

type DNP3RangeCode uint8

DNP3RangeCode is the range specifier code of a qualifier.

const (
	DNP3RangeStartStop1  DNP3RangeCode = 0x0 // 1 octet start and stop index
	DNP3RangeStartStop2  DNP3RangeCode = 0x1
	DNP3RangeStartStop4  DNP3RangeCode = 0x2
	DNP3RangeVirtual1    DNP3RangeCode = 0x3 // 1 octet start and stop virtual address
	DNP3RangeVirtual2    DNP3RangeCode = 0x4
	DNP3RangeVirtual4    DNP3RangeCode = 0x5
	DNP3RangeAll         DNP3RangeCode = 0x6 // no range field
	DNP3RangeCount1      DNP3RangeCode = 0x7 // 1 octet object count
	DNP3RangeCount2      DNP3RangeCode = 0x8
	DNP3RangeCount4      DNP3RangeCode = 0x9
	DNP3RangeFreeFormat1 DNP3RangeCode = 0xB // 1 octet count of variable format objects
)

DNP3RangeCode values. Codes 3 to 5 hold a start and a stop like codes 0 to 2 (IEEE 1815-2012 table 4-6, and the parsing rules of DNP3 application note AN2013-004b), one object per address. Wireshark follows the older reading of a single absolute address instead, so it shows other objects for these three codes.

func (DNP3RangeCode) IsStartStop

func (c DNP3RangeCode) IsStartStop() bool

IsStartStop reports whether the range field holds start and stop values.

func (DNP3RangeCode) IsVirtual

func (c DNP3RangeCode) IsVirtual() bool

IsVirtual reports whether the start and stop values are virtual addresses (codes 3 to 5) rather than point indexes.

func (DNP3RangeCode) String

func (c DNP3RangeCode) String() string

String returns the range code name.

type DNP3SecurityStat

type DNP3SecurityStat struct {
	Flags       DNP3Flags
	Association uint16
	Value       uint32
	Time        DNP3Timestamp
}

DNP3SecurityStat is a security statistic or security statistic event (g121, g122). Its flags are those of a counter.

type DNP3TimeDate

type DNP3TimeDate struct {
	Time     time.Time
	Interval uint32
	Units    DNP3IntervalUnit
}

DNP3TimeDate is a time and date (g50) or a CTO (g51). Interval and Units are set by g50v2 (milliseconds) and g50v4.

type DNP3TimeDelay

type DNP3TimeDelay struct {
	Delay time.Duration
}

DNP3TimeDelay is a time delay (g52): seconds for v1, milliseconds for v2.

type DNP3TimeKind

type DNP3TimeKind uint8

DNP3TimeKind says what time an object carries.

const (
	DNP3TimeNone     DNP3TimeKind = iota
	DNP3TimeAbsolute              // 48 bit milliseconds since 1970
	DNP3TimeRelative              // 16 bit milliseconds since the CTO
)

DNP3TimeKind values.

type DNP3Timestamp

type DNP3Timestamp struct {
	Kind     DNP3TimeKind
	Time     time.Time
	Relative time.Duration
}

DNP3Timestamp is the time of an object: Time for an absolute time, Relative for a time relative to the fragment's CTO.

type DNP3Transport

type DNP3Transport struct {
	FIN bool
	FIR bool
	Seq uint8
}

DNP3Transport is the one byte transport header.

type DNP3TripClose

type DNP3TripClose uint8

DNP3TripClose is the trip-close code of a CROB control code.

const (
	DNP3TripCloseNul      DNP3TripClose = 0
	DNP3TripCloseClose    DNP3TripClose = 1
	DNP3TripCloseTrip     DNP3TripClose = 2
	DNP3TripCloseReserved DNP3TripClose = 3
)

DNP3TripClose values.

func (DNP3TripClose) String

func (t DNP3TripClose) String() string

String returns the trip-close code name.

type DNP3Value

type DNP3Value interface {
	// contains filtered or unexported methods
}

DNP3Value is the value of one object: one of the DNP3 value types of this file, e.g. DNP3Analog. Type switch on it to read its fields.

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.

DNS name fields (such as DNSQuestion.Name and DNSResourceRecord.Name) hold names in dotted presentation form. When a packet decoded by this layer is re-serialized without changing a name field, the original wire label boundaries are preserved, so a label that legitimately contains a literal dot (for example a DNS-SD instance label "foo.bar") round-trips correctly.

A name field that is newly constructed or changed is instead parsed as a presentation name, where a dot separates labels. To embed a literal dot, backslash, or arbitrary byte in a single label, use the escapes "\.", "\\", or "\DDD" (three decimal digits). A decoded name copied verbatim into a different field loses its preserved boundaries and is re-parsed this way, so any literal dot in it must be escaped first.

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 DNSKEY added in v1.3.1

type DNSKEY struct {
	Flags     DNSKEYFlag
	Protocol  DNSKEYProtocol
	Algorithm DNSSECAlgorithm
	PublicKey []byte
}

DNSKEY is a DNSKEY record, see RFC 4034, section 2.1

func (DNSKEY) String added in v1.3.1

func (dnskey DNSKEY) String() string

type DNSKEYFlag added in v1.3.1

type DNSKEYFlag uint16

DNSKEYFlag represents the key type of a DNSKEY record, see RFC 4034, section 2.1.1

const (
	DNSKEYFlagOtherKey         DNSKEYFlag = 0
	DNSKEYFlagZoneKey          DNSKEYFlag = 256
	DNSKEYFlagSecureEntryPoint DNSKEYFlag = 257
)

DNSKEYFlag common values

type DNSKEYProtocol added in v1.3.1

type DNSKEYProtocol uint8
const (
	DNSKEYProtocolReserved DNSKEYProtocol = 0
	DNSKEYProtocolValue    DNSKEYProtocol = 3
)

DNSKEYProtocol common values, see RFC 4034, section 2.1.2

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 DNSNAPTR added in v1.6.0

type DNSNAPTR struct {
	Order       uint16
	Preference  uint16
	Flags       []byte
	Service     []byte
	Regexp      []byte
	Replacement []byte
}

DNSNAPTR is a Naming Authority Pointer record, used for application-specific string transformations (e.g., for SIP, ENUM).

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
	// contains filtered or unexported fields
}

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

type DNSRRSIG added in v1.3.1

type DNSRRSIG struct {
	TypeCovered                        DNSType
	Algorithm                          DNSSECAlgorithm
	Labels                             uint8
	OriginalTTL, Expiration, Inception uint32
	KeyTag                             uint16
	SignerName, Signature              []byte
}

DNSRRSIG is a DNS RRSIG record, see RFC 4034, section 3.1

func (DNSRRSIG) String added in v1.3.1

func (rrsig DNSRRSIG) String() string

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
	NAPTR          DNSNAPTR
	OPT            []DNSOPT // See RFC 6891, section 6.1.2
	RRSIG          DNSRRSIG // See RFC 4034, section 3.1
	DNSKEY         DNSKEY   // See RFC 4034, section 2.1
	SVCB           DNSSVCB  // See RFC 9460, this contains both SVCB and HTTPS
	URI            DNSURI

	// Undecoded TXT for backward compatibility
	TXT []byte
	// contains filtered or unexported fields
}

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 DNSSECAlgorithm added in v1.3.1

type DNSSECAlgorithm uint8

DNSSECAlgorithm represents the algorithm used in a DNSSEC record, see RFC 4034, section 5.1

const (
	DNSSECAlgorithmRSAMD5          DNSSECAlgorithm = 1
	DNSSECAlgorithmDH              DNSSECAlgorithm = 3
	DNSSECAlgorithmDSASHA1         DNSSECAlgorithm = 3
	DNSSECAlgorithmECC             DNSSECAlgorithm = 4
	DNSSECAlgorithmRSASHA1         DNSSECAlgorithm = 5
	DNSSECAlgorithmDSASHA1NSEC3    DNSSECAlgorithm = 6
	DNSSECAlgorithmRSASHA1NSEC3    DNSSECAlgorithm = 7
	DNSSECAlgorithmRSASHA256       DNSSECAlgorithm = 8
	DNSSECAlgorithmRSASHA512       DNSSECAlgorithm = 10
	DNSSECAlgorithmECCGOST         DNSSECAlgorithm = 12
	DNSSECAlgorithmECDSAP256SHA256 DNSSECAlgorithm = 13
	DNSSECAlgorithmECDSAP384SHA384 DNSSECAlgorithm = 14
	DNSSECAlgorithmED25519         DNSSECAlgorithm = 15
	DNSSECAlgorithmED448           DNSSECAlgorithm = 16
)

DNSSECAlgorithm common values

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 DNSSVCB added in v1.3.0

type DNSSVCB struct {
	Priority uint16
	Target   []byte
	Params   []DNSSvcParam
}

DNSSVCB resource record is used to facilitate the lookup of information needed to make connections to network services, such as for HTTP origins.

func (DNSSVCB) String added in v1.3.0

func (svcb DNSSVCB) String() string

type DNSSvcParam added in v1.3.0

type DNSSvcParam struct {
	Key   DNSSvcParamKey
	Value []byte
}

DNSSvcParam is a service param, see RFC9460, section 2.2.

func (DNSSvcParam) String added in v1.3.0

func (param DNSSvcParam) String() string

type DNSSvcParamKey added in v1.3.0

type DNSSvcParamKey uint16

DNSSvcParamKey defines SVCB service parameter keys.

const (
	DNSSvcParamKeyMandatory     DNSSvcParamKey = 0     // RFC9460, Section 8
	DNSSvcParamKeyAlpn          DNSSvcParamKey = 1     // RFC9460, Section 7.1
	DNSSvcParamKeyNoDefaultAlpn DNSSvcParamKey = 2     // RFC9460, Section 7.1
	DNSSvcParamKeyPort          DNSSvcParamKey = 3     // RFC9460, Section 7.2
	DNSSvcParamKeyIPv4Hint      DNSSvcParamKey = 4     // RFC9460, Section 7.3
	DNSSvcParamKeyECH           DNSSvcParamKey = 5     // RFC9460
	DNSSvcParamKeyIPv6Hint      DNSSvcParamKey = 6     // RFC9460, Section 7.3
	DNSSvcParamKeyDoHPath       DNSSvcParamKey = 7     // RFC9461
	DNSSvcParamKeyOHTTP         DNSSvcParamKey = 8     // RFC9540, Section 4
	DNSSvcParamKeyDoHURI        DNSSvcParamKey = 32768 // draft-pauly-add-resolver-discovery-00.html
	DNSSvcParamKeyInvalidKey    DNSSvcParamKey = 65535 // RFC9460
)

DNSSvcParamKey known values.

func (DNSSvcParamKey) String added in v1.3.0

func (key DNSSvcParamKey) String() string

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]
	DNSTypeNAPTR  DNSType = 35  // naming authority pointer [RFC3403]
	DNSTypeOPT    DNSType = 41  // OPT Pseudo-RR [RFC6891]
	DNSTypeRRSIG  DNSType = 46  // RRSIG RR [RFC4034][RFC3755]
	DNSTypeDNSKEY DNSType = 48  // DNSKEY RR [RFC4034][RFC3755]
	DNSTypeSVCB   DNSType = 64  // SVCB DNS RR [RFC9460]
	DNSTypeHTTPS  DNSType = 65  // HTTPS RR [RFC9460]
	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 DataBandwidth added in v1.3.0

type DataBandwidth uint8
const (
	DataBandwidth20 DataBandwidth = iota
	DataBandwidth40
	DataBandwidth80
	DataBandwidth160
	DataBandwidth26ToneRU
	DataBandwidth52ToneRU
	DataBandwidth106ToneRU
	DataBandwidth242ToneRU
	DataBandwidth484ToneRU
	DataBandwidth996ToneRU
	DataBandwidth2x996ToneRU
)

func (DataBandwidth) String added in v1.3.0

func (db DataBandwidth) String() string

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 Diameter added in v1.6.0

type Diameter struct {
	BaseLayer
	Version       uint8
	MessageLength uint32 // 24-bit field
	CommandFlags  DiameterCommandFlags
	CommandCode   uint32 // 24-bit field
	ApplicationID uint32
	HopByHopID    uint32
	EndToEndID    uint32
	AVPs          []DiameterAVP
}

Diameter represents a Diameter Protocol message (RFC 6733)

func (*Diameter) CanDecode added in v1.6.0

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

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

func (*Diameter) DecodeFromBytes added in v1.6.0

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

DecodeFromBytes decodes the given bytes into this layer

func (*Diameter) IsError added in v1.6.0

func (d *Diameter) IsError() bool

IsError returns true if this is an error message

func (*Diameter) IsProxiable added in v1.6.0

func (d *Diameter) IsProxiable() bool

IsProxiable returns true if the message may be proxied

func (*Diameter) IsRequest added in v1.6.0

func (d *Diameter) IsRequest() bool

IsRequest returns true if this is a request message

func (*Diameter) IsRetransmitted added in v1.6.0

func (d *Diameter) IsRetransmitted() bool

IsRetransmitted returns true if this is a retransmitted message

func (*Diameter) LayerType added in v1.6.0

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

LayerType returns gopacket.LayerTypeDiameter

func (*Diameter) NextLayerType added in v1.6.0

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

NextLayerType returns the layer type contained by this DecodingLayer

func (*Diameter) Payload added in v1.6.0

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

Payload returns nil as Diameter is an application-layer protocol

func (*Diameter) SerializeTo added in v1.6.0

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

type DiameterAVP added in v1.6.0

type DiameterAVP struct {
	Code        uint32
	Flags       DiameterAVPFlags
	Length      uint32 // 24-bit field
	VendorID    uint32 // Only present if VendorSpecific flag is set
	Data        []byte
	GroupedAVPs []DiameterAVP // For Grouped AVP types
}

DiameterAVP represents an Attribute-Value Pair in Diameter

func ParseDiameterAVPs added in v1.6.0

func ParseDiameterAVPs(data []byte) ([]DiameterAVP, error)

ParseDiameterAVPs parses all AVPs from a data slice

func (*DiameterAVP) GetAVPTypeName added in v1.6.0

func (avp *DiameterAVP) GetAVPTypeName() string

GetAVPTypeName returns the type name for this AVP

func (*DiameterAVP) GetInteger32 added in v1.6.0

func (avp *DiameterAVP) GetInteger32() (int32, error)

GetInteger32 returns the AVP data as int32

func (*DiameterAVP) GetInteger64 added in v1.6.0

func (avp *DiameterAVP) GetInteger64() (int64, error)

GetInteger64 returns the AVP data as int64

func (*DiameterAVP) GetString added in v1.6.0

func (avp *DiameterAVP) GetString() string

GetString returns the AVP data as string

func (*DiameterAVP) GetTime added in v1.6.0

func (avp *DiameterAVP) GetTime() (time.Time, error)

GetTime returns the AVP data as time.Time (NTP timestamp)

func (*DiameterAVP) GetUnsigned32 added in v1.6.0

func (avp *DiameterAVP) GetUnsigned32() (uint32, error)

GetUnsigned32 returns the AVP data as uint32

func (*DiameterAVP) GetUnsigned64 added in v1.6.0

func (avp *DiameterAVP) GetUnsigned64() (uint64, error)

GetUnsigned64 returns the AVP data as uint64

func (*DiameterAVP) GetVendorIDString added in v1.6.0

func (avp *DiameterAVP) GetVendorIDString() string

GetVendorIDFromAVP is a convenience method to get vendor name from AVP

func (*DiameterAVP) IsMandatory added in v1.6.0

func (avp *DiameterAVP) IsMandatory() bool

IsMandatory returns true if the AVP is mandatory

func (*DiameterAVP) IsProtected added in v1.6.0

func (avp *DiameterAVP) IsProtected() bool

IsProtected returns true if the AVP is protected

func (*DiameterAVP) IsVendorSpecific added in v1.6.0

func (avp *DiameterAVP) IsVendorSpecific() bool

IsVendorSpecific returns true if the AVP is vendor-specific

func (*DiameterAVP) String added in v1.6.0

func (avp *DiameterAVP) String() string

String returns a string representation of the AVP

type DiameterAVPCode added in v1.6.0

type DiameterAVPCode uint32

DiameterAVPCode represents Diameter AVP codes

const (
	DiameterAVPCodeUserName               DiameterAVPCode = 1
	DiameterAVPCodeClass                  DiameterAVPCode = 25
	DiameterAVPCodeSessionTimeout         DiameterAVPCode = 27
	DiameterAVPCodeProxyState             DiameterAVPCode = 33
	DiameterAVPCodeAccountingSessionID    DiameterAVPCode = 44
	DiameterAVPCodeAcctMultiSessionID     DiameterAVPCode = 50
	DiameterAVPCodeEventTimestamp         DiameterAVPCode = 55
	DiameterAVPCodeAcctInterimInterval    DiameterAVPCode = 85
	DiameterAVPCodeHostIPAddress          DiameterAVPCode = 257
	DiameterAVPCodeAuthApplicationID      DiameterAVPCode = 258
	DiameterAVPCodeAcctApplicationID      DiameterAVPCode = 259
	DiameterAVPCodeVendorSpecificAppID    DiameterAVPCode = 260
	DiameterAVPCodeRedirectHostUsage      DiameterAVPCode = 261
	DiameterAVPCodeRedirectMaxCacheTime   DiameterAVPCode = 262
	DiameterAVPCodeSessionID              DiameterAVPCode = 263
	DiameterAVPCodeOriginHost             DiameterAVPCode = 264
	DiameterAVPCodeSupportedVendorID      DiameterAVPCode = 265
	DiameterAVPCodeVendorID               DiameterAVPCode = 266
	DiameterAVPCodeFirmwareRevision       DiameterAVPCode = 267
	DiameterAVPCodeResultCode             DiameterAVPCode = 268
	DiameterAVPCodeProductName            DiameterAVPCode = 269
	DiameterAVPCodeSessionBinding         DiameterAVPCode = 270
	DiameterAVPCodeSessionServerFailover  DiameterAVPCode = 271
	DiameterAVPCodeMultiRoundTimeOut      DiameterAVPCode = 272
	DiameterAVPCodeDisconnectCause        DiameterAVPCode = 273
	DiameterAVPCodeAuthRequestType        DiameterAVPCode = 274
	DiameterAVPCodeAuthGracePeriod        DiameterAVPCode = 276
	DiameterAVPCodeAuthSessionState       DiameterAVPCode = 277
	DiameterAVPCodeOriginStateID          DiameterAVPCode = 278
	DiameterAVPCodeFailedAVP              DiameterAVPCode = 279
	DiameterAVPCodeProxyHost              DiameterAVPCode = 280
	DiameterAVPCodeErrorMessage           DiameterAVPCode = 281
	DiameterAVPCodeRouteRecord            DiameterAVPCode = 282
	DiameterAVPCodeDestinationRealm       DiameterAVPCode = 283
	DiameterAVPCodeProxyInfo              DiameterAVPCode = 284
	DiameterAVPCodeReAuthRequestType      DiameterAVPCode = 285
	DiameterAVPCodeAccountingSubSessionID DiameterAVPCode = 287
	DiameterAVPCodeAuthorizationLifetime  DiameterAVPCode = 291
	DiameterAVPCodeRedirectHost           DiameterAVPCode = 292
	DiameterAVPCodeDestinationHost        DiameterAVPCode = 293
	DiameterAVPCodeErrorReportingHost     DiameterAVPCode = 294
	DiameterAVPCodeTerminationCause       DiameterAVPCode = 295
	DiameterAVPCodeOriginRealm            DiameterAVPCode = 296
	DiameterAVPCodeExperimentalResult     DiameterAVPCode = 297
	DiameterAVPCodeExperimentalResultCode DiameterAVPCode = 298
	DiameterAVPCodeInbandSecurityID       DiameterAVPCode = 299
	DiameterAVPCodeAccountingRecordType   DiameterAVPCode = 480
	DiameterAVPCodeAccountingRealtimeReq  DiameterAVPCode = 483
	DiameterAVPCodeAccountingRecordNumber DiameterAVPCode = 485
)

Standard Diameter AVP Codes from RFC 6733

const (
	DiameterAVPCode3GPPUserName           DiameterAVPCode = 1
	DiameterAVPCode3GPPMSISDN             DiameterAVPCode = 8
	DiameterAVPCode3GPPVisitedPLMNId      DiameterAVPCode = 9
	DiameterAVPCode3GPPUserEquipmentType  DiameterAVPCode = 21
	DiameterAVPCode3GPPUserEquipmentValue DiameterAVPCode = 22
	DiameterAVPCode3GPPCCRequestNumber    DiameterAVPCode = 415
	DiameterAVPCode3GPPCCRequestType      DiameterAVPCode = 416
	DiameterAVPCode3GPPSubscriptionId     DiameterAVPCode = 443
	DiameterAVPCode3GPPSubscriptionIdData DiameterAVPCode = 444
	DiameterAVPCode3GPPSubscriptionIdType DiameterAVPCode = 450
	DiameterAVPCode3GPPServingNode        DiameterAVPCode = 873
	DiameterAVPCode3GPPRatingGroup        DiameterAVPCode = 1032
	DiameterAVPCode3GPPTraceData          DiameterAVPCode = 1263
)

3GPP Vendor AVP Codes (Vendor ID: 10415)

const (
	DiameterAVPCodeETSISIPAuthDataItem      DiameterAVPCode = 311
	DiameterAVPCodeETSIAFChargingIdentifier DiameterAVPCode = 505
	DiameterAVPCodeETSIVisitedNetworkID     DiameterAVPCode = 600
	DiameterAVPCodeETSIPublicIdentity       DiameterAVPCode = 601
	DiameterAVPCodeETSIServerName           DiameterAVPCode = 602
	DiameterAVPCodeETSIServerAssignmentType DiameterAVPCode = 603
	DiameterAVPCodeETSIUserDataAlreadyAvail DiameterAVPCode = 606
	DiameterAVPCodeETSIChargingInformation  DiameterAVPCode = 610
	DiameterAVPCodeETSISupportedFeatures    DiameterAVPCode = 629
	DiameterAVPCodeETSIFeatureListID        DiameterAVPCode = 630
	DiameterAVPCodeETSIFeatureList          DiameterAVPCode = 631
)

ETSI Vendor AVP Codes (Vendor ID: 13019)

type DiameterAVPFlags added in v1.6.0

type DiameterAVPFlags struct {
	Vendor    bool
	Mandatory bool
	Protected bool
}

DiameterAVPFlags represents the flags in a Diameter AVP header

type DiameterAVPType added in v1.6.0

type DiameterAVPType uint8

DiameterAVPType represents the data type of an AVP

const (
	DiameterAVPTypeOctetString DiameterAVPType = iota
	DiameterAVPTypeInteger32
	DiameterAVPTypeInteger64
	DiameterAVPTypeUnsigned32
	DiameterAVPTypeUnsigned64
	DiameterAVPTypeFloat32
	DiameterAVPTypeFloat64
	DiameterAVPTypeGrouped
	DiameterAVPTypeAddress
	DiameterAVPTypeTime
	DiameterAVPTypeUTF8String
	DiameterAVPTypeDiameterIdentity
	DiameterAVPTypeDiameterURI
	DiameterAVPTypeEnumerated
	DiameterAVPTypeIPFilterRule
)

func GetDiameterAVPType added in v1.6.0

func GetDiameterAVPType(code uint32, vendorID uint32) (DiameterAVPType, bool)

GetDiameterAVPType returns the data type for an AVP based on its code and vendor ID

type DiameterCommandFlags added in v1.6.0

type DiameterCommandFlags struct {
	Request       bool
	Proxiable     bool
	Error         bool
	Retransmitted bool
}

DiameterCommandFlags represents the flags in a Diameter message header

type DiameterVendor added in v1.6.0

type DiameterVendor uint32

DiameterVendor represents known Diameter vendors

const (
	DiameterVendorNone     DiameterVendor = 0
	DiameterVendor3GPP     DiameterVendor = 10415 // 3GPP
	DiameterVendorETSI     DiameterVendor = 13019 // ETSI
	DiameterVendorVodafone DiameterVendor = 12645 // Vodafone
	DiameterVendorCisco    DiameterVendor = 9     // Cisco
	DiameterVendorEricsson DiameterVendor = 193   // Ericsson
	DiameterVendorHuawei   DiameterVendor = 2011  // Huawei
	DiameterVendorNokia    DiameterVendor = 94    // Nokia
)

Known Diameter vendor IDs

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 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
	ExtensionID Dot11InformationElementExtId
}

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 Dot11InformationElementExtId added in v1.3.0

type Dot11InformationElementExtId uint8
const (
	Dot11InformationElementExtIDAssocDelayInfo             Dot11InformationElementExtId = 1
	Dot11InformationElementExtIDFilsReqParams              Dot11InformationElementExtId = 2
	Dot11InformationElementExtIDFilsKeyConfirm             Dot11InformationElementExtId = 3
	Dot11InformationElementExtIDFilsSession                Dot11InformationElementExtId = 4
	Dot11InformationElementExtIDFilsHLPContainer           Dot11InformationElementExtId = 5
	Dot11InformationElementExtIDFilsIPAddrAssign           Dot11InformationElementExtId = 6
	Dot11InformationElementExtIDKeyDelivery                Dot11InformationElementExtId = 7
	Dot11InformationElementExtIDFilsWrappedData            Dot11InformationElementExtId = 8
	Dot11InformationElementExtIDFilsPublicKey              Dot11InformationElementExtId = 12
	Dot11InformationElementExtIDFilsNonce                  Dot11InformationElementExtId = 13
	Dot11InformationElementExtIDFutureChanGuidance         Dot11InformationElementExtId = 14
	Dot11InformationElementExtIDHeCapability               Dot11InformationElementExtId = 35
	Dot11InformationElementExtIDHEOperation                Dot11InformationElementExtId = 36
	Dot11InformationElementExtIDUora                       Dot11InformationElementExtId = 37
	Dot11InformationElementExtIDHeMuEdca                   Dot11InformationElementExtId = 38
	Dot11InformationElementExtIDHeSpr                      Dot11InformationElementExtId = 39
	Dot11InformationElementExtIDNdpFeedbackReportParamset  Dot11InformationElementExtId = 41
	Dot11InformationElementExtIDBssColorChgAnn             Dot11InformationElementExtId = 42
	Dot11InformationElementExtIDQuietTimePeriodSetup       Dot11InformationElementExtId = 43
	Dot11InformationElementExtIDEssReport                  Dot11InformationElementExtId = 45
	Dot11InformationElementExtIDOps                        Dot11InformationElementExtId = 46
	Dot11InformationElementExtIDHeBssLoad                  Dot11InformationElementExtId = 47
	Dot11InformationElementExtIDMaxChannelSwitchTime       Dot11InformationElementExtId = 52
	Dot11InformationElementExtIDMultipleBssidConfiguration Dot11InformationElementExtId = 55
	Dot11InformationElementExtIDNonInheritance             Dot11InformationElementExtId = 56
	Dot11InformationElementExtIDKnownBssid                 Dot11InformationElementExtId = 57
	Dot11InformationElementExtIDShortSsidList              Dot11InformationElementExtId = 58
	Dot11InformationElementExtIDHe6ghzCApA                 Dot11InformationElementExtId = 59
	Dot11InformationElementExtIDuLMuPowerCapA              Dot11InformationElementExtId = 60
	Dot11InformationElementExtIDEhTOperation               Dot11InformationElementExtId = 106
	Dot11InformationElementExtIDEhtMultiLink               Dot11InformationElementExtId = 107
	Dot11InformationElementExtIDEHhCapability              Dot11InformationElementExtId = 108
)

func (Dot11InformationElementExtId) String added in v1.3.0

String provides a human readable string for Dot11InformationElementExtId. This string is possibly subject to change over time; if you're storing this persistently, you should probably store the Dot11InformationElementExtId value, not its 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
	Dot11InformationElementIDQosParameter              Dot11InformationElementID = 222
	Dot11InformationElementIDS1GOperation              Dot11InformationElementID = 232
	Dot11InformationElementIDCAGNumber                 Dot11InformationElementID = 237
	Dot11InformationElementIDAPCSN                     Dot11InformationElementID = 239
	Dot11InformationElementIDFILSIndication            Dot11InformationElementID = 240
	Dot11InformationElementIDDILS                      Dot11InformationElementID = 241
	Dot11InformationElementIDFragment                  Dot11InformationElementID = 242
	Dot11InformationElementIDRSNX                      Dot11InformationElementID = 244
	Dot11InformationElementIDExtension                 Dot11InformationElementID = 255
)

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 Dss added in v1.3.1

type Dss struct {
	BaseLayer
	F, M, A    bool
	DataAck    []byte
	DSN        []byte
	SSN        uint32
	DataLength uint16
	Checksum   uint16
	// contains filtered or unexported fields
}

Dss contains the fields from the DSS MPTCP Option

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 ENIP added in v1.5.0

type ENIP struct {
	BaseLayer
	Command         ENIPCommand
	Length          uint16
	SessionHandle   uint32
	Status          uint32
	SenderContext   []byte
	Options         uint32
	CommandSpecific ENIPCommandSpecificData
}

ENIP implements decoding of EtherNet/IP, a protocol used to transport the Common Industrial Protocol over standard OSI networks. EtherNet/IP transports over both TCP and UDP. See the EtherNet/IP Developer's Guide for more information: https://www.odva.org/Portals/0/Library/Publications_Numbered/PUB00213R0_EtherNetIP_Developers_Guide.pdf

func (*ENIP) CanDecode added in v1.5.0

func (enip *ENIP) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeENIP

func (*ENIP) DecodeFromBytes added in v1.5.0

func (enip *ENIP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes parses the contents of `data` as an EtherNet/IP packet.

func (*ENIP) LayerType added in v1.5.0

func (enip *ENIP) LayerType() gopacket.LayerType

LayerType returns LayerTypeENIP

func (*ENIP) NextLayerType added in v1.5.0

func (enip *ENIP) NextLayerType() (nl gopacket.LayerType)

NextLayerType returns either LayerTypePayload or the next layer type derived from the command specific data

type ENIPCommand added in v1.5.0

type ENIPCommand uint16

ENIPCommand is an EtherNet/IP command code

const (
	ENIPCommandNOP               ENIPCommand = 0x0000
	ENIPCommandListServices      ENIPCommand = 0x0004
	ENIPCommandListIdentity      ENIPCommand = 0x0063
	ENIPCommandListInterfaces    ENIPCommand = 0x0064
	ENIPCommandRegisterSession   ENIPCommand = 0x0065
	ENIPCommandUnregisterSession ENIPCommand = 0x0066
	ENIPCommandSendRRData        ENIPCommand = 0x006F
	ENIPCommandSendUnitData      ENIPCommand = 0x0070
	ENIPCommandIndicateStatus    ENIPCommand = 0x0072
	ENIPCommandCancel            ENIPCommand = 0x0073
)

ENIP Command constants

func (ENIPCommand) String added in v1.5.0

func (ec ENIPCommand) String() string

String returns a human-readable string representation of the ENIP command

type ENIPCommandSpecificData added in v1.6.0

type ENIPCommandSpecificData struct {
	Cmd  ENIPCommand
	Data []byte
}

ENIPCommandSpecificData contains data specific to a command. This may include another EtherNet/IP packet embedded within the Data structure.

func (ENIPCommandSpecificData) NextLayer added in v1.6.0

func (csd ENIPCommandSpecificData) NextLayer() (nl gopacket.LayerType)

NextLayer derives the next layer type by checking for a CIP marker at the start of the command specific data, returning LayerTypeCIP if found; if not present, the next layer type is LayerTypePayload

type ENIPStatus added in v1.5.0

type ENIPStatus uint32

ENIPStatus represents an EtherNet/IP status code

const (
	ENIPStatusSuccess              ENIPStatus = 0x0000
	ENIPStatusInvalidCommand       ENIPStatus = 0x0001
	ENIPStatusInsufficientMemory   ENIPStatus = 0x0002
	ENIPStatusIncorrectData        ENIPStatus = 0x0003
	ENIPStatusInvalidSessionHandle ENIPStatus = 0x0064
	ENIPStatusInvalidLength        ENIPStatus = 0x0065
	ENIPStatusUnsupportedProtocol  ENIPStatus = 0x0069
)

ENIP Status constants

func (ENIPStatus) String added in v1.5.0

func (es ENIPStatus) String() string

String returns a human-readable string representation of the ENIP status

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 ESCALControl

type ESCALControl uint16

ESCALControl is the AL control register (0x0120): the state the master requests.

func (ESCALControl) ErrorAck

func (c ESCALControl) ErrorAck() bool

ErrorAck reports whether the master acknowledges an error.

func (ESCALControl) IDRequest

func (c ESCALControl) IDRequest() bool

IDRequest reports whether the master requests the device ID.

func (ESCALControl) State

func (c ESCALControl) State() ESCALState

State returns the requested state.

type ESCALState

type ESCALState uint8

ESCALState is an EtherCAT state machine state.

const (
	ESCALStateInit      ESCALState = 1
	ESCALStatePreOp     ESCALState = 2
	ESCALStateBootstrap ESCALState = 3
	ESCALStateSafeOp    ESCALState = 4
	ESCALStateOp        ESCALState = 8
)

EtherCAT state machine states.

func (ESCALState) String

func (s ESCALState) String() string

String returns the state name.

type ESCALStatus

type ESCALStatus uint16

ESCALStatus is the AL status register (0x0130): the state the slave is in.

func (ESCALStatus) Error

func (s ESCALStatus) Error() bool

Error reports whether the slave signals an error; the AL status code register says which.

func (ESCALStatus) IDLoaded

func (s ESCALStatus) IDLoaded() bool

IDLoaded reports whether the device ID is in the AL status code.

func (ESCALStatus) State

func (s ESCALStatus) State() ESCALState

State returns the current state.

type ESCALStatusCode

type ESCALStatusCode uint16

ESCALStatusCode is the AL status code register (0x0134): why a slave refused a state change or left a state.

const (
	ESCALNoError              ESCALStatusCode = 0x0000
	ESCALUnspecifiedError     ESCALStatusCode = 0x0001
	ESCALNoMemory             ESCALStatusCode = 0x0002
	ESCALInvalidDeviceSetup   ESCALStatusCode = 0x0003
	ESCALSIIMismatch          ESCALStatusCode = 0x0006
	ESCALFirmwareUpdateFailed ESCALStatusCode = 0x0007
	ESCALLicenseError         ESCALStatusCode = 0x000E
	ESCALInvalidStateChange   ESCALStatusCode = 0x0011
	ESCALUnknownState         ESCALStatusCode = 0x0012
	ESCALNoBootstrap          ESCALStatusCode = 0x0013
	ESCALNoValidFirmware      ESCALStatusCode = 0x0014
	ESCALMailboxConfigBoot    ESCALStatusCode = 0x0015
	ESCALMailboxConfigPreOp   ESCALStatusCode = 0x0016
	ESCALSyncManagerConfig    ESCALStatusCode = 0x0017
	ESCALNoValidInputs        ESCALStatusCode = 0x0018
	ESCALNoValidOutputs       ESCALStatusCode = 0x0019
	ESCALSyncError            ESCALStatusCode = 0x001A
	ESCALSyncManagerWatchdog  ESCALStatusCode = 0x001B
	ESCALSyncManagerTypes     ESCALStatusCode = 0x001C
	ESCALOutputConfig         ESCALStatusCode = 0x001D
	ESCALInputConfig          ESCALStatusCode = 0x001E
	ESCALWatchdogConfig       ESCALStatusCode = 0x001F
	ESCALNeedColdStart        ESCALStatusCode = 0x0020
	ESCALNeedInit             ESCALStatusCode = 0x0021
	ESCALNeedPreOp            ESCALStatusCode = 0x0022
	ESCALNeedSafeOp           ESCALStatusCode = 0x0023
	ESCALInputMapping         ESCALStatusCode = 0x0024
	ESCALOutputMapping        ESCALStatusCode = 0x0025
	ESCALInconsistentSettings ESCALStatusCode = 0x0026
	ESCALNoFreeRun            ESCALStatusCode = 0x0027
	ESCALNoSyncMode           ESCALStatusCode = 0x0028
	ESCALFreeRunThreeBuffer   ESCALStatusCode = 0x0029
	ESCALBackgroundWatchdog   ESCALStatusCode = 0x002A
	ESCALNoValidIO            ESCALStatusCode = 0x002B
	ESCALFatalSyncError       ESCALStatusCode = 0x002C
	ESCALNoSyncError          ESCALStatusCode = 0x002D
	ESCALCycleTimeTooSmall    ESCALStatusCode = 0x002E
	ESCALDCSyncConfig         ESCALStatusCode = 0x0030
	ESCALDCLatchConfig        ESCALStatusCode = 0x0031
	ESCALPLLError             ESCALStatusCode = 0x0032
	ESCALDCSyncIOError        ESCALStatusCode = 0x0033
	ESCALDCSyncTimeout        ESCALStatusCode = 0x0034
	ESCALDCSyncCycleTime      ESCALStatusCode = 0x0035
	ESCALDCSync0CycleTime     ESCALStatusCode = 0x0036
	ESCALDCSync1CycleTime     ESCALStatusCode = 0x0037
	ESCALMailboxAoE           ESCALStatusCode = 0x0041
	ESCALMailboxEoE           ESCALStatusCode = 0x0042
	ESCALMailboxCoE           ESCALStatusCode = 0x0043
	ESCALMailboxFoE           ESCALStatusCode = 0x0044
	ESCALMailboxSoE           ESCALStatusCode = 0x0045
	ESCALMailboxVoE           ESCALStatusCode = 0x004F
	ESCALEEPROMNoAccess       ESCALStatusCode = 0x0050
	ESCALEEPROMError          ESCALStatusCode = 0x0051
	ESCALHardwareNotReady     ESCALStatusCode = 0x0052
	ESCALRestartedLocally     ESCALStatusCode = 0x0060
	ESCALDeviceIDUpdated      ESCALStatusCode = 0x0061
	ESCALModuleIdentMismatch  ESCALStatusCode = 0x0070
	ESCALAppControllerReady   ESCALStatusCode = 0x00F0
)

AL status codes (ETG.1000.6 table 11).

func (ESCALStatusCode) String

func (c ESCALStatusCode) String() string

String returns the status code name. Codes from 0x8000 are vendor specific.

type ESCArea

type ESCArea uint8

ESCArea is a block of the slave controller address space.

const (
	ESCAreaInformation ESCArea = iota
	ESCAreaStation
	ESCAreaProtection
	ESCAreaDataLink
	ESCAreaApplication
	ESCAreaInterrupt
	ESCAreaErrorCounter
	ESCAreaWatchdog
	ESCAreaEEPROM
	ESCAreaMII
	ESCAreaFMMU
	ESCAreaSyncManager
	ESCAreaDC
	ESCAreaSpecific
	ESCAreaDigitalIO
	ESCAreaUserRAM
	ESCAreaMemory
	ESCAreaReserved
)

Address space areas, in address order.

func (ESCArea) String

func (a ESCArea) String() string

String returns the area name.

type ESCDCActivation

type ESCDCActivation uint8

ESCDCActivation is the DC activation register (0x0981).

func (ESCDCActivation) CyclicOperation

func (a ESCDCActivation) CyclicOperation() bool

CyclicOperation reports whether the sync out unit runs.

func (ESCDCActivation) Sync0

func (a ESCDCActivation) Sync0() bool

Sync0 reports whether SYNC0 pulses are generated.

func (ESCDCActivation) Sync1

func (a ESCDCActivation) Sync1() bool

Sync1 reports whether SYNC1 pulses are generated.

type ESCDCEdge

type ESCDCEdge uint8

ESCDCEdge selects the edge of a latch time.

const (
	ESCDCEdgePositive ESCDCEdge = iota
	ESCDCEdgeNegative
)

Latch edges.

type ESCDCLatchControl

type ESCDCLatchControl uint8

ESCDCLatchControl is a latch control register (0x09A8, 0x09A9).

func (ESCDCLatchControl) NegativeSingle

func (c ESCDCLatchControl) NegativeSingle() bool

NegativeSingle reports whether only the first negative edge latches.

func (ESCDCLatchControl) PositiveSingle

func (c ESCDCLatchControl) PositiveSingle() bool

PositiveSingle reports whether only the first positive edge latches; otherwise every edge does.

type ESCDCLatchStatus

type ESCDCLatchStatus uint8

ESCDCLatchStatus is a latch status register (0x09AE, 0x09AF).

func (ESCDCLatchStatus) NegativeEvent

func (s ESCDCLatchStatus) NegativeEvent() bool

NegativeEvent reports a latched negative edge.

func (ESCDCLatchStatus) PinState

func (s ESCDCLatchStatus) PinState() bool

PinState returns the level of the latch input pin.

func (ESCDCLatchStatus) PositiveEvent

func (s ESCDCLatchStatus) PositiveEvent() bool

PositiveEvent reports a latched positive edge.

type ESCDLStatus

type ESCDLStatus uint16

ESCDLStatus is the DL status register (0x0110, 2 bytes): the link state of the four ports.

func (ESCDLStatus) Communication

func (s ESCDLStatus) Communication(port int) bool

Communication reports whether port 0-3 has a stable link to a neighbour.

func (ESCDLStatus) EnhancedLinkDetection

func (s ESCDLStatus) EnhancedLinkDetection() bool

EnhancedLinkDetection reports whether enhanced link detection is on.

func (ESCDLStatus) LoopClosed

func (s ESCDLStatus) LoopClosed(port int) bool

LoopClosed reports whether port 0-3 forwards frames back (no neighbour).

func (ESCDLStatus) PDIOperational

func (s ESCDLStatus) PDIOperational() bool

PDIOperational reports whether the EEPROM is loaded and the PDI runs.

func (ESCDLStatus) PDIWatchdog

func (s ESCDLStatus) PDIWatchdog() bool

PDIWatchdog reports whether the PDI watchdog is reloaded (not expired).

func (s ESCDLStatus) PhysicalLink(port int) bool

PhysicalLink reports whether port 0-3 has a physical link.

type ESCEEPROMCommand

type ESCEEPROMCommand uint8

ESCEEPROMCommand is the command field of the EEPROM control register.

const (
	ESCEEPROMNop    ESCEEPROMCommand = 0
	ESCEEPROMRead   ESCEEPROMCommand = 1
	ESCEEPROMWrite  ESCEEPROMCommand = 2
	ESCEEPROMReload ESCEEPROMCommand = 4
)

EEPROM commands.

func (ESCEEPROMCommand) String

func (c ESCEEPROMCommand) String() string

String returns the command name.

type ESCEEPROMControl

type ESCEEPROMControl uint16

ESCEEPROMControl is the EEPROM control/status register (0x0502).

func (ESCEEPROMControl) AckError

func (c ESCEEPROMControl) AckError() bool

AckError reports a missing acknowledge or an invalid command.

func (ESCEEPROMControl) Busy

func (c ESCEEPROMControl) Busy() bool

Busy reports whether the EEPROM interface is busy.

func (ESCEEPROMControl) ChecksumError

func (c ESCEEPROMControl) ChecksumError() bool

ChecksumError reports a checksum error in the ESC configuration area.

func (ESCEEPROMControl) Command

func (c ESCEEPROMControl) Command() ESCEEPROMCommand

Command returns the command a write starts or a read finds pending.

func (ESCEEPROMControl) Emulated

func (c ESCEEPROMControl) Emulated() bool

Emulated reports whether the PDI emulates the EEPROM.

func (ESCEEPROMControl) LoadError

func (c ESCEEPROMControl) LoadError() bool

LoadError reports that the device information was not loaded.

func (ESCEEPROMControl) ReadSize

func (c ESCEEPROMControl) ReadSize() int

ReadSize returns how many data bytes one read yields: 4 or 8.

func (ESCEEPROMControl) TwoAddressBytes

func (c ESCEEPROMControl) TwoAddressBytes() bool

TwoAddressBytes reports whether the EEPROM takes two address bytes.

func (ESCEEPROMControl) WriteEnable

func (c ESCEEPROMControl) WriteEnable() bool

WriteEnable reports whether write requests are enabled.

func (ESCEEPROMControl) WriteError

func (c ESCEEPROMControl) WriteError() bool

WriteError reports a write command without write enable.

type ESCFMMU

type ESCFMMU struct {
	LogicalStart     uint32
	Length           uint16
	LogicalStartBit  uint8
	LogicalEndBit    uint8
	PhysicalStart    uint16
	PhysicalStartBit uint8
	Type             uint8
	Activate         uint8
}

ESCFMMU is one fieldbus memory management unit configuration block (0x0600 + 16n): it maps a logical address range onto slave memory.

func (ESCFMMU) Enabled

func (f ESCFMMU) Enabled() bool

Enabled reports whether the FMMU is activated.

func (ESCFMMU) Read

func (f ESCFMMU) Read() bool

Read reports whether the mapping serves logical reads.

func (ESCFMMU) Write

func (f ESCFMMU) Write() bool

Write reports whether the mapping serves logical writes.

type ESCMII

type ESCMII struct {
	Control     ESCMIIControl
	PHYAddress  uint8
	PHYRegister uint8
	Data        uint16
}

ESCMII is the MII management interface, registers 0x0510 to 0x0515: one access to a PHY register.

type ESCMIICommand

type ESCMIICommand uint8

ESCMIICommand is the command field of the MII control register.

const (
	ESCMIINop   ESCMIICommand = 0
	ESCMIIRead  ESCMIICommand = 1
	ESCMIIWrite ESCMIICommand = 2
)

MII management commands.

func (ESCMIICommand) String

func (c ESCMIICommand) String() string

String returns the command name.

type ESCMIIControl

type ESCMIIControl uint16

ESCMIIControl is the MII management control/status register (0x0510).

func (ESCMIIControl) Busy

func (c ESCMIIControl) Busy() bool

Busy reports whether the MII management interface is busy.

func (ESCMIIControl) Command

func (c ESCMIIControl) Command() ESCMIICommand

Command returns the command a write starts or a read finds pending.

func (ESCMIIControl) CommandError

func (c ESCMIIControl) CommandError() bool

CommandError reports an invalid command or a write without enable.

func (ESCMIIControl) LinkDetection

func (c ESCMIIControl) LinkDetection() bool

LinkDetection reports whether MI link detection is active.

func (ESCMIIControl) PDIControl

func (c ESCMIIControl) PDIControl() bool

PDIControl reports whether the PDI may take over the interface.

func (ESCMIIControl) PHYOffset

func (c ESCMIIControl) PHYOffset() uint8

PHYOffset returns the PHY address of port 0.

func (ESCMIIControl) ReadError

func (c ESCMIIControl) ReadError() bool

ReadError reports a failed PHY read.

func (ESCMIIControl) WriteEnable

func (c ESCMIIControl) WriteEnable() bool

WriteEnable reports whether PHY register writes are enabled.

type ESCRegister

type ESCRegister uint16

ESCRegister is the offset of an EtherCAT slave controller register.

const (
	ESCRegisterType            ESCRegister = 0x0000
	ESCRegisterRevision        ESCRegister = 0x0001
	ESCRegisterBuild           ESCRegister = 0x0002
	ESCRegisterFMMUCount       ESCRegister = 0x0004
	ESCRegisterSMCount         ESCRegister = 0x0005
	ESCRegisterRAMSize         ESCRegister = 0x0006
	ESCRegisterPorts           ESCRegister = 0x0007
	ESCRegisterFeatures        ESCRegister = 0x0008
	ESCRegisterStationAddress  ESCRegister = 0x0010
	ESCRegisterStationAlias    ESCRegister = 0x0012
	ESCRegisterWriteProtect    ESCRegister = 0x0020
	ESCRegisterAccessProtect   ESCRegister = 0x0030
	ESCRegisterResetECAT       ESCRegister = 0x0040
	ESCRegisterResetPDI        ESCRegister = 0x0041
	ESCRegisterDLControl       ESCRegister = 0x0100
	ESCRegisterDLControl1      ESCRegister = 0x0101
	ESCRegisterDLControl2      ESCRegister = 0x0102
	ESCRegisterDLControl3      ESCRegister = 0x0103
	ESCRegisterPhysRWOffset    ESCRegister = 0x0108
	ESCRegisterDLStatus        ESCRegister = 0x0110
	ESCRegisterDLStatus1       ESCRegister = 0x0111
	ESCRegisterALControl       ESCRegister = 0x0120
	ESCRegisterALStatus        ESCRegister = 0x0130
	ESCRegisterALStatusCode    ESCRegister = 0x0134
	ESCRegisterPDIControl      ESCRegister = 0x0140
	ESCRegisterPDIConfig       ESCRegister = 0x0141
	ESCRegisterECATIRQMask     ESCRegister = 0x0200
	ESCRegisterPDIIRQMaskLow   ESCRegister = 0x0204
	ESCRegisterPDIIRQMaskHigh  ESCRegister = 0x0206
	ESCRegisterECATIRQ         ESCRegister = 0x0210
	ESCRegisterPDIIRQLow       ESCRegister = 0x0220
	ESCRegisterPDIIRQHigh      ESCRegister = 0x0222
	ESCRegisterCRCError0       ESCRegister = 0x0300
	ESCRegisterCRCError1       ESCRegister = 0x0302
	ESCRegisterCRCError2       ESCRegister = 0x0304
	ESCRegisterCRCError3       ESCRegister = 0x0306
	ESCRegisterForwardedCRC0   ESCRegister = 0x0308
	ESCRegisterForwardedCRC1   ESCRegister = 0x0309
	ESCRegisterForwardedCRC2   ESCRegister = 0x030A
	ESCRegisterForwardedCRC3   ESCRegister = 0x030B
	ESCRegisterProcessUnitErr  ESCRegister = 0x030C
	ESCRegisterPDIError        ESCRegister = 0x030D
	ESCRegisterLinkLost0       ESCRegister = 0x0310
	ESCRegisterLinkLost1       ESCRegister = 0x0311
	ESCRegisterLinkLost2       ESCRegister = 0x0312
	ESCRegisterLinkLost3       ESCRegister = 0x0313
	ESCRegisterWDDivider       ESCRegister = 0x0400
	ESCRegisterWDTimePDI       ESCRegister = 0x0410
	ESCRegisterWDTimeSM        ESCRegister = 0x0420
	ESCRegisterWDStatus        ESCRegister = 0x0440
	ESCRegisterWDCounterSM     ESCRegister = 0x0442
	ESCRegisterWDCounterPDI    ESCRegister = 0x0443
	ESCRegisterEEPROMAssign    ESCRegister = 0x0500
	ESCRegisterEEPROMControl   ESCRegister = 0x0502
	ESCRegisterEEPROMAddrLow   ESCRegister = 0x0504
	ESCRegisterEEPROMAddrHigh  ESCRegister = 0x0506
	ESCRegisterEEPROMData0     ESCRegister = 0x0508
	ESCRegisterEEPROMData1     ESCRegister = 0x050A
	ESCRegisterEEPROMData2     ESCRegister = 0x050C
	ESCRegisterEEPROMData3     ESCRegister = 0x050E
	ESCRegisterMIIControl      ESCRegister = 0x0510
	ESCRegisterMIIAddress      ESCRegister = 0x0512
	ESCRegisterMIIData         ESCRegister = 0x0514
	ESCRegisterMIIAccess       ESCRegister = 0x0516
	ESCRegisterMIIPortStatus0  ESCRegister = 0x0518
	ESCRegisterMIIPortStatus1  ESCRegister = 0x0519
	ESCRegisterMIIPortStatus2  ESCRegister = 0x051A
	ESCRegisterMIIPortStatus3  ESCRegister = 0x051B
	ESCRegisterFMMU            ESCRegister = 0x0600 // first of 16
	ESCRegisterSyncManager     ESCRegister = 0x0800 // first of 8
	ESCRegisterDCRecvTime0     ESCRegister = 0x0900
	ESCRegisterDCRecvTime1     ESCRegister = 0x0904
	ESCRegisterDCRecvTime2     ESCRegister = 0x0908
	ESCRegisterDCRecvTime3     ESCRegister = 0x090C
	ESCRegisterDCSystemTime    ESCRegister = 0x0910
	ESCRegisterDCSystemTimeHi  ESCRegister = 0x0914
	ESCRegisterDCRecvTimeUnit  ESCRegister = 0x0918
	ESCRegisterDCTimeOffset    ESCRegister = 0x0920
	ESCRegisterDCTimeOffsetHi  ESCRegister = 0x0924
	ESCRegisterDCTimeDelay     ESCRegister = 0x0928
	ESCRegisterDCControlError  ESCRegister = 0x092C
	ESCRegisterDCSpeedStart    ESCRegister = 0x0930
	ESCRegisterDCSpeedDiff     ESCRegister = 0x0932
	ESCRegisterDCFilterTime    ESCRegister = 0x0934
	ESCRegisterDCFilterSpeed   ESCRegister = 0x0935
	ESCRegisterDCCyclicControl ESCRegister = 0x0980
	ESCRegisterDCActivation    ESCRegister = 0x0981
	ESCRegisterDCPulseLength   ESCRegister = 0x0982
	ESCRegisterDCActivationSt  ESCRegister = 0x0984
	ESCRegisterDCSync0Status   ESCRegister = 0x098E
	ESCRegisterDCSync1Status   ESCRegister = 0x098F
	ESCRegisterDCStartTime0    ESCRegister = 0x0990
	ESCRegisterDCStartTime1    ESCRegister = 0x0998
	ESCRegisterDCCycleTime0    ESCRegister = 0x09A0
	ESCRegisterDCCycleTime1    ESCRegister = 0x09A4
	ESCRegisterDCLatch0Control ESCRegister = 0x09A8
	ESCRegisterDCLatch1Control ESCRegister = 0x09A9
	ESCRegisterDCLatch0Status  ESCRegister = 0x09AE
	ESCRegisterDCLatch1Status  ESCRegister = 0x09AF
	ESCRegisterDCLatch0Pos     ESCRegister = 0x09B0
	ESCRegisterDCLatch0Neg     ESCRegister = 0x09B8
	ESCRegisterDCLatch1Pos     ESCRegister = 0x09C0
	ESCRegisterDCLatch1Neg     ESCRegister = 0x09C8
	ESCRegisterDCSMChangeTime  ESCRegister = 0x09F0
	ESCRegisterDCPDISMStart    ESCRegister = 0x09F8
	ESCRegisterDCPDISMChange   ESCRegister = 0x09FC
	ESCRegisterProductID       ESCRegister = 0x0E00
	ESCRegisterVendorID        ESCRegister = 0x0E08
	ESCRegisterDigitalOutput   ESCRegister = 0x0F00
	ESCRegisterGPOutput        ESCRegister = 0x0F10
	ESCRegisterGPInput         ESCRegister = 0x0F18
	ESCRegisterUserRAM         ESCRegister = 0x0F80
)

ESC registers.

func (ESCRegister) Area

func (r ESCRegister) Area() ESCArea

Area returns the block of the address space the offset lies in. Every offset has one, named register or not: e.g. 0x0E10 is ESC specific and 0x0FA4 user RAM.

func (ESCRegister) IsMemory

func (r ESCRegister) IsMemory() bool

IsMemory reports whether the offset lies in the process data memory (0x1000 and up) instead of the register area.

func (ESCRegister) String

func (r ESCRegister) String() string

String returns the register name, or the hex offset of an unnamed one. FMMU and sync manager registers are named by their start, e.g. "FMMU 2" for 0x0620; offsets inside a block are unnamed.

type ESCRegisterValue

type ESCRegisterValue struct {
	Register ESCRegister
	Data     []byte
}

ESCRegisterValue is one register found in the data of a datagram. Data aliases the packet data and has the register's size.

func (ESCRegisterValue) Uint

func (v ESCRegisterValue) Uint() uint64

Uint returns the little-endian value of a register of up to 8 bytes, and 0 for longer ones (FMMU and sync manager blocks, user RAM).

type ESCSMMode

type ESCSMMode uint8

ESCSMMode is the buffer mode of a sync manager.

const (
	ESCSMModeBuffered ESCSMMode = 0 // 3 buffers, process data
	ESCSMModeMailbox  ESCSMMode = 2 // 1 buffer, handshake
)

Sync manager modes.

type ESCSyncManager

type ESCSyncManager struct {
	Start      uint16
	Length     uint16
	Control    uint8
	Status     uint8
	Activate   uint8
	PDIControl uint8
}

ESCSyncManager is one sync manager configuration block (0x0800 + 8n).

func (ESCSyncManager) Enabled

func (s ESCSyncManager) Enabled() bool

Enabled reports whether the sync manager is activated.

func (ESCSyncManager) MasterWrites

func (s ESCSyncManager) MasterWrites() bool

MasterWrites reports the direction: true when the master writes the buffer (outputs, mailbox out), false when it reads it.

func (ESCSyncManager) Mode

func (s ESCSyncManager) Mode() ESCSMMode

Mode returns the buffer mode.

type ESCWatchdogDivider

type ESCWatchdogDivider uint16

ESCWatchdogDivider is the watchdog divider register (0x0400).

func (ESCWatchdogDivider) Period

func (w ESCWatchdogDivider) Period() time.Duration

Period returns the length of one watchdog tick: 100 us for the default divider 2498.

type ESCWatchdogStatus

type ESCWatchdogStatus uint8

ESCWatchdogStatus is the process data watchdog status (0x0440).

func (ESCWatchdogStatus) Running

func (s ESCWatchdogStatus) Running() bool

Running reports whether the process data watchdog is active or disabled; false means it expired.

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 EtherCAT

type EtherCAT struct {
	BaseLayer

	Length    uint16
	Reserved  uint8
	Type      EtherCATFrameType
	Datagrams []EtherCATDatagram

	ADS     *EtherCATAMS     // type 2
	RawIO   *EtherCATRawIO   // type 3
	NV      *EtherCATNV      // type 4
	Mailbox *EtherCATMailbox // type 5
}

EtherCAT is an EtherCAT frame.

For type 1 frames the datagrams are decoded and there is no payload; Ethernet padding after the last datagram is dropped.

Types 2 to 5 set the one field that matches and have no payload either. A body too short for its header, or of an unknown type, stays raw in the payload.

func (*EtherCAT) CanDecode

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

CanDecode returns LayerTypeEtherCAT.

func (*EtherCAT) DecodeFromBytes

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

DecodeFromBytes decodes an EtherCAT frame, starting at the frame header.

func (*EtherCAT) LayerType

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

LayerType returns LayerTypeEtherCAT.

func (*EtherCAT) NextLayerType

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

NextLayerType returns LayerTypePayload for frames left undecoded.

type EtherCATADS

type EtherCATADS struct {
	Result      EtherCATADSError // responses
	IndexGroup  EtherCATADSGroup
	IndexOffset uint32
	// Length is the read or write length of the request, or the data
	// length of a read response.
	Length      uint32
	WriteLength uint32 // read write request
	ADSState    EtherCATADSState
	DeviceState uint16

	// Read device info response.
	MajorVersion uint8
	MinorVersion uint8
	Build        uint16
	DeviceName   []byte // without NUL padding

	// Notifications. MaxDelay and CycleTime count 100 ns steps; see
	// MaxDelayTime and CycleDuration.
	Handle           uint32
	TransmissionMode EtherCATADSTransMode
	MaxDelay         uint32
	CycleTime        uint32
	StampCount       uint32 // as announced; Stamps holds those present
	Stamps           []EtherCATADSStamp

	Data []byte // read, write and control data

	// SumUp lists the accesses of a sum-up request: a read write on
	// index groups 0xF080 to 0xF084. IndexOffset announces their number;
	// SumUp holds those present.
	SumUp []EtherCATADSSumItem
}

EtherCATADS is the body of an ADS request or response. The fields set depend on the command and direction, as listed in the file comment.

func (*EtherCATADS) CycleDuration

func (a *EtherCATADS) CycleDuration() time.Duration

CycleDuration returns the interval at which an add notification request has the server check the variable.

func (*EtherCATADS) MaxDelayTime

func (a *EtherCATADS) MaxDelayTime() time.Duration

MaxDelayTime returns the longest time an add notification request lets the server hold a notification back.

func (*EtherCATADS) SumUpResults

func (a *EtherCATADS) SumUpResults(req *EtherCATADS) []EtherCATADSSumResult

SumUpResults decodes the data of a read write response as the answer to the sum-up request req, one result per access of the request. It returns nil when req is no sum-up request or the response is shorter than its result list. Pair the two by the AMS invoke ID.

type EtherCATADSCommand

type EtherCATADSCommand uint16

EtherCATADSCommand is the AMS command identifier.

const (
	EtherCATADSInvalid            EtherCATADSCommand = 0
	EtherCATADSReadDeviceInfo     EtherCATADSCommand = 1
	EtherCATADSRead               EtherCATADSCommand = 2
	EtherCATADSWrite              EtherCATADSCommand = 3
	EtherCATADSReadState          EtherCATADSCommand = 4
	EtherCATADSWriteControl       EtherCATADSCommand = 5
	EtherCATADSAddNotification    EtherCATADSCommand = 6
	EtherCATADSDeleteNotification EtherCATADSCommand = 7
	EtherCATADSNotification       EtherCATADSCommand = 8
	EtherCATADSReadWrite          EtherCATADSCommand = 9
)

ADS commands.

func (EtherCATADSCommand) String

func (c EtherCATADSCommand) String() string

String returns the command name.

type EtherCATADSError

type EtherCATADSError uint32

EtherCATADSError is an ADS return code: the error code of the AMS header and the result of an ADS response.

const (
	EtherCATADSNoError   EtherCATADSError = 0x000
	EtherCATADSErrRouter EtherCATADSError = 0x500
	EtherCATADSErrDevice EtherCATADSError = 0x700
	EtherCATADSErrClient EtherCATADSError = 0x740
)

The first code of each ADS return code range.

func (EtherCATADSError) String

func (e EtherCATADSError) String() string

String returns the return code name.

type EtherCATADSGroup

type EtherCATADSGroup uint32

EtherCATADSGroup is an ADS index group.

const (
	EtherCATADSGroupPLCMemory     EtherCATADSGroup = 0x4020
	EtherCATADSGroupPLCMemoryBit  EtherCATADSGroup = 0x4021
	EtherCATADSGroupPLCData       EtherCATADSGroup = 0x4040
	EtherCATADSGroupSymbolTable   EtherCATADSGroup = 0xF000
	EtherCATADSGroupSymbolName    EtherCATADSGroup = 0xF001
	EtherCATADSGroupSymbolValue   EtherCATADSGroup = 0xF002
	EtherCATADSGroupHandleByName  EtherCATADSGroup = 0xF003
	EtherCATADSGroupValueByName   EtherCATADSGroup = 0xF004
	EtherCATADSGroupValueByHandle EtherCATADSGroup = 0xF005
	EtherCATADSGroupReleaseHandle EtherCATADSGroup = 0xF006
	EtherCATADSGroupInfoByName    EtherCATADSGroup = 0xF007
	EtherCATADSGroupSymbolVersion EtherCATADSGroup = 0xF008
	EtherCATADSGroupInfoByNameEx  EtherCATADSGroup = 0xF009
	EtherCATADSGroupSymbolUpload  EtherCATADSGroup = 0xF00B
	EtherCATADSGroupUploadInfo    EtherCATADSGroup = 0xF00C
	EtherCATADSGroupInputBytes    EtherCATADSGroup = 0xF020
	EtherCATADSGroupInputBits     EtherCATADSGroup = 0xF021
	EtherCATADSGroupOutputBytes   EtherCATADSGroup = 0xF030
	EtherCATADSGroupOutputBits    EtherCATADSGroup = 0xF031
	EtherCATADSGroupSumUpRead     EtherCATADSGroup = 0xF080
	EtherCATADSGroupSumUpWrite    EtherCATADSGroup = 0xF081
	EtherCATADSGroupSumUpRW       EtherCATADSGroup = 0xF082
	EtherCATADSGroupSumUpReadEx   EtherCATADSGroup = 0xF083
	EtherCATADSGroupSumUpReadEx2  EtherCATADSGroup = 0xF084
	EtherCATADSGroupSumUpAddNote  EtherCATADSGroup = 0xF085
	EtherCATADSGroupSumUpDelNote  EtherCATADSGroup = 0xF086
	EtherCATADSGroupDeviceData    EtherCATADSGroup = 0xF100
)

Index groups of the ADS system services and the PLC.

func (EtherCATADSGroup) IsSumUp

func (g EtherCATADSGroup) IsSumUp() bool

IsSumUp reports whether a read write on the group is a sum-up command this package decodes (0xF080 to 0xF084).

func (EtherCATADSGroup) String

func (g EtherCATADSGroup) String() string

String returns the index group name.

type EtherCATADSSample

type EtherCATADSSample struct {
	Handle uint32
	Data   []byte
}

EtherCATADSSample is one value of a device notification.

type EtherCATADSStamp

type EtherCATADSStamp struct {
	Timestamp uint64
	Samples   []EtherCATADSSample
}

EtherCATADSStamp is one timestamped group of notification samples. Timestamp is a Windows FILETIME: 100 ns steps since 1601-01-01 UTC.

type EtherCATADSState

type EtherCATADSState uint16

EtherCATADSState is the ADS state of a device.

const (
	EtherCATADSStateInvalid      EtherCATADSState = 0
	EtherCATADSStateIdle         EtherCATADSState = 1
	EtherCATADSStateReset        EtherCATADSState = 2
	EtherCATADSStateInit         EtherCATADSState = 3
	EtherCATADSStateStart        EtherCATADSState = 4
	EtherCATADSStateRun          EtherCATADSState = 5
	EtherCATADSStateStop         EtherCATADSState = 6
	EtherCATADSStateSaveConfig   EtherCATADSState = 7
	EtherCATADSStateLoadConfig   EtherCATADSState = 8
	EtherCATADSStatePowerFailure EtherCATADSState = 9
	EtherCATADSStatePowerGood    EtherCATADSState = 10
	EtherCATADSStateError        EtherCATADSState = 11
	EtherCATADSStateShutdown     EtherCATADSState = 12
	EtherCATADSStateSuspend      EtherCATADSState = 13
	EtherCATADSStateResume       EtherCATADSState = 14
	EtherCATADSStateConfig       EtherCATADSState = 15
	EtherCATADSStateReconfig     EtherCATADSState = 16
)

ADS states.

func (EtherCATADSState) String

func (s EtherCATADSState) String() string

String returns the state name.

type EtherCATADSSumItem

type EtherCATADSSumItem struct {
	IndexGroup  EtherCATADSGroup
	IndexOffset uint32
	Length      uint32
	WriteLength uint32
	Data        []byte
}

EtherCATADSSumItem is one access of a sum-up request. Length is the read length, WriteLength and Data the write side; a kind that only reads or only writes leaves the other at zero. Data is nil when the request is cut before it.

type EtherCATADSSumResult

type EtherCATADSSumResult struct {
	Result EtherCATADSError
	Length uint32
	Data   []byte
}

EtherCATADSSumResult is the answer to one access of a sum-up request. Length is the returned length, 0 where the response has none. Data is nil when the response is cut before it.

type EtherCATADSTransMode

type EtherCATADSTransMode uint32

EtherCATADSTransMode is the transmission mode of a notification.

const (
	EtherCATADSTransNone            EtherCATADSTransMode = 0
	EtherCATADSTransClientCycle     EtherCATADSTransMode = 1
	EtherCATADSTransClientOnChange  EtherCATADSTransMode = 2
	EtherCATADSTransServerCycle     EtherCATADSTransMode = 3
	EtherCATADSTransServerOnChange  EtherCATADSTransMode = 4
	EtherCATADSTransServerCycle2    EtherCATADSTransMode = 5
	EtherCATADSTransServerOnChange2 EtherCATADSTransMode = 6
	EtherCATADSTransClientFirstReq  EtherCATADSTransMode = 10
)

ADS transmission modes.

func (EtherCATADSTransMode) String

func (m EtherCATADSTransMode) String() string

String returns the transmission mode name.

type EtherCATAMS

type EtherCATAMS struct {
	TargetNetID EtherCATAMSNetID
	TargetPort  EtherCATAMSPort
	SourceNetID EtherCATAMSNetID
	SourcePort  EtherCATAMSPort
	Command     EtherCATADSCommand
	Flags       EtherCATAMSFlags
	Length      uint32
	ErrorCode   EtherCATADSError
	InvokeID    uint32
	Data        []byte
	ADS         *EtherCATADS
}

EtherCATAMS is an AMS packet with its ADS body.

Data holds the bytes after the header. ADS is set when the ADS flag is and the body is long enough for the command; system commands and bodies of unknown commands stay raw in Data.

func (*EtherCATAMS) IsResponse

func (a *EtherCATAMS) IsResponse() bool

IsResponse reports whether the packet answers a request.

type EtherCATAMSFlags

type EtherCATAMSFlags uint16

EtherCATAMSFlags is the AMS state flag word.

const (
	EtherCATAMSResponse       EtherCATAMSFlags = 0x0001
	EtherCATAMSNoReturn       EtherCATAMSFlags = 0x0002
	EtherCATAMSADSCommand     EtherCATAMSFlags = 0x0004
	EtherCATAMSSystemCommand  EtherCATAMSFlags = 0x0008
	EtherCATAMSHighPriority   EtherCATAMSFlags = 0x0010
	EtherCATAMSTimestampAdded EtherCATAMSFlags = 0x0020
	EtherCATAMSUDP            EtherCATAMSFlags = 0x0040
	EtherCATAMSInitCommand    EtherCATAMSFlags = 0x0080
	EtherCATAMSBroadcast      EtherCATAMSFlags = 0x8000
)

AMS state flags.

func (EtherCATAMSFlags) Has

Has reports whether the flag is set.

type EtherCATAMSNetID

type EtherCATAMSNetID [ethercatAMSNetIDLen]byte

EtherCATAMSNetID is a 6-byte AMS network identifier.

func (EtherCATAMSNetID) String

func (n EtherCATAMSNetID) String() string

String returns the dotted form, e.g. "192.168.1.10.1.1".

type EtherCATAMSPort

type EtherCATAMSPort uint16

EtherCATAMSPort is an AMS port: the service addressed on a device.

const (
	EtherCATAMSPortRouter      EtherCATAMSPort = 1
	EtherCATAMSPortDebugger    EtherCATAMSPort = 2
	EtherCATAMSPortLogger      EtherCATAMSPort = 100
	EtherCATAMSPortEventLogger EtherCATAMSPort = 110
	EtherCATAMSPortRealtime    EtherCATAMSPort = 200
	EtherCATAMSPortTrace       EtherCATAMSPort = 290
	EtherCATAMSPortIO          EtherCATAMSPort = 300
	EtherCATAMSPortNC          EtherCATAMSPort = 500
	EtherCATAMSPortNCSAF       EtherCATAMSPort = 501
	EtherCATAMSPortNCSVB       EtherCATAMSPort = 511
	EtherCATAMSPortISG         EtherCATAMSPort = 600
	EtherCATAMSPortCNC         EtherCATAMSPort = 700
	EtherCATAMSPortPLC         EtherCATAMSPort = 800
	EtherCATAMSPortPLCRuntime1 EtherCATAMSPort = 801
	EtherCATAMSPortPLCRuntime2 EtherCATAMSPort = 811
	EtherCATAMSPortPLCRuntime3 EtherCATAMSPort = 821
	EtherCATAMSPortPLCRuntime4 EtherCATAMSPort = 831
	EtherCATAMSPortTC3PLC1     EtherCATAMSPort = 851
	EtherCATAMSPortTC3PLC2     EtherCATAMSPort = 852
	EtherCATAMSPortTC3PLC3     EtherCATAMSPort = 853
	EtherCATAMSPortTC3PLC4     EtherCATAMSPort = 854
	EtherCATAMSPortCamshaft    EtherCATAMSPort = 900
	EtherCATAMSPortSystem      EtherCATAMSPort = 10000
	EtherCATAMSPortScope       EtherCATAMSPort = 14000
)

Well-known AMS ports.

func (EtherCATAMSPort) String

func (p EtherCATAMSPort) String() string

String returns "number(name)" for a well-known port, else the number.

type EtherCATAMSTCP

type EtherCATAMSTCP struct {
	BaseLayer
	PDUs []EtherCATAMSTCPPDU
}

EtherCATAMSTCP is the AMS over TCP content of one TCP segment, or one token of ScanEtherCATAMSTCP. There is no payload.

SignAndEncrypt transports (Secure ADS, TLS on port 8016) are not handled.

func (*EtherCATAMSTCP) CanDecode

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

CanDecode returns LayerTypeEtherCATAMSTCP.

func (*EtherCATAMSTCP) DecodeFromBytes

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

DecodeFromBytes decodes the AMS/TCP packets of a TCP segment. A first pass counts them, each at least 6 bytes, then the list is allocated once. Bytes after the last packet that are too few for a header are left out of the layer contents.

func (*EtherCATAMSTCP) LayerType

func (a *EtherCATAMSTCP) LayerType() gopacket.LayerType

LayerType returns LayerTypeEtherCATAMSTCP.

func (*EtherCATAMSTCP) NextLayerType

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

NextLayerType returns LayerTypeZero: the layer has no payload.

type EtherCATAMSTCPCommand

type EtherCATAMSTCPCommand uint16

EtherCATAMSTCPCommand is the command word of the AMS/TCP header.

const (
	EtherCATAMSTCPPacket       EtherCATAMSTCPCommand = 0x0000
	EtherCATAMSTCPPortClose    EtherCATAMSTCPCommand = 0x0001
	EtherCATAMSTCPPortConnect  EtherCATAMSTCPCommand = 0x1000
	EtherCATAMSTCPRouterNote   EtherCATAMSTCPCommand = 0x1001
	EtherCATAMSTCPGetLocalAddr EtherCATAMSTCPCommand = 0x1002
)

AMS/TCP commands.

func (EtherCATAMSTCPCommand) String

func (c EtherCATAMSTCPCommand) String() string

String returns the command name.

type EtherCATAMSTCPPDU

type EtherCATAMSTCPPDU struct {
	Command   EtherCATAMSTCPCommand
	Length    uint32
	Data      []byte
	AMS       *EtherCATAMS
	Truncated bool
}

EtherCATAMSTCPPDU is one AMS/TCP packet.

Data holds the bytes after the 6-byte header. AMS is set for command 0 when the AMS header is there. Truncated marks the last packet of a segment when the segment ends before Length bytes; Data then holds what is there and ADS bodies decode as far as they reach.

type EtherCATAssemblyStatus

type EtherCATAssemblyStatus uint8

EtherCATAssemblyStatus says what the assembler did with a mailbox.

const (
	// EtherCATAssemblyNone: the mailbox is not part of a transfer.
	EtherCATAssemblyNone EtherCATAssemblyStatus = iota
	// EtherCATAssemblyPending: taken, the transfer goes on.
	EtherCATAssemblyPending
	// EtherCATAssemblyComplete: the transfer is returned.
	EtherCATAssemblyComplete
	// EtherCATAssemblyDuplicate: a repeat of the last fragment or
	// packet, ignored.
	EtherCATAssemblyDuplicate
	// EtherCATAssemblyToggle: an SDO segment with the toggle bit of the
	// previous one, ignored. The transfer stays open.
	EtherCATAssemblyToggle
	// EtherCATAssemblySequence: a fragment or packet out of order. The
	// transfer is dropped.
	EtherCATAssemblySequence
	// EtherCATAssemblyOrphan: a continuation without its start.
	EtherCATAssemblyOrphan
	// EtherCATAssemblyTooLarge: the transfer passed the size cap and is
	// dropped.
	EtherCATAssemblyTooLarge
	// EtherCATAssemblyAborted: an abort or error ended the transfer.
	EtherCATAssemblyAborted
)

Assembly results. Only EtherCATAssemblyComplete comes with a transfer.

func (EtherCATAssemblyStatus) String

func (s EtherCATAssemblyStatus) String() string

String returns the status name.

type EtherCATCoE

type EtherCATCoE struct {
	Number    uint16
	Service   EtherCATCoEService
	Data      []byte             // bytes after the CoE header
	SDO       *EtherCATSDO       // SDO request and response services
	SDOInfo   *EtherCATSDOInfo   // SDO information service
	Emergency *EtherCATEmergency // emergency service
}

EtherCATCoE is a CANopen over EtherCAT message.

Number is the PDO number for the PDO services, whose PDO bytes are Data. The remote request services carry no data.

type EtherCATCoEService

type EtherCATCoEService uint8

EtherCATCoEService is the CoE service.

const (
	EtherCATCoEEmergency   EtherCATCoEService = 1
	EtherCATCoESDORequest  EtherCATCoEService = 2
	EtherCATCoESDOResponse EtherCATCoEService = 3
	EtherCATCoETxPDO       EtherCATCoEService = 4
	EtherCATCoERxPDO       EtherCATCoEService = 5
	EtherCATCoETxPDORemote EtherCATCoEService = 6
	EtherCATCoERxPDORemote EtherCATCoEService = 7
	EtherCATCoESDOInfo     EtherCATCoEService = 8
)

CoE services.

func (EtherCATCoEService) String

func (s EtherCATCoEService) String() string

String returns the CoE service name.

type EtherCATCommand

type EtherCATCommand uint8

EtherCATCommand is the datagram command.

const (
	EtherCATCommandNOP  EtherCATCommand = 0
	EtherCATCommandAPRD EtherCATCommand = 1
	EtherCATCommandAPWR EtherCATCommand = 2
	EtherCATCommandAPRW EtherCATCommand = 3
	EtherCATCommandFPRD EtherCATCommand = 4
	EtherCATCommandFPWR EtherCATCommand = 5
	EtherCATCommandFPRW EtherCATCommand = 6
	EtherCATCommandBRD  EtherCATCommand = 7
	EtherCATCommandBWR  EtherCATCommand = 8
	EtherCATCommandBRW  EtherCATCommand = 9
	EtherCATCommandLRD  EtherCATCommand = 10
	EtherCATCommandLWR  EtherCATCommand = 11
	EtherCATCommandLRW  EtherCATCommand = 12
	EtherCATCommandARMW EtherCATCommand = 13
	EtherCATCommandFRMW EtherCATCommand = 14
)

EtherCAT commands.

func (EtherCATCommand) IsLogical

func (c EtherCATCommand) IsLogical() bool

IsLogical reports whether the command uses a 32-bit logical address instead of ADP/ADO.

func (EtherCATCommand) IsPhysical

func (c EtherCATCommand) IsPhysical() bool

IsPhysical reports whether the command addresses slave memory by ADO.

func (EtherCATCommand) String

func (c EtherCATCommand) String() string

String returns the command mnemonic.

type EtherCATDatagram

type EtherCATDatagram struct {
	Command EtherCATCommand
	Index   uint8
	// Address is the raw 32-bit address: a logical address for LRD, LWR
	// and LRW, otherwise ADP in the low and ADO in the high half.
	Address        uint32
	Length         uint16
	Circulating    bool
	More           bool
	IRQ            uint16
	Data           []byte
	WorkingCounter uint16

	// Mailbox is set when Data holds a mailbox, by Wireshark's heuristic:
	// a write (or a read answered by one slave) to ADO 0x1000 or above
	// whose header names a known mailbox type.
	Mailbox *EtherCATMailbox
}

EtherCATDatagram is one datagram of an EtherCAT frame.

func (*EtherCATDatagram) ADO

func (d *EtherCATDatagram) ADO() uint16

ADO returns the physical memory or register offset.

func (*EtherCATDatagram) ADP

func (d *EtherCATDatagram) ADP() uint16

ADP returns the position or configured station address.

func (*EtherCATDatagram) ALControl

func (d *EtherCATDatagram) ALControl() (ESCALControl, bool)

ALControl returns the AL control register when the datagram carries it.

func (*EtherCATDatagram) ALStatus

func (d *EtherCATDatagram) ALStatus() (ESCALStatus, bool)

ALStatus returns the AL status register when the datagram carries it.

func (*EtherCATDatagram) ALStatusCode

func (d *EtherCATDatagram) ALStatusCode() (ESCALStatusCode, bool)

ALStatusCode returns the AL status code register when the datagram carries it.

func (*EtherCATDatagram) DCActivation

func (d *EtherCATDatagram) DCActivation() (ESCDCActivation, bool)

DCActivation returns the DC activation register when the datagram carries it.

func (*EtherCATDatagram) DCCycleTime

func (d *EtherCATDatagram) DCCycleTime(n int) (time.Duration, bool)

DCCycleTime returns the cycle time of SYNC0 (n = 0, register 0x09A0) or SYNC1 (n = 1, 0x09A4). For SYNC1 it is the delay after SYNC0.

func (*EtherCATDatagram) DCLatchControl

func (d *EtherCATDatagram) DCLatchControl(n int) (ESCDCLatchControl, bool)

DCLatchControl returns the control register of latch n (0 or 1).

func (*EtherCATDatagram) DCLatchStatus

func (d *EtherCATDatagram) DCLatchStatus(n int) (ESCDCLatchStatus, bool)

DCLatchStatus returns the status register of latch n (0 or 1).

func (*EtherCATDatagram) DCLatchTime

func (d *EtherCATDatagram) DCLatchTime(n int, edge ESCDCEdge) (ns uint64, ok bool)

DCLatchTime returns the DC system time latch n (0 or 1) took at the given edge (0x09B0 to 0x09CF), in nanoseconds; see ESCDCTime.

func (*EtherCATDatagram) DCStartTime

func (d *EtherCATDatagram) DCStartTime() (ns uint64, ok bool)

DCStartTime returns the start time of the cyclic operation (0x0990), in nanoseconds of DC system time; see ESCDCTime.

func (*EtherCATDatagram) DCSystemTime

func (d *EtherCATDatagram) DCSystemTime() (ns uint64, ok bool)

DCSystemTime returns the distributed clock system time register (0x0910): nanoseconds since 2000-01-01. A 4-byte access yields the low half only, which wraps every 4.29 s; ok is false for it.

func (*EtherCATDatagram) DLStatus

func (d *EtherCATDatagram) DLStatus() (ESCDLStatus, bool)

DLStatus returns the DL status register when the datagram carries it.

func (*EtherCATDatagram) EEPROMAddress

func (d *EtherCATDatagram) EEPROMAddress() (uint32, bool)

EEPROMAddress returns the EEPROM address register (0x0504): a word address into the slave information interface. Masters often access the low word only; it is returned when the datagram stops there.

func (*EtherCATDatagram) EEPROMControl

func (d *EtherCATDatagram) EEPROMControl() (ESCEEPROMControl, bool)

EEPROMControl returns the EEPROM control/status register when the datagram carries it.

func (*EtherCATDatagram) EEPROMData

func (d *EtherCATDatagram) EEPROMData() []byte

EEPROMData returns the EEPROM data register (0x0508): 8 bytes when the datagram carries them all, else 4, else nil. It aliases the packet data.

func (*EtherCATDatagram) FMMU

func (d *EtherCATDatagram) FMMU(n int) (ESCFMMU, bool)

FMMU returns the configuration of FMMU n (0-15) when the datagram carries all of it.

func (*EtherCATDatagram) MII

func (d *EtherCATDatagram) MII() (ESCMII, bool)

MII returns the MII management interface when the datagram carries control, address and data, as one PHY access does.

func (*EtherCATDatagram) MIIControl

func (d *EtherCATDatagram) MIIControl() (ESCMIIControl, bool)

MIIControl returns the MII control/status register when the datagram carries it.

func (*EtherCATDatagram) Register

func (d *EtherCATDatagram) Register() ESCRegister

Register returns the first register the datagram addresses: its ADO. It means nothing for NOP and the logical commands.

func (*EtherCATDatagram) RegisterBytes

func (d *EtherCATDatagram) RegisterBytes(reg ESCRegister, size int) []byte

RegisterBytes returns the size bytes at register reg when the datagram carries valid data for all of them, nil otherwise.

func (*EtherCATDatagram) Registers

func (d *EtherCATDatagram) Registers() []ESCRegisterValue

Registers lists the named registers the datagram data covers in full, in offset order. It returns nil when the datagram carries no valid register data; see RegisterBytes. The list is built on each call and is bounded by the register table, not by the packet.

func (*EtherCATDatagram) SyncManager

func (d *EtherCATDatagram) SyncManager(n int) (ESCSyncManager, bool)

SyncManager returns the configuration of sync manager n (0-7) when the datagram carries all of it.

func (*EtherCATDatagram) WatchdogDivider

func (d *EtherCATDatagram) WatchdogDivider() (ESCWatchdogDivider, bool)

WatchdogDivider returns the watchdog divider register when the datagram carries it.

func (*EtherCATDatagram) WatchdogStatus

func (d *EtherCATDatagram) WatchdogStatus() (ESCWatchdogStatus, bool)

WatchdogStatus returns the process data watchdog status when the datagram carries it.

func (*EtherCATDatagram) WatchdogTimePDI

func (d *EtherCATDatagram) WatchdogTimePDI() (uint16, bool)

WatchdogTimePDI returns the PDI watchdog time (0x0410), in ticks of the watchdog divider.

func (*EtherCATDatagram) WatchdogTimeSM

func (d *EtherCATDatagram) WatchdogTimeSM() (uint16, bool)

WatchdogTimeSM returns the process data (sync manager) watchdog time (0x0420), in ticks of the watchdog divider.

type EtherCATEmergency

type EtherCATEmergency struct {
	ErrorCode     uint16
	ErrorRegister uint8
	Data          []byte // manufacturer specific, 5 bytes when complete
}

EtherCATEmergency is a CoE emergency message (CiA 301 EMCY).

type EtherCATEoE

type EtherCATEoE struct {
	Type          EtherCATEoEType
	Port          uint8
	LastFragment  bool
	TimeAppended  bool
	TimeRequested bool

	// Fragment and timestamp response.
	FragmentNo uint8
	Offset     uint16
	FrameNo    uint8

	// Result of the set and get IP and MAC filter responses.
	Result EtherCATEoEResult

	// Timestamp is set when HasTimestamp is: by a timestamp response, or
	// by a fragment with TimeAppended that is long enough to hold it.
	Timestamp    uint32
	HasTimestamp bool

	// SetIP holds the parameters of a set IP request or get IP
	// response, MACFilter those of a set address filter request or get
	// address filter response. The get requests have no body.
	Data      []byte
	SetIP     *EtherCATEoESetIP
	MACFilter *EtherCATEoEMACFilter
}

EtherCATEoE is an Ethernet over EtherCAT message.

For a fragment, Data holds the Ethernet frame bytes without the appended timestamp, and Offset is the byte offset of the fragment or, for fragment 0, the size of the whole frame, both in steps of 32. Fragments are reassembled by EtherCATMailboxAssembler.

type EtherCATEoEIPFlags

type EtherCATEoEIPFlags uint32

EtherCATEoEIPFlags says which parameters a set IP request carries.

const (
	EtherCATEoEHasMAC          EtherCATEoEIPFlags = 0x00000001
	EtherCATEoEHasIP           EtherCATEoEIPFlags = 0x00000002
	EtherCATEoEHasSubnetMask   EtherCATEoEIPFlags = 0x00000004
	EtherCATEoEHasGateway      EtherCATEoEIPFlags = 0x00000008
	EtherCATEoEHasDNSServer    EtherCATEoEIPFlags = 0x00000010
	EtherCATEoEHasDNSName      EtherCATEoEIPFlags = 0x00000020
	EtherCATEoEAppendTimestamp EtherCATEoEIPFlags = 0x00010000
)

Set IP request flags.

type EtherCATEoEMACFilter

type EtherCATEoEMACFilter struct {
	NoBroadcasts bool
	Filters      []net.HardwareAddr
	Masks        []net.HardwareAddr
}

EtherCATEoEMACFilter is the body of an EoE MAC filter request. Filters and Masks hold the entries the option counts announce.

type EtherCATEoEResult

type EtherCATEoEResult uint16

EtherCATEoEResult is the result word of the EoE responses.

const (
	EtherCATEoESuccess          EtherCATEoEResult = 0x0000
	EtherCATEoEUnspecifiedError EtherCATEoEResult = 0x0001
	EtherCATEoEUnsupportedType  EtherCATEoEResult = 0x0002
	EtherCATEoENoIPSupport      EtherCATEoEResult = 0x0201
	EtherCATEoENoDHCPSupport    EtherCATEoEResult = 0x0202
	EtherCATEoENoFilterSupport  EtherCATEoEResult = 0x0401
)

EoE results (ETG.1000.6).

func (EtherCATEoEResult) String

func (r EtherCATEoEResult) String() string

String returns the result name.

type EtherCATEoESetIP

type EtherCATEoESetIP struct {
	Flags      EtherCATEoEIPFlags
	Packed     bool
	MAC        net.HardwareAddr
	IP         net.IP
	SubnetMask net.IP
	Gateway    net.IP
	DNSServer  net.IP
	DNSName    []byte
}

EtherCATEoESetIP is the body of an EoE set IP parameter request.

ETG.1000.6 gives the body a fixed layout: every field has its place whether or not its flag is set, and only the flagged ones mean anything. Some masters (SOEM) instead send only the flagged fields, back to back; such a body is recognised by its exact length, Packed is set and the fields that were not sent stay nil. Wireshark rejects the packed form as too short.

The four addresses travel in reversed byte order and are returned in the usual one. DNSName is the 32-byte field without its NUL padding.

func (*EtherCATEoESetIP) Has

Has reports whether the request carries the parameter flag names.

type EtherCATEoEType

type EtherCATEoEType uint8

EtherCATEoEType is the EoE frame type.

const (
	EtherCATEoEFragment         EtherCATEoEType = 0
	EtherCATEoETimestamp        EtherCATEoEType = 1
	EtherCATEoESetIPRequest     EtherCATEoEType = 2
	EtherCATEoESetIPResponse    EtherCATEoEType = 3
	EtherCATEoEMACFilterRequest EtherCATEoEType = 4
	EtherCATEoEMACFilterReply   EtherCATEoEType = 5
	EtherCATEoEGetIPRequest     EtherCATEoEType = 6
	EtherCATEoEGetIPResponse    EtherCATEoEType = 7
	EtherCATEoEGetFilterRequest EtherCATEoEType = 8
	EtherCATEoEGetFilterReply   EtherCATEoEType = 9
)

EoE frame types.

func (EtherCATEoEType) String

func (t EtherCATEoEType) String() string

String returns the frame type name.

type EtherCATFoE

type EtherCATFoE struct {
	OpCode    EtherCATFoEOpCode
	Password  uint32           // RRQ, WRQ
	PacketNo  uint32           // DATA, ACK
	ErrorCode EtherCATFoEError // ERR
	Done      uint16           // BUSY: progress, out of Entire
	Entire    uint16           // BUSY
	Data      []byte
}

EtherCATFoE is a File access over EtherCAT message.

Data is what follows the 6-byte header: the file name of RRQ and WRQ, the file bytes of DATA, the text of ERR and BUSY. It aliases the packet data; names and texts carry no terminator.

func (*EtherCATFoE) FileName

func (f *EtherCATFoE) FileName() string

FileName returns the file name of a read or write request.

func (*EtherCATFoE) Text

func (f *EtherCATFoE) Text() string

Text returns the text of an error or busy message.

type EtherCATFoEError

type EtherCATFoEError uint32

EtherCATFoEError is an FoE error code.

const (
	EtherCATFoEErrNotDefined    EtherCATFoEError = 0x8000
	EtherCATFoEErrNotFound      EtherCATFoEError = 0x8001
	EtherCATFoEErrAccessDenied  EtherCATFoEError = 0x8002
	EtherCATFoEErrDiskFull      EtherCATFoEError = 0x8003
	EtherCATFoEErrIllegal       EtherCATFoEError = 0x8004
	EtherCATFoEErrPacketNumber  EtherCATFoEError = 0x8005
	EtherCATFoEErrAlreadyExists EtherCATFoEError = 0x8006
	EtherCATFoEErrNoUser        EtherCATFoEError = 0x8007
	EtherCATFoEErrBootstrapOnly EtherCATFoEError = 0x8008
	EtherCATFoEErrNotBootstrap  EtherCATFoEError = 0x8009
	EtherCATFoEErrNoRights      EtherCATFoEError = 0x800A
	EtherCATFoEErrProgramError  EtherCATFoEError = 0x800B
)

FoE error codes (ETG.1000.6 table 92).

func (EtherCATFoEError) String

func (e EtherCATFoEError) String() string

String returns the error name. Old slaves send the codes without the 0x8000 base; both forms are named.

type EtherCATFoEOpCode

type EtherCATFoEOpCode uint8

EtherCATFoEOpCode is the FoE operation.

const (
	EtherCATFoERRQ  EtherCATFoEOpCode = 1
	EtherCATFoEWRQ  EtherCATFoEOpCode = 2
	EtherCATFoEDATA EtherCATFoEOpCode = 3
	EtherCATFoEACK  EtherCATFoEOpCode = 4
	EtherCATFoEERR  EtherCATFoEOpCode = 5
	EtherCATFoEBUSY EtherCATFoEOpCode = 6
)

FoE opcodes.

func (EtherCATFoEOpCode) String

func (o EtherCATFoEOpCode) String() string

String returns the opcode mnemonic.

type EtherCATFrameType

type EtherCATFrameType uint8

EtherCATFrameType is the protocol type in the frame header.

const (
	EtherCATFrameCommands EtherCATFrameType = 1
	EtherCATFrameADS      EtherCATFrameType = 2
	EtherCATFrameRawIO    EtherCATFrameType = 3
	EtherCATFrameNV       EtherCATFrameType = 4
	EtherCATFrameMailbox  EtherCATFrameType = 5
)

EtherCAT frame types.

func (EtherCATFrameType) String

func (t EtherCATFrameType) String() string

String returns the frame type name.

type EtherCATMailbox

type EtherCATMailbox struct {
	Length   uint16
	Address  uint16
	Channel  uint8
	Priority uint8
	Type     EtherCATMailboxType
	Counter  uint8
	Data     []byte       // Length bytes of service data
	CoE      *EtherCATCoE // Type CoE only
	EoE      *EtherCATEoE // Type EoE only
	FoE      *EtherCATFoE // Type FoE only
	SoE      *EtherCATSoE // Type SoE only
	VoE      *EtherCATVoE // Type VoE only
	AoE      *EtherCATAMS // Type AoE only

	// Error is the body of a Type ERR mailbox: the reply to a mailbox
	// the slave could not take.
	Error *EtherCATMailboxError
}

EtherCATMailbox is an EtherCAT mailbox. Data aliases the packet data.

func DecodeEtherCATMailbox

func DecodeEtherCATMailbox(data []byte) (*EtherCATMailbox, error)

DecodeEtherCATMailbox decodes a mailbox from the data of a datagram. Bytes after the declared length (unused mailbox space) are ignored.

type EtherCATMailboxAssembler

type EtherCATMailboxAssembler struct {
	// MaxBytes caps one transfer; 0 means EtherCATAssemblerMaxBytes.
	MaxBytes int
	// MaxOpen caps the open transfers; 0 means EtherCATAssemblerMaxOpen.
	MaxOpen int
	// FoEPacketSize is the data size of a full FoE packet (mailbox size
	// less 12), when known. A shorter packet ends the file. When 0 the
	// first data packet of a file sets it, and a file of one packet
	// only ends by FlushFoE or the next request.
	FoEPacketSize int
	// contains filtered or unexported fields
}

EtherCATMailboxAssembler reassembles segmented SDO transfers, EoE frames, FoE files and fragmented SoE element data.

The zero value is ready to use. It holds at most MaxOpen transfers of at most MaxBytes each; opening one more drops the oldest. It is not safe for concurrent use.

func (*EtherCATMailboxAssembler) Feed

Feed hands the mailbox of a datagram to the assembler. The station is the datagram's ADP; a write travels to the slave, a read from it. A datagram without a mailbox returns EtherCATAssemblyNone.

A capture taken at the master holds every frame twice, on its way out and back. The second copy of a fragment reports Duplicate, Toggle or Orphan and adds nothing; the second copy of a transfer that fits one mailbox, or of the last SoE fragment, cannot be told from a new one and is returned again.

func (*EtherCATMailboxAssembler) FeedMailbox

FeedMailbox hands one mailbox of a station to the assembler. Mailboxes must come in capture order. The mailbox data is copied; nothing of it is kept.

func (*EtherCATMailboxAssembler) FlushFoE

func (a *EtherCATMailboxAssembler) FlushFoE(station uint16) *EtherCATTransfer

FlushFoE ends the open FoE transfer of a station and returns what it holds, marked Unfinished. It returns nil when there is none.

func (*EtherCATMailboxAssembler) Open

func (a *EtherCATMailboxAssembler) Open() int

Open returns the number of transfers in progress.

type EtherCATMailboxDir

type EtherCATMailboxDir uint8

EtherCATMailboxDir is the direction a mailbox travels.

const (
	EtherCATToSlave EtherCATMailboxDir = iota
	EtherCATFromSlave
)

Mailbox directions.

type EtherCATMailboxErrDetail

type EtherCATMailboxErrDetail uint16

EtherCATMailboxErrDetail says why a slave refused a mailbox.

const (
	EtherCATMailboxErrSyntax      EtherCATMailboxErrDetail = 1
	EtherCATMailboxErrProtocol    EtherCATMailboxErrDetail = 2
	EtherCATMailboxErrChannel     EtherCATMailboxErrDetail = 3
	EtherCATMailboxErrService     EtherCATMailboxErrDetail = 4
	EtherCATMailboxErrHeader      EtherCATMailboxErrDetail = 5
	EtherCATMailboxErrTooShort    EtherCATMailboxErrDetail = 6
	EtherCATMailboxErrNoMemory    EtherCATMailboxErrDetail = 7
	EtherCATMailboxErrSize        EtherCATMailboxErrDetail = 8
	EtherCATMailboxErrServiceBusy EtherCATMailboxErrDetail = 9
)

Mailbox error details (ETG.1000.4 table 30).

func (EtherCATMailboxErrDetail) String

func (d EtherCATMailboxErrDetail) String() string

String returns the error detail name.

type EtherCATMailboxError

type EtherCATMailboxError struct {
	Type   uint16
	Detail EtherCATMailboxErrDetail
}

EtherCATMailboxError is the body of an error reply (mailbox type 0):

Type (2) | Detail (2)

Type is EtherCATMailboxErrCommand in every reply the standard defines.

type EtherCATMailboxType

type EtherCATMailboxType uint8

EtherCATMailboxType is the mailbox protocol.

const (
	EtherCATMailboxERR EtherCATMailboxType = 0
	EtherCATMailboxAoE EtherCATMailboxType = 1
	EtherCATMailboxEoE EtherCATMailboxType = 2
	EtherCATMailboxCoE EtherCATMailboxType = 3
	EtherCATMailboxFoE EtherCATMailboxType = 4
	EtherCATMailboxSoE EtherCATMailboxType = 5
	EtherCATMailboxVoE EtherCATMailboxType = 15
)

Mailbox types.

func (EtherCATMailboxType) String

func (t EtherCATMailboxType) String() string

String returns the mailbox type name.

type EtherCATNV

type EtherCATNV struct {
	Publisher EtherCATAMSNetID
	Count     uint16
	Cycle     uint16
	Variables []EtherCATNVVariable
}

EtherCATNV is a network variables frame (EtherCAT frame type 4).

Count is the announced number of variables; Variables holds those that fit the frame.

type EtherCATNVVariable

type EtherCATNVVariable struct {
	ID      uint16
	Hash    uint16
	Length  uint16
	Quality uint16
	Data    []byte
}

EtherCATNVVariable is one published network variable.

type EtherCATRawIO

type EtherCATRawIO struct {
	Header uint32
	Data   []byte
}

EtherCATRawIO is a raw IO frame (EtherCAT frame type 3).

type EtherCATSDO

type EtherCATSDO struct {
	Command   uint8
	Specifier EtherCATSDOSpecifier
	Segment   bool
	Index     uint16
	SubIndex  uint8
	Value     uint32
	Data      []byte

	SizeIndicated  bool
	Expedited      bool
	CompleteAccess bool
	LastSegment    bool
	Toggle         bool
	UnusedBytes    uint8
	// ExpeditedData is the used part of the 4 data bytes of an expedited
	// transfer; it aliases the packet data.
	ExpeditedData []byte
}

EtherCATSDO is a CoE SDO request or response.

For initiate and abort services Index, SubIndex and Value are set; Value is the expedited data, the complete size or the abort code. For segment services Segment is true and Data holds the segment bytes after the command byte.

The flags come from the command byte and only mean something for the services that define them:

initiate download request, initiate upload response:
    SizeIndicated, Expedited, UnusedBytes (of the 4 expedited bytes),
    CompleteAccess, ExpeditedData
initiate upload request:   CompleteAccess
download segment request, upload segment response:
    LastSegment, UnusedBytes (of the 7 byte minimum segment), Toggle
upload segment request, download segment response: Toggle

A normal (not expedited) initiate transfer has its complete size in Value and the first data bytes in Data.

func (*EtherCATSDO) AbortCode

func (s *EtherCATSDO) AbortCode() EtherCATSDOAbortCode

AbortCode returns Value as an SDO abort code.

type EtherCATSDOAbortCode

type EtherCATSDOAbortCode uint32

EtherCATSDOAbortCode is an SDO abort code (ETG.1000.6 table 41).

const (
	EtherCATSDOAbortToggle          EtherCATSDOAbortCode = 0x05030000
	EtherCATSDOAbortTimeout         EtherCATSDOAbortCode = 0x05040000
	EtherCATSDOAbortSpecifier       EtherCATSDOAbortCode = 0x05040001
	EtherCATSDOAbortOutOfMemory     EtherCATSDOAbortCode = 0x05040005
	EtherCATSDOAbortAccess          EtherCATSDOAbortCode = 0x06010000
	EtherCATSDOAbortWriteOnly       EtherCATSDOAbortCode = 0x06010001
	EtherCATSDOAbortReadOnly        EtherCATSDOAbortCode = 0x06010002
	EtherCATSDOAbortSubIndexWrite   EtherCATSDOAbortCode = 0x06010003
	EtherCATSDOAbortNoCompleteAcc   EtherCATSDOAbortCode = 0x06010004
	EtherCATSDOAbortObjectTooLong   EtherCATSDOAbortCode = 0x06010005
	EtherCATSDOAbortMappedToRxPDO   EtherCATSDOAbortCode = 0x06010006
	EtherCATSDOAbortNoObject        EtherCATSDOAbortCode = 0x06020000
	EtherCATSDOAbortNotMappable     EtherCATSDOAbortCode = 0x06040041
	EtherCATSDOAbortPDOLength       EtherCATSDOAbortCode = 0x06040042
	EtherCATSDOAbortParameter       EtherCATSDOAbortCode = 0x06040043
	EtherCATSDOAbortInternal        EtherCATSDOAbortCode = 0x06040047
	EtherCATSDOAbortHardware        EtherCATSDOAbortCode = 0x06060000
	EtherCATSDOAbortLength          EtherCATSDOAbortCode = 0x06070010
	EtherCATSDOAbortLengthHigh      EtherCATSDOAbortCode = 0x06070012
	EtherCATSDOAbortLengthLow       EtherCATSDOAbortCode = 0x06070013
	EtherCATSDOAbortNoSubIndex      EtherCATSDOAbortCode = 0x06090011
	EtherCATSDOAbortValueRange      EtherCATSDOAbortCode = 0x06090030
	EtherCATSDOAbortValueHigh       EtherCATSDOAbortCode = 0x06090031
	EtherCATSDOAbortValueLow        EtherCATSDOAbortCode = 0x06090032
	EtherCATSDOAbortMaxBelowMin     EtherCATSDOAbortCode = 0x06090036
	EtherCATSDOAbortGeneral         EtherCATSDOAbortCode = 0x08000000
	EtherCATSDOAbortTransfer        EtherCATSDOAbortCode = 0x08000020
	EtherCATSDOAbortLocalControl    EtherCATSDOAbortCode = 0x08000021
	EtherCATSDOAbortDeviceState     EtherCATSDOAbortCode = 0x08000022
	EtherCATSDOAbortNoObjDictionary EtherCATSDOAbortCode = 0x08000023
)

SDO abort codes.

func (EtherCATSDOAbortCode) String

func (c EtherCATSDOAbortCode) String() string

String returns the abort reason.

type EtherCATSDOInfo

type EtherCATSDOInfo struct {
	OpCode        EtherCATSDOInfoOpCode
	Incomplete    bool
	FragmentsLeft uint16
	Data          []byte

	// List request and response.
	ListType EtherCATSDOInfoListType
	Indexes  []uint16

	// Object and entry description.
	Index       uint16
	SubIndex    uint8
	ValueInfo   uint8
	DataType    uint16
	MaxSubIndex uint8
	ObjectCode  uint8
	BitLength   uint16
	Access      uint16
	UnitType    uint16
	Default     []byte
	Min         []byte
	Max         []byte
	Name        []byte

	// Error response.
	AbortCode EtherCATSDOAbortCode
}

EtherCATSDOInfo is a CoE SDO information message. The fields set depend on OpCode, as drawn in the file comment; Data keeps the bytes after the 4-byte header.

Only the first fragment of a fragmented response starts with the opcode fields; later fragments (those after a message with Incomplete set) continue the list or name where the previous one stopped. Without the previous fragments that cannot be told apart, so every message is read as a first fragment, as Wireshark does.

Wireshark never shows UnitType, Default, Min and Max: it tests a copy of ValueInfo that it does not fill. They are decoded here as ETG.1000.6 lays them out.

type EtherCATSDOInfoListType

type EtherCATSDOInfoListType uint16

EtherCATSDOInfoListType selects the objects an OD list names.

const (
	EtherCATSDOInfoListLengths  EtherCATSDOInfoListType = 0 // the lengths of the five lists
	EtherCATSDOInfoListAll      EtherCATSDOInfoListType = 1
	EtherCATSDOInfoListRxPDOMap EtherCATSDOInfoListType = 2
	EtherCATSDOInfoListTxPDOMap EtherCATSDOInfoListType = 3
	EtherCATSDOInfoListBackup   EtherCATSDOInfoListType = 4
	EtherCATSDOInfoListSettings EtherCATSDOInfoListType = 5
)

OD list types.

type EtherCATSDOInfoOpCode

type EtherCATSDOInfoOpCode uint8

EtherCATSDOInfoOpCode is the SDO information service opcode.

const (
	EtherCATSDOInfoListRequest    EtherCATSDOInfoOpCode = 1
	EtherCATSDOInfoListResponse   EtherCATSDOInfoOpCode = 2
	EtherCATSDOInfoObjectRequest  EtherCATSDOInfoOpCode = 3
	EtherCATSDOInfoObjectResponse EtherCATSDOInfoOpCode = 4
	EtherCATSDOInfoEntryRequest   EtherCATSDOInfoOpCode = 5
	EtherCATSDOInfoEntryResponse  EtherCATSDOInfoOpCode = 6
	EtherCATSDOInfoError          EtherCATSDOInfoOpCode = 7
)

SDO information opcodes.

func (EtherCATSDOInfoOpCode) String

func (o EtherCATSDOInfoOpCode) String() string

String returns the opcode name.

type EtherCATSDOSpecifier

type EtherCATSDOSpecifier uint8

EtherCATSDOSpecifier is the 3-bit SDO command specifier: the client specifier (CCS) in requests, the server specifier (SCS) in responses.

const (
	EtherCATSDOCCSDownloadSegment  EtherCATSDOSpecifier = 0
	EtherCATSDOCCSInitiateDownload EtherCATSDOSpecifier = 1
	EtherCATSDOCCSInitiateUpload   EtherCATSDOSpecifier = 2
	EtherCATSDOCCSUploadSegment    EtherCATSDOSpecifier = 3
	EtherCATSDOCCSAbort            EtherCATSDOSpecifier = 4
	EtherCATSDOSCSUploadSegment    EtherCATSDOSpecifier = 0
	EtherCATSDOSCSDownloadSegment  EtherCATSDOSpecifier = 1
	EtherCATSDOSCSInitiateUpload   EtherCATSDOSpecifier = 2
	EtherCATSDOSCSInitiateDownload EtherCATSDOSpecifier = 3
	EtherCATSDOSCSAbort            EtherCATSDOSpecifier = 4
)

SDO command specifiers.

type EtherCATSoE

type EtherCATSoE struct {
	OpCode        EtherCATSoEOpCode
	Incomplete    bool
	Error         bool
	DriveNo       uint8
	Elements      EtherCATSoEElements
	IDN           EtherCATSoEIDN
	FragmentsLeft uint16
	ErrorCode     uint16
	Data          []byte
}

EtherCATSoE is a Servo drive profile over EtherCAT message.

IDN is set unless Incomplete is, in which case FragmentsLeft is. With Error set, ErrorCode is read from the two bytes after the header. Data holds everything after the header.

Wireshark differs on error messages: it shows the IDN word a second time as the error code.

type EtherCATSoEElements

type EtherCATSoEElements uint8

EtherCATSoEElements is the element flag byte: the IDN elements a request asks for or a response carries.

const (
	EtherCATSoEDataState EtherCATSoEElements = 0x01
	EtherCATSoEName      EtherCATSoEElements = 0x02
	EtherCATSoEAttribute EtherCATSoEElements = 0x04
	EtherCATSoEUnit      EtherCATSoEElements = 0x08
	EtherCATSoEMin       EtherCATSoEElements = 0x10
	EtherCATSoEMax       EtherCATSoEElements = 0x20
	EtherCATSoEValue     EtherCATSoEElements = 0x40
	EtherCATSoEDefault   EtherCATSoEElements = 0x80
)

SoE element flags.

func (EtherCATSoEElements) Has

Has reports whether the element flag is set.

type EtherCATSoEIDN

type EtherCATSoEIDN uint16

EtherCATSoEIDN is a SERCOS identification number.

func (EtherCATSoEIDN) String

func (i EtherCATSoEIDN) String() string

String formats the IDN the SERCOS way, e.g. "S-0-0100" or "P-1-0012".

type EtherCATSoEOpCode

type EtherCATSoEOpCode uint8

EtherCATSoEOpCode is the SoE service.

const (
	EtherCATSoEReadRequest   EtherCATSoEOpCode = 1
	EtherCATSoEReadResponse  EtherCATSoEOpCode = 2
	EtherCATSoEWriteRequest  EtherCATSoEOpCode = 3
	EtherCATSoEWriteResponse EtherCATSoEOpCode = 4
	EtherCATSoENotification  EtherCATSoEOpCode = 5
	EtherCATSoEEmergency     EtherCATSoEOpCode = 6
)

SoE opcodes.

func (EtherCATSoEOpCode) String

func (o EtherCATSoEOpCode) String() string

String returns the opcode name.

type EtherCATTransfer

type EtherCATTransfer struct {
	Kind    EtherCATTransferKind
	Station uint16
	Dir     EtherCATMailboxDir
	Data    []byte

	// SDO. Announced is the complete size of the initiate service, 0
	// for an expedited transfer; it may differ from len(Data).
	Index          uint16
	SubIndex       uint8
	CompleteAccess bool
	Announced      uint32

	// EoE. The timestamp is the one appended to the last fragment.
	Port         uint8
	FrameNo      uint8
	Timestamp    uint32
	HasTimestamp bool

	// FoE. FoEOp is RRQ or WRQ, or 0 when the request was not seen.
	// Unfinished marks a file whose end was not seen: it was flushed,
	// or cut off by the next request.
	FoEOp      EtherCATFoEOpCode
	FileName   []byte
	Password   uint32
	Unfinished bool

	// SoE.
	SoEOp    EtherCATSoEOpCode
	DriveNo  uint8
	Elements EtherCATSoEElements
	IDN      EtherCATSoEIDN
}

EtherCATTransfer is one finished mailbox transfer. Data is owned by the caller. The other fields set depend on Kind:

SDO download, upload  Index, SubIndex, CompleteAccess, Announced
EoE                   Port, FrameNo, Timestamp, HasTimestamp
FoE                   FoEOp, FileName, Password, Unfinished
SoE                   SoEOp, DriveNo, Elements, IDN

Transfers that fit one mailbox (expedited SDO, single EoE fragment, unfragmented SoE) are returned too, so a caller sees every transfer.

func (*EtherCATTransfer) NextLayerType

func (t *EtherCATTransfer) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type Data decodes as: LayerTypeEthernet for an EoE frame, LayerTypePayload for everything else.

type EtherCATTransferKind

type EtherCATTransferKind uint8

EtherCATTransferKind is the kind of a reassembled transfer.

const (
	EtherCATTransferSDODownload EtherCATTransferKind = iota + 1
	EtherCATTransferSDOUpload
	EtherCATTransferEoE
	EtherCATTransferFoE
	EtherCATTransferSoE
)

Transfer kinds.

func (EtherCATTransferKind) String

func (k EtherCATTransferKind) String() string

String returns the kind name.

type EtherCATVoE

type EtherCATVoE struct {
	VendorID   uint32
	VendorType uint16
	Data       []byte
}

EtherCATVoE is a vendor specific over EtherCAT message.

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
	EthernetTypeMerakiDiscoveryProtocol     EthernetType = 0x712
	EthernetTypeDot1Q                       EthernetType = 0x8100
	EthernetTypePPP                         EthernetType = 0x880b
	EthernetTypePPPoEDiscovery              EthernetType = 0x8863
	EthernetTypePPPoESession                EthernetType = 0x8864
	EthernetTypeMPLSUnicast                 EthernetType = 0x8847
	EthernetTypeMPLSMulticast               EthernetType = 0x8848
	EthernetTypeEAPOL                       EthernetType = 0x888e
	EthernetTypeQinQ                        EthernetType = 0x88a8
	EthernetTypeERSPAN                      EthernetType = 0x88be
	EthernetTypeLinkLayerDiscovery          EthernetType = 0x88cc
	EthernetTypeEthernetCTP                 EthernetType = 0x9000
	EthernetTypeRaw                         EthernetType = 0xFFFF // Special case for raw IP
)
const (
	EthernetTypeGOOSE EthernetType = 0x88B8
	EthernetTypeSV    EthernetType = 0x88BA
)

IEC 61850-8-1 GOOSE and IEC 61850-9-2 Sampled Values EtherTypes. They are not decoded unless registerIEC61850Decoders has run.

const (
	LinuxSLL2EthernetTypeDot3    EthernetType = 0x0001
	LinuxSLL2EthernetTypeUnknown EthernetType = 0x0003
	LinuxSLL2EthernetTypeLLC     EthernetType = 0x0004
	LinuxSLL2EthernetTypeCAN     EthernetType = 0x000C
)
const EthernetTypeEtherCAT EthernetType = 0x88A4

EthernetTypeEtherCAT is the EtherType of EtherCAT frames.

const EthernetTypeOPCUAPubSub EthernetType = 0xB62C

EthernetTypeOPCUAPubSub is the EtherType of UADP over Ethernet (OPC 10000-14 §7.3.3).

const EthernetTypeProfinet EthernetType = 0x8892

EthernetTypeProfinet is the EtherType of PROFINET real-time frames.

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 GOOSE

type GOOSE struct {
	BaseLayer
	IEC61850Header

	GocbRef           string
	TimeAllowedToLive uint32
	DatSet            string
	GoID              string
	Timestamp         MMSUTCTime
	StNum             uint32
	SqNum             uint32
	// Simulation is the "test" field of IEC 61850-8-1 Ed1.
	Simulation       bool
	ConfRev          uint32
	NdsCom           bool
	NumDatSetEntries uint32
	AllData          []MMSData
	Security         []byte
}

GOOSE is an IEC 61850-8-1 Generic Object Oriented Substation Event. It is usually sent 802.1Q tagged with priority 4.

func (*GOOSE) CanDecode

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

CanDecode returns LayerTypeGOOSE.

func (*GOOSE) DecodeFromBytes

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

DecodeFromBytes decodes a GOOSE frame starting at the APPID.

func (*GOOSE) EntriesMatch

func (g *GOOSE) EntriesMatch() bool

EntriesMatch reports whether numDatSetEntries equals the number of allData members. A mismatch is not a decode error.

func (*GOOSE) LayerType

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

LayerType returns LayerTypeGOOSE.

func (*GOOSE) NextLayerType

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

NextLayerType returns LayerTypeZero: GOOSE carries no further layer.

func (*GOOSE) Payload

func (g *GOOSE) Payload() []byte

Payload returns nil.

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.

func (*GRE) VerifyChecksum added in v1.2.0

func (g *GRE) VerifyChecksum() (error, gopacket.ChecksumVerificationResult)

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 GTPv2 added in v1.5.0

type GTPv2 struct {
	BaseLayer
	Version          uint8
	PiggybackingFlag bool
	TEIDflag         bool
	MessagePriority  uint8
	MessageType      uint8
	MessageLength    uint16
	TEID             uint32
	SequenceNumber   uint32
	Spare            uint8
	IEs              []IE
}

GTPv2 is designed for the control plane of the Evolved Packet System, facilitating various control and mobility management messages between gateways and MME/S-GW. Defined in the 3GPP TS 29.274 specification

func (*GTPv2) CanDecode added in v1.5.0

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

CanDecode returns a set of layers that GTP objects can decode

func (*GTPv2) DecodeFromBytes added in v1.5.0

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

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

func (*GTPv2) LayerContents added in v1.5.0

func (g *GTPv2) LayerContents() []byte

LayerContents returns the contents of the GTPv2 layer.

func (*GTPv2) LayerPayload added in v1.5.0

func (g *GTPv2) LayerPayload() []byte

LayerPayload returns the payload of the GTPv2 layer.

func (*GTPv2) LayerType added in v1.5.0

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

LayerType returns LayerTypeGTPv2

func (*GTPv2) NextLayerType added in v1.5.0

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

NextLayerType specifies the next layer that GoPacket should attempt to

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) CanDecode added in v1.4.0

func (gn *Geneve) CanDecode() gopacket.LayerClass

CanDecode implements DecodingLayer.

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 Gi added in v1.3.0

type Gi uint8
const (
	Gi_0_8us Gi = iota
	Gi_1_6us
	Gi_3_2us
	Gi_reserved
)

func (Gi) String added in v1.3.0

func (gi Gi) String() string

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.

func (*ICMPv4) VerifyChecksum added in v1.2.0

func (i *ICMPv4) VerifyChecksum() (error, gopacket.ChecksumVerificationResult)

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.

func (*ICMPv6) VerifyChecksum added in v1.2.0

func (i *ICMPv6) VerifyChecksum() (error, gopacket.ChecksumVerificationResult)

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

	// ICMPv6OptRecursiveDNSServer is used in Router Advertisement messages to
	// advertise recursive DNS servers.
	ICMPv6OptRecursiveDNSServer = 25
)

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 IE added in v1.5.0

type IE struct {
	Type    uint8
	Content []byte
}

IE represents an Information Element in GTPv2, a key component for message structure

type IEC104

type IEC104 struct {
	BaseLayer

	// Length counts the octets after the length octet.
	Length uint8
	Format IEC104Format
	// SendSeq is N(S), set for I-format frames.
	SendSeq uint16
	// RecvSeq is N(R), set for I- and S-format frames.
	RecvSeq uint16
	// UFunction is set for U-format frames.
	UFunction IEC104UFunction
	// ASDU is set for I-format frames.
	ASDU IEC104ASDU

	// Skipped counts the octets passed over before the start octet.
	// They belong to no layer.
	Skipped int
	// Faults is zero for a sound APDU.
	Faults IEC104Fault
}

IEC104 is one IEC 60870-5-104 APDU. Payload holds whatever follows it in the segment, normally further APDUs.

The decoder resynchronises instead of failing on octets that start no APDU, such as the tail of an APDU begun in an earlier segment:

| garbage ... | 0x68 | length | control | ASDU | next APDU ...
 \_ Skipped _/ \__________ Contents __________/ \_ Payload _

It skips to the next whole APDU with a sound control field. When there is none it takes the first start octet and decodes what follows as far as it goes; Faults tells what was wrong.

func (*IEC104) CanDecode

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

CanDecode returns LayerTypeIEC104.

func (*IEC104) DecodeFromBytes

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

DecodeFromBytes decodes the first APDU of data, skipping garbage before it. A damaged APDU is filled in as far as it goes and returned with an error; Faults tells them apart.

func (*IEC104) LayerType

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

LayerType returns LayerTypeIEC104.

func (*IEC104) NextLayerType

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

NextLayerType returns LayerTypeZero: following APDUs are decoded by decodeIEC104, not chained through the layer.

type IEC104AFQ

type IEC104AFQ uint8

IEC104AFQ is the acknowledge file or section qualifier of F_AF_NA_1.

func (IEC104AFQ) Ack

func (q IEC104AFQ) Ack() IEC104AFQAck

Ack returns the low nibble.

func (IEC104AFQ) Error

func (q IEC104AFQ) Error() IEC104FileError

Error returns the high nibble.

type IEC104AFQAck

type IEC104AFQAck uint8

IEC104AFQAck is the acknowledge nibble of AFQ.

const (
	IEC104AFQFilePositive    IEC104AFQAck = 1
	IEC104AFQFileNegative    IEC104AFQAck = 2
	IEC104AFQSectionPositive IEC104AFQAck = 3
	IEC104AFQSectionNegative IEC104AFQAck = 4
)

Acknowledgements.

func (IEC104AFQAck) String

func (a IEC104AFQAck) String() string

String returns the acknowledgement as Wireshark names it.

type IEC104ASDU

type IEC104ASDU struct {
	TypeID IEC104TypeID
	// Sequence is SQ: one address for a run of consecutive objects.
	Sequence bool
	// NumObjects is the object count of the variable structure qualifier.
	NumObjects uint8
	Cause      IEC104Cause
	// Negative is P/N: a negative confirmation.
	Negative bool
	// Test is T: a test transmission.
	Test       bool
	Originator uint8
	CommonAddr uint16
	Objects    []IEC104Object
	// Raw holds the object octets left undecoded: all of them for a type
	// this decoder does not know, else any past the last object.
	Raw []byte
	// Security holds the body of the IEC 62351-5 types S_CH_NA_1 to
	// S_ER_NA_1, which carry no information objects.
	Security IEC104Security
}

IEC104ASDU is an application service data unit.

func DecodeIEC104ASDU

func DecodeIEC104ASDU(data []byte, opts IEC104ASDUOptions) (*IEC104ASDU, error)

DecodeIEC104ASDU decodes an ASDU with the field sizes of opts; see IEC104ASDU.DecodeWithOptions.

func (*IEC104ASDU) DecodeWithOptions

func (a *IEC104ASDU) DecodeWithOptions(data []byte, opts IEC104ASDUOptions) error

DecodeWithOptions decodes an ASDU, starting at its type identification, with the field sizes of opts. It serves IEC 60870-5-101 systems, which may use a 1-octet cause of transmission or common address and a 1- or 2-octet object address. The Objects slice of a is reused.

type IEC104ASDUOptions

type IEC104ASDUOptions struct {
	// COTSize is the size of the cause of transmission: 1, or 2 with an
	// originator address.
	COTSize int
	// CommonAddrSize is the size of the common address: 1 or 2.
	CommonAddrSize int
	// IOASize is the size of the information object address: 1 to 3.
	IOASize int
}

IEC104ASDUOptions sets the sizes of the ASDU fields IEC 60870-5-101 leaves to the system. A zero size selects the IEC 60870-5-104 value.

type IEC104AuthErrorCode

type IEC104AuthErrorCode uint8

IEC104AuthErrorCode is ERR, the error code of S_ER_NA_1.

func (IEC104AuthErrorCode) String

func (e IEC104AuthErrorCode) String() string

String returns the error as Wireshark names it.

type IEC104COI

type IEC104COI uint8

IEC104COI is the cause of initialisation of M_EI_NA_1.

func (IEC104COI) Cause

func (c IEC104COI) Cause() IEC104COICause

Cause returns the cause of initialisation.

func (IEC104COI) LocalChange

func (c IEC104COI) LocalChange() bool

LocalChange reports whether the station initialised after a change of its local parameters.

type IEC104COICause

type IEC104COICause uint8

IEC104COICause is the cause in the low seven bits of COI.

const (
	IEC104COIPowerOn     IEC104COICause = 0
	IEC104COIManualReset IEC104COICause = 1
	IEC104COIRemoteReset IEC104COICause = 2
)

Causes of initialisation.

func (IEC104COICause) String

func (c IEC104COICause) String() string

String returns the cause as Wireshark names it.

type IEC104Cause

type IEC104Cause uint8

IEC104Cause is the cause of transmission, without its P/N and T bits.

const (
	IEC104CausePeriodic         IEC104Cause = 1
	IEC104CauseBackground       IEC104Cause = 2
	IEC104CauseSpontaneous      IEC104Cause = 3
	IEC104CauseInitialized      IEC104Cause = 4
	IEC104CauseRequest          IEC104Cause = 5
	IEC104CauseActivation       IEC104Cause = 6
	IEC104CauseActivationCon    IEC104Cause = 7
	IEC104CauseDeactivation     IEC104Cause = 8
	IEC104CauseDeactivationCon  IEC104Cause = 9
	IEC104CauseActivationTerm   IEC104Cause = 10
	IEC104CauseRemoteCommand    IEC104Cause = 11
	IEC104CauseLocalCommand     IEC104Cause = 12
	IEC104CauseFileTransfer     IEC104Cause = 13
	IEC104CauseInterrogated     IEC104Cause = 20 // station interrogation
	IEC104CauseInterrogatedG1   IEC104Cause = 21 // group 1; groups 2-16 follow
	IEC104CauseInterrogatedG16  IEC104Cause = 36
	IEC104CauseCounterRequest   IEC104Cause = 37 // general counter request
	IEC104CauseCounterRequestG1 IEC104Cause = 38 // group 1; groups 2-4 follow
	IEC104CauseCounterRequestG4 IEC104Cause = 41
	IEC104CauseUnknownType      IEC104Cause = 44
	IEC104CauseUnknownCause     IEC104Cause = 45
	IEC104CauseUnknownAddress   IEC104Cause = 46
	IEC104CauseUnknownObject    IEC104Cause = 47
)

Causes of transmission (IEC 60870-5-101, 7.2.3).

func (IEC104Cause) String

func (c IEC104Cause) String() string

String returns the cause as Wireshark abbreviates it, e.g. "Spont" or "Inro3".

type IEC104ChallengeReason

type IEC104ChallengeReason uint8

IEC104ChallengeReason is RSC, the reason for a challenge.

const IEC104ReasonCritical IEC104ChallengeReason = 1

IEC104ReasonCritical is the one reason IEC 62351-5 defines: the challenged ASDU is a critical function.

func (IEC104ChallengeReason) String

func (r IEC104ChallengeReason) String() string

String returns the reason as Wireshark names it.

type IEC104Command

type IEC104Command struct {
	// State is SCS (0 off, 1 on), DCS (1 off, 2 on) or RCS (1 lower,
	// 2 higher); zero for a set-point.
	State uint8
	// Qualifier is QU for commands, see QU, and QL for set-points.
	Qualifier uint8
	// Select is S/E: select rather than execute.
	Select bool
}

IEC104Command is the command or set-point qualifier: SCO, DCO, RCO or QOS.

func (IEC104Command) QU

func (c IEC104Command) QU() IEC104QU

QU returns the command qualifier of SCO, DCO or RCO as its type. For a set-point Qualifier is QL, a plain number, and QU does not apply.

type IEC104Counter

type IEC104Counter struct {
	Value    int32
	Sequence uint8 // SQ, 0 to 31
	Carry    bool  // CY
	Adjusted bool  // CA
	Invalid  bool  // IV
}

IEC104Counter is a BCR binary counter reading.

type IEC104DoublePoint

type IEC104DoublePoint uint8

IEC104DoublePoint is the state of a DIQ double point or a SEP event.

const (
	IEC104DoublePointIntermediate  IEC104DoublePoint = 0
	IEC104DoublePointOff           IEC104DoublePoint = 1
	IEC104DoublePointOn            IEC104DoublePoint = 2
	IEC104DoublePointIndeterminate IEC104DoublePoint = 3
)

Double point states.

func (IEC104DoublePoint) String

func (d IEC104DoublePoint) String() string

String returns the state name.

type IEC104Event

type IEC104Event uint8

IEC104Event holds the bits of SPE (start events of protection) or OCI (output circuit information).

const (
	IEC104EventGeneral IEC104Event = 0x01 // GS / GC
	IEC104EventPhaseL1 IEC104Event = 0x02 // SL1 / CL1
	IEC104EventPhaseL2 IEC104Event = 0x04 // SL2 / CL2
	IEC104EventPhaseL3 IEC104Event = 0x08 // SL3 / CL3
	IEC104EventEarth   IEC104Event = 0x10 // SIE, earth current
	IEC104EventReverse IEC104Event = 0x20 // SRD, reverse direction
)

Protection event bits. OCI uses the first four: general command and the phase L1 to L3 commands.

type IEC104FRQ

type IEC104FRQ uint8

IEC104FRQ is the file ready qualifier of F_FR_NA_1.

func (IEC104FRQ) Negative

func (q IEC104FRQ) Negative() bool

Negative reports a negative confirm of select, request, deactivate or delete.

func (IEC104FRQ) Qualifier

func (q IEC104FRQ) Qualifier() uint8

Qualifier returns the low seven bits; 0 is the default.

func (IEC104FRQ) String

func (q IEC104FRQ) String() string

String returns the confirm and the qualifier, e.g. "Negative, Default".

type IEC104Fault

type IEC104Fault uint8

IEC104Fault flags what is wrong with the framing of an APDU that still became a layer. A damaged APDU is decoded as far as its octets go, the way Wireshark shows it, and the flags tell how far to trust it.

const (
	// IEC104FaultGarbage: octets that start no APDU came before this
	// one. Skipped counts them.
	IEC104FaultGarbage IEC104Fault = 1 << iota
	// IEC104FaultLength: the length octet is below 4, or does not fit
	// the frame format: an S or U frame longer than its control field.
	IEC104FaultLength
	// IEC104FaultTruncated: the data ends inside the APDU. The control
	// field and the ASDU are set as far as the data reaches.
	IEC104FaultTruncated
	// IEC104FaultASDU: the ASDU of an I-format frame is malformed.
	IEC104FaultASDU
)

APDU faults.

func (IEC104Fault) Has

func (f IEC104Fault) Has(mask IEC104Fault) bool

Has reports whether all of the faults in mask are set.

func (IEC104Fault) String

func (f IEC104Fault) String() string

String lists the faults, e.g. "Garbage|Truncated", or "None".

type IEC104File

type IEC104File struct {
	Name    uint16 // NOF
	Section uint8  // NOS
	// Length is LOF, or LOS for a segment.
	Length uint32
	// Qualifier is the raw FRQ, SRQ, SCQ, LSQ, AFQ or SOF octet; the
	// methods of the same names split it.
	Qualifier uint8
	Checksum  uint8  // CHS
	Segment   []byte // F_SG_NA_1 segment data
	// Stop is the end of the F_SC_NB_1 range; Time of the object holds
	// its start.
	Stop IEC104Time
}

IEC104File holds the file transfer elements of F_* types.

func (*IEC104File) AFQ

func (f *IEC104File) AFQ() IEC104AFQ

AFQ returns the qualifier of an F_AF_NA_1 object.

func (*IEC104File) FRQ

func (f *IEC104File) FRQ() IEC104FRQ

FRQ returns the qualifier of an F_FR_NA_1 object.

func (*IEC104File) LSQ

func (f *IEC104File) LSQ() IEC104LSQ

LSQ returns the qualifier of an F_LS_NA_1 object.

func (*IEC104File) NOF

func (f *IEC104File) NOF() IEC104NOF

NOF returns the name of file of a file transfer object.

func (*IEC104File) NOS

func (f *IEC104File) NOS() IEC104NOS

NOS returns the name of section of a file transfer object.

func (*IEC104File) SCQ

func (f *IEC104File) SCQ() IEC104SCQ

SCQ returns the qualifier of an F_SC_NA_1 object.

func (*IEC104File) SOF

func (f *IEC104File) SOF() IEC104SOF

SOF returns the status of an F_DR_TA_1 object.

func (*IEC104File) SRQ

func (f *IEC104File) SRQ() IEC104SRQ

SRQ returns the qualifier of an F_SR_NA_1 object.

type IEC104FileError

type IEC104FileError uint8

IEC104FileError is the error nibble of SCQ and AFQ.

const (
	IEC104FileErrNone     IEC104FileError = 0
	IEC104FileErrNoMemory IEC104FileError = 1
	IEC104FileErrChecksum IEC104FileError = 2
	IEC104FileErrService  IEC104FileError = 3
	IEC104FileErrName     IEC104FileError = 4
	IEC104FileErrSection  IEC104FileError = 5
)

File transfer errors.

func (IEC104FileError) String

func (e IEC104FileError) String() string

String returns the error as Wireshark names it.

type IEC104Format

type IEC104Format uint8

IEC104Format is the APCI frame format.

const (
	// IEC104FormatI is a numbered information transfer carrying an ASDU.
	IEC104FormatI IEC104Format = 0x00
	// IEC104FormatS is a numbered supervisory acknowledgement.
	IEC104FormatS IEC104Format = 0x01
	// IEC104FormatU is an unnumbered control function.
	IEC104FormatU IEC104Format = 0x03
)

Frame formats, coded in the low bits of the first control octet.

func (IEC104Format) String

func (f IEC104Format) String() string

String returns the format letter.

type IEC104KeyStatus

type IEC104KeyStatus uint8

IEC104KeyStatus is KST, the session key status.

const (
	IEC104KeyStatusOK       IEC104KeyStatus = 1
	IEC104KeyStatusNotInit  IEC104KeyStatus = 2
	IEC104KeyStatusCommFail IEC104KeyStatus = 3
	IEC104KeyStatusAuthFail IEC104KeyStatus = 4
)

Session key states.

func (IEC104KeyStatus) String

func (k IEC104KeyStatus) String() string

String returns the status as Wireshark names it.

type IEC104KeyWrap

type IEC104KeyWrap uint8

IEC104KeyWrap is KWA, the key wrap algorithm.

const (
	IEC104KeyWrapAES128 IEC104KeyWrap = 1
	IEC104KeyWrapAES256 IEC104KeyWrap = 2
)

Key wrap algorithms.

func (IEC104KeyWrap) String

func (k IEC104KeyWrap) String() string

String returns the algorithm as Wireshark names it.

type IEC104LSQ

type IEC104LSQ uint8

IEC104LSQ is the last section or segment qualifier of F_LS_NA_1.

const (
	IEC104LSQFile         IEC104LSQ = 1 // file transfer without deactivation
	IEC104LSQFileDeact    IEC104LSQ = 2
	IEC104LSQSection      IEC104LSQ = 3 // section transfer without deactivation
	IEC104LSQSectionDeact IEC104LSQ = 4
)

Last section or segment qualifiers.

func (IEC104LSQ) String

func (q IEC104LSQ) String() string

String returns the qualifier as Wireshark names it.

type IEC104MACAlgorithm

type IEC104MACAlgorithm uint8

IEC104MACAlgorithm is MAL or HAL, the MAC algorithm.

const (
	IEC104MACNone      IEC104MACAlgorithm = 0
	IEC104MACSHA1x4    IEC104MACAlgorithm = 1 // HMAC SHA-1 truncated to 4 octets
	IEC104MACSHA1x10   IEC104MACAlgorithm = 2
	IEC104MACSHA256x8  IEC104MACAlgorithm = 3
	IEC104MACSHA256x16 IEC104MACAlgorithm = 4
	IEC104MACSHA1x8    IEC104MACAlgorithm = 5 // HMAC SHA-1 truncated to 8 octets
	IEC104MACAESGMAC   IEC104MACAlgorithm = 6 // 12 octets
)

MAC algorithms (IEC 62351-5, MAL). Wireshark names 1 to 4 and reads 6 as AES-GMAC.

func (IEC104MACAlgorithm) Size

func (m IEC104MACAlgorithm) Size() int

Size returns the MAC length in octets, or 0 when the algorithm does not fix one.

func (IEC104MACAlgorithm) String

func (m IEC104MACAlgorithm) String() string

String returns the algorithm as Wireshark names it.

type IEC104NOF

type IEC104NOF uint16

IEC104NOF is the name of file (IEC 60870-5-101, 7.2.6.33).

const (
	IEC104NOFDefault     IEC104NOF = 0
	IEC104NOFTransparent IEC104NOF = 1
	IEC104NOFDisturbance IEC104NOF = 2
	IEC104NOFEvents      IEC104NOF = 3
	IEC104NOFAnalogue    IEC104NOF = 4
)

File names the standard defines.

func (IEC104NOF) String

func (n IEC104NOF) String() string

String returns what the name stands for, e.g. "Sequences of events".

type IEC104NOS

type IEC104NOS uint8

IEC104NOS is the name of section (IEC 60870-5-101, 7.2.6.34).

func (IEC104NOS) String

func (n IEC104NOS) String() string

String returns "Default" for 0, else the section, e.g. "Section(3)".

type IEC104Object

type IEC104Object struct {
	// IOA is the information object address.
	IOA uint32
	// Raw holds the object's element octets, address excluded.
	Raw []byte

	// Quality is QDS, QDP, or the quality bits of SIQ, DIQ or SEP.
	Quality IEC104Quality
	// SinglePoint is SPI of SIQ.
	SinglePoint bool
	// DoublePoint is DPI of DIQ or ES of SEP.
	DoublePoint IEC104DoublePoint
	// Step is the VTI value, -64 to 63; Transient its T bit.
	Step      int8
	Transient bool
	// Bitstring is BSI.
	Bitstring uint32
	// Status and Changed are ST and CD of SCD.
	Status  uint16
	Changed uint16
	// Normalized is NVA as a raw fraction of 32768; see NormalizedValue.
	Normalized int16
	// Scaled is SVA.
	Scaled int16
	// Float is an IEEE 754 short floating point value.
	Float float32
	// Counter is BCR.
	Counter IEC104Counter
	// Event is SPE or OCI.
	Event IEC104Event
	// Elapsed is a CP16Time2a duration in milliseconds: relay duration,
	// operating time, or the delay of C_CD_NA_1.
	Elapsed uint16
	// Command is SCO, DCO, RCO or QOS.
	Command IEC104Command
	// Qualifier is the raw COI, QOI, QCC, QRP, QPM or QPA octet; the
	// methods of the same names give it its type.
	Qualifier uint8
	// Test is the FBP test pattern of C_TS_NA_1 or the TSC counter of
	// C_TS_TA_1.
	Test uint16
	// Time is the object's time tag.
	Time IEC104Time
	// File holds the file transfer elements.
	File IEC104File
	// AssociationID is AID of S_IT_TC_1 security statistics.
	AssociationID uint16
}

IEC104Object is one information object. Which fields are set depends on the ASDU type identification; the others stay zero.

func (*IEC104Object) COI

func (o *IEC104Object) COI() IEC104COI

COI returns the qualifier of an M_EI_NA_1 object.

func (*IEC104Object) NormalizedValue

func (o *IEC104Object) NormalizedValue() float64

NormalizedValue returns NVA as a fraction in [-1, 1).

func (*IEC104Object) QCC

func (o *IEC104Object) QCC() IEC104QCC

QCC returns the qualifier of a C_CI_NA_1 object.

func (*IEC104Object) QOI

func (o *IEC104Object) QOI() IEC104QOI

QOI returns the qualifier of a C_IC_NA_1 object.

func (*IEC104Object) QPA

func (o *IEC104Object) QPA() IEC104QPA

QPA returns the qualifier of a P_AC_NA_1 object.

func (*IEC104Object) QPM

func (o *IEC104Object) QPM() IEC104QPM

QPM returns the qualifier of a P_ME_NA_1, P_ME_NB_1 or P_ME_NC_1 object.

func (*IEC104Object) QRP

func (o *IEC104Object) QRP() IEC104QRP

QRP returns the qualifier of a C_RP_NA_1 object.

type IEC104QCC

type IEC104QCC uint8

IEC104QCC is the qualifier of counter interrogation of C_CI_NA_1.

func (IEC104QCC) Freeze

func (q IEC104QCC) Freeze() IEC104QCCFreeze

Freeze returns FRZ.

func (IEC104QCC) Request

func (q IEC104QCC) Request() IEC104QCCRequest

Request returns RQT.

type IEC104QCCFreeze

type IEC104QCCFreeze uint8

IEC104QCCFreeze is FRZ, what a C_CI_NA_1 does to the counters.

const (
	IEC104QCCRead        IEC104QCCFreeze = 0
	IEC104QCCFreezeOnly  IEC104QCCFreeze = 1
	IEC104QCCFreezeReset IEC104QCCFreeze = 2
	IEC104QCCReset       IEC104QCCFreeze = 3
)

Freeze actions.

func (IEC104QCCFreeze) String

func (f IEC104QCCFreeze) String() string

String returns the action name.

type IEC104QCCRequest

type IEC104QCCRequest uint8

IEC104QCCRequest is RQT, the counters a C_CI_NA_1 asks for.

const (
	IEC104QCCGroup1  IEC104QCCRequest = 1
	IEC104QCCGroup4  IEC104QCCRequest = 4
	IEC104QCCGeneral IEC104QCCRequest = 5
)

Counter requests. Groups 2 and 3 lie between the group bounds.

func (IEC104QCCRequest) String

func (r IEC104QCCRequest) String() string

String returns the request as Wireshark names it.

type IEC104QOI

type IEC104QOI uint8

IEC104QOI is the qualifier of interrogation of C_IC_NA_1.

const (
	IEC104QOIStation IEC104QOI = 20
	IEC104QOIGroup1  IEC104QOI = 21
	IEC104QOIGroup16 IEC104QOI = 36
)

Qualifiers of interrogation. Groups 2 to 15 lie between the group bounds.

func (IEC104QOI) Group

func (q IEC104QOI) Group() int

Group returns the interrogated group, 1 to 16, or 0 when the qualifier names none.

func (IEC104QOI) String

func (q IEC104QOI) String() string

String returns the qualifier as Wireshark names it.

type IEC104QPA

type IEC104QPA uint8

IEC104QPA is the qualifier of parameter activation of P_AC_NA_1.

const (
	IEC104QPALoaded   IEC104QPA = 1 // previously loaded parameters
	IEC104QPAObject   IEC104QPA = 2 // parameter of the addressed object
	IEC104QPACyclicTx IEC104QPA = 3 // cyclic transmission of the object
)

Qualifiers of parameter activation.

func (IEC104QPA) String

func (q IEC104QPA) String() string

String returns the qualifier as Wireshark names it.

type IEC104QPM

type IEC104QPM uint8

IEC104QPM is the qualifier of parameter of measured values of P_ME_*.

func (IEC104QPM) Kind

func (q IEC104QPM) Kind() IEC104QPMKind

Kind returns KPA.

func (IEC104QPM) LocalChange

func (q IEC104QPM) LocalChange() bool

LocalChange returns LPC: the parameter was changed locally.

func (IEC104QPM) NotInOperation

func (q IEC104QPM) NotInOperation() bool

NotInOperation returns POP: the parameter is not in operation.

type IEC104QPMKind

type IEC104QPMKind uint8

IEC104QPMKind is KPA, the kind of parameter.

const (
	IEC104QPMThreshold IEC104QPMKind = 1
	IEC104QPMSmoothing IEC104QPMKind = 2
	IEC104QPMLowLimit  IEC104QPMKind = 3
	IEC104QPMHighLimit IEC104QPMKind = 4
)

Kinds of parameter.

func (IEC104QPMKind) String

func (k IEC104QPMKind) String() string

String returns the kind name.

type IEC104QRP

type IEC104QRP uint8

IEC104QRP is the qualifier of reset process command of C_RP_NA_1.

const (
	IEC104QRPGeneral     IEC104QRP = 1
	IEC104QRPEventBuffer IEC104QRP = 2
)

Qualifiers of reset process command.

func (IEC104QRP) String

func (q IEC104QRP) String() string

String returns the qualifier as Wireshark names it.

type IEC104QU

type IEC104QU uint8

IEC104QU is the QU field of the command qualifier QOC, which SCO, DCO and RCO carry in IEC104Command.Qualifier.

const (
	IEC104QUNone       IEC104QU = 0
	IEC104QUShortPulse IEC104QU = 1
	IEC104QULongPulse  IEC104QU = 2
	IEC104QUPersistent IEC104QU = 3
)

Command qualifiers.

func (IEC104QU) String

func (q IEC104QU) String() string

String returns the qualifier as Wireshark names it.

type IEC104Quality

type IEC104Quality uint8

IEC104Quality holds the quality bits of QDS, QDP, SIQ, DIQ and SEP.

const (
	IEC104QualityOverflow       IEC104Quality = 0x01 // OV
	IEC104QualityElapsedInvalid IEC104Quality = 0x08 // EI
	IEC104QualityBlocked        IEC104Quality = 0x10 // BL
	IEC104QualitySubstituted    IEC104Quality = 0x20 // SB
	IEC104QualityNotTopical     IEC104Quality = 0x40 // NT
	IEC104QualityInvalid        IEC104Quality = 0x80 // IV
)

Quality bits. Each element type carries a subset: SIQ and DIQ have BL, SB, NT and IV; QDS adds OV; QDP and SEP add EI.

func (IEC104Quality) String

func (q IEC104Quality) String() string

String lists the set bits, e.g. "BL|IV", or "OK" when none is set.

type IEC104SCQ

type IEC104SCQ uint8

IEC104SCQ is the select and call qualifier of F_SC_NA_1.

func (IEC104SCQ) Action

func (q IEC104SCQ) Action() IEC104SCQAction

Action returns the low nibble.

func (IEC104SCQ) Error

func (q IEC104SCQ) Error() IEC104FileError

Error returns the high nibble.

type IEC104SCQAction

type IEC104SCQAction uint8

IEC104SCQAction is the action nibble of SCQ.

const (
	IEC104SCQSelectFile     IEC104SCQAction = 1
	IEC104SCQRequestFile    IEC104SCQAction = 2
	IEC104SCQDeactFile      IEC104SCQAction = 3
	IEC104SCQDeleteFile     IEC104SCQAction = 4
	IEC104SCQSelectSection  IEC104SCQAction = 5
	IEC104SCQRequestSection IEC104SCQAction = 6
	IEC104SCQDeactSection   IEC104SCQAction = 7
)

Select and call actions.

func (IEC104SCQAction) String

func (a IEC104SCQAction) String() string

String returns the action name.

type IEC104SOF

type IEC104SOF uint8

IEC104SOF is the status of file of F_DR_TA_1.

func (IEC104SOF) Active

func (s IEC104SOF) Active() bool

Active returns FA: the file transfer is active.

func (IEC104SOF) Directory

func (s IEC104SOF) Directory() bool

Directory returns FOR: the name is a subdirectory, not a file.

func (IEC104SOF) LastFile

func (s IEC104SOF) LastFile() bool

LastFile returns LFD: this is the last file of the directory.

func (IEC104SOF) Status

func (s IEC104SOF) Status() uint8

Status returns the low five bits; 0 is the default.

func (IEC104SOF) String

func (s IEC104SOF) String() string

String returns the status and the three flags as Wireshark words them, e.g. "Default, Last file, File, Waits for transfer".

type IEC104SRQ

type IEC104SRQ uint8

IEC104SRQ is the section ready qualifier of F_SR_NA_1.

func (IEC104SRQ) NotReady

func (q IEC104SRQ) NotReady() bool

NotReady reports that the section is not ready to load.

func (IEC104SRQ) Qualifier

func (q IEC104SRQ) Qualifier() uint8

Qualifier returns the low seven bits; 0 is the default.

func (IEC104SRQ) String

func (q IEC104SRQ) String() string

String returns the readiness and the qualifier, e.g. "Ready, Default".

type IEC104Security

type IEC104Security struct {
	// SegmentNumber, First and Final are ASN, FIR and FIN of the segment
	// sequence octet. S_KR_NA_1 has none.
	SegmentNumber uint8
	First         bool
	Final         bool
	// Segment holds the octets after the segment sequence octet.
	Segment []byte
	// Decoded reports whether the fields below were read from the body.
	// It stays false for a segment that is not a whole body.
	Decoded bool

	// Sequence is CSQ, the challenge sequence number, or KSQ, the key
	// change sequence number.
	Sequence uint32
	// User is USR, the user number.
	User uint16
	// MACAlgorithm is MAL of a challenge or HAL of a key status.
	MACAlgorithm IEC104MACAlgorithm
	// Reason is RSC, the reason for challenge; 1 is CRITICAL.
	Reason uint8
	// Challenge is the pseudo-random challenge data.
	Challenge []byte
	// MAC is the MAC value.
	MAC       []byte
	KeyWrap   IEC104KeyWrap   // KWA
	KeyStatus IEC104KeyStatus // KST
	// WrappedKey is the wrapped key data of S_KC_NA_1.
	WrappedKey []byte
	// AssociationID, ErrorCode, ErrorTime and ErrorText are AID, ERR, ETM
	// and the text of S_ER_NA_1.
	AssociationID uint16
	ErrorCode     IEC104AuthErrorCode
	ErrorTime     IEC104Time
	ErrorText     []byte
	// EncapsulatedRaw is the ASDU an S_AR_NA_1 authenticates; Encapsulated
	// is that ASDU decoded, or nil when it is itself a secure
	// authentication type.
	EncapsulatedRaw []byte
	Encapsulated    *IEC104ASDU
}

IEC104Security is the body of a secure authentication ASDU. Which fields are set depends on the type identification; the others stay zero. Slices alias the packet data.

func (*IEC104Security) DecodeBody

func (s *IEC104Security) DecodeBody(t IEC104TypeID, body []byte, opts IEC104ASDUOptions) ([]byte, error)

DecodeBody reads a whole secure authentication body of type t, such as IEC104SecurityAssembler returns, into the fields of s and returns the octets left over. The segment fields of s are kept.

func (*IEC104Security) RSC

RSC returns the reason for challenge as a named value.

func (*IEC104Security) USR

func (s *IEC104Security) USR() IEC104User

USR returns the user number as a named value.

type IEC104SecurityAssembler

type IEC104SecurityAssembler struct {
	// MaxSize caps the body in octets; 0 means 64 KiB.
	MaxSize int
	// contains filtered or unexported fields
}

IEC104SecurityAssembler joins the segments of a secure authentication body that spans several ASDUs. It follows one direction of one connection; the zero value is ready to use.

func (*IEC104SecurityAssembler) Add

Add takes the segment of a decoded ASDU. It returns the whole body once its final segment arrives, and nil before that. The body is a copy, valid until the next call; pass it to IEC104Security.DecodeBody.

A first segment restarts the assembler. A segment that does not carry the next sequence number, or that would grow the body past MaxSize, drops the body and returns an error.

type IEC104Time

type IEC104Time struct {
	Format IEC104TimeFormat
	// Milliseconds counts from the start of the minute, 0 to 59999.
	Milliseconds uint16
	Minute       uint8
	Hour         uint8
	Day          uint8 // day of month, 1 to 31
	Weekday      uint8 // 1 (Monday) to 7, or 0 when unused
	Month        uint8
	Year         uint8 // years past 2000, 0 to 99
	Invalid      bool  // IV
	Substituted  bool  // GEN: time substituted, not genuine
	Summer       bool  // SU: daylight saving time
}

IEC104Time is a CP24Time2a or CP56Time2a time tag. Fields CP24Time2a lacks stay zero.

func (IEC104Time) RangeFaults

func (t IEC104Time) RangeFaults() IEC104TimeFault

RangeFaults returns the fields of the tag that are out of range, 0 when all are valid. It is apart from Invalid, the IV bit the sender sets. A CP24Time2a tag has milliseconds and minutes to check only.

func (IEC104Time) Time

func (t IEC104Time) Time(loc *time.Location) time.Time

Time returns the CP56Time2a tag as a time.Time in loc, the zone the station keeps its clock in; nil means UTC. Two-digit years count from 2000. It returns the zero time for a CP24Time2a tag or no tag, since those carry no date.

type IEC104TimeFault

type IEC104TimeFault uint8

IEC104TimeFault flags the fields of a time tag that are out of range. A tag with such a field still decodes: the fields hold what was sent.

const (
	// IEC104TimeBadMilliseconds: above 59999.
	IEC104TimeBadMilliseconds IEC104TimeFault = 1 << iota
	// IEC104TimeBadMinute: above 59.
	IEC104TimeBadMinute
	// IEC104TimeBadHour: above 23.
	IEC104TimeBadHour
	// IEC104TimeBadDay: 0, or past the end of the month, e.g. 30
	// February.
	IEC104TimeBadDay
	// IEC104TimeBadMonth: 0 or above 12.
	IEC104TimeBadMonth
	// IEC104TimeBadYear: above 99.
	IEC104TimeBadYear
)

Time tag faults.

func (IEC104TimeFault) String

func (f IEC104TimeFault) String() string

String lists the fields out of range, e.g. "Hour|Day", or "None".

type IEC104TimeFormat

type IEC104TimeFormat uint8

IEC104TimeFormat tells which time tag an object carries.

const (
	// IEC104TimeNone means the object has no time tag.
	IEC104TimeNone IEC104TimeFormat = iota
	// IEC104TimeCP24 is CP24Time2a: milliseconds and minutes only.
	IEC104TimeCP24
	// IEC104TimeCP56 is CP56Time2a: a full date and time.
	IEC104TimeCP56
)

Time tag formats.

type IEC104TypeID

type IEC104TypeID uint8

IEC104TypeID is the ASDU type identification.

const (
	IEC104TypeSinglePoint              IEC104TypeID = 1   // M_SP_NA_1
	IEC104TypeSinglePointTime24        IEC104TypeID = 2   // M_SP_TA_1
	IEC104TypeDoublePoint              IEC104TypeID = 3   // M_DP_NA_1
	IEC104TypeDoublePointTime24        IEC104TypeID = 4   // M_DP_TA_1
	IEC104TypeStepPosition             IEC104TypeID = 5   // M_ST_NA_1
	IEC104TypeStepPositionTime24       IEC104TypeID = 6   // M_ST_TA_1
	IEC104TypeBitstring                IEC104TypeID = 7   // M_BO_NA_1
	IEC104TypeBitstringTime24          IEC104TypeID = 8   // M_BO_TA_1
	IEC104TypeNormalized               IEC104TypeID = 9   // M_ME_NA_1
	IEC104TypeNormalizedTime24         IEC104TypeID = 10  // M_ME_TA_1
	IEC104TypeScaled                   IEC104TypeID = 11  // M_ME_NB_1
	IEC104TypeScaledTime24             IEC104TypeID = 12  // M_ME_TB_1
	IEC104TypeFloat                    IEC104TypeID = 13  // M_ME_NC_1
	IEC104TypeFloatTime24              IEC104TypeID = 14  // M_ME_TC_1
	IEC104TypeTotals                   IEC104TypeID = 15  // M_IT_NA_1
	IEC104TypeTotalsTime24             IEC104TypeID = 16  // M_IT_TA_1
	IEC104TypeProtEventTime24          IEC104TypeID = 17  // M_EP_TA_1
	IEC104TypeProtStartTime24          IEC104TypeID = 18  // M_EP_TB_1
	IEC104TypeProtCircuitTime24        IEC104TypeID = 19  // M_EP_TC_1
	IEC104TypePackedSinglePoint        IEC104TypeID = 20  // M_PS_NA_1
	IEC104TypeNormalizedNoQuality      IEC104TypeID = 21  // M_ME_ND_1
	IEC104TypeSinglePointTime56        IEC104TypeID = 30  // M_SP_TB_1
	IEC104TypeDoublePointTime56        IEC104TypeID = 31  // M_DP_TB_1
	IEC104TypeStepPositionTime56       IEC104TypeID = 32  // M_ST_TB_1
	IEC104TypeBitstringTime56          IEC104TypeID = 33  // M_BO_TB_1
	IEC104TypeNormalizedTime56         IEC104TypeID = 34  // M_ME_TD_1
	IEC104TypeScaledTime56             IEC104TypeID = 35  // M_ME_TE_1
	IEC104TypeFloatTime56              IEC104TypeID = 36  // M_ME_TF_1
	IEC104TypeTotalsTime56             IEC104TypeID = 37  // M_IT_TB_1
	IEC104TypeProtEventTime56          IEC104TypeID = 38  // M_EP_TD_1
	IEC104TypeProtStartTime56          IEC104TypeID = 39  // M_EP_TE_1
	IEC104TypeProtCircuitTime56        IEC104TypeID = 40  // M_EP_TF_1
	IEC104TypeSecurityStatistics       IEC104TypeID = 41  // S_IT_TC_1
	IEC104TypeSingleCommand            IEC104TypeID = 45  // C_SC_NA_1
	IEC104TypeDoubleCommand            IEC104TypeID = 46  // C_DC_NA_1
	IEC104TypeStepCommand              IEC104TypeID = 47  // C_RC_NA_1
	IEC104TypeSetpointNormalized       IEC104TypeID = 48  // C_SE_NA_1
	IEC104TypeSetpointScaled           IEC104TypeID = 49  // C_SE_NB_1
	IEC104TypeSetpointFloat            IEC104TypeID = 50  // C_SE_NC_1
	IEC104TypeBitstringCommand         IEC104TypeID = 51  // C_BO_NA_1
	IEC104TypeSingleCommandTime56      IEC104TypeID = 58  // C_SC_TA_1
	IEC104TypeDoubleCommandTime56      IEC104TypeID = 59  // C_DC_TA_1
	IEC104TypeStepCommandTime56        IEC104TypeID = 60  // C_RC_TA_1
	IEC104TypeSetpointNormalizedTime56 IEC104TypeID = 61  // C_SE_TA_1
	IEC104TypeSetpointScaledTime56     IEC104TypeID = 62  // C_SE_TB_1
	IEC104TypeSetpointFloatTime56      IEC104TypeID = 63  // C_SE_TC_1
	IEC104TypeBitstringCommandTime56   IEC104TypeID = 64  // C_BO_TA_1
	IEC104TypeEndOfInit                IEC104TypeID = 70  // M_EI_NA_1
	IEC104TypeInterrogation            IEC104TypeID = 100 // C_IC_NA_1
	IEC104TypeCounterInterrogation     IEC104TypeID = 101 // C_CI_NA_1
	IEC104TypeRead                     IEC104TypeID = 102 // C_RD_NA_1
	IEC104TypeClockSync                IEC104TypeID = 103 // C_CS_NA_1
	IEC104TypeTest                     IEC104TypeID = 104 // C_TS_NA_1
	IEC104TypeResetProcess             IEC104TypeID = 105 // C_RP_NA_1
	IEC104TypeDelayAcquisition         IEC104TypeID = 106 // C_CD_NA_1
	IEC104TypeTestTime56               IEC104TypeID = 107 // C_TS_TA_1
	IEC104TypeParamNormalized          IEC104TypeID = 110 // P_ME_NA_1
	IEC104TypeParamScaled              IEC104TypeID = 111 // P_ME_NB_1
	IEC104TypeParamFloat               IEC104TypeID = 112 // P_ME_NC_1
	IEC104TypeParamActivation          IEC104TypeID = 113 // P_AC_NA_1
	IEC104TypeFileReady                IEC104TypeID = 120 // F_FR_NA_1
	IEC104TypeSectionReady             IEC104TypeID = 121 // F_SR_NA_1
	IEC104TypeCallFile                 IEC104TypeID = 122 // F_SC_NA_1
	IEC104TypeLastSection              IEC104TypeID = 123 // F_LS_NA_1
	IEC104TypeAckFile                  IEC104TypeID = 124 // F_AF_NA_1
	IEC104TypeSegment                  IEC104TypeID = 125 // F_SG_NA_1
	IEC104TypeDirectory                IEC104TypeID = 126 // F_DR_TA_1
	IEC104TypeQueryLog                 IEC104TypeID = 127 // F_SC_NB_1
)

Type identifications of IEC 60870-5-101 and 60870-5-104. The comment of each names its mnemonic, which String returns.

const (
	IEC104TypeAuthChallenge    IEC104TypeID = 81 // S_CH_NA_1
	IEC104TypeAuthReply        IEC104TypeID = 82 // S_RP_NA_1
	IEC104TypeAuthAggressive   IEC104TypeID = 83 // S_AR_NA_1
	IEC104TypeKeyStatusRequest IEC104TypeID = 84 // S_KR_NA_1
	IEC104TypeKeyStatus        IEC104TypeID = 85 // S_KS_NA_1
	IEC104TypeKeyChange        IEC104TypeID = 86 // S_KC_NA_1
	IEC104TypeAuthError        IEC104TypeID = 87 // S_ER_NA_1
	IEC104TypeUserStatusChange IEC104TypeID = 90 // S_US_NA_1
	IEC104TypeUpdateKeyRequest IEC104TypeID = 91 // S_UQ_NA_1
	IEC104TypeUpdateKeyReply   IEC104TypeID = 92 // S_UR_NA_1
	IEC104TypeUpdateKeySym     IEC104TypeID = 93 // S_UK_NA_1
	IEC104TypeUpdateKeyAsym    IEC104TypeID = 94 // S_UA_NA_1
	IEC104TypeUpdateKeyConfirm IEC104TypeID = 95 // S_UC_NA_1
)

Secure authentication type identifications. The comment of each names its mnemonic, which String returns.

func (IEC104TypeID) String

func (t IEC104TypeID) String() string

String returns the type's mnemonic, e.g. "M_SP_NA_1".

type IEC104UFunction

type IEC104UFunction uint8

IEC104UFunction is the function bits of a U-format control field: the first control octet without its two format bits.

const (
	IEC104StartDTAct IEC104UFunction = 0x04
	IEC104StartDTCon IEC104UFunction = 0x08
	IEC104StopDTAct  IEC104UFunction = 0x10
	IEC104StopDTCon  IEC104UFunction = 0x20
	IEC104TestFRAct  IEC104UFunction = 0x40
	IEC104TestFRCon  IEC104UFunction = 0x80
)

U-format functions.

func (IEC104UFunction) String

func (u IEC104UFunction) String() string

String returns the function as Wireshark names it, e.g. "STARTDT act".

type IEC104User

type IEC104User uint16

IEC104User is USR, the user number (IEC 62351-5).

const (
	IEC104UserUnknown IEC104User = 0
	IEC104UserDefault IEC104User = 1
)

User numbers with a fixed meaning; the rest are handed out by the controlling station.

func (IEC104User) String

func (u IEC104User) String() string

String returns the user as Wireshark names it.

type IEC61850Header

type IEC61850Header struct {
	AppID     uint16
	Length    uint16
	Reserved1 uint16
	Reserved2 uint16
}

IEC61850Header is the header GOOSE and SV share in front of their APDU. Length counts from AppID to the end of the APDU.

func (*IEC61850Header) Simulated

func (h *IEC61850Header) Simulated() bool

Simulated reports whether the simulation bit of Reserved1 is set.

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) CanDecode added in v1.4.0

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

CanDecode returns the layer type this DecodingLayer can decode

func (*IPSecAH) DecodeFromBytes added in v1.4.0

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

DecodeFromBytes takes a byte buffer and decodes

func (*IPSecAH) LayerType

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

LayerType returns LayerTypeIPSecAH.

func (*IPSecAH) NextLayerType added in v1.4.0

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

NextLayerType returns the next layer we should see after IPSecAH

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) CanDecode added in v1.4.0

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

CanDecode returns the layer type this DecodingLayer can decode

func (*IPSecESP) DecodeFromBytes added in v1.4.0

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

DecodeFromBytes takes a byte buffer and decodes

func (*IPSecESP) LayerType

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

LayerType returns LayerTypeIPSecESP.

func (*IPSecESP) NextLayerType added in v1.4.0

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

NextLayerType retuns the next layer we should see after IPSecESP

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.

func (*IPv4) VerifyChecksum added in v1.2.0

func (ip *IPv4) VerifyChecksum() (error, gopacket.ChecksumVerificationResult)

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) CanDecode added in v1.7.6

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

CanDecode implementation according to gopacket.DecodingLayer

func (*IPv6Fragment) DecodeFromBytes added in v1.7.6

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

DecodeFromBytes implementation according to gopacket.DecodingLayer

func (*IPv6Fragment) LayerType

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

LayerType returns LayerTypeIPv6Fragment.

func (*IPv6Fragment) NextLayerType added in v1.7.6

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

NextLayerType implementation according to gopacket.DecodingLayer. The data behind a fragment header is a piece of the original packet, so it is a Fragment as it is for IPv4; only an atomic fragment (offset 0, no more fragments) carries the header named by NextHeader.

func (*IPv6Fragment) SerializeTo added in v1.3.0

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
	// Data is the type-specific data after the first 8 bytes of the header,
	// set only when it was not decoded into SourceRoutingIPs.
	Data []byte
	// contains filtered or unexported fields
}

IPv6Routing is the IPv6 routing extension.

func (*IPv6Routing) LayerType

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

LayerType returns LayerTypeIPv6Routing.

func (*IPv6Routing) SerializeTo added in v1.4.0

SerializeTo implementation according to gopacket.SerializableLayer

type ISOPresentation

type ISOPresentation struct {
	BaseLayer
	Type ISOPresentationType
	// Mode is the mode-value: 0 x410-1984, 1 normal.
	Mode               int64
	CallingSelector    []byte
	CalledSelector     []byte
	RespondingSelector []byte
	Contexts           []ISOPresentationContext
	Results            []ISOPresentationResult
	// ContextIDs lists the presentation-context-identifier-list of an ARU.
	ContextIDs        []int64
	ProviderReason    int64
	HasProviderReason bool
	EventID           int64
	PDVs              []ISOPresentationPDV
	SimplyEncoded     []byte
	// X410 is set for a PPDU with x410-mode parameters and for the RTTP
	// and RTTR APDUs. The data of an RTTR is the layer payload.
	X410 *ISOPresentationX410
	// contains filtered or unexported fields
}

ISOPresentation is an ISO 8823 PPDU. The layer payload is the data of the first PDV, and only that PDV is routed to the next layer. PDVs lists all of them; PDVLayer decodes any one.

Presentation context identifiers are bound to abstract syntaxes by the CP/CPA exchange, which later packets do not repeat. When a CP in the same PPDU defines the context, the PDV is routed by its abstract syntax. Otherwise the decoder uses the tag of the PDV data, as Wireshark's conventional mapping does (context 1 = ACSE, 3 = MMS): ACSE APDUs are APPLICATION class, MMS PDUs context class, so the two never collide.

func (*ISOPresentation) CanDecode

func (p *ISOPresentation) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeISOPresentation.

func (*ISOPresentation) DecodeFromBytes

func (p *ISOPresentation) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a PPDU. Without the session SPDU type, CP vs CPA and CPR vs ARP are told apart by the fields present.

func (*ISOPresentation) LayerType

func (p *ISOPresentation) LayerType() gopacket.LayerType

LayerType returns LayerTypeISOPresentation.

func (*ISOPresentation) NextLayerType

func (p *ISOPresentation) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeACSE or LayerTypeMMS for the first PDV, gopacket.LayerTypePayload for other data, or LayerTypeZero.

func (*ISOPresentation) PDVLayer

func (p *ISOPresentation) PDVLayer(i int) (gopacket.Layer, error)

PDVLayer decodes PDV i as the ACSE or MMS layer it would be routed to in first place, e.g. the MMS PDU that follows an ACSE APDU in the same PPDU. It returns nil, nil for opaque or unrecognised data.

type ISOPresentationContext

type ISOPresentationContext struct {
	ID               int64
	AbstractSyntax   string
	TransferSyntaxes []string
}

ISOPresentationContext is one presentation-context-definition-list item of a CP PPDU.

type ISOPresentationEncoding

type ISOPresentationEncoding uint8

ISOPresentationEncoding is the presentation-data-values (or EXTERNAL encoding) CHOICE of a PDV.

const (
	ISOPresentationSingleASN1   ISOPresentationEncoding = 0
	ISOPresentationOctetAligned ISOPresentationEncoding = 1
	ISOPresentationArbitrary    ISOPresentationEncoding = 2
)

PDV encodings.

func (ISOPresentationEncoding) String

func (e ISOPresentationEncoding) String() string

String returns the ASN.1 name of the encoding.

type ISOPresentationPDV

type ISOPresentationPDV struct {
	TransferSyntax string
	ContextID      int64
	Encoding       ISOPresentationEncoding
	Data           []byte
}

ISOPresentationPDV is one PDV-list of fully-encoded user data. ACSE reuses it for EXTERNAL, where TransferSyntax is the direct-reference and ContextID the indirect-reference.

type ISOPresentationResult

type ISOPresentationResult struct {
	Result         int64
	TransferSyntax string
	ProviderReason int64
}

ISOPresentationResult is one presentation-context-definition-result-list item of a CPA or CPR PPDU. Result 0 is acceptance, 1 user-rejection and 2 provider-rejection.

type ISOPresentationType

type ISOPresentationType uint8

ISOPresentationType is the kind of PPDU.

const (
	ISOPresentationCP ISOPresentationType = iota + 1
	ISOPresentationCPA
	ISOPresentationCPR
	ISOPresentationARU
	ISOPresentationARP
	ISOPresentationUserData
	// ISOPresentationRTTP and ISOPresentationRTTR are the token and data
	// APDUs X.410-1984 mode sends as bare session user data.
	ISOPresentationRTTP
	ISOPresentationRTTR
)

PPDU kinds. ISOPresentationUserData covers TD and the data of other session SPDUs: a bare fully- or simply-encoded User-data.

func (ISOPresentationType) String

func (t ISOPresentationType) String() string

String returns the PPDU abbreviation.

type ISOPresentationX410

type ISOPresentationX410 struct {
	CheckpointSize int64
	WindowSize     int64
	// DialogueMode is 0 monologue, 1 two way alternate.
	DialogueMode           int64
	ApplicationProtocol    int64
	HasApplicationProtocol bool
	// ConnectionData is the open value, or the session connection
	// identifier of a recovered connection when Recover is set.
	ConnectionData []byte
	Recover        bool

	// Reason is the refuseReason or abortReason.
	Reason    int64
	HasReason bool
	// Reflected is the reflectedParameter BIT STRING value.
	Reflected []byte
	UserData  []byte
	Priority  int64
}

ISOPresentationX410 holds the x410-mode parameters of a PPDU: the fields of the X.410-1984 reliable transfer APDU it stands for.

CP    RTORQ  CheckpointSize, WindowSize, DialogueMode, ConnectionData
             or Recover, ApplicationProtocol
CPA   RTOAC  CheckpointSize, WindowSize, ConnectionData or Recover
CPR   RTORJ  Reason, UserData
ARU   RTAB   Reason, Reflected, UserData
RTTP         Priority

CheckpointSize defaults to 0 and WindowSize to 3.

type ISOSession

type ISOSession struct {
	BaseLayer
	SPDUs []ISOSessionSPDU
	Flaws ISOSessionFlaws
}

ISOSession is an ISO 8327-1 session TSDU. SPDUs holds one SPDU, or a category 0 SPDU (Give or Please Tokens) followed by the SPDU it is concatenated with. Extended concatenation puts several category 2 SPDUs after it, e.g. GT, MIP and DT; all are listed, the last one being the main SPDU. The layer payload is the session user data: the User Data parameter of connection SPDUs, the bytes that follow a DT, or the SS-user data trailing a Refuse reason code.

Flaws tells what was tolerated to decode the TSDU. No flaw is an error: the layers above still get the user data found.

func (*ISOSession) CanDecode

func (s *ISOSession) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeISOSession.

func (*ISOSession) DecodeFromBytes

func (s *ISOSession) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a session TSDU (one COTP DT user data unit).

func (*ISOSession) LayerType

func (s *ISOSession) LayerType() gopacket.LayerType

LayerType returns LayerTypeISOSession.

func (*ISOSession) NextLayerType

func (s *ISOSession) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeISOPresentation when there is user data.

func (*ISOSession) Type

func (s *ISOSession) Type() ISOSessionSPDUType

Type returns the type of the last (main) SPDU.

type ISOSessionEnclosure

type ISOSessionEnclosure uint8

ISOSessionEnclosure is the Enclosure Item parameter of a segmented SSDU.

const (
	ISOSessionEnclosureBegin ISOSessionEnclosure = 0x01
	ISOSessionEnclosureEnd   ISOSessionEnclosure = 0x02
)

Enclosure Item bits.

type ISOSessionFlaws

type ISOSessionFlaws uint8

ISOSessionFlaws flags what is wrong with a TSDU that still decodes.

const (
	// ISOSessionLengthOverrun: the length indicator of an SPDU runs past
	// the TSDU, yet the octets present are whole parameters. The SPDU is
	// decoded from those; ISOSessionSPDU.Length keeps the indicator.
	ISOSessionLengthOverrun ISOSessionFlaws = 1 << iota
	// ISOSessionBadConcat: what follows the concatenated SPDUs starts
	// like another one and does not decode. It is left undecoded.
	ISOSessionBadConcat
	// ISOSessionTooManySPDUs: more SPDUs are concatenated than the
	// decoder reads. The others are left undecoded.
	ISOSessionTooManySPDUs
)

Flaws of a session TSDU.

func (ISOSessionFlaws) String

func (f ISOSessionFlaws) String() string

String lists the flaws, e.g. "length-overrun|bad-concatenation".

type ISOSessionOptions

type ISOSessionOptions uint8

ISOSessionOptions is the Protocol Options parameter.

const ISOSessionExtendedConcat ISOSessionOptions = 0x01

ISOSessionExtendedConcat tells the sender can receive extended concatenated SPDUs.

type ISOSessionParam

type ISOSessionParam struct {
	ID     ISOSessionParamID
	Value  []byte
	Params []ISOSessionParam
}

ISOSessionParam is one PI or PGI unit. Params holds the PIs of a PGI.

type ISOSessionParamID

type ISOSessionParamID uint8

ISOSessionParamID is a parameter (PI) or parameter group (PGI) identifier.

const (
	ISOSessionParamConnectionID     ISOSessionParamID = 1
	ISOSessionParamConnectAccept    ISOSessionParamID = 5
	ISOSessionParamCalledSSUserRef  ISOSessionParamID = 9
	ISOSessionParamCallingSSUserRef ISOSessionParamID = 10
	ISOSessionParamCommonRef        ISOSessionParamID = 11
	ISOSessionParamAdditionalRef    ISOSessionParamID = 12
	ISOSessionParamSyncType         ISOSessionParamID = 15
	ISOSessionParamTokenItem        ISOSessionParamID = 16
	ISOSessionParamTransportDisc    ISOSessionParamID = 17
	ISOSessionParamProtocolOptions  ISOSessionParamID = 19
	ISOSessionParamSessionUserReq   ISOSessionParamID = 20
	ISOSessionParamTSDUMaxSize      ISOSessionParamID = 21
	ISOSessionParamVersion          ISOSessionParamID = 22
	ISOSessionParamInitialSerial    ISOSessionParamID = 23
	ISOSessionParamPrepareType      ISOSessionParamID = 24
	ISOSessionParamEnclosure        ISOSessionParamID = 25
	ISOSessionParamTokenSetting     ISOSessionParamID = 26
	ISOSessionParamResyncType       ISOSessionParamID = 27
	ISOSessionParamLinkingInfo      ISOSessionParamID = 33
	ISOSessionParamActivityID       ISOSessionParamID = 41
	ISOSessionParamSerialNumber     ISOSessionParamID = 42
	ISOSessionParamReflect          ISOSessionParamID = 49
	ISOSessionParamReasonCode       ISOSessionParamID = 50
	ISOSessionParamCallingSelector  ISOSessionParamID = 51
	ISOSessionParamCalledSelector   ISOSessionParamID = 52
	ISOSessionParamDataOverflow     ISOSessionParamID = 60
	ISOSessionParamUserData         ISOSessionParamID = 193
	ISOSessionParamExtendedUserData ISOSessionParamID = 194
)

ISO 8327-1 parameter and parameter group identifiers.

func (ISOSessionParamID) String

func (id ISOSessionParamID) String() string

String returns the parameter name.

type ISOSessionRequirements

type ISOSessionRequirements uint16

ISOSessionRequirements is the Session User Requirements parameter: the functional units proposed or selected.

const (
	ISOSessionFUHalfDuplex        ISOSessionRequirements = 1 << 0
	ISOSessionFUDuplex            ISOSessionRequirements = 1 << 1
	ISOSessionFUExpedited         ISOSessionRequirements = 1 << 2
	ISOSessionFUMinorSync         ISOSessionRequirements = 1 << 3
	ISOSessionFUMajorSync         ISOSessionRequirements = 1 << 4
	ISOSessionFUResync            ISOSessionRequirements = 1 << 5
	ISOSessionFUActivity          ISOSessionRequirements = 1 << 6
	ISOSessionFUNegotiatedRelease ISOSessionRequirements = 1 << 7
	ISOSessionFUCapabilityData    ISOSessionRequirements = 1 << 8
	ISOSessionFUExceptions        ISOSessionRequirements = 1 << 9
	ISOSessionFUTypedData         ISOSessionRequirements = 1 << 10
	ISOSessionFUSymmetricSync     ISOSessionRequirements = 1 << 11
	ISOSessionFUDataSeparation    ISOSessionRequirements = 1 << 12
)

ISO 8327-1 functional units.

type ISOSessionSPDU

type ISOSessionSPDU struct {
	Type   ISOSessionSPDUType
	Length int
	Params []ISOSessionParam
}

ISOSessionSPDU is one SPDU: its identifier, length indicator and parameters.

func (*ISOSessionSPDU) CalledSelector

func (s *ISOSessionSPDU) CalledSelector() []byte

CalledSelector returns the Called (or Responding) Session Selector, nil when absent.

func (*ISOSessionSPDU) CallingSelector

func (s *ISOSessionSPDU) CallingSelector() []byte

CallingSelector returns the Calling Session Selector, nil when absent.

func (*ISOSessionSPDU) Enclosure

func (s *ISOSessionSPDU) Enclosure() (e ISOSessionEnclosure, ok bool)

Enclosure returns the Enclosure Item parameter.

func (*ISOSessionSPDU) MaxTSDUSize

func (s *ISOSessionSPDU) MaxTSDUSize() (toResponder, toInitiator uint16, ok bool)

MaxTSDUSize returns the TSDU Maximum Size parameter: the largest TSDU from the initiator to the responder and back, 0 for no limit.

func (*ISOSessionSPDU) Param

Param returns the first parameter with the given id, searching inside parameter groups too, or nil.

func (*ISOSessionSPDU) ProtocolOptions

func (s *ISOSessionSPDU) ProtocolOptions() (opts ISOSessionOptions, ok bool)

ProtocolOptions returns the Protocol Options parameter; ok is false when it is absent or malformed, as for the accessors below.

func (*ISOSessionSPDU) ReasonCode

func (s *ISOSessionSPDU) ReasonCode() (code uint8, ok bool)

ReasonCode returns the first octet of the Reason Code parameter of a Refuse SPDU, e.g. 2 for a rejection by the called SS-user with user data.

func (*ISOSessionSPDU) Requirements

func (s *ISOSessionSPDU) Requirements() (r ISOSessionRequirements, ok bool)

Requirements returns the Session User Requirements parameter.

func (*ISOSessionSPDU) SerialNumber

func (s *ISOSessionSPDU) SerialNumber() string

SerialNumber returns the digits of the Serial Number parameter of a synchronization SPDU, e.g. "42", or "" when absent.

func (*ISOSessionSPDU) TokenItem

func (s *ISOSessionSPDU) TokenItem() (tokens uint8, ok bool)

TokenItem returns the Token Item parameter: two bits per token (data, synchronize-minor, major/activity, release from the least significant pair up).

func (*ISOSessionSPDU) TokenSetting

func (s *ISOSessionSPDU) TokenSetting() (tokens uint8, ok bool)

TokenSetting returns the Token Setting Item parameter, laid out as the Token Item.

func (*ISOSessionSPDU) TransportDisconnect

func (s *ISOSessionSPDU) TransportDisconnect() (d ISOSessionTransportDisc, ok bool)

TransportDisconnect returns the Transport Disconnect parameter.

func (*ISOSessionSPDU) Versions

func (s *ISOSessionSPDU) Versions() (v ISOSessionVersions, ok bool)

Versions returns the Version Number parameter.

type ISOSessionSPDUType

type ISOSessionSPDUType uint8

ISOSessionSPDUType is the SPDU identifier (SI) of an ISO 8327-1 SPDU. SI 1 means Give Tokens when it opens a concatenated TSDU and Data Transfer in second place: "01 00 01 00 <data>" is GT followed by DT.

const (
	ISOSessionGiveTokens          ISOSessionSPDUType = 1
	ISOSessionDataTransfer        ISOSessionSPDUType = 1
	ISOSessionPleaseTokens        ISOSessionSPDUType = 2
	ISOSessionExpedited           ISOSessionSPDUType = 5
	ISOSessionPrepare             ISOSessionSPDUType = 7
	ISOSessionNotFinished         ISOSessionSPDUType = 8
	ISOSessionFinish              ISOSessionSPDUType = 9
	ISOSessionDisconnect          ISOSessionSPDUType = 10
	ISOSessionRefuse              ISOSessionSPDUType = 12
	ISOSessionConnect             ISOSessionSPDUType = 13
	ISOSessionAccept              ISOSessionSPDUType = 14
	ISOSessionConnectDataOverflow ISOSessionSPDUType = 15
	ISOSessionOverflowAccept      ISOSessionSPDUType = 16
	ISOSessionGiveTokensConfirm   ISOSessionSPDUType = 21
	ISOSessionGiveTokensAck       ISOSessionSPDUType = 22
	ISOSessionAbort               ISOSessionSPDUType = 25
	ISOSessionAbortAccept         ISOSessionSPDUType = 26
	ISOSessionActivityResume      ISOSessionSPDUType = 29
	ISOSessionTypedData           ISOSessionSPDUType = 33
	ISOSessionResyncAck           ISOSessionSPDUType = 34
	ISOSessionMajorSync           ISOSessionSPDUType = 41
	ISOSessionMajorSyncAck        ISOSessionSPDUType = 42
	ISOSessionActivityStart       ISOSessionSPDUType = 45
	ISOSessionExceptionData       ISOSessionSPDUType = 48
	ISOSessionMinorSync           ISOSessionSPDUType = 49
	ISOSessionMinorSyncAck        ISOSessionSPDUType = 50
	ISOSessionResync              ISOSessionSPDUType = 53
	ISOSessionActivityDiscard     ISOSessionSPDUType = 57
	ISOSessionActivityDiscardAck  ISOSessionSPDUType = 58
	ISOSessionCapabilityData      ISOSessionSPDUType = 61
	ISOSessionCapabilityDataAck   ISOSessionSPDUType = 62
)

ISO 8327-1 SPDU identifiers.

func (ISOSessionSPDUType) String

func (t ISOSessionSPDUType) String() string

String returns the SPDU abbreviation used by ISO 8327-1.

type ISOSessionTransportDisc

type ISOSessionTransportDisc uint8

ISOSessionTransportDisc is the Transport Disconnect parameter.

const (
	ISOSessionTransportReleased ISOSessionTransportDisc = 0x01
	ISOSessionUserAbort         ISOSessionTransportDisc = 0x02
	ISOSessionProtocolError     ISOSessionTransportDisc = 0x04
	ISOSessionNoReason          ISOSessionTransportDisc = 0x08
	ISOSessionImplRestriction   ISOSessionTransportDisc = 0x10
)

Transport Disconnect bits. The reason bits are only set in an Abort.

type ISOSessionVersions

type ISOSessionVersions uint8

ISOSessionVersions is the Version Number parameter: a bit per protocol version supported.

const (
	ISOSessionVersion1 ISOSessionVersions = 0x01
	ISOSessionVersion2 ISOSessionVersions = 0x02
)

ISO 8327-1 protocol versions.

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 LTF added in v1.3.0

type LTF uint8
const (
	LTF_unknown LTF = iota
	LTF_1x
	LTF_2x
	LTF_4x
)

func (LTF) String added in v1.3.0

func (ltf LTF) String() string

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 uint16

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 = iota
	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
	LinkTypeLinuxSLL2      LinkType = 276

	// Warning: this const should always be 1 larger than the largest valid value
	LinkTypeMax LinkType = 277
)
const LinkTypeApplePKTAP LinkType = 149 // Apple pktap wrapper (Darwin only)
const LinkTypeBACnetMSTP LinkType = 165

LinkTypeBACnetMSTP is the pcap link type of BACnet MS/TP frames (LINKTYPE_BACNET_MS_TP).

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 LinuxSLL2

type LinuxSLL2 struct {
	BaseLayer
	ProtocolType    EthernetType
	InterfaceIndex  uint32
	ARPHardwareType ARPHardwareType
	PacketType      LinuxSLL2PacketType
	AddrLength      uint8
	Addr            net.HardwareAddr
}

LinuxSLL2 is the second version of the Linux "cooked" capture encapsulation protocol. It is used to encapsulate packets within packet capture files, particularly by libpcap/tcpdump when making a packet capture with -i any https://www.tcpdump.org/linktypes/LINKTYPE_LINUX_SLL2.html

func (*LinuxSLL2) CanDecode

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

func (*LinuxSLL2) DecodeFromBytes

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

func (*LinuxSLL2) LayerType

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

LayerType returns LayerTypeLinuxSLL.

func (*LinuxSLL2) LinkFlow

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

func (*LinuxSLL2) NextLayerType

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

type LinuxSLL2PacketType

type LinuxSLL2PacketType uint8

The LinuxSLL2PacketType can contain the same values as LinuxSLLPacketType accept it is a uint8 instread of a uint16

const (
	LinuxSLL2PacketTypeHost      LinuxSLL2PacketType = 0 // To us
	LinuxSLL2PacketTypeBroadcast LinuxSLL2PacketType = 1 // To all
	LinuxSLL2PacketTypeMulticast LinuxSLL2PacketType = 2 // To group
	LinuxSLL2PacketTypeOtherhost LinuxSLL2PacketType = 3 // To someone else
	LinuxSLL2PacketTypeOutgoing  LinuxSLL2PacketType = 4 // Outgoing of any type
	// These ones are invisible by user level
	LinuxSLL2PacketTypeLoopback  LinuxSLL2PacketType = 5 // MC/BRD frame looped back
	LinuxSLL2PacketTypeFastroute LinuxSLL2PacketType = 6 // Fastrouted frame
)

func (LinuxSLL2PacketType) String

func (l LinuxSLL2PacketType) String() string

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 MBAP added in v1.6.0

type MBAP struct {
	TransactionID uint16 // Transaction identifier
	ProtocolID    uint16 // Protocol identifier (0 for Modbus)
	Length        uint16 // Length of remaining data
	UnitID        uint8  // Unit identifier
}

MBAP represents the Modbus Application Protocol header

type MDP added in v1.3.1

type MDP struct {
	BaseLayer
	PreambleData []byte
	DeviceInfo   string
	NetworkInfo  string
	Longitude    float64
	Latitude     float64
	Type6UUID    string
	Type7UUID    string
	IPAddress    net.IP
	Type13Bool   bool

	Type   EthernetType
	Length int
}

MDP defines a MDP over LLC layer.

func (*MDP) CanDecode added in v1.3.1

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

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

func (*MDP) DecodeFromBytes added in v1.3.1

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

DecodeFromBytes decodes the given bytes into this layer.

func (*MDP) LayerType added in v1.3.1

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

LayerType returns LayerTypeMDP.

func (*MDP) NextLayerType added in v1.3.1

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

NextLayerType returns the layer type contained by this DecodingLayer.

func (*MDP) SerializeTo added in v1.3.1

func (m *MDP) SerializeTo(b gopacket.SerializeBuffer, opts gopacket.SerializeOptions) error

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 MMS

type MMS struct {
	BaseLayer
	Type        MMSPDUType
	InvokeID    uint32
	Service     MMSConfirmedService
	Unconfirmed MMSUnconfirmedService
	ServiceData []byte
	// NoService is set for a confirmed PDU that ends after its invokeID,
	// or goes on with a service-ext or, in a response, a universal
	// element. The service is mandatory, yet such responses are seen on
	// the wire; Service is then meaningless and ServiceDecodeErr tells
	// why.
	NoService bool

	Initiate          *MMSInitiate
	Error             *MMSServiceError
	ModifierPosition  int64
	Reject            *MMSRejectInfo
	ObjectName        *MMSObjectName
	GetNameListReq    *MMSGetNameListRequest
	GetNameListResp   *MMSGetNameListResponse
	ReadReq           *MMSReadRequest
	ReadResp          *MMSReadResponse
	WriteReq          *MMSWriteRequest
	WriteResp         []MMSWriteResult
	InformationReport *MMSInformationReport
	IdentifyResp      *MMSIdentifyResponse
	NamedVariableList *MMSNamedVariableList

	// The fields below are best effort: a malformed service element
	// leaves them nil and sets ServiceDecodeErr, and the PDU still
	// decodes with its raw ServiceData. ObjectName above is also set for
	// the other requests that are a bare ObjectName, e.g.
	// reportJournalStatus, deleteSemaphore or getNamedTypeAttributes.
	ServiceDecodeErr error
	// ErrorDetail is the serviceSpecificInformation of Error.
	ErrorDetail *MMSErrorDetail
	// VariableAddress is set for a getVariableAccessAttributes request
	// by address.
	VariableAddress      *MMSAddress
	VariableAttributes   *MMSVariableAttributes
	DeleteReq            *MMSDeleteRequest
	DeleteResp           *MMSDeleteResponse
	StatusReq            *MMSStatusRequest
	Status               *MMSVMDStatus
	RenameReq            *MMSRenameRequest
	CapabilityList       *MMSCapabilityList
	DomainReq            *MMSDomainRequest
	DomainResp           *MMSDomainResponse
	ProgramReq           *MMSProgramRequest
	ProgramAttributes    *MMSProgramAttributes
	FileReq              *MMSFileRequest
	FileResp             *MMSFileResponse
	JournalReq           *MMSJournalRequest
	JournalResp          *MMSJournalResponse
	EventCondition       *MMSEventCondition
	EventConditionStatus *MMSEventConditionStatus
	EventNotification    *MMSEventNotification
	EventAck             *MMSEventAck
	AlarmSummaryReq      *MMSAlarmSummaryRequest
	AlarmSummary         *MMSAlarmSummaryResponse

	// Modifiers is the listOfModifier of a confirmed request and
	// ServiceExt the service-ext detail that may follow any service.
	Modifiers  []MMSModifier
	ServiceExt *MMSServiceExt

	NamedVariable     *MMSNamedVariable
	ScatteredAccess   *MMSScatteredAccess
	NamedType         *MMSNamedType
	OperatorReq       *MMSOperatorRequest
	OperatorResp      *MMSOperatorResponse
	SemaphoreReq      *MMSSemaphoreRequest
	SemaphoreResp     *MMSSemaphoreResponse
	EventAlter        *MMSEventAlter
	EventAction       *MMSEventAction
	EventActionStatus *MMSEventActionStatus
	EventEnrollment   *MMSEventEnrollment
	EnrollmentQuery   *MMSEnrollmentQuery
	EnrollmentList    *MMSEnrollmentList
	EnrollmentStatus  *MMSEnrollmentStatus
	EventDeleteReq    *MMSEventDeleteRequest
	EventDeleteResp   *MMSEventDeleteResponse
	Additional        *MMSAdditional
	DataExchange      *MMSDataExchange
	AccessControl     *MMSAccessControl
}

MMS is an ISO 9506 MMSpdu. InvokeID is set for confirmed and cancel PDUs. Service and ServiceData are set for confirmed requests and responses, Unconfirmed and ServiceData for unconfirmed PDUs. Services with a typed decoding also fill the matching pointer field; the others only expose ServiceData, the raw service element value.

func (*MMS) CanDecode

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

CanDecode returns LayerTypeMMS.

func (*MMS) DecodeFromBytes

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

DecodeFromBytes decodes one MMSpdu.

func (*MMS) LayerType

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

LayerType returns LayerTypeMMS.

func (*MMS) NextLayerType

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

NextLayerType returns LayerTypeZero: MMS is the application layer.

func (*MMS) Payload

func (m *MMS) Payload() []byte

Payload returns nil.

type MMSAccessCondition

type MMSAccessCondition struct {
	Kind       MMSAccessConditionKind
	Semaphore  string
	User       *MMSApplicationReference
	Password   []byte
	Conditions []MMSAccessCondition
}

MMSAccessCondition is one AccessCondition: who may do an operation. Semaphore names the semaphore to own, User the application allowed (nil for any user), Password is the raw Authentication-value, and Conditions lists those that must all (joint) or any (alternate) hold.

type MMSAccessConditionKind

type MMSAccessConditionKind uint8

MMSAccessConditionKind is the AccessCondition CHOICE tag.

const (
	MMSAccessNever     MMSAccessConditionKind = 0
	MMSAccessSemaphore MMSAccessConditionKind = 1
	MMSAccessUser      MMSAccessConditionKind = 2
	MMSAccessPassword  MMSAccessConditionKind = 3
	MMSAccessJoint     MMSAccessConditionKind = 4
	MMSAccessAlternate MMSAccessConditionKind = 5
)

Access condition alternatives.

func (MMSAccessConditionKind) String

func (k MMSAccessConditionKind) String() string

String returns the ASN.1 name of the alternative.

type MMSAccessControl

type MMSAccessControl struct {
	Name     string
	Elements []MMSAccessElement

	VMD         bool
	HasObject   bool
	ObjectClass MMSObjectClass
	ObjectName  MMSObjectName

	VMDUse            bool
	References        []MMSAccessReference
	AccessControlList string

	ContinueAfter    MMSObjectName
	HasContinueAfter bool
	Names            []MMSObjectName
	MoreFollows      bool

	Scope    MMSDeleteScope
	DomainID string
	Matched  uint32
	Changed  uint32
}

MMSAccessControl holds the access control list services of ISO 9506-2:2003. Name is the access control list:

Elements                      defineAccessControlList request,
                              getAccessControlListAttributes response
VMD, HasObject, ObjectClass,
ObjectName                    getAccessControlListAttributes request:
                              by list name, for the VMD or for an object
VMDUse, References,
AccessControlList             getAccessControlListAttributes response
ObjectClass, ContinueAfter    reportAccessControlledObjects request
Names, MoreFollows            reportAccessControlledObjects response
VMD, ObjectClass, Scope,
Names, DomainID               changeAccessControl request
Matched, Changed              changeAccessControl response

type MMSAccessElement

type MMSAccessElement struct {
	Operation MMSAccessOperation
	Condition MMSAccessCondition
}

MMSAccessElement is the condition for one operation.

type MMSAccessKind

type MMSAccessKind uint8

MMSAccessKind is the VariableAccessSpecification CHOICE tag.

const (
	MMSAccessListOfVariable   MMSAccessKind = 0
	MMSAccessVariableListName MMSAccessKind = 1
)

Variable access specification alternatives.

func (MMSAccessKind) String

func (k MMSAccessKind) String() string

String returns the ASN.1 name of the alternative.

type MMSAccessOperation

type MMSAccessOperation uint8

MMSAccessOperation is the operation an access condition guards: the tag of the accessControlListElements field.

const (
	MMSAccessRead    MMSAccessOperation = 0
	MMSAccessStore   MMSAccessOperation = 1
	MMSAccessWrite   MMSAccessOperation = 2
	MMSAccessLoad    MMSAccessOperation = 3
	MMSAccessExecute MMSAccessOperation = 4
	MMSAccessDelete  MMSAccessOperation = 5
	MMSAccessEdit    MMSAccessOperation = 6
)

Guarded operations.

func (MMSAccessOperation) String

func (o MMSAccessOperation) String() string

String returns the name of the operation.

type MMSAccessReference

type MMSAccessReference struct {
	Class MMSObjectClass
	Count int64
}

MMSAccessReference counts the objects of one class under an access control list.

type MMSAccessResult

type MMSAccessResult struct {
	Failed bool
	Error  MMSDataAccessError
	Data   MMSData
}

MMSAccessResult is one AccessResult: Data on success, or a DataAccessError when Failed is set.

type MMSAdditional

type MMSAdditional struct {
	Kind MMSAdditionalKind
	Data []byte

	ExtendedDerivation bool
	Status             *MMSVMDStatus
	Name               string
	Programs           []string
	Domains            []string
	StartCount         MMSStartCount
	Position           *MMSUnitPosition
	ExecutionArgument  string
	ExecutionExternal  *ISOPresentationPDV
	FileName           []string
	ThirdParty         *MMSApplicationReference
	Elements           []MMSControlElement
	MoreFollows        bool

	ListName        MMSObjectName
	Conditions      []MMSObjectName
	Lists           []MMSObjectName
	ContinueAfter   string
	ConditionStatus []MMSListedCondition
	Enabled         bool
	Priority        int64
	HasPriority     bool
	PriorityReset   bool
}

MMSAdditional is an additionalService request or response. Kind selects the service and Data keeps the raw value of its element:

ExtendedDerivation          vMDReset request
Status                      vMDReset response
Name                        the unit control of the UC services, the
                            program invocation of alterPI, the
                            controlling one of select
Programs                    select (controlled), create/addTo/
                            removeFromUC, getUCAttributes response
Domains                     create/addTo/removeFromUC, getUCAttributes
                            response
StartCount                  alterPI
Position                    uCUpload: continueAfter or nextElement
ExecutionArgument,
ExecutionExternal           startUC
FileName, ThirdParty        loadUCFromFile, storeUCToFile
Elements, MoreFollows       uCLoad and uCUpload responses
ListName                    the event condition list of the ECL
                            services
Conditions, Lists           defineECL, add/removeECLReference,
                            getECLAttributes response
ContinueAfter               reportECLStatus request
ConditionStatus,
MoreFollows                 reportECLStatus response
Enabled, Priority,
HasPriority, PriorityReset  alterECLMonitoring

type MMSAdditionalKind

type MMSAdditionalKind uint8

MMSAdditionalKind is the AdditionalService-Request/Response CHOICE tag.

const (
	MMSAddVMDStop            MMSAdditionalKind = 0
	MMSAddVMDReset           MMSAdditionalKind = 1
	MMSAddSelect             MMSAdditionalKind = 2
	MMSAddAlterPI            MMSAdditionalKind = 3
	MMSAddInitiateUCLoad     MMSAdditionalKind = 4
	MMSAddUCLoad             MMSAdditionalKind = 5
	MMSAddUCUpload           MMSAdditionalKind = 6
	MMSAddStartUC            MMSAdditionalKind = 7
	MMSAddStopUC             MMSAdditionalKind = 8
	MMSAddCreateUC           MMSAdditionalKind = 9
	MMSAddAddToUC            MMSAdditionalKind = 10
	MMSAddRemoveFromUC       MMSAdditionalKind = 11
	MMSAddGetUCAttributes    MMSAdditionalKind = 12
	MMSAddLoadUCFromFile     MMSAdditionalKind = 13
	MMSAddStoreUCToFile      MMSAdditionalKind = 14
	MMSAddDeleteUC           MMSAdditionalKind = 15
	MMSAddDefineECL          MMSAdditionalKind = 16
	MMSAddDeleteECL          MMSAdditionalKind = 17
	MMSAddAddECLReference    MMSAdditionalKind = 18
	MMSAddRemoveECLReference MMSAdditionalKind = 19
	MMSAddGetECLAttributes   MMSAdditionalKind = 20
	MMSAddReportECLStatus    MMSAdditionalKind = 21
	MMSAddAlterECLMonitoring MMSAdditionalKind = 22
)

Additional services. UC is a unit control, ECL an event condition list.

func (MMSAdditionalKind) String

func (k MMSAdditionalKind) String() string

String returns the ASN.1 name of the service.

type MMSAddress

type MMSAddress struct {
	Kind          MMSAddressKind
	Numeric       uint32
	Symbolic      string
	Unconstrained []byte
}

MMSAddress is a device specific variable Address.

type MMSAddressKind

type MMSAddressKind uint8

MMSAddressKind is the Address CHOICE tag.

const (
	MMSAddressNumeric       MMSAddressKind = 0
	MMSAddressSymbolic      MMSAddressKind = 1
	MMSAddressUnconstrained MMSAddressKind = 2
)

Address alternatives.

func (MMSAddressKind) String

func (k MMSAddressKind) String() string

String returns the ASN.1 name of the alternative.

type MMSAlarmAckRule

type MMSAlarmAckRule int64

MMSAlarmAckRule is an AlarmAckRule.

const (
	MMSAckNone      MMSAlarmAckRule = 0
	MMSAckSimple    MMSAlarmAckRule = 1
	MMSAckAckActive MMSAlarmAckRule = 2
	MMSAckAckAll    MMSAlarmAckRule = 3
)

Alarm acknowledgment rules.

func (MMSAlarmAckRule) String

func (r MMSAlarmAckRule) String() string

String returns the ASN.1 name of the rule.

type MMSAlarmEnrollment

type MMSAlarmEnrollment struct {
	EnrollmentName     MMSObjectName
	Client             *MMSApplicationReference
	Severity           uint8
	State              MMSEventState
	Enhancement        MMSEnhancement
	NotificationLost   bool
	AckRule            MMSAlarmAckRule
	HasAckRule         bool
	EnrollmentState    MMSEnrollmentState
	HasEnrollmentState bool
	ToActive           MMSEventTime
	HasToActive        bool
	ActiveAcked        MMSEventTime
	HasActiveAcked     bool
	ToIdle             MMSEventTime
	HasToIdle          bool
	IdleAcked          MMSEventTime
	HasIdleAcked       bool
}

MMSAlarmEnrollment is one AlarmEnrollmentSummary of a GetAlarmEnrollmentSummary-Response. Each Has field tells the value before it was present.

type MMSAlarmSummary

type MMSAlarmSummary struct {
	ConditionName  MMSObjectName
	Severity       uint8
	State          MMSEventState
	Unacknowledged MMSUnackedState
	Enhancement    MMSEnhancement
	ToActive       MMSEventTime
	HasToActive    bool
	ToIdle         MMSEventTime
	HasToIdle      bool
}

MMSAlarmSummary is one AlarmSummary of a GetAlarmSummary-Response.

type MMSAlarmSummaryRequest

type MMSAlarmSummaryRequest struct {
	EnrollmentsOnly  bool
	ActiveAlarmsOnly bool
	// AckFilter is 0 not-acked, 1 acked, 2 all.
	AckFilter         int64
	HasSeverityFilter bool
	MostSevere        uint8
	LeastSevere       uint8
	HasContinueAfter  bool
	ContinueAfter     MMSObjectName
}

MMSAlarmSummaryRequest is a GetAlarmSummary-Request.

type MMSAlarmSummaryResponse

type MMSAlarmSummaryResponse struct {
	Summaries   int
	List        []MMSAlarmSummary
	Enrollments []MMSAlarmEnrollment
	MoreFollows bool
}

MMSAlarmSummaryResponse is a GetAlarmSummary-Response (List) or a GetAlarmEnrollmentSummary-Response (Enrollments). Summaries counts the entries of either.

type MMSAltSelection

type MMSAltSelection uint8

MMSAltSelection is the accessSelection of an AlternateAccessSelection.

const (
	MMSAltComponent   MMSAltSelection = 0
	MMSAltIndex       MMSAltSelection = 1
	MMSAltIndexRange  MMSAltSelection = 2
	MMSAltAllElements MMSAltSelection = 3
)

Access selections.

func (MMSAltSelection) String

func (s MMSAltSelection) String() string

String returns the ASN.1 name of the selection.

type MMSAlternateAccess

type MMSAlternateAccess struct {
	// Named is set for the named alternative, whose name is Name.
	Named bool
	Name  string
	// Selection picks Component, Index, or Index and Count.
	Selection MMSAltSelection
	Component string
	// Index is the index, or the low index of an indexRange.
	Index uint32
	// Count is the numberOfElements of an indexRange.
	Count uint32
	// SelectAlternate is set for selectAlternateAccess: Nested then
	// applies within the selected part.
	SelectAlternate bool
	Nested          []MMSAlternateAccess
}

MMSAlternateAccess is one AlternateAccess entry: it selects a part of a variable, e.g. component "q" of a structure or elements 2..5 of an array.

type MMSApplicationReference

type MMSApplicationReference struct {
	Title ACSEAETitle
	Info  ACSEAEInfo
}

MMSApplicationReference is an ApplicationReference: the AE title and invocation identifiers of another application process, e.g. the owner of a semaphore or the client of an event enrollment.

type MMSAttachToEvent

type MMSAttachToEvent struct {
	EnrollmentName     MMSObjectName
	ConditionName      MMSObjectName
	Transitions        MMSTransitions
	AcceptableDelay    uint32
	HasAcceptableDelay bool
}

MMSAttachToEvent is an AttachToEventCondition modifier: the request runs when the event condition makes one of the transitions.

type MMSCSCondition

type MMSCSCondition struct {
	PriorityOverride    uint8
	HasPriorityOverride bool
	OverrideUndefined   bool
	Lists               []MMSObjectName
}

MMSCSCondition is the CS-GetEventConditionAttributes-Response detail; its displayEnhancement is MMSServiceExt.Enhancement.

type MMSCSObjectClass

type MMSCSObjectClass uint8

MMSCSObjectClass is the csObjectClass of the companion standards.

const (
	MMSClassEventConditionList MMSCSObjectClass = 0
	MMSClassUnitControl        MMSCSObjectClass = 1
)

Companion standard object classes.

func (MMSCSObjectClass) String

func (c MMSCSObjectClass) String() string

String returns the ASN.1 name of the class.

type MMSCSProgram

type MMSCSProgram struct {
	ErrorCode          int64
	Control            MMSControlState
	Controlled         []string
	ProgramLocation    string
	RunningMode        MMSStartCount
	ControllingProgram string
}

MMSCSProgram is the CS-GetProgramInvocationAttributes-Response detail. A controlling program invocation lists Controlled, ProgramLocation and RunningMode; a controlled one names ControllingProgram, if any.

type MMSCSStatus

type MMSCSStatus struct {
	// OperationState is 0 idle, 1 loaded, 2 ready, 3 executing, 4
	// motion-paused, 5 manualInterventionRequired.
	OperationState     int64
	ExtendedStatus     uint8
	ExtendedStatusMask uint8
	SelectedProgram    string
	HasSelectedProgram bool
}

MMSCSStatus is the CS-Status-Response detail of a status response. ExtendedStatus and ExtendedStatusMask hold four bits, most significant first: safetyInterlocksViolated, anyPhysicalResourcePowerOn, allPhysicalResourcesCalibrated, localControl.

type MMSCapabilityList

type MMSCapabilityList struct {
	ContinueAfter string
	Capabilities  []string
	MoreFollows   bool
}

MMSCapabilityList is a GetCapabilityList-Request (ContinueAfter) or -Response (Capabilities and MoreFollows).

type MMSConfirmedService

type MMSConfirmedService uint16

MMSConfirmedService is the ConfirmedServiceRequest/Response CHOICE tag.

const (
	MMSStatus                         MMSConfirmedService = 0
	MMSGetNameList                    MMSConfirmedService = 1
	MMSIdentify                       MMSConfirmedService = 2
	MMSRename                         MMSConfirmedService = 3
	MMSRead                           MMSConfirmedService = 4
	MMSWrite                          MMSConfirmedService = 5
	MMSGetVariableAccessAttributes    MMSConfirmedService = 6
	MMSDefineNamedVariable            MMSConfirmedService = 7
	MMSDefineScatteredAccess          MMSConfirmedService = 8
	MMSGetScatteredAccessAttributes   MMSConfirmedService = 9
	MMSDeleteVariableAccess           MMSConfirmedService = 10
	MMSDefineNamedVariableList        MMSConfirmedService = 11
	MMSGetNamedVariableListAttributes MMSConfirmedService = 12
	MMSDeleteNamedVariableList        MMSConfirmedService = 13
	MMSDefineNamedType                MMSConfirmedService = 14
	MMSGetNamedTypeAttributes         MMSConfirmedService = 15
	MMSDeleteNamedType                MMSConfirmedService = 16
	MMSInput                          MMSConfirmedService = 17
	MMSOutput                         MMSConfirmedService = 18
	MMSTakeControl                    MMSConfirmedService = 19
	MMSRelinquishControl              MMSConfirmedService = 20
	MMSDefineSemaphore                MMSConfirmedService = 21
	MMSDeleteSemaphore                MMSConfirmedService = 22
	MMSReportSemaphoreStatus          MMSConfirmedService = 23
	MMSReportPoolSemaphoreStatus      MMSConfirmedService = 24
	MMSReportSemaphoreEntryStatus     MMSConfirmedService = 25
	MMSInitiateDownloadSequence       MMSConfirmedService = 26
	MMSDownloadSegment                MMSConfirmedService = 27
	MMSTerminateDownloadSequence      MMSConfirmedService = 28
	MMSInitiateUploadSequence         MMSConfirmedService = 29
	MMSUploadSegment                  MMSConfirmedService = 30
	MMSTerminateUploadSequence        MMSConfirmedService = 31
	MMSRequestDomainDownload          MMSConfirmedService = 32
	MMSRequestDomainUpload            MMSConfirmedService = 33
	MMSLoadDomainContent              MMSConfirmedService = 34
	MMSStoreDomainContent             MMSConfirmedService = 35
	MMSDeleteDomain                   MMSConfirmedService = 36
	MMSGetDomainAttributes            MMSConfirmedService = 37
	MMSCreateProgramInvocation        MMSConfirmedService = 38
	MMSDeleteProgramInvocation        MMSConfirmedService = 39
	MMSStart                          MMSConfirmedService = 40
	MMSStop                           MMSConfirmedService = 41
	MMSResume                         MMSConfirmedService = 42
	MMSReset                          MMSConfirmedService = 43
	MMSKill                           MMSConfirmedService = 44
	MMSGetProgramInvocationAttributes MMSConfirmedService = 45
	MMSObtainFile                     MMSConfirmedService = 46
	MMSDefineEventCondition           MMSConfirmedService = 47
	MMSDeleteEventCondition           MMSConfirmedService = 48
	MMSGetEventConditionAttributes    MMSConfirmedService = 49
	MMSReportEventConditionStatus     MMSConfirmedService = 50
	MMSAlterEventConditionMonitoring  MMSConfirmedService = 51
	MMSTriggerEvent                   MMSConfirmedService = 52
	MMSDefineEventAction              MMSConfirmedService = 53
	MMSDeleteEventAction              MMSConfirmedService = 54
	MMSGetEventActionAttributes       MMSConfirmedService = 55
	MMSReportEventActionStatus        MMSConfirmedService = 56
	MMSDefineEventEnrollment          MMSConfirmedService = 57
	MMSDeleteEventEnrollment          MMSConfirmedService = 58
	MMSAlterEventEnrollment           MMSConfirmedService = 59
	MMSReportEventEnrollmentStatus    MMSConfirmedService = 60
	MMSGetEventEnrollmentAttributes   MMSConfirmedService = 61
	MMSAcknowledgeEventNotification   MMSConfirmedService = 62
	MMSGetAlarmSummary                MMSConfirmedService = 63
	MMSGetAlarmEnrollmentSummary      MMSConfirmedService = 64
	MMSReadJournal                    MMSConfirmedService = 65
	MMSWriteJournal                   MMSConfirmedService = 66
	MMSInitializeJournal              MMSConfirmedService = 67
	MMSReportJournalStatus            MMSConfirmedService = 68
	MMSCreateJournal                  MMSConfirmedService = 69
	MMSDeleteJournal                  MMSConfirmedService = 70
	MMSGetCapabilityList              MMSConfirmedService = 71
	MMSFileOpen                       MMSConfirmedService = 72
	MMSFileRead                       MMSConfirmedService = 73
	MMSFileClose                      MMSConfirmedService = 74
	MMSFileRename                     MMSConfirmedService = 75
	MMSFileDelete                     MMSConfirmedService = 76
	MMSFileDirectory                  MMSConfirmedService = 77
)

Confirmed services (ISO 9506-2 clause 7).

const (
	MMSAdditionalService              MMSConfirmedService = 78
	MMSGetDataExchangeAttributes      MMSConfirmedService = 80
	MMSExchangeData                   MMSConfirmedService = 81
	MMSDefineAccessControlList        MMSConfirmedService = 82
	MMSGetAccessControlListAttributes MMSConfirmedService = 83
	MMSReportAccessControlledObjects  MMSConfirmedService = 84
	MMSDeleteAccessControlList        MMSConfirmedService = 85
	MMSChangeAccessControl            MMSConfirmedService = 86
)

Confirmed services added by ISO 9506-2:2003. Tag 79 is reserved for the service-ext detail, see MMSServiceExt.

func (MMSConfirmedService) String

func (s MMSConfirmedService) String() string

String returns the ASN.1 name of the service.

type MMSControlElement

type MMSControlElement struct {
	Kind         MMSControlElementKind
	Name         string
	Capabilities []string
	Sharable     bool
	Load         *MMSLoadData

	Domains    []string
	Reusable   bool
	Monitor    bool
	HasMonitor bool
	State      MMSProgramState
	HasState   bool
}

MMSControlElement is one piece of a unit control being loaded or uploaded: the start, continuation or end of a domain, or a program invocation. Name is the domain or program invocation name.

type MMSControlElementKind

type MMSControlElementKind uint8

MMSControlElementKind is the ControlElement CHOICE tag.

const (
	MMSElementBeginDomain    MMSControlElementKind = 0
	MMSElementContinueDomain MMSControlElementKind = 1
	MMSElementEndDomain      MMSControlElementKind = 2
	MMSElementProgram        MMSControlElementKind = 3
)

Control element alternatives.

func (MMSControlElementKind) String

func (k MMSControlElementKind) String() string

String returns the ASN.1 name of the alternative.

type MMSControlState

type MMSControlState int64

MMSControlState is the Control-State of a program invocation.

const (
	MMSControlNormal      MMSControlState = 0
	MMSControlControlling MMSControlState = 1
	MMSControlControlled  MMSControlState = 2
)

Control states.

func (MMSControlState) String

func (s MMSControlState) String() string

String returns the ASN.1 name of the state.

type MMSData

type MMSData struct {
	Type MMSDataType
	Raw  []byte

	// Bool is set for boolean.
	Bool bool
	// IntOverflow is set for an integer, unsigned or bcd value too long
	// for Int or Uint, which then stay 0; BigInt returns its value.
	IntOverflow bool
	// Int is set for integer and bcd.
	Int int64
	// Uint is set for unsigned.
	Uint uint64
	// Float is set for floating-point and real.
	Float float64
	// Bits and UnusedBits are set for bit-string and booleanArray.
	Bits       []byte
	UnusedBits uint8
	// String is set for visible-string, mMSString, generalized-time and
	// objId (dotted form). GeneralizedTime parses a generalized-time.
	String string
	// Time is set for binary-time. A 4 octet TimeOfDay carries no date
	// and is reported on 1984-01-01.
	Time time.Time
	// UTC is set for utc-time.
	UTC MMSUTCTime
	// Items holds the members of an array or structure.
	Items []MMSData
}

MMSData is one decoded MMS Data value. Type selects which field holds the value; Raw always holds the encoded value octets.

func (*MMSData) BCD

func (d *MMSData) BCD() (n int64, ok bool)

BCD returns the value of a bcd, which is encoded as an INTEGER; ok is false for other types and for a value too long for an int64.

func (*MMSData) BigInt

func (d *MMSData) BigInt() *big.Int

BigInt returns the value of an integer, unsigned or bcd of any length, or nil for other types.

func (*MMSData) Bit

func (d *MMSData) Bit(i int) bool

Bit returns bit i (0 = most significant bit of the first octet) of a bit-string or booleanArray, or false when i is out of range.

func (*MMSData) BitLen

func (d *MMSData) BitLen() int

BitLen returns the number of bits of a bit-string or booleanArray.

func (*MMSData) GeneralizedTime

func (d *MMSData) GeneralizedTime() (t time.Time, ok bool)

GeneralizedTime parses a generalized-time value, e.g. "20260102030405.5Z" or "202601020304+0100". A local time, one without "Z" or offset, is returned as UTC. ok is false for another Data type or a string that is no GeneralizedTime; a fraction of an hour or of a minute is not read.

func (*MMSData) Octets

func (d *MMSData) Octets() []byte

Octets returns the value of an octet-string, nil for other types.

type MMSDataAccessError

type MMSDataAccessError uint8

MMSDataAccessError is the DataAccessError of a failed read or write.

const (
	MMSObjectInvalidated           MMSDataAccessError = 0
	MMSHardwareFault               MMSDataAccessError = 1
	MMSTemporarilyUnavailable      MMSDataAccessError = 2
	MMSObjectAccessDenied          MMSDataAccessError = 3
	MMSObjectUndefined             MMSDataAccessError = 4
	MMSInvalidAddress              MMSDataAccessError = 5
	MMSTypeUnsupported             MMSDataAccessError = 6
	MMSTypeInconsistent            MMSDataAccessError = 7
	MMSObjectAttributeInconsistent MMSDataAccessError = 8
	MMSObjectAccessUnsupported     MMSDataAccessError = 9
	MMSObjectNonExistent           MMSDataAccessError = 10
	MMSObjectValueInvalid          MMSDataAccessError = 11
)

Data access errors.

func (MMSDataAccessError) String

func (e MMSDataAccessError) String() string

String returns the ASN.1 name of the error.

type MMSDataExchange

type MMSDataExchange struct {
	Name              MMSObjectName
	Data              []MMSData
	InUse             bool
	RequestTypes      []MMSTypeSpec
	ResponseTypes     []MMSTypeSpec
	ProgramInvocation string
	AccessControlList string
}

MMSDataExchange holds the data exchange services of ISO 9506-2:2003:

Name, Data                         exchangeData request
Data                               exchangeData response
InUse .. AccessControlList         getDataExchangeAttributes response

type MMSDataType

type MMSDataType uint8

MMSDataType is the CHOICE tag of an MMS Data value (ISO 9506-2). GOOSE allData and MMS read, write and report values all use this type.

const (
	MMSDataArray           MMSDataType = 1
	MMSDataStructure       MMSDataType = 2
	MMSDataBoolean         MMSDataType = 3
	MMSDataBitString       MMSDataType = 4
	MMSDataInteger         MMSDataType = 5
	MMSDataUnsigned        MMSDataType = 6
	MMSDataFloatingPoint   MMSDataType = 7
	MMSDataReal            MMSDataType = 8
	MMSDataOctetString     MMSDataType = 9
	MMSDataVisibleString   MMSDataType = 10
	MMSDataGeneralizedTime MMSDataType = 11
	MMSDataBinaryTime      MMSDataType = 12
	MMSDataBCD             MMSDataType = 13
	MMSDataBooleanArray    MMSDataType = 14
	MMSDataObjID           MMSDataType = 15
	MMSDataMMSString       MMSDataType = 16
	MMSDataUTCTime         MMSDataType = 17
)

MMS Data CHOICE tags. MMSDataReal is the ASN.1 REAL of ISO 9506-2:1990, a tag the 2003 edition reserves.

func (MMSDataType) String

func (t MMSDataType) String() string

String returns the ASN.1 name of the Data alternative.

type MMSDeleteRequest

type MMSDeleteRequest struct {
	Scope MMSDeleteScope
	Names []MMSObjectName
	// DomainID is set for the domain scope.
	DomainID string
}

MMSDeleteRequest is a DeleteNamedVariableList-Request or a DeleteVariableAccess-Request.

type MMSDeleteResponse

type MMSDeleteResponse struct {
	Matched uint32
	Deleted uint32
}

MMSDeleteResponse is a DeleteNamedVariableList-Response or a DeleteVariableAccess-Response.

type MMSDeleteScope

type MMSDeleteScope int64

MMSDeleteScope is the scopeOfDelete of a delete request.

const (
	MMSDeleteScopeSpecific MMSDeleteScope = 0
	MMSDeleteScopeAA       MMSDeleteScope = 1
	MMSDeleteScopeDomain   MMSDeleteScope = 2
	MMSDeleteScopeVMD      MMSDeleteScope = 3
)

Delete scopes.

func (MMSDeleteScope) String

func (s MMSDeleteScope) String() string

String returns the ASN.1 name of the scope.

type MMSDirectoryEntry

type MMSDirectoryEntry struct {
	FileName   []string
	Attributes MMSFileAttributes
}

MMSDirectoryEntry is one fileDirectory entry.

type MMSDomainRequest

type MMSDomainRequest struct {
	DomainName   string
	Capabilities []string
	Sharable     bool
	Discard      *MMSServiceError
	ULSMID       int32
	FileName     []string
	ThirdParty   *MMSApplicationReference
}

MMSDomainRequest holds the arguments of the domain management and upload/download requests:

DomainName    deleteDomain, getDomainAttributes, initiateUploadSequence,
              downloadSegment, initiate/terminateDownloadSequence
Capabilities  initiateDownloadSequence
Sharable      initiateDownloadSequence
Discard       terminateDownloadSequence, when the download failed
ULSMID        uploadSegment, terminateUploadSequence

requestDomainDownload and loadDomainContent fill DomainName, Capabilities, Sharable and FileName; requestDomainUpload and storeDomainContent DomainName and FileName. ThirdParty is set for loadDomainContent and storeDomainContent only.

type MMSDomainResponse

type MMSDomainResponse struct {
	Capabilities       []string
	State              MMSDomainState
	Deletable          bool
	Sharable           bool
	ProgramInvocations []string
	UploadInProgress   int64

	ULSMID int32

	LoadData    []byte
	Coded       bool
	LoadKind    MMSLoadDataKind
	External    *ISOPresentationPDV
	MoreFollows bool
}

MMSDomainResponse holds a getDomainAttributes, initiateUploadSequence, downloadSegment or uploadSegment response. Segment data stays raw in LoadData; Coded tells it is an EXTERNAL rather than non-coded octets. LoadKind tells the loadData alternative and External is the decoded EXTERNAL of coded data, nil when it is malformed.

type MMSDomainState

type MMSDomainState int64

MMSDomainState is the state of a domain.

const (
	MMSDomainNonExistent MMSDomainState = 0
	MMSDomainLoading     MMSDomainState = 1
	MMSDomainReady       MMSDomainState = 2
	MMSDomainInUse       MMSDomainState = 3
	MMSDomainComplete    MMSDomainState = 4
	MMSDomainIncomplete  MMSDomainState = 5
)

Domain states; d1 to d9 (7 to 15) are transitional.

func (MMSDomainState) String

func (s MMSDomainState) String() string

String returns the ASN.1 name of the state.

type MMSEnhancement

type MMSEnhancement struct {
	Kind   MMSEnhancementKind
	String string
	Index  int64
}

MMSEnhancement is the display enhancement the companion standards add to events: a text or an index into a table of texts.

type MMSEnhancementKind

type MMSEnhancementKind uint8

MMSEnhancementKind tells what a display enhancement holds.

const (
	MMSEnhancementNone MMSEnhancementKind = iota
	MMSEnhancementString
	MMSEnhancementIndex
)

Display enhancement alternatives.

func (MMSEnhancementKind) String

func (k MMSEnhancementKind) String() string

String returns the ASN.1 name of the alternative.

type MMSEnrollmentClass

type MMSEnrollmentClass int64

MMSEnrollmentClass is an EE-Class.

const (
	MMSEnrollmentModifier     MMSEnrollmentClass = 0
	MMSEnrollmentNotification MMSEnrollmentClass = 1
)

Event enrollment classes.

func (MMSEnrollmentClass) String

func (c MMSEnrollmentClass) String() string

String returns the ASN.1 name of the class.

type MMSEnrollmentDuration

type MMSEnrollmentDuration int64

MMSEnrollmentDuration is an EE-Duration.

const (
	MMSEnrollmentCurrent   MMSEnrollmentDuration = 0
	MMSEnrollmentPermanent MMSEnrollmentDuration = 1
)

Event enrollment durations.

func (MMSEnrollmentDuration) String

func (d MMSEnrollmentDuration) String() string

String returns the ASN.1 name of the duration.

type MMSEnrollmentList

type MMSEnrollmentList struct {
	Enrollments []MMSEventEnrollment
	MoreFollows bool
}

MMSEnrollmentList is a GetEventEnrollmentAttributes-Response.

type MMSEnrollmentQuery

type MMSEnrollmentQuery struct {
	Scope            MMSEnrollmentScope
	Names            []MMSObjectName
	Client           *MMSApplicationReference
	ConditionName    MMSObjectName
	HasCondition     bool
	ActionName       MMSObjectName
	HasAction        bool
	ContinueAfter    MMSObjectName
	HasContinueAfter bool
}

MMSEnrollmentQuery is a GetEventEnrollmentAttributes-Request. Scope defaults to client.

type MMSEnrollmentScope

type MMSEnrollmentScope int64

MMSEnrollmentScope is the scopeOfRequest of a getEventEnrollmentAttributes request.

const (
	MMSEnrollmentScopeSpecific  MMSEnrollmentScope = 0
	MMSEnrollmentScopeClient    MMSEnrollmentScope = 1
	MMSEnrollmentScopeCondition MMSEnrollmentScope = 2
	MMSEnrollmentScopeAction    MMSEnrollmentScope = 3
)

Enrollment request scopes.

func (MMSEnrollmentScope) String

func (s MMSEnrollmentScope) String() string

String returns the ASN.1 name of the scope.

type MMSEnrollmentState

type MMSEnrollmentState int64

MMSEnrollmentState is an EE-State.

const (
	MMSEnrollmentDisabled     MMSEnrollmentState = 0
	MMSEnrollmentIdle         MMSEnrollmentState = 1
	MMSEnrollmentActive       MMSEnrollmentState = 2
	MMSEnrollmentActiveNoAckA MMSEnrollmentState = 3
	MMSEnrollmentIdleNoAckI   MMSEnrollmentState = 4
	MMSEnrollmentIdleNoAckA   MMSEnrollmentState = 5
	MMSEnrollmentIdleAcked    MMSEnrollmentState = 6
	MMSEnrollmentActiveAcked  MMSEnrollmentState = 7
	MMSEnrollmentUndefined    MMSEnrollmentState = 8
)

Event enrollment states.

func (MMSEnrollmentState) String

func (s MMSEnrollmentState) String() string

String returns the ASN.1 name of the state.

type MMSEnrollmentStatus

type MMSEnrollmentStatus struct {
	Transitions      MMSTransitions
	NotificationLost bool
	Duration         MMSEnrollmentDuration
	AckRule          MMSAlarmAckRule
	HasAckRule       bool
	State            MMSEnrollmentState
	StateUndefined   bool
	TransitionTime   MMSEventTime
}

MMSEnrollmentStatus is a ReportEventEnrollmentStatus-Response (Transitions to State) or an AlterEventEnrollment-Response (State, StateUndefined and TransitionTime).

type MMSErrorClass

type MMSErrorClass uint8

MMSErrorClass is the ServiceError errorClass CHOICE tag.

const (
	MMSErrorVMDState       MMSErrorClass = 0
	MMSErrorAppReference   MMSErrorClass = 1
	MMSErrorDefinition     MMSErrorClass = 2
	MMSErrorResource       MMSErrorClass = 3
	MMSErrorService        MMSErrorClass = 4
	MMSErrorServicePreempt MMSErrorClass = 5
	MMSErrorTimeResolution MMSErrorClass = 6
	MMSErrorAccess         MMSErrorClass = 7
	MMSErrorInitiate       MMSErrorClass = 8
	MMSErrorConclude       MMSErrorClass = 9
	MMSErrorCancel         MMSErrorClass = 10
	MMSErrorFile           MMSErrorClass = 11
	MMSErrorOthers         MMSErrorClass = 12
)

Service error classes.

func (MMSErrorClass) String

func (c MMSErrorClass) String() string

String returns the ASN.1 name of the class.

type MMSErrorDetail

type MMSErrorDetail struct {
	Kind  MMSErrorDetailKind
	Value int64
	Name  MMSObjectName
	Raw   []byte
}

MMSErrorDetail is the serviceSpecificInformation of a ServiceError. Value holds the INTEGER alternatives: a ProgramInvocationState for start to reset, a number deleted for the delete services, 0 source or 1 destination file for obtainFile and fileRename. Name is set for defineEventEnrollment-Error. Raw is the element value.

type MMSErrorDetailKind

type MMSErrorDetailKind uint8

MMSErrorDetailKind is the serviceSpecificInformation CHOICE tag of a ServiceError.

const (
	MMSErrDetailObtainFile          MMSErrorDetailKind = 0
	MMSErrDetailStart               MMSErrorDetailKind = 1
	MMSErrDetailStop                MMSErrorDetailKind = 2
	MMSErrDetailResume              MMSErrorDetailKind = 3
	MMSErrDetailReset               MMSErrorDetailKind = 4
	MMSErrDetailDeleteVariable      MMSErrorDetailKind = 5
	MMSErrDetailDeleteNVL           MMSErrorDetailKind = 6
	MMSErrDetailDeleteNamedType     MMSErrorDetailKind = 7
	MMSErrDetailDefineEnrollment    MMSErrorDetailKind = 8
	MMSErrDetailFileRename          MMSErrorDetailKind = 9
	MMSErrDetailAdditionalService   MMSErrorDetailKind = 10
	MMSErrDetailChangeAccessControl MMSErrorDetailKind = 11
)

Service specific error alternatives.

func (MMSErrorDetailKind) String

func (k MMSErrorDetailKind) String() string

String returns the ASN.1 name of the alternative.

type MMSEventAck

type MMSEventAck struct {
	EnrollmentName MMSObjectName
	State          MMSEventState
	Time           MMSEventTime
}

MMSEventAck is an AcknowledgeEventNotification-Request.

type MMSEventAction

type MMSEventAction struct {
	Name              MMSObjectName
	Deletable         bool
	Modifiers         []MMSModifier
	HasService        bool
	Service           MMSConfirmedService
	ServiceData       []byte
	Ext               *MMSServiceExt
	AccessControlList string
	// contains filtered or unexported fields
}

MMSEventAction is a DefineEventAction-Request (Name) or a GetEventActionAttributes-Response (Deletable): the confirmed service request an event runs, with its modifiers.

Service is the request's service and ServiceData its raw service element value; Request decodes it. Ext is the request's service-ext detail.

func (*MMSEventAction) Request

func (a *MMSEventAction) Request() (*MMS, error)

Request decodes the confirmed service request of the action as a confirmed-RequestPDU without invokeID.

type MMSEventActionStatus

type MMSEventActionStatus struct {
	Enrollments uint32
}

MMSEventActionStatus is a ReportEventActionStatus-Response.

type MMSEventAlter

type MMSEventAlter struct {
	Name                   MMSObjectName
	Enabled                bool
	HasEnabled             bool
	Priority               uint8
	HasPriority            bool
	AlarmSummaryReports    bool
	HasAlarmSummaryReports bool
	EvaluationInterval     uint32
	HasEvaluationInterval  bool
}

MMSEventAlter is an AlterEventConditionMonitoring-Request or a TriggerEvent-Request (Name and Priority only). Each Has field tells the value before it was present.

type MMSEventClass

type MMSEventClass int64

MMSEventClass is an EC-Class.

const (
	MMSEventNetworkTriggered MMSEventClass = 0
	MMSEventMonitored        MMSEventClass = 1
)

Event condition classes.

func (MMSEventClass) String

func (c MMSEventClass) String() string

String returns the ASN.1 name of the class.

type MMSEventCondition

type MMSEventCondition struct {
	Name                MMSObjectName
	Deletable           bool
	Class               MMSEventClass
	Priority            uint8
	Severity            uint8
	AlarmSummaryReports bool
	// Monitored is the monitoredVariable; MonitoredUndefined is set when
	// a response reports it undefined.
	Monitored             *MMSVariable
	MonitoredUndefined    bool
	EvaluationInterval    uint32
	HasEvaluationInterval bool
}

MMSEventCondition is a DefineEventCondition-Request (Name and the definition) or a GetEventConditionAttributes-Response (Deletable and the definition).

type MMSEventConditionStatus

type MMSEventConditionStatus struct {
	State       MMSEventState
	Enrollments uint32
	Enabled     bool
	HasEnabled  bool
	// ToActive and ToIdle are the last transition times; HasToActive and
	// HasToIdle tell they were present.
	ToActive    MMSEventTime
	HasToActive bool
	ToIdle      MMSEventTime
	HasToIdle   bool
}

MMSEventConditionStatus is a ReportEventConditionStatus-Response.

type MMSEventDeleteRequest

type MMSEventDeleteRequest struct {
	Scope    MMSEventDeleteScope
	Names    []MMSObjectName
	DomainID string
	Name     MMSObjectName
}

MMSEventDeleteRequest is a DeleteEventCondition-, DeleteEventAction- or DeleteEventEnrollment-Request: Names for the specific scope, DomainID for domain, Name for an event condition or action.

type MMSEventDeleteResponse

type MMSEventDeleteResponse struct {
	NotDeleted uint32
}

MMSEventDeleteResponse is the response to them: how many candidates were not deleted.

type MMSEventDeleteScope

type MMSEventDeleteScope uint8

MMSEventDeleteScope is the CHOICE of a delete event condition, action or enrollment request.

const (
	MMSEventDeleteSpecific MMSEventDeleteScope = iota
	MMSEventDeleteAA
	MMSEventDeleteDomain
	MMSEventDeleteVMD
	MMSEventDeleteCondition
	MMSEventDeleteAction
)

Event delete scopes. Condition and Action only apply to event enrollments: every enrollment of that condition or action.

func (MMSEventDeleteScope) String

func (s MMSEventDeleteScope) String() string

String returns the ASN.1 name of the scope.

type MMSEventEnrollment

type MMSEventEnrollment struct {
	Name               MMSObjectName
	ConditionName      MMSObjectName
	ConditionUndefined bool
	Transitions        MMSTransitions
	HasTransitions     bool
	AckRule            MMSAlarmAckRule
	HasAckRule         bool
	ActionName         MMSObjectName
	HasAction          bool
	ActionUndefined    bool
	// Client is the clientApplication, nil when absent or malformed.
	Client *MMSApplicationReference

	Deletable         bool
	Class             MMSEnrollmentClass
	Duration          MMSEnrollmentDuration
	InvokeID          uint32
	HasInvokeID       bool
	RemainingDelay    uint32
	HasRemainingDelay bool
	Enhancement       MMSEnhancement
}

MMSEventEnrollment describes an event enrollment. It is a DefineEventEnrollment-Request, an AlterEventEnrollment-Request (Name, Transitions and AckRule) or one entry of a GetEventEnrollmentAttributes-Response, which adds the fields from Deletable on and may report the condition or action undefined.

type MMSEventNotification

type MMSEventNotification struct {
	EnrollmentName MMSObjectName
	// ConditionName is the event condition, unless ConditionUndefined.
	ConditionName      MMSObjectName
	ConditionUndefined bool
	Severity           uint8
	State              MMSEventState
	HasState           bool
	TransitionTime     MMSEventTime
	NotificationLost   bool
	AckRule            MMSAlarmAckRule
	HasAckRule         bool
	// HasAction is set when an action result is attached: ActionName, and
	// the raw ConfirmedServiceResponse of a successful action or the
	// ServiceError of a failed one.
	HasAction      bool
	ActionName     MMSObjectName
	ActionResponse []byte
	ActionError    *MMSServiceError
	// ModifierPosition tells which modifier of the action failed (ISO
	// 9506-2:2003).
	ModifierPosition    uint32
	HasModifierPosition bool
}

MMSEventNotification is an EventNotification.

func (*MMSEventNotification) Response

func (e *MMSEventNotification) Response() (*MMS, error)

Response decodes the ConfirmedServiceResponse of a successful action, kept raw in ActionResponse, as a confirmed-ResponsePDU without invokeID.

type MMSEventState

type MMSEventState int64

MMSEventState is an EC-State.

const (
	MMSEventDisabled MMSEventState = 0
	MMSEventIdle     MMSEventState = 1
	MMSEventActive   MMSEventState = 2
)

Event condition states.

func (MMSEventState) String

func (s MMSEventState) String() string

String returns the ASN.1 name of the state.

type MMSEventTime

type MMSEventTime struct {
	Kind     MMSEventTimeKind
	Time     time.Time
	Sequence uint32
}

MMSEventTime is an EventTime: a TimeOfDay (see MMSData.Time) or a time sequence identifier.

type MMSEventTimeKind

type MMSEventTimeKind uint8

MMSEventTimeKind is the EventTime CHOICE tag.

const (
	MMSEventTimeOfDay    MMSEventTimeKind = 0
	MMSEventTimeSequence MMSEventTimeKind = 1
	MMSEventTimeUndef    MMSEventTimeKind = 2
)

EventTime alternatives.

func (MMSEventTimeKind) String

func (k MMSEventTimeKind) String() string

String returns the ASN.1 name of the alternative.

type MMSFileAttributes

type MMSFileAttributes struct {
	Size         uint32
	LastModified string
}

MMSFileAttributes is FileAttributes. LastModified is the raw GeneralizedTime, e.g. "20231005120000.000Z", empty when absent.

type MMSFileRequest

type MMSFileRequest struct {
	FileName        []string
	NewFileName     []string
	InitialPosition uint32
	FRSMID          int32
	ContinueAfter   []string
}

MMSFileRequest holds the arguments of the file service requests:

FileName         fileOpen, fileDelete, fileDirectory (fileSpecification),
                 fileRename (current name), obtainFile (source file)
NewFileName      fileRename, obtainFile (destination file)
InitialPosition  fileOpen
FRSMID           fileRead, fileClose
ContinueAfter    fileDirectory

A file name is a list of GraphicString parts, e.g. {"/COMTRADE/a.cfg"}.

type MMSFileResponse

type MMSFileResponse struct {
	FRSMID      int32
	Attributes  MMSFileAttributes
	Data        []byte
	MoreFollows bool
	Entries     []MMSDirectoryEntry
}

MMSFileResponse holds a fileOpen (FRSMID, Attributes), fileRead (Data, MoreFollows) or fileDirectory (Entries, MoreFollows) response. MoreFollows defaults to true for fileRead and false for fileDirectory.

type MMSGetNameListRequest

type MMSGetNameListRequest struct {
	ObjectClass   MMSObjectClass
	Scope         MMSObjectScope
	DomainID      string
	ContinueAfter string

	// CSObjectClass is set, with HasCSObjectClass, when the request names
	// a companion standard class instead of ObjectClass.
	CSObjectClass    MMSCSObjectClass
	HasCSObjectClass bool
}

MMSGetNameListRequest is a GetNameList-Request. DomainID is set for the domain-specific scope.

type MMSGetNameListResponse

type MMSGetNameListResponse struct {
	Identifiers []string
	MoreFollows bool
}

MMSGetNameListResponse is a GetNameList-Response.

type MMSIdentifyResponse

type MMSIdentifyResponse struct {
	Vendor           string
	Model            string
	Revision         string
	AbstractSyntaxes []string
}

MMSIdentifyResponse is an Identify-Response.

type MMSInformationReport

type MMSInformationReport struct {
	Access  MMSVariableAccess
	Results []MMSAccessResult
}

MMSInformationReport is an InformationReport. IEC 61850 reports use a variableListName of "RPT" and put the report fields in Results.

type MMSInitiate

type MMSInitiate struct {
	LocalDetail               int64
	HasLocalDetail            bool
	MaxServOutstandingCalling int64
	MaxServOutstandingCalled  int64
	NestingLevel              int64
	HasNestingLevel           bool
	Version                   int64
	// ParameterCBB and ServicesSupported are bit strings; services bit n
	// is MMSConfirmedService n (bits 78 and up are unconfirmed services,
	// conclude and cancel).
	ParameterCBB      []byte
	ServicesSupported []byte

	// AdditionalSupported, AdditionalCBB and PrivilegeClass are the ISO
	// 9506-2:2003 detail: additional services bit n is
	// MMSAdditionalKind n, the CBB bits are des, dei and recl.
	AdditionalSupported []byte
	AdditionalCBB       []byte
	PrivilegeClass      string
	// contains filtered or unexported fields
}

MMSInitiate holds an Initiate-Request or Initiate-Response: proposed values in a request, negotiated values in a response.

func (*MMSInitiate) SupportsService

func (in *MMSInitiate) SupportsService(s MMSConfirmedService) bool

SupportsService reports whether the services supported bit string announces the confirmed service s.

type MMSJournalContent

type MMSJournalContent struct {
	OccurrenceTime time.Time
	Form           MMSJournalForm
	HasEvent       bool
	EventCondition MMSObjectName
	EventState     MMSEventState
	Variables      []MMSJournalVariable
	Annotation     string
	// AdditionalDetail is the raw companion standard detail.
	AdditionalDetail []byte
}

MMSJournalContent is an EntryContent. A data entry holds an event transition (HasEvent), variable values or both; an annotation entry holds a text.

type MMSJournalEntry

type MMSJournalEntry struct {
	ID          []byte
	Application *MMSApplicationReference
	Content     MMSJournalContent
}

MMSJournalEntry is one JournalEntry of a ReadJournal-Response. Application is nil when malformed.

type MMSJournalForm

type MMSJournalForm uint8

MMSJournalForm is the entryForm CHOICE of a journal entry.

const (
	MMSJournalData MMSJournalForm = iota
	MMSJournalAnnotation
)

Journal entry forms.

func (MMSJournalForm) String

func (f MMSJournalForm) String() string

String returns the ASN.1 name of the form.

type MMSJournalPosition

type MMSJournalPosition struct {
	HasTime bool
	Time    time.Time
	Entry   []byte
}

MMSJournalPosition is a point in a journal: a time, an entry identifier, or both. Entry is nil when absent.

type MMSJournalRequest

type MMSJournalRequest struct {
	Name    MMSObjectName
	Entries int

	Start         *MMSJournalPosition
	Stop          *MMSJournalPosition
	EntryCount    int32
	HasEntryCount bool
	Variables     []string
	After         *MMSJournalPosition

	Content []MMSJournalContent

	Limit *MMSJournalPosition
}

MMSJournalRequest holds the arguments of the journal requests. Name is always set:

Start, Stop, EntryCount, Variables, After   readJournal
Entries, Content                            writeJournal
Limit                                       initializeJournal

Start is the rangeStartSpecification (a time or an entry), Stop the endingTime and EntryCount the numberOfEntries of the rangeStopSpecification, After the entryToStartAfter and Limit the limitSpecification. Entries counts Content.

type MMSJournalResponse

type MMSJournalResponse struct {
	Entries           int
	List              []MMSJournalEntry
	MoreFollows       bool
	CurrentEntries    uint32
	Deletable         bool
	AccessControlList string
	Deleted           uint32
}

MMSJournalResponse is a ReadJournal-Response (Entries, List, MoreFollows), a ReportJournalStatus-Response (CurrentEntries, Deletable, AccessControlList) or an InitializeJournal-Response (Deleted). Entries counts List.

type MMSJournalVariable

type MMSJournalVariable struct {
	Tag   string
	Value MMSData
}

MMSJournalVariable is one logged variable: its tag and value.

type MMSListedCondition

type MMSListedCondition struct {
	Name   MMSObjectName
	Status MMSEventConditionStatus
}

MMSListedCondition is the status of one event condition of an event condition list.

type MMSLoadData

type MMSLoadData struct {
	Kind     MMSLoadDataKind
	Data     []byte
	External *ISOPresentationPDV
}

MMSLoadData is the content of a domain: non-coded octets, a coded EXTERNAL (also decoded in External) or an EMBEDDED PDV. Data is the value of the element.

type MMSLoadDataKind

type MMSLoadDataKind uint8

MMSLoadDataKind is the LoadData CHOICE alternative.

const (
	MMSLoadNonCoded MMSLoadDataKind = iota
	MMSLoadCoded
	MMSLoadEmbedded
)

LoadData alternatives.

func (MMSLoadDataKind) String

func (k MMSLoadDataKind) String() string

String returns the ASN.1 name of the alternative.

type MMSLogicalStatus

type MMSLogicalStatus int64

MMSLogicalStatus is the vmdLogicalStatus of a Status-Response.

const (
	MMSStateChangesAllowed   MMSLogicalStatus = 0
	MMSNoStateChangesAllowed MMSLogicalStatus = 1
	MMSLimitedServices       MMSLogicalStatus = 2
	MMSSupportServices       MMSLogicalStatus = 3
)

VMD logical states.

func (MMSLogicalStatus) String

func (s MMSLogicalStatus) String() string

String returns the ASN.1 name of the state.

type MMSModifier

type MMSModifier struct {
	Kind      MMSModifierKind
	Event     *MMSAttachToEvent
	Semaphore *MMSSemaphoreRequest
}

MMSModifier is one Modifier of a confirmed request or event action. Kind selects Event or Semaphore.

type MMSModifierKind

type MMSModifierKind uint8

MMSModifierKind is the Modifier CHOICE tag.

const (
	MMSModifierEvent     MMSModifierKind = 0
	MMSModifierSemaphore MMSModifierKind = 1
)

Modifier alternatives.

func (MMSModifierKind) String

func (k MMSModifierKind) String() string

String returns the ASN.1 name of the alternative.

type MMSNamedToken

type MMSNamedToken struct {
	State MMSTokenState
	Name  string
}

MMSNamedToken is one named token of a pool semaphore.

type MMSNamedType

type MMSNamedType struct {
	Name              MMSObjectName
	Deletable         bool
	Type              MMSTypeSpec
	AccessControlList string
	Meaning           string
}

MMSNamedType is a DefineNamedType-Request (Name and Type) or a GetNamedTypeAttributes-Response (Deletable, Type, AccessControlList and Meaning).

type MMSNamedVariable

type MMSNamedVariable struct {
	Name    MMSObjectName
	Address MMSAddress
	Type    *MMSTypeSpec
}

MMSNamedVariable is a DefineNamedVariable-Request. Type is nil when the request leaves the type to the address.

type MMSNamedVariableList

type MMSNamedVariableList struct {
	Name      MMSObjectName
	Deletable bool
	Variables []MMSVariable
}

MMSNamedVariableList is a DefineNamedVariableList-Request (Name and Variables) or a GetNamedVariableListAttributes-Response (Deletable and Variables).

type MMSObjectClass

type MMSObjectClass uint8

MMSObjectClass is the getNameList basicObjectClass.

const (
	MMSClassNamedVariable     MMSObjectClass = 0
	MMSClassScatteredAccess   MMSObjectClass = 1
	MMSClassNamedVariableList MMSObjectClass = 2
	MMSClassNamedType         MMSObjectClass = 3
	MMSClassSemaphore         MMSObjectClass = 4
	MMSClassEventCondition    MMSObjectClass = 5
	MMSClassEventAction       MMSObjectClass = 6
	MMSClassEventEnrollment   MMSObjectClass = 7
	MMSClassJournal           MMSObjectClass = 8
	MMSClassDomain            MMSObjectClass = 9
	MMSClassProgramInvocation MMSObjectClass = 10
	MMSClassOperatorStation   MMSObjectClass = 11
	MMSClassDataExchange      MMSObjectClass = 12
	MMSClassAccessControlList MMSObjectClass = 13
)

Basic object classes.

func (MMSObjectClass) String

func (c MMSObjectClass) String() string

String returns the ASN.1 name of the class.

type MMSObjectName

type MMSObjectName struct {
	Scope    MMSObjectScope
	DomainID string
	ItemID   string
}

MMSObjectName is an ObjectName: a VMD or AA specific identifier, or a domain specific {domainId, itemId} pair. IEC 61850 maps logical devices to domains, e.g. {"IED1LD0", "LLN0$ST$Mod$stVal"}.

type MMSObjectScope

type MMSObjectScope uint8

MMSObjectScope is the ObjectName CHOICE (and getNameList objectScope).

const (
	MMSScopeVMD    MMSObjectScope = 0
	MMSScopeDomain MMSObjectScope = 1
	MMSScopeAA     MMSObjectScope = 2
)

Object name scopes.

func (MMSObjectScope) String

func (s MMSObjectScope) String() string

String returns the ASN.1 name of the scope.

type MMSOperatorRequest

type MMSOperatorRequest struct {
	Station         string
	Echo            bool
	Prompts         []string
	InputTimeOut    uint32
	HasInputTimeOut bool
	Output          []string
}

MMSOperatorRequest is an Input-Request (Echo, Prompts, InputTimeOut) or an Output-Request (Output) for an operator station. Echo defaults to true.

type MMSOperatorResponse

type MMSOperatorResponse struct {
	Input string
}

MMSOperatorResponse is an Input-Response: what the operator typed.

type MMSPDUType

type MMSPDUType uint8

MMSPDUType is the MMSpdu CHOICE tag.

const (
	MMSConfirmedRequest  MMSPDUType = 0
	MMSConfirmedResponse MMSPDUType = 1
	MMSConfirmedError    MMSPDUType = 2
	MMSUnconfirmed       MMSPDUType = 3
	MMSReject            MMSPDUType = 4
	MMSCancelRequest     MMSPDUType = 5
	MMSCancelResponse    MMSPDUType = 6
	MMSCancelError       MMSPDUType = 7
	MMSInitiateRequest   MMSPDUType = 8
	MMSInitiateResponse  MMSPDUType = 9
	MMSInitiateError     MMSPDUType = 10
	MMSConcludeRequest   MMSPDUType = 11
	MMSConcludeResponse  MMSPDUType = 12
	MMSConcludeError     MMSPDUType = 13
)

MMSpdu alternatives.

func (MMSPDUType) String

func (t MMSPDUType) String() string

String returns the ASN.1 name of the PDU.

type MMSPhysicalStatus

type MMSPhysicalStatus int64

MMSPhysicalStatus is the vmdPhysicalStatus of a Status-Response.

const (
	MMSOperational          MMSPhysicalStatus = 0
	MMSPartiallyOperational MMSPhysicalStatus = 1
	MMSInoperable           MMSPhysicalStatus = 2
	MMSNeedsCommissioning   MMSPhysicalStatus = 3
)

VMD physical states.

func (MMSPhysicalStatus) String

func (s MMSPhysicalStatus) String() string

String returns the ASN.1 name of the state.

type MMSProgramAttributes

type MMSProgramAttributes struct {
	State             MMSProgramState
	Domains           []string
	Deletable         bool
	Reusable          bool
	Monitor           bool
	StartArgument     string
	ExecutionArgument string
	// ExecutionExternal is the execution argument encoded as an EXTERNAL.
	ExecutionExternal *ISOPresentationPDV
	// AccessControlList is the ISO 9506-2:2003 addition.
	AccessControlList string
}

MMSProgramAttributes is a GetProgramInvocationAttributes-Response.

type MMSProgramRequest

type MMSProgramRequest struct {
	Name              string
	Domains           []string
	Reusable          bool
	Monitor           bool
	HasMonitor        bool
	ExecutionArgument string
	ExecutionExternal *ISOPresentationPDV
}

MMSProgramRequest holds the arguments of the program invocation requests. Name is always set; createProgramInvocation fills Domains, Reusable and Monitor, start and resume the ExecutionArgument string or, when it is encoded as an EXTERNAL, ExecutionExternal.

type MMSProgramState

type MMSProgramState int64

MMSProgramState is a ProgramInvocationState.

const (
	MMSProgramNonExistent MMSProgramState = 0
	MMSProgramUnrunnable  MMSProgramState = 1
	MMSProgramIdle        MMSProgramState = 2
	MMSProgramRunning     MMSProgramState = 3
	MMSProgramStopped     MMSProgramState = 4
	MMSProgramStarting    MMSProgramState = 5
	MMSProgramStopping    MMSProgramState = 6
	MMSProgramResuming    MMSProgramState = 7
	MMSProgramResetting   MMSProgramState = 8
)

Program invocation states.

func (MMSProgramState) String

func (s MMSProgramState) String() string

String returns the ASN.1 name of the state.

type MMSReadRequest

type MMSReadRequest struct {
	SpecificationWithResult bool
	Access                  MMSVariableAccess
}

MMSReadRequest is a Read-Request.

type MMSReadResponse

type MMSReadResponse struct {
	HasAccess bool
	Access    MMSVariableAccess
	Results   []MMSAccessResult
}

MMSReadResponse is a Read-Response. HasAccess tells whether the optional variable access specification was returned.

type MMSRejectInfo

type MMSRejectInfo struct {
	HasInvokeID bool
	InvokeID    uint32
	Type        MMSRejectType
	Reason      int64
}

MMSRejectInfo is a RejectPDU.

type MMSRejectType

type MMSRejectType uint8

MMSRejectType is the rejectReason CHOICE tag: which PDU was rejected.

const (
	MMSRejectConfirmedRequest  MMSRejectType = 1
	MMSRejectConfirmedResponse MMSRejectType = 2
	MMSRejectConfirmedError    MMSRejectType = 3
	MMSRejectUnconfirmed       MMSRejectType = 4
	MMSRejectPDUError          MMSRejectType = 5
	MMSRejectCancelRequest     MMSRejectType = 6
	MMSRejectCancelResponse    MMSRejectType = 7
	MMSRejectCancelError       MMSRejectType = 8
	MMSRejectConcludeRequest   MMSRejectType = 9
	MMSRejectConcludeResponse  MMSRejectType = 10
	MMSRejectConcludeError     MMSRejectType = 11
)

Reject reasons.

func (MMSRejectType) String

func (r MMSRejectType) String() string

String returns the ASN.1 name of the reject reason.

type MMSRenameRequest

type MMSRenameRequest struct {
	ObjectClass   MMSObjectClass
	CurrentName   MMSObjectName
	NewIdentifier string
}

MMSRenameRequest is a Rename-Request.

type MMSScatteredAccess

type MMSScatteredAccess struct {
	Name              MMSObjectName
	Deletable         bool
	Components        []MMSScatteredComponent
	AccessControlList string
}

MMSScatteredAccess is a DefineScatteredAccess-Request (Name) or a GetScatteredAccessAttributes-Response (Deletable, AccessControlList): one object made of pieces of other variables.

type MMSScatteredComponent

type MMSScatteredComponent struct {
	Name            string
	Variable        MMSVariable
	AlternateAccess []byte
	Alternate       []MMSAlternateAccess
}

MMSScatteredComponent is one component of a scattered access: a variable, optionally named and narrowed by an alternate access. AlternateAccess keeps the raw alternate access; Alternate is nil when it is absent or malformed.

type MMSSemaphoreClass

type MMSSemaphoreClass int64

MMSSemaphoreClass is the class of a semaphore.

const (
	MMSSemaphoreToken MMSSemaphoreClass = 0
	MMSSemaphorePool  MMSSemaphoreClass = 1
)

Semaphore classes.

func (MMSSemaphoreClass) String

func (c MMSSemaphoreClass) String() string

String returns the ASN.1 name of the class.

type MMSSemaphoreEntry

type MMSSemaphoreEntry struct {
	EntryID             []byte
	Class               MMSSemaphoreEntryClass
	Application         *MMSApplicationReference
	NamedToken          string
	Priority            uint8
	RemainingTimeOut    uint32
	HasRemainingTimeOut bool
	AbortOnTimeOut      bool
	HasAbortOnTimeOut   bool
	RelinquishIfLost    bool
}

MMSSemaphoreEntry is one SemaphoreEntry: a queued, owning or hung request for a semaphore. Application is nil when malformed or absent.

type MMSSemaphoreEntryClass

type MMSSemaphoreEntryClass int64

MMSSemaphoreEntryClass tells how a semaphore entry was made.

const (
	MMSEntrySimple   MMSSemaphoreEntryClass = 0
	MMSEntryModifier MMSSemaphoreEntryClass = 1
)

Semaphore entry classes.

func (MMSSemaphoreEntryClass) String

func (c MMSSemaphoreEntryClass) String() string

String returns the ASN.1 name of the class.

type MMSSemaphoreRequest

type MMSSemaphoreRequest struct {
	Name               MMSObjectName
	NamedToken         string
	Priority           uint8
	AcceptableDelay    uint32
	HasAcceptableDelay bool
	ControlTimeOut     uint32
	HasControlTimeOut  bool
	AbortOnTimeOut     bool
	HasAbortOnTimeOut  bool
	RelinquishIfLost   bool
	Preempt            *MMSApplicationReference

	Tokens          uint16
	StartAfter      string
	State           MMSSemaphoreState
	EntryStartAfter []byte
}

MMSSemaphoreRequest holds the arguments of the semaphore requests and of an attach-To-Semaphore modifier. Name is always set:

NamedToken                 takeControl, relinquishControl, modifier
Priority .. Preempt        takeControl, modifier (no Preempt)
Tokens                     defineSemaphore
StartAfter                 reportPoolSemaphoreStatus
State, EntryStartAfter     reportSemaphoreEntryStatus

Priority defaults to 64 and RelinquishIfLost to true.

type MMSSemaphoreResponse

type MMSSemaphoreResponse struct {
	NamedToken    string
	HasNamedToken bool

	Deletable   bool
	Class       MMSSemaphoreClass
	Tokens      uint16
	OwnedTokens uint16
	HungTokens  uint16

	NamedTokens []MMSNamedToken
	Entries     []MMSSemaphoreEntry
	MoreFollows bool
}

MMSSemaphoreResponse holds a semaphore response:

NamedToken, HasNamedToken      takeControl (noResult when not set)
Deletable .. HungTokens        reportSemaphoreStatus
NamedTokens, MoreFollows       reportPoolSemaphoreStatus
Entries, MoreFollows           reportSemaphoreEntryStatus

type MMSSemaphoreState

type MMSSemaphoreState int64

MMSSemaphoreState is the state filter of a reportSemaphoreEntryStatus request.

const (
	MMSSemaphoreQueued MMSSemaphoreState = 0
	MMSSemaphoreOwner  MMSSemaphoreState = 1
	MMSSemaphoreHung   MMSSemaphoreState = 2
)

Semaphore entry states.

func (MMSSemaphoreState) String

func (s MMSSemaphoreState) String() string

String returns the ASN.1 name of the state.

type MMSServiceError

type MMSServiceError struct {
	Class          MMSErrorClass
	Code           int64
	AdditionalCode int64
	Description    string
}

MMSServiceError is a ServiceError: an error class and its code.

type MMSServiceExt

type MMSServiceExt struct {
	Other   bool
	Service MMSConfirmedService
	Raw     []byte

	ControlState  MMSControlState
	Controlling   bool
	StartLocation string
	StartCount    MMSStartCount
	ContinueMode  bool
	Enhancement   MMSEnhancement
	Status        *MMSCSStatus
	Program       *MMSCSProgram
	Condition     *MMSCSCondition
}

MMSServiceExt is the service-ext [79] detail that follows the service of a confirmed or unconfirmed PDU. Other is set for otherRequests NULL. Otherwise Service is the tag of the detail, which is the service it extends (2, eventNotification, in an unconfirmed PDU), and Raw its value:

ControlState                  createProgramInvocation request
Controlling, StartLocation,
StartCount, ContinueMode      start and resume requests
Enhancement                   event condition and enrollment requests,
                              eventNotification
Status                        status response
Program                       getProgramInvocationAttributes response
Condition, Enhancement        getEventConditionAttributes response

type MMSStartCount

type MMSStartCount struct {
	Kind  MMSStartCountKind
	Count int64
}

MMSStartCount tells how long a controlling program invocation runs: without limit, or for Count cycles or steps. The default is one cycle.

type MMSStartCountKind

type MMSStartCountKind uint8

MMSStartCountKind is the StartCount (and running mode) CHOICE tag.

const (
	MMSStartNoLimit    MMSStartCountKind = 0
	MMSStartCycleCount MMSStartCountKind = 1
	MMSStartStepCount  MMSStartCountKind = 2
)

StartCount alternatives.

func (MMSStartCountKind) String

func (k MMSStartCountKind) String() string

String returns the ASN.1 name of the alternative.

type MMSStatusRequest

type MMSStatusRequest struct {
	ExtendedDerivation bool
}

MMSStatusRequest is a Status-Request.

type MMSTokenState

type MMSTokenState uint8

MMSTokenState tells whether a named token is free, owned or hung.

const (
	MMSTokenFree  MMSTokenState = 0
	MMSTokenOwned MMSTokenState = 1
	MMSTokenHung  MMSTokenState = 2
)

Named token states: the tags of the listOfNamedTokens CHOICE.

func (MMSTokenState) String

func (s MMSTokenState) String() string

String returns the ASN.1 name of the state.

type MMSTransitions

type MMSTransitions uint8

MMSTransitions is the Transitions BIT STRING of event enrollments: the state changes of an event condition that matter.

const (
	MMSIdleToDisabled   MMSTransitions = 0x80
	MMSActiveToDisabled MMSTransitions = 0x40
	MMSDisabledToIdle   MMSTransitions = 0x20
	MMSActiveToIdle     MMSTransitions = 0x10
	MMSDisabledToActive MMSTransitions = 0x08
	MMSIdleToActive     MMSTransitions = 0x04
	MMSAnyToDeleted     MMSTransitions = 0x02
)

Transitions bits; bit 0 is the most significant bit of the octet.

type MMSTypeComponent

type MMSTypeComponent struct {
	Name string
	Type MMSTypeSpec
}

MMSTypeComponent is one structure member: an optional name and a type.

type MMSTypeKind

type MMSTypeKind uint8

MMSTypeKind is the TypeSpecification CHOICE tag. Except typeName, the tags match the MMSDataType of the values the type describes.

const (
	MMSTypeName            MMSTypeKind = 0
	MMSTypeArray           MMSTypeKind = 1
	MMSTypeStructure       MMSTypeKind = 2
	MMSTypeBoolean         MMSTypeKind = 3
	MMSTypeBitString       MMSTypeKind = 4
	MMSTypeInteger         MMSTypeKind = 5
	MMSTypeUnsigned        MMSTypeKind = 6
	MMSTypeFloatingPoint   MMSTypeKind = 7
	MMSTypeOctetString     MMSTypeKind = 9
	MMSTypeVisibleString   MMSTypeKind = 10
	MMSTypeGeneralizedTime MMSTypeKind = 11
	MMSTypeBinaryTime      MMSTypeKind = 12
	MMSTypeBCD             MMSTypeKind = 13
	MMSTypeObjID           MMSTypeKind = 15
	MMSTypeMMSString       MMSTypeKind = 16
	MMSTypeUTCTime         MMSTypeKind = 17
)

TypeSpecification alternatives.

func (MMSTypeKind) String

func (k MMSTypeKind) String() string

String returns the ASN.1 name of the alternative.

type MMSTypeSpec

type MMSTypeSpec struct {
	Kind MMSTypeKind
	// Name is set for typeName.
	Name MMSObjectName
	// Packed is set for packed arrays and structures.
	Packed bool
	// Size is the Integer32 or Unsigned8 parameter: bits of a bit-string,
	// integer or unsigned, octets of an octet-string, characters of a
	// visible-string or mMSString and digits of a bcd. A negative string
	// size means variable length of at most -Size, e.g. -255.
	Size int64
	// Elements and Element describe an array.
	Elements uint32
	Element  *MMSTypeSpec
	// Components lists the members of a structure.
	Components []MMSTypeComponent
	// FormatWidth and ExponentWidth are set for floating-point, e.g. 32
	// and 8 for IEEE 754 single precision.
	FormatWidth   uint8
	ExponentWidth uint8
	// WithDate is set for a binary-time that includes the date.
	WithDate bool
}

MMSTypeSpec is a TypeSpecification. Kind selects the fields in use.

IEC 61850 describes a data object as nested structures, e.g. Mod as structure {stVal integer(8), q bit-string(13), t utc-time}.

type MMSUTCTime

type MMSUTCTime struct {
	Seconds  uint32
	Fraction uint32
	Quality  uint8
}

MMSUTCTime is the IEC 61850 / MMS UtcTime: seconds since 1970, a 24 bit binary fraction of a second and a time quality octet. Quality bit 7 is leap second known, 6 clock failure, 5 clock not synchronized and bits 0-4 the number of accurate fraction bits.

func (MMSUTCTime) Time

func (u MMSUTCTime) Time() time.Time

Time converts the timestamp to a UTC time.Time, truncated to the nanosecond.

type MMSUnackedState

type MMSUnackedState int64

MMSUnackedState is the unacknowledgedState of an alarm summary.

const (
	MMSUnackedNone   MMSUnackedState = 0
	MMSUnackedActive MMSUnackedState = 1
	MMSUnackedIdle   MMSUnackedState = 2
	MMSUnackedBoth   MMSUnackedState = 3
)

Unacknowledged states.

func (MMSUnackedState) String

func (s MMSUnackedState) String() string

String returns the ASN.1 name of the state.

type MMSUnconfirmedService

type MMSUnconfirmedService uint8

MMSUnconfirmedService is the UnconfirmedService CHOICE tag.

const (
	MMSUnconfirmedInfoReport MMSUnconfirmedService = 0
	MMSUnconfirmedStatus     MMSUnconfirmedService = 1
	MMSUnconfirmedEvent      MMSUnconfirmedService = 2
)

Unconfirmed services.

func (MMSUnconfirmedService) String

func (s MMSUnconfirmedService) String() string

String returns the ASN.1 name of the service.

type MMSUnitPosition

type MMSUnitPosition struct {
	Kind   MMSUnitPositionKind
	Name   string
	ULSMID int64
}

MMSUnitPosition is where a unit control upload continues: a domain or program invocation Name, or an upload state machine ULSMID.

type MMSUnitPositionKind

type MMSUnitPositionKind uint8

MMSUnitPositionKind tells what a unit control upload continues with.

const (
	MMSUnitDomain  MMSUnitPositionKind = 1
	MMSUnitULSM    MMSUnitPositionKind = 2
	MMSUnitProgram MMSUnitPositionKind = 3
)

Upload positions: the tags of the continueAfter and nextElement CHOICE.

func (MMSUnitPositionKind) String

func (k MMSUnitPositionKind) String() string

String returns the ASN.1 name of the alternative.

type MMSVMDStatus

type MMSVMDStatus struct {
	Logical  MMSLogicalStatus
	Physical MMSPhysicalStatus
	// LocalDetail is the optional local detail BIT STRING.
	LocalDetail       []byte
	LocalDetailUnused uint8
}

MMSVMDStatus is a Status-Response or an unsolicitedStatus.

type MMSVariable

type MMSVariable struct {
	Kind            MMSVariableKind
	Name            MMSObjectName
	Spec            []byte
	AlternateAccess []byte

	// Address is set for the address and variableDescription
	// alternatives, Type for the variableDescription.
	Address MMSAddress
	Type    *MMSTypeSpec
	// Alternate is the decoded AlternateAccess, nil when it is absent or
	// malformed.
	Alternate []MMSAlternateAccess
	// Scattered lists the components of a scatteredAccessDescription, nil
	// when it is malformed or nested too deep.
	Scattered []MMSScatteredComponent
}

MMSVariable is one listOfVariable entry. Spec always keeps the raw VariableSpecification value and AlternateAccess the raw alternate access. The name alternative must decode; the others are best effort.

type MMSVariableAccess

type MMSVariableAccess struct {
	Kind      MMSAccessKind
	Variables []MMSVariable
	ListName  MMSObjectName
}

MMSVariableAccess is a VariableAccessSpecification.

type MMSVariableAttributes

type MMSVariableAttributes struct {
	Deletable  bool
	HasAddress bool
	Address    MMSAddress
	Type       MMSTypeSpec
}

MMSVariableAttributes is a GetVariableAccessAttributes-Response.

type MMSVariableKind

type MMSVariableKind uint8

MMSVariableKind is the VariableSpecification CHOICE tag.

const (
	MMSVariableName        MMSVariableKind = 0
	MMSVariableAddress     MMSVariableKind = 1
	MMSVariableDescription MMSVariableKind = 2
	MMSVariableScattered   MMSVariableKind = 3
	MMSVariableInvalidated MMSVariableKind = 4
)

Variable specification alternatives.

func (MMSVariableKind) String

func (k MMSVariableKind) String() string

String returns the ASN.1 name of the alternative.

type MMSWriteRequest

type MMSWriteRequest struct {
	Access MMSVariableAccess
	Data   []MMSData
}

MMSWriteRequest is a Write-Request.

type MMSWriteResult

type MMSWriteResult struct {
	Failed bool
	Error  MMSDataAccessError
}

MMSWriteResult is one Write-Response entry.

type MPCapable added in v1.3.1

type MPCapable struct {
	BaseLayer
	Version                uint8
	A, B, C, D, E, F, G, H bool
	SendKey                []byte
	ReceivKey              []byte
	DataLength             uint16
	Checksum               uint16
}

MPCapable contains the fields from the MP_CAPABLE MPTCP Option

type MPFClose added in v1.3.1

type MPFClose struct {
	BaseLayer
	ReceivKey []byte
}

MPFClose contains the fields from the MP_FASTCLOSE MPTCP Option

type MPFail added in v1.3.1

type MPFail struct {
	BaseLayer
	DSN uint64
}

MPFail contains the fields from the MP_FAIL MPTCP Option

type MPJoin added in v1.3.1

type MPJoin struct {
	BaseLayer
	Backup      bool
	AddrID      uint8
	ReceivToken uint32
	SendRandNum uint32
	SendHMAC    []byte
}

MPJoin contains the fields from the MP_JOIN MPTCP Option

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 MPPrio added in v1.3.1

type MPPrio struct {
	BaseLayer
	Backup bool
	AddrID uint8
}

MPPrio contains the fields from the MP_PRIO MPTCP Option

type MPTCPSubtype added in v1.3.1

type MPTCPSubtype uint8

MPTCPSubtype represents an MPTCP subtype code.

func (MPTCPSubtype) String added in v1.3.1

func (k MPTCPSubtype) String() string

type MPTcpRst added in v1.3.1

type MPTcpRst struct {
	BaseLayer
	U, V, W, T bool
	Reason     uint8
}

MPTcpRst contains the fields from the MP_TCPRST MPTCP Option

type MidamblePeriodicity added in v1.3.0

type MidamblePeriodicity uint8
const (
	MidamblePeriodicity_10 MidamblePeriodicity = iota
	MidamblePeriodicity_20
)

func (MidamblePeriodicity) String added in v1.3.0

func (mp MidamblePeriodicity) String() string

type Modbus added in v1.6.0

type Modbus struct {
	BaseLayer
	MBAP
	FunctionCode uint8  // Raw Modbus function code byte (includes exception bit 0x80 if present)
	Exception    bool   // True if this is an exception response
	ReqResp      []byte // Request/Response data
}

Modbus represents a Modbus TCP packet

func (*Modbus) CanDecode added in v1.6.0

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

func (*Modbus) DecodeFromBytes added in v1.6.0

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

func (*Modbus) DecodePDU

func (m *Modbus) DecodePDU(dir ModbusDirection) (*ModbusPDU, error)

DecodePDU decodes the function specific data of m. On error the returned PDU holds the fields decoded before the fault was found.

func (*Modbus) GetExceptionCode added in v1.6.0

func (m *Modbus) GetExceptionCode() ModbusExceptionCode

GetExceptionCode returns the exception code from the first byte of ReqResp data Returns 0 if this is not an exception response or if there is no data

func (*Modbus) GetFunction added in v1.6.0

func (m *Modbus) GetFunction() ModbusFunctionCode

GetFunction returns the Modbus function code as a ModbusFunctionCode type

func (*Modbus) IsException added in v1.6.0

func (m *Modbus) IsException() bool

IsException returns true if this is a Modbus exception response

func (*Modbus) LayerType added in v1.6.0

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

func (*Modbus) NextLayerType added in v1.6.0

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

func (*Modbus) Validate added in v1.6.0

func (m *Modbus) Validate() error

Validate checks if the Modbus packet is valid according to the protocol specification

type ModbusCANopen

type ModbusCANopen struct {
	Control     uint8
	Control2    uint8 // extended protocol control, when HasControl2
	Reserved    uint8
	Counter     uint8 // when HasCounter
	NetworkID   uint8 // when HasNetworkID
	EncodedData uint8 // when HasEncodedData
	NodeID      uint8
	Index       uint16
	SubIndex    uint8
	Address     uint16 // starting address within the object
	Quantity    uint16 // data bytes to read or write
	Data        []byte
}

ModbusCANopen is the header of a CANopen General Reference PDU (MEI type 0x0D), which carries an access to the object dictionary of a CANopen node behind a gateway.

The layout follows CiA 309-2 as vendor manuals summarise it; the Modbus specification only names the MEI type and Wireshark does not dissect it, so nothing here was checked against a second decoder:

control [control 2] reserved [counter] [network] [encoded]
node  index(2)  sub-index  address(2)  quantity(2)  data ...

The fields in brackets are present when the matching bit of Control is set.

func (*ModbusCANopen) Extend

func (c *ModbusCANopen) Extend() bool

Extend reports whether the PDU is one of several that carry the object.

func (*ModbusCANopen) HasControl2

func (c *ModbusCANopen) HasControl2() bool

HasControl2 reports whether a second protocol control byte follows.

func (*ModbusCANopen) HasCounter

func (c *ModbusCANopen) HasCounter() bool

HasCounter reports whether the counter byte is present.

func (*ModbusCANopen) HasEncodedData

func (c *ModbusCANopen) HasEncodedData() bool

HasEncodedData reports whether the encoded data byte is present.

func (*ModbusCANopen) HasNetworkID

func (c *ModbusCANopen) HasNetworkID() bool

HasNetworkID reports whether the network ID is present.

func (*ModbusCANopen) Valid

func (c *ModbusCANopen) Valid() bool

Valid reports whether the node ID and quantity lie in the ranges CiA 309-2 allows: node 1 to 127, at most 253 data bytes.

func (*ModbusCANopen) Write

func (c *ModbusCANopen) Write() bool

Write reports whether the access writes the object. It reads it otherwise.

type ModbusDevIDCode

type ModbusDevIDCode uint8

ModbusDevIDCode is the Read Device ID code of a Read Device Identification PDU: which category of objects is asked for.

const (
	ModbusDevIDBasic    ModbusDevIDCode = 0x01 // stream access, basic objects
	ModbusDevIDRegular  ModbusDevIDCode = 0x02 // stream access, regular objects
	ModbusDevIDExtended ModbusDevIDCode = 0x03 // stream access, extended objects
	ModbusDevIDSpecific ModbusDevIDCode = 0x04 // one specific object
)

ModbusDevIDCode values.

func (ModbusDevIDCode) String

func (c ModbusDevIDCode) String() string

String returns the read device ID code name.

type ModbusDevObjectID

type ModbusDevObjectID uint8

ModbusDevObjectID identifies one device identification object.

const (
	ModbusDevObjVendorName  ModbusDevObjectID = 0x00
	ModbusDevObjProductCode ModbusDevObjectID = 0x01
	ModbusDevObjRevision    ModbusDevObjectID = 0x02
	ModbusDevObjVendorURL   ModbusDevObjectID = 0x03
	ModbusDevObjProductName ModbusDevObjectID = 0x04
	ModbusDevObjModelName   ModbusDevObjectID = 0x05
	ModbusDevObjUserAppName ModbusDevObjectID = 0x06
)

ModbusDevObjectID values for the basic and regular objects.

func (ModbusDevObjectID) String

func (o ModbusDevObjectID) String() string

String returns the object name.

type ModbusDeviceID

type ModbusDeviceID struct {
	ReadCode     ModbusDevIDCode
	ObjectID     ModbusDevObjectID // request: first object to read
	Conformity   uint8             // response: conformity level
	MoreFollows  bool              // response: another transaction is needed
	NextObjectID ModbusDevObjectID // response: object to ask for next
	NumObjects   uint8             // response: object count field
	Objects      []ModbusDeviceObject
}

ModbusDeviceID holds a Read Device Identification (MEI 0x0E) PDU.

type ModbusDeviceInfo

type ModbusDeviceInfo struct {
	ReadCode   ModbusDevIDCode
	Conformity uint8
	Objects    []ModbusDeviceObject
	Complete   bool
	// contains filtered or unexported fields
}

ModbusDeviceInfo joins the objects of a Read Device Identification that a server sends over several responses. When a response has MoreFollows set, the client asks again from NextObjectID; Add takes each response in turn:

resp 1: MoreFollows, NextObjectID 2, objects 0, 1
resp 2: last,                        objects 2      -> Complete

The zero value is ready to use. Object values are copied. Object IDs must ascend, so at most 256 objects are kept, one per ID.

func (*ModbusDeviceInfo) Add

Add appends the objects of the next response. It returns ErrModbusDevIDDone after the last response, and ErrModbusDevIDOrder, leaving d as it was, for a response that does not continue the read: another read code, objects that do not start at the ID announced or do not ascend, or a next object ID that does not move forward.

func (*ModbusDeviceInfo) Next

func (d *ModbusDeviceInfo) Next() (code ModbusDevIDCode, id ModbusDevObjectID, ok bool)

Next returns the request that continues the read: the read code and the object ID to ask for. ok is false before the first response and once the read is complete.

func (*ModbusDeviceInfo) Object

func (d *ModbusDeviceInfo) Object(id ModbusDevObjectID) ([]byte, bool)

Object returns the value of object id, when it was received.

type ModbusDeviceObject

type ModbusDeviceObject struct {
	ID    ModbusDevObjectID
	Value []byte
}

ModbusDeviceObject is one object of a Read Device Identification response.

type ModbusDiagCode

type ModbusDiagCode uint16

ModbusDiagCode is the sub-function code of a Diagnostics (0x08) PDU.

const (
	ModbusDiagReturnQueryData      ModbusDiagCode = 0x00
	ModbusDiagRestartComm          ModbusDiagCode = 0x01
	ModbusDiagReturnDiagRegister   ModbusDiagCode = 0x02
	ModbusDiagChangeASCIIDelimiter ModbusDiagCode = 0x03
	ModbusDiagForceListenOnly      ModbusDiagCode = 0x04
	ModbusDiagClearCounters        ModbusDiagCode = 0x0A
	ModbusDiagBusMessageCount      ModbusDiagCode = 0x0B
	ModbusDiagBusCommErrorCount    ModbusDiagCode = 0x0C
	ModbusDiagBusExceptionCount    ModbusDiagCode = 0x0D
	ModbusDiagServerMessageCount   ModbusDiagCode = 0x0E
	ModbusDiagServerNoRespCount    ModbusDiagCode = 0x0F
	ModbusDiagServerNAKCount       ModbusDiagCode = 0x10
	ModbusDiagServerBusyCount      ModbusDiagCode = 0x11
	ModbusDiagBusCharOverrunCount  ModbusDiagCode = 0x12
	ModbusDiagClearOverrun         ModbusDiagCode = 0x14
)

ModbusDiagCode values from the spec, section 6.8.1.

func (ModbusDiagCode) Kind

func (c ModbusDiagCode) Kind() ModbusDiagKind

Kind returns what the data field of sub-function c means.

func (ModbusDiagCode) Reserved

func (c ModbusDiagCode) Reserved() bool

Reserved reports whether c is a sub-function the spec reserves: 5 to 9, 0x13 and everything above 0x14.

func (ModbusDiagCode) String

func (c ModbusDiagCode) String() string

String returns the sub-function name.

type ModbusDiagKind

type ModbusDiagKind uint8

ModbusDiagKind says what the data field of a Diagnostics PDU means.

const (
	// ModbusDiagEcho: Return Query Data. The data is free and echoed.
	ModbusDiagEcho ModbusDiagKind = iota
	// ModbusDiagRestart: Restart Communications Option. ClearLog says
	// whether the event log is cleared too.
	ModbusDiagRestart
	// ModbusDiagRegister: Return Diagnostic Register. Value is the
	// register in a response.
	ModbusDiagRegister
	// ModbusDiagDelimiter: Change ASCII Input Delimiter. Delimiter is
	// the new end of message character.
	ModbusDiagDelimiter
	// ModbusDiagCommand: a command without data: Force Listen Only
	// Mode, Clear Counters and Diagnostic Register, Clear Overrun
	// Counter and Flag.
	ModbusDiagCommand
	// ModbusDiagCounter: one of the Return ... Count sub-functions.
	// Value is the counter in a response.
	ModbusDiagCounter
	// ModbusDiagReserved: a reserved sub-function. Its data is not
	// checked.
	ModbusDiagReserved
)

ModbusDiagKind values.

func (ModbusDiagKind) String

func (k ModbusDiagKind) String() string

String returns the kind name.

type ModbusDiagnostic

type ModbusDiagnostic struct {
	Code      ModbusDiagCode
	Kind      ModbusDiagKind
	Value     uint16 // the 16 bit data field; 0 for ModbusDiagEcho
	ClearLog  bool   // ModbusDiagRestart: data field 0xFF00
	Delimiter byte   // ModbusDiagDelimiter
}

ModbusDiagnostic is the data field of a Diagnostics PDU, read as its sub-function defines (spec section 6.8).

type ModbusDirConfidence

type ModbusDirConfidence uint8

ModbusDirConfidence says how a direction was told.

const (
	// ModbusDirUnknown: the PDU decodes as neither a request nor a
	// response. The direction returned is ModbusRequest.
	ModbusDirUnknown ModbusDirConfidence = iota
	// ModbusDirAmbiguous: the PDU is valid both ways, as the echo of a
	// write is. The direction returned is ModbusRequest.
	ModbusDirAmbiguous
	// ModbusDirByShape: the PDU is valid one way only, or has the
	// exception bit set.
	ModbusDirByShape
	// ModbusDirByPort: one port is the Modbus port, 502.
	ModbusDirByPort
)

ModbusDirConfidence values, weakest first.

func (ModbusDirConfidence) String

func (c ModbusDirConfidence) String() string

String returns the confidence name.

type ModbusDirection

type ModbusDirection uint8

ModbusDirection says whether a PDU is a request (client to server) or a response. A PDU does not carry this itself.

const (
	ModbusRequest ModbusDirection = iota
	ModbusResponse
)

ModbusDirection values.

func ModbusDirFromPorts

func ModbusDirFromPorts(src, dst TCPPort) ModbusDirection

ModbusDirFromPorts infers the direction of a Modbus/TCP PDU from its TCP ports: a PDU sent from port 502 is a response, anything else (normally sent to port 502) is a request.

func (ModbusDirection) String

func (d ModbusDirection) String() string

String returns the direction name.

type ModbusExceptionCode added in v1.6.0

type ModbusExceptionCode byte

ModbusExceptionCode represents a Modbus exception code

const (
	ModbusExceptionIllegalFunction                    ModbusExceptionCode = 0x01
	ModbusExceptionIllegalDataAddress                 ModbusExceptionCode = 0x02
	ModbusExceptionIllegalDataValue                   ModbusExceptionCode = 0x03
	ModbusExceptionSlaveDeviceFailure                 ModbusExceptionCode = 0x04
	ModbusExceptionAcknowledge                        ModbusExceptionCode = 0x05
	ModbusExceptionSlaveDeviceBusy                    ModbusExceptionCode = 0x06
	ModbusExceptionMemoryParityError                  ModbusExceptionCode = 0x08
	ModbusExceptionGatewayPathUnavailable             ModbusExceptionCode = 0x0A
	ModbusExceptionGatewayTargetDeviceFailedToRespond ModbusExceptionCode = 0x0B
)

Modbus Exception Code constants

func (ModbusExceptionCode) String added in v1.6.0

func (ec ModbusExceptionCode) String() string

String returns a human-readable string representation of the exception code

type ModbusExchange

type ModbusExchange struct {
	TransactionID uint16
	UnitID        uint8
	Request       *ModbusPDU
	Response      *ModbusPDU
}

ModbusExchange is one Modbus/TCP PDU and the PDU it pairs with. Request is nil for a response whose request was not seen; Response is nil for a request.

func (*ModbusExchange) Address

func (e *ModbusExchange) Address() (addr uint16, ok bool)

Address returns the starting address the exchange is about, taken from the request: a read response carries values, not where they were read from. ok is false without a request or for a function that has no starting address.

type ModbusFileRecord

type ModbusFileRecord struct {
	RefType      uint8
	FileNumber   uint16 // not present in a read response
	RecordNumber uint16 // not present in a read response
	RecordLength uint16 // in registers
	Data         []byte // record registers, big endian; empty in a read request
}

ModbusFileRecord is one sub-request or sub-response of a Read File Record (0x14) or Write File Record (0x15) PDU.

type ModbusFunctionCode added in v1.6.0

type ModbusFunctionCode byte

ModbusFunctionCode represents a Modbus function code

const (
	ModbusFuncCodeReadCoils              ModbusFunctionCode = 0x01
	ModbusFuncCodeReadDiscreteInputs     ModbusFunctionCode = 0x02
	ModbusFuncCodeReadHoldingRegisters   ModbusFunctionCode = 0x03
	ModbusFuncCodeReadInputRegisters     ModbusFunctionCode = 0x04
	ModbusFuncCodeWriteSingleCoil        ModbusFunctionCode = 0x05
	ModbusFuncCodeWriteSingleRegister    ModbusFunctionCode = 0x06
	ModbusFuncCodeReadExceptionStatus    ModbusFunctionCode = 0x07
	ModbusFuncCodeDiagnostics            ModbusFunctionCode = 0x08
	ModbusFuncCodeGetCommEventCounter    ModbusFunctionCode = 0x0B
	ModbusFuncCodeGetCommEventLog        ModbusFunctionCode = 0x0C
	ModbusFuncCodeWriteMultipleCoils     ModbusFunctionCode = 0x0F
	ModbusFuncCodeWriteMultipleRegisters ModbusFunctionCode = 0x10
	ModbusFuncCodeReportSlaveID          ModbusFunctionCode = 0x11
	ModbusFuncCodeReadFileRecord         ModbusFunctionCode = 0x14
	ModbusFuncCodeWriteFileRecord        ModbusFunctionCode = 0x15
	ModbusFuncCodeMaskWriteRegister      ModbusFunctionCode = 0x16
	ModbusFuncCodeReadWriteMultipleRegs  ModbusFunctionCode = 0x17
	ModbusFuncCodeReadFIFOQueue          ModbusFunctionCode = 0x18
	ModbusFuncCodeEncapsulatedInterface  ModbusFunctionCode = 0x2B
	// Exception mask (OR'd with function code for exception responses)
	ModbusFuncCodeExceptionMask ModbusFunctionCode = 0x80
)

Modbus Function Code constants

func (ModbusFunctionCode) String added in v1.6.0

func (fc ModbusFunctionCode) String() string

String returns a human-readable string representation of the function code

type ModbusMEIType

type ModbusMEIType uint8

ModbusMEIType is the MEI type of an Encapsulated Interface Transport (0x2B) PDU.

const (
	ModbusMEICANopen  ModbusMEIType = 0x0D // CANopen General Reference
	ModbusMEIDeviceID ModbusMEIType = 0x0E // Read Device Identification
)

ModbusMEIType values.

func (ModbusMEIType) String

func (t ModbusMEIType) String() string

String returns the MEI type name.

type ModbusPDU

type ModbusPDU struct {
	Direction     ModbusDirection
	Function      ModbusFunctionCode // exception bit cleared
	Exception     bool
	ExceptionCode ModbusExceptionCode

	Address       uint16
	Quantity      uint16
	Value         uint16
	WriteAddress  uint16
	WriteQuantity uint16
	AndMask       uint16
	OrMask        uint16

	ByteCount int
	Bits      []byte // packed coil or input status, LSB of byte 0 first
	Registers []uint16

	SubFunction  ModbusDiagCode
	Status       uint16
	EventCount   uint16
	MessageCount uint16
	Events       []byte
	FIFOCount    uint16
	FileRecords  []ModbusFileRecord

	MEIType  ModbusMEIType
	DeviceID ModbusDeviceID

	Data []byte
}

ModbusPDU is a decoded Modbus PDU. Which fields are set depends on the function code and the direction:

0x01,0x02 req: Address, Quantity          resp: ByteCount, Bits
0x03,0x04 req: Address, Quantity          resp: ByteCount, Registers
0x05,0x06 req/resp: Address, Value
0x07      resp: Status (output data byte)
0x08      req/resp: SubFunction, Data (Diagnostic reads it by type)
0x0B      resp: Status, EventCount
0x0C      resp: ByteCount, Status, EventCount, MessageCount, Events
0x0F      req: Address, Quantity, ByteCount, Bits  resp: Address, Quantity
0x10      req: Address, Quantity, ByteCount, Registers  resp: Address, Quantity
0x11      resp: ByteCount, Data (server ID, run indicator, extra data;
          ServerID splits them)
0x14,0x15 req/resp: ByteCount, FileRecords
0x16      req/resp: Address, AndMask, OrMask
0x17      req: Address, Quantity (read), WriteAddress, WriteQuantity,
          ByteCount, Registers (write values)  resp: ByteCount, Registers
0x18      req: Address (FIFO pointer)  resp: ByteCount, FIFOCount, Registers
0x2B      req/resp: MEIType, then DeviceID (0x0E) or Data (others;
          CANopen reads the header of 0x0D)
exception resp: ExceptionCode
unknown function: Data

func DecodeModbusPDU

func DecodeModbusPDU(pdu []byte, dir ModbusDirection) (*ModbusPDU, error)

DecodeModbusPDU decodes a raw PDU: a function code followed by its data, such as ModbusTCP.Payload(). On error the returned PDU, when not nil, holds the fields decoded before the fault was found.

func (*ModbusPDU) Bit

func (p *ModbusPDU) Bit(i int) bool

Bit returns coil or input i of Bits, counting from the first one addressed. It returns false past the end of Bits.

func (*ModbusPDU) CANopen

func (p *ModbusPDU) CANopen() (*ModbusCANopen, error)

CANopen reads the header of a CANopen General Reference PDU from Data. It errors when Data is too short for the header its control byte announces; it does not judge the values, which Valid does.

func (*ModbusPDU) Diagnostic

func (p *ModbusPDU) Diagnostic() (ModbusDiagnostic, error)

Diagnostic reads the data of a Diagnostics PDU as its sub-function defines. It errors, with the fields read so far, when the data is not the two bytes every sub-function but Return Query Data carries, or holds a value the spec does not allow: a request for a register or a counter must send 0x0000, a restart 0x0000 or 0xFF00, a delimiter its character then 0x00.

func (*ModbusPDU) ServerID

func (p *ModbusPDU) ServerID() (ModbusServerID, error)

ServerID splits the data of a Report Server ID response into the server ID, the run indicator and the additional data.

It is a best effort. The spec fixes the order of the three but not the length of the server ID, which is device specific, so the split is a guess: the run indicator is taken to be the first byte past the first that is 0x00 (OFF) or 0xFF (ON). A one byte ID, by far the most common, always splits right; an ID with such a byte inside it does not. Without a run indicator everything is the ID. The raw bytes stay in Data.

type ModbusProtocol

type ModbusProtocol uint16

ModbusProtocol type

const (
	ModbusProtocolModbus ModbusProtocol = 0
)

ModbusProtocol known values.

func (ModbusProtocol) String

func (mp ModbusProtocol) String() string

type ModbusRunStatus

type ModbusRunStatus uint8

ModbusRunStatus is the run indicator of a Report Server ID response.

const (
	ModbusRunUnknown ModbusRunStatus = iota // no run indicator found
	ModbusRunOff                            // 0x00
	ModbusRunOn                             // 0xFF
)

ModbusRunStatus values.

func (ModbusRunStatus) String

func (s ModbusRunStatus) String() string

String returns the run status name.

type ModbusServerID

type ModbusServerID struct {
	ID         []byte
	Run        ModbusRunStatus
	Additional []byte
}

ModbusServerID is a Report Server ID response split into its parts.

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 ModbusTransactions

type ModbusTransactions struct {
	// Max caps the requests waiting for a response. 0 means
	// ModbusMaxTransactions.
	Max int
	// contains filtered or unexported fields
}

ModbusTransactions pairs the requests and responses of one Modbus/TCP connection by transaction and unit identifier, so a response can be read with the addresses of its request. Use one per connection: the identifiers are only unique within it. The zero value is ready to use. It is not safe for concurrent use.

Memory is bounded: at most Max requests wait, each a copy of at most one PDU, and the oldest is dropped to make room.

func (*ModbusTransactions) Add

Add decodes the PDU of m, the layer TCP port 502 decodes to, sent in direction dir, and pairs it. A request is kept until its response comes; a response is returned with its request, when one with the same identifiers and function waits. The error is that of decoding the PDU; the exchange is returned with it.

A kept request is decoded from a copy of its bytes, so m and its buffer may be reused.

func (*ModbusTransactions) AddTCP

AddTCP is Add for a ModbusTCP layer, whose payload is the PDU. It returns no exchange when the payload is empty.

func (*ModbusTransactions) Pending

func (t *ModbusTransactions) Pending() int

Pending returns how many requests wait for a response.

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 NLTF added in v1.3.0

type NLTF uint8
const (
	NLTF_1x NLTF = iota
	NLTF_2x
	NLTF_4x
	NLTF_6x
	NLTF_8x
	NLTF_reserved
)

func (NLTF) String added in v1.3.0

func (nltf NLTF) String() 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 OPCUA

type OPCUA struct {
	BaseLayer
	MessageType OPCUAMessageType
	ChunkType   OPCUAChunkType
	// MessageSize is the message length, header included.
	MessageSize uint32

	Hello        OPCUAHello
	Acknowledge  OPCUAConnectionLimits
	Error        OPCUAError
	ReverseHello OPCUAReverseHello

	SecureChannelID uint32
	// SecurityHeader is set by OPN; TokenID by MSG and CLO.
	SecurityHeader OPCUAAsymmetricSecurityHeader
	TokenID        uint32
	// SequenceNumber and RequestID are ciphertext on an encrypted channel.
	SequenceNumber uint32
	RequestID      uint32

	// Body is the message after the sequence header: the service, its
	// padding and signature, all encrypted on an encrypting channel.
	Body []byte
	// Service is the decoded body, nil when it was not decoded.
	Service *OPCUAService

	// Encrypted is set when the message is known to be ciphertext from
	// the sequence header on: by the decoder for an OPN under a policy
	// other than None, and by an OPCUAChunkAssembler for the MSG and CLO
	// of a channel in mode SignAndEncrypt. The decoder alone cannot know
	// the mode of a MSG and leaves it false. SequenceNumber and RequestID
	// are then ciphertext too.
	Encrypted bool
	// EncryptedData is the ciphertext of an Encrypted message: sequence
	// header, body, padding and signature, as sent. It is not decrypted.
	EncryptedData []byte
	// contains filtered or unexported fields
}

OPCUA is one OPC UA Binary transport message. Header fields are set by message type: Hello, Acknowledge, Error and ReverseHello for the connection messages; SecureChannelID, the security header, the sequence header and Body for OPN, MSG and CLO.

func (*OPCUA) CanDecode

func (o *OPCUA) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeOPCUA.

func (*OPCUA) DecodeFromBytes

func (o *OPCUA) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the message at the start of data.

func (*OPCUA) LayerType

func (o *OPCUA) LayerType() gopacket.LayerType

LayerType returns LayerTypeOPCUA.

func (*OPCUA) NextLayerType

func (o *OPCUA) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeZero. Further messages in the same segment are added as their own layers by the packet decoder; a DecodingLayerParser sees them in Payload.

func (*OPCUA) NullStrings

func (o *OPCUA) NullStrings() (header, body []int)

NullStrings tells the null Strings of the message from the empty ones, which both decode to "". It returns the offset of the length of every null String: those of the transport header (EndpointURL, Reason, SecurityPolicyURI and the like) as offsets into LayerContents, those of the decoded Service, the ExtensionObjects with a Value included, as offsets into Body. A String of the service that is not listed is not null. The message is walked again on every call.

func (*OPCUA) ServiceNodeID

func (o *OPCUA) ServiceNodeID() (OPCUANodeID, error)

ServiceNodeID returns the type NodeId that opens the body of an OPN, MSG or CLO message, the binary encoding id of its service. It fails when the body is too short, or encrypted into something that is not a NodeId.

type OPCUAActivateSessionRequest

type OPCUAActivateSessionRequest struct {
	ClientSignature            OPCUASignatureData
	ClientSoftwareCertificates []OPCUASignedSoftwareCertificate
	LocaleIDs                  []string
	// UserIdentityToken is the token as sent; IdentityToken is its
	// decoded form, the Value of UserIdentityToken, nil for an unknown or
	// undecodable token.
	UserIdentityToken  OPCUAExtensionObject
	IdentityToken      *OPCUAUserIdentityToken
	UserTokenSignature OPCUASignatureData
}

OPCUAActivateSessionRequest is the ActivateSession request (OPC 10000-4 §5.6.3).

type OPCUAActivateSessionResponse

type OPCUAActivateSessionResponse struct {
	ServerNonce []byte
	OPCUAResults
}

OPCUAActivateSessionResponse is the ActivateSession response.

type OPCUAAddNodesItem

type OPCUAAddNodesItem struct {
	ParentNodeID       OPCUANodeID
	ReferenceTypeID    OPCUANodeID
	RequestedNewNodeID OPCUANodeID
	BrowseName         OPCUAQualifiedName
	NodeClass          OPCUANodeClass
	NodeAttributes     OPCUAExtensionObject
	TypeDefinition     OPCUANodeID
}

OPCUAAddNodesItem is one node to add (OPC 10000-4 §5.7.2). The Value of NodeAttributes is a pointer to the attributes of its node class, such as *OPCUAVariableAttributes.

type OPCUAAddNodesRequest

type OPCUAAddNodesRequest struct {
	NodesToAdd []OPCUAAddNodesItem
}

OPCUAAddNodesRequest is the AddNodes request.

type OPCUAAddNodesResponse

type OPCUAAddNodesResponse struct {
	Results         []OPCUAAddNodesResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAAddNodesResponse is the AddNodes response.

type OPCUAAddNodesResult

type OPCUAAddNodesResult struct {
	StatusCode  OPCUAStatusCode
	AddedNodeID OPCUANodeID
}

OPCUAAddNodesResult is the result of adding one node.

type OPCUAAddReferencesItem

type OPCUAAddReferencesItem struct {
	SourceNodeID    OPCUANodeID
	ReferenceTypeID OPCUANodeID
	IsForward       bool
	TargetServerURI string
	TargetNodeID    OPCUANodeID
	TargetNodeClass OPCUANodeClass
}

OPCUAAddReferencesItem is one reference to add (OPC 10000-4 §5.7.3).

type OPCUAAddReferencesRequest

type OPCUAAddReferencesRequest struct {
	ReferencesToAdd []OPCUAAddReferencesItem
}

OPCUAAddReferencesRequest is the AddReferences request.

type OPCUAAggregateConfiguration

type OPCUAAggregateConfiguration struct {
	UseServerCapabilitiesDefaults bool
	TreatUncertainAsBad           bool
	PercentDataBad                uint8
	PercentDataGood               uint8
	UseSlopedExtrapolation        bool
}

OPCUAAggregateConfiguration tells how an aggregate is computed (OPC 10000-11 §6.4.4.2).

type OPCUAAggregateFilter

type OPCUAAggregateFilter struct {
	StartTime     time.Time
	AggregateType OPCUANodeID
	// ProcessingInterval is in milliseconds.
	ProcessingInterval     float64
	AggregateConfiguration OPCUAAggregateConfiguration
}

OPCUAAggregateFilter monitors an aggregate of a value (OPC 10000-4 §7.22.4).

type OPCUAAggregateFilterResult

type OPCUAAggregateFilterResult struct {
	RevisedStartTime time.Time
	// RevisedProcessingInterval is in milliseconds.
	RevisedProcessingInterval     float64
	RevisedAggregateConfiguration OPCUAAggregateConfiguration
}

OPCUAAggregateFilterResult is what a server grants an AggregateFilter.

type OPCUAAnnotation

type OPCUAAnnotation struct {
	Message        string
	UserName       string
	AnnotationTime time.Time
}

OPCUAAnnotation is an Annotation of historical data (OPC 10000-11 §6.6.6).

type OPCUAApplicationDescription

type OPCUAApplicationDescription struct {
	ApplicationURI      string
	ProductURI          string
	ApplicationName     OPCUALocalizedText
	ApplicationType     OPCUAApplicationType
	GatewayServerURI    string
	DiscoveryProfileURI string
	DiscoveryURLs       []string
}

OPCUAApplicationDescription describes a client or server application (OPC 10000-4 §7.2).

type OPCUAApplicationType

type OPCUAApplicationType uint32

OPCUAApplicationType is an ApplicationType (OPC 10000-4 §7.2.2).

const (
	OPCUAApplicationServer          OPCUAApplicationType = 0
	OPCUAApplicationClient          OPCUAApplicationType = 1
	OPCUAApplicationClientAndServer OPCUAApplicationType = 2
	OPCUAApplicationDiscoveryServer OPCUAApplicationType = 3
)

OPCUAApplicationType values.

func (OPCUAApplicationType) String

func (t OPCUAApplicationType) String() string

String returns the application type name.

type OPCUAArgument

type OPCUAArgument struct {
	Name            string
	DataType        OPCUANodeID
	ValueRank       int32
	ArrayDimensions []uint32
	Description     OPCUALocalizedText
}

OPCUAArgument describes a method argument (OPC 10000-3 §8.6), the value of the InputArguments and OutputArguments properties.

type OPCUAAsymmetricSecurityHeader

type OPCUAAsymmetricSecurityHeader struct {
	SecurityPolicyURI string
	// SenderCertificate is the DER certificate of the sender, followed
	// by those of its issuers when it sends its chain; Certificates
	// splits it.
	SenderCertificate []byte
	// ReceiverCertificateThumbprint is the SHA-1 of the DER certificate
	// the message is encrypted for, 20 bytes.
	ReceiverCertificateThumbprint []byte
}

OPCUAAsymmetricSecurityHeader opens an OPN message (OPC 10000-6 §6.7.2.3). The certificate and thumbprint are nil when null.

func (OPCUAAsymmetricSecurityHeader) Certificates

func (h OPCUAAsymmetricSecurityHeader) Certificates() [][]byte

Certificates splits SenderCertificate into its DER certificates: the sender's first, then its issuers'. It stops at the first byte that is not the start of a DER SEQUENCE that fits, and returns at most 16 certificates. The slices alias SenderCertificate.

type OPCUAAttributeID

type OPCUAAttributeID uint32

OPCUAAttributeID names a node attribute (OPC 10000-6 §A.1).

const (
	OPCUAAttributeNodeID                  OPCUAAttributeID = 1
	OPCUAAttributeNodeClass               OPCUAAttributeID = 2
	OPCUAAttributeBrowseName              OPCUAAttributeID = 3
	OPCUAAttributeDisplayName             OPCUAAttributeID = 4
	OPCUAAttributeDescription             OPCUAAttributeID = 5
	OPCUAAttributeWriteMask               OPCUAAttributeID = 6
	OPCUAAttributeUserWriteMask           OPCUAAttributeID = 7
	OPCUAAttributeIsAbstract              OPCUAAttributeID = 8
	OPCUAAttributeSymmetric               OPCUAAttributeID = 9
	OPCUAAttributeInverseName             OPCUAAttributeID = 10
	OPCUAAttributeContainsNoLoops         OPCUAAttributeID = 11
	OPCUAAttributeEventNotifier           OPCUAAttributeID = 12
	OPCUAAttributeValue                   OPCUAAttributeID = 13
	OPCUAAttributeDataType                OPCUAAttributeID = 14
	OPCUAAttributeValueRank               OPCUAAttributeID = 15
	OPCUAAttributeArrayDimensions         OPCUAAttributeID = 16
	OPCUAAttributeAccessLevel             OPCUAAttributeID = 17
	OPCUAAttributeUserAccessLevel         OPCUAAttributeID = 18
	OPCUAAttributeMinimumSamplingInterval OPCUAAttributeID = 19
	OPCUAAttributeHistorizing             OPCUAAttributeID = 20
	OPCUAAttributeExecutable              OPCUAAttributeID = 21
	OPCUAAttributeUserExecutable          OPCUAAttributeID = 22
	OPCUAAttributeDataTypeDefinition      OPCUAAttributeID = 23
	OPCUAAttributeRolePermissions         OPCUAAttributeID = 24
	OPCUAAttributeUserRolePermissions     OPCUAAttributeID = 25
	OPCUAAttributeAccessRestrictions      OPCUAAttributeID = 26
	OPCUAAttributeAccessLevelEx           OPCUAAttributeID = 27
)

OPCUAAttributeID values.

func (OPCUAAttributeID) String

func (a OPCUAAttributeID) String() string

String returns the attribute name.

type OPCUAAttributeOperand

type OPCUAAttributeOperand struct {
	NodeID      OPCUANodeID
	Alias       string
	BrowsePath  []OPCUARelativePathElement
	AttributeID OPCUAAttributeID
	IndexRange  string
}

OPCUAAttributeOperand names an attribute by a relative path from a node (OPC 10000-4 §7.7.4.4).

type OPCUAAxisInformation

type OPCUAAxisInformation struct {
	EngineeringUnits OPCUAEUInformation
	EURange          OPCUARange
	Title            OPCUALocalizedText
	AxisScaleType    uint32
	AxisSteps        []float64
}

OPCUAAxisInformation is an AxisInformation (OPC 10000-8 §5.6.6).

type OPCUABrowseDescription

type OPCUABrowseDescription struct {
	NodeID          OPCUANodeID
	BrowseDirection OPCUABrowseDirection
	ReferenceTypeID OPCUANodeID
	IncludeSubtypes bool
	NodeClassMask   uint32
	ResultMask      uint32
}

OPCUABrowseDescription is one node to browse.

type OPCUABrowseDirection

type OPCUABrowseDirection uint32

OPCUABrowseDirection is a BrowseDirection (OPC 10000-4 §7.5).

const (
	OPCUABrowseForward OPCUABrowseDirection = 0
	OPCUABrowseInverse OPCUABrowseDirection = 1
	OPCUABrowseBoth    OPCUABrowseDirection = 2
	OPCUABrowseInvalid OPCUABrowseDirection = 3
)

OPCUABrowseDirection values.

func (OPCUABrowseDirection) String

func (d OPCUABrowseDirection) String() string

String returns the direction name.

type OPCUABrowseNextRequest

type OPCUABrowseNextRequest struct {
	ReleaseContinuationPoints bool
	ContinuationPoints        [][]byte
}

OPCUABrowseNextRequest is the BrowseNext request (OPC 10000-4 §5.8.3).

type OPCUABrowsePath

type OPCUABrowsePath struct {
	StartingNode OPCUANodeID
	RelativePath []OPCUARelativePathElement
}

OPCUABrowsePath is a start node and the hops from it.

type OPCUABrowsePathResult

type OPCUABrowsePathResult struct {
	StatusCode OPCUAStatusCode
	Targets    []OPCUABrowsePathTarget
}

OPCUABrowsePathResult is the result of one browse path.

type OPCUABrowsePathTarget

type OPCUABrowsePathTarget struct {
	TargetID           OPCUANodeID
	RemainingPathIndex uint32
}

OPCUABrowsePathTarget is a node a browse path reaches; RemainingPathIndex is 0xFFFFFFFF when the whole path was followed.

type OPCUABrowseRequest

type OPCUABrowseRequest struct {
	View                          OPCUAViewDescription
	RequestedMaxReferencesPerNode uint32
	NodesToBrowse                 []OPCUABrowseDescription
}

OPCUABrowseRequest is the Browse request (OPC 10000-4 §5.8.2).

type OPCUABrowseResponse

type OPCUABrowseResponse struct {
	Results         []OPCUABrowseResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUABrowseResponse is the Browse and BrowseNext response.

type OPCUABrowseResult

type OPCUABrowseResult struct {
	StatusCode        OPCUAStatusCode
	ContinuationPoint []byte
	References        []OPCUAReferenceDescription
}

OPCUABrowseResult is the result of browsing one node (OPC 10000-4 §7.6).

type OPCUABuildInfo

type OPCUABuildInfo struct {
	ProductURI       string
	ManufacturerName string
	ProductName      string
	SoftwareVersion  string
	BuildNumber      string
	BuildDate        time.Time
}

OPCUABuildInfo is a BuildInfo (OPC 10000-5 §12.4).

type OPCUABuiltinType

type OPCUABuiltinType uint8

OPCUABuiltinType is a built-in type id (OPC 10000-6 §5.1.2), the type of a Variant.

const (
	OPCUATypeNull            OPCUABuiltinType = 0
	OPCUATypeBoolean         OPCUABuiltinType = 1
	OPCUATypeSByte           OPCUABuiltinType = 2
	OPCUATypeByte            OPCUABuiltinType = 3
	OPCUATypeInt16           OPCUABuiltinType = 4
	OPCUATypeUInt16          OPCUABuiltinType = 5
	OPCUATypeInt32           OPCUABuiltinType = 6
	OPCUATypeUInt32          OPCUABuiltinType = 7
	OPCUATypeInt64           OPCUABuiltinType = 8
	OPCUATypeUInt64          OPCUABuiltinType = 9
	OPCUATypeFloat           OPCUABuiltinType = 10
	OPCUATypeDouble          OPCUABuiltinType = 11
	OPCUATypeString          OPCUABuiltinType = 12
	OPCUATypeDateTime        OPCUABuiltinType = 13
	OPCUATypeGUID            OPCUABuiltinType = 14
	OPCUATypeByteString      OPCUABuiltinType = 15
	OPCUATypeXMLElement      OPCUABuiltinType = 16
	OPCUATypeNodeID          OPCUABuiltinType = 17
	OPCUATypeExpandedNodeID  OPCUABuiltinType = 18
	OPCUATypeStatusCode      OPCUABuiltinType = 19
	OPCUATypeQualifiedName   OPCUABuiltinType = 20
	OPCUATypeLocalizedText   OPCUABuiltinType = 21
	OPCUATypeExtensionObject OPCUABuiltinType = 22
	OPCUATypeDataValue       OPCUABuiltinType = 23
	OPCUATypeVariant         OPCUABuiltinType = 24
	OPCUATypeDiagnosticInfo  OPCUABuiltinType = 25
)

OPCUABuiltinType values.

func (OPCUABuiltinType) String

func (t OPCUABuiltinType) String() string

String returns the type name.

type OPCUACallMethodRequest

type OPCUACallMethodRequest struct {
	ObjectID       OPCUANodeID
	MethodID       OPCUANodeID
	InputArguments []OPCUAVariant
}

OPCUACallMethodRequest is one method to call.

type OPCUACallMethodResult

type OPCUACallMethodResult struct {
	StatusCode                   OPCUAStatusCode
	InputArgumentResults         []OPCUAStatusCode
	InputArgumentDiagnosticInfos []OPCUADiagnosticInfo
	OutputArguments              []OPCUAVariant
}

OPCUACallMethodResult is the result of one method call.

type OPCUACallRequest

type OPCUACallRequest struct {
	MethodsToCall []OPCUACallMethodRequest
}

OPCUACallRequest is the Call request (OPC 10000-4 §5.11.2).

type OPCUACallResponse

type OPCUACallResponse struct {
	Results         []OPCUACallMethodResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUACallResponse is the Call response.

type OPCUACancelRequest

type OPCUACancelRequest struct {
	RequestHandle uint32
}

OPCUACancelRequest is the Cancel request (OPC 10000-4 §5.6.5): the handle of the requests to cancel.

type OPCUACancelResponse

type OPCUACancelResponse struct {
	CancelCount uint32
}

OPCUACancelResponse is the Cancel response.

type OPCUAChannelSecurityToken

type OPCUAChannelSecurityToken struct {
	ChannelID uint32
	TokenID   uint32
	CreatedAt time.Time
	// RevisedLifetime is in milliseconds.
	RevisedLifetime uint32
}

OPCUAChannelSecurityToken identifies the keys of a secure channel.

type OPCUAChunkAssembler

type OPCUAChunkAssembler struct {
	// MaxMessageSize is the largest joined body, in bytes; 0 means
	// OPCUADefaultMaxMessageSize.
	MaxMessageSize int
	// MaxPending is the count of unfinished messages kept; 0 means
	// OPCUADefaultMaxPending. One more evicts the oldest.
	MaxPending int
	// SignatureSize is the count of bytes at the end of every chunk body
	// that are a signature rather than message. 0 derives it from the
	// security policy of the OPN seen, and is no signature when none
	// was; any other value overrides the policy.
	SignatureSize int
	// contains filtered or unexported fields
}

OPCUAChunkAssembler joins the chunks of long messages. It serves one direction of one connection: feed Add the OPN, MSG and CLO layers of that direction in the order they were sent, after TCP reassembly. Chunks are matched by message type, SecureChannelID and RequestID.

Memory is bounded by MaxPending bodies of MaxMessageSize bytes. A joined body is then decoded like any other, which can take up to 130 times its size (an array of empty DataValues, 1 byte each on the wire), so MaxMessageSize also bounds that.

Only plaintext joins, and nothing is decrypted. The assembler learns the security policy from the OPN it is fed:

  • Policy None: chunks are plaintext without signature.
  • Any other policy: the mode is Sign or SignAndEncrypt, which the OPN does not show. The first MSG after it decides: a body that opens with the type id of a known service is plaintext with a signature at its end, sized by the policy (OPCUASignatureSize); anything else is ciphertext. The MSG and CLO of an encrypted channel are returned one by one, unjoined, as copies with Encrypted set and EncryptedData holding the ciphertext.
  • No OPN seen: chunks are taken as plaintext, with SignatureSize bytes of signature.

A lost chunk shows as a hole in the sequence numbers of the plaintext chunks. The numbers do not say which message lost it, so every message then pending is dropped: its final chunk returns ErrOPCUAChunkLost. Lost counts the holes.

The zero value is ready to use. An assembler is not safe for concurrent use.

func (*OPCUAChunkAssembler) Add

func (a *OPCUAChunkAssembler) Add(ua *OPCUA) (*OPCUA, error)

Add takes the next layer and returns the message it completes.

  • A final chunk with nothing pending is a whole message: it is returned as it is.

  • An intermediate chunk is copied and kept; Add returns nil.

  • A final chunk that ends a pending message returns a copy of it whose Body is the joined body and whose Service is decoded from it. The other fields, MessageSize and SequenceNumber among them, are those of the final chunk.

  • An abort chunk drops the pending message and is returned as it is; its Error tells why the sender gave up.

  • HEL, ACK, ERR and RHE are never chunked and are returned as they are.

  • An encrypted message, an OPN under a policy other than None or any MSG or CLO of a channel in mode SignAndEncrypt, is returned at once with Encrypted set, whatever its chunk type.

ErrOPCUAMessageTooLarge is returned for the chunk that passes MaxMessageSize and for every later chunk of that message, which is dropped. ErrOPCUAChunkLost is returned for the final chunk of a message that lost a chunk. ErrOPCUAMalformed is returned for an unknown chunk type and for a chunk shorter than its signature.

func (*OPCUAChunkAssembler) Lost

func (a *OPCUAChunkAssembler) Lost() int

Lost returns the count of holes seen in the sequence numbers, each one or more lost chunks.

func (*OPCUAChunkAssembler) Pending

func (a *OPCUAChunkAssembler) Pending() int

Pending returns the count of unfinished messages.

func (*OPCUAChunkAssembler) SecurityPolicyURI

func (a *OPCUAChunkAssembler) SecurityPolicyURI() (string, bool)

SecurityPolicyURI returns the policy of the last OPN fed to Add, and whether there was one.

type OPCUAChunkType

type OPCUAChunkType uint8

OPCUAChunkType tells a final chunk from an intermediate or aborted one.

const (
	OPCUAChunkFinal        OPCUAChunkType = 'F'
	OPCUAChunkIntermediate OPCUAChunkType = 'C'
	OPCUAChunkAbort        OPCUAChunkType = 'A'
)

OPCUAChunkType values.

func (OPCUAChunkType) String

func (c OPCUAChunkType) String() string

String returns the chunk type letter.

type OPCUACloseSessionRequest

type OPCUACloseSessionRequest struct {
	DeleteSubscriptions bool
}

OPCUACloseSessionRequest is the CloseSession request (OPC 10000-4 §5.6.4).

type OPCUAComplexNumber

type OPCUAComplexNumber struct {
	Real      float32
	Imaginary float32
}

OPCUAComplexNumber is a ComplexNumberType (OPC 10000-8 §5.6.4).

type OPCUAComplianceLevel

type OPCUAComplianceLevel uint32

OPCUAComplianceLevel tells how a profile was tested (OPC UA 1.02).

const (
	OPCUAComplianceUntested   OPCUAComplianceLevel = 0
	OPCUACompliancePartial    OPCUAComplianceLevel = 1
	OPCUAComplianceSelfTested OPCUAComplianceLevel = 2
	OPCUAComplianceCertified  OPCUAComplianceLevel = 3
)

OPCUAComplianceLevel values.

func (OPCUAComplianceLevel) String

func (l OPCUAComplianceLevel) String() string

String returns the level name.

type OPCUAConfigurationVersion

type OPCUAConfigurationVersion struct {
	MajorVersion uint32
	MinorVersion uint32
}

OPCUAConfigurationVersion is a ConfigurationVersionDataType (OPC 10000-14 §6.2.3.2.6): two VersionTimes.

type OPCUAConnectionLimits

type OPCUAConnectionLimits struct {
	ProtocolVersion   uint32
	ReceiveBufferSize uint32
	SendBufferSize    uint32
	// MaxMessageSize and MaxChunkCount are 0 for no limit.
	MaxMessageSize uint32
	MaxChunkCount  uint32
}

OPCUAConnectionLimits are the buffer and message limits that Hello proposes and Acknowledge settles (OPC 10000-6 §7.1.2.3, 7.1.2.4).

type OPCUAContentFilter

type OPCUAContentFilter struct {
	Elements []OPCUAContentFilterElement
}

OPCUAContentFilter is a ContentFilter (OPC 10000-4 §7.7.1), the where clause of an EventFilter and the filter of a query.

type OPCUAContentFilterElement

type OPCUAContentFilterElement struct {
	FilterOperator OPCUAFilterOperator
	FilterOperands []OPCUAExtensionObject
}

OPCUAContentFilterElement is one operator of a ContentFilter and its operands: each Value is an *OPCUAElementOperand, *OPCUALiteralOperand, *OPCUAAttributeOperand or *OPCUASimpleAttributeOperand.

type OPCUAContentFilterElementResult

type OPCUAContentFilterElementResult struct {
	StatusCode             OPCUAStatusCode
	OperandStatusCodes     []OPCUAStatusCode
	OperandDiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAContentFilterElementResult is the status of one filter element.

type OPCUAContentFilterResult

type OPCUAContentFilterResult struct {
	ElementResults         []OPCUAContentFilterElementResult
	ElementDiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAContentFilterResult is the status of a ContentFilter (OPC 10000-4 §7.7.2).

type OPCUACreateItemsRequest

type OPCUACreateItemsRequest struct {
	SubscriptionID     uint32
	TimestampsToReturn OPCUATimestampsToReturn
	ItemsToCreate      []OPCUAMonitoredItemCreate
}

OPCUACreateItemsRequest is the CreateMonitoredItems request (OPC 10000-4 §5.12.2).

type OPCUACreateItemsResponse

type OPCUACreateItemsResponse struct {
	Results         []OPCUAMonitoredItemCreateResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUACreateItemsResponse is the CreateMonitoredItems response.

type OPCUACreateSessionRequest

type OPCUACreateSessionRequest struct {
	ClientDescription OPCUAApplicationDescription
	ServerURI         string
	EndpointURL       string
	SessionName       string
	ClientNonce       []byte
	ClientCertificate []byte
	// RequestedSessionTimeout is in milliseconds.
	RequestedSessionTimeout float64
	MaxResponseMessageSize  uint32
}

OPCUACreateSessionRequest is the CreateSession request (OPC 10000-4 §5.6.2).

type OPCUACreateSessionResponse

type OPCUACreateSessionResponse struct {
	SessionID           OPCUANodeID
	AuthenticationToken OPCUANodeID
	// RevisedSessionTimeout is in milliseconds.
	RevisedSessionTimeout      float64
	ServerNonce                []byte
	ServerCertificate          []byte
	ServerEndpoints            []OPCUAEndpointDescription
	ServerSoftwareCertificates []OPCUASignedSoftwareCertificate
	ServerSignature            OPCUASignatureData
	MaxRequestMessageSize      uint32
}

OPCUACreateSessionResponse is the CreateSession response.

type OPCUACreateSubRequest

type OPCUACreateSubRequest struct {
	OPCUASubscriptionParams
	PublishingEnabled bool
	Priority          uint8
}

OPCUACreateSubRequest is the CreateSubscription request (OPC 10000-4 §5.13.2).

type OPCUACreateSubResponse

type OPCUACreateSubResponse struct {
	SubscriptionID uint32
	OPCUASubscriptionRevision
}

OPCUACreateSubResponse is the CreateSubscription response.

type OPCUADataChangeFilter

type OPCUADataChangeFilter struct {
	Trigger       uint32
	DeadbandType  uint32
	DeadbandValue float64
}

OPCUADataChangeFilter is the filter of a monitored value (OPC 10000-4 §7.22.2). Trigger is 0 Status, 1 StatusValue, 2 StatusValueTimestamp; DeadbandType is 0 None, 1 Absolute, 2 Percent.

type OPCUADataChangeNotification

type OPCUADataChangeNotification struct {
	MonitoredItems  []OPCUAMonitoredItemNotif
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUADataChangeNotification reports changed values (OPC 10000-4 §7.25.2).

type OPCUADataSetEncoding

type OPCUADataSetEncoding uint8

OPCUADataSetEncoding is the encoding of the fields of a DataSetMessage.

const (
	OPCUADataSetVariant   OPCUADataSetEncoding = 0
	OPCUADataSetRawData   OPCUADataSetEncoding = 1
	OPCUADataSetDataValue OPCUADataSetEncoding = 2
)

OPCUADataSetEncoding values.

func (OPCUADataSetEncoding) String

func (e OPCUADataSetEncoding) String() string

String returns the encoding name.

type OPCUADataSetFlags1

type OPCUADataSetFlags1 uint8

OPCUADataSetFlags1 is the DataSetFlags1 octet of a DataSetMessage.

const (
	OPCUADataSetValid        OPCUADataSetFlags1 = 0x01
	OPCUADataSetEncodingMask OPCUADataSetFlags1 = 0x06
	OPCUADataSetSequence     OPCUADataSetFlags1 = 0x08
	OPCUADataSetStatus       OPCUADataSetFlags1 = 0x10
	OPCUADataSetMajorVersion OPCUADataSetFlags1 = 0x20
	OPCUADataSetMinorVersion OPCUADataSetFlags1 = 0x40
	OPCUADataSetFlags2Follow OPCUADataSetFlags1 = 0x80
)

OPCUADataSetFlags1 bits; bits 1 and 2 give the field encoding.

type OPCUADataSetFlags2

type OPCUADataSetFlags2 uint8

OPCUADataSetFlags2 is the DataSetFlags2 octet of a DataSetMessage.

const (
	OPCUADataSetTypeMask    OPCUADataSetFlags2 = 0x0F
	OPCUADataSetTimestamp   OPCUADataSetFlags2 = 0x10
	OPCUADataSetPicoSeconds OPCUADataSetFlags2 = 0x20
)

OPCUADataSetFlags2 bits; the low four give the DataSetMessage type.

type OPCUADataSetMessage

type OPCUADataSetMessage struct {
	// WriterID is the DataSetWriterId of the payload header, 0 without
	// one.
	WriterID uint16
	Flags1   OPCUADataSetFlags1
	Flags2   OPCUADataSetFlags2
	Encoding OPCUADataSetEncoding
	Type     OPCUADataSetMessageType

	SequenceNumber uint16
	Timestamp      time.Time
	// PicoSeconds counts 10 ps steps to add to Timestamp.
	PicoSeconds uint16
	// Status is the high 16 bits of a StatusCode.
	Status uint16
	// ConfigMajorVersion and ConfigMinorVersion are VersionTimes.
	ConfigMajorVersion uint32
	ConfigMinorVersion uint32

	// FieldCount is the count sent; a key frame of RawData sends none,
	// and a heartbeat, a key frame that ends with its header, neither.
	FieldCount   uint16
	FieldIndexes []uint16
	Variants     []OPCUAVariant
	DataValues   []OPCUADataValue
	RawData      []byte

	// Padding is what follows the fields up to the size the payload
	// gives the message. Without sizes it is part of the Trailer of the
	// NetworkMessage.
	Padding []byte
	// Undecoded is the message after its header when the fields were
	// not decoded: the valid bit is clear, the encoding or type is
	// reserved or an action, or a field does not parse. It is the whole
	// message when its header does not parse.
	Undecoded []byte
}

OPCUADataSetMessage is one DataSetMessage of a NetworkMessage (OPC 10000-14 §7.2.4.5.4). The header fields are set as Flags1 and Flags2 announce them.

The fields decode by Encoding and Type:

Variant    key frame, event   Variants, in DataSet order
Variant    delta frame        Variants, with FieldIndexes beside
DataValue  key frame          DataValues, in DataSet order
DataValue  delta frame        DataValues, with FieldIndexes beside
RawData    key frame          RawData: the fields back to back, which
                              only the DataSetMetaData can split
RawData    delta frame        FieldCount, and RawData: index and
                              value of every field
any        keep alive         no fields

func (*OPCUADataSetMessage) Valid

func (m *OPCUADataSetMessage) Valid() bool

Valid reports whether the valid bit is set; a subscriber skips the message otherwise, and the fields are not decoded.

type OPCUADataSetMessageType

type OPCUADataSetMessageType uint8

OPCUADataSetMessageType is the UADP DataSetMessage type.

const (
	OPCUADataSetKeyFrame       OPCUADataSetMessageType = 0
	OPCUADataSetDeltaFrame     OPCUADataSetMessageType = 1
	OPCUADataSetEvent          OPCUADataSetMessageType = 2
	OPCUADataSetKeepAlive      OPCUADataSetMessageType = 3
	OPCUADataSetActionRequest  OPCUADataSetMessageType = 5
	OPCUADataSetActionResponse OPCUADataSetMessageType = 6
)

OPCUADataSetMessageType values.

func (OPCUADataSetMessageType) String

func (t OPCUADataSetMessageType) String() string

String returns the type name.

type OPCUADataSetMetaData

type OPCUADataSetMetaData struct {
	OPCUADataTypeSchemaHeader
	Name                 string
	Description          OPCUALocalizedText
	Fields               []OPCUAFieldMetaData
	DataSetClassID       OPCUAGUID
	ConfigurationVersion OPCUAConfigurationVersion
}

OPCUADataSetMetaData is a DataSetMetaDataType (OPC 10000-14 §6.2.3.2.3): the fields of a DataSet, which is what the RawData of a DataSetMessage is laid out by.

type OPCUADataTypeAttributes

type OPCUADataTypeAttributes struct {
	OPCUANodeAttributes
	IsAbstract bool
}

OPCUADataTypeAttributes are the attributes of a DataType node.

type OPCUADataTypeNode

type OPCUADataTypeNode struct {
	OPCUANode
	IsAbstract bool
	// DataTypeDefinition is not sent in the layout of OPC UA 1.03.
	DataTypeDefinition OPCUAExtensionObject
}

OPCUADataTypeNode is a DataTypeNode (OPC 10000-3 §5.8.3).

type OPCUADataTypeSchemaHeader

type OPCUADataTypeSchemaHeader struct {
	Namespaces         []string
	StructureDataTypes []OPCUAStructureDescription
	EnumDataTypes      []OPCUAEnumDescription
	SimpleDataTypes    []OPCUASimpleTypeDescription
}

OPCUADataTypeSchemaHeader holds the types a DataSet uses beyond the standard ones (OPC 10000-5 §12.31).

type OPCUADataValue

type OPCUADataValue struct {
	Mask              uint8
	Value             OPCUAVariant
	Status            OPCUAStatusCode
	SourceTimestamp   time.Time
	SourcePicoseconds uint16
	ServerTimestamp   time.Time
	ServerPicoseconds uint16
}

OPCUADataValue is a DataValue (OPC 10000-6 §5.2.2.17); Mask tells which fields were present. An absent Status is Good.

type OPCUADeleteAtTimeDetails

type OPCUADeleteAtTimeDetails struct {
	NodeID   OPCUANodeID
	ReqTimes []time.Time
}

OPCUADeleteAtTimeDetails deletes the values at given times (OPC 10000-11 §6.8.6).

type OPCUADeleteEventDetails

type OPCUADeleteEventDetails struct {
	NodeID   OPCUANodeID
	EventIDs [][]byte
}

OPCUADeleteEventDetails deletes events by id (OPC 10000-11 §6.8.7).

type OPCUADeleteItemsRequest

type OPCUADeleteItemsRequest struct {
	SubscriptionID   uint32
	MonitoredItemIDs []uint32
}

OPCUADeleteItemsRequest is the DeleteMonitoredItems request (OPC 10000-4 §5.12.6).

type OPCUADeleteNodesItem

type OPCUADeleteNodesItem struct {
	NodeID                 OPCUANodeID
	DeleteTargetReferences bool
}

OPCUADeleteNodesItem is one node to delete (OPC 10000-4 §5.7.4).

type OPCUADeleteNodesRequest

type OPCUADeleteNodesRequest struct {
	NodesToDelete []OPCUADeleteNodesItem
}

OPCUADeleteNodesRequest is the DeleteNodes request.

type OPCUADeleteRawModifiedDetails

type OPCUADeleteRawModifiedDetails struct {
	NodeID           OPCUANodeID
	IsDeleteModified bool
	StartTime        time.Time
	EndTime          time.Time
}

OPCUADeleteRawModifiedDetails deletes the values of a time range (OPC 10000-11 §6.8.5).

type OPCUADeleteReferencesItem

type OPCUADeleteReferencesItem struct {
	SourceNodeID        OPCUANodeID
	ReferenceTypeID     OPCUANodeID
	IsForward           bool
	TargetNodeID        OPCUANodeID
	DeleteBidirectional bool
}

OPCUADeleteReferencesItem is one reference to delete (OPC 10000-4 §5.7.5).

type OPCUADeleteReferencesRequest

type OPCUADeleteReferencesRequest struct {
	ReferencesToDelete []OPCUADeleteReferencesItem
}

OPCUADeleteReferencesRequest is the DeleteReferences request.

type OPCUADiagnosticInfo

type OPCUADiagnosticInfo struct {
	Mask            uint8
	SymbolicID      int32
	NamespaceURI    int32
	Locale          int32
	LocalizedText   int32
	AdditionalInfo  string
	InnerStatusCode OPCUAStatusCode
	Inner           *OPCUADiagnosticInfo
}

OPCUADiagnosticInfo is a DiagnosticInfo (OPC 10000-6 §5.2.2.12). The int32 fields index the response string table; -1 means absent.

type OPCUADoubleComplex

type OPCUADoubleComplex struct {
	Real      float64
	Imaginary float64
}

OPCUADoubleComplex is a DoubleComplexNumberType (OPC 10000-8 §5.6.5).

type OPCUAEUInformation

type OPCUAEUInformation struct {
	NamespaceURI string
	UnitID       int32
	DisplayName  OPCUALocalizedText
	Description  OPCUALocalizedText
}

OPCUAEUInformation is an engineering unit (OPC 10000-8 §5.6.3).

type OPCUAElementOperand

type OPCUAElementOperand struct {
	Index uint32
}

OPCUAElementOperand refers to another element of the same ContentFilter (OPC 10000-4 §7.7.4.2).

type OPCUAEndpointConfiguration

type OPCUAEndpointConfiguration struct {
	OperationTimeout      int32
	UseBinaryEncoding     bool
	MaxStringLength       int32
	MaxByteStringLength   int32
	MaxArrayLength        int32
	MaxMessageSize        int32
	MaxBufferSize         int32
	ChannelLifetime       int32
	SecurityTokenLifetime int32
}

OPCUAEndpointConfiguration is an EndpointConfiguration (OPC 10000-4 §7.9 of OPC UA 1.03): the limits a client proposes to an endpoint. The times are in milliseconds.

type OPCUAEndpointDescription

type OPCUAEndpointDescription struct {
	EndpointURL         string
	Server              OPCUAApplicationDescription
	ServerCertificate   []byte
	SecurityMode        OPCUAMessageSecurityMode
	SecurityPolicyURI   string
	UserIdentityTokens  []OPCUAUserTokenPolicy
	TransportProfileURI string
	SecurityLevel       uint8
}

OPCUAEndpointDescription describes a server endpoint (OPC 10000-4 §7.14).

type OPCUAEndpointURLList

type OPCUAEndpointURLList struct {
	EndpointURLList []string
}

OPCUAEndpointURLList is an EndpointUrlListDataType (OPC 10000-5 §12.19).

type OPCUAEnumDefinition

type OPCUAEnumDefinition struct {
	Fields []OPCUAEnumField
}

OPCUAEnumDefinition lists the values of an enumeration (OPC 10000-3 §8.50).

type OPCUAEnumDescription

type OPCUAEnumDescription struct {
	DataTypeID  OPCUANodeID
	Name        OPCUAQualifiedName
	Definition  OPCUAEnumDefinition
	BuiltInType OPCUABuiltinType
}

OPCUAEnumDescription names an enumeration and gives its values.

type OPCUAEnumField

type OPCUAEnumField struct {
	OPCUAEnumValueType
	Name string
}

OPCUAEnumField is one value of an enumeration (OPC 10000-3 §8.52).

type OPCUAEnumValueType

type OPCUAEnumValueType struct {
	Value       int64
	DisplayName OPCUALocalizedText
	Description OPCUALocalizedText
}

OPCUAEnumValueType is one value of an enumeration (OPC 10000-3 §8.40).

type OPCUAError

type OPCUAError struct {
	Error  OPCUAStatusCode
	Reason string
}

OPCUAError is the body of an ERR message or of an abort chunk.

type OPCUAEventFieldList

type OPCUAEventFieldList struct {
	ClientHandle uint32
	EventFields  []OPCUAVariant
}

OPCUAEventFieldList is the selected fields of one event.

type OPCUAEventFilter

type OPCUAEventFilter struct {
	SelectClauses []OPCUASimpleAttributeOperand
	WhereClause   OPCUAContentFilter
}

OPCUAEventFilter selects the fields of the events to report and the events themselves (OPC 10000-4 §7.22.3).

type OPCUAEventFilterResult

type OPCUAEventFilterResult struct {
	SelectClauseResults         []OPCUAStatusCode
	SelectClauseDiagnosticInfos []OPCUADiagnosticInfo
	WhereClauseResult           OPCUAContentFilterResult
}

OPCUAEventFilterResult is the status a server gives an EventFilter.

type OPCUAEventNotificationList

type OPCUAEventNotificationList struct {
	Events []OPCUAEventFieldList
}

OPCUAEventNotificationList reports events (OPC 10000-4 §7.25.3).

type OPCUAExtensionObject

type OPCUAExtensionObject struct {
	TypeID OPCUANodeID
	// Encoding is 0 for no body, 1 for a ByteString body, 2 for XML.
	Encoding uint8
	// Body is the body as sent, always kept.
	Body []byte
	// Value is the decoded body when TypeID is the binary encoding id of a
	// structure this package knows: a pointer to its type, such as
	// *OPCUADataChangeFilter or *OPCUAArgument. It is nil for any other
	// type, for a body that does not parse to its last byte, and for a
	// body nested more than opcuaMaxExtDepth ExtensionObjects deep.
	Value interface{}
}

OPCUAExtensionObject is an ExtensionObject (OPC 10000-6 §5.2.2.15).

type OPCUAFieldMetaData

type OPCUAFieldMetaData struct {
	Name            string
	Description     OPCUALocalizedText
	FieldFlags      uint16
	BuiltInType     OPCUABuiltinType
	DataType        OPCUANodeID
	ValueRank       int32
	ArrayDimensions []uint32
	MaxStringLength uint32
	DataSetFieldID  OPCUAGUID
	Properties      []OPCUAKeyValuePair
}

OPCUAFieldMetaData describes one field of a DataSet (OPC 10000-14 §6.2.3.2.4). FieldFlags bit 0 marks a promoted field.

type OPCUAFilterOperator

type OPCUAFilterOperator uint32

OPCUAFilterOperator is a FilterOperator (OPC 10000-4 §7.7.3).

const (
	OPCUAFilterEquals             OPCUAFilterOperator = 0
	OPCUAFilterIsNull             OPCUAFilterOperator = 1
	OPCUAFilterGreaterThan        OPCUAFilterOperator = 2
	OPCUAFilterLessThan           OPCUAFilterOperator = 3
	OPCUAFilterGreaterThanOrEqual OPCUAFilterOperator = 4
	OPCUAFilterLessThanOrEqual    OPCUAFilterOperator = 5
	OPCUAFilterLike               OPCUAFilterOperator = 6
	OPCUAFilterNot                OPCUAFilterOperator = 7
	OPCUAFilterBetween            OPCUAFilterOperator = 8
	OPCUAFilterInList             OPCUAFilterOperator = 9
	OPCUAFilterAnd                OPCUAFilterOperator = 10
	OPCUAFilterOr                 OPCUAFilterOperator = 11
	OPCUAFilterCast               OPCUAFilterOperator = 12
	OPCUAFilterInView             OPCUAFilterOperator = 13
	OPCUAFilterOfType             OPCUAFilterOperator = 14
	OPCUAFilterRelatedTo          OPCUAFilterOperator = 15
	OPCUAFilterBitwiseAnd         OPCUAFilterOperator = 16
	OPCUAFilterBitwiseOr          OPCUAFilterOperator = 17
)

OPCUAFilterOperator values.

func (OPCUAFilterOperator) String

func (o OPCUAFilterOperator) String() string

String returns the operator name.

type OPCUAFindOnNetworkRequest

type OPCUAFindOnNetworkRequest struct {
	StartingRecordID       uint32
	MaxRecordsToReturn     uint32
	ServerCapabilityFilter []string
}

OPCUAFindOnNetworkRequest is the FindServersOnNetwork request (OPC 10000-4 §5.4.3).

type OPCUAFindOnNetworkResponse

type OPCUAFindOnNetworkResponse struct {
	LastCounterResetTime time.Time
	Servers              []OPCUAServerOnNetwork
}

OPCUAFindOnNetworkResponse is the FindServersOnNetwork response.

type OPCUAFindServersRequest

type OPCUAFindServersRequest struct {
	EndpointURL string
	LocaleIDs   []string
	ServerURIs  []string
}

OPCUAFindServersRequest is the FindServers request (OPC 10000-4 §5.4.2).

type OPCUAFindServersResponse

type OPCUAFindServersResponse struct {
	Servers []OPCUAApplicationDescription
}

OPCUAFindServersResponse is the FindServers response.

type OPCUAGUID

type OPCUAGUID [opcuaGUIDLen]byte

OPCUAGUID is a Guid as it appears on the wire: Data1 to Data3 little endian, Data4 as bytes.

func (OPCUAGUID) String

func (g OPCUAGUID) String() string

String returns the GUID in its canonical text form.

type OPCUAGenericAttributeValue

type OPCUAGenericAttributeValue struct {
	AttributeID OPCUAAttributeID
	Value       OPCUAVariant
}

OPCUAGenericAttributeValue is one attribute of GenericAttributes.

type OPCUAGenericAttributes

type OPCUAGenericAttributes struct {
	OPCUANodeAttributes
	AttributeValues []OPCUAGenericAttributeValue
}

OPCUAGenericAttributes lists attributes by id, for any node class.

type OPCUAGetEndpointsRequest

type OPCUAGetEndpointsRequest struct {
	EndpointURL string
	LocaleIDs   []string
	ProfileURIs []string
}

OPCUAGetEndpointsRequest is the GetEndpoints request (OPC 10000-4 §5.4.4).

type OPCUAGetEndpointsResponse

type OPCUAGetEndpointsResponse struct {
	Endpoints []OPCUAEndpointDescription
}

OPCUAGetEndpointsResponse is the GetEndpoints response (OPC 10000-4 §5.4.4).

type OPCUAHello

type OPCUAHello struct {
	OPCUAConnectionLimits
	EndpointURL string
}

OPCUAHello is the body of a HEL message.

type OPCUAHistoryData

type OPCUAHistoryData struct {
	DataValues []OPCUADataValue
}

OPCUAHistoryData is the history of a variable (OPC 10000-11 §6.5.2).

type OPCUAHistoryEvent

type OPCUAHistoryEvent struct {
	Events []OPCUAHistoryEventFieldList
}

OPCUAHistoryEvent is the history of events (OPC 10000-11 §6.5.4).

type OPCUAHistoryEventFieldList

type OPCUAHistoryEventFieldList struct {
	EventFields []OPCUAVariant
}

OPCUAHistoryEventFieldList is the selected fields of one past event.

type OPCUAHistoryModifiedData

type OPCUAHistoryModifiedData struct {
	DataValues        []OPCUADataValue
	ModificationInfos []OPCUAModificationInfo
}

OPCUAHistoryModifiedData is the modified history of a variable (OPC 10000-11 §6.5.3).

type OPCUAHistoryModifiedEvent

type OPCUAHistoryModifiedEvent struct {
	Events            []OPCUAHistoryEventFieldList
	ModificationInfos []OPCUAModificationInfo
}

OPCUAHistoryModifiedEvent is the modified history of events (OPC 10000-11 §6.6.5).

type OPCUAHistoryReadRequest

type OPCUAHistoryReadRequest struct {
	HistoryReadDetails        OPCUAExtensionObject
	TimestampsToReturn        OPCUATimestampsToReturn
	ReleaseContinuationPoints bool
	NodesToRead               []OPCUAHistoryReadValueID
}

OPCUAHistoryReadRequest is the HistoryRead request (OPC 10000-4 §5.10.3). The Value of HistoryReadDetails is an *OPCUAReadRawModifiedDetails, *OPCUAReadEventDetails, *OPCUAReadProcessedDetails or *OPCUAReadAtTimeDetails.

type OPCUAHistoryReadResponse

type OPCUAHistoryReadResponse struct {
	Results         []OPCUAHistoryReadResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAHistoryReadResponse is the HistoryRead response.

type OPCUAHistoryReadResult

type OPCUAHistoryReadResult struct {
	StatusCode        OPCUAStatusCode
	ContinuationPoint []byte
	HistoryData       OPCUAExtensionObject
}

OPCUAHistoryReadResult is the history of one node. The Value of HistoryData is an *OPCUAHistoryData, *OPCUAHistoryModifiedData or *OPCUAHistoryEvent.

type OPCUAHistoryReadValueID

type OPCUAHistoryReadValueID struct {
	NodeID            OPCUANodeID
	IndexRange        string
	DataEncoding      OPCUAQualifiedName
	ContinuationPoint []byte
}

OPCUAHistoryReadValueID is one node a HistoryRead reads.

type OPCUAHistoryUpdateDetails

type OPCUAHistoryUpdateDetails struct {
	NodeID OPCUANodeID
}

OPCUAHistoryUpdateDetails is the base of the history update details: the node alone.

type OPCUAHistoryUpdateRequest

type OPCUAHistoryUpdateRequest struct {
	HistoryUpdateDetails []OPCUAExtensionObject
}

OPCUAHistoryUpdateRequest is the HistoryUpdate request (OPC 10000-4 §5.10.5). The Value of each entry is a pointer to one of the update or delete details, such as *OPCUAUpdateDataDetails.

type OPCUAHistoryUpdateResponse

type OPCUAHistoryUpdateResponse struct {
	Results         []OPCUAHistoryUpdateResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAHistoryUpdateResponse is the HistoryUpdate response.

type OPCUAHistoryUpdateResult

type OPCUAHistoryUpdateResult struct {
	StatusCode       OPCUAStatusCode
	OperationResults []OPCUAStatusCode
	DiagnosticInfos  []OPCUADiagnosticInfo
}

OPCUAHistoryUpdateResult is the result of one history update.

type OPCUAKeyValuePair

type OPCUAKeyValuePair struct {
	Key   OPCUAQualifiedName
	Value OPCUAVariant
}

OPCUAKeyValuePair is a KeyValuePair (OPC 10000-5 §12.21).

type OPCUALiteralOperand

type OPCUALiteralOperand struct {
	Value OPCUAVariant
}

OPCUALiteralOperand is a literal value (OPC 10000-4 §7.7.4.3).

type OPCUALocalizedText

type OPCUALocalizedText struct {
	Mask   uint8
	Locale string
	Text   string
}

OPCUALocalizedText is a LocalizedText; Mask tells which fields were present.

type OPCUAMdnsDiscoveryConfig

type OPCUAMdnsDiscoveryConfig struct {
	MdnsServerName     string
	ServerCapabilities []string
}

OPCUAMdnsDiscoveryConfig is the MdnsDiscoveryConfiguration a RegisterServer2 request carries (OPC 10000-12 §5.3.2).

type OPCUAMessageSecurityMode

type OPCUAMessageSecurityMode uint32

OPCUAMessageSecurityMode is a MessageSecurityMode (OPC 10000-4 §7.20).

const (
	OPCUASecurityModeInvalid        OPCUAMessageSecurityMode = 0
	OPCUASecurityModeNone           OPCUAMessageSecurityMode = 1
	OPCUASecurityModeSign           OPCUAMessageSecurityMode = 2
	OPCUASecurityModeSignAndEncrypt OPCUAMessageSecurityMode = 3
)

OPCUAMessageSecurityMode values.

func (OPCUAMessageSecurityMode) String

func (m OPCUAMessageSecurityMode) String() string

String returns the mode name.

type OPCUAMessageType

type OPCUAMessageType uint32

OPCUAMessageType is the three-letter transport message type, packed big endian into the low 24 bits.

const (
	OPCUAMessageHello              OPCUAMessageType = 'H'<<16 | 'E'<<8 | 'L'
	OPCUAMessageAcknowledge        OPCUAMessageType = 'A'<<16 | 'C'<<8 | 'K'
	OPCUAMessageError              OPCUAMessageType = 'E'<<16 | 'R'<<8 | 'R'
	OPCUAMessageReverseHello       OPCUAMessageType = 'R'<<16 | 'H'<<8 | 'E'
	OPCUAMessageOpenSecureChannel  OPCUAMessageType = 'O'<<16 | 'P'<<8 | 'N'
	OPCUAMessageSecure             OPCUAMessageType = 'M'<<16 | 'S'<<8 | 'G'
	OPCUAMessageCloseSecureChannel OPCUAMessageType = 'C'<<16 | 'L'<<8 | 'O'
)

OPCUAMessageType values.

func (OPCUAMessageType) String

func (t OPCUAMessageType) String() string

String returns the three letters of the type.

type OPCUAMethodAttributes

type OPCUAMethodAttributes struct {
	OPCUANodeAttributes
	Executable     bool
	UserExecutable bool
}

OPCUAMethodAttributes are the attributes of a Method node.

type OPCUAMethodNode

type OPCUAMethodNode struct {
	OPCUANode
	Executable     bool
	UserExecutable bool
}

OPCUAMethodNode is a MethodNode (OPC 10000-3 §5.7).

type OPCUAModelChange

type OPCUAModelChange struct {
	Affected     OPCUANodeID
	AffectedType OPCUANodeID
	Verb         uint8
}

OPCUAModelChange is a ModelChangeStructureDataType (OPC 10000-5 §12.16).

type OPCUAModificationInfo

type OPCUAModificationInfo struct {
	ModificationTime time.Time
	UpdateType       uint32
	UserName         string
}

OPCUAModificationInfo tells who changed a historical value and how. UpdateType is 1 Insert, 2 Replace, 3 Update, 4 Delete.

type OPCUAModifyItemsRequest

type OPCUAModifyItemsRequest struct {
	SubscriptionID     uint32
	TimestampsToReturn OPCUATimestampsToReturn
	ItemsToModify      []OPCUAMonitoredItemModify
}

OPCUAModifyItemsRequest is the ModifyMonitoredItems request (OPC 10000-4 §5.12.3).

type OPCUAModifyItemsResponse

type OPCUAModifyItemsResponse struct {
	Results         []OPCUAMonitoredItemModifyResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAModifyItemsResponse is the ModifyMonitoredItems response.

type OPCUAModifySubRequest

type OPCUAModifySubRequest struct {
	SubscriptionID uint32
	OPCUASubscriptionParams
	Priority uint8
}

OPCUAModifySubRequest is the ModifySubscription request (OPC 10000-4 §5.13.3).

type OPCUAMonitoredItemCreate

type OPCUAMonitoredItemCreate struct {
	ItemToMonitor       OPCUAReadValueID
	MonitoringMode      OPCUAMonitoringMode
	RequestedParameters OPCUAMonitoringParameters
}

OPCUAMonitoredItemCreate is one item to monitor.

type OPCUAMonitoredItemCreateResult

type OPCUAMonitoredItemCreateResult struct {
	StatusCode      OPCUAStatusCode
	MonitoredItemID uint32
	OPCUAMonitoredItemRevision
}

OPCUAMonitoredItemCreateResult is the result of creating one monitored item.

type OPCUAMonitoredItemModify

type OPCUAMonitoredItemModify struct {
	MonitoredItemID     uint32
	RequestedParameters OPCUAMonitoringParameters
}

OPCUAMonitoredItemModify is one monitored item to change.

type OPCUAMonitoredItemModifyResult

type OPCUAMonitoredItemModifyResult struct {
	StatusCode OPCUAStatusCode
	OPCUAMonitoredItemRevision
}

OPCUAMonitoredItemModifyResult is the result of changing one monitored item.

type OPCUAMonitoredItemNotif

type OPCUAMonitoredItemNotif struct {
	ClientHandle uint32
	Value        OPCUADataValue
}

OPCUAMonitoredItemNotif is one changed value of a monitored item.

type OPCUAMonitoredItemRevision

type OPCUAMonitoredItemRevision struct {
	// RevisedSamplingInterval is in milliseconds.
	RevisedSamplingInterval float64
	RevisedQueueSize        uint32
	FilterResult            OPCUAExtensionObject
}

OPCUAMonitoredItemRevision is the sampling a server grants a monitored item. The Value of FilterResult is an *OPCUAEventFilterResult or *OPCUAAggregateFilterResult.

type OPCUAMonitoringMode

type OPCUAMonitoringMode uint32

OPCUAMonitoringMode is a MonitoringMode (OPC 10000-4 §7.23).

const (
	OPCUAMonitoringDisabled  OPCUAMonitoringMode = 0
	OPCUAMonitoringSampling  OPCUAMonitoringMode = 1
	OPCUAMonitoringReporting OPCUAMonitoringMode = 2
)

OPCUAMonitoringMode values.

func (OPCUAMonitoringMode) String

func (m OPCUAMonitoringMode) String() string

String returns the mode name.

type OPCUAMonitoringParameters

type OPCUAMonitoringParameters struct {
	ClientHandle uint32
	// SamplingInterval is in milliseconds.
	SamplingInterval float64
	Filter           OPCUAExtensionObject
	QueueSize        uint32
	DiscardOldest    bool
}

OPCUAMonitoringParameters are the sampling and queueing settings of a monitored item (OPC 10000-4 §7.21). The Value of Filter is an *OPCUADataChangeFilter, *OPCUAEventFilter or *OPCUAAggregateFilter.

type OPCUANetworkGroup

type OPCUANetworkGroup struct {
	ServerURI    string
	NetworkPaths []OPCUAEndpointURLList
}

OPCUANetworkGroup is a NetworkGroupDataType (OPC 10000-5 §12.20): the network paths to one server of a redundant set.

type OPCUANode

type OPCUANode struct {
	NodeID        OPCUANodeID
	NodeClass     OPCUANodeClass
	BrowseName    OPCUAQualifiedName
	DisplayName   OPCUALocalizedText
	Description   OPCUALocalizedText
	WriteMask     uint32
	UserWriteMask uint32
	// RolePermissions, UserRolePermissions and AccessRestrictions are
	// not sent in the layout of OPC UA 1.03.
	RolePermissions     []OPCUARolePermission
	UserRolePermissions []OPCUARolePermission
	AccessRestrictions  uint16
	References          []OPCUAReferenceNode
	// Legacy is set when the body has the layout of OPC UA 1.03.
	Legacy bool
}

OPCUANode holds the attributes every node class has, as a server exports them (OPC 10000-3 §5.2). It is the Value of a Node, an InstanceNode and a TypeNode, and the base of the other node classes.

type OPCUANodeAttributes

type OPCUANodeAttributes struct {
	SpecifiedAttributes uint32
	DisplayName         OPCUALocalizedText
	Description         OPCUALocalizedText
	WriteMask           uint32
	UserWriteMask       uint32
}

OPCUANodeAttributes are the attributes every node class has (OPC 10000-4 §7.24.1). SpecifiedAttributes is a bit mask of the attributes the sender set.

type OPCUANodeClass

type OPCUANodeClass uint32

OPCUANodeClass is a NodeClass (OPC 10000-3 §8.29), one bit per class.

const (
	OPCUANodeClassUnspecified   OPCUANodeClass = 0
	OPCUANodeClassObject        OPCUANodeClass = 1
	OPCUANodeClassVariable      OPCUANodeClass = 2
	OPCUANodeClassMethod        OPCUANodeClass = 4
	OPCUANodeClassObjectType    OPCUANodeClass = 8
	OPCUANodeClassVariableType  OPCUANodeClass = 16
	OPCUANodeClassReferenceType OPCUANodeClass = 32
	OPCUANodeClassDataType      OPCUANodeClass = 64
	OPCUANodeClassView          OPCUANodeClass = 128
)

OPCUANodeClass values.

func (OPCUANodeClass) String

func (c OPCUANodeClass) String() string

String returns the node class name.

type OPCUANodeID

type OPCUANodeID struct {
	Encoding  OPCUANodeIDEncoding
	Namespace uint16
	Numeric   uint32
	StringID  string
	GUID      OPCUAGUID
	Opaque    []byte
	// NamespaceURI and ServerIndex are set by an ExpandedNodeId whose
	// flags announce them.
	NamespaceURI string
	ServerIndex  uint32
}

OPCUANodeID is a NodeId or ExpandedNodeId. Which identifier field is set depends on Encoding: Numeric for the three numeric forms, StringID, GUID or Opaque for the others.

func (OPCUANodeID) String

func (n OPCUANodeID) String() string

String returns the NodeId in the OPC UA text form, such as "i=631" or "ns=2;s=Pump".

type OPCUANodeIDEncoding

type OPCUANodeIDEncoding uint8

OPCUANodeIDEncoding is the wire form of a NodeId (OPC 10000-6 §5.2.2.9).

const (
	OPCUANodeIDTwoByte    OPCUANodeIDEncoding = 0
	OPCUANodeIDFourByte   OPCUANodeIDEncoding = 1
	OPCUANodeIDNumeric    OPCUANodeIDEncoding = 2
	OPCUANodeIDString     OPCUANodeIDEncoding = 3
	OPCUANodeIDGUID       OPCUANodeIDEncoding = 4
	OPCUANodeIDByteString OPCUANodeIDEncoding = 5
)

OPCUANodeIDEncoding values.

func (OPCUANodeIDEncoding) String

func (e OPCUANodeIDEncoding) String() string

String returns the encoding name.

type OPCUANodeIDList

type OPCUANodeIDList struct {
	NodeIDs []OPCUANodeID
}

OPCUANodeIDList is the parameter of RegisterNodes requests and responses and of UnregisterNodes requests (OPC 10000-4 §5.8.5, §5.8.6).

type OPCUANodeReference

type OPCUANodeReference struct {
	NodeID            OPCUANodeID
	ReferenceTypeID   OPCUANodeID
	IsForward         bool
	ReferencedNodeIDs []OPCUANodeID
}

OPCUANodeReference is a NodeReference of a query result (OPC 10000-4 §7.28).

type OPCUANodeTypeDescription

type OPCUANodeTypeDescription struct {
	TypeDefinitionNode OPCUANodeID
	IncludeSubTypes    bool
	DataToReturn       []OPCUAQueryDataDescription
}

OPCUANodeTypeDescription is one type of node a query looks for.

type OPCUANotificationData

type OPCUANotificationData struct {
	Raw          OPCUAExtensionObject
	DataChange   *OPCUADataChangeNotification
	Events       *OPCUAEventNotificationList
	StatusChange *OPCUAStatusChangeNotification
}

OPCUANotificationData is one entry of a NotificationMessage: the ExtensionObject as sent and, for the three standard notification types in binary form, the one decoded pointer that is set, which is the Value of Raw.

type OPCUANotificationMessage

type OPCUANotificationMessage struct {
	SequenceNumber   uint32
	PublishTime      time.Time
	NotificationData []OPCUANotificationData
}

OPCUANotificationMessage is a NotificationMessage (OPC 10000-4 §7.24).

type OPCUAObjectAttributes

type OPCUAObjectAttributes struct {
	OPCUANodeAttributes
	EventNotifier uint8
}

OPCUAObjectAttributes are the attributes of an Object node.

type OPCUAObjectNode

type OPCUAObjectNode struct {
	OPCUANode
	EventNotifier uint8
}

OPCUAObjectNode is an ObjectNode (OPC 10000-3 §5.5.1).

type OPCUAObjectTypeAttributes

type OPCUAObjectTypeAttributes struct {
	OPCUANodeAttributes
	IsAbstract bool
}

OPCUAObjectTypeAttributes are the attributes of an ObjectType node.

type OPCUAObjectTypeNode

type OPCUAObjectTypeNode struct {
	OPCUANode
	IsAbstract bool
}

OPCUAObjectTypeNode is an ObjectTypeNode (OPC 10000-3 §5.5.2).

type OPCUAOpenSecureChannelRequest

type OPCUAOpenSecureChannelRequest struct {
	ClientProtocolVersion uint32
	RequestType           OPCUASecurityTokenRequestType
	SecurityMode          OPCUAMessageSecurityMode
	ClientNonce           []byte
	// RequestedLifetime is in milliseconds.
	RequestedLifetime uint32
}

OPCUAOpenSecureChannelRequest is the OpenSecureChannel request (OPC 10000-4 §5.5.2).

type OPCUAOpenSecureChannelResponse

type OPCUAOpenSecureChannelResponse struct {
	ServerProtocolVersion uint32
	SecurityToken         OPCUAChannelSecurityToken
	ServerNonce           []byte
}

OPCUAOpenSecureChannelResponse is the OpenSecureChannel response.

type OPCUAOptionSet

type OPCUAOptionSet struct {
	Value     []byte
	ValidBits []byte
}

OPCUAOptionSet is an OptionSet (OPC 10000-3 §8.39): a bit mask and the bits of it that are valid.

type OPCUAParsingResult

type OPCUAParsingResult struct {
	StatusCode          OPCUAStatusCode
	DataStatusCodes     []OPCUAStatusCode
	DataDiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAParsingResult is the status of one node type of a query.

type OPCUAProgramDiagnostic

type OPCUAProgramDiagnostic struct {
	CreateSessionID           OPCUANodeID
	CreateClientName          string
	InvocationCreationTime    time.Time
	LastTransitionTime        time.Time
	LastMethodCall            string
	LastMethodSessionID       OPCUANodeID
	LastMethodInputArguments  []OPCUAArgument
	LastMethodOutputArguments []OPCUAArgument
	LastMethodCallTime        time.Time
	LastMethodReturnStatus    OPCUAStatusResult
}

OPCUAProgramDiagnostic is a ProgramDiagnosticDataType (OPC 10000-10 §5.2.8), the last method call of a program.

type OPCUAPubSub

type OPCUAPubSub struct {
	BaseLayer
	Version   uint8
	Flags     OPCUAPubSubFlags
	ExtFlags1 OPCUAPubSubExtFlags1
	ExtFlags2 OPCUAPubSubExtFlags2
	Type      OPCUAPubSubMessageType

	// PublisherID is set with the PublisherID flag, DataSetClassID with
	// its flag in ExtFlags1, Group with the GroupHeader flag.
	PublisherID    OPCUAPublisherID
	DataSetClassID OPCUAGUID
	Group          OPCUAPubSubGroupHeader
	// DataSetWriterIDs is the payload header: one id per DataSetMessage,
	// or the one id of a chunk.
	DataSetWriterIDs []uint16
	Timestamp        time.Time
	// PicoSeconds counts 10 ps steps to add to Timestamp.
	PicoSeconds uint16
	// PromotedFields are the promoted fields as sent; their layout is
	// that of the DataSetMetaData.
	PromotedFields []byte
	Security       OPCUAPubSubSecurityHeader

	// Messages are the DataSetMessages of a message of type DataSet.
	Messages []OPCUADataSetMessage
	// Chunk is set by a chunk NetworkMessage.
	Chunk *OPCUAPubSubChunkData
	// Probe and Announcement are the discovery messages.
	Probe        *OPCUAPubSubProbeData
	Announcement *OPCUAPubSubAnnounceData

	// EncryptedPayload is everything after the header of an encrypted
	// message: ciphertext, security footer and signature.
	EncryptedPayload []byte
	// Trailer is what follows the decoded payload: padding, the security
	// footer and the signature. Their sizes are not on the wire but for
	// Security.FooterSize; the standard PubSub policies sign with
	// HMAC-SHA256, 32 bytes.
	Trailer []byte
	// PayloadError is nil for a payload decoded in full. Otherwise it
	// is the reason the payload, or one of its Messages, was not:
	// ErrOPCUATruncated, ErrOPCUAMalformed or ErrOPCUAPubSubUnsupported.
	// Undecoded is the payload from where decoding stopped; it is nil
	// when only the fields of a message failed, which then holds its own
	// Undecoded.
	Undecoded    []byte
	PayloadError error
}

OPCUAPubSub is one UADP NetworkMessage.

func (*OPCUAPubSub) CanDecode

func (p *OPCUAPubSub) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeOPCUAPubSub.

func (*OPCUAPubSub) DecodeFromBytes

func (p *OPCUAPubSub) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the NetworkMessage that fills data.

func (*OPCUAPubSub) LayerType

func (p *OPCUAPubSub) LayerType() gopacket.LayerType

LayerType returns LayerTypeOPCUAPubSub.

func (*OPCUAPubSub) NextLayerType

func (p *OPCUAPubSub) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypePayload; a NetworkMessage carries no further layer and its Payload is empty.

type OPCUAPubSubAnnounceData

type OPCUAPubSubAnnounceData struct {
	AnnouncementType OPCUAPubSubAnnouncementType
	SequenceNumber   uint16

	Endpoints  []OPCUAEndpointDescription
	StatusCode OPCUAStatusCode

	DataSetWriterID uint16
	MetaData        *OPCUADataSetMetaData

	ApplicationInformationType uint16
	Application                *OPCUAApplicationDescription
	Capabilities               []string
	Status                     *OPCUAPubSubStatus

	Body []byte
}

OPCUAPubSubAnnounceData is a discovery announcement (OPC 10000-14 §7.2.4.6.3). By AnnouncementType:

  • endpoints: Endpoints and StatusCode.
  • DataSetMetaData: DataSetWriterID, MetaData and StatusCode.
  • application information: ApplicationInformationType, then Application and Capabilities (1) or Status (2).
  • any other type: Body, raw.

type OPCUAPubSubAnnouncementType

type OPCUAPubSubAnnouncementType uint8

OPCUAPubSubAnnouncementType is the type of a discovery announcement.

const (
	OPCUAPubSubAnnounceEndpoints    OPCUAPubSubAnnouncementType = 1
	OPCUAPubSubAnnounceMetaData     OPCUAPubSubAnnouncementType = 2
	OPCUAPubSubAnnounceWriterConfig OPCUAPubSubAnnouncementType = 3
	OPCUAPubSubAnnounceConnections  OPCUAPubSubAnnouncementType = 4
	OPCUAPubSubAnnounceApplication  OPCUAPubSubAnnouncementType = 5
	OPCUAPubSubAnnounceResponders   OPCUAPubSubAnnouncementType = 6
	OPCUAPubSubAnnounceActionMeta   OPCUAPubSubAnnouncementType = 7
)

OPCUAPubSubAnnouncementType values.

func (OPCUAPubSubAnnouncementType) String

String returns the announcement type name.

type OPCUAPubSubChunkData

type OPCUAPubSubChunkData struct {
	MessageSequenceNumber uint16
	ChunkOffset           uint32
	TotalSize             uint32
	Data                  []byte
}

OPCUAPubSubChunkData is the payload of a chunk NetworkMessage (OPC 10000-14 §7.2.4.4.4): a piece of one DataSetMessage or announcement too large for one NetworkMessage. Chunks are not joined.

type OPCUAPubSubExtFlags1

type OPCUAPubSubExtFlags1 uint8

OPCUAPubSubExtFlags1 is the ExtendedFlags1 octet.

const (
	OPCUAPubSubPublisherIDType OPCUAPubSubExtFlags1 = 0x07
	OPCUAPubSubDataSetClassID  OPCUAPubSubExtFlags1 = 0x08
	OPCUAPubSubSecurity        OPCUAPubSubExtFlags1 = 0x10
	OPCUAPubSubTimestamp       OPCUAPubSubExtFlags1 = 0x20
	OPCUAPubSubPicoSeconds     OPCUAPubSubExtFlags1 = 0x40
	OPCUAPubSubExtendedFlags2  OPCUAPubSubExtFlags1 = 0x80
)

OPCUAPubSubExtFlags1 bits; the low three give the PublisherId type.

type OPCUAPubSubExtFlags2

type OPCUAPubSubExtFlags2 uint8

OPCUAPubSubExtFlags2 is the ExtendedFlags2 octet.

const (
	OPCUAPubSubChunk          OPCUAPubSubExtFlags2 = 0x01
	OPCUAPubSubPromotedFields OPCUAPubSubExtFlags2 = 0x02
	OPCUAPubSubTypeMask       OPCUAPubSubExtFlags2 = 0x1C
	OPCUAPubSubActionHeader   OPCUAPubSubExtFlags2 = 0x20
)

OPCUAPubSubExtFlags2 bits; bits 2 to 4 give the NetworkMessage type.

type OPCUAPubSubFlags

type OPCUAPubSubFlags uint8

OPCUAPubSubFlags are the UADPFlags, the high four bits of the first octet.

const (
	OPCUAPubSubFlagPublisherID   OPCUAPubSubFlags = 0x10
	OPCUAPubSubFlagGroupHeader   OPCUAPubSubFlags = 0x20
	OPCUAPubSubFlagPayloadHeader OPCUAPubSubFlags = 0x40
	OPCUAPubSubFlagExtFlags1     OPCUAPubSubFlags = 0x80
)

OPCUAPubSubFlags bits.

type OPCUAPubSubGroupFlags

type OPCUAPubSubGroupFlags uint8

OPCUAPubSubGroupFlags is the GroupFlags octet.

const (
	OPCUAPubSubWriterGroupID    OPCUAPubSubGroupFlags = 0x01
	OPCUAPubSubGroupVersion     OPCUAPubSubGroupFlags = 0x02
	OPCUAPubSubNetworkMsgNumber OPCUAPubSubGroupFlags = 0x04
	OPCUAPubSubSequenceNumber   OPCUAPubSubGroupFlags = 0x08
)

OPCUAPubSubGroupFlags bits.

type OPCUAPubSubGroupHeader

type OPCUAPubSubGroupHeader struct {
	Flags         OPCUAPubSubGroupFlags
	WriterGroupID uint16
	// GroupVersion is a VersionTime: seconds since 2000-01-01 UTC.
	GroupVersion         uint32
	NetworkMessageNumber uint16
	SequenceNumber       uint16
}

OPCUAPubSubGroupHeader is the GroupHeader; Flags tells which of its fields were sent.

type OPCUAPubSubInformationType

type OPCUAPubSubInformationType uint8

OPCUAPubSubInformationType is what a publisher information probe asks for.

const (
	OPCUAPubSubInfoEndpoints    OPCUAPubSubInformationType = 1
	OPCUAPubSubInfoMetaData     OPCUAPubSubInformationType = 2
	OPCUAPubSubInfoWriterConfig OPCUAPubSubInformationType = 3
	OPCUAPubSubInfoWriterGroup  OPCUAPubSubInformationType = 4
	OPCUAPubSubInfoConnections  OPCUAPubSubInformationType = 5
)

OPCUAPubSubInformationType values.

func (OPCUAPubSubInformationType) String

String returns the information type name.

type OPCUAPubSubMessageType

type OPCUAPubSubMessageType uint8

OPCUAPubSubMessageType is the UADP NetworkMessage type.

const (
	OPCUAPubSubDataSet      OPCUAPubSubMessageType = 0
	OPCUAPubSubProbe        OPCUAPubSubMessageType = 1
	OPCUAPubSubAnnouncement OPCUAPubSubMessageType = 2
)

OPCUAPubSubMessageType values.

func (OPCUAPubSubMessageType) String

func (t OPCUAPubSubMessageType) String() string

String returns the type name.

type OPCUAPubSubProbeData

type OPCUAPubSubProbeData struct {
	ProbeType             OPCUAPubSubProbeType
	InformationType       OPCUAPubSubInformationType
	DataSetWriterIDs      []uint16
	WriterGroupID         uint16
	TransportProfileURIs  []string
	IncludeWriterGroups   bool
	IncludeDataSetWriters bool
}

OPCUAPubSubProbeData is a discovery probe (OPC 10000-14 §7.2.4.6.12). The fields after InformationType are set by that type: DataSetWriterIDs for metadata and writer configuration, WriterGroupID for a writer group, the rest for connections.

type OPCUAPubSubProbeType

type OPCUAPubSubProbeType uint8

OPCUAPubSubProbeType is the type of a discovery probe.

const (
	OPCUAPubSubProbePublisherInfo    OPCUAPubSubProbeType = 1
	OPCUAPubSubProbeFindApplications OPCUAPubSubProbeType = 2
)

OPCUAPubSubProbeType values.

type OPCUAPubSubSecurityFlags

type OPCUAPubSubSecurityFlags uint8

OPCUAPubSubSecurityFlags is the SecurityFlags octet.

const (
	OPCUAPubSubSigned         OPCUAPubSubSecurityFlags = 0x01
	OPCUAPubSubEncrypted      OPCUAPubSubSecurityFlags = 0x02
	OPCUAPubSubSecurityFooter OPCUAPubSubSecurityFlags = 0x04
	OPCUAPubSubForceKeyReset  OPCUAPubSubSecurityFlags = 0x08
)

OPCUAPubSubSecurityFlags bits.

type OPCUAPubSubSecurityHeader

type OPCUAPubSubSecurityHeader struct {
	Flags      OPCUAPubSubSecurityFlags
	TokenID    uint32
	Nonce      []byte
	FooterSize uint16
}

OPCUAPubSubSecurityHeader is the SecurityHeader. FooterSize is only sent with the SecurityFooter flag.

type OPCUAPubSubState

type OPCUAPubSubState uint32

OPCUAPubSubState is a PubSubState (OPC 10000-14 §6.2.1).

const (
	OPCUAPubSubStateDisabled       OPCUAPubSubState = 0
	OPCUAPubSubStatePaused         OPCUAPubSubState = 1
	OPCUAPubSubStateOperational    OPCUAPubSubState = 2
	OPCUAPubSubStateError          OPCUAPubSubState = 3
	OPCUAPubSubStatePreOperational OPCUAPubSubState = 4
)

OPCUAPubSubState values.

func (OPCUAPubSubState) String

func (s OPCUAPubSubState) String() string

String returns the state name.

type OPCUAPubSubStatus

type OPCUAPubSubStatus struct {
	IsCyclic       bool
	Status         OPCUAPubSubState
	NextReportTime time.Time
	Timestamp      time.Time
}

OPCUAPubSubStatus is the status a publisher announces (OPC 10000-14 §7.2.4.6.7). The times are only sent when IsCyclic.

type OPCUAPublishRequest

type OPCUAPublishRequest struct {
	SubscriptionAcknowledgements []OPCUASubscriptionAck
}

OPCUAPublishRequest is the Publish request (OPC 10000-4 §5.13.5).

type OPCUAPublishResponse

type OPCUAPublishResponse struct {
	SubscriptionID           uint32
	AvailableSequenceNumbers []uint32
	MoreNotifications        bool
	NotificationMessage      OPCUANotificationMessage
	OPCUAResults
}

OPCUAPublishResponse is the Publish response.

type OPCUAPublisherID

type OPCUAPublisherID struct {
	Type    OPCUAPublisherIDType
	Numeric uint64
	Text    string
}

OPCUAPublisherID is the id of the publisher of a NetworkMessage: Numeric for the integer types, Text for a String. Two ids are equal only when type and value are.

type OPCUAPublisherIDType

type OPCUAPublisherIDType uint8

OPCUAPublisherIDType is the DataType of a PublisherId.

const (
	OPCUAPublisherIDByte   OPCUAPublisherIDType = 0
	OPCUAPublisherIDUInt16 OPCUAPublisherIDType = 1
	OPCUAPublisherIDUInt32 OPCUAPublisherIDType = 2
	OPCUAPublisherIDUInt64 OPCUAPublisherIDType = 3
	OPCUAPublisherIDString OPCUAPublisherIDType = 4
)

OPCUAPublisherIDType values.

func (OPCUAPublisherIDType) String

func (t OPCUAPublisherIDType) String() string

String returns the type name.

type OPCUAQualifiedName

type OPCUAQualifiedName struct {
	Namespace uint16
	Name      string
}

OPCUAQualifiedName is a QualifiedName: a namespace index and a name.

type OPCUAQueryDataDescription

type OPCUAQueryDataDescription struct {
	RelativePath []OPCUARelativePathElement
	AttributeID  OPCUAAttributeID
	IndexRange   string
}

OPCUAQueryDataDescription names an attribute a query returns, by a path from the node type.

type OPCUAQueryDataSet

type OPCUAQueryDataSet struct {
	NodeID             OPCUANodeID
	TypeDefinitionNode OPCUANodeID
	Values             []OPCUAVariant
}

OPCUAQueryDataSet is the data of one node a query found.

type OPCUAQueryFirstRequest

type OPCUAQueryFirstRequest struct {
	View                  OPCUAViewDescription
	NodeTypes             []OPCUANodeTypeDescription
	Filter                OPCUAContentFilter
	MaxDataSetsToReturn   uint32
	MaxReferencesToReturn uint32
}

OPCUAQueryFirstRequest is the QueryFirst request (OPC 10000-4 §5.9.3).

type OPCUAQueryFirstResponse

type OPCUAQueryFirstResponse struct {
	QueryDataSets     []OPCUAQueryDataSet
	ContinuationPoint []byte
	ParsingResults    []OPCUAParsingResult
	DiagnosticInfos   []OPCUADiagnosticInfo
	FilterResult      OPCUAContentFilterResult
}

OPCUAQueryFirstResponse is the QueryFirst response.

type OPCUAQueryNextRequest

type OPCUAQueryNextRequest struct {
	ReleaseContinuationPoint bool
	ContinuationPoint        []byte
}

OPCUAQueryNextRequest is the QueryNext request (OPC 10000-4 §5.9.4).

type OPCUAQueryNextResponse

type OPCUAQueryNextResponse struct {
	QueryDataSets            []OPCUAQueryDataSet
	RevisedContinuationPoint []byte
}

OPCUAQueryNextResponse is the QueryNext response.

type OPCUARange

type OPCUARange struct {
	Low  float64
	High float64
}

OPCUARange is a Range (OPC 10000-8 §5.6.2), such as an EURange.

type OPCUAReadAnnotationDataDetails

type OPCUAReadAnnotationDataDetails struct {
	ReqTimes []time.Time
}

OPCUAReadAnnotationDataDetails reads the annotations at given times (OPC 10000-11 §6.5.6).

type OPCUAReadAtTimeDetails

type OPCUAReadAtTimeDetails struct {
	ReqTimes        []time.Time
	UseSimpleBounds bool
}

OPCUAReadAtTimeDetails reads the values at given times (OPC 10000-11 §6.4.5).

type OPCUAReadEventDetails

type OPCUAReadEventDetails struct {
	NumValuesPerNode uint32
	StartTime        time.Time
	EndTime          time.Time
	Filter           OPCUAEventFilter
}

OPCUAReadEventDetails reads the history of events (OPC 10000-11 §6.4.2).

type OPCUAReadEventDetailsSorted

type OPCUAReadEventDetailsSorted struct {
	OPCUAReadEventDetails
	SortClause []OPCUASortRuleElement
}

OPCUAReadEventDetailsSorted reads the history of events in a given order (OPC 10000-11 §6.5.2).

type OPCUAReadProcessedDetails

type OPCUAReadProcessedDetails struct {
	StartTime time.Time
	EndTime   time.Time
	// ProcessingInterval is in milliseconds.
	ProcessingInterval     float64
	AggregateType          []OPCUANodeID
	AggregateConfiguration OPCUAAggregateConfiguration
}

OPCUAReadProcessedDetails reads aggregates of the history (OPC 10000-11 §6.4.4).

type OPCUAReadRawModifiedDetails

type OPCUAReadRawModifiedDetails struct {
	IsReadModified   bool
	StartTime        time.Time
	EndTime          time.Time
	NumValuesPerNode uint32
	ReturnBounds     bool
}

OPCUAReadRawModifiedDetails reads raw or modified values (OPC 10000-11 §6.4.3).

type OPCUAReadRequest

type OPCUAReadRequest struct {
	// MaxAge is in milliseconds.
	MaxAge             float64
	TimestampsToReturn OPCUATimestampsToReturn
	NodesToRead        []OPCUAReadValueID
}

OPCUAReadRequest is the Read request (OPC 10000-4 §5.10.2).

type OPCUAReadResponse

type OPCUAReadResponse struct {
	Results         []OPCUADataValue
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAReadResponse is the Read response (OPC 10000-4 §5.10.2).

type OPCUAReadValueID

type OPCUAReadValueID struct {
	NodeID       OPCUANodeID
	AttributeID  OPCUAAttributeID
	IndexRange   string
	DataEncoding OPCUAQualifiedName
}

OPCUAReadValueID names one attribute of one node to read.

type OPCUARedundantServer

type OPCUARedundantServer struct {
	ServerID     string
	ServiceLevel uint8
	ServerState  uint32
}

OPCUARedundantServer is a RedundantServerDataType (OPC 10000-5 §12.5).

type OPCUAReferenceDescription

type OPCUAReferenceDescription struct {
	ReferenceTypeID OPCUANodeID
	IsForward       bool
	NodeID          OPCUANodeID
	BrowseName      OPCUAQualifiedName
	DisplayName     OPCUALocalizedText
	NodeClass       OPCUANodeClass
	TypeDefinition  OPCUANodeID
}

OPCUAReferenceDescription is one reference a Browse found (OPC 10000-4 §7.30).

type OPCUAReferenceNode

type OPCUAReferenceNode struct {
	ReferenceTypeID OPCUANodeID
	IsInverse       bool
	TargetID        OPCUANodeID
}

OPCUAReferenceNode is one reference of a node (OPC 10000-3 §5.3).

type OPCUAReferenceTypeAttributes

type OPCUAReferenceTypeAttributes struct {
	OPCUANodeAttributes
	IsAbstract  bool
	Symmetric   bool
	InverseName OPCUALocalizedText
}

OPCUAReferenceTypeAttributes are the attributes of a ReferenceType node.

type OPCUAReferenceTypeNode

type OPCUAReferenceTypeNode struct {
	OPCUANode
	IsAbstract  bool
	Symmetric   bool
	InverseName OPCUALocalizedText
}

OPCUAReferenceTypeNode is a ReferenceTypeNode (OPC 10000-3 §5.3.2).

type OPCUARegisterServer2Request

type OPCUARegisterServer2Request struct {
	Server                 OPCUARegisteredServer
	DiscoveryConfiguration []OPCUAExtensionObject
}

OPCUARegisterServer2Request is the RegisterServer2 request (OPC 10000-4 §5.4.6). The Value of a known DiscoveryConfiguration is an *OPCUAMdnsDiscoveryConfig.

type OPCUARegisterServerRequest

type OPCUARegisterServerRequest struct {
	Server OPCUARegisteredServer
}

OPCUARegisterServerRequest is the RegisterServer request (OPC 10000-4 §5.4.5).

type OPCUARegisteredServer

type OPCUARegisteredServer struct {
	ServerURI         string
	ProductURI        string
	ServerNames       []OPCUALocalizedText
	ServerType        OPCUAApplicationType
	GatewayServerURI  string
	DiscoveryURLs     []string
	SemaphoreFilePath string
	IsOnline          bool
}

OPCUARegisteredServer describes a server to a discovery server (OPC 10000-4 §7.32).

type OPCUARelativePath

type OPCUARelativePath struct {
	Elements []OPCUARelativePathElement
}

OPCUARelativePath is a RelativePath (OPC 10000-4 §7.31).

type OPCUARelativePathElement

type OPCUARelativePathElement struct {
	ReferenceTypeID OPCUANodeID
	IsInverse       bool
	IncludeSubtypes bool
	TargetName      OPCUAQualifiedName
}

OPCUARelativePathElement is one hop of a browse path.

type OPCUARepublishRequest

type OPCUARepublishRequest struct {
	SubscriptionID           uint32
	RetransmitSequenceNumber uint32
}

OPCUARepublishRequest is the Republish request (OPC 10000-4 §5.13.6).

type OPCUARepublishResponse

type OPCUARepublishResponse struct {
	NotificationMessage OPCUANotificationMessage
}

OPCUARepublishResponse is the Republish response.

type OPCUARequestHeader

type OPCUARequestHeader struct {
	AuthenticationToken OPCUANodeID
	Timestamp           time.Time
	RequestHandle       uint32
	ReturnDiagnostics   uint32
	AuditEntryID        string
	// TimeoutHint is in milliseconds; 0 is none.
	TimeoutHint      uint32
	AdditionalHeader OPCUAExtensionObject
}

OPCUARequestHeader opens every service request (OPC 10000-4 §7.33).

type OPCUAResponseHeader

type OPCUAResponseHeader struct {
	Timestamp          time.Time
	RequestHandle      uint32
	ServiceResult      OPCUAStatusCode
	ServiceDiagnostics OPCUADiagnosticInfo
	StringTable        []string
	AdditionalHeader   OPCUAExtensionObject
}

OPCUAResponseHeader opens every service response (OPC 10000-4 §7.34).

type OPCUAResults

type OPCUAResults struct {
	Results         []OPCUAStatusCode
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUAResults is the per-operation status of a response (OPC 10000-4 §7.39, §7.12): Write, SetMonitoringMode, DeleteMonitoredItems, SetPublishingMode and DeleteSubscriptions return only this.

type OPCUAReverseHello

type OPCUAReverseHello struct {
	ServerURI   string
	EndpointURL string
}

OPCUAReverseHello is the body of an RHE message (OPC 10000-6 §7.1.2.6).

type OPCUARolePermission

type OPCUARolePermission struct {
	RoleID      OPCUANodeID
	Permissions uint32
}

OPCUARolePermission grants a role some permissions on a node (OPC 10000-3 §8.48). Permissions is a PermissionType bit mask.

type OPCUASamplingDiagnostics

type OPCUASamplingDiagnostics struct {
	// SamplingInterval is in milliseconds.
	SamplingInterval           float64
	MonitoredItemCount         uint32
	MaxMonitoredItemCount      uint32
	DisabledMonitoredItemCount uint32
}

OPCUASamplingDiagnostics is a SamplingIntervalDiagnosticsDataType (OPC 10000-5 §12.8).

type OPCUASecurityTokenRequestType

type OPCUASecurityTokenRequestType uint32

OPCUASecurityTokenRequestType asks for a new token or a renewal.

const (
	OPCUASecurityTokenIssue OPCUASecurityTokenRequestType = 0
	OPCUASecurityTokenRenew OPCUASecurityTokenRequestType = 1
)

OPCUASecurityTokenRequestType values.

func (OPCUASecurityTokenRequestType) String

String returns the request type name.

type OPCUASemanticChange

type OPCUASemanticChange struct {
	Affected     OPCUANodeID
	AffectedType OPCUANodeID
}

OPCUASemanticChange is a SemanticChangeStructureDataType (OPC 10000-5 §12.17).

type OPCUAServerDiagnostics

type OPCUAServerDiagnostics struct {
	ServerViewCount               uint32
	CurrentSessionCount           uint32
	CumulatedSessionCount         uint32
	SecurityRejectedSessionCount  uint32
	RejectedSessionCount          uint32
	SessionTimeoutCount           uint32
	SessionAbortCount             uint32
	CurrentSubscriptionCount      uint32
	CumulatedSubscriptionCount    uint32
	PublishingIntervalCount       uint32
	SecurityRejectedRequestsCount uint32
	RejectedRequestsCount         uint32
}

OPCUAServerDiagnostics is a ServerDiagnosticsSummaryDataType (OPC 10000-5 §12.9), the counters of a server.

type OPCUAServerOnNetwork

type OPCUAServerOnNetwork struct {
	RecordID           uint32
	ServerName         string
	DiscoveryURL       string
	ServerCapabilities []string
}

OPCUAServerOnNetwork is one server a discovery server knows from mDNS.

type OPCUAServerStatus

type OPCUAServerStatus struct {
	StartTime           time.Time
	CurrentTime         time.Time
	State               uint32
	BuildInfo           OPCUABuildInfo
	SecondsTillShutdown uint32
	ShutdownReason      OPCUALocalizedText
}

OPCUAServerStatus is a ServerStatusDataType (OPC 10000-5 §12.10), the value of the ServerStatus variable.

type OPCUAService

type OPCUAService struct {
	TypeID OPCUANodeID
	ID     OPCUAServiceID

	RequestHeader  *OPCUARequestHeader
	ResponseHeader *OPCUAResponseHeader

	OpenSecureChannelRequest  *OPCUAOpenSecureChannelRequest
	OpenSecureChannelResponse *OPCUAOpenSecureChannelResponse
	GetEndpointsRequest       *OPCUAGetEndpointsRequest
	ReadRequest               *OPCUAReadRequest

	FindServersRequest           *OPCUAFindServersRequest
	FindServersResponse          *OPCUAFindServersResponse
	FindServersOnNetworkRequest  *OPCUAFindOnNetworkRequest
	FindServersOnNetworkResponse *OPCUAFindOnNetworkResponse
	RegisterServerRequest        *OPCUARegisterServerRequest
	RegisterServer2Request       *OPCUARegisterServer2Request
	RegisterServer2Response      *OPCUAResults
	CancelRequest                *OPCUACancelRequest
	CancelResponse               *OPCUACancelResponse

	GetEndpointsResponse    *OPCUAGetEndpointsResponse
	CreateSessionRequest    *OPCUACreateSessionRequest
	CreateSessionResponse   *OPCUACreateSessionResponse
	ActivateSessionRequest  *OPCUAActivateSessionRequest
	ActivateSessionResponse *OPCUAActivateSessionResponse
	CloseSessionRequest     *OPCUACloseSessionRequest

	ReadResponse        *OPCUAReadResponse
	WriteRequest        *OPCUAWriteRequest
	WriteResponse       *OPCUAResults
	HistoryReadRequest  *OPCUAHistoryReadRequest
	HistoryReadResponse *OPCUAHistoryReadResponse
	CallRequest         *OPCUACallRequest
	CallResponse        *OPCUACallResponse

	AddNodesRequest          *OPCUAAddNodesRequest
	AddNodesResponse         *OPCUAAddNodesResponse
	AddReferencesRequest     *OPCUAAddReferencesRequest
	AddReferencesResponse    *OPCUAResults
	DeleteNodesRequest       *OPCUADeleteNodesRequest
	DeleteNodesResponse      *OPCUAResults
	DeleteReferencesRequest  *OPCUADeleteReferencesRequest
	DeleteReferencesResponse *OPCUAResults
	QueryFirstRequest        *OPCUAQueryFirstRequest
	QueryFirstResponse       *OPCUAQueryFirstResponse
	QueryNextRequest         *OPCUAQueryNextRequest
	QueryNextResponse        *OPCUAQueryNextResponse
	HistoryUpdateRequest     *OPCUAHistoryUpdateRequest
	HistoryUpdateResponse    *OPCUAHistoryUpdateResponse

	BrowseRequest                         *OPCUABrowseRequest
	BrowseResponse                        *OPCUABrowseResponse
	BrowseNextRequest                     *OPCUABrowseNextRequest
	BrowseNextResponse                    *OPCUABrowseResponse
	TranslateBrowsePathsToNodeIDsRequest  *OPCUATranslateRequest
	TranslateBrowsePathsToNodeIDsResponse *OPCUATranslateResponse
	RegisterNodesRequest                  *OPCUANodeIDList
	RegisterNodesResponse                 *OPCUANodeIDList
	UnregisterNodesRequest                *OPCUANodeIDList

	CreateMonitoredItemsRequest  *OPCUACreateItemsRequest
	CreateMonitoredItemsResponse *OPCUACreateItemsResponse
	ModifyMonitoredItemsRequest  *OPCUAModifyItemsRequest
	ModifyMonitoredItemsResponse *OPCUAModifyItemsResponse
	SetMonitoringModeRequest     *OPCUASetMonitoringRequest
	SetMonitoringModeResponse    *OPCUAResults
	DeleteMonitoredItemsRequest  *OPCUADeleteItemsRequest
	DeleteMonitoredItemsResponse *OPCUAResults
	CreateSubscriptionRequest    *OPCUACreateSubRequest
	CreateSubscriptionResponse   *OPCUACreateSubResponse
	ModifySubscriptionRequest    *OPCUAModifySubRequest
	ModifySubscriptionResponse   *OPCUASubscriptionRevision
	SetPublishingModeRequest     *OPCUASetPublishingRequest
	SetPublishingModeResponse    *OPCUAResults
	DeleteSubscriptionsRequest   *OPCUASubscriptionIDs
	DeleteSubscriptionsResponse  *OPCUAResults
	PublishRequest               *OPCUAPublishRequest
	PublishResponse              *OPCUAPublishResponse
	RepublishRequest             *OPCUARepublishRequest
	RepublishResponse            *OPCUARepublishResponse

	SetTriggeringRequest          *OPCUASetTriggeringRequest
	SetTriggeringResponse         *OPCUASetTriggeringResponse
	TransferSubscriptionsRequest  *OPCUATransferSubsRequest
	TransferSubscriptionsResponse *OPCUATransferSubsResponse

	Params []byte
}

OPCUAService is a decoded service body. TypeID and ID name the service; one of the headers is always set; at most one of the typed parameter fields is. Params holds what follows the last decoded field: padding and signature.

The parameters decode in full or not at all: when they do not parse, as in the first chunk of a long message, every typed field is nil and Params holds all of them. OPCUAChunkAssembler joins such a message. Services without parameters (CloseSecureChannel, the CloseSession, UnregisterNodes and RegisterServer responses, ServiceFault) have no typed field.

type OPCUAServiceCounter

type OPCUAServiceCounter struct {
	TotalCount uint32
	ErrorCount uint32
}

OPCUAServiceCounter is a ServiceCounterDataType (OPC 10000-5 §12.13).

type OPCUAServiceID

type OPCUAServiceID uint32

OPCUAServiceID is the numeric NodeId, in namespace 0, of the binary encoding of a service message (OPC 10000-4, 10000-6).

const (
	OPCUAServiceServiceFault                          OPCUAServiceID = 397
	OPCUAServiceFindServersRequest                    OPCUAServiceID = 422
	OPCUAServiceFindServersResponse                   OPCUAServiceID = 425
	OPCUAServiceGetEndpointsRequest                   OPCUAServiceID = 428
	OPCUAServiceGetEndpointsResponse                  OPCUAServiceID = 431
	OPCUAServiceRegisterServerRequest                 OPCUAServiceID = 437
	OPCUAServiceRegisterServerResponse                OPCUAServiceID = 440
	OPCUAServiceOpenSecureChannelRequest              OPCUAServiceID = 446
	OPCUAServiceOpenSecureChannelResponse             OPCUAServiceID = 449
	OPCUAServiceCloseSecureChannelRequest             OPCUAServiceID = 452
	OPCUAServiceCloseSecureChannelResponse            OPCUAServiceID = 455
	OPCUAServiceCreateSessionRequest                  OPCUAServiceID = 461
	OPCUAServiceCreateSessionResponse                 OPCUAServiceID = 464
	OPCUAServiceActivateSessionRequest                OPCUAServiceID = 467
	OPCUAServiceActivateSessionResponse               OPCUAServiceID = 470
	OPCUAServiceCloseSessionRequest                   OPCUAServiceID = 473
	OPCUAServiceCloseSessionResponse                  OPCUAServiceID = 476
	OPCUAServiceCancelRequest                         OPCUAServiceID = 479
	OPCUAServiceCancelResponse                        OPCUAServiceID = 482
	OPCUAServiceAddNodesRequest                       OPCUAServiceID = 488
	OPCUAServiceAddNodesResponse                      OPCUAServiceID = 491
	OPCUAServiceAddReferencesRequest                  OPCUAServiceID = 494
	OPCUAServiceAddReferencesResponse                 OPCUAServiceID = 497
	OPCUAServiceDeleteNodesRequest                    OPCUAServiceID = 500
	OPCUAServiceDeleteNodesResponse                   OPCUAServiceID = 503
	OPCUAServiceDeleteReferencesRequest               OPCUAServiceID = 506
	OPCUAServiceDeleteReferencesResponse              OPCUAServiceID = 509
	OPCUAServiceBrowseRequest                         OPCUAServiceID = 527
	OPCUAServiceBrowseResponse                        OPCUAServiceID = 530
	OPCUAServiceBrowseNextRequest                     OPCUAServiceID = 533
	OPCUAServiceBrowseNextResponse                    OPCUAServiceID = 536
	OPCUAServiceTranslateBrowsePathsToNodeIdsRequest  OPCUAServiceID = 554
	OPCUAServiceTranslateBrowsePathsToNodeIdsResponse OPCUAServiceID = 557
	OPCUAServiceRegisterNodesRequest                  OPCUAServiceID = 560
	OPCUAServiceRegisterNodesResponse                 OPCUAServiceID = 563
	OPCUAServiceUnregisterNodesRequest                OPCUAServiceID = 566
	OPCUAServiceUnregisterNodesResponse               OPCUAServiceID = 569
	OPCUAServiceQueryFirstRequest                     OPCUAServiceID = 615
	OPCUAServiceQueryFirstResponse                    OPCUAServiceID = 618
	OPCUAServiceQueryNextRequest                      OPCUAServiceID = 621
	OPCUAServiceQueryNextResponse                     OPCUAServiceID = 624
	OPCUAServiceReadRequest                           OPCUAServiceID = 631
	OPCUAServiceReadResponse                          OPCUAServiceID = 634
	OPCUAServiceHistoryReadRequest                    OPCUAServiceID = 664
	OPCUAServiceHistoryReadResponse                   OPCUAServiceID = 667
	OPCUAServiceWriteRequest                          OPCUAServiceID = 673
	OPCUAServiceWriteResponse                         OPCUAServiceID = 676
	OPCUAServiceHistoryUpdateRequest                  OPCUAServiceID = 700
	OPCUAServiceHistoryUpdateResponse                 OPCUAServiceID = 703
	OPCUAServiceCallMethodRequest                     OPCUAServiceID = 706
	OPCUAServiceCallRequest                           OPCUAServiceID = 712
	OPCUAServiceCallResponse                          OPCUAServiceID = 715
	OPCUAServiceMonitoredItemCreateRequest            OPCUAServiceID = 745
	OPCUAServiceCreateMonitoredItemsRequest           OPCUAServiceID = 751
	OPCUAServiceCreateMonitoredItemsResponse          OPCUAServiceID = 754
	OPCUAServiceMonitoredItemModifyRequest            OPCUAServiceID = 757
	OPCUAServiceModifyMonitoredItemsRequest           OPCUAServiceID = 763
	OPCUAServiceModifyMonitoredItemsResponse          OPCUAServiceID = 766
	OPCUAServiceSetMonitoringModeRequest              OPCUAServiceID = 769
	OPCUAServiceSetMonitoringModeResponse             OPCUAServiceID = 772
	OPCUAServiceSetTriggeringRequest                  OPCUAServiceID = 775
	OPCUAServiceSetTriggeringResponse                 OPCUAServiceID = 778
	OPCUAServiceDeleteMonitoredItemsRequest           OPCUAServiceID = 781
	OPCUAServiceDeleteMonitoredItemsResponse          OPCUAServiceID = 784
	OPCUAServiceCreateSubscriptionRequest             OPCUAServiceID = 787
	OPCUAServiceCreateSubscriptionResponse            OPCUAServiceID = 790
	OPCUAServiceModifySubscriptionRequest             OPCUAServiceID = 793
	OPCUAServiceModifySubscriptionResponse            OPCUAServiceID = 796
	OPCUAServiceSetPublishingModeRequest              OPCUAServiceID = 799
	OPCUAServiceSetPublishingModeResponse             OPCUAServiceID = 802
	OPCUAServicePublishRequest                        OPCUAServiceID = 826
	OPCUAServicePublishResponse                       OPCUAServiceID = 829
	OPCUAServiceRepublishRequest                      OPCUAServiceID = 832
	OPCUAServiceRepublishResponse                     OPCUAServiceID = 835
	OPCUAServiceTransferSubscriptionsRequest          OPCUAServiceID = 841
	OPCUAServiceTransferSubscriptionsResponse         OPCUAServiceID = 844
	OPCUAServiceDeleteSubscriptionsRequest            OPCUAServiceID = 847
	OPCUAServiceDeleteSubscriptionsResponse           OPCUAServiceID = 850
	OPCUAServiceFindServersOnNetworkRequest           OPCUAServiceID = 12208
	OPCUAServiceFindServersOnNetworkResponse          OPCUAServiceID = 12209
	OPCUAServiceRegisterServer2Request                OPCUAServiceID = 12211
	OPCUAServiceRegisterServer2Response               OPCUAServiceID = 12212
)

OPCUAServiceID values.

func (OPCUAServiceID) IsRequest

func (s OPCUAServiceID) IsRequest() bool

IsRequest reports whether the message is a service request, which opens with a RequestHeader; responses and ServiceFault open with a ResponseHeader.

func (OPCUAServiceID) String

func (s OPCUAServiceID) String() string

String returns the service message name, such as "ReadRequest".

type OPCUASessionDiagnostics

type OPCUASessionDiagnostics struct {
	SessionID         OPCUANodeID
	SessionName       string
	ClientDescription OPCUAApplicationDescription
	ServerURI         string
	EndpointURL       string
	LocaleIDs         []string
	// ActualSessionTimeout is in milliseconds.
	ActualSessionTimeout          float64
	MaxResponseMessageSize        uint32
	ClientConnectionTime          time.Time
	ClientLastContactTime         time.Time
	CurrentSubscriptionsCount     uint32
	CurrentMonitoredItemsCount    uint32
	CurrentPublishRequestsInQueue uint32
	TotalRequestCount             OPCUAServiceCounter
	UnauthorizedRequestCount      uint32

	ReadCount                  OPCUAServiceCounter
	HistoryReadCount           OPCUAServiceCounter
	WriteCount                 OPCUAServiceCounter
	HistoryUpdateCount         OPCUAServiceCounter
	CallCount                  OPCUAServiceCounter
	CreateMonitoredItemsCount  OPCUAServiceCounter
	ModifyMonitoredItemsCount  OPCUAServiceCounter
	SetMonitoringModeCount     OPCUAServiceCounter
	SetTriggeringCount         OPCUAServiceCounter
	DeleteMonitoredItemsCount  OPCUAServiceCounter
	CreateSubscriptionCount    OPCUAServiceCounter
	ModifySubscriptionCount    OPCUAServiceCounter
	SetPublishingModeCount     OPCUAServiceCounter
	PublishCount               OPCUAServiceCounter
	RepublishCount             OPCUAServiceCounter
	TransferSubscriptionsCount OPCUAServiceCounter
	DeleteSubscriptionsCount   OPCUAServiceCounter
	AddNodesCount              OPCUAServiceCounter
	AddReferencesCount         OPCUAServiceCounter
	DeleteNodesCount           OPCUAServiceCounter
	DeleteReferencesCount      OPCUAServiceCounter
	BrowseCount                OPCUAServiceCounter
	BrowseNextCount            OPCUAServiceCounter
	TranslateBrowsePathsCount  OPCUAServiceCounter
	QueryFirstCount            OPCUAServiceCounter
	QueryNextCount             OPCUAServiceCounter
	RegisterNodesCount         OPCUAServiceCounter
	UnregisterNodesCount       OPCUAServiceCounter
}

OPCUASessionDiagnostics is a SessionDiagnosticsDataType (OPC 10000-5 §12.11), the counters of one session.

type OPCUASessionSecurityDiagnostics

type OPCUASessionSecurityDiagnostics struct {
	SessionID               OPCUANodeID
	ClientUserIDOfSession   string
	ClientUserIDHistory     []string
	AuthenticationMechanism string
	Encoding                string
	TransportProtocol       string
	SecurityMode            OPCUAMessageSecurityMode
	SecurityPolicyURI       string
	ClientCertificate       []byte
}

OPCUASessionSecurityDiagnostics is a SessionSecurityDiagnosticsDataType (OPC 10000-5 §12.12).

type OPCUASetMonitoringRequest

type OPCUASetMonitoringRequest struct {
	SubscriptionID   uint32
	MonitoringMode   OPCUAMonitoringMode
	MonitoredItemIDs []uint32
}

OPCUASetMonitoringRequest is the SetMonitoringMode request (OPC 10000-4 §5.12.4).

type OPCUASetPublishingRequest

type OPCUASetPublishingRequest struct {
	PublishingEnabled bool
	SubscriptionIDs   []uint32
}

OPCUASetPublishingRequest is the SetPublishingMode request (OPC 10000-4 §5.13.4).

type OPCUASetTriggeringRequest

type OPCUASetTriggeringRequest struct {
	SubscriptionID   uint32
	TriggeringItemID uint32
	LinksToAdd       []uint32
	LinksToRemove    []uint32
}

OPCUASetTriggeringRequest is the SetTriggering request (OPC 10000-4 §5.12.5): the items a triggering item makes report.

type OPCUASetTriggeringResponse

type OPCUASetTriggeringResponse struct {
	AddResults            []OPCUAStatusCode
	AddDiagnosticInfos    []OPCUADiagnosticInfo
	RemoveResults         []OPCUAStatusCode
	RemoveDiagnosticInfos []OPCUADiagnosticInfo
}

OPCUASetTriggeringResponse is the SetTriggering response.

type OPCUASignatureData

type OPCUASignatureData struct {
	Algorithm string
	Signature []byte
}

OPCUASignatureData is a signature and its algorithm (OPC 10000-4 §7.37).

type OPCUASignedSoftwareCertificate

type OPCUASignedSoftwareCertificate struct {
	CertificateData []byte
	Signature       []byte
}

OPCUASignedSoftwareCertificate is a SignedSoftwareCertificate (OPC 10000-4 §7.38).

type OPCUASimpleAttributeOperand

type OPCUASimpleAttributeOperand struct {
	TypeDefinitionID OPCUANodeID
	BrowsePath       []OPCUAQualifiedName
	AttributeID      OPCUAAttributeID
	IndexRange       string
}

OPCUASimpleAttributeOperand names an attribute by a path of browse names from a type (OPC 10000-4 §7.7.4.5), as the select clauses of an EventFilter do.

type OPCUASimpleTypeDescription

type OPCUASimpleTypeDescription struct {
	DataTypeID   OPCUANodeID
	Name         OPCUAQualifiedName
	BaseDataType OPCUANodeID
	BuiltInType  OPCUABuiltinType
}

OPCUASimpleTypeDescription names a subtype of a built-in type.

type OPCUASoftwareCertificate

type OPCUASoftwareCertificate struct {
	ProductName              string
	ProductURI               string
	VendorName               string
	VendorProductCertificate []byte
	SoftwareVersion          string
	BuildNumber              string
	BuildDate                time.Time
	IssuedBy                 string
	IssueDate                time.Time
	SupportedProfiles        []OPCUASupportedProfile
}

OPCUASoftwareCertificate describes a certified product (OPC UA 1.02 Part 4 §7.31; later versions dropped it).

type OPCUASortOrder

type OPCUASortOrder uint32

OPCUASortOrder is a SortOrderType (OPC 10000-11 §6.5).

const (
	OPCUASortAscending  OPCUASortOrder = 0
	OPCUASortDescending OPCUASortOrder = 1
)

OPCUASortOrder values.

func (OPCUASortOrder) String

func (o OPCUASortOrder) String() string

String returns the sort order name.

type OPCUASortRuleElement

type OPCUASortRuleElement struct {
	SortOrder  OPCUASortOrder
	EventField OPCUASimpleAttributeOperand
}

OPCUASortRuleElement sorts past events by one of their fields (OPC 10000-11 §6.5.2).

type OPCUAStatusChangeNotification

type OPCUAStatusChangeNotification struct {
	Status         OPCUAStatusCode
	DiagnosticInfo OPCUADiagnosticInfo
}

OPCUAStatusChangeNotification reports a subscription status change (OPC 10000-4 §7.25.4).

type OPCUAStatusCode

type OPCUAStatusCode uint32

OPCUAStatusCode is a StatusCode (OPC 10000-4 §7.39); the top two bits give the severity.

func (OPCUAStatusCode) IsBad

func (s OPCUAStatusCode) IsBad() bool

IsBad reports whether the severity is Bad.

func (OPCUAStatusCode) IsGood

func (s OPCUAStatusCode) IsGood() bool

IsGood reports whether the severity is Good.

func (OPCUAStatusCode) String

func (s OPCUAStatusCode) String() string

String returns the status code name, or its severity and value.

type OPCUAStatusResult

type OPCUAStatusResult struct {
	StatusCode     OPCUAStatusCode
	DiagnosticInfo OPCUADiagnosticInfo
}

OPCUAStatusResult is a StatusCode and its diagnostics.

type OPCUAStructureDefinition

type OPCUAStructureDefinition struct {
	DefaultEncodingID OPCUANodeID
	BaseDataType      OPCUANodeID
	StructureType     uint32
	Fields            []OPCUAStructureField
}

OPCUAStructureDefinition is the layout of a structure (OPC 10000-3 §8.49). StructureType is 0 Structure, 1 with optional fields, 2 Union.

type OPCUAStructureDescription

type OPCUAStructureDescription struct {
	DataTypeID OPCUANodeID
	Name       OPCUAQualifiedName
	Definition OPCUAStructureDefinition
}

OPCUAStructureDescription names a structure and gives its layout.

type OPCUAStructureField

type OPCUAStructureField struct {
	Name            string
	Description     OPCUALocalizedText
	DataType        OPCUANodeID
	ValueRank       int32
	ArrayDimensions []uint32
	MaxStringLength uint32
	IsOptional      bool
}

OPCUAStructureField is one field of a structure (OPC 10000-3 §8.51).

type OPCUASubscriptionAck

type OPCUASubscriptionAck struct {
	SubscriptionID uint32
	SequenceNumber uint32
}

OPCUASubscriptionAck acknowledges one notification message.

type OPCUASubscriptionDiagnostics

type OPCUASubscriptionDiagnostics struct {
	SessionID      OPCUANodeID
	SubscriptionID uint32
	Priority       uint8
	// PublishingInterval is in milliseconds.
	PublishingInterval           float64
	MaxKeepAliveCount            uint32
	MaxLifetimeCount             uint32
	MaxNotificationsPerPublish   uint32
	PublishingEnabled            bool
	ModifyCount                  uint32
	EnableCount                  uint32
	DisableCount                 uint32
	RepublishRequestCount        uint32
	RepublishMessageRequestCount uint32
	RepublishMessageCount        uint32
	TransferRequestCount         uint32
	TransferredToAltClientCount  uint32
	TransferredToSameClientCount uint32
	PublishRequestCount          uint32
	DataChangeNotificationsCount uint32
	EventNotificationsCount      uint32
	NotificationsCount           uint32
	LatePublishRequestCount      uint32
	CurrentKeepAliveCount        uint32
	CurrentLifetimeCount         uint32
	UnacknowledgedMessageCount   uint32
	DiscardedMessageCount        uint32
	MonitoredItemCount           uint32
	DisabledMonitoredItemCount   uint32
	MonitoringQueueOverflowCount uint32
	NextSequenceNumber           uint32
	EventQueueOverflowCount      uint32
}

OPCUASubscriptionDiagnostics is a SubscriptionDiagnosticsDataType (OPC 10000-5 §12.15), the counters of one subscription.

type OPCUASubscriptionIDs

type OPCUASubscriptionIDs struct {
	SubscriptionIDs []uint32
}

OPCUASubscriptionIDs is the DeleteSubscriptions request (OPC 10000-4 §5.13.8).

type OPCUASubscriptionParams

type OPCUASubscriptionParams struct {
	// RequestedPublishingInterval is in milliseconds.
	RequestedPublishingInterval float64
	RequestedLifetimeCount      uint32
	RequestedMaxKeepAliveCount  uint32
	MaxNotificationsPerPublish  uint32
}

OPCUASubscriptionParams are the timing a client asks of a subscription, in CreateSubscription and ModifySubscription requests.

type OPCUASubscriptionRevision

type OPCUASubscriptionRevision struct {
	// RevisedPublishingInterval is in milliseconds.
	RevisedPublishingInterval float64
	RevisedLifetimeCount      uint32
	RevisedMaxKeepAliveCount  uint32
}

OPCUASubscriptionRevision is the timing a server grants, the ModifySubscription response.

type OPCUASupportedProfile

type OPCUASupportedProfile struct {
	OrganizationURI    string
	ProfileID          string
	ComplianceTool     string
	ComplianceDate     time.Time
	ComplianceLevel    OPCUAComplianceLevel
	UnsupportedUnitIDs []string
}

OPCUASupportedProfile is a profile a product claims (OPC UA 1.02 Part 4 §7.31; later versions dropped it).

type OPCUATimeZone

type OPCUATimeZone struct {
	Offset                 int16
	DaylightSavingInOffset bool
}

OPCUATimeZone is a TimeZoneDataType (OPC 10000-3 §8.31); Offset is in minutes from UTC.

type OPCUATimestampsToReturn

type OPCUATimestampsToReturn uint32

OPCUATimestampsToReturn selects the timestamps a Read returns.

const (
	OPCUATimestampsSource  OPCUATimestampsToReturn = 0
	OPCUATimestampsServer  OPCUATimestampsToReturn = 1
	OPCUATimestampsBoth    OPCUATimestampsToReturn = 2
	OPCUATimestampsNeither OPCUATimestampsToReturn = 3
	OPCUATimestampsInvalid OPCUATimestampsToReturn = 4
)

OPCUATimestampsToReturn values.

func (OPCUATimestampsToReturn) String

func (t OPCUATimestampsToReturn) String() string

String returns the selection name.

type OPCUATransferResult

type OPCUATransferResult struct {
	StatusCode               OPCUAStatusCode
	AvailableSequenceNumbers []uint32
}

OPCUATransferResult is the result of moving one subscription.

type OPCUATransferSubsRequest

type OPCUATransferSubsRequest struct {
	SubscriptionIDs   []uint32
	SendInitialValues bool
}

OPCUATransferSubsRequest is the TransferSubscriptions request (OPC 10000-4 §5.13.7).

type OPCUATransferSubsResponse

type OPCUATransferSubsResponse struct {
	Results         []OPCUATransferResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUATransferSubsResponse is the TransferSubscriptions response.

type OPCUATranslateRequest

type OPCUATranslateRequest struct {
	BrowsePaths []OPCUABrowsePath
}

OPCUATranslateRequest is the TranslateBrowsePathsToNodeIds request (OPC 10000-4 §5.8.4).

type OPCUATranslateResponse

type OPCUATranslateResponse struct {
	Results         []OPCUABrowsePathResult
	DiagnosticInfos []OPCUADiagnosticInfo
}

OPCUATranslateResponse is the TranslateBrowsePathsToNodeIds response.

type OPCUATrustList

type OPCUATrustList struct {
	SpecifiedLists      uint32
	TrustedCertificates [][]byte
	TrustedCRLs         [][]byte
	IssuerCertificates  [][]byte
	IssuerCRLs          [][]byte
}

OPCUATrustList is a TrustListDataType (OPC 10000-12 §7.8.2.6): the DER certificates and CRLs a server trusts. SpecifiedLists is a bit mask of the lists present.

type OPCUAUpdateDataDetails

type OPCUAUpdateDataDetails struct {
	NodeID               OPCUANodeID
	PerformInsertReplace uint32
	UpdateValues         []OPCUADataValue
}

OPCUAUpdateDataDetails inserts or replaces historical values (OPC 10000-11 §6.8.2); it is also the form of UpdateStructureDataDetails. PerformInsertReplace is 1 Insert, 2 Replace, 3 Update, 4 Remove.

type OPCUAUpdateEventDetails

type OPCUAUpdateEventDetails struct {
	NodeID               OPCUANodeID
	PerformInsertReplace uint32
	Filter               OPCUAEventFilter
	EventData            []OPCUAHistoryEventFieldList
}

OPCUAUpdateEventDetails inserts or replaces historical events (OPC 10000-11 §6.8.4).

type OPCUAUserIdentityToken

type OPCUAUserIdentityToken struct {
	TokenType OPCUAUserTokenType
	PolicyID  string
	// UserName is set by a UserName token.
	UserName string
	// EncryptionAlgorithm is set by UserName and IssuedToken tokens; empty
	// means the secret is in plaintext.
	EncryptionAlgorithm string
	// CertificateData is the DER certificate of an X509 token.
	CertificateData []byte
}

OPCUAUserIdentityToken is the decoded, non-secret part of a user identity token, the Value of its ExtensionObject. The UserName password and the IssuedToken data stay only in the raw body.

type OPCUAUserTokenPolicy

type OPCUAUserTokenPolicy struct {
	PolicyID          string
	TokenType         OPCUAUserTokenType
	IssuedTokenType   string
	IssuerEndpointURL string
	SecurityPolicyURI string
}

OPCUAUserTokenPolicy is a user identity token an endpoint accepts (OPC 10000-4 §7.43).

type OPCUAUserTokenType

type OPCUAUserTokenType uint32

OPCUAUserTokenType is a UserTokenType (OPC 10000-4 §7.42).

const (
	OPCUAUserTokenAnonymous   OPCUAUserTokenType = 0
	OPCUAUserTokenUserName    OPCUAUserTokenType = 1
	OPCUAUserTokenCertificate OPCUAUserTokenType = 2
	OPCUAUserTokenIssued      OPCUAUserTokenType = 3
)

OPCUAUserTokenType values.

func (OPCUAUserTokenType) String

func (t OPCUAUserTokenType) String() string

String returns the token type name.

type OPCUAVariableAttributes

type OPCUAVariableAttributes struct {
	OPCUANodeAttributes
	Value           OPCUAVariant
	DataType        OPCUANodeID
	ValueRank       int32
	ArrayDimensions []uint32
	AccessLevel     uint8
	UserAccessLevel uint8
	// MinimumSamplingInterval is in milliseconds.
	MinimumSamplingInterval float64
	Historizing             bool
}

OPCUAVariableAttributes are the attributes of a Variable node.

type OPCUAVariableNode

type OPCUAVariableNode struct {
	OPCUANode
	Value           OPCUAVariant
	DataType        OPCUANodeID
	ValueRank       int32
	ArrayDimensions []uint32
	AccessLevel     uint8
	UserAccessLevel uint8
	// MinimumSamplingInterval is in milliseconds.
	MinimumSamplingInterval float64
	Historizing             bool
	// AccessLevelEx is not sent in the layout of OPC UA 1.03.
	AccessLevelEx uint32
}

OPCUAVariableNode is a VariableNode (OPC 10000-3 §5.6.2).

type OPCUAVariableTypeAttributes

type OPCUAVariableTypeAttributes struct {
	OPCUANodeAttributes
	Value           OPCUAVariant
	DataType        OPCUANodeID
	ValueRank       int32
	ArrayDimensions []uint32
	IsAbstract      bool
}

OPCUAVariableTypeAttributes are the attributes of a VariableType node.

type OPCUAVariableTypeNode

type OPCUAVariableTypeNode struct {
	OPCUANode
	Value           OPCUAVariant
	DataType        OPCUANodeID
	ValueRank       int32
	ArrayDimensions []uint32
	IsAbstract      bool
}

OPCUAVariableTypeNode is a VariableTypeNode (OPC 10000-3 §5.6.5).

type OPCUAVariant

type OPCUAVariant struct {
	Type    OPCUABuiltinType
	IsArray bool
	// Dimensions are the ArrayDimensions of a multi-dimensional array,
	// whose elements Value lists in row-major order.
	Dimensions []int32
	Value      interface{}
}

OPCUAVariant is a Variant (OPC 10000-6 §5.2.2.16). Value holds, by Type: bool, int8, uint8, int16, uint16, int32, uint32, int64, uint64, float32, float64, string (String and XmlElement), time.Time, OPCUAGUID, []byte, OPCUANodeID (NodeId and ExpandedNodeId), OPCUAStatusCode, OPCUAQualifiedName, OPCUALocalizedText, OPCUAExtensionObject, OPCUADataValue, OPCUAVariant or OPCUADiagnosticInfo. An array holds a slice of that type: a nil slice when null, an empty one when the array has length 0. Value is nil for Null. The reserved types 26 to 31 hold a []byte, as the specification asks: their value is read as a ByteString.

type OPCUAViewAttributes

type OPCUAViewAttributes struct {
	OPCUANodeAttributes
	ContainsNoLoops bool
	EventNotifier   uint8
}

OPCUAViewAttributes are the attributes of a View node.

type OPCUAViewDescription

type OPCUAViewDescription struct {
	ViewID      OPCUANodeID
	Timestamp   time.Time
	ViewVersion uint32
}

OPCUAViewDescription names the view a Browse runs in (OPC 10000-4 §7.45); a null ViewID is the whole address space.

type OPCUAViewNode

type OPCUAViewNode struct {
	OPCUANode
	ContainsNoLoops bool
	EventNotifier   uint8
}

OPCUAViewNode is a ViewNode (OPC 10000-3 §5.4).

type OPCUAWriteRequest

type OPCUAWriteRequest struct {
	NodesToWrite []OPCUAWriteValue
}

OPCUAWriteRequest is the Write request (OPC 10000-4 §5.10.4).

type OPCUAWriteValue

type OPCUAWriteValue struct {
	NodeID      OPCUANodeID
	AttributeID OPCUAAttributeID
	IndexRange  string
	Value       OPCUADataValue
}

OPCUAWriteValue is one attribute to write.

type OPCUAXVType

type OPCUAXVType struct {
	X     float64
	Value float32
}

OPCUAXVType is a point of an XY array (OPC 10000-8 §5.6.8).

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 PTP

type PTP struct {
	BaseLayer

	// Transport is an input: DecodeFromBytes keeps it. The EtherType
	// decoder sets PTPTransportEthernet; set it yourself when you feed
	// Ethernet payloads to DecodeFromBytes and want IEEE 802.1AS handling.
	Transport PTPTransport

	// MajorSdoID is transportSpecific in IEEE 1588-2008, e.g. 1 for
	// IEEE 802.1AS.
	MajorSdoID    uint8
	MessageType   PTPMessageType
	MinorVersion  uint8
	Version       uint8
	MessageLength uint16
	Domain        uint8
	// MinorSdoID is reserved in IEEE 1588-2008.
	MinorSdoID uint8
	Flags      PTPFlags
	// Correction is correctionField in units of 2^-16 ns; see
	// CorrectionNs.
	Correction int64
	// MessageTypeSpecific is reserved in IEEE 1588-2008.
	MessageTypeSpecific uint32
	SourcePort          PTPPortIdentity
	SequenceID          uint16
	Control             PTPControl
	LogMessageInterval  int8

	// Timestamp is the origin timestamp (Sync, Delay_Req, Pdelay_Req,
	// Announce), preciseOriginTimestamp (Follow_Up), receiveTimestamp
	// (Delay_Resp), requestReceiptTimestamp (Pdelay_Resp) or
	// responseOriginTimestamp (Pdelay_Resp_Follow_Up). IEEE 802.1AS
	// reserves these octets in Announce, Pdelay_Req and two-step Sync
	// messages, so Timestamp stays zero there; see IsGPTP.
	Timestamp PTPTimestamp
	// RequestingPort is set for Delay_Resp, Pdelay_Resp and
	// Pdelay_Resp_Follow_Up.
	RequestingPort PTPPortIdentity
	// Announce is set for Announce.
	Announce PTPAnnounce
	// TargetPort is set for Signaling and Management.
	TargetPort PTPPortIdentity
	// Management is set for Management.
	Management PTPManagement
	// TLVs follow the body of any known message type.
	TLVs []PTPTLV
}

PTP is a PTPv2 message. Body fields are set by message type; the others stay zero. Payload holds octets past messageLength, such as Ethernet padding.

func (*PTP) CanDecode

func (p *PTP) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypePTP.

func (*PTP) CorrectionNs

func (p *PTP) CorrectionNs() float64

CorrectionNs returns the correction field in nanoseconds.

func (*PTP) DecodeFromBytes

func (p *PTP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a PTPv2 message, up to its messageLength.

func (*PTP) IsGPTP

func (p *PTP) IsGPTP() bool

IsGPTP reports whether the message is IEEE 802.1AS (gPTP): majorSdoId bit 0 set on a message known to come over Ethernet. This is Wireshark's rule; over UDP the same bit leaves the message plain IEEE 1588.

func (*PTP) LayerType

func (p *PTP) LayerType() gopacket.LayerType

LayerType returns LayerTypePTP.

func (*PTP) NextLayerType

func (p *PTP) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeZero.

type PTPAcceptableMaster

type PTPAcceptableMaster struct {
	PortIdentity       PTPPortIdentity
	AlternatePriority1 uint8
}

PTPAcceptableMaster is one entry of an ACCEPTABLE_MASTER_TABLE.

type PTPAcceptableMasterTable

type PTPAcceptableMasterTable []PTPAcceptableMaster

PTPAcceptableMasterTable is the data of ACCEPTABLE_MASTER_TABLE.

type PTPAddressTable

type PTPAddressTable struct {
	LogQueryInterval int8
	Addresses        []PTPPortAddress
}

PTPAddressTable is the data of GRANDMASTER_CLUSTER_TABLE and UNICAST_MASTER_TABLE.

type PTPAltTimeOffsetEnable

type PTPAltTimeOffsetEnable struct {
	KeyField uint8
	Enable   bool
}

PTPAltTimeOffsetEnable is the data of ALTERNATE_TIME_OFFSET_ENABLE.

type PTPAltTimeOffsetName

type PTPAltTimeOffsetName struct {
	KeyField    uint8
	DisplayName string
}

PTPAltTimeOffsetName is the data of ALTERNATE_TIME_OFFSET_NAME.

type PTPAltTimeOffsetProperties

type PTPAltTimeOffsetProperties struct {
	KeyField       uint8
	CurrentOffset  int32
	JumpSeconds    int32
	TimeOfNextJump uint64
}

PTPAltTimeOffsetProperties is the data of ALTERNATE_TIME_OFFSET_PROPERTIES.

type PTPAlternateMaster

type PTPAlternateMaster struct {
	TransmitSync bool
	// NumberOfAlternateMasters is how many alternates the port accepts.
	NumberOfAlternateMasters uint8
	LogSyncInterval          int8
}

PTPAlternateMaster is the data of ALTERNATE_MASTER.

type PTPAlternateTimeOffset

type PTPAlternateTimeOffset struct {
	KeyField uint8
	// CurrentOffset is the alternate time minus the node time, in seconds.
	CurrentOffset int32
	JumpSeconds   int32
	// TimeOfNextJump is in seconds of the node time.
	TimeOfNextJump uint64
	DisplayName    string
}

PTPAlternateTimeOffset is the value of an ALTERNATE_TIME_OFFSET_INDICATOR TLV.

type PTPAnnounce

type PTPAnnounce struct {
	CurrentUTCOffset        int16
	GrandmasterPriority1    uint8
	GrandmasterClockQuality PTPClockQuality
	GrandmasterPriority2    uint8
	GrandmasterIdentity     PTPClockIdentity
	StepsRemoved            uint16
	TimeSource              PTPTimeSource
}

PTPAnnounce is the body of an Announce message after its timestamp.

type PTPAuthFields

type PTPAuthFields struct {
	DisclosedKey []byte
	SequenceNo   []byte
	RES          []byte
	// ICV is the integrity check value: all that is left.
	ICV []byte
}

PTPAuthFields is what follows the key ID of an AUTHENTICATION TLV.

type PTPAuthLayout

type PTPAuthLayout struct {
	DisclosedKeyLen int
	SequenceNoLen   int
	RESLen          int
}

PTPAuthLayout sizes the optional fields of an AUTHENTICATION TLV. The security association the SPP points to fixes them; none is on the wire. A zero length means the field is absent.

type PTPAuthentication

type PTPAuthentication struct {
	// SPP is the security parameter pointer.
	SPP uint8
	// SecParamIndicator flags which optional fields are present.
	SecParamIndicator uint8
	KeyID             uint32
	Rest              []byte
}

PTPAuthentication is an IEEE 1588-2019 AUTHENTICATION TLV (16.14). Rest holds what follows the key ID: the optional disclosed key, sequence number and reserved fields, then the ICV. Their sizes come from the security association, which is not on the wire; Fields cuts Rest with sizes the caller knows.

func (PTPAuthentication) Fields

func (a PTPAuthentication) Fields(layout PTPAuthLayout) (PTPAuthFields, error)

Fields cuts Rest into the optional fields and the ICV (IEEE 1588-2019, 16.14.3). The zero layout gives the whole of Rest as the ICV, which is what a TLV with a zero SecParamIndicator holds. A layout larger than Rest gives ErrPTPTLVValue. The slices alias the packet data.

type PTPC37238

type PTPC37238 struct {
	// Edition is 2011 or 2017.
	Edition                   uint16
	GrandmasterID             uint16
	GrandmasterTimeInaccuracy uint32
	NetworkTimeInaccuracy     uint32
	TotalTimeInaccuracy       uint32
}

PTPC37238 is the IEEE C37.238 power profile TLV. The 2011 edition carries GrandmasterTimeInaccuracy and NetworkTimeInaccuracy, the 2017 edition TotalTimeInaccuracy; all are in nanoseconds.

type PTPCSN

type PTPCSN struct {
	UpstreamTxTime PTPScaledNs
	// NeighborRateRatio is (rateRatio - 1) * 2^41.
	NeighborRateRatio int32
	MeanLinkDelay     PTPScaledNs
	DelayAsymmetry    PTPScaledNs
	Domain            uint8
}

PTPCSN is the IEEE 802.1AS CSN TLV for coordinated shared networks (802.1AS-2020, 16.6.4.3).

type PTPClockAccuracy

type PTPClockAccuracy uint8

PTPClockAccuracy is the clockAccuracy of a clockQuality.

const (
	PTPAccuracy1ps     PTPClockAccuracy = 0x17 // IEEE 1588-2019
	PTPAccuracy2500fs  PTPClockAccuracy = 0x18 // IEEE 1588-2019
	PTPAccuracy10ps    PTPClockAccuracy = 0x19 // IEEE 1588-2019
	PTPAccuracy25ps    PTPClockAccuracy = 0x1A // IEEE 1588-2019
	PTPAccuracy100ps   PTPClockAccuracy = 0x1B // IEEE 1588-2019
	PTPAccuracy250ps   PTPClockAccuracy = 0x1C // IEEE 1588-2019
	PTPAccuracy1ns     PTPClockAccuracy = 0x1D // IEEE 1588-2019
	PTPAccuracy2500ps  PTPClockAccuracy = 0x1E // IEEE 1588-2019
	PTPAccuracy10ns    PTPClockAccuracy = 0x1F // IEEE 1588-2019
	PTPAccuracy25ns    PTPClockAccuracy = 0x20
	PTPAccuracy100ns   PTPClockAccuracy = 0x21
	PTPAccuracy250ns   PTPClockAccuracy = 0x22
	PTPAccuracy1us     PTPClockAccuracy = 0x23
	PTPAccuracy2500ns  PTPClockAccuracy = 0x24
	PTPAccuracy10us    PTPClockAccuracy = 0x25
	PTPAccuracy25us    PTPClockAccuracy = 0x26
	PTPAccuracy100us   PTPClockAccuracy = 0x27
	PTPAccuracy250us   PTPClockAccuracy = 0x28
	PTPAccuracy1ms     PTPClockAccuracy = 0x29
	PTPAccuracy2500us  PTPClockAccuracy = 0x2A
	PTPAccuracy10ms    PTPClockAccuracy = 0x2B
	PTPAccuracy25ms    PTPClockAccuracy = 0x2C
	PTPAccuracy100ms   PTPClockAccuracy = 0x2D
	PTPAccuracy250ms   PTPClockAccuracy = 0x2E
	PTPAccuracy1s      PTPClockAccuracy = 0x2F
	PTPAccuracy10s     PTPClockAccuracy = 0x30
	PTPAccuracyOver10s PTPClockAccuracy = 0x31
	PTPAccuracyUnknown PTPClockAccuracy = 0xFE
)

Clock accuracies: the clock is accurate to within the named bound.

func (PTPClockAccuracy) String

func (a PTPClockAccuracy) String() string

String returns the accuracy bound, e.g. "100ns".

type PTPClockDescription

type PTPClockDescription struct {
	ClockType             PTPClockType
	PhysicalLayerProtocol string
	PhysicalAddress       []byte
	ProtocolAddress       PTPPortAddress
	// ManufacturerIdentity is an OUI.
	ManufacturerIdentity [ptpOUILen]byte
	ProductDescription   string
	RevisionData         string
	UserDescription      string
	ProfileIdentity      [ptpProfileIDLen]byte
}

PTPClockDescription is the data of CLOCK_DESCRIPTION.

type PTPClockIdentity

type PTPClockIdentity [ptpClockIDLen]byte

PTPClockIdentity is an 8-octet clockIdentity, usually an EUI-64.

func (PTPClockIdentity) String

func (c PTPClockIdentity) String() string

String returns the identity as colon separated hex octets.

type PTPClockQuality

type PTPClockQuality struct {
	Class                   uint8
	Accuracy                PTPClockAccuracy
	OffsetScaledLogVariance uint16
}

PTPClockQuality is a clockQuality.

type PTPClockType

type PTPClockType uint16

PTPClockType is the clockType of a CLOCK_DESCRIPTION, a bit per kind of clock the node implements.

const (
	PTPClockOrdinary       PTPClockType = 0x8000
	PTPClockBoundary       PTPClockType = 0x4000
	PTPClockP2PTransparent PTPClockType = 0x2000
	PTPClockE2ETransparent PTPClockType = 0x1000
	PTPClockManagementNode PTPClockType = 0x0800
)

Clock type bits.

func (PTPClockType) String

func (c PTPClockType) String() string

String lists the set bits, e.g. "ordinary|boundary".

type PTPComputedFlags

type PTPComputedFlags uint8

PTPComputedFlags tells which fields of the computed records hold a value.

const (
	PTPComputedRateRatioValid PTPComputedFlags = 0x01 // scaledNeighborRateRatio
	PTPComputedPathDelayValid PTPComputedFlags = 0x02 // meanPathDelay
	PTPComputedOffsetValid    PTPComputedFlags = 0x04 // offsetFromMaster
)

Computed data flags.

type PTPControl

type PTPControl uint8

PTPControl is the controlField, kept for PTPv1 compatibility.

const (
	PTPControlSync       PTPControl = 0
	PTPControlDelayReq   PTPControl = 1
	PTPControlFollowUp   PTPControl = 2
	PTPControlDelayResp  PTPControl = 3
	PTPControlManagement PTPControl = 4
	PTPControlOther      PTPControl = 5
)

Control field values.

func (PTPControl) String

func (c PTPControl) String() string

String returns the control field name.

type PTPCumFreqScaleFactorOffset

type PTPCumFreqScaleFactorOffset int32

PTPCumFreqScaleFactorOffset is the value of a CUM_FREQ_SCALE_FACTOR_OFFSET TLV (IEEE 1588-2008, Annex L): the frequency ratio of the grandmaster to the sender, less one, times 2^41.

type PTPCumulativeRateRatio

type PTPCumulativeRateRatio struct {
	// Scaled is (rateRatio - 1) * 2^41; see RateRatio.
	Scaled int32
}

PTPCumulativeRateRatio is the value of a CUMULATIVE_RATE_RATIO TLV (IEEE 1588-2019, 16.10).

func (PTPCumulativeRateRatio) RateRatio

func (c PTPCumulativeRateRatio) RateRatio() float64

RateRatio returns the grandmaster to local clock frequency ratio.

type PTPCurrentDataSet

type PTPCurrentDataSet struct {
	StepsRemoved     uint16
	OffsetFromMaster PTPTimeInterval
	MeanPathDelay    PTPTimeInterval
}

PTPCurrentDataSet is the data of CURRENT_DATA_SET.

type PTPDefaultDataSet

type PTPDefaultDataSet struct {
	TwoStep       bool
	SlaveOnly     bool
	NumberPorts   uint16
	Priority1     uint8
	ClockQuality  PTPClockQuality
	Priority2     uint8
	ClockIdentity PTPClockIdentity
	Domain        uint8
}

PTPDefaultDataSet is the data of DEFAULT_DATA_SET.

type PTPDelayMechanism

type PTPDelayMechanism uint8

PTPDelayMechanism is a delayMechanism.

const (
	PTPDelayE2E         PTPDelayMechanism = 0x01
	PTPDelayP2P         PTPDelayMechanism = 0x02
	PTPDelayCommonP2P   PTPDelayMechanism = 0x03 // IEEE 1588-2019
	PTPDelaySpecial     PTPDelayMechanism = 0x04 // IEEE 1588-2019
	PTPDelayNoMechanism PTPDelayMechanism = 0xFE
)

Delay mechanisms.

func (PTPDelayMechanism) String

func (d PTPDelayMechanism) String() string

String returns the mechanism name, e.g. "E2E".

type PTPDriftTracking

type PTPDriftTracking struct {
	SyncEgressSeconds uint64
	// SyncEgressNs and SyncEgressSubNs are nanoseconds and 2^-16 ns.
	SyncEgressNs            uint32
	SyncEgressSubNs         uint16
	SyncGrandmasterIdentity PTPClockIdentity
	SyncStepsRemoved        uint16
	// RateRatioDrift is the drift * 2^41 per second; see DriftPPM.
	RateRatioDrift int32
}

PTPDriftTracking is the IEEE 802.1AS drift tracking TLV of a Follow_Up (802.1ASdm).

func (PTPDriftTracking) DriftPPM

func (d PTPDriftTracking) DriftPPM() float64

DriftPPM returns the rate ratio drift in parts per million per second.

type PTPEnhancedAccuracyMetrics

type PTPEnhancedAccuracyMetrics struct {
	BCHopCount uint8
	TCHopCount uint8

	MaxGMInaccuracy             float64
	VarGMInaccuracy             float64
	MaxTransientInaccuracy      float64
	VarTransientInaccuracy      float64
	MaxDynamicInaccuracy        float64
	VarDynamicInaccuracy        float64
	MaxStaticInstanceInaccuracy float64
	VarStaticInstanceInaccuracy float64
	MaxStaticMediumInaccuracy   float64
	VarStaticMediumInaccuracy   float64
}

PTPEnhancedAccuracyMetrics is the value of an ENHANCED_ACCURACY_METRICS TLV (IEEE 1588-2019, 16.12). Each inaccuracy is a maximum in seconds and a variance in seconds squared.

type PTPExtPortConfig

type PTPExtPortConfig struct {
	DesiredState PTPPortState
}

PTPExtPortConfig is the data of EXT_PORT_CONFIG_PORT_DATA_SET.

type PTPFaultLog

type PTPFaultLog []PTPFaultRecord

PTPFaultLog is the data of FAULT_LOG.

type PTPFaultRecord

type PTPFaultRecord struct {
	Time        PTPTimestamp
	Severity    PTPFaultSeverity
	Name        string
	Value       string
	Description string
}

PTPFaultRecord is one record of a FAULT_LOG.

type PTPFaultSeverity

type PTPFaultSeverity uint8

PTPFaultSeverity is the severityCode of a fault record, numbered like syslog: 0 emergency to 7 debug.

type PTPFlags

type PTPFlags uint16

PTPFlags is the flagField, its first octet in the high byte.

const (
	PTPFlagAlternateMaster  PTPFlags = 0x0100
	PTPFlagTwoStep          PTPFlags = 0x0200
	PTPFlagUnicast          PTPFlags = 0x0400
	PTPFlagProfileSpecific1 PTPFlags = 0x2000
	PTPFlagProfileSpecific2 PTPFlags = 0x4000
	PTPFlagSecurity         PTPFlags = 0x8000
	PTPFlagLeap61           PTPFlags = 0x0001
	PTPFlagLeap59           PTPFlags = 0x0002
	PTPFlagUTCOffsetValid   PTPFlags = 0x0004
	PTPFlagPTPTimescale     PTPFlags = 0x0008
	PTPFlagTimeTraceable    PTPFlags = 0x0010
	PTPFlagFreqTraceable    PTPFlags = 0x0020
	PTPFlagSyncUncertain    PTPFlags = 0x0040 // IEEE 1588-2019
)

Flag bits.

func (PTPFlags) String

func (f PTPFlags) String() string

String lists the set flags, e.g. "twoStep|ptpTimescale".

type PTPFollowUpInfo

type PTPFollowUpInfo struct {
	// CumulativeScaledRateOffset is (rateRatio - 1) * 2^41; see RateRatio.
	CumulativeScaledRateOffset int32
	GMTimeBaseIndicator        uint16
	LastGMPhaseChange          PTPScaledNs
	// ScaledLastGMFreqChange is the fractional frequency change * 2^41.
	ScaledLastGMFreqChange int32
}

PTPFollowUpInfo is the IEEE 802.1AS Follow_Up information TLV (802.1AS-2020, 11.4.4.3).

func (PTPFollowUpInfo) RateRatio

func (f PTPFollowUpInfo) RateRatio() float64

RateRatio returns the grandmaster to local clock frequency ratio.

type PTPGPTPCapable

type PTPGPTPCapable struct {
	LogMessageInterval int8
	Flags              uint8
}

PTPGPTPCapable is the IEEE 802.1AS gPTP-capable TLV (802.1AS-2020, 10.6.4.4).

type PTPGPTPCapableInterval

type PTPGPTPCapableInterval struct {
	LogMessageInterval int8
}

PTPGPTPCapableInterval is the IEEE 802.1AS gPTP-capable message interval request TLV (802.1AS-2020, 10.6.4.5).

type PTPInterfaceRate

type PTPInterfaceRate struct {
	// BitPeriod is the period of one bit of the interface, in attoseconds.
	BitPeriod uint64
	// The bits a frame holds before and after its timestamp point.
	BitsBeforeTimestamp uint16
	BitsAfterTimestamp  uint16
}

PTPInterfaceRate is the ITU-T G.8275.1 and G.8275.2 interface rate TLV of a Signaling message.

type PTPIntervalFlags

type PTPIntervalFlags uint8

PTPIntervalFlags is the flags octet of the IEEE 802.1AS message interval request TLV.

const (
	PTPIntervalComputeRateRatio PTPIntervalFlags = 0x02
	PTPIntervalComputeLinkDelay PTPIntervalFlags = 0x04
	PTPIntervalOneStepReceive   PTPIntervalFlags = 0x08
)

Message interval request flags. The masks are Wireshark's.

type PTPIntervalRequest

type PTPIntervalRequest struct {
	LinkDelayInterval int8
	TimeSyncInterval  int8
	AnnounceInterval  int8
	Flags             PTPIntervalFlags
}

PTPIntervalRequest is the IEEE 802.1AS message interval request TLV (802.1AS-2020, 10.6.4.3). The intervals are log2 seconds; 127 stops sending and -128 asks for no change.

type PTPL1Sync

type PTPL1Sync struct {
	Flags    PTPL1SyncFlags
	Extended bool

	ExtFlags               PTPL1SyncExtFlags
	PhaseOffsetTx          PTPTimeInterval
	PhaseOffsetTxTimestamp PTPTimestamp
	FreqOffsetTx           PTPTimeInterval
	FreqOffsetTxTimestamp  PTPTimestamp
}

PTPL1Sync is the value of an L1_SYNC TLV (IEEE 1588-2019, Annex L). The fields after Flags are those of the extended format, which a port sends when PTPL1OptParamsEnabled is set; Extended tells.

type PTPL1SyncExtFlags

type PTPL1SyncExtFlags uint8

PTPL1SyncExtFlags is the third flag octet, of the extended format only.

const (
	PTPL1TimestampsCorrectedTx PTPL1SyncExtFlags = 0x01 // TCT
	PTPL1PhaseOffsetTxValid    PTPL1SyncExtFlags = 0x02 // POV
	PTPL1FreqOffsetTxValid     PTPL1SyncExtFlags = 0x04 // FOV
)

Extended L1_SYNC flags.

type PTPL1SyncFlags

type PTPL1SyncFlags uint16

PTPL1SyncFlags holds the two flag octets every L1_SYNC TLV opens with, the first in the high byte.

const (
	PTPL1TxCoherentRequired PTPL1SyncFlags = 0x0100 // TCR
	PTPL1RxCoherentRequired PTPL1SyncFlags = 0x0200 // RCR
	PTPL1CongruentRequired  PTPL1SyncFlags = 0x0400 // CR
	// PTPL1OptParamsEnabled marks the extended format.
	PTPL1OptParamsEnabled PTPL1SyncFlags = 0x0800 // OPE
	PTPL1TxCoherent       PTPL1SyncFlags = 0x0001 // ITC
	PTPL1RxCoherent       PTPL1SyncFlags = 0x0002 // IRC
	PTPL1Congruent        PTPL1SyncFlags = 0x0004 // IC
)

L1_SYNC flags: what the port requires, then what it has.

type PTPManagement

type PTPManagement struct {
	StartingBoundaryHops uint8
	BoundaryHops         uint8
	Action               PTPManagementAction
	// ID is the managementId of the MANAGEMENT or MANAGEMENT_ERROR_STATUS
	// TLV.
	ID PTPManagementID
	// Error is the managementErrorId of a MANAGEMENT_ERROR_STATUS TLV.
	Error PTPManagementError
}

PTPManagement is the body of a Management message, with the IDs of its first TLV.

type PTPManagementAction

type PTPManagementAction uint8

PTPManagementAction is the actionField of a Management message.

const (
	PTPActionGet         PTPManagementAction = 0
	PTPActionSet         PTPManagementAction = 1
	PTPActionResponse    PTPManagementAction = 2
	PTPActionCommand     PTPManagementAction = 3
	PTPActionAcknowledge PTPManagementAction = 4
)

Management actions.

func (PTPManagementAction) String

func (a PTPManagementAction) String() string

String returns the action name.

type PTPManagementError

type PTPManagementError uint16

PTPManagementError is a managementErrorId.

const (
	PTPMgmtErrResponseTooBig PTPManagementError = 0x0001
	PTPMgmtErrNoSuchID       PTPManagementError = 0x0002
	PTPMgmtErrWrongLength    PTPManagementError = 0x0003
	PTPMgmtErrWrongValue     PTPManagementError = 0x0004
	PTPMgmtErrNotSetable     PTPManagementError = 0x0005
	PTPMgmtErrNotSupported   PTPManagementError = 0x0006
	PTPMgmtErrGeneralError   PTPManagementError = 0xFFFE
)

Management error IDs.

func (PTPManagementError) String

func (e PTPManagementError) String() string

String returns the error name, e.g. "NO_SUCH_ID".

type PTPManagementErrorStatus

type PTPManagementErrorStatus struct {
	Error PTPManagementError
	// ID is the managementId the error is about.
	ID          PTPManagementID
	DisplayData string
}

PTPManagementErrorStatus is the value of a MANAGEMENT_ERROR_STATUS TLV.

type PTPManagementID

type PTPManagementID uint16

PTPManagementID is a managementId (IEEE 1588-2008, Table 40).

const (
	PTPMgmtNullManagement            PTPManagementID = 0x0000
	PTPMgmtClockDescription          PTPManagementID = 0x0001
	PTPMgmtUserDescription           PTPManagementID = 0x0002
	PTPMgmtSaveInNonVolatileStorage  PTPManagementID = 0x0003
	PTPMgmtResetNonVolatileStorage   PTPManagementID = 0x0004
	PTPMgmtInitialize                PTPManagementID = 0x0005
	PTPMgmtFaultLog                  PTPManagementID = 0x0006
	PTPMgmtFaultLogReset             PTPManagementID = 0x0007
	PTPMgmtDefaultDataSet            PTPManagementID = 0x2000
	PTPMgmtCurrentDataSet            PTPManagementID = 0x2001
	PTPMgmtParentDataSet             PTPManagementID = 0x2002
	PTPMgmtTimePropertiesDataSet     PTPManagementID = 0x2003
	PTPMgmtPortDataSet               PTPManagementID = 0x2004
	PTPMgmtPriority1                 PTPManagementID = 0x2005
	PTPMgmtPriority2                 PTPManagementID = 0x2006
	PTPMgmtDomain                    PTPManagementID = 0x2007
	PTPMgmtSlaveOnly                 PTPManagementID = 0x2008
	PTPMgmtLogAnnounceInterval       PTPManagementID = 0x2009
	PTPMgmtAnnounceReceiptTimeout    PTPManagementID = 0x200A
	PTPMgmtLogSyncInterval           PTPManagementID = 0x200B
	PTPMgmtVersionNumber             PTPManagementID = 0x200C
	PTPMgmtEnablePort                PTPManagementID = 0x200D
	PTPMgmtDisablePort               PTPManagementID = 0x200E
	PTPMgmtTime                      PTPManagementID = 0x200F
	PTPMgmtClockAccuracy             PTPManagementID = 0x2010
	PTPMgmtUTCProperties             PTPManagementID = 0x2011
	PTPMgmtTraceabilityProperties    PTPManagementID = 0x2012
	PTPMgmtTimescaleProperties       PTPManagementID = 0x2013
	PTPMgmtUnicastNegotiationEnable  PTPManagementID = 0x2014
	PTPMgmtPathTraceList             PTPManagementID = 0x2015
	PTPMgmtPathTraceEnable           PTPManagementID = 0x2016
	PTPMgmtGrandmasterClusterTable   PTPManagementID = 0x2017
	PTPMgmtUnicastMasterTable        PTPManagementID = 0x2018
	PTPMgmtUnicastMasterMaxTableSize PTPManagementID = 0x2019
	PTPMgmtAcceptableMasterTable     PTPManagementID = 0x201A
	PTPMgmtAcceptableMasterEnabled   PTPManagementID = 0x201B
	PTPMgmtAcceptableMasterMaxSize   PTPManagementID = 0x201C
	PTPMgmtAlternateMaster           PTPManagementID = 0x201D
	PTPMgmtAlternateTimeOffsetEnable PTPManagementID = 0x201E
	PTPMgmtAlternateTimeOffsetName   PTPManagementID = 0x201F
	PTPMgmtAlternateTimeOffsetMaxKey PTPManagementID = 0x2020
	PTPMgmtAlternateTimeOffsetProps  PTPManagementID = 0x2021
	PTPMgmtExternalPortConfigEnabled PTPManagementID = 0x3000 // IEEE 1588-2019
	PTPMgmtMasterOnly                PTPManagementID = 0x3001 // IEEE 1588-2019
	PTPMgmtHoldoverUpgradeEnable     PTPManagementID = 0x3002 // IEEE 1588-2019
	PTPMgmtExtPortConfigPortDataSet  PTPManagementID = 0x3003 // IEEE 1588-2019
	PTPMgmtTransparentClockDefaultDS PTPManagementID = 0x4000
	PTPMgmtTransparentClockPortDS    PTPManagementID = 0x4001
	PTPMgmtPrimaryDomain             PTPManagementID = 0x4002
	PTPMgmtDelayMechanism            PTPManagementID = 0x6000
	PTPMgmtLogMinPdelayReqInterval   PTPManagementID = 0x6001
)

Management IDs.

func (PTPManagementID) String

func (m PTPManagementID) String() string

String returns the management ID name, e.g. "CURRENT_DATA_SET".

type PTPManagementTLV

type PTPManagementTLV struct {
	ID   PTPManagementID
	Data []byte
}

PTPManagementTLV is the value of a MANAGEMENT TLV. Data is empty in a GET; Decode types it.

func (PTPManagementTLV) Decode

func (m PTPManagementTLV) Decode() (any, error)

Decode returns the typed data of the management TLV:

CLOCK_DESCRIPTION                   PTPClockDescription
USER_DESCRIPTION                    PTPUserDescription
FAULT_LOG                           PTPFaultLog
DEFAULT_DATA_SET                    PTPDefaultDataSet
CURRENT_DATA_SET                    PTPCurrentDataSet
PARENT_DATA_SET                     PTPParentDataSet
TIME_PROPERTIES_DATA_SET            PTPTimePropertiesDataSet
PORT_DATA_SET                       PTPPortDataSet
TIME                                PTPTimestamp
CLOCK_ACCURACY                      PTPClockAccuracy
UTC_PROPERTIES                      PTPUTCProperties
TRACEABILITY_PROPERTIES             PTPTraceabilityProperties
TIMESCALE_PROPERTIES                PTPTimescaleProperties
PATH_TRACE_LIST                     PTPPathTrace
GRANDMASTER_CLUSTER_TABLE           PTPAddressTable
UNICAST_MASTER_TABLE                PTPAddressTable
ACCEPTABLE_MASTER_TABLE             PTPAcceptableMasterTable
ALTERNATE_MASTER                    PTPAlternateMaster
ALTERNATE_TIME_OFFSET_ENABLE        PTPAltTimeOffsetEnable
ALTERNATE_TIME_OFFSET_NAME          PTPAltTimeOffsetName
ALTERNATE_TIME_OFFSET_PROPERTIES    PTPAltTimeOffsetProperties
EXT_PORT_CONFIG_PORT_DATA_SET       PTPExtPortConfig
TRANSPARENT_CLOCK_DEFAULT_DATA_SET  PTPTransparentDefaultDS
TRANSPARENT_CLOCK_PORT_DATA_SET     PTPTransparentPortDS
DELAY_MECHANISM                     PTPDelayMechanism
single value IDs                    PTPMgmtUint8, PTPMgmtInt8,
                                    PTPMgmtUint16 or PTPMgmtBool

Empty data, as in a GET or for an ID that carries none, gives nil and no error, and so does an unknown ID. Data too short for its ID gives ErrPTPTLVValue. Slices alias the packet data.

type PTPMessageAvailability

type PTPMessageAvailability uint8

PTPMessageAvailability tells how a port can send one message type.

const (
	PTPAvailMulticast        PTPMessageAvailability = 0x01
	PTPAvailUnicast          PTPMessageAvailability = 0x02
	PTPAvailUnicastNegotiate PTPMessageAvailability = 0x04
	// PTPAvailUnicastNegotiateOn is unicast negotiation capable and
	// enabled.
	PTPAvailUnicastNegotiateOn PTPMessageAvailability = 0x08
)

Message availability flags.

type PTPMessageType

type PTPMessageType uint8

PTPMessageType is the messageType of the common header.

const (
	PTPMessageSync               PTPMessageType = 0x0
	PTPMessageDelayReq           PTPMessageType = 0x1
	PTPMessagePdelayReq          PTPMessageType = 0x2
	PTPMessagePdelayResp         PTPMessageType = 0x3
	PTPMessageFollowUp           PTPMessageType = 0x8
	PTPMessageDelayResp          PTPMessageType = 0x9
	PTPMessagePdelayRespFollowUp PTPMessageType = 0xA
	PTPMessageAnnounce           PTPMessageType = 0xB
	PTPMessageSignaling          PTPMessageType = 0xC
	PTPMessageManagement         PTPMessageType = 0xD
)

Message types.

func (PTPMessageType) String

func (m PTPMessageType) String() string

String returns the message type as the standard spells it.

type PTPMgmtBool

type PTPMgmtBool bool

PTPMgmtBool is the data of a managementId holding one flag: SLAVE_ONLY, UNICAST_NEGOTIATION_ENABLE, PATH_TRACE_ENABLE, ACCEPTABLE_MASTER_TABLE_ENABLED, EXTERNAL_PORT_CONFIGURATION_ENABLED, MASTER_ONLY and HOLDOVER_UPGRADE_ENABLE.

type PTPMgmtInt8

type PTPMgmtInt8 int8

PTPMgmtInt8 is the data of a managementId holding a log2 interval in seconds: LOG_ANNOUNCE_INTERVAL, LOG_SYNC_INTERVAL and LOG_MIN_PDELAY_REQ_INTERVAL.

type PTPMgmtUint8

type PTPMgmtUint8 uint8

PTPMgmtUint8 is the data of a managementId holding one unsigned octet: PRIORITY1, PRIORITY2, DOMAIN, ANNOUNCE_RECEIPT_TIMEOUT, VERSION_NUMBER, ALTERNATE_TIME_OFFSET_MAX_KEY and PRIMARY_DOMAIN.

type PTPMgmtUint16

type PTPMgmtUint16 uint16

PTPMgmtUint16 is the data of a managementId holding two octets: INITIALIZE (the initialization key), UNICAST_MASTER_MAX_TABLE_SIZE and ACCEPTABLE_MASTER_MAX_TABLE_SIZE.

type PTPNTPMessage

type PTPNTPMessage []byte

PTPNTPMessage is the IANA TLV that carries an NTP message inside PTP (NTP over PTP). The NTP layer decodes it.

type PTPNetworkProtocol

type PTPNetworkProtocol uint16

PTPNetworkProtocol is the networkProtocol of a PortAddress.

const (
	PTPNetworkUDPv4      PTPNetworkProtocol = 0x0001
	PTPNetworkUDPv6      PTPNetworkProtocol = 0x0002
	PTPNetworkIEEE8023   PTPNetworkProtocol = 0x0003
	PTPNetworkDeviceNet  PTPNetworkProtocol = 0x0004
	PTPNetworkControlNet PTPNetworkProtocol = 0x0005
	PTPNetworkPROFINET   PTPNetworkProtocol = 0x0006
	PTPNetworkUnknown    PTPNetworkProtocol = 0xFFFE
)

Network protocols.

func (PTPNetworkProtocol) String

func (n PTPNetworkProtocol) String() string

String returns the protocol name, e.g. "UDP/IPv4".

type PTPOrganizationExtension

type PTPOrganizationExtension struct {
	// Type is the tlvType: sub types are numbered apart for
	// ORGANIZATION_EXTENSION_DO_NOT_PROPAGATE.
	Type           PTPTLVType
	OrganizationID PTPOrganizationID
	SubType        uint32
	Data           []byte
}

PTPOrganizationExtension is the value of an ORGANIZATION_EXTENSION TLV, in any of its three propagation forms. Decode types Data for the organizations this package knows.

func (PTPOrganizationExtension) Decode

func (o PTPOrganizationExtension) Decode() (any, error)

Decode returns the typed form of the extension:

IEEE 802.1, ORGANIZATION_EXTENSION, sub type 1   PTPFollowUpInfo
                                    sub type 2   PTPIntervalRequest
                                    sub type 3   PTPCSN
                                    sub type 6   PTPDriftTracking
IEEE 802.1, DO_NOT_PROPAGATE, sub type 4         PTPGPTPCapable
                              sub type 5         PTPGPTPCapableInterval
IEEE C37.238, ORGANIZATION_EXTENSION, 1 and 2    PTPC37238
SMPTE, ORGANIZATION_EXTENSION, sub type 1        PTPSMPTE
CERN, ORGANIZATION_EXTENSION, sub type 0xDEAD01  PTPWhiteRabbit
ITU-T, ORGANIZATION_EXTENSION, sub type 2        PTPInterfaceRate
IANA, ORGANIZATION_EXTENSION, sub type 1         PTPNTPMessage

Anything else gives nil and no error; a short value gives ErrPTPTLVValue. Like Wireshark, it reads ORGANIZATION_EXTENSION_PROPAGATE no further than the organization and sub type.

type PTPOrganizationID

type PTPOrganizationID uint32

PTPOrganizationID is the 24-bit OUI or CID of an organization extension.

const (
	PTPOrgIEEE8021 PTPOrganizationID = 0x0080C2
	PTPOrgIEEEC37  PTPOrganizationID = 0x1C129D // IEEE C37.238 power profile
	PTPOrgSMPTE    PTPOrganizationID = 0x6897E8
	PTPOrgCERN     PTPOrganizationID = 0x080030 // White Rabbit
	PTPOrgITUT     PTPOrganizationID = 0x0019A7
	PTPOrgIANA     PTPOrganizationID = 0x00005E
)

Organizations with typed extensions, and the others Wireshark knows.

func (PTPOrganizationID) String

func (o PTPOrganizationID) String() string

String returns the organization name, or its OUI in hex.

type PTPPad

type PTPPad []byte

PTPPad is the value of a PAD TLV: filler to ignore.

type PTPParentDataSet

type PTPParentDataSet struct {
	ParentPort  PTPPortIdentity
	ParentStats bool
	// ObservedVariance is observedParentOffsetScaledLogVariance.
	ObservedVariance uint16
	// ObservedPhaseChangeRate is observedParentClockPhaseChangeRate.
	ObservedPhaseChangeRate int32
	GrandmasterPriority1    uint8
	GrandmasterClockQuality PTPClockQuality
	GrandmasterPriority2    uint8
	GrandmasterIdentity     PTPClockIdentity
}

PTPParentDataSet is the data of PARENT_DATA_SET.

type PTPPathTrace

type PTPPathTrace []PTPClockIdentity

PTPPathTrace is the value of a PATH_TRACE TLV: the clocks an Announce message went through.

type PTPPortAddress

type PTPPortAddress struct {
	NetworkProtocol PTPNetworkProtocol
	Address         []byte
}

PTPPortAddress is a PortAddress. Address aliases the packet data.

type PTPPortAvailability

type PTPPortAvailability struct {
	Sync      PTPMessageAvailability
	DelayResp PTPMessageAvailability
}

PTPPortAvailability is the value of a PORT_COMMUNICATION_AVAILABILITY TLV (IEEE 1588-2019, 16.9).

type PTPPortDataSet

type PTPPortDataSet struct {
	PortIdentity            PTPPortIdentity
	PortState               PTPPortState
	LogMinDelayReqInterval  int8
	PeerMeanPathDelay       PTPTimeInterval
	LogAnnounceInterval     int8
	AnnounceReceiptTimeout  uint8
	LogSyncInterval         int8
	DelayMechanism          PTPDelayMechanism
	LogMinPdelayReqInterval int8
	VersionNumber           uint8
}

PTPPortDataSet is the data of PORT_DATA_SET. The intervals are log2 seconds.

type PTPPortIdentity

type PTPPortIdentity struct {
	ClockIdentity PTPClockIdentity
	PortNumber    uint16
}

PTPPortIdentity is a portIdentity: a clock and one of its ports.

type PTPPortState

type PTPPortState uint8

PTPPortState is a portState.

const (
	PTPPortInitializing PTPPortState = 1
	PTPPortFaulty       PTPPortState = 2
	PTPPortDisabled     PTPPortState = 3
	PTPPortListening    PTPPortState = 4
	PTPPortPreMaster    PTPPortState = 5
	PTPPortMaster       PTPPortState = 6
	PTPPortPassive      PTPPortState = 7
	PTPPortUncalibrated PTPPortState = 8
	PTPPortSlave        PTPPortState = 9
)

Port states.

func (PTPPortState) String

func (s PTPPortState) String() string

String returns the state name, e.g. "SLAVE".

type PTPProtocolAddress

type PTPProtocolAddress PTPPortAddress

PTPProtocolAddress is the value of a PROTOCOL_ADDRESS TLV (IEEE 1588-2019, 16.9): the address the port sends from.

type PTPRxSyncComputedRecord

type PTPRxSyncComputedRecord struct {
	SequenceID       uint16
	OffsetFromMaster PTPTimeInterval
	MeanPathDelay    PTPTimeInterval
	// ScaledNeighborRateRatio is (rateRatio - 1) * 2^41.
	ScaledNeighborRateRatio int32
}

PTPRxSyncComputedRecord is what a slave port computed from one Sync message.

type PTPRxSyncTimingRecord

type PTPRxSyncTimingRecord struct {
	SequenceID          uint16
	SyncOriginTimestamp PTPTimestamp
	TotalCorrection     PTPTimeInterval
	// ScaledCumulativeRateOffset is (rateRatio - 1) * 2^41.
	ScaledCumulativeRateOffset int32
	SyncEventIngressTimestamp  PTPTimestamp
}

PTPRxSyncTimingRecord is what a slave port saw of one Sync message.

type PTPSMPTE

type PTPSMPTE struct {
	// The default system frame rate is Numerator/Denominator Hz.
	FrameRateNumerator   uint32
	FrameRateDenominator uint32
	LockingStatus        PTPSMPTELockStatus
	TimeAddressFlags     PTPSMPTETimeFlags
	// CurrentLocalOffset is local time minus PTP time.
	CurrentLocalOffset     int32
	JumpSeconds            int32
	TimeOfNextJump         uint64
	TimeOfNextJam          uint64
	TimeOfPreviousJam      uint64
	PreviousJamLocalOffset int32
	DaylightSaving         PTPSMPTEDaylight
	LeapSecondJump         uint8
}

PTPSMPTE is the SMPTE ST 2059-2 synchronization metadata (SM) TLV a grandmaster sends in a Management message (ST 2059-2:2021, Table 2). Offsets and jumps are in seconds; the times are seconds of the PTP timescale.

type PTPSMPTEDaylight

type PTPSMPTEDaylight uint8

PTPSMPTEDaylight is the daylightSaving octet of the SMPTE TLV.

const (
	PTPSMPTEDaylightCurrent  PTPSMPTEDaylight = 0x01
	PTPSMPTEDaylightNext     PTPSMPTEDaylight = 0x02
	PTPSMPTEDaylightPrevious PTPSMPTEDaylight = 0x04
)

Daylight saving flags: in effect now, at the next discontinuity, and at the previous daily jam.

type PTPSMPTELockStatus

type PTPSMPTELockStatus uint8

PTPSMPTELockStatus is the gmLockingStatus of the SMPTE TLV, which the 2015 edition called masterLockingStatus.

const (
	PTPSMPTEUnavailable PTPSMPTELockStatus = 0
	PTPSMPTEInternal    PTPSMPTELockStatus = 1
	PTPSMPTEColdLocking PTPSMPTELockStatus = 2
	PTPSMPTEWarmLocking PTPSMPTELockStatus = 3
	PTPSMPTELocked      PTPSMPTELockStatus = 4
)

Grandmaster locking states (SMPTE ST 2059-2:2021, Table 2).

func (PTPSMPTELockStatus) String

func (s PTPSMPTELockStatus) String() string

String returns the state name, e.g. "Externally locked".

type PTPSMPTETimeFlags

type PTPSMPTETimeFlags uint8

PTPSMPTETimeFlags is the timeAddressFlags octet of the SMPTE TLV.

const (
	PTPSMPTEDropFrame  PTPSMPTETimeFlags = 0x01
	PTPSMPTEColorFrame PTPSMPTETimeFlags = 0x02
)

Time address flags.

type PTPScaledNs

type PTPScaledNs [ptpScaledNsLen]byte

PTPScaledNs is a 96-bit IEEE 802.1AS ScaledNs or UScaledNs, big endian: nanoseconds scaled by 2^16.

func (PTPScaledNs) Ns

func (s PTPScaledNs) Ns() float64

Ns returns the value in nanoseconds, read as signed. A UScaledNs above 2^95 would come out negative; none fits a real link delay or timestamp.

type PTPSlaveRxSyncComputed

type PTPSlaveRxSyncComputed struct {
	SourcePort PTPPortIdentity
	Flags      PTPComputedFlags
	Records    []PTPRxSyncComputedRecord
}

PTPSlaveRxSyncComputed is the value of a SLAVE_RX_SYNC_COMPUTED_DATA TLV (IEEE 1588-2019, 16.11.5).

type PTPSlaveRxSyncTiming

type PTPSlaveRxSyncTiming struct {
	// SourcePort is the port the Sync messages came from.
	SourcePort PTPPortIdentity
	Records    []PTPRxSyncTimingRecord
}

PTPSlaveRxSyncTiming is the value of a SLAVE_RX_SYNC_TIMING_DATA TLV (IEEE 1588-2019, 16.11.4).

type PTPSlaveTxEventTimestamps

type PTPSlaveTxEventTimestamps struct {
	SourcePort       PTPPortIdentity
	EventMessageType PTPMessageType
	Records          []PTPTxEventRecord
}

PTPSlaveTxEventTimestamps is the value of a SLAVE_TX_EVENT_TIMESTAMPS TLV (IEEE 1588-2019, 16.11.6). EventMessageType is read from the high nibble of its octet, where the unicast TLVs keep theirs.

type PTPTLV

type PTPTLV struct {
	Type   PTPTLVType
	Length uint16
	Value  []byte
}

PTPTLV is one TLV. Value is the raw value; Decode gives its typed form.

func (PTPTLV) Decode

func (t PTPTLV) Decode() (any, error)

Decode returns the typed value of the TLV:

MANAGEMENT                               PTPManagementTLV
MANAGEMENT_ERROR_STATUS                  PTPManagementErrorStatus
ORGANIZATION_EXTENSION, all three forms  PTPOrganizationExtension
REQUEST_UNICAST_TRANSMISSION             PTPUnicastRequest
GRANT_UNICAST_TRANSMISSION               PTPUnicastGrant
CANCEL_ and ACKNOWLEDGE_CANCEL_UNICAST   PTPUnicastCancel
PATH_TRACE                               PTPPathTrace
ALTERNATE_TIME_OFFSET_INDICATOR          PTPAlternateTimeOffset
AUTHENTICATION (0x8009)                  PTPAuthentication
PAD                                      PTPPad
L1_SYNC                                  PTPL1Sync
PORT_COMMUNICATION_AVAILABILITY          PTPPortAvailability
PROTOCOL_ADDRESS                         PTPProtocolAddress
SLAVE_RX_SYNC_TIMING_DATA                PTPSlaveRxSyncTiming
SLAVE_RX_SYNC_COMPUTED_DATA              PTPSlaveRxSyncComputed
SLAVE_TX_EVENT_TIMESTAMPS                PTPSlaveTxEventTimestamps
CUMULATIVE_RATE_RATIO                    PTPCumulativeRateRatio
ENHANCED_ACCURACY_METRICS                PTPEnhancedAccuracyMetrics
CUM_FREQ_SCALE_FACTOR_OFFSET             PTPCumFreqScaleFactorOffset

Any other type gives nil and no error. A value too short for its type gives ErrPTPTLVValue. Slices alias the packet data.

type PTPTLVType

type PTPTLVType uint16

PTPTLVType is a tlvType.

const (
	PTPTLVManagement                PTPTLVType = 0x0001
	PTPTLVManagementErrorStatus     PTPTLVType = 0x0002
	PTPTLVOrganizationExtension     PTPTLVType = 0x0003
	PTPTLVRequestUnicast            PTPTLVType = 0x0004
	PTPTLVGrantUnicast              PTPTLVType = 0x0005
	PTPTLVCancelUnicast             PTPTLVType = 0x0006
	PTPTLVAckCancelUnicast          PTPTLVType = 0x0007
	PTPTLVPathTrace                 PTPTLVType = 0x0008
	PTPTLVAlternateTimeOffset       PTPTLVType = 0x0009
	PTPTLVAuthentication            PTPTLVType = 0x2000 // IEEE 1588-2008 Annex K
	PTPTLVAuthenticationChallenge   PTPTLVType = 0x2001 // IEEE 1588-2008 Annex K
	PTPTLVSecurityAssociationUpdate PTPTLVType = 0x2002 // IEEE 1588-2008 Annex K
	PTPTLVCumFreqScaleFactorOffset  PTPTLVType = 0x2003 // IEEE 1588-2008 Annex L
	PTPTLVOrgExtensionPropagate     PTPTLVType = 0x4000 // IEEE 1588-2019
	PTPTLVEnhancedAccuracyMetrics   PTPTLVType = 0x4001 // IEEE 1588-2019
	PTPTLVOrgExtensionNoPropagate   PTPTLVType = 0x8000 // IEEE 1588-2019
	PTPTLVL1Sync                    PTPTLVType = 0x8001 // IEEE 1588-2019
	PTPTLVPortAvailability          PTPTLVType = 0x8002 // IEEE 1588-2019
	PTPTLVProtocolAddress           PTPTLVType = 0x8003 // IEEE 1588-2019
	PTPTLVSlaveRxSyncTimingData     PTPTLVType = 0x8004 // IEEE 1588-2019
	PTPTLVSlaveRxSyncComputedData   PTPTLVType = 0x8005 // IEEE 1588-2019
	PTPTLVSlaveTxEventTimestamps    PTPTLVType = 0x8006 // IEEE 1588-2019
	PTPTLVCumulativeRateRatio       PTPTLVType = 0x8007 // IEEE 1588-2019
	PTPTLVPad                       PTPTLVType = 0x8008 // IEEE 1588-2019
	PTPTLVAuthentication2019        PTPTLVType = 0x8009 // IEEE 1588-2019, 16.14
)

TLV types.

func (PTPTLVType) String

func (t PTPTLVType) String() string

String returns the TLV type name, e.g. "PATH_TRACE".

type PTPTimeInterval

type PTPTimeInterval int64

PTPTimeInterval is a TimeInterval: nanoseconds scaled by 2^16.

func (PTPTimeInterval) Ns

func (i PTPTimeInterval) Ns() float64

Ns returns the interval in nanoseconds.

type PTPTimePropertiesDataSet

type PTPTimePropertiesDataSet struct {
	CurrentUTCOffset int16
	Flags            PTPFlags
	TimeSource       PTPTimeSource
}

PTPTimePropertiesDataSet is the data of TIME_PROPERTIES_DATA_SET. Flags holds the leap, UTC offset valid, timescale and traceable bits, as the low octet of a header flagField does.

type PTPTimeSource

type PTPTimeSource uint8

PTPTimeSource is the timeSource of an Announce message.

const (
	PTPTimeSourceAtomicClock        PTPTimeSource = 0x10
	PTPTimeSourceGNSS               PTPTimeSource = 0x20 // GPS in IEEE 1588-2008
	PTPTimeSourceTerrestrialRadio   PTPTimeSource = 0x30
	PTPTimeSourceSerialTimeCode     PTPTimeSource = 0x39 // IEEE 1588-2019
	PTPTimeSourcePTP                PTPTimeSource = 0x40
	PTPTimeSourceNTP                PTPTimeSource = 0x50
	PTPTimeSourceHandSet            PTPTimeSource = 0x60
	PTPTimeSourceOther              PTPTimeSource = 0x90
	PTPTimeSourceInternalOscillator PTPTimeSource = 0xA0
)

Time sources.

func (PTPTimeSource) String

func (s PTPTimeSource) String() string

String returns the time source name.

type PTPTimescaleProperties

type PTPTimescaleProperties struct {
	Flags      PTPFlags
	TimeSource PTPTimeSource
}

PTPTimescaleProperties is the data of TIMESCALE_PROPERTIES. Flags holds the ptpTimescale bit.

type PTPTimestamp

type PTPTimestamp struct {
	Seconds     uint64
	Nanoseconds uint32
}

PTPTimestamp is a PTP Timestamp: 48-bit seconds and nanoseconds.

func (PTPTimestamp) Time

func (t PTPTimestamp) Time() time.Time

Time returns the timestamp as a time.Time in UTC. It does not apply currentUtcOffset: with the ptpTimescale flag set, the seconds count TAI.

func (PTPTimestamp) UTC

func (t PTPTimestamp) UTC(currentUTCOffset int16) time.Time

UTC returns a PTP timescale (TAI) timestamp as UTC, by taking off currentUtcOffset seconds, e.g. 37 since 2017. The offset comes from an Announce message or a time properties data set and is only good when their currentUtcOffsetValid flag is set. With the ptpTimescale flag clear the timescale is arbitrary and Time is the best reading.

type PTPTraceabilityProperties

type PTPTraceabilityProperties struct {
	Flags PTPFlags
}

PTPTraceabilityProperties is the data of TRACEABILITY_PROPERTIES. Flags holds the time and frequency traceable bits.

type PTPTransparentDefaultDS

type PTPTransparentDefaultDS struct {
	ClockIdentity  PTPClockIdentity
	NumberPorts    uint16
	DelayMechanism PTPDelayMechanism
	PrimaryDomain  uint8
}

PTPTransparentDefaultDS is the data of TRANSPARENT_CLOCK_DEFAULT_DATA_SET.

type PTPTransparentPortDS

type PTPTransparentPortDS struct {
	PortIdentity            PTPPortIdentity
	Faulty                  bool
	LogMinPdelayReqInterval int8
	PeerMeanPathDelay       PTPTimeInterval
}

PTPTransparentPortDS is the data of TRANSPARENT_CLOCK_PORT_DATA_SET.

type PTPTransport

type PTPTransport uint8

PTPTransport says what carried a PTP message.

const (
	// PTPTransportUnknown is the zero value: the message is read as plain
	// IEEE 1588, as it is over UDP.
	PTPTransportUnknown PTPTransport = iota
	// PTPTransportEthernet is PTP over EtherType 0x88F7, the only transport
	// of IEEE 802.1AS.
	PTPTransportEthernet
)

PTP transports.

type PTPTxEventRecord

type PTPTxEventRecord struct {
	SequenceID           uint16
	EventEgressTimestamp PTPTimestamp
}

PTPTxEventRecord is the egress time of one event message.

type PTPUTCProperties

type PTPUTCProperties struct {
	CurrentUTCOffset int16
	Flags            PTPFlags
}

PTPUTCProperties is the data of UTC_PROPERTIES. Flags holds the leap and UTC offset valid bits.

type PTPUnicastCancel

type PTPUnicastCancel struct {
	Acknowledge     bool
	MessageType     PTPMessageType
	MaintainRequest bool // IEEE 1588-2019
	MaintainGrant   bool // IEEE 1588-2019
}

PTPUnicastCancel is the value of a CANCEL_UNICAST_TRANSMISSION or ACKNOWLEDGE_CANCEL_UNICAST_TRANSMISSION TLV; Acknowledge tells them apart.

type PTPUnicastGrant

type PTPUnicastGrant struct {
	MessageType           PTPMessageType
	LogInterMessagePeriod int8
	Duration              uint32
	RenewalInvited        bool
}

PTPUnicastGrant is the value of a GRANT_UNICAST_TRANSMISSION TLV. A zero Duration denies the request.

type PTPUnicastRequest

type PTPUnicastRequest struct {
	MessageType PTPMessageType
	// LogInterMessagePeriod is log2 of the seconds between messages.
	LogInterMessagePeriod int8
	// Duration is durationField, in seconds.
	Duration uint32
}

PTPUnicastRequest is the value of a REQUEST_UNICAST_TRANSMISSION TLV.

type PTPUserDescription

type PTPUserDescription string

PTPUserDescription is the data of USER_DESCRIPTION.

type PTPWRConfig

type PTPWRConfig uint8

PTPWRConfig tells which White Rabbit roles a port can take.

const (
	PTPWRNonWR      PTPWRConfig = 0
	PTPWRMasterOnly PTPWRConfig = 1
	PTPWRSlaveOnly  PTPWRConfig = 2
	PTPWRMasterAndS PTPWRConfig = 3
)

White Rabbit port configurations.

func (PTPWRConfig) String

func (c PTPWRConfig) String() string

String returns the configuration name, e.g. "WR_M_AND_S".

type PTPWRFlags

type PTPWRFlags uint16

PTPWRFlags is the wrFlags field of a White Rabbit Announce suffix.

const (
	PTPWRConfigMask PTPWRFlags = 0x0003
	PTPWRCalibDone  PTPWRFlags = 0x0004 // calibrated
	PTPWRModeIsOn   PTPWRFlags = 0x0008 // wrModeOn
)

White Rabbit flags. The low two bits are the wrConfig; see Config.

func (PTPWRFlags) Config

func (f PTPWRFlags) Config() PTPWRConfig

Config returns the wrConfig bits of the flags.

type PTPWRMessageID

type PTPWRMessageID uint16

PTPWRMessageID is the wrMessageID of a White Rabbit TLV.

const (
	PTPWRSlavePresent   PTPWRMessageID = 0x1000
	PTPWRLock           PTPWRMessageID = 0x1001
	PTPWRLocked         PTPWRMessageID = 0x1002
	PTPWRCalibrate      PTPWRMessageID = 0x1003
	PTPWRCalibrated     PTPWRMessageID = 0x1004
	PTPWRModeOn         PTPWRMessageID = 0x1005
	PTPWRAnnounceSuffix PTPWRMessageID = 0x2000
)

White Rabbit messages (WRPTP 2.0). All but the Announce suffix travel in Signaling messages.

func (PTPWRMessageID) String

func (m PTPWRMessageID) String() string

String returns the message name, e.g. "CALIBRATE".

type PTPWhiteRabbit

type PTPWhiteRabbit struct {
	MessageID PTPWRMessageID
	Flags     PTPWRFlags

	CalSendPattern bool
	CalRetry       uint8
	// CalPeriod is the calibration period in microseconds.
	CalPeriod uint32

	// DeltaTx and DeltaRx are the fixed delays of the port, in
	// picoseconds scaled by 2^16; see PTPWRDelayPs.
	DeltaTx uint64
	DeltaRx uint64
}

PTPWhiteRabbit is a CERN White Rabbit TLV. Flags is set in an Announce suffix, the calibration fields in CALIBRATE and the deltas in CALIBRATED; the other messages carry the ID alone.

type PktapDirection added in v1.6.0

type PktapDirection uint32

PktapDirection represents the direction of a packet

func (PktapDirection) String added in v1.6.0

func (d PktapDirection) String() string

type PktapV1 added in v1.6.0

type PktapV1 struct {
	BaseLayer
	HeaderLength           uint32       // 0x00: total header length (156)
	RecordType             uint32       // 0x04: PKT_REC_PACKET=1
	DLT                    uint32       // 0x08: DLT type of inner packet
	InterfaceName          string       // 0x0C: interface name (24 bytes)
	Flags                  uint32       // 0x24: direction and other flags
	ProtocolFamily         uint32       // 0x28: protocol family (AF_INET=2, AF_INET6=30)
	LinkLayerHeaderLength  uint32       // 0x2C: link-layer header length
	LinkLayerTrailerLength uint32       // 0x30: link-layer trailer length
	PID                    uint32       // 0x34: process ID
	CommandName            string       // 0x38: command name (20 bytes)
	ServiceClass           ServiceClass // 0x4C: service class
	InterfaceType          uint16       // 0x50: interface type
	InterfaceUnit          uint16       // 0x52: unit number
	EffectivePID           uint32       // 0x54: effective process ID
	EffectiveCommandName   string       // 0x58: effective command name (20 bytes)
}

PktapV1 is the Darwin-specific pktap v1 metadata header. It wraps packets with process/connection metadata at the kernel level. see: https://github.com/apple-oss-distributions/xnu/blob/xnu-12377.81.4/bsd/net/pktap.h#L89-L114

func (*PktapV1) CanDecode added in v1.6.0

func (p *PktapV1) CanDecode() gopacket.LayerClass

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

func (*PktapV1) DecodeFromBytes added in v1.6.0

func (p *PktapV1) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes the given bytes into this layer.

func (*PktapV1) Direction added in v1.6.0

func (p *PktapV1) Direction() PktapDirection

Direction returns the packet direction (in/out)

func (*PktapV1) LayerType added in v1.6.0

func (p *PktapV1) LayerType() gopacket.LayerType

LayerType returns LayerTypePktap.

func (*PktapV1) NextLayerType added in v1.6.0

func (p *PktapV1) NextLayerType() gopacket.LayerType

NextLayerType returns the layer type of the inner packet (determined by DLT)

func (*PktapV1) String added in v1.6.0

func (p *PktapV1) String() string

String returns a human-readable representation of the pktap metadata.

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 Profinet

type Profinet struct {
	BaseLayer

	FrameID ProfinetFrameID

	// Cyclic frames only. A frame with authenticated encryption (see
	// Security) hides the trailer: IOData is then the ciphertext and the
	// three status fields are zero.
	IOData         []byte
	CycleCounter   uint16
	DataStatus     ProfinetDataStatus
	TransferStatus uint8

	// Security is the SecurityMetaData of a secured cyclic or alarm frame,
	// nil for plain frames.
	Security *ProfinetSecurity

	// Subframes are the DFP subframes of an RT_CLASS_3 frame, nil when the
	// frame is not packed. They alias IOData, which stays whole.
	//
	// A frame is taken as packed when, as in Wireshark's IsDFP_Frame, its
	// IO data opens with a header CRC that is zero or matches, the next
	// two bytes are not zero, and a chain of subframes (position, length,
	// cycle counter, data status, data, CRC) leads to a terminating
	// zero-length subframe, each non-zero CRC of a subframe with position
	// bit 7 set matching. The header CRC covers the Ethernet addresses, so
	// it can only be checked when the frame is decoded from the Ethernet
	// layer down; a bare DecodeFromBytes accepts a zero header CRC only.
	// Use DecodeSubframes to supply the addresses in that case.
	SubframeHeaderCRC uint16
	Subframes         []ProfinetSubframe

	// Fragment frames only (0xFF80-0xFF8F); the payload is the fragment.
	FragDataLength uint8 // in units of 8 octets
	FragStatus     ProfinetFragStatus
}

Profinet is a PROFINET real-time frame.

For cyclic classes (see ProfinetFrameClass.IsCyclic) the IO data and the APDU status trailer are decoded here and there is no payload. The IO data layout comes from the device's GSDML file, so it stays raw.

Ethernet pads frames to 64 bytes. The cyclic trailer always sits at the end of the frame, so the padding needed by short IO data is part of IOData: without the connection's configuration the padding cannot be told apart from data. Wireshark behaves the same way.

For acyclic classes the PDU after the Frame ID is the payload. Padding is left in the payload; the DCP, alarm and PTCP layers drop it using their own length fields.

func (*Profinet) CanDecode

func (p *Profinet) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeProfinet.

func (*Profinet) DecodeFromBytes

func (p *Profinet) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a PROFINET RT frame, starting at the Frame ID.

func (*Profinet) DecodeSubframes

func (p *Profinet) DecodeSubframes(dst, src net.HardwareAddr) bool

DecodeSubframes looks for DFP subframes in IOData and fills Subframes, reporting whether the frame is packed. dst and src are the Ethernet addresses of the frame; without them (nil) only a zero header CRC is accepted, since a non-zero one cannot be checked.

Decoding a packet from the Ethernet layer calls this for RT_CLASS_3 frames. Callers that use DecodeFromBytes directly, such as a DecodingLayerParser, can call it with the addresses of their Ethernet layer.

func (*Profinet) LayerType

func (p *Profinet) LayerType() gopacket.LayerType

LayerType returns LayerTypeProfinet.

func (*Profinet) NextLayerType

func (p *Profinet) NextLayerType() gopacket.LayerType

NextLayerType picks the decoder for the PDU after the Frame ID.

type ProfinetAMDeviceID

type ProfinetAMDeviceID struct {
	Organization uint16
	VendorID     uint16
	DeviceID     uint16
	DeviceSubID  uint16
}

ProfinetAMDeviceID is AM_DeviceIdentification: the organization that assigned the vendor ID (0 PROFINET) and the IDs it scopes.

type ProfinetAMLocation

type ProfinetAMLocation [profinetAMLocationLen]byte

ProfinetAMLocation is AM_Location: where an asset sits. The low byte selects the structure: 1 a tree of up to twelve 10-bit levels, 2 the slot and subslot of a submodule.

func (ProfinetAMLocation) BeginSlot

func (l ProfinetAMLocation) BeginSlot() uint16

BeginSlot returns the first slot of a slot and subslot location.

func (ProfinetAMLocation) BeginSubslot

func (l ProfinetAMLocation) BeginSubslot() uint16

BeginSubslot returns the first subslot of a slot and subslot location.

func (ProfinetAMLocation) EndSlot

func (l ProfinetAMLocation) EndSlot() uint16

EndSlot returns the last slot of a slot and subslot location.

func (ProfinetAMLocation) EndSubslot

func (l ProfinetAMLocation) EndSubslot() uint16

EndSubslot returns the last subslot of a slot and subslot location.

func (ProfinetAMLocation) Level

func (l ProfinetAMLocation) Level(n int) uint16

Level returns level n (0 to 11) of a level tree location; 0x3FF marks an unused level. The levels follow the structure byte, 10 bits each, from the low end of the 128-bit value.

func (ProfinetAMLocation) Levels

func (l ProfinetAMLocation) Levels() [profinetAMLocationLevels]uint16

Levels returns the twelve levels of a level tree location.

func (ProfinetAMLocation) Structure

func (l ProfinetAMLocation) Structure() uint8

Structure returns AM_Location.Structure: 1 level tree, 2 slot and subslot.

type ProfinetAPIData

type ProfinetAPIData struct {
	APIs []uint32
}

ProfinetAPIData is the body of APIData: the APIs a device has.

type ProfinetARAlgorithmInfo

type ProfinetARAlgorithmInfo struct {
	IOProtection    ProfinetSecurityCapability // InputOutputProtectionAlgorithm
	AlarmProtection ProfinetSecurityCapability // AlarmProtectionAlgorithm
	SXPProtection   ProfinetSecurityCapability // SXPProtectionAlgorithm
	KeyDerivation   ProfinetSecurityCapability // KeyDerivationAlgorithm
	KeyAgreement    ProfinetSecurityCapability // KeyAgreementAlgorithm
}

ProfinetARAlgorithmInfo is the body of ARAlgorithmInfoBlock: the algorithms that protect an AR.

type ProfinetARBlock

type ProfinetARBlock struct {
	ARType     ProfinetARType
	ARUUID     ProfinetUUID
	SessionKey uint16
	MAC        net.HardwareAddr // CMInitiatorMacAdd or CMResponderMacAdd
	UDPRTPort  uint16           // InitiatorUDPRTPort or ResponderUDPRTPort

	ObjectUUID            ProfinetUUID // CMInitiatorObjectUUID
	Properties            ProfinetARProperties
	ActivityTimeoutFactor uint16
	StationName           string // CMInitiatorStationName
}

ProfinetARBlock is an ARBlockReq or ARBlockRes.

The request names the CM initiator, the response the CM responder; the fields after UDPRTPort exist only in requests.

type ProfinetARData

type ProfinetARData struct {
	ARs []ProfinetARDataAR
}

ProfinetARData is the body of ARData: the ARs a device has.

type ProfinetARDataAR

type ProfinetARDataAR struct {
	ARUUID               ProfinetUUID
	ARType               ProfinetARType
	Properties           ProfinetARProperties
	InitiatorObjectUUID  ProfinetUUID // CMInitiatorObjectUUID
	InitiatorStationName string
	IOCRs                []ProfinetARDataIOCR
	AlarmCRType          uint16
	LocalAlarmReference  uint16
	RemoteAlarmReference uint16
	PrmServerObjectUUID  ProfinetUUID // ParameterServerObjectUUID
	PrmServerStationName string
	APIs                 []uint32
	InitiatorUDPRTPort   uint16          // version 1.1
	ResponderUDPRTPort   uint16          // version 1.1
	NumberOfARDataInfo   uint16          // version 1.1
	Info                 []ProfinetBlock // version 1.1: IRInfoBlock, SRInfoBlock, ...
}

ProfinetARDataAR is one AR of ARData.

type ProfinetARDataIOCR

type ProfinetARDataIOCR struct {
	IOCRType           ProfinetIOCRType
	Properties         ProfinetIOCRProperties
	FrameID            ProfinetFrameID
	CycleCounter       uint16
	DataStatus         ProfinetDataStatus
	TransferStatus     uint8
	InitiatorUDPRTPort uint16
	ResponderUDPRTPort uint16
}

ProfinetARDataIOCR is one IOCR of an AR in ARData. The UDP ports exist per IOCR in version 1.0 and per AR in version 1.1.

type ProfinetARProperties

type ProfinetARProperties uint32

ProfinetARProperties is the ARProperties bit field of an ARBlockReq.

func (ProfinetARProperties) AcknowledgeCompanionAR

func (p ProfinetARProperties) AcknowledgeCompanionAR() bool

AcknowledgeCompanionAR reports whether the companion AR needs an acknowledge (bit 11).

func (ProfinetARProperties) AdvancedStartup

func (p ProfinetARProperties) AdvancedStartup() bool

AdvancedStartup reports whether the advanced startup mode is used.

func (ProfinetARProperties) CombinedObjectContainer

func (p ProfinetARProperties) CombinedObjectContainer() bool

CombinedObjectContainer reports whether the AR uses the CombinedObjectContainer (bit 29).

func (ProfinetARProperties) CompanionAR

func (p ProfinetARProperties) CompanionAR() uint8

CompanionAR returns bits 9-10: 0 single AR, 1 first AR of a companion pair, 2 companion AR.

func (ProfinetARProperties) DeviceAccess

func (p ProfinetARProperties) DeviceAccess() bool

DeviceAccess reports whether the AR is a device access AR.

func (ProfinetARProperties) ParameterizationServer

func (p ProfinetARProperties) ParameterizationServer() bool

ParameterizationServer reports who parameterizes: false an external parameter server, true the CM initiator (bit 4).

func (ProfinetARProperties) PullModuleAlarm

func (p ProfinetARProperties) PullModuleAlarm() bool

PullModuleAlarm reports whether pull module alarms are allowed.

func (ProfinetARProperties) RejectDCPSetRequests

func (p ProfinetARProperties) RejectDCPSetRequests() bool

RejectDCPSetRequests reports whether the device rejects DCP Set while the AR is up (bit 27).

func (ProfinetARProperties) State

func (p ProfinetARProperties) State() uint8

State returns the AR state (bits 0-2): 1 active.

func (ProfinetARProperties) SupervisorTakeoverAllowed

func (p ProfinetARProperties) SupervisorTakeoverAllowed() bool

SupervisorTakeoverAllowed reports whether an IO supervisor may take the AR over (bit 3).

func (ProfinetARProperties) TimeAwareSystem

func (p ProfinetARProperties) TimeAwareSystem() bool

TimeAwareSystem reports whether the AR belongs to a time aware system (bit 28).

type ProfinetARRPCBlock

type ProfinetARRPCBlock struct {
	RPCServerPort uint16
}

ProfinetARRPCBlock is the body of ARRPCBlockReq and ARRPCBlockRes: the UDP port of the RPC server of the initiator or the responder.

type ProfinetARSXPBlock

type ProfinetARSXPBlock struct {
	ARType                ProfinetARType
	ARUUID                ProfinetUUID
	SessionKey            uint16
	ActivityTimeoutFactor uint16
	Properties            ProfinetARProperties
	Endpoint              ProfinetSXPEndpoint
	MAC                   net.HardwareAddr // CMInitiatorMacAdd or CMResponderMacAdd
	StationName           string
}

ProfinetARSXPBlock is an ARSXPBlockReq or ARSXPBlockRsp: the AR block of a connection over the secure transport. The response has no timeout factor and no properties.

type ProfinetARSelector

type ProfinetARSelector uint16

ProfinetARSelector is the last two bytes of the ARUUID of a system redundancy AR (ARType 0x0020). The six bytes before the eight of the configuration ID discriminate the AR set.

func (ProfinetARSelector) ARNumber

func (s ProfinetARSelector) ARNumber() uint8

ARNumber returns the number of the AR in its AR set (bits 0-2).

func (ProfinetARSelector) ARResource

func (s ProfinetARSelector) ARResource() uint8

ARResource returns bits 3-4: 2 a communication endpoint shall be possible for the AR.

type ProfinetARServerBlock

type ProfinetARServerBlock struct {
	StationName string // CMResponderStationName
}

ProfinetARServerBlock is an ARServerBlockRes.

type ProfinetARType

type ProfinetARType uint16

ProfinetARType is the ARType of an AR block.

const (
	ProfinetARTypeIOController ProfinetARType = 0x0001
	ProfinetARTypeIOCARCIR     ProfinetARType = 0x0003
	ProfinetARTypeSupervisor   ProfinetARType = 0x0006
	ProfinetARTypeRTClass3     ProfinetARType = 0x0010
	ProfinetARTypeSysRed       ProfinetARType = 0x0020
)

AR types.

func (ProfinetARType) String

func (t ProfinetARType) String() string

String returns the AR type name used by Wireshark.

type ProfinetARUUIDBlock

type ProfinetARUUIDBlock struct {
	ARUUID ProfinetUUID
}

ProfinetARUUIDBlock is the body of ARUUIDBlock.

type ProfinetARVendorBlock

type ProfinetARVendorBlock struct {
	APStructureIdentifier uint16
	API                   uint32
	Data                  []byte
}

ProfinetARVendorBlock is the body of ARVendorBlockReq and ARVendorBlockRes.

type ProfinetAdjustBoundary

type ProfinetAdjustBoundary struct {
	Boundary         uint32
	Egress           uint32
	AdjustProperties uint16
}

ProfinetAdjustBoundary is the body of the adjust blocks that hold a 32-bit boundary: AdjustDomainBoundary, AdjustMulticastBoundary, AdjustPeerToPeerBoundary and AdjustDCPBoundary. A set bit blocks the multicast address or the protocol of that position.

AdjustDomainBoundary 1.1 has one boundary per direction: Boundary is DomainBoundaryIngress and Egress DomainBoundaryEgress.

type ProfinetAdjustValue

type ProfinetAdjustValue struct {
	Value            uint16
	AdjustProperties uint16
}

ProfinetAdjustValue is the body of the adjust blocks that hold one 16-bit value: MAUType in AdjustMAUType, LinkState in AdjustLinkState, PreambleLength in AdjustPreambleLength and MAUTypeExtension in AdjustMAUTypeExtension.

type ProfinetAlarm

type ProfinetAlarm struct {
	BaseLayer

	DstEndpoint   uint16
	SrcEndpoint   uint16
	PDUType       ProfinetAlarmPDUType
	Version       uint8
	WindowSize    uint8
	TACK          uint8
	SendSeqNum    uint16
	AckSeqNum     uint16
	VarPartLength uint16

	// ERR-RTA PNIO status.
	ErrorCode   uint8
	ErrorDecode uint8
	ErrorCode1  uint8
	ErrorCode2  uint8

	// Block is the DATA-RTA block, with Block.Alarm or Block.AlarmAck set
	// for the alarm block types. It is nil for other PDU types and when
	// the VarPart holds no whole block header.
	Block *ProfinetBlock
}

ProfinetAlarm is a PROFINET IO RTA-PDU.

The payload is the raw VarPart; Ethernet padding past VarPartLen is dropped. It is also decoded: the block of a DATA-RTA into Block, the PNIO status of an ERR-RTA into the four error fields.

func (*ProfinetAlarm) CanDecode

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

CanDecode returns LayerTypeProfinetAlarm.

func (*ProfinetAlarm) DecodeFromBytes

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

DecodeFromBytes decodes an RTA-PDU, starting at the destination endpoint.

func (*ProfinetAlarm) LayerType

func (a *ProfinetAlarm) LayerType() gopacket.LayerType

LayerType returns LayerTypeProfinetAlarm.

func (*ProfinetAlarm) NextLayerType

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

NextLayerType returns LayerTypePayload when there is a VarPart.

func (*ProfinetAlarm) Status

func (a *ProfinetAlarm) Status() ProfinetPNIOStatus

Status returns the ERR-RTA PNIO status as one value.

type ProfinetAlarmAck

type ProfinetAlarmAck struct {
	AlarmType ProfinetAlarmType
	API       uint32
	Slot      uint16
	Subslot   uint16
	Specifier ProfinetAlarmSpecifier
	Status    ProfinetPNIOStatus
}

ProfinetAlarmAck is the body of an alarm acknowledge block.

type ProfinetAlarmCRBlock

type ProfinetAlarmCRBlock struct {
	AlarmCRType        uint16
	LocalAlarmRef      uint16
	MaxAlarmDataLength uint16

	LT               EthernetType
	Properties       ProfinetAlarmCRProperties
	RTATimeoutFactor uint16
	RTARetries       uint16
	TagHeaderHigh    ProfinetTagHeader
	TagHeaderLow     ProfinetTagHeader
}

ProfinetAlarmCRBlock is an AlarmCRBlockReq or AlarmCRBlockRes. The response carries only the type, the reference and the data length.

type ProfinetAlarmCRProperties

type ProfinetAlarmCRProperties uint32

ProfinetAlarmCRProperties is the AlarmCRProperties bit field.

func (ProfinetAlarmCRProperties) LowPriorityOnly

func (p ProfinetAlarmCRProperties) LowPriorityOnly() bool

LowPriorityOnly reports whether the user priority is ignored and every alarm travels with low priority (bit 0).

func (ProfinetAlarmCRProperties) UDPTransport

func (p ProfinetAlarmCRProperties) UDPTransport() bool

UDPTransport reports whether alarms use RTA_CLASS_UDP rather than RTA_CLASS_1 (bit 1).

type ProfinetAlarmItem

type ProfinetAlarmItem struct {
	USI  ProfinetUSI
	Data []byte

	// ChannelDiagnosis, ExtChannelDiagnosis, QualifiedChannelDiagnosis
	// and, for the first two fields, PRAL items.
	ChannelNumber     uint16
	ChannelProperties ProfinetChannelProperties
	ChannelErrorType  ProfinetChannelErrorType

	// ExtChannelDiagnosis and QualifiedChannelDiagnosis.
	ExtChannelErrorType ProfinetExtChannelErrorType
	ExtChannelAddValue  uint32

	// QualifiedChannelDiagnosis.
	QualifiedChannelQualifier ProfinetChannelQualifier

	// PRAL (channel related process alarm reason).
	PRALReason         uint16
	PRALExtReason      uint16
	PRALReasonAddValue []byte

	// Maintenance, Upload&Retrieval, iParameter and PE_EnergySavingStatus
	// items wrap a block.
	Block *ProfinetBlock

	// Multiple: the DiagnosisData blocks of the submodule.
	Blocks []ProfinetBlock

	// RS_LowWatermark, RS_Timeout and RS_Overflow (reserved bits only).
	RSAlarmInfo uint16

	// RS_Event.
	RSEvents *ProfinetRSEventInfo
}

ProfinetAlarmItem is one user structure of an alarm notification.

Data holds the item's bytes after the identifier. The typed fields are set for the identifiers they belong to.

func (*ProfinetAlarmItem) ExtErrorName

func (it *ProfinetAlarmItem) ExtErrorName() string

ExtErrorName names ExtChannelErrorType for the item's channel error type.

type ProfinetAlarmItemBlock

type ProfinetAlarmItemBlock struct {
	// MaintenanceItem.
	MaintenanceStatus ProfinetMaintenanceStatus

	// Upload&Retrieval items (IEC 61158-6-10; Wireshark leaves them raw).
	URRecordIndex  uint32
	URRecordLength uint32

	// iParameterItem (IEC 61158-6-10; Wireshark leaves it raw).
	IParReqHeader uint32
	MaxSegmSize   uint32
	TransferIndex uint32
	TotalIParSize uint32

	// PE alarm: PE_OperationalMode.
	PEOperationalMode uint8
}

ProfinetAlarmItemBlock is the body of the blocks alarm items wrap.

type ProfinetAlarmNotification

type ProfinetAlarmNotification struct {
	AlarmType            ProfinetAlarmType
	API                  uint32
	Slot                 uint16
	Subslot              uint16
	ModuleIdentNumber    uint32
	SubmoduleIdentNumber uint32
	Specifier            ProfinetAlarmSpecifier
	Items                []ProfinetAlarmItem
}

ProfinetAlarmNotification is the body of an alarm notification block.

type ProfinetAlarmPDUType

type ProfinetAlarmPDUType uint8

ProfinetAlarmPDUType is the RTA-PDU type.

const (
	ProfinetAlarmData ProfinetAlarmPDUType = 0x01
	ProfinetAlarmNACK ProfinetAlarmPDUType = 0x02
	ProfinetAlarmACK  ProfinetAlarmPDUType = 0x03
	ProfinetAlarmERR  ProfinetAlarmPDUType = 0x04
)

RTA-PDU types.

func (ProfinetAlarmPDUType) String

func (t ProfinetAlarmPDUType) String() string

String returns the PDU type name.

type ProfinetAlarmSpecifier

type ProfinetAlarmSpecifier uint16

ProfinetAlarmSpecifier is the AlarmSpecifier bit field.

const (
	ProfinetAlarmSpecChannel      ProfinetAlarmSpecifier = 0x0800
	ProfinetAlarmSpecManufacturer ProfinetAlarmSpecifier = 0x1000
	ProfinetAlarmSpecSubmodule    ProfinetAlarmSpecifier = 0x2000
	ProfinetAlarmSpecARDiagnosis  ProfinetAlarmSpecifier = 0x8000
)

AlarmSpecifier bits.

func (ProfinetAlarmSpecifier) ARDiagnosis

func (s ProfinetAlarmSpecifier) ARDiagnosis() bool

ARDiagnosis reports whether the AR has a diagnosis pending.

func (ProfinetAlarmSpecifier) ChannelDiagnosis

func (s ProfinetAlarmSpecifier) ChannelDiagnosis() bool

ChannelDiagnosis reports whether a channel diagnosis is pending.

func (ProfinetAlarmSpecifier) ManufacturerDiagnosis

func (s ProfinetAlarmSpecifier) ManufacturerDiagnosis() bool

ManufacturerDiagnosis reports whether a manufacturer specific diagnosis is pending.

func (ProfinetAlarmSpecifier) SequenceNumber

func (s ProfinetAlarmSpecifier) SequenceNumber() uint16

SequenceNumber returns the alarm sequence number (11 bits).

func (ProfinetAlarmSpecifier) SubmoduleDiagnosis

func (s ProfinetAlarmSpecifier) SubmoduleDiagnosis() bool

SubmoduleDiagnosis reports whether the submodule has a diagnosis pending.

type ProfinetAlarmType

type ProfinetAlarmType uint16

ProfinetAlarmType is the AlarmType of an alarm notification.

const (
	ProfinetAlarmTypeDiagnosis         ProfinetAlarmType = 0x0001
	ProfinetAlarmTypeProcess           ProfinetAlarmType = 0x0002
	ProfinetAlarmTypePull              ProfinetAlarmType = 0x0003
	ProfinetAlarmTypePlug              ProfinetAlarmType = 0x0004
	ProfinetAlarmTypeStatus            ProfinetAlarmType = 0x0005
	ProfinetAlarmTypeUpdate            ProfinetAlarmType = 0x0006
	ProfinetAlarmTypeRedundancy        ProfinetAlarmType = 0x0007
	ProfinetAlarmTypeSupervisor        ProfinetAlarmType = 0x0008
	ProfinetAlarmTypeReleased          ProfinetAlarmType = 0x0009
	ProfinetAlarmTypePlugWrong         ProfinetAlarmType = 0x000A
	ProfinetAlarmTypeReturnOfSubmodule ProfinetAlarmType = 0x000B
	ProfinetAlarmTypeDiagDisappears    ProfinetAlarmType = 0x000C
	ProfinetAlarmTypeUploadRetrieval   ProfinetAlarmType = 0x001E
	ProfinetAlarmTypePullModule        ProfinetAlarmType = 0x001F
)

Common alarm types; String names all of them.

func (ProfinetAlarmType) String

func (t ProfinetAlarmType) String() string

String returns the alarm type name used by Wireshark.

type ProfinetAssetInfo

type ProfinetAssetInfo struct {
	UniqueIdentifier   ProfinetUUID
	Location           ProfinetAMLocation
	Annotation         string
	OrderID            string
	SoftwareRevision   string // AM_SoftwareRevision
	HardwareRevision   string // AM_HardwareRevision
	SerialNumber       string
	IMSoftwareRevision ProfinetSWRevision
	DeviceID           ProfinetAMDeviceID
	TypeIdentification uint16
	IMHardwareRevision uint16
}

ProfinetAssetInfo is one asset: the body of AM_FullInformation, AM_HardwareOnlyInformation and AM_FirmwareOnlyInformation. The hardware only block has no software revisions, the firmware only block no hardware revisions.

type ProfinetAuditableEvents

type ProfinetAuditableEvents struct {
	NumberOfEntries uint16
	Events          []string
}

ProfinetAuditableEvents is the body of ReadAuditableEventsRsp: syslog messages (RFC 5424), each behind a 16-bit length and padded to a multiple of four bytes from the block start.

type ProfinetBlock

type ProfinetBlock struct {
	Type        ProfinetBlockType
	Length      uint16 // BlockLength as sent
	VersionHigh uint8
	VersionLow  uint8
	Body        []byte

	Alarm      *ProfinetAlarmNotification // Alarm Notification High/Low
	AlarmAck   *ProfinetAlarmAck          // Alarm Ack High/Low
	AR         *ProfinetARBlock           // ARBlockReq, ARBlockRes
	IOCR       *ProfinetIOCRBlock         // IOCRBlockReq, IOCRBlockRes
	AlarmCR    *ProfinetAlarmCRBlock      // AlarmCRBlockReq, AlarmCRBlockRes
	Expected   *ProfinetExpectedBlock     // ExpectedSubmoduleBlockReq
	ModuleDiff *ProfinetModuleDiffBlock   // ModuleDiffBlock
	ARServer   *ProfinetARServerBlock     // ARServerBlockRes
	Control    *ProfinetControlBlock      // IODControl, IOXControl, IODRelease, PrmBegin
	Record     *ProfinetRecordBlock       // IODWrite/IODRead request and response headers
	Item       *ProfinetAlarmItemBlock    // MaintenanceItem, Upload&Retrieval, iParameter, PE alarm

	// Value is the body of every other decoded block type: a pointer to
	// the struct named beside the ProfinetBlock... constant of the type.
	// Blocks holds the blocks nested in a container.
	Value  interface{}
	Blocks []ProfinetBlock
}

ProfinetBlock is one PROFINET IO block.

Body holds the bytes after the version, clipped to the captured data. At most one of the typed pointers is set, for the block types listed with them. Every other block type with a known layout has its body in Value, as a pointer to the Profinet type documented with its block type constant, and the blocks it nests in Blocks. A block of an unknown type or version, or with a body shorter than its fixed fields, stays raw in Body.

func ProfinetDecodeBlocks

func ProfinetDecodeBlocks(data []byte) ([]ProfinetBlock, error)

ProfinetDecodeBlocks decodes a run of blocks, such as the record data of a read response whose index is known to hold blocks. It stops at the end of the data or at a zero block type, like Wireshark. Blocks decoded before an error are returned with it.

func (*ProfinetBlock) Clipped

func (b *ProfinetBlock) Clipped() bool

Clipped reports whether BlockLength promised more body than was captured.

func (*ProfinetBlock) Decoded

func (b *ProfinetBlock) Decoded() bool

Decoded reports whether the body was decoded into a typed value or into nested blocks. Other blocks are header-only: their body is raw in Body.

type ProfinetBlockType

type ProfinetBlockType uint16

ProfinetBlockType is the BlockType of a PROFINET IO block.

const (
	ProfinetBlockSubstituteValue ProfinetBlockType = 0x0014 // *ProfinetSubstituteValue
	ProfinetBlockRecordInput     ProfinetBlockType = 0x0015 // *ProfinetRecordIOData
	ProfinetBlockRecordOutput    ProfinetBlockType = 0x0016 // *ProfinetRecordIOData +Blocks
	ProfinetBlockARData          ProfinetBlockType = 0x0018 // *ProfinetARData
	ProfinetBlockLogBookData     ProfinetBlockType = 0x0019 // *ProfinetLogBookData
	ProfinetBlockAPIData         ProfinetBlockType = 0x001A // *ProfinetAPIData
	ProfinetBlockSRLData         ProfinetBlockType = 0x001B // *ProfinetSRLData
	ProfinetBlockPrmServerReq    ProfinetBlockType = 0x0105 // *ProfinetPrmServerBlock
	ProfinetBlockMCRReq          ProfinetBlockType = 0x0106 // *ProfinetMCRBlock
	ProfinetBlockARRPCReq        ProfinetBlockType = 0x0107 // *ProfinetARRPCBlock
	ProfinetBlockARVendorReq     ProfinetBlockType = 0x0108 // *ProfinetARVendorBlock
	ProfinetBlockIRInfo          ProfinetBlockType = 0x0109 // *ProfinetIRInfoBlock
	ProfinetBlockSRInfo          ProfinetBlockType = 0x010A // *ProfinetSRInfoBlock
	ProfinetBlockARFSU           ProfinetBlockType = 0x010B // Blocks only
	ProfinetBlockRSInfo          ProfinetBlockType = 0x010C // *ProfinetRSInfoBlock
	ProfinetBlockSubmoduleList   ProfinetBlockType = 0x0119 // *ProfinetSubmoduleList
	ProfinetBlockARUUIDReq       ProfinetBlockType = 0x011B // *ProfinetARUUIDBlock
	ProfinetBlockARUUID          ProfinetBlockType = 0x06E1 // *ProfinetARUUIDBlock
	ProfinetBlockPERequest       ProfinetBlockType = 0x0800 // *ProfinetPEService
	ProfinetBlockPEResponse      ProfinetBlockType = 0x0801 // *ProfinetPEService
	ProfinetBlockPEEntityFilter  ProfinetBlockType = 0x0810 // *ProfinetIdentification
	ProfinetBlockPEEntityStatus  ProfinetBlockType = 0x0811 // *ProfinetPEEntityStatus
	ProfinetBlockPrmServerRes    ProfinetBlockType = 0x8105 // *ProfinetPrmServerBlock
	ProfinetBlockARRPCRes        ProfinetBlockType = 0x8107 // *ProfinetARRPCBlock
	ProfinetBlockARVendorRes     ProfinetBlockType = 0x8108 // *ProfinetARVendorBlock
)

AR block types. Each names the type of ProfinetBlock.Value; "+Blocks" marks the containers.

const (
	ProfinetBlockAlarmHigh         ProfinetBlockType = 0x0001
	ProfinetBlockAlarmLow          ProfinetBlockType = 0x0002
	ProfinetBlockIODWriteReq       ProfinetBlockType = 0x0008
	ProfinetBlockIODReadReq        ProfinetBlockType = 0x0009
	ProfinetBlockARReq             ProfinetBlockType = 0x0101
	ProfinetBlockIOCRReq           ProfinetBlockType = 0x0102
	ProfinetBlockAlarmCRReq        ProfinetBlockType = 0x0103
	ProfinetBlockExpectedSubmodule ProfinetBlockType = 0x0104
	ProfinetBlockPrmEndReq         ProfinetBlockType = 0x0110
	ProfinetBlockPlugPrmEndReq     ProfinetBlockType = 0x0111
	ProfinetBlockAppReadyReq       ProfinetBlockType = 0x0112
	ProfinetBlockPlugAppReadyReq   ProfinetBlockType = 0x0113
	ProfinetBlockReleaseReq        ProfinetBlockType = 0x0114
	ProfinetBlockReadyCompanionReq ProfinetBlockType = 0x0116
	ProfinetBlockReadyRTC3Req      ProfinetBlockType = 0x0117
	ProfinetBlockPrmBeginReq       ProfinetBlockType = 0x0118
	ProfinetBlockMaintenanceItem   ProfinetBlockType = 0x0F00
	ProfinetBlockUploadRecords     ProfinetBlockType = 0x0F01
	ProfinetBlockIParameterItem    ProfinetBlockType = 0x0F02
	ProfinetBlockRetrieveRecords   ProfinetBlockType = 0x0F03
	ProfinetBlockRetrieveAll       ProfinetBlockType = 0x0F04
	ProfinetBlockPEAlarm           ProfinetBlockType = 0x0F05
	ProfinetBlockAlarmAckHigh      ProfinetBlockType = 0x8001
	ProfinetBlockAlarmAckLow       ProfinetBlockType = 0x8002
	ProfinetBlockIODWriteRes       ProfinetBlockType = 0x8008
	ProfinetBlockIODReadRes        ProfinetBlockType = 0x8009
	ProfinetBlockARRes             ProfinetBlockType = 0x8101
	ProfinetBlockIOCRRes           ProfinetBlockType = 0x8102
	ProfinetBlockAlarmCRRes        ProfinetBlockType = 0x8103
	ProfinetBlockModuleDiff        ProfinetBlockType = 0x8104
	ProfinetBlockARServer          ProfinetBlockType = 0x8106
	ProfinetBlockPrmEndRes         ProfinetBlockType = 0x8110
	ProfinetBlockPlugPrmEndRes     ProfinetBlockType = 0x8111
	ProfinetBlockAppReadyRes       ProfinetBlockType = 0x8112
	ProfinetBlockPlugAppReadyRes   ProfinetBlockType = 0x8113
	ProfinetBlockReleaseRes        ProfinetBlockType = 0x8114
	ProfinetBlockReadyCompanionRes ProfinetBlockType = 0x8116
	ProfinetBlockReadyRTC3Res      ProfinetBlockType = 0x8117
	ProfinetBlockPrmBeginRes       ProfinetBlockType = 0x8118
)

Block types with a typed decode. ProfinetBlockType.String names every type Wireshark knows.

const (
	ProfinetBlockCIMPortConfig       ProfinetBlockType = 0x0272 // *ProfinetCIMPortConfig +Blocks
	ProfinetBlockCIMQueueConfig      ProfinetBlockType = 0x0273 // *ProfinetCIMQueueConfig
	ProfinetBlockCIMStreamPath       ProfinetBlockType = 0x0275 // *ProfinetCIMStreamPath
	ProfinetBlockCIMSyncTree         ProfinetBlockType = 0x0276 // *ProfinetCIMSyncTree
	ProfinetBlockCIMUploadNetAttr    ProfinetBlockType = 0x0277 // *ProfinetCIMUploadAttributes +Blocks
	ProfinetBlockCIMForwardingDelay  ProfinetBlockType = 0x0278 // *ProfinetCIMForwardingDelay
	ProfinetBlockCIMExpectedNetAttr  ProfinetBlockType = 0x0279 // Blocks only
	ProfinetBlockCIMStreamPathReal   ProfinetBlockType = 0x027A // *ProfinetCIMStreamPath
	ProfinetBlockCIMIngressLimiter   ProfinetBlockType = 0x027B // *ProfinetCIMIngressLimiter
	ProfinetBlockCIMEgressLimiter    ProfinetBlockType = 0x027C // *ProfinetCIMEgressLimiter
	ProfinetBlockCIMPortCapabilities ProfinetBlockType = 0x027D // *ProfinetCIMPortCapabilities
	ProfinetBlockCIMExpectedNeighbor ProfinetBlockType = 0x027E // *ProfinetCIMExpectedNeighbors
	ProfinetBlockCIMCallingHomeAdj   ProfinetBlockType = 0x0310 // *ProfinetCIMCallingHome
	ProfinetBlockCIMCallingHomeReal  ProfinetBlockType = 0x0311 // *ProfinetCIMCallingHome
	ProfinetBlockCIMCapabilities     ProfinetBlockType = 0x0312 // *ProfinetCIMCapabilities
	ProfinetBlockRecordPolicyAdjust  ProfinetBlockType = 0x0313 // *ProfinetRecordAccessPolicy
	ProfinetBlockRecordPolicyReal    ProfinetBlockType = 0x0314 // *ProfinetRecordAccessPolicy
)

TSN network configuration block types and the type of their ProfinetBlock.Value.

const (
	ProfinetBlockExpectedIdent   ProfinetBlockType = 0x0012 // *ProfinetIdentification
	ProfinetBlockRealIdent       ProfinetBlockType = 0x0013 // *ProfinetIdentification
	ProfinetBlockIM0             ProfinetBlockType = 0x0020 // *ProfinetIM0
	ProfinetBlockIM1             ProfinetBlockType = 0x0021 // *ProfinetIM1
	ProfinetBlockIM2             ProfinetBlockType = 0x0022 // *ProfinetIM2
	ProfinetBlockIM3             ProfinetBlockType = 0x0023 // *ProfinetIM3
	ProfinetBlockIM4             ProfinetBlockType = 0x0024 // *ProfinetIM4
	ProfinetBlockIM5             ProfinetBlockType = 0x0025 // *ProfinetEntryCount, I&M5Data in Blocks
	ProfinetBlockIM0FilterSubmod ProfinetBlockType = 0x0030 // *ProfinetIdentification
	ProfinetBlockIM0FilterModule ProfinetBlockType = 0x0031 // *ProfinetIdentification
	ProfinetBlockIM0FilterDevice ProfinetBlockType = 0x0032 // *ProfinetIdentification
	ProfinetBlockIM5Data         ProfinetBlockType = 0x0034 // *ProfinetIM5Data
	ProfinetBlockAssetManagement ProfinetBlockType = 0x0035 // *ProfinetEntryCount, AM_* in Blocks
	ProfinetBlockAMFullInfo      ProfinetBlockType = 0x0036 // *ProfinetAssetInfo
	ProfinetBlockAMHardwareOnly  ProfinetBlockType = 0x0037 // *ProfinetAssetInfo
	ProfinetBlockAMFirmwareOnly  ProfinetBlockType = 0x0038 // *ProfinetAssetInfo
)

Block types of the identification records. Each names the type of ProfinetBlock.Value.

const (
	ProfinetBlockPDIfMrpAdjust    ProfinetBlockType = 0x0211 // *ProfinetMrpInterface +Blocks
	ProfinetBlockPDIfMrpReal      ProfinetBlockType = 0x0212 // *ProfinetMrpInterface +Blocks
	ProfinetBlockPDIfMrpCheck     ProfinetBlockType = 0x0213 // *ProfinetMrpInterface +Blocks
	ProfinetBlockPDPortMrpAdjust  ProfinetBlockType = 0x0214 // *ProfinetMrpPort
	ProfinetBlockPDPortMrpReal    ProfinetBlockType = 0x0215 // *ProfinetMrpPort
	ProfinetBlockMrpManagerParams ProfinetBlockType = 0x0216 // *ProfinetMrpManagerParams
	ProfinetBlockMrpClientParams  ProfinetBlockType = 0x0217 // *ProfinetMrpClientParams
	ProfinetBlockMrpRTModeManager ProfinetBlockType = 0x0218 // *ProfinetMrpRTMode
	ProfinetBlockMrpRingState     ProfinetBlockType = 0x0219 // *ProfinetCheckValue (MRP_RingState: 0 open, 1 closed)
	ProfinetBlockMrpRTState       ProfinetBlockType = 0x021A // *ProfinetCheckValue (MRP_RTState)
	ProfinetBlockMrpRTModeClient  ProfinetBlockType = 0x021D // *ProfinetMrpRTMode
	ProfinetBlockMrpInstAdjust    ProfinetBlockType = 0x0231 // *ProfinetMrpInterface +Blocks
	ProfinetBlockMrpInstReal      ProfinetBlockType = 0x0232 // *ProfinetMrpInterface +Blocks
	ProfinetBlockMrpInstCheck     ProfinetBlockType = 0x0233 // *ProfinetMrpInterface
)

MRP block types. Each names the type of ProfinetBlock.Value; "+Blocks" marks the containers.

const (
	ProfinetBlockPDPortDataCheck   ProfinetBlockType = 0x0200 // *ProfinetSubslot +Blocks
	ProfinetBlockPDevData          ProfinetBlockType = 0x0201 // Blocks only
	ProfinetBlockPDPortDataAdjust  ProfinetBlockType = 0x0202 // *ProfinetSubslot +Blocks
	ProfinetBlockPDSyncData        ProfinetBlockType = 0x0203 // *ProfinetPDSyncData
	ProfinetBlockIsochronousMode   ProfinetBlockType = 0x0204 // *ProfinetIsochronousMode
	ProfinetBlockPDIRData          ProfinetBlockType = 0x0205 // *ProfinetSubslot +Blocks
	ProfinetBlockPDIRGlobalData    ProfinetBlockType = 0x0206 // *ProfinetPDIRGlobalData
	ProfinetBlockPDIRFrameData     ProfinetBlockType = 0x0207 // *ProfinetPDIRFrameData
	ProfinetBlockPDIRBeginEndData  ProfinetBlockType = 0x0208 // *ProfinetPDIRBeginEnd
	ProfinetBlockAdjDomainBoundary ProfinetBlockType = 0x0209 // *ProfinetAdjustBoundary
	ProfinetBlockCheckPeers        ProfinetBlockType = 0x020A // *ProfinetCheckPeers
	ProfinetBlockCheckLineDelay    ProfinetBlockType = 0x020B // *ProfinetCheckLineDelay
	ProfinetBlockCheckMAUType      ProfinetBlockType = 0x020C // *ProfinetCheckValue
	ProfinetBlockAdjustMAUType     ProfinetBlockType = 0x020E // *ProfinetAdjustValue
	ProfinetBlockPDPortDataReal    ProfinetBlockType = 0x020F // *ProfinetPDPortDataReal
	ProfinetBlockAdjMulticastBound ProfinetBlockType = 0x0210 // *ProfinetAdjustBoundary
	ProfinetBlockAdjustLinkState   ProfinetBlockType = 0x021B // *ProfinetAdjustValue
	ProfinetBlockCheckLinkState    ProfinetBlockType = 0x021C // *ProfinetCheckValue
	ProfinetBlockCheckSyncDiff     ProfinetBlockType = 0x021E // *ProfinetCheckValue
	ProfinetBlockCheckMAUTypeDiff  ProfinetBlockType = 0x021F // *ProfinetCheckValue
	ProfinetBlockPDPortFODataReal  ProfinetBlockType = 0x0220 // *ProfinetFiberOptic +Blocks
	ProfinetBlockFOManufacturer    ProfinetBlockType = 0x0221 // *ProfinetFOManufacturer
	ProfinetBlockPDPortFOAdjust    ProfinetBlockType = 0x0222 // *ProfinetFiberOptic
	ProfinetBlockPDPortFOCheck     ProfinetBlockType = 0x0223 // *ProfinetBudgetCheck
	ProfinetBlockAdjP2PBoundary    ProfinetBlockType = 0x0224 // *ProfinetAdjustBoundary
	ProfinetBlockAdjDCPBoundary    ProfinetBlockType = 0x0225 // *ProfinetAdjustBoundary
	ProfinetBlockAdjPreambleLength ProfinetBlockType = 0x0226 // *ProfinetAdjustValue
	ProfinetBlockCheckMAUTypeExt   ProfinetBlockType = 0x0227 // *ProfinetCheckValue
	ProfinetBlockFODiagnosisInfo   ProfinetBlockType = 0x0228 // *ProfinetFODiagnosisInfo
	ProfinetBlockAdjustMAUTypeExt  ProfinetBlockType = 0x0229 // *ProfinetAdjustValue
	ProfinetBlockPDIRSubframeData  ProfinetBlockType = 0x022A // *ProfinetEntryCount +Blocks
	ProfinetBlockSubframe          ProfinetBlockType = 0x022B // *ProfinetSubframeBlock
	ProfinetBlockPDPortRealExt     ProfinetBlockType = 0x022C // *ProfinetSubslot +Blocks
	ProfinetBlockPDNCDataCheck     ProfinetBlockType = 0x0230 // *ProfinetBudgetCheck
	ProfinetBlockPDIfDataReal      ProfinetBlockType = 0x0240 // *ProfinetPDInterfaceReal
	ProfinetBlockPDIfAdjust        ProfinetBlockType = 0x0250 // *ProfinetPDInterfaceAdjust
	ProfinetBlockPDPortStatistic   ProfinetBlockType = 0x0251 // *ProfinetPDPortStatistic
	ProfinetBlockOwnPort           ProfinetBlockType = 0x0260 // *ProfinetOwnPort
	ProfinetBlockNeighbors         ProfinetBlockType = 0x0261 // *ProfinetNeighbors
	ProfinetBlockPDRsiInstances    ProfinetBlockType = 0x0241 // *ProfinetPDRsiInstances
	ProfinetBlockMultipleHeader    ProfinetBlockType = 0x0400 // *ProfinetMultipleHeader +Blocks
	ProfinetBlockCOContainer       ProfinetBlockType = 0x0401 // *ProfinetCOContainer +Blocks
	ProfinetBlockFSHello           ProfinetBlockType = 0x0600 // *ProfinetFSHello
	ProfinetBlockFSParameter       ProfinetBlockType = 0x0601 // *ProfinetFSParameter
	ProfinetBlockPDIfFSUAdjust     ProfinetBlockType = 0x0608 // Blocks only
	ProfinetBlockARFSUDataAdjust   ProfinetBlockType = 0x0609 // Blocks only
)

PDev block types. Each names the type of ProfinetBlock.Value; "+Blocks" marks the containers.

const (
	ProfinetBlockRSAdjustObserver ProfinetBlockType = 0x0900 // *ProfinetRSAdjustInfo
	ProfinetBlockRSGetEvent       ProfinetBlockType = 0x0901 // *ProfinetRSEventInfo
	ProfinetBlockRSAckEvent       ProfinetBlockType = 0x0902 // *ProfinetRSAckInfo
)

Reporting system block types and the type of their ProfinetBlock.Value.

const (
	ProfinetBlockARSXPReq        ProfinetBlockType = 0x010D // *ProfinetARSXPBlock
	ProfinetBlockSecurityReq     ProfinetBlockType = 0x011A // *ProfinetSecurityService
	ProfinetBlockRecordQuery     ProfinetBlockType = 0x0500 // *ProfinetRecordQuery
	ProfinetBlockSAMReq          ProfinetBlockType = 0x06E0 // *ProfinetSCMService
	ProfinetBlockARAlgorithmInfo ProfinetBlockType = 0x06E2 // *ProfinetARAlgorithmInfo
	ProfinetBlockSCMReq          ProfinetBlockType = 0x06F0 // *ProfinetSCMService
	ProfinetBlockARSXPRes        ProfinetBlockType = 0x810D // *ProfinetARSXPBlock
	ProfinetBlockSecurityRes     ProfinetBlockType = 0x811A // *ProfinetSecurityService
	ProfinetBlockAuditableEvents ProfinetBlockType = 0x811C // *ProfinetAuditableEvents
	ProfinetBlockSAMRes          ProfinetBlockType = 0x86E0 // *ProfinetSCMService
	ProfinetBlockSCMRes          ProfinetBlockType = 0x86F0 // *ProfinetSCMService
)

Security block types and the type of their ProfinetBlock.Value.

const (
	ProfinetBlockNMEDomainTime     ProfinetBlockType = 0x0274 // *ProfinetNMEDomainTime
	ProfinetBlockNMEDomainConfReal ProfinetBlockType = 0x027F // *ProfinetNMEDomainConfig
	ProfinetBlockCIMSNMPAdjust     ProfinetBlockType = 0x0300 // *ProfinetCIMSNMP
	ProfinetBlockCIMSNMPReal       ProfinetBlockType = 0x0302 // *ProfinetCIMSNMP
	ProfinetBlockCIMCLRPCAdjust    ProfinetBlockType = 0x0303 // *ProfinetCIMControl
	ProfinetBlockCIMCLRPCReal      ProfinetBlockType = 0x0304 // *ProfinetCIMControl
	ProfinetBlockCIMDCPAdjust      ProfinetBlockType = 0x0305 // *ProfinetCIMDCP
	ProfinetBlockCIMDCPReal        ProfinetBlockType = 0x0306 // *ProfinetCIMDCP
	ProfinetBlockCIMLockdownAdjust ProfinetBlockType = 0x0307 // *ProfinetCIMControl
	ProfinetBlockCIMLockdownReal   ProfinetBlockType = 0x0308 // *ProfinetCIMControl
	ProfinetBlockCIMPortSAPAdjust  ProfinetBlockType = 0x0309 // *ProfinetCIMControl
	ProfinetBlockCIMPortSAPReal    ProfinetBlockType = 0x030A // *ProfinetCIMControl
)

TSN and CIM block types and the type of their ProfinetBlock.Value.

const ProfinetBlockDiagnosisData ProfinetBlockType = 0x0010

ProfinetBlockDiagnosisData is the DiagnosisData block; its Value is a *ProfinetDiagnosisData.

func (ProfinetBlockType) String

func (t ProfinetBlockType) String() string

String returns the block type name used by Wireshark.

type ProfinetBudgetCheck

type ProfinetBudgetCheck struct {
	MaintenanceRequired ProfinetPowerBudget
	MaintenanceDemanded ProfinetPowerBudget
	Error               ProfinetPowerBudget
}

ProfinetBudgetCheck is the body of PDPortFODataCheck (power budgets) and PDNCDataCheck (frame drop budgets).

type ProfinetCIMCallingHome

type ProfinetCIMCallingHome struct {
	NumberOfEntries uint16
	Reserved        []byte
	Flags           uint16 // CallingHomeFlags
	StationName     string // CH_StationName
	StationIP       net.IP // CH_StationIP
}

ProfinetCIMCallingHome is the body of CIMCallingHomeAdjust and CIMCallingHomeReal with one entry: the station a device calls to have its SXP connection opened.

Wireshark dissects the first entry only and skips its first six bytes, which stay raw in Reserved. A block with another count stays raw.

func (*ProfinetCIMCallingHome) UseLayer2

func (c *ProfinetCIMCallingHome) UseLayer2() bool

UseLayer2 reports whether SXP runs over RTA.

func (*ProfinetCIMCallingHome) UseLayer3

func (c *ProfinetCIMCallingHome) UseLayer3() bool

UseLayer3 reports whether SXP runs over TCP/IP.

type ProfinetCIMCapabilities

type ProfinetCIMCapabilities struct {
	Entries []ProfinetCIMCapability
}

ProfinetCIMCapabilities is the body of CIM_Capabilities.

type ProfinetCIMCapability

type ProfinetCIMCapability struct {
	EntryLength     uint8  // CapEntryLength
	NamespaceFormat uint8  // 1 profile capability, 2 vendor capability
	NamespaceID     uint16 // CapNamespaceID
	CapabilityID    uint32 // CIMCapabilityID
}

ProfinetCIMCapability is one CIM_CapabilityEntry. Wireshark reads eight bytes whatever EntryLength says.

type ProfinetCIMControl

type ProfinetCIMControl struct {
	Control uint16
}

ProfinetCIMControl is the body of the CIM records that hold one control word: CLRPCControl, LockdownControl or PortControl. The methods read the word as one of the three; which one it is follows from the block type.

func (*ProfinetCIMControl) CLRPC

func (c *ProfinetCIMControl) CLRPC() bool

CLRPC reports whether CLRPCControl enables CLRPC (bit 0).

func (*ProfinetCIMControl) IOCInterface

func (c *ProfinetCIMControl) IOCInterface() bool

IOCInterface reports whether CLRPCControl enables the IO controller interface (bit 2).

func (*ProfinetCIMControl) IODInterface

func (c *ProfinetCIMControl) IODInterface() bool

IODInterface reports whether CLRPCControl enables the IO device interface (bit 1).

func (*ProfinetCIMControl) NonProtectableProtocols

func (c *ProfinetCIMControl) NonProtectableProtocols() uint8

NonProtectableProtocols returns bits 2-3 of LockdownControl.

func (*ProfinetCIMControl) PlainRTAv3CallingHomeSAP

func (c *ProfinetCIMControl) PlainRTAv3CallingHomeSAP() uint8

PlainRTAv3CallingHomeSAP returns bits 10-11 of PortControl.

func (*ProfinetCIMControl) PlainRTAv3ServerSAP

func (c *ProfinetCIMControl) PlainRTAv3ServerSAP() uint8

PlainRTAv3ServerSAP returns bits 8-9 of PortControl.

func (*ProfinetCIMControl) PlainTCPCallingHomePort

func (c *ProfinetCIMControl) PlainTCPCallingHomePort() uint8

PlainTCPCallingHomePort returns bits 2-3 of PortControl.

func (*ProfinetCIMControl) PlainTCPServerPort

func (c *ProfinetCIMControl) PlainTCPServerPort() uint8

PlainTCPServerPort returns bits 0-1 of PortControl.

func (*ProfinetCIMControl) ProtectableProtocols

func (c *ProfinetCIMControl) ProtectableProtocols() uint8

ProtectableProtocols returns bits 0-1 of LockdownControl.

type ProfinetCIMDCP

type ProfinetCIMDCP struct {
	SetControl       uint16 // DCPSetControl
	GetControl       uint16 // DCPGetControl
	MulticastControl uint16 // DCPMulticastControl: bit 0 identify, bit 8 hello
}

ProfinetCIMDCP is the body of CIMDCPAdjust and CIMDCPReal. Bit 0 of each word enables the service.

func (*ProfinetCIMDCP) Get

func (d *ProfinetCIMDCP) Get() bool

Get reports whether DCP get requests are served.

func (*ProfinetCIMDCP) Hello

func (d *ProfinetCIMDCP) Hello() bool

Hello reports whether DCP hello frames are evaluated.

func (*ProfinetCIMDCP) Identify

func (d *ProfinetCIMDCP) Identify() bool

Identify reports whether DCP identify requests are served.

func (*ProfinetCIMDCP) Set

func (d *ProfinetCIMDCP) Set() bool

Set reports whether DCP set requests are served.

func (*ProfinetCIMDCP) SetNameOfStation

func (d *ProfinetCIMDCP) SetNameOfStation() bool

SetNameOfStation reports whether the station name may be set while an AR is active (DCPSetControl bit 2).

type ProfinetCIMDelayEntry

type ProfinetCIMDelayEntry struct {
	ForwardingGroupIngress uint8
	ForwardingGroupEgress  uint8
	StreamClass            uint16
	ForwardingDelay        ProfinetForwardingDelay
}

ProfinetCIMDelayEntry is one entry of ForwardingDelayBlock: the delay between two groups of ports for one stream class.

type ProfinetCIMEgressLimiter

type ProfinetCIMEgressLimiter struct {
	Limiters []ProfinetEgressRateLimiter
}

ProfinetCIMEgressLimiter is the body of CIMStationEgressRateLimiterBlock.

type ProfinetCIMExpectedNeighbors

type ProfinetCIMExpectedNeighbors struct {
	Ports []ProfinetCIMNeighborPort
}

ProfinetCIMExpectedNeighbors is the body of CIMStationExpectedNeighborBlock.

type ProfinetCIMExpectedPeer

type ProfinetCIMExpectedPeer struct {
	PortName    string
	StationName string
	LineDelay   ProfinetLineDelay
}

ProfinetCIMExpectedPeer is one neighbor a port expects.

type ProfinetCIMForwardingDelay

type ProfinetCIMForwardingDelay struct {
	Entries []ProfinetCIMDelayEntry
}

ProfinetCIMForwardingDelay is the body of ForwardingDelayBlock.

type ProfinetCIMIngressLimiter

type ProfinetCIMIngressLimiter struct {
	Limiters []ProfinetIngressRateLimiter
}

ProfinetCIMIngressLimiter is the body of CIMStationPortIngressRateLimiterBlock.

type ProfinetCIMNeighborPort

type ProfinetCIMNeighborPort struct {
	Slot    uint16
	Subslot uint16
	Peers   []ProfinetCIMExpectedPeer
}

ProfinetCIMNeighborPort is one port of CIMStationExpectedNeighborBlock.

type ProfinetCIMPortCapabilities

type ProfinetCIMPortCapabilities struct {
	Ports []ProfinetCIMPortCapability
}

ProfinetCIMPortCapabilities is the body of CIMStationPortCapabilitiesBlock.

type ProfinetCIMPortCapability

type ProfinetCIMPortCapability struct {
	Slot             uint16
	Subslot          uint16
	MAUType          ProfinetMAUType
	MAUTypeExtension uint16
	NumberOfQueues   uint8
	Capabilities     ProfinetPortCapabilities
	ForwardingGroup  uint8
}

ProfinetCIMPortCapability is one port of CIMStationPortCapabilitiesBlock.

type ProfinetCIMPortConfig

type ProfinetCIMPortConfig struct {
	NumberOfEntries uint16
	Slot            uint16
	Subslot         uint16
	Status          ProfinetCIMPortStatus
}

ProfinetCIMPortConfig is the head of CIMStationPortConfigBlock with one entry; the rate limiter blocks of the port follow in ProfinetBlock.Blocks.

Wireshark reads one entry and then blocks to the end of the body, so the layout of a block with another count is not established and such a block stays raw.

type ProfinetCIMPortStatus

type ProfinetCIMPortStatus uint8

ProfinetCIMPortStatus is CIMStationPortStatus.

func (ProfinetCIMPortStatus) BoundaryPort

func (s ProfinetCIMPortStatus) BoundaryPort() uint8

BoundaryPort returns BoundaryPortStatus (bits 1-3).

func (ProfinetCIMPortStatus) Preemption

func (s ProfinetCIMPortStatus) Preemption() bool

Preemption reports whether frame preemption is active on the link.

type ProfinetCIMQueueConfig

type ProfinetCIMQueueConfig struct {
	Queues []ProfinetNMEQueueConfig
}

ProfinetCIMQueueConfig is the body of CIMStationQueueConfigBlock.

type ProfinetCIMSNMP

type ProfinetCIMSNMP struct {
	SNMPControl        uint16 // 0 disabled, 1 read only, 2 read and write
	ReadCommunity      string
	ReadWriteCommunity string
}

ProfinetCIMSNMP is the body of CIMSNMPAdjust and CIMSNMPReal. The real record has SNMPControl only.

type ProfinetCIMStreamEntry

type ProfinetCIMStreamEntry struct {
	DestinationAddress net.HardwareAddr
	StreamClass        uint16
	Elements           [2]ProfinetSubslot
}

ProfinetCIMStreamEntry is one stream of a stream path. Wireshark shows the two station elements as slot and subslot without naming their role.

type ProfinetCIMStreamPath

type ProfinetCIMStreamPath struct {
	FDBCommand           uint8
	Entries              []ProfinetCIMStreamEntry
	StreamCollectionUUID ProfinetUUID
}

ProfinetCIMStreamPath is the body of CIMNetConfStreamPathData and CIMNetConfStreamPathDataReal. FDBCommand (1 adds, 2 removes stream entries) is zero in the real data, which has padding in its place.

type ProfinetCIMSyncPort

type ProfinetCIMSyncPort struct {
	Slot             uint16 // CIMStationElementID
	Subslot          uint16
	TimeDomainNumber uint16
	SyncPortRole     uint8
}

ProfinetCIMSyncPort is one port of a sync tree.

type ProfinetCIMSyncTree

type ProfinetCIMSyncTree struct {
	Ports            []ProfinetCIMSyncPort
	SyncTreeDataUUID ProfinetUUID
}

ProfinetCIMSyncTree is the body of CIMNetConfSyncTreeData.

type ProfinetCIMUploadAttributes

type ProfinetCIMUploadAttributes struct {
	MaxSupportedRecordSize   uint32
	TransferTimeTX           uint32
	TransferTimeRX           uint32
	SupportedBurstSize       uint32
	MinIPGBreakingPoint      uint16
	MinIPGFrameSize          uint16
	FrameSendOffsetDeviation uint16
}

ProfinetCIMUploadAttributes is the body of CIMNetConfUploadNetworkAttributes: what a station can do, for the engineering of a TSN domain. ProfinetBlock.Blocks holds its two blocks, the port capabilities and the forwarding delays.

Padding (2), CIMStationPortCapabilitiesBlock, MaxSupportedRecordSize,
TransferTimeTX, TransferTimeRX, ForwardingDelayBlock,
SupportedBurstSize, MinIPGBreakingPoint, MinIPGFrameSize,
FrameSendOffsetDeviation

type ProfinetCOContainer

type ProfinetCOContainer struct {
	API     uint32
	Slot    uint16
	Subslot uint16
	Index   ProfinetRecordIndex
}

ProfinetCOContainer is the head of a COContainerContent block of a CombinedObjectContainer: the record it stands for. The record data follows as blocks.

type ProfinetChannelDataType

type ProfinetChannelDataType uint8

ProfinetChannelDataType is ChannelProperties.Type: the width of the channel.

func (ProfinetChannelDataType) String

func (t ProfinetChannelDataType) String() string

String names the channel width.

type ProfinetChannelDiagnosis

type ProfinetChannelDiagnosis struct {
	ChannelNumber             uint16
	ChannelProperties         ProfinetChannelProperties
	ChannelErrorType          ProfinetChannelErrorType
	ExtChannelErrorType       ProfinetExtChannelErrorType
	ExtChannelAddValue        uint32
	QualifiedChannelQualifier ProfinetChannelQualifier
}

ProfinetChannelDiagnosis is one entry of a DiagnosisData block. The extended fields are set in extended and qualified diagnoses, the qualifier in qualified ones.

func (*ProfinetChannelDiagnosis) ExtErrorName

func (d *ProfinetChannelDiagnosis) ExtErrorName() string

ExtErrorName names ExtChannelErrorType for this entry's channel error type.

type ProfinetChannelDirection

type ProfinetChannelDirection uint8

ProfinetChannelDirection is ChannelProperties.Direction.

const (
	ProfinetDirectionManufacturer ProfinetChannelDirection = 0
	ProfinetDirectionInput        ProfinetChannelDirection = 1
	ProfinetDirectionOutput       ProfinetChannelDirection = 2
	ProfinetDirectionInputOutput  ProfinetChannelDirection = 3
)

Directions.

func (ProfinetChannelDirection) String

func (d ProfinetChannelDirection) String() string

String names the direction.

type ProfinetChannelErrorType

type ProfinetChannelErrorType uint16

ProfinetChannelErrorType is the ChannelErrorType of a diagnosis.

const (
	ProfinetChannelErrShortCircuit    ProfinetChannelErrorType = 0x0001
	ProfinetChannelErrUndervoltage    ProfinetChannelErrorType = 0x0002
	ProfinetChannelErrOvervoltage     ProfinetChannelErrorType = 0x0003
	ProfinetChannelErrOverload        ProfinetChannelErrorType = 0x0004
	ProfinetChannelErrOvertemperature ProfinetChannelErrorType = 0x0005
	ProfinetChannelErrLineBreak       ProfinetChannelErrorType = 0x0006
	ProfinetChannelErrUpperLimit      ProfinetChannelErrorType = 0x0007
	ProfinetChannelErrLowerLimit      ProfinetChannelErrorType = 0x0008
	ProfinetChannelErrError           ProfinetChannelErrorType = 0x0009
	ProfinetChannelErrSimulation      ProfinetChannelErrorType = 0x000A
	ProfinetChannelErrParamMissing    ProfinetChannelErrorType = 0x000F
	ProfinetChannelErrParamFault      ProfinetChannelErrorType = 0x0010
	ProfinetChannelErrPowerSupply     ProfinetChannelErrorType = 0x0011
	ProfinetChannelErrFuse            ProfinetChannelErrorType = 0x0012
	ProfinetChannelErrCommunication   ProfinetChannelErrorType = 0x0013
	ProfinetChannelErrGround          ProfinetChannelErrorType = 0x0014
	ProfinetChannelErrReferencePoint  ProfinetChannelErrorType = 0x0015
	ProfinetChannelErrSampling        ProfinetChannelErrorType = 0x0016
	ProfinetChannelErrThreshold       ProfinetChannelErrorType = 0x0017
	ProfinetChannelErrOutputDisabled  ProfinetChannelErrorType = 0x0018
	ProfinetChannelErrSafetyEvent     ProfinetChannelErrorType = 0x0019
	ProfinetChannelErrExternal        ProfinetChannelErrorType = 0x001A
	ProfinetChannelErrTemporary       ProfinetChannelErrorType = 0x001F

	ProfinetChannelErrDataTransmission ProfinetChannelErrorType = 0x8000
	ProfinetChannelErrRemoteMismatch   ProfinetChannelErrorType = 0x8001
	ProfinetChannelErrMediaRedundancy  ProfinetChannelErrorType = 0x8002
	ProfinetChannelErrSyncMismatch     ProfinetChannelErrorType = 0x8003
	ProfinetChannelErrIsochronous      ProfinetChannelErrorType = 0x8004
	ProfinetChannelErrMulticastCR      ProfinetChannelErrorType = 0x8005
	ProfinetChannelErrFiberOptic       ProfinetChannelErrorType = 0x8007
	ProfinetChannelErrNetworkComponent ProfinetChannelErrorType = 0x8008
	ProfinetChannelErrTimeMismatch     ProfinetChannelErrorType = 0x8009
	ProfinetChannelErrFramePacking     ProfinetChannelErrorType = 0x800A
	ProfinetChannelErrMRPD             ProfinetChannelErrorType = 0x800B
	ProfinetChannelErrSystemRedundancy ProfinetChannelErrorType = 0x800C
	ProfinetChannelErrMultipleIface    ProfinetChannelErrorType = 0x800D
)

Channel error types. 0x0100 to 0x7FFF are manufacturer specific, 0x9000 to 0x9FFF belong to profiles.

func (ProfinetChannelErrorType) String

func (t ProfinetChannelErrorType) String() string

String names the error type.

type ProfinetChannelMaintenance

type ProfinetChannelMaintenance uint8

ProfinetChannelMaintenance is ChannelProperties.Maintenance: the severity of a diagnosis.

const (
	ProfinetMaintenanceFault     ProfinetChannelMaintenance = 0
	ProfinetMaintenanceRequired  ProfinetChannelMaintenance = 1
	ProfinetMaintenanceDemanded  ProfinetChannelMaintenance = 2
	ProfinetMaintenanceQualified ProfinetChannelMaintenance = 3 // see QualifiedChannelQualifier
)

Severities.

func (ProfinetChannelMaintenance) String

String names the severity.

type ProfinetChannelProperties

type ProfinetChannelProperties uint16

ProfinetChannelProperties is the ChannelProperties field of a channel diagnosis.

func (ProfinetChannelProperties) Accumulative

func (p ProfinetChannelProperties) Accumulative() bool

Accumulative reports whether the diagnosis sums up several channels.

func (ProfinetChannelProperties) Direction

Direction returns bits 13-15.

func (ProfinetChannelProperties) Maintenance

Maintenance returns the severity (bits 9-10).

func (ProfinetChannelProperties) Specifier

Specifier returns bits 11-12: whether the diagnosis comes or goes.

func (ProfinetChannelProperties) Type

Type returns the channel data type (bits 0-7).

type ProfinetChannelQualifier

type ProfinetChannelQualifier uint32

ProfinetChannelQualifier is QualifiedChannelQualifier: one bit per qualifier, grouped by severity.

func (ProfinetChannelQualifier) Advice

func (q ProfinetChannelQualifier) Advice() bool

Advice reports whether one of Qualifier_3 to Qualifier_6 is set.

func (ProfinetChannelQualifier) Fault

func (q ProfinetChannelQualifier) Fault() bool

Fault reports whether one of Qualifier_27 to Qualifier_31 is set.

func (ProfinetChannelQualifier) MaintenanceDemanded

func (q ProfinetChannelQualifier) MaintenanceDemanded() bool

MaintenanceDemanded reports whether one of Qualifier_17 to Qualifier_26 is set.

func (ProfinetChannelQualifier) MaintenanceRequired

func (q ProfinetChannelQualifier) MaintenanceRequired() bool

MaintenanceRequired reports whether one of Qualifier_7 to Qualifier_16 is set.

func (ProfinetChannelQualifier) String

func (q ProfinetChannelQualifier) String() string

String names the severity groups that have a qualifier set.

type ProfinetChannelSpecifier

type ProfinetChannelSpecifier uint8

ProfinetChannelSpecifier is ChannelProperties.Specifier: whether the diagnosis comes or goes.

const (
	ProfinetSpecifierAllDisappear    ProfinetChannelSpecifier = 0
	ProfinetSpecifierAppears         ProfinetChannelSpecifier = 1
	ProfinetSpecifierDisappears      ProfinetChannelSpecifier = 2
	ProfinetSpecifierDisappearsOther ProfinetChannelSpecifier = 3 // others remain
)

Specifiers.

func (ProfinetChannelSpecifier) String

func (s ProfinetChannelSpecifier) String() string

String names the specifier.

type ProfinetCheckLineDelay

type ProfinetCheckLineDelay struct {
	LineDelay ProfinetLineDelay
}

ProfinetCheckLineDelay is the body of CheckLineDelay.

type ProfinetCheckPeer

type ProfinetCheckPeer struct {
	PortID    string
	ChassisID string
}

ProfinetCheckPeer is one expected neighbour.

type ProfinetCheckPeers

type ProfinetCheckPeers struct {
	Peers []ProfinetCheckPeer
}

ProfinetCheckPeers is the body of CheckPeers.

type ProfinetCheckValue

type ProfinetCheckValue struct {
	Value uint16
}

ProfinetCheckValue is the body of the check blocks that hold one 16-bit value: MAUType in CheckMAUType, LinkState in CheckLinkState, CheckSyncMode in CheckSyncDifference (bit 0 cable delay, bit 1 sync master), MAUTypeMode in CheckMAUTypeDifference and MAUTypeExtension in CheckMAUTypeExtension.

type ProfinetControlBlock

type ProfinetControlBlock struct {
	ARUUID     ProfinetUUID
	SessionKey uint16

	// AlarmSequenceNumber is meaningful in the plug variants (Plug Prm End,
	// Plug Application Ready); it is reserved in the others.
	AlarmSequenceNumber uint16
	Command             ProfinetControlCommand
	Properties          uint16
}

ProfinetControlBlock is the body shared by the IODControl, IOXControl, IODRelease and PrmBegin request and response blocks.

type ProfinetControlCommand

type ProfinetControlCommand uint16

ProfinetControlCommand is the ControlCommand bit field.

const (
	ProfinetControlPrmEnd            ProfinetControlCommand = 0x0001
	ProfinetControlApplicationReady  ProfinetControlCommand = 0x0002
	ProfinetControlRelease           ProfinetControlCommand = 0x0004
	ProfinetControlDone              ProfinetControlCommand = 0x0008
	ProfinetControlReadyForCompanion ProfinetControlCommand = 0x0010
	ProfinetControlReadyForRTClass3  ProfinetControlCommand = 0x0020
	ProfinetControlPrmBegin          ProfinetControlCommand = 0x0040
)

Control commands.

func (ProfinetControlCommand) String

func (c ProfinetControlCommand) String() string

String names the command bits that are set.

type ProfinetCredentialID

type ProfinetCredentialID uint32

ProfinetCredentialID is a CredentialID; bits 0-1 are the credential type, zero when no credential exists.

func (ProfinetCredentialID) Type

func (c ProfinetCredentialID) Type() uint8

Type returns the credential type (bits 0-1).

type ProfinetDCP

type ProfinetDCP struct {
	BaseLayer

	ServiceID     ProfinetDCPServiceID
	ServiceType   ProfinetDCPServiceType
	Xid           uint32
	ResponseDelay uint16 // identify requests; reserved otherwise
	DataLength    uint16
	Blocks        []ProfinetDCPBlock
}

ProfinetDCP is a PROFINET DCP PDU.

Blocks are parsed only for the known services and service types, as Wireshark does. A Get request's selectors appear as blocks with no length, prefix or value. Ethernet padding after DataLength is ignored.

func (*ProfinetDCP) CanDecode

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

CanDecode returns LayerTypeProfinetDCP.

func (*ProfinetDCP) DecodeFromBytes

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

DecodeFromBytes decodes a DCP PDU, starting at the ServiceID.

func (*ProfinetDCP) LayerType

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

LayerType returns LayerTypeProfinetDCP.

func (*ProfinetDCP) NextLayerType

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

NextLayerType returns LayerTypeZero: DCP carries no further layer.

func (*ProfinetDCP) Payload

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

Payload returns the raw block area, also decoded into Blocks.

type ProfinetDCPBlock

type ProfinetDCPBlock struct {
	Option    ProfinetDCPOption
	Suboption uint8
	Length    uint16 // DCPBlockLength as sent, prefix included
	Prefix    ProfinetDCPPrefix
	BlockInfo uint16 // BlockInfo or BlockQualifier, per Prefix
	Value     []byte

	MAC              net.HardwareAddr      // IP/MAC address
	IP               net.IP                // IP parameter, full IP suite
	Subnet           net.IP                // IP parameter, full IP suite
	Gateway          net.IP                // IP parameter, full IP suite
	DNS              []net.IP              // full IP suite
	Name             string                // type of station, name of station, alias name, NME domain name, arbitrary DHCP client identifier
	VendorID         uint16                // device ID, OEM device ID
	DeviceID         uint16                // device ID, OEM device ID
	Role             ProfinetDCPDeviceRole // device role
	Options          []ProfinetDCPSelector // device options
	Instance         uint16                // device instance, high<<8 | low
	Signal           uint16                // control signal value
	Response         ProfinetDCPSelector   // control response: option answered
	BlockError       ProfinetDCPBlockError // control response
	DeviceInitiative uint16                // device initiative value
	Properties       uint16                // RSI properties, protocol properties
	DHCPOptionCode   DHCPOpt               // DHCP blocks
	NMEPriority      uint16                // NME manager
}

ProfinetDCPBlock is one DCP block.

Value holds the bytes after the prefix, without padding. The typed fields below it are filled for the block types they belong to, when Value is long enough; they alias the packet data.

Name ends at the first NUL, as tshark prints it: devices pad names with NULs. Value keeps every byte.

func (*ProfinetDCPBlock) DHCPParameter

func (b *ProfinetDCPBlock) DHCPParameter() []byte

DHCPParameter returns the parameter data of a DHCP block, clipped to the block when its length byte lies. It is a method rather than a field to keep the block small: a Get request allocates one block per two bytes.

func (*ProfinetDCPBlock) ResetMode

func (b *ProfinetDCPBlock) ResetMode() ProfinetDCPResetMode

ResetMode returns the mode of a Control/Reset to factory block.

func (*ProfinetDCPBlock) Type

Type returns the block's option and suboption as one value.

func (*ProfinetDCPBlock) UUID

func (b *ProfinetDCPBlock) UUID() (u ProfinetUUID, ok bool)

UUID returns the UUID that opens an NME domain, parameter UUID or agent block, and whether the block carries one. Like DHCPParameter it is a method to keep the block small.

type ProfinetDCPBlockError

type ProfinetDCPBlockError uint8

ProfinetDCPBlockError is the error code of a Control/Response block.

const (
	ProfinetDCPErrorOK                  ProfinetDCPBlockError = 0x00
	ProfinetDCPErrorOptionUnsupported   ProfinetDCPBlockError = 0x01
	ProfinetDCPErrorSuboptionUnsupp     ProfinetDCPBlockError = 0x02
	ProfinetDCPErrorSuboptionNotSet     ProfinetDCPBlockError = 0x03
	ProfinetDCPErrorResource            ProfinetDCPBlockError = 0x04
	ProfinetDCPErrorSetNotPossible      ProfinetDCPBlockError = 0x05
	ProfinetDCPErrorInOperation         ProfinetDCPBlockError = 0x06
	ProfinetDCPErrorSecurityRestriction ProfinetDCPBlockError = 0x07
)

DCP block errors.

func (ProfinetDCPBlockError) String

func (e ProfinetDCPBlockError) String() string

String returns the block error name.

type ProfinetDCPBlockType

type ProfinetDCPBlockType uint16

ProfinetDCPBlockType is an option and suboption pair, Option<<8|Suboption.

const (
	ProfinetDCPBlockIPMAC            ProfinetDCPBlockType = 0x0101
	ProfinetDCPBlockIPParameter      ProfinetDCPBlockType = 0x0102
	ProfinetDCPBlockIPSuite          ProfinetDCPBlockType = 0x0103
	ProfinetDCPBlockTypeOfStation    ProfinetDCPBlockType = 0x0201
	ProfinetDCPBlockNameOfStation    ProfinetDCPBlockType = 0x0202
	ProfinetDCPBlockDeviceID         ProfinetDCPBlockType = 0x0203
	ProfinetDCPBlockDeviceRole       ProfinetDCPBlockType = 0x0204
	ProfinetDCPBlockDeviceOptions    ProfinetDCPBlockType = 0x0205
	ProfinetDCPBlockAliasName        ProfinetDCPBlockType = 0x0206
	ProfinetDCPBlockDeviceInstance   ProfinetDCPBlockType = 0x0207
	ProfinetDCPBlockOEMDeviceID      ProfinetDCPBlockType = 0x0208
	ProfinetDCPBlockRSIProperties    ProfinetDCPBlockType = 0x020A
	ProfinetDCPBlockProtocolProps    ProfinetDCPBlockType = 0x020B
	ProfinetDCPBlockDHCPHostName     ProfinetDCPBlockType = 0x030C
	ProfinetDCPBlockDHCPVendor       ProfinetDCPBlockType = 0x032B
	ProfinetDCPBlockDHCPServerID     ProfinetDCPBlockType = 0x0336
	ProfinetDCPBlockDHCPParamRequest ProfinetDCPBlockType = 0x0337
	ProfinetDCPBlockDHCPClassID      ProfinetDCPBlockType = 0x033C
	ProfinetDCPBlockDHCPClientID     ProfinetDCPBlockType = 0x033D
	ProfinetDCPBlockDHCPFQDN         ProfinetDCPBlockType = 0x0351
	ProfinetDCPBlockDHCPUUID         ProfinetDCPBlockType = 0x0361
	ProfinetDCPBlockDHCPControl      ProfinetDCPBlockType = 0x03FF
	ProfinetDCPBlockStartTransaction ProfinetDCPBlockType = 0x0501
	ProfinetDCPBlockEndTransaction   ProfinetDCPBlockType = 0x0502
	ProfinetDCPBlockSignal           ProfinetDCPBlockType = 0x0503
	ProfinetDCPBlockResponse         ProfinetDCPBlockType = 0x0504
	ProfinetDCPBlockFactoryReset     ProfinetDCPBlockType = 0x0505
	ProfinetDCPBlockResetToFactory   ProfinetDCPBlockType = 0x0506
	ProfinetDCPBlockDeviceInitiative ProfinetDCPBlockType = 0x0601
	ProfinetDCPBlockNMEDomain        ProfinetDCPBlockType = 0x0701
	ProfinetDCPBlockNMEManager       ProfinetDCPBlockType = 0x0702
	ProfinetDCPBlockNMEParameterUUID ProfinetDCPBlockType = 0x0703
	ProfinetDCPBlockNMEAgent         ProfinetDCPBlockType = 0x0704
	ProfinetDCPBlockCIMInterface     ProfinetDCPBlockType = 0x0705
	ProfinetDCPBlockAllSelector      ProfinetDCPBlockType = 0xFFFF
)

DCP block types with a decoded value.

func (ProfinetDCPBlockType) Option

Option returns the option half of the block type.

func (ProfinetDCPBlockType) String

func (t ProfinetDCPBlockType) String() string

String returns the block type name.

type ProfinetDCPDeviceRole

type ProfinetDCPDeviceRole uint8

ProfinetDCPDeviceRole is the device role bit field.

const (
	ProfinetDCPRoleIODevice     ProfinetDCPDeviceRole = 0x01
	ProfinetDCPRoleIOController ProfinetDCPDeviceRole = 0x02
	ProfinetDCPRoleIOMultidev   ProfinetDCPDeviceRole = 0x04
	ProfinetDCPRoleSupervisor   ProfinetDCPDeviceRole = 0x08
)

Device role bits.

type ProfinetDCPOption

type ProfinetDCPOption uint8

ProfinetDCPOption is the option byte of a DCP block.

const (
	ProfinetDCPOptionIP               ProfinetDCPOption = 0x01
	ProfinetDCPOptionDevice           ProfinetDCPOption = 0x02
	ProfinetDCPOptionDHCP             ProfinetDCPOption = 0x03
	ProfinetDCPOptionControl          ProfinetDCPOption = 0x05
	ProfinetDCPOptionDeviceInitiative ProfinetDCPOption = 0x06
	ProfinetDCPOptionNME              ProfinetDCPOption = 0x07
	ProfinetDCPOptionManufFirst       ProfinetDCPOption = 0x80
	ProfinetDCPOptionManufLast        ProfinetDCPOption = 0xFE
	ProfinetDCPOptionAll              ProfinetDCPOption = 0xFF
)

DCP options.

func (ProfinetDCPOption) IsManufacturer

func (o ProfinetDCPOption) IsManufacturer() bool

IsManufacturer reports whether the option is manufacturer specific.

func (ProfinetDCPOption) String

func (o ProfinetDCPOption) String() string

String returns the option name.

type ProfinetDCPPrefix

type ProfinetDCPPrefix uint8

ProfinetDCPPrefix says which 2-byte field opens a block value.

const (
	ProfinetDCPPrefixNone ProfinetDCPPrefix = iota
	ProfinetDCPPrefixBlockInfo
	ProfinetDCPPrefixBlockQualifier
)

DCP block prefixes.

func (ProfinetDCPPrefix) String

func (p ProfinetDCPPrefix) String() string

String returns the prefix name.

type ProfinetDCPResetMode

type ProfinetDCPResetMode uint16

ProfinetDCPResetMode is the mode of a Control/Reset to factory block, carried in bits 1-15 of its BlockQualifier.

const (
	ProfinetDCPResetApplication   ProfinetDCPResetMode = 1
	ProfinetDCPResetCommunication ProfinetDCPResetMode = 2
	ProfinetDCPResetEngineering   ProfinetDCPResetMode = 3
	ProfinetDCPResetAllStored     ProfinetDCPResetMode = 4
	ProfinetDCPResetDevice        ProfinetDCPResetMode = 8
	ProfinetDCPResetAndRestore    ProfinetDCPResetMode = 9
)

Reset to factory modes.

func (ProfinetDCPResetMode) String

func (m ProfinetDCPResetMode) String() string

String returns the reset mode name.

type ProfinetDCPSelector

type ProfinetDCPSelector struct {
	Option    ProfinetDCPOption
	Suboption uint8
}

ProfinetDCPSelector is an Option/Suboption pair, as listed by Get requests and Device/Device options blocks.

func (ProfinetDCPSelector) Type

Type returns the selector as a block type.

type ProfinetDCPServiceID

type ProfinetDCPServiceID uint8

ProfinetDCPServiceID is the DCP service.

const (
	ProfinetDCPServiceGet      ProfinetDCPServiceID = 0x03
	ProfinetDCPServiceSet      ProfinetDCPServiceID = 0x04
	ProfinetDCPServiceIdentify ProfinetDCPServiceID = 0x05
	ProfinetDCPServiceHello    ProfinetDCPServiceID = 0x06
)

DCP service IDs.

func (ProfinetDCPServiceID) String

func (s ProfinetDCPServiceID) String() string

String returns the service name.

type ProfinetDCPServiceType

type ProfinetDCPServiceType uint8

ProfinetDCPServiceType says whether a PDU is a request or a response.

const (
	ProfinetDCPRequest             ProfinetDCPServiceType = 0x00
	ProfinetDCPResponseSuccess     ProfinetDCPServiceType = 0x01
	ProfinetDCPResponseUnsupported ProfinetDCPServiceType = 0x05
)

DCP service types. Bit 0 selects response, bit 2 flags an unsupported service in the response.

func (ProfinetDCPServiceType) IsResponse

func (t ProfinetDCPServiceType) IsResponse() bool

IsResponse reports whether the response bit is set.

func (ProfinetDCPServiceType) String

func (t ProfinetDCPServiceType) String() string

String returns the service type name.

type ProfinetDataDescription

type ProfinetDataDescription struct {
	Type       uint16 // 1 input, 2 output
	DataLength uint16
	LengthIOCS uint8
	LengthIOPS uint8
}

ProfinetDataDescription sizes the input or output data of a submodule.

type ProfinetDataStatus

type ProfinetDataStatus uint8

ProfinetDataStatus is the DataStatus byte of the APDU status trailer.

const (
	ProfinetDataStatusPrimary    ProfinetDataStatus = 0x01 // 1 primary, 0 backup
	ProfinetDataStatusRedundancy ProfinetDataStatus = 0x02
	ProfinetDataStatusDataValid  ProfinetDataStatus = 0x04
	ProfinetDataStatusRun        ProfinetDataStatus = 0x10 // provider state: 1 run, 0 stop
	ProfinetDataStatusStationOK  ProfinetDataStatus = 0x20 // station problem indicator: 1 ok
	ProfinetDataStatusIgnore     ProfinetDataStatus = 0x80
)

DataStatus bits (IEC 61158-6-10, Wireshark pn_rt.ds_*).

func (ProfinetDataStatus) DataValid

func (s ProfinetDataStatus) DataValid() bool

DataValid reports whether the IO data is valid.

func (ProfinetDataStatus) Ignore

func (s ProfinetDataStatus) Ignore() bool

Ignore reports whether the consumer must ignore this frame.

func (ProfinetDataStatus) Primary

func (s ProfinetDataStatus) Primary() bool

Primary reports whether the provider is the primary (not backup) one.

func (ProfinetDataStatus) Redundancy

func (s ProfinetDataStatus) Redundancy() bool

Redundancy returns the redundancy bit; its meaning depends on the IOCR.

func (ProfinetDataStatus) Run

func (s ProfinetDataStatus) Run() bool

Run reports whether the provider is in RUN (not STOP).

func (ProfinetDataStatus) StationProblem

func (s ProfinetDataStatus) StationProblem() bool

StationProblem reports whether the station signals a problem.

func (ProfinetDataStatus) String

func (s ProfinetDataStatus) String() string

String summarises the bits like Wireshark's info column.

type ProfinetDiagnosisData

type ProfinetDiagnosisData struct {
	API               uint32
	Slot              uint16
	Subslot           uint16
	ChannelNumber     uint16 // 0x8000: the whole submodule
	ChannelProperties ProfinetChannelProperties
	USI               ProfinetUSI
	Channels          []ProfinetChannelDiagnosis
	Data              []byte
}

ProfinetDiagnosisData is the body of a DiagnosisData block: the diagnoses of one submodule. Version 1.0 has no API.

Channels holds the entries of a channel, extended or qualified diagnosis; every other user structure is raw in Data.

func (*ProfinetDiagnosisData) WholeSubmodule

func (d *ProfinetDiagnosisData) WholeSubmodule() bool

WholeSubmodule reports whether the block is about the submodule rather than one channel.

type ProfinetDiffAPI

type ProfinetDiffAPI struct {
	API     uint32
	Modules []ProfinetDiffModule
}

ProfinetDiffAPI is one API entry of a ModuleDiffBlock.

type ProfinetDiffModule

type ProfinetDiffModule struct {
	Slot        uint16
	IdentNumber uint32
	State       ProfinetModuleState
	Submodules  []ProfinetDiffSubmodule
}

ProfinetDiffModule is one module of a ModuleDiffBlock.

type ProfinetDiffSubmodule

type ProfinetDiffSubmodule struct {
	Subslot     uint16
	IdentNumber uint32
	State       ProfinetSubmoduleState
}

ProfinetDiffSubmodule is one submodule of a ModuleDiffBlock.

type ProfinetEgressRateLimiter

type ProfinetEgressRateLimiter uint64

ProfinetEgressRateLimiter is PortQueueEgressRateLimiter.

func (ProfinetEgressRateLimiter) CBS

CBS returns the committed burst size in octets (bits 16-31).

func (ProfinetEgressRateLimiter) CIR

CIR returns the committed information rate in 0.1 Mbit/s (bits 0-15).

func (ProfinetEgressRateLimiter) Envelope

func (l ProfinetEgressRateLimiter) Envelope() uint8

Envelope returns bits 32-39.

func (ProfinetEgressRateLimiter) QueueID

func (l ProfinetEgressRateLimiter) QueueID() uint8

QueueID returns the queue the limiter belongs to (bits 48-55).

func (ProfinetEgressRateLimiter) Rank

Rank returns bits 40-47.

type ProfinetEntryCount

type ProfinetEntryCount struct {
	NumberOfEntries uint16
}

ProfinetEntryCount is the body of a block that only counts the blocks nested in it: I&M5 and AssetManagementData.

type ProfinetErrorCode

type ProfinetErrorCode uint8

ProfinetErrorCode is the ErrorCode byte of a PNIO status: the service that failed.

const (
	ProfinetErrorCodeOK         ProfinetErrorCode = 0x00
	ProfinetErrorCodePNIO       ProfinetErrorCode = 0x81
	ProfinetErrorCodeRTA        ProfinetErrorCode = 0xCF
	ProfinetErrorCodeAlarmAck   ProfinetErrorCode = 0xDA
	ProfinetErrorCodeConnect    ProfinetErrorCode = 0xDB
	ProfinetErrorCodeRelease    ProfinetErrorCode = 0xDC
	ProfinetErrorCodeControl    ProfinetErrorCode = 0xDD
	ProfinetErrorCodeRead       ProfinetErrorCode = 0xDE
	ProfinetErrorCodeWrite      ProfinetErrorCode = 0xDF
	ProfinetErrorCodeSXPConnect ProfinetErrorCode = 0xE0
	ProfinetErrorCodeSCMService ProfinetErrorCode = 0xE1
	ProfinetErrorCodeSXP        ProfinetErrorCode = 0xE2
)

PNIO status error codes.

func (ProfinetErrorCode) String

func (c ProfinetErrorCode) String() string

String returns the error code name.

type ProfinetErrorDecode

type ProfinetErrorDecode uint8

ProfinetErrorDecode is the ErrorDecode byte of a PNIO status: how to read ErrorCode1 and ErrorCode2.

const (
	ProfinetErrorDecodeOK           ProfinetErrorDecode = 0x00
	ProfinetErrorDecodePNIORW       ProfinetErrorDecode = 0x80
	ProfinetErrorDecodePNIO         ProfinetErrorDecode = 0x81
	ProfinetErrorDecodeManufacturer ProfinetErrorDecode = 0x82
	ProfinetErrorDecodePNIOSEC      ProfinetErrorDecode = 0x83
)

PNIO status error decodes.

func (ProfinetErrorDecode) String

func (d ProfinetErrorDecode) String() string

String returns the error decode name.

type ProfinetExpectedAPI

type ProfinetExpectedAPI struct {
	API               uint32
	Slot              uint16
	ModuleIdentNumber uint32
	ModuleProperties  uint16
	Submodules        []ProfinetExpectedSubmodule
}

ProfinetExpectedAPI is one API entry of an ExpectedSubmoduleBlockReq: the module expected in a slot and its submodules.

type ProfinetExpectedBlock

type ProfinetExpectedBlock struct {
	APIs []ProfinetExpectedAPI
}

ProfinetExpectedBlock is an ExpectedSubmoduleBlockReq.

type ProfinetExpectedSubmodule

type ProfinetExpectedSubmodule struct {
	Subslot      uint16
	IdentNumber  uint32
	Properties   ProfinetSubmoduleProperties
	Descriptions []ProfinetDataDescription // two for input and output submodules
}

ProfinetExpectedSubmodule is one submodule of an expected module.

type ProfinetExtChannelErrorType

type ProfinetExtChannelErrorType uint16

ProfinetExtChannelErrorType is the ExtChannelErrorType of an extended diagnosis. Its meaning depends on the ChannelErrorType next to it.

func (ProfinetExtChannelErrorType) Name

Name names the extended error type in the context of its channel error type. Manufacturer and profile specific channel error types share one standard value, the accumulative info.

type ProfinetFODiagnosisInfo

type ProfinetFODiagnosisInfo struct {
	FiberOpticPowerBudgetReal ProfinetPowerBudget
}

ProfinetFODiagnosisInfo is the body of FiberOpticDiagnosisInfo.

type ProfinetFOManufacturer

type ProfinetFOManufacturer struct {
	VendorID        uint16
	VendorBlockType uint16
	Data            []byte
}

ProfinetFOManufacturer is the body of FiberOpticManufacturerSpecific.

type ProfinetFSHello

type ProfinetFSHello struct {
	Mode     uint32 // 0 off, 1 send Hello on link up, 2 after HelloDelay
	Interval uint32
	Retry    uint32
	Delay    uint32
}

ProfinetFSHello is the body of FSHelloBlock: how a fast start up device announces itself with DCP Hello. Interval and delay are in milliseconds.

type ProfinetFSParameter

type ProfinetFSParameter struct {
	Mode uint32 // 0 off, 1 on
	UUID ProfinetUUID
}

ProfinetFSParameter is the body of FSParameterBlock.

type ProfinetFiberOptic

type ProfinetFiberOptic struct {
	FiberOpticType      uint32
	FiberOpticCableType uint32
}

ProfinetFiberOptic is the body of PDPortFODataReal and PDPortFODataAdjust. PDPortFODataReal nests the manufacturer specific and the diagnosis block.

type ProfinetForwardingDelay

type ProfinetForwardingDelay uint32

ProfinetForwardingDelay is ForwardingDelay.

func (ProfinetForwardingDelay) Dependent

func (d ProfinetForwardingDelay) Dependent() uint8

Dependent returns the frame length dependent part (bits 28-31); zero stands for cut-through forwarding.

func (ProfinetForwardingDelay) Independent

func (d ProfinetForwardingDelay) Independent() uint32

Independent returns the frame length independent port to port delay (bits 0-19).

type ProfinetFragAssembler

type ProfinetFragAssembler struct {
	// MaxSize caps the bytes of one reassembled frame.
	MaxSize int
	// contains filtered or unexported fields
}

ProfinetFragAssembler reassembles fragmented PROFINET frames.

It keeps one reassembly per source, destination and fragment ID. A reassembly starts at fragment number 0 and takes fragments in order; anything else drops it. Memory is bounded: each reassembly holds at most MaxSize bytes and at most 64 run at once, the oldest making room for a new one. There are no timers; a reassembly that never completes stays until it is evicted or its key starts over.

An assembler is not safe for concurrent use.

func NewProfinetFragAssembler

func NewProfinetFragAssembler(maxSize int) *ProfinetFragAssembler

NewProfinetFragAssembler returns an assembler that caps each reassembled frame at maxSize bytes; a value of zero or less selects 9216.

func (*ProfinetFragAssembler) Add

func (a *ProfinetFragAssembler) Add(src, dst net.HardwareAddr, pn *Profinet) ([]byte, error)

Add feeds one fragment frame, given the Ethernet addresses it travelled between. It returns nil while fragments are missing and, with the last fragment, the reassembled bytes: a 2-byte EtherType followed by that protocol's payload, in a buffer the caller owns. To decode it:

etherType := EthernetType(binary.BigEndian.Uint16(frame))
pkt := gopacket.NewPacket(frame[2:], etherType.LayerType(), gopacket.Default)

Like Wireshark, the fragment is taken to be everything after the header, and must be at least FragDataLength*8 bytes.

func (*ProfinetFragAssembler) Pending

func (a *ProfinetFragAssembler) Pending() int

Pending returns the number of reassemblies in progress.

type ProfinetFragStatus

type ProfinetFragStatus uint8

ProfinetFragStatus is the FragStatus byte of a fragment.

const ProfinetFragMoreFollows ProfinetFragStatus = 0x80

ProfinetFragMoreFollows is the FragStatus bit set on every fragment but the last.

func (ProfinetFragStatus) MoreFollows

func (s ProfinetFragStatus) MoreFollows() bool

MoreFollows reports whether more fragments follow this one.

func (ProfinetFragStatus) Number

func (s ProfinetFragStatus) Number() uint8

Number returns the zero-based fragment number (bits 0-5).

func (ProfinetFragStatus) String

func (s ProfinetFragStatus) String() string

String formats the status as Wireshark does.

type ProfinetFrameClass

type ProfinetFrameClass uint8

ProfinetFrameClass is the kind of frame a Frame ID range stands for.

const (
	ProfinetFrameClassReserved ProfinetFrameClass = iota
	ProfinetFrameClassPTCPSync
	ProfinetFrameClassRTClass3
	ProfinetFrameClassRTClass1
	ProfinetFrameClassRTClass1Legacy
	ProfinetFrameClassAlarmHigh
	ProfinetFrameClassAlarmLow
	ProfinetFrameClassAcyclic
	ProfinetFrameClassDCP
	ProfinetFrameClassPTCPAnnounce
	ProfinetFrameClassPTCPFollowUp
	ProfinetFrameClassPTCPDelay
	ProfinetFrameClassFragment
	ProfinetFrameClassRTStream
)

PROFINET frame classes.

0x8000-0xBFFF was RT_CLASS_2 in early editions of IEC 61158-6-10; current editions and Wireshark treat it as RT_CLASS_1, which is what controllers such as the S7-1500 send there. RT_CLASS_STREAM (0x1000-0x3FFF on time-aware networks) needs connection state to tell apart from reserved IDs, so it is reported as reserved, as Wireshark does by default.

func (ProfinetFrameClass) IsCyclic

func (c ProfinetFrameClass) IsCyclic() bool

IsCyclic reports whether frames of this class carry IO data and the APDU status trailer.

func (ProfinetFrameClass) IsPTCP

func (c ProfinetFrameClass) IsPTCP() bool

IsPTCP reports whether frames of this class carry a PTCP PDU.

func (ProfinetFrameClass) String

func (c ProfinetFrameClass) String() string

String returns the frame class name.

type ProfinetFrameID

type ProfinetFrameID uint16

ProfinetFrameID is the 2-byte Frame ID that opens every PROFINET RT frame.

const (
	ProfinetFrameIDAlarmHigh  ProfinetFrameID = 0xFC01
	ProfinetFrameIDAlarmLow   ProfinetFrameID = 0xFE01
	ProfinetFrameIDRSI        ProfinetFrameID = 0xFE02 // Remote Service Interface
	ProfinetFrameIDSXP        ProfinetFrameID = 0xFE03 // SXP via RTAv3
	ProfinetFrameIDDCPHello   ProfinetFrameID = 0xFEFC
	ProfinetFrameIDDCPGetSet  ProfinetFrameID = 0xFEFD
	ProfinetFrameIDDCPIdentRq ProfinetFrameID = 0xFEFE
	ProfinetFrameIDDCPIdentRs ProfinetFrameID = 0xFEFF
)

Frame IDs with a fixed meaning.

const (
	ProfinetFrameIDAlarmHighSec ProfinetFrameID = 0xFC41
	ProfinetFrameIDAlarmLowSec  ProfinetFrameID = 0xFE41
	ProfinetFrameIDRSISec       ProfinetFrameID = 0xFE42
)

Frame IDs of the secured variants: the same PDU behind a SecurityMetaData header.

func (ProfinetFrameID) Class

Class maps the Frame ID to its frame class.

func (ProfinetFrameID) Name

func (id ProfinetFrameID) Name() string

Name describes the Frame ID: the fixed meaning of the IDs that have one, otherwise the range it lies in.

func (ProfinetFrameID) StreamClass

func (id ProfinetFrameID) StreamClass() ProfinetFrameClass

StreamClass maps the Frame ID to its class on a time-aware (TSN) network, where 0x1000-0x2FFF and 0x3800-0x3FFF carry RT_CLASS_STREAM and the RT_CLASS_3 range is reserved. Whether a network is time-aware is negotiated at connection set-up (ARProperties), which a single frame does not show; Class assumes it is not, as Wireshark does by default.

func (ProfinetFrameID) StreamName

func (id ProfinetFrameID) StreamName() string

StreamName is Name for a time-aware network (see StreamClass).

func (ProfinetFrameID) String

func (id ProfinetFrameID) String() string

String returns the Frame ID in hex with its class.

type ProfinetIM0

type ProfinetIM0 struct {
	VendorID            uint16 // VendorIDHigh, VendorIDLow
	OrderID             string
	SerialNumber        string
	HardwareRevision    uint16
	SoftwareRevision    ProfinetSWRevision
	RevisionCounter     uint16
	ProfileID           uint16
	ProfileSpecificType uint16
	VersionMajor        uint8
	VersionMinor        uint8
	Supported           ProfinetIMSupported
}

ProfinetIM0 is the I&M0 record: who made the submodule and which revision it is.

type ProfinetIM1

type ProfinetIM1 struct {
	TagFunction string
	TagLocation string
}

ProfinetIM1 is the I&M1 record.

type ProfinetIM2

type ProfinetIM2 struct {
	Date string
}

ProfinetIM2 is the I&M2 record: the installation date, "YYYY-MM-DD HH:MM".

type ProfinetIM3

type ProfinetIM3 struct {
	Descriptor string
}

ProfinetIM3 is the I&M3 record.

type ProfinetIM4

type ProfinetIM4 struct {
	Signature []byte
}

ProfinetIM4 is the I&M4 record: a signature set by the profile.

type ProfinetIM5Data

type ProfinetIM5Data struct {
	Annotation       string
	OrderID          string
	VendorID         uint16
	SerialNumber     string
	HardwareRevision uint16
	SoftwareRevision ProfinetSWRevision
}

ProfinetIM5Data is one I&M5Data block: the identification of one communication module.

type ProfinetIMSupported

type ProfinetIMSupported uint16

ProfinetIMSupported is IM_Supported: bit n set means I&Mn is supported.

func (ProfinetIMSupported) Supports

func (s ProfinetIMSupported) Supports(n int) bool

Supports reports whether record I&Mn (1 to 15) is supported.

type ProfinetIOCRAPI

type ProfinetIOCRAPI struct {
	API           uint32
	IODataObjects []ProfinetIOObject
	IOCS          []ProfinetIOObject
}

ProfinetIOCRAPI lists the IO data of one API in an IOCRBlockReq.

type ProfinetIOCRBlock

type ProfinetIOCRBlock struct {
	IOCRType      ProfinetIOCRType
	IOCRReference uint16
	FrameID       ProfinetFrameID

	LT              EthernetType
	Properties      ProfinetIOCRProperties
	DataLength      uint16
	SendClockFactor uint16
	ReductionRatio  uint16
	Phase           uint16
	Sequence        uint16
	FrameSendOffset uint32
	WatchdogFactor  uint16
	DataHoldFactor  uint16
	TagHeader       ProfinetTagHeader
	MulticastMAC    net.HardwareAddr
	APIs            []ProfinetIOCRAPI
}

ProfinetIOCRBlock is an IOCRBlockReq or IOCRBlockRes. The response carries only the type, the reference and the frame ID.

type ProfinetIOCRProperties

type ProfinetIOCRProperties uint32

ProfinetIOCRProperties is the IOCRProperties bit field.

func (ProfinetIOCRProperties) RTClass

func (p ProfinetIOCRProperties) RTClass() uint8

RTClass returns the RT class (bits 0-3): 1 and 2 RT_CLASS_1, 3 RT_CLASS_3, 4 RT_CLASS_UDP, 5 RT_CLASS_STREAM.

type ProfinetIOCRType

type ProfinetIOCRType uint16

ProfinetIOCRType is the IOCRType of an IOCR block.

const (
	ProfinetIOCRInput             ProfinetIOCRType = 0x0001
	ProfinetIOCROutput            ProfinetIOCRType = 0x0002
	ProfinetIOCRMulticastProvider ProfinetIOCRType = 0x0003
	ProfinetIOCRMulticastConsumer ProfinetIOCRType = 0x0004
)

IOCR types.

func (ProfinetIOCRType) String

func (t ProfinetIOCRType) String() string

String returns the IOCR type name used by Wireshark.

type ProfinetIOObject

type ProfinetIOObject struct {
	Slot        uint16
	Subslot     uint16
	FrameOffset uint16
}

ProfinetIOObject locates an IO data object or an IOCS in the cyclic frame.

type ProfinetIORPC

type ProfinetIORPC struct {
	BaseLayer

	// DCE/RPC header.
	PacketType       ProfinetRPCPacketType
	Flags1           uint8
	Flags2           uint8
	DataRep          [3]byte
	SerialHigh       uint8
	ObjectUUID       ProfinetUUID
	InterfaceUUID    ProfinetUUID
	ActivityUUID     ProfinetUUID
	ServerBootTime   uint32
	InterfaceVersion uint32
	SequenceNumber   uint32
	Opnum            ProfinetRPCOpnum
	InterfaceHint    uint16
	ActivityHint     uint16
	FragmentLength   uint16
	FragmentNumber   uint16
	AuthProto        uint8
	SerialLow        uint8

	// FaultStatus is the status of a Fault or Reject PDU.
	FaultStatus uint32

	// PNIO NDR header. ArgsMaximum exists in requests, Status in
	// responses.
	HasNDR       bool
	ArgsMaximum  uint32
	Status       ProfinetPNIOStatus
	ArgsLength   uint32
	MaximumCount uint32
	Offset       uint32
	ActualCount  uint32

	Blocks []ProfinetBlock
}

ProfinetIORPC is a PROFINET IO RPC PDU: the connectionless DCE/RPC header and, for PNIO requests and responses, the NDR header and the block list.

The body is decoded when the PDU is an unfragmented request or response on a PNIO interface; HasNDR tells. Everything else leaves the body after the DCE/RPC header as the payload: other interfaces (the endpoint mapper), other packet types and fragments, which are not reassembled.

UUIDs are stored in canonical order whatever the sender's byte order.

func (*ProfinetIORPC) CanDecode

func (r *ProfinetIORPC) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeProfinetIORPC.

func (*ProfinetIORPC) DecodeFromBytes

func (r *ProfinetIORPC) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a PROFINET IO RPC PDU, starting at the DCE/RPC version byte.

func (*ProfinetIORPC) Fragmented

func (r *ProfinetIORPC) Fragmented() bool

Fragmented reports whether the PDU is one fragment of a larger one.

func (*ProfinetIORPC) Interface

func (r *ProfinetIORPC) Interface() ProfinetRPCInterface

Interface classifies the interface UUID.

func (*ProfinetIORPC) LayerType

func (r *ProfinetIORPC) LayerType() gopacket.LayerType

LayerType returns LayerTypeProfinetIORPC.

func (*ProfinetIORPC) LittleEndian

func (r *ProfinetIORPC) LittleEndian() bool

LittleEndian reports whether the sender's integers are little-endian.

func (*ProfinetIORPC) NextLayerType

func (r *ProfinetIORPC) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypePayload for a body left undecoded.

func (*ProfinetIORPC) Payload

func (r *ProfinetIORPC) Payload() []byte

Payload returns the body left undecoded; it makes the layer an application layer.

type ProfinetIOxS

type ProfinetIOxS uint8

ProfinetIOxS is an IOPS or IOCS byte: the state of the IO data of a submodule as its provider or consumer sees it.

func (ProfinetIOxS) Extension

func (s ProfinetIOxS) Extension() bool

Extension reports whether another IOxS byte follows.

func (ProfinetIOxS) Good

func (s ProfinetIOxS) Good() bool

Good reports DataState: the data is good.

func (ProfinetIOxS) Instance

func (s ProfinetIOxS) Instance() uint8

Instance returns who detected bad data (bits 5-6): 0 subslot, 1 slot, 2 IO device, 3 IO controller.

type ProfinetIRAssignment

type ProfinetIRAssignment struct {
	TxRedOrangePeriodBegin uint32
	TxOrangePeriodBegin    uint32
	TxGreenPeriodBegin     uint32
	RxRedOrangePeriodBegin uint32
	RxOrangePeriodBegin    uint32
	RxGreenPeriodBegin     uint32
}

ProfinetIRAssignment is the begin of the red, orange and green periods of one phase, for sending and for receiving, in nanoseconds.

type ProfinetIRFrame

type ProfinetIRFrame struct {
	FrameSendOffset uint32
	DataLength      uint16
	ReductionRatio  uint16
	Phase           uint16
	FrameID         ProfinetFrameID
	EtherType       EthernetType
	RxPort          uint8
	FrameDetails    uint8  // bits 0-1 sync frame, bits 2-3 meaning
	TxPortGroups    []byte // one bit per port, bit 0 of byte 0 the local interface
}

ProfinetIRFrame is one frame of PDIRFrameData: when an RT_CLASS_3 frame is sent and where it is forwarded.

type ProfinetIRInfoBlock

type ProfinetIRInfoBlock struct {
	IRDataUUID ProfinetUUID
	IOCRs      []ProfinetIRInfoIOCR
}

ProfinetIRInfoBlock is the body of IRInfoBlock.

type ProfinetIRInfoIOCR

type ProfinetIRInfoIOCR struct {
	IOCRReference  uint16
	SubframeOffset uint16
	SubframeData   ProfinetSubframeData
}

ProfinetIRInfoIOCR places one IOCR in a dynamic frame packing frame.

type ProfinetIRPhase

type ProfinetIRPhase struct {
	TxPhaseAssignment uint16
	RxPhaseAssignment uint16
}

ProfinetIRPhase picks the assignment of one phase.

type ProfinetIRPortDelay

type ProfinetIRPortDelay struct {
	MaxPortTxDelay uint32
	MaxPortRxDelay uint32
	MaxLineRxDelay uint32
	YellowTime     uint32
}

ProfinetIRPortDelay is the delays of one port in PDIRGlobalData, in nanoseconds. The last two exist in version 1.2.

type ProfinetIRPortPeriods

type ProfinetIRPortPeriods struct {
	Assignments []ProfinetIRAssignment
	Phases      []ProfinetIRPhase
}

ProfinetIRPortPeriods is one port of PDIRBeginEndData.

type ProfinetIdentAPI

type ProfinetIdentAPI struct {
	API     uint32
	Modules []ProfinetIdentModule
}

ProfinetIdentAPI is the modules of one API.

type ProfinetIdentModule

type ProfinetIdentModule struct {
	Slot              uint16
	ModuleIdentNumber uint32
	Submodules        []ProfinetIdentSubmodule
}

ProfinetIdentModule is one module of an identification list.

type ProfinetIdentSubmodule

type ProfinetIdentSubmodule struct {
	Subslot              uint16
	SubmoduleIdentNumber uint32
}

ProfinetIdentSubmodule is one submodule of an identification list.

type ProfinetIdentification

type ProfinetIdentification struct {
	APIs []ProfinetIdentAPI
}

ProfinetIdentification is the body of RealIdentificationData, ExpectedIdentificationData and the three I&M0FilterData blocks: modules and submodules by API. Version 1.0 of the identification data has no API level; its modules are returned under API 0.

type ProfinetIngressRateLimiter

type ProfinetIngressRateLimiter uint64

ProfinetIngressRateLimiter is PortIngressRateLimiter.

func (ProfinetIngressRateLimiter) CBS

CBS returns the committed burst size in octets (bits 16-31).

func (ProfinetIngressRateLimiter) CIR

CIR returns the committed information rate in 0.1 Mbit/s (bits 0-15).

func (ProfinetIngressRateLimiter) Envelope

func (l ProfinetIngressRateLimiter) Envelope() uint16

Envelope returns bits 32-47.

func (ProfinetIngressRateLimiter) Rank

Rank returns bits 48-63.

type ProfinetIsochronousMode

type ProfinetIsochronousMode struct {
	Slot                             uint16
	Subslot                          uint16
	ControllerApplicationCycleFactor uint16
	TimeDataCycle                    uint16
	TimeIOInput                      uint32
	TimeIOOutput                     uint32
	TimeIOInputValid                 uint32
	TimeIOOutputValid                uint32
}

ProfinetIsochronousMode is the body of IsochronousModeData. Times are in nanoseconds; the cycle is ControllerApplicationCycleFactor times the send cycle.

type ProfinetLineDelay

type ProfinetLineDelay uint32

ProfinetLineDelay is a LineDelay: bit 31 says whether the low 31 bits are the cable delay (set) or the line delay (clear), in nanoseconds.

func (ProfinetLineDelay) IsCableDelay

func (d ProfinetLineDelay) IsCableDelay() bool

IsCableDelay reports whether the value is a cable delay.

func (ProfinetLineDelay) Nanoseconds

func (d ProfinetLineDelay) Nanoseconds() uint32

Nanoseconds returns the delay.

type ProfinetLinkState

type ProfinetLinkState uint16

ProfinetLinkState is a LinkState: Port in the high byte, Link in the low byte.

func (s ProfinetLinkState) Link() uint8

Link returns LinkState.Link: 1 up, 2 down, 3 testing, 4 unknown, 5 dormant, 6 not present, 7 lower layer down.

func (ProfinetLinkState) Port

func (s ProfinetLinkState) Port() uint8

Port returns LinkState.Port: 0 unknown, 1 disabled or discarding, 2 blocking, 3 listening, 4 learning, 5 forwarding, 6 broken.

type ProfinetLogBookData

type ProfinetLogBookData struct {
	ActualLocalTimeStamp uint64
	Entries              []ProfinetLogEntry
}

ProfinetLogBookData is the body of LogBookData. Time stamps count from an arbitrary start, in units the device chooses.

type ProfinetLogEntry

type ProfinetLogEntry struct {
	LocalTimeStamp uint64
	ARUUID         ProfinetUUID
	Status         ProfinetPNIOStatus
	EntryDetail    uint32
}

ProfinetLogEntry is one entry of the log book.

type ProfinetMAUType

type ProfinetMAUType uint16

ProfinetMAUType is a MAUType: the IEEE 802.3 medium attachment unit type of dot3MauType.

const (
	ProfinetMAU10BaseTHD   ProfinetMAUType = 0x000A
	ProfinetMAU10BaseTFD   ProfinetMAUType = 0x000B
	ProfinetMAU100BaseTXHD ProfinetMAUType = 0x000F
	ProfinetMAU100BaseTXFD ProfinetMAUType = 0x0010
	ProfinetMAU100BaseFXHD ProfinetMAUType = 0x0011
	ProfinetMAU100BaseFXFD ProfinetMAUType = 0x0012
	ProfinetMAU1000BaseXFD ProfinetMAUType = 0x0016
	ProfinetMAU1000BaseTFD ProfinetMAUType = 0x001E
	ProfinetMAU10GBaseT    ProfinetMAUType = 0x0030
	ProfinetMAU100BasePXFD ProfinetMAUType = 0x0036 // POF and PCF
)

Common MAU types.

func (ProfinetMAUType) String

func (m ProfinetMAUType) String() string

String names the MAU type.

type ProfinetMCRBlock

type ProfinetMCRBlock struct {
	IOCRReference               uint16
	AddressResolutionProperties uint32 // bits 0-2 protocol: 1 DNS, 2 DCP; bits 16-31 resolution timeout factor
	MCITimeoutFactor            uint16
	ProviderStationName         string
}

ProfinetMCRBlock is the body of MCRBlockReq: how a multicast consumer finds its provider.

type ProfinetMaintenanceStatus

type ProfinetMaintenanceStatus uint32

ProfinetMaintenanceStatus is the MaintenanceStatus of a MaintenanceItem.

func (ProfinetMaintenanceStatus) Demanded

func (s ProfinetMaintenanceStatus) Demanded() bool

Demanded reports whether maintenance is demanded.

func (ProfinetMaintenanceStatus) Required

func (s ProfinetMaintenanceStatus) Required() bool

Required reports whether maintenance is required.

type ProfinetModuleDiffBlock

type ProfinetModuleDiffBlock struct {
	APIs []ProfinetDiffAPI
}

ProfinetModuleDiffBlock is a ModuleDiffBlock: how the real configuration differs from the expected one.

type ProfinetModuleState

type ProfinetModuleState uint16

ProfinetModuleState is the ModuleState of a ModuleDiffBlock.

const (
	ProfinetModuleNone       ProfinetModuleState = 0
	ProfinetModuleWrong      ProfinetModuleState = 1
	ProfinetModuleProper     ProfinetModuleState = 2
	ProfinetModuleSubstitute ProfinetModuleState = 3
)

Module states.

func (ProfinetModuleState) String

func (s ProfinetModuleState) String() string

String names the module state.

type ProfinetMrpCheck

type ProfinetMrpCheck uint32

ProfinetMrpCheck is MRP_Check: what the device shall diagnose.

func (ProfinetMrpCheck) DomainUUID

func (c ProfinetMrpCheck) DomainUUID() bool

DomainUUID reports whether the MRP domain UUID is checked.

func (ProfinetMrpCheck) Manager

func (c ProfinetMrpCheck) Manager() bool

Manager reports whether the media redundancy manager is checked.

type ProfinetMrpClientParams

type ProfinetMrpClientParams struct {
	LNKdownT uint16 // link down interval, ms
	LNKupT   uint16 // link up interval, ms
	LNKNRmax uint16 // link change count
}

ProfinetMrpClientParams is the body of MrpClientParams.

type ProfinetMrpInterface

type ProfinetMrpInterface struct {
	NumberOfEntries uint8
	Instance        uint8
	DomainUUID      ProfinetUUID
	Role            ProfinetMrpRole
	Version         uint16
	DomainName      string
	Check           ProfinetMrpCheck
}

ProfinetMrpInterface is the body of the MRP records of an interface: PDInterfaceMrpDataAdjust, Real and Check, and the MrpInstanceData blocks their version 1.1 nests.

Version 1.1 of the interface records sets only NumberOfEntries; the rings are in the nested blocks. Role and DomainName do not exist in the check records, Version only in the real ones, Check only in the check ones, Instance only in the MrpInstanceData blocks.

type ProfinetMrpManagerParams

type ProfinetMrpManagerParams struct {
	Prio        uint16 // MRP_Prio: 0 highest
	TOPchgT     uint16 // topology change interval
	TOPNRmax    uint16 // topology change repeat count
	TSTshortT   uint16 // short test interval
	TSTdefaultT uint16 // default test interval
	TSTNRmax    uint16 // test monitoring count
}

ProfinetMrpManagerParams is the body of MrpManagerParams. Times are in milliseconds.

type ProfinetMrpPort

type ProfinetMrpPort struct {
	Instance   uint8
	DomainUUID ProfinetUUID
}

ProfinetMrpPort is the body of PDPortMrpDataAdjust and PDPortMrpDataReal: the ring a port belongs to. Instance exists in version 1.1.

type ProfinetMrpRTMode

type ProfinetMrpRTMode struct {
	TSTNRmax    uint16
	TSTdefaultT uint16
	RTMode      uint32
}

ProfinetMrpRTMode is the body of MrpRTModeManagerData and MrpRTModeClientData. The test parameters exist for the manager only. RTMode bit 0 enables RT_CLASS_1 and 2 redundancy, bit 1 RT_CLASS_3.

type ProfinetMrpRole

type ProfinetMrpRole uint16

ProfinetMrpRole is MRP_Role.

const (
	ProfinetMrpRoleOff         ProfinetMrpRole = 0
	ProfinetMrpRoleClient      ProfinetMrpRole = 1
	ProfinetMrpRoleManager     ProfinetMrpRole = 2
	ProfinetMrpRoleAutoManager ProfinetMrpRole = 3
)

MRP roles.

func (ProfinetMrpRole) String

func (m ProfinetMrpRole) String() string

String names the role.

type ProfinetMultipleHeader

type ProfinetMultipleHeader struct {
	API     uint32
	Slot    uint16
	Subslot uint16
}

ProfinetMultipleHeader is the head of a MultipleBlockHeader: the submodule the nested blocks belong to.

type ProfinetNMEDomainConfig

type ProfinetNMEDomainConfig struct {
	StreamCollectionUUID          ProfinetUUID // CIMStreamCollectionUUID
	SyncTreeDataUUID              ProfinetUUID // CIMSyncTreeDataUUID
	ExpectedNetworkAttributesUUID ProfinetUUID // CIMExpectedNetworkAttributesUUID
}

ProfinetNMEDomainConfig is the body of NMEDomainConfigRealBlock: the configuration sets a TSN domain runs with.

type ProfinetNMEDomainTime

type ProfinetNMEDomainTime struct {
	TimeDomainNumber      uint16 // 0 global time, 0x20 working clock
	TimePLLWindow         uint32 // nanoseconds
	MessageIntervalFactor uint32
	MessageTimeoutFactor  uint16
	TimeSyncProperties    uint16 // bits 0-1 role: 1 external, 2 internal sync
	TimeDomainUUID        ProfinetUUID
	TimeDomainName        string
}

ProfinetNMEDomainTime is the body of NMEDomainTimeDataBlock: the time synchronization of a TSN domain.

type ProfinetNMEQueueConfig

type ProfinetNMEQueueConfig uint64

ProfinetNMEQueueConfig is NMEDomainQueueConfig: one egress queue.

func (ProfinetNMEQueueConfig) MaskTimeOffset

func (q ProfinetNMEQueueConfig) MaskTimeOffset() uint32

MaskTimeOffset returns bits 40-63.

func (ProfinetNMEQueueConfig) PreemptionMode

func (q ProfinetNMEQueueConfig) PreemptionMode() uint8

PreemptionMode returns bits 14-15.

func (ProfinetNMEQueueConfig) QueueID

func (q ProfinetNMEQueueConfig) QueueID() uint8

QueueID returns bits 0-3.

func (ProfinetNMEQueueConfig) Shaper

func (q ProfinetNMEQueueConfig) Shaper() uint8

Shaper returns the traffic shaper (bits 7-13).

func (ProfinetNMEQueueConfig) TciPcp

func (q ProfinetNMEQueueConfig) TciPcp() uint8

TciPcp returns the priority code point mapped to the queue (bits 4-6).

func (ProfinetNMEQueueConfig) UnmaskTimeOffset

func (q ProfinetNMEQueueConfig) UnmaskTimeOffset() uint32

UnmaskTimeOffset returns bits 16-39.

type ProfinetNeighbors

type ProfinetNeighbors struct {
	Peers []ProfinetPeer
}

ProfinetNeighbors is the body of a Neighbors block of PDPortDataRealExtended.

type ProfinetOwnPort

type ProfinetOwnPort struct {
	OwnPortID         string
	LineDelay         ProfinetLineDelay
	MediaType         uint32
	MulticastBoundary uint32
	MAUType           ProfinetMAUType
	MAUTypeExtension  uint16
	LinkState         ProfinetLinkState
	RTClass3Status    uint16 // RTClass3_PortStatus
}

ProfinetOwnPort is the body of an OwnPort block of PDPortDataRealExtended.

type ProfinetPDIRBeginEnd

type ProfinetPDIRBeginEnd struct {
	StartOfRedFrameID ProfinetFrameID
	EndOfRedFrameID   ProfinetFrameID
	Ports             []ProfinetIRPortPeriods
}

ProfinetPDIRBeginEnd is the body of PDIRBeginEndData.

type ProfinetPDIRFrameData

type ProfinetPDIRFrameData struct {
	FrameDataProperties uint32
	Frames              []ProfinetIRFrame
}

ProfinetPDIRFrameData is the body of PDIRFrameData. FrameDataProperties exists in version 1.1.

type ProfinetPDIRGlobalData

type ProfinetPDIRGlobalData struct {
	IRDataUUID     ProfinetUUID
	MaxBridgeDelay uint32
	Ports          []ProfinetIRPortDelay
}

ProfinetPDIRGlobalData is the body of PDIRGlobalData.

type ProfinetPDInterfaceAdjust

type ProfinetPDInterfaceAdjust struct {
	MultipleInterfaceMode uint32
}

ProfinetPDInterfaceAdjust is the body of PDInterfaceAdjust. Bit 0 of MultipleInterfaceMode makes the LLDP port ID carry the station name too.

func (*ProfinetPDInterfaceAdjust) NameOfDevice

func (p *ProfinetPDInterfaceAdjust) NameOfDevice() bool

NameOfDevice reports whether the LLDP port ID holds the name of the port and the name of the station.

type ProfinetPDInterfaceReal

type ProfinetPDInterfaceReal struct {
	OwnChassisID    string
	MACAddress      net.HardwareAddr
	IPAddress       net.IP
	Subnetmask      net.IP
	StandardGateway net.IP
}

ProfinetPDInterfaceReal is the body of PDInterfaceDataReal: the name and the addresses of an interface.

type ProfinetPDPortDataReal

type ProfinetPDPortDataReal struct {
	Slot              uint16
	Subslot           uint16
	OwnPortID         string
	Peers             []ProfinetPeer
	MAUType           ProfinetMAUType
	DomainBoundary    uint32
	MulticastBoundary uint32
	LinkState         ProfinetLinkState
	MediaType         uint32 // 1 copper, 2 fiber optic, 3 radio
}

ProfinetPDPortDataReal is the body of PDPortDataReal: the state of a port and what LLDP learned about its neighbours.

type ProfinetPDPortStatistic

type ProfinetPDPortStatistic struct {
	CounterStatus uint16
	InOctets      uint32
	OutOctets     uint32
	InDiscards    uint32
	OutDiscards   uint32
	InErrors      uint32
	OutErrors     uint32
}

ProfinetPDPortStatistic is the body of PDPortStatistic: the interface counters of the MIB-II ifTable. CounterStatus exists in version 1.1; a set bit marks the counter at that position (ifInOctets first) invalid.

type ProfinetPDRsiInstances

type ProfinetPDRsiInstances struct {
	Instances        []ProfinetRsiInstance
	DeviceType       string
	OrderID          string
	SerialNumber     string // IM_Serial_Number
	HardwareRevision string // HWRevision, five digits
	SoftwarePrefix   byte   // SWRevisionPrefix
	SoftwareRevision string // SWRevision, three numbers of three digits
}

ProfinetPDRsiInstances is the body of PDRsiInstances: the instances and the SystemIdentification of the device, whose fixed-size strings keep their padding.

| DeviceType | OrderID | IM_Serial_Number | HWRevision | Prefix | SWRevision |
| 25         | 20      | 16               | 5          | 1      | 9          |

One blank separates the fields, but not the prefix from the revision.

type ProfinetPDSyncData

type ProfinetPDSyncData struct {
	PTCPSubdomainUUID     ProfinetUUID
	ReservedIntervalBegin uint32
	ReservedIntervalEnd   uint32
	PLLWindow             uint32
	SyncSendFactor        uint32
	SendClockFactor       uint16
	PTCPTimeoutFactor     uint16
	PTCPTakeoverFactor    uint16 // PTCPTakeoverTimeoutFactor
	PTCPMasterStartupTime uint16
	SyncProperties        uint16 // bits 0-1 role: 1 slave, 2 master; bits 8-12 sync ID
	MasterPriority1       uint8
	MasterPriority2       uint8
	PTCPSubdomainName     string
}

ProfinetPDSyncData is the body of PDSyncData (version 1.2): the PTCP sync domain a device joins.

type ProfinetPEAPI

type ProfinetPEAPI struct {
	API     uint32
	Modules []ProfinetPEModule
}

ProfinetPEAPI is one API of PE_EntityStatusData.

type ProfinetPEEntityStatus

type ProfinetPEEntityStatus struct {
	APIs []ProfinetPEAPI
}

ProfinetPEEntityStatus is the body of PE_EntityStatusData.

type ProfinetPEModule

type ProfinetPEModule struct {
	Slot       uint16
	Submodules []ProfinetPESubmodule
}

ProfinetPEModule is one slot of PE_EntityStatusData.

type ProfinetPEService

type ProfinetPEService struct {
	ServiceID  uint8 // 1 Start_Pause, 2 End_Pause, 3 Query_Modes, 4 PEM_Status, 5 PE_Identify, 16 Query_Measurement
	RequestRef uint8
	Modifier   uint8
	Status     uint8 // 1 ready, 2 ready with error, 3 data incomplete
	StructID   uint8
	Data       []byte
}

ProfinetPEService is the head of a PROFIenergy ServiceRequest or ServiceResponse. Modifier exists in requests, Status in responses; Data depends on the service.

type ProfinetPESubmodule

type ProfinetPESubmodule struct {
	Subslot         uint16
	OperationalMode uint8 // PE_OperationalMode: 0 power off, 0xF0 operate, 0xFF ready to operate
}

ProfinetPESubmodule is the PROFIenergy mode of one submodule.

type ProfinetPNIOStatus

type ProfinetPNIOStatus struct {
	ErrorCode   ProfinetErrorCode
	ErrorDecode ProfinetErrorDecode
	ErrorCode1  uint8
	ErrorCode2  uint8
}

ProfinetPNIOStatus is the 4-byte PNIO status of responses, alarm acknowledges and ERR-RTA PDUs.

func (ProfinetPNIOStatus) Code1Name

func (s ProfinetPNIOStatus) Code1Name() string

Code1Name names ErrorCode1 for the ErrorDecode of the status. It returns "" for a status that is OK and for codes the standard leaves open.

func (ProfinetPNIOStatus) Code2Name

func (s ProfinetPNIOStatus) Code2Name() string

Code2Name names ErrorCode2 where the standard gives it a meaning: the faulty field of a block, the CMRPC reason and the reason an AR was aborted. It returns "" otherwise.

func (ProfinetPNIOStatus) OK

func (s ProfinetPNIOStatus) OK() bool

OK reports whether the status signals success (all four bytes zero).

func (ProfinetPNIOStatus) String

func (s ProfinetPNIOStatus) String() string

String formats the status as Wireshark's summary does.

type ProfinetPTCP

type ProfinetPTCP struct {
	BaseLayer

	Delay10ns   uint32 // RTSync only
	SequenceID  uint16
	Delay1nsLow uint8 // RTSync only
	Delay1ns    int32 // Integer32 Delay1ns_FUP in follow up PDUs
	TLVs        []ProfinetPTCPTLV

	// Subdomain block.
	MasterSourceAddress net.HardwareAddr
	SubdomainUUID       []byte

	// Time block.
	EpochNumber uint16
	Seconds     uint32
	NanoSeconds uint32

	// TimeExtension block.
	Flags            uint16
	CurrentUTCOffset uint16

	// Master block.
	MasterPriority1 ProfinetPTCPPriority1
	MasterPriority2 uint8
	ClockClass      uint8
	ClockAccuracy   ProfinetPTCPClockAccuracy
	ClockVariance   int16

	// PortParameter block, in nanoseconds.
	T2PortRxDelay uint32
	T3PortTxDelay uint32

	// DelayParameter block.
	PortMACAddress net.HardwareAddr

	// PortTime block, in nanoseconds.
	T2TimeStamp uint32

	// Organizationally specific block. OptionData is what follows the
	// subtype; IRDataUUID is set for the PROFINET RTData option.
	OUI           uint32
	OptionSubType uint8
	OptionData    []byte
	IRDataUUID    ProfinetUUID
}

ProfinetPTCP is a PROFINET PTCP PDU (RTSync, announce, follow up, delay).

Every block is listed raw in TLVs and decoded into the fields below; TLVs tells which blocks the PDU carries. Padding after the End block is ignored.

func (*ProfinetPTCP) CanDecode

func (t *ProfinetPTCP) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeProfinetPTCP.

func (*ProfinetPTCP) DecodeFromBytes

func (t *ProfinetPTCP) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes a PTCP PDU, starting after the Frame ID.

func (*ProfinetPTCP) DelayNs

func (t *ProfinetPTCP) DelayNs() int64

DelayNs returns the delay in nanoseconds as Wireshark computes it: Delay10ns*10 + Delay1ns(byte) + Delay1ns. A follow up's Delay1ns_FUP is signed, so the result can be negative.

func (*ProfinetPTCP) LayerType

func (t *ProfinetPTCP) LayerType() gopacket.LayerType

LayerType returns LayerTypeProfinetPTCP.

func (*ProfinetPTCP) NextLayerType

func (t *ProfinetPTCP) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeZero: PTCP carries no further layer.

type ProfinetPTCPClockAccuracy

type ProfinetPTCPClockAccuracy uint8

ProfinetPTCPClockAccuracy is the ClockAccuracy byte of a Master block.

const ProfinetPTCPAccuracyUnknown ProfinetPTCPClockAccuracy = 0xFE

ProfinetPTCPAccuracyUnknown is the "unknown" clock accuracy.

func (ProfinetPTCPClockAccuracy) String

func (a ProfinetPTCPClockAccuracy) String() string

String returns the accuracy name used by Wireshark.

type ProfinetPTCPPriority1

type ProfinetPTCPPriority1 uint8

ProfinetPTCPPriority1 is the MasterPriority1 byte of a Master block.

func (ProfinetPTCPPriority1) Active

func (p ProfinetPTCPPriority1) Active() bool

Active reports whether the master is active (bit 7).

func (ProfinetPTCPPriority1) Level

func (p ProfinetPTCPPriority1) Level() uint8

Level returns bits 3-5: 0 is the highest level, 7 the lowest.

func (ProfinetPTCPPriority1) Priority

func (p ProfinetPTCPPriority1) Priority() uint8

Priority returns bits 0-2: 0 sync slave, 1 primary master, 2 secondary master.

func (ProfinetPTCPPriority1) String

func (p ProfinetPTCPPriority1) String() string

String names the priority as Wireshark does.

type ProfinetPTCPTLV

type ProfinetPTCPTLV struct {
	Type   ProfinetPTCPTLVType
	Length uint16
	Value  []byte
}

ProfinetPTCPTLV is one PTCP TLV block; Value aliases the packet data.

type ProfinetPTCPTLVType

type ProfinetPTCPTLVType uint8

ProfinetPTCPTLVType is a PTCP TLV block type.

const (
	ProfinetPTCPTLVEnd            ProfinetPTCPTLVType = 0x00
	ProfinetPTCPTLVSubdomain      ProfinetPTCPTLVType = 0x01
	ProfinetPTCPTLVTime           ProfinetPTCPTLVType = 0x02
	ProfinetPTCPTLVTimeExtension  ProfinetPTCPTLVType = 0x03
	ProfinetPTCPTLVMaster         ProfinetPTCPTLVType = 0x04
	ProfinetPTCPTLVPortParameter  ProfinetPTCPTLVType = 0x05
	ProfinetPTCPTLVDelayParameter ProfinetPTCPTLVType = 0x06
	ProfinetPTCPTLVPortTime       ProfinetPTCPTLVType = 0x07
	ProfinetPTCPTLVOrgSpecific    ProfinetPTCPTLVType = 0x7F
)

PTCP TLV types.

func (ProfinetPTCPTLVType) String

func (t ProfinetPTCPTLVType) String() string

String returns the TLV type name.

type ProfinetPeer

type ProfinetPeer struct {
	PortID     string // PeerPortID, the LLDP port ID
	ChassisID  string // PeerChassisID, the LLDP chassis ID
	LineDelay  ProfinetLineDelay
	MACAddress net.HardwareAddr

	// Neighbors blocks only.
	MAUType          ProfinetMAUType
	MAUTypeExtension uint16
}

ProfinetPeer is one neighbour of a port.

type ProfinetPortCapabilities

type ProfinetPortCapabilities uint8

ProfinetPortCapabilities is PortCapabilities.

func (ProfinetPortCapabilities) Preemption

func (c ProfinetPortCapabilities) Preemption() bool

Preemption reports whether the port supports frame preemption.

func (ProfinetPortCapabilities) QueueMasking

func (c ProfinetPortCapabilities) QueueMasking() bool

QueueMasking reports whether the port supports queue masking.

func (ProfinetPortCapabilities) TimeAware

func (c ProfinetPortCapabilities) TimeAware() bool

TimeAware reports whether the port is usable in a time aware system.

type ProfinetPowerBudget

type ProfinetPowerBudget uint32

ProfinetPowerBudget is a power or drop budget: bit 31 enables the check, the low 31 bits are the value (0.1 dB, or frames).

func (ProfinetPowerBudget) Enabled

func (p ProfinetPowerBudget) Enabled() bool

Enabled reports whether the check is on.

func (ProfinetPowerBudget) Value

func (p ProfinetPowerBudget) Value() uint32

Value returns the budget.

type ProfinetPrmServerBlock

type ProfinetPrmServerBlock struct {
	ObjectUUID            ProfinetUUID // ParameterServerObjectUUID
	Properties            uint32       // ParameterServerProperties
	ActivityTimeoutFactor uint16       // CMInitiatorActivityTimeoutFactor
	StationName           string       // ParameterServerStationName
}

ProfinetPrmServerBlock is the body of PrmServerBlockReq and PrmServerBlockRes. The response carries the station name only.

type ProfinetRPCInterface

type ProfinetRPCInterface uint8

ProfinetRPCInterface says which PNIO interface an RPC addresses.

const (
	ProfinetRPCInterfaceOther ProfinetRPCInterface = iota // not PNIO, e.g. the endpoint mapper
	ProfinetRPCInterfaceDevice
	ProfinetRPCInterfaceController
	ProfinetRPCInterfaceSupervisor
	ProfinetRPCInterfaceParameterServer
)

PNIO interfaces. Their UUIDs are DEA0000x-6C97-11D1-8271-00A02442DF7D with x from 1 to 4.

func (ProfinetRPCInterface) String

func (i ProfinetRPCInterface) String() string

String returns the interface name.

type ProfinetRPCOpnum

type ProfinetRPCOpnum uint16

ProfinetRPCOpnum is the PNIO-CM operation.

const (
	ProfinetRPCConnect      ProfinetRPCOpnum = 0
	ProfinetRPCRelease      ProfinetRPCOpnum = 1
	ProfinetRPCRead         ProfinetRPCOpnum = 2
	ProfinetRPCWrite        ProfinetRPCOpnum = 3
	ProfinetRPCControl      ProfinetRPCOpnum = 4
	ProfinetRPCReadImplicit ProfinetRPCOpnum = 5
)

PNIO-CM operations.

func (ProfinetRPCOpnum) String

func (o ProfinetRPCOpnum) String() string

String returns the operation name.

type ProfinetRPCPacketType

type ProfinetRPCPacketType uint8

ProfinetRPCPacketType is the DCE/RPC packet type.

const (
	ProfinetRPCRequest   ProfinetRPCPacketType = 0
	ProfinetRPCPing      ProfinetRPCPacketType = 1
	ProfinetRPCResponse  ProfinetRPCPacketType = 2
	ProfinetRPCFault     ProfinetRPCPacketType = 3
	ProfinetRPCWorking   ProfinetRPCPacketType = 4
	ProfinetRPCNoCall    ProfinetRPCPacketType = 5
	ProfinetRPCReject    ProfinetRPCPacketType = 6
	ProfinetRPCAck       ProfinetRPCPacketType = 7
	ProfinetRPCCancel    ProfinetRPCPacketType = 8
	ProfinetRPCFack      ProfinetRPCPacketType = 9
	ProfinetRPCCancelAck ProfinetRPCPacketType = 10
)

Connectionless DCE/RPC packet types.

func (ProfinetRPCPacketType) String

func (t ProfinetRPCPacketType) String() string

String returns the packet type name.

type ProfinetRSAckInfo

type ProfinetRSAckInfo struct {
	Specifier ProfinetRSSpecifier
}

ProfinetRSAckInfo is RS_AckInfo, the body of RS_AckEvent: the last event the controller has seen.

type ProfinetRSAdjustBlock

type ProfinetRSAdjustBlock struct {
	ProfinetRSBlockHead
	Data []byte
}

ProfinetRSAdjustBlock is one RS_AdjustBlock: the settings of one observer, raw (Wireshark shows them as user data for every observer).

type ProfinetRSAdjustInfo

type ProfinetRSAdjustInfo struct {
	NumberOfEntries uint16
	Blocks          []ProfinetRSAdjustBlock
}

ProfinetRSAdjustInfo is RS_AdjustInfo, the body of RS_AdjustObserver.

type ProfinetRSBlockHead

type ProfinetRSBlockHead struct {
	BlockType   ProfinetRSBlockType
	Length      uint16
	VersionHigh uint8
	VersionLow  uint8
}

ProfinetRSBlockHead is the header of a reporting system block.

type ProfinetRSBlockType

type ProfinetRSBlockType uint16

ProfinetRSBlockType is the block type of a reporting system block: the observer that made the event. Types below 0x4000 are manufacturer specific.

const (
	ProfinetRSStopObserver         ProfinetRSBlockType = 0x4000
	ProfinetRSBufferObserver       ProfinetRSBlockType = 0x4001
	ProfinetRSTimeStatusObserver   ProfinetRSBlockType = 0x4002
	ProfinetRSSRLObserver          ProfinetRSBlockType = 0x4003
	ProfinetRSSourceIdentObserver  ProfinetRSBlockType = 0x4004
	ProfinetRSDigitalInputObserver ProfinetRSBlockType = 0x4010
)

Observers of the standard.

func (ProfinetRSBlockType) String

func (t ProfinetRSBlockType) String() string

String names the observer.

type ProfinetRSDigitalInput

type ProfinetRSDigitalInput struct {
	CurrentValue uint16 // SoE_DigitalInputCurrentValue
}

ProfinetRSDigitalInput is the extension of a digital input observer event.

func (*ProfinetRSDigitalInput) One

func (d *ProfinetRSDigitalInput) One() bool

One reports whether the digital input is one (bit 0).

type ProfinetRSEvent

type ProfinetRSEvent struct {
	ProfinetRSBlockHead
	ARUUID        ProfinetUUID
	API           uint32
	Slot          uint16
	Subslot       uint16
	ChannelNumber uint16
	Specifier     ProfinetRSSpecifier
	TimeStamp     ProfinetRSTimeStamp
	MinusError    uint16
	PlusError     uint16
	Extensions    []ProfinetRSExtension
}

ProfinetRSEvent is one RS_EventBlock.

type ProfinetRSEventInfo

type ProfinetRSEventInfo struct {
	NumberOfEntries uint16
	Events          []ProfinetRSEvent
}

ProfinetRSEventInfo is RS_EventInfo: the body of RS_GetEvent and of the RS_Event alarm item.

type ProfinetRSExtension

type ProfinetRSExtension struct {
	Type  uint8
	Data  []byte
	Value interface{}
}

ProfinetRSExtension is one RS_EventDataExtension. Value is set on the first extension of an event of a standard observer: a pointer to ProfinetRSStop, ProfinetRSTimeStatus, ProfinetRSSourceIdent or ProfinetRSDigitalInput.

type ProfinetRSInfoBlock

type ProfinetRSInfoBlock struct {
	RSProperties uint32
}

ProfinetRSInfoBlock is the body of RSInfoBlock. Bit 0 of RSProperties asks for an alarm on each reporting system event.

type ProfinetRSSourceIdent

type ProfinetRSSourceIdent struct {
	Organization uint16 // AM_DeviceIdentification
	VendorID     uint16
	DeviceID     uint16
	DeviceSubID  uint16
	TagFunction  string // IM_Tag_Function
	TagLocation  string // IM_Tag_Location
}

ProfinetRSSourceIdent is the extension of a source identification observer event. The tags keep their padding.

type ProfinetRSSpecifier

type ProfinetRSSpecifier uint16

ProfinetRSSpecifier is RS_Specifier.

func (ProfinetRSSpecifier) SequenceNumber

func (s ProfinetRSSpecifier) SequenceNumber() uint16

SequenceNumber returns the event sequence number (bits 0-10).

func (ProfinetRSSpecifier) Specifier

func (s ProfinetRSSpecifier) Specifier() uint8

Specifier returns bits 14-15: 0 current value, 1 appears, 2 disappears.

type ProfinetRSStop

type ProfinetRSStop struct {
	Observer ProfinetRSBlockType
	Reason   uint16 // RS_ReasonCode bits 0-15
	Detail   uint16 // RS_ReasonCode bits 16-31
	Data     []byte
}

ProfinetRSStop is the extension of a stop observer event: the observer that stopped and why.

type ProfinetRSTimeStamp

type ProfinetRSTimeStamp struct {
	Status      uint16
	SecondsHigh uint16
	Seconds     uint32
	Nanoseconds uint32
}

ProfinetRSTimeStamp is RS_TimeStamp: a status word and a PTP style time. Bits 0-1 of Status tell the time scale: 0 global synchronized time, 1 the working clock, 2 local arbitrary time.

type ProfinetRSTimeStatus

type ProfinetRSTimeStatus struct {
	DomainIdentification []byte // RS_DomainIdentification, 16 bytes
	MasterIdentification []byte // RS_MasterIdentification, 8 bytes
	TimeStamp            ProfinetRSTimeStamp
}

ProfinetRSTimeStatus is the extension of a time status observer event.

type ProfinetRange

type ProfinetRange uint32

ProfinetRange is a range of slots, subslots or record indexes: the end in the high and the start in the low 16 bits.

func (ProfinetRange) End

func (g ProfinetRange) End() uint16

End returns the last number of the range.

func (ProfinetRange) Start

func (g ProfinetRange) Start() uint16

Start returns the first number of the range.

type ProfinetRecordAccessPolicy

type ProfinetRecordAccessPolicy struct {
	Entries []ProfinetRecordPolicy
}

ProfinetRecordAccessPolicy is the body of ARRecordAccessPolicyAdjust and ARRecordAccessPolicyReal.

type ProfinetRecordBlock

type ProfinetRecordBlock struct {
	SeqNumber        uint16
	ARUUID           ProfinetUUID
	API              uint32
	Slot             uint16
	Subslot          uint16
	Index            ProfinetRecordIndex
	RecordDataLength uint32

	TargetARUUID ProfinetUUID       // read request with a nil ARUUID (implicit read)
	AddVal1      uint16             // responses
	AddVal2      uint16             // responses
	Status       ProfinetPNIOStatus // write response

	Data []byte

	// Blocks is Data decoded, for the indices whose record data is a run
	// of blocks (see ProfinetRecordIndex.HoldsBlocks).
	Blocks []ProfinetBlock
}

ProfinetRecordBlock is an IODWriteReqHeader, IODReadReqHeader, IODWriteResHeader or IODReadResHeader block.

Data is the record data that follows a write request or a read response header, clipped to the captured bytes. Its layout depends on Index; for the indexes that hold blocks (Index.HoldsBlocks), Blocks is Data decoded.

type ProfinetRecordIOData

type ProfinetRecordIOData struct {
	SubstituteActiveFlag uint16 // 0 operation, 1 substitute
	LengthIOCS           uint8
	LengthIOPS           uint8
	IOCS                 ProfinetIOxS
	IOPS                 ProfinetIOxS
	Data                 []byte
}

ProfinetRecordIOData is the body of RecordInputDataObjectElement and RecordOutputDataObjectElement: the IO data of a submodule read as a record. SubstituteActiveFlag exists for outputs, whose block also nests the SubstituteValue block.

type ProfinetRecordIndex

type ProfinetRecordIndex uint16

ProfinetRecordIndex is the Index of a record.

const (
	ProfinetIndexExpectedIdent    ProfinetRecordIndex = 0x8000
	ProfinetIndexRealIdent        ProfinetRecordIndex = 0x8001
	ProfinetIndexDiagChannel      ProfinetRecordIndex = 0x800A
	ProfinetIndexDiagAll          ProfinetRecordIndex = 0x800B
	ProfinetIndexDiagMaintQual    ProfinetRecordIndex = 0x800C
	ProfinetIndexMaintReqChannel  ProfinetRecordIndex = 0x8010
	ProfinetIndexMaintDemChannel  ProfinetRecordIndex = 0x8011
	ProfinetIndexMaintReqAll      ProfinetRecordIndex = 0x8012
	ProfinetIndexMaintDemAll      ProfinetRecordIndex = 0x8013
	ProfinetIndexSubstituteValue  ProfinetRecordIndex = 0x801E
	ProfinetIndexPDIRSubframeData ProfinetRecordIndex = 0x8020
	ProfinetIndexPDPortRealExt    ProfinetRecordIndex = 0x8027
	ProfinetIndexRecordInput      ProfinetRecordIndex = 0x8028
	ProfinetIndexRecordOutput     ProfinetRecordIndex = 0x8029
	ProfinetIndexPDPortDataReal   ProfinetRecordIndex = 0x802A
	ProfinetIndexPDPortDataCheck  ProfinetRecordIndex = 0x802B
	ProfinetIndexPDIRData         ProfinetRecordIndex = 0x802C
	ProfinetIndexPDSyncData       ProfinetRecordIndex = 0x802D
	ProfinetIndexPDPortDataAdjust ProfinetRecordIndex = 0x802F
	ProfinetIndexIsochronousMode  ProfinetRecordIndex = 0x8030
	ProfinetIndexPDTimeData       ProfinetRecordIndex = 0x8031
	ProfinetIndexPDIfMrpReal      ProfinetRecordIndex = 0x8050
	ProfinetIndexPDIfMrpCheck     ProfinetRecordIndex = 0x8051
	ProfinetIndexPDIfMrpAdjust    ProfinetRecordIndex = 0x8052
	ProfinetIndexPDPortMrpAdjust  ProfinetRecordIndex = 0x8053
	ProfinetIndexPDPortMrpReal    ProfinetRecordIndex = 0x8054
	ProfinetIndexPDPortMrpIcAdj   ProfinetRecordIndex = 0x8055
	ProfinetIndexPDPortMrpIcCheck ProfinetRecordIndex = 0x8056
	ProfinetIndexPDPortMrpIcReal  ProfinetRecordIndex = 0x8057
	ProfinetIndexPDPortFOReal     ProfinetRecordIndex = 0x8060
	ProfinetIndexPDPortFOCheck    ProfinetRecordIndex = 0x8061
	ProfinetIndexPDPortFOAdjust   ProfinetRecordIndex = 0x8062
	ProfinetIndexPDPortSFPCheck   ProfinetRecordIndex = 0x8063
	ProfinetIndexPDNCDataCheck    ProfinetRecordIndex = 0x8070
	ProfinetIndexPDIfAdjust       ProfinetRecordIndex = 0x8071
	ProfinetIndexPDPortStatistic  ProfinetRecordIndex = 0x8072
	ProfinetIndexPDIfDataReal     ProfinetRecordIndex = 0x8080
	ProfinetIndexPDIfFSUAdjust    ProfinetRecordIndex = 0x8090
	ProfinetIndexPROFIenergy      ProfinetRecordIndex = 0x80A0
	ProfinetIndexPEEntityStatus   ProfinetRecordIndex = 0x80AF
	ProfinetIndexCombinedObject   ProfinetRecordIndex = 0x80B0
	ProfinetIndexRSAdjustObserver ProfinetRecordIndex = 0x80CF
	ProfinetIndexIM0              ProfinetRecordIndex = 0xAFF0
	ProfinetIndexIM1              ProfinetRecordIndex = 0xAFF1
	ProfinetIndexIM2              ProfinetRecordIndex = 0xAFF2
	ProfinetIndexIM3              ProfinetRecordIndex = 0xAFF3
	ProfinetIndexIM4              ProfinetRecordIndex = 0xAFF4
	ProfinetIndexIM5              ProfinetRecordIndex = 0xAFF5
	ProfinetIndexModuleDiff       ProfinetRecordIndex = 0xE002
	ProfinetIndexMultipleWrite    ProfinetRecordIndex = 0xE040
	ProfinetIndexARFSUDataAdjust  ProfinetRecordIndex = 0xE050
	ProfinetIndexRSGetEvent       ProfinetRecordIndex = 0xE060
	ProfinetIndexRSAckEvent       ProfinetRecordIndex = 0xE061
	ProfinetIndexARDataAPI        ProfinetRecordIndex = 0xF020
	ProfinetIndexDiagDevice       ProfinetRecordIndex = 0xF80C
	ProfinetIndexARData           ProfinetRecordIndex = 0xF820
	ProfinetIndexAPIData          ProfinetRecordIndex = 0xF821
	ProfinetIndexLogBookData      ProfinetRecordIndex = 0xF830
	ProfinetIndexPDevData         ProfinetRecordIndex = 0xF831
	ProfinetIndexIM0FilterData    ProfinetRecordIndex = 0xF840
	ProfinetIndexPDRealData       ProfinetRecordIndex = 0xF841
	ProfinetIndexPDExpectedData   ProfinetRecordIndex = 0xF842
	ProfinetIndexAutoConfig       ProfinetRecordIndex = 0xF850
	ProfinetIndexGSDUpload        ProfinetRecordIndex = 0xF860
	ProfinetIndexPEEntityFilter   ProfinetRecordIndex = 0xF870
	ProfinetIndexPEEntityStatusAR ProfinetRecordIndex = 0xF871
	ProfinetIndexAssetManagement  ProfinetRecordIndex = 0xF880
	ProfinetIndexRPCTrigger       ProfinetRecordIndex = 0xFBFF
)

Record indices. Diagnosis indices exist once per scope: add the low byte to the base of the subslot, slot, AR or API range.

func (ProfinetRecordIndex) HoldsBlocks

func (i ProfinetRecordIndex) HoldsBlocks() bool

HoldsBlocks reports whether the record data of the index is a run of blocks. MultipleWrite is not: its write headers follow as blocks of the PDU itself.

func (ProfinetRecordIndex) IsProfile

func (i ProfinetRecordIndex) IsProfile() bool

IsProfile reports whether the index belongs to a profile range.

func (ProfinetRecordIndex) IsUser

func (i ProfinetRecordIndex) IsUser() bool

IsUser reports whether the index is user specific: the record data has no layout the standard knows.

func (ProfinetRecordIndex) String

func (i ProfinetRecordIndex) String() string

String names the index after the record it addresses.

type ProfinetRecordPolicy

type ProfinetRecordPolicy struct {
	Condition uint16 // RACondition: bits 0-1 the AR type
	Access    uint16 // RAAccess: bits 0-1 the permission
	Slot      ProfinetRange
	Subslot   ProfinetRange
	Index     ProfinetRange
}

ProfinetRecordPolicy is one RecordPolicySetData: the access an AR type has to a range of records.

func (ProfinetRecordPolicy) ARType

func (p ProfinetRecordPolicy) ARType() uint8

ARType returns the AR type the policy applies to (RACondition bits 0-1).

func (ProfinetRecordPolicy) AccessType

func (p ProfinetRecordPolicy) AccessType() uint8

AccessType returns the permission (RAAccess bits 0-1); zero permits reading and writing.

type ProfinetRecordQuery

type ProfinetRecordQuery struct {
	Data []byte
}

ProfinetRecordQuery is the body of RecordDataReadQuery: the query a read request passes to the record, user specific.

type ProfinetRsiInstance

type ProfinetRsiInstance struct {
	VendorID   uint16
	DeviceID   uint16
	InstanceID uint16
	Interface  uint8 // RsiInterface
}

ProfinetRsiInstance is one PDRsiInstance: a remote service interface the device offers.

type ProfinetSCMConfig

type ProfinetSCMConfig uint64

ProfinetSCMConfig is SecurityConfigurationParameters as the SCM and SAM blocks carry it.

func (ProfinetSCMConfig) SACKDegradationFactor

func (c ProfinetSCMConfig) SACKDegradationFactor() uint16

SACKDegradationFactor returns SACKDegradationThresholdFactor (bits 16-31).

func (ProfinetSCMConfig) ValidityPeriodCheck

func (c ProfinetSCMConfig) ValidityPeriodCheck() uint8

ValidityPeriodCheck returns CredentialValidityPeriodCheck (bits 2-3).

type ProfinetSCMService

type ProfinetSCMService struct {
	Operation   ProfinetSecurityOperation
	DevIDDomain uint32            // requests that name a credential
	Config      ProfinetSCMConfig // Get and Set Security Configuration
	EAP         []byte            // Process EAP Message: one EAP packet
	ProfinetSecurityParams
}

ProfinetSCMService is the body of SCMRequestBlock, SCMResponseBlock, SAMRequestBlock and SAMResponseBlock. Wireshark reads all four alike; only the SAM blocks carry EAP.

type ProfinetSRInfoBlock

type ProfinetSRInfoBlock struct {
	RedundancyDataHoldFactor uint16
	SRProperties             uint32
}

ProfinetSRInfoBlock is the body of SRInfoBlock: the timing of a system redundancy AR.

func (*ProfinetSRInfoBlock) InputValidOnBackupAR

func (s *ProfinetSRInfoBlock) InputValidOnBackupAR() bool

InputValidOnBackupAR reports whether the controller reads the inputs of the backup AR (bit 0).

func (*ProfinetSRInfoBlock) Mode

func (s *ProfinetSRInfoBlock) Mode() bool

Mode reports bit 2: the controller supports data marked invalid while the inputs of the backup AR are not valid.

type ProfinetSRLData

type ProfinetSRLData struct {
	RedundancyInfo uint16
}

ProfinetSRLData is the body of SRLData. Bits 0-1 of RedundancyInfo say which end of the system redundancy layer answered: 1 left or below, 2 right or above.

func (*ProfinetSRLData) EndPoint

func (s *ProfinetSRLData) EndPoint() uint8

EndPoint returns RedundancyInfo.EndPoint.

type ProfinetSWRevision

type ProfinetSWRevision struct {
	Prefix                byte
	FunctionalEnhancement uint8
	BugFix                uint8
	InternalChange        uint8
}

ProfinetSWRevision is IM_Software_Revision: a prefix letter (V released, R revision, P prototype, U under test, T test device) and three numbers.

type ProfinetSXPEndpoint

type ProfinetSXPEndpoint struct {
	ID         uint8 // SXP_EndPointID: 1 the CIM endpoint
	VendorID   uint16
	DeviceID   uint16
	InstanceID uint16
}

ProfinetSXPEndpoint is the SXP destination endpoint of an ARSXPBlock.

type ProfinetSecurity

type ProfinetSecurity struct {
	Information     uint8  // bit 0 is the protection mode
	Control         uint8  // low nibble is the generation number
	SequenceCounter uint32 // SecuritySequenceCounter
	Length          uint16 // SecurityLength: protected bytes after the metadata

	// Checksum is the 16-byte SecurityChecksum behind the protected bytes,
	// nil when the capture ends before it.
	Checksum []byte
}

ProfinetSecurity is the SecurityMetaData of a secured frame.

func (*ProfinetSecurity) Encrypted

func (s *ProfinetSecurity) Encrypted() bool

Encrypted reports whether the protection mode is authenticated encryption (1) rather than authentication only (0).

func (*ProfinetSecurity) GenerationNumber

func (s *ProfinetSecurity) GenerationNumber() uint8

GenerationNumber returns the key generation (SecurityControl bits 0-3).

type ProfinetSecurityCapability

type ProfinetSecurityCapability uint16

ProfinetSecurityCapability is a SecurityCapability: what an algorithm is used for and which one it is.

func (ProfinetSecurityCapability) Algorithm

func (c ProfinetSecurityCapability) Algorithm() uint8

Algorithm returns the high byte, read in the number space of Usage.

func (ProfinetSecurityCapability) Usage

Usage returns the low byte: 2 symmetric authenticated encryption, 4 key agreement.

type ProfinetSecurityConfig

type ProfinetSecurityConfig uint64

ProfinetSecurityConfig is SecurityConfigurationParameters as a SecurityRequestBlock and a SecurityResponse carry it.

func (ProfinetSecurityConfig) SACKDegradationThreshold

func (c ProfinetSecurityConfig) SACKDegradationThreshold() uint8

SACKDegradationThreshold returns bits 8-15.

func (ProfinetSecurityConfig) SecurityMode

func (c ProfinetSecurityConfig) SecurityMode() uint8

SecurityMode returns bits 0-1; zero preserves the stored value.

func (ProfinetSecurityConfig) ValidityPeriodCheck

func (c ProfinetSecurityConfig) ValidityPeriodCheck() uint8

ValidityPeriodCheck returns CertificateValidityPeriodCheck (bits 2-3).

type ProfinetSecurityOperation

type ProfinetSecurityOperation uint16

ProfinetSecurityOperation is the SecurityOperation, SCMOperation or SAMOperation that opens a security service block.

const (
	ProfinetSecOpGetCapabilities ProfinetSecurityOperation = 0x0001
	ProfinetSecOpGetCredentials  ProfinetSecurityOperation = 0x0002 // SecurityOperation only
	ProfinetSecOpGetConfig       ProfinetSecurityOperation = 0x0003
	ProfinetSecOpGetEEPath       ProfinetSecurityOperation = 0x0004
	ProfinetSecOpGetTrustedCA    ProfinetSecurityOperation = 0x0005
	ProfinetSecOpGenerateKeyCSR  ProfinetSecurityOperation = 0x0006
	ProfinetSecOpImprintEEPath   ProfinetSecurityOperation = 0x0008
	ProfinetSecOpRemoveEEPath    ProfinetSecurityOperation = 0x0009
	ProfinetSecOpImprintCA       ProfinetSecurityOperation = 0x000A
	ProfinetSecOpRemoveCA        ProfinetSecurityOperation = 0x000B
	ProfinetSecOpSetConfig       ProfinetSecurityOperation = 0x000C
	ProfinetSecOpReset           ProfinetSecurityOperation = 0x000D // SCMOperation only
	ProfinetSecOpEAP             ProfinetSecurityOperation = 0x0100 // SAMOperation only
)

Security operations.

func (ProfinetSecurityOperation) String

func (o ProfinetSecurityOperation) String() string

String returns the operation name used by Wireshark.

type ProfinetSecurityParams

type ProfinetSecurityParams struct {
	// Get Security Capabilities response: bit 0 of Features is key pair
	// generation in a SecurityResponse and validity period checking in
	// an SCM response.
	Features     uint16
	Capabilities []ProfinetSecurityCapability

	// Certificates holds the DER certificates of a certification path or
	// the one trusted CA certificate, opaque.
	Certificates [][]byte

	// CSR is the certification request information of a Generate Key
	// Pair And CSR request, or the request its response returns, opaque.
	// The request carries no length: it runs to the end of the block,
	// padding included.
	CSR []byte

	// Data holds what follows an operation with no known parameters.
	Data []byte
}

ProfinetSecurityParams holds what both security services carry behind the operation and its identifier.

type ProfinetSecurityService

type ProfinetSecurityService struct {
	Operation    ProfinetSecurityOperation
	CredentialID ProfinetCredentialID   // requests of the operations 4 to 11
	Config       ProfinetSecurityConfig // Get and Set Security Configuration
	Credentials  []ProfinetCredentialID // Get Available CredentialIDs response
	ProfinetSecurityParams
}

ProfinetSecurityService is the body of SecurityRequestBlock and SecurityResponse.

type ProfinetSubframe

type ProfinetSubframe struct {
	Position     uint8 // bits 0-6 of the position byte
	CRCFlag      bool  // bit 7 of the position byte: the CRC is checked
	DataLength   uint8
	CycleCounter uint8
	DataStatus   ProfinetDataStatus
	Data         []byte
	CRC          uint16 // SFCRC16, zero when not used
}

ProfinetSubframe is one DFP subframe.

type ProfinetSubframeBlock

type ProfinetSubframeBlock struct {
	FrameID          ProfinetFrameID
	SFIOCRProperties uint32
	SubframeData     []ProfinetSubframeData
}

ProfinetSubframeBlock is the body of a SubframeBlock of PDIRSubframeData: the layout of one dynamic frame packing frame.

type ProfinetSubframeData

type ProfinetSubframeData uint32

ProfinetSubframeData places one subframe in a dynamic frame packing frame.

func (ProfinetSubframeData) DataLength

func (d ProfinetSubframeData) DataLength() uint8

DataLength returns the length of the subframe data (bits 8-15).

func (ProfinetSubframeData) Position

func (d ProfinetSubframeData) Position() uint8

Position returns the number of the subframe in the frame (bits 0-6).

type ProfinetSubmoduleList

type ProfinetSubmoduleList struct {
	Entries []ProfinetSubmoduleRef
}

ProfinetSubmoduleList is the body of SubmoduleListBlock: the submodules a PrmBegin applies to.

type ProfinetSubmoduleProperties

type ProfinetSubmoduleProperties uint16

ProfinetSubmoduleProperties is SubmoduleProperties of an expected submodule.

func (ProfinetSubmoduleProperties) DiscardIOXS

func (p ProfinetSubmoduleProperties) DiscardIOXS() bool

DiscardIOXS reports whether the IOxS bytes are left out of the frame.

func (ProfinetSubmoduleProperties) ReduceInputLength

func (p ProfinetSubmoduleProperties) ReduceInputLength() bool

ReduceInputLength reports ReduceInputSubmoduleDataLength: the input data length is zero.

func (ProfinetSubmoduleProperties) ReduceOutputLength

func (p ProfinetSubmoduleProperties) ReduceOutputLength() bool

ReduceOutputLength reports ReduceOutputSubmoduleDataLength.

func (ProfinetSubmoduleProperties) SharedInput

func (p ProfinetSubmoduleProperties) SharedInput() bool

SharedInput reports whether the input is shared with other controllers.

func (ProfinetSubmoduleProperties) Type

Type returns bits 0-1: 0 no IO data, 1 input, 2 output, 3 input and output.

type ProfinetSubmoduleRef

type ProfinetSubmoduleRef struct {
	API     uint32
	Slot    uint16
	Subslot uint16
}

ProfinetSubmoduleRef addresses one submodule.

type ProfinetSubmoduleState

type ProfinetSubmoduleState uint16

ProfinetSubmoduleState is the SubmoduleState of a ModuleDiffBlock. The accessors read the current coding, which FormatIndicator marks.

func (ProfinetSubmoduleState) ARInfo

func (s ProfinetSubmoduleState) ARInfo() uint8

ARInfo returns bits 7-10: 0 own, 1 application ready pending, 2 superordinated locked, 3 locked by IO controller, 4 locked by IO supervisor.

func (ProfinetSubmoduleState) AddInfo

func (s ProfinetSubmoduleState) AddInfo() uint8

AddInfo returns bits 0-2: 1 takeover is not allowed.

func (ProfinetSubmoduleState) Advice

func (s ProfinetSubmoduleState) Advice() bool

Advice reports whether an advice is available (bit 3).

func (ProfinetSubmoduleState) Fault

func (s ProfinetSubmoduleState) Fault() bool

Fault reports whether a diagnosis of severity fault is pending (bit 6).

func (ProfinetSubmoduleState) FormatIndicator

func (s ProfinetSubmoduleState) FormatIndicator() bool

FormatIndicator reports whether the state uses the coding with IdentInfo and ARInfo (bit 15); the accessors below are valid then.

func (ProfinetSubmoduleState) IdentInfo

func (s ProfinetSubmoduleState) IdentInfo() uint8

IdentInfo returns bits 11-14: 0 ok, 1 substitute, 2 wrong, 3 no submodule.

func (ProfinetSubmoduleState) MaintenanceDemanded

func (s ProfinetSubmoduleState) MaintenanceDemanded() bool

MaintenanceDemanded reports bit 5.

func (ProfinetSubmoduleState) MaintenanceRequired

func (s ProfinetSubmoduleState) MaintenanceRequired() bool

MaintenanceRequired reports bit 4.

type ProfinetSubslot

type ProfinetSubslot struct {
	Slot    uint16
	Subslot uint16
}

ProfinetSubslot is the head of the containers that address one submodule: PDPortDataCheck, PDPortDataAdjust, PDPortDataRealExtended and PDIRData.

type ProfinetSubstituteValue

type ProfinetSubstituteValue struct {
	Mode uint16 // SubstitutionMode: 0 zero, 1 last value, 2 replacement value
	IOCS ProfinetIOxS
	Data []byte
}

ProfinetSubstituteValue is the body of SubstituteValue: what an output submodule applies when its controller is gone.

Data is the SubstituteDataObjectElement: the substitute values and, last, SubstituteDataValid, coded like an IOPS.

func (*ProfinetSubstituteValue) DataValid

func (s *ProfinetSubstituteValue) DataValid() ProfinetIOxS

DataValid returns SubstituteDataValid, the last byte of Data.

type ProfinetTagHeader

type ProfinetTagHeader uint16

ProfinetTagHeader is an IOCRTagHeader or an AlarmCRTagHeader: the VLAN tag the frames of the CR carry.

func (ProfinetTagHeader) UserPriority

func (t ProfinetTagHeader) UserPriority() uint8

UserPriority returns the IEEE 802.1Q priority (bits 13-15): 6 for IO and high priority alarms, 5 for low priority alarms.

func (ProfinetTagHeader) VLANID

func (t ProfinetTagHeader) VLANID() uint16

VLANID returns the VLAN ID (bits 0-11); 0 means no VLAN.

type ProfinetUSI

type ProfinetUSI uint16

ProfinetUSI is the UserStructureIdentifier that opens each alarm item.

const (
	ProfinetUSIChannelDiagnosis    ProfinetUSI = 0x8000
	ProfinetUSIMultiple            ProfinetUSI = 0x8001
	ProfinetUSIExtChannelDiagnosis ProfinetUSI = 0x8002
	ProfinetUSIQualifiedDiagnosis  ProfinetUSI = 0x8003
	ProfinetUSIMaintenance         ProfinetUSI = 0x8100
	ProfinetUSIUploadRetrieval     ProfinetUSI = 0x8200
	ProfinetUSIIParameter          ProfinetUSI = 0x8201
	ProfinetUSIRSLowWatermark      ProfinetUSI = 0x8300
	ProfinetUSIRSTimeout           ProfinetUSI = 0x8301
	ProfinetUSIRSOverflow          ProfinetUSI = 0x8302
	ProfinetUSIRSEvent             ProfinetUSI = 0x8303
	ProfinetUSIPEEnergySaving      ProfinetUSI = 0x8310
	ProfinetUSIPRAL                ProfinetUSI = 0x8320
)

User structure identifiers. Values below 0x8000 are manufacturer specific.

func (ProfinetUSI) IsManufacturer

func (u ProfinetUSI) IsManufacturer() bool

IsManufacturer reports whether the item is manufacturer specific data.

func (ProfinetUSI) String

func (u ProfinetUSI) String() string

String returns the identifier name used by Wireshark.

type ProfinetUUID

type ProfinetUUID [profinetUUIDLen]byte

ProfinetUUID is a UUID in its canonical (big-endian) byte order.

func (ProfinetUUID) ConfigID

func (u ProfinetUUID) ConfigID() []byte

ConfigID returns ARUUID.ConfigID of a system redundancy AR.

func (ProfinetUUID) Discriminator

func (u ProfinetUUID) Discriminator() []byte

Discriminator returns ARUUID.Discriminator of a system redundancy AR.

func (ProfinetUUID) IsZero

func (u ProfinetUUID) IsZero() bool

IsZero reports whether the UUID is the nil UUID.

func (ProfinetUUID) Selector

func (u ProfinetUUID) Selector() ProfinetARSelector

Selector returns ARUUID.Selector of a system redundancy AR.

func (ProfinetUUID) String

func (u ProfinetUUID) String() string

String formats the UUID as 8-4-4-4-12 hex digits, as Wireshark does.

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
	// Multiple segments of the defined RadioTap fields can be present, if the extension bit and RadioTap namespace bit are both set.
	RadioTapValues []RadioTapNamespace
	// Multiple segments of fields defined by the hardware vendor of the packet sending hardware can be included, if the extension bit and vendor namespace bit are both set.
	VendorValues []VendorNamespace
}

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 (status RadioTapAMPDUStatus) String() string

type RadioTapAMPDUStatusFlags

type RadioTapAMPDUStatusFlags uint16
const (
	RadioTapAMPDUStatusFlagsReportZerolen RadioTapAMPDUStatusFlags = 1 << iota
	RadioTapAMPDUIsZerolen
	RadioTapAMPDULastKnown
	RadioTapAMPDUIsLast
	RadioTapAMPDUDelimCRCErr
	RadioTapAMPDUDelimCRCKnown
)

func (RadioTapAMPDUStatusFlags) DelimCRCErr

func (flags RadioTapAMPDUStatusFlags) DelimCRCErr() bool

func (RadioTapAMPDUStatusFlags) DelimCRCKnown

func (flags RadioTapAMPDUStatusFlags) DelimCRCKnown() bool

func (RadioTapAMPDUStatusFlags) IsLast

func (flags RadioTapAMPDUStatusFlags) IsLast() bool

func (RadioTapAMPDUStatusFlags) IsZerolen

func (flags RadioTapAMPDUStatusFlags) IsZerolen() bool

func (RadioTapAMPDUStatusFlags) LastKnown

func (flags RadioTapAMPDUStatusFlags) LastKnown() bool

func (RadioTapAMPDUStatusFlags) ReportZerolen

func (flags 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 (mcs RadioTapMCS) String() string

type RadioTapMCSFlags

type RadioTapMCSFlags uint8

func (RadioTapMCSFlags) Bandwidth

func (flags RadioTapMCSFlags) Bandwidth() int

func (RadioTapMCSFlags) FECLDPC

func (flags RadioTapMCSFlags) FECLDPC() bool

func (RadioTapMCSFlags) Greenfield

func (flags RadioTapMCSFlags) Greenfield() bool

func (RadioTapMCSFlags) NESS0

func (flags RadioTapMCSFlags) NESS0() bool

func (RadioTapMCSFlags) STBC

func (flags RadioTapMCSFlags) STBC() int

func (RadioTapMCSFlags) ShortGI

func (flags RadioTapMCSFlags) ShortGI() bool

type RadioTapMCSKnown

type RadioTapMCSKnown uint8
const (
	RadioTapMCSKnownBandwidth RadioTapMCSKnown = 1 << iota
	RadioTapMCSKnownMCSIndex
	RadioTapMCSKnownGuardInterval
	RadioTapMCSKnownHTFormat
	RadioTapMCSKnownFECType
	RadioTapMCSKnownSTBC
	RadioTapMCSKnownNESS
	RadioTapMCSKnownNESS1
)

func (RadioTapMCSKnown) Bandwidth

func (known RadioTapMCSKnown) Bandwidth() bool

func (RadioTapMCSKnown) FECType

func (known RadioTapMCSKnown) FECType() bool

func (RadioTapMCSKnown) GuardInterval

func (known RadioTapMCSKnown) GuardInterval() bool

func (RadioTapMCSKnown) HTFormat

func (known RadioTapMCSKnown) HTFormat() bool

func (RadioTapMCSKnown) MCSIndex

func (known RadioTapMCSKnown) MCSIndex() bool

func (RadioTapMCSKnown) NESS

func (known RadioTapMCSKnown) NESS() bool

func (RadioTapMCSKnown) NESS1

func (known RadioTapMCSKnown) NESS1() bool

func (RadioTapMCSKnown) STBC

func (known RadioTapMCSKnown) STBC() bool

type RadioTapNamespace added in v1.4.0

type RadioTapNamespace struct {
	// 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
	HE          RadiotapHE
}

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
	RadioTapPresentTimestamp
	RadioTapPresentHE
	RadioTapPresentHEMU
	RadioTapPresentHEUOtherUser
	RadioTapPresentZeroLengthPSDU
	RadioTapPresentLSIG
	RadioTapPresentTLVFields
	RadioTapPresentRadioTapNamespace
	RadioTapPresentVendorNamespace
	RadioTapPresentEXT
)

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) HE added in v1.3.0

func (r RadioTapPresent) HE() bool

func (RadioTapPresent) HEMU added in v1.3.0

func (r RadioTapPresent) HEMU() bool

func (RadioTapPresent) HEUOtherUser added in v1.3.0

func (r RadioTapPresent) HEUOtherUser() bool

func (RadioTapPresent) LSIG added in v1.4.0

func (r RadioTapPresent) LSIG() bool

func (RadioTapPresent) LockQuality

func (r RadioTapPresent) LockQuality() bool

func (RadioTapPresent) MCS

func (r RadioTapPresent) MCS() bool

func (RadioTapPresent) RadioTapNamespace added in v1.4.0

func (r RadioTapPresent) RadioTapNamespace() 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) TLVFields added in v1.4.0

func (r RadioTapPresent) TLVFields() bool

func (RadioTapPresent) TSFT

func (r RadioTapPresent) TSFT() bool

func (RadioTapPresent) Timestamp added in v1.3.0

func (r RadioTapPresent) Timestamp() 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

func (RadioTapPresent) VendorNamespace added in v1.4.0

func (r RadioTapPresent) VendorNamespace() bool

func (RadioTapPresent) ZeroLengthPSDU added in v1.4.0

func (r RadioTapPresent) ZeroLengthPSDU() 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 (f RadioTapRxFlags) BadPlcp() bool

func (RadioTapRxFlags) String

func (f RadioTapRxFlags) String() string

type RadioTapTxFlags

type RadioTapTxFlags uint16
const (
	RadioTapTxFlagsFail RadioTapTxFlags = 1 << iota
	RadioTapTxFlagsCTS
	RadioTapTxFlagsRTS
	RadioTapTxFlagsNoACK
)

func (RadioTapTxFlags) CTS

func (f RadioTapTxFlags) CTS() bool

func (RadioTapTxFlags) Fail

func (f RadioTapTxFlags) Fail() bool

func (RadioTapTxFlags) NoACK

func (f RadioTapTxFlags) NoACK() bool

func (RadioTapTxFlags) RTS

func (f RadioTapTxFlags) RTS() bool

func (RadioTapTxFlags) String

func (f 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 (vht 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 RadiotapHE added in v1.3.0

type RadiotapHE struct {
	Data1 RadiotapHEData1
	Data2 RadiotapHEData2
	Data3 RadiotapHEData3
	Data4 RadiotapHEData4
	Data5 RadiotapHEData5
	Data6 RadiotapHEData6
}

func (RadiotapHE) String added in v1.3.0

func (self RadiotapHE) String() string

type RadiotapHECoding added in v1.3.0

type RadiotapHECoding bool
const (
	RadiotapHECodingBCC  RadiotapHECoding = false
	RadiotapHECodingLDPC RadiotapHECoding = true
)

type RadiotapHEData1 added in v1.3.0

type RadiotapHEData1 uint16
const (
	RadiotapHEData1_HE_PPDUFormatMask          RadiotapHEData1 = 0x0003
	RadiotapHEData1BSSColorKnown               RadiotapHEData1 = 0x0004
	RadiotapHEData1BeamChangeKnown             RadiotapHEData1 = 0x0008
	RadiotapHEData1ULDLKnown                   RadiotapHEData1 = 0x0010
	RadiotapHEData1DataMCSKnown                RadiotapHEData1 = 0x0020
	RadiotapHEData1DataDCMKnown                RadiotapHEData1 = 0x0040
	RadiotapHEData1CodingKnown                 RadiotapHEData1 = 0x0080
	RadiotapHEData1LDPCExtraSymbolSegmentKnown RadiotapHEData1 = 0x0100
	RadiotapHEData1STBCKnown                   RadiotapHEData1 = 0x0200
	RadiotapHEData1SpatialReuseKnown           RadiotapHEData1 = 0x0400
	RadiotapHEData1SpatialReuse1Known          RadiotapHEData1 = 0x0400
	RadiotapHEData1SpatialReuse2Known          RadiotapHEData1 = 0x0800
	RadiotapHEData1StaIDKnown                  RadiotapHEData1 = 0x8000
	RadiotapHEData1SpatialReuse3Known          RadiotapHEData1 = 0x1000
	RadiotapHEData1SpatialReuse4Known          RadiotapHEData1 = 0x2000
	RadiotapHEData1DataBWRUAllocationKnown     RadiotapHEData1 = 0x4000
	RadiotapHEData1DopplerKnown                RadiotapHEData1 = 0x8000
)

func (RadiotapHEData1) BSSColorKnown added in v1.3.0

func (self RadiotapHEData1) BSSColorKnown() bool

func (RadiotapHEData1) BeamChangeKnown added in v1.3.0

func (self RadiotapHEData1) BeamChangeKnown() bool

func (RadiotapHEData1) CodingKnown added in v1.3.0

func (self RadiotapHEData1) CodingKnown() bool

func (RadiotapHEData1) DataBWRUAllocationKnown added in v1.3.0

func (self RadiotapHEData1) DataBWRUAllocationKnown() bool

func (RadiotapHEData1) DataDCMKnown added in v1.3.0

func (self RadiotapHEData1) DataDCMKnown() bool

func (RadiotapHEData1) DataMCSKnown added in v1.3.0

func (self RadiotapHEData1) DataMCSKnown() bool

func (RadiotapHEData1) DopplerKnown added in v1.3.0

func (self RadiotapHEData1) DopplerKnown() bool

func (RadiotapHEData1) HE_PPDUFormat added in v1.3.0

func (self RadiotapHEData1) HE_PPDUFormat() RadiotapHePpduFormat

func (RadiotapHEData1) LDPCExtraSymbolSegmentKnown added in v1.3.0

func (self RadiotapHEData1) LDPCExtraSymbolSegmentKnown() bool

func (RadiotapHEData1) STBCKnown added in v1.3.0

func (self RadiotapHEData1) STBCKnown() bool

func (RadiotapHEData1) SpatialReuse1Known added in v1.3.0

func (self RadiotapHEData1) SpatialReuse1Known() bool

func (RadiotapHEData1) SpatialReuse2Known added in v1.3.0

func (self RadiotapHEData1) SpatialReuse2Known() bool

func (RadiotapHEData1) SpatialReuse3Known added in v1.3.0

func (self RadiotapHEData1) SpatialReuse3Known() bool

func (RadiotapHEData1) SpatialReuse4Known added in v1.3.0

func (self RadiotapHEData1) SpatialReuse4Known() bool

func (RadiotapHEData1) SpatialReuseKnown added in v1.3.0

func (self RadiotapHEData1) SpatialReuseKnown() bool

func (RadiotapHEData1) StaIDKnown added in v1.3.0

func (self RadiotapHEData1) StaIDKnown() bool

func (RadiotapHEData1) ULDLKnown added in v1.3.0

func (self RadiotapHEData1) ULDLKnown() bool

type RadiotapHEData2 added in v1.3.0

type RadiotapHEData2 uint16
const (
	RadiotapHEData2PriSec80MHzKnown         RadiotapHEData2 = 0x0001
	RadiotapHEData2GIKnown                  RadiotapHEData2 = 0x0002
	RadiotapHEData2NumLTFKnown              RadiotapHEData2 = 0x0004
	RadiotapHEData2PreFECPaddingFactorKnown RadiotapHEData2 = 0x0008
	RadiotapHEData2TxBFKnown                RadiotapHEData2 = 0x0010
	RadiotapHEData2PEDisambiguityKnown      RadiotapHEData2 = 0x0020
	RadiotapHEData2TXOPKnown                RadiotapHEData2 = 0x0040
	RadiotapHEData2MidamblePeriodicityKnown RadiotapHEData2 = 0x0080
	RadiotapHEData2RUAllocationOffset       RadiotapHEData2 = 0x3f00
	RadiotapHEData2RUAllocationOffsetKnown  RadiotapHEData2 = 0x4000
	RadiotapHEData2PriSec80MHz              RadiotapHEData2 = 0x8000
)

func (RadiotapHEData2) GIKnown added in v1.3.0

func (self RadiotapHEData2) GIKnown() bool

func (RadiotapHEData2) MidamblePeriodicityKnown added in v1.3.0

func (self RadiotapHEData2) MidamblePeriodicityKnown() bool

func (RadiotapHEData2) NumLTFKnown added in v1.3.0

func (self RadiotapHEData2) NumLTFKnown() bool

func (RadiotapHEData2) PEDisambiguityKnown added in v1.3.0

func (self RadiotapHEData2) PEDisambiguityKnown() bool

func (RadiotapHEData2) PreFECPaddingFactorKnown added in v1.3.0

func (self RadiotapHEData2) PreFECPaddingFactorKnown() bool

func (RadiotapHEData2) PriSec80MHz added in v1.3.0

func (self RadiotapHEData2) PriSec80MHz() bool

func (RadiotapHEData2) PriSec80MHzKnown added in v1.3.0

func (self RadiotapHEData2) PriSec80MHzKnown() bool

func (RadiotapHEData2) RUAllocationOffset added in v1.3.0

func (self RadiotapHEData2) RUAllocationOffset() int

func (RadiotapHEData2) RUAllocationOffsetKnown added in v1.3.0

func (self RadiotapHEData2) RUAllocationOffsetKnown() bool

func (RadiotapHEData2) TXOPKnown added in v1.3.0

func (self RadiotapHEData2) TXOPKnown() bool

func (RadiotapHEData2) TxBFKnown added in v1.3.0

func (self RadiotapHEData2) TxBFKnown() bool

type RadiotapHEData3 added in v1.3.0

type RadiotapHEData3 uint16
const (
	RadiotapHEData3BSSColorMask           RadiotapHEData3 = 0x003F
	RadiotapHEData3BeamChange             RadiotapHEData3 = 0x0040
	RadiotapHEData3ULDL                   RadiotapHEData3 = 0x0080
	RadiotapHEData3DataMCSMask            RadiotapHEData3 = 0x0F00
	RadiotapHEData3DataDCM                RadiotapHEData3 = 0x1000
	RadiotapHEData3Coding                 RadiotapHEData3 = 0x2000
	RadiotapHEData3LDPCEXtraSymbolSegment RadiotapHEData3 = 0x4000
	RadiotapHEData3STBC                   RadiotapHEData3 = 0x8000
)

func (RadiotapHEData3) BSSColor added in v1.3.0

func (self RadiotapHEData3) BSSColor() int

func (RadiotapHEData3) BeamChange added in v1.3.0

func (self RadiotapHEData3) BeamChange() bool

func (RadiotapHEData3) Coding added in v1.3.0

func (self RadiotapHEData3) Coding() RadiotapHECoding

func (RadiotapHEData3) DataDCM added in v1.3.0

func (self RadiotapHEData3) DataDCM() bool

func (RadiotapHEData3) DataMCS added in v1.3.0

func (self RadiotapHEData3) DataMCS() uint8

func (RadiotapHEData3) LDPCExtraSymbolSegment added in v1.3.0

func (self RadiotapHEData3) LDPCExtraSymbolSegment() bool

func (RadiotapHEData3) STBC added in v1.3.0

func (self RadiotapHEData3) STBC() bool

func (RadiotapHEData3) ULDL added in v1.3.0

func (self RadiotapHEData3) ULDL() bool

type RadiotapHEData4 added in v1.3.0

type RadiotapHEData4 uint16

type RadiotapHEData5 added in v1.3.0

type RadiotapHEData5 uint16
const (
	RadiotapHEData5DataBandwidthMask   RadiotapHEData5 = 0x000F
	RadiotapHEData5GI                  RadiotapHEData5 = 0x0030
	RadiotapHEData5LTFSize             RadiotapHEData5 = 0x00C0
	RadiotapHEData5NumLTFSymbols       RadiotapHEData5 = 0x0700
	RadiotapHEData5PreFECPaddingFactor RadiotapHEData5 = 0x3000
	RadiotapHEData5TxBF                RadiotapHEData5 = 0x4000
	RadiotapHEData5PEDisambiguity      RadiotapHEData5 = 0x8000
)

func (RadiotapHEData5) DataBandwidth added in v1.3.0

func (self RadiotapHEData5) DataBandwidth() DataBandwidth

func (RadiotapHEData5) Gi added in v1.3.0

func (self RadiotapHEData5) Gi() Gi

func (RadiotapHEData5) LTFSize added in v1.3.0

func (self RadiotapHEData5) LTFSize() LTF

func (RadiotapHEData5) NumLTFSymbols added in v1.3.0

func (self RadiotapHEData5) NumLTFSymbols() NLTF

func (RadiotapHEData5) PEDisambiguity added in v1.3.0

func (self RadiotapHEData5) PEDisambiguity() bool

func (RadiotapHEData5) PreFECPaddingFactor added in v1.3.0

func (self RadiotapHEData5) PreFECPaddingFactor() uint8

func (RadiotapHEData5) TxBF added in v1.3.0

func (self RadiotapHEData5) TxBF() bool

type RadiotapHEData6 added in v1.3.0

type RadiotapHEData6 uint16
const (
	RadiotapHEData6NSTS             RadiotapHEData6 = 0x000F
	RadiotapHEData6Doppler          RadiotapHEData6 = 0x0010
	RadiotapHEData6TXOP             RadiotapHEData6 = 0x7F00
	RadiotapHEData6MidamblePeriodic RadiotapHEData6 = 0x8000
)

func (RadiotapHEData6) Doppler added in v1.3.0

func (self RadiotapHEData6) Doppler() bool

func (RadiotapHEData6) MidamblePeriodicity added in v1.3.0

func (self RadiotapHEData6) MidamblePeriodicity() MidamblePeriodicity

func (RadiotapHEData6) NSTS added in v1.3.0

func (self RadiotapHEData6) NSTS() int

func (RadiotapHEData6) TXOP added in v1.3.0

func (self RadiotapHEData6) TXOP() int

type RadiotapHEPriSec80MHz added in v1.3.0

type RadiotapHEPriSec80MHz bool

type RadiotapHePpduFormat added in v1.3.0

type RadiotapHePpduFormat uint8
const (
	RadiotapHePpduFormatHE_SU RadiotapHePpduFormat = iota
	RadiotapHePpduFormatHE_EXT_SU
	RadiotapHePpduFormatHE_MU
	RadiotapHePpduFormatHE_TRIG
)

func (RadiotapHePpduFormat) String added in v1.3.0

func (self RadiotapHePpduFormat) String() string

type RemAddr added in v1.3.1

type RemAddr struct {
	BaseLayer
	AddrIDs []uint8
}

RemAddr contains the fields from the REMOVE_ADDR MPTCP Option

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 S7Comm

type S7Comm struct {
	BaseLayer
	ProtocolID   uint8
	ROSCTR       S7CommROSCTR
	RedundancyID uint16
	PDURef       uint16
	ParamLength  uint16
	DataLength   uint16
	ErrorClass   S7CommErrorClass // Ack, Ack_Data
	ErrorCode    uint8            // Ack, Ack_Data
	Function     S7CommFunction   // first parameter octet, if any
	ItemCount    uint8            // Read/Write Var, Userdata
	Params       []byte
	Data         []byte

	SetupComm    *S7CommSetupComm
	VarItems     []S7CommVarItem    // Read/Write Var job
	DataItems    []S7CommDataItem   // Read Var Ack_Data, Write Var job
	WriteResults []S7CommReturnCode // Write Var Ack_Data
	BlockControl *S7CommBlockControl
	PIService    *S7CommPIService
	Userdata     *S7CommUserdata
}

S7Comm is a Siemens S7comm PDU. Params and Data always hold the raw parameter and data parts; the decoded views below are set only for the message types and functions they belong to.

func (*S7Comm) CanDecode

func (s *S7Comm) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeS7Comm.

func (*S7Comm) DecodeFromBytes

func (s *S7Comm) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes an S7comm PDU from data.

func (*S7Comm) LayerType

func (s *S7Comm) LayerType() gopacket.LayerType

LayerType returns LayerTypeS7Comm.

func (*S7Comm) NextLayerType

func (s *S7Comm) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypePayload for octets after the PDU, else LayerTypeZero.

type S7CommAlarm

type S7CommAlarm struct {
	Time        time.Time
	Function    uint8
	ObjectCount uint8
	Objects     []S7CommAlarmObject
}

S7CommAlarm is an alarm message. Time is set for the indications that carry one and is zero if it is not a valid date.

type S7CommAlarmEntry

type S7CommAlarmEntry struct {
	Length      uint8
	AlarmType   S7CommAlarmType
	EventID     uint32
	EventState  uint8
	AckGoing    uint8
	AckComing   uint8
	Coming      time.Time
	ComingValue *S7CommDataItem
	Going       time.Time
	GoingValue  *S7CommDataItem
}

S7CommAlarmEntry is one pending alarm of a query response. The ALARM_S fields are set for that alarm type only; times are zero if not a valid date.

type S7CommAlarmObject

type S7CommAlarmObject struct {
	VarSpec    uint8
	Length     uint8
	SyntaxID   S7CommSyntaxID
	ValueCount uint8
	EventID    uint32 // ALARM syntaxes, or query by event ID
	EventState uint8  // ALARM_IND, NOTIFY_IND
	State      uint8  // ALARM_IND, NOTIFY_IND
	AckGoing   uint8  // ALARM_IND, ALARM_ACK, NOTIFY_IND
	AckComing  uint8  // ALARM_IND, ALARM_ACK, NOTIFY_IND
	// NOTIFY_IND only.
	EventGoing       uint8
	EventComing      uint8
	EventLastChanged uint8
	Values           []S7CommDataItem // associated values
	// ALARM_QUERYREQ only.
	QueryType S7CommAlarmQueryType
	AlarmType S7CommAlarmType // query by alarm type
	// Response objects carry only this.
	ReturnCode S7CommReturnCode
}

S7CommAlarmObject is one alarm message object. Signal state octets carry one bit per signal (bit 0 = signal 1).

type S7CommAlarmQuery

type S7CommAlarmQuery struct {
	Function       uint8
	ObjectCount    uint8
	ReturnCode     S7CommReturnCode
	TransportSize  S7CommDataTransportSize
	CompleteLength uint16
	Alarms         []S7CommAlarmEntry
}

S7CommAlarmQuery is an alarm query response.

type S7CommAlarmQueryType

type S7CommAlarmQueryType uint8

S7CommAlarmQueryType selects what an alarm query asks for.

const (
	S7CommQueryByAlarmType S7CommAlarmQueryType = 1
	S7CommQueryByEventID   S7CommAlarmQueryType = 3
)

Alarm query types.

type S7CommAlarmType

type S7CommAlarmType uint8

S7CommAlarmType is the alarm type of an alarm query.

const (
	S7CommAlarmTypeScan   S7CommAlarmType = 1
	S7CommAlarmTypeAlarm8 S7CommAlarmType = 2
	S7CommAlarmTypeAlarmS S7CommAlarmType = 4
)

Alarm types.

type S7CommArea

type S7CommArea uint8

S7CommArea is the memory area of an S7ANY address.

const (
	S7CommAreaSysInfo200   S7CommArea = 0x03
	S7CommAreaSysFlags200  S7CommArea = 0x05
	S7CommAreaAnaIn200     S7CommArea = 0x06
	S7CommAreaAnaOut200    S7CommArea = 0x07
	S7CommAreaCounter      S7CommArea = 0x1C
	S7CommAreaTimer        S7CommArea = 0x1D
	S7CommAreaIECCounter   S7CommArea = 0x1E
	S7CommAreaIECTimer     S7CommArea = 0x1F
	S7CommAreaPeripheral   S7CommArea = 0x80
	S7CommAreaInputs       S7CommArea = 0x81
	S7CommAreaOutputs      S7CommArea = 0x82
	S7CommAreaFlags        S7CommArea = 0x83
	S7CommAreaDataBlocks   S7CommArea = 0x84
	S7CommAreaInstanceDB   S7CommArea = 0x85
	S7CommAreaLocal        S7CommArea = 0x86
	S7CommAreaPreviousLocl S7CommArea = 0x87
)

S7ANY memory areas.

func (S7CommArea) String

func (a S7CommArea) String() string

String returns a human-readable name of the area.

type S7CommBlockControl

type S7CommBlockControl struct {
	FunctionStatus uint8
	ErrorCode      uint16 // Download ended and End upload; reserved otherwise
	UploadID       uint32
	Filename       string // e.g. "_0A00001P": file ID, block type, number, filesystem
	LoadMemLength  string // ASCII digits
	MC7Length      string // ASCII digits
	BlockLength    string // ASCII digits
	DataLength     uint16
	DataUnknown    uint16
	BlockData      []byte
}

S7CommBlockControl holds the parameter (and data, where present) of the download and upload functions. Which fields are set depends on the function and direction:

Job: FunctionStatus, ErrorCode, UploadID, Filename (not Upload,
     End upload); LoadMemLength, MC7Length (Request download)
Ack_Data: FunctionStatus; UploadID, BlockLength (Start upload);
     DataLength, DataUnknown, BlockData (Download block, Upload)

type S7CommBlockCount

type S7CommBlockCount struct {
	Type  S7CommBlockType
	Count uint16
}

S7CommBlockCount is one entry of a list blocks response.

type S7CommBlockEntry

type S7CommBlockEntry struct {
	Number   uint16
	Flags    uint8
	Language S7CommBlockLang
}

S7CommBlockEntry is one entry of a list blocks of type response.

type S7CommBlockInfo

type S7CommBlockInfo struct {
	Head            uint16 // "block type" in Wireshark; 0x0100 seen
	InfoLength      uint16
	Unknown2        uint16
	Const3          string // "pp"
	Unknown         uint8
	Flags           uint8 // 0x01 linked, 0x02 standard block, 0x08 non-retain
	Language        S7CommBlockLang
	SubblockType    S7CommSubblockType
	Number          uint16
	LoadMemLength   uint32
	Security        S7CommBlockSecurity
	CodeTime        time.Time
	InterfaceTime   time.Time
	SSBLength       uint16
	AddLength       uint16
	LocalDataLength uint16
	MC7Length       uint16
	Author          string
	Family          string
	Name            string
	Version         uint8 // major << 4 | minor
	Unknown3        uint8
	Checksum        uint16
	Reserved1       uint32
	Reserved2       uint32
}

S7CommBlockInfo is a get block info response. Times are UTC.

func (*S7CommBlockInfo) VersionString

func (b *S7CommBlockInfo) VersionString() string

VersionString returns the header version as "major.minor".

type S7CommBlockLang

type S7CommBlockLang uint8

S7CommBlockLang is the programming language of a block.

const (
	S7CommLangUndefined S7CommBlockLang = 0x00
	S7CommLangAWL       S7CommBlockLang = 0x01
	S7CommLangKOP       S7CommBlockLang = 0x02
	S7CommLangFUP       S7CommBlockLang = 0x03
	S7CommLangSCL       S7CommBlockLang = 0x04
	S7CommLangDB        S7CommBlockLang = 0x05
	S7CommLangGRAPH     S7CommBlockLang = 0x06
	S7CommLangSDB       S7CommBlockLang = 0x07
	S7CommLangCPUDB     S7CommBlockLang = 0x08
	S7CommLangSDBReset  S7CommBlockLang = 0x11
	S7CommLangSDBRoute  S7CommBlockLang = 0x12
	S7CommLangEncrypted S7CommBlockLang = 0x29
)

S7 block languages.

func (S7CommBlockLang) String

func (l S7CommBlockLang) String() string

String returns the Wireshark name of the block language.

type S7CommBlockSecurity

type S7CommBlockSecurity uint32

S7CommBlockSecurity is the block protection of block info.

const (
	S7CommSecurityNone    S7CommBlockSecurity = 0
	S7CommSecurityKnowHow S7CommBlockSecurity = 3
)

Block protection values.

type S7CommBlockType

type S7CommBlockType uint16

S7CommBlockType is a block type as its two ASCII octets ("08" is OB).

const (
	S7CommBlockOB  S7CommBlockType = 0x3038
	S7CommBlockDB  S7CommBlockType = 0x3041
	S7CommBlockSDB S7CommBlockType = 0x3042
	S7CommBlockFC  S7CommBlockType = 0x3043
	S7CommBlockSFC S7CommBlockType = 0x3044
	S7CommBlockFB  S7CommBlockType = 0x3045
	S7CommBlockSFB S7CommBlockType = 0x3046
)

S7 block types.

func (S7CommBlockType) String

func (b S7CommBlockType) String() string

String returns the block type name.

type S7CommCycleTimebase

type S7CommCycleTimebase uint8

S7CommCycleTimebase is the unit of the cyclic interval factor.

const (
	S7CommTimebase100ms S7CommCycleTimebase = 0
	S7CommTimebase1s    S7CommCycleTimebase = 1
	S7CommTimebase10s   S7CommCycleTimebase = 2
)

Cyclic interval timebases.

func (S7CommCycleTimebase) Duration

func (t S7CommCycleTimebase) Duration() time.Duration

Duration returns the timebase unit, or 0 when unknown.

type S7CommCyclic

type S7CommCyclic struct {
	Reserved  uint8
	ItemCount uint8
	Timebase  S7CommCycleTimebase
	Factor    uint8
	Items     []S7CommVarItem
	Values    []S7CommDataItem
	Function  uint8 // unsubscribe request
	JobID     uint8 // unsubscribe request

	Record *S7CommReadRecord // read record
}

S7CommCyclic is a cyclic data subscription, push or unsubscribe. Items holds request addresses, or the NCK addresses some responses carry instead of values; Values holds the pushed data.

func (*S7CommCyclic) Interval

func (c *S7CommCyclic) Interval() time.Duration

Interval returns the requested cycle time, or 0 when the timebase is unknown.

type S7CommDBReadArea

type S7CommDBReadArea struct {
	Length   uint8
	DBNumber uint16
	Start    uint16 // byte address
}

S7CommDBReadArea is one area of a DBREAD address.

type S7CommDataItem

type S7CommDataItem struct {
	ReturnCode    S7CommReturnCode
	TransportSize S7CommDataTransportSize
	Length        uint16
	Data          []byte
}

S7CommDataItem is one data item of a Read Var response or a Write Var request. Length is the wire value, in bits or octets per TransportSize; Data excludes the fill octet after odd-sized items.

type S7CommDataTransportSize

type S7CommDataTransportSize uint8

S7CommDataTransportSize is the transport size of a data item, which also says whether its length counts bits or octets.

const (
	S7CommDataTSNull     S7CommDataTransportSize = 0x00
	S7CommDataTSBit      S7CommDataTransportSize = 0x03
	S7CommDataTSByte     S7CommDataTransportSize = 0x04 // BYTE/WORD/DWORD
	S7CommDataTSInt      S7CommDataTransportSize = 0x05
	S7CommDataTSDInt     S7CommDataTransportSize = 0x06
	S7CommDataTSReal     S7CommDataTransportSize = 0x07
	S7CommDataTSOctetStr S7CommDataTransportSize = 0x09
)

S7comm data item transport sizes.

func (S7CommDataTransportSize) ByteLength

func (t S7CommDataTransportSize) ByteLength(length uint16) int

ByteLength converts a data item length field to octets: BIT, BYTE and INTEGER count bits, rounded up to whole octets; others count octets.

func (S7CommDataTransportSize) String

func (t S7CommDataTransportSize) String() string

String returns a human-readable name of the transport size.

type S7CommDiagMessage

type S7CommDiagMessage struct {
	EventID       uint16
	PriorityClass uint8
	OBNumber      uint8
	DatID         uint16
	Info1         uint16
	Info2         uint32
	Time          time.Time
}

S7CommDiagMessage is a CPU diagnostic buffer entry. Time is zero if it is not a valid date.

type S7CommDriveESAddress

type S7CommDriveESAddress struct {
	Unknown1  uint8
	Unknown2  uint16
	Unknown3  uint16
	Parameter uint16
	Index     uint16
}

S7CommDriveESAddress addresses a drive parameter routed through the PLC (Drive ES).

type S7CommErrorClass

type S7CommErrorClass uint8

S7CommErrorClass is the error class of an Ack or Ack_Data header.

const (
	S7CommErrClassNone        S7CommErrorClass = 0x00
	S7CommErrClassAppRelation S7CommErrorClass = 0x81
	S7CommErrClassObjectDef   S7CommErrorClass = 0x82
	S7CommErrClassNoResources S7CommErrorClass = 0x83
	S7CommErrClassService     S7CommErrorClass = 0x84
	S7CommErrClassSupplies    S7CommErrorClass = 0x85
	S7CommErrClassAccess      S7CommErrorClass = 0x87
)

S7comm header error classes.

func (S7CommErrorClass) String

func (e S7CommErrorClass) String() string

String returns a human-readable name of the error class.

type S7CommField

type S7CommField struct {
	Name  string
	Kind  S7CommFieldKind
	Value uint32 // S7CommFieldUint
	Text  string // S7CommFieldText, up to the first NUL
	Raw   []byte
}

S7CommField is one named field of a record. Raw holds the octets of the field, aliasing the packet data.

func (S7CommField) String

func (f S7CommField) String() string

String returns the field as "name=value".

type S7CommFieldKind

type S7CommFieldKind uint8

S7CommFieldKind says which value of an S7CommField is set.

const (
	S7CommFieldUint  S7CommFieldKind = iota // Value
	S7CommFieldText                         // Text
	S7CommFieldBytes                        // Raw only
)

Field kinds.

type S7CommFuncGroup

type S7CommFuncGroup uint8

S7CommFuncGroup is the Userdata function group.

const (
	S7CommGroupModeTransition S7CommFuncGroup = 0x0
	S7CommGroupProgrammer     S7CommFuncGroup = 0x1
	S7CommGroupCyclicData     S7CommFuncGroup = 0x2
	S7CommGroupBlock          S7CommFuncGroup = 0x3
	S7CommGroupCPU            S7CommFuncGroup = 0x4
	S7CommGroupSecurity       S7CommFuncGroup = 0x5
	S7CommGroupPBC            S7CommFuncGroup = 0x6
	S7CommGroupTime           S7CommFuncGroup = 0x7
	S7CommGroupDRR            S7CommFuncGroup = 0x20
	S7CommGroupNCProgramming  S7CommFuncGroup = 0x3F
)

S7comm Userdata function groups.

func (S7CommFuncGroup) String

func (g S7CommFuncGroup) String() string

String returns the Wireshark name of the function group.

type S7CommFunction

type S7CommFunction uint8

S7CommFunction is the function code, the first parameter octet.

const (
	S7CommFuncCPUServices     S7CommFunction = 0x00
	S7CommFuncReadVar         S7CommFunction = 0x04
	S7CommFuncWriteVar        S7CommFunction = 0x05
	S7CommFuncRequestDownload S7CommFunction = 0x1A
	S7CommFuncDownloadBlock   S7CommFunction = 0x1B
	S7CommFuncDownloadEnded   S7CommFunction = 0x1C
	S7CommFuncStartUpload     S7CommFunction = 0x1D
	S7CommFuncUpload          S7CommFunction = 0x1E
	S7CommFuncEndUpload       S7CommFunction = 0x1F
	S7CommFuncPLCControl      S7CommFunction = 0x28 // PI service
	S7CommFuncPLCStop         S7CommFunction = 0x29
	S7CommFuncSetupComm       S7CommFunction = 0xF0
)

S7comm function codes.

func (S7CommFunction) String

func (f S7CommFunction) String() string

String returns a human-readable name of the function.

type S7CommMsgService

type S7CommMsgService struct {
	Events    uint8 // request: 0x01 mode, 0x02 system, 0x04 user, 0x80 alarm
	Username  string
	Result    uint8 // response
	AlarmType uint8
}

S7CommMsgService is a message service subscription request or its response. AlarmType is set when the request subscribes to ALARM messages or the response carries it.

type S7CommNCFile

type S7CommNCFile struct {
	UnackCount uint8
	Unknown    uint8
	Filename   string
	FileLength string // 8 ASCII characters; spaces for a directory
	FileTime   string // 16 ASCII characters
	FilePath   string // without its closing line feed
	FileData   []byte
	Rest       []byte // value, or its tail, without a known layout
}

S7CommNCFile is an NC programming value. Only the fields of the layout the subfunction and direction select are set.

type S7CommNCKAddress

type S7CommNCKAddress struct {
	Area      uint8 // 3 bits
	Unit      uint8 // 5 bits
	Column    uint16
	Line      uint16
	Module    uint8
	LineCount uint8
}

S7CommNCKAddress is a Sinumerik NCK variable address.

type S7CommPIBlock

type S7CommPIBlock struct {
	Type       S7CommBlockType
	Number     string // ASCII digits
	Filesystem uint8  // e.g. 'P' passive, 'A' active
}

S7CommPIBlock is one block a PI service activates or deletes.

type S7CommPIService

type S7CommPIService struct {
	Unknown     []byte
	ParamBlock  []byte
	ServiceName string // e.g. "_INSE", "P_PROGRAM"

	Blocks    []S7CommPIBlock // _INSE, _INS2, _DELE
	Args      []string        // P_PROGRAM, _MODU, _GARB, _N_* (file names...)
	DecodeErr error
}

S7CommPIService is the parameter of a PLC Control (PI service) or PLC Stop job. PLC Stop has no ParamBlock. ParamBlock is kept raw; Blocks and Args are its views for the services in s7comm_pi.go. DecodeErr records why they were not set; DecodeFromBytes does not return it.

type S7CommPlus

type S7CommPlus struct {
	BaseLayer
	ProtocolID uint8
	Version    S7CommPlusVersion
	DataLength uint16
	Integrity  []byte // V3: digest after its length octet, opaque

	HasDataHeader  bool
	Opcode         S7CommPlusOpcode
	Reserved1      uint16
	Function       S7CommPlusFunction
	Reserved2      uint16
	Sequence       uint16
	SessionID      uint32 // requests only
	TransportFlags uint8
	Data           []byte

	HasTrailer     bool
	TrailerVersion S7CommPlusVersion
	TrailerLength  uint16
}

S7CommPlus is one S7comm-plus frame. HasDataHeader tells whether the body started with a known opcode and the request or response header fields are set; Data holds the body after that header (or the whole body when HasDataHeader is false). Notifications keep their body raw in Data after Opcode.

func (*S7CommPlus) CanDecode

func (s *S7CommPlus) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeS7CommPlus.

func (*S7CommPlus) DecodeBody

func (s *S7CommPlus) DecodeBody() (*S7CommPlusBody, error)

DecodeBody decodes Data of a frame that holds a whole PDU: one with a data header and a trailer. Fragments of larger PDUs return ErrS7CommPlusFragment; join them with an S7CommPlusAssembler and decode the PDU it returns. On error the returned body, when not nil, holds the fields decoded so far.

func (*S7CommPlus) DecodeFromBytes

func (s *S7CommPlus) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes an S7comm-plus frame from data.

func (*S7CommPlus) DecodeSysEvent

func (s *S7CommPlus) DecodeSysEvent() (*S7CommPlusSysEvent, error)

DecodeSysEvent decodes Data of a frame with version S7CommPlusKeepAlive. Other versions return ErrS7CommPlusUnsupported.

func (*S7CommPlus) LayerType

func (s *S7CommPlus) LayerType() gopacket.LayerType

LayerType returns LayerTypeS7CommPlus.

func (*S7CommPlus) NextLayerType

func (s *S7CommPlus) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypePayload for octets after the frame, else LayerTypeZero.

func (*S7CommPlus) ReturnValue

func (s *S7CommPlus) ReturnValue() (uint64, error)

ReturnValue reads the VLQ return value most responses start their data with. It is a convenience: the item layout is function-specific and not validated here.

type S7CommPlusAddress

type S7CommPlusAddress struct {
	SymbolCRC     uint32
	AccessArea    uint32
	LIDCount      uint32
	AccessSubArea uint32
	LIDs          []uint32
}

S7CommPlusAddress is a variable address of Get/SetMultiVariables:

symbol CRC | access area | LID count | sub-area | LID...

LIDCount counts the sub-area and the LIDs. A DB area is 0x8A0E0000 plus the DB number; I, Q, M, C and T are 80 to 84. With CRC 0 such an address can use classic blob access: LIDs 3, start offset, byte count[, bit offset].

func (*S7CommPlusAddress) DBNumber

func (a *S7CommPlusAddress) DBNumber() (uint16, bool)

DBNumber returns the DB number of a DB access area.

type S7CommPlusAssembler

type S7CommPlusAssembler struct {
	// MaxSize caps the body and stream of a PDU in octets. Zero or less
	// means S7CommPlusDefaultMaxPDU.
	MaxSize int
	// contains filtered or unexported fields
}

S7CommPlusAssembler joins the frames of one direction of a connection into PDUs. The zero value is ready to use. It holds at most MaxSize octets and is not safe for concurrent use.

Frames must be fed in order; the protocol numbers PDUs, not frames, so a frame out of order cannot be told from one in order. Feed the S7comm-plus layer of every TPDU of the direction, after TCP reassembly.

func (*S7CommPlusAssembler) Feed

Feed takes the next frame of the direction. When s completes a PDU, Feed returns it; otherwise it returns nil.

A PDU that came in one frame aliases s. A joined PDU owns its Data and Stream. System events (version S7CommPlusKeepAlive) are whole by themselves and do not disturb an unfinished PDU.

A PDU above the size cap returns ErrS7CommPlusPDUTooLong once, and a frame without a data header where a first frame is due returns ErrS7CommPlusNoStart once; the frames up to the next trailer are then skipped.

func (*S7CommPlusAssembler) Pending

func (a *S7CommPlusAssembler) Pending() int

Pending returns the octets held for an unfinished PDU.

func (*S7CommPlusAssembler) Reset

func (a *S7CommPlusAssembler) Reset()

Reset drops an unfinished PDU.

type S7CommPlusBlob

type S7CommPlusBlob struct {
	RootID  uint32
	Unknown []byte
	Type    uint8
	Values  []S7CommPlusIDValue
}

S7CommPlusBlob is the extended BLOB form, announced by a root ID above 1: 8 unknown octets, a blob type, then raw octets (types 2 and 3, in the element's Bytes) or an ID/value list (type 0).

type S7CommPlusBody

type S7CommPlusBody struct {
	Return           S7CommPlusReturn
	Returns          []S7CommPlusReturn
	ObjectID         uint32
	ObjectIDs        []uint32
	ItemCount        uint32
	FieldCount       uint32
	Addresses        []S7CommPlusAddress
	IDs              []uint32
	Value            *S7CommPlusValue
	Values           []S7CommPlusIDValue
	Errors           []S7CommPlusItemError
	Elements         *S7CommPlusElements
	Explore          *S7CommPlusExplore
	Sequence         *S7CommPlusSequence
	Notification     *S7CommPlusNotification
	Qualifier        *S7CommPlusQualifier
	Stream           *S7CommPlusValue
	InnerIntegrityID uint32
	HasInnerID       bool
	IntegrityID      uint32
	HasIntegrityID   bool
	Digest           []byte
	Rest             []byte
}

S7CommPlusBody is the decoded body of an S7comm-plus PDU. Which fields are set depends on opcode and function:

Request
  CreateObject       ObjectID (request ID), Value, InnerIntegrityID, Elements
  DeleteObject       ObjectID
  SetVariable        ObjectID, ItemCount, IDs (an ID 0 is followed by a raw length), Value
  GetVariable        ObjectID (relation ID), ItemCount, IDs
  SetMultiVariables  ObjectID (0: by address), ItemCount, FieldCount, Addresses or IDs, Values
  GetMultiVariables  ObjectID (0, or a link ID), ItemCount, FieldCount, Addresses or IDs
  Get/SetVarSubStreamed Values (4-octet IDs), Stream (Set)
  Explore            ObjectID (area), Explore
  GetLink            IDs
  BeginSequence      Sequence, Elements
  Invoke             ObjectID (sub-session), Values
Response
  all                Return
  CreateObject       ObjectIDs, Elements (V1)
  DeleteObject       ObjectID, Elements (error extension)
  GetVariable        Value
  GetMultiVariables  Values, Errors
  SetMultiVariables  Errors
  GetVarSubStreamed  Value
  Explore            ObjectID, Explore, Elements
  GetLink            ObjectIDs (link IDs)
  BeginSequence      Sequence
  Invoke             Returns, Values
Notification         Notification

Unknown and fill octets the plugin does not name are skipped. Rest holds the octets after the integrity part, usually four zeros.

func DecodeS7CommPlusBody

func DecodeS7CommPlusBody(v S7CommPlusVersion, op S7CommPlusOpcode, fn S7CommPlusFunction, data []byte) (*S7CommPlusBody, error)

DecodeS7CommPlusBody decodes the body that follows a data header with the given version, opcode and function (ignored for notifications).

type S7CommPlusDatatype

type S7CommPlusDatatype uint8

S7CommPlusDatatype is the datatype of an S7comm-plus value.

const (
	S7CommPlusTypeNull      S7CommPlusDatatype = 0x00
	S7CommPlusTypeBool      S7CommPlusDatatype = 0x01
	S7CommPlusTypeUSInt     S7CommPlusDatatype = 0x02
	S7CommPlusTypeUInt      S7CommPlusDatatype = 0x03
	S7CommPlusTypeUDInt     S7CommPlusDatatype = 0x04 // VLQ
	S7CommPlusTypeULInt     S7CommPlusDatatype = 0x05 // VLQ
	S7CommPlusTypeSInt      S7CommPlusDatatype = 0x06
	S7CommPlusTypeInt       S7CommPlusDatatype = 0x07
	S7CommPlusTypeDInt      S7CommPlusDatatype = 0x08 // VLQ
	S7CommPlusTypeLInt      S7CommPlusDatatype = 0x09 // VLQ
	S7CommPlusTypeByte      S7CommPlusDatatype = 0x0A
	S7CommPlusTypeWord      S7CommPlusDatatype = 0x0B
	S7CommPlusTypeDWord     S7CommPlusDatatype = 0x0C
	S7CommPlusTypeLWord     S7CommPlusDatatype = 0x0D
	S7CommPlusTypeReal      S7CommPlusDatatype = 0x0E
	S7CommPlusTypeLReal     S7CommPlusDatatype = 0x0F
	S7CommPlusTypeTimestamp S7CommPlusDatatype = 0x10 // ns since 1970
	S7CommPlusTypeTimespan  S7CommPlusDatatype = 0x11 // ns, VLQ
	S7CommPlusTypeRID       S7CommPlusDatatype = 0x12
	S7CommPlusTypeAID       S7CommPlusDatatype = 0x13 // VLQ
	S7CommPlusTypeBlob      S7CommPlusDatatype = 0x14
	S7CommPlusTypeWString   S7CommPlusDatatype = 0x15 // UTF-8
	S7CommPlusTypeVariant   S7CommPlusDatatype = 0x16
	S7CommPlusTypeStruct    S7CommPlusDatatype = 0x17
	S7CommPlusTypeS7String  S7CommPlusDatatype = 0x19 // tag descriptions only
)

S7comm-plus datatypes.

func (S7CommPlusDatatype) String

func (d S7CommPlusDatatype) String() string

String returns the plugin's name of the datatype.

type S7CommPlusElement

type S7CommPlusElement struct {
	Type  S7CommPlusDatatype // the value's type; a VARIANT element's own
	Flags S7CommPlusTypeFlags
	Key   uint32 // sparse array key
	Bits  uint64
	Bytes []byte
	Blob  *S7CommPlusBlob // BLOB with root ID > 1
}

S7CommPlusElement is one element of a value; a scalar has one.

Bits holds every numeric type: unsigned integers and BYTE..LWORD as they are, signed integers and TIMESPAN sign-extended, REAL and LREAL as IEEE 754 bits, TIMESTAMP in ns since 1970, STRUCT and RID as their 32-bit ID. Bytes holds WSTRING text and BLOB content and aliases the frame.

func (*S7CommPlusElement) Duration

func (e *S7CommPlusElement) Duration() time.Duration

Duration returns a TIMESPAN element.

func (*S7CommPlusElement) Float

func (e *S7CommPlusElement) Float() float64

Float returns the value of a REAL or LREAL element.

func (*S7CommPlusElement) Int

func (e *S7CommPlusElement) Int() int64

Int returns the signed view of the element: Bits as two's complement for SINT, INT, DINT, LINT and TIMESPAN.

func (*S7CommPlusElement) Time

func (e *S7CommPlusElement) Time() time.Time

Time returns a TIMESTAMP element as a UTC time.

func (*S7CommPlusElement) Uint

func (e *S7CommPlusElement) Uint() uint64

Uint returns Bits, the unsigned view of the element.

type S7CommPlusElements

type S7CommPlusElements struct {
	Objects    []S7CommPlusObject
	Attributes []S7CommPlusIDValue
	Relations  []S7CommPlusRelation
	TagDescs   []S7CommPlusTagDesc
	VarTypes   []S7CommPlusVarType
	VarNames   []string
}

S7CommPlusElements are the elements of an object, or of a top-level element list, grouped by kind in wire order within each kind.

type S7CommPlusExplore

type S7CommPlusExplore struct {
	ExploreID         uint32
	ChildsRecursive   uint8
	Unknown3          uint8
	Parents           uint8
	Sets              []S7CommPlusExploreSet
	SequenceIntegrity uint32
	HasSeqIntegrity   bool
}

S7CommPlusExplore holds the Explore fields besides the area ID (the body's ObjectID): request filters, and the response's sequence integrity value (V3, and V2 from S7-1500s).

type S7CommPlusExploreSet

type S7CommPlusExploreSet struct {
	ObjectCount  uint8
	AddressCount uint8
	Datatype     S7CommPlusDatatype // set when ObjectCount > 0
	StructID     uint32             // Datatype STRUCT only
	Values       []S7CommPlusIDValue
	IDs          []uint32
}

S7CommPlusExploreSet is one object/address set of an Explore request.

type S7CommPlusFunction

type S7CommPlusFunction uint16

S7CommPlusFunction is the function code of a request or response.

const (
	S7CommPlusFuncError             S7CommPlusFunction = 0x04B1
	S7CommPlusFuncExplore           S7CommPlusFunction = 0x04BB
	S7CommPlusFuncCreateObject      S7CommPlusFunction = 0x04CA
	S7CommPlusFuncDeleteObject      S7CommPlusFunction = 0x04D4
	S7CommPlusFuncSetVariable       S7CommPlusFunction = 0x04F2
	S7CommPlusFuncGetVariable       S7CommPlusFunction = 0x04FC
	S7CommPlusFuncAddLink           S7CommPlusFunction = 0x0506
	S7CommPlusFuncRemoveLink        S7CommPlusFunction = 0x051A
	S7CommPlusFuncGetLink           S7CommPlusFunction = 0x0524
	S7CommPlusFuncSetMultiVariables S7CommPlusFunction = 0x0542
	S7CommPlusFuncGetMultiVariables S7CommPlusFunction = 0x054C
	S7CommPlusFuncBeginSequence     S7CommPlusFunction = 0x0556
	S7CommPlusFuncEndSequence       S7CommPlusFunction = 0x0560
	S7CommPlusFuncInvoke            S7CommPlusFunction = 0x056B
	S7CommPlusFuncSetVarSubStreamed S7CommPlusFunction = 0x057C
	S7CommPlusFuncGetVarSubStreamed S7CommPlusFunction = 0x0586
	S7CommPlusFuncGetVariablesAddr  S7CommPlusFunction = 0x0590
	S7CommPlusFuncAbort             S7CommPlusFunction = 0x059A
	S7CommPlusFuncError2            S7CommPlusFunction = 0x05A9
	S7CommPlusFuncInitSSL           S7CommPlusFunction = 0x05B3
)

S7comm-plus function codes.

func (S7CommPlusFunction) String

func (f S7CommPlusFunction) String() string

String returns the function name.

type S7CommPlusIDValue

type S7CommPlusIDValue struct {
	ID    uint32
	Value S7CommPlusValue
}

S7CommPlusIDValue is an ID (or item number) with its value.

type S7CommPlusItemError

type S7CommPlusItemError struct {
	Item   uint32
	Return S7CommPlusReturn
}

S7CommPlusItemError is one entry of a response's error list.

type S7CommPlusNotification

type S7CommPlusNotification struct {
	SubscriptionID  uint32
	Unknown2        uint16
	Unknown3        uint16
	Unknown4        uint16
	CreditTick      uint8
	Sequence        uint32
	ChangeCounter   uint8
	Timestamp       uint64 // µs since 1970, when HasTimestamp
	HasTimestamp    bool
	Items           []S7CommPlusNotifyItem
	SubscriptionID2 uint32
	Unknown5        uint16
	Items2          []S7CommPlusNotifyItem
	V1Unknown2      uint32
	V1Unknown3      uint32
	V1Unknown4      uint16
}

S7CommPlusNotification is the body of a notification. The sequence fields and value lists are present only when Unknown2 is 0x0400 (V2 and V3) or V1Unknown3 is not 0 (V1). Subscriptions below 0x70000000 count with a one-octet Sequence and no CreditTick; newer CPUs replace a zero change counter with a timestamp and a second counter.

func (*S7CommPlusNotification) Time

func (n *S7CommPlusNotification) Time() time.Time

Time returns Timestamp as a UTC time.

type S7CommPlusNotifyItem

type S7CommPlusNotifyItem struct {
	Code     uint8
	ItemRef  uint32
	Value    *S7CommPlusValue
	Elements *S7CommPlusElements
}

S7CommPlusNotifyItem is one item of a notification value list. Code selects the rest: 0x92 reference and value, 0x9B ID and value, 0x83 value, 0x81 objects, 0x9C reference, 0x13 and 0x03 the reference of an access error.

type S7CommPlusObject

type S7CommPlusObject struct {
	RelationID       uint32
	ClassID          uint32
	ClassFlags       uint32
	AttributeID      uint32
	AttributeIDFlags uint32
	S7CommPlusElements
}

S7CommPlusObject is an object (0xA1 ... 0xA2). AttributeIDFlags is on the wire only when AttributeID is not 0.

type S7CommPlusOpcode

type S7CommPlusOpcode uint8

S7CommPlusOpcode is the first octet of the data header.

const (
	S7CommPlusOpResponse2    S7CommPlusOpcode = 0x02
	S7CommPlusOpRequest      S7CommPlusOpcode = 0x31
	S7CommPlusOpResponse     S7CommPlusOpcode = 0x32
	S7CommPlusOpNotification S7CommPlusOpcode = 0x33
)

S7comm-plus opcodes.

func (S7CommPlusOpcode) String

func (o S7CommPlusOpcode) String() string

String returns a human-readable name of the opcode.

type S7CommPlusPDU

type S7CommPlusPDU struct {
	S7CommPlus

	// Frames counts the frames the PDU came in.
	Frames int

	// Stream holds the pieces a SetVarSubStreamed request sent after its
	// first frame, StreamTail what followed the last piece (integrity
	// part and fill). They are not part of Data.
	Stream     []byte
	StreamTail []byte
}

S7CommPlusPDU is a whole PDU: the header fields of its first frame, the trailer of its last, and in Data the joined body after the data header, which DecodeBody decodes.

type S7CommPlusPacked

type S7CommPlusPacked struct {
	InterfaceTimestamp uint64 // ns since 1970
	TransportFlags     uint32
	ElementCount       uint32 // octets in Data
	Data               []byte
}

S7CommPlusPacked is a packed STRUCT (struct IDs 0x02000001-0x02FFFFFE and 0x90000001-0x9FFFFFFE, DTL for example): its members are raw octets, not an ID/value list.

type S7CommPlusQualifier

type S7CommPlusQualifier struct {
	ID     uint32
	Values []S7CommPlusIDValue
}

S7CommPlusQualifier is the object qualifier after a variable access request.

type S7CommPlusRelation

type S7CommPlusRelation struct {
	RelationID uint32
	Unknown    uint32
}

S7CommPlusRelation is a relation element (0xA4).

type S7CommPlusReturn

type S7CommPlusReturn uint64

S7CommPlusReturn is a 64-bit return value of a response.

func (S7CommPlusReturn) ErrorCode

func (r S7CommPlusReturn) ErrorCode() int16

ErrorCode returns the signed error code in bits 0-15; 0 is success.

func (S7CommPlusReturn) ErrorSource

func (r S7CommPlusReturn) ErrorSource() uint8

ErrorSource returns bits 32-39.

func (S7CommPlusReturn) Extension

func (r S7CommPlusReturn) Extension() bool

Extension reports bit 62, the error extension: a DeleteObject response then carries an object.

func (S7CommPlusReturn) GenericError

func (r S7CommPlusReturn) GenericError() uint8

GenericError returns the generic error code in bits 40-46.

func (S7CommPlusReturn) OMSLine

func (r S7CommPlusReturn) OMSLine() uint16

OMSLine returns bits 16-31.

func (S7CommPlusReturn) ServerError

func (r S7CommPlusReturn) ServerError() bool

ServerError reports bit 47.

type S7CommPlusSequence

type S7CommPlusSequence struct {
	TransactionType uint8
	ValueType       uint16
	RequestID       uint32
}

S7CommPlusSequence holds the BeginSequence fields. V1 has only the transaction type, in the request.

type S7CommPlusSubscriptionRef

type S7CommPlusSubscriptionRef struct {
	Head      uint32
	RefNumber uint32
	Unknown   uint32
	Address   S7CommPlusAddress
}

S7CommPlusSubscriptionRef is one variable a subscription asks for. Notifications name it by RefNumber.

type S7CommPlusSubscriptionRefs

type S7CommPlusSubscriptionRefs struct {
	Header       uint32
	Unsubscribed []uint32
	Subscribed   []S7CommPlusSubscriptionRef

	// Rest holds array elements after the last subscription.
	Rest []uint32
}

S7CommPlusSubscriptionRefs is a decoded subscription reference list: the reference numbers to drop and the variables to add.

func (*S7CommPlusSubscriptionRefs) ChangeCounter

func (l *S7CommPlusSubscriptionRefs) ChangeCounter() uint8

ChangeCounter returns the subscription change counter.

func (*S7CommPlusSubscriptionRefs) New

New reports whether the list creates the subscription.

type S7CommPlusSysEvent

type S7CommPlusSysEvent struct {
	Reserved1 uint32

	// ConfirmedBytes counts the octets received since the last event.
	ConfirmedBytes uint32

	Reserved2 uint32
	Reserved3 uint32

	// Message is a text tail, Value a binary one. At most one is set.
	Message string
	Value   *S7CommPlusValue

	// Rest holds what follows Value.
	Rest []byte
}

S7CommPlusSysEvent is the body of a system event frame.

func DecodeS7CommPlusSysEvent

func DecodeS7CommPlusSysEvent(data []byte) (*S7CommPlusSysEvent, error)

DecodeS7CommPlusSysEvent decodes the body of a system event. On error the returned event, when not nil, holds the fields decoded so far.

type S7CommPlusTagDesc

type S7CommPlusTagDesc struct {
	OffsetInfoType uint8
	Name           string
	Unknown2       uint8
	Datatype       S7CommPlusDatatype
	SoftDatatype   uint32
	AttributeFlags uint32
	LID            uint32
	Length         uint32 // S7STRING length, struct relation ID or unknown
	Access         uint32
	Section        uint32
	OffsetType1    uint32
	OffsetType2    uint32
	BitOffset1     uint32
	BitOffset2     uint32
	Padding1       uint32
	Padding2       uint32
	LowerBounds    []int32
	ElementCounts  []uint32
	SFBInstOffset1 uint32
	SFBInstOffset2 uint32
}

S7CommPlusTagDesc is a tag description (0xA7) of old S7-1200 firmware. Which offset fields are set depends on OffsetInfoType: bit 0x04 or 0x08 adds Access and Section; kind 1 adds the bit offsets, kind 2 one array dimension, kind 3 padding and up to N dimensions; type 0x08 adds the SFB instance offsets.

type S7CommPlusTypeFlags

type S7CommPlusTypeFlags uint8

S7CommPlusTypeFlags is the datatype flags octet before a datatype.

const (
	S7CommPlusFlagArray        S7CommPlusTypeFlags = 0x10
	S7CommPlusFlagAddressArray S7CommPlusTypeFlags = 0x20
	S7CommPlusFlagSparseArray  S7CommPlusTypeFlags = 0x40
)

S7comm-plus datatype flags.

type S7CommPlusValue

type S7CommPlusValue struct {
	Flags       S7CommPlusTypeFlags
	Type        S7CommPlusDatatype
	Elements    []S7CommPlusElement
	Members     []S7CommPlusIDValue
	StructArray [][]S7CommPlusIDValue
	Packed      *S7CommPlusPacked
}

S7CommPlusValue is a typed value. Members holds the ID/value list of a STRUCT where the enclosing list carries one; StructArray holds an address array of structs, one member list per element.

func (*S7CommPlusValue) SubscriptionRefs

func (v *S7CommPlusValue) SubscriptionRefs() (*S7CommPlusSubscriptionRefs, error)

SubscriptionRefs decodes the value of attribute S7CommPlusIDSubscriptionRefs. Any other value, and a list whose counts exceed its array, returns ErrS7CommPlusMalformed.

type S7CommPlusVarOffsets

type S7CommPlusVarOffsets struct {
	// Addresses in the optimized and the non-optimized (classic)
	// layout: 16 bits wide for the standard types, else 32.
	OptimizedAddr    uint32
	NonOptimizedAddr uint32

	// The legacy pair of the other types. A STRING or WSTRING (also as
	// array element) has its maximum length in place of Unspecified1.
	StringLength uint16
	Unspecified1 uint16
	Unspecified2 uint16

	// FB and SFB instances.
	FBRelationID     uint32
	FBInfo           [s7plusInfoWords]uint32
	FBRetainOffset   uint32
	FBVolatileOffset uint32

	// Arrays. An FB array has an element count and three sizes.
	ArrayLowerBound   int32
	ArrayElementCount uint32
	FBClassicSize     uint32
	FBRetainSize      uint32
	FBVolatileSize    uint32

	// Multi-dimensional arrays; unused dimensions have count 0.
	DimLowerBounds   [s7plusMaxDims]int32
	DimElementCounts [s7plusMaxDims]uint32

	// Structs.
	NonOptimizedStructSize uint32
	OptimizedStructSize    uint32
	StructRelationID       uint32
	StructInfo             [s7plusInfoWords]uint32
}

S7CommPlusVarOffsets is the typed offset part of a type list entry. Sections the entry's offset info type does not have stay zero.

type S7CommPlusVarType

type S7CommPlusVarType struct {
	LID            uint32
	SymbolCRC      uint32
	SoftDatatype   uint8
	AttributeFlags uint16
	BitOffsetInfo  uint8
	OffsetInfo     []byte
}

S7CommPlusVarType is one entry of a variable type list (0xAB). OffsetInfo is the rest of the entry, whose layout follows the offset info type; its 16 and 32-bit words are little-endian.

func (*S7CommPlusVarType) OffsetInfoType

func (v *S7CommPlusVarType) OffsetInfoType() uint8

OffsetInfoType returns bits 12-15 of the attribute flags, which select the layout of OffsetInfo.

func (*S7CommPlusVarType) Offsets

Offsets splits OffsetInfo into its sections. It returns false when OffsetInfo does not have the size of the entry's offset info type, which a decoded entry always has.

type S7CommPlusVersion

type S7CommPlusVersion uint8

S7CommPlusVersion is the protocol version octet of the frame header.

const (
	S7CommPlusV1        S7CommPlusVersion = 0x01
	S7CommPlusV2        S7CommPlusVersion = 0x02
	S7CommPlusV3        S7CommPlusVersion = 0x03
	S7CommPlusKeepAlive S7CommPlusVersion = 0xFE // extended keep-alive
)

S7comm-plus protocol versions.

func (S7CommPlusVersion) String

func (v S7CommPlusVersion) String() string

String returns a human-readable name of the version.

type S7CommROSCTR

type S7CommROSCTR uint8

S7CommROSCTR is the S7comm message type (remote operating service control).

const (
	S7CommROSCTRJob      S7CommROSCTR = 0x01
	S7CommROSCTRAck      S7CommROSCTR = 0x02
	S7CommROSCTRAckData  S7CommROSCTR = 0x03
	S7CommROSCTRUserdata S7CommROSCTR = 0x07
)

S7comm message types.

func (S7CommROSCTR) String

func (r S7CommROSCTR) String() string

String returns the Wireshark name of the message type.

type S7CommReadRecord

type S7CommReadRecord struct {
	Item          *S7CommVarItem
	ReturnCode    S7CommReturnCode
	TransportSize S7CommDataTransportSize // with return code 0xFF
	Status        []byte                  // STATUS output of the block
	Length        uint16                  // with return code 0xFF
	Data          []byte
}

S7CommReadRecord is the first item of a read record (SFB 52 RDREC) request or response. Item is the request address; the other fields belong to the response. Status and Data alias the packet data.

type S7CommReturnCode

type S7CommReturnCode uint8

S7CommReturnCode is the per-item return code of a data item.

const (
	S7CommRetReserved         S7CommReturnCode = 0x00
	S7CommRetHardwareFault    S7CommReturnCode = 0x01
	S7CommRetAccessDenied     S7CommReturnCode = 0x03
	S7CommRetInvalidAddress   S7CommReturnCode = 0x05
	S7CommRetTypeUnsupported  S7CommReturnCode = 0x06
	S7CommRetTypeInconsistent S7CommReturnCode = 0x07
	S7CommRetObjectMissing    S7CommReturnCode = 0x0A
	S7CommRetSuccess          S7CommReturnCode = 0xFF
)

S7comm item return codes.

func (S7CommReturnCode) String

func (r S7CommReturnCode) String() string

String returns a human-readable name of the return code.

type S7CommSZL

type S7CommSZL struct {
	ID           uint16
	Index        uint16
	RecordLength uint16
	RecordCount  uint16
	Records      [][]byte

	ModuleIDs       []S7CommSZLModuleID   // xy11
	Characteristics []uint16              // xy12
	Components      []S7CommSZLComponent  // xy1C
	CommCaps        []S7CommSZLCommCaps   // 0131 index 1
	CommStatus      []S7CommSZLCommStatus // 0132 index 1
	Protection      []S7CommSZLProtection // 0132 index 4
	TimeSystem      []S7CommSZLTimeSystem // 0132 index 8
	LEDs            []S7CommSZLLED        // xy74, xy19
	ModeEvents      []S7CommSZLModeEvent  // 0124, 0424
	DiagEvents      []S7CommDiagMessage   // xyA0
}

S7CommSZL is a system status list (SZL) read. A request sets ID and Index only. Records alias the packet data, RecordLength octets each.

The record views below Records are set for the IDs and indexes in s7comm_szl.go, one entry per record; others stay nil.

func (*S7CommSZL) Fields

func (z *S7CommSZL) Fields(i int) []S7CommField

Fields returns record i split into named fields, or nil when i is out of range, the SZL ID and index have no known layout, or the record is shorter than its layout. It allocates on each call and decodes nothing ahead of it.

func (*S7CommSZL) HeaderOnly

func (z *S7CommSZL) HeaderOnly() bool

HeaderOnly reports whether the SZL ID asks for the list header alone (partial list extract 0xF), so a response carries no records.

type S7CommSZLCommCaps

type S7CommSZLCommCaps struct {
	Index    uint16
	MaxPDU   uint16
	MaxConns uint16
	MPIRate  uint32
	BusRate  uint32
}

S7CommSZLCommCaps is an SZL 0x0131 index 1 record (general communication capabilities).

type S7CommSZLCommStatus

type S7CommSZLCommStatus struct {
	Index          uint16
	GuaranteedPG   uint16
	GuaranteedOS   uint16
	CurrentPG      uint16
	CurrentOS      uint16
	Configured     uint16
	Established    uint16
	Free           uint16
	FreeUsed       uint16
	MaxCommLoadPct uint16
}

S7CommSZLCommStatus is an SZL 0x0132 index 1 record (communication status): guaranteed and current PG/OS connections, configured and established connections, free and used free connections, and the maximum communication load in percent.

type S7CommSZLComponent

type S7CommSZLComponent struct {
	Index           uint16
	Text            string
	ManufacturerID  uint16
	ProfileID       uint16
	ProfileSpecType uint16
	OEMID           uint16
	OEMAddID        uint32
}

S7CommSZLComponent is an SZL xy1C record (component identification). Text holds the name, tag, copyright, serial number, CPU type, memory card serial or location for the indexes carrying text (1-5, 7, 8, 0xB); index 9 sets the profile IDs and index 0xA the OEM copyright (in Text) and IDs. Other indexes set Index only.

type S7CommSZLLED

type S7CommSZLLED struct {
	ID       uint16 // rack in bits 8-10, master in bit 11, LED in 0-7
	On       uint8
	Flashing uint8
}

S7CommSZLLED is an SZL xy74 (or xy19) record.

type S7CommSZLModeEvent

type S7CommSZLModeEvent struct {
	Event    uint16
	AE       uint8
	BZUID    uint8 // previous mode << 4 | requested mode
	Reserved []byte
	Info     [4]uint8
	Time     time.Time
}

S7CommSZLModeEvent is an SZL xy24 record (mode transition). Time is zero if it is not a valid date.

type S7CommSZLModuleID

type S7CommSZLModuleID struct {
	Index       uint16
	OrderNumber string // MLFB, e.g. "6ES7 315-2EH14-0AB0"
	ModuleType  uint16
	Version     uint16
	Release     uint16
}

S7CommSZLModuleID is an SZL xy11 record (module identification).

type S7CommSZLProtection

type S7CommSZLProtection struct {
	Index        uint16
	KeySwitch    uint16 // protection level of the key switch
	Assigned     uint16 // assigned protection level
	Effective    uint16 // valid protection level of the CPU
	ModeSwitch   uint16 // position of the mode switch
	StartSwitch  uint16 // CRST/WRST switch
	Reserved     uint16
	VersionValid uint16 // which version IDs below are valid
	HWVersion1   uint16 // the version IDs are little-endian on the wire
	HWVersion2   uint16
	ProgVersion1 uint16
	ProgVersion2 uint16
}

S7CommSZLProtection is an SZL 0x0132 index 4 record (protection levels and switch positions).

type S7CommSZLTimeSystem

type S7CommSZLTimeSystem struct {
	Index      uint16
	SyncCycle  uint16
	Correction uint16
	RunMeters  [s7commSZLRunMeters]uint16 // hours
	Time       time.Time
}

S7CommSZLTimeSystem is an SZL 0x0132 index 8 record (time system). Time is zero if it is not a valid date.

type S7CommSendData

type S7CommSendData struct {
	ID     uint32
	Length uint16
	Data   []byte
}

S7CommSendData is the value of a PBC BSEND or an AR_SEND. ID is the R_ID or AR_ID each data unit names, 0 when the unit header is missing. Length is the size the sender states; Data is what follows.

type S7CommSetupComm

type S7CommSetupComm struct {
	Reserved      uint8
	MaxAmQCalling uint16
	MaxAmQCalled  uint16
	PDULength     uint16
}

S7CommSetupComm is the Setup Communication parameter.

type S7CommSubblockType

type S7CommSubblockType uint8

S7CommSubblockType is the block type octet of block info, e.g. 0x0A for a DB. Unlike S7CommBlockType it is binary, not ASCII.

const (
	S7CommSubblockNone S7CommSubblockType = 0x00
	S7CommSubblockOB   S7CommSubblockType = 0x08
	S7CommSubblockDB   S7CommSubblockType = 0x0A
	S7CommSubblockSDB  S7CommSubblockType = 0x0B
	S7CommSubblockFC   S7CommSubblockType = 0x0C
	S7CommSubblockSFC  S7CommSubblockType = 0x0D
	S7CommSubblockFB   S7CommSubblockType = 0x0E
	S7CommSubblockSFB  S7CommSubblockType = 0x0F
)

Subblock types.

func (S7CommSubblockType) String

func (t S7CommSubblockType) String() string

type S7CommSubfunction

type S7CommSubfunction uint8

S7CommSubfunction is a Userdata subfunction; its meaning depends on the function group, so the constants carry the group in their name.

const (
	S7CommCPUScanInd         S7CommSubfunction = 0x09
	S7CommCPUAlarm8LockInd   S7CommSubfunction = 0x0D
	S7CommCPUAlarm8UnlockInd S7CommSubfunction = 0x0E
	S7CommCPUARSendInd       S7CommSubfunction = 0x10
	S7CommCPUAlarmSQInd      S7CommSubfunction = 0x11
	S7CommCPUAlarmS12Ind     S7CommSubfunction = 0x12
	S7CommCPUNotify8Ind      S7CommSubfunction = 0x16
)

More CPU subfunctions. Wireshark names 0x11 (S7CommCPUAlarmSInd) ALARM_SQ and 0x12 ALARM_S.

const (
	S7CommCyclicTransfer    S7CommSubfunction = 0x01
	S7CommCyclicUnsubscribe S7CommSubfunction = 0x04
	S7CommCyclicChange      S7CommSubfunction = 0x05
	S7CommCyclicChangeMod   S7CommSubfunction = 0x07
	S7CommCyclicReadRecord  S7CommSubfunction = 0x08
)

Subfunctions of the cyclic data group.

const (
	S7CommTISVarStat S7CommSubfunction = 0x02
	S7CommTISModVar  S7CommSubfunction = 0x08
	S7CommTISForce   S7CommSubfunction = 0x09
)

Subfunctions of the programmer commands group whose data is decoded.

const (
	S7CommTISBlockStat   S7CommSubfunction = 0x01
	S7CommTISIStack      S7CommSubfunction = 0x03
	S7CommTISBStack      S7CommSubfunction = 0x04
	S7CommTISLStack      S7CommSubfunction = 0x05
	S7CommTISBreakpoint  S7CommSubfunction = 0x0A
	S7CommTISExitHold    S7CommSubfunction = 0x0B
	S7CommTISDisableJob  S7CommSubfunction = 0x0D
	S7CommTISEnableJob   S7CommSubfunction = 0x0E
	S7CommTISDeleteJob   S7CommSubfunction = 0x0F
	S7CommTISReadJobList S7CommSubfunction = 0x10
	S7CommTISReadJob     S7CommSubfunction = 0x11
	S7CommTISReplaceJob  S7CommSubfunction = 0x12
	S7CommTISBlockStat2  S7CommSubfunction = 0x13
)

More subfunctions of the programmer commands group.

const (
	S7CommCPUReadSZL        S7CommSubfunction = 0x01
	S7CommCPUMessageService S7CommSubfunction = 0x02
	S7CommCPUDiagMessage    S7CommSubfunction = 0x03
	S7CommCPUAlarm8Ind      S7CommSubfunction = 0x05
	S7CommCPUNotifyInd      S7CommSubfunction = 0x06
	S7CommCPUAlarm8Lock     S7CommSubfunction = 0x07
	S7CommCPUAlarm8Unlock   S7CommSubfunction = 0x08
	S7CommCPUAlarmAck       S7CommSubfunction = 0x0B
	S7CommCPUAlarmAckInd    S7CommSubfunction = 0x0C
	S7CommCPUAlarmSInd      S7CommSubfunction = 0x11
	S7CommCPUAlarmQuery     S7CommSubfunction = 0x13

	S7CommBlockList       S7CommSubfunction = 0x01
	S7CommBlockListOfType S7CommSubfunction = 0x02
	S7CommBlockGetInfo    S7CommSubfunction = 0x03

	S7CommTimeReadClock    S7CommSubfunction = 0x01
	S7CommTimeSetClock     S7CommSubfunction = 0x02
	S7CommTimeReadClockFol S7CommSubfunction = 0x03
	S7CommTimeSetClock2    S7CommSubfunction = 0x04
)

Subfunctions of the CPU, block and time function groups.

const (
	S7CommNCRequestDownload S7CommSubfunction = 0x01
	S7CommNCDownloadBlock   S7CommSubfunction = 0x02
	S7CommNCContDownload    S7CommSubfunction = 0x03
	S7CommNCDownloadEnded   S7CommSubfunction = 0x04
	S7CommNCStartUpload     S7CommSubfunction = 0x06
	S7CommNCUpload          S7CommSubfunction = 0x07
	S7CommNCContUpload      S7CommSubfunction = 0x08
)

Subfunctions of the NC programming group (Sinumerik file transfer).

type S7CommSyntaxID

type S7CommSyntaxID uint8

S7CommSyntaxID is the address syntax of a variable item, or the parameter format of a Userdata PDU.

const (
	S7CommSyntaxS7Any      S7CommSyntaxID = 0x10
	S7CommSyntaxParamShort S7CommSyntaxID = 0x11 // Userdata request
	S7CommSyntaxParamExt   S7CommSyntaxID = 0x12 // Userdata response
	S7CommSyntaxPBCID      S7CommSyntaxID = 0x13
	S7CommSyntaxAlarmLock  S7CommSyntaxID = 0x15
	S7CommSyntaxAlarmInd   S7CommSyntaxID = 0x16
	S7CommSyntaxAlarmAck   S7CommSyntaxID = 0x19
	S7CommSyntaxAlarmQuery S7CommSyntaxID = 0x1A
	S7CommSyntaxNotifyInd  S7CommSyntaxID = 0x1C
	S7CommSyntaxNCK        S7CommSyntaxID = 0x82
	S7CommSyntaxNCKMetric  S7CommSyntaxID = 0x83
	S7CommSyntaxNCKInch    S7CommSyntaxID = 0x84
	S7CommSyntaxDriveESAny S7CommSyntaxID = 0xA2
	S7CommSyntaxDBRead     S7CommSyntaxID = 0xB0
	S7CommSyntax1200Symbol S7CommSyntaxID = 0xB2
)

S7comm syntax IDs.

func (S7CommSyntaxID) String

func (s S7CommSyntaxID) String() string

String returns the Wireshark name of the syntax ID.

type S7CommTIS

type S7CommTIS struct {
	ParamSize uint16
	DataSize  uint16
	Param     []byte
	Body      []byte
	ItemCount uint16
	Addresses []S7CommTISAddress
	Values    []S7CommDataItem
	Results   []S7CommReturnCode
	// contains filtered or unexported fields
}

S7CommTIS is a programmer command. Param and Body are the raw parameter and data parts; the views below are set for variable status, modify and force. ParamFields and DataFields split the parameter and the data of the other services.

func (*S7CommTIS) DataFields

func (t *S7CommTIS) DataFields() []S7CommField

DataFields returns the data part split into named fields for the services listed in s7comm_ud_tis_fields.go. It is nil for other services, including variable status, modify and force (see Addresses, Values and Results), and when the data is shorter than its layout.

func (*S7CommTIS) ParamFields

func (t *S7CommTIS) ParamFields() []S7CommField

ParamFields returns the parameter part split into named fields, or nil when it is empty or shorter than its layout.

type S7CommTISAddress

type S7CommTISAddress struct {
	Area       S7CommTISArea
	Repetition uint8
	BitPos     uint8
	DBNumber   uint16
	Start      uint16
}

S7CommTISAddress is a variable table address. An area with a nonzero low nibble (byte, word, double word, timer, counter) carries a repetition factor; a bit area carries the bit position.

type S7CommTISArea

type S7CommTISArea uint8

S7CommTISArea is the memory area of a variable table address.

const (
	S7CommTISAreaMX  S7CommTISArea = 0x00
	S7CommTISAreaMB  S7CommTISArea = 0x01
	S7CommTISAreaMW  S7CommTISArea = 0x02
	S7CommTISAreaMD  S7CommTISArea = 0x03
	S7CommTISAreaEX  S7CommTISArea = 0x10
	S7CommTISAreaEB  S7CommTISArea = 0x11
	S7CommTISAreaEW  S7CommTISArea = 0x12
	S7CommTISAreaED  S7CommTISArea = 0x13
	S7CommTISAreaAX  S7CommTISArea = 0x20
	S7CommTISAreaAB  S7CommTISArea = 0x21
	S7CommTISAreaAW  S7CommTISArea = 0x22
	S7CommTISAreaAD  S7CommTISArea = 0x23
	S7CommTISAreaPEB S7CommTISArea = 0x31
	S7CommTISAreaPEW S7CommTISArea = 0x32
	S7CommTISAreaPED S7CommTISArea = 0x33
	S7CommTISAreaDBX S7CommTISArea = 0x70
	S7CommTISAreaDBB S7CommTISArea = 0x71
	S7CommTISAreaDBW S7CommTISArea = 0x72
	S7CommTISAreaDBD S7CommTISArea = 0x73
	S7CommTISAreaT   S7CommTISArea = 0x54
	S7CommTISAreaC   S7CommTISArea = 0x64
)

Variable table memory areas: bit (X), byte (B), word (W), double word (D) of flags (M), inputs (E), outputs (A), peripheral inputs (PE), data blocks, timers and counters.

func (S7CommTISArea) String

func (a S7CommTISArea) String() string

type S7CommTransportSize

type S7CommTransportSize uint8

S7CommTransportSize is the element type of an S7ANY address.

const (
	S7CommTSBit       S7CommTransportSize = 0x01
	S7CommTSByte      S7CommTransportSize = 0x02
	S7CommTSChar      S7CommTransportSize = 0x03
	S7CommTSWord      S7CommTransportSize = 0x04
	S7CommTSInt       S7CommTransportSize = 0x05
	S7CommTSDWord     S7CommTransportSize = 0x06
	S7CommTSDInt      S7CommTransportSize = 0x07
	S7CommTSReal      S7CommTransportSize = 0x08
	S7CommTSDate      S7CommTransportSize = 0x09
	S7CommTSTOD       S7CommTransportSize = 0x0A
	S7CommTSTime      S7CommTransportSize = 0x0B
	S7CommTSS5Time    S7CommTransportSize = 0x0C
	S7CommTSDateTime  S7CommTransportSize = 0x0F
	S7CommTSCounter   S7CommTransportSize = 0x1C
	S7CommTSTimer     S7CommTransportSize = 0x1D
	S7CommTSIECTimer  S7CommTransportSize = 0x1E
	S7CommTSIECCount  S7CommTransportSize = 0x1F
	S7CommTSHSCounter S7CommTransportSize = 0x20
)

S7ANY transport sizes.

func (S7CommTransportSize) String

func (t S7CommTransportSize) String() string

String returns the S7 type name of the transport size.

type S7CommUDAssembler

type S7CommUDAssembler struct {
	// MaxSize caps the octets held over all unfinished transfers. Zero
	// or less means S7CommUDDefaultMaxSize.
	MaxSize int
	// contains filtered or unexported fields
}

S7CommUDAssembler joins the data units of Userdata values that span several PDUs. Feed it the S7comm layers of one connection in order, either direction or both. The zero value is ready to use; it is not safe for concurrent use.

Transfers are keyed by Userdata type (request, response, push) and sequence number, so at most 768 are open at once, and all of them together hold at most MaxSize octets. Data units carry no position: their order is the order of the calls, i.e. of the TCP stream.

func (*S7CommUDAssembler) Feed

func (a *S7CommUDAssembler) Feed(s *S7Comm) (*S7CommUserdata, error)

Feed takes the next S7comm PDU. It returns the Userdata view to use:

  • s.Userdata itself for a PDU that is not part of a multi-PDU value;
  • nil while data units of the value are still to come;
  • a new view on the last data unit, with the parameter and data header of that PDU, Data holding the joined value (owned by the caller), Fragments the number of units and the value views decoded from the whole.

It returns nil for a nil layer or one that is not Userdata. A transfer above the size cap returns ErrS7CommUDTooLong once and is dropped up to its last unit.

A capture that starts inside a transfer yields its tail as if it were whole; the view's DecodeErr then usually says so.

func (*S7CommUDAssembler) Pending

func (a *S7CommUDAssembler) Pending() int

Pending returns how many octets of unfinished transfers are held.

func (*S7CommUDAssembler) Reset

func (a *S7CommUDAssembler) Reset()

Reset drops every unfinished transfer, e.g. after a gap in the TCP stream.

type S7CommUserdata

type S7CommUserdata struct {
	VarSpec       uint8
	ParamLength   uint8 // octets after this one
	SyntaxID      S7CommSyntaxID
	Type          S7CommUserdataType
	FunctionGroup S7CommFuncGroup
	Subfunction   S7CommSubfunction
	Sequence      uint8
	DataUnitRef   uint8
	LastDataUnit  uint8 // 0x00: last; otherwise more follow
	ErrorCode     uint16
	ReturnCode    S7CommReturnCode
	TransportSize S7CommDataTransportSize
	Length        uint16
	Data          []byte

	// UnitHeader holds the octets NC programming, PBC BSEND and AR_SEND
	// put before each data unit; Data starts after them.
	UnitHeader []byte

	// Fragments is the number of data units an S7CommUDAssembler joined
	// into Data; 0 for a view decoded from a single PDU.
	Fragments int

	SZL          *S7CommSZL
	BlockCounts  []S7CommBlockCount // list blocks response
	BlockEntries []S7CommBlockEntry // list blocks of type response
	BlockType    S7CommBlockType    // list of type and get info requests
	BlockNumber  string             // get block info request, ASCII digits
	Filesystem   uint8              // get block info request

	BlockInfo  *S7CommBlockInfo  // get block info response
	Clock      *time.Time        // clock read response, set request; UTC
	Cyclic     *S7CommCyclic     // cyclic data
	TIS        *S7CommTIS        // programmer commands
	Alarm      *S7CommAlarm      // alarm indications, ack, lock, query request
	AlarmQuery *S7CommAlarmQuery // alarm query response
	Diag       *S7CommDiagMessage
	MsgService *S7CommMsgService
	NC         *S7CommNCFile   // NC programming, joined value only
	Send       *S7CommSendData // PBC BSEND, AR_SEND
	DecodeErr  error
}

S7CommUserdata is the decoded parameter and data of a Userdata PDU. DataUnitRef, LastDataUnit and ErrorCode are set only with the long (response) parameter. The value views below Data are set for an unfragmented value with data, whatever its return code, as Wireshark does; only an SZL response, a block info response and the clock need return code 0xFF, and block queries a transport size. A view is nil when its service does not apply. Data always keeps the raw value.

DecodeErr records why the view matching the group and subfunction was not set, e.g. a count overrunning the data. DecodeFromBytes does not return it: the PDU itself is well formed. It does return a malformed SZL or block function value sent with return code 0xFF.

func (*S7CommUserdata) Fragmented

func (u *S7CommUserdata) Fragmented() bool

Fragmented reports whether the PDU is one part of a multi-PDU value, which S7CommUDAssembler joins. It is false for the view the assembler returns.

func (*S7CommUserdata) SubfunctionName

func (u *S7CommUserdata) SubfunctionName() string

SubfunctionName returns the subfunction name within its group.

type S7CommUserdataType

type S7CommUserdataType uint8

S7CommUserdataType is the direction of a Userdata PDU, the top two bits of the type/group octet.

const (
	S7CommUDTypePush     S7CommUserdataType = 0
	S7CommUDTypeRequest  S7CommUserdataType = 1
	S7CommUDTypeResponse S7CommUserdataType = 2
)

S7comm Userdata types.

func (S7CommUserdataType) String

func (t S7CommUserdataType) String() string

String returns a human-readable name of the type.

type S7CommVarItem

type S7CommVarItem struct {
	VarSpec       uint8 // 0x12
	Length        uint8 // octets after this one
	SyntaxID      S7CommSyntaxID
	TransportSize S7CommTransportSize
	Count         uint16 // elements of TransportSize
	DBNumber      uint16
	Area          S7CommArea
	BitAddress    uint32 // 24-bit address in bits: byte*8 + bit
	Address       []byte

	// Set for their syntax IDs only (see s7comm_address.go).
	DBRead  []S7CommDBReadArea
	NCK     *S7CommNCKAddress
	DriveES *S7CommDriveESAddress
}

S7CommVarItem is one Read Var or Write Var request item. The S7ANY fields are set only when SyntaxID is S7CommSyntaxS7Any; Address holds every syntax's address octets after the syntax ID.

func (*S7CommVarItem) BitOffset

func (i *S7CommVarItem) BitOffset() uint8

BitOffset returns the bit part (0-7) of an S7ANY address.

func (*S7CommVarItem) ByteOffset

func (i *S7CommVarItem) ByteOffset() uint32

ByteOffset returns the byte part of an S7ANY address.

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
	Payload                               []byte
}

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) LayerType added in v1.6.0

func (a SCTPPort) LayerType() gopacket.LayerType

LayerType returns a LayerType that would be able to decode the application payload. It uses some well-known ports such as 3868 for Diameter.

Returns gopacket.LayerTypePayload for unknown/unsupported port numbers.

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
}

SFlowBaseCounterRecord

0                      15                      31
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|      20 bit Interprise (0)     |12 bit format |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                  counter length               |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                   counter data                |
|                                               |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

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
}

**************************************************

Extended Decapsulate Egress

**************************************************

0                      15                      31
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|      20 bit Interprise (0)     |12 bit format |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                  record length                |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|               Inner Header Offset             |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedDecapsulateIngressRecord

type SFlowExtendedDecapsulateIngressRecord struct {
	SFlowBaseFlowRecord
	InnerHeaderOffset uint32
}

SFlowExtendedDecapsulateIngressRecord

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
}

**************************************************

Extended IPv4 Tunnel Egress

**************************************************

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
}

**************************************************

Extended IPv4 Tunnel Ingress

**************************************************

0                      15                      31
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|      20 bit Interprise (0)     |12 bit format |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                  record length                |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/           Packet IP version 4 Record          /
/                                               /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedIpv6TunnelEgressRecord

type SFlowExtendedIpv6TunnelEgressRecord struct {
	SFlowBaseFlowRecord
	SFlowIpv6Record
}

**************************************************

Extended IPv6 Tunnel Egress

**************************************************

0                      15                      31
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|      20 bit Interprise (0)     |12 bit format |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                  record length                |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
/           Packet IP version 6 Record          /
/                                               /
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedIpv6TunnelIngressRecord

type SFlowExtendedIpv6TunnelIngressRecord struct {
	SFlowBaseFlowRecord
	SFlowIpv6Record
}

**************************************************

Extended IPv6 Tunnel Ingress

**************************************************

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
}

SFlowExtendedVniEgressRecord

0                      15                      31
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|      20 bit Interprise (0)     |12 bit format |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                  record length                |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|                       VNI                     |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+

type SFlowExtendedVniIngressRecord

type SFlowExtendedVniIngressRecord struct {
	SFlowBaseFlowRecord
	VNI uint32
}

SFlowExtendedVniIngressRecord

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
}

SFlowIpv4Record

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
}

**************************************************

Packet IP version 6 Record

**************************************************

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. Sampled sFlow datagrams are decoded up to maxSampledSFlowDepth levels deep; past that, the datagram is the gopacket.Payload of Header.

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, whether they use its long or its compact form.

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 SV

type SV struct {
	BaseLayer
	IEC61850Header

	NoASDU   uint16
	Security []byte
	ASDUs    []SVASDU
}

SV is an IEC 61850-9-2 Sampled Values frame. It is usually sent 802.1Q tagged with priority 4.

func (*SV) ASDUCountMatch

func (s *SV) ASDUCountMatch() bool

ASDUCountMatch reports whether noASDU equals the number of decoded ASDUs. A mismatch is not a decode error.

func (*SV) CanDecode

func (s *SV) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeSV.

func (*SV) DecodeFromBytes

func (s *SV) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes an SV frame starting at the APPID.

func (*SV) LayerType

func (s *SV) LayerType() gopacket.LayerType

LayerType returns LayerTypeSV.

func (*SV) NextLayerType

func (s *SV) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeZero: SV carries no further layer.

func (*SV) Payload

func (s *SV) Payload() []byte

Payload returns nil.

type SVASDU

type SVASDU struct {
	SvID       string
	DatSet     string
	SmpCnt     uint16
	ConfRev    uint32
	RefrTm     MMSUTCTime
	HasRefrTm  bool
	SmpSynch   SVSmpSynch
	SmpRate    uint16
	HasSmpRate bool
	Sample     []byte
	SmpMod     uint16
	HasSmpMod  bool
	GmIdentity []byte
}

SVASDU is one Application Service Data Unit of a savPdu. The Has* fields tell whether an OPTIONAL field was present.

func (*SVASDU) Samples92LE

func (a *SVASDU) Samples92LE() ([svLEChannels]SVLESample, error)

Samples92LE decodes Sample as the 9-2LE dataset of 4 currents and 4 voltages. It fails unless Sample is 64 octets long.

type SVLESample

type SVLESample struct {
	Value   int32
	Quality uint32
}

SVLESample is one IEC 61850-9-2LE channel: a scaled value and its IEC 61850 quality bits.

type SVSmpSynch

type SVSmpSynch uint8

SVSmpSynch is the smpSynch value of an ASDU. Values 5 to 254 name a grandmaster clock (IEC 61850-9-2 Ed2.1).

const (
	SVSmpSynchNone   SVSmpSynch = 0
	SVSmpSynchLocal  SVSmpSynch = 1
	SVSmpSynchGlobal SVSmpSynch = 2
)

smpSynch values.

func (SVSmpSynch) String

func (s SVSmpSynch) String() string

String returns the smpSynch meaning.

type ServiceClass added in v1.6.0

type ServiceClass uint32

ServiceClass represents the SO_TC_* service class values

func (ServiceClass) String added in v1.6.0

func (s ServiceClass) String() string

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

	Multipath bool
	// 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

func (*TCP) VerifyChecksum added in v1.2.0

func (t *TCP) VerifyChecksum() (error, gopacket.ChecksumVerificationResult)

type TCPOption

type TCPOption struct {
	OptionType            TCPOptionKind
	OptionLength          uint8
	OptionData            []byte
	OptionMultipath       MPTCPSubtype
	OptionMPTCPMpCapable  *MPCapable
	OptionMPTCPDss        *Dss
	OptionMPTCPMpJoin     *MPJoin
	OptionMPTCPMpPrio     *MPPrio
	OptionMPTCPAddAddr    *AddAddr
	OptionMTCPRemAddr     *RemAddr
	OptionMTCPMPFastClose *MPFClose
	OptionMPTCPMPTcpRst   *MPTcpRst
	OptionMTCPMPFail      *MPFail
}

TCPOption are the possible TCP and MPTCP Options

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.

const TCPPortEtherCATAMS TCPPort = 48898

TCPPortEtherCATAMS is the TCP port of AMS over TCP.

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 TLSExtension added in v1.3.1

type TLSExtension uint16

TLS Extensions http://www.iana.org/assignments/tls-extensiontype-values/tls-extensiontype-values.xhtml

const (
	TLSExtServerName           TLSExtension = 0
	TLSExtMaxFragLen           TLSExtension = 1
	TLSExtClientCertURL        TLSExtension = 2
	TLSExtTrustedCAKeys        TLSExtension = 3
	TLSExtTruncatedHMAC        TLSExtension = 4
	TLSExtStatusRequest        TLSExtension = 5
	TLSExtUserMapping          TLSExtension = 6
	TLSExtClientAuthz          TLSExtension = 7
	TLSExtServerAuthz          TLSExtension = 8
	TLSExtCertType             TLSExtension = 9
	TLSExtSupportedGroups      TLSExtension = 10
	TLSExtECPointFormats       TLSExtension = 11
	TLSExtSRP                  TLSExtension = 12
	TLSExtSignatureAlgs        TLSExtension = 13
	TLSxtUseSRTP               TLSExtension = 14
	TLSExtHeartbeat            TLSExtension = 15
	TLSExtALPN                 TLSExtension = 16
	TLSExtStatusRequestV2      TLSExtension = 17
	TLSExtSignedCertTS         TLSExtension = 18
	TLSExtClientCertType       TLSExtension = 19
	TLSExtServerCertType       TLSExtension = 20
	TLSExtPadding              TLSExtension = 21
	TLSExtEncryptThenMAC       TLSExtension = 22
	TLSExtExtendedMasterSecret TLSExtension = 23
	TLSExtSessionTicket        TLSExtension = 35
	TLSExtNPN                  TLSExtension = 13172
	TLSExtRenegotiationInfo    TLSExtension = 65281
)

type TLSHandshakeRecord

type TLSHandshakeRecord struct {
	TLSRecordHeader
	ClientHello     TLSHandshakeRecordClientHello
	ClientKeyChange TLSHandshakeRecordClientKeyChange
}

TLSHandshakeRecord defines the structure of a Handshare Record

type TLSHandshakeRecordClientHello

type TLSHandshakeRecordClientHello struct {
	HandshakeType            uint8
	Length                   uint32
	ProtocolVersion          TLSVersion
	Random                   []uint8
	SessionIDLength          uint8
	SessionID                []uint8
	CipherSuitsLength        uint16
	CipherSuits              []uint8
	CompressionMethodsLength uint8
	CompressionMethods       []uint8
	ExtensionsLength         uint16
	Extensions               []uint8
	SNI                      []uint8
}

type TLSHandshakeRecordClientKeyChange

type TLSHandshakeRecordClientKeyChange struct {
}

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 TPKT

type TPKT struct {
	BaseLayer
	Version  uint8
	Reserved uint8
	Length   uint16
}

TPKT is an RFC 1006 frame header. Payload holds the COTP TPDU; bytes past Length belong to the next TPKT of the segment.

gopacket.NewPacket decodes every TPKT of a segment. A DecodingLayerParser holds one TPKT value and decodes only the first; to read the rest, call DecodeFromBytes again on data[Length:].

func (*TPKT) CanDecode

func (t *TPKT) CanDecode() gopacket.LayerClass

CanDecode returns LayerTypeTPKT.

func (*TPKT) DecodeFromBytes

func (t *TPKT) DecodeFromBytes(data []byte, df gopacket.DecodeFeedback) error

DecodeFromBytes decodes one TPKT frame from the start of data.

func (*TPKT) LayerType

func (t *TPKT) LayerType() gopacket.LayerType

LayerType returns LayerTypeTPKT.

func (*TPKT) NextLayerType

func (t *TPKT) NextLayerType() gopacket.LayerType

NextLayerType returns LayerTypeCOTP.

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

func (*UDP) VerifyChecksum added in v1.2.0

func (u *UDP) VerifyChecksum() (error, gopacket.ChecksumVerificationResult)

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.

const UDPPortEtherCAT UDPPort = 0x88A4

UDPPortEtherCAT is the UDP port of EtherCAT frames over UDP.

const UDPPortProfinetIO UDPPort = 34964

UDPPortProfinetIO is the UDP port of the PROFINET IO RPC endpoint mapper and, on most devices, of the PNIO-CM server itself.

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.

type VendorNamespace added in v1.4.0

type VendorNamespace struct {
	OUI          []uint8 // The vendor's Organizationally Unique Identifier
	SubNamespace uint8   // Selector to determine which vendor-specific namespace the fields represent
	SkipLength   uint16  // Amount of data present for this vendor namespace (does not include the header size of the vendor namespace field itself)
	Contents     []uint8 // The custom data for the vendor namespace. This library does not yet attempt to parse specific vendor fields.
}

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.

Source Files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL