Kea
1.9.9-git
|
Base class for all address/prefix allocation algorithms. More...
#include <alloc_engine.h>
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) |
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 70 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 114 of file alloc_engine.h.
|
inlinevirtual |
Virtual destructor.
Definition at line 118 of file alloc_engine.h.
|
inlinevirtual |
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 |
Definition at line 98 of file alloc_engine.h.
References isc::util::MultiThreadingMgr::instance().
|
protected |
Defines pool type allocation.
Definition at line 131 of file alloc_engine.h.