PcapPlusPlus  23.09
pcpp::DhcpV6Option Class Reference

#include <DhcpV6Layer.h>

Inheritance diagram for pcpp::DhcpV6Option:
pcpp::TLVRecord< uint16_t, uint16_t >

Public Member Functions

 DhcpV6Option (uint8_t *optionRawData)
 
virtual ~DhcpV6Option ()
 
DhcpV6OptionType getType () const
 
std::string getValueAsHexString () 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

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

Constructor & Destructor Documentation

◆ DhcpV6Option()

pcpp::DhcpV6Option::DhcpV6Option ( 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 option raw data

◆ ~DhcpV6Option()

virtual pcpp::DhcpV6Option::~DhcpV6Option ( )
inlinevirtual

A d'tor for this class, currently does nothing

Member Function Documentation

◆ getDataSize()

size_t pcpp::DhcpV6Option::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::DhcpV6Option::getTotalSize ( ) const
virtual
Returns
The total size of the TLV record (in bytes)

Implements pcpp::TLVRecord< uint16_t, uint16_t >.

◆ getType()

DhcpV6OptionType pcpp::DhcpV6Option::getType ( ) const
Returns
The option type converted to DhcpV6OptionType enum

◆ getValueAsHexString()

std::string pcpp::DhcpV6Option::getValueAsHexString ( ) const
Returns
The raw option value (byte array) as a hex string