Kea  1.9.9-git
translator_subnet.h
Go to the documentation of this file.
1 // Copyright (C) 2018-2019,2021 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>
11 #include <yang/translator_pool.h>
13 #include <yang/translator_host.h>
14 #include <list>
15 
16 namespace isc {
17 namespace yang {
18 
250 
254 class TranslatorSubnet : virtual public TranslatorPools,
255  virtual public TranslatorPdPools, virtual public TranslatorHosts {
256 public:
257 
262 #ifndef HAVE_PRE_0_7_6_SYSREPO
263  TranslatorSubnet(sysrepo::S_Session session, const std::string& model);
264 #else
265  TranslatorSubnet(S_Session session, const std::string& model);
266 #endif
267 
269  virtual ~TranslatorSubnet();
270 
277  isc::data::ElementPtr getSubnet(const std::string& xpath);
278 
284  void setSubnet(const std::string& xpath, isc::data::ConstElementPtr elem);
285 
286 protected:
291  isc::data::ElementPtr getSubnetIetf6(const std::string& xpath);
292 
297  void setSubnetIetf6(const std::string& xpath,
299 
304  isc::data::ElementPtr getSubnetKea(const std::string& xpath);
305 
310  void setSubnetKea(const std::string& xpath,
312 };
313 
318 class TranslatorSubnets : virtual public TranslatorSubnet {
319 public:
320 
325 #ifndef HAVE_PRE_0_7_6_SYSREPO
326  TranslatorSubnets(sysrepo::S_Session session, const std::string& model);
327 #else
328  TranslatorSubnets(S_Session session, const std::string& model);
329 #endif
330 
332  virtual ~TranslatorSubnets();
333 
338  isc::data::ElementPtr getSubnets(const std::string& xpath);
339 
345  void setSubnets(const std::string& xpath, isc::data::ConstElementPtr elem);
346 
347 protected:
352  isc::data::ElementPtr getSubnetsCommon(const std::string& xpath,
353  const std::string& subsel);
354 
359  void setSubnetsIetf6(const std::string& xpath,
361 
367  void setSubnetsKea(const std::string& xpath,
369  const std::string& subsel);
370 };
371 
372 }; // end of namespace isc::yang
373 }; // end of namespace isc
374 
375 #endif // ISC_TRANSLATOR_SUBNET_H
virtual ~TranslatorSubnet()
Destructor.
Subnet (aka network range) translation between YANG and JSON.
isc::data::ElementPtr getSubnet(const std::string &xpath)
Get and translate a subnet from YANG to JSON.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
void setSubnetKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnet for kea-dhcp[46]-server.
A translator class for converting a pd-pool list between YANG and JSON.
TranslatorSubnet(sysrepo::S_Session session, const std::string &model)
Constructor.
TranslatorSubnets(sysrepo::S_Session session, const std::string &model)
Constructor.
isc::data::ElementPtr getSubnetsCommon(const std::string &xpath, const std::string &subsel)
getSubnets common part.
isc::data::ElementPtr getSubnets(const std::string &xpath)
Get and translate subnets from YANG to JSON.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
isc::data::ElementPtr getSubnetKea(const std::string &xpath)
getSubnet for kea-dhcp[46]-server.
A translator class for converting a subnet list between YANG and JSON.
Defines the logger used by the top-level component of kea-dhcp-ddns.
void setSubnetsIetf6(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnets for ietf-dhcpv6-server.
void setSubnet(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set subnet from JSON to YANG.
virtual ~TranslatorSubnets()
Destructor.
A translator class for converting pools between YANG and JSON.
void setSubnets(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set subnets from JSON to YANG.
void setSubnetIetf6(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnet for ietf-dhcpv6-server.
void setSubnetsKea(const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
setSubnets for kea-dhcp[46]-server.
A translator class for converting host reservations list between YANG and JSON.
isc::data::ElementPtr getSubnetIetf6(const std::string &xpath)
getSubnet for ietf-dhcpv6-server.