| Kea 3.0.2-git

isc::dhcp::PrefixLen Class Reference

Encapsulates prefix length. More...

`#include <option_data_types.h>`

## Public Member Functions
| PrefixLen ()
| Default constructor.
| PrefixLen (const uint8_t prefix_len)
| Constructor.
uint8_t | asUint8 () const
| Returns prefix length as uint8_t value.
unsigned int | asUnsigned () const
| Returns prefix length as unsigned int.

## Detailed Description

Encapsulates prefix length.

Definition at line 280 of file option_data_types.h.

## Constructor & Destructor Documentation

## ◆ PrefixLen() [1/2]

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

Default constructor.

Definition at line 284 of file option_data_types.h.

## ◆ PrefixLen() [2/2]

isc::dhcp::PrefixLen::PrefixLen | ( | const uint8_t | prefix_len | ) |
| inline explicit

Constructor.

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

Parameters

  prefix_len | Prefix length value.

Exceptions

  isc::OutOfRange | If specified prefix length is greater than 128.

Definition at line 293 of file option_data_types.h.

## Member Function Documentation

## ◆ asUint8()

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

Returns prefix length as uint8_t value.

Definition at line 298 of file option_data_types.h.

Referenced by isc::dhcp::OptionDataTypeUtil::readPrefix(), and isc::dhcp::OptionDataTypeUtil::writePrefix().

## ◆ asUnsigned()

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 307 of file option_data_types.h.

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

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

- option_data_types.h