Kea
1.9.9-git
|
Code used to conduct various sanity checks. More...
#include <sanity_checker.h>
Public Member Functions | |
void | checkLease (Lease4Ptr &lease, bool current=true) |
Sanity checks and possibly corrects an IPv4 lease. More... | |
void | checkLease (Lease6Ptr &lease, bool current=true) |
Sanity checks and possibly corrects an IPv6 lease. More... | |
template<typename LeasePtrType , typename SubnetsType > | |
void | checkLeaseInternal (LeasePtrType &lease, const CfgConsistencyPtr &checks, const SubnetsType &subnets) |
Static Public Member Functions | |
static bool | leaseCheckingEnabled (bool current=true) |
Indicates the specified configuration enables lease sanity checking. More... | |
Code used to conduct various sanity checks.
Currently used for leases.
This class is expected to be used as a simple interface sanity checker for various run-time and configuration elements. Currently is provides sanity checking and correction for subnet-id parameter in leases.
Definition at line 21 of file sanity_checker.h.
void isc::dhcp::SanityChecker::checkLease | ( | Lease4Ptr & | lease, |
bool | current = true |
||
) |
Sanity checks and possibly corrects an IPv4 lease.
Depending on the sanity-checks/lease-checks parameter value (see CfgConsistency for details), this code may print a warning, correct subnet-id or discard the lease.
lease | Lease to be sanity-checked |
current | specify whether to use current (true) or staging (false) config |
Definition at line 34 of file sanity_checker.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::getStagingCfg(), isc::dhcp::CfgMgr::instance(), and isc::dhcp::CfgConsistency::LEASE_CHECK_NONE.
void isc::dhcp::SanityChecker::checkLease | ( | Lease6Ptr & | lease, |
bool | current = true |
||
) |
Sanity checks and possibly corrects an IPv6 lease.
Depending on the sanity-checks/lease-checks parameter value (see CfgConsistency for details), this code may print a warning, correct subnet-id or discard the lease. Note that if the lease type is TYPE_PD, it simply returns.
lease | Lease to be sanity-checked |
current | specify whether to use current (true) or staging (false) config |
Definition at line 52 of file sanity_checker.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::getStagingCfg(), isc::dhcp::CfgMgr::instance(), isc::dhcp::CfgConsistency::LEASE_CHECK_NONE, and isc::dhcp::Lease::TYPE_NA.
void isc::dhcp::SanityChecker::checkLeaseInternal | ( | LeasePtrType & | lease, |
const CfgConsistencyPtr & | checks, | ||
const SubnetsType & | subnets | ||
) |
Definition at line 75 of file sanity_checker.cc.
References isc::dhcp::DHCPSRV_LEASE_SANITY_FAIL, isc::dhcp::DHCPSRV_LEASE_SANITY_FAIL_DISCARD, isc::dhcp::DHCPSRV_LEASE_SANITY_FIXED, isc::dhcp::dhcpsrv_logger, isc::dhcp::CfgConsistency::LEASE_CHECK_DEL, isc::dhcp::CfgConsistency::LEASE_CHECK_FIX, isc::dhcp::CfgConsistency::LEASE_CHECK_FIX_DEL, isc::dhcp::CfgConsistency::LEASE_CHECK_WARN, LOG_INFO, and LOG_WARN.
|
static |
Indicates the specified configuration enables lease sanity checking.
current | specifies whether to use current (true) or staging(false) server configuration |
Definition at line 18 of file sanity_checker.cc.
References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::getStagingCfg(), isc::dhcp::CfgMgr::instance(), and isc::dhcp::CfgConsistency::LEASE_CHECK_NONE.
Referenced by isc::dhcp::LeaseFileLoader::load().