PcapPlusPlus  24.09
pcpp::StpConfigurationBPDULayer Class Reference

#include <StpLayer.h>

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

Public Member Functions

 StpConfigurationBPDULayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 StpConfigurationBPDULayer ()
 
stp_conf_bpdugetStpConfHeader () const
 
uint8_t getFlag () const
 
void setFlag (uint8_t value)
 
uint64_t getRootId () const
 
void setRootId (uint64_t value)
 
uint16_t getRootPriority () const
 
void setRootPriority (uint16_t value)
 
uint16_t getRootSystemIDExtension () const
 
void setRootSystemIDExtension (uint16_t value)
 
pcpp::MacAddress getRootSystemID () const
 
void setRootSystemID (const pcpp::MacAddress &value)
 
uint32_t getPathCost () const
 
void setPathCost (uint32_t value)
 
uint64_t getBridgeId () const
 
void setBridgeId (uint64_t value)
 
uint16_t getBridgePriority () const
 
void setBridgePriority (uint16_t value)
 
uint16_t getBridgeSystemIDExtension () const
 
void setBridgeSystemIDExtension (uint16_t value)
 
pcpp::MacAddress getBridgeSystemID () const
 
void setBridgeSystemID (const pcpp::MacAddress &value)
 
uint16_t getPortId () const
 
void setPortId (uint16_t value)
 
double getMessageAge () const
 
void setMessageAge (double value)
 
double getMaximumAge () const
 
void setMaximumAge (double value)
 
double getTransmissionInterval () const
 
void setTransmissionInterval (double value)
 
double getForwardDelay () const
 
void setForwardDelay (double value)
 
size_t getHeaderLen () const
 
void parseNextLayer ()
 Parses next layer.
 
std::string toString () const
 
- Public Member Functions inherited from pcpp::StpTopologyChangeBPDULayer
 StpTopologyChangeBPDULayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 StpTopologyChangeBPDULayer ()
 
stp_tcn_bpdugetStpTcnHeader ()
 
- Public Member Functions inherited from pcpp::StpLayer
stp_headergetStpHeader () const
 
uint16_t getProtoId () const
 
void setProtoId (uint16_t value)
 
uint8_t getVersion () const
 
void setVersion (uint8_t value)
 
uint8_t getType () const
 
void setType (uint8_t value)
 
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
 
bool isMemberOfProtocolFamily (ProtocolTypeFamily protocolTypeFamily) 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::StpTopologyChangeBPDULayer
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 configuration BPDU message of Spanning Tree Protocol

Constructor & Destructor Documentation

◆ StpConfigurationBPDULayer() [1/2]

