7#ifndef FLQ_ALLOCATION_STATE_H
8#define FLQ_ALLOCATION_STATE_H
13#include <boost/shared_ptr.hpp>
20class PoolFreeLeaseQueueAllocationState;
78 template<
typename AddressType>
79 using FreeLeaseQueue = boost::multi_index_container<
81 boost::multi_index::indexed_by<
82 boost::multi_index::sequenced<>,
83 boost::multi_index::hashed_unique<
84 boost::multi_index::identity<AddressType>
90 typedef boost::shared_ptr<FreeLeaseQueue<uint32_t>> FreeLease4QueuePtr;
93 typedef boost::shared_ptr<FreeLeaseQueue<asiolink::IOAddress>> FreeLease6QueuePtr;
97 FreeLease4QueuePtr free_lease4_queue_;
101 FreeLease6QueuePtr free_lease6_queue_;
The IOAddress class represents an IP addresses (version agnostic)
Base class for representing allocation state in pools and subnets.
Pool allocation state used by the FLQ allocator.
asiolink::IOAddress offerFreeLease()
Returns next available lease.
PoolFreeLeaseQueueAllocationState(Lease::Type type)
Constructor.
bool exhausted() const
Checks if the pool has run out of free leases.
void deleteFreeLease(const asiolink::IOAddress &address)
Deletes free lease from the queue.
void addFreeLease(const asiolink::IOAddress &address)
Adds a free lease to the queue.
static PoolFreeLeaseQueueAllocationStatePtr create(const PoolPtr &pool)
Factory function creating the state instance from a pool.
size_t getFreeLeaseCount() const
Returns the current number of free leases in the queue.
boost::shared_ptr< PoolFreeLeaseQueueAllocationState > PoolFreeLeaseQueueAllocationStatePtr
Type of the pointer to the PoolFreeLeaseQueueAllocationState.
boost::shared_ptr< Pool > PoolPtr
a pointer to either IPv4 or IPv6 Pool
Defines the logger used by the top-level component of kea-lfc.
Type
Type of lease or pool.