Kea  1.9.9-git
translator_shared_network.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_SHARED_NETWORK_H
8 #define ISC_TRANSLATOR_SHARED_NETWORK_H 1
9 
10 #include <yang/translator.h>
11 #include <yang/translator_subnet.h>
12 #include <list>
13 
14 namespace isc {
15 namespace yang {
16 
137 
145 public:
146 
151 #ifndef HAVE_PRE_0_7_6_SYSREPO
152  TranslatorSharedNetwork(sysrepo::S_Session session,
153  const std::string& model);
154 #else
155  TranslatorSharedNetwork(S_Session session, const std::string& model);
156 #endif
157 
159  virtual ~TranslatorSharedNetwork();
160 
166  isc::data::ElementPtr getSharedNetwork(const std::string& xpath);
167 
172  void setSharedNetwork(const std::string& xpath,
174 
175 protected:
182  isc::data::ElementPtr getSharedNetworkKea(const std::string& xpath,
183  const std::string& subsel);
184 
191  void setSharedNetworkKea(const std::string& xpath,
193  const std::string& subsel);
194 };
195 
203 public:
204 
209 #ifndef HAVE_PRE_0_7_6_SYSREPO
210  TranslatorSharedNetworks(sysrepo::S_Session session,
211  const std::string& model);
212 #else
213  TranslatorSharedNetworks(S_Session session, const std::string& model);
214 #endif
215 
217  virtual ~TranslatorSharedNetworks();
218 
223  isc::data::ElementPtr getSharedNetworks(const std::string& xpath);
224 
229  void setSharedNetworks(const std::string& xpath,
231 
232 protected:
239  void setSharedNetworksKea(const std::string& xpath,
241 };
242 
243 }; // end of namespace isc::yang
244 }; // end of namespace isc
245 
246 #endif // ISC_TRANSLATOR_SHARED_NETWORK_H
TranslatorSharedNetwork(sysrepo::S_Session session, const std::string &model)
Constructor.
void setSharedNetworks(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set shared networks from JSON to YANG.
void setSharedNetworkKea(const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
setSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
isc::data::ElementPtr getSharedNetwork(const std::string &xpath)
Get and translate a shared network from YANG to JSON.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::data::ElementPtr getSharedNetworks(const std::string &xpath)
Get and translate shared networks from YANG to JSON.
TranslatorSharedNetworks(sysrepo::S_Session session, const std::string &model)
Constructor.
Shared network translation between YANG and JSON.
void setSharedNetworksKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setSharedNetworks for kea-dhcp4-server and kea-dhcp6-server
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
A translator class for converting a shared network list between YANG and JSON.
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 setSharedNetwork(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set shared network from JSON to YANG.
isc::data::ElementPtr getSharedNetworkKea(const std::string &xpath, const std::string &subsel)
getSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models