Kea  1.9.9-git
translator_subnet.cc
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 #include <config.h>
8 
10 #include <yang/adaptor_pool.h>
11 #include <yang/yang_models.h>
12 #include <sstream>
13 
14 using namespace std;
15 using namespace isc::data;
16 #ifndef HAVE_PRE_0_7_6_SYSREPO
17 using namespace sysrepo;
18 #endif
19 
20 namespace isc {
21 namespace yang {
22 
23 TranslatorSubnet::TranslatorSubnet(S_Session session, const string& model)
24  : TranslatorBasic(session, model),
25  TranslatorOptionData(session, model),
26  TranslatorOptionDataList(session, model),
27  TranslatorPool(session, model),
28  TranslatorPools(session, model),
29  TranslatorPdPool(session, model),
30  TranslatorPdPools(session, model),
31  TranslatorHost(session, model),
32  TranslatorHosts(session, model) {
33 }
34 
36 }
37 
39 TranslatorSubnet::getSubnet(const string& xpath) {
40  try {
41  if (model_ == IETF_DHCPV6_SERVER) {
42  return (getSubnetIetf6(xpath));
43  } else if ((model_ == KEA_DHCP4_SERVER) ||
44  (model_ == KEA_DHCP6_SERVER)) {
45  return (getSubnetKea(xpath));
46  }
47  } catch (const sysrepo_exception& ex) {
49  "sysrepo error getting subnet at '" << xpath
50  << "': " << ex.what());
51  }
53  "getSubnet not implemented for the model: " << model_);
54 }
55 
57 TranslatorSubnet::getSubnetIetf6(const string& xpath) {
58  ElementPtr result = Element::createMap();
61  ConstElementPtr pools = getPools(xpath + "/address-pools");
62  if (pools) {
64  result->set("pools", pools);
65  }
66  pools = getPdPools(xpath + "/pd-pools");
67  if (pools && (pools->size() > 0)) {
68  result->set("pd-pools", pools);
69  }
70  ConstElementPtr subnet = getItem(xpath + "/network-prefix");
71  if (!subnet) {
72  isc_throw(BadValue, "getSubnetIetf6 requires network prefix");
73  }
74  result->set("subnet", subnet);
75  ConstElementPtr id = getItem(xpath + "/network-range-id");
76  if (!id) {
77  isc_throw(BadValue, "getSubnetIetf6 requires network range id");
78  }
79  result->set("id", id);
82  ConstElementPtr description = getItem(xpath + "/network-description");
84  if (description) {
85  ElementPtr context = Element::createMap();
86  context->set("description", description);
87  result->set("user-context", context);
88  }
90  AdaptorPool::toSubnet(model_, result, result->get("pools"));
91  return (result);
92 }
93 
95 TranslatorSubnet::getSubnetKea(const string& xpath) {
96  ElementPtr result = Element::createMap();
97  if (model_ == KEA_DHCP6_SERVER) {
98  ConstElementPtr preferred = getItem(xpath + "/preferred-lifetime");
99  if (preferred) {
100  result->set("preferred-lifetime", preferred);
101  }
102  ConstElementPtr min_pref = getItem(xpath + "/min-preferred-lifetime");
103  if (min_pref) {
104  result->set("min-preferred-lifetime", min_pref);
105  }
106  ConstElementPtr max_pref = getItem(xpath + "/max-preferred-lifetime");
107  if (max_pref) {
108  result->set("max-preferred-lifetime", max_pref);
109  }
110  }
111  ConstElementPtr valid = getItem(xpath + "/valid-lifetime");
112  if (valid) {
113  result->set("valid-lifetime", valid);
114  }
115  ConstElementPtr min_valid = getItem(xpath + "/min-valid-lifetime");
116  if (min_valid) {
117  result->set("min-valid-lifetime", min_valid);
118  }
119  ConstElementPtr max_valid = getItem(xpath + "/max-valid-lifetime");
120  if (max_valid) {
121  result->set("max-valid-lifetime", max_valid);
122  }
123  ConstElementPtr renew = getItem(xpath + "/renew-timer");
124 
125  if (renew) {
126  result->set("renew-timer", renew);
127  }
128  ConstElementPtr rebind = getItem(xpath + "/rebind-timer");
129  if (rebind) {
130  result->set("rebind-timer", rebind);
131  }
132  ConstElementPtr calculate = getItem(xpath + "/calculate-tee-times");
133  if (calculate) {
134  result->set("calculate-tee-times", calculate);
135  }
136  ConstElementPtr t1_percent = getItem(xpath + "/t1-percent");
137  if (t1_percent) {
138  result->set("t1-percent", t1_percent);
139  }
140  ConstElementPtr t2_percent = getItem(xpath + "/t2-percent");
141  if (t2_percent) {
142  result->set("t2-percent", t2_percent);
143  }
144  ConstElementPtr options = getOptionDataList(xpath);
145  if (options && (options->size() > 0)) {
146  result->set("option-data", options);
147  }
148  ConstElementPtr pools = getPools(xpath);
149  if (pools && (pools->size() > 0)) {
150  result->set("pools", pools);
151  }
152  if (model_ == KEA_DHCP6_SERVER) {
153  pools = getPdPools(xpath);
154  if (pools && (pools->size() > 0)) {
155  result->set("pd-pools", pools);
156  }
157  }
158  ConstElementPtr subnet = getItem(xpath + "/subnet");
159  if (!subnet) {
160  isc_throw(BadValue, "getSubnetKea requires subnet");
161  }
162  result->set("subnet", subnet);
163  ConstElementPtr interface = getItem(xpath + "/interface");
164  if (interface) {
165  result->set("interface", interface);
166  }
167  if (model_ == KEA_DHCP6_SERVER) {
168  ConstElementPtr interface_id = getItem(xpath + "/interface-id");
169  if (interface_id) {
170  result->set("interface-id", interface_id);
171  }
172  }
173  ConstElementPtr id = getItem(xpath + "/id");
174  if (!id) {
175  isc_throw(BadValue, "getSubnetKea requires id");
176  }
177  result->set("id", id);
178  if (model_ == KEA_DHCP6_SERVER) {
179  ConstElementPtr rapid_commit = getItem(xpath + "/rapid-commit");
180  if (rapid_commit) {
181  result->set("rapid-commit", rapid_commit);
182  }
183  }
184  ConstElementPtr guard = getItem(xpath + "/client-class");
185  if (guard) {
186  result->set("client-class", guard);
187  }
188  ConstElementPtr required = getItems(xpath + "/require-client-classes");
189  if (required && (required->size() > 0)) {
190  result->set("require-client-classes", required);
191  }
192  ConstElementPtr hosts = getHosts(xpath);
193  if (hosts && (hosts->size() > 0)) {
194  result->set("reservations", hosts);
195  }
196  ConstElementPtr mode = getItem(xpath + "/reservation-mode");
197  if (mode) {
198  result->set("reservation-mode", mode);
199  }
200  ConstElementPtr relay = getItems(xpath + "/relay/ip-addresses");
201  if (relay && (relay->size() > 0)) {
202  ElementPtr relay_map = Element::createMap();
203  relay_map->set("ip-addresses", relay);
204  result->set("relay", relay_map);
205  }
206  if (model_ == KEA_DHCP4_SERVER) {
207  ConstElementPtr match = getItem(xpath + "/match-client-id");
208  if (match) {
209  result->set("match-client-id", match);
210  }
211  ConstElementPtr auth = getItem(xpath + "/authoritative");
212  if (auth) {
213  result->set("authoritative", auth);
214  }
215  ConstElementPtr next = getItem(xpath + "/next-server");
216  if (next) {
217  result->set("next-server", next);
218  }
219  ConstElementPtr hostname = getItem(xpath + "/server-hostname");
220  if (hostname) {
221  result->set("server-hostname", hostname);
222  }
223  ConstElementPtr boot = getItem(xpath + "/boot-file-name");
224  if (boot) {
225  result->set("boot-file-name", boot);
226  }
227  ConstElementPtr s4o6_if = getItem(xpath + "/subnet-4o6-interface");
228  if (s4o6_if) {
229  result->set("4o6-interface", s4o6_if);
230  }
231  ConstElementPtr s4o6_id = getItem(xpath + "/subnet-4o6-interface-id");
232  if (s4o6_id) {
233  result->set("4o6-interface-id", s4o6_id);
234  }
235  ConstElementPtr s4o6_sub = getItem(xpath + "/subnet-4o6-subnet");
236  if (s4o6_sub) {
237  result->set("4o6-subnet", s4o6_sub);
238  }
239  }
240  ConstElementPtr context = getItem(xpath + "/user-context");
241  if (context) {
242  result->set("user-context", Element::fromJSON(context->stringValue()));
243  }
244  return (result);
245 }
246 
247 void
248 TranslatorSubnet::setSubnet(const string& xpath, ConstElementPtr elem) {
249  try {
250  if (model_ == IETF_DHCPV6_SERVER) {
251  setSubnetIetf6(xpath, elem);
252  } else if ((model_ == KEA_DHCP4_SERVER) ||
253  (model_ == KEA_DHCP6_SERVER)) {
254  setSubnetKea(xpath, elem);
255  } else {
257  "setSubnet not implemented for the model: " << model_);
258  }
259  } catch (const sysrepo_exception& ex) {
261  "sysrepo error setting subnet '" << elem->str()
262  << "' at '" << xpath << "': " << ex.what());
263  }
264 }
265 
266 void
269  AdaptorPool::fromSubnet(model_, elem, elem->get("pools"));
270  ConstElementPtr context = elem->get("user-context");
271  if (context && context->contains("description")) {
272  ConstElementPtr description = context->get("description");
273  if (description->getType() == Element::string) {
274  setItem(xpath + "/network-description", description, SR_STRING_T);
275  }
276  }
277  ConstElementPtr subnet = elem->get("subnet");
278  if (!subnet) {
279  isc_throw(BadValue, "setSubnetIetf6 requires subnet: " << elem->str());
280  }
281  setItem(xpath + "/network-prefix", subnet, SR_STRING_T);
283  ConstElementPtr pools = elem->get("pools");
284  if (pools && (pools->size() > 0)) {
285  setPools(xpath + "/address-pools", pools);
286  }
287  pools = elem->get("pd-pools");
288  if (pools && (pools->size() > 0)) {
289  setPdPools(xpath + "/pd-pools", pools);
290  }
292 }
293 
294 void
297  if (model_ == KEA_DHCP6_SERVER) {
298  ConstElementPtr preferred = elem->get("preferred-lifetime");
299  if (preferred) {
300  setItem(xpath + "/preferred-lifetime", preferred, SR_UINT32_T);
301  }
302  ConstElementPtr min_pref = elem->get("min-preferred-lifetime");
303  if (min_pref) {
304  setItem(xpath + "/min-preferred-lifetime", min_pref, SR_UINT32_T);
305  }
306  ConstElementPtr max_pref = elem->get("max-preferred-lifetime");
307  if (max_pref) {
308  setItem(xpath + "/max-preferred-lifetime", max_pref, SR_UINT32_T);
309  }
310  }
311  ConstElementPtr valid = elem->get("valid-lifetime");
312  if (valid) {
313  setItem(xpath + "/valid-lifetime", valid, SR_UINT32_T);
314  }
315  ConstElementPtr min_valid = elem->get("min-valid-lifetime");
316  if (min_valid) {
317  setItem(xpath + "/min-valid-lifetime", min_valid, SR_UINT32_T);
318  }
319  ConstElementPtr max_valid = elem->get("max-valid-lifetime");
320  if (max_valid) {
321  setItem(xpath + "/max-valid-lifetime", max_valid, SR_UINT32_T);
322  }
323  ConstElementPtr renew = elem->get("renew-timer");
324  if (renew) {
325  setItem(xpath + "/renew-timer", renew, SR_UINT32_T);
326  }
327  ConstElementPtr rebind = elem->get("rebind-timer");
328  if (rebind) {
329  setItem(xpath + "/rebind-timer", rebind, SR_UINT32_T);
330  }
331  ConstElementPtr calculate = elem->get("calculate-tee-times");
332  if (calculate) {
333  setItem(xpath + "/calculate-tee-times", calculate, SR_BOOL_T);
334  }
335  ConstElementPtr t1_percent = elem->get("t1-percent");
336  if (t1_percent) {
337  setItem(xpath + "/t1-percent", t1_percent, SR_DECIMAL64_T);
338  }
339  ConstElementPtr t2_percent = elem->get("t2-percent");
340  if (t2_percent) {
341  setItem(xpath + "/t2-percent", t2_percent, SR_DECIMAL64_T);
342  }
343  ConstElementPtr options = elem->get("option-data");
344  if (options && (options->size() > 0)) {
345  setOptionDataList(xpath, options);
346  }
347  ConstElementPtr pools = elem->get("pools");
348  if (pools && (pools->size() > 0)) {
349  setPools(xpath, pools);
350  }
351  if (model_ == KEA_DHCP6_SERVER) {
352  pools = elem->get("pd-pools");
353  if (pools && (pools->size() > 0)) {
354  setPdPools(xpath, pools);
355  }
356  }
357  ConstElementPtr subnet = elem->get("subnet");
358  if (!subnet) {
359  isc_throw(BadValue, "setSubnetKea requires subnet: " << elem->str());
360  }
361  setItem(xpath + "/subnet", subnet, SR_STRING_T);
362  ConstElementPtr interface = elem->get("interface");
363  if (interface) {
364  setItem(xpath + "/interface", interface, SR_STRING_T);
365  }
366  if (model_ == KEA_DHCP6_SERVER) {
367  ConstElementPtr interface_id = elem->get("interface-id");
368  if (interface_id) {
369  setItem(xpath + "/interface-id", interface_id, SR_STRING_T);
370  }
371  }
372  if (model_ == KEA_DHCP6_SERVER) {
373  ConstElementPtr rapid_commit = elem->get("rapid-commit");
374  if (rapid_commit) {
375  setItem(xpath + "/rapid-commit", rapid_commit, SR_BOOL_T);
376  }
377  }
378  ConstElementPtr guard = elem->get("client-class");
379  if (guard) {
380  setItem(xpath + "/client-class", guard, SR_STRING_T);
381  }
382  ConstElementPtr required = elem->get("require-client-classes");
383  if (required && (required->size() > 0)) {
384  for (ConstElementPtr rclass : required->listValue()) {
385  setItem(xpath + "/require-client-classes", rclass, SR_STRING_T);
386  }
387  }
388  ConstElementPtr hosts = elem->get("reservations");
389  if (hosts && (hosts->size() > 0)) {
390  setHosts(xpath, hosts);
391  }
392  ConstElementPtr mode = elem->get("reservation-mode");
393  if (mode) {
394  setItem(xpath + "/reservation-mode", mode, SR_ENUM_T);
395  }
396  ConstElementPtr relay = elem->get("relay");
397  if (relay) {
398  ConstElementPtr address = relay->get("ip-address");
399  ConstElementPtr addresses = relay->get("ip-addresses");
400  if (address) {
401  setItem(xpath + "/relay/ip-addresses", address, SR_STRING_T);
402  } else if (addresses && (addresses->size() > 0)) {
403  for (ConstElementPtr addr : addresses->listValue()) {
404  setItem(xpath + "/relay/ip-addresses", addr, SR_STRING_T);
405  }
406  }
407  }
408  if (model_ == KEA_DHCP4_SERVER) {
409  ConstElementPtr match = elem->get("match-client-id");
410  if (match) {
411  setItem(xpath + "/match-client-id", match, SR_BOOL_T);
412  }
413  ConstElementPtr auth = elem->get("authoritative");
414  if (auth) {
415  setItem(xpath + "/authoritative", auth, SR_BOOL_T);
416  }
417  ConstElementPtr next = elem->get("next-server");
418  if (next) {
419  setItem(xpath + "/next-server", next, SR_STRING_T);
420  }
421  ConstElementPtr hostname = elem->get("server-hostname");
422  if (hostname) {
423  setItem(xpath + "/server-hostname", hostname, SR_STRING_T);
424  }
425  ConstElementPtr boot = elem->get("boot-file-name");
426  if (boot) {
427  setItem(xpath + "/boot-file-name", boot, SR_STRING_T);
428  }
429  ConstElementPtr s4o6_if = elem->get("4o6-interface");
430  if (s4o6_if) {
431  setItem(xpath + "/subnet-4o6-interface", s4o6_if, SR_STRING_T);
432  }
433  ConstElementPtr s4o6_id = elem->get("4o6-interface-id");
434  if (s4o6_id) {
435  setItem(xpath + "/subnet-4o6-interface-id", s4o6_id, SR_STRING_T);
436  }
437  ConstElementPtr s4o6_subnet = elem->get("4o6-subnet");
438  if (s4o6_subnet) {
439  setItem(xpath + "/subnet-4o6-subnet", s4o6_subnet, SR_STRING_T);
440  }
441  }
442  ConstElementPtr context = Adaptor::getContext(elem);
443  if (context) {
444  ConstElementPtr repr = Element::create(context->str());
445  setItem(xpath + "/user-context", repr, SR_STRING_T);
446  }
447 }
448 
449 TranslatorSubnets::TranslatorSubnets(S_Session session, const string& model)
450  : TranslatorBasic(session, model),
451  TranslatorOptionData(session, model),
452  TranslatorOptionDataList(session, model),
453  TranslatorPool(session, model),
454  TranslatorPools(session, model),
455  TranslatorPdPool(session, model),
456  TranslatorPdPools(session, model),
457  TranslatorHost(session, model),
458  TranslatorHosts(session, model),
459  TranslatorSubnet(session, model) {
460 }
461 
463 }
464 
466 TranslatorSubnets::getSubnets(const string& xpath) {
467  try {
468  if (model_ == IETF_DHCPV6_SERVER) {
469  return (getSubnetsCommon(xpath, "network-range"));
470  } else if (model_ == KEA_DHCP4_SERVER) {
471  return (getSubnetsCommon(xpath, "subnet4"));
472  } else if (model_ == KEA_DHCP6_SERVER) {
473  return (getSubnetsCommon(xpath, "subnet6"));
474  }
475  } catch (const sysrepo_exception& ex) {
477  "sysrepo error getting subnets at '" << xpath
478  << "': " << ex.what());
479  }
481  "getSubnets not implemented for the model: " << model_);
482 }
483 
486  const std::string& subsel) {
487  ElementPtr result = Element::createList();
488  S_Iter_Value iter = getIter(xpath + "/" + subsel);
489  if (!iter) {
491  isc_throw(Unexpected, "getSubnets: can't get iterator: " << xpath);
492  }
493  for (;;) {
494  const string& subnet = getNext(iter);
495  if (subnet.empty()) {
496  break;
497  }
498  result->add(getSubnet(subnet));
499  }
500  return (result);
501 }
502 
503 void
504 TranslatorSubnets::setSubnets(const string& xpath, ConstElementPtr elem) {
505  try {
506  if (model_ == IETF_DHCPV6_SERVER) {
507  setSubnetsIetf6(xpath, elem);
508  } else if (model_ == KEA_DHCP4_SERVER) {
509  setSubnetsKea(xpath, elem, "subnet4");
510  } else if (model_ == KEA_DHCP6_SERVER) {
511  setSubnetsKea(xpath, elem, "subnet6");
512  } else {
514  "setSubnets not implemented for the model: " << model_);
515  }
516  } catch (const sysrepo_exception& ex) {
518  "sysrepo error setting subnets '" << elem->str()
519  << "' at '" << xpath << "': " << ex.what());
520  }
521 }
522 
523 void
525  for (size_t i = 0; i < elem->size(); ++i) {
526  ConstElementPtr subnet = elem->get(i);
527  ostringstream range;
528  range << xpath << "/network-range[network-range-id='";
529  ConstElementPtr id = subnet->get("id");
530  if (!id) {
531  isc_throw(BadValue, "subnet without id: " << elem->str());
532  }
533  range << id->intValue() << "']";
534  setSubnet(range.str().c_str(), subnet);
535  }
536 }
537 
538 void
540  const std::string& subsel) {
541  for (size_t i = 0; i < elem->size(); ++i) {
542  ConstElementPtr subnet = elem->get(i);
543  if (!subnet->contains("id")) {
544  isc_throw(BadValue, "subnet without id: " << subnet->str());
545  }
546  ostringstream prefix;
547  prefix << xpath << "/" << subsel << "[id='"
548  << subnet->get("id")->intValue() << "']";
549  setSubnet(prefix.str(), subnet);
550  }
551 }
552 
553 }; // end of namespace isc::yang
554 }; // end of namespace isc
isc::data::ElementPtr getItems(const std::string &xpath)
Get and translate a list of basic values from YANG to JSON.
Definition: translator.cc:126
virtual ~TranslatorSubnet()
Destructor.
isc::data::ElementPtr getHosts(const std::string &xpath)
Get and translate host reservations from YANG to JSON.
Subnet (aka network range) translation between YANG and JSON.
A generic exception that is thrown when a function is not implemented.
Between YANG and JSON translator class for basic values.
Definition: translator.h:27
isc::data::ElementPtr getSubnet(const std::string &xpath)
Get and translate a subnet from YANG to JSON.
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
STL namespace.
void setSubnetKea(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnet for kea-dhcp[46]-server.
A translator class for converting a pd-pool list between YANG and JSON.
isc::data::ElementPtr getPdPools(const std::string &xpath)
Get and translate pd-pools from YANG to JSON.
sysrepo::S_Iter_Value getIter(const std::string &xpath)
List iterator methods keeping the session private.
Definition: translator.cc:316
TranslatorSubnets(sysrepo::S_Session session, const std::string &model)
Constructor.
void setPools(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set (address) pools from JSON to YANG.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
void setItem(const std::string &xpath, isc::data::ConstElementPtr elem, sr_type_t type)
Translate and set basic value from JSON to YANG.
Definition: translator.cc:288
Translation between YANG and JSON for a single host reservation.
isc::data::ElementPtr getSubnetsCommon(const std::string &xpath, const std::string &subsel)
getSubnets common part.
A translator class for converting an option data list between YANG and JSON.
A generic exception that is thrown when an unexpected error condition occurs.
isc::data::ElementPtr getSubnets(const std::string &xpath)
Get and translate subnets from YANG to JSON.
std::string model_
The model.
Definition: translator.h:132
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:23
std::string getNext(sysrepo::S_Iter_Value iter)
Get xpath of the next YANG list item.
Definition: translator.cc:321
void setPdPools(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set pd-pools from JSON to YANG.
static isc::data::ConstElementPtr getContext(isc::data::ConstElementPtr parent)
Get user context.
Definition: adaptor.cc:27
isc::data::ElementPtr getSubnetKea(const std::string &xpath)
getSubnet for kea-dhcp[46]-server.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
Defines the logger used by the top-level component of kea-dhcp-ddns.
isc::data::ConstElementPtr getOptionDataList(const std::string &xpath)
Get and translate option data list from YANG to JSON.
isc::data::ElementPtr getItem(const std::string &xpath)
Get and translate basic value from YANG to JSON.
Definition: translator.cc:111
Prefix delegation pool translation between YANG and JSON.
A translator class for converting a pool between YANG and JSON.
void setSubnetsIetf6(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnets for ietf-dhcpv6-server.
void setSubnet(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set subnet from JSON to YANG.
virtual ~TranslatorSubnets()
Destructor.
A translator class for converting pools between YANG and JSON.
void setSubnets(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set subnets from JSON to YANG.
isc::data::ElementPtr getPools(const std::string &xpath)
Get and translate pools from YANG to JSON.
static void toSubnet(const std::string &model, isc::data::ElementPtr subnet, isc::data::ConstElementPtr pools)
Move parameters from pools to the subnet.
Definition: adaptor_pool.cc:67
Option data translation between YANG and JSON.
void setOptionDataList(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set option data list from JSON to YANG.
void setSubnetIetf6(const std::string &xpath, isc::data::ConstElementPtr elem)
setSubnet for ietf-dhcpv6-server.
void setSubnetsKea(const std::string &xpath, isc::data::ConstElementPtr elem, const std::string &subsel)
setSubnets for kea-dhcp[46]-server.
A translator class for converting host reservations list between YANG and JSON.
static void fromSubnet(const std::string &model, isc::data::ConstElementPtr subnet, isc::data::ConstElementPtr pools)
Moves parameters from subnets to pools.
Definition: adaptor_pool.cc:47
isc::data::ElementPtr getSubnetIetf6(const std::string &xpath)
getSubnet for ietf-dhcpv6-server.
void setHosts(const std::string &xpath, isc::data::ConstElementPtr elem)
Translate and set (address) host reservations from JSON to YANG.