7 #ifndef DHCPSRV_CONFIG_H
8 #define DHCPSRV_CONFIG_H
34 #include <boost/shared_ptr.hpp>
59 : subnet_(
boost::dynamic_pointer_cast<
Subnet>(subnet)),
60 d2_client_enabled_(d2_client_enabled) {}
70 : subnet_(
boost::dynamic_pointer_cast<
Subnet>(subnet)),
71 d2_client_enabled_(d2_client_enabled) {}
147 return subnet_->getID();
158 bool d2_client_enabled_;
273 return (cfg_option_def_);
284 return (cfg_option_def_);
294 return (cfg_option_);
304 return (cfg_option_);
312 return (cfg_subnets4_);
321 return (cfg_shared_networks4_);
330 return (cfg_shared_networks6_);
338 return (cfg_subnets4_);
346 return (cfg_subnets6_);
354 return (cfg_subnets6_);
394 return (cfg_expiration_);
400 return (cfg_expiration_);
418 return (cfg_db_access_);
424 return (cfg_db_access_);
430 return (cfg_host_operations4_);
436 return (cfg_host_operations4_);
442 return (cfg_host_operations6_);
448 return (cfg_host_operations6_);
453 return (cfg_consist_);
463 return (cfg_mac_source_);
471 return (cfg_mac_source_);
477 return (control_socket_);
483 control_socket_ = control_socket;
489 return (dhcp_queue_control_);
495 dhcp_queue_control_ = dhcp_queue_control;
501 return (dhcp_multi_threading_);
507 dhcp_multi_threading_ = dhcp_multi_threading;
513 return (class_dictionary_);
519 return (class_dictionary_);
525 class_dictionary_ = dictionary;
532 return (hooks_config_);
539 return (hooks_config_);
680 virtual void merge(ConfigBase& other);
703 decline_timer_ = decline_timer;
711 return (decline_timer_);
721 echo_v4_client_id_ = echo;
727 return (echo_v4_client_id_);
737 dhcp4o6_port_ = port;
745 return (dhcp4o6_port_);
750 return (d2_client_config_);
755 return (d2_client_config_);
761 d2_client_config_ = d2_client_config;
793 configured_globals_->set(name, value);
807 const std::string& name)
const;
855 lenient_option_parsing_ = value;
862 return lenient_option_parsing_;
1006 uint32_t decline_timer_;
1009 bool echo_v4_client_id_;
1015 uint16_t dhcp4o6_port_;
1028 bool lenient_option_parsing_;
1045 #endif // DHCPSRV_CONFIG_H
Defines the D2ClientConfig class.
D2ClientConfigPtr getD2ClientConfig()
Returns pointer to the D2 client configuration.
boost::shared_ptr< CfgSharedNetworks6 > CfgSharedNetworks6Ptr
Pointer to the configuration of IPv6 shared networks.
D2ClientConfig::ReplaceClientNameMode getReplaceClientNameMode() const
Returns how Kea should handle the domain-name supplied by the client.
bool nequals(const SrvConfig &other) const
Compares two objects for inequality.
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
SrvConfig()
Default constructor.
isc::data::ConstElementPtr getConfiguredGlobal(std::string name) const
Returns pointer to a given configured global parameter.
boost::shared_ptr< const CfgOptionDef > ConstCfgOptionDefPtr
Const pointer.
ConstCfgHostOperationsPtr getCfgHostOperations6() const
Returns const pointer to the object holding general configuration for host reservations in DHCPv6...
SubnetID getSubnetId() const
Returns the subnet-id of the subnet associated with these parameters.
static const uint32_t CFGSEL_IFACE4
Number of enabled ifaces.
std::vector< SimpleDefault > SimpleDefaults
This specifies all default values in a given scope (e.g. a subnet).
static void moveDdnsParams(isc::data::ElementPtr srv_elem)
Moves deprecated parameters from dhcp-ddns element to global element.
ConstCfgHostsPtr getCfgHosts() const
Returns pointer to the const objects representing host reservations for different IPv4 and IPv6 subne...
boost::shared_ptr< const CfgOption > ConstCfgOptionPtr
Const pointer.
virtual isc::data::ElementPtr toElement() const
Unparse a configuration object.
static const uint32_t CFGSEL_CFG_CTL
Config control info.
CfgConsistencyPtr getConsistency()
Returns const pointer to object holding sanity checks flags.
Base class for all configurations.
void removeStatistics()
Removes statistics.
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
boost::shared_ptr< Subnet4 > Subnet4Ptr
A pointer to a Subnet4 object.
boost::shared_ptr< const CfgRSOO > ConstCfgRSOOPtr
Pointer to the const object.
boost::shared_ptr< const CfgHosts > ConstCfgHostsPtr
Const pointer.
void copy(SrvConfig &new_config) const
Copies the current configuration to a new configuration.
void setControlSocketInfo(const isc::data::ConstElementPtr &control_socket)
Sets information about the control socket.
ConstCfgExpirationPtr getCfgExpiration() const
Returns pointer to the const object holding configuration pertaining to processing expired leases...
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< CfgIface > CfgIfacePtr
A pointer to the CfgIface .
Wrapper class that holds hooks libraries configuration.
uint32_t getSequence() const
Returns configuration sequence number.
CfgSubnets6Ptr getCfgSubnets6()
Returns pointer to non-const object holding subnets configuration for DHCPv6.
void setLenientOptionParsing(bool const value)
Set lenient option parsing compatibility flag.
bool getUpdateOnRenew() const
Returns whether or not DNS should be updated when leases renew.
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< CfgConsistency > CfgConsistencyPtr
Type used to for pointing to CfgConsistency structure.
void updateStatistics()
Updates statistics.
boost::shared_ptr< const CfgDUID > ConstCfgDUIDPtr
Pointer to the const object.
boost::shared_ptr< CfgSubnets4 > CfgSubnets4Ptr
Non-const pointer.
bool equals(const SrvConfig &other) const
Compares two objects for equality.
void setDHCPQueueControl(const isc::data::ConstElementPtr dhcp_queue_control)
Sets information about the dhcp queue control.
void setIPReservationsUnique(const bool unique)
Configures the server to allow or disallow specifying multiple hosts with the same IP address/subnet...
bool getLenientOptionParsing() const
Get lenient option parsing compatibility flag.
boost::shared_ptr< const CfgSubnets4 > ConstCfgSubnets4Ptr
Const pointer.
boost::shared_ptr< DdnsParams > DdnsParamsPtr
Defines a pointer for DdnsParams instances.
boost::shared_ptr< CfgExpiration > CfgExpirationPtr
Pointer to the Non-const object.
CfgOptionDefPtr getCfgOptionDef()
Return pointer to non-const object representing user-defined option definitions.
boost::shared_ptr< const CfgDbAccess > ConstCfgDbAccessPtr
A pointer to the const CfgDbAccess.
void setEchoClientId(const bool echo)
Sets whether server should send back client-id in DHCPv4.
boost::shared_ptr< CfgSharedNetworks4 > CfgSharedNetworks4Ptr
Pointer to the configuration of IPv4 shared networks.
bool operator!=(const SrvConfig &other) const
other An object to be compared with this object.
boost::shared_ptr< const SrvConfig > ConstSrvConfigPtr
Const pointer to the SrvConfig.
uint16_t getDhcp4o6Port() const
Returns DHCP4o6 IPC port.
Wrapper class that holds MAC/hardware address sources.
bool getEnableUpdates() const
Returns whether or not DHCP DDNS updating is enabled.
boost::shared_ptr< CfgDbAccess > CfgDbAccessPtr
A pointer to the CfgDbAccess.
void setDeclinePeriod(const uint32_t decline_timer)
Sets decline probation-period.
bool operator==(const SrvConfig &other) const
Equality operator.
const ClientClassDictionaryPtr getClientClassDictionary() const
Returns pointer to const dictionary of global client class definitions.
boost::shared_ptr< const CfgSubnets6 > ConstCfgSubnets6Ptr
Const pointer.
ConstCfgIfacePtr getCfgIface() const
Returns const pointer to interface configuration.
boost::shared_ptr< ClientClassDictionary > ClientClassDictionaryPtr
Defines a pointer to a ClientClassDictionary.
const isc::data::ConstElementPtr getDHCPQueueControl() const
Returns DHCP queue control information.
ConstCfgRSOOPtr getCfgRSOO() const
Returns pointer to the const object representing set of RSOO-enabled options.
void addConfiguredGlobal(const std::string &name, isc::data::ConstElementPtr value)
Adds a parameter to the collection configured globals.
boost::shared_ptr< const CfgExpiration > ConstCfgExpirationPtr
Pointer to the const object.
ConstCfgDUIDPtr getCfgDUID() const
Returns const pointer to the object holding configuration of the server identifier.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< CfgRSOO > CfgRSOOPtr
Pointer to the Non-const object.
CfgDbAccessPtr getCfgDbAccess()
Returns pointer to the object holding configuration of the lease and host database connection paramet...
const ConstCfgOptionPtr getCfgOption() const
Returns pointer to the const object holding options.
boost::shared_ptr< CfgSubnets6 > CfgSubnets6Ptr
Non-const pointer.
CfgExpirationPtr getCfgExpiration()
Returns pointer to the object holding configuration pertaining to processing expired leases...
CfgHostOperationsPtr getCfgHostOperations4()
Returns pointer to the object holding general configuration for host reservations in DHCPv4...
isc::util::str::StringSanitizerPtr getHostnameSanitizer() const
Returns a regular expression string sanitizer.
Convenience container for conveying DDNS behavioral parameters It is intended to be created per Packe...
const D2ClientConfigPtr getD2ClientConfig() const
Returns pointer to const D2 client configuration.
CfgIfacePtr getCfgIface()
Returns non-const pointer to interface configuration.
static const uint32_t CFGSEL_SUBNET
Number of all subnets.
DdnsParamsPtr getDdnsParams(const Subnet4Ptr &subnet) const
Fetches the DDNS parameters for a given DHCPv4 subnet.
Specifies current DHCP configuration.
static const uint32_t CFGSEL_ALL6
IPv6 related config.
CfgRSOOPtr getCfgRSOO()
Returns pointer to the non-const object representing set of RSOO-enabled options. ...
Defines the logger used by the top-level component of kea-dhcp-ddns.
CfgSharedNetworks4Ptr getCfgSharedNetworks4() const
Returns pointer to non-const object holding configuration of shared networks in DHCPv4;.
virtual void merge(ConfigBase &other)
Merges the configuration specified as a parameter into this configuration.
DdnsParams(const Subnet4Ptr &subnet, bool d2_client_enabled)
Constructor for DHPCv4 subnets.
std::string getHostnameCharSet() const
Returns the regular expression describing invalid characters for client hostnames.
void clearConfiguredGlobals()
Removes all configured global parameters.
CfgMACSource & getMACSources()
Returns non-const reference to an array that stores MAC/hardware address sources. ...
ReplaceClientNameMode
Defines the client name replacement modes.
static const uint32_t CFGSEL_SUBNET4
Number of IPv4 subnets.
bool getOverrideClientUpdate() const
Returns whether or not Kea should perform updates, even if client requested delegation.
CfgDUIDPtr getCfgDUID()
Returns pointer to the object holding configuration of the server identifier.
static const uint32_t CFGSEL_ALL
Whole config.
ConstCfgHostOperationsPtr getCfgHostOperations4() const
Returns const pointer to the object holding general configuration for host reservations in DHCPv4...
ConstCfgDbAccessPtr getCfgDbAccess() const
Returns const pointer to the object holding configuration of the lease and host database connection p...
void setClientClassDictionary(const ClientClassDictionaryPtr &dictionary)
Sets the client class dictionary.
std::string getConfigSummary(const uint32_t selection) const
Returns summary of the configuration in the textual format.
bool sequenceEquals(const SrvConfig &other)
Compares configuration sequence with other sequence.
void extractConfiguredGlobals(isc::data::ConstElementPtr config)
Saves scalar elements from the global scope of a configuration.
ConstCfgSubnets6Ptr getCfgSubnets6() const
Returns pointer to const object holding subnets configuration for DHCPv6.
isc::hooks::HooksConfig & getHooksConfig()
Returns non-const reference to configured hooks libraries.
static const uint32_t CFGSEL_DDNS
DDNS enabled/disabled.
const isc::data::ConstElementPtr getControlSocketInfo() const
Returns information about control socket.
boost::shared_ptr< const CfgIface > ConstCfgIfacePtr
A pointer to the const CfgIface.
ClientClassDictionaryPtr getClientClassDictionary()
Returns pointer to the dictionary of global client class definitions.
void sanityChecksLifetime(const std::string &name) const
Conducts sanity checks on global lifetime parameters.
CfgSharedNetworks6Ptr getCfgSharedNetworks6() const
Returns pointer to non-const object holding configuration of shared networks in DHCPv6.
boost::shared_ptr< const CfgHostOperations > ConstCfgHostOperationsPtr
Pointer to the const object.
ConstCfgSubnets4Ptr getCfgSubnets4() const
Returns pointer to const object holding subnets configuration for DHCPv4.
std::string getGeneratedPrefix() const
Returns the Prefix Kea should use when generating domain-names.
isc::data::ConstElementPtr getConfiguredGlobals() const
Returns pointer to configured global parameters.
CfgHostsPtr getCfgHosts()
Returns pointer to the non-const objects representing host reservations for different IPv4 and IPv6 s...
CfgSubnets4Ptr getCfgSubnets4()
Returns pointer to non-const object holding subnets configuration for DHCPv4.
void setDHCPMultiThreading(const isc::data::ConstElementPtr dhcp_multi_threading)
Sets information about the dhcp multi threading.
static const uint32_t CFGSEL_GLOBALS
Configured globals.
boost::shared_ptr< Subnet6 > Subnet6Ptr
A pointer to a Subnet6 object.
bool getOverrideNoUpdate() const
Returns whether or not Kea should perform updates, even if client requested no updates.
boost::shared_ptr< StringSanitizer > StringSanitizerPtr
bool getUseConflictResolution() const
Returns whether or not keah-dhcp-ddns should use conflict resolution.
const isc::data::ConstElementPtr getDHCPMultiThreading() const
Returns DHCP multi threading information.
uint32_t getDeclinePeriod() const
Returns probation-period.
CfgOptionPtr getCfgOption()
Returns pointer to the non-const object holding options.
CfgHostOperationsPtr getCfgHostOperations6()
Returns pointer to the object holding general configuration for host reservations in DHCPv6...
static const uint32_t CFGSEL_SUBNET6
Number of IPv6 subnets.
boost::shared_ptr< CfgDUID > CfgDUIDPtr
Pointer to the Non-const object.
void applyDefaultsConfiguredGlobals(const isc::data::SimpleDefaults &defaults)
Applies defaults to global parameters.
ConstCfgOptionDefPtr getCfgOptionDef() const
Returns pointer to the const object representing user-defined option definitions. ...
bool getEchoClientId() const
Returns whether server should send back client-id in DHCPv4.
boost::shared_ptr< D2ClientConfig > D2ClientConfigPtr
Defines a pointer for D2ClientConfig instances.
const isc::hooks::HooksConfig & getHooksConfig() const
Returns const reference to configured hooks libraries.
void setDhcp4o6Port(uint16_t port)
Sets DHCP4o6 IPC port.
Defines classes for storing client class definitions.
std::string getQualifyingSuffix() const
Returns the suffix Kea should use when to qualify partial domain-names.
const CfgMACSource & getMACSources() const
Returns const reference to an array that stores MAC/hardware address sources.
DdnsParams()
Default constructor.
std::string getHostnameCharReplacement() const
Returns the string to replace invalid characters when scrubbing hostnames.
void configureLowerLevelLibraries() const
Convenience method to propagate configuration parameters through inversion of control.
void setD2ClientConfig(const D2ClientConfigPtr &d2_client_config)
Sets the D2 client configuration.
boost::shared_ptr< Subnet > SubnetPtr
A generic pointer to either Subnet4 or Subnet6 object.
static const uint32_t CFGSEL_NONE
Nothing selected.
boost::shared_ptr< CfgHostOperations > CfgHostOperationsPtr
Pointer to the Non-const object.
uint32_t SubnetID
Unique identifier for a subnet (both v4 and v6)
static const uint32_t CFGSEL_ALL4
IPv4 related config.
DdnsParams(const Subnet6Ptr &subnet, bool d2_client_enabled)
Constructor for DHPCv6 subnets.
static const uint32_t CFGSEL_IFACE6
Number of v6 ifaces.
boost::shared_ptr< CfgHosts > CfgHostsPtr
Non-const pointer.