PcapPlusPlus  23.09
pcpp::LLCLayer Class Reference

#include <LLCLayer.h>

Inheritance diagram for pcpp::LLCLayer:
pcpp::Layer pcpp::IDataContainer

Public Member Functions

 LLCLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
 
 LLCLayer (uint8_t dsap, uint8_t ssap, uint8_t control)
 
llc_headergetLlcHeader () const
 
void parseNextLayer ()
 Parses the next layer. Currently only STP supported as next layer.
 
void computeCalculateFields ()
 Does nothing for this layer.
 
size_t getHeaderLen () const
 
std::string toString () const
 
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)
 

Detailed Description

Represents Logical Link Control layer messages

Constructor & Destructor Documentation

◆ LLCLayer() [1/2]

pcpp::LLCLayer::LLCLayer ( 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 (will be casted to llc_header)
[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

◆ LLCLayer() [2/2]

pcpp::LLCLayer::LLCLayer ( uint8_t  dsap,
uint8_t  ssap,
uint8_t  control 
)

A constructor that creates the LLC layer from provided values

Parameters
[in]dsapDestination Service Access Point
[in]ssapSource Service Access Point
[in]controlControl Field

Member Function Documentation

◆ getHeaderLen()

size_t pcpp::LLCLayer::getHeaderLen ( ) const
inlinevirtual
Returns
Get the size of the LLC header

Implements pcpp::Layer.

◆ getLlcHeader()

llc_header* pcpp::LLCLayer::getLlcHeader ( ) const
inline

Get a pointer to Logical Link Control (LLC) layer header

Returns
Pointer to LLC header

◆ getOsiModelLayer()

OsiModelLayer pcpp::LLCLayer::getOsiModelLayer ( ) const
inlinevirtual
Returns
The OSI layer level of LLC (Data Link Layer).

Implements pcpp::Layer.

◆ isDataValid()

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

A static method that validates the input data

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

◆ toString()

std::string pcpp::LLCLayer::toString ( ) const
virtual
Returns
Returns the protocol info as readable string

Implements pcpp::Layer.