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:
/// @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.
/// @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,
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:
/// @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.
/// @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,