Kea 2.7.5
|
Pool information for IPv4 addresses. More...
#include <pool.h>
Public Member Functions | |
Pool4 (const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last) | |
the constructor for Pool4 "min-max" style definition | |
Pool4 (const isc::asiolink::IOAddress &prefix, uint8_t prefix_len) | |
the constructor for Pool4 "prefix/len" style definition | |
virtual data::ElementPtr | toElement () const |
Unparse a Pool4 object. | |
Public Member Functions inherited from isc::dhcp::Pool | |
virtual | ~Pool ()=default |
virtual destructor | |
void | addAdditionalClass (const ClientClass &class_name) |
Adds class class_name to the additional classes list. | |
void | allowClientClass (const isc::dhcp::ClientClass &class_name) |
Adds class clas_name to the allowed client classes list. | |
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 ClientClasses & | getClientClasses () const |
Returns the list of allowed client classes. | |
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. | |
ClientClasses & | getMutableClientClasses () |
Returns the mutable list of allowed client classes. | |
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 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. | |
Static Public Member Functions | |
static Pool4Ptr | create (const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last) |
Factory function for creating an instance of the Pool4 . | |
static Pool4Ptr | create (const isc::asiolink::IOAddress &prefix, uint8_t prefix_len) |
Factory function for creating an instance of the Pool4 . | |
Static Public Member Functions inherited from isc::data::UserContext | |
static data::ElementPtr | toElement (data::ConstElementPtr map) |
Copy an Element map. | |
Additional Inherited Members | |
Protected Member Functions inherited from isc::dhcp::Pool | |
Pool (Lease::Type type, const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last) | |
protected constructor | |
Protected Attributes inherited from isc::dhcp::Pool | |
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. | |
ClientClasses | client_classes_ |
List of client classes allowed to use this pool. | |
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) | |
Pool information for IPv4 addresses.
It holds information about pool4, i.e. a range of IPv4 address space that is configured for DHCP allocation.
isc::dhcp::Pool4::Pool4 | ( | const isc::asiolink::IOAddress & | first, |
const isc::asiolink::IOAddress & | last ) |
the constructor for Pool4 "min-max" style definition
first | the first address in a pool |
last | the last address in a pool |
Definition at line 59 of file pool.cc.
References isc::asiolink::addrsInRange(), isc::dhcp::Pool::capacity_, isc_throw, and isc::asiolink::IOAddress::isV4().
isc::dhcp::Pool4::Pool4 | ( | const isc::asiolink::IOAddress & | prefix, |
uint8_t | prefix_len ) |
the constructor for Pool4 "prefix/len" style definition
prefix | specifies prefix of the pool |
prefix_len | specifies length of the prefix of the pool |
Definition at line 78 of file pool.cc.
References isc::asiolink::addrsInRange(), isc::dhcp::Pool::capacity_, isc::asiolink::firstAddrInPrefix(), isc_throw, isc::dhcp::Pool::last_, and isc::asiolink::lastAddrInPrefix().
|
static |
Factory function for creating an instance of the Pool4
.
This function should be used to create an instance of the pool within a hooks library in cases when the library may be unloaded before the object is destroyed. This ensures that the ownership of the object by the Kea process is retained.
first | the first address in a pool |
last | the last address in a pool |
Pool4
instance.
|
static |
Factory function for creating an instance of the Pool4
.
This function should be used to create an instance of the pool within a hooks library in cases when the library may be unloaded before the object is destroyed. This ensures that the ownership of the object by the Kea process is retained.
prefix | specifies prefix of the pool. |
prefix_len | specifies length of the prefix of the pool. |
Pool4
instance.
|
virtual |
Unparse a Pool4 object.
Reimplemented from isc::dhcp::Pool.
Definition at line 149 of file pool.cc.
References isc::data::Element::create(), isc::dhcp::Pool::getFirstAddress(), isc::dhcp::Pool::getLastAddress(), isc::asiolink::prefixLengthFromRange(), isc::dhcp::Pool::toElement(), and isc::asiolink::IOAddress::toText().