From: Francis Dupont Date: Thu, 25 Oct 2018 12:08:34 +0000 (+0200) Subject: [65-libyang-config-translator] Small fixes (translator_config.cc to be reviewed) X-Git-Tag: 65-libyang-finish-doc_base~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=df75c9cafcc37865282666f85136f7da8b65aa78;p=thirdparty%2Fkea.git [65-libyang-config-translator] Small fixes (translator_config.cc to be reviewed) --- diff --git a/src/lib/yang/tests/config_unittests.cc b/src/lib/yang/tests/config_unittests.cc index 3dcdf8d68f..d5a8634f6a 100644 --- a/src/lib/yang/tests/config_unittests.cc +++ b/src/lib/yang/tests/config_unittests.cc @@ -240,6 +240,9 @@ TEST_F(ConfigTest, emptyKeaDhcp6) { } // Check subnet with two pools with ietf-dhcpv6-server model. +// Validation will fail because the current model has a vendor-info +// container with a mandatory ent-num leaf and no presence flag, +// and of course the candidate YANG tree has nothing for this. TEST_F(ConfigTest, subnetTwoPoolsIetf6) { // First set the model. setModel(subnetTwoPoolsModelIetf6); diff --git a/src/lib/yang/translator_config.h b/src/lib/yang/translator_config.h index 5dfd111427..600cfdf46d 100644 --- a/src/lib/yang/translator_config.h +++ b/src/lib/yang/translator_config.h @@ -20,9 +20,10 @@ namespace yang { /// @brief DHCP configuration translation between YANG and JSON /// -/// This translator supports kea-dhcp4-server and kea-dhcp6-server. +/// This translator supports kea-dhcp4-server, kea-dhcp6-server and +/// partially ietf-dhcpv6-server. /// -/// JSON syntax for kea-dhcp6-server is: +/// JSON syntax for kea-dhcp6 is: /// @code /// "Dhcp6": { /// "preferred-lifetime": , @@ -135,7 +136,7 @@ namespace yang { /// +--rw loggers /// @endcode /// -/// Example of kea-dhcp6-server simple configuration: +/// Example of kea-dhcp6 simple configuration: /// @code /// { /// "Dhcp6": { @@ -163,7 +164,8 @@ namespace yang { /// } /// @endcode /// -/// The same configuration wrote into YANG datastore using @c setConfig() and exported to XML format: +/// The same configuration wrote into YANG datastore using @c setConfig() +/// with the kea-dhcp6-model and exported to XML format: /// @code /// /// @@ -231,8 +233,7 @@ namespace yang { /// 'XXX (list)' stands for 'XXX list --- XXX' which is a common motif /// (only database shows direct dependencies on both the list and the element) /// -/// @brief A translator class for converting the config between -/// YANG and JSON. +/// @brief A translator class for converting the config between YANG and JSON. /// /// Currently supports the following models: /// - kea-dhcp4-server @@ -255,13 +256,15 @@ public: /// @brief Destructor. virtual ~TranslatorConfig(); - /// @brief Get and translate the whole DHCP server config from YANG to JSON. + /// @brief Get and translate the whole DHCP server configuration + /// from YANG to JSON. /// /// @return JSON representation of the config. /// @throw SysrepoError when sysrepo raises an error. isc::data::ElementPtr getConfig(); - /// @brief Translate and sets the DHCP server config from JSON to YANG. + /// @brief Translate and sets the DHCP server configuration + /// from JSON to YANG. /// /// Null elem argument removes the config containers. ///