Kea 2.5.7
translator_subnet.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_SUBNET_H
8#define ISC_TRANSLATOR_SUBNET_H 1
9
10#include <yang/translator.h>
14
15namespace isc {
16namespace yang {
17
268
272class TranslatorSubnet : virtual public TranslatorPools,
273 virtual public TranslatorPdPools, virtual public TranslatorHosts {
274public:
279 TranslatorSubnet(sysrepo::Session session, const std::string& model);
280
282 virtual ~TranslatorSubnet() = default;
283
292 isc::data::ElementPtr getSubnet(libyang::DataNode const& data_node);
293
302 isc::data::ElementPtr getSubnetFromAbsoluteXpath(std::string const& xpath);
303
309 void setSubnet(const std::string& xpath, isc::data::ConstElementPtr elem);
310
311protected:
317 isc::data::ElementPtr getSubnetIetf6(libyang::DataNode const& data_node);
318
323 void setSubnetIetf6(const std::string& xpath,
325
331 isc::data::ElementPtr getSubnetKea(libyang::DataNode const& data_node);
332
337 void setSubnetKea(const std::string& xpath,
339}; // TranslatorSubnets
340
345class TranslatorSubnets : virtual public TranslatorSubnet {
346public:
351 TranslatorSubnets(sysrepo::Session session, const std::string& model);
352
354 virtual ~TranslatorSubnets() = default;
355
363 isc::data::ElementPtr getSubnets(libyang::DataNode const& data_node);
364
372 isc::data::ElementPtr getSubnetsFromAbsoluteXpath(std::string const& xpath);
373
379 void setSubnets(const std::string& xpath, isc::data::ConstElementPtr elem);
380
381protected:
388 isc::data::ElementPtr getSubnetsCommon(libyang::DataNode const& data_node,
389 const std::string& subsel);
390
395 void setSubnetsIetf6(const std::string& xpath,
397
403 void setSubnetsKea(const std::string& xpath,
405 const std::string& subsel);
406}; // TranslatorSubnets
407
408} // namespace yang
409} // namespace isc
410
411#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.
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.
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.