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 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. | |
util::Optional< std::string > | getDdnsConflictResolutionMode () const |
Returns ddns-conflict-resolution-mode. | |
util::Optional< std::string > | getDdnsGeneratedPrefix () const |
Returns ddns-generated-prefix. | |
util::Optional< bool > | getDdnsOverrideClientUpdate () const |
Returns ddns-override-client-update. | |
util::Optional< bool > | getDdnsOverrideNoUpdate () const |
Returns ddns-override-no-update. | |
util::Optional< std::string > | getDdnsQualifyingSuffix () const |
Returns ddns-qualifying-suffix. | |
util::Optional< D2ClientConfig::ReplaceClientNameMode > | getDdnsReplaceClientNameMode () const |
Returns ddns-replace-client-name-mode. | |
util::Optional< bool > | getDdnsSendUpdates () const |
Returns ddns-send-updates. | |
util::Optional< uint32_t > | getDdnsTtl () const |
Returns ddns-ttl. | |
util::Optional< uint32_t > | getDdnsTtlMax () const |
Returns ddns-ttl-max. | |
util::Optional< uint32_t > | getDdnsTtlMin () const |
Returns ddns-ttl-min. | |
util::Optional< double > | getDdnsTtlPercent () const |
Returns ddns-ttl-percent. | |
util::Optional< bool > | getDdnsUpdateOnRenew () const |
Returns ddns-update-on-renew. | |
const isc::asiolink::IOAddress & | getFirstAddress () const |
Returns the first address in a pool. | |
util::Optional< std::string > | getHostnameCharReplacement () const |
Return the invalid char replacement used to sanitize client hostnames. | |
util::Optional< std::string > | getHostnameCharSet () const |
Return the char set regexp used to sanitize client hostnames. | |
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 | hasDdnsParameters () const |
Checks if any of the DDNS parameters has a value. | |
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 | setDdnsConflictResolutionMode (const util::Optional< std::string > &ddns_conflict_resolution_mode) |
Sets new ddns-conflict-resolution-mode. | |
void | setDdnsGeneratedPrefix (const util::Optional< std::string > &ddns_generated_prefix) |
Sets new ddns-generated-prefix. | |
void | setDdnsOverrideClientUpdate (const util::Optional< bool > &ddns_override_client_update) |
Sets new ddns-override-client-update. | |
void | setDdnsOverrideNoUpdate (const util::Optional< bool > &ddns_override_no_update) |
Sets new ddns-override-no-update. | |
void | setDdnsQualifyingSuffix (const util::Optional< std::string > &ddns_qualifying_suffix) |
Sets new ddns-qualifying-suffix. | |
void | setDdnsReplaceClientNameMode (const util::Optional< D2ClientConfig::ReplaceClientNameMode > &ddns_replace_client_name_mode) |
Sets new ddns-replace-client-name-mode. | |
void | setDdnsSendUpdates (const util::Optional< bool > &ddns_send_updates) |
Sets new ddns-send-updates. | |
void | setDdnsTtl (const util::Optional< uint32_t > &ddns_ttl) |
Sets new ddns-ttl. | |
void | setDdnsTtlMax (const util::Optional< uint32_t > &ddns_ttl_max) |
Sets new ddns-ttl-max. | |
void | setDdnsTtlMin (const util::Optional< uint32_t > &ddns_ttl_min) |
Sets new ddns-ttl-min. | |
void | setDdnsTtlPercent (const util::Optional< double > &ddns_ttl_percent) |
Sets new ddns-ttl-percent. | |
void | setDdnsUpdateOnRenew (const util::Optional< bool > &ddns_update_on_renew) |
Sets new ddns-update-on-renew. | |
void | setHostnameCharReplacement (const util::Optional< std::string > &hostname_char_replacement) |
Sets new hostname-char-replacement. | |
void | setHostnameCharSet (const util::Optional< std::string > &hostname_char_set) |
Sets new hostname-char-set. | |
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 | |
![]() | |
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. | |
![]() | |
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. | |
ClientClasses | client_classes_ |
List of client classes allowed to use this pool. | |
util::Optional< std::string > | ddns_conflict_resolution_mode_ |
DDNS conflict resolution mode. | |
util::Optional< std::string > | ddns_generated_prefix_ |
Prefix Kea should use when generating domain-names. | |
util::Optional< bool > | ddns_override_client_update_ |
Should Kea perform updates, even if client requested delegation. | |
util::Optional< bool > | ddns_override_no_update_ |
Should Kea perform updates, even if client requested no updates. | |
util::Optional< std::string > | ddns_qualifying_suffix_ |
Suffix Kea should use when to qualify partial domain-names. | |
util::Optional< D2ClientConfig::ReplaceClientNameMode > | ddns_replace_client_name_mode_ |
How Kea should handle the domain-name supplied by the client. | |
util::Optional< bool > | ddns_send_updates_ |
Should Kea perform DNS updates. | |
util::Optional< uint32_t > | ddns_ttl_ |
Explicit value to use for DNS TTL. | |
util::Optional< uint32_t > | ddns_ttl_max_ |
Maximum value to use for DNS TTL. | |
util::Optional< uint32_t > | ddns_ttl_min_ |
Minimum value to use for DNS TTL. | |
util::Optional< double > | ddns_ttl_percent_ |
Percentage of the lease lifetime to use for DNS TTL. | |
util::Optional< bool > | ddns_update_on_renew_ |
Should Kea perform updates when leases are extended. | |
isc::asiolink::IOAddress | first_ |
The first address in a pool. | |
util::Optional< std::string > | hostname_char_replacement_ |
A string to replace invalid characters when scrubbing hostnames. | |
util::Optional< std::string > | hostname_char_set_ |
Regular expression describing invalid characters for client hostnames. | |
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) | |
![]() | |
data::ConstElementPtr | user_context_ |
Pointer to the user context (may be NULL) | |
Additional Inherited Members | |
![]() | |
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 |
void isc::dhcp::Pool::addAdditionalClass | ( | const ClientClass & | class_name | ) |
Adds class class_name to the additional classes list.
class_name | client class to add |
Definition at line 45 of file pool.cc.
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 isc::dhcp::ClientClass & | class_name | ) |
Adds class clas_name to the allowed client classes list.
class_name | client class to be supported by this network |
Definition at line 38 of file pool.cc.
References client_classes_, isc::dhcp::ClientClasses::contains(), and isc::dhcp::ClientClasses::insert().
Referenced by isc::dhcp::PdPoolParser::parse(), and isc::dhcp::PoolParser::parse().
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 33 of file pool.cc.
References client_classes_, isc::dhcp::ClientClasses::empty(), and isc::dhcp::ClientClasses::intersects().
|
inline |
Returns the additional classes list.
Definition at line 144 of file pool.h.
References additional_classes_.
|
inline |
Returns pool-specific allocation state.
The actual type of the state depends on the allocator type.
Definition at line 158 of file pool.h.
References allocation_state_.
|
inline |
|
inline |
Returns pointer to the option data configuration for this pool.
Definition at line 106 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 112 of file pool.h.
References cfg_option_.
|
inline |
Returns the list of allowed client classes.
Definition at line 129 of file pool.h.
References client_classes_.
|
inline |
Returns ddns-conflict-resolution-mode.
Definition at line 271 of file pool.h.
References ddns_conflict_resolution_mode_.
|
inline |
Returns ddns-generated-prefix.
Definition at line 232 of file pool.h.
References ddns_generated_prefix_.
|
inline |
Returns ddns-override-client-update.
Definition at line 203 of file pool.h.
References ddns_override_client_update_.
|
inline |
Returns ddns-override-no-update.
Definition at line 190 of file pool.h.
References ddns_override_no_update_.
|
inline |
Returns ddns-qualifying-suffix.
Definition at line 245 of file pool.h.
References ddns_qualifying_suffix_.
|
inline |
Returns ddns-replace-client-name-mode.
Definition at line 217 of file pool.h.
References ddns_replace_client_name_mode_.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns ddns-update-on-renew.
Definition at line 258 of file pool.h.
References ddns_update_on_renew_.
|
inline |
Returns the first address in a pool.
Definition at line 63 of file pool.h.
References first_.
Referenced by isc::dhcp::Pool4::toElement(), and isc::dhcp::Pool6::toElement().
|
inline |
Return the invalid char replacement used to sanitize client hostnames.
Definition at line 350 of file pool.h.
References hostname_char_replacement_.
|
inline |
Return the char set regexp used to sanitize client hostnames.
Definition at line 337 of file pool.h.
References hostname_char_set_.
|
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 46 of file pool.h.
References id_.
|
inline |
Returns the last address in a pool.
Definition at line 69 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 149 of file pool.h.
References additional_classes_.
|
inline |
Returns the mutable list of allowed client classes.
Definition at line 134 of file pool.h.
References client_classes_.
|
inline |
bool isc::dhcp::Pool::hasDdnsParameters | ( | ) | const |
Checks if any of the DDNS parameters has a value.
Definition at line 60 of file pool.cc.
References ddns_conflict_resolution_mode_, ddns_generated_prefix_, ddns_override_client_update_, ddns_override_no_update_, ddns_qualifying_suffix_, ddns_replace_client_name_mode_, ddns_send_updates_, ddns_ttl_, ddns_ttl_max_, ddns_ttl_min_, ddns_ttl_percent_, ddns_update_on_renew_, hostname_char_replacement_, hostname_char_set_, and isc::util::Optional< T >::unspecified().
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 165 of file pool.h.
References allocation_state_.
|
inline |
Sets new ddns-conflict-resolution-mode.
ddns_conflict_resolution_mode | New value to use. |
Definition at line 278 of file pool.h.
References ddns_conflict_resolution_mode_.
|
inline |
Sets new ddns-generated-prefix.
ddns_generated_prefix | New value to use. |
Definition at line 239 of file pool.h.
References ddns_generated_prefix_.
|
inline |
Sets new ddns-override-client-update.
ddns_override_client_update | New value to use. |
Definition at line 210 of file pool.h.
References ddns_override_client_update_.
|
inline |
Sets new ddns-override-no-update.
ddns_override_no_update | New value to use. |
Definition at line 197 of file pool.h.
References ddns_override_no_update_.
|
inline |
Sets new ddns-qualifying-suffix.
ddns_qualifying_suffix | New value to use. |
Definition at line 252 of file pool.h.
References ddns_qualifying_suffix_.
|
inline |
Sets new ddns-replace-client-name-mode.
ddns_replace_client_name_mode | New value to use. |
Definition at line 225 of file pool.h.
References ddns_replace_client_name_mode_.
|
inline |
Sets new ddns-send-updates.
ddns_send_updates | New value to use. |
Definition at line 184 of file pool.h.
References ddns_send_updates_.
|
inline |
|
inline |
Sets new ddns-ttl-max.
ddns_ttl_max | New value to use. |
Definition at line 331 of file pool.h.
References ddns_ttl_max_.
|
inline |
Sets new ddns-ttl-min.
ddns_ttl_min | New value to use. |
Definition at line 318 of file pool.h.
References ddns_ttl_min_.
|
inline |
Sets new ddns-ttl-percent.
ddns_ttl_percent | New value to use. |
Definition at line 292 of file pool.h.
References ddns_ttl_percent_.
|
inline |
Sets new ddns-update-on-renew.
ddns_update_on_renew | New value to use. |
Definition at line 265 of file pool.h.
References ddns_update_on_renew_.
|
inline |
Sets new hostname-char-replacement.
hostname_char_replacement | New value to use. |
Definition at line 357 of file pool.h.
References hostname_char_replacement_.
|
inline |
Sets new hostname-char-set.
hostname_char_set | New value to use. |
Definition at line 344 of file pool.h.
References hostname_char_set_.
|
inline |
|
virtual |
Unparse a pool object.
Implements isc::data::CfgToElement.
Reimplemented in isc::dhcp::Pool4, and isc::dhcp::Pool6.
Definition at line 137 of file pool.cc.
References additional_classes_, client_classes_, isc::data::UserContext::contextToElement(), isc::data::Element::create(), isc::data::Element::createMap(), ddns_conflict_resolution_mode_, ddns_generated_prefix_, ddns_override_client_update_, ddns_override_no_update_, ddns_qualifying_suffix_, ddns_replace_client_name_mode_, ddns_send_updates_, ddns_ttl_, ddns_ttl_max_, ddns_ttl_min_, ddns_ttl_percent_, ddns_update_on_renew_, isc::dhcp::ClientClasses::empty(), getCfgOption(), hostname_char_replacement_, hostname_char_set_, id_, isc::dhcp::ClientClasses::toElement(), type_, isc::dhcp::Lease::TYPE_PD, and isc::util::Optional< T >::unspecified().
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 52 of file pool.cc.
References first_, last_, type_, and isc::dhcp::Lease::typeToText().
|
protected |
Additional classes.
isc::dhcp::Network::additional_classes_
Definition at line 419 of file pool.h.
Referenced by addAdditionalClass(), getAdditionalClasses(), getMutableAdditionalClasses(), and toElement().
|
protected |
Holds pool-specific allocation state.
Definition at line 425 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 403 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 406 of file pool.h.
Referenced by getCfgOption(), and getCfgOption().
|
protected |
List of client classes allowed to use this pool.
If not empty, only clients belonging to at least one of the classes in this list will be allowed to use this particular pool. By default the list is empty which means that any client is allowed, regardless of its class membership.
Definition at line 414 of file pool.h.
Referenced by allowClientClass(), clientSupported(), getClientClasses(), getMutableClientClasses(), and toElement().
|
protected |
DDNS conflict resolution mode.
Definition at line 451 of file pool.h.
Referenced by getDdnsConflictResolutionMode(), hasDdnsParameters(), setDdnsConflictResolutionMode(), and toElement().
|
protected |
Prefix Kea should use when generating domain-names.
Definition at line 442 of file pool.h.
Referenced by getDdnsGeneratedPrefix(), hasDdnsParameters(), setDdnsGeneratedPrefix(), and toElement().
|
protected |
Should Kea perform updates, even if client requested delegation.
Definition at line 436 of file pool.h.
Referenced by getDdnsOverrideClientUpdate(), hasDdnsParameters(), setDdnsOverrideClientUpdate(), and toElement().
|
protected |
Should Kea perform updates, even if client requested no updates.
Overrides the client request for no updates via the N flag.
Definition at line 433 of file pool.h.
Referenced by getDdnsOverrideNoUpdate(), hasDdnsParameters(), setDdnsOverrideNoUpdate(), and toElement().
|
protected |
Suffix Kea should use when to qualify partial domain-names.
Definition at line 445 of file pool.h.
Referenced by getDdnsQualifyingSuffix(), hasDdnsParameters(), setDdnsQualifyingSuffix(), and toElement().
|
protected |
How Kea should handle the domain-name supplied by the client.
Definition at line 439 of file pool.h.
Referenced by getDdnsReplaceClientNameMode(), hasDdnsParameters(), setDdnsReplaceClientNameMode(), and toElement().
|
protected |
Should Kea perform DNS updates.
Used to provide scoped enabling and disabling of updates.
Definition at line 429 of file pool.h.
Referenced by getDdnsSendUpdates(), hasDdnsParameters(), setDdnsSendUpdates(), and toElement().
|
protected |
Explicit value to use for DNS TTL.
Definition at line 457 of file pool.h.
Referenced by getDdnsTtl(), hasDdnsParameters(), setDdnsTtl(), and toElement().
|
protected |
Maximum value to use for DNS TTL.
Definition at line 463 of file pool.h.
Referenced by getDdnsTtlMax(), hasDdnsParameters(), setDdnsTtlMax(), and toElement().
|
protected |
Minimum value to use for DNS TTL.
Definition at line 460 of file pool.h.
Referenced by getDdnsTtlMin(), hasDdnsParameters(), setDdnsTtlMin(), and toElement().
|
protected |
Percentage of the lease lifetime to use for DNS TTL.
Definition at line 454 of file pool.h.
Referenced by getDdnsTtlPercent(), hasDdnsParameters(), setDdnsTtlPercent(), and toElement().
|
protected |
Should Kea perform updates when leases are extended.
Definition at line 448 of file pool.h.
Referenced by getDdnsUpdateOnRenew(), hasDdnsParameters(), setDdnsUpdateOnRenew(), and toElement().
|
protected |
The first address in a pool.
Definition at line 389 of file pool.h.
Referenced by getFirstAddress(), inRange(), isc::dhcp::Pool6::toText(), and toText().
|
protected |
A string to replace invalid characters when scrubbing hostnames.
Meaningful only if hostname_char_set_ is not empty.
Definition at line 471 of file pool.h.
Referenced by getHostnameCharReplacement(), hasDdnsParameters(), setHostnameCharReplacement(), and toElement().
|
protected |
Regular expression describing invalid characters for client hostnames.
Definition at line 467 of file pool.h.
Referenced by getHostnameCharSet(), hasDdnsParameters(), setHostnameCharSet(), and toElement().
|
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 386 of file pool.h.
Referenced by getID(), setID(), and toElement().
|
protected |
The last address in a pool.
Definition at line 392 of file pool.h.
Referenced by isc::dhcp::Pool4::Pool4(), getLastAddress(), inRange(), isc::dhcp::Pool6::toText(), and toText().
|
protected |
defines a lease type that will be served from this pool
Definition at line 395 of file pool.h.
Referenced by isc::dhcp::Pool6::getType(), getType(), toElement(), isc::dhcp::Pool6::toText(), and toText().
|
protected |