Kea 2.7.0
translator_subnet.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_SUBNET_H
8#define ISC_TRANSLATOR_SUBNET_H 1
9
10#include <yang/translator.h>
14
15namespace isc {
16namespace yang {
17
266
270class TranslatorSubnet : virtual public TranslatorPools,
271 virtual public TranslatorPdPools, virtual public TranslatorHosts {
272public:
277 TranslatorSubnet(sysrepo::Session session, const std::string& model);
278
280 virtual ~TranslatorSubnet() = default;
281
290 isc::data::ElementPtr getSubnet(libyang::DataNode const& data_node);
291
300 isc::data::ElementPtr getSubnetFromAbsoluteXpath(std::string const& xpath);
301
307 void setSubnet(const std::string& xpath, isc::data::ConstElementPtr elem);
308
309protected:
315 isc::data::ElementPtr getSubnetIetf6(libyang::DataNode const& data_node);
316
321 void setSubnetIetf6(const std::string& xpath,
323
329 isc::data::ElementPtr getSubnetKea(libyang::DataNode const& data_node);
330
335 void setSubnetKea(const std::string& xpath,
337}; // TranslatorSubnets
338
343class TranslatorSubnets : virtual public TranslatorSubnet {
344public:
349 TranslatorSubnets(sysrepo::Session session, const std::string& model);
350
352 virtual ~TranslatorSubnets() = default;
353
361 isc::data::ElementPtr getSubnets(libyang::DataNode const& data_node);
362
370 isc::data::ElementPtr getSubnetsFromAbsoluteXpath(std::string const& xpath);
371
377 void setSubnets(const std::string& xpath, isc::data::ConstElementPtr elem);
378
379protected:
386 isc::data::ElementPtr getSubnetsCommon(libyang::DataNode const& data_node,
387 const std::string& subsel);
388
393 void setSubnetsIetf6(const std::string& xpath,
395
401 void setSubnetsKea(const std::string& xpath,
403 const std::string& subsel);
404}; // TranslatorSubnets
405
406} // namespace yang
407} // namespace isc
408
409#endif // ISC_TRANSLATOR_SUBNET_H
A translator class for converting host reservations list between YANG and JSON.
A translator class for converting a pd-pool list between YANG and JSON.
A translator class for converting pools between YANG and JSON.
Subnet (aka network range) translation between YANG and JSON.
isc::data::ElementPtr getSubnet(libyang::DataNode const &data_node)
Get and translate a subnet from YANG to JSON.
void setSubnetIetf6(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnet for ietf-dhcpv6-server.
virtual ~TranslatorSubnet()=default
Destructor.
void setSubnet(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set subnet from JSON to YANG.
isc::data::ElementPtr getSubnetIetf6(libyang::DataNode const &data_node)
getSubnet for ietf-dhcpv6-server.
isc::data::ElementPtr getSubnetFromAbsoluteXpath(std::string const &xpath)
Get and translate a subnet from YANG to JSON.
TranslatorSubnet(sysrepo::Session session, const std::string &model)
Constructor.
isc::data::ElementPtr getSubnetKea(libyang::DataNode const &data_node)
getSubnet for kea-dhcp[46]-server.
void setSubnetKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnet for kea-dhcp[46]-server.
A translator class for converting a subnet list between YANG and JSON.
isc::data::ElementPtr getSubnetsCommon(libyang::DataNode const &data_node, const std::string &subsel)
getSubnets common part.
void setSubnets(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set subnets from JSON to YANG.
void setSubnetsKea(const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
setSubnets for kea-dhcp[46]-server.
isc::data::ElementPtr getSubnets(libyang::DataNode const &data_node)
Get and translate subnets from YANG to JSON.
isc::data::ElementPtr getSubnetsFromAbsoluteXpath(std::string const &xpath)
Get and translate subnets from YANG to JSON.
virtual ~TranslatorSubnets()=default
Destructor.
void setSubnetsIetf6(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnets for ietf-dhcpv6-server.
TranslatorSubnets(sysrepo::Session session, const std::string &model)
Constructor.
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.