]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[#2832] add missing YANG nodes
authorAndrei Pavel <andrei@isc.org>
Wed, 10 May 2023 15:49:45 +0000 (18:49 +0300)
committerAndrei Pavel <andrei@isc.org>
Tue, 16 May 2023 12:38:17 +0000 (15:38 +0300)
- allocator
- ddns-ttl-percent
- exclude-first-last-24,
- ignore-dhcp-server-Identifier
- offer-lifetime
- pd-allocator
- read-timeout
- tcp-user-timeout
- write-timeout

Removed obsolete YANG nodes: contact-points, keyspace.

21 files changed:
doc/examples/kea4/all-keys-netconf.json
doc/examples/kea4/all-keys.json
doc/examples/kea6/all-keys-netconf.json
doc/examples/kea6/all-keys.json
src/lib/yang/translator_class.cc
src/lib/yang/translator_config.cc
src/lib/yang/translator_database.cc
src/lib/yang/translator_shared_network.cc
src/lib/yang/translator_subnet.cc
src/lib/yang/yang_revisions.h
src/share/yang/modules/Makefile.am
src/share/yang/modules/hashes/kea-dhcp-types@2022-12-27.hash [deleted file]
src/share/yang/modules/hashes/kea-dhcp-types@2023-05-31.hash [new file with mode: 0644]
src/share/yang/modules/hashes/kea-dhcp4-server@2022-12-27.hash [deleted file]
src/share/yang/modules/hashes/kea-dhcp4-server@2023-05-31.hash [new file with mode: 0644]
src/share/yang/modules/hashes/kea-dhcp6-server@2022-12-27.hash [deleted file]
src/share/yang/modules/hashes/kea-dhcp6-server@2023-05-31.hash [new file with mode: 0644]
src/share/yang/modules/kea-dhcp-types@2023-05-31.yang [moved from src/share/yang/modules/kea-dhcp-types@2022-12-27.yang with 92% similarity]
src/share/yang/modules/kea-dhcp4-server@2023-05-31.yang [moved from src/share/yang/modules/kea-dhcp4-server@2022-12-27.yang with 96% similarity]
src/share/yang/modules/kea-dhcp6-server@2023-05-31.yang [moved from src/share/yang/modules/kea-dhcp6-server@2022-12-27.yang with 97% similarity]
src/share/yang/modules/utils/bump-up-revisions.sh [new file with mode: 0755]

index 29484cec26e1e25c804a8d9acce666a309ada01f..442222ab9f8119a041200ae507e0ead770a3ff08 100644 (file)
@@ -11,6 +11,9 @@
 {
     // Kea DHCPv4 server configuration begins here.
     "Dhcp4": {
+        // Global flag selecting an IP address allocation strategy for all
+        // subnets. Use "random" for a random allocation strategy.
+        "allocator": "iterative",
 
         // Global authoritative flag to handle requests by clients for
         // unknown IP addresses (ignore if disabled, NAK if enabled).
                 "min-valid-lifetime": 4000,
 
                 // Class max valid lifetime.
-                "max-valid-lifetime": 8000
+                "max-valid-lifetime": 8000,
+
+                // If greater than zero, it is the lifetime of leases temporarily allocated
+                // on DISCOVER. When zero (the default), leases are not allocated on DISCOVER.
+                "offer-lifetime" : 65
             },
             {
                 // Default value of the class-specific bootfile name. An empty name
         // Parameters for triggering behaviors compatible with broken or
         // non-compliant clients, relays, or other agents
         "compatibility": {
+            // Ignore DHCP Server Identifier option if set to true.
+            // Enabling this will cause Kea to accept any query, even
+            // if the address in the option belongs to another server,
+            // instead of dropping it. This config option defaults to
+            // false, as enabling it breaks RFC compliance.
+            "ignore-dhcp-server-identifier": false,
+
             // Ignore Relay Agent Information Link Selection suboption if set
             // to true. Enabling this will cause Kea to use normal subnet
             // selection logic instead of attempting to use the subnet
 
             // Parse options more leniently where fields can be deduced
             // deterministically, even if against RFC or common practice.
-            "lenient-option-parsing": true
+            "lenient-option-parsing": true,
+
+            // Boolean flag indicating whether .0 and .255 addresses
+            // must be considered as never free in subnets with a prefix length
+            // of 24 or less. The default is false, as these addresses are not
+            // special; only the first and the last addresses are.
+            "exclude-first-last-24": false
         },
 
         // Command control socket configuration parameters for the Kea DHCPv4 server.
         // It may be specified at the global, shared-network, and subnet levels.
         "ddns-use-conflict-resolution": true,
 
+        // When greater than 0.0, it is the percent of the lease's lifetime
+        // to use for the DNS TTL.
+        "ddns-ttl-percent": 0.75,
+
         // Time in seconds specifying how long a declined lease should be
         // excluded from DHCP assignments. The default value is 86400 (24 hours).
         "decline-probation-period": 86400,
                 "key-file": "my-key",
 
                 // Cipher list (see the OpenSSL ciphers command manual).
-                "cipher-list": "AES"
+                "cipher-list": "AES",
+
+                // Connection reconnect wait time.
+                // This parameter governs how long Kea waits before attempting
+                // to reconnect. Expressed in milliseconds. The default is 0
+                // (disabled) for MySQL and PostgreSQL.
+                "reconnect-wait-time": 3000,
+
+                // Connection maximum reconnect tries.
+                "max-reconnect-tries": 3,
+
+                // Action to take when connection recovery fails.
+                // Supported values: stop-retry-exit, serve-retry-exit,
+                // serve-retry-continue
+                "on-fail": "stop-retry-exit",
+
+                // Connection connect timeout in seconds.
+                "connect-timeout": 100,
+
+                // Timeout of database read operations in seconds.
+                "read-timeout": 120,
+
+                // Timeout of database write operations in seconds.
+                "write-timeout": 180
             },
             {
                 // Name of the database to connect to.
                 // Username to be used to access the database.
                 "user": "keatest",
 
-                // Connection reconnect wait time.
-                // This parameter governs how long Kea waits before attempting
-                // to reconnect. Expressed in milliseconds. The default is 0
-                // (disabled) for MySQL and PostgreSQL.
-                "reconnect-wait-time": 3000,
-
-                // Connection maximum reconnect tries.
-                "max-reconnect-tries": 3,
-
-                // Action to take when connection recovery fails.
-                // Supported values: stop-retry-exit, serve-retry-exit,
-                // serve-retry-continue
-                "on-fail": "stop-retry-exit",
-
-                // Connection connect timeout in seconds.
-                "connect-timeout": 100
+                // TCP user timeout while communicating with the database.
+                // It is specified in seconds.
+                "tcp-user-timeout": 100
             }
         ],
 
         // networks group subnets together.
         "shared-networks": [
             {
+                // A flag selecting an IP address allocation strategy for all
+                // subnets in this shared network.
+                "allocator": "random",
+
                 // Shared-network level authoritative flag.
                 "authoritative": false,
 
                 // Shared-network level value. See description at the global level.
                 "ddns-use-conflict-resolution": true,
 
+                // Shared-network level value. See description at the global level.
+                "ddns-ttl-percent": 0.65,
+
                 // Shared-network level value. See description at the global level.
                 "hostname-char-replacement": "x",
 
                 // to be sent in 'siaddr'.
                 "next-server": "192.0.2.123",
 
+                // If greater than zero, it is the lifetime of leases temporarily allocated
+                // on DISCOVER. When zero (the default), leases are not allocated on DISCOVER.
+                "offer-lifetime" : 60,
+
                 // List of shared network-specific DHCP options.
                 "option-data": [],
 
                         // Prefix matched against source address. See RFC7341.
                         "4o6-subnet": "2001:db8:1:1::/64",
 
+                        // A flag selecting an IP address allocation strategy for
+                        // the subnet.
+                        "allocator": "iterative",
+
                         // Subnet-level authoritative flag.
                         "authoritative": false,
 
                         // Subnet-level value. See description at the global level.
                         "ddns-use-conflict-resolution": true,
 
+                        // Subnet-level value. See description at the global level.
+                        "ddns-ttl-percent": 0.55,
+
                         // Subnet-level value. See description at the global level.
                         "hostname-char-replacement": "x",
 
                         // in 'siaddr'.
                         "next-server": "0.0.0.0",
 
+                        // If greater than zero, it is the lifetime of leases temporarily allocated
+                        // on DISCOVER. When zero (the default), leases are not allocated on DISCOVER.
+                        "offer-lifetime" : 60,
+
                         // Turn on storage of extended information (e.g. relay agent
                         // information) with each lease for this subnet.
                         "store-extended-info": true,
                         // Subnet-level value of the rebind timer.
                         "rebind-timer": 40,
 
-                        // List of IPv4 relay addresses for which this subnet is
-                        // selected.
+                        // List of IPv4 relay addresses for which this subnet is selected.
                         "relay": {
                             "ip-addresses": [
                                 "192.168.56.1"
                 // Shared-network level (default) valid lifetime.
                 "valid-lifetime": 6001,
 
-                // Subnet-level min valid lifetime.
+                // Shared-network level min valid lifetime.
                 "min-valid-lifetime": 4001,
 
-                // Subnet-level max valid lifetime.
+                // Shared-network level max valid lifetime.
                 "max-valid-lifetime": 8001
             }
         ],
             }
         ],
 
+        // If greater than zero, it is the lifetime of leases temporarily allocated
+        // on DISCOVER. When zero (the default), leases are not allocated on DISCOVER.
+        "offer-lifetime" : 60,
+
         // Look at advanced examples for the use of user-contexts.
         "user-context": { }
     }
