Kea 3.0.0
isc::dhcp::CfgMgr Class Reference

Configuration Manager. More...

#include <cfgmgr.h>

Inheritance diagram for isc::dhcp::CfgMgr:

Public Member Functions

bool ddnsEnabled ()
 Convenience method for checking if DHCP-DDNS updates are enabled.
const D2ClientConfigPtrgetD2ClientConfig () const
 Fetches the DHCP-DDNS configuration pointer.
D2ClientMgrgetD2ClientMgr ()
 Fetches the DHCP-DDNS manager.
std::string getDataDir (bool reset=false, const std::string explicit_path="")
 Fetches the supported DHCP data directory.
void setD2ClientConfig (D2ClientConfigPtr &new_config)
 Updates the DHCP-DDNS client configuration to the given value.
std::string validatePath (const std::string data_path) const
 Validates a file path against the supported directory for DHDP data.

Static Public Member Functions

static CfgMgrinstance ()
 returns a single instance of Configuration Manager

Methods managing the collection of configurations.

The following methods manage the process of preparing a configuration without affecting a currently used configuration and then committing the configuration to replace current configuration atomically.

Todo
Migrate all configuration parameters to use the model supported by these functions.
void clear ()
 Remove current, staging, and external configurations.
void clearStagingConfiguration ()
 Remove staging configuration.
void commit ()
 Commits the staging configuration.
SrvConfigPtr getCurrentCfg ()
 Returns a pointer to the current configuration.
SrvConfigPtr getStagingCfg ()
 Returns a pointer to the staging configuration.
SrvConfigPtr createExternalCfg ()
 Creates an external configuration and returns pointer to it.
void mergeIntoStagingCfg (const uint32_t seq)
 Merges external configuration with the given sequence number into the staging configuration.
void mergeIntoCurrentCfg (const uint32_t seq)
 Merges external configuration with the given sequence number into the current configuration.
void setFamily (uint16_t family)
 Sets address family (AF_INET or AF_INET6)
uint16_t getFamily () const
 Returns address family.
 CfgMgr ()
 Protected constructor.
virtual ~CfgMgr ()=default
 virtual destructor

Detailed Description

Configuration Manager.

This singleton class holds the whole configuration for DHCPv4 and DHCPv6 servers.

Below is a sketch of configuration inheritance. Let's investigate the following configuration:

preferred-lifetime 500;
valid-lifetime 1000;
subnet6 2001:db8:1::/48 {
pool6 2001::db8:1::1 - 2001::db8:1::ff;
};
subnet6 2001:db8:2::/48 {
valid-lifetime 2000;
pool6 2001::db8:2::1 - 2001::db8:2::ff;
};

Parameters defined in a global scope are applicable to everything until they are overwritten in a smaller scope, in this case subnet6. In the example above, the first subnet6 has preferred lifetime of 500s and a valid lifetime of 1000s. The second subnet has preferred lifetime of 500s, but valid lifetime of 2000s.

Parameter inheritance is implemented in dedicated classes. See isc::dhcp::SimpleParser4::deriveParameters and isc::dhcp::SimpleParser6::deriveParameters.

Definition at line 71 of file cfgmgr.h.

Constructor & Destructor Documentation

◆ CfgMgr()

isc::dhcp::CfgMgr::CfgMgr ( )
protected

Protected constructor.

This constructor is protected for 2 reasons. First, it forbids any instantiations of this class (CfgMgr is a singleton). Second, it allows derived class to instantiate it. That is useful for testing purposes.

Definition at line 22 of file cfgmgr.cc.

Referenced by instance().

◆ ~CfgMgr()

virtual isc::dhcp::CfgMgr::~CfgMgr ( )
protectedvirtualdefault

virtual destructor

Member Function Documentation

◆ clear()

void isc::dhcp::CfgMgr::clear ( )

Remove current, staging, and external configurations.

This function removes all configurations, including current, staging and external configurations. It creates a new current configuration with default settings.

This function is exception safe.

Definition at line 74 of file cfgmgr.cc.

References setD2ClientConfig().

Here is the call graph for this function:

◆ clearStagingConfiguration()

void isc::dhcp::CfgMgr::clearStagingConfiguration ( )

