Kea
1.9.9-git
|
Address/prefix allocator that iterates over all addresses. More...
#include <alloc_engine.h>
Public Member Functions | |
IterativeAllocator (Lease::Type type) | |
Default constructor. More... | |
Public Member Functions inherited from isc::dhcp::AllocEngine::Allocator | |
Allocator (Lease::Type pool_type) | |
Default constructor. More... | |
virtual | ~Allocator () |
Virtual destructor. More... | |
virtual isc::asiolink::IOAddress | pickAddress (const SubnetPtr &subnet, const ClientClasses &client_classes, const DuidPtr &duid, const isc::asiolink::IOAddress &hint) |
Picks one address out of available pools in a given subnet. More... | |
Static Protected Member Functions | |
static isc::asiolink::IOAddress | increaseAddress (const isc::asiolink::IOAddress &address, bool prefix, const uint8_t prefix_len) |
Returns the next address or prefix. More... | |
static isc::asiolink::IOAddress | increasePrefix (const isc::asiolink::IOAddress &prefix, const uint8_t prefix_len) |
Returns the next prefix. More... | |
Additional Inherited Members | |
Protected Attributes inherited from isc::dhcp::AllocEngine::Allocator | |
Lease::Type | pool_type_ |
Defines pool type allocation. More... | |
Address/prefix allocator that iterates over all addresses.
This class implements an iterative algorithm that returns all addresses in a pool iteratively, one after another. Once the last address is reached, it starts allocating from the beginning of the first pool (i.e. it loops over).
Definition at line 148 of file alloc_engine.h.
isc::dhcp::AllocEngine::IterativeAllocator::IterativeAllocator | ( | Lease::Type | type | ) |
Default constructor.
Does not do anything
type | - specifies allocation type |
Definition at line 93 of file alloc_engine.cc.
|
staticprotected |
Returns the next address or prefix.
This method works for IPv4 addresses, IPv6 addresses and IPv6 prefixes.
address | address or prefix to be increased |
prefix | true when the previous argument is a prefix |
prefix_len | length of the prefix |
Definition at line 151 of file alloc_engine.cc.
References isc::asiolink::IOAddress::increase().
|
staticprotected |
Returns the next prefix.
This method works for IPv6 addresses only. It increases the specified prefix by a given prefix_len. For example, 2001:db8:: increased by prefix length /32 will become 2001:db9::. This method is used to iterate over IPv6 prefix pools
prefix | prefix to be increased |
prefix_len | length of the prefix to be increased |
Definition at line 98 of file alloc_engine.cc.
References isc::asiolink::IOAddress::fromBytes(), isc_throw, isc::asiolink::IOAddress::isV6(), and isc::asiolink::IOAddress::toBytes().