![]() |
Kea 3.0.0
|
Pool information for IPv6 addresses and prefixes. More...
#include <pool.h>
Public Member Functions | |
| Pool6 (const asiolink::IOAddress &prefix, const uint8_t prefix_len, const uint8_t delegated_len, const asiolink::IOAddress &excluded_prefix, const uint8_t excluded_prefix_len) | |
| Constructor for DHCPv6 prefix pool with an excluded prefix. | |
| Pool6 (Lease::Type type, const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last) | |
| the constructor for Pool6 "min-max" style definition | |
| Pool6 (Lease::Type type, const isc::asiolink::IOAddress &prefix, uint8_t prefix_len, uint8_t delegated_len=128) | |
| the constructor for Pool6 "prefix/len" style definition | |
| uint8_t | getLength () const |
| returns delegated prefix length | |
| Option6PDExcludePtr | getPrefixExcludeOption () const |
| Returns instance of the pool specific Prefix Exclude option. | |
| Lease::Type | getType () const |
| returns pool type | |
| virtual data::ElementPtr | toElement () const |
| Unparse a Pool6 object. | |
| virtual std::string | toText () const |
| returns textual representation of the pool | |
| 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. | |
| 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. | |
| 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 Pool6Ptr | create (const asiolink::IOAddress &prefix, const uint8_t prefix_len, const uint8_t delegated_len, const asiolink::IOAddress &excluded_prefix, const uint8_t excluded_prefix_len) |
Factory function for creating an instance of the Pool6. | |
| static Pool6Ptr | create (Lease::Type type, const isc::asiolink::IOAddress &first, const isc::asiolink::IOAddress &last) |
Factory function for creating an instance of the Pool6. | |
| static Pool6Ptr | create (Lease::Type type, const isc::asiolink::IOAddress &prefix, uint8_t prefix_len, uint8_t delegated_len=128) |
Factory function for creating an instance of the Pool6. | |
| 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. | |
| 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) | |
| Protected Attributes inherited from isc::data::UserContext | |
| data::ConstElementPtr | user_context_ |
| Pointer to the user context (may be NULL) | |
Pool information for IPv6 addresses and prefixes.
It holds information about pool6, i.e. a range of IPv6 address space that is configured for DHCP allocation.
| isc::dhcp::Pool6::Pool6 | ( | Lease::Type | type, |
| const isc::asiolink::IOAddress & | first, | ||
| const isc::asiolink::IOAddress & | last ) |
the constructor for Pool6 "min-max" style definition
| BadValue | if PD is define (PD can be only prefix/len) |
| type | type of the pool (IA or TA) |
| first | the first address in a pool |
| last | the last address in a pool |
Definition at line 249 of file pool.cc.
References isc::dhcp::Pool::Pool(), isc::asiolink::addrsInRange(), isc::dhcp::Pool::capacity_, if(), isc_throw, isc::asiolink::IOAddress::isV6(), isc::dhcp::Lease::TYPE_NA, isc::dhcp::Lease::TYPE_PD, and isc::dhcp::Lease::TYPE_TA.
| isc::dhcp::Pool6::Pool6 | ( | Lease::Type | type, |
| const isc::asiolink::IOAddress & | prefix, | ||
| uint8_t | prefix_len, | ||
| uint8_t | delegated_len = 128 ) |
the constructor for Pool6 "prefix/len" style definition
For addressed, this is just a prefix/len definition. For prefixes, there is one extra additional parameter delegated_len. It specifies a size of delegated prefixes that the pool will be split into. For example pool 2001:db8::/56, delegated_len=64 means that there is a pool 2001:db8::/56. It will be split into 256 prefixes of length /64, e.g. 2001:db8:0:1::/64, 2001:db8:0:2::/64 etc.
Naming convention: A smaller prefix length yields a shorter prefix which describes a larger set of addresses. A larger length yields a longer prefix which describes a smaller set of addresses.
Obviously, prefix_len must define shorter or equal prefix length than delegated_len, so prefix_len <= delegated_len. Note that it is slightly confusing: bigger (larger) prefix actually has smaller prefix length, e.g. /56 is a bigger prefix than /64, but has shorter (smaller) prefix length.
| BadValue | if delegated_len is defined for non-PD types or when delegated_len < prefix_len |
| type | type of the pool (IA, TA or PD) |
| prefix | specifies prefix of the pool |
| prefix_len | specifies prefix length of the pool |
| delegated_len | specifies length of the delegated prefixes |
Definition at line 291 of file pool.cc.
References isc::dhcp::Pool::Pool(), and isc::asiolink::IOAddress::IPV6_ZERO_ADDRESS().
| isc::dhcp::Pool6::Pool6 | ( | const asiolink::IOAddress & | prefix, |
| const uint8_t | prefix_len, | ||
| const uint8_t | delegated_len, | ||
| const asiolink::IOAddress & | excluded_prefix, | ||
| const uint8_t | excluded_prefix_len ) |
Constructor for DHCPv6 prefix pool with an excluded prefix.
If excluded_prefix is equal to '::' and the excluded_prefix_len is equal to 0, the excluded prefix is assumed to be unspecified for the pool. In this case, the server will not send the Prefix Exclude option to a client.
| prefix | specified a prefix of the pool. |
| prefix_len | specifies prefix length of the pool. |
| delegated_len | specifies length of the delegated prefixes. |
| excluded_prefix | specifies an excluded prefix as per RFC6603. |
| excluded_prefix_len | specifies length of an excluded prefix. |
Definition at line 300 of file pool.cc.
References isc::dhcp::Pool::Pool(), isc_throw, isc::asiolink::IOAddress::isV6(), isc::asiolink::IOAddress::isV6Zero(), and isc::dhcp::Lease::TYPE_PD.
|
static |
Factory function for creating an instance of the Pool6.
If excluded_prefix is equal to '::' and the excluded_prefix_len is equal to 0, the excluded prefix is assumed to be unspecified for the pool. In this case, the server will not send the Prefix Exclude option to a client.
| prefix | specifies a prefix of the pool. |
| prefix_len | specifies prefix length of the pool. |
| delegated_len | specifies length of the delegated prefixes. |
| excluded_prefix | specifies an excluded prefix as per RFC6603. |
| excluded_prefix_len | specifies length of an excluded prefix. |
Pool6 instance.
|
static |
Factory function for creating an instance of the Pool6.
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.
| type | type of the pool (IA or TA) |
| first | the first address in a pool |
| last | the last address in a pool |
Pool6 instance.
|
static |
Factory function for creating an instance of the Pool6.
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.
| type | type of the pool (IA, TA or PD) |
| prefix | specifies prefix of the pool |
| prefix_len | specifies prefix length of the pool |
| delegated_len | specifies length of the delegated prefixes |
Pool6 instance.
|
inline |
returns delegated prefix length
This may be useful for "prefix/len" style definition for addresses, but is mostly useful for prefix pools.
Definition at line 668 of file pool.h.
Referenced by toElement().
|
inline |
Returns instance of the pool specific Prefix Exclude option.
Definition at line 676 of file pool.h.
Referenced by toElement().
|
inline |
returns pool type
Definition at line 659 of file pool.h.
References isc::dhcp::Pool::type_.
Referenced by toElement().
|
virtual |
Unparse a Pool6 object.
}
Reimplemented from isc::dhcp::Pool.
Definition at line 439 of file pool.cc.
References isc::data::Element::create(), isc::dhcp::Pool::getFirstAddress(), isc::dhcp::Pool::getLastAddress(), getLength(), getPrefixExcludeOption(), getType(), isc_throw, isc::asiolink::prefixLengthFromRange(), isc::dhcp::Pool::toElement(), isc::asiolink::IOAddress::toText(), isc::dhcp::Lease::TYPE_NA, and isc::dhcp::Lease::TYPE_PD.
|
virtual |
returns textual representation of the pool
Reimplemented from isc::dhcp::Pool.
Definition at line 509 of file pool.cc.
References isc::dhcp::Pool::first_, isc::dhcp::Pool::last_, isc::dhcp::Pool::type_, and isc::dhcp::Lease::typeToText().