Kea  2.3.3-git
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, const uint32_t preferred=0, const uint32_t valid=0)
 Default constructor. More...
 
bool equals (const Resource &other) const
 Compares two AllocEngine::Resource objects for equality. More...
 
isc::asiolink::IOAddress getAddress () const
 Returns the address. More...
 
uint32_t getPreferred () const
 Returns the optional preferred lifetime. More...
 
uint8_t getPrefixLength () const
 Returns the prefix length. More...
 
uint32_t getValid () const
 Returns the optional valid lifetime. More...
 
bool operator== (const Resource &other) const
 Equality operator. More...
 

Protected Attributes

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

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,
const uint32_t  preferred = 0,
const uint32_t  valid = 0 
)
inline

Default constructor.

Parameters
addressthe address or prefix
prefix_lenthe prefix length (128 for addresses)
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: