Kea 2.5.6
sanity_checker.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 SANITY_CHECKER_H
8#define SANITY_CHECKER_H
9
10#include <dhcpsrv/lease.h>
12
13namespace isc {
14namespace dhcp {
15
24public:
25
35 void checkLease(Lease4Ptr& lease, bool current = true);
36
47 void checkLease(Lease6Ptr& lease, bool current = true);
48
55 static bool leaseCheckingEnabled(bool current = true);
56
57 private:
58
68 template<typename LeaseType, typename SubnetsType>
69 void checkLeaseInternal(LeaseType& lease, const CfgConsistencyPtr& checks,
70 const SubnetsType& subnets);
71
79 template<typename LeaseType, typename SubnetsType>
80 SubnetID findSubnetId(const LeaseType& lease, const SubnetsType& subnets);
81};
82
83}
84}
85
86#endif /* SANITY_CHECKER_H */
Code used to conduct various sanity checks.
void checkLease(Lease4Ptr &lease, bool current=true)
Sanity checks and possibly corrects an IPv4 lease.
static bool leaseCheckingEnabled(bool current=true)
Indicates the specified configuration enables lease sanity checking.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition: lease.h:505
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:25
boost::shared_ptr< CfgConsistency > CfgConsistencyPtr
Type used to for pointing to CfgConsistency structure.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Definition: lease.h:292
Defines the logger used by the top-level component of kea-lfc.