Kea 2.7.4
translator_shared_network.h
Go to the documentation of this file.
1// Copyright (C) 2018-2024 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_SHARED_NETWORK_H
8#define ISC_TRANSLATOR_SHARED_NETWORK_H 1
9
10#include <yang/translator.h>
12
13namespace isc {
14namespace yang {
15
156
164public:
169 TranslatorSharedNetwork(sysrepo::Session session,
170 const std::string& model);
171
173 virtual ~TranslatorSharedNetwork() = default;
174
182 isc::data::ElementPtr getSharedNetwork(libyang::DataNode const& data_node);
183
192
197 void setSharedNetwork(const std::string& xpath,
199
200protected:
208 isc::data::ElementPtr getSharedNetworkKea(libyang::DataNode const& data_node,
209 const std::string& subsel);
210
217 void setSharedNetworkKea(const std::string& xpath,
219 const std::string& subsel);
220}; // TranslatorSharedNetwork
221
229public:
234 TranslatorSharedNetworks(sysrepo::Session session,
235 const std::string& model);
236
238 virtual ~TranslatorSharedNetworks() = default;
239
247 isc::data::ElementPtr getSharedNetworks(libyang::DataNode const& data_node);
248
257
262 void setSharedNetworks(const std::string& xpath,
264
265protected:
272 void setSharedNetworksKea(const std::string& xpath,
274}; // TranslatorSharedNetworks
275
276} // namespace yang
277} // namespace isc
278
279#endif // ISC_TRANSLATOR_SHARED_NETWORK_H
Shared network translation between YANG and JSON.
isc::data::ElementPtr getSharedNetworkFromAbsoluteXpath(std::string const &xpath)
Translate a shared network from YANG to JSON.
TranslatorSharedNetwork(sysrepo::Session session, const std::string &model)
Constructor.
virtual ~TranslatorSharedNetwork()=default
Destructor.
isc::data::ElementPtr getSharedNetwork(libyang::DataNode const &data_node)
Translate a shared network from YANG to JSON.
void setSharedNetworkKea(const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
setSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
isc::data::ElementPtr getSharedNetworkKea(libyang::DataNode const &data_node, const std::string &subsel)
getSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
void setSharedNetwork(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set shared network from JSON to YANG.
A translator class for converting a shared network list between YANG and JSON.
TranslatorSharedNetworks(sysrepo::Session session, const std::string &model)
Constructor.
virtual ~TranslatorSharedNetworks()=default
Destructor.
void setSharedNetworksKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setSharedNetworks for kea-dhcp4-server and kea-dhcp6-server
isc::data::ElementPtr getSharedNetworks(libyang::DataNode const &data_node)
Translate shared networks from YANG to JSON.
isc::data::ElementPtr getSharedNetworksFromAbsoluteXpath(std::string const &xpath)
Translate shared networks from YANG to JSON.
void setSharedNetworks(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set shared networks from JSON to YANG.
A translator class for converting a subnet 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.