Kea  1.9.9-git
cfg_consistency.cc
Go to the documentation of this file.
1 // Copyright (C) 2018-2020 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 <cc/data.h>
11 
12 using namespace isc::data;
13 
14 namespace isc {
15 namespace dhcp {
16 
17 isc::data::ElementPtr CfgConsistency::toElement() const {
18  ElementPtr m(new MapElement());
19  ElementPtr l(new StringElement(sanityCheckToText(getLeaseSanityCheck())));
20  m->set("lease-checks", l);
21 
22  return (m);
23 }
24 
25 std::string CfgConsistency::sanityCheckToText(LeaseSanity check_type) {
26  switch (check_type) {
27  case LEASE_CHECK_NONE:
28  return ("none");
29  case LEASE_CHECK_WARN:
30  return ("warn");
31  case LEASE_CHECK_FIX:
32  return ("fix");
33  case LEASE_CHECK_FIX_DEL:
34  return ("fix-del");
35  case LEASE_CHECK_DEL:
36  return ("del");
37  default:
38  return ("unknown");
39  }
40 }
41 
42 };
43 };
44 
45 
boost::shared_ptr< Element > ElementPtr
Definition: data.h:20
LeaseSanity
Values for subnet-id sanity checks done for leases.
Defines the logger used by the top-level component of kea-dhcp-ddns.