From: Razvan Becheriu Date: Mon, 13 May 2024 20:12:59 +0000 (+0300) Subject: [#3301] updated yang modules X-Git-Tag: Kea-2.6.0~27 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cbf76f496d73d9e2b0e8ab3f2bcf1d86595d84e;p=thirdparty%2Fkea.git [#3301] updated yang modules --- diff --git a/doc/examples/kea4/all-keys-netconf.json b/doc/examples/kea4/all-keys-netconf.json index d5246b26be..e03d71d10a 100644 --- a/doc/examples/kea4/all-keys-netconf.json +++ b/doc/examples/kea4/all-keys-netconf.json @@ -211,7 +211,25 @@ // resolution as described in RFC 4703 should be employed for the // given update request. The default value for this flag is true. // It may be specified at the global, shared-network, and subnet levels. - "ddns-use-conflict-resolution": true, + // This field has been replaced by ddns-conflict-resolution-mode. + // Parsing is maintained only for backwards compatibility. + // "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 + // while performing DDNS updates. The acceptable values are: + // check-with-dhcid (this includes adding a DHCID record and checking + // that record via conflict detection as per RFC 4703, + // no-check-with-dhcid (this will ignore conflict detection but add + // a DHCID record when creating/updating an entry), + // check-exists-with-dhcid (this will check if there is an existing + // DHCID record but does not verify the value of the record matches + // the update. This will also update the DHCID record for the entry), + // no-check-without-dhcid (this ignores conflict detection and will + // not add a DHCID record when creating/updating a DDNS entry). + // The default value is "check-with-dhcid". It may be + // specified at the global, shared-network and subnet levels. + "ddns-conflict-resolution-mode": "check-with-dhcid", // When greater than 0.0, it is the percent of the lease's lifetime // to use for the DNS TTL. @@ -377,6 +395,10 @@ // serve-retry-continue "on-fail": "stop-retry-exit", + // Flag which indicates if the DB recovery should be attempted + // at server startup and on reconfiguration events. + "retry-on-startup": false, + // Connection connect timeout in seconds. "connect-timeout": 100, @@ -739,7 +761,12 @@ "ddns-update-on-renew": true, // Shared-network level value. See description at the global level. - "ddns-use-conflict-resolution": true, + // This field has been replaced by ddns-conflict-resolution-mode. + // Parsing is maintained only for backwards compatibility. + // "ddns-use-conflict-resolution": true, + + // Shared-network level value. See description at the global level. + "ddns-conflict-resolution-mode": "check-with-dhcid", // Shared-network level value. See description at the global level. "ddns-ttl-percent": 0.65, @@ -873,8 +900,13 @@ // Subnet-level value. See description at the global level. "ddns-update-on-renew": true, + // 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, + // Subnet-level value. See description at the global level. - "ddns-use-conflict-resolution": true, + "ddns-conflict-resolution-mode": "check-with-dhcid", // Subnet-level value. See description at the global level. "ddns-ttl-percent": 0.55, @@ -1082,6 +1114,10 @@ // Global server hostname set in the 'sname' field. "server-hostname": "", + // Stash agent options (aka RAI) to make direct queries to come + // through a relay. + "stash-agent-options": false, + // List of IPv4 subnets which don't belong to any shared network. "subnet4": [], diff --git a/doc/examples/kea6/all-keys-netconf.json b/doc/examples/kea6/all-keys-netconf.json index 16fe6ef725..efc8e25235 100644 --- a/doc/examples/kea6/all-keys-netconf.json +++ b/doc/examples/kea6/all-keys-netconf.json @@ -162,7 +162,25 @@ // resolution as described in RFC 4703 should be employed for the // given update request. The default value for this flag is true. // It may be specified at the global, shared-network, and subnet levels. - "ddns-use-conflict-resolution": true, + // This field has been replaced by ddns-conflict-resolution-mode. + // Parsing is maintained only for backwards compatibility. + // "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 + // while performing DDNS updates. The acceptable values are: + // check-with-dhcid (this includes adding a DHCID record and checking + // that record via conflict detection as per RFC 4703, + // no-check-with-dhcid (this will ignore conflict detection but add + // a DHCID record when creating/updating an entry), + // check-exists-with-dhcid (this will check if there is an existing + // DHCID record but does not verify the value of the record matches + // the update. This will also update the DHCID record for the entry), + // no-check-without-dhcid (this ignores conflict detection and will + // not add a DHCID record when creating/updating a DDNS entry). + // The default value is "check-with-dhcid". It may be + // specified at the global, shared-network and subnet levels. + "ddns-conflict-resolution-mode": "check-with-dhcid", // When greater than 0.0, it is the percent of the lease's lifetime // to use for the DNS TTL. @@ -319,6 +337,10 @@ // serve-retry-continue "on-fail": "stop-retry-exit", + // Flag which indicates if the DB recovery should be attempted + // at server startup and on reconfiguration events. + "retry-on-startup": false, + // Connection connect timeout in seconds. "connect-timeout": 100, @@ -682,7 +704,12 @@ "ddns-update-on-renew": true, // Shared-network level value. See description at the global level. - "ddns-use-conflict-resolution": true, + // This field has been replaced by ddns-conflict-resolution-mode. + // Parsing is maintained only for backwards compatibility. + // "ddns-use-conflict-resolution": true, + + // Shared-network level value. See description at the global level. + "ddns-conflict-resolution-mode": "check-with-dhcid", // Shared-network level value. See description at the global level. "ddns-ttl-percent": 0.65, @@ -809,7 +836,12 @@ "ddns-update-on-renew": true, // Subnet-level value. See description at the global level. - "ddns-use-conflict-resolution": true, + // This field has been replaced by ddns-conflict-resolution-mode. + // Parsing is maintained only for backwards compatibility. + // "ddns-use-conflict-resolution": true, + + // Subnet-level value. See description at the global level. + "ddns-conflict-resolution-mode": "check-with-dhcid", // Subnet-level value. See description at the global level. "ddns-ttl-percent": 0.55, diff --git a/doc/sphinx/arm/dhcp4-srv.rst b/doc/sphinx/arm/dhcp4-srv.rst index 446331de3c..8b44410ffb 100644 --- a/doc/sphinx/arm/dhcp4-srv.rst +++ b/doc/sphinx/arm/dhcp4-srv.rst @@ -5748,10 +5748,6 @@ following can be used: { "id": 1, "subnet": "10.0.0.0/24", - # It is replaced by the "reservations-global", - # "reservations-in-subnet", and "reservations-out-of-pool" - # parameters. - # "reservation-mode": "global", # Specify if the server should look up global reservations. "reservations-global": true, # Specify if the server should look up in-subnet reservations. @@ -7942,8 +7938,6 @@ at which it is currently supported. +-----------------------------+----------------------------+--------------+-------------+-------------+-------------+ | require-client-classes | no | n/a | yes | yes | yes | +-----------------------------+----------------------------+--------------+-------------+-------------+-------------+ - | reservation-mode | yes | n/a | yes | yes | n/a | - +-----------------------------+----------------------------+--------------+-------------+-------------+-------------+ | reservations-global | yes | n/a | yes | yes | n/a | +-----------------------------+----------------------------+--------------+-------------+-------------+-------------+ | reservations-in-subnet | yes | n/a | yes | yes | n/a | diff --git a/doc/sphinx/arm/dhcp6-srv.rst b/doc/sphinx/arm/dhcp6-srv.rst index 5deec17681..7ef6b9816f 100644 --- a/doc/sphinx/arm/dhcp6-srv.rst +++ b/doc/sphinx/arm/dhcp6-srv.rst @@ -5039,10 +5039,6 @@ following can be used: "valid-lifetime": 600, "subnet4": [ { "subnet": "2001:db8:1::/64", - # It is replaced by the "reservations-global", - # "reservations-in-subnet", and "reservations-out-of-pool" - # parameters. - # "reservation-mode": "global", # Specify if the server should look up global reservations. "reservations-global": true, # Specify if the server should look up in-subnet reservations. @@ -7776,8 +7772,6 @@ at which it is currently supported. +-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+ | require-client-classes | n/a | n/a | yes | yes | yes | yes | +-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+ - | reservation-mode | yes | n/a | yes | yes | n/a | n/a | - +-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+ | reservations-global | yes | n/a | yes | yes | n/a | n/a | +-----------------------------+----------------------------+-----------+-----------+-----------+-----------+------------+ | reservations-in-subnet | yes | n/a | yes | yes | n/a | n/a | diff --git a/src/lib/yang/adaptor_subnet.cc b/src/lib/yang/adaptor_subnet.cc index 0beba823e3..5e4e9f2bc4 100644 --- a/src/lib/yang/adaptor_subnet.cc +++ b/src/lib/yang/adaptor_subnet.cc @@ -47,19 +47,7 @@ AdaptorSubnet::updateRelay(ElementPtr subnet) { return; } ConstElementPtr addresses = relay->get("ip-addresses"); - if (!addresses) { - ConstElementPtr address = relay->get("ip-address"); - if (!address) { - subnet->remove("relay"); - return; - } - ElementPtr addr = Element::create(address->stringValue()); - ElementPtr addrs = Element::createList(); - addrs->add(addr); - ElementPtr updated = Element::createMap(); - updated->set("ip-addresses", addrs); - subnet->set("relay", updated); - } else if (addresses->size() == 0) { + if (!addresses || addresses->size() == 0) { subnet->remove("relay"); } } diff --git a/src/lib/yang/adaptor_subnet.h b/src/lib/yang/adaptor_subnet.h index f357eb9c70..475fec043c 100644 --- a/src/lib/yang/adaptor_subnet.h +++ b/src/lib/yang/adaptor_subnet.h @@ -20,9 +20,8 @@ namespace yang { /// so the caller can decide if the second pass is needed. /// -2- For a subnet without an ID, assigned the next unused ID. /// -/// For relays an old syntax ip-address is translated into a new syntax -/// ip-addresses. Note as all canonization adaptor it is optional, i.e., -/// code should work without it. +/// Note as all canonization adaptor it is optional, i.e., code should work +/// without it. class AdaptorSubnet { public: /// @brief Destructor. @@ -47,7 +46,6 @@ public: /// @brief Update relay. /// - /// Force the use of ip-addresses when it finds an ip-address entry. /// Can be used for shared networks too. /// /// @param subnet The subnet. diff --git a/src/lib/yang/tests/adaptor_subnet_unittests.cc b/src/lib/yang/tests/adaptor_subnet_unittests.cc index 4b744b4877..6cf060f01c 100644 --- a/src/lib/yang/tests/adaptor_subnet_unittests.cc +++ b/src/lib/yang/tests/adaptor_subnet_unittests.cc @@ -173,42 +173,4 @@ TEST(AdaptorSubnetTest, updateRelayEmptyAddresses) { EXPECT_FALSE(json->get("relay")); } -// Verifies how updateRelay handles a subnet entry with relay which -// has addresses: no change. -TEST(AdaptorSubnetTest, updateRelayAddresses) { - string config = "{\n" - " \"subnet\": \"192.0.2.0/24\",\n" - " \"relay\": {\n" - " \"ip-addresses\": [ \"192.168.1.1\" ]\n" - " }\n" - "}"; - ElementPtr json; - ASSERT_NO_THROW_LOG(json = Element::fromJSON(config)); - ConstElementPtr copied = copy(json); - ASSERT_NO_THROW_LOG(AdaptorSubnet::updateRelay(json)); - EXPECT_TRUE(copied->equals(*json)); -} - -// Verifies how updateRelay handles a subnet entry with relay which -// has only address: the address is moved to a new list. -TEST(AdaptorSubnetTest, updateRelayAddress) { - string config = "{\n" - " \"subnet\": \"192.0.2.0/24\",\n" - " \"relay\": {\n" - " \"ip-address\": \"192.168.1.1\"\n" - " }\n" - "}"; - ElementPtr json; - ASSERT_NO_THROW_LOG(json = Element::fromJSON(config)); - ConstElementPtr copied = copy(json); - ASSERT_NO_THROW_LOG(AdaptorSubnet::updateRelay(json)); - EXPECT_FALSE(copied->equals(*json)); - ConstElementPtr relay = json->get("relay"); - ASSERT_TRUE(relay); - string expected = "{ \"ip-addresses\": [ \"192.168.1.1\" ] }"; - EXPECT_EQ(expected, relay->str()); -} - -// It does not make sense to have both ip-address and ip-addresses... - } // anonymous namespace diff --git a/src/lib/yang/translator_config.cc b/src/lib/yang/translator_config.cc index 4c2c6b88e1..da2806da75 100644 --- a/src/lib/yang/translator_config.cc +++ b/src/lib/yang/translator_config.cc @@ -131,16 +131,9 @@ TranslatorConfig::getDdnsKea(DataNode const& data_node) { ElementPtr result(Element::createMap()); checkAndGetLeaf(result, data_node, "enable-updates"); - checkAndGetLeaf(result, data_node, "generated-prefix"); - checkAndGetLeaf(result, data_node, "hostname-char-replacement"); - checkAndGetLeaf(result, data_node, "hostname-char-set"); checkAndGetLeaf(result, data_node, "max-queue-size"); checkAndGetLeaf(result, data_node, "ncr-format"); checkAndGetLeaf(result, data_node, "ncr-protocol"); - checkAndGetLeaf(result, data_node, "qualifying-suffix"); - checkAndGetLeaf(result, data_node, "override-client-update"); - checkAndGetLeaf(result, data_node, "override-no-update"); - checkAndGetLeaf(result, data_node, "replace-client-name"); checkAndGetLeaf(result, data_node, "sender-ip"); checkAndGetLeaf(result, data_node, "sender-port"); checkAndGetLeaf(result, data_node, "server-ip"); @@ -201,6 +194,7 @@ TranslatorConfig::getServerKeaDhcpCommon(DataNode const& data_node) { checkAndGetLeaf(result, data_node, "ddns-ttl-percent"); checkAndGetLeaf(result, data_node, "ddns-update-on-renew"); checkAndGetLeaf(result, data_node, "ddns-use-conflict-resolution"); + checkAndGetLeaf(result, data_node, "ddns-conflict-resolution-mode"); checkAndGetLeaf(result, data_node, "decline-probation-period"); checkAndGetLeaf(result, data_node, "early-global-reservations-lookup"); checkAndGetLeaf(result, data_node, "host-reservation-identifiers"); @@ -212,7 +206,6 @@ TranslatorConfig::getServerKeaDhcpCommon(DataNode const& data_node) { checkAndGetLeaf(result, data_node, "parked-packet-limit"); checkAndGetLeaf(result, data_node, "rebind-timer"); checkAndGetLeaf(result, data_node, "renew-timer"); - checkAndGetLeaf(result, data_node, "reservation-mode"); checkAndGetLeaf(result, data_node, "reservations-global"); checkAndGetLeaf(result, data_node, "reservations-in-subnet"); checkAndGetLeaf(result, data_node, "reservations-lookup-first"); @@ -341,6 +334,7 @@ TranslatorConfig::getServerKeaDhcp4() { checkAndGetLeaf(result, config, "next-server"); checkAndGetLeaf(result, config, "offer-lifetime"); checkAndGetLeaf(result, config, "server-hostname"); + checkAndGetLeaf(result, config, "stash-agent-options"); checkAndGet(result, config, "compatibility", [&](DataNode const& node) -> ElementPtr const { @@ -519,6 +513,7 @@ TranslatorConfig::setServerKeaDhcpCommon(string const& xpath, checkAndSetLeaf(elem, xpath, "ddns-ttl-percent", LeafBaseType::Dec64); checkAndSetLeaf(elem, xpath, "ddns-update-on-renew", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "ddns-use-conflict-resolution", LeafBaseType::Bool); + checkAndSetLeaf(elem, xpath, "ddns-conflict-resolution-mode", LeafBaseType::Enum); checkAndSetLeaf(elem, xpath, "dhcp4o6-port", LeafBaseType::Uint16); checkAndSetLeaf(elem, xpath, "decline-probation-period", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "early-global-reservations-lookup", LeafBaseType::Bool); @@ -530,7 +525,6 @@ TranslatorConfig::setServerKeaDhcpCommon(string const& xpath, checkAndSetLeaf(elem, xpath, "parked-packet-limit", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "rebind-timer", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "renew-timer", LeafBaseType::Uint32); - checkAndSetLeaf(elem, xpath, "reservation-mode", LeafBaseType::Enum); checkAndSetLeaf(elem, xpath, "reservations-global", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "reservations-in-subnet", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "reservations-lookup-first", LeafBaseType::Bool); @@ -578,16 +572,9 @@ TranslatorConfig::setServerKeaDhcpCommon(string const& xpath, if (ddns) { string const ddns_xpath(xpath + "/dhcp-ddns"); checkAndSetLeaf(ddns, ddns_xpath, "enable-updates", LeafBaseType::Bool); - checkAndSetLeaf(ddns, ddns_xpath, "generated-prefix", LeafBaseType::String); - checkAndSetLeaf(ddns, ddns_xpath, "hostname-char-replacement", LeafBaseType::String); - checkAndSetLeaf(ddns, ddns_xpath, "hostname-char-set", LeafBaseType::String); checkAndSetLeaf(ddns, ddns_xpath, "max-queue-size", LeafBaseType::Uint32); checkAndSetLeaf(ddns, ddns_xpath, "ncr-format", LeafBaseType::Enum); checkAndSetLeaf(ddns, ddns_xpath, "ncr-protocol", LeafBaseType::Enum); - checkAndSetLeaf(ddns, ddns_xpath, "override-client-update", LeafBaseType::Bool); - checkAndSetLeaf(ddns, ddns_xpath, "override-no-update", LeafBaseType::Bool); - checkAndSetLeaf(ddns, ddns_xpath, "qualifying-suffix", LeafBaseType::String); - checkAndSetLeaf(ddns, ddns_xpath, "replace-client-name", LeafBaseType::Enum); checkAndSetLeaf(ddns, ddns_xpath, "sender-ip", LeafBaseType::String); checkAndSetLeaf(ddns, ddns_xpath, "sender-port", LeafBaseType::Uint16); checkAndSetLeaf(ddns, ddns_xpath, "server-ip", LeafBaseType::String); @@ -685,6 +672,7 @@ TranslatorConfig::setServerKeaDhcp4(ConstElementPtr elem) { checkAndSetLeaf(elem, xpath, "next-server", LeafBaseType::String); checkAndSetLeaf(elem, xpath, "offer-lifetime", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "server-hostname", LeafBaseType::String); + checkAndSetLeaf(elem, xpath, "stash-agent-options", LeafBaseType::Bool); ConstElementPtr compatibility(elem->get("compatibility")); if (compatibility) { diff --git a/src/lib/yang/translator_config.h b/src/lib/yang/translator_config.h index cbdff25171..a69ed77f01 100644 --- a/src/lib/yang/translator_config.h +++ b/src/lib/yang/translator_config.h @@ -61,7 +61,6 @@ namespace yang { /// , /// , /// "sanity-checks": { }, -/// "reservation-mode": , /// "reservations": [ ], /// , /// "server-tag": , @@ -105,7 +104,6 @@ namespace yang { /// +--rw authoritative? boolean /// +--rw user-context? user-context /// +--rw sanity-checks -/// +--rw reservation-mode? host-reservation-mode /// +--rw host* [identifier-type identifier] /// +--rw config-control /// +--rw server-tag? string @@ -122,6 +120,7 @@ namespace yang { /// +--rw ddns-send-updates? boolean /// +--rw ddns-update-on-renew? boolean /// +--rw ddns-use-conflict-resolution? boolean +/// +--rw ddns-conflict-resolution-mode? conflict-resolution-mode /// +--rw ip-reservations-unique? boolean /// +--rw early-global-reservations-lookup? boolean /// +--rw reservations-lookup-first? boolean @@ -227,7 +226,6 @@ namespace yang { /// , /// /// "sanity-checks": { }, -/// "reservation-mode": , /// "reservations": [ ], /// , /// "server-tag": , @@ -272,7 +270,6 @@ namespace yang { /// +--rw dhcp-ddns /// +--rw user-context? user-context /// +--rw sanity-checks -/// +--rw reservation-mode? host-reservation-mode /// +--rw host* [identifier-type identifier] /// +--rw config-control /// +--rw server-tag? string @@ -289,6 +286,7 @@ namespace yang { /// +--rw ddns-send-updates? boolean /// +--rw ddns-update-on-renew? boolean /// +--rw ddns-use-conflict-resolution? boolean +/// +--rw ddns-conflict-resolution-mode? conflict-resolution-mode /// +--rw ip-reservations-unique? boolean /// +--rw early-global-reservations-lookup? boolean /// +--rw reservations-lookup-first? boolean diff --git a/src/lib/yang/translator_database.cc b/src/lib/yang/translator_database.cc index e92f2ff60f..e0806a6a10 100644 --- a/src/lib/yang/translator_database.cc +++ b/src/lib/yang/translator_database.cc @@ -63,6 +63,7 @@ TranslatorDatabase::getDatabaseKea(DataNode const& data_node) { checkAndGetLeaf(result, data_node, "max-row-errors"); checkAndGetLeaf(result, data_node, "name"); checkAndGetLeaf(result, data_node, "on-fail"); + checkAndGetLeaf(result, data_node, "retry-on-startup"); checkAndGetLeaf(result, data_node, "password"); checkAndGetLeaf(result, data_node, "persist"); checkAndGetLeaf(result, data_node, "port"); @@ -117,6 +118,7 @@ TranslatorDatabase::setDatabaseKea(string const& xpath, checkAndSetLeaf(elem, xpath, "max-row-errors", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "name", LeafBaseType::String); checkAndSetLeaf(elem, xpath, "on-fail", LeafBaseType::String); + checkAndSetLeaf(elem, xpath, "retry-on-startup", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "password", LeafBaseType::String); checkAndSetLeaf(elem, xpath, "persist", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "port", LeafBaseType::Uint16); diff --git a/src/lib/yang/translator_database.h b/src/lib/yang/translator_database.h index 7480fa7530..ec220bc6b4 100644 --- a/src/lib/yang/translator_database.h +++ b/src/lib/yang/translator_database.h @@ -60,6 +60,7 @@ namespace yang { /// +--rw reconnect-wait-time? uint32 /// +--rw max-row-errors? uint32 /// +--rw on-fail? string +/// +--rw retry-on-startup? boolean /// +--rw user-context? user-context /// @endcode /// diff --git a/src/lib/yang/translator_shared_network.cc b/src/lib/yang/translator_shared_network.cc index 49b9070c68..e4dfa09a1d 100644 --- a/src/lib/yang/translator_shared_network.cc +++ b/src/lib/yang/translator_shared_network.cc @@ -81,6 +81,7 @@ TranslatorSharedNetwork::getSharedNetworkKea(DataNode const& data_node, checkAndGetLeaf(result, data_node, "ddns-ttl-percent"); checkAndGetLeaf(result, data_node, "ddns-update-on-renew"); checkAndGetLeaf(result, data_node, "ddns-use-conflict-resolution"); + checkAndGetLeaf(result, data_node, "ddns-conflict-resolution-mode"); checkAndGetLeaf(result, data_node, "hostname-char-replacement"); checkAndGetLeaf(result, data_node, "hostname-char-set"); checkAndGetLeaf(result, data_node, "interface"); @@ -89,7 +90,6 @@ TranslatorSharedNetwork::getSharedNetworkKea(DataNode const& data_node, checkAndGetLeaf(result, data_node, "rebind-timer"); checkAndGetLeaf(result, data_node, "renew-timer"); checkAndGetLeaf(result, data_node, "require-client-classes"); - checkAndGetLeaf(result, data_node, "reservation-mode"); checkAndGetLeaf(result, data_node, "reservations-global"); checkAndGetLeaf(result, data_node, "reservations-in-subnet"); checkAndGetLeaf(result, data_node, "reservations-out-of-pool"); @@ -180,6 +180,7 @@ TranslatorSharedNetwork::setSharedNetworkKea(string const& xpath, checkAndSetLeaf(elem, xpath, "ddns-ttl-percent", LeafBaseType::Dec64); checkAndSetLeaf(elem, xpath, "ddns-update-on-renew", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "ddns-use-conflict-resolution", LeafBaseType::Bool); + checkAndSetLeaf(elem, xpath, "ddns-conflict-resolution-mode", LeafBaseType::Enum); checkAndSetLeaf(elem, xpath, "hostname-char-replacement", LeafBaseType::String); checkAndSetLeaf(elem, xpath, "hostname-char-set", LeafBaseType::String); checkAndSetLeaf(elem, xpath, "interface", LeafBaseType::String); @@ -187,7 +188,6 @@ TranslatorSharedNetwork::setSharedNetworkKea(string const& xpath, checkAndSetLeaf(elem, xpath, "min-valid-lifetime", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "rebind-timer", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "renew-timer", LeafBaseType::Uint32); - checkAndSetLeaf(elem, xpath, "reservation-mode", LeafBaseType::Enum); checkAndSetLeaf(elem, xpath, "reservations-global", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "reservations-in-subnet", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "reservations-out-of-pool", LeafBaseType::Bool); @@ -202,11 +202,8 @@ TranslatorSharedNetwork::setSharedNetworkKea(string const& xpath, ConstElementPtr relay = elem->get("relay"); if (relay) { - ConstElementPtr address = relay->get("ip-address"); ConstElementPtr addresses = relay->get("ip-addresses"); - if (address) { - setItem(xpath + "/relay/ip-addresses", address, LeafBaseType::String); - } else if (addresses && !addresses->empty()) { + if (addresses && !addresses->empty()) { for (ElementPtr const& addr : addresses->listValue()) { setItem(xpath + "/relay/ip-addresses", addr, LeafBaseType::String); } diff --git a/src/lib/yang/translator_shared_network.h b/src/lib/yang/translator_shared_network.h index 04f8335943..b592106691 100644 --- a/src/lib/yang/translator_shared_network.h +++ b/src/lib/yang/translator_shared_network.h @@ -32,7 +32,6 @@ namespace yang { /// "interface": "", /// "client-class": "", /// "require-client-classes": [ ], -/// "reservation-mode": , /// "relay": , /// "match-client-id": , /// "next-server": "", @@ -66,7 +65,6 @@ namespace yang { /// "rapid-commit": , /// "client-class": "", /// "require-client-classes": [ ], -/// "reservation-mode": , /// "relay": , /// "user-context": { }, /// "comment": "" @@ -81,7 +79,6 @@ namespace yang { /// +--rw renew-timer? uint32 /// +--rw rebind-timer? uint32 /// +--rw option-data* [code space] -/// +--rw reservation-mode? host-reservation-mode /// +--rw client-class? string /// +--rw require-client-classes* string /// +--rw valid-lifetime? uint32 @@ -100,6 +97,7 @@ namespace yang { /// +--rw ddns-send-updates? boolean /// +--rw ddns-update-on-renew? boolean /// +--rw ddns-use-conflict-resolution? boolean +/// +--rw ddns-conflict-resolution-mode? conflict-resolution-mode /// +--rw store-extended-info? boolean /// +--rw hostname-char-replacement? string /// +--rw hostname-char-set? string diff --git a/src/lib/yang/translator_subnet.cc b/src/lib/yang/translator_subnet.cc index c0a5224d42..18eb6a9310 100644 --- a/src/lib/yang/translator_subnet.cc +++ b/src/lib/yang/translator_subnet.cc @@ -114,6 +114,7 @@ TranslatorSubnet::getSubnetKea(DataNode const& data_node) { checkAndGetLeaf(result, data_node, "ddns-ttl-percent"); checkAndGetLeaf(result, data_node, "ddns-update-on-renew"); checkAndGetLeaf(result, data_node, "ddns-use-conflict-resolution"); + checkAndGetLeaf(result, data_node, "ddns-conflict-resolution-mode"); checkAndGetLeaf(result, data_node, "hostname-char-replacement"); checkAndGetLeaf(result, data_node, "hostname-char-set"); checkAndGetLeaf(result, data_node, "interface"); @@ -122,7 +123,6 @@ TranslatorSubnet::getSubnetKea(DataNode const& data_node) { checkAndGetLeaf(result, data_node, "rebind-timer"); checkAndGetLeaf(result, data_node, "renew-timer"); checkAndGetLeaf(result, data_node, "require-client-classes"); - checkAndGetLeaf(result, data_node, "reservation-mode"); checkAndGetLeaf(result, data_node, "reservations-global"); checkAndGetLeaf(result, data_node, "reservations-in-subnet"); checkAndGetLeaf(result, data_node, "reservations-out-of-pool"); @@ -266,6 +266,7 @@ TranslatorSubnet::setSubnetKea(string const& xpath, ConstElementPtr elem) { checkAndSetLeaf(elem, xpath, "ddns-ttl-percent", LeafBaseType::Dec64); checkAndSetLeaf(elem, xpath, "ddns-update-on-renew", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "ddns-use-conflict-resolution", LeafBaseType::Bool); + checkAndSetLeaf(elem, xpath, "ddns-conflict-resolution-mode", LeafBaseType::Enum); checkAndSetLeaf(elem, xpath, "hostname-char-replacement", LeafBaseType::String); checkAndSetLeaf(elem, xpath, "hostname-char-set", LeafBaseType::String); checkAndSetLeaf(elem, xpath, "interface", LeafBaseType::String); @@ -273,7 +274,6 @@ TranslatorSubnet::setSubnetKea(string const& xpath, ConstElementPtr elem) { checkAndSetLeaf(elem, xpath, "min-valid-lifetime", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "rebind-timer", LeafBaseType::Uint32); checkAndSetLeaf(elem, xpath, "renew-timer", LeafBaseType::Uint32); - checkAndSetLeaf(elem, xpath, "reservation-mode", LeafBaseType::Enum); checkAndSetLeaf(elem, xpath, "reservations-global", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "reservations-in-subnet", LeafBaseType::Bool); checkAndSetLeaf(elem, xpath, "reservations-out-of-pool", LeafBaseType::Bool); @@ -294,11 +294,8 @@ TranslatorSubnet::setSubnetKea(string const& xpath, ConstElementPtr elem) { } ConstElementPtr relay = elem->get("relay"); if (relay) { - ConstElementPtr address = relay->get("ip-address"); ConstElementPtr addresses = relay->get("ip-addresses"); - if (address) { - setItem(xpath + "/relay/ip-addresses", address, LeafBaseType::String); - } else if (addresses && !addresses->empty()) { + if (addresses && !addresses->empty()) { for (ElementPtr const& addr : addresses->listValue()) { setItem(xpath + "/relay/ip-addresses", addr, LeafBaseType::String); } diff --git a/src/lib/yang/translator_subnet.h b/src/lib/yang/translator_subnet.h index b5e48d705d..10655d9b93 100644 --- a/src/lib/yang/translator_subnet.h +++ b/src/lib/yang/translator_subnet.h @@ -36,7 +36,6 @@ namespace yang { /// "client-class": "", /// "require-client-classes": [ ], /// "reservations": [ ], -/// "reservation-mode": , /// "relay": , /// "match-client-id": , /// "next-server": "", @@ -76,7 +75,6 @@ namespace yang { /// "client-class": "", /// "require-client-classes": [ ], /// "reservations": [ ], -/// "reservation-mode": , /// "relay": , /// "user-context": { }, /// "comment": "" @@ -114,7 +112,6 @@ namespace yang { /// +--rw client-class? string /// +--rw require-client-classes* string /// +--rw host* [identifier-type identifier] -/// +--rw reservation-mode? host-reservation-mode /// +--rw relay /// +--rw cache-max-age? uint32 /// +--rw cache-threshold? decimal64 @@ -126,6 +123,7 @@ namespace yang { /// +--rw ddns-send-updates? boolean /// +--rw ddns-update-on-renew? boolean /// +--rw ddns-use-conflict-resolution? boolean +/// +--rw ddns-conflict-resolution-mode? conflict-resolution-mode /// +--rw hostname-char-replacement? string /// +--rw hostname-char-set? string /// +--rw reservations-global? boolean diff --git a/src/lib/yang/yang_revisions.h b/src/lib/yang/yang_revisions.h index 6d6ee742b1..1c422e7f60 100644 --- a/src/lib/yang/yang_revisions.h +++ b/src/lib/yang/yang_revisions.h @@ -22,9 +22,9 @@ static const std::unordered_map YANG_REVISIONS = { { "ietf-dhcpv6-options", "2018-09-04" }, { "ietf-dhcpv6-server", "2018-09-04" }, { "kea-types", "2019-08-12" }, - { "kea-dhcp-types", "2023-06-28" }, - { "kea-dhcp4-server", "2024-01-31" }, - { "kea-dhcp6-server", "2024-01-31" }, + { "kea-dhcp-types", "2024-05-29" }, + { "kea-dhcp4-server", "2024-05-29" }, + { "kea-dhcp6-server", "2024-05-29" }, { "kea-ctrl-agent", "2019-08-12" }, { "kea-dhcp-ddns", "2022-07-27" } }; // YANG_REVISIONS diff --git a/src/share/yang/modules/Makefile.am b/src/share/yang/modules/Makefile.am index a3b6fa546d..bf91e94f2b 100644 --- a/src/share/yang/modules/Makefile.am +++ b/src/share/yang/modules/Makefile.am @@ -13,9 +13,9 @@ yangmodules_list += ietf-inet-types@2013-07-15.yang yangmodules_list += ietf-yang-types@2013-07-15.yang yangmodules_list += kea-ctrl-agent@2019-08-12.yang yangmodules_list += kea-dhcp-ddns@2022-07-27.yang -yangmodules_list += kea-dhcp-types@2023-06-28.yang -yangmodules_list += kea-dhcp4-server@2024-01-31.yang -yangmodules_list += kea-dhcp6-server@2024-01-31.yang +yangmodules_list += kea-dhcp-types@2024-05-29.yang +yangmodules_list += kea-dhcp4-server@2024-05-29.yang +yangmodules_list += kea-dhcp6-server@2024-05-29.yang yangmodules_list += kea-types@2019-08-12.yang yangmodules_list += keatest-module@2022-11-30.yang diff --git a/src/share/yang/modules/hashes/kea-dhcp-types@2023-06-28.hash b/src/share/yang/modules/hashes/kea-dhcp-types@2023-06-28.hash deleted file mode 100644 index 7979124d48..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp-types@2023-06-28.hash +++ /dev/null @@ -1 +0,0 @@ -1d8a9d22cdd4751a0b67d1018ca2d6495d68a2dd3beaad3d791999784e53ec1a diff --git a/src/share/yang/modules/hashes/kea-dhcp-types@2024-05-29.hash b/src/share/yang/modules/hashes/kea-dhcp-types@2024-05-29.hash new file mode 100644 index 0000000000..99b1725005 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp-types@2024-05-29.hash @@ -0,0 +1 @@ +ed30e29cccb5c67db520704003a88e9a574e46f3579d3a20e651deefcbec33c7 diff --git a/src/share/yang/modules/hashes/kea-dhcp4-server@2024-01-31.hash b/src/share/yang/modules/hashes/kea-dhcp4-server@2024-01-31.hash deleted file mode 100644 index eff71c98c4..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp4-server@2024-01-31.hash +++ /dev/null @@ -1 +0,0 @@ -a1b6cad9bbf1174cf985163df390b89fa20c9f9dd52732c194dfcc9d8ab82d8d diff --git a/src/share/yang/modules/hashes/kea-dhcp4-server@2024-05-29.hash b/src/share/yang/modules/hashes/kea-dhcp4-server@2024-05-29.hash new file mode 100644 index 0000000000..1c59d21981 --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp4-server@2024-05-29.hash @@ -0,0 +1 @@ +2340982f95cf932980e9de6b32aebf52ee8852302dcce1aaf6647db03f0f0809 diff --git a/src/share/yang/modules/hashes/kea-dhcp6-server@2024-01-31.hash b/src/share/yang/modules/hashes/kea-dhcp6-server@2024-01-31.hash deleted file mode 100644 index 0838c3ef5d..0000000000 --- a/src/share/yang/modules/hashes/kea-dhcp6-server@2024-01-31.hash +++ /dev/null @@ -1 +0,0 @@ -5e06c05278ba1591d5860c3069900fb4e3ce21117742453257afad6c34a2f703 diff --git a/src/share/yang/modules/hashes/kea-dhcp6-server@2024-05-29.hash b/src/share/yang/modules/hashes/kea-dhcp6-server@2024-05-29.hash new file mode 100644 index 0000000000..83c605f12c --- /dev/null +++ b/src/share/yang/modules/hashes/kea-dhcp6-server@2024-05-29.hash @@ -0,0 +1 @@ +953e6ab578308b714a9dbc20e5e2b3bb2b97c21194ec38911402cccb85836833 diff --git a/src/share/yang/modules/kea-dhcp-types@2023-06-28.yang b/src/share/yang/modules/kea-dhcp-types@2024-05-29.yang similarity index 94% rename from src/share/yang/modules/kea-dhcp-types@2023-06-28.yang rename to src/share/yang/modules/kea-dhcp-types@2024-05-29.yang index fb77060419..24a4a7e074 100644 --- a/src/share/yang/modules/kea-dhcp-types@2023-06-28.yang +++ b/src/share/yang/modules/kea-dhcp-types@2024-05-29.yang @@ -16,6 +16,14 @@ module kea-dhcp-types { description "This file defines some commonly used Kea DHCP types and groupings."; + revision 2024-05-29 { + description "Removed qualifying-suffix, override-no-update, + override-client-update, replace-client-name, generated-prefix, + hostname-char-set and hostname-char-replacement from dhcp-ddns, + removed reservation-mode and added retry-on-startup and + ddns-conflict-resolution-mode."; + } + revision 2023-06-28 { description "Added pool ID."; } @@ -73,22 +81,25 @@ module kea-dhcp-types { /* * Typedef */ - typedef host-reservation-mode { + typedef conflict-resolution-mode { type enumeration { - enum "disabled" { - description "Host reservation support is disabled."; + enum "check-with-dhcid" { + description "Existing DNS entries may be overwritten by matching client if + they have a DHCID record and it matches the client's DHCID."; } - enum "out-of-pool" { - description "Allows only out of pool host reservations."; + enum "no-check-with-dhcid" { + description "Existing DNS entries may be overwritten by any client, whether + or not those entries include a DHCID record."; } - enum "all" { - description "Allows both in pool and out of pool host reservations."; + enum "check-exists-with-dhcid" { + description "Existing DNS entries may be overwritten only if they have a + DHCID record."; } - enum "global" { - description "Allows only global host reservations."; + enum "no-check-without-dhcid" { + description "Existing DNS entries may be overwritten by any client."; } } - description "Host reservation mode."; + description "Conflict Resolution mode."; } typedef lease-state { @@ -320,8 +331,11 @@ module kea-dhcp-types { } leaf on-fail { type string; - description - "action to take when connection recovery fails"; + description "action to take when connection recovery fails"; + } + leaf retry-on-startup { + type boolean; + description "try connection recovery on startup."; } uses kea:user-context { refine user-context { @@ -406,10 +420,6 @@ module kea-dhcp-types { type boolean; description "Enable DHCP-DDNS updates."; } - leaf qualifying-suffix { - type string; - description "DHCP-DDNS qualifying suffix."; - } leaf server-ip { type inet:ip-address; description "DHCP-DDNS server IP address."; @@ -450,37 +460,6 @@ module kea-dhcp-types { } description "Packet format to use for DHCP-DDNS."; } - leaf override-no-update { - type boolean; - description "Ignore client request and send update."; - } - leaf override-client-update { - type boolean; - description "Ignore client delegation."; - } - leaf replace-client-name { - type enumeration { - enum "when-present" { - description "When the client sent a name."; - } - enum "never" { - description "Never replace or generate a name."; - } - enum "always" { - description "Always replace or generate a name."; - } - enum "when-not-present" { - description "When the client did not send a name."; - } - } - description "Replace the name provided by the client."; - } - leaf generated-prefix { - type string; - description "DHCP-DDNS generated prefix."; - } - uses hostname-char-set; - uses hostname-char-replacement; uses kea:user-context { refine user-context { description "DHCP-DDNS user context. Arbitrary JSON data can @@ -710,14 +689,6 @@ module kea-dhcp-types { } } - grouping reservation-mode { - description "Reservation mode grouping."; - leaf reservation-mode { - type host-reservation-mode; - description "Reservation mode entry."; - } - } - grouping interfaces-re-detect { description "Interfaces re-detect grouping."; leaf re-detect { @@ -1132,6 +1103,14 @@ module kea-dhcp-types { } } + grouping ddns-conflict-resolution-mode { + description "Conflict resolution mode grouping."; + leaf ddns-conflict-resolution-mode { + type conflict-resolution-mode; + description "Conflict resolution mode entry."; + } + } + grouping ip-reservations-unique { leaf ip-reservations-unique { type boolean; diff --git a/src/share/yang/modules/kea-dhcp4-server@2024-01-31.yang b/src/share/yang/modules/kea-dhcp4-server@2024-05-29.yang similarity index 97% rename from src/share/yang/modules/kea-dhcp4-server@2024-01-31.yang rename to src/share/yang/modules/kea-dhcp4-server@2024-05-29.yang index 0fad8d4759..3d65b9f115 100644 --- a/src/share/yang/modules/kea-dhcp4-server@2024-01-31.yang +++ b/src/share/yang/modules/kea-dhcp4-server@2024-05-29.yang @@ -12,7 +12,7 @@ module kea-dhcp4-server { } import kea-dhcp-types { prefix dhcp; - revision-date 2023-06-28; + revision-date 2024-05-29; } organization "Internet Systems Consortium"; @@ -20,6 +20,10 @@ module kea-dhcp4-server { description "This model defines a YANG data model that can be used to configure and manage a Kea DHCPv4 server."; + revision 2024-05-29 { + description "Removed reservation-mode and added stash-agent-options."; + } + revision 2024-01-31 { description "Added data to the set of keys for option-data to facilitate configuring options with same code and space, but different @@ -244,7 +248,6 @@ module kea-dhcp4-server { description "Subnet host reservations list."; } } - uses dhcp:reservation-mode; container relay { description "Optional information about relay agent."; uses relay; @@ -277,6 +280,7 @@ module kea-dhcp4-server { uses dhcp:ddns-ttl-percent; uses dhcp:ddns-update-on-renew; uses dhcp:ddns-use-conflict-resolution; + uses dhcp:ddns-conflict-resolution-mode; uses dhcp:hostname-char-replacement; uses dhcp:hostname-char-set; uses dhcp:reservations-global; @@ -397,7 +401,6 @@ module kea-dhcp4-server { uses relay; } uses authoritative; - uses dhcp:reservation-mode; uses dhcp:network-client-class; uses dhcp:network-require-client-classes; uses dhcp:valid-lifetime; @@ -417,6 +420,7 @@ module kea-dhcp4-server { uses dhcp:ddns-ttl-percent; uses dhcp:ddns-update-on-renew; uses dhcp:ddns-use-conflict-resolution; + uses dhcp:ddns-conflict-resolution-mode; uses dhcp:hostname-char-replacement; uses dhcp:hostname-char-set; uses dhcp:reservations-global; @@ -500,7 +504,6 @@ module kea-dhcp4-server { } } uses dhcp:sanity-checks; - uses dhcp:reservation-mode; uses reservations { refine host { description "Global host reservations list."; @@ -525,6 +528,7 @@ module kea-dhcp4-server { uses dhcp:ddns-ttl-percent; uses dhcp:ddns-update-on-renew; uses dhcp:ddns-use-conflict-resolution; + uses dhcp:ddns-conflict-resolution-mode; uses dhcp:ip-reservations-unique; uses dhcp:early-global-reservations-lookup; uses dhcp:reservations-lookup-first; @@ -536,6 +540,12 @@ module kea-dhcp4-server { uses dhcp:statistic-default-sample-age; uses dhcp:statistic-default-sample-count; uses dhcp:store-extended-info; + + leaf stash-agent-options { + type boolean; + description "Stash agent options (aka RAI) to make direct queries to come + through a relay."; + } } /* diff --git a/src/share/yang/modules/kea-dhcp6-server@2024-01-31.yang b/src/share/yang/modules/kea-dhcp6-server@2024-05-29.yang similarity index 98% rename from src/share/yang/modules/kea-dhcp6-server@2024-01-31.yang rename to src/share/yang/modules/kea-dhcp6-server@2024-05-29.yang index a80f919473..20b79643ad 100644 --- a/src/share/yang/modules/kea-dhcp6-server@2024-01-31.yang +++ b/src/share/yang/modules/kea-dhcp6-server@2024-05-29.yang @@ -12,7 +12,7 @@ module kea-dhcp6-server { } import kea-dhcp-types { prefix dhcp; - revision-date 2023-06-28; + revision-date 2024-05-29; } organization "Internet Systems Consortium"; @@ -20,6 +20,10 @@ module kea-dhcp6-server { description "This model defines a YANG data model that can be used to configure and manage a Kea DHCPv6 server."; + revision 2024-05-29 { + description "Removed reservation-mode."; + } + revision 2024-01-31 { description "Added data to the set of keys for option-data to facilitate configuring options with same code and space, but different @@ -297,7 +301,6 @@ module kea-dhcp6-server { description "Subnet host reservations list."; } } - uses dhcp:reservation-mode; container relay { description "Optional information about relay agent."; uses relay; @@ -313,6 +316,7 @@ module kea-dhcp6-server { uses dhcp:ddns-ttl-percent; uses dhcp:ddns-update-on-renew; uses dhcp:ddns-use-conflict-resolution; + uses dhcp:ddns-conflict-resolution-mode; uses dhcp:hostname-char-replacement; uses dhcp:hostname-char-set; uses dhcp:reservations-global; @@ -435,7 +439,6 @@ module kea-dhcp6-server { description "Optional information about relay agent."; uses relay; } - uses dhcp:reservation-mode; uses dhcp:network-client-class; uses dhcp:require-client-classes; uses preferred-lifetime; @@ -463,6 +466,7 @@ module kea-dhcp6-server { uses dhcp:ddns-ttl-percent; uses dhcp:ddns-update-on-renew; uses dhcp:ddns-use-conflict-resolution; + uses dhcp:ddns-conflict-resolution-mode; uses dhcp:hostname-char-replacement; uses dhcp:hostname-char-set; uses dhcp:reservations-global; @@ -564,7 +568,6 @@ module kea-dhcp6-server { } } uses dhcp:sanity-checks; - uses dhcp:reservation-mode; uses reservations { refine host { description "Global host reservations list."; @@ -588,6 +591,7 @@ module kea-dhcp6-server { uses dhcp:ddns-ttl-percent; uses dhcp:ddns-update-on-renew; uses dhcp:ddns-use-conflict-resolution; + uses dhcp:ddns-conflict-resolution-mode; uses dhcp:ip-reservations-unique; uses dhcp:early-global-reservations-lookup; uses dhcp:reservations-lookup-first;