| Kea 3.0.2-git

isc::dhcp::DdnsParams Class Reference

Convenience container for conveying DDNS behavioral parameters It is intended to be created per Packet exchange using the selected subnet passed into functions that require them. More...

`#include <ddns_params.h>`

## Public Member Functions
| DdnsParams ()
| Default constructor.
| DdnsParams (const ConstSubnetPtr &subnet, bool d2_client_enabled)
| Constructor.
std::string | getConflictResolutionMode () const
| Returns the DDNS config resolution mode for kea-dhcp-ddns.
bool | getEnableUpdates () const
| Returns whether or not DHCP DDNS updating is enabled.
std::string | getGeneratedPrefix () const
| Returns the Prefix Kea should use when generating domain-names.
std::string | getHostnameCharReplacement () const
| Returns the string to replace invalid characters when scrubbing hostnames.
std::string | getHostnameCharSet () const
| Returns the regular expression describing invalid characters for client hostnames.
isc::util::str::StringSanitizerPtr | getHostnameSanitizer () const
| Returns a regular expression string sanitizer.
bool | getOverrideClientUpdate () const
| Returns whether or not Kea should perform updates, even if client requested delegation.
bool | getOverrideNoUpdate () const
| Returns whether or not Kea should perform updates, even if client requested no updates.
PoolPtr | getPool () const
| Fetches the current pool.
std::string | getQualifyingSuffix () const
| Returns the suffix Kea should use when to qualify partial domain-names.
D2ClientConfig::ReplaceClientNameMode | getReplaceClientNameMode () const
| Returns how Kea should handle the domain-name supplied by the client.
SubnetID | getSubnetId () const
| Returns the subnet-id of the subnet associated with these parameters.
util::Optional< uint32_t > | getTtl () const
| Returns explicit TTL to use.
util::Optional< uint32_t > | getTtlMax () const
| Returns the maximum TTL to use.
util::Optional< uint32_t > | getTtlMin () const
| Returns the minimum TTL to use.
util::Optional< double > | getTtlPercent () const
| Returns percent of lease lifetime to use for TTL.
bool | getUpdateOnRenew () const
| Returns whether or not DNS should be updated when leases renew.
void | resetPool ()
| Resets the current pool.
PoolPtr | setPoolFromAddress (const asiolink::IOAddress &address)
| Sets the pool based on the current subnet and given address.

## Detailed Description

Convenience container for conveying DDNS behavioral parameters It is intended to be created per Packet exchange using the selected subnet passed into functions that require them.

Definition at line 23 of file ddns_params.h.

## Constructor & Destructor Documentation

## ◆ DdnsParams() [1/2]

isc::dhcp::DdnsParams::DdnsParams | ( |  | ) |
| inline

Default constructor.

Definition at line 26 of file ddns_params.h.

## ◆ DdnsParams() [2/2]

isc::dhcp::DdnsParams::DdnsParams | ( | const ConstSubnetPtr & | subnet,
|  | bool | d2_client_enabled )
| inline

Constructor.

Parameters

  subnet | Pointer to subnet instance to use for fetching parameter values (typically this is the selected subnet).
  d2_client_enabled | flag which indicates whether or not D2Client is enabled (typically the value should come from global D2Client configuration).

Definition at line 35 of file ddns_params.h.

## Member Function Documentation

## ◆ getConflictResolutionMode()

std::string isc::dhcp::DdnsParams::getConflictResolutionMode | ( |  | ) | const

Returns the DDNS config resolution mode for kea-dhcp-ddns.

This value is communicated to D2 via the NCR.

Returns
  the DDNS conflict resolution mode

Definition at line 32 of file ddns_params.cc.

## ◆ getEnableUpdates()

bool isc::dhcp::DdnsParams::getEnableUpdates | ( |  | ) | const

Returns whether or not DHCP DDNS updating is enabled.

The value is the logical AND of d2_client_enabled_ and the value returned by subnet_'s getDdnsSendUpdates().

Returns
  True if updates are enabled, false otherwise or if subnet_ is empty.

Definition at line 967 of file srv_config.cc.

Referenced by isc::dhcp::D2ClientMgr::analyzeFqdn(), and isc::dhcp::Dhcpv4Srv::createNameChangeRequests().

## ◆ getGeneratedPrefix()

std::string isc::dhcp::DdnsParams::getGeneratedPrefix | ( |  | ) | const

Returns the Prefix Kea should use when generating domain-names.

Returns
  The value from the subnet_ or an empty string if subnet_ is empty.

Definition at line 1030 of file srv_config.cc.

Referenced by isc::dhcp::D2ClientMgr::generateFqdn().

## ◆ getHostnameCharReplacement()

std::string isc::dhcp::DdnsParams::getHostnameCharReplacement | ( |  | ) | const

Returns the string to replace invalid characters when scrubbing hostnames.

Meaningful only if hostname_char_set_ is not empty.

Returns
  The value from the subnet_ or an empty string if subnet_ is empty.

Definition at line 1071 of file srv_config.cc.

Referenced by getHostnameSanitizer().

## ◆ getHostnameCharSet()

std::string isc::dhcp::DdnsParams::getHostnameCharSet | ( |  | ) | const

Returns the regular expression describing invalid characters for client hostnames.

If empty, host name scrubbing should not be done.

Returns
  The value from the subnet_ or an empty string if subnet_ is empty.

Definition at line 1062 of file srv_config.cc.

Referenced by getHostnameSanitizer().

## ◆ getHostnameSanitizer()

util::str::StringSanitizerPtr isc::dhcp::DdnsParams::getHostnameSanitizer | ( |  | ) | const

Returns a regular expression string sanitizer.

If the value returned by getHostnameCharSet() is not empty, then it is used in conjunction the value returned by getHostnameCharReplacment() (which may be empty) to create and return a StringSanitizer instance. Otherwise it will return an empty pointer.

Returns
  pointer to the StringSanitizer instance or an empty pointer

Exceptions

  BadValue | if the compilation fails.

Definition at line 1080 of file srv_config.cc.

References getHostnameCharReplacement(), getHostnameCharSet(), and isc_throw.

Referenced by isc::dhcp::D2ClientMgr::adjustDomainName().

Here is the call graph for this function:

## ◆ getOverrideClientUpdate()

bool isc::dhcp::DdnsParams::getOverrideClientUpdate | ( |  | ) | const

Returns whether or not Kea should perform updates, even if client requested delegation.

Returns
  The value from the subnet_ or false if subnet_ is empty.

Definition at line 998 of file srv_config.cc.

Referenced by isc::dhcp::D2ClientMgr::analyzeFqdn().

## ◆ getOverrideNoUpdate()

bool isc::dhcp::DdnsParams::getOverrideNoUpdate | ( |  | ) | const

Returns whether or not Kea should perform updates, even if client requested no updates.

Returns
  The value from the subnet_ or false if subnet_ is empty.

Definition at line 983 of file srv_config.cc.

Referenced by isc::dhcp::D2ClientMgr::analyzeFqdn().

## ◆ getPool()

PoolPtr isc::dhcp::DdnsParams::getPool | ( |  | ) | const
| inline

Fetches the current pool.

Returns
  Pointer to the current pool, may be an empty pointer.

Definition at line 175 of file ddns_params.h.

## ◆ getQualifyingSuffix()

std::string isc::dhcp::DdnsParams::getQualifyingSuffix | ( |  | ) | const

Returns the suffix Kea should use when to qualify partial domain-names.

Returns
  The value from the subnet_ or an empty string if subnet_ is empty.

Definition at line 1046 of file srv_config.cc.

Referenced by isc::dhcp::D2ClientMgr::qualifyName().

## ◆ getReplaceClientNameMode()

D2ClientConfig::ReplaceClientNameMode isc::dhcp::DdnsParams::getReplaceClientNameMode | ( |  | ) | const

Returns how Kea should handle the domain-name supplied by the client.

Returns
  The value from the subnet_ or RCM_NEVER if subnet_ is empty.

Definition at line 1014 of file srv_config.cc.

References isc::dhcp::D2ClientConfig::RCM_NEVER.

Referenced by isc::dhcp::D2ClientMgr::adjustDomainName().

## ◆ getSubnetId()

SubnetID isc::dhcp::DdnsParams::getSubnetId | ( |  | ) | const
| inline

Returns the subnet-id of the subnet associated with these parameters.

Returns
  value of subnet-id (or 0 if no subnet is associated)

Definition at line 150 of file ddns_params.h.

## ◆ getTtl()

util::Optional< uint32_t > isc::dhcp::DdnsParams::getTtl | ( |  | ) | const

Returns explicit TTL to use.

This value, if greater than zero, is used as the lifetime passed to D2 in the NCR.

Returns
  TTL as an Optional.

Definition at line 65 of file ddns_params.cc.

## ◆ getTtlMax()

util::Optional< uint32_t > isc::dhcp::DdnsParams::getTtlMax | ( |  | ) | const

Returns the maximum TTL to use.

This value, if greater than zero, is used as the upper boundary for calculated TTLs.

Returns
  TTL maximum as an Optional.

Definition at line 97 of file ddns_params.cc.

## ◆ getTtlMin()

util::Optional< uint32_t > isc::dhcp::DdnsParams::getTtlMin | ( |  | ) | const

Returns the minimum TTL to use.

This value, if greater than zero, is used as the lower boundary for calculated TTLs.

Returns
  TTL minimum as an Optional.

Definition at line 81 of file ddns_params.cc.

## ◆ getTtlPercent()

util::Optional< double > isc::dhcp::DdnsParams::getTtlPercent | ( |  | ) | const

Returns percent of lease lifetime to use for TTL.

This value, if greater than zero, is used to calculate the lease lifetime passed to D2 in the NCR. Otherwise the value is calculated per RFC 4702.

Returns
  TTL percent as an Optional.

Definition at line 49 of file ddns_params.cc.

## ◆ getUpdateOnRenew()

bool isc::dhcp::DdnsParams::getUpdateOnRenew | ( |  | ) | const

Returns whether or not DNS should be updated when leases renew.

If this is true, DNS should always be updated when leases are extended (i.e. renewed/rebound) even if the DNS information has not changed.

Returns
  True if updates should always be performed.

Definition at line 16 of file ddns_params.cc.

Referenced by isc::dhcp::Dhcpv4Srv::createNameChangeRequests().

## ◆ resetPool()

void isc::dhcp::DdnsParams::resetPool | ( |  | ) |
| inline

Resets the current pool.

Definition at line 167 of file ddns_params.h.

## ◆ setPoolFromAddress()

PoolPtr isc::dhcp::DdnsParams::setPoolFromAddress | ( | const asiolink::IOAddress & | address | ) |

Sets the pool based on the current subnet and given address.

Parameters

  address | lease address for which the pool is desired.

Returns
  a pointer to the newly set current pool or an empty pointer if there is either no subnet or no matching pool.

Todo
  Not sure this can happen.

Definition at line 113 of file ddns_params.cc.

References isc_throw, isc::asiolink::IOAddress::isV4(), isc::dhcp::Lease::TYPE_NA, and isc::dhcp::Lease::TYPE_V4.

Here is the call graph for this function:

The documentation for this class was generated from the following files:

- ddns_params.h
- ddns_params.cc
- srv_config.cc