2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-30 21:45:37 +00:00
/doc/examples/kea4/all-keys.json
/doc/examples/kea6/all-keys.json
    Commented out ddns-use-conflict-resolution
    Added ddns-conflict-resolution-mode

/src/bin/dhcp4/dhcp4_parser.yy b/src/bin/dhcp4/dhcp4_parser.yy
/src/bin/dhcp4/dhcp4_parser.yy b/src/bin/dhcp6/dhcp6_parser.yy
    Translates ddns-use-conflict-resolution
    to ddns-conflict-resolution-mode

/src/lib/dhcpsrv/cfg_globals.cc
/src/lib/dhcpsrv/cfg_globals.h
    Removed ddns-use-conflict-resolution

/src/lib/dhcpsrv/parsers/simple_parser4.cc
/src/lib/dhcpsrv/parsers/simple_parser6.cc
    removed ddns-use-conflict-resolution
This commit is contained in:
Thomas Markwalder
2023-06-05 10:51:40 -04:00
parent 54905229fd
commit f1523a6674
13 changed files with 1591 additions and 1582 deletions

View File

@@ -213,7 +213,7 @@
// It may be specified at the global, shared-network, and subnet levels.
// This field has been replaced by ddns-conflict-resolution-mode.
// Parsing is maintained only for backwards compatibility.
"ddns-use-conflict-resolution": true,
// "ddns-use-conflict-resolution": true,
// Enumeration, which is passed to kea-dhcp-ddns with each DDNS
// update request to indicate the mode used for resolving conflicts
@@ -772,7 +772,7 @@
// Shared-network level value. See description at the global level.
// This field has been replaced by ddns-conflict-resolution-mode.
// Parsing is maintained only for backwards compatibility.
"ddns-use-conflict-resolution": true,
// "ddns-use-conflict-resolution": true,
// Shared-network level value. See description at the global level.
"ddns-conflict-resolution-mode": "check-with-dhcid",
@@ -916,10 +916,10 @@
// Subnet-level value. See description at the global level.
"ddns-update-on-renew": true,
// Subnet-level value. See description at the global level.
// Shared-network level value. See description at the global level.
// This field has been replaced by ddns-conflict-resolution-mode.
// Parsing is maintained only for backwards compatibility.
"ddns-use-conflict-resolution": true,
// "ddns-use-conflict-resolution": true,
// Subnet-level value. See description at the global level.
"ddns-conflict-resolution-mode": "check-with-dhcid",

View File

@@ -164,7 +164,7 @@
// It may be specified at the global, shared-network, and subnet levels.
// This field has been replaced by ddns-conflict-resolution-mode.
// Parsing is maintained only for backwards compatibility.
"ddns-use-conflict-resolution": true,
// "ddns-use-conflict-resolution": true,
// Enumeration, which is passed to kea-dhcp-ddns with each DDNS
// update request to indicate the mode used for resolving conflicts
@@ -715,7 +715,7 @@
// Shared-network level value. See description at the global level.
// This field has been replaced by ddns-conflict-resolution-mode.
// Parsing is maintained only for backwards compatibility.
"ddns-use-conflict-resolution": true,
// "ddns-use-conflict-resolution": true,
// Shared-network level value. See description at the global level.
"ddns-conflict-resolution-mode": "check-with-dhcid",
@@ -854,7 +854,7 @@
// Subnet-level value. See description at the global level.
// This field has been replaced by ddns-conflict-resolution-mode.
// Parsing is maintained only for backwards compatibility.
"ddns-use-conflict-resolution": true,
// "ddns-use-conflict-resolution": true,
// Subnet-level value. See description at the global level.
"ddns-conflict-resolution-mode": "check-with-dhcid",

File diff suppressed because it is too large Load Diff

View File

