PcapPlusPlus  22.11
pcpp::StpTopologyChangeBPDULayer Class Reference

#include <StpLayer.h>

Inheritance diagram for pcpp::StpTopologyChangeBPDULayer:
pcpp::StpLayer pcpp::Layer pcpp::IDataContainer pcpp::StpConfigurationBPDULayer pcpp::RapidStpLayer pcpp::MultipleStpLayer

Public Member Functions

 StpTopologyChangeBPDULayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
stp_tcn_bpdugetStpTcnHeader ()
 
std::string toString () const
 
- Public Member Functions inherited from pcpp::StpLayer
stp_headergetStpHeader () const
 
uint16_t getProtoId () const
 
uint8_t getVersion () const
 
uint8_t getType () const
 
size_t getHeaderLen () const
 
void parseNextLayer ()
 Parses the next layer. STP is the always last so does nothing for this layer.
 
void computeCalculateFields ()
 Does nothing for this layer.
 
OsiModelLayer getOsiModelLayer () const
 
- Public Member Functions inherited from pcpp::Layer
virtual ~Layer ()
 
LayergetNextLayer () const
 
LayergetPrevLayer () const
 
ProtocolType getProtocol () const
 
uint8_t * getData () const
 
size_t getDataLen () const
 
uint8_t * getLayerPayload () const
 
size_t getLayerPayloadSize () const
 
bool isAllocatedToPacket () const
 
void copyData (uint8_t *toArr) const
 
uint8_t * getDataPtr (size_t offset=0) const
 

Static Public Member Functions

static bool isDataValid (const uint8_t *data, size_t dataLen)
 
- Static Public Member Functions inherited from pcpp::StpLayer
static bool isDataValid (const uint8_t *data, size_t dataLen)
 
static StpLayerparseStpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 

Additional Inherited Members

- Static Public Attributes inherited from pcpp::StpLayer
static pcpp::MacAddress StpMulticastDstMAC
 STP protocol uses "01:80:C2:00:00:00" multicast address as destination MAC.
 
static pcpp::MacAddress StpUplinkFastMulticastDstMAC
 STP Uplink Fast protocol uses "01:00:0C:CD:CD:CD" as destination MAC.
 

Detailed Description

Represents network topology change BPDU message of Spanning Tree Protocol

Constructor & Destructor Documentation

◆ StpTopologyChangeBPDULayer()

pcpp::StpTopologyChangeBPDULayer::StpTopologyChangeBPDULayer ( uint8_t *  data,
size_t  dataLen,
Layer prevLayer,
Packet packet 
)
inline

A constructor that creates the layer from an existing packet raw data

Parameters
[in]dataA pointer to the raw data
[in]dataLenSize of the data in bytes
[in]prevLayerA pointer to the previous layer
[in]packetA pointer to the Packet instance where layer will be stored in

Member Function Documentation

◆ getStpTcnHeader()

stp_tcn_bpdu* pcpp::StpTopologyChangeBPDULayer::getStpTcnHeader ( )
inline

Get a pointer to network topology change (TCN) BPDU message

Returns
A pointer to TCN BPDU message

◆ isDataValid()

static bool pcpp::StpTopologyChangeBPDULayer::isDataValid ( const uint8_t *  data,
size_t  dataLen 
)
inlinestatic

A static method that validates the input data

Parameters
[in]dataThe pointer to the beginning of a byte stream of an Spanning Tree Topology Change BPDU packet
[in]dataLenThe length of the byte stream
Returns
True if the data is valid and can represent an Spanning Tree packet

◆ toString()

std::string pcpp::StpTopologyChangeBPDULayer::toString ( ) const
inlinevirtual
Returns
Returns the protocol info as readable string

Implements pcpp::Layer.

Reimplemented in pcpp::MultipleStpLayer, pcpp::RapidStpLayer, and pcpp::StpConfigurationBPDULayer.