]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[65-libyang-option-def] Moved syntax comments - capitalized YANG
authorFrancis Dupont <fdupont@isc.org>
Fri, 21 Sep 2018 23:27:13 +0000 (01:27 +0200)
committerFrancis Dupont <fdupont@isc.org>
Fri, 21 Sep 2018 23:27:13 +0000 (01:27 +0200)
src/lib/yang/translator_option_def.h

index 3b012372c08210efc360d0924840e6e8ddb1beac..6faa089d207f19a7867f6471db6193d369405ba4 100644 (file)
 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": <code>,
+//     "name": <name>,
+//     "space": <space>,
+//     "type": <type>,
+//     "array": <array flag>,
+//     "encapsulate": <encapsulated space>,
+//     "record-types": <record types>,
+//     "user-context": { <json map> },
+//     "comment": "<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": <code>,
-    ///     "name": <name>,
-    ///     "space": <space>,
-    ///     "type": <type>,
-    ///     "array": <array flag>,
-    ///     "encapsulate": <encapsulated space>,
-    ///     "record-types": <record types>,
-    ///     "user-context": { <json map> },
-    ///     "comment": "<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,