Kea 2.7.6
isc::dhcp::AllocEngine::Resource Class Reference

Defines a single hint. More...

#include <alloc_engine.h>

Public Member Functions

 Resource (const isc::asiolink::IOAddress &address, const uint8_t prefix_len=128, const uint32_t preferred=0, const uint32_t valid=0)
 Default constructor.
 
bool equals (const Resource &other) const
 Compares two AllocEngine::Resource objects for equality.
 
isc::asiolink::IOAddress getAddress () const
 Returns the address.
 
uint32_t getPreferred () const
 Returns the optional preferred lifetime.
 
uint8_t getPrefixLength () const
 Returns the prefix length.
 
uint32_t getValid () const
 Returns the optional valid lifetime.
 
bool operator== (const Resource &other) const
 Equality operator.
 

Protected Attributes

isc::asiolink::IOAddress address_
 The address or prefix.
 
uint32_t preferred_
 The preferred lifetime (0 when not set).
 
uint8_t prefix_len_
 The prefix length (128 for an address).
 
uint32_t valid_
 The valid lifetime (0 when not set).
 

Detailed Description

Defines a single hint.

This is an entry that represents what the client had requested, either an address or a prefix. Prefix length is 128 for regular addresses. Optionally it provides wanted preferred and valid lifetimes.

Note
Seems to be used only for DHCPv6.

Definition at line 83 of file alloc_engine.h.

Constructor & Destructor Documentation

◆ Resource()

isc::dhcp::AllocEngine::Resource::Resource ( const isc::asiolink::IOAddress & address,
const uint8_t prefix_len = 128,
const uint32_t preferred = 0,
const uint32_t valid = 0 )
inline

Default constructor.

Parameters
addressthe address or prefix
prefix_lenthe prefix length (defaults to 128)
preferredthe optional preferred lifetime, defaults to 0, meaning not specified
validthe optional valid lifetime, defaults to 0, meaning not specified

Definition at line 94 of file alloc_engine.h.

Member Function Documentation

◆ equals()

bool isc::dhcp::AllocEngine::Resource::equals ( const Resource & other) const
inline

Compares two AllocEngine::Resource objects for equality.

Parameters
otherobject to be compared with this object
Returns
true if objects are equal, false otherwise.

Definition at line 135 of file alloc_engine.h.

References address_, and prefix_len_.

Referenced by operator==().

◆ getAddress()

isc::asiolink::IOAddress isc::dhcp::AllocEngine::Resource::getAddress ( ) const
inline

Returns the address.

Returns
the address or prefix

Definition at line 105 of file alloc_engine.h.

References address_.

Referenced by isc::dhcp::AllocEngine::ResourceCompare::operator()().

◆ getPreferred()

uint32_t isc::dhcp::AllocEngine::Resource::getPreferred ( ) const
inline

Returns the optional preferred lifetime.

Returns
the preferred lifetime (0 if not set)

Definition at line 119 of file alloc_engine.h.

References preferred_.

◆ getPrefixLength()

uint8_t isc::dhcp::AllocEngine::Resource::getPrefixLength ( ) const
inline

Returns the prefix length.

Returns
the prefix length

Definition at line 112 of file alloc_engine.h.

References prefix_len_.

Referenced by isc::dhcp::AllocEngine::ResourceCompare::operator()().

◆ getValid()

uint32_t isc::dhcp::AllocEngine::Resource::getValid ( ) const
inline

Returns the optional valid lifetime.

Returns
the valid lifetime (0 if not set)

Definition at line 126 of file alloc_engine.h.

References valid_.

◆ operator==()

bool isc::dhcp::AllocEngine::Resource::operator== ( const Resource & other) const
inline

Equality operator.

Parameters
otherobject to be compared with this object
Returns
true if objects are equal, false otherwise.

Definition at line 145 of file alloc_engine.h.

References equals().

+ Here is the call graph for this function:

Member Data Documentation

◆ address_

isc::asiolink::IOAddress isc::dhcp::AllocEngine::Resource::address_
protected

The address or prefix.

Definition at line 152 of file alloc_engine.h.

Referenced by equals(), and getAddress().

◆ preferred_

uint32_t isc::dhcp::AllocEngine::Resource::preferred_
protected

The preferred lifetime (0 when not set).

Definition at line 158 of file alloc_engine.h.

Referenced by getPreferred().

◆ prefix_len_

uint8_t isc::dhcp::AllocEngine::Resource::prefix_len_
protected

The prefix length (128 for an address).

Definition at line 155 of file alloc_engine.h.

Referenced by equals(), and getPrefixLength().

◆ valid_

uint32_t isc::dhcp::AllocEngine::Resource::valid_
protected

The valid lifetime (0 when not set).

Definition at line 161 of file alloc_engine.h.

Referenced by getValid().


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