Kea  1.5.0
isc::dhcp::SanityChecker Class Reference

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 IPv4 lease. More...
 
template<typename LeasePtrType , typename SubnetsType >
void checkLeaseInternal (LeasePtrType &lease, const CfgConsistencyPtr &checks, const SubnetsType &subnets)
 

Detailed Description

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.

Member Function Documentation

◆ checkLease() [1/2]

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.

Parameters
leaseLease to be sanity-checked
currentspecify whether to use current (true) or staging(false) config

Definition at line 16 of file sanity_checker.cc.

References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::getStagingCfg(), and isc::dhcp::CfgMgr::instance().

Referenced by isc::dhcp::LeaseFileLoader::load().

+ Here is the call graph for this function:

◆ checkLease() [2/2]

void isc::dhcp::SanityChecker::checkLease ( Lease6Ptr 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.

Parameters
leaseLease to be sanity-checked
currentspecify whether to use current (true) or staging(false) config

Definition at line 28 of file sanity_checker.cc.

References isc::dhcp::CfgMgr::getCurrentCfg(), isc::dhcp::CfgMgr::getStagingCfg(), and isc::dhcp::CfgMgr::instance().

+ Here is the call graph for this function:

◆ checkLeaseInternal()

template<typename LeasePtrType , typename SubnetsType >
void isc::dhcp::SanityChecker::checkLeaseInternal ( LeasePtrType &  lease,
const CfgConsistencyPtr checks,
const SubnetsType &  subnets 
)

The documentation for this class was generated from the following files: