Kea  1.9.9-git
isc::dhcp::PrefixLen Class Reference

Encapsulates prefix length. More...

#include <option_data_types.h>

Public Member Functions

 PrefixLen ()
 Default constructor. More...
 
 PrefixLen (const uint8_t prefix_len)
 Constructor. More...
 
uint8_t asUint8 () const
 Returns prefix length as uint8_t value. More...
 
unsigned int asUnsigned () const
 Returns prefix length as unsigned int. More...
 

Detailed Description

Encapsulates prefix length.

Definition at line 277 of file option_data_types.h.

Constructor & Destructor Documentation

isc::dhcp::PrefixLen::PrefixLen ( )
inline

Default constructor.

Definition at line 281 of file option_data_types.h.

isc::dhcp::PrefixLen::PrefixLen ( const uint8_t  prefix_len)
inlineexplicit

Constructor.

This constructor checks if the specified prefix length is in the range of 0 to 128.

Parameters
prefix_lenPrefix length value.
Exceptions
isc::OutOfRangeIf specified prefix length is greater than 128.

Definition at line 290 of file option_data_types.h.

Member Function Documentation

uint8_t isc::dhcp::PrefixLen::asUint8 ( ) const
inline

Returns prefix length as uint8_t value.

Definition at line 295 of file option_data_types.h.

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

unsigned int isc::dhcp::PrefixLen::asUnsigned ( ) const
inline

Returns prefix length as unsigned int.

This is useful to convert the value to a numeric type which can be logged directly. See PSIDLen::asUnsigned for the use cases of this accessor.

Definition at line 304 of file option_data_types.h.


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