]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[433-update-yang-models] Updated code and tests
authorFrancis Dupont <fdupont@isc.org>
Fri, 9 Aug 2019 17:47:58 +0000 (19:47 +0200)
committerTomek Mrugalski <tomek@isc.org>
Tue, 13 Aug 2019 21:43:06 +0000 (17:43 -0400)
20 files changed:
doc/examples/kea4/all-keys-stable.json
doc/examples/kea6/all-keys-stable.json
src/lib/yang/tests/translator_unittests.cc
src/lib/yang/translator.cc
src/lib/yang/translator_config.cc
src/lib/yang/translator_config.h
src/lib/yang/translator_control_socket.h
src/lib/yang/translator_database.cc
src/lib/yang/translator_database.h
src/lib/yang/translator_logger.h
src/lib/yang/translator_pool.h
src/lib/yang/translator_shared_network.cc
src/lib/yang/translator_shared_network.h
src/lib/yang/translator_subnet.cc
src/lib/yang/translator_subnet.h
src/lib/yang/yang.dox
src/lib/yang/yang_revisions.h
src/share/yang/modules/Makefile.am
src/share/yang/modules/hashes/kea-dhcp4-server@2019-08-09.hash
src/share/yang/modules/kea-dhcp4-server@2019-08-09.yang

index a99516fe7b227be799ff4c637c3eebe4b421ed23..56d66744b80428b4d2e3e3c6eebe87f65d46e52c 100644 (file)
@@ -6,8 +6,8 @@
 // list of parameters supported by Kea DHCPv4 server along with the brief
 // description of each parameter.
 //
-// This stable version is used for YANG as we do not want to update code
-// and models each time a keyword is added to the syntax.
+// This current version should be up to date, i.e. new keywords should be
+// added in this file at the same time than in the syntax.
 {
     // Kea DHCPv4 server configuration begins here.
     "Dhcp4": {
 
                 // User name to be used to access the database.
                 "user": "kea"
+            },
+            {
+                // Name of the database to connect to.
+                "name": "kea",
+
+                // Host on which the database resides.
+                "host": "localhost",
+
+                // Database password.
+                "password": "kea",
+
+                // Port on which the database is available.
+                "port": 5432,
+
+                // Type of the database, e.g. "mysql", "postgresql", "cql".
+                "type": "postgresql",
+
+                // User name to be used to access the database.
+                "user": "kea"
+            },
+            {
+                // Name of the database to connect to.
+                "keyspace": "kea",
+
+                // Host on which the database resides.
+                "contact-points": "127.0.0.1",
+
+                // Database password.
+                "password": "kea",
+
+                // Port on which the database is available.
+                "port": 9042,
+
+                // Type of the database, e.g. "mysql", "postgresql", "cql".
+                "type": "cql",
+
+                // User name to be used to access the database.
+                "user": "kea",
+
+                // Consistency level for all queries.
+                // Supported values: any, one, two, three, quorum, all,
+                // local-quorum, each-quorum, serial, local-serial, local-one.
+                "consistency": "quorum",
+
+                // Serial consistency level for all queries.
+                // Supported values: any, one, two, three, quorum, all,
+                // local-quorum, each-quorum, serial, local-serial, local-one.
+                "serial-consistency": "serial",
+
+                // Connection reconnect wait time.
+                "reconnect-wait-time": 100,
+
+                // Connection connect timeout.
+                "connect-timeout": 100,
+
+                // Connection request timeout.
+                "request-timeout": 100,
+
+                // Connection tcp keepalive.
+                "tcp-keepalive": 100,
+
+                // Connection tcp nodelay.
+                "tcp-nodelay": true
             }
         ],
 
                 // Shared network level renew timer.
                 "renew-timer": 31,
 
+                // Shared network level compute T1 and T2 timers.
+                "calculate-tee-times": true,
+
+                // T1 = valid lifetime * .5.
+                "t1-percent": .5,
+
+                // T2 = valid lifetime * .75.
+                "t2-percent": .75,
+
                 // Enumeration specifying server's mode of operation when it
                 // fetches host reservations.
                 "reservation-mode": "all",
                         // fetches host reservations.
                         "reservation-mode": "all",
 
+                        // Subnet-level compute T1 and T2 timers.
+                        "calculate-tee-times": true,
+
+                        // T1 = valid lifetime * .5.
+                        "t1-percent": .5,
+
+                        // T2 = valid lifetime * .75.
+                        "t2-percent": .75,
+
                         // List of static IPv4 reservations assigned to the clients belonging
                         // to this subnet. For detailed example see reservations.json.
                         "reservations": [
                         // Subnet prefix.
                         "subnet": "192.0.0.0/8",
 
-                        // Subnet level valid lifetime.
-                        "valid-lifetime": 6000
+                        // Subnet level (default) valid lifetime.
+                        "valid-lifetime": 6000,
+
+                        // Subnet level min valid lifetime.
+                        "min-valid-lifetime": 4000,
+
+                        // Subnet level max valid lifetime.
+                        "max-valid-lifetime": 8000
                     }
                 ],
 
-                // Shared network level valid lifetime.
-                "valid-lifetime": 6001
+                // Shared network level (default) valid lifetime.
+                "valid-lifetime": 6001,
+
+                // Subnet level min valid lifetime.
+                "min-valid-lifetime": 4001,
+
+                // Subnet level max valid lifetime.
+                "max-valid-lifetime": 8001
             }
         ],
 
         // List of IPv4 subnets which don't belong to any shared network.
         "subnet4": [],
 
-        // Global valid lifetime value.
+        // Global valid (default) lifetime value.
         "valid-lifetime": 6000,
 
+        // Global min valid lifetime value.
+        "min-valid-lifetime": 4000,
+
+        // Global max valid lifetime value.
+        "max-valid-lifetime": 8000,
+
+        // Reservations (examples are in other files).
+        "reservations": [],
+
         // Configuration control (currently not used, i.e. this syntax
         // is already defined but corresponding feature is not implemented).
         "config-control":
                     // Type of the database, e.g. "mysql", "postgresql", "cql".
                     "type": "mysql"
                 }
-            ]
+            ],
+            // Intervals between attempts to fetch configuration updates
+            // via the configuration backends used.
+            "config-fetch-wait-time": 30
         },
 
         // Server tag.
             // Queue type was mandatory.
             "queue-type": "kea-ring4"
         },
-        // Missing: calculate-tee-times, t1-percent, t2-percent
+
+        // Fetches host reservations.
+        "reservation-mode": "all",
+
+        // Global compute T1 and T2 timers.
+        "calculate-tee-times": true,
+
+        // T1 = valid lifetime * .5.
+        "t1-percent": .5,
+
+        // T2 = valid lifetime * .75.
+        "t2-percent": .75,
+
+        // String of zero or more characters with which to replace each
+        // invalid character in the hostname or Client FQDN. The default
+        // value is an empty string which will cause invalid characters
+        // to be omitted rather than replaced.
+       "hostname-char-replacement": "x",
+
+        // Regular expression describing the invalid character set in
+        // the hostname or Client FQDN.
+        "hostname-char-set": "[^A-Za-z0-9.-]",
 
         // List of loggers used by the servers using this configuration file.
         "loggers": [
index 4c8f2a7ace3a451e8cc412089e54c3fbd5d32dcd..9e38763ab116164227c2e13e384ed40325ca7ad1 100644 (file)
@@ -6,8 +6,8 @@
 // list of parameters supported by Kea DHCPv6 server along with the brief
 // description of each parameter.
 //
-// This stable version is used for YANG as we do not want to update code
-// and models each time a keyword is added to the syntax.
+// This current version should be up to date, i.e. new keywords should be
+// added in this file at the same time than in the syntax.
 {
     // Kea DHCPv6 server configuration begins here.
     "Dhcp6": {
 
                 // User name to be used to access the database.
                 "user": "kea"
+            },
+            {
+                // Name of the database to connect to.
+                "name": "kea",
+
+                // Host on which the database resides.
+                "host": "localhost",
+
+                // Database password.
+                "password": "kea",
+
+                // Port on which the database is available.
+                "port": 5432,
+
+                // Type of the database, e.g. "mysql", "postgresql", "cql".
+                "type": "postgresql",
+
+                // User name to be used to access the database.
+                "user": "kea"
+            },
+            {
+                // Name of the database to connect to.
+                "keyspace": "kea",
+
+                // Host on which the database resides.
+                "contact-points": "127.0.0.1",
+
+                // Database password.
+                "password": "kea",
+
+                // Port on which the database is available.
+                "port": 9042,
+
+                // Type of the database, e.g. "mysql", "postgresql", "cql".
+                "type": "cql",
+
+                // User name to be used to access the database.
+                "user": "kea",
+
+                // Consistency level for all queries.
+                // Supported values: any, one, two, three, quorum, all,
+                // local-quorum, each-quorum, serial, local-serial, local-one.
+                "consistency": "quorum",
+
+                // Serial consistency level for all queries.
+                // Supported values: any, one, two, three, quorum, all,
+                // local-quorum, each-quorum, serial, local-serial, local-one.
+                "serial-consistency": "serial",
+
+                // Connection reconnect wait time.
+                "reconnect-wait-time": 100,
+
+                // Connection connect timeout.
+                "connect-timeout": 100,
+
+                // Connection request timeout.
+                "request-timeout": 100,
+
+                // Connection tcp keepalive.
+                "tcp-keepalive": 100,
+
+                // Connection tcp nodelay.
+                "tcp-nodelay": true
             }
         ],
 
             }
         ],
 
-        // Global value of the preferred lifetime.
+        // Global (default) value of the preferred lifetime.
         "preferred-lifetime": 50,
 
+        // Global min value of the preferred lifetime.
+        "min-preferred-lifetime": 40,
+
+        // Global max value of the preferred lifetime.
+        "max-preferred-lifetime": 60,
+
         // Global value for the rebind timer, i.e. the time after which the
         // DHCP client enters rebind state if it fails to renew the lease.
         "rebind-timer": 40,
                 // List of shared network specific DHCP options.
                 "option-data": [],
 
-                // Shared network specific preferred lifetime.
+                // Shared network specific (default) preferred lifetime.
                 "preferred-lifetime": 2000,
 
+                // Shared network specific min preferred lifetime.
+                "min-preferred-lifetime": 1500,
+
+                // Shared network specific ma xpreferred lifetime.
+                "max-preferred-lifetime": 2500,
+
                 // Boolen flag indicating if the server can respond to
                 // a Solicit message including a Rapid Commit option with
                 // the Reply message (See DHCPv6 rapid commit).
                 // Shared network level renew timer.
                 "renew-timer": 31,
 
+                // Shared network level compute T1 and T2 timers.
+                "calculate-tee-times": true,
+
+                // T1 = valid lifetime * .5.
+                "t1-percent": .5,
+
+                // T2 = valid lifetime * .75.
+                "t2-percent": .75,
+
                 // Enumeration specifying server's mode of operation when it
                 // fetches host reservations.
                 "reservation-mode": "all",
                         // clients.
                         "pd-pools": [
                             {
+                                // Restricts this prefix pool to be used only for the client
+                                // requests belonging to a particular client class.
                                 "client-class": "phones_server1",
+
+                                // Length of prefixes delegated to clients.
                                 "delegated-len": 64,
+
+                                // Excluded prefix (address) from client assignments.
                                 "excluded-prefix": "2001:db8::",
+
+                                // Excluded prefix (length) from client assignments.
                                 "excluded-prefix-len": 48,
+
+                                // Prefix pool level list of DHCP options.
                                 "option-data": [],
+
+                                // Prefix range (address) used for client assignments.
                                 "prefix": "2001:db8::",
+
+                                // Prefix range (length) used for client assignments.
                                 "prefix-len": 40,
+
+                                // List of client classes which must be evaluated
+                                // when this prefix pool is selected for client assignments.
                                 "require-client-classes": []
                             }
                         ],
                             }
                         ],
 
-                        // Subnet specific preferred lifetime.
+                        // Subnet specific (default) preferred lifetime.
                         "preferred-lifetime": 2000,
 
+                        // Subnet specific min preferred lifetime.
+                        "min-preferred-lifetime": 1500,
+
+                        // Subnet specific max referred lifetime.
+                        "max-preferred-lifetime": 2500,
+
                         // Boolen flag indicating if the server can respond to
                         // a Solicit message including a Rapid Commit option with
                         // the Reply message (See DHCPv6 rapid commit).
                         // fetches host reservations.
                         "reservation-mode": "all",
 
+                        // Subnet level compute T1 and T2 timers.
+                        "calculate-tee-times": true,
+
+                        // T1 = valid lifetime * .5.
+                        "t1-percent": .5,
+
+                        // T2 = valid lifetime * .75.
+                        "t2-percent": .75,
+
                         // List of static IPv6 reservations assigned to the clients belonging
                         // to this subnet. For detailed example see reservations.json.
                         "reservations": [
                         // Subnet prefix.
                         "subnet": "2001:db8::/32",
 
-                        // Subnet level valid lifetime.
-                        "valid-lifetime": 6000
+                        // Subnet level (default) valid lifetime.
+                        "valid-lifetime": 6000,
+
+                        // Subnet level min valid lifetime.
+                        "min-valid-lifetime": 4000,
+
+                        // Subnet level max valid lifetime.
+                        "max-valid-lifetime": 8000
                     }
                 ],
 
-                // Shared network level valid lifetime.
-                "valid-lifetime": 6001
+                // Shared network level (default) valid lifetime.
+                "valid-lifetime": 6001,
+
+                // Shared network level min valid lifetime.
+                "min-valid-lifetime": 4001,
+
+                // Shared network level max valid lifetime.
+                "max-valid-lifetime": 8001
             }
         ],
 
         // List of IPv6 subnets which don't belong to any shared network.
         "subnet6": [],
 
-        // Global valid lifetime value.
+        // Global (default) valid lifetime value.
         "valid-lifetime": 6000,
 
+        // Global min valid lifetime value.
+        "min-valid-lifetime": 4000,
+
+        // Global max valid lifetime value.
+        "max-valid-lifetime": 8000,
+
+        // Reservations (examples are in other files).
+        "reservations": [],
+
         // Configuration control (currently not used, i.e. this syntax
         // is already defined but corresponding feature is not implemented).
         "config-control":
                     // Type of the database, e.g. "mysql", "postgresql", "cql".
                     "type": "mysql"
                 }
