Kea 2.7.5
isc::dhcp::PoolRandomAllocationState Class Reference

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

#include <random_allocation_state.h>

+ Inheritance diagram for isc::dhcp::PoolRandomAllocationState:

Public Member Functions

 PoolRandomAllocationState (const asiolink::IOAddress &first, const asiolink::IOAddress &last)
 Constructor from an IP address pool.
 
 PoolRandomAllocationState (const asiolink::IOAddress &first, const asiolink::IOAddress &last, const uint8_t delegated)
 Constructor from a delegated prefix pool.
 
IPRangePermutationPtr getPermutation () const
 Returns a pointer to the permutation of addresses or delegated prefixes.
 
- Public Member Functions inherited from isc::dhcp::AllocationState
virtual ~AllocationState ()=default
 Virtual destructor.
 

Static Public Member Functions

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

Detailed Description

Pool allocation state used by the random allocator.

It extends the base class with the mechanism that maintains an address or delegated prefix pool permutation. The permutation serves random, non-repeating leases.

Definition at line 30 of file random_allocation_state.h.

Constructor & Destructor Documentation

◆ PoolRandomAllocationState() [1/2]

isc::dhcp::PoolRandomAllocationState::PoolRandomAllocationState ( const asiolink::IOAddress & first,
const asiolink::IOAddress & last )

Constructor from an IP address pool.

Parameters
firstfirst address in the pool.
lastlast address in the pool.

Definition at line 30 of file random_allocation_state.cc.

◆ PoolRandomAllocationState() [2/2]

isc::dhcp::PoolRandomAllocationState::PoolRandomAllocationState ( const asiolink::IOAddress & first,
const asiolink::IOAddress & last,
const uint8_t delegated )

Constructor from a delegated prefix pool.

Parameters
firstfirst address in the pool.
lastlast prefix in the pool.
delegateddelegated prefix length.

Definition at line 34 of file random_allocation_state.cc.

Member Function Documentation

◆ create()

PoolRandomAllocationStatePtr isc::dhcp::PoolRandomAllocationState::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 17 of file random_allocation_state.cc.

References isc::dhcp::Lease::TYPE_PD.

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

◆ getPermutation()

IPRangePermutationPtr isc::dhcp::PoolRandomAllocationState::getPermutation ( ) const
inline

Returns a pointer to the permutation of addresses or delegated prefixes.

Returns
permutation instance.

Definition at line 60 of file random_allocation_state.h.


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