Kea 2.2.0
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
13namespace isc {
14namespace 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 */
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:503
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
Definition: subnet_id.h:24
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:284
Defines the logger used by the top-level component of kea-lfc.