PcapPlusPlus  Next
pcpp::NdpOption Class Reference

#include <NdpLayer.h>

Inheritance diagram for pcpp::NdpOption:
pcpp::TLVRecord< uint8_t, uint8_t >

Public Member Functions

 NdpOption (uint8_t *optionRawData)
 
 ~NdpOption () override=default
 
NDPNeighborOptionTypes getNdpOptionType () const
 
size_t getTotalSize () const override
 
size_t getDataSize () const override
 
- Public Member Functions inherited from pcpp::TLVRecord< uint8_t, uint8_t >
 TLVRecord (uint8_t *recordRawData)
 
 TLVRecord (const TLVRecord &other)
 
virtual ~TLVRecord ()=default
 
void assign (uint8_t *recordRawData)
 
TLVRecordoperator= (const TLVRecord &other)
 
bool operator== (const TLVRecord &rhs) const
 
bool operator!= (const TLVRecord &rhs) const
 
uint8_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)
 

Additional Inherited Members

- Static Public Member Functions inherited from pcpp::TLVRecord< uint8_t, uint8_t >
static bool canAssign (const uint8_t *recordRawData, size_t tlvDataLen)
 

Detailed Description

A wrapper class for NDP options. This class does not create or modify NDP option records, but rather serves as a wrapper and provides useful methods for retrieving data from them

Constructor & Destructor Documentation

◆ NdpOption()

pcpp::NdpOption::NdpOption ( uint8_t *  optionRawData)
inlineexplicit

A c'tor for this class that gets a pointer to the option raw data (byte array)

Parameters
[in]optionRawDataA pointer to the NDP option raw data

◆ ~NdpOption()

pcpp::NdpOption::~NdpOption ( )
overridedefault

A d'tor for this class, currently does nothing

Member Function Documentation

◆ getDataSize()

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

Implements pcpp::TLVRecord< uint8_t, uint8_t >.

◆ getNdpOptionType()

NDPNeighborOptionTypes pcpp::NdpOption::getNdpOptionType ( ) const
inline
Returns
NDP option type casted as pcpp::NDPNeighborOptionTypes enum. If the data is null a value of NDP_OPTION_UNKNOWN is returned

◆ getTotalSize()

size_t pcpp::NdpOption::getTotalSize ( ) const
inlineoverridevirtual
Returns
The total size of the TLV record (in bytes)

Implements pcpp::TLVRecord< uint8_t, uint8_t >.