pcpp::StpConfigurationBPDULayer::StpConfigurationBPDULayer ( 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

◆ StpConfigurationBPDULayer() [2/2]

pcpp::StpConfigurationBPDULayer::StpConfigurationBPDULayer ( )

Empty c'tor to create a new configuration BPDU layer. Initializes the protocol identifier, version and STP type fields with correct values

Member Function Documentation

◆ getBridgeId()

uint64_t pcpp::StpConfigurationBPDULayer::getBridgeId ( ) const

Returns the bridge identifier

Returns
Bridge identifier

◆ getBridgePriority()

uint16_t pcpp::StpConfigurationBPDULayer::getBridgePriority ( ) const

Returns the priority of bridge

Returns
Priority of bridge

◆ getBridgeSystemID()

pcpp::MacAddress pcpp::StpConfigurationBPDULayer::getBridgeSystemID ( ) const
inline

Returns the system identifier of bridge

Returns
System identifier of bridge

◆ getBridgeSystemIDExtension()

uint16_t pcpp::StpConfigurationBPDULayer::getBridgeSystemIDExtension ( ) const

Returns the system identifier extension of bridge

Returns
System extension of bridge

◆ getFlag()

uint8_t pcpp::StpConfigurationBPDULayer::getFlag ( ) const
inline

Returns the flags of configuration message which indicates purpose of BPDU

Returns
Flags of the configuration message

◆ getForwardDelay()

double pcpp::StpConfigurationBPDULayer::getForwardDelay ( ) const

Returns the delay for STP message

Returns
Value of the forward delay in seconds

◆ getHeaderLen()

size_t pcpp::StpConfigurationBPDULayer::getHeaderLen ( ) const
inlinevirtual
Returns
The size of STP configuration BPDU message

Reimplemented from pcpp::StpTopologyChangeBPDULayer.

Reimplemented in pcpp::RapidStpLayer.

◆ getMaximumAge()

double pcpp::StpConfigurationBPDULayer::getMaximumAge ( ) const

Returns maximum age of the BPDU message

Returns
Maximum age of BPDU in seconds

◆ getMessageAge()

double pcpp::StpConfigurationBPDULayer::getMessageAge ( ) const

Returns age of the BPDU message

Returns
Age of BPDU in seconds

◆ getPathCost()

uint32_t pcpp::StpConfigurationBPDULayer::getPathCost ( ) const

Returns the value of the cost of path

Returns
Cost of path

◆ getPortId()

uint16_t pcpp::StpConfigurationBPDULayer::getPortId ( ) const

Returns the port identifier

Returns
Port identifier

◆ getRootId()

uint64_t pcpp::StpConfigurationBPDULayer::getRootId ( ) const

Returns the root bridge identifier

Returns
Root bridge identifier

◆ getRootPriority()

uint16_t pcpp::StpConfigurationBPDULayer::getRootPriority ( ) const

Returns the priority of root bridge

Returns
Priority of root bridge

◆ getRootSystemID()

pcpp::MacAddress pcpp::StpConfigurationBPDULayer::getRootSystemID ( ) const
inline

Returns the system identifier of root bridge

Returns
System identifier of root bridge

◆ getRootSystemIDExtension()

uint16_t pcpp::StpConfigurationBPDULayer::getRootSystemIDExtension ( ) const

Returns the system identifier extension of root bridge

Returns
System extension of root bridge

◆ getStpConfHeader()

stp_conf_bpdu* pcpp::StpConfigurationBPDULayer::getStpConfHeader ( ) const
inline

Get a pointer to configuration BPDU message

Returns
A pointer to configuration BPDU message

◆ getTransmissionInterval()

double pcpp::StpConfigurationBPDULayer::getTransmissionInterval ( ) const

Returns the BPDU transmission interval

Returns
Value of the transmission interval in seconds

◆ isDataValid()

static bool pcpp::StpConfigurationBPDULayer::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 Configuration BPDU packet
[in]dataLenThe length of the byte stream
Returns
True if the data is valid and can represent an Spanning Tree packet

◆ setBridgeId()

void pcpp::StpConfigurationBPDULayer::setBridgeId ( uint64_t  value)

Sets the bridge identifier

Parameters
[in]valueBridge identifier

◆ setBridgePriority()

void pcpp::StpConfigurationBPDULayer::setBridgePriority ( uint16_t  value)

Sets the priority of bridge

Parameters
[in]valuePriority of bridge

◆ setBridgeSystemID()

void pcpp::StpConfigurationBPDULayer::setBridgeSystemID ( const pcpp::MacAddress value)

Sets the system identifier of bridge

Parameters
[in]valueSystem identifier of bridge

◆ setBridgeSystemIDExtension()

void pcpp::StpConfigurationBPDULayer::setBridgeSystemIDExtension ( uint16_t  value)

Sets the system identifier extension of bridge

Parameters
[in]valueSystem extension of bridge

◆ setFlag()

void pcpp::StpConfigurationBPDULayer::setFlag ( uint8_t  value)
inline

Returns the flags of configuration message which indicates purpose of BPDU

Parameters
[in]valueFlags of the configuration message

◆ setForwardDelay()

void pcpp::StpConfigurationBPDULayer::setForwardDelay ( double  value)

Sets the delay for STP message

Parameters
[in]valueValue of the forward delay in seconds

◆ setMaximumAge()

void pcpp::StpConfigurationBPDULayer::setMaximumAge ( double  value)

Sets maximum age of the BPDU message

Parameters
[in]valueMaximum age of BPDU in seconds

◆ setMessageAge()

void pcpp::StpConfigurationBPDULayer::setMessageAge ( double  value)

Sets age of the BPDU message

Parameters
[in]valueAge of BPDU in seconds

◆ setPathCost()

void pcpp::StpConfigurationBPDULayer::setPathCost ( uint32_t  value)

Sets the value of the cost of path

Parameters
[in]valueCost of path

◆ setPortId()

void pcpp::StpConfigurationBPDULayer::setPortId ( uint16_t  value)

Sets the port identifier

Parameters
[in]valuePort identifier

◆ setRootId()

void pcpp::StpConfigurationBPDULayer::setRootId ( uint64_t  value)

Sets the root bridge identifier

Parameters
[in]valueRoot bridge identifier

◆ setRootPriority()

void pcpp::StpConfigurationBPDULayer::setRootPriority ( uint16_t  value)

Sets the priority of root bridge

Parameters
[in]valuePriority of root bridge

◆ setRootSystemID()

void pcpp::StpConfigurationBPDULayer::setRootSystemID ( const pcpp::MacAddress value)

Sets the system identifier of root bridge

Parameters
[in]valueSystem identifier of root bridge

◆ setRootSystemIDExtension()

void pcpp::StpConfigurationBPDULayer::setRootSystemIDExtension ( uint16_t  value)

Sets the system identifier extension of root bridge

Parameters
[in]valueSystem extension of root bridge

◆ setTransmissionInterval()

void pcpp::StpConfigurationBPDULayer::setTransmissionInterval ( double  value)

Sets the BPDU transmission interval

Parameters
[in]valueValue of the transmission interval in seconds

◆ toString()

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

Reimplemented from pcpp::StpTopologyChangeBPDULayer.

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