index 673856e45d321ae49bf79108d88da22d6be08d6b..6016eb46e0f42183a5931414e5a989944cb73f72 100644 (file)
 
             // Boolean flag indicating whether .0 and .255 addresses
             // must be considered as never free in subnets with a prefix length
-            // less than 24. The default is false, as these addresses are not
+            // of 24 or less. The default is false, as these addresses are not
             // special; only the first and the last addresses are.
             "exclude-first-last-24": false
         },
                 "key-file": "my-key",
 
                 // Cipher list (see the OpenSSL ciphers command manual).
-                "cipher-list": "AES"
-            },
-            {
-                // Name of the database to connect to.
-                "name": "keatest",
-
-                // Host on which the database resides.
-                "host": "localhost",
-
-                // Database password.
-                "password": "keatest",
-
-                // Port on which the database is available.
-                "port": 5432,
-
-                // Type of database, e.g. "mysql", "postgresql".
-                "type": "postgresql",
-
-                // Username to be used to access the database.
-                "user": "keatest",
-
-                // TCP user timeout while communicating with the database.
-                // It is specified in seconds.
-                "tcp-user-timeout": 100
-            },
-            {
-                // Name of the database to connect to.
-                "name": "keatest",
-
-                // Database password.
-                "password": "keatest",
-
-                // Port on which the database is available.
-                "port": 9042,
-
-                // Type of database, e.g. "mysql", "postgresql".
-                "type": "mysql",
-
-                // Username to be used to access the database.
-                "user": "keatest",
+                "cipher-list": "AES",
 
                 // Connection reconnect wait time.
                 // This parameter governs how long Kea waits before attempting
 
                 // Timeout of database write operations in seconds.
                 "write-timeout": 180
+            },
+            {
+                // Name of the database to connect to.
+                "name": "keatest",
+
+                // Host on which the database resides.
+                "host": "localhost",
+
+                // Database password.
+                "password": "keatest",
+
+                // Port on which the database is available.
+                "port": 5432,
+
+                // Type of database, e.g. "mysql", "postgresql".
+                "type": "postgresql",
+
+                // Username to be used to access the database.
+                "user": "keatest",
+
+                // TCP user timeout while communicating with the database.
+                // It is specified in seconds.
+                "tcp-user-timeout": 100
             }
         ],
 
