Kea 2.7.5
translator_option_def.h
Go to the documentation of this file.
1// Copyright (C) 2018-2022 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef ISC_TRANSLATOR_OPTION_DEF_H
8#define ISC_TRANSLATOR_OPTION_DEF_H 1
9
10#include <yang/translator.h>
11
12namespace isc {
13namespace yang {
14
72
78class TranslatorOptionDef : virtual public Translator {
79public:
84 TranslatorOptionDef(sysrepo::Session session, const std::string& model);
85
87 virtual ~TranslatorOptionDef() = default;
88
96 isc::data::ElementPtr getOptionDef(libyang::DataNode const& data_node);
97
106
111 void setOptionDef(const std::string& xpath,
113
114protected:
123 isc::data::ElementPtr getOptionDefKea(libyang::DataNode const& data_node);
124
130 void setOptionDefKea(const std::string& xpath,
132}; // TranslatorOptionDef
133
134// @brief A translator class for converting an option definition list
135// between YANG and JSON.
136//
140public:
145 TranslatorOptionDefList(sysrepo::Session session,
146 const std::string& model);
147
149 virtual ~TranslatorOptionDefList() = default;
150
158 isc::data::ConstElementPtr getOptionDefList(libyang::DataNode const& data_node);
159
168
173 void setOptionDefList(const std::string& xpath,
175
176protected:
183 isc::data::ConstElementPtr getOptionDefListKea(libyang::DataNode const& data_node);
184
191 void setOptionDefListKea(const std::string& xpath,
193}; // TranslatorOptionDefList
194
195} // namespace yang
196} // namespace isc
197
198#endif // ISC_TRANSLATOR_OPTION_DEF_H
Currently supports kea-dhcp[46]-server models.
isc::data::ConstElementPtr getOptionDefListKea(libyang::DataNode const &data_node)
getOptionDefList implementation specific to kea-dhcp[46]-server models.
virtual ~TranslatorOptionDefList()=default
Destructor.
void setOptionDefListKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setOptionDefList implementation specific to kea-dhcp[46]-server models.
isc::data::ConstElementPtr getOptionDefList(libyang::DataNode const &data_node)
Translate option definition list from YANG to JSON.
TranslatorOptionDefList(sysrepo::Session session, const std::string &model)
Constructor.
isc::data::ConstElementPtr getOptionDefListFromAbsoluteXpath(std::string const &xpath)
Translate option definition list from YANG to JSON.
void setOptionDefList(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set option definition list from JSON to YANG.
Option definition translation between YANG and JSON.
isc::data::ElementPtr getOptionDefFromAbsoluteXpath(std::string const &xpath)
Translate an option definition from YANG to JSON.
isc::data::ElementPtr getOptionDefKea(libyang::DataNode const &data_node)
getOptionDef implementation specific to kea-dhcp[46]-server models.
virtual ~TranslatorOptionDef()=default
Destructor.
void setOptionDef(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set option definition from JSON to YANG.
void setOptionDefKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setOptionDef implementation specific to kea-dhcp[46]-server models.
TranslatorOptionDef(sysrepo::Session session, const std::string &model)
Constructor.
isc::data::ElementPtr getOptionDef(libyang::DataNode const &data_node)
Translate an option definition from YANG to JSON.
Between YANG and JSON translator class for basic values.
Definition translator.h:23
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
Defines the logger used by the top-level component of kea-lfc.