Kea 2.5.7
translator_shared_network.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_SHARED_NETWORK_H
8#define ISC_TRANSLATOR_SHARED_NETWORK_H 1
9
10#include <yang/translator.h>
12
13namespace isc {
14namespace yang {
15
158
166public:
171 TranslatorSharedNetwork(sysrepo::Session session,
172 const std::string& model);
173
175 virtual ~TranslatorSharedNetwork() = default;
176
184 isc::data::ElementPtr getSharedNetwork(libyang::DataNode const& data_node);
185
194
199 void setSharedNetwork(const std::string& xpath,
201
202protected:
210 isc::data::ElementPtr getSharedNetworkKea(libyang::DataNode const& data_node,
211 const std::string& subsel);
212
219 void setSharedNetworkKea(const std::string& xpath,
221 const std::string& subsel);
222}; // TranslatorSharedNetwork
223
231public:
236 TranslatorSharedNetworks(sysrepo::Session session,
237 const std::string& model);
238
240 virtual ~TranslatorSharedNetworks() = default;
241
249 isc::data::ElementPtr getSharedNetworks(libyang::DataNode const& data_node);
250
259
264 void setSharedNetworks(const std::string& xpath,
266
267protected:
274 void setSharedNetworksKea(const std::string& xpath,
276}; // TranslatorSharedNetworks
277
278} // namespace yang
279} // namespace isc
280
281#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.
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.
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.