![]() |
Kea
1.5.0
|
Address/prefix allocator that iterates over all addresses. More...
#include <alloc_engine.h>
Inheritance diagram for isc::dhcp::AllocEngine::IterativeAllocator:Public Member Functions | |
| IterativeAllocator (Lease::Type type) | |
| default constructor More... | |
| virtual isc::asiolink::IOAddress | pickAddress (const SubnetPtr &subnet, const ClientClasses &client_classes, const DuidPtr &duid, const isc::asiolink::IOAddress &hint) |
| returns the next address from pools in a subnet More... | |
Public Member Functions inherited from isc::dhcp::AllocEngine::Allocator | |
| Allocator (Lease::Type pool_type) | |
| Default constructor. More... | |
| virtual | ~Allocator () |
| virtual destructor 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 122 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 87 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 148 of file alloc_engine.cc.
References isc::asiolink::IOAddress::increase().
Here is the call graph for this function:
|
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 92 of file alloc_engine.cc.
References isc_throw, isc::asiolink::IOAddress::isV6(), and isc::asiolink::IOAddress::toBytes().
Here is the call graph for this function:
|
virtual |
returns the next address from pools in a subnet
| subnet | next address will be returned from pool of that subnet |
| client_classes | list of classes client belongs to |
| duid | Client's DUID (ignored) |
| hint | client's hint (ignored) |
Implements isc::dhcp::AllocEngine::Allocator.
Definition at line 159 of file alloc_engine.cc.
References isc_throw, and isc::dhcp::Lease::TYPE_PD.