Kea 3.1.1
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
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
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
98
106 bool getUpdateOnRenew() const;
107
115
123
131
139
145 std::string getConflictResolutionMode() const;
146
151 if (subnet_) {
152 return (subnet_->getID());
153 } else {
154 return (0);
155 }
156 }
157
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
191typedef boost::shared_ptr<DdnsParams> DdnsParamsPtr;
192
193} // namespace dhcp
194} // namespace isc
195
196#endif // DDNS_PARAMS_H
ReplaceClientNameMode
Defines the client name replacement modes.
std::string getHostnameCharReplacement() const
Returns the string to replace invalid characters when scrubbing hostnames.
void resetPool()
Resets the current pool.
D2ClientConfig::ReplaceClientNameMode getReplaceClientNameMode() const
Returns how Kea should handle the domain-name supplied by the client.
std::string getGeneratedPrefix() const
Returns the Prefix Kea should use when generating domain-names.
util::Optional< double > getTtlPercent() const
Returns percent of lease lifetime to use for TTL.
isc::util::str::StringSanitizerPtr getHostnameSanitizer() const
Returns a regular expression string sanitizer.
std::string getHostnameCharSet() const
Returns the regular expression describing invalid characters for client hostnames.
util::Optional< uint32_t > getTtl() const
Returns explicit TTL to use.
SubnetID getSubnetId() const
Returns the subnet-id of the subnet associated with these parameters.
std::string getConflictResolutionMode() const
Returns the DDNS config resolution mode for kea-dhcp-ddns.
std::string getQualifyingSuffix() const
Returns the suffix Kea should use when to qualify partial domain-names.
bool getUpdateOnRenew() const
Returns whether or not DNS should be updated when leases renew.
bool getOverrideNoUpdate() const
Returns whether or not Kea should perform updates, even if client requested no updates.
util::Optional< uint32_t > getTtlMax() const
Returns the maximum TTL to use.
PoolPtr setPoolFromAddress(const asiolink::IOAddress &address)
Sets the pool based on the current subnet and given address.
DdnsParams()
Default constructor.
Definition ddns_params.h:26
util::Optional< uint32_t > getTtlMin() const
Returns the minimum TTL to use.
bool getEnableUpdates() const
Returns whether or not DHCP DDNS updating is enabled.
bool getOverrideClientUpdate() const
Returns whether or not Kea should perform updates, even if client requested delegation.
DdnsParams(const ConstSubnetPtr &subnet, bool d2_client_enabled)
Constructor.
Definition ddns_params.h:35
PoolPtr getPool() const
Fetches the current pool.
A template representing an optional value.
Definition optional.h:36
boost::shared_ptr< DdnsParams > DdnsParamsPtr
Defines a pointer for DdnsParams instances.
boost::shared_ptr< Pool > PoolPtr
a pointer to either IPv4 or IPv6 Pool
Definition pool.h:726
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition subnet_id.h:25
boost::shared_ptr< const Subnet > ConstSubnetPtr
A generic pointer to either const Subnet4 or const Subnet6 object.
Definition subnet.h:452
std::unique_ptr< StringSanitizer > StringSanitizerPtr
Type representing the pointer to the StringSanitizer.
Definition str.h:263
Defines the logger used by the top-level component of kea-lfc.