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

size_t pcpp::IPv6TLVOptionHeader::TLVOption::getDataSize ( )
The size of the option data
size_t pcpp::IPv6TLVOptionHeader::TLVOption::getTotalSize ( ) const
The total size of this option (in bytes)
template<typename T >
T pcpp::IPv6TLVOptionHeader::TLVOption::getValueAs ( )

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

The option data as type T

Member Data Documentation

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

Option data (variable size)

uint8_t pcpp::IPv6TLVOptionHeader::TLVOption::optionLen

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

uint8_t pcpp::IPv6TLVOptionHeader::TLVOption::optionType

Option type