Kea 2.7.5
translator_host.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_HOST_H
8#define ISC_TRANSLATOR_HOST_H 1
9
11
12namespace isc {
13namespace yang {
14
104
114public:
119 TranslatorHost(sysrepo::Session session, const std::string& model);
120
122 virtual ~TranslatorHost() = default;
123
131 isc::data::ElementPtr getHost(libyang::DataNode const& data_node);
132
145 isc::data::ElementPtr getHostFromAbsoluteXpath(std::string const& xpath);
146
151 void setHost(const std::string& xpath, isc::data::ConstElementPtr elem);
152
153protected:
159 isc::data::ElementPtr getHostKea(libyang::DataNode const& data_node);
160
165 void setHostKea(const std::string& xpath, isc::data::ConstElementPtr elem);
166}; // TranslatorHost
167
176class TranslatorHosts : virtual public TranslatorHost {
177public:
182 TranslatorHosts(sysrepo::Session session, const std::string& model);
183
185 virtual ~TranslatorHosts() = default;
186
194 isc::data::ElementPtr getHosts(libyang::DataNode const& data_node);
195
208 isc::data::ElementPtr getHostsFromAbsoluteXpath(std::string const& xpath);
209
214 void setHosts(const std::string& xpath, isc::data::ConstElementPtr elem);
215
216protected:
222 void setHostsKea(const std::string& xpath,
224}; // TranslatorHosts
225
226} // namespace yang
227} // namespace isc
228
229#endif // ISC_TRANSLATOR_HOST_H
Translation between YANG and JSON for a single host reservation.
isc::data::ElementPtr getHostFromAbsoluteXpath(std::string const &xpath)
Translate a host reservation from YANG to JSON.
void setHost(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set host reservation from JSON to YANG.
isc::data::ElementPtr getHostKea(libyang::DataNode const &data_node)
getHost for kea-dhcp[46]-server models.
virtual ~TranslatorHost()=default
Destructor.
isc::data::ElementPtr getHost(libyang::DataNode const &data_node)
Translate a host reservation from YANG to JSON.
void setHostKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setHost for kea-dhcp[46]-server models.
TranslatorHost(sysrepo::Session session, const std::string &model)
Constructor.
A translator class for converting host reservations list between YANG and JSON.
isc::data::ElementPtr getHosts(libyang::DataNode const &data_node)
Translate host reservations from YANG to JSON.
virtual ~TranslatorHosts()=default
Destructor.
TranslatorHosts(sysrepo::Session session, const std::string &model)
Constructor.
void setHosts(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set (address) host reservations from JSON to YANG.
void setHostsKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setHosts for kea-dhcp[46].
isc::data::ElementPtr getHostsFromAbsoluteXpath(std::string const &xpath)
Translate host reservations from YANG to JSON.
A translator class for converting an option data list between YANG and JSON.
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.