From: Francis Dupont Date: Fri, 21 Sep 2018 23:27:13 +0000 (+0200) Subject: [65-libyang-option-def] Moved syntax comments - capitalized YANG X-Git-Tag: 65-libyang-class_base^2^2~6^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2263341c9c6cef4dc7671012484f9f59e7bb4740;p=thirdparty%2Fkea.git [65-libyang-option-def] Moved syntax comments - capitalized YANG --- diff --git a/src/lib/yang/translator_option_def.h b/src/lib/yang/translator_option_def.h index 3b012372c0..6faa089d20 100644 --- a/src/lib/yang/translator_option_def.h +++ b/src/lib/yang/translator_option_def.h @@ -13,7 +13,39 @@ namespace isc { namespace yang { -// @brief Between Yang and JSON translator class for the option definition. +// @brief A translator class for converting an option definition between +// YANG and JSON. +// +// Currently supports on kea-dhcp[46]-server, does not exist in +// ietf-dhcpv6-server. +// +// JSON syntax for Kea DHCP servers is: +// @code +// { +// "code": , +// "name": , +// "space": , +// "type": , +// "array": , +// "encapsulate": , +// "record-types": , +// "user-context": { }, +// "comment": "" +// } +// @endcode +// +// YANG syntax for kea-dhcp[46] with code and space as keys is: +// @code +// +--rw name string +// +--rw code uint8 / uint16 +// +--rw type string +// +--rw record-types? string +// +--rw space string +// +--rw encapsulate? string +// +--rw array? boolean +// +--rw user-context? string +// @endcode +// class TranslatorOptionDef : virtual public TranslatorBasic { public: @@ -26,29 +58,14 @@ public: /// @brief Destructor. virtual ~TranslatorOptionDef(); - /// @brief Get and translate an option definition from Yang to JSON. - /// - /// JSON syntax for Kea DHCP with command channel is: - /// @code - /// { - /// "code": , - /// "name": , - /// "space": , - /// "type": , - /// "array": , - /// "encapsulate": , - /// "record-types": , - /// "user-context": { }, - /// "comment": "" - /// } - /// @endcode + /// @brief Get and translate an option definition from YANG to JSON. /// /// @param xpath The xpath of the option definition. /// @return JSON representation of the option definition. /// @throw SysrepoError when sysrepo raises an error. isc::data::ElementPtr getOptionDef(const std::string& xpath); - /// @brief Translate and set option definition from JSON to Yang. + /// @brief Translate and set option definition from JSON to YANG. /// /// @param xpath The xpath of the option definition.. /// @param elem The JSON element. @@ -65,18 +82,6 @@ protected: /// @brief setOptionDef for kea-dhcp[46]. /// - /// Yang syntax for kea-dhcp[46] with code and space as keys is: - /// @code - /// +--rw name string - /// +--rw code uint8 / uint16 - /// +--rw type string - /// +--rw record-types? string - /// +--rw space string - /// +--rw encapsulate? string - /// +--rw array? boolean - /// +--rw user-context? string - /// @endcode - /// /// @param xpath The xpath of the option definition. /// @param elem The JSON element. void setOptionDefKea(const std::string& xpath, @@ -86,7 +91,14 @@ protected: std::string model_; }; -// @brief Between Yang and JSON translator class for option definition list. +// @brief A translator class for converting an option definition list +// between YANG and JSON. +// +// Currently supports on kea-dhcp[46]-server, does not exist in +// ietf-dhcpv6-server. +// +// YANG syntax is a option-def list keyed by code and space. +// class TranslatorOptionDefList : virtual public TranslatorOptionDef { public: @@ -99,13 +111,13 @@ public: /// @brief Destructor. virtual ~TranslatorOptionDefList(); - /// @brief Get and translate option definition list from Yang to JSON. + /// @brief Get and translate option definition list from YANG to JSON. /// /// @param xpath The xpath of the option definition list. /// @throw SysrepoError when sysrepo raises an error. isc::data::ConstElementPtr getOptionDefList(const std::string& xpath); - /// @brief Translate and set option definition list from JSON to Yang. + /// @brief Translate and set option definition list from JSON to YANG. /// /// @param xpath The xpath of the option definition list. /// @param elem The JSON element. @@ -121,8 +133,6 @@ protected: /// @brief setOptionDefList for kea-dhcp[46]. /// - /// Yang syntax is a option-def list keyed by code and space. - /// /// @param xpath The xpath of the option definition list. /// @param elem The JSON element. void setOptionDefListKea(const std::string& xpath,