Kea: translator_shared_network.h Source File

| Kea 1.5.0

translator_shared_network.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_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
118
125 class TranslatorSharedNetwork : virtual public TranslatorSubnets {
126 public:
127
132 #ifndef HAVE_PRE_0_7_6_SYSREPO
133 TranslatorSharedNetwork(sysrepo::S_Session session,
134 const std::string& model);
135 #else
136 TranslatorSharedNetwork(S_Session session, const std::string& model);
137 #endif
138
140 virtual ~TranslatorSharedNetwork();
141
147 isc::data::ElementPtr getSharedNetwork(const std::string& xpath);
148
153 void setSharedNetwork(const std::string& xpath,
154 isc::data::ConstElementPtr elem);
155
156 protected:
163 isc::data::ElementPtr getSharedNetworkKea(const std::string& xpath,
164 const std::string& subsel);
165
172 void setSharedNetworkKea(const std::string& xpath,
173 isc::data::ConstElementPtr elem,
174 const std::string& subsel);
175 };
176
183 class TranslatorSharedNetworks : virtual public TranslatorSharedNetwork {
184 public:
185
190 #ifndef HAVE_PRE_0_7_6_SYSREPO
191 TranslatorSharedNetworks(sysrepo::S_Session session,
192 const std::string& model);
193 #else
194 TranslatorSharedNetworks(S_Session session, const std::string& model);
195 #endif
196
198 virtual ~TranslatorSharedNetworks();
199
204 isc::data::ElementPtr getSharedNetworks(const std::string& xpath);
205
210 void setSharedNetworks(const std::string& xpath,
211 isc::data::ConstElementPtr elem);
212
213 protected:
220 void setSharedNetworksKea(const std::string& xpath,
221 isc::data::ConstElementPtr elem);
222 };
223
224 }; // end of namespace isc::yang
225 }; // end of namespace isc
226
227 #endif // ISC_TRANSLATOR_SHARED_NETWORK_H
isc::yang::TranslatorSubnets
A translator class for converting a subnet list between YANG and JSON.
Definition: translator_subnet.h:299
isc::yang::TranslatorSharedNetworks
A translator class for converting a shared network list between YANG and JSON.
Definition: translator_shared_network.h:183
isc::yang::TranslatorSharedNetwork::setSharedNetwork
void setSharedNetwork(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set shared network from JSON to YANG.
Definition: translator_shared_network.cc:156
isc::yang::TranslatorSharedNetworks::setSharedNetworks
void setSharedNetworks(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set shared networks from JSON to YANG.
Definition: translator_shared_network.cc:320
isc::yang::TranslatorSharedNetwork::getSharedNetworkKea
isc::data::ElementPtr getSharedNetworkKea(const std::string &xpath, const std::string &subsel)
getSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
Definition: translator_shared_network.cc:59
isc::yang::TranslatorSharedNetwork
Shared network translation between YANG and JSON.
Definition: translator_shared_network.h:125
translator_subnet.h
isc
Defines the logger used by the top-level component of kea-dhcp-ddns.
Definition: agent_parser.cc:144
isc::yang::TranslatorSharedNetwork::getSharedNetwork
isc::data::ElementPtr getSharedNetwork(const std::string &xpath)
Get and translate a shared network from YANG to JSON.
Definition: translator_shared_network.cc:42
isc::yang::TranslatorSharedNetwork::~TranslatorSharedNetwork
virtual ~TranslatorSharedNetwork()
Destructor.
Definition: translator_shared_network.cc:38
isc::yang::TranslatorSharedNetwork::TranslatorSharedNetwork
TranslatorSharedNetwork(sysrepo::S_Session session, const std::string &model)
Constructor.
Definition: translator_shared_network.cc:23
isc::yang::TranslatorSharedNetworks::TranslatorSharedNetworks
TranslatorSharedNetworks(sysrepo::S_Session session, const std::string &model)
Constructor.
Definition: translator_shared_network.cc:275
isc::yang::TranslatorSharedNetworks::getSharedNetworks
isc::data::ElementPtr getSharedNetworks(const std::string &xpath)
Get and translate shared networks from YANG to JSON.
Definition: translator_shared_network.cc:295
isc::yang::TranslatorSharedNetworks::~TranslatorSharedNetworks
virtual ~TranslatorSharedNetworks()
Destructor.
Definition: translator_shared_network.cc:291
isc::yang::TranslatorSharedNetwork::setSharedNetworkKea
void setSharedNetworkKea(const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
setSharedNetwork for kea-dhcp4-server and kea-dhcp6-server models
Definition: translator_shared_network.cc:176
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
translator.h
isc::yang::TranslatorSharedNetworks::setSharedNetworksKea
void setSharedNetworksKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setSharedNetworks for kea-dhcp4-server and kea-dhcp6-server
Definition: translator_shared_network.cc:339