Kea  1.9.9-git
translator_pool.h
Go to the documentation of this file.
1 // Copyright (C) 2018-2019 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_POOL_H
8 #define ISC_TRANSLATOR_POOL_H 1
9 
11 #include <list>
12 
13 namespace isc {
14 namespace yang {
15 
124 class TranslatorPool : virtual public TranslatorOptionDataList {
125 public:
126 
131 #ifndef HAVE_PRE_0_7_6_SYSREPO
132  TranslatorPool(sysrepo::S_Session session, const std::string& model);
133 #else
134  TranslatorPool(S_Session session, const std::string& model);
135 #endif
136 
138  virtual ~TranslatorPool();
139 
145  isc::data::ElementPtr getPool(const std::string& xpath);
146 
151  void setPool(const std::string& xpath, isc::data::ConstElementPtr elem);
152 
159  static void getAddresses(const std::string& prefix,
160  std::string& start_address,
161  std::string& end_address);
162 
163 protected:
169  isc::data::ElementPtr getPoolIetf6(const std::string& xpath);
170 
177  void setPoolIetf6(const std::string& xpath,
179 
185  isc::data::ElementPtr getPoolKea(const std::string& xpath);
186 
192  void setPoolKea(const std::string& xpath, isc::data::ConstElementPtr elem);
193 };
194 
198 class TranslatorPools : virtual public TranslatorPool {
199 public:
200 
205 #ifndef HAVE_PRE_0_7_6_SYSREPO
206  TranslatorPools(sysrepo::S_Session session, const std::string& model);
207 #else
208  TranslatorPools(S_Session session, const std::string& model);
209 #endif
210 
212  virtual ~TranslatorPools();
213 
218  isc::data::ElementPtr getPools(const std::string& xpath);
219 
224  void setPools(const std::string& xpath, isc::data::ConstElementPtr elem);
225 
226 protected:
230  isc::data::ElementPtr getPoolsIetf(const std::string& xpath);
231 
235  isc::data::ElementPtr getPoolsKea(const std::string& xpath);
236 
241  void setPoolsById(const std::string& xpath,
243 
249  void setPoolsByAddresses(const std::string& xpath,
251 };
252 
253 }; // end of namespace isc::yang
254 }; // end of namespace isc
255 
256 #endif // ISC_TRANSLATOR_POOL_H
isc::data::ElementPtr getPool(const std::string &xpath)
Get and translate a pool from YANG to JSON.
isc::data::ElementPtr getPoolIetf6(const std::string &xpath)
getPool for ietf-dhcpv6-server.
virtual ~TranslatorPools()
Destructor.
isc::data::ElementPtr getPoolsKea(const std::string &xpath)
getPools for kea-dhcp[46]-server.
isc::data::ElementPtr getPoolsIetf(const std::string &xpath)
getPools for ietf-dhcpv6-server.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
void setPool(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set (address) pool from JSON to YANG.
static void getAddresses(const std::string &prefix, std::string &start_address, std::string &end_address)
Get start and end addresses from prefix.
void setPools(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set (address) pools from JSON to YANG.
TranslatorPool(sysrepo::S_Session session, const std::string &model)
Constructor.
void setPoolsById(const std::string &xpath, isc::data::ConstElementPtr elem)
setPools using pool-id.
TranslatorPools(sysrepo::S_Session session, const std::string &model)
Constructor.
void setPoolKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setPool for kea-dhcp[46]-server.
A translator class for converting an option data list between YANG and JSON.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
Defines the logger used by the top-level component of kea-dhcp-ddns.
A translator class for converting a pool between YANG and JSON.
void setPoolIetf6(const std::string &xpath, isc::data::ConstElementPtr elem)
setPool for ietf-dhcpv6-server.
A translator class for converting pools between YANG and JSON.
isc::data::ElementPtr getPools(const std::string &xpath)
Get and translate pools from YANG to JSON.
void setPoolsByAddresses(const std::string &xpath, isc::data::ConstElementPtr elem)
setPools using address pair.
virtual ~TranslatorPool()
Destructor.
isc::data::ElementPtr getPoolKea(const std::string &xpath)
getPool for kea-dhcp[46]-server.