Kea: translator_host.h Source File

| Kea 2.2.0

translator_host.h
Go to the documentation of this file.
1// Copyright (C) 2018-2021 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
10#include <yang/translator_option_data.h>
11#include <list>
12
13namespace isc {
14namespace yang {
15
105
114 class TranslatorHost : virtual public TranslatorOptionDataList {
115public:
116
121 TranslatorHost(sysrepo::S_Session session, const std::string& model);
122
124 virtual ~TranslatorHost();
125
131 isc::data::ElementPtr getHost(const std::string& xpath);
132
137 void setHost(const std::string& xpath, isc::data::ConstElementPtr elem);
138
139protected:
144 isc::data::ElementPtr getHostKea(const std::string& xpath);
145
150 void setHostKea(const std::string& xpath, isc::data::ConstElementPtr elem);
151};
152
161 class TranslatorHosts : virtual public TranslatorHost {
162public:
163
168 TranslatorHosts(sysrepo::S_Session session, const std::string& model);
169
171 virtual ~TranslatorHosts();
172
177 isc::data::ElementPtr getHosts(const std::string& xpath);
178
183 void setHosts(const std::string& xpath, isc::data::ConstElementPtr elem);
184
185protected:
191 void setHostsKea(const std::string& xpath,
192 isc::data::ConstElementPtr elem);
193};
194
195} // namespace yang
196} // namespace isc
197
198#endif // ISC_TRANSLATOR_HOST_H
isc::yang::TranslatorHost
Translation between YANG and JSON for a single host reservation.
Definition: translator_host.h:114
isc::yang::TranslatorHost::~TranslatorHost
virtual ~TranslatorHost()
Destructor.
Definition: translator_host.cc:27
isc::yang::TranslatorHost::getHost
isc::data::ElementPtr getHost(const std::string &xpath)
Get and translate a host reservation from YANG to JSON.
Definition: translator_host.cc:31
isc::yang::TranslatorHost::setHost
void setHost(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set host reservation from JSON to YANG.
Definition: translator_host.cc:105
isc::yang::TranslatorHost::TranslatorHost
TranslatorHost(sysrepo::S_Session session, const std::string &model)
Constructor.
Definition: translator_host.cc:21
isc::yang::TranslatorHost::getHostKea
isc::data::ElementPtr getHostKea(const std::string &xpath)
getHost for kea-dhcp[46]-server models.
Definition: translator_host.cc:47
isc::yang::TranslatorHost::setHostKea
void setHostKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setHost for kea-dhcp[46]-server models.
Definition: translator_host.cc:122
isc::yang::TranslatorHosts
A translator class for converting host reservations list between YANG and JSON.
Definition: translator_host.h:161
isc::yang::TranslatorHosts::getHosts
isc::data::ElementPtr getHosts(const std::string &xpath)
Get and translate host reservations from YANG to JSON.
Definition: translator_host.cc:193
isc::yang::TranslatorHosts::TranslatorHosts
TranslatorHosts(sysrepo::S_Session session, const std::string &model)
Constructor.
Definition: translator_host.cc:182
isc::yang::TranslatorHosts::setHosts
void setHosts(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set (address) host reservations from JSON to YANG.
Definition: translator_host.cc:199
isc::yang::TranslatorHosts::~TranslatorHosts
virtual ~TranslatorHosts()
Destructor.
Definition: translator_host.cc:189
isc::yang::TranslatorHosts::setHostsKea
void setHostsKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setHosts for kea-dhcp[46].
Definition: translator_host.cc:216
isc::yang::TranslatorOptionDataList
A translator class for converting an option data list between YANG and JSON.
Definition: translator_option_data.h:123
isc::data::ConstElementPtr
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:27
isc::data::ElementPtr
boost::shared_ptr< Element > ElementPtr
Definition: data.h:24
isc
Defines the logger used by the top-level component of kea-lfc.
Definition: agent_parser.cc:143
translator_option_data.h