Kea 2.7.5
|
base class for Pool4 and Pool6 More...
#include <pool.h>
Public Member Functions | |
virtual | ~Pool ()=default |
virtual destructor | |
void | addAdditionalClass (const ClientClass &class_name) |
Adds class class_name to the additional classes list. | |
void | allowClientClass (const ClientClass &class_name) |
Sets the supported class to class class_name. | |
bool | clientSupported (const ClientClasses &client_classes) const |
Checks whether this pool supports client that belongs to specified classes. | |
const ClientClasses & | getAdditionalClasses () const |
Returns the additional classes list. | |
AllocationStatePtr | getAllocationState () const |
Returns pool-specific allocation state. | |
isc::util::uint128_t | getCapacity () const |
Returns the number of all leases in this pool. | |
CfgOptionPtr | getCfgOption () |
Returns pointer to the option data configuration for this pool. | |
ConstCfgOptionPtr | getCfgOption () const |
Returns const pointer to the option data configuration for this pool. | |
const ClientClass & | getClientClass () const |
returns the client class | |
const isc::asiolink::IOAddress & | getFirstAddress () const |
Returns the first address in a pool. | |
uint64_t | getID () const |
Returns Pool-id. | |
const isc::asiolink::IOAddress & | getLastAddress () const |
Returns the last address in a pool. | |
ClientClasses & | getMutableAdditionalClasses () |
Returns the mutable additional classes list. | |
Lease::Type | getType () const |
Returns pool type (v4, v6 non-temporary, v6 temp, v6 prefix) | |
bool | inRange (const isc::asiolink::IOAddress &addr) const |
Checks if a given address is in the range. | |
void | setAllocationState (const AllocationStatePtr &allocation_state) |
Sets pool-specific allocation state. | |
void | setID (const uint64_t id) |
Sets Pool-id. | |
virtual data::ElementPtr | toElement () const |
Unparse a pool object. | |
virtual std::string | toText () const |
returns textual representation of the pool | |
Public Member Functions inherited from isc::data::UserContext | |
void | contextToElement (data::ElementPtr map) const |
Merge unparse a user_context object. | |
data::ConstElementPtr | getContext () const |
Returns const pointer to the user context. | |
void | setContext (const data::ConstElementPtr &ctx) |
Sets user context. | |
Public Member Functions inherited from isc::data::CfgToElement | |
virtual | ~CfgToElement () |
Destructor. | |
Protected Member Functions | |
Pool (Lease::Type type, const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last) | |
protected constructor | |
Protected Attributes | |
ClientClasses | additional_classes_ |
Additional classes. | |
AllocationStatePtr | allocation_state_ |
Holds pool-specific allocation state. | |
isc::util::uint128_t | capacity_ |
Stores number of possible leases. | |
CfgOptionPtr | cfg_option_ |
Pointer to the option data configuration for this pool. | |
ClientClass | client_class_ |
Optional definition of a client class. | |
isc::asiolink::IOAddress | first_ |
The first address in a pool. | |
uint64_t | id_ |
pool-id | |
isc::asiolink::IOAddress | last_ |
The last address in a pool. | |
Lease::Type | type_ |
defines a lease type that will be served from this pool | |
data::ConstElementPtr | user_context_ |
Pointer to the user context (may be NULL) | |
Protected Attributes inherited from isc::data::UserContext | |
data::ConstElementPtr | user_context_ |
Pointer to the user context (may be NULL) | |
Additional Inherited Members | |
Static Public Member Functions inherited from isc::data::UserContext | |
static data::ElementPtr | toElement (data::ConstElementPtr map) |
Copy an Element map. | |
base class for Pool4 and Pool6
Stores information about pool of IPv4 or IPv6 addresses. That is a basic component of a configuration.
|
virtualdefault |
virtual destructor
We need Pool to be a polymorphic class, so we could dynamic cast from PoolPtr to Pool6Ptr if we need to. A class becomes polymorphic, when there is at least one virtual method.
|
protected |
|
inline |
Adds class class_name to the additional classes list.
class_name | client class to add |
Definition at line 141 of file pool.h.
References additional_classes_, isc::dhcp::ClientClasses::contains(), and isc::dhcp::ClientClasses::insert().
Referenced by isc::dhcp::PdPoolParser::parse(), and isc::dhcp::PoolParser::parse().
void isc::dhcp::Pool::allowClientClass | ( | const ClientClass & | class_name | ) |
Sets the supported class to class class_name.
class_name | client class to be supported by this pool |
Definition at line 35 of file pool.cc.
References client_class_.
bool isc::dhcp::Pool::clientSupported | ( | const ClientClasses & | client_classes | ) | const |
Checks whether this pool supports client that belongs to specified classes.
client_classes | list of all classes the client belongs to |
Definition at line 31 of file pool.cc.
References client_class_.
|
inline |
Returns the additional classes list.
Definition at line 148 of file pool.h.
References additional_classes_.
Referenced by toElement().
|
inline |
Returns pool-specific allocation state.
The actual type of the state depends on the allocator type.
Definition at line 162 of file pool.h.
References allocation_state_.
|
inline |
|
inline |
Returns pointer to the option data configuration for this pool.
Definition at line 104 of file pool.h.
References cfg_option_.
Referenced by toElement().
|
inline |
Returns const pointer to the option data configuration for this pool.
Definition at line 110 of file pool.h.
References cfg_option_.
|
inline |
returns the client class
Definition at line 134 of file pool.h.
References client_class_.
Referenced by toElement().
|
inline |
Returns the first address in a pool.
Definition at line 61 of file pool.h.
References first_.
Referenced by isc::dhcp::Pool4::toElement(), and isc::dhcp::Pool6::toElement().
|
inline |
Returns Pool-id.
Pool-id is an unique value that can be used to identify a pool within a subnet or shared network.
Definition at line 44 of file pool.h.
References id_.
|
inline |
Returns the last address in a pool.
Definition at line 67 of file pool.h.
References last_.
Referenced by isc::dhcp::Pool4::toElement(), and isc::dhcp::Pool6::toElement().
|
inline |
Returns the mutable additional classes list.
Definition at line 153 of file pool.h.
References additional_classes_.
|
inline |
bool isc::dhcp::Pool::inRange | ( | const isc::asiolink::IOAddress & | addr | ) | const |
|
inline |
Sets pool-specific allocation state.
allocation_state | allocation state instance. |
Definition at line 169 of file pool.h.
References allocation_state_.
|
inline |
|
virtual |
Unparse a pool object.
Implements isc::data::CfgToElement.
Reimplemented in isc::dhcp::Pool4, and isc::dhcp::Pool6.
Definition at line 107 of file pool.cc.
References isc::data::UserContext::contextToElement(), isc::data::Element::create(), isc::data::Element::createList(), isc::data::Element::createMap(), getAdditionalClasses(), getCfgOption(), getClientClass(), and id_.
Referenced by isc::dhcp::Pool4::toElement(), and isc::dhcp::Pool6::toElement().
|
virtual |
returns textual representation of the pool
Reimplemented in isc::dhcp::Pool6.
Definition at line 40 of file pool.cc.
References first_, last_, type_, and isc::dhcp::Lease::typeToText().
|
protected |
Additional classes.
isc::dhcp::Network::additional_classes_
Definition at line 227 of file pool.h.
Referenced by addAdditionalClass(), getAdditionalClasses(), and getMutableAdditionalClasses().
|
protected |
Holds pool-specific allocation state.
Definition at line 233 of file pool.h.
Referenced by getAllocationState(), and setAllocationState().
|
protected |
Stores number of possible leases.
This could be calculated on the fly, but the calculations are somewhat involved, so it is more efficient to calculate it once and just store the result. Note that for very large pools, the number is capped at max value of uint64_t.
Definition at line 214 of file pool.h.
Referenced by isc::dhcp::Pool4::Pool4(), isc::dhcp::Pool4::Pool4(), isc::dhcp::Pool6::Pool6(), and getCapacity().
|
protected |
Pointer to the option data configuration for this pool.
Definition at line 217 of file pool.h.
Referenced by getCfgOption(), and getCfgOption().
|
protected |
Optional definition of a client class.
Definition at line 222 of file pool.h.
Referenced by allowClientClass(), clientSupported(), and getClientClass().
|
protected |
The first address in a pool.
Definition at line 200 of file pool.h.
Referenced by getFirstAddress(), inRange(), toText(), and isc::dhcp::Pool6::toText().
|
protected |
pool-id
This id is an unique value that can be used to identify a pool within a subnet or shared network.
Definition at line 197 of file pool.h.
Referenced by getID(), setID(), and toElement().
|
protected |
The last address in a pool.
Definition at line 203 of file pool.h.
Referenced by isc::dhcp::Pool4::Pool4(), getLastAddress(), inRange(), toText(), and isc::dhcp::Pool6::toText().
|
protected |
defines a lease type that will be served from this pool
Definition at line 206 of file pool.h.
Referenced by getType(), isc::dhcp::Pool6::getType(), toText(), and isc::dhcp::Pool6::toText().
|
protected |