PcapPlusPlus
pcpp::TcpOption Class Reference

#include <TcpLayer.h>

Inheritance diagram for pcpp::TcpOption:
pcpp::TLVRecord

Public Member Functions

 TcpOption (uint8_t *optionRawData)
 
 ~TcpOption ()
 
TcpOptionType getTcpOptionType ()
 
size_t getTotalSize () const
 
size_t getDataSize ()
 
- Public Member Functions inherited from pcpp::TLVRecord
 TLVRecord (uint8_t *recordRawData)
 
 TLVRecord (const TLVRecord &other)
 
virtual ~TLVRecord ()
 
TLVRecordoperator= (const TLVRecord &other)
 
bool operator== (const TLVRecord &rhs)
 
uint8_t getType ()
 
uint8_t * getValue ()
 
bool isNull ()
 
bool isNotNull ()
 
uint8_t * getRecordBasePtr ()
 
void purgeRecordData ()
 
template<typename T >
getValueAs (size_t offset=0)
 
template<typename T >
bool setValue (T newValue, int valueOffset=0)
 

Detailed Description

A wrapper class for TCP options. This class does not create or modify TCP option records, but rather serves as a wrapper and provides useful methods for retrieving data from them

Constructor & Destructor Documentation

◆ TcpOption()

pcpp::TcpOption::TcpOption ( uint8_t *  optionRawData)
inline

A c'tor for this class that gets a pointer to the option raw data (byte array)

Parameters
[in]optionRawDataA pointer to the TCP option raw data

◆ ~TcpOption()

pcpp::TcpOption::~TcpOption ( )
inline

A d'tor for this class, currently does nothing

Member Function Documentation

◆ getDataSize()

size_t pcpp::TcpOption::getDataSize ( )
inlinevirtual
Returns
The size of the record value (meaning the size of the 'V' part in TLV)

Implements pcpp::TLVRecord.

◆ getTcpOptionType()

TcpOptionType pcpp::TcpOption::getTcpOptionType ( )
inline
Returns
TCP option type casted as pcpp::TcpOptionType enum. If the data is null a value of TCPOPT_Unknown is returned

◆ getTotalSize()

size_t pcpp::TcpOption::getTotalSize ( ) const
inlinevirtual
Returns
The total size of the TLV record (in bytes)

Implements pcpp::TLVRecord.