Kea 2.7.6
cfg_consistency.h
Go to the documentation of this file.
1// Copyright (C) 2018-2022 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 CFG_CONSISTENCY_H
8#define CFG_CONSISTENCY_H
9
10#include <cc/cfg_to_element.h>
11#include <cc/user_context.h>
12
13namespace isc {
14namespace dhcp {
15
16
20
21 public:
22
25 LEASE_CHECK_NONE, // Skip sanity checks
26 LEASE_CHECK_WARN, // Print a warning if subnet-id is incorrect.
27 LEASE_CHECK_FIX, // If subnet-id is incorrect, try to fix it (try to pick
28 // appropriate subnet, but if it fails, keep the lease,
29 // despite its broken subnet-id.
30 LEASE_CHECK_FIX_DEL, // If subnet-id is incorrect, try to fix it (try to pick
31 // appropriate subnet. If it fails, delete broken lease.
32 LEASE_CHECK_DEL // Delete leases with invalid subnet-id.
33 };
34
37 EXTENDED_INFO_CHECK_NONE, // Skip sanity checks.
38 EXTENDED_INFO_CHECK_FIX, // Fix extended info common inconsistencies.
39 EXTENDED_INFO_CHECK_STRICT, // Fix extended info inconsistencies which
40 // have an impact for Bulk Lease Query.
41 EXTENDED_INFO_CHECK_PEDANTIC // Fix all extended info inconsistencies.
42 };
43
46 : lease_sanity_check_(LEASE_CHECK_NONE),
47 extended_info_sanity_check_(EXTENDED_INFO_CHECK_FIX) {
48 }
49
53 virtual isc::data::ElementPtr toElement() const;
54
59 lease_sanity_check_ = l;
60 }
61
66 return (lease_sanity_check_);
67 }
68
72 static std::string sanityCheckToText(LeaseSanity check_type);
73
78 extended_info_sanity_check_ = l;
79 }
80
85 return (extended_info_sanity_check_);
86 }
87
91 static std::string sanityCheckToText(ExtendedInfoSanity check_type);
92
93 private:
94
96 LeaseSanity lease_sanity_check_;
97
99 ExtendedInfoSanity extended_info_sanity_check_;
100};
101
103typedef boost::shared_ptr<CfgConsistency> CfgConsistencyPtr;
104
106typedef boost::shared_ptr<const CfgConsistency> ConstCfgConsistencyPtr;
107
108} // namespace isc::dhcp
109} // namespace isc
110
111#endif /* CFG_CONSISTENCY_H */
Parameters for various consistency checks.
virtual isc::data::ElementPtr toElement() const
Returns JSON representation.
void setLeaseSanityCheck(LeaseSanity l)
Sets specific sanity checks mode for leases.
LeaseSanity
Values for subnet-id sanity checks done for leases.
ExtendedInfoSanity getExtendedInfoSanityCheck() const
Returns specific sanity checks mode for extended info.
ExtendedInfoSanity
Values for extended info sanity checks done for leases.
LeaseSanity getLeaseSanityCheck() const
Returns specific sanity checks mode for leases.
void setExtendedInfoSanityCheck(ExtendedInfoSanity l)
Sets specific sanity checks mode for extended info.
static std::string sanityCheckToText(LeaseSanity check_type)
Converts lease sanity check value to printable text.
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
boost::shared_ptr< CfgConsistency > CfgConsistencyPtr
Type used to for pointing to CfgConsistency structure.
boost::shared_ptr< const CfgConsistency > ConstCfgConsistencyPtr
Type used to for pointing to const CfgConsistency structure.
Defines the logger used by the top-level component of kea-lfc.
Abstract class for configuration Cfg_* classes.
Base class for user context.