Kea: isc::dhcp::SubnetIterativeAllocationState Class Reference

| Kea 3.2.0-git

isc::dhcp::SubnetIterativeAllocationState Class Reference

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

`#include <iterative_allocation_state.h>`

Inheritance diagram for isc::dhcp::SubnetIterativeAllocationState:
[legend]

## 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.

## Detailed Description

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.

## Constructor & Destructor Documentation

## ◆ SubnetIterativeAllocationState()

isc::dhcp::SubnetIterativeAllocationState::SubnetIterativeAllocationState | ( | const asiolink::IOAddress & | prefix,
|  | const uint8_t | prefix_length )

Constructor.

Parameters

  prefix | subnet prefix.
  prefix_length | subnet prefix length.

Definition at line 26 of file iterative_allocation_state.cc.

References isc::dhcp::SubnetAllocationState::SubnetAllocationState(), and isc::asiolink::lastAddrInPrefix().

Here is the call graph for this function:

## Member Function Documentation

## ◆ create()

SubnetIterativeAllocationStatePtr isc::dhcp::SubnetIterativeAllocationState::create | ( | const SubnetPtr & | subnet | ) |
| static

Factory function creating the state instance from subnet.

Parameters

  subnet | instance of the subnet for which the allocation state should be instantiated.

Returns
  new allocation state instance.

Definition at line 21 of file iterative_allocation_state.cc.

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

## ◆ getLastAllocated()

IOAddress isc::dhcp::SubnetIterativeAllocationState::getLastAllocated | ( |  | ) | const

Returns last allocated address or prefix.

Returns
  last allocated address or prefix.

Definition at line 33 of file iterative_allocation_state.cc.

References isc::dhcp::SubnetAllocationState::mutex_.

## ◆ setLastAllocated()

void isc::dhcp::SubnetIterativeAllocationState::setLastAllocated | ( | const asiolink::IOAddress & | address | ) |

Sets last allocated address or prefix.

Parameters

  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().

Here is the call graph for this function:

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

- iterative_allocation_state.h
- iterative_allocation_state.cc