From 54cf13af140c0614ef2cdfb120fd76004a172920 Mon Sep 17 00:00:00 2001 From: Francis Dupont Date: Mon, 24 Sep 2018 16:35:02 +0200 Subject: [PATCH] [65-libyang-option-def] Added example --- src/lib/yang/translator_option_def.h | 43 ++++++++++++++++++++++------ 1 file changed, 35 insertions(+), 8 deletions(-) diff --git a/src/lib/yang/translator_option_def.h b/src/lib/yang/translator_option_def.h index 068d280131..3b01243619 100644 --- a/src/lib/yang/translator_option_def.h +++ b/src/lib/yang/translator_option_def.h @@ -13,11 +13,7 @@ namespace isc { namespace yang { -// @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. +// Option definition translation between YANG and JSON // // JSON syntax for Kea DHCP servers is: // @code @@ -46,6 +42,40 @@ namespace yang { // +--rw user-context? string // @endcode // +// An example in JSON and YANG formats: +// @code +// [ +// { +// "code": 100, +// "name": "foo", +// "space": "isc", +// "type": "string", +// "array": false +// } +// ] +// @endcode +// @code +// /kea-dhcp6-server:config (container) +// /kea-dhcp6-server:config/option-def-list (container) +// /kea-dhcp6-server:config/option-def-list/ +// option-def[code='100'][space='isc'] (list instance) +// /kea-dhcp6-server:config/option-def-list/ +// option-def[code='100'][space='isc']/code = 100 +// /kea-dhcp6-server:config/option-def-list/ +// option-def[code='100'][space='isc']/space = isc +// /kea-dhcp6-server:config/option-def-list/ +// option-def[code='100'][space='isc']/name = foo +// /kea-dhcp6-server:config/option-def-list/ +// option-def[code='100'][space='isc']/type = string +// /kea-dhcp6-server:config/option-def-list/ +// option-def[code='100'][space='isc']/array = false +// @endcode + +// @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. class TranslatorOptionDef : virtual public TranslatorBasic { public: @@ -98,9 +128,6 @@ protected: // // 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: -- 2.47.2