Kea  2.3.8
isc::dhcp::PSIDLen Class Reference

Encapsulates PSID length. More...

#include <option_data_types.h>

Public Member Functions

 PSIDLen ()
 Default constructor. More...
 PSIDLen (const uint8_t psid_len)
 Constructor. More...
uint8_t asUint8 () const
 Returns PSID length as uint8_t value. More...
unsigned int asUnsigned () const
 Returns PSID length as unsigned int. More...

Detailed Description

Encapsulates PSID length.

Definition at line 201 of file option_data_types.h.

Constructor & Destructor Documentation

◆ PSIDLen() [1/2]

isc::dhcp::PSIDLen::PSIDLen ( )

Default constructor.

Definition at line 205 of file option_data_types.h.

◆ PSIDLen() [2/2]

isc::dhcp::PSIDLen::PSIDLen ( const uint8_t  psid_len)


It checks that the specified value is not greater than 16, which is a maximum value for the PSID length.

psid_lenPSID length.
isc::OutOfRangeIf specified PSID length is greater than 16.

Definition at line 214 of file option_data_types.h.

References asUnsigned(), and isc_throw.

+ Here is the call graph for this function:

Member Function Documentation

◆ asUint8()

uint8_t isc::dhcp::PSIDLen::asUint8 ( ) const

Returns PSID length as uint8_t value.

Definition at line 223 of file option_data_types.h.

Referenced by isc::dhcp::OptionDataTypeUtil::writePsid().

◆ asUnsigned()

unsigned int isc::dhcp::PSIDLen::asUnsigned ( ) const

Returns PSID length as unsigned int.

This is useful to convert the value to a numeric type which can be logged directly. Note that the uint8_t value has to be cast to an integer value to be logged as a number. This is because the uint8_t is often implemented as char, in which case directly logging an uint8_t value prints a character rather than a number.

Definition at line 235 of file option_data_types.h.

Referenced by PSIDLen(), and isc::dhcp::OptionDataTypeUtil::writePsid().

The documentation for this class was generated from the following file: