PcapPlusPlus  21.05+
pcpp::PPPoEDiscoveryLayer::PPPoETag Class Reference

#include <PPPoELayer.h>

Inheritance diagram for pcpp::PPPoEDiscoveryLayer::PPPoETag:
pcpp::TLVRecord< uint16_t, uint16_t >

Public Member Functions

 PPPoETag (uint8_t *tagRawData)
 
virtual ~PPPoETag ()
 
PPPoEDiscoveryLayer::PPPoETagTypes getType () const
 
std::string getValueAsString () const
 
size_t getTotalSize () const
 
size_t getDataSize () const
 
- Public Member Functions inherited from pcpp::TLVRecord< uint16_t, uint16_t >
 TLVRecord (uint8_t *recordRawData)
 
 TLVRecord (const TLVRecord &other)
 
virtual ~TLVRecord ()
 
void assign (uint8_t *recordRawData)
 
TLVRecordoperator= (const TLVRecord &other)
 
bool operator== (const TLVRecord &rhs) const
 
bool operator!= (const TLVRecord &rhs) const
 
uint16_t getType () const
 
uint8_t * getValue () const
 
bool isNull () const
 
bool isNotNull () const
 
uint8_t * getRecordBasePtr () const
 
void purgeRecordData ()
 
getValueAs (size_t offset=0) const
 
bool setValue (T newValue, int valueOffset=0)
 

Detailed Description

Represents a PPPoE tag and its data

Constructor & Destructor Documentation

◆ PPPoETag()

pcpp::PPPoEDiscoveryLayer::PPPoETag::PPPoETag ( uint8_t *  tagRawData)
inline

A c'tor that gets a pointer to the tag raw data (byte array)

Parameters
[in]tagRawDataA pointer to the tag raw data

◆ ~PPPoETag()

virtual pcpp::PPPoEDiscoveryLayer::PPPoETag::~PPPoETag ( )
inlinevirtual

A d'tor for this class, currently does nothing

Member Function Documentation

◆ getDataSize()

size_t pcpp::PPPoEDiscoveryLayer::PPPoETag::getDataSize ( ) const
virtual
Returns
The size of the record value (meaning the size of the 'V' part in TLV)

Implements pcpp::TLVRecord< uint16_t, uint16_t >.

◆ getTotalSize()

size_t pcpp::PPPoEDiscoveryLayer::PPPoETag::getTotalSize ( ) const
virtual
Returns
The total size of the TLV record (in bytes)

Implements pcpp::TLVRecord< uint16_t, uint16_t >.

◆ getType()

PPPoEDiscoveryLayer::PPPoETagTypes pcpp::PPPoEDiscoveryLayer::PPPoETag::getType ( ) const
Returns
The tag type converted to PPPoEDiscoveryLayer::PPPoETagTypes enum

◆ getValueAsString()

std::string pcpp::PPPoEDiscoveryLayer::PPPoETag::getValueAsString ( ) const
inline

Retrieve the tag data as string. Relevant only if the tag value is indeed a string

Returns
The tag data as string