Kea  1.9.9-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 324 of file alloc_engine.h.

Constructor & Destructor Documentation

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 335 of file alloc_engine.h.

Member Function Documentation

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 376 of file alloc_engine.h.

References address_, and prefix_len_.

Referenced by operator==().

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

Returns the address.

Returns
the address or prefix

Definition at line 346 of file alloc_engine.h.

References address_.

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

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 360 of file alloc_engine.h.

References preferred_.

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

Returns the prefix length.

Returns
the prefix length

Definition at line 353 of file alloc_engine.h.

References prefix_len_.

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

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 367 of file alloc_engine.h.

References valid_.

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 386 of file alloc_engine.h.

References equals().

+ Here is the call graph for this function:

Member Data Documentation

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

The address or prefix.

Definition at line 393 of file alloc_engine.h.

Referenced by equals(), and getAddress().

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

The preferred lifetime (0 when not set).

Definition at line 399 of file alloc_engine.h.

Referenced by getPreferred().

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

The prefix length (128 for an address).

Definition at line 396 of file alloc_engine.h.

Referenced by equals(), and getPrefixLength().

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

The valid lifetime (0 when not set).

Definition at line 402 of file alloc_engine.h.

Referenced by getValid().


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