![]() |
Kea
2.3.5-git
|
Specifies current DHCP configuration. More...
#include <srv_config.h>
Public Member Functions | |
SrvConfig () | |
Default constructor. More... | |
SrvConfig (const uint32_t sequence) | |
Constructor. More... | |
void | addConfiguredGlobal (const std::string &name, isc::data::ConstElementPtr value) |
Adds a parameter to the collection configured globals. More... | |
void | applyDefaultsConfiguredGlobals (const isc::data::SimpleDefaults &defaults) |
Applies defaults to global parameters. More... | |
void | clearConfiguredGlobals () |
Removes all configured global parameters. More... | |
void | configureLowerLevelLibraries () const |
Convenience method to propagate configuration parameters through inversion of control. More... | |
void | copy (SrvConfig &new_config) const |
Copies the current configuration to a new configuration. More... | |
void | extractConfiguredGlobals (isc::data::ConstElementPtr config) |
Saves scalar elements from the global scope of a configuration. More... | |
CfgDbAccessPtr | getCfgDbAccess () |
Returns pointer to the object holding configuration of the lease and host database connection parameters. More... | |
ConstCfgDbAccessPtr | getCfgDbAccess () const |
Returns const pointer to the object holding configuration of the lease and host database connection parameters. More... | |
CfgDUIDPtr | getCfgDUID () |
Returns pointer to the object holding configuration of the server identifier. More... | |
ConstCfgDUIDPtr | getCfgDUID () const |
Returns const pointer to the object holding configuration of the server identifier. More... | |
CfgExpirationPtr | getCfgExpiration () |
Returns pointer to the object holding configuration pertaining to processing expired leases. More... | |
ConstCfgExpirationPtr | getCfgExpiration () const |
Returns pointer to the const object holding configuration pertaining to processing expired leases. More... | |
CfgHostOperationsPtr | getCfgHostOperations4 () |
Returns pointer to the object holding general configuration for host reservations in DHCPv4. More... | |
ConstCfgHostOperationsPtr | getCfgHostOperations4 () const |
Returns const pointer to the object holding general configuration for host reservations in DHCPv4. More... | |
CfgHostOperationsPtr | getCfgHostOperations6 () |
Returns pointer to the object holding general configuration for host reservations in DHCPv6. More... | |
ConstCfgHostOperationsPtr | getCfgHostOperations6 () const |
Returns const pointer to the object holding general configuration for host reservations in DHCPv6. More... | |
CfgHostsPtr | getCfgHosts () |
Returns pointer to the non-const objects representing host reservations for different IPv4 and IPv6 subnets. More... | |
ConstCfgHostsPtr | getCfgHosts () const |
Returns pointer to the const objects representing host reservations for different IPv4 and IPv6 subnets. More... | |
CfgIfacePtr | getCfgIface () |
Returns non-const pointer to interface configuration. More... | |
ConstCfgIfacePtr | getCfgIface () const |
Returns const pointer to interface configuration. More... | |
CfgOptionPtr | getCfgOption () |
Returns pointer to the non-const object holding options. More... | |
const ConstCfgOptionPtr | getCfgOption () const |
Returns pointer to the const object holding options. More... | |
CfgOptionDefPtr | getCfgOptionDef () |
Return pointer to non-const object representing user-defined option definitions. More... | |
ConstCfgOptionDefPtr | getCfgOptionDef () const |
Returns pointer to the const object representing user-defined option definitions. More... | |
CfgRSOOPtr | getCfgRSOO () |
Returns pointer to the non-const object representing set of RSOO-enabled options. More... | |
ConstCfgRSOOPtr | getCfgRSOO () const |
Returns pointer to the const object representing set of RSOO-enabled options. More... | |
CfgSharedNetworks4Ptr | getCfgSharedNetworks4 () const |
Returns pointer to non-const object holding configuration of shared networks in DHCPv4;. More... | |
CfgSharedNetworks6Ptr | getCfgSharedNetworks6 () const |
Returns pointer to non-const object holding configuration of shared networks in DHCPv6. More... | |
CfgSubnets4Ptr | getCfgSubnets4 () |
Returns pointer to non-const object holding subnets configuration for DHCPv4. More... | |
ConstCfgSubnets4Ptr | getCfgSubnets4 () const |
Returns pointer to const object holding subnets configuration for DHCPv4. More... | |
CfgSubnets6Ptr | getCfgSubnets6 () |
Returns pointer to non-const object holding subnets configuration for DHCPv6. More... | |
ConstCfgSubnets6Ptr | getCfgSubnets6 () const |
Returns pointer to const object holding subnets configuration for DHCPv6. More... | |
ClientClassDictionaryPtr | getClientClassDictionary () |
Returns pointer to the dictionary of global client class definitions. More... | |
const ClientClassDictionaryPtr | getClientClassDictionary () const |
Returns pointer to const dictionary of global client class definitions. More... | |
std::string | getConfigSummary (const uint32_t selection) const |
Returns summary of the configuration in the textual format. More... | |
isc::data::ConstElementPtr | getConfiguredGlobal (std::string name) const |
Returns pointer to a given configured global parameter. More... | |
isc::data::ConstElementPtr | getConfiguredGlobal (int index) const |
Returns pointer to a given configured global parameter. More... | |
CfgGlobalsPtr | getConfiguredGlobals () |
Returns non-const pointer to configured global parameters. More... | |
ConstCfgGlobalsPtr | getConfiguredGlobals () const |
Returns const pointer to configured global parameters. More... | |
CfgConsistencyPtr | getConsistency () |
Returns non-const pointer to object holding sanity checks flags. More... | |
ConstCfgConsistencyPtr | getConsistency () const |
Returns const pointer to object holding sanity checks flags. More... | |
const isc::data::ConstElementPtr | getControlSocketInfo () const |
Returns information about control socket. More... | |
D2ClientConfigPtr | getD2ClientConfig () |
Returns pointer to the D2 client configuration. More... | |
const D2ClientConfigPtr | getD2ClientConfig () const |
Returns pointer to const D2 client configuration. More... | |
DdnsParamsPtr | getDdnsParams (const Subnet4Ptr &subnet) const |
Fetches the DDNS parameters for a given DHCPv4 subnet. More... | |
DdnsParamsPtr | getDdnsParams (const Subnet6Ptr &subnet) const |
Fetches the DDNS parameters for a given DHCPv6 subnet. More... | |
uint32_t | getDeclinePeriod () const |
Returns probation-period. More... | |
uint16_t | getDhcp4o6Port () const |
Returns DHCP4o6 IPC port. More... | |
const isc::data::ConstElementPtr | getDHCPMultiThreading () const |
Returns DHCP multi threading information. More... | |
const isc::data::ConstElementPtr | getDHCPQueueControl () const |
Returns DHCP queue control information. More... | |
bool | getEchoClientId () const |
Returns whether server should send back client-id in DHCPv4. More... | |
isc::hooks::HooksConfig & | getHooksConfig () |
Returns non-const reference to configured hooks libraries. More... | |
const isc::hooks::HooksConfig & | getHooksConfig () const |
Returns const reference to configured hooks libraries. More... | |
bool | getIgnoreRAILinkSelection () const |
Get ignore RAI Link Selection compatibility flag. More... | |
bool | getLenientOptionParsing () const |
Get lenient option parsing compatibility flag. More... | |
CfgMACSource & | getMACSources () |
Returns non-const reference to an array that stores MAC/hardware address sources. More... | |
const CfgMACSource & | getMACSources () const |
Returns const reference to an array that stores MAC/hardware address sources. More... | |
bool | getReservationsLookupFirst () const |
Returns whether the server does host reservations lookup before lease lookup. More... | |
uint32_t | getSequence () const |
Returns configuration sequence number. More... | |
virtual void | merge (ConfigBase &other) |
Merges the configuration specified as a parameter into this configuration. More... | |
void | removeStatistics () |
Removes statistics. More... | |
void | sanityChecksLifetime (const std::string &name) const |
Conducts sanity checks on global lifetime parameters. More... | |
void | sanityChecksLifetime (const SrvConfig &target_config, const std::string &name) const |
Conducts sanity checks on global lifetime parameters before merge from the external configuration to the target one. More... | |
bool | sequenceEquals (const SrvConfig &other) |
Compares configuration sequence with other sequence. More... | |
void | setClientClassDictionary (const ClientClassDictionaryPtr &dictionary) |
Sets the client class dictionary. More... | |
void | setControlSocketInfo (const isc::data::ConstElementPtr &control_socket) |
Sets information about the control socket. More... | |
void | setD2ClientConfig (const D2ClientConfigPtr &d2_client_config) |
Sets the D2 client configuration. More... | |
void | setDeclinePeriod (const uint32_t decline_timer) |
Sets decline probation-period. More... | |
void | setDhcp4o6Port (uint16_t port) |
Sets DHCP4o6 IPC port. More... | |
void | setDHCPMultiThreading (const isc::data::ConstElementPtr dhcp_multi_threading) |
Sets information about the dhcp multi threading. More... | |
void | setDHCPQueueControl (const isc::data::ConstElementPtr dhcp_queue_control) |
Sets information about the dhcp queue control. More... | |
void | setEchoClientId (const bool echo) |
Sets whether server should send back client-id in DHCPv4. More... | |
void | setIgnoreRAILinkSelection (bool const value) |
Set ignore RAI Link Selection compatibility flag. More... | |
void | setIPReservationsUnique (const bool unique) |
Configures the server to allow or disallow specifying multiple hosts with the same IP address/subnet. More... | |
void | setLenientOptionParsing (bool const value) |
Set lenient option parsing compatibility flag. More... | |
void | setReservationsLookupFirst (const bool first) |
Sets whether the server does host reservations lookup before lease lookup. More... | |
virtual isc::data::ElementPtr | toElement () const |
Unparse a configuration object. More... | |
void | updateStatistics () |
Updates statistics. More... | |
Methods and operators used to compare configurations. | |
bool | equals (const SrvConfig &other) const |
Compares two objects for equality. More... | |
bool | nequals (const SrvConfig &other) const |
Compares two objects for inequality. More... | |
bool | operator== (const SrvConfig &other) const |
Equality operator. More... | |
bool | operator!= (const SrvConfig &other) const |
other An object to be compared with this object. More... | |
![]() | |
const process::LoggingInfoStorage & | getLoggingInfo () const |
Returns logging specific configuration. More... | |
void | addLoggingInfo (const process::LoggingInfo &logging_info) |
Sets logging specific configuration. More... | |
void | applyLoggingCfg () const |
Apply logging configuration to log4cplus. More... | |
bool | equals (const ConfigBase &other) const |
Compares two configuration. More... | |
virtual void | merge (ConfigBase &other) |
Merges specified configuration into this configuration. More... | |
process::ConstConfigControlInfoPtr | getConfigControlInfo () const |
Fetches a read-only copy of the configuration control information. More... | |
void | setConfigControlInfo (const process::ConfigControlInfoPtr &config_ctl_info) |
Set the configuration control information. More... | |
void | setServerTag (const util::Optional< std::string > &server_tag) |
Sets the server's logical name. More... | |
util::Optional< std::string > | getServerTag () const |
Returns the server's logical name. More... | |
boost::posix_time::ptime | getLastCommitTime () const |
Returns the last commit timestamp. More... | |
void | setLastCommitTime (const boost::posix_time::ptime &last_commit_time) |
Sets the last commit timestamp. More... | |
![]() | |
void | contextToElement (data::ElementPtr map) const |
Merge unparse a user_context object. More... | |
data::ConstElementPtr | getContext () const |
Returns const pointer to the user context. More... | |
void | setContext (const data::ConstElementPtr &ctx) |
Sets user context. More... | |
![]() | |
virtual | ~CfgToElement () |
Destructor. More... | |
Static Public Member Functions | |
static void | moveDdnsParams (isc::data::ElementPtr srv_elem) |
Moves deprecated parameters from dhcp-ddns element to global element. More... | |
![]() | |
static data::ElementPtr | toElement (data::ConstElementPtr map) |
Copy an Element map. More... | |
Static Public Attributes | |
Constants for selection of parameters returned by @c getConfigSummary | |
static const uint32_t | CFGSEL_NONE = 0x00000000 |
Nothing selected. More... | |
static const uint32_t | CFGSEL_SUBNET4 = 0x00000001 |
Number of IPv4 subnets. More... | |
static const uint32_t | CFGSEL_SUBNET6 = 0x00000002 |
Number of IPv6 subnets. More... | |
static const uint32_t | CFGSEL_IFACE4 = 0x00000004 |
Number of enabled ifaces. More... | |
static const uint32_t | CFGSEL_IFACE6 = 0x00000008 |
Number of v6 ifaces. More... | |
static const uint32_t | CFGSEL_DDNS = 0x00000010 |
DDNS enabled/disabled. More... | |
static const uint32_t | CFGSEL_SUBNET = 0x00000003 |
Number of all subnets. More... | |
static const uint32_t | CFGSEL_GLOBALS = 0x00000020 |
Configured globals. More... | |
static const uint32_t | CFGSEL_CFG_CTL = 0x00000040 |
Config control info. More... | |
static const uint32_t | CFGSEL_ALL4 = 0x00000035 |
IPv4 related config. More... | |
static const uint32_t | CFGSEL_ALL6 = 0x0000003A |
IPv6 related config. More... | |
static const uint32_t | CFGSEL_ALL = 0xFFFFFFFF |
Whole config. More... | |
Additional Inherited Members | |
![]() | |
void | copy (ConfigBase &new_config) const |
Copies the current configuration to a new configuration. More... | |
![]() | |
data::ConstElementPtr | user_context_ |
Pointer to the user context (may be NULL) More... | |
Specifies current DHCP configuration.
Definition at line 177 of file srv_config.h.
isc::dhcp::SrvConfig::SrvConfig | ( | ) |
Default constructor.
This constructor sets configuration sequence number to 0.
Definition at line 35 of file srv_config.cc.
isc::dhcp::SrvConfig::SrvConfig | ( | const uint32_t | sequence | ) |
Constructor.
Sets arbitrary configuration sequence number.
sequence | The configuration sequence. |
Definition at line 54 of file srv_config.cc.
|
inline |
Adds a parameter to the collection configured globals.
name | std::string name of the global to add. |
value | ElementPtr containing the value of the global. |
Definition at line 903 of file srv_config.h.
Referenced by applyDefaultsConfiguredGlobals(), extractConfiguredGlobals(), and merge().
void isc::dhcp::SrvConfig::applyDefaultsConfiguredGlobals | ( | const isc::data::SimpleDefaults & | defaults | ) |
Applies defaults to global parameters.
defaults | vector of (name, type, value) defaults to apply. |
Definition at line 326 of file srv_config.cc.
References addConfiguredGlobal(), isc::data::Element::boolean, getConfiguredGlobal(), isc::data::Element::integer, isc_throw, isc::data::Element::real, and isc::data::Element::string.
|
inline |
Removes all configured global parameters.
applyDefaultsConfiguredGlobals
and mergeGlobals
, or isc::data::SimpleParser::setDefaults
and extractConfiguredGlobals
should be called after. Definition at line 887 of file srv_config.h.
void isc::dhcp::SrvConfig::configureLowerLevelLibraries | ( | ) | const |
Convenience method to propagate configuration parameters through inversion of control.
To be used as a last resort when CfgMgr::instance().getCurrentCfg() can't be easily called from where the configuration parameter is used, usually because that particular library is lower in the dependency tree. Happens on configuration commit.
Definition at line 902 of file srv_config.cc.
References isc::dhcp::Option::lenient_parsing_.
void isc::dhcp::SrvConfig::copy | ( | SrvConfig & | new_config | ) | const |
Copies the current configuration to a new configuration.
This method copies the parameters stored in the configuration to an object passed as parameter. The configuration sequence is not copied.
CfgMgr
unusable.[out] | new_config | An object to which the configuration will be copied. |
Definition at line 120 of file srv_config.cc.
References isc::hooks::HooksConfig::add(), isc::hooks::HooksConfig::clear(), isc::data::copy(), getD2ClientConfig(), and setD2ClientConfig().
bool isc::dhcp::SrvConfig::equals | ( | const SrvConfig & | other | ) | const |
Compares two objects for equality.
It ignores the configuration sequence number when checking for equality of objects.
other | An object to be compared with this object. |
Definition at line 142 of file srv_config.cc.
References isc::hooks::HooksConfig::get().
void isc::dhcp::SrvConfig::extractConfiguredGlobals | ( | isc::data::ConstElementPtr | config | ) |
Saves scalar elements from the global scope of a configuration.
Definition at line 396 of file srv_config.cc.
References addConfiguredGlobal(), isc_throw, isc::data::Element::list, and isc::data::Element::map.
|
inline |
Returns pointer to the object holding configuration of the lease and host database connection parameters.
Definition at line 445 of file srv_config.h.
Referenced by setIPReservationsUnique().
|
inline |
Returns const pointer to the object holding configuration of the lease and host database connection parameters.
Definition at line 454 of file srv_config.h.
|
inline |
Returns pointer to the object holding configuration of the server identifier.
Definition at line 427 of file srv_config.h.
|
inline |
Returns const pointer to the object holding configuration of the server identifier.
Definition at line 436 of file srv_config.h.
|
inline |
Returns pointer to the object holding configuration pertaining to processing expired leases.
Definition at line 409 of file srv_config.h.
|
inline |
Returns pointer to the const object holding configuration pertaining to processing expired leases.
Definition at line 418 of file srv_config.h.
|
inline |
Returns pointer to the object holding general configuration for host reservations in DHCPv4.
Definition at line 463 of file srv_config.h.
|
inline |
Returns const pointer to the object holding general configuration for host reservations in DHCPv4.
Definition at line 472 of file srv_config.h.
|
inline |
Returns pointer to the object holding general configuration for host reservations in DHCPv6.
Definition at line 481 of file srv_config.h.
|
inline |
Returns const pointer to the object holding general configuration for host reservations in DHCPv6.
Definition at line 490 of file srv_config.h.
|
inline |
Returns pointer to the non-const objects representing host reservations for different IPv4 and IPv6 subnets.
Definition at line 375 of file srv_config.h.
Referenced by setIPReservationsUnique().
|
inline |
Returns pointer to the const objects representing host reservations for different IPv4 and IPv6 subnets.
Definition at line 383 of file srv_config.h.
|
inline |
Returns non-const pointer to interface configuration.
This function returns a non-const pointer to the interface configuration.
Definition at line 265 of file srv_config.h.
|
inline |
Returns const pointer to interface configuration.
This function returns a const pointer to the interface configuration.
Definition at line 275 of file srv_config.h.
|
inline |
Returns pointer to the non-const object holding options.
This method returns a pointer to the object which holds instances of the options to be returned to the clients belonging to any subnet.
Definition at line 307 of file srv_config.h.
Referenced by merge().
|
inline |
Returns pointer to the const object holding options.
This method returns a pointer to the object which holds instances of the options to be returned to the clients belonging to any subnet.
Definition at line 317 of file srv_config.h.
|
inline |
Return pointer to non-const object representing user-defined option definitions.
This function returns a pointer to the object which represents the user defined option definitions grouped by option space name.
Definition at line 286 of file srv_config.h.
Referenced by merge().
|
inline |
Returns pointer to the const object representing user-defined option definitions.
This function returns a pointer to the object which represents the user defined option definitions grouped by option space name.
Definition at line 297 of file srv_config.h.
|
inline |
Returns pointer to the non-const object representing set of RSOO-enabled options.
Definition at line 392 of file srv_config.h.
|
inline |
Returns pointer to the const object representing set of RSOO-enabled options.
Definition at line 400 of file srv_config.h.
|
inline |
Returns pointer to non-const object holding configuration of shared networks in DHCPv4;.
Definition at line 334 of file srv_config.h.
Referenced by merge().
|
inline |
Returns pointer to non-const object holding configuration of shared networks in DHCPv6.
Definition at line 343 of file srv_config.h.
Referenced by merge().
|
inline |
Returns pointer to non-const object holding subnets configuration for DHCPv4.
Definition at line 325 of file srv_config.h.
Referenced by getConfigSummary(), merge(), removeStatistics(), and updateStatistics().
|
inline |
Returns pointer to const object holding subnets configuration for DHCPv4.
Definition at line 351 of file srv_config.h.
|
inline |
Returns pointer to non-const object holding subnets configuration for DHCPv6.
Definition at line 359 of file srv_config.h.
Referenced by getConfigSummary(), merge(), removeStatistics(), and updateStatistics().
|
inline |
Returns pointer to const object holding subnets configuration for DHCPv6.
Definition at line 367 of file srv_config.h.
|
inline |
Returns pointer to the dictionary of global client class definitions.
Definition at line 572 of file srv_config.h.
Referenced by merge().
|
inline |
Returns pointer to const dictionary of global client class definitions.
Definition at line 580 of file srv_config.h.
std::string isc::dhcp::SrvConfig::getConfigSummary | ( | const uint32_t | selection | ) | const |
Returns summary of the configuration in the textual format.
This method returns the brief text describing the current configuration. It may be used for logging purposes, e.g. when the new configuration is committed to notify a user about the changes in configuration.
CfgMgr
accessors to get the configuration parameters. Once these parameters are migrated from the CfgMgr
this method will have to be modified accordingly.selection | Is a bitfield which describes the parts of the configuration to be returned. |
Definition at line 74 of file srv_config.cc.
References CFGSEL_DDNS, CFGSEL_SUBNET4, CFGSEL_SUBNET6, getCfgSubnets4(), getCfgSubnets6(), and getD2ClientConfig().
|
inline |
Returns pointer to a given configured global parameter.
name | Name of the parameter to fetch. |
Definition at line 868 of file srv_config.h.
Referenced by applyDefaultsConfiguredGlobals(), merge(), sanityChecksLifetime(), and updateStatistics().
|
inline |
Returns pointer to a given configured global parameter.
index | Index of the parameter to fetch. |
Definition at line 877 of file srv_config.h.
|
inline |
Returns non-const pointer to configured global parameters.
This function returns a non-const pointer to the configured global parameters.
Definition at line 849 of file srv_config.h.
Referenced by merge().
|
inline |
Returns const pointer to configured global parameters.
This function returns a const pointer to the configured global parameters.
Definition at line 859 of file srv_config.h.
|
inline |
Returns non-const pointer to object holding sanity checks flags.
Definition at line 497 of file srv_config.h.
Referenced by isc::dhcp::SanityChecksParser::parse().
|
inline |
Returns const pointer to object holding sanity checks flags.
Definition at line 504 of file srv_config.h.
|
inline |
Returns information about control socket.
Definition at line 529 of file srv_config.h.
|
inline |
Returns pointer to the D2 client configuration.
Definition at line 825 of file srv_config.h.
Referenced by copy(), getConfigSummary(), and getDdnsParams().
|
inline |
Returns pointer to const D2 client configuration.
Definition at line 832 of file srv_config.h.
DdnsParamsPtr isc::dhcp::SrvConfig::getDdnsParams | ( | const Subnet4Ptr & | subnet | ) | const |
Fetches the DDNS parameters for a given DHCPv4 subnet.
Creates a DdnsParams structure which retain and thereafter use the given subnet to fetch DDNS behavioral parameters. The values are fetched with the inheritance scope mode of Network::ALL.
subnet | DHCPv4 Subnet for which DDNS parameters are desired. |
Definition at line 831 of file srv_config.cc.
References getD2ClientConfig().
DdnsParamsPtr isc::dhcp::SrvConfig::getDdnsParams | ( | const Subnet6Ptr & | subnet | ) | const |
Fetches the DDNS parameters for a given DHCPv6 subnet.
Creates a DdnsParams structure which retain and thereafter use the given subnet to fetch DDNS behavioral parameters. The values are fetched with the inheritance scope mode of Network::ALL.
subnet | DHCPv6 Subnet for which DDNS parameters are desired. |
Definition at line 837 of file srv_config.cc.
References getD2ClientConfig().
|
inline |
Returns probation-period.
See setDeclinePeriod for brief discussion.
Definition at line 782 of file srv_config.h.
|
inline |
Returns DHCP4o6 IPC port.
See setDhcp4o6Port for brief discussion.
Definition at line 818 of file srv_config.h.
|
inline |
Returns DHCP multi threading information.
Definition at line 557 of file srv_config.h.
Referenced by toElement().
|
inline |
Returns DHCP queue control information.
Definition at line 543 of file srv_config.h.
Referenced by toElement().
|
inline |
Returns whether server should send back client-id in DHCPv4.
Definition at line 799 of file srv_config.h.
|
inline |
Returns non-const reference to configured hooks libraries.
Definition at line 594 of file srv_config.h.
|
inline |
Returns const reference to configured hooks libraries.
Definition at line 601 of file srv_config.h.
References isc::data::copy().
|
inline |
Get ignore RAI Link Selection compatibility flag.
Definition at line 1005 of file srv_config.h.
|
inline |
Get lenient option parsing compatibility flag.
Definition at line 990 of file srv_config.h.
|
inline |
Returns non-const reference to an array that stores MAC/hardware address sources.
Definition at line 514 of file srv_config.h.
|
inline |
Returns const reference to an array that stores MAC/hardware address sources.
Definition at line 522 of file srv_config.h.
|
inline |
Returns whether the server does host reservations lookup before lease lookup.
Definition at line 970 of file srv_config.h.
|
inline |
Returns configuration sequence number.
Definition at line 243 of file srv_config.h.
Referenced by sequenceEquals().
|
virtual |
Merges the configuration specified as a parameter into this configuration.
This method is used when two or more configurations held in the SrvConfig
objects need to be combined into a single configuration. Specifically, when the configuration backend is used, then part of the server configuration comes from the configuration file and stored in the staging configuration. The other part of the configuration comes from the database. The configuration fetched from the database is stored in a separate SrvConfig
instance and then merged into the staging configuration prior to committing it.
The merging strategy depends on the underlying data being merged. For example: subnets are merged using the algorithm implemented in the CfgSubnets4
. Other data structures are merged using the algorithms implemented in their respective configuration containers.
The general rule is that the configuration data from the other
object replaces configuration data held in this object instance. The data that do not overlap between the two objects is simply inserted into this configuration.
Due to the nature of the client classes, i.e. they are ordered and depend on each other, individual classes are not merged. Instead, the new list of classes entirely replaces the existing list. It implies that client classes should not be defined in a config file if there are classes defined in the config backend for this server.
merge
may modify the data in the other
object. Therefore, the caller must not rely on the data held in the other
object after the call to merge
. Also, the data held in other
must not be modified after the call to merge
because it may affect the merged configuration.The other
parameter must be a SrvConfig
or its derivation.
This method calls either merge4
or merge6
based on
Currently, the following parts of the configuration are merged:
merge4
or merge6
depending on CfgMgr::family_:
other | An object holding the configuration to be merged into this configuration. |
Definition at line 168 of file srv_config.cc.
References addConfiguredGlobal(), getCfgOption(), getCfgOptionDef(), getCfgSharedNetworks4(), getCfgSharedNetworks6(), getCfgSubnets4(), getCfgSubnets6(), getClientClassDictionary(), getConfiguredGlobal(), getConfiguredGlobals(), isc::dhcp::CfgMgr::instance(), isc_throw, isc::data::merge(), isc::dhcp::BaseNetworkParser::moveReservationMode(), isc::dhcp::CfgGlobals::RESERVATION_MODE, isc::dhcp::CfgGlobals::RESERVATIONS_GLOBAL, isc::dhcp::CfgGlobals::RESERVATIONS_IN_SUBNET, isc::dhcp::CfgGlobals::RESERVATIONS_OUT_OF_POOL, setClientClassDictionary(), setDeclinePeriod(), setDhcp4o6Port(), setEchoClientId(), setIPReservationsUnique(), setReservationsLookupFirst(), and isc::process::ConfigBase::setServerTag().
|
static |
Moves deprecated parameters from dhcp-ddns element to global element.
Given a server configuration element map, the following parameters are moved from dhcp-ddns to top-level (i.e. global) element if they do not already exist there:
Note that the whether or not the deprecated parameters are added to the global element, they are always removed from the dhcp-ddns element.
srv_elem | server top level map to alter |
Definition at line 843 of file srv_config.cc.
References isc::dhcp::DHCPSRV_CFGMGR_DDNS_PARAMETER_IGNORED, isc::dhcp::DHCPSRV_CFGMGR_DDNS_PARAMETER_MOVED, isc::dhcp::dhcpsrv_logger, isc_throw, LOG_INFO, and isc::data::Element::map.
|
inline |
Compares two objects for inequality.
It ignores the configuration sequence number when checking for inequality of objects.
other | An object to be compared with this object. |
Definition at line 667 of file srv_config.h.
|
inline |
other An object to be compared with this object.
It ignores the configuration sequence number when checking for inequality of objects.
other | An object to be compared with this object. |
Definition at line 691 of file srv_config.h.
References isc::data::merge().
|
inline |
Equality operator.
It ignores the configuration sequence number when checking for equality of objects.
other | An object to be compared with this object. |
Definition at line 679 of file srv_config.h.
void isc::dhcp::SrvConfig::removeStatistics | ( | ) |
Removes statistics.
This method calls appropriate methods in child objects that remove related statistics. See CfgSubnets4::removeStatistics and CfgSubnets6::removeStatistics for details.
Definition at line 280 of file srv_config.cc.
References getCfgSubnets4(), and getCfgSubnets6().
void isc::dhcp::SrvConfig::sanityChecksLifetime | ( | const std::string & | name | ) | const |
Conducts sanity checks on global lifetime parameters.
name | Base name of the lifetime parameter. |
Definition at line 411 of file srv_config.cc.
References getConfiguredGlobal(), and isc_throw.
void isc::dhcp::SrvConfig::sanityChecksLifetime | ( | const SrvConfig & | target_config, |
const std::string & | name | ||
) | const |
Conducts sanity checks on global lifetime parameters before merge from the external configuration to the target one.
target_config | Target configuration. |
name | Base name of the lifetime parameter. |
Definition at line 488 of file srv_config.cc.
References getConfiguredGlobal(), and isc_throw.
bool isc::dhcp::SrvConfig::sequenceEquals | ( | const SrvConfig & | other | ) |
Compares configuration sequence with other sequence.
This method compares sequence numbers of two configurations for equality. The sequence numbers are meant to be unique, so if they are equal it means that they point to the same configuration.
other | Configuration which sequence number should be compared with the sequence number of this configuration. |
Definition at line 115 of file srv_config.cc.
References getSequence().
|
inline |
Sets the client class dictionary.
dictionary | pointer to the new class dictionary |
Definition at line 587 of file srv_config.h.
Referenced by merge().
|
inline |
Sets information about the control socket.
control_socket | Element that holds control-socket map |
Definition at line 536 of file srv_config.h.
Referenced by isc::dhcp::ControlSocketParser::parse().
|
inline |
Sets the D2 client configuration.
d2_client_config | pointer to the new D2 client configuration |
Definition at line 839 of file srv_config.h.
Referenced by copy().
|
inline |
Sets decline probation-period.
Probation-period is the timer, expressed, in seconds, that specifies how long a lease is unavailable after reported as declined.
decline_timer | number of seconds after declined lease is restored |
Definition at line 773 of file srv_config.h.
Referenced by merge().
|
inline |
Sets DHCP4o6 IPC port.
DHCPv4-over-DHCPv6 uses a UDP socket for inter-server communication, this socket is bound and connected to this port and port + 1
port | port and port + 1 to use |
Definition at line 809 of file srv_config.h.
Referenced by merge().
|
inline |
Sets information about the dhcp multi threading.
dhcp_multi_threading | new dhcp multi threading information |
Definition at line 564 of file srv_config.h.
Referenced by isc::dhcp::MultiThreadingConfigParser::parse().
|
inline |
Sets information about the dhcp queue control.
dhcp_queue_control | new dhcp queue control information |
Definition at line 550 of file srv_config.h.
|
inline |
Sets whether server should send back client-id in DHCPv4.
This is a compatibility flag. The default (true) is compliant with RFC6842. False is for backward compatibility.
echo | should the client-id be sent or not |
Definition at line 792 of file srv_config.h.
Referenced by merge().
|
inline |
Set ignore RAI Link Selection compatibility flag.
value | the boolean value to be set when configuring RAI Link Selection usage preferences |
Definition at line 998 of file srv_config.h.
void isc::dhcp::SrvConfig::setIPReservationsUnique | ( | const bool | unique | ) |
Configures the server to allow or disallow specifying multiple hosts with the same IP address/subnet.
This setting is applied in CfgDbAccess
and CfgHosts
. This function should be called when the server is being configured using the configuration file, config-set command or via the configuration backend.
unique | Boolean value indicating if it is allowed (when false) or disallowed to specify multiple hosts with the same IP reservation. |
Definition at line 893 of file srv_config.cc.
References isc::dhcp::DHCPSRV_CFGMGR_IP_RESERVATIONS_UNIQUE_DUPLICATES_POSSIBLE, isc::dhcp::dhcpsrv_logger, getCfgDbAccess(), getCfgHosts(), and LOG_WARN.
Referenced by merge().
|
inline |
Set lenient option parsing compatibility flag.
value | the boolean value to be set when configuring lenient option parsing |
Definition at line 983 of file srv_config.h.
|
inline |
Sets whether the server does host reservations lookup before lease lookup.
first | Boolean value indicating if host reservations lookup should be performed before lease lookup. |
Definition at line 961 of file srv_config.h.
Referenced by merge().
|
virtual |
Unparse a configuration object.
Reimplemented from isc::process::ConfigBase.
Definition at line 600 of file srv_config.cc.
References isc::data::UserContext::contextToElement(), isc::data::Element::create(), isc::data::Element::createList(), isc::data::Element::createMap(), isc::dhcp::CfgHostsList::get(), isc::process::ConfigBase::getConfigControlInfo(), isc::dhcp::CfgMgr::getDataDir(), getDHCPMultiThreading(), getDHCPQueueControl(), isc::dhcp::CfgMgr::getFamily(), isc::process::ConfigBase::getLoggingInfo(), isc::db::info, isc::dhcp::CfgMgr::instance(), isc::dhcp::CfgHostsList::internalize(), isc_throw, isc::data::isNull(), isc::asiodns::logger, isc::data::UserContext::toElement(), isc::dhcp::CfgLeaseDbAccess::toElement(), isc::dhcp::CfgHostDbAccess::toElement(), and isc::util::Optional< T >::unspecified().
void isc::dhcp::SrvConfig::updateStatistics | ( | ) |
Updates statistics.
This method calls appropriate methods in child objects that update related statistics. See CfgSubnets4::updateStatistics and CfgSubnets6::updateStatistics for details.
Definition at line 288 of file srv_config.cc.
References getCfgSubnets4(), getCfgSubnets6(), getConfiguredGlobal(), isc::dhcp::LeaseMgrFactory::haveInstance(), isc::stats::StatsMgr::instance(), isc::stats::StatsMgr::setMaxSampleAgeAll(), isc::stats::StatsMgr::setMaxSampleAgeDefault(), isc::stats::StatsMgr::setMaxSampleCountAll(), and isc::stats::StatsMgr::setMaxSampleCountDefault().
|
static |
Whole config.
Definition at line 205 of file srv_config.h.
|
static |
IPv4 related config.
Definition at line 201 of file srv_config.h.
|
static |
IPv6 related config.
Definition at line 203 of file srv_config.h.
|
static |
Config control info.
Definition at line 199 of file srv_config.h.
|
static |
DDNS enabled/disabled.
Definition at line 193 of file srv_config.h.
Referenced by getConfigSummary().
|
static |
Configured globals.
Definition at line 197 of file srv_config.h.
|
static |
Number of enabled ifaces.
Definition at line 189 of file srv_config.h.
|
static |
Number of v6 ifaces.
Definition at line 191 of file srv_config.h.
|
static |
Nothing selected.
Definition at line 183 of file srv_config.h.
|
static |
Number of all subnets.
Definition at line 195 of file srv_config.h.
|
static |
Number of IPv4 subnets.
Definition at line 185 of file srv_config.h.
Referenced by getConfigSummary().
|
static |
Number of IPv6 subnets.
Definition at line 187 of file srv_config.h.
Referenced by getConfigSummary().