-            ]
+            ],
+            // Intervals between attempts to fetch configuration updates
+            // via the configuration backends used.
+            "config-fetch-wait-time": 30
         },
 
         // Server tag.
             "queue-type": "kea-ring6"
         },
 
+        // Fetches host reservations.
+        "reservation-mode": "all",
+
+        // Data directory.
+        "data-directory": "/tmp",
+
+        // Global compute T1 and T2 timers.
+        "calculate-tee-times": true,
+
+        // T1 = valid lifetime * .5.
+        "t1-percent": .5,
+
+        // T2 = valid lifetime * .75.
+        "t2-percent": .75,
+
+        // String of zero or more characters with which to replace each
+        // invalid character in the hostname or Client FQDN. The default
+        // value is an empty string which will cause invalid characters
+        // to be omitted rather than replaced.
+        "hostname-char-replacement": "x",
+
+        // Regular expression describing the invalid character set in
+        // the hostname or Client FQDN.
+        "hostname-char-set": "[^A-Za-z0-9.-]",
+
         // List of loggers used by the servers using this configuration file.
         "loggers": [
             {
index 14ee74cdc4e5ab428992d8e0ec23ae6ebfe5abbe..f47368ca1761abe61e6093f5d210d03a80e1ea19 100644 (file)
@@ -162,10 +162,13 @@ TEST(TranslatorBasicTest, valueFrom) {
     EXPECT_EQ("foobar", elem->stringValue());
     elem.reset();
 
-    // Unknown / unsupported.
+    // Decimal 64.
     double d64(.1234);
     s_val.reset(new Val(d64));
-    EXPECT_THROW(TranslatorBasic::value(s_val), NotImplemented);
+    EXPECT_NO_THROW(elem = TranslatorBasic::value(s_val));
+    ASSERT_TRUE(elem);
+    ASSERT_EQ(Element::real, elem->getType());
+    EXPECT_DOUBLE_EQ(d64, elem->doubleValue());
 }
 
 // Test basic yang value to JSON using sysrepo test models.
@@ -373,7 +376,10 @@ TEST(TranslatorBasicTest, getItem) {
     xpath = "/keatest-module:main/dec64";
     s_val.reset(new Val(9.85));
     EXPECT_NO_THROW(sess->set_item(xpath.c_str(), s_val));
-    EXPECT_THROW(elem = t_obj->getItem(xpath), NotImplemented);
+    EXPECT_NO_THROW(elem = t_obj->getItem(xpath));
+    ASSERT_TRUE(elem);
+    ASSERT_EQ(Element::real, elem->getType());
+    EXPECT_EQ("9.85", elem->str());
     elem.reset();
 
     // Not found.
@@ -501,9 +507,13 @@ TEST(TranslatorBasicTest, valueTo) {
     EXPECT_EQ("Zm9vYmFy", string(s_val->data()->get_binary()));
     s_val.reset();
 
-    // Unknown / unsupported.
-    elem = Element::create(.1234);
-    EXPECT_THROW(TranslatorBasic::value(elem, SR_DECIMAL64_T), NotImplemented);
+    // Decimal 64.
+    double d64(.1234);
+    elem = Element::create(d64);
+    EXPECT_NO_THROW(s_val = TranslatorBasic::value(elem, SR_DECIMAL64_T));
+    ASSERT_TRUE(s_val);
+    EXPECT_DOUBLE_EQ(d64, s_val->data()->get_decimal64());
+    s_val.reset();
 }
 
 // Test JSON to  basic yang value using sysrepo test models.
@@ -641,6 +651,17 @@ TEST(TranslatorBasicTest, setItem) {
     EXPECT_EQ("Zm9vYmFy", string(s_val->data()->get_binary()));
     s_val.reset();
 
+    // Decimal 64.
+    xpath = "/keatest-module:main/dec64";
+    double d64(9.85);
+    elem = Element::create(d64);
+    EXPECT_NO_THROW(t_obj->setItem(xpath, elem, SR_DECIMAL64_T));
+    EXPECT_NO_THROW(s_val = sess->get_item(xpath.c_str()));
+    ASSERT_TRUE(s_val);
+    ASSERT_EQ(SR_DECIMAL64_T, s_val->type());
+    EXPECT_DOUBLE_EQ(d64, s_val->data()->get_decimal64());
+    s_val.reset();
+
     // Leaf-list.
     xpath = "/keatest-module:main/numbers";
     S_Vals s_vals;
@@ -666,11 +687,6 @@ TEST(TranslatorBasicTest, setItem) {
     EXPECT_FALSE(s_vals);
     s_vals.reset();
 
-    // Unknown / unsupported.
-    xpath = "/keatest-module:main/dec64";
-    elem = Element::create(9.85);
-    EXPECT_THROW(t_obj->setItem(xpath, elem, SR_DECIMAL64_T), NotImplemented);
-
     // Bad xpath.
     xpath = "/keatest-module:main/no_such_string";
     elem = Element::create(string("str"));
index aa5cc0ec5b869965ac80f4b777a47eccb45b4569..3cac6fa6b0d102489809d57c3acd1f5a842fedf1 100644 (file)
@@ -48,11 +48,10 @@ TranslatorBasic::~TranslatorBasic() {
 }
 
 ElementPtr
-
 #ifndef HAVE_PRE_0_7_6_SYSREPO
-    TranslatorBasic::value(sysrepo::S_Val s_val) {
+TranslatorBasic::value(sysrepo::S_Val s_val) {
 #else
-    TranslatorBasic::value(S_Val s_val) {
+TranslatorBasic::value(S_Val s_val) {
 #endif
     if (!s_val) {
         isc_throw(BadValue, "value called with null");
@@ -90,6 +89,9 @@ ElementPtr
     case SR_INT32_T:
         return (Element::create(static_cast<long long>(s_val->data()->get_int32())));
 
+    case SR_DECIMAL64_T:
+        return (Element::create(s_val->data()->get_decimal64()));
+
     case SR_IDENTITYREF_T:
         return (Element::create(string(s_val->data()->get_identityref())));
 
@@ -258,6 +260,13 @@ TranslatorBasic::value(ConstElementPtr elem, sr_type_t type) {
 #endif
         break;
 
+    case SR_DECIMAL64_T:
+        if (elem->getType() != Element::real) {
+            isc_throw(BadValue, "value for a real called with not a real");
+        }
+        s_val.reset(new Val(elem->doubleValue()));
+        break;
+
     case SR_BINARY_T:
         if (elem->getType() != Element::string) {
             isc_throw(BadValue,
index 7f0c21c41567ee92d870ecef04e80fb391fec3c3..898d662e814c00c181bdbff7bbd67ea607140603 100644 (file)
@@ -191,6 +191,7 @@ TranslatorConfig::getDdnsKea(const std::string& xpath) {
 ElementPtr
 TranslatorConfig::getConfigControlKea(const string& xpath) {
     ElementPtr config_ctrl = Element::createMap();
+    getParam(config_ctrl, xpath, "config-fetch-wait-time");
     ConstElementPtr databases = getDatabases(xpath + "/config-database");
     if (databases && !databases->empty()) {
         config_ctrl->set("config-databases", databases);
@@ -209,9 +210,16 @@ TranslatorConfig::getServerKeaDhcpCommon(const string& xpath) {
     ElementPtr result = Element::createMap();
 
     getParam(result, xpath, "valid-lifetime");
+    getParam(result, xpath, "min-valid-lifetime");
+    getParam(result, xpath, "max-valid-lifetime");
     getParam(result, xpath, "renew-timer");
     getParam(result, xpath, "rebind-timer");
+    getParam(result, xpath, "calculate-tee-times");
+    getParam(result, xpath, "t1-percent");
+    getParam(result, xpath, "t2-percent");
     getParam(result, xpath, "decline-probation-period");
+    getParam(result, xpath, "hostname-char-set");
+    getParam(result, xpath, "hostname-char-replacement");
 
     ConstElementPtr networks = getSharedNetworks(xpath);
     if (networks && !networks->empty()) {
@@ -335,7 +343,10 @@ TranslatorConfig::getServerKeaDhcp6() {
     string xpath = "/kea-dhcp6-server:config";
     ElementPtr result = getServerKeaDhcpCommon(xpath);
     // Handle DHCPv6 specific global parameters.
+    getParam(result, xpath, "data-directory");
     getParam(result, xpath, "preferred-lifetime");
+    getParam(result, xpath, "min-preferred-lifetime");
+    getParam(result, xpath, "max-preferred-lifetime");
     // Handle subnets.
     ConstElementPtr subnets = getSubnets(xpath);
     if (subnets && !subnets->empty()) {
@@ -468,6 +479,14 @@ TranslatorConfig::setServerKeaDhcpCommon(const string& xpath,
     if (valid) {
         setItem(xpath + "/valid-lifetime", valid, SR_UINT32_T);
     }
+    ConstElementPtr min_valid = elem->get("min-valid-lifetime");
+    if (min_valid) {
+        setItem(xpath + "/min-valid-lifetime", min_valid, SR_UINT32_T);
+    }
+    ConstElementPtr max_valid = elem->get("max-valid-lifetime");
+    if (max_valid) {
+        setItem(xpath + "/max-valid-lifetime", max_valid, SR_UINT32_T);
+    }
     ConstElementPtr renew = elem->get("renew-timer");
     if (renew) {
         setItem(xpath + "/renew-timer", renew, SR_UINT32_T);
@@ -476,6 +495,18 @@ TranslatorConfig::setServerKeaDhcpCommon(const string& xpath,
     if (rebind) {
         setItem(xpath + "/rebind-timer", rebind, SR_UINT32_T);
     }
+    ConstElementPtr calculate = elem->get("calculate-tee-times");
+    if (calculate) {
+        setItem(xpath + "/calculate-tee-times", calculate, SR_BOOL_T);
+    }
+    ConstElementPtr t1_percent =  elem->get("t1-percent");
+    if (t1_percent) {
+        setItem(xpath + "/t1-percent", t1_percent, SR_DECIMAL64_T);
+    }
+    ConstElementPtr t2_percent =  elem->get("t2-percent");
+    if (t2_percent) {
+        setItem(xpath + "/t2-percent", t2_percent, SR_DECIMAL64_T);
+    }
     ConstElementPtr period = elem->get("decline-probation-period");
     if (period) {
         setItem(xpath + "/decline-probation-period", period, SR_UINT32_T);
@@ -581,6 +612,14 @@ TranslatorConfig::setServerKeaDhcpCommon(const string& xpath,
     if (socket) {
         setControlSocket(xpath + "/control-socket", socket);
     }
+    ConstElementPtr char_set = elem->get("hostname-char-set");
+    if (char_set) {
+        setItem(xpath + "/hostname-char-set", char_set, SR_STRING_T);
+    }
+    ConstElementPtr char_repl = elem->get("hostname-char-replacement");
+    if (char_repl) {
+        setItem(xpath + "/hostname-char-replacement", char_repl, SR_STRING_T);
+    }
     ConstElementPtr ddns = elem->get("dhcp-ddns");
     if (ddns) {
         ConstElementPtr enable = ddns->get("enable-updates");
@@ -679,6 +718,11 @@ TranslatorConfig::setServerKeaDhcpCommon(const string& xpath,
     }
     ConstElementPtr config_ctrl = elem->get("config-control");
     if (config_ctrl && !config_ctrl->empty()) {
+        ConstElementPtr cfwt = config_ctrl->get("config-fetch-wait-time");
+        if (cfwt) {
+            setItem(xpath + "/config-control/config-fetch-wait-time", cfwt,
+                    SR_UINT32_T);
+        }
         databases = config_ctrl->get("config-databases");
         if (databases && !databases->empty()) {
             setDatabases(xpath + "/config-control/config-database", databases);
@@ -767,10 +811,22 @@ void
 TranslatorConfig::setServerKeaDhcp6(ConstElementPtr elem) {
     string xpath = "/kea-dhcp6-server:config";
     setServerKeaDhcpCommon(xpath, elem);
+    ConstElementPtr data_dir = elem->get("data-directory");
+    if (data_dir) {
+        setItem(xpath + "/data-directory", data_dir, SR_STRING_T);
+    }
     ConstElementPtr preferred = elem->get("preferred-lifetime");
     if (preferred) {
         setItem(xpath + "/preferred-lifetime", preferred, SR_UINT32_T);
     }
+    ConstElementPtr min_pref = elem->get("min-preferred-lifetime");
+    if (min_pref) {
+        setItem(xpath + "/min-preferred-lifetime", min_pref, SR_UINT32_T);
+    }
+    ConstElementPtr max_pref = elem->get("max-preferred-lifetime");
+    if (max_pref) {
+        setItem(xpath + "/max-preferred-lifetime", max_pref, SR_UINT32_T);
+    }
     ConstElementPtr subnets = elem->get("subnet6");
     if (subnets) {
         setSubnets(xpath, subnets);
index 361e51563b3825e282de5abb54c86549bee1ffa5..bb3290649f097017fe0c3db0a578977d970acb11 100644 (file)
@@ -27,8 +27,13 @@ namespace yang {
 /// @code
 /// "Dhcp4": {
 ///     "valid-lifetime": <valid lifetime>,
+///     "min-valid-lifetime": <minimum valid lifetime>,
+///     "max-valid-lifetime": <maximum valid lifetime>,
 ///     "renew-timer": <renew timer>,
 ///     "rebind-timer": <rebind timer>,
+///     "calculate-tee-times": <calculate T1/T2 times>,
+///     "t1-percent": <T1 percent>,
+///     "t2-percent": <T2 percent>,
 ///     "decline-probation-period": <decline probation period>,
 ///     "subnet4": [ <list of subnet4> ],
 ///     <shared-networks>,
@@ -45,6 +50,8 @@ namespace yang {
 ///     <expired-leases-processing>,
 ///     <dhcp4o6-port>,
 ///     <control-socket>,
+///     <hostname-char-set": <hostname character set>,
+///     <hostname-char-replacement": <hostname character replacement>,
 ///     <dhcp-ddns>,
 ///     "echo-client-id": <echo client id flag>,
 ///     "match-client-id": <match client id flag>,
@@ -67,8 +74,13 @@ namespace yang {
 /// YANG syntax for kea-dhcp4-server:config is:
 /// @code
 /// +--rw valid-lifetime?                uint32
+/// +--rw min-valid-lifetime?            uint32
+/// +--rw max-valid-lifetime?            uint32
 /// +--rw renew-timer?                   uint32
 /// +--rw rebind-timer?                  uint32
+/// +--rw calculate-tee-times?           boolean
+/// +--rw t1-percent?                    decimal64
+/// +--rw t2-percent?                    decimal64
 /// +--rw decline-probation-period?      uint32
 /// +--rw subnet4*
 /// +--rw shared-network*
@@ -90,6 +102,8 @@ namespace yang {
 /// +--rw expired-leases-processing      <expired-leases-processing>
 /// +--rw dhcp4o6-port?                  uint16
 /// +--rw control-socket!                <control-socket>
+/// +--rw hostname-char-set?             string
+/// +--rw hostname-char-replacement?     string
 /// +--rw dhcp-ddns                      <dhcp-ddns>
 /// +--rw echo-client-id?                boolean
 /// +--rw match-client-id?               boolean
@@ -103,6 +117,7 @@ namespace yang {
 /// +--rw reservation-mode?              enumeration
 /// +--rw host*
 /// +--rw config-control
+///    +--rw config-fetch-wait-time?     uint32
 ///    +--rw config-database*
 /// +--rw server-tag                     string
 /// +--rw dhcp-queue-control             string
@@ -164,10 +179,18 @@ namespace yang {
 /// JSON syntax for kea-dhcp6 is:
 /// @code
 /// "Dhcp6": {
+///     "data-directory": <data directory>,
 ///     "preferred-lifetime": <preferred lifetime>,
+///     "min-preferred-lifetime": <minimum preferred lifetime>,
+///     "max-preferred-lifetime": <maximum preferred lifetime>,
 ///     "valid-lifetime": <valid lifetime>,
+///     "min-valid-lifetime": <minimum valid lifetime>,
+///     "max-valid-lifetime": <maximum valid lifetime>,
 ///     "renew-timer": <renew timer>,
 ///     "rebind-timer": <rebind timer>,
+///     "calculate-tee-times": <calculate T1/T2 times>,
+///     "t1-percent": <T1 percent>,
+///     "t2-percent": <T2 percent>,
 ///     "decline-probation-period": <decline probation period>,
 ///     "subnet6": [ <list of subnet6> ],
 ///     <shared-networks>,
@@ -187,6 +210,8 @@ namespace yang {
 ///     <server-id>,
 ///     <dhcp4o6-port>,
 ///     <control-socket>,
+///     <hostname-char-set": <hostname character set>,
+///     <hostname-char-replacement": <hostname character replacement>,
 ///     <dhcp-ddns>,
 ///     <user-context>,
 ///     <comment>
@@ -202,10 +227,18 @@ namespace yang {
 ///
 /// YANG syntax for kea-dhcp6-server:config is:
 /// @code
+/// +--rw data-directory?                string
 /// +--rw preferred-lifetime?            uint32
+/// +--rw min-preferred-lifetime?        uint32
+/// +--rw max-preferred-lifetime?        uint32
 /// +--rw valid-lifetime?                uint32
+/// +--rw min-valid-lifetime?            uint32
+/// +--rw max-valid-lifetime?            uint32
 /// +--rw renew-timer?                   uint32
 /// +--rw rebind-timer?                  uint32
+/// +--rw calculate-tee-times?           boolean
+/// +--rw t1-percent?                    decimal64
+/// +--rw t2-percent?                    decimal64
 /// +--rw decline-probation-period?      uint32
 /// +--rw subnet6*
 /// +--rw shared-network*
@@ -228,6 +261,8 @@ namespace yang {
 /// +--rw server-id                      <server-id>
 /// +--rw dhcp4o6-port?                  uint16
 /// +--rw control-socket!                <control-socket>
+/// +--rw hostname-char-set?             string
+/// +--rw hostname-char-replacement?     string
 /// +--rw dhcp-ddns                      <dhcp-ddns>
 /// +--rw echo-client-id?                boolean
 /// +--rw user-context?                  string
@@ -236,6 +271,7 @@ namespace yang {
 /// +--rw reservation-mode?              enumeration
 /// +--rw host*
 /// +--rw config-control
+///    +--rw config-fetch-wait-time?     uint32
 ///    +--rw config-database*
 /// +--rw server-tag                     string
 /// +--rw dhcp-queue-control             string
index 0ee964af657fce19e45f0fb5c4bd0703e11a6585..236d17bdd6f5b86844b0334a165b15a61d10e255 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 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
@@ -65,7 +65,7 @@ namespace yang {
 /// Supports the following models:
 /// - kea-dhcp4-server
 /// - kea-dhcp6-server
-/// - kea-dhcp-ddns (not yet supported by the server itself)
+/// - kea-dhcp-ddns
 /// - kea-ctrl-agent
 class TranslatorControlSocket : virtual public TranslatorBasic {
 public:
index deed8c8f688f6e92300ccbfa21535a6e63451777..b12bec428035b56b4b35d191c229468b2a96739c 100644 (file)
@@ -115,6 +115,14 @@ TranslatorDatabase::getDatabaseKea(const string& xpath) {
     if (nodelay) {
         result->set("tcp-nodelay", nodelay);
     }
+    ConstElementPtr consistency = getItem(xpath + "/consistency");
+    if (consistency) {
+        result->set("consistency", consistency);
+    }
+    ConstElementPtr serial_consistency = getItem(xpath + "/serial-consistency");
+    if (serial_consistency) {
+        result->set("serial-consistency", serial_consistency);
+    }
     ConstElementPtr context = getItem(xpath + "/user-context");
     if (context) {
         result->set("user-context", Element::fromJSON(context->stringValue()));
@@ -221,6 +229,14 @@ TranslatorDatabase::setDatabaseKea(const string& xpath,
     if (nodelay) {
         setItem(xpath + "/tcp-nodelay", nodelay, SR_BOOL_T);
     }
+    ConstElementPtr consistency = elem->get("consistency");
+    if (consistency) {
+        setItem(xpath + "/consistency", consistency, SR_STRING_T);
+    }
+    ConstElementPtr serial_consistency = elem->get("serial-consistency");
+    if (serial_consistency) {
+        setItem(xpath + "/serial-consistency", serial_consistency, SR_STRING_T);
+    }
     ConstElementPtr context = Adaptor::getContext(elem);
     if (context) {
         setItem(xpath + "/user-context", Element::create(context->str()),
index a33da13dbcca59da065a5afc7b279f867f22d4cc..aa6442c3900f4ca6ccba5c97ecf04e094cc3c132 100644 (file)
@@ -35,6 +35,8 @@ namespace yang {
 ///     "request-timeout": <request timeout>,
 ///     "tcp-keepalive": <TCP keepalive>,
 ///     "tcp-nodelay": <TCP nodelay flag>,
+///     "consistency": <consistency level>,
+///     "serial-consistency": <serial consistency level>,
 ///     "user-context": { <json map> },
 ///     "comment": <comment>
 /// }
@@ -61,6 +63,8 @@ namespace yang {
 ///    +--rw request-timeout?      uint32
 ///    +--rw tcp-keepalive?        uint32
 ///    +--rw tcp-nodelay?          boolean
+///    +--rw consistency?          string
+///    +--rw serial-consistency?   string
 ///    +--rw user-context?         string
 /// @endcode
 ///
index 69984c3319b53a41e271a27058acc15d8e2a1239..fe9fc71c23eb699a39d5ac88f03bebd8d3321ee9 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 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
@@ -37,8 +37,7 @@ namespace yang {
 /// }
 /// @endcode
 ///
-/// YANG syntax for kea-logging is with name as the logger list key and
-/// output as the output option list key.
+/// YANG syntax for loggers is:
 /// @code
 ///  +--rw logger               (list)
 ///     |
@@ -150,14 +149,14 @@ protected:
     void setOutputOptions(const std::string& xpath,
                           isc::data::ConstElementPtr elem);
 
-    /// @brief getLogger JSON for kea-logging.
+    /// @brief getLogger JSON for loggers.
     ///
     /// @param xpath The xpath of the logger.
     /// @return JSON representation of the logger.
     /// @throw SysrepoError when sysrepo raises an error.
     isc::data::ElementPtr getLoggerKea(const std::string& xpath);
 
-    /// @brief setLogger for kea-logging.
+    /// @brief setLogger for loggers.
     ///
     /// @param xpath The xpath of the logger.
     /// @param elem The JSON element.
@@ -200,14 +199,14 @@ public:
                       isc::data::ConstElementPtr elem);
 
 protected:
-    /// @brief getLoggers JSON for kea-logging.
+    /// @brief getLoggers JSON for loggers.
     ///
     /// @param xpath The xpath of loggers.
     /// @return JSON representation of  loggers.
     /// @throw SysrepoError when sysrepo raises an error.
     isc::data::ElementPtr getLoggersKea(const std::string& xpath);
 
-    /// @brief setLoggers for kea-logging.
+    /// @brief setLoggers for loggers.
     ///
     /// @param xpath The xpath of loggers.
     /// @param elem The JSON element.
index fe4a89d0326bffbd41a97119cdcb50e818e90c30..0f2fa7530eb36510b9a2a4fe24703119e2b2cf2d 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 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
index 73644f581d5f8e7e8b19b93cbbc7fc6dc55fc3a7..9ba195f7619ffdc2e2bb75da831ea03e29ba195a 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 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
@@ -74,11 +74,27 @@ TranslatorSharedNetwork::getSharedNetworkKea(const string& xpath,
         if (preferred) {
             result->set("preferred-lifetime", preferred);
         }
+        ConstElementPtr min_pref = getItem(xpath + "/min-preferred-lifetime");
+        if (min_pref) {
+            result->set("min-preferred-lifetime", min_pref);
+        }
+        ConstElementPtr max_pref = getItem(xpath + "/max-preferred-lifetime");
+        if (max_pref) {
+            result->set("max-preferred-lifetime", max_pref);
+        }
     }
     ConstElementPtr valid = getItem(xpath + "/valid-lifetime");
     if (valid) {
         result->set("valid-lifetime", valid);
     }
+    ConstElementPtr min_valid = getItem(xpath + "/min-valid-lifetime");
+    if (min_valid) {
+        result->set("min-valid-lifetime", min_valid);
+    }
+    ConstElementPtr max_valid = getItem(xpath + "/max-valid-lifetime");
+    if (max_valid) {
+        result->set("max-valid-lifetime", max_valid);
+    }
     ConstElementPtr renew = getItem(xpath + "/renew-timer");
     if (renew) {
         result->set("renew-timer", renew);
@@ -87,6 +103,18 @@ TranslatorSharedNetwork::getSharedNetworkKea(const string& xpath,
     if (rebind) {
         result->set("rebind-timer", rebind);
     }
+    ConstElementPtr calculate = getItem(xpath + "/calculate-tee-times");
+    if (calculate) {
+        result->set("calculate-tee-times", calculate);
+    }
+    ConstElementPtr t1_percent = getItem(xpath + "/t1-percent");
+    if (t1_percent) {
+        result->set("t1-percent", t1_percent);
+    }
+    ConstElementPtr t2_percent = getItem(xpath + "/t2-percent");
+    if (t2_percent) {
+        result->set("t2-percent", t2_percent);
+    }
     ConstElementPtr options = getOptionDataList(xpath);
     if (options && (options->size() > 0)) {
         result->set("option-data", options);
@@ -186,11 +214,27 @@ TranslatorSharedNetwork::setSharedNetworkKea(const string& xpath,
         if (preferred) {
             setItem(xpath + "/preferred-lifetime", preferred, SR_UINT32_T);
         }
+        ConstElementPtr min_pref = elem->get("min-preferred-lifetime");
+        if (min_pref) {
+            setItem(xpath + "/min-preferred-lifetime", min_pref, SR_UINT32_T);
+        }
+        ConstElementPtr max_pref = elem->get("max-preferred-lifetime");
+        if (max_pref) {
+            setItem(xpath + "/max-preferred-lifetime", max_pref, SR_UINT32_T);
+        }
     }
     ConstElementPtr valid = elem->get("valid-lifetime");
     if (valid) {
         setItem(xpath + "/valid-lifetime", valid, SR_UINT32_T);
     }
+    ConstElementPtr min_valid = elem->get("min-valid-lifetime");
+    if (min_valid) {
+        setItem(xpath + "/min-valid-lifetime", min_valid, SR_UINT32_T);
+    }
+    ConstElementPtr max_valid = elem->get("max-valid-lifetime");
+    if (max_valid) {
+        setItem(xpath + "/max-valid-lifetime", max_valid, SR_UINT32_T);
+    }
     ConstElementPtr renew = elem->get("renew-timer");
     if (renew) {
         setItem(xpath + "/renew-timer", renew, SR_UINT32_T);
@@ -199,6 +243,18 @@ TranslatorSharedNetwork::setSharedNetworkKea(const string& xpath,
     if (rebind) {
         setItem(xpath + "/rebind-timer", rebind, SR_UINT32_T);
     }
+    ConstElementPtr calculate = elem->get("calculate-tee-times");
+    if (calculate) {
+        setItem(xpath + "/calculate-tee-times", calculate, SR_BOOL_T);
+    }
+    ConstElementPtr t1_percent =  elem->get("t1-percent");
+    if (t1_percent) {
+        setItem(xpath + "/t1-percent", t1_percent, SR_DECIMAL64_T);
+    }
+    ConstElementPtr t2_percent =  elem->get("t2-percent");
+    if (t2_percent) {
+        setItem(xpath + "/t2-percent", t2_percent, SR_DECIMAL64_T);
+    }
     ConstElementPtr options = elem->get("option-data");
     if (options && (options->size() > 0)) {
         setOptionDataList(xpath, options);
index 15ced6154e825801391bd6a23b171e8d4a6325db..316e9b8bb118b56146f247f2185b6c7db114d1ad 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 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
@@ -22,8 +22,13 @@ namespace yang {
 ///     "name": <name>,
 ///     "subnet4": <subnet list>,
 ///     "valid-lifetime": <valid lifetime>,
+///     "min-valid-lifetime": <minimum valid lifetime>,
+///     "max-valid-lifetime": <maximum valid lifetime>,
 ///     "renew-timer": <renew timer>,
 ///     "rebind-timer": <rebind timer>,
+///     "calculate-tee-times": <calculate T1/T2 times>,
+///     "t1-percent": <T1 percent>,
+///     "t2-percent": <T2 percent>,
 ///     "option-data": [ <list of option data> ],
 ///     "interface": "<interface>",
 ///     "client-class": "<guard class name>",
@@ -46,9 +51,16 @@ namespace yang {
 ///     "name": <name>,
 ///     "subnet6": <subnet list>,
 ///     "preferred-lifetime": <preferred lifetime>,
+///     "min-preferred-lifetime": <minimum preferred lifetime>,
+///     "max-preferred-lifetime": <maximum preferred lifetime>,
 ///     "valid-lifetime": <valid lifetime>,
+///     "min-valid-lifetime": <minimum valid lifetime>,
+///     "max-valid-lifetime": <maximum valid lifetime>,
 ///     "renew-timer": <renew timer>,
 ///     "rebind-timer": <rebind timer>,
+///     "calculate-tee-times": <calculate T1/T2 times>,
+///     "t1-percent": <T1 percent>,
+///     "t2-percent": <T2 percent>,
 ///     "option-data": [ <list of option data> ],
 ///     "interface": "<interface>",
 ///     "interface-id": "<interface id>",
@@ -66,8 +78,13 @@ namespace yang {
 /// @code
 ///  +--rw name                      string
 ///  +--rw valid-lifetime?           uint32
+///  +--rw min-valid-lifetime?       uint32
+///  +--rw max-valid-lifetime?       uint32
 ///  +--rw renew-timer?              uint32
 ///  +--rw rebind-timer?             uint32
+///  +--rw calculate-tee-times?      boolean
+///  +--rw t1-percent?               decimal64
+///  +--rw t2-percent?               decimal64
 ///  +--rw option-data*
 ///  +--rw interface?                string
 ///  +--rw client-class?             string
@@ -85,6 +102,8 @@ namespace yang {
 ///  (DHCPv6 only)
 ///  +--rw subnet6*
 ///  +--rw preferred-lifetime?       uint32
+///  +--rw min-preferred-lifetime?   uint32
+///  +--rw max-preferred-lifetime?   uint32
 ///  +--rw interface-id?             string
 ///  +--rw rapid-commit?             boolean
 /// @endcode
index 315a6010d9f6f364527933adceacd2e8e116f9b7..1d8ac030b745726afd9f7d1be8c01e9a3bf4cb36 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 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
@@ -99,12 +99,29 @@ TranslatorSubnet::getSubnetKea(const string& xpath) {
         if (preferred) {
             result->set("preferred-lifetime", preferred);
         }
+        ConstElementPtr min_pref = getItem(xpath + "/min-preferred-lifetime");
+        if (min_pref) {
+            result->set("min-preferred-lifetime", min_pref);
+        }
+        ConstElementPtr max_pref = getItem(xpath + "/max-preferred-lifetime");
+        if (max_pref) {
+            result->set("max-preferred-lifetime", max_pref);
+        }
     }
     ConstElementPtr valid = getItem(xpath + "/valid-lifetime");
     if (valid) {
         result->set("valid-lifetime", valid);
     }
+    ConstElementPtr min_valid = getItem(xpath + "/min-valid-lifetime");
+    if (min_valid) {
+        result->set("min-valid-lifetime", min_valid);
+    }
+    ConstElementPtr max_valid = getItem(xpath + "/max-valid-lifetime");
+    if (max_valid) {
+        result->set("max-valid-lifetime", max_valid);
+    }
     ConstElementPtr renew = getItem(xpath + "/renew-timer");
+
     if (renew) {
         result->set("renew-timer", renew);
     }
@@ -112,6 +129,18 @@ TranslatorSubnet::getSubnetKea(const string& xpath) {
     if (rebind) {
         result->set("rebind-timer", rebind);
     }
+    ConstElementPtr calculate = getItem(xpath + "/calculate-tee-times");
+    if (calculate) {
+        result->set("calculate-tee-times", calculate);
+    }
+    ConstElementPtr t1_percent = getItem(xpath + "/t1-percent");
+    if (t1_percent) {
+        result->set("t1-percent", t1_percent);
+    }
+    ConstElementPtr t2_percent = getItem(xpath + "/t2-percent");
+    if (t2_percent) {
+        result->set("t2-percent", t2_percent);
+    }
     ConstElementPtr options = getOptionDataList(xpath);
     if (options && (options->size() > 0)) {
         result->set("option-data", options);
@@ -270,11 +299,27 @@ TranslatorSubnet::setSubnetKea(const string& xpath, ConstElementPtr elem) {
         if (preferred) {
             setItem(xpath + "/preferred-lifetime", preferred, SR_UINT32_T);
         }
+        ConstElementPtr min_pref = elem->get("min-preferred-lifetime");
+        if (min_pref) {
+            setItem(xpath + "/min-preferred-lifetime", min_pref, SR_UINT32_T);
+        }
+        ConstElementPtr max_pref = elem->get("max-preferred-lifetime");
+        if (max_pref) {
+            setItem(xpath + "/max-preferred-lifetime", max_pref, SR_UINT32_T);
+        }
     }
     ConstElementPtr valid = elem->get("valid-lifetime");
     if (valid) {
         setItem(xpath + "/valid-lifetime", valid, SR_UINT32_T);
     }
+    ConstElementPtr min_valid = elem->get("min-valid-lifetime");
+    if (min_valid) {
+        setItem(xpath + "/min-valid-lifetime", min_valid, SR_UINT32_T);
+    }
+    ConstElementPtr max_valid = elem->get("max-valid-lifetime");
+    if (max_valid) {
+        setItem(xpath + "/max-valid-lifetime", max_valid, SR_UINT32_T);
+    }
     ConstElementPtr renew = elem->get("renew-timer");
     if (renew) {
         setItem(xpath + "/renew-timer", renew, SR_UINT32_T);
@@ -283,6 +328,18 @@ TranslatorSubnet::setSubnetKea(const string& xpath, ConstElementPtr elem) {
     if (rebind) {
         setItem(xpath + "/rebind-timer", rebind, SR_UINT32_T);
     }
+    ConstElementPtr calculate = elem->get("calculate-tee-times");
+    if (calculate) {
+        setItem(xpath + "/calculate-tee-times", calculate, SR_BOOL_T);
+    }
+    ConstElementPtr t1_percent =  elem->get("t1-percent");
+    if (t1_percent) {
+        setItem(xpath + "/t1-percent", t1_percent, SR_DECIMAL64_T);
+    }
+    ConstElementPtr t2_percent =  elem->get("t2-percent");
+    if (t2_percent) {
+        setItem(xpath + "/t2-percent", t2_percent, SR_DECIMAL64_T);
+    }
     ConstElementPtr options = elem->get("option-data");
     if (options && (options->size() > 0)) {
         setOptionDataList(xpath, options);
index 7023bec5e5a81c196bb32b41be6c7af369d0355a..e6a2d9872780f3ef2b1c03d9de1f6ce4820e9a94 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 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
@@ -22,8 +22,13 @@ namespace yang {
 /// @code
 /// {
 ///     "valid-lifetime": <valid lifetime>,
+///     "min-valid-lifetime": <minimum valid lifetime>,
+///     "max-valid-lifetime": <maximum valid lifetime>,
 ///     "renew-timer": <renew timer>,
 ///     "rebind-timer": <rebind timer>,
+///     "calculate-tee-times": <calculate T1/T2 times>,
+///     "t1-percent": <T1 percent>,
+///     "t2-percent": <T2 percent>,
 ///     "option-data": [ <list of option data> ],
 ///     "pools": [ <list of pools> ],
 ///     "subnet": "<subnet prefix>",
@@ -51,9 +56,16 @@ namespace yang {
 /// @code
 /// {
 ///     "preferred-lifetime": <preferred lifetime>,
+///     "min-preferred-lifetime": <minimum preferred lifetime>,
+///     "max-preferred-lifetime": <maximum preferred lifetime>,
 ///     "valid-lifetime": <valid lifetime>,
+///     "min-valid-lifetime": <minimum valid lifetime>,
+///     "max-valid-lifetime": <maximum valid lifetime>,
 ///     "renew-timer": <renew timer>,
 ///     "rebind-timer": <rebind timer>,
+///     "calculate-tee-times": <calculate T1/T2 times>,
+///     "t1-percent": <T1 percent>,
+///     "t2-percent": <T2 percent>,
 ///     "option-data": [ <list of option data> ],
 ///     "pools": [ <list of pools> ],
 ///     "pd-pools": [ <list of prefix delegation pools> ],
@@ -87,8 +99,13 @@ namespace yang {
 /// YANG syntax for kea-dhcp[46]-server is with id as the key:
 /// @code
 ///  +--rw valid-lifetime?           uint32
+///  +--rw min-valid-lifetime?       uint32
+///  +--rw max-valid-lifetime?       uint32
 ///  +--rw renew-timer?              uint32
 ///  +--rw rebind-timer?             uint32
+///  +--rw calculate-tee-times?      boolean
+///  +--rw t1-percent?               decimal64
+///  +--rw t2-percent?               decimal64
 ///  +--rw option-data*
 ///  +--rw pool*
 ///  +--rw subnet                    inet:ip-prefix
@@ -111,6 +128,8 @@ namespace yang {
 ///  +--rw authoritative?            boolean
 ///  (DHCPv6 only)
 ///  +--rw preferred-lifetime?       uint32
+///  +--rw min-preferred-lifetime?   uint32
+///  +--rw max-preferred-lifetime?   uint32
 ///  +--rw pd-pool*
 ///  +--rw interface-id?             string
 ///  +--rw rapid-commit?             boolean
index cf619270003016e82dbfeb2b1f41d3299ac3f7b7..d2ee88e97050d324c33a13de5cc0dad1578890f4 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2018 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2018-2019 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
@@ -150,7 +150,6 @@ Those models depend on the following modules:
  - ietf-yang-types
  - ietf-interfaces
  - kea-types
- - kea-logging
  - kea-dhcp-types
 
 Those modules are extracted from the IETF DHCPv6 YANG draft too:
index d3b7b12065c344d0bcc5b094043409bf25f63db9..2aa6b5d3cf0d0cf796c073b6d941c1183778c6ab 100644 (file)
@@ -21,13 +21,12 @@ static const std::map<std::string, std::string> YANG_REVISIONS = {
     { "ietf-dhcpv6-types", "2018-09-04" },
     { "ietf-dhcpv6-options", "2018-09-04" },
     { "ietf-dhcpv6-server", "2018-09-04" },
-    { "kea-types", "2018-11-20" },
-    { "kea-logging", "2018-11-20" },
-    { "kea-dhcp-types", "2018-11-20" },
-    { "kea-dhcp4-server", "2018-11-20" },
-    { "kea-dhcp6-server", "2018-11-20" },
-    { "kea-ctrl-agent", "2018-11-20" },
-    { "kea-dhcp-ddns", "2018-11-20" }
+    { "kea-types", "2019-08-09" },
+    { "kea-dhcp-types", "2019-08-09" },
+    { "kea-dhcp4-server", "2019-08-09" },
+    { "kea-dhcp6-server", "2019-08-09" },
+    { "kea-ctrl-agent", "2019-08-09" },
+    { "kea-dhcp-ddns", "2019-08-09" }
 };
 
 }; // end of namespace isc::yang
index 484389e0f3a677239e47402f402f352f6a5ec258..5ae20063ef3fd2ede3262bb592d4cabcc7a13a6c 100644 (file)
@@ -3,19 +3,19 @@ SUBDIRS = .
 yangmodulesdir = ${datarootdir}/${PACKAGE_NAME}/yang/modules
 
 yangmodules_list = ietf-dhcpv6-client@2018-09-04.yang
-yangmodules_list += ietf-interfaces@2014-05-08.yang
+yangmodules_list += ietf-interfaces@2018-02-20.yang
 yangmodules_list += ietf-dhcpv6-options@2018-09-04.yang
 yangmodules_list += ietf-dhcpv6-relay@2018-09-04.yang
 yangmodules_list += ietf-dhcpv6-server@2018-09-04.yang
 yangmodules_list += ietf-dhcpv6-types@2018-09-04.yang
 yangmodules_list += ietf-inet-types@2013-07-15.yang
 yangmodules_list += ietf-yang-types@2013-07-15.yang
-yangmodules_list += kea-ctrl-agent@2018-11-20.yang
-yangmodules_list += kea-dhcp-ddns@2018-11-20.yang
-yangmodules_list += kea-dhcp-types@2018-11-20.yang
-yangmodules_list += kea-dhcp4-server@2018-11-20.yang
-yangmodules_list += kea-dhcp6-server@2018-11-20.yang
-yangmodules_list += kea-types@2018-11-20.yang
+yangmodules_list += kea-ctrl-agent@2019-08-09.yang
+yangmodules_list += kea-dhcp-ddns@2019-08-09.yang
+yangmodules_list += kea-dhcp-types@2019-08-09.yang
+yangmodules_list += kea-dhcp4-server@2019-08-09.yang
+yangmodules_list += kea-dhcp6-server@2019-08-09.yang
+yangmodules_list += kea-types@2019-08-09.yang
 yangmodules_list += keatest-module@2018-11-20.yang
 
 if HAVE_SYSREPO
index 12058d39d1e08b022da58fc2f09b407390f28ad4..29d94830ffe049074ed99f3d88d3fd51bd8eda0c 100644 (file)
@@ -1 +1 @@
-bd90f2b341a0f5502231dff061f2c2fc0a52558ad8d9375533c4195719c206fd
+d405e7acd13d6ac6f8acc3192e3462b9c550bd90ea73506a27bb133f91667edb
index 4aeef0fa52da74c1119fbf77042073a2801ee9a1..7ec16607fcc9cffcf5b727aba174c870caae8b44 100644 (file)
@@ -290,10 +290,10 @@ module kea-dhcp4-server {
     uses dhcp:max-valid-lifetime;
     uses dhcp:renew-timer;
     uses dhcp:rebind-timer;
-    uses dhcp:decline-probation-period;
     uses dhcp:calculate-tee-times;
     uses dhcp:t1-percent;
     uses dhcp:t2-percent;
+    uses dhcp:decline-probation-period;
     uses subnet4-list;
 
     list shared-network {