PcapPlusPlus  23.09
pcpp::RapidStpLayer Class Reference

#include <StpLayer.h>

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

Public Member Functions

 RapidStpLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 RapidStpLayer ()
 
rstp_conf_bpdugetRstpConfHeader () const
 
uint8_t getVersion1Len () const
 
void setVersion1Len (uint8_t value)
 
size_t getHeaderLen () const
 
void parseNextLayer ()
 Parses next layer.
 
std::string toString () const
 
- Public Member Functions inherited from pcpp::StpConfigurationBPDULayer
 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)
 
- 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
 
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::StpConfigurationBPDULayer
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 Rapid Spanning Tree Protocol (RSTP)

Constructor & Destructor Documentation

◆ RapidStpLayer() [1/2]

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

◆ RapidStpLayer() [2/2]

pcpp::RapidStpLayer::RapidStpLayer ( )

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

Member Function Documentation

◆ getHeaderLen()

size_t pcpp::RapidStpLayer::getHeaderLen ( ) const
inlinevirtual
Returns
The size of Rapid STP message

Reimplemented from pcpp::StpConfigurationBPDULayer.

◆ getRstpConfHeader()

rstp_conf_bpdu* pcpp::RapidStpLayer::getRstpConfHeader ( ) const
inline

Get a pointer to Rapid STP header

Returns
A pointer to Rapid STP header

◆ getVersion1Len()

uint8_t pcpp::RapidStpLayer::getVersion1Len ( ) const
inline

Returns the length of version1 field. Fixed at 0x0 for Rapid STP

Returns
Length of the version1 field

◆ isDataValid()

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

◆ setVersion1Len()

void pcpp::RapidStpLayer::setVersion1Len ( uint8_t  value)
inline

Returns the length of version1 field

Parameters
[in]valueLength of the version1 field

◆ toString()

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

Reimplemented from pcpp::StpConfigurationBPDULayer.

Reimplemented in pcpp::MultipleStpLayer.