@@ -750,10 +750,17 @@ ddns_update_on_renew: DDNS_UPDATE_ON_RENEW COLON BOOLEAN {
ctx.stack_.back()->set("ddns-update-on-renew", b);
};
// ddns-use-conflict-resolutions is deprecated. We translate it
// to ddns-conflict-resolution-mode. If they happen to specify
// both the server parsing should detect it.
ddns_use_conflict_resolution: DDNS_USE_CONFLICT_RESOLUTION COLON BOOLEAN {
ctx.unique("ddns-use-conflict-resolution", ctx.loc2pos(@1));
ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("ddns-use-conflict-resolution", b);
ctx.warning(@2, "ddns-use-conflict-resolution is deprecated. "
"Substituting ddns-conflict-resolution-mode");
ElementPtr mode(new StringElement(b->boolValue() ? "check-with-dhcid"
: "no-check-with-dhcid"));
ctx.stack_.back()->set("ddns-conflict-resolution-mode", mode);
};
ddns_conflict_resolution_mode: DDNS_CONFLICT_RESOLUTION_MODE {

View File

@@ -1,4 +1,4 @@
// A Bison parser, made by GNU Bison 3.8.2.
// A Bison parser, made by GNU Bison 3.7.2.
// Locations for Bison parsers in C++

File diff suppressed because it is too large Load Diff

View File

@@ -741,10 +741,17 @@ ddns_update_on_renew: DDNS_UPDATE_ON_RENEW COLON BOOLEAN {
ctx.stack_.back()->set("ddns-update-on-renew", b);
};
// ddns-use-conflict-resolutions is deprecated. We translate it
// to ddns-conflict-resolution-mode. If they happen to specify
// both the server parsing should detect it.
ddns_use_conflict_resolution: DDNS_USE_CONFLICT_RESOLUTION COLON BOOLEAN {
ctx.unique("ddns-use-conflict-resolution", ctx.loc2pos(@1));
ElementPtr b(new BoolElement($3, ctx.loc2pos(@3)));
ctx.stack_.back()->set("ddns-use-conflict-resolution", b);
ctx.warning(@2, "ddns-use-conflict-resolution is deprecated. "
"Substituting ddns-conflict-resolution-mode");
ElementPtr mode(new StringElement(b->boolValue() ? "check-with-dhcid"
: "no-check-with-dhcid"));
ctx.stack_.back()->set("ddns-conflict-resolution-mode", mode);
};
ddns_conflict_resolution_mode: DDNS_CONFLICT_RESOLUTION_MODE {

View File

@@ -48,7 +48,6 @@ CfgGlobals::nameToIndex = {
{ "ip-reservations-unique", IP_RESERVATIONS_UNIQUE },
{ "reservations-lookup-first", RESERVATIONS_LOOKUP_FIRST },
{ "ddns-update-on-renew", DDNS_UPDATE_ON_RENEW },
{ "ddns-use-conflict-resolution", DDNS_USE_CONFLICT_RESOLUTION },
{ "parked-packet-limit", PARKED_PACKET_LIMIT },
{ "allocator", ALLOCATOR },
{ "ddns-ttl-percent", DDNS_TTL_PERCENT },
@@ -137,6 +136,7 @@ CfgGlobals::set(const std::string& name, ConstElementPtr value) {
if (it == nameToIndex.cend()) {
isc_throw(NotFound, "invalid global parameter name '" << name << "'");
}
set(it->second, value);
}

View File

@@ -71,7 +71,6 @@ public:
IP_RESERVATIONS_UNIQUE,
RESERVATIONS_LOOKUP_FIRST,
DDNS_UPDATE_ON_RENEW,
DDNS_USE_CONFLICT_RESOLUTION,
PARKED_PACKET_LIMIT,
ALLOCATOR,
DDNS_TTL_PERCENT,

View File

@@ -271,17 +271,10 @@ BaseNetworkParser::parseDdnsParams(const data::ConstElementPtr& network_data,
network->setDdnsTtlPercent(getDouble(network_data, "ddns-ttl-percent"));
}
// For backward compatibility, ddns-conflict-resolution-mode is optional.
if (network_data->contains("ddns-conflict-resolution-mode")) {
network->setDdnsConflictResolutionMode(getString(network_data,
"ddns-conflict-resolution-mode"));
} else {
// For backward compatibility, look for ddns-use-conflict-resolution.
// We might consider emitting a debug log?
if (network_data->contains("ddns-use-conflict-resolution")) {
auto value = getBoolean(network_data, "ddns-use-conflict-resolution");
network->setDdnsConflictResolutionMode(value ? "check-with-dhcid"
: "no-check_with-dhcid");
}
}
}

View File

@@ -96,7 +96,6 @@ const SimpleKeywords SimpleParser4::GLOBAL4_PARAMETERS = {
{ "ip-reservations-unique", Element::boolean },
{ "reservations-lookup-first", Element::boolean },
{ "ddns-update-on-renew", Element::boolean },
{ "ddns-use-conflict-resolution", Element::boolean }, // deprecated
{ "compatibility", Element::map },
{ "parked-packet-limit", Element::integer },
{ "allocator", Element::string },
@@ -256,7 +255,6 @@ const SimpleKeywords SimpleParser4::SUBNET4_PARAMETERS = {
{ "cache-threshold", Element::real },
{ "cache-max-age", Element::integer },
{ "ddns-update-on-renew", Element::boolean },
{ "ddns-use-conflict-resolution", Element::boolean }, // deprecated
{ "allocator", Element::string },
{ "offer-lifetime", Element::integer },
{ "ddns-ttl-percent", Element::real },
@@ -385,7 +383,6 @@ const SimpleKeywords SimpleParser4::SHARED_NETWORK4_PARAMETERS = {
{ "cache-threshold", Element::real },
{ "cache-max-age", Element::integer },
{ "ddns-update-on-renew", Element::boolean },
{ "ddns-use-conflict-resolution", Element::boolean }, // deprecated
{ "allocator", Element::string },
{ "offer-lifetime", Element::integer },
{ "ddns-ttl-percent", Element::real },

View File

@@ -97,7 +97,6 @@ const SimpleKeywords SimpleParser6::GLOBAL6_PARAMETERS = {
{ "ip-reservations-unique", Element::boolean },
{ "reservations-lookup-first", Element::boolean },
{ "ddns-update-on-renew", Element::boolean },
{ "ddns-use-conflict-resolution", Element::boolean }, // deprecated
{ "compatibility", Element::map },
{ "parked-packet-limit", Element::integer },
{ "allocator", Element::string },
@@ -251,7 +250,6 @@ const SimpleKeywords SimpleParser6::SUBNET6_PARAMETERS = {
{ "cache-threshold", Element::real },
{ "cache-max-age", Element::integer },
{ "ddns-update-on-renew", Element::boolean },
{ "ddns-use-conflict-resolution", Element::boolean }, // deprecated
{ "allocator", Element::string },
{ "pd-allocator", Element::string },
{ "ddns-ttl-percent", Element::real },
@@ -399,7 +397,6 @@ const SimpleKeywords SimpleParser6::SHARED_NETWORK6_PARAMETERS = {
{ "cache-threshold", Element::real },
{ "cache-max-age", Element::integer },
{ "ddns-update-on-renew", Element::boolean },
{ "ddns-use-conflict-resolution", Element::boolean }, // deprecated
{ "allocator", Element::string },
{ "pd-allocator", Element::string },
{ "ddns-ttl-percent", Element::real },

View File

@@ -1772,7 +1772,8 @@ TEST_F(SrvConfigTest, getDdnsParamsNoSubnetTest6) {
conf.addConfiguredGlobal("hostname-char-set", Element::create("[^A-Z]"));
conf.addConfiguredGlobal("hostname-char-replacement", Element::create("x"));
conf.addConfiguredGlobal("ddns-update-on-renew", Element::create(true));
conf.addConfiguredGlobal("ddns-use-conflict-resolution", Element::create(false));
conf.addConfiguredGlobal("ddns-conflict-resolution-mode",
Element::create("no-check-with-dhcid"));
conf.addConfiguredGlobal("ddns-ttl-percent", Element::create(77.0));
// Get DDNS params for no subnet.