PcapPlusPlus
|
#include <IPv4Layer.h>
Public Member Functions | |
template<typename T > | |
T | getValueAs (int valueOffset=0) |
std::vector< IPv4Address > | getValueAsIpList () |
IPv4TimestampOptionValue | getTimestampOptionValue () |
size_t | getTotalSize () const |
size_t | getDataSize () |
IPv4OptionTypes | getType () |
Public Attributes | |
uint8_t | opCode |
uint8_t | len |
uint8_t | value [] |
Representing a IPv4 option in a TLV (type-length-value) structure
|
inline |
|
inline |
A method for parsing the IPv4 timestamp option value. This method is relevant only for IPv4 timestamp option. For other option types an empty result will be returned. The returned structure contains the timestamp value type (timestamp only, timestamp + IP addresses, etc.) as well as 2 vectors containing the list of timestamps and the list of IP addresses (if applicable for the timestamp value type). Blank timestamps or IP addresses (meaning zeroed values - timestamp=0 or IP address=0.0.0.0) will not be added to the lists. If some error occurs during the parsing or the value is invalid an empty result is returned
|
inline |
|
inline |
|
inline |
A templated method to retrieve the IPv4 option data as a certain type T. For example, if IPv4 option data is 4B (integer) then this method should be used as getValueAs<int>() and it will return the IPv4 option data as an integer.
Notice this return value is a copy of the data, not a pointer to the actual data
[in] | valueOffset | An optional parameter that specifies where to start copy the IPv4 option data. For example: if option data is 20 bytes and you need only the 4 last bytes as integer then use this method like this: getValueAs<int>(16). The default is 0 - start copying from the beginning of option data |
|
inline |
A method for parsing the IPv4 option value as an IP list. This method is relevant only for certain types of IPv4 options which their value is a list of IPv4 addresses such as IPV4OPT_RecordRoute, IPV4OPT_StrictSourceRoute, IPV4OPT_LooseSourceRoute, etc. This method returns a vector of the IPv4 addresses. Blank IP addresses (meaning zeroed addresses - 0.0.0.0) will not be added to the returned list. If some error occurs during the parsing or the value is invalid an empty vector is returned
uint8_t pcpp::IPv4OptionData::len |
IPv4 option length
uint8_t pcpp::IPv4OptionData::opCode |
IPv4 option code, should be of type pcpp::IPv4OptionTypes
uint8_t pcpp::IPv4OptionData::value[] |
IPv4 option value