Kea  1.9.9-git
sanity_checker.h
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 #ifndef SANITY_CHECKER_H
8 #define SANITY_CHECKER_H
9 
10 #include <dhcpsrv/lease.h>
12 
13 namespace isc {
14 namespace dhcp {
15 
22  public:
23 
33  void checkLease(Lease4Ptr& lease, bool current = true);
34 
45  void checkLease(Lease6Ptr& lease, bool current = true);
46 
53  static bool leaseCheckingEnabled(bool current = true);
54 
55  private:
56 
66  template<typename LeaseType, typename SubnetsType>
67  void checkLeaseInternal(LeaseType& lease, const CfgConsistencyPtr& checks,
68  const SubnetsType& subnets);
69 
77  template<typename LeaseType, typename SubnetsType>
78  SubnetID findSubnetId(const LeaseType& lease, const SubnetsType& subnets);
79 };
80 
81 
82 };
83 };
84 
85 
86 #endif /* SANITY_CHECKER_H */
static bool leaseCheckingEnabled(bool current=true)
Indicates the specified configuration enables lease sanity checking.
boost::shared_ptr< CfgConsistency > CfgConsistencyPtr
Type used to for pointing to CfgConsistency structure.
Code used to conduct various sanity checks.
boost::shared_ptr< Lease4 > Lease4Ptr
Pointer to a Lease4 structure.
Definition: lease.h:283
Defines the logger used by the top-level component of kea-dhcp-ddns.
boost::shared_ptr< Lease6 > Lease6Ptr
Pointer to a Lease6 structure.
Definition: lease.h:492
void checkLease(Lease4Ptr &lease, bool current=true)
Sanity checks and possibly corrects an IPv4 lease.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
Definition: lease.h:24