Kea  1.5.0
translator_subnet.h
Go to the documentation of this file.
1 // Copyright (C) 2018 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 
231 
235 class TranslatorSubnet : virtual public TranslatorPools,
236  virtual public TranslatorPdPools, virtual public TranslatorHosts {
237 public:
238 
243 #ifndef HAVE_PRE_0_7_6_SYSREPO
244  TranslatorSubnet(sysrepo::S_Session session, const std::string& model);
245 #else
246  TranslatorSubnet(S_Session session, const std::string& model);
247 #endif
248 
250  virtual ~TranslatorSubnet();
251 
258  isc::data::ElementPtr getSubnet(const std::string& xpath);
259 
265  void setSubnet(const std::string& xpath, isc::data::ConstElementPtr elem);
266 
267 protected:
272  isc::data::ElementPtr getSubnetIetf6(const std::string& xpath);
273 
278  void setSubnetIetf6(const std::string& xpath,
280 
285  isc::data::ElementPtr getSubnetKea(const std::string& xpath);
286 
291  void setSubnetKea(const std::string& xpath,
293 };
294 
299 class TranslatorSubnets : virtual public TranslatorSubnet {
300 public:
301 
306 #ifndef HAVE_PRE_0_7_6_SYSREPO
307  TranslatorSubnets(sysrepo::S_Session session, const std::string& model);
308 #else
309  TranslatorSubnets(S_Session session, const std::string& model);
310 #endif
311 
313  virtual ~TranslatorSubnets();
314 
319  isc::data::ElementPtr getSubnets(const std::string& xpath);
320 
326  void setSubnets(const std::string& xpath, isc::data::ConstElementPtr elem);
327 
328 protected:
333  isc::data::ElementPtr getSubnetsCommon(const std::string& xpath,
334  const std::string& subsel);
335 
340  void setSubnetsIetf6(const std::string& xpath,
342 
348  void setSubnetsKea(const std::string& xpath,
350  const std::string& subsel);
351 };
352 
353 }; // end of namespace isc::yang
354 }; // end of namespace isc
355 
356 #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.