Kea 2.7.5
|
Subnet allocation state used by the iterative allocator. More...
#include <iterative_allocation_state.h>
Public Member Functions | |
SubnetIterativeAllocationState (const asiolink::IOAddress &prefix, const uint8_t prefix_length) | |
Constructor. | |
asiolink::IOAddress | getLastAllocated () const |
Returns last allocated address or prefix. | |
void | setLastAllocated (const asiolink::IOAddress &address) |
Sets last allocated address or prefix. | |
Public Member Functions inherited from isc::dhcp::SubnetAllocationState | |
SubnetAllocationState () | |
Constructor. | |
boost::posix_time::ptime | getLastAllocatedTime () const |
Returns last allocation time for the specified lease type. | |
Public Member Functions inherited from isc::dhcp::AllocationState | |
virtual | ~AllocationState ()=default |
Virtual destructor. | |
Static Public Member Functions | |
static SubnetIterativeAllocationStatePtr | create (const SubnetPtr &subnet) |
Factory function creating the state instance from subnet. | |
Additional Inherited Members | |
Protected Member Functions inherited from isc::dhcp::SubnetAllocationState | |
void | setCurrentAllocatedTimeInternal () |
Sets the last allocation time to current. | |
Protected Attributes inherited from isc::dhcp::SubnetAllocationState | |
boost::posix_time::ptime | last_allocated_time_ |
Timestamp indicating when a lease has been last allocated from the subnet. | |
boost::scoped_ptr< std::mutex > | mutex_ |
Mutex used for thread-safe access to the state members. | |
Subnet allocation state used by the iterative allocator.
It extends the base class with the mechanism to store the last allocated address or delegated prefix. The iterative allocator uses this information to pick the next address or delegated prefix on the next allocation request.
Definition at line 33 of file iterative_allocation_state.h.
isc::dhcp::SubnetIterativeAllocationState::SubnetIterativeAllocationState | ( | const asiolink::IOAddress & | prefix, |
const uint8_t | prefix_length ) |
Constructor.
prefix | subnet prefix. |
prefix_length | subnet prefix length. |
Definition at line 26 of file iterative_allocation_state.cc.
|
static |
Factory function creating the state instance from subnet.
subnet | instance of the subnet for which the allocation state should be instantiated. |
Definition at line 21 of file iterative_allocation_state.cc.
Referenced by isc::dhcp::Subnet6::create(), isc::dhcp::Subnet4::create(), isc::dhcp::Subnet4::createAllocators(), and isc::dhcp::Subnet6::createAllocators().
IOAddress isc::dhcp::SubnetIterativeAllocationState::getLastAllocated | ( | ) | const |
Returns last allocated address or prefix.
Definition at line 33 of file iterative_allocation_state.cc.
References isc::dhcp::SubnetAllocationState::mutex_.
void isc::dhcp::SubnetIterativeAllocationState::setLastAllocated | ( | const asiolink::IOAddress & | address | ) |
Sets last allocated address or prefix.
address | an address or prefix last allocated. |
Definition at line 39 of file iterative_allocation_state.cc.
References isc::dhcp::SubnetAllocationState::mutex_, and isc::dhcp::SubnetAllocationState::setCurrentAllocatedTimeInternal().