summaryrefslogtreecommitdiffstats
path: root/src/lib/dhcpsrv/network.h
diff options
context:
space:
mode:
authorThomas Markwalder <tmark@isc.org>2023-03-21 16:53:32 +0100
committerThomas Markwalder <tmark@isc.org>2023-03-24 17:50:00 +0100
commit904f4d26112b4cff5651691151f5349e7cab723b (patch)
tree8294b560c07b3d7e8b4895d684b0bd082ec89d65 /src/lib/dhcpsrv/network.h
parent[#2748] Update release checklist (diff)
downloadkea-904f4d26112b4cff5651691151f5349e7cab723b.tar.xz
kea-904f4d26112b4cff5651691151f5349e7cab723b.zip
[#225] Added ddsn-ttl-percent parameter
kea-dhcp4/6 both now support ddns-ttl-percent at the global, shared-network, and subnet scopes. If specified it is the percentage of the lease lifetime to send to D2. Not yet supported by CB. modified: doc/examples/kea4/all-keys.json doc/examples/kea6/all-keys.json src/bin/dhcp4/dhcp4_lexer.cc src/bin/dhcp4/dhcp4_lexer.ll src/bin/dhcp4/dhcp4_parser.cc src/bin/dhcp4/dhcp4_parser.h src/bin/dhcp4/dhcp4_parser.yy src/bin/dhcp4/json_config_parser.cc src/bin/dhcp4/location.hh src/bin/dhcp6/dhcp6_lexer.cc src/bin/dhcp6/dhcp6_lexer.ll src/bin/dhcp6/dhcp6_parser.cc src/bin/dhcp6/dhcp6_parser.h src/bin/dhcp6/dhcp6_parser.yy src/bin/dhcp6/dhcp6_srv.cc src/bin/dhcp6/json_config_parser.cc src/bin/dhcp6/location.hh src/bin/dhcp6/tests/fqdn_unittest.cc src/lib/dhcpsrv/cfg_globals.cc src/lib/dhcpsrv/cfg_globals.h src/lib/dhcpsrv/dhcpsrv_messages.cc src/lib/dhcpsrv/dhcpsrv_messages.h src/lib/dhcpsrv/dhcpsrv_messages.mes src/lib/dhcpsrv/ncr_generator.cc src/lib/dhcpsrv/ncr_generator.h src/lib/dhcpsrv/network.cc src/lib/dhcpsrv/network.h src/lib/dhcpsrv/parsers/base_network_parser.cc src/lib/dhcpsrv/parsers/base_network_parser.h src/lib/dhcpsrv/parsers/simple_parser4.cc src/lib/dhcpsrv/parsers/simple_parser6.cc src/lib/dhcpsrv/srv_config.cc src/lib/dhcpsrv/srv_config.h src/lib/dhcpsrv/tests/ncr_generator_unittest.cc src/lib/dhcpsrv/tests/network_unittest.cc src/lib/dhcpsrv/tests/srv_config_unittest.cc
Diffstat (limited to 'src/lib/dhcpsrv/network.h')
-rw-r--r--src/lib/dhcpsrv/network.h22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/lib/dhcpsrv/network.h b/src/lib/dhcpsrv/network.h
index de3ce2a64a..147f79e826 100644
--- a/src/lib/dhcpsrv/network.h
+++ b/src/lib/dhcpsrv/network.h
@@ -219,7 +219,7 @@ public:
ddns_replace_client_name_mode_(), ddns_generated_prefix_(), ddns_qualifying_suffix_(),
hostname_char_set_(), hostname_char_replacement_(), store_extended_info_(),
cache_threshold_(), cache_max_age_(), ddns_update_on_renew_(),
- ddns_use_conflict_resolution_() {
+ ddns_use_conflict_resolution_(), ddns_ttl_percent_() {
}
/// @brief Virtual destructor.
@@ -663,6 +663,23 @@ public:
ddns_qualifying_suffix_ = ddns_qualifying_suffix;
}
+ /// @brief Returns ddns-ttl-percent
+ ///
+ /// @param inheritance inheritance mode to be used.
+ util::Optional<double>
+ getDdnsTtlPercent(const Inheritance& inheritance = Inheritance::ALL) const {
+ return (getProperty<Network>(&Network::getDdnsTtlPercent,
+ ddns_ttl_percent_, inheritance,
+ CfgGlobals::DDNS_TTL_PERCENT));
+ }
+
+ /// @brief Sets new ddns-ttl-percent
+ ///
+ /// @param ddns_ttl_percent New value to use.
+ void setDdnsTtlPercent(const util::Optional<double>& ddns_ttl_percent) {
+ ddns_ttl_percent_ = ddns_ttl_percent;
+ }
+
/// @brief Return the char set regexp used to sanitize client hostnames.
util::Optional<std::string>
getHostnameCharSet(const Inheritance& inheritance = Inheritance::ALL) const {
@@ -1195,6 +1212,9 @@ protected:
/// @brief Allocator used for IP address allocations.
util::Optional<std::string> allocator_type_;
+ /// @brief Percentage of the lease lifetime to use for DNS TTL.
+ util::Optional<double> ddns_ttl_percent_;
+
/// @brief Pointer to another network that this network belongs to.
///
/// The most common case is that this instance is a subnet which belongs