![]() |
Kea
1.5.0
|
base class for all address/prefix allocation algorithms More...
#include <alloc_engine.h>
Inheritance diagram for isc::dhcp::AllocEngine::Allocator:Public Member Functions | |
| 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)=0 |
| picks one address out of available pools in a given subnet More... | |
Protected Attributes | |
| Lease::Type | pool_type_ |
| defines pool type allocation More... | |
base class for all address/prefix allocation algorithms
This is an abstract class that should not be used directly, but rather specialized implementations should be used instead.
Definition at line 63 of file alloc_engine.h.
|
inline |
Default constructor.
Specifies which type of leases this allocator will assign
| pool_type | specifies pool type (addresses, temp. addr or prefixes) |
Definition at line 100 of file alloc_engine.h.
|
inlinevirtual |
virtual destructor
Definition at line 105 of file alloc_engine.h.
|
pure virtual |
picks one address out of available pools in a given subnet
This method returns one address from the available pools in the specified subnet. It should not check if the address is used or reserved - AllocEngine will check that and will call pickAddress again if necessary. The number of times this method is called will increase as the number of available leases will decrease.
This method can also be used to pick a prefix. We should not rename it to pickLease(), because at this early stage there is no concept of a lease yet. Here it is a matter of selecting one address or prefix from the defined pool, without going into details who it is for or who uses it. I thought that pickAddress() is less confusing than pickResource(), because nobody would immediately know what the resource means in this context.
Pools which are not allowed for client classes are skipped.
| subnet | next address will be returned from pool of that subnet |
| client_classes | list of classes client belongs to |
| duid | Client's DUID |
| hint | client's hint |
Implemented in isc::dhcp::AllocEngine::RandomAllocator, isc::dhcp::AllocEngine::HashedAllocator, and isc::dhcp::AllocEngine::IterativeAllocator.
|
protected |
defines pool type allocation
Definition at line 110 of file alloc_engine.h.