PcapPlusPlus
pcpp::IPv6TLVOptionHeader::TLVOption Struct Reference

#include <IPv6Extensions.h>

Public Member Functions

template<typename T >
getValueAs ()
 
size_t getTotalSize () const
 
size_t getDataSize ()
 

Public Attributes

uint8_t optionType
 
uint8_t optionLen
 
uint8_t optionData []
 

Detailed Description

A struct representing a Type-Length-Value (TLV) option. These type of options are used inside Hop-By-Hop and Destinations IPv6 extensions

Member Function Documentation

◆ getDataSize()

size_t pcpp::IPv6TLVOptionHeader::TLVOption::getDataSize ( )
inline
Returns
The size of the option data

◆ getTotalSize()

size_t pcpp::IPv6TLVOptionHeader::TLVOption::getTotalSize ( ) const
inline
Returns
The total size of this option (in bytes)

◆ getValueAs()

template<typename T >
T pcpp::IPv6TLVOptionHeader::TLVOption::getValueAs ( )
inline

A templated method to retrieve the option data as a certain type T. For example, if option data is 4B long (integer) then this method should be used as getValueAs<int>() and it will return the option data as an integer.
Notice this return value is a copy of the data, not a pointer to the actual data

Returns
The option data as type T

Member Data Documentation

◆ optionData

uint8_t pcpp::IPv6TLVOptionHeader::TLVOption::optionData[]

Option data (variable size)

◆ optionLen

uint8_t pcpp::IPv6TLVOptionHeader::TLVOption::optionLen

Option length in bytes, not including TLVOption::optionType field and this field

◆ optionType

uint8_t pcpp::IPv6TLVOptionHeader::TLVOption::optionType

Option type