Remove staging configuration.

This function is exception safe.

Definition at line 88 of file cfgmgr.cc.

Referenced by isc::dhcp::ControlledDhcpv4Srv::loadConfigFile(), and isc::dhcp::ControlledDhcpv6Srv::loadConfigFile().

◆ commit()

void isc::dhcp::CfgMgr::commit ( )

Commits the staging configuration.

The staging configuration becomes current configuration when this function is called.

This function is exception safe.

Definition at line 93 of file cfgmgr.cc.

◆ createExternalCfg()

SrvConfigPtr isc::dhcp::CfgMgr::createExternalCfg ( )

Creates an external configuration and returns pointer to it.

External configurations are those that come from other sources than from the configuration file, e.g. a database or a command. They are created aside and merged into the staging or current configuration. External configurations are accessed by their sequence numbers. The sequence numbers are autogenerated when the external configuration instance is created.

Returns
non-null pointer to created external configuration.

Definition at line 130 of file cfgmgr.cc.

Referenced by isc::dhcp::CBControlDHCPv4::databaseConfigApply(), and isc::dhcp::CBControlDHCPv6::databaseConfigApply().

◆ ddnsEnabled()

bool isc::dhcp::CfgMgr::ddnsEnabled ( )

Convenience method for checking if DHCP-DDNS updates are enabled.

Returns
True if the D2 configuration is enabled.

Definition at line 59 of file cfgmgr.cc.

◆ getCurrentCfg()

SrvConfigPtr isc::dhcp::CfgMgr::getCurrentCfg ( )

Returns a pointer to the current configuration.

This function returns pointer to the current configuration. If the current configuration is not set it will create a default configuration and return it.

In the previous Kea releases this method used to return a const pointer to the current configuration to ensure that it is not accidentally modified while the server is running. This has been changed in Kea 1.3 release and now this function returns a non-const pointer. The reason is that there are certain use cases when current configuration must be modified without going through a full cycle of server reconfiguration, e.g. add a subnet to the current configuration as a result of receiving a command over control API. In such case the performance of processing such command is critical and rebuilding the whole configuration just for this small configuration change is out of question.

Nevertheless, such configuration updates should always be made with caution and one has to make sure that the configuration data integrity is preserved.

Returns
Non-null pointer to the current configuration.

Definition at line 116 of file cfgmgr.cc.

Referenced by isc::dhcp::Dhcpv4Srv::acceptServerId(), isc::lease_query::LeaseQueryImpl4::acceptServerId(), isc::class_cmds::ClassCmdsImpl::addClass(), isc::subnet_cmds::SubnetCmdsImpl::addNetwork(), isc::subnet_cmds::SubnetCmds::addNetwork4(), isc::subnet_cmds::SubnetCmds::addNetwork4Subnet(), isc::subnet_cmds::SubnetCmds::addNetwork6(), isc::subnet_cmds::SubnetCmds::addNetwork6Subnet(), isc::lease_query::LeaseQueryImpl4::addOptions(), isc::subnet_cmds::SubnetCmdsImpl::addSubnet(), isc::subnet_cmds::SubnetCmds::addSubnet4(), isc::subnet_cmds::SubnetCmds::addSubnet4Delta(), isc::subnet_cmds::SubnetCmds::addSubnet6(), isc::subnet_cmds::SubnetCmds::addSubnet6Delta(), isc::dhcp::Dhcpv4Srv::adjustIfaceData(), isc::dhcp::Dhcpv4Srv::assignLease(), isc::radius::RadiusAccounting::buildAcct(), isc::radius::RadiusAccounting::buildAcct(), isc::radius::RadiusAccounting::buildAcct4(), isc::radius::RadiusAccounting::buildAcct6(), isc::dhcp::Dhcpv4Srv::buildCfgOptionList(), isc::dhcp::Dhcpv6Srv::buildCfgOptionList(), isc::lease_query::LeaseQueryImpl4::buildCfgOptionList(), cb6_updated(), isc::dhcp::SanityChecker::checkLease(), isc::dhcp::SanityChecker::checkLease(), checkLoggingEnabledSubnet4(), checkLoggingEnabledSubnet6(), isc::dhcp::configureCommandChannel(), isc::dhcp::CBControlDHCPv4::databaseConfigApply(), isc::dhcp::CBControlDHCPv6::databaseConfigApply(), isc::dhcp::Dhcpv4Srv::declineLease(), isc::dhcp::Dhcpv6Srv::declineLease(), isc::dhcp::Dhcpv4Srv::deferredUnpack(), isc::class_cmds::ClassCmdsImpl::delClass(), isc::dhcp::deleteAssignedLease(), isc::subnet_cmds::SubnetCmdsImpl::delNetwork(), isc::subnet_cmds::SubnetCmds::delNetwork4(), isc::subnet_cmds::SubnetCmds::delNetwork4Subnet(), isc::subnet_cmds::SubnetCmds::delNetwork6(), isc::subnet_cmds::SubnetCmds::delNetwork6Subnet(), isc::subnet_cmds::SubnetCmdsImpl::delSubnet(), isc::subnet_cmds::SubnetCmds::delSubnet4(), isc::subnet_cmds::SubnetCmds::delSubnet4Delta(), isc::subnet_cmds::SubnetCmds::delSubnet6(), isc::subnet_cmds::SubnetCmds::delSubnet6Delta(), isc::dhcp::Dhcpv4Srv::earlyGHRLookup(), isc::dhcp::Dhcpv6Srv::earlyGHRLookup(), isc::dhcp::Dhcpv4Srv::evaluateAdditionalClasses(), isc::dhcp::Dhcpv6Srv::evaluateAdditionalClasses(), isc::dhcp::Dhcpv4Exchange::evaluateClasses(), isc::dhcp::Dhcpv6Srv::evaluateClasses(), isc::dhcp::Memfile_LeaseMgr::extractExtendedInfo4(), isc::class_cmds::ClassCmdsImpl::getClass(), isc::class_cmds::ClassCmdsImpl::getClassList(), isc::dhcp::AllocEngine::ClientContext4::getDdnsParams(), isc::dhcp::AllocEngine::ClientContext6::getDdnsParams(), isc::dhcp::AllocEngine::getLifetimes6(), isc::dhcp::Dhcpv6Srv::getMAC(), isc::subnet_cmds::SubnetCmds::getNetwork4(), isc::subnet_cmds::SubnetCmds::getNetwork4List(), isc::subnet_cmds::SubnetCmds::getNetwork6(), isc::subnet_cmds::SubnetCmds::getNetwork6List(), isc::dhcp::AllocEngine::getOfferLft(), isc::ping_check::PingCheckMgr::getScopedConfig(), isc::subnet_cmds::SubnetCmds::getSubnet4(), isc::subnet_cmds::SubnetCmds::getSubnet4List(), isc::subnet_cmds::SubnetCmds::getSubnet6(), isc::subnet_cmds::SubnetCmds::getSubnet6List(), isc::dhcp::AllocEngine::getValidLft(), isc::lease_query::LeaseQueryImpl6::initReply(), isc::dhcp::CfgSubnets4::initSelector(), isc::ha::HAImpl::lease4Expire(), isc::lease_cmds::LeaseCmdsImpl::lease4UpdateHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6BulkApplyHandler(), isc::ha::HAImpl::lease6Expire(), isc::lease_cmds::LeaseCmdsImpl::lease6UpdateHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseAddHandler(), isc::dhcp::SanityChecker::leaseCheckingEnabled(), legalLog4Handler(), legalLog6Handler(), isc::lease_query::LeaseQueryImpl6::makeClientOption(), isc::stat_cmds::LeaseStatCmdsImpl::makeResultSet4(), isc::stat_cmds::LeaseStatCmdsImpl::makeResultSet6(), mergeIntoCurrentCfg(), isc::limits::LimitManager::pkt_receive(), isc::dhcp::Dhcpv6Srv::processLocalizedQuery6(), isc::dhcp::Dhcpv4Srv::processRelease(), isc::dhcp::Dhcpv6Srv::processRSOO(), isc::lease_query::LeaseQueryImpl6::queryByClientId(), isc::lease_query::LeaseQueryImpl4::queryByIpAddress(), isc::lease_query::LeaseQueryImpl6::queryByIpAddress(), isc::lease_query::LeaseQueryImpl6::queryByLinkStart(), isc::lease_query::LeaseQueryImpl6::queryByRelayIdStart(), isc::lease_query::LeaseQueryImpl6::queryByRemoteIdStart(), isc::dhcp::queueNCR(), isc::dhcp::queueNCR(), isc::dhcp::LeaseMgr::recountLeaseStats4(), isc::dhcp::LeaseMgr::recountLeaseStats6(), isc::dhcp::Dhcpv4Srv::recoverStashedAgentOption(), isc::dhcp::Dhcpv6Srv::releaseIA_NA(), isc::dhcp::Dhcpv6Srv::releaseIA_PD(), isc::dhcp::Dhcpv4Exchange::removeDependentEvaluatedClasses(), isc::dhcp::Dhcpv6Srv::removeDependentEvaluatedClasses(), isc::radius::RadiusAccess::reselectSubnet(), isc::radius::RadiusAccess::reselectSubnet(), isc::radius::RadiusAccess::reselectSubnet(), isc::radius::RadiusAccess::reselectSubnet(), isc::dhcp::Dhcpv4Srv::selectSubnet(), isc::dhcp::Dhcpv6Srv::selectSubnet(), isc::dhcp::Dhcpv4Srv::selectSubnet4o6(), isc::lease_query::BulkLeaseQuery4::sendActive(), isc::dhcp::Dhcpv4Srv::serverDecline(), isc::dhcp::Dhcpv4Srv::setFixedFields(), isc::dhcp::Dhcpv4Exchange::setHostIdentifiers(), isc::dhcp::Dhcpv6Srv::setHostIdentifiers(), isc::radius::RadiusAccess::terminate4Internal(), isc::radius::RadiusAccess::terminate6Internal(), isc::lease_query::LeaseQueryImpl6::testServerId(), isc::class_cmds::ClassCmdsImpl::updateClass(), isc::dhcp::AllocEngine::updateLease4ExtendedInfo(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnAdd(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnAdd(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnDelete(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnDelete(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnUpdate(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnUpdate(), isc::subnet_cmds::SubnetCmdsImpl::updateSubnet(), isc::subnet_cmds::SubnetCmds::updateSubnet4(), and isc::subnet_cmds::SubnetCmds::updateSubnet6().

◆ getD2ClientConfig()

const D2ClientConfigPtr & isc::dhcp::CfgMgr::getD2ClientConfig ( ) const

Fetches the DHCP-DDNS configuration pointer.

Returns
a reference to the current configuration pointer.

Definition at line 64 of file cfgmgr.cc.

◆ getD2ClientMgr()

◆ getDataDir()

std::string isc::dhcp::CfgMgr::getDataDir ( bool reset = false,
const std::string explicit_path = "" )

Fetches the supported DHCP data directory.

The first call to this function with no arguments will set the default hooks path to either the value of DHCP_DATA_DIR or the environment variable KEA_DHCP_DATA_DIR if it is defined. Subsequent calls with no arguments will simply return this value.

Parameters
resetrecalculate when true, defaults to false. This is for testing purposes only.
explicit_pathset default hooks path to this value. This is for testing purposes only.
Returns
String containing the default data directory.

Definition at line 35 of file cfgmgr.cc.

Referenced by isc::dhcp::Memfile_LeaseMgr::getDefaultLeaseFilePath().

◆ getFamily()

◆ getStagingCfg()

SrvConfigPtr isc::dhcp::CfgMgr::getStagingCfg ( )

Returns a pointer to the staging configuration.

The staging configuration is used by the configuration parsers to create new configuration. The staging configuration doesn't affect the server's operation until it is committed. The staging configuration is a non-const object which can be modified by the caller.

Multiple consecutive calls to this function return the same object which can be modified from various places of the code (e.g. various configuration parsers).

Returns
non-null pointer to the staging configuration.

Definition at line 121 of file cfgmgr.cc.

Referenced by isc::dhcp::HostReservationIdsParser4::HostReservationIdsParser4(), isc::dhcp::HostReservationIdsParser6::HostReservationIdsParser6(), isc::lease_query::LeaseQueryImpl6::LeaseQueryImpl6(), isc::legal_log::LegalSyslog::LegalSyslog(), isc::dhcp::Memfile_LeaseMgr::buildExtendedInfoTables6(), isc::radius::RadiusImpl::checkEarlyGlobalResvLookup(), isc::dhcp::SanityChecker::checkLease(), isc::dhcp::SanityChecker::checkLease(), isc::radius::RadiusImpl::checkSharedNetworks(), isc::dhcp::configureCommandChannel(), isc::dhcp::configureDhcp4Server(), isc::dhcp::configureDhcp6Server(), isc::dhcp::CBControlDHCPv4::databaseConfigApply(), isc::dhcp::CBControlDHCPv6::databaseConfigApply(), isc::dhcp::Memfile_LeaseMgr::extractExtendedInfo4(), isc::dhcp::SanityChecker::leaseCheckingEnabled(), mergeIntoStagingCfg(), isc::dhcp::Dhcp4to6Ipc::open(), isc::dhcp::Dhcp6to4Ipc::open(), isc::dhcp::Subnet4ConfigParser::parse(), isc::dhcp::Subnet6ConfigParser::parse(), isc::radius::RadiusConfigParser::parse(), isc::dhcp::ControlledDhcpv4Srv::processConfig(), isc::dhcp::ControlledDhcpv6Srv::processConfig(), isc::dhcp::processDhcp4Config(), isc::dhcp::processDhcp6Config(), and isc::ha::HAConfig::validate().

◆ instance()

CfgMgr & isc::dhcp::CfgMgr::instance ( )
static

returns a single instance of Configuration Manager

CfgMgr is a singleton and this method is the only way of accessing it.

Definition at line 29 of file cfgmgr.cc.

References CfgMgr().

Referenced by isc::class_cmds::ClassCmdsImpl::ClassCmdsImpl(), isc::host_cmds::HostCmdsImpl::HostCmdsImpl(), isc::dhcp::HostReservationIdsParser4::HostReservationIdsParser4(), isc::dhcp::HostReservationIdsParser6::HostReservationIdsParser6(), isc::lease_query::LeaseQueryImpl6::LeaseQueryImpl6(), isc::legal_log::LegalSyslog::LegalSyslog(), isc::dhcp::Dhcpv4Srv::acceptServerId(), isc::lease_query::LeaseQueryImpl4::acceptServerId(), isc::class_cmds::ClassCmdsImpl::addClass(), isc::subnet_cmds::SubnetCmdsImpl::addNetwork(), isc::subnet_cmds::SubnetCmds::addNetwork4(), isc::subnet_cmds::SubnetCmds::addNetwork4Subnet(), isc::subnet_cmds::SubnetCmds::addNetwork6(), isc::subnet_cmds::SubnetCmds::addNetwork6Subnet(), isc::lease_query::LeaseQueryImpl4::addOptions(), isc::subnet_cmds::SubnetCmdsImpl::addSubnet(), isc::subnet_cmds::SubnetCmds::addSubnet4(), isc::subnet_cmds::SubnetCmds::addSubnet4Delta(), isc::subnet_cmds::SubnetCmds::addSubnet6(), isc::subnet_cmds::SubnetCmds::addSubnet6Delta(), isc::dhcp::Dhcpv4Srv::adjustIfaceData(), isc::ha::LeaseSyncFilter::apply(), isc::dhcp::Dhcpv4Srv::assignLease(), isc::radius::RadiusAccounting::buildAcct(), isc::radius::RadiusAccounting::buildAcct(), isc::radius::RadiusAccounting::buildAcct4(), isc::radius::RadiusAccounting::buildAcct6(), isc::dhcp::Dhcpv4Srv::buildCfgOptionList(), isc::dhcp::Dhcpv6Srv::buildCfgOptionList(), isc::lease_query::LeaseQueryImpl4::buildCfgOptionList(), isc::dhcp::Memfile_LeaseMgr::buildExtendedInfoTables6(), isc::host_cache::HostCache::cacheWriteHandler(), cb4_updated(), cb6_updated(), isc::limits::LimitManager::cb_updated(), isc::radius::RadiusImpl::checkEarlyGlobalResvLookup(), isc::dhcp::SanityChecker::checkLease(), isc::dhcp::SanityChecker::checkLease(), checkLoggingEnabledSubnet4(), checkLoggingEnabledSubnet6(), isc::radius::RadiusImpl::checkSharedNetworks(), isc::dhcp::configureCommandChannel(), isc::dhcp::configureDhcp4Server(), isc::dhcp::configureDhcp6Server(), isc::dhcp::Dhcpv6Srv::createNameChangeRequests(), isc::dhcp::SubnetConfigParser::createSubnet(), isc::dhcp::Dhcpv4Srv::d2ClientErrorHandler(), isc::dhcp::Dhcpv6Srv::d2ClientErrorHandler(), isc::dhcp::CBControlDHCPv4::databaseConfigApply(), isc::dhcp::CBControlDHCPv6::databaseConfigApply(), ddns4_update(), ddns6_update(), isc::dhcp::Dhcpv4Srv::declineLease(), isc::dhcp::Dhcpv6Srv::declineLease(), isc::dhcp::Dhcpv4Srv::deferredUnpack(), isc::class_cmds::ClassCmdsImpl::delClass(), isc::dhcp::deleteAssignedLease(), isc::subnet_cmds::SubnetCmdsImpl::delNetwork(), isc::subnet_cmds::SubnetCmds::delNetwork4(), isc::subnet_cmds::SubnetCmds::delNetwork4Subnet(), isc::subnet_cmds::SubnetCmds::delNetwork6(), isc::subnet_cmds::SubnetCmds::delNetwork6Subnet(), isc::subnet_cmds::SubnetCmdsImpl::delSubnet(), isc::subnet_cmds::SubnetCmds::delSubnet4(), isc::subnet_cmds::SubnetCmds::delSubnet4Delta(), isc::subnet_cmds::SubnetCmds::delSubnet6(), isc::subnet_cmds::SubnetCmds::delSubnet6Delta(), isc::limits::LimitManager::dhcp_srv_configured(), isc::dhcp::Dhcpv4Srv::earlyGHRLookup(), isc::dhcp::Dhcpv6Srv::earlyGHRLookup(), isc::dhcp::Dhcpv4Srv::evaluateAdditionalClasses(), isc::dhcp::Dhcpv6Srv::evaluateAdditionalClasses(), isc::dhcp::Dhcpv4Exchange::evaluateClasses(), isc::dhcp::Dhcpv6Srv::evaluateClasses(), isc::dhcp::Memfile_LeaseMgr::extractExtendedInfo4(), isc::dhcp::ControlledDhcpv4Srv::finishConfigHookLibraries(), isc::dhcp::ControlledDhcpv6Srv::finishConfigHookLibraries(), isc::class_cmds::ClassCmdsImpl::getClass(), isc::class_cmds::ClassCmdsImpl::getClassList(), isc::dhcp::Memfile_LeaseMgr::getDBVersion(), isc::dhcp::AllocEngine::ClientContext4::getDdnsParams(), isc::dhcp::AllocEngine::ClientContext6::getDdnsParams(), isc::dhcp::Memfile_LeaseMgr::getDefaultLeaseFilePath(), isc::dhcp::AllocEngine::getLifetimes6(), isc::dhcp::Dhcpv6Srv::getMAC(), isc::subnet_cmds::SubnetCmds::getNetwork4(), isc::subnet_cmds::SubnetCmds::getNetwork4List(), isc::subnet_cmds::SubnetCmds::getNetwork6(), isc::subnet_cmds::SubnetCmds::getNetwork6List(), isc::dhcp::AllocEngine::getOfferLft(), isc::ping_check::PingCheckMgr::getScopedConfig(), isc::subnet_cmds::SubnetCmds::getSubnet4(), isc::subnet_cmds::SubnetCmds::getSubnet4List(), isc::subnet_cmds::SubnetCmds::getSubnet6(), isc::subnet_cmds::SubnetCmds::getSubnet6List(), isc::dhcp::AllocEngine::getValidLft(), isc::lease_query::LeaseQueryImpl6::initReply(), isc::dhcp::CfgSubnets4::initSelector(), isc::ha::HAImpl::lease4Expire(), isc::lease_cmds::LeaseCmdsImpl::lease4ResendDdnsHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4UpdateHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6BulkApplyHandler(), isc::ha::HAImpl::lease6Expire(), isc::lease_cmds::LeaseCmdsImpl::lease6ResendDdnsHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6UpdateHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseAddHandler(), isc::dhcp::SanityChecker::leaseCheckingEnabled(), isc::lease_cmds::LeaseCmdsImpl::leaseWriteHandler(), legalLog4Handler(), legalLog6Handler(), isc::limits::load(), load(), isc::dhcp::ControlledDhcpv4Srv::loadConfigFile(), isc::dhcp::ControlledDhcpv6Srv::loadConfigFile(), main(), isc::lease_query::LeaseQueryImpl6::makeClientOption(), isc::stat_cmds::LeaseStatCmdsImpl::makeResultSet4(), isc::stat_cmds::LeaseStatCmdsImpl::makeResultSet6(), isc::dhcp::SrvConfig::merge(), isc::dhcp::Dhcp4to6Ipc::open(), isc::dhcp::Dhcp6to4Ipc::open(), isc::dhcp::CompatibilityParser::parse(), isc::dhcp::SharedNetwork4Parser::parse(), isc::dhcp::SharedNetwork6Parser::parse(), isc::dhcp::Subnet4ConfigParser::parse(), isc::dhcp::Subnet6ConfigParser::parse(), isc::radius::RadiusAttributeParser::parse(), isc::radius::RadiusConfigParser::parse(), isc::limits::LimitManager::pkt_receive(), isc::dhcp::Dhcpv4Srv::postAllocateNameUpdate(), isc::dhcp::Dhcpv6Srv::processClientFqdn(), isc::dhcp::Dhcpv4Srv::processClientName(), isc::dhcp::ControlledDhcpv4Srv::processConfig(), isc::dhcp::ControlledDhcpv6Srv::processConfig(), isc::dhcp::processDhcp4Config(), isc::dhcp::processDhcp6Config(), isc::dhcp::Dhcpv6Srv::processLocalizedQuery6(), isc::dhcp::Dhcpv4Srv::processRelease(), isc::dhcp::Dhcpv6Srv::processRSOO(), isc::lease_query::LeaseQueryImpl6::queryByClientId(), isc::lease_query::LeaseQueryImpl4::queryByIpAddress(), isc::lease_query::LeaseQueryImpl6::queryByIpAddress(), isc::lease_query::LeaseQueryImpl6::queryByLinkStart(), isc::lease_query::LeaseQueryImpl6::queryByRelayIdStart(), isc::lease_query::LeaseQueryImpl6::queryByRemoteIdStart(), isc::dhcp::queueNCR(), isc::dhcp::queueNCR(), isc::dhcp::LeaseMgr::recountLeaseStats4(), isc::dhcp::LeaseMgr::recountLeaseStats6(), isc::dhcp::Dhcpv4Srv::recoverStashedAgentOption(), isc::dhcp::Dhcpv6Srv::releaseIA_NA(), isc::dhcp::Dhcpv6Srv::releaseIA_PD(), isc::dhcp::Dhcpv4Exchange::removeDependentEvaluatedClasses(), isc::dhcp::Dhcpv6Srv::removeDependentEvaluatedClasses(), isc::radius::RadiusAccess::reselectSubnet(), isc::radius::RadiusAccess::reselectSubnet(), isc::radius::RadiusAccess::reselectSubnet(), isc::radius::RadiusAccess::reselectSubnet(), isc::dhcp::Dhcpv4Srv::selectSubnet(), isc::dhcp::Dhcpv6Srv::selectSubnet(), isc::dhcp::Dhcpv4Srv::selectSubnet4o6(), isc::lease_query::BulkLeaseQuery4::sendActive(), isc::dhcp::Dhcpv4Srv::serverDecline(), isc::dhcp::Dhcpv4Srv::setFixedFields(), isc::dhcp::Dhcpv4Exchange::setHostIdentifiers(), isc::dhcp::Dhcpv6Srv::setHostIdentifiers(), isc::dhcp::LegalLogMgr::setRequestFormatExpression(), isc::dhcp::LegalLogMgr::setResponseFormatExpression(), isc::dhcp::Dhcpv4Srv::startD2(), isc::dhcp::Dhcpv6Srv::startD2(), isc::radius::RadiusImpl::startServices(), isc::dhcp::Dhcpv4Srv::stopD2(), isc::dhcp::Dhcpv6Srv::stopD2(), isc::radius::RadiusAccess::terminate4Internal(), isc::radius::RadiusAccess::terminate6Internal(), isc::lease_query::LeaseQueryImpl6::testServerId(), isc::dhcp::CfgHosts::toElement(), isc::dhcp::ClientClassDef::toElement(), isc::dhcp::SrvConfig::toElement(), unload(), isc::class_cmds::ClassCmdsImpl::updateClass(), isc::dhcp::AllocEngine::updateLease4ExtendedInfo(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnAdd(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnAdd(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnDelete(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnDelete(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnUpdate(), isc::lease_cmds::LeaseCmdsImpl::updateStatsOnUpdate(), isc::subnet_cmds::SubnetCmdsImpl::updateSubnet(), isc::subnet_cmds::SubnetCmds::updateSubnet4(), isc::subnet_cmds::SubnetCmds::updateSubnet6(), and isc::ha::HAConfig::validate().

Here is the call graph for this function:

◆ mergeIntoCurrentCfg()

void isc::dhcp::CfgMgr::mergeIntoCurrentCfg ( const uint32_t seq)

Merges external configuration with the given sequence number into the current configuration.

After the merge, the source configuration is discarded from the CfgMgr as it should not be used anymore.

Parameters
seqSource configuration sequence number.
Exceptions
BadValueif the external configuration with the given sequence number doesn't exist.

Definition at line 148 of file cfgmgr.cc.

References getCurrentCfg(), and isc::dhcp::LibDHCP::setRuntimeOptionDefs().

Referenced by isc::dhcp::CBControlDHCPv4::databaseConfigApply(), and isc::dhcp::CBControlDHCPv6::databaseConfigApply().

Here is the call graph for this function:

◆ mergeIntoStagingCfg()

void isc::dhcp::CfgMgr::mergeIntoStagingCfg ( const uint32_t seq)

Merges external configuration with the given sequence number into the staging configuration.

After the merge, the source configuration is discarded from the CfgMgr as it should not be used anymore.

Parameters
seqSource configuration sequence number.
Exceptions
BadValueif the external configuration with the given sequence number doesn't exist.

Definition at line 143 of file cfgmgr.cc.

References getStagingCfg().

Referenced by isc::dhcp::CBControlDHCPv4::databaseConfigApply(), and isc::dhcp::CBControlDHCPv6::databaseConfigApply().

Here is the call graph for this function:

◆ setD2ClientConfig()

void isc::dhcp::CfgMgr::setD2ClientConfig ( D2ClientConfigPtr & new_config)

Updates the DHCP-DDNS client configuration to the given value.

Passes the new configuration to the D2ClientMgr instance, d2_client_mgr_, which will attempt to apply the new configuration by shutting down its sender and opening a new connection per the new configuration (see D2ClientMgr::setD2ClientConfig()).

Parameters
new_configpointer to the new client configuration.
Exceptions
Underlyingmethod(s) will throw D2ClientError if given an empty pointer.

Definition at line 45 of file cfgmgr.cc.

Referenced by clear(), isc::dhcp::configureDhcp4Server(), and isc::dhcp::configureDhcp6Server().

◆ setFamily()

void isc::dhcp::CfgMgr::setFamily ( uint16_t family)
inline

Sets address family (AF_INET or AF_INET6)

Definition at line 241 of file cfgmgr.h.

Referenced by main().

◆ validatePath()

std::string isc::dhcp::CfgMgr::validatePath ( const std::string data_path) const

Validates a file path against the supported directory for DHDP data.

Parameters
data_pathdata path to validate.
Returns
validated path

Definition at line 40 of file cfgmgr.cc.

Referenced by isc::host_cache::HostCache::cacheWriteHandler(), and isc::lease_cmds::LeaseCmdsImpl::leaseWriteHandler().


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