index 8afab6440910da9ba878e990464eb6b3ae72b357..04004697e8e04151e2c95fe37aab387b403c4346 100644 (file)
 {
     // Kea DHCPv6 server configuration begins here.
     "Dhcp6": {
+        // Global flag selecting an IP address allocation strategy for all
+        // subnets.
+        "allocator": "iterative",
+
+        // Global flag selecting a delegated prefix allocation strategy
+        // for all subnets.
+        "pd-allocator": "random",
+
         // Ordered list of client classes used by the DHCPv6 server.
         "client-classes": [
             {
         // It may be specified at the global, shared-network, and subnet levels.
         "ddns-use-conflict-resolution": true,
 
+        // When greater than 0.0, it is the percent of the lease's lifetime
+        // to use for the DNS TTL.
+        "ddns-ttl-percent": 0.75,
+
         // Time in seconds specifying how long a declined lease should be
         // excluded from DHCP assignments. The default value is 24 hours.
         "decline-probation-period": 86400,
                 "key-file": "my-key",
 
                 // Cipher list (see the OpenSSL ciphers command manual).
-                "cipher-list": "AES"
+                "cipher-list": "AES",
+
+                // Connection reconnect wait time.
+                // This parameter governs how long Kea waits before attempting
+                // to reconnect. Expressed in milliseconds. The default is 0
+                // (disabled) for MySQL and PostgreSQL.
+                "reconnect-wait-time": 3000,
+
+                // Connection maximum reconnect tries.
+                "max-reconnect-tries": 3,
+
+                // Action to take when connection recovery fails.
+                // Supported values: stop-retry-exit, serve-retry-exit,
+                // serve-retry-continue
+                "on-fail": "stop-retry-exit",
+
+                // Connection connect timeout in seconds.
+                "connect-timeout": 100,
+
+                // Timeout of database read operations in seconds.
+                "read-timeout": 120,
+
+                // Timeout of database write operations in seconds.
+                "write-timeout": 180
             },
             {
                 // Name of the database to connect to.
                 // Username to be used to access the database.
                 "user": "keatest",
 
-                // Connection reconnect wait time.
-                // This parameter governs how long Kea waits before attempting
-                // to reconnect. Expressed in milliseconds. The default is 0
-                // (disabled) for MySQL and PostgreSQL.
-                "reconnect-wait-time": 3000,
-
-                // Connection maximum reconnect tries.
-                "max-reconnect-tries": 3,
-
-                // Action to take when connection recovery fails.
-                // Supported values: stop-retry-exit, serve-retry-exit,
-                // serve-retry-continue
-                "on-fail": "stop-retry-exit",
-
-                // Connection connect timeout in seconds.
-                "connect-timeout": 100
+                // TCP user timeout while communicating with the database.
+                // It is specified in seconds.
+                "tcp-user-timeout": 100
             }
         ],
 
         // networks group subnets together.
         "shared-networks": [
             {
+                // A flag selecting an IP address allocation strategy for all
+                // subnets in this shared network.
+                "allocator": "random",
+
+                // A flag selecting a delegated prefix allocation strategy for
+                // all subnets in this shared network.
+                "pd-allocator": "iterative",
+
                 // Restricts this shared network to allow only clients
                 // that belong to a particular client class. If an
                 // empty string is provided, no restriction is applied.
                 // Shared-network level value. See description at the global level.
                 "ddns-use-conflict-resolution": true,
 
+                // Shared-network level value. See description at the global level.
+                "ddns-ttl-percent": 0.65,
+
                 // Shared-network level value. See description at the global level.
                 "hostname-char-replacement": "x",
 
                 // List of IPv6 subnets belonging to this shared network.
                 "subnet6": [
                     {
+                        // A flag selecting an IP address allocation strategy for
+                        // the subnet.
+                        "allocator": "iterative",
+
+                        // A flag selecting a delegated prefix allocation strategy
+                        // for the subnet.
+                        "pd-allocator": "iterative",
+
                         // Restricts this subnet to allow only clients that belong
                         // to a particular client class. If an empty string is
                         // provided, no restriction is applied.
                         // Subnet-level value. See description at the global level.
                         "ddns-use-conflict-resolution": true,
 
+                        // Subnet-level value. See description at the global level.
+                        "ddns-ttl-percent": 0.55,
+
                         // Subnet-level value. See description at the global level.
                         "hostname-char-replacement": "x",
 
                             }
                         ],
 
+                        // List of IP address pools belonging to the subnet.
                         "pools": [
                             {
                                 // Restricts this pool to only be used for client
                         // the Reply message (See DHCPv6 rapid commit).
                         "rapid-commit": false,
 
-                        // Subnet-level rebind timer.
+                        // Subnet-level value of the rebind timer.
                         "rebind-timer": 40,
 
-                        // List of IPv4 relay addresses for which this subnet
-                        // is selected.
+                        // List of IPv6 relay addresses for which this subnet is selected.
                         "relay": {
                             "ip-addresses": [
                                 "2001:db8:0:f::1"
index 8e1ecc3964e05afb14a797fdfd2fef1464c5f2ae..b380b720fbf35094491b38f81842c5bd0d38553f 100644 (file)
                 "key-file": "my-key",
 
                 // Cipher list (see the OpenSSL ciphers command manual).
-                "cipher-list": "AES"
-            },
-            {
-                // Name of the database to connect to.
-                "name": "keatest",
-
-                // Host on which the database resides.
-                "host": "localhost",
-
-                // Database password.
-                "password": "keatest",
-
-                // Port on which the database is available.
-                "port": 5432,
-
-                // Type of database, e.g. "mysql", "postgresql".
-                "type": "postgresql",
-
-                // Username to be used to access the database.
-                "user": "keatest",
-
-                // TCP user timeout while communicating with the database.
-                // It is specified in seconds.
-                "tcp-user-timeout": 100
-            },
-            {
-                // Name of the database to connect to.
-                "name": "keatest",
-
-                // Database password.
-                "password": "keatest",
-
-                // Port on which the database is available.
-                "port": 9042,
-
-                // Type of database, e.g. "mysql", "postgresql".
-                "type": "mysql",
-
-                // Username to be used to access the database.
-                "user": "keatest",
+                "cipher-list": "AES",
 
                 // Connection reconnect wait time.
                 // This parameter governs how long Kea waits before attempting
 
                 // Timeout of database write operations in seconds.
                 "write-timeout": 180
+            },
+            {
+                // Name of the database to connect to.
+                "name": "keatest",
+
+                // Host on which the database resides.
+                "host": "localhost",
+
+                // Database password.
+                "password": "keatest",
+
+                // Port on which the database is available.
+                "port": 5432,
+
+                // Type of database, e.g. "mysql", "postgresql".
+                "type": "postgresql",
+
+                // Username to be used to access the database.
+                "user": "keatest",
+
+                // TCP user timeout while communicating with the database.
+                // It is specified in seconds.
+                "tcp-user-timeout": 100
             }
         ],
 
index 7d3ec401890e1eaf8529ac7794a8894cb82869ed..eff8da89b4f5c469b016ae4c797597967f44ecb8 100644 (file)
@@ -75,6 +75,7 @@ TranslatorClass::getClassKea(DataNode const& data_node) {
     if (model_ == KEA_DHCP4_SERVER) {
         checkAndGetLeaf(result, data_node, "boot-file-name");
         checkAndGetLeaf(result, data_node, "next-server");
+        checkAndGetLeaf(result, data_node, "offer-lifetime");
         checkAndGetLeaf(result, data_node, "server-hostname");
 
         ConstElementPtr defs = getOptionDefList(data_node);
@@ -127,6 +128,7 @@ TranslatorClass::setClassKea(string const& xpath, ConstElementPtr elem) {
     if (model_ == KEA_DHCP4_SERVER) {
         checkAndSetLeaf(elem, xpath, "boot-file-name", LeafBaseType::String);
         checkAndSetLeaf(elem, xpath, "next-server", LeafBaseType::String);
+        checkAndSetLeaf(elem, xpath, "offer-lifetime", LeafBaseType::Uint32);
         checkAndSetLeaf(elem, xpath, "server-hostname", LeafBaseType::String);
 
         ConstElementPtr defs = elem->get("option-def");
index 13a29d82bfdcbebe4e4035c4b842670f7d1aa8df..c560b526b7a801243c9befbf147c7828dc30c676 100644 (file)
@@ -187,6 +187,8 @@ ElementPtr
 TranslatorConfig::getServerKeaDhcpCommon(DataNode const& data_node) {
     ElementPtr result = Element::createMap();
 
+    checkAndGetLeaf(result, data_node, "allocator");
+    checkAndGetLeaf(result, data_node, "cache-max-age");
     checkAndGetLeaf(result, data_node, "cache-max-age");
     checkAndGetLeaf(result, data_node, "cache-threshold");
     checkAndGetLeaf(result, data_node, "calculate-tee-times");
@@ -197,6 +199,7 @@ TranslatorConfig::getServerKeaDhcpCommon(DataNode const& data_node) {
     checkAndGetLeaf(result, data_node, "ddns-qualifying-suffix");
     checkAndGetLeaf(result, data_node, "ddns-replace-client-name");
     checkAndGetLeaf(result, data_node, "ddns-send-updates");
+    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, "decline-probation-period");
@@ -234,6 +237,8 @@ TranslatorConfig::getServerKeaDhcpCommon(DataNode const& data_node) {
     checkAndGet(result, data_node, "compatibility",
                 [&](DataNode const& node) -> ElementPtr const {
                     ElementPtr compatibility(Element::createMap());
+                    checkAndGetLeaf(compatibility, node, "exclude-first-last-24");
+                    checkAndGetLeaf(compatibility, node, "ignore-dhcp-server-identifier");
                     checkAndGetLeaf(compatibility, node, "ignore-rai-link-selection");
                     checkAndGetLeaf(compatibility, node, "lenient-option-parsing");
                     return compatibility;
@@ -337,6 +342,7 @@ TranslatorConfig::getServerKeaDhcp4() {
     checkAndGetLeaf(result, config, "echo-client-id");
     checkAndGetLeaf(result, config, "match-client-id");
     checkAndGetLeaf(result, config, "next-server");
+    checkAndGetLeaf(result, config, "offer-lifetime");
     checkAndGetLeaf(result, config, "server-hostname");
 
     // Handle interfaces.
@@ -371,6 +377,7 @@ TranslatorConfig::getServerKeaDhcp6() {
     checkAndGetLeaf(result, config, "mac-sources");
     checkAndGetLeaf(result, config, "max-preferred-lifetime");
     checkAndGetLeaf(result, config, "min-preferred-lifetime");
+    checkAndGetLeaf(result, config, "pd-allocator");
     checkAndGetLeaf(result, config, "preferred-lifetime");
     checkAndGetLeaf(result, config, "relay-supplied-options");
 
@@ -486,6 +493,7 @@ TranslatorConfig::setConfigKea6(ConstElementPtr elem) {
 void
 TranslatorConfig::setServerKeaDhcpCommon(string const& xpath,
                                          ConstElementPtr elem) {
+    checkAndSetLeaf(elem, xpath, "allocator", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "cache-max-age", LeafBaseType::Uint32);
     checkAndSetLeaf(elem, xpath, "cache-threshold", LeafBaseType::Dec64);
     checkAndSetLeaf(elem, xpath, "calculate-tee-times", LeafBaseType::Bool);
@@ -495,6 +503,7 @@ TranslatorConfig::setServerKeaDhcpCommon(string const& xpath,
     checkAndSetLeaf(elem, xpath, "ddns-qualifying-suffix", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "ddns-replace-client-name", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "ddns-send-updates", LeafBaseType::Bool);
+    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, "dhcp4o6-port", LeafBaseType::Uint16);
@@ -661,8 +670,15 @@ TranslatorConfig::setServerKeaDhcp4(ConstElementPtr elem) {
     checkAndSetLeaf(elem, xpath, "echo-client-id", LeafBaseType::Bool);
     checkAndSetLeaf(elem, xpath, "match-client-id", LeafBaseType::Bool);
     checkAndSetLeaf(elem, xpath, "next-server", LeafBaseType::String);
+    checkAndSetLeaf(elem, xpath, "offer-lifetime", LeafBaseType::Uint32);
     checkAndSetLeaf(elem, xpath, "server-hostname", LeafBaseType::String);
 
+    ConstElementPtr compatibility(elem->get("compatibility"));
+    if (compatibility) {
+        checkAndSetLeaf(compatibility, xpath + "/compatibility", "exclude-first-last-24", LeafBaseType::Bool);
+        checkAndSetLeaf(compatibility, xpath + "/compatibility", "ignore-dhcp-server-identifier", LeafBaseType::Bool);
+    }
+
     ConstElementPtr if_config = elem->get("interfaces-config");
     if (if_config) {
         string const if_cfg_xpath(xpath + "/interfaces-config");
@@ -691,6 +707,7 @@ TranslatorConfig::setServerKeaDhcp6(ConstElementPtr elem) {
     checkAndSetLeaf(elem, xpath, "data-directory", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "max-preferred-lifetime", LeafBaseType::Uint32);
     checkAndSetLeaf(elem, xpath, "min-preferred-lifetime", LeafBaseType::Uint32);
+    checkAndSetLeaf(elem, xpath, "pd-allocator", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "preferred-lifetime", LeafBaseType::Uint32);
 
     checkAndSetLeafList(elem, xpath, "mac-sources", LeafBaseType::String);
index 1e6bb6e4cd26b1e4b7303c337775c7d29bb14425..e75c47c73579af74a4b412b230ce442b8efc5b0d 100644 (file)
@@ -66,10 +66,13 @@ TranslatorDatabase::getDatabaseKea(DataNode const& data_node) {
     checkAndGetLeaf(result, data_node, "password");
     checkAndGetLeaf(result, data_node, "persist");
     checkAndGetLeaf(result, data_node, "port");
+    checkAndGetLeaf(result, data_node, "read-timeout");
     checkAndGetLeaf(result, data_node, "readonly");
     checkAndGetLeaf(result, data_node, "reconnect-wait-time");
+    checkAndGetLeaf(result, data_node, "tcp-user-timeout");
     checkAndGetLeaf(result, data_node, "trust-anchor");
     checkAndGetLeaf(result, data_node, "user");
+    checkAndGetLeaf(result, data_node, "write-timeout");
 
     checkAndGetAndJsonifyLeaf(result, data_node, "user-context");
 
@@ -118,9 +121,12 @@ TranslatorDatabase::setDatabaseKea(string const& xpath,
     checkAndSetLeaf(elem, xpath, "persist", LeafBaseType::Bool);
     checkAndSetLeaf(elem, xpath, "port", LeafBaseType::Uint16);
     checkAndSetLeaf(elem, xpath, "readonly", LeafBaseType::Bool);
+    checkAndSetLeaf(elem, xpath, "read-timeout", LeafBaseType::Uint32);
     checkAndSetLeaf(elem, xpath, "reconnect-wait-time", LeafBaseType::Uint32);
+    checkAndSetLeaf(elem, xpath, "tcp-user-timeout", LeafBaseType::Uint32);
     checkAndSetLeaf(elem, xpath, "trust-anchor", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "user", LeafBaseType::String);
+    checkAndSetLeaf(elem, xpath, "write-timeout", LeafBaseType::Uint32);
 
     checkAndSetUserContext(elem, xpath);
 
index ad5d121ffcd727ece9d9c813da0a08449349d898..bc1aa284e07b74718d9083199ae9acdc7cffaadc 100644 (file)
@@ -67,6 +67,7 @@ TranslatorSharedNetwork::getSharedNetworkKea(DataNode const& data_node,
 
     getMandatoryLeaf(result, data_node, "name");
 
+    checkAndGetLeaf(result, data_node, "allocator");
     checkAndGetLeaf(result, data_node, "cache-max-age");
     checkAndGetLeaf(result, data_node, "cache-threshold");
     checkAndGetLeaf(result, data_node, "calculate-tee-times");
@@ -77,6 +78,7 @@ TranslatorSharedNetwork::getSharedNetworkKea(DataNode const& data_node,
     checkAndGetLeaf(result, data_node, "ddns-qualifying-suffix");
     checkAndGetLeaf(result, data_node, "ddns-replace-client-name");
     checkAndGetLeaf(result, data_node, "ddns-send-updates");
+    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, "hostname-char-replacement");
@@ -119,6 +121,7 @@ TranslatorSharedNetwork::getSharedNetworkKea(DataNode const& data_node,
         checkAndGetLeaf(result, data_node, "interface-id");
         checkAndGetLeaf(result, data_node, "max-preferred-lifetime");
         checkAndGetLeaf(result, data_node, "min-preferred-lifetime");
+        checkAndGetLeaf(result, data_node, "pd-allocator");
         checkAndGetLeaf(result, data_node, "preferred-lifetime");
         checkAndGetLeaf(result, data_node, "rapid-commit");
     } else if (subsel == "subnet4") {
@@ -126,6 +129,7 @@ TranslatorSharedNetwork::getSharedNetworkKea(DataNode const& data_node,
         checkAndGetLeaf(result, data_node, "boot-file-name");
         checkAndGetLeaf(result, data_node, "match-client-id");
         checkAndGetLeaf(result, data_node, "next-server");
+        checkAndGetLeaf(result, data_node, "offer-lifetime");
         checkAndGetLeaf(result, data_node, "server-hostname");
     }
 
@@ -158,6 +162,7 @@ TranslatorSharedNetwork::setSharedNetworkKea(string const& xpath,
                                              string const& subsel) {
     // Skip key "name".
 
+    checkAndSetLeaf(elem, xpath, "allocator", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "cache-max-age", LeafBaseType::Uint32);
     checkAndSetLeaf(elem, xpath, "cache-threshold", LeafBaseType::Dec64);
     checkAndSetLeaf(elem, xpath, "calculate-tee-times", LeafBaseType::Bool);
@@ -168,6 +173,7 @@ TranslatorSharedNetwork::setSharedNetworkKea(string const& xpath,
     checkAndSetLeaf(elem, xpath, "ddns-qualifying-suffix", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "ddns-replace-client-name", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "ddns-send-updates", LeafBaseType::Bool);
+    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, "hostname-char-replacement", LeafBaseType::String);
@@ -217,6 +223,7 @@ TranslatorSharedNetwork::setSharedNetworkKea(string const& xpath,
         checkAndSetLeaf(elem, xpath, "interface-id", LeafBaseType::String);
         checkAndSetLeaf(elem, xpath, "max-preferred-lifetime", LeafBaseType::Uint32);
         checkAndSetLeaf(elem, xpath, "min-preferred-lifetime", LeafBaseType::Uint32);
+        checkAndSetLeaf(elem, xpath, "pd-allocator", LeafBaseType::String);
         checkAndSetLeaf(elem, xpath, "preferred-lifetime", LeafBaseType::Uint32);
         checkAndSetLeaf(elem, xpath, "rapid-commit", LeafBaseType::Bool);
     } else {
@@ -224,6 +231,7 @@ TranslatorSharedNetwork::setSharedNetworkKea(string const& xpath,
         checkAndSetLeaf(elem, xpath, "boot-file-name", LeafBaseType::String);
         checkAndSetLeaf(elem, xpath, "match-client-id", LeafBaseType::Bool);
         checkAndSetLeaf(elem, xpath, "next-server", LeafBaseType::String);
+        checkAndSetLeaf(elem, xpath, "offer-lifetime", LeafBaseType::Uint32);
         checkAndSetLeaf(elem, xpath, "server-hostname", LeafBaseType::String);
     }
 }
index ae9c0f654f0f0ea5a1e5dc6715585f973be9bac5..15a2e6ae963bfe840322ee615e163f16815c7968 100644 (file)
@@ -100,6 +100,7 @@ TranslatorSubnet::getSubnetKea(DataNode const& data_node) {
     getMandatoryLeaf(result, data_node, "id");
     getMandatoryLeaf(result, data_node, "subnet");
 
+    checkAndGetLeaf(result, data_node, "allocator");
     checkAndGetLeaf(result, data_node, "cache-max-age");
     checkAndGetLeaf(result, data_node, "cache-threshold");
     checkAndGetLeaf(result, data_node, "calculate-tee-times");
@@ -110,6 +111,7 @@ TranslatorSubnet::getSubnetKea(DataNode const& data_node) {
     checkAndGetLeaf(result, data_node, "ddns-qualifying-suffix");
     checkAndGetLeaf(result, data_node, "ddns-replace-client-name");
     checkAndGetLeaf(result, data_node, "ddns-send-updates");
+    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, "hostname-char-replacement");
@@ -157,6 +159,7 @@ TranslatorSubnet::getSubnetKea(DataNode const& data_node) {
         checkAndGetLeaf(result, data_node, "interface-id");
         checkAndGetLeaf(result, data_node, "max-preferred-lifetime");
         checkAndGetLeaf(result, data_node, "min-preferred-lifetime");
+        checkAndGetLeaf(result, data_node, "pd-allocator");
         checkAndGetLeaf(result, data_node, "preferred-lifetime");
         checkAndGetLeaf(result, data_node, "rapid-commit");
 
@@ -169,6 +172,7 @@ TranslatorSubnet::getSubnetKea(DataNode const& data_node) {
         checkAndGetLeaf(result, data_node, "boot-file-name");
         checkAndGetLeaf(result, data_node, "match-client-id");
         checkAndGetLeaf(result, data_node, "next-server");
+        checkAndGetLeaf(result, data_node, "offer-lifetime");
         checkAndGetLeaf(result, data_node, "server-hostname");
 
         checkAndGetDivergingLeaf(result, data_node, "4o6-interface", "subnet-4o6-interface");
@@ -240,6 +244,7 @@ TranslatorSubnet::setSubnetKea(string const& xpath, ConstElementPtr elem) {
     }
     setItem(xpath + "/subnet", subnet, LeafBaseType::String);
 
+    checkAndSetLeaf(elem, xpath, "allocator", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "cache-max-age", LeafBaseType::Uint32);
     checkAndSetLeaf(elem, xpath, "cache-threshold", LeafBaseType::Dec64);
     checkAndSetLeaf(elem, xpath, "calculate-tee-times", LeafBaseType::Bool);
@@ -250,6 +255,7 @@ TranslatorSubnet::setSubnetKea(string const& xpath, ConstElementPtr elem) {
     checkAndSetLeaf(elem, xpath, "ddns-qualifying-suffix", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "ddns-replace-client-name", LeafBaseType::String);
     checkAndSetLeaf(elem, xpath, "ddns-send-updates", LeafBaseType::Bool);
+    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, "hostname-char-replacement", LeafBaseType::String);
@@ -299,6 +305,7 @@ TranslatorSubnet::setSubnetKea(string const& xpath, ConstElementPtr elem) {
         checkAndSetLeaf(elem, xpath, "interface-id", LeafBaseType::String);
         checkAndSetLeaf(elem, xpath, "max-preferred-lifetime", LeafBaseType::Uint32);
         checkAndSetLeaf(elem, xpath, "min-preferred-lifetime", LeafBaseType::Uint32);
+        checkAndSetLeaf(elem, xpath, "pd-allocator", LeafBaseType::String);
         checkAndSetLeaf(elem, xpath, "preferred-lifetime", LeafBaseType::Uint32);
         checkAndSetLeaf(elem, xpath, "rapid-commit", LeafBaseType::Bool);
 
@@ -311,6 +318,7 @@ TranslatorSubnet::setSubnetKea(string const& xpath, ConstElementPtr elem) {
         checkAndSetLeaf(elem, xpath, "boot-file-name", LeafBaseType::String);
         checkAndSetLeaf(elem, xpath, "match-client-id", LeafBaseType::Bool);
         checkAndSetLeaf(elem, xpath, "next-server", LeafBaseType::String);
+        checkAndSetLeaf(elem, xpath, "offer-lifetime", LeafBaseType::Uint32);
         checkAndSetLeaf(elem, xpath, "server-hostname", LeafBaseType::String);
 
         checkAndSetDivergingLeaf(elem, xpath, "4o6-interface", "subnet-4o6-interface", LeafBaseType::String);
index 36fd06ce3ce330565a52a6b339e19e33ae604d4b..ebd9c5a1c5291f4b9ba76535acadf2d2696d14e7 100644 (file)
@@ -22,9 +22,9 @@ static const std::unordered_map<std::string, std::string> YANG_REVISIONS = {
     { "ietf-dhcpv6-options", "2018-09-04" },
     { "ietf-dhcpv6-server", "2018-09-04" },
     { "kea-types", "2019-08-12" },
-    { "kea-dhcp-types", "2022-12-27" },
-    { "kea-dhcp4-server", "2022-12-27" },
-    { "kea-dhcp6-server", "2022-12-27" },
+    { "kea-dhcp-types", "2023-05-31" },
+    { "kea-dhcp4-server", "2023-05-31" },
+    { "kea-dhcp6-server", "2023-05-31" },
     { "kea-ctrl-agent", "2019-08-12" },
     { "kea-dhcp-ddns", "2022-07-27" }
 };  // YANG_REVISIONS
index dd8737fa629cd168b32a03f6d707528c4e36692e..6b6cc0f930441a6907a01aff58592ff80dc43946 100644 (file)
@@ -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@2022-12-27.yang
-yangmodules_list += kea-dhcp4-server@2022-12-27.yang
-yangmodules_list += kea-dhcp6-server@2022-12-27.yang
+yangmodules_list += kea-dhcp-types@2023-05-31.yang
+yangmodules_list += kea-dhcp4-server@2023-05-31.yang
+yangmodules_list += kea-dhcp6-server@2023-05-31.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@2022-12-27.hash b/src/share/yang/modules/hashes/kea-dhcp-types@2022-12-27.hash
deleted file mode 100644 (file)
index f3be9ec..0000000
+++ /dev/null
@@ -1 +0,0 @@
-c7c3d49249be8027851050a5a11e888053253e4ef3863d9acd125062160e7190
diff --git a/src/share/yang/modules/hashes/kea-dhcp-types@2023-05-31.hash b/src/share/yang/modules/hashes/kea-dhcp-types@2023-05-31.hash
new file mode 100644 (file)
index 0000000..40d750d
--- /dev/null
@@ -0,0 +1 @@
+6dc9841ffdbd2b6af5c3d3fc5b065faf5da5fb2a6e4aa353bd354a912c1a8ff2
diff --git a/src/share/yang/modules/hashes/kea-dhcp4-server@2022-12-27.hash b/src/share/yang/modules/hashes/kea-dhcp4-server@2022-12-27.hash
deleted file mode 100644 (file)
index 24abe89..0000000
+++ /dev/null
@@ -1 +0,0 @@
-2bef760a61ec2054c0398c75e31fb20208620d2bf7353cdf3c33fbebca32becb
diff --git a/src/share/yang/modules/hashes/kea-dhcp4-server@2023-05-31.hash b/src/share/yang/modules/hashes/kea-dhcp4-server@2023-05-31.hash
new file mode 100644 (file)
index 0000000..6f52b83
--- /dev/null
@@ -0,0 +1 @@
+1ca854318d678439af345dec3bc76a784fdc7a07ccb632e17819a4e32183b577
diff --git a/src/share/yang/modules/hashes/kea-dhcp6-server@2022-12-27.hash b/src/share/yang/modules/hashes/kea-dhcp6-server@2022-12-27.hash
deleted file mode 100644 (file)
index 800bfc7..0000000
+++ /dev/null
@@ -1 +0,0 @@
-25e02b2d4347dd95b58b8f397d3d506bf94483a3b2d85a90eb062aa1e52e3a5a
diff --git a/src/share/yang/modules/hashes/kea-dhcp6-server@2023-05-31.hash b/src/share/yang/modules/hashes/kea-dhcp6-server@2023-05-31.hash
new file mode 100644 (file)
index 0000000..d50d36d
--- /dev/null
@@ -0,0 +1 @@
+a0d0f5874e8d57775b6b813d448aacf8c0b9eb8056160ecd79f5b597fe80dcf3
similarity index 92%
rename from src/share/yang/modules/kea-dhcp-types@2022-12-27.yang
rename to src/share/yang/modules/kea-dhcp-types@2023-05-31.yang
index d46ac0e8cfd5727f9d9c5af8e2efe8cb64a2e893..2daca51164a6d51458b64abe55dded08f1241b14 100644 (file)
@@ -16,6 +16,13 @@ module kea-dhcp-types {
   description "This file defines some commonly used Kea DHCP types and
                groupings.";
 
+  revision 2023-05-31 {
+    description "Added allocator, ddns-ttl-percent, exclude-first-last-24,
+                 ignore-dhcp-server-identifier, offer-lifetime, pd-allocator,
+                 read-timeout, tcp-user-timeout, write-timeout.
+                 Removed contact-points, keyspace.";
+  }
+
   revision 2022-12-27 {
     description "Added never-send.";
   }
@@ -257,15 +264,15 @@ module kea-dhcp-types {
       units "milliseconds";
       description "Database connection timeout.";
     }
-    leaf contact-points {
-      type string;
-      description "Cassandra database contact points, a coma separated list of
-                   IP addresses.";
+    leaf read-timeout {
+      type uint32;
+      units "seconds";
+      description "timeout for database read operations";
     }
-    leaf keyspace {
-      type string;
-      description "Cassandra database keyspace (this is Cassandra's equivalent
-                   of a database name).";
+    leaf write-timeout {
+      type uint32;
+      units "seconds";
+      description "timeout for database write operations";
     }
     leaf max-reconnect-tries {
       type uint32;
@@ -290,6 +297,11 @@ module kea-dhcp-types {
       type boolean;
       description "TCP nodelay for the database connection.";
     }
+    leaf tcp-user-timeout {
+      type uint32;
+      units "seconds";
+      description "TCP user timeout while communicating with the database";
+    }
     leaf consistency {
       type string;
       description "Consistency level.";
@@ -997,21 +1009,35 @@ module kea-dhcp-types {
     }
   }
 
-  grouping compatibility {
-    container compatibility {
+  grouping common-compatibility {
+    description
+      "parameters that are common to DHCPv4 and DHCPv6 for triggering behaviors compatible
+        with broken or non-compliant clients, relays or other agents";
+    leaf ignore-rai-link-selection {
+      type boolean;
       description
-        "parameters for triggering behaviors compatible with broken or
-         non-compliant clients, relays or other agents";
-      leaf ignore-rai-link-selection {
-        type boolean;
-        description
-          "Ignore the link selection RAI suboption.";
-      }
-      leaf lenient-option-parsing {
-        type boolean;
-        description
-          "Enable more lenient option parsing.";
-      }
+        "Ignore the link selection RAI suboption.";
+    }
+    leaf lenient-option-parsing {
+      type boolean;
+      description
+        "Enable more lenient option parsing.";
+    }
+  }
+
+  grouping v4-compatibility {
+    description
+      "DHCPv4-specific parameters for triggering behaviors compatible
+        with broken or non-compliant clients, relays or other agents";
+    leaf exclude-first-last-24 {
+      type boolean;
+      description
+        "Whether .0 and .255 addresses should be excluded from allocation in subnets with a prefix length of 24 or less.";
+    }
+    leaf ignore-dhcp-server-identifier {
+      type boolean;
+      description
+        "Whether the DHCP Server Identifier should be ignored in ingress packets.";
     }
   }
 
@@ -1064,6 +1090,17 @@ module kea-dhcp-types {
     }
   }
 
+  grouping ddns-ttl-percent {
+    leaf ddns-ttl-percent {
+      type decimal64 {
+        fraction-digits 18;
+        range "0 .. 1";
+      }
+      description
+        "the percentage of the leases's lifetime to use for the DNS TTL";
+    }
+  }
+
   grouping ddns-update-on-renew {
     leaf ddns-update-on-renew {
       type boolean;
@@ -1178,4 +1215,28 @@ module kea-dhcp-types {
         "the maximum number of samples which are kept";
     }
   }
+
+  grouping allocator {
+    leaf allocator {
+      type string;
+      description
+        "the allocation strategy for IP addresses";
+    }
+  }
+
+  grouping pd-allocator {
+    leaf pd-allocator {
+      type string;
+      description
+        "the allocation strategy for delegted prefixes";
+    }
+  }
+
+  grouping offer-lifetime {
+    leaf offer-lifetime {
+      type uint32;
+      description
+        "the lifetime of leases temporarily allocated on DISCOVER";
+    }
+  }
 }
similarity index 96%
rename from src/share/yang/modules/kea-dhcp4-server@2022-12-27.yang
rename to src/share/yang/modules/kea-dhcp4-server@2023-05-31.yang
index 95a850b0980de30f133efeb782499ad64beb5822..3f53d3cb4ce80eaa0a7604f2ba975b1beb23bd3d 100644 (file)
@@ -12,7 +12,7 @@ module kea-dhcp4-server {
   }
   import kea-dhcp-types {
     prefix dhcp;
-    revision-date 2022-12-27;
+    revision-date 2023-05-31;
   }
 
   organization "Internet Systems Consortium";
@@ -20,6 +20,13 @@ 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 2023-05-31 {
+    description "Added allocator, ddns-ttl-percent, exclude-first-last-24,
+                 ignore-dhcp-server-identifier, offer-lifetime,
+                 read-timeout, tcp-user-timeout, write-timeout.
+                 Removed contact-points, keyspace.";
+  }
+
   revision 2022-12-27 {
     description "Added never-send to option-data.";
   }
@@ -177,6 +184,8 @@ module kea-dhcp4-server {
       key id;
       ordered-by user;
       description "List of IPv4 subnets.";
+      uses dhcp:allocator;
+      uses dhcp:offer-lifetime;
       uses dhcp:valid-lifetime;
       uses dhcp:min-valid-lifetime;
       uses dhcp:max-valid-lifetime;
@@ -254,6 +263,7 @@ module kea-dhcp4-server {
       uses dhcp:ddns-qualifying-suffix;
       uses dhcp:ddns-replace-client-name;
       uses dhcp:ddns-send-updates;
+      uses dhcp:ddns-ttl-percent;
       uses dhcp:ddns-update-on-renew;
       uses dhcp:ddns-use-conflict-resolution;
       uses dhcp:hostname-char-replacement;
@@ -276,6 +286,7 @@ module kea-dhcp4-server {
       uses dhcp:class-test;
       uses dhcp:template-test;
       uses dhcp:class-only-if-required;
+      uses dhcp:offer-lifetime;
       uses option-def-list;
       uses option-data-list;
       uses next-server;
@@ -344,6 +355,8 @@ module kea-dhcp4-server {
     // config true;
     description "Contains DHCPv4 server configuration.";
 
+    uses dhcp:allocator;
+    uses dhcp:offer-lifetime;
     uses dhcp:valid-lifetime;
     uses dhcp:min-valid-lifetime;
     uses dhcp:max-valid-lifetime;
@@ -360,6 +373,8 @@ module kea-dhcp4-server {
       description "List of IPv4 shared networks.";
       uses dhcp:network-name;
       uses subnet4-list;
+      uses dhcp:allocator;
+      uses dhcp:offer-lifetime;
       uses dhcp:network-interface;
       uses dhcp:renew-timer;
       uses dhcp:rebind-timer;
@@ -390,6 +405,7 @@ module kea-dhcp4-server {
       uses dhcp:ddns-qualifying-suffix;
       uses dhcp:ddns-replace-client-name;
       uses dhcp:ddns-send-updates;
+      uses dhcp:ddns-ttl-percent;
       uses dhcp:ddns-update-on-renew;
       uses dhcp:ddns-use-conflict-resolution;
       uses dhcp:hostname-char-replacement;
@@ -487,13 +503,17 @@ module kea-dhcp4-server {
     uses kea:loggers;
     uses dhcp:cache-max-age;
     uses dhcp:cache-threshold;
-    uses dhcp:compatibility;
+    container compatibility {
+      uses dhcp:common-compatibility;
+      uses dhcp:v4-compatibility;
+    }
     uses dhcp:ddns-generated-prefix;
     uses dhcp:ddns-override-client-update;
     uses dhcp:ddns-override-no-update;
     uses dhcp:ddns-qualifying-suffix;
     uses dhcp:ddns-replace-client-name;
     uses dhcp:ddns-send-updates;
+    uses dhcp:ddns-ttl-percent;
     uses dhcp:ddns-update-on-renew;
     uses dhcp:ddns-use-conflict-resolution;
     uses dhcp:ip-reservations-unique;
similarity index 97%
rename from src/share/yang/modules/kea-dhcp6-server@2022-12-27.yang
rename to src/share/yang/modules/kea-dhcp6-server@2023-05-31.yang
index 20f38ee48996186752471b4509719832d8d820d1..b1d13639917597dedb716149615df8cf4303350c 100644 (file)
@@ -12,7 +12,7 @@ module kea-dhcp6-server {
   }
   import kea-dhcp-types {
     prefix dhcp;
-    revision-date 2022-12-27;
+    revision-date 2023-05-31;
   }
 
   organization "Internet Systems Consortium";
@@ -20,6 +20,12 @@ 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 2023-05-31 {
+    description "Added allocator, ddns-ttl-percent, offer-lifetime,
+                 pd-allocator, read-timeout, tcp-user-timeout, write-timeout.
+                 Removed contact-points, keyspace.";
+  }
+
   revision 2022-12-27 {
     description "Added never-send to option-data.";
   }
@@ -180,6 +186,8 @@ module kea-dhcp6-server {
       key id;
       ordered-by user;
       description "List of IPv6 subnets.";
+      uses dhcp:allocator;
+      uses dhcp:pd-allocator;
       uses preferred-lifetime;
       uses min-preferred-lifetime;
       uses max-preferred-lifetime;
@@ -289,6 +297,7 @@ module kea-dhcp6-server {
       uses dhcp:ddns-qualifying-suffix;
       uses dhcp:ddns-replace-client-name;
       uses dhcp:ddns-send-updates;
+      uses dhcp:ddns-ttl-percent;
       uses dhcp:ddns-update-on-renew;
       uses dhcp:ddns-use-conflict-resolution;
       uses dhcp:hostname-char-replacement;
@@ -378,6 +387,8 @@ module kea-dhcp6-server {
     // config true;
     description "Contains DHCPv6 server configuration.";
 
+    uses dhcp:allocator;
+    uses dhcp:pd-allocator;
     uses data-directory;
     uses preferred-lifetime;
     uses min-preferred-lifetime;
@@ -397,6 +408,8 @@ module kea-dhcp6-server {
       key name;
       uses dhcp:network-name;
       description "List of IPv4 shared networks.";
+      uses dhcp:allocator;
+      uses dhcp:pd-allocator;
       uses subnet6-list;
       uses dhcp:network-interface;
       uses interface-id {
@@ -436,6 +449,7 @@ module kea-dhcp6-server {
       uses dhcp:ddns-qualifying-suffix;
       uses dhcp:ddns-replace-client-name;
       uses dhcp:ddns-send-updates;
+      uses dhcp:ddns-ttl-percent;
       uses dhcp:ddns-update-on-renew;
       uses dhcp:ddns-use-conflict-resolution;
       uses dhcp:hostname-char-replacement;
@@ -551,13 +565,16 @@ module kea-dhcp6-server {
     uses kea:loggers;
     uses dhcp:cache-max-age;
     uses dhcp:cache-threshold;
-    uses dhcp:compatibility;
+    container compatibility {
+      uses dhcp:common-compatibility;
+    }
     uses dhcp:ddns-generated-prefix;
     uses dhcp:ddns-override-client-update;
     uses dhcp:ddns-override-no-update;
     uses dhcp:ddns-qualifying-suffix;
     uses dhcp:ddns-replace-client-name;
     uses dhcp:ddns-send-updates;
+    uses dhcp:ddns-ttl-percent;
     uses dhcp:ddns-update-on-renew;
     uses dhcp:ddns-use-conflict-resolution;
     uses dhcp:ip-reservations-unique;
diff --git a/src/share/yang/modules/utils/bump-up-revisions.sh b/src/share/yang/modules/utils/bump-up-revisions.sh
new file mode 100755 (executable)
index 0000000..3500155
--- /dev/null
@@ -0,0 +1,75 @@
+#!/bin/sh
+
+# Copyright (C) 2023 Internet Systems Consortium, Inc. ("ISC")
+#
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+# This script can be used to bump up YANG module revisions.
+
+# Exit with error if commands exit with non-zero and if undefined variables are
+# used.
+set -eu
+
+# Print usage.
+# Expressions don't expand in single quotes, use double quotes for that. [SC2016]
+# shellcheck disable=SC2016
+print_usage() {
+  printf \
+'Usage: %s {{options}}
+Options:
+  [-d|--debug]                              enable debug mode, showing every executed command
+  [-h|--help]                               print usage (this text)
+' \
+    "$(basename "${0}")"
+}
+
+# Parse parameters.
+while test ${#} -gt 0; do
+  case "${1}" in
+    # [-d|--debug]                              enable debug mode, showing every executed command
+    '-d'|'--debug') set -vx ;;
+
+    # [-h|--help]                               print usage (this text)
+    '-h'|'--help') print_usage; exit 0 ;;
+
+    # Unrecognized argument
+    *)
+    printf "${red}ERROR: Unrecognized argument '%s'${reset}\\n" "${1}" 1>&2; print_usage; exit 1 ;;
+  esac; shift
+done
+
+#------------------------------------------------------------------------------#
+
+# Get script path.
+script_path=$(cd "$(dirname "${0}")" && pwd)
+pushd "${script_path}/.."
+
+# Get the last wednesday of the month.
+this_month=$(date +%Y-%m)
+wednesday=$(date -dwednesday +%Y-%m-%d)
+i="${wednesday}"
+while test "$(date -d "${i}" +%Y-%m)" == "${this_month}"; do
+  wednesday="${i}"
+  i=$(date -d"${wednesday} +7 days" +%Y-%m-%d)
+done
+
+# For all modules that were modified in this branch:
+# - rename it to the new revision
+# - change its name in Makefile.am
+# - change its name in yang_revisions.h
+ca=$(git merge-base origin/master $(git rev-parse --abbrev-ref HEAD))
+for module in $(git diff "${ca}" --name-only . | grep  -E '\.yang$'); do
+  module=$(basename "${module}")
+  new_module="$(printf '%s' "${module}" | sed "s/@.*\.yang/@${wednesday}.yang/g")"
+  if test "${module}" != "${new_module}"; then
+    mv "${module}" "${new_module}"
+    sed -i "s/${module}/${new_module}/g" ./Makefile.am
+    sed -i "s/${module}/${new_module}/g" ../../../lib/yang/yang_revisions.h
+  fi
+done
+
+# Regenerate hashes.
+rm hashes/*
+./utils/check-hashes.sh -a