Kea: translator_shared_network.h Source File

| Kea 3.2.0-git

translator_shared_network.h
Go to the documentation of this file.
1// Copyright (C) 2018-2026 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>
11#include <yang/translator_subnet.h>
12
13namespace isc {
14namespace yang {
15
163
170 class TranslatorSharedNetwork : virtual public TranslatorSubnets {
171public:
176 TranslatorSharedNetwork(sysrepo::Session session,
177 const std::string& model);
178
180 virtual ~TranslatorSharedNetwork() = default;
181
189 isc::data::ElementPtr getSharedNetwork(libyang::DataNode const& data_node);
190
198 isc::data::ElementPtr getSharedNetworkFromAbsoluteXpath(std::string const& xpath);
199
204 void setSharedNetwork(const std::string& xpath,
205 isc::data::ConstElementPtr elem);
206
207protected:
215 isc::data::ElementPtr getSharedNetworkKea(libyang::DataNode const& data_node,
216 const std::string& subsel);
217
224 void setSharedNetworkKea(const std::string& xpath,
225 isc::data::ConstElementPtr elem,
226 const std::string& subsel);
227}; // TranslatorSharedNetwork
228
235 class TranslatorSharedNetworks : virtual public TranslatorSharedNetwork {
236public:
241 TranslatorSharedNetworks(sysrepo::Session session,
242 const std::string& model);
243
245 virtual ~TranslatorSharedNetworks() = default;
246
254 isc::data::ElementPtr getSharedNetworks(libyang::DataNode const& data_node);
255
263 isc::data::ElementPtr getSharedNetworksFromAbsoluteXpath(std::string const& xpath);
264
269 void setSharedNetworks(const std::string& xpath,
270 isc::data::ConstElementPtr elem);
271
272protected:
279 void setSharedNetworksKea(const std::string& xpath,
280 isc::data::ConstElementPtr elem);
281}; // TranslatorSharedNetworks
282
283} // namespace yang
284} // namespace isc
285
286#endif // ISC_TRANSLATOR_SHARED_NETWORK_H
isc::yang::TranslatorSharedNetwork::getSharedNetworkFromAbsoluteXpath
isc::data::ElementPtr getSharedNetworkFromAbsoluteXpath(std::string const &xpath)
Translate a shared network from YANG to JSON.
Definition translator_shared_network.cc:55
isc::yang::TranslatorSharedNetwork::TranslatorSharedNetwork
TranslatorSharedNetwork(sysrepo::Session session, const std::string &model)
Constructor.
Definition translator_shared_network.cc:22
isc::yang::TranslatorSharedNetwork::~TranslatorSharedNetwork
virtual ~TranslatorSharedNetwork()=default
Destructor.
isc::yang::TranslatorSharedNetwork::getSharedNetwork
isc::data::ElementPtr getSharedNetwork(libyang::DataNode const &data_node)
Translate a shared network from YANG to JSON.
Definition translator_shared_network.cc:38
isc::yang::TranslatorSharedNetwork::setSharedNetworkKea
void setSharedNetworkKea(const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
setSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
Definition translator_shared_network.cc:166
isc::yang::TranslatorSharedNetwork::getSharedNetworkKea
isc::data::ElementPtr getSharedNetworkKea(libyang::DataNode const &data_node, const std::string &subsel)
getSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
Definition translator_shared_network.cc:64
isc::yang::TranslatorSharedNetwork::setSharedNetwork
void setSharedNetwork(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set shared network from JSON to YANG.
Definition translator_shared_network.cc:146
isc::yang::TranslatorSharedNetworks::TranslatorSharedNetworks
TranslatorSharedNetworks(sysrepo::Session session, const std::string &model)
Constructor.
Definition translator_shared_network.cc:251
isc::yang::TranslatorSharedNetworks::~TranslatorSharedNetworks
virtual ~TranslatorSharedNetworks()=default
Destructor.
isc::yang::TranslatorSharedNetworks::setSharedNetworksKea
void setSharedNetworksKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setSharedNetworks for kea-dhcp4-server and kea-dhcp6-server
Definition translator_shared_network.cc:302
isc::yang::TranslatorSharedNetworks::getSharedNetworks
isc::data::ElementPtr getSharedNetworks(libyang::DataNode const &data_node)
Translate shared networks from YANG to JSON.
Definition translator_shared_network.cc:268
isc::yang::TranslatorSharedNetworks::getSharedNetworksFromAbsoluteXpath
isc::data::ElementPtr getSharedNetworksFromAbsoluteXpath(std::string const &xpath)
Translate shared networks from YANG to JSON.
Definition translator_shared_network.cc:274
isc::yang::TranslatorSharedNetworks::setSharedNetworks
void setSharedNetworks(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set shared networks from JSON to YANG.
Definition translator_shared_network.cc:283
isc::yang::TranslatorSubnets::TranslatorSubnets
TranslatorSubnets(sysrepo::Session session, const std::string &model)
Constructor.
Definition translator_subnet.cc:347
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:30
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition data.h:29
isc::yang
Definition adaptor.cc:17
isc
Defines the logger used by the top-level component of kea-lfc.
Definition check_exists_add.cc:18
translator.h
translator_subnet.h