PcapPlusPlus  21.05
pcpp::TcpOptionBuilder Class Reference

#include <TcpLayer.h>

Inheritance diagram for pcpp::TcpOptionBuilder:
pcpp::TLVRecordBuilder

Public Types

enum  NopEolOptionTypes { NOP, EOL }
 

Public Member Functions

 TcpOptionBuilder (TcpOptionType optionType, const uint8_t *optionValue, uint8_t optionValueLen)
 
 TcpOptionBuilder (TcpOptionType optionType, uint8_t optionValue)
 
 TcpOptionBuilder (TcpOptionType optionType, uint16_t optionValue)
 
 TcpOptionBuilder (TcpOptionType optionType, uint32_t optionValue)
 
 TcpOptionBuilder (NopEolOptionTypes optionType)
 
TcpOption build () const
 

Detailed Description

A class for building TCP option records. This builder receives the TCP option parameters in its c'tor, builds the TCP option raw buffer and provides a build() method to get a TcpOption object out of it

Member Enumeration Documentation

◆ NopEolOptionTypes

An enum to describe NOP and EOL TCP options. Used in one of this class's c'tors

Enumerator
NOP 

NOP TCP option

EOL 

EOL TCP option

Constructor & Destructor Documentation

◆ TcpOptionBuilder() [1/5]

pcpp::TcpOptionBuilder::TcpOptionBuilder ( TcpOptionType  optionType,
const uint8_t *  optionValue,
uint8_t  optionValueLen 
)
inline

A c'tor for building TCP options which their value is a byte array. The TcpOption object can be later retrieved by calling build()

Parameters
[in]optionTypeTCP option type
[in]optionValueA buffer containing the option value. This buffer is read-only and isn't modified in any way.
[in]optionValueLenOption value length in bytes

◆ TcpOptionBuilder() [2/5]

pcpp::TcpOptionBuilder::TcpOptionBuilder ( TcpOptionType  optionType,
uint8_t  optionValue 
)
inline

A c'tor for building TCP options which have a 1-byte value. The TcpOption object can be later retrieved by calling build()

Parameters
[in]optionTypeTCP option type
[in]optionValueA 1-byte option value

◆ TcpOptionBuilder() [3/5]

pcpp::TcpOptionBuilder::TcpOptionBuilder ( TcpOptionType  optionType,
uint16_t  optionValue 
)
inline

A c'tor for building TCP options which have a 2-byte value. The TcpOption object can be later retrieved by calling build()

Parameters
[in]optionTypeTCP option type
[in]optionValueA 2-byte option value

◆ TcpOptionBuilder() [4/5]

pcpp::TcpOptionBuilder::TcpOptionBuilder ( TcpOptionType  optionType,
uint32_t  optionValue 
)
inline

A c'tor for building TCP options which have a 4-byte value. The TcpOption object can be later retrieved by calling build()

Parameters
[in]optionTypeTCP option type
[in]optionValueA 4-byte option value

◆ TcpOptionBuilder() [5/5]

pcpp::TcpOptionBuilder::TcpOptionBuilder ( NopEolOptionTypes  optionType)

A c'tor for building TCP NOP and EOL options. These option types are special in that they contain only 1 byte which is the TCP option type (NOP or EOL). The TcpOption object can be later retrieved by calling build()

Parameters
[in]optionTypeAn enum value indicating which option type to build (NOP or EOL)

Member Function Documentation

◆ build()

TcpOption pcpp::TcpOptionBuilder::build ( ) const

Build the TcpOption object out of the parameters defined in the c'tor

Returns
The TcpOption object