1 #ifndef PACKETPP_STP_LAYER 2 #define PACKETPP_STP_LAYER 87 uint8_t mstConfigName[32];
91 uint8_t mstConfigDigest[16];
105 #pragma pack(push, 1) 131 :
Layer(data, dataLen, prevLayer, packet)
154 uint16_t
getProtoId()
const {
return getStpHeader()->protoId; }
160 uint8_t
getVersion()
const {
return getStpHeader()->version; }
166 uint8_t
getType()
const {
return getStpHeader()->type; }
192 static bool isDataValid(
const uint8_t *data,
size_t dataLen);
203 static StpLayer *parseStpLayer(uint8_t *data,
size_t dataLen,
Layer *prevLayer,
Packet *packet);
221 :
StpLayer(data, dataLen, prevLayer, packet)
236 std::string
toString()
const {
return "Spanning Tree Topology Change Notification"; }
276 uint8_t
getFlag()
const {
return getStpConfHeader()->flag; }
282 uint64_t getRootId()
const;
288 uint16_t getRootPriority()
const;
294 uint16_t getRootSystemIDExtension()
const;
306 uint32_t getPathCost()
const;
312 uint64_t getBridgeId()
const;
318 uint16_t getBridgePriority()
const;
324 uint16_t getBridgeSystemIDExtension()
const;
336 uint16_t getPortId()
const;
342 double getMessageAge()
const;
348 double getMaximumAge()
const;
354 double getTransmissionInterval()
const;
360 double getForwardDelay()
const;
367 std::string
toString()
const {
return "Spanning Tree Configuration"; }
417 std::string
toString()
const {
return "Rapid Spanning Tree"; }
459 uint16_t getVersion3Len()
const;
471 std::string getMstConfigurationName()
const;
489 uint32_t getCISTIrpc()
const;
495 uint64_t getCISTBridgeId()
const;
501 uint16_t getCISTBridgePriority()
const;
507 uint16_t getCISTBridgeSystemIDExtension()
const;
540 std::string
toString()
const {
return "Multiple Spanning Tree"; }
Definition: StpLayer.h:80
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:298
Definition: StpLayer.h:435
uint16_t maxAge
Maximum age of the BPDU.
Definition: StpLayer.h:55
OsiModelLayer getOsiModelLayer() const
Definition: StpLayer.h:184
RapidStpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: StpLayer.h:395
uint32_t pathCost
Cost of path.
Definition: StpLayer.h:47
uint8_t getNumberOfMSTIConfMessages() const
Definition: StpLayer.h:525
uint16_t helloTime
BPDU transmission interval.
Definition: StpLayer.h:57
Definition: StpLayer.h:40
static bool isDataValid(const uint8_t *data, size_t dataLen)
Definition: StpLayer.h:425
stp_tcn_bpdu stp_header
Spanning Tree protocol common header.
Definition: StpLayer.h:33
Definition: ProtocolType.h:303
uint8_t remainId
CIST remaining hop count.
Definition: StpLayer.h:97
uint16_t getMstConfigRevision() const
Definition: StpLayer.h:477
uint8_t flags
MSTI flags.
Definition: StpLayer.h:109
static bool isDataValid(const uint8_t *data, size_t dataLen)
Definition: StpLayer.h:548
uint16_t portId
Port ID.
Definition: StpLayer.h:51
Definition: StpLayer.h:251
static bool isDataValid(const uint8_t *data, size_t dataLen)
Definition: StpLayer.h:375
const ProtocolType STP
Definition: ProtocolType.h:278
uint8_t * getMstConfigDigest() const
Definition: StpLayer.h:483
stp_conf_bpdu * getStpConfHeader() const
Definition: StpLayer.h:270
StpTopologyChangeBPDULayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: StpLayer.h:220
Definition: StpLayer.h:127
StpConfigurationBPDULayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: StpLayer.h:261
uint64_t regionalRootId
Regional root switching id (Priority (4 bits) + ID (12 bits) + Regional root (48 bits - MAC address))...
Definition: StpLayer.h:111
uint8_t getType() const
Definition: StpLayer.h:166
Definition: StpLayer.h:68
void parseNextLayer()
Parses the next layer. STP is the always last so does nothing for this layer.
Definition: StpLayer.h:176
std::string toString() const
Definition: StpLayer.h:540
void computeCalculateFields()
Does nothing for this layer.
Definition: StpLayer.h:179
uint8_t getVersion() const
Definition: StpLayer.h:160
uint8_t getVersion1Len() const
Definition: StpLayer.h:410
std::string toString() const
Definition: StpLayer.h:417
uint8_t portPriority
Priority value of port.
Definition: StpLayer.h:117
uint16_t mstConfigRevision
Configuration id revision.
Definition: StpLayer.h:89
Definition: StpLayer.h:21
uint64_t cistBridgeId
CIST bridge id.
Definition: StpLayer.h:95
uint8_t version1Len
Version1 length. The value is 0x0.
Definition: StpLayer.h:71
Definition: StpLayer.h:385
Definition: StpLayer.h:210
uint32_t pathCost
Total path cost from local port to regional port.
Definition: StpLayer.h:113
uint16_t msgAge
Age of the BPDU.
Definition: StpLayer.h:53
uint16_t version3Len
Version3 length.
Definition: StpLayer.h:83
stp_tcn_bpdu * getStpTcnHeader()
Definition: StpLayer.h:229
pcpp::MacAddress getRootSystemID() const
Definition: StpLayer.h:300
uint16_t protoId
Protocol ID. Fixed at 0x0, which represents IEEE 802.1d.
Definition: StpLayer.h:24
std::string toString() const
Definition: StpLayer.h:367
std::string toString() const
Definition: StpLayer.h:236
uint8_t version
Protocol version. 0x0 for STP, 0x2 for RSTP, 0x3 for MSTP.
Definition: StpLayer.h:26
uint8_t type
Type of the BPDU. 0x0 for configuration, 0x2 for RSTP/MSTP, 0x80 for TCN.
Definition: StpLayer.h:28
MultipleStpLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: StpLayer.h:445
pcpp::MacAddress getBridgeSystemID() const
Definition: StpLayer.h:330
uint64_t bridgeId
Bridge ID.
Definition: StpLayer.h:49
uint64_t rootId
Root bridge ID.
Definition: StpLayer.h:45
uint8_t getFlag() const
Definition: StpLayer.h:276
uint16_t getProtoId() const
Definition: StpLayer.h:154
Definition: StpLayer.h:106
static pcpp::MacAddress StpMulticastDstMAC
STP protocol uses "01:80:C2:00:00:00" multicast address as destination MAC.
Definition: StpLayer.h:140
mstp_conf_bpdu * getMstpHeader() const
Definition: StpLayer.h:454
static bool isDataValid(const uint8_t *data, size_t dataLen)
Definition: StpLayer.h:244
uint8_t mstConfigFormatSelector
Configuration id format selector.
Definition: StpLayer.h:85
uint8_t remainingHops
Remaining hops of BPDU.
Definition: StpLayer.h:119
rstp_conf_bpdu * getRstpConfHeader() const
Definition: StpLayer.h:404
uint8_t getRemainingHopCount() const
Definition: StpLayer.h:519
pcpp::MacAddress getCISTBridgeSystemID() const
Definition: StpLayer.h:513
uint32_t irpc
CIST internal root path cost.
Definition: StpLayer.h:93
static pcpp::MacAddress StpUplinkFastMulticastDstMAC
STP Uplink Fast protocol uses "01:00:0C:CD:CD:CD" as destination MAC.
Definition: StpLayer.h:142
uint8_t flag
Flag for indicate purpose of BPDU.
Definition: StpLayer.h:43
uint8_t bridgePriority
Priority value of switching device.
Definition: StpLayer.h:115
Definition: MacAddress.h:28
stp_header * getStpHeader() const
Definition: StpLayer.h:148
size_t getHeaderLen() const
Definition: StpLayer.h:173
uint8_t getMstConfigurationFormatSelector() const
Definition: StpLayer.h:465
uint16_t forwardDelay
Delay for STP.
Definition: StpLayer.h:59