PcapPlusPlus  22.11
pcpp::DhcpOptionBuilder Class Reference

#include <DhcpLayer.h>

Inheritance diagram for pcpp::DhcpOptionBuilder:
pcpp::TLVRecordBuilder

Public Member Functions

 DhcpOptionBuilder (DhcpOptionTypes optionType, const uint8_t *optionValue, uint8_t optionValueLen)
 
 DhcpOptionBuilder (DhcpOptionTypes optionType, uint8_t optionValue)
 
 DhcpOptionBuilder (DhcpOptionTypes optionType, uint16_t optionValue)
 
 DhcpOptionBuilder (DhcpOptionTypes optionType, uint32_t optionValue)
 
 DhcpOptionBuilder (DhcpOptionTypes optionType, const IPv4Address &optionValue)
 
 DhcpOptionBuilder (DhcpOptionTypes optionType, const std::string &optionValue)
 
 DhcpOptionBuilder (const DhcpOptionBuilder &other)
 
DhcpOptionBuilderoperator= (const DhcpOptionBuilder &other)
 
DhcpOption build () const
 

Detailed Description

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

Constructor & Destructor Documentation

◆ DhcpOptionBuilder() [1/7]

pcpp::DhcpOptionBuilder::DhcpOptionBuilder ( DhcpOptionTypes  optionType,
const uint8_t *  optionValue,
uint8_t  optionValueLen 
)
inline

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

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

◆ DhcpOptionBuilder() [2/7]

pcpp::DhcpOptionBuilder::DhcpOptionBuilder ( DhcpOptionTypes  optionType,
uint8_t  optionValue 
)
inline

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

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

◆ DhcpOptionBuilder() [3/7]

pcpp::DhcpOptionBuilder::DhcpOptionBuilder ( DhcpOptionTypes  optionType,
uint16_t  optionValue 
)
inline

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

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

◆ DhcpOptionBuilder() [4/7]

pcpp::DhcpOptionBuilder::DhcpOptionBuilder ( DhcpOptionTypes  optionType,
uint32_t  optionValue 
)
inline

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

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

◆ DhcpOptionBuilder() [5/7]

pcpp::DhcpOptionBuilder::DhcpOptionBuilder ( DhcpOptionTypes  optionType,
const IPv4Address optionValue 
)
inline

A c'tor for building DHCP options which have an IPv4Address value. The DhcpOption object can later be retrieved by calling build()

Parameters
[in]optionTypeDHCP option type
[in]optionValueThe IPv4 address option value

◆ DhcpOptionBuilder() [6/7]

pcpp::DhcpOptionBuilder::DhcpOptionBuilder ( DhcpOptionTypes  optionType,
const std::string &  optionValue 
)
inline

A c'tor for building DHCP options which have a string value. The DhcpOption object can later be retrieved by calling build()

Parameters
[in]optionTypeDHCP option type
[in]optionValueThe string option value

◆ DhcpOptionBuilder() [7/7]

pcpp::DhcpOptionBuilder::DhcpOptionBuilder ( const DhcpOptionBuilder other)
inline

A copy c'tor which copies all the data from another instance of DhcpOptionBuilder

Parameters
[in]otherThe instance to copy from

Member Function Documentation

◆ build()

DhcpOption pcpp::DhcpOptionBuilder::build ( ) const

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

Returns
The DhcpOption object

◆ operator=()

DhcpOptionBuilder& pcpp::DhcpOptionBuilder::operator= ( const DhcpOptionBuilder other)
inline

Assignment operator that copies all data from another instance of DhcpOptionBuilder

Parameters
[in]otherThe instance to assign from
Returns
A reference to the assignee