|
PcapPlusPlus
|
#include <TcpLayer.h>
Public Member Functions | |
| template<typename T > | |
| T | getValueAs (int valueOffset=0) |
| template<typename T > | |
| void | setValue (T newValue, int valueOffset=0) |
| size_t | getTotalSize () const |
| TcpOption | getType () |
Public Attributes | |
| uint8_t | option |
| uint8_t | len |
| uint8_t | value [] |
Representing a TCP option in a TLV (type-length-value) type
|
inline |
|
inline |
|
inline |
A templated method to retrieve the TCP option data as a certain type T. For example, if option data is 4B (integer) then this method should be used as getValueAs<int>() and it will return the TCP 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 TCP 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 copy from the beginning of option data |
|
inline |
A templated method to copy data of type T into the TCP option data. For example: if option data is 4[Bytes] long use this method with <int> to set an integer value into the TCP option data: setValue<int>(num)
| [in] | newValue | The value of type T to copy to TCP option data |
| [in] | valueOffset | An optional parameter that specifies where to start set the option data. For example: if option data is 20 bytes long and you only need to set the 4 last bytes as integer then use this method like this: setValue<int>(num, 16). The default is 0 - start copy from the beginning of option data |
| uint8_t pcpp::TcpOptionData::len |
TCP option length
| uint8_t pcpp::TcpOptionData::option |
TCP option type, should be on of TcpOption
| uint8_t pcpp::TcpOptionData::value[] |
TCP option value