PcapPlusPlus
|
#include <PPPoELayer.h>
Public Member Functions | |
template<typename T > | |
T | getTagDataAs (int tagDataOffset=0) |
template<typename T > | |
void | setTagData (T value, int tagDataOffset=0) |
size_t | getTagTotalSize () const |
PPPoEDiscoveryLayer::PPPoETagTypes | getType () |
Public Attributes | |
uint16_t | tagType |
uint16_t | tagDataLength |
uint8_t | tagData [] |
Represents a PPPoE tag and its data
|
inline |
A templated method to retrieve the tag data as a certain type T. For example, if tag data is 4B (integer) then this method should be used as getTagDataAs<int>() and it will return the tag data as integer.
Notice this return value is a copy of the data, not a pointer to the actual data
[in] | tagDataOffset | An optional parameter that specifies where to start copy the tag data. For example: if tag data is 20 bytes and you need only the 4 last bytes as integer then use this method like this: getTagDataAs<int>(16). The default is 0 - start copy from the beginning of tag data |
size_t pcpp::PPPoEDiscoveryLayer::PPPoETag::getTagTotalSize | ( | ) | const |
PPPoEDiscoveryLayer::PPPoETagTypes pcpp::PPPoEDiscoveryLayer::PPPoETag::getType | ( | ) |
|
inline |
A templated method to copy data of type T into the tag data. For example: if tag data is 4[Bytes] long use this method like this to set an integer "num" into tag data: setTagData<int>(num)
[in] | value | The value of type T to copy to tag data |
[in] | tagDataOffset | An optional parameter that specifies where to start set the tag data. For example: if tag data is 20 bytes and you only need to set the 4 last bytes as integer then use this method like this: setTagDataAs<int>(num, 16). The default is 0 - start copy to the beginning of tag data |
uint8_t pcpp::PPPoEDiscoveryLayer::PPPoETag::tagData[] |
A pointer to the tag data. It's recommended to use getTagDataAs() to retrieve the tag data or setTagData() to set tag data
uint16_t pcpp::PPPoEDiscoveryLayer::PPPoETag::tagDataLength |
The length of the tag data
uint16_t pcpp::PPPoEDiscoveryLayer::PPPoETag::tagType |
The type of the data, can be converted to PPPoEDiscoveryLayer::PPPoETagTypes enum (or use getType())