Kea: ddns_params.h Source File

| Kea 3.2.0-git

ddns_params.h
Go to the documentation of this file.
1// Copyright (C) 2014-2025 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef DDNS_PARAMS_H
8#define DDNS_PARAMS_H
9
10#include <cc/data.h>
11#include <dhcpsrv/subnet.h>
12#include <util/optional.h>
13#include <util/str.h>
14
15#include <boost/shared_ptr.hpp>
16
17namespace isc {
18namespace dhcp {
19
23 class DdnsParams {
24public:
26 DdnsParams() : subnet_(), d2_client_enabled_(false) {}
27
35 DdnsParams(const ConstSubnetPtr& subnet, bool d2_client_enabled)
36 : subnet_(subnet),
37 d2_client_enabled_(d2_client_enabled) {}
38
45 bool getEnableUpdates() const;
46
51 bool getOverrideNoUpdate() const;
52
57 bool getOverrideClientUpdate() const;
58
63 D2ClientConfig::ReplaceClientNameMode getReplaceClientNameMode() const;
64
68 std::string getGeneratedPrefix() const;
69
74 std::string getQualifyingSuffix() const;
75
80 std::string getHostnameCharSet() const;
81
86 std::string getHostnameCharReplacement() const;
87
97 isc::util::str::StringSanitizerPtr getHostnameSanitizer() const;
98
106 bool getUpdateOnRenew() const;
107
114 util::Optional<double> getTtlPercent() const;
115
122 util::Optional<uint32_t> getTtl() const;
123
130 util::Optional<uint32_t> getTtlMin() const;
131
138 util::Optional<uint32_t> getTtlMax() const;
139
145 std::string getConflictResolutionMode() const;
146
150 SubnetID getSubnetId() const {
151 if (subnet_) {
152 return (subnet_->getID());
153 } else {
154 return (0);
155 }
156 }
157
164 PoolPtr setPoolFromAddress(const asiolink::IOAddress& address);
165
167 void resetPool() {
168 pool_.reset();
169 }
170
175 PoolPtr getPool() const {
176 return (pool_);
177 }
178
179private:
181 ConstSubnetPtr subnet_;
182
184 bool d2_client_enabled_;
185
187 PoolPtr pool_;
188};
189
191 typedef boost::shared_ptr<DdnsParams> DdnsParamsPtr;
192
193} // namespace dhcp
194} // namespace isc
195
196#endif // DDNS_PARAMS_H
isc::asiolink::IOAddress
The IOAddress class represents an IP addresses (version agnostic).
Definition io_address.h:53
isc::dhcp::D2ClientConfig::ReplaceClientNameMode
ReplaceClientNameMode
Defines the client name replacement modes.
Definition d2_client_cfg.h:76
isc::dhcp::DdnsParams::getHostnameCharReplacement
std::string getHostnameCharReplacement() const
Returns the string to replace invalid characters when scrubbing hostnames.
Definition srv_config.cc:1109
isc::dhcp::DdnsParams::resetPool
void resetPool()
Resets the current pool.
Definition ddns_params.h:167
isc::dhcp::DdnsParams::getReplaceClientNameMode
D2ClientConfig::ReplaceClientNameMode getReplaceClientNameMode() const
Returns how Kea should handle the domain-name supplied by the client.
Definition srv_config.cc:1052
isc::dhcp::DdnsParams::getGeneratedPrefix
std::string getGeneratedPrefix() const
Returns the Prefix Kea should use when generating domain-names.
Definition srv_config.cc:1068
isc::dhcp::DdnsParams::getTtlPercent
util::Optional< double > getTtlPercent() const
Returns percent of lease lifetime to use for TTL.
Definition ddns_params.cc:49
isc::dhcp::DdnsParams::getHostnameSanitizer
isc::util::str::StringSanitizerPtr getHostnameSanitizer() const
Returns a regular expression string sanitizer.
Definition srv_config.cc:1118
isc::dhcp::DdnsParams::getHostnameCharSet
std::string getHostnameCharSet() const
Returns the regular expression describing invalid characters for client hostnames.
Definition srv_config.cc:1100
isc::dhcp::DdnsParams::getTtl
util::Optional< uint32_t > getTtl() const
Returns explicit TTL to use.
Definition ddns_params.cc:65
isc::dhcp::DdnsParams::getSubnetId
SubnetID getSubnetId() const
Returns the subnet-id of the subnet associated with these parameters.
Definition ddns_params.h:150
isc::dhcp::DdnsParams::getConflictResolutionMode
std::string getConflictResolutionMode() const
Returns the DDNS config resolution mode for kea-dhcp-ddns.
Definition ddns_params.cc:32
isc::dhcp::DdnsParams::getQualifyingSuffix
std::string getQualifyingSuffix() const
Returns the suffix Kea should use when to qualify partial domain-names.
Definition srv_config.cc:1084
isc::dhcp::DdnsParams::getUpdateOnRenew
bool getUpdateOnRenew() const
Returns whether or not DNS should be updated when leases renew.
Definition ddns_params.cc:16
isc::dhcp::DdnsParams::getOverrideNoUpdate
bool getOverrideNoUpdate() const
Returns whether or not Kea should perform updates, even if client requested no updates.
Definition srv_config.cc:1021
isc::dhcp::DdnsParams::getTtlMax
util::Optional< uint32_t > getTtlMax() const
Returns the maximum TTL to use.
Definition ddns_params.cc:97
isc::dhcp::DdnsParams::setPoolFromAddress
PoolPtr setPoolFromAddress(const asiolink::IOAddress &address)
Sets the pool based on the current subnet and given address.
Definition ddns_params.cc:113
isc::dhcp::DdnsParams::DdnsParams
DdnsParams()
Default constructor.
Definition ddns_params.h:26
isc::dhcp::DdnsParams::getTtlMin
util::Optional< uint32_t > getTtlMin() const
Returns the minimum TTL to use.
Definition ddns_params.cc:81
isc::dhcp::DdnsParams::getEnableUpdates
bool getEnableUpdates() const
Returns whether or not DHCP DDNS updating is enabled.
Definition srv_config.cc:1005
isc::dhcp::DdnsParams::getOverrideClientUpdate
bool getOverrideClientUpdate() const
Returns whether or not Kea should perform updates, even if client requested delegation.
Definition srv_config.cc:1036
isc::dhcp::DdnsParams::DdnsParams
DdnsParams(const ConstSubnetPtr &subnet, bool d2_client_enabled)
Constructor.
Definition ddns_params.h:35
isc::dhcp::DdnsParams::getPool
PoolPtr getPool() const
Fetches the current pool.
Definition ddns_params.h:175
isc::util::Optional
A template representing an optional value.
Definition optional.h:37
data.h
isc::dhcp
Definition dhcp4/client_handler.cc:20
isc::dhcp::DdnsParamsPtr
boost::shared_ptr< DdnsParams > DdnsParamsPtr
Defines a pointer for DdnsParams instances.
Definition ddns_params.h:191
isc::dhcp::PoolPtr
boost::shared_ptr< Pool > PoolPtr
a pointer to either IPv4 or IPv6 Pool
Definition pool.h:726
isc::dhcp::SubnetID
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
isc::dhcp::ConstSubnetPtr
boost::shared_ptr< const Subnet > ConstSubnetPtr
A generic pointer to either const Subnet4 or const Subnet6 object.
Definition subnet.h:449
isc::util::str::StringSanitizerPtr
std::unique_ptr< StringSanitizer > StringSanitizerPtr
Type representing the pointer to the StringSanitizer.
Definition str.h:263
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
optional.h
str.h
subnet.h