Kea: cfg_consistency.cc Source File

| Kea 1.5.0

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