Kea 1.5.0
translator_host.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_HOST_H
8#define ISC_TRANSLATOR_HOST_H 1
9
11#include <list>
12
13namespace isc {
14namespace yang {
15
103
113public:
114
119#ifndef HAVE_PRE_0_7_6_SYSREPO
120 TranslatorHost(sysrepo::S_Session session, const std::string& model);
121#else
122 TranslatorHost(S_Session session, const std::string& model);
123#endif
124
126 virtual ~TranslatorHost();
127
133 isc::data::ElementPtr getHost(const std::string& xpath);
134
139 void setHost(const std::string& xpath, isc::data::ConstElementPtr elem);
140
141protected:
146 isc::data::ElementPtr getHostKea(const std::string& xpath);
147
152 void setHostKea(const std::string& xpath, isc::data::ConstElementPtr elem);
153};
154
163class TranslatorHosts : virtual public TranslatorHost {
164public:
165
170#ifndef HAVE_PRE_0_7_6_SYSREPO
171 TranslatorHosts(sysrepo::S_Session session, const std::string& model);
172#else
173 TranslatorHosts(S_Session session, const std::string& model);
174#endif
175
177 virtual ~TranslatorHosts();
178
183 isc::data::ElementPtr getHosts(const std::string& xpath);
184
189 void setHosts(const std::string& xpath, isc::data::ConstElementPtr elem);
190
191protected:
197 void setHostsKea(const std::string& xpath,
199};
200
201}; // end of namespace isc::yang
202}; // end of namespace isc
203
204#endif // ISC_TRANSLATOR_HOST_H
Translation between YANG and JSON for a single host reservation.
virtual ~TranslatorHost()
Destructor.
isc::data::ElementPtr getHost(const std::string &xpath)
Get and translate a host reservation from YANG to JSON.
void setHost(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set host reservation from JSON to YANG.
isc::data::ElementPtr getHostKea(const std::string &xpath)
getHost for kea-dhcp[46]-server models.
void setHostKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setHost for kea-dhcp[46]-server models.
A translator class for converting host reservations list between YANG and JSON.
isc::data::ElementPtr getHosts(const std::string &xpath)
Get and translate host reservations from YANG to JSON.
void setHosts(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set (address) host reservations from JSON to YANG.
virtual ~TranslatorHosts()
Destructor.
void setHostsKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setHosts for kea-dhcp[46].
A translator class for converting an option data list between YANG and JSON.
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
boost::shared_ptr< Element > ElementPtr
Definition: data.h:22
Defines the logger used by the top-level component of kea-dhcp-ddns.