Kea 2.7.6
isc::dhcp::PoolIterativeAllocationState Class Reference

Pool allocation state used by the iterative allocator. More...

#include <iterative_allocation_state.h>

+ Inheritance diagram for isc::dhcp::PoolIterativeAllocationState:

Public Member Functions

 PoolIterativeAllocationState (const asiolink::IOAddress &first)
 Constructor.
 
isc::asiolink::IOAddress getLastAllocated () const
 Returns the last address that was tried from this pool.
 
bool isLastAllocatedValid () const
 Checks if the last address is valid.
 
void resetLastAllocated ()
 Resets the last address to invalid.
 
void setLastAllocated (const asiolink::IOAddress &address)
 Sets the last address that was tried from this pool.
 
- Public Member Functions inherited from isc::dhcp::AllocationState
virtual ~AllocationState ()=default
 Virtual destructor.
 

Static Public Member Functions

static PoolIterativeAllocationStatePtr create (const PoolPtr &pool)
 Factory function creating the state instance from pool.
 

Detailed Description

Pool allocation state used by the iterative allocator.

It extends the base class with the information about the last allocated address in the pool.

Definition at line 84 of file iterative_allocation_state.h.

Constructor & Destructor Documentation

◆ PoolIterativeAllocationState()

isc::dhcp::PoolIterativeAllocationState::PoolIterativeAllocationState ( const asiolink::IOAddress & first)

Constructor.

Parameters
firstfirst address in the pool.

Definition at line 51 of file iterative_allocation_state.cc.

Member Function Documentation

◆ create()

PoolIterativeAllocationStatePtr isc::dhcp::PoolIterativeAllocationState::create ( const PoolPtr & pool)
static

Factory function creating the state instance from pool.

Parameters
poolinstance of the pool for which the allocation state should be instantiated.
Returns
new allocation state instance.

Definition at line 47 of file iterative_allocation_state.cc.

Referenced by isc::dhcp::Subnet4::createAllocators(), and isc::dhcp::Subnet6::createAllocators().

◆ getLastAllocated()

isc::asiolink::IOAddress isc::dhcp::PoolIterativeAllocationState::getLastAllocated ( ) const
inline

Returns the last address that was tried from this pool.

Returns
address or prefix that was last tried from this pool

Definition at line 102 of file iterative_allocation_state.h.

◆ isLastAllocatedValid()

bool isc::dhcp::PoolIterativeAllocationState::isLastAllocatedValid ( ) const
inline

Checks if the last address is valid.

Returns
true if the last address is valid, false otherwise.

Definition at line 109 of file iterative_allocation_state.h.

◆ resetLastAllocated()

void isc::dhcp::PoolIterativeAllocationState::resetLastAllocated ( )
inline

Resets the last address to invalid.

Definition at line 122 of file iterative_allocation_state.h.

◆ setLastAllocated()

void isc::dhcp::PoolIterativeAllocationState::setLastAllocated ( const asiolink::IOAddress & address)
inline

Sets the last address that was tried from this pool.

Parameters
addressaddress or prefix to that was tried last.

Definition at line 116 of file iterative_allocation_state.h.


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