7#ifndef DHCPSRV_CONFIG_H
8#define DHCPSRV_CONFIG_H
37#include <boost/shared_ptr.hpp>
62 : subnet_(
boost::dynamic_pointer_cast<const
Subnet>(subnet)),
63 d2_client_enabled_(d2_client_enabled) {}
73 : subnet_(
boost::dynamic_pointer_cast<const
Subnet>(subnet)),
74 d2_client_enabled_(d2_client_enabled) {}
165 return (subnet_->getID());
176 bool d2_client_enabled_;
295 return (cfg_option_def_);
306 return (cfg_option_def_);
316 return (cfg_option_);
326 return (cfg_option_);
334 return (cfg_subnets4_);
343 return (cfg_shared_networks4_);
352 return (cfg_shared_networks6_);
360 return (cfg_subnets4_);
368 return (cfg_subnets6_);
376 return (cfg_subnets6_);
418 return (cfg_expiration_);
427 return (cfg_expiration_);
454 return (cfg_db_access_);
463 return (cfg_db_access_);
472 return (cfg_host_operations4_);
481 return (cfg_host_operations4_);
490 return (cfg_host_operations6_);
499 return (cfg_host_operations6_);
506 return (cfg_consist_);
513 return (cfg_consist_);
523 return (cfg_mac_source_);
531 return (cfg_mac_source_);
538 return (unix_control_socket_);
545 unix_control_socket_ = control_socket;
552 return (http_control_socket_);
559 http_control_socket_ = control_socket;
566 return (dhcp_queue_control_);
573 dhcp_queue_control_ = dhcp_queue_control;
580 return (dhcp_multi_threading_);
587 dhcp_multi_threading_ = dhcp_multi_threading;
595 return (class_dictionary_);
603 return (class_dictionary_);
610 class_dictionary_ = dictionary;
617 return (hooks_config_);
624 return (hooks_config_);
773 virtual void merge(ConfigBase& other);
796 decline_timer_ = decline_timer;
805 return (decline_timer_);
815 echo_v4_client_id_ = echo;
822 return (echo_v4_client_id_);
832 dhcp4o6_port_ = port;
841 return (dhcp4o6_port_);
848 return (d2_client_config_);
855 return (d2_client_config_);
862 d2_client_config_ = d2_client_config;
872 return (configured_globals_);
882 return (configured_globals_);
891 return (configured_globals_->get(name));
900 return (configured_globals_->get(index));
910 configured_globals_->clear();
911 lenient_option_parsing_ =
false;
912 ignore_dhcp_server_identifier_ =
false;
913 ignore_rai_link_selection_ =
false;
914 exclude_first_last_24_ =
false;
915 unix_control_socket_.reset();
916 http_control_socket_.reset();
919 dhcp_multi_threading_.reset();
921 cfg_duid_.reset(
new CfgDUID());
922 dhcp_queue_control_.reset();
938 configured_globals_->set(name, value);
952 const std::string& name)
const;
971 reservations_lookup_first_ = first;
980 return (reservations_lookup_first_);
993 lenient_option_parsing_ = value;
1000 return lenient_option_parsing_;
1008 ignore_dhcp_server_identifier_ = value;
1015 return (ignore_dhcp_server_identifier_);
1023 ignore_rai_link_selection_ = value;
1030 return ignore_rai_link_selection_;
1038 exclude_first_last_24_ = value;
1045 return exclude_first_last_24_;
1216 uint32_t decline_timer_;
1219 bool echo_v4_client_id_;
1225 uint16_t dhcp4o6_port_;
1240 bool lenient_option_parsing_;
1242 bool ignore_dhcp_server_identifier_;
1244 bool ignore_rai_link_selection_;
1246 bool exclude_first_last_24_;
1254 bool reservations_lookup_first_;
Parameters for various consistency checks.
Holds manual configuration of the server identifier (DUID).
Holds configuration parameters pertaining to lease expiration and lease affinity.
Wrapper class that holds MAC/hardware address sources.
Acts as a storage vault for D2 client configuration.
ReplaceClientNameMode
Defines the client name replacement modes.
Convenience container for conveying DDNS behavioral parameters It is intended to be created per Packe...
std::string getHostnameCharReplacement() const
Returns the string to replace invalid characters when scrubbing hostnames.
D2ClientConfig::ReplaceClientNameMode getReplaceClientNameMode() const
Returns how Kea should handle the domain-name supplied by the client.
std::string getGeneratedPrefix() const
Returns the Prefix Kea should use when generating domain-names.
util::Optional< double > getTtlPercent() const
Returns percent of lease lifetime to use for TTL.
isc::util::str::StringSanitizerPtr getHostnameSanitizer() const
Returns a regular expression string sanitizer.
std::string getHostnameCharSet() const
Returns the regular expression describing invalid characters for client hostnames.
DdnsParams(const ConstSubnet6Ptr &subnet, bool d2_client_enabled)
Constructor for DHCPv6 subnets.
SubnetID getSubnetId() const
Returns the subnet-id of the subnet associated with these parameters.
std::string getConflictResolutionMode() const
Returns the DDNS config resolution mode for kea-dhcp-ddns.
std::string getQualifyingSuffix() const
Returns the suffix Kea should use when to qualify partial domain-names.
bool getUpdateOnRenew() const
Returns whether or not DNS should be updated when leases renew.
bool getOverrideNoUpdate() const
Returns whether or not Kea should perform updates, even if client requested no updates.
DdnsParams(const ConstSubnet4Ptr &subnet, bool d2_client_enabled)
Constructor for DHCPv4 subnets.
DdnsParams()
Default constructor.
bool getEnableUpdates() const
Returns whether or not DHCP DDNS updating is enabled.
bool getOverrideClientUpdate() const
Returns whether or not Kea should perform updates, even if client requested delegation.
Specifies current DHCP configuration.
const isc::data::ConstElementPtr getUnixControlSocketInfo() const
Returns information about UNIX control socket.
ClientClassDictionaryPtr getClientClassDictionary()
Returns pointer to the dictionary of global client class definitions.
static const uint32_t CFGSEL_SUBNET4
Number of IPv4 subnets.
ConstCfgOptionDefPtr getCfgOptionDef() const
Returns pointer to the const object representing user-defined option definitions.
const ConstCfgOptionPtr getCfgOption() const
Returns pointer to the const object holding options.
void setDhcp4o6Port(uint16_t port)
Sets DHCP4o6 IPC port.
void addConfiguredGlobal(const std::string &name, isc::data::ConstElementPtr value)
Adds a parameter to the collection configured globals.
void setUnixControlSocketInfo(const isc::data::ConstElementPtr &control_socket)
Sets information about the UNIX control socket.
CfgGlobalsPtr getConfiguredGlobals()
Returns non-const pointer to configured global parameters.
ConstCfgGlobalsPtr getConfiguredGlobals() const
Returns const pointer to configured global parameters.
void setLenientOptionParsing(bool const value)
Set lenient option parsing compatibility flag.
bool getReservationsLookupFirst() const
Returns whether the server does host reservations lookup before lease lookup.
const ClientClassDictionaryPtr getClientClassDictionary() const
Returns pointer to const dictionary of global client class definitions.
const D2ClientConfigPtr getD2ClientConfig() const
Returns pointer to const D2 client configuration.
void clearConfiguredGlobals()
Removes all configured global parameters.
void setClientClassDictionary(const ClientClassDictionaryPtr &dictionary)
Sets the client class dictionary.
ConstCfgSubnets6Ptr getCfgSubnets6() const
Returns pointer to const object holding subnets configuration for DHCPv6.
virtual void merge(ConfigBase &other)
Merges the configuration specified as a parameter into this configuration.
void extractConfiguredGlobals(isc::data::ConstElementPtr config)
Saves scalar elements from the global scope of a configuration.
static const uint32_t CFGSEL_ALL
Whole config.
void setIgnoreServerIdentifier(bool const value)
Set ignore DHCP Server Identifier compatibility flag.
ConstCfgDUIDPtr getCfgDUID() const
Returns const pointer to the object holding configuration of the server identifier.
bool nequals(const SrvConfig &other) const
Compares two objects for inequality.
bool operator!=(const SrvConfig &other) const
other An object to be compared with this object.
isc::data::ConstElementPtr getConfiguredGlobal(std::string name) const
Returns pointer to a given configured global parameter.
ConstCfgConsistencyPtr getConsistency() const
Returns const pointer to object holding sanity checks flags.
CfgSharedNetworks6Ptr getCfgSharedNetworks6() const
Returns pointer to non-const object holding configuration of shared networks in DHCPv6.
static const uint32_t CFGSEL_ALL6
IPv6 related config.
bool getIgnoreRAILinkSelection() const
Get ignore RAI Link Selection compatibility flag.
void setD2ClientConfig(const D2ClientConfigPtr &d2_client_config)
Sets the D2 client configuration.
void setHttpControlSocketInfo(const isc::config::HttpCommandConfigPtr &control_socket)
Sets information about the HTTP/HTTPS control socket.
static const uint32_t CFGSEL_NONE
Nothing selected.
void applyDefaultsConfiguredGlobals(const isc::data::SimpleDefaults &defaults)
Applies defaults to global parameters.
void setIPReservationsUnique(const bool unique)
Configures the server to allow or disallow specifying multiple hosts with the same IP address/subnet.
void configureLowerLevelLibraries() const
Convenience method to propagate configuration parameters through inversion of control.
void setIgnoreRAILinkSelection(bool const value)
Set ignore RAI Link Selection compatibility flag.
static const uint32_t CFGSEL_IFACE4
Number of enabled ifaces.
CfgDUIDPtr getCfgDUID()
Returns pointer to the object holding configuration of the server identifier.
bool sequenceEquals(const SrvConfig &other)
Compares configuration sequence with other sequence.
static const uint32_t CFGSEL_GLOBALS
Configured globals.
isc::data::ConstElementPtr getConfiguredGlobal(int index) const
Returns pointer to a given configured global parameter.
CfgConsistencyPtr getConsistency()
Returns non-const pointer to object holding sanity checks flags.
CfgSubnets4Ptr getCfgSubnets4()
Returns pointer to non-const object holding subnets configuration for DHCPv4.
CfgSubnets6Ptr getCfgSubnets6()
Returns pointer to non-const object holding subnets configuration for DHCPv6.
CfgOptionDefPtr getCfgOptionDef()
Return pointer to non-const object representing user-defined option definitions.
uint16_t getDhcp4o6Port() const
Returns DHCP4o6 IPC port.
D2ClientConfigPtr getD2ClientConfig()
Returns pointer to the D2 client configuration.
bool operator==(const SrvConfig &other) const
Equality operator.
CfgRSOOPtr getCfgRSOO()
Returns pointer to the non-const object representing set of RSOO-enabled options.
CfgHostOperationsPtr getCfgHostOperations6()
Returns pointer to the object holding general configuration for host reservations in DHCPv6.
void setReservationsLookupFirst(const bool first)
Sets whether the server does host reservations lookup before lease lookup.
ConstCfgHostOperationsPtr getCfgHostOperations6() const
Returns const pointer to the object holding general configuration for host reservations in DHCPv6.
const isc::data::ConstElementPtr getDHCPMultiThreading() const
Returns DHCP multi threading information.
bool getEchoClientId() const
Returns whether server should send back client-id in DHCPv4.
void setDHCPQueueControl(const isc::data::ConstElementPtr dhcp_queue_control)
Sets information about the dhcp queue control.
isc::config::HttpCommandConfigPtr getHttpControlSocketInfo() const
Returns information about HTTP/HTTPS control socket.
DdnsParamsPtr getDdnsParams(const ConstSubnet4Ptr &subnet) const
Fetches the DDNS parameters for a given DHCPv4 subnet.
void sanityChecksLifetime(const std::string &name) const
Conducts sanity checks on global lifetime parameters.
ConstCfgIfacePtr getCfgIface() const
Returns const pointer to interface configuration.
ConstCfgExpirationPtr getCfgExpiration() const
Returns pointer to the const object holding configuration pertaining to processing expired leases.
std::string getConfigSummary(const uint32_t selection) const
Returns summary of the configuration in the textual format.
const isc::data::ConstElementPtr getDHCPQueueControl() const
Returns DHCP queue control information.
const isc::hooks::HooksConfig & getHooksConfig() const
Returns const reference to configured hooks libraries.
bool equals(const SrvConfig &other) const
Compares two objects for equality.
uint32_t getSequence() const
Returns configuration sequence number.
CfgIfacePtr getCfgIface()
Returns non-const pointer to interface configuration.
static const uint32_t CFGSEL_DDNS
DDNS enabled/disabled.
void setDeclinePeriod(const uint32_t decline_timer)
Sets decline probation-period.
uint32_t getDeclinePeriod() const
Returns probation-period.
void removeStatistics()
Removes statistics.
ConstCfgHostsPtr getCfgHosts() const
Returns pointer to the const objects representing host reservations for different IPv4 and IPv6 subne...
CfgExpirationPtr getCfgExpiration()
Returns pointer to the object holding configuration pertaining to processing expired leases.
const CfgMACSource & getMACSources() const
Returns const reference to an array that stores MAC/hardware address sources.
CfgOptionPtr getCfgOption()
Returns pointer to the non-const object holding options.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
bool getLenientOptionParsing() const
Get lenient option parsing compatibility flag.
ConstCfgRSOOPtr getCfgRSOO() const
Returns pointer to the const object representing set of RSOO-enabled options.
static const uint32_t CFGSEL_SUBNET6
Number of IPv6 subnets.
bool getExcludeFirstLast24() const
Get exclude .0 and .255 addresses in subnets bigger than /24 flag.
isc::hooks::HooksConfig & getHooksConfig()
Returns non-const reference to configured hooks libraries.
void updateStatistics()
Updates statistics.
ConstCfgDbAccessPtr getCfgDbAccess() const
Returns const pointer to the object holding configuration of the lease and host database connection p...
void setExcludeFirstLast24(bool const value)
Set exclude .0 and .255 addresses in subnets bigger than /24 flag.
static const uint32_t CFGSEL_SUBNET
Number of all subnets.
static const uint32_t CFGSEL_ALL4
IPv4 related config.
void setDHCPMultiThreading(const isc::data::ConstElementPtr dhcp_multi_threading)
Sets information about the dhcp multi threading.
CfgDbAccessPtr getCfgDbAccess()
Returns pointer to the object holding configuration of the lease and host database connection paramet...
void setEchoClientId(const bool echo)
Sets whether server should send back client-id in DHCPv4.
void copy(SrvConfig &new_config) const
Copies the current configuration to a new configuration.
CfgSharedNetworks4Ptr getCfgSharedNetworks4() const
Returns pointer to non-const object holding configuration of shared networks in DHCPv4;.
CfgHostsPtr getCfgHosts()
Returns pointer to the non-const objects representing host reservations for different IPv4 and IPv6 s...
static const uint32_t CFGSEL_IFACE6
Number of v6 ifaces.
bool getIgnoreServerIdentifier() const
Get ignore DHCP Server Identifier compatibility flag.
ConstCfgSubnets4Ptr getCfgSubnets4() const
Returns pointer to const object holding subnets configuration for DHCPv4.
static const uint32_t CFGSEL_CFG_CTL
Config control info.
SrvConfig()
Default constructor.
ConstCfgHostOperationsPtr getCfgHostOperations4() const
Returns const pointer to the object holding general configuration for host reservations in DHCPv4.
CfgHostOperationsPtr getCfgHostOperations4()
Returns pointer to the object holding general configuration for host reservations in DHCPv4.
CfgMACSource & getMACSources()
Returns non-const reference to an array that stores MAC/hardware address sources.
Wrapper class that holds hooks libraries configuration.
Base class for all configurations.
A template representing an optional value.
Defines classes for storing client class definitions.
Defines the D2ClientConfig class.
boost::shared_ptr< HttpCommandConfig > HttpCommandConfigPtr
Pointer to a HttpCommandConfig object.
boost::shared_ptr< const Element > ConstElementPtr
std::vector< SimpleDefault > SimpleDefaults
This specifies all default values in a given scope (e.g. a subnet).
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< const CfgOptionDef > ConstCfgOptionDefPtr
Const pointer.
boost::shared_ptr< CfgDUID > CfgDUIDPtr
Pointer to the Non-const object.
boost::shared_ptr< CfgHostOperations > CfgHostOperationsPtr
Pointer to the Non-const object.
boost::shared_ptr< const CfgDUID > ConstCfgDUIDPtr
Pointer to the const object.
boost::shared_ptr< const CfgGlobals > ConstCfgGlobalsPtr
Const shared pointer to a CfgGlobals instance.
boost::shared_ptr< const CfgHosts > ConstCfgHostsPtr
Const pointer.
boost::shared_ptr< D2ClientConfig > D2ClientConfigPtr
Defines a pointer for D2ClientConfig instances.
boost::shared_ptr< const SrvConfig > ConstSrvConfigPtr
Const pointer to the SrvConfig.
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
boost::shared_ptr< const Subnet4 > ConstSubnet4Ptr
A const pointer to a Subnet4 object.
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< CfgDbAccess > CfgDbAccessPtr
A pointer to the CfgDbAccess.
boost::shared_ptr< const CfgExpiration > ConstCfgExpirationPtr
Pointer to the const object.
boost::shared_ptr< const CfgIface > ConstCfgIfacePtr
A pointer to the const CfgIface.
boost::shared_ptr< const CfgDbAccess > ConstCfgDbAccessPtr
A pointer to the const CfgDbAccess.
boost::shared_ptr< const CfgRSOO > ConstCfgRSOOPtr
Pointer to the const object.
boost::shared_ptr< const CfgHostOperations > ConstCfgHostOperationsPtr
Pointer to the const object.
boost::shared_ptr< CfgIface > CfgIfacePtr
A pointer to the CfgIface .
boost::shared_ptr< DdnsParams > DdnsParamsPtr
Defines a pointer for DdnsParams instances.
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
boost::shared_ptr< CfgSubnets6 > CfgSubnets6Ptr
Non-const pointer.
boost::shared_ptr< CfgExpiration > CfgExpirationPtr
boost::shared_ptr< CfgGlobals > CfgGlobalsPtr
Non-const shared pointer to a CfgGlobals instance.
boost::shared_ptr< ClientClassDictionary > ClientClassDictionaryPtr
Defines a pointer to a ClientClassDictionary.
boost::shared_ptr< CfgSharedNetworks6 > CfgSharedNetworks6Ptr
Pointer to the configuration of IPv6 shared networks.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
boost::shared_ptr< CfgHosts > CfgHostsPtr
Non-const pointer.
boost::shared_ptr< CfgSubnets4 > CfgSubnets4Ptr
Non-const pointer.
boost::shared_ptr< const CfgSubnets4 > ConstCfgSubnets4Ptr
Const pointer.
boost::shared_ptr< const CfgSubnets6 > ConstCfgSubnets6Ptr
Const pointer.
boost::shared_ptr< CfgConsistency > CfgConsistencyPtr
Type used to for pointing to CfgConsistency structure.
boost::shared_ptr< const Subnet > ConstSubnetPtr
A generic pointer to either const Subnet4 or const Subnet6 object.
boost::shared_ptr< CfgSharedNetworks4 > CfgSharedNetworks4Ptr
Pointer to the configuration of IPv4 shared networks.
boost::shared_ptr< CfgRSOO > CfgRSOOPtr
Pointer to the Non-const object.
boost::shared_ptr< const CfgConsistency > ConstCfgConsistencyPtr
Type used to for pointing to const CfgConsistency structure.
boost::shared_ptr< const CfgOption > ConstCfgOptionPtr
Const pointer.
std::unique_ptr< StringSanitizer > StringSanitizerPtr
Type representing the pointer to the StringSanitizer.
Defines the logger used by the top-level component of kea-lfc.