36#include <boost/make_shared.hpp>
50 : sequence_(0), cfg_iface_(new
CfgIface()),
61 decline_timer_(0), echo_v4_client_id_(true), dhcp4o6_port_(0),
64 lenient_option_parsing_(false), ignore_dhcp_server_identifier_(false),
65 ignore_rai_link_selection_(false), exclude_first_last_24_(false),
66 reservations_lookup_first_(false) {
70 : sequence_(sequence), cfg_iface_(new
CfgIface()),
81 decline_timer_(0), echo_v4_client_id_(true), dhcp4o6_port_(0),
84 lenient_option_parsing_(false), ignore_dhcp_server_identifier_(false),
85 ignore_rai_link_selection_(false), exclude_first_last_24_(false),
86 reservations_lookup_first_(false) {
95 if (subnets_num > 0) {
96 s <<
"added IPv4 subnets: " << subnets_num;
98 s <<
"no IPv4 subnets!";
105 if (subnets_num > 0) {
106 s <<
"added IPv6 subnets: " << subnets_num;
108 s <<
"no IPv6 subnets!";
115 s <<
"DDNS: " << (ddns_enabled ?
"enabled" :
"disabled") <<
"; ";
118 if (s.tellp() ==
static_cast<std::streampos
>(0)) {
119 s <<
"no config details available";
122 std::string summary = s.str();
123 size_t last_separator_pos = summary.find_last_of(
";");
124 if (last_separator_pos == summary.length() - 2) {
125 summary.erase(last_separator_pos);
140 new_config.cfg_iface_.reset(
new CfgIface(*cfg_iface_));
142 cfg_option_def_->copyTo(*new_config.cfg_option_def_);
143 cfg_option_->copyTo(*new_config.cfg_option_);
149 new_config.hooks_config_.
clear();
151 for (
auto const& it : hooks_config_.get()) {
152 new_config.hooks_config_.
add(it.libname_, it.parameters_, it.cfgname_);
165 if ((*cfg_iface_ != *other.cfg_iface_) ||
166 (*cfg_option_def_ != *other.cfg_option_def_) ||
167 (*cfg_option_ != *other.cfg_option_) ||
168 (*class_dictionary_ != *other.class_dictionary_) ||
169 (*d2_client_config_ != *other.d2_client_config_)) {
175 if (hooks_config_.get().size() != other.hooks_config_.
get().size()) {
180 return (hooks_config_.equal(other.hooks_config_));
192 mergeGlobals(other_srv_config);
195 mergeGlobalContainers(other_srv_config);
204 cfg_option_->merge(cfg_option_def_, *other_srv_config.
getCfgOption());
216 merge4(other_srv_config);
218 merge6(other_srv_config);
220 }
catch (
const std::bad_cast&) {
222 " of the SrvConfig as an argument of the call to"
223 " SrvConfig::merge()");
240SrvConfig::merge6(SrvConfig& other) {
242 cfg_shared_networks6_->merge(cfg_option_def_, *(other.getCfgSharedNetworks6()));
246 *(other.getCfgSubnets6()));
252SrvConfig::mergeGlobals(SrvConfig& other) {
256 for (
auto const& other_global : other.getConfiguredGlobals()->valuesMap()) {
263 std::string name = merged_global.first;
266 if (name ==
"decline-probation-period") {
268 }
else if (name ==
"echo-client-id") {
272 }
else if (name ==
"dhcp4o6-port") {
274 }
else if (name ==
"server-tag") {
276 }
else if (name ==
"ip-reservations-unique") {
278 }
else if (name ==
"reservations-lookup-first") {
281 }
catch(
const std::exception& ex) {
282 isc_throw (BadValue,
"Invalid value:" << element->str()
283 <<
" explicit global:" << name);
289SrvConfig::mergeGlobalContainers(
SrvConfig& other) {
291 for (
auto const& other_global : other.getConfiguredGlobals()->valuesMap()) {
292 config->set(other_global.first, other_global.second);
294 std::string parameter_name;
297 ConstElementPtr host_reservation_identifiers = config->get(
"host-reservation-identifiers");
298 parameter_name =
"host-reservation-identifiers";
299 if (host_reservation_identifiers) {
302 parser.parse(host_reservation_identifiers);
305 parser.parse(host_reservation_identifiers);
311 parameter_name =
"compatibility";
313 CompatibilityParser parser;
314 parser.parse(compatibility, *
this);
317 ElementPtr dhcp_ddns = boost::const_pointer_cast<Element>(config->get(
"dhcp-ddns"));
318 parameter_name =
"dhcp-ddns";
322 D2ClientConfigParser parser;
325 d2_client_cfg = parser.parse(dhcp_ddns);
326 if (!d2_client_cfg) {
327 d2_client_cfg.reset(
new D2ClientConfig());
329 d2_client_cfg->validateContents();
333 ConstElementPtr expiration_cfg = config->get(
"expired-leases-processing");
334 parameter_name =
"expired-leases-processing";
335 if (expiration_cfg) {
336 ExpirationConfigParser parser;
340 ElementPtr multi_threading = boost::const_pointer_cast<Element>(config->get(
"multi-threading"));
341 parameter_name =
"multi-threading";
342 if (multi_threading) {
348 MultiThreadingConfigParser parser;
349 parser.parse(*
this, multi_threading);
352 bool multi_threading_enabled =
true;
353 uint32_t thread_count = 0;
354 uint32_t queue_size = 0;
356 multi_threading_enabled, thread_count, queue_size);
357 ElementPtr sanity_checks = boost::const_pointer_cast<Element>(config->get(
"sanity-checks"));
358 parameter_name =
"sanity-checks";
365 SanityChecksParser parser;
366 parser.parse(*
this, sanity_checks);
370 parameter_name =
"server-id";
372 DUIDConfigParser parser;
374 parser.parse(cfg, server_id);
377 ElementPtr queue_control = boost::const_pointer_cast<Element>(config->get(
"dhcp-queue-control"));
378 parameter_name =
"dhcp-queue-control";
385 DHCPQueueControlParser parser;
389 }
catch (
const isc::Exception& ex) {
390 isc_throw(BadValue,
"Invalid parameter " << parameter_name <<
" error: " << ex.
what());
392 isc_throw(BadValue,
"Invalid parameter " << parameter_name);
409 uint32_t max_samples = 0;
411 max_samples = samples->intValue();
413 if (max_samples != 0) {
420 int64_t time_duration = duration->intValue();
421 auto max_age = std::chrono::seconds(time_duration);
423 if (max_samples == 0) {
449 for (
auto const& def_value : defaults) {
461 switch (def_value.type_) {
468 int int_value = boost::lexical_cast<int>(def_value.value_);
471 catch (
const std::exception& ex) {
473 "Internal error. Integer value expected for: "
474 << def_value.name_ <<
", value is: "
475 << def_value.value_ );
482 if (def_value.value_ == std::string(
"true")) {
484 }
else if (def_value.value_ == std::string(
"false")) {
488 "Internal error. Boolean value for "
489 << def_value.name_ <<
" specified as "
490 << def_value.value_ <<
", expected true or false");
496 double dbl_value = boost::lexical_cast<double>(def_value.value_);
503 "Internal error. Incorrect default value type for "
516 const std::map<std::string, ConstElementPtr>& values =
config->mapValue();
517 for (
auto const& value : values) {
534 auto ivalue = elem->intValue();
535 if (ivalue < 0 || ivalue > std::numeric_limits<uint32_t>::max()) {
537 <<
" must be >= 0 and <= "
538 << std::numeric_limits<uint32_t>::max());
541 return (
static_cast<uint32_t
>(ivalue));
551 value = rangeCheck(has_value, name);
554 uint32_t min_value = 0;
557 min_value = rangeCheck(has_min,
"min-" + name);
560 uint32_t max_value = 0;
563 max_value = rangeCheck(has_max,
"max-" + name);
566 if (!has_value && !has_min && !has_max) {
570 if (!has_min && !has_max) {
573 }
else if (!has_min) {
576 }
else if (!has_max) {
580 }
else if (has_min) {
587 << name <<
" but no " << name <<
" (default)");
595 if (min_value > max_value) {
596 if (has_min && has_max) {
598 << min_value <<
") is not less than max-" << name <<
" ("
599 << max_value <<
")");
600 }
else if (has_min) {
603 << min_value <<
") is not less than (default) " << name
604 <<
" (" << value <<
")");
608 <<
" (" << value <<
") is not less than max-" << name
609 <<
" (" << max_value <<
")");
614 if ((value < min_value) || (value > max_value)) {
616 << value <<
") is not between min-" << name <<
" ("
617 << min_value <<
") and max-" << name <<
" ("
618 << max_value <<
")");
624 const std::string& name)
const {
631 bool new_value =
true;
637 value = rangeCheck(has_value, name);
640 uint32_t min_value = 0;
648 min_value = rangeCheck(has_min,
"min-" + name);
651 uint32_t max_value = 0;
659 max_value = rangeCheck(has_max,
"max-" + name);
662 if (!has_value && !has_min && !has_max) {
666 if (!has_min && !has_max) {
669 }
else if (!has_min) {
672 }
else if (!has_max) {
676 }
else if (has_min) {
683 << name <<
" but no " << name <<
" (default)");
691 if (min_value > max_value) {
692 if (has_min && has_max) {
693 std::string from_min = (new_min ?
"new" :
"previous");
694 std::string from_max = (new_max ?
"new" :
"previous");
696 <<
" min-" << name <<
" ("
697 << min_value <<
") is not less than "
698 << from_max <<
" max-" << name
699 <<
" (" << max_value <<
")");
700 }
else if (has_min) {
702 std::string from_min = (new_min ?
"new" :
"previous");
703 std::string from_value = (new_value ?
"new" :
"previous");
705 <<
" min-" << name <<
" ("
706 << min_value <<
") is not less than " << from_value
707 <<
" (default) " << name
708 <<
" (" << value <<
")");
711 std::string from_max = (new_max ?
"new" :
"previous");
712 std::string from_value = (new_value ?
"new" :
"previous");
714 <<
" (default) " << name
715 <<
" (" << value <<
") is not less than " << from_max
716 <<
" max-" << name <<
" (" << max_value <<
")");
721 if ((value < min_value) || (value > max_value)) {
722 std::string from_value = (new_value ?
"new" :
"previous");
723 std::string from_min = (new_min ?
"new" :
"previous");
724 std::string from_max = (new_max ?
"new" :
"previous");
726 <<
" (default) " << name <<
" ("
727 << value <<
") is not between " << from_min
728 <<
" min-" << name <<
" (" << min_value
729 <<
") and " << from_max <<
" max-"
730 << name <<
" (" << max_value <<
")");
747 if (!loggers_info.empty()) {
750 for (LoggingInfoStorage::const_iterator logger =
751 loggers_info.cbegin();
752 logger != loggers_info.cend(); ++logger) {
753 loggers->add(logger->toElement());
755 dhcp->set(
"loggers", loggers);
767 compatibility->set(
"ignore-dhcp-server-identifier",
Element::create(
true));
770 compatibility->set(
"ignore-rai-link-selection",
Element::create(
true));
775 if (compatibility->size() > 0) {
776 dhcp->set(
"compatibility", compatibility);
780 dhcp->set(
"decline-probation-period",
783 if (family == AF_INET) {
787 dhcp->set(
"dhcp4o6-port",
790 dhcp->set(
"dhcp-ddns", d2_client_config_->toElement());
792 dhcp->set(
"interfaces-config", cfg_iface_->toElement());
794 dhcp->set(
"option-def", cfg_option_def_->toElement());
796 dhcp->set(
"option-data", cfg_option_->toElement());
809 std::vector<ElementPtr> sn_list;
811 if (family == AF_INET) {
815 for (
auto const& subnet : *subnets) {
818 subnet->getSharedNetwork(network);
823 sn_list.push_back(subnet_cfg);
824 plain_subnets->add(subnet_cfg);
826 dhcp->set(
"subnet4", plain_subnets);
829 ElementPtr shared_networks = cfg_shared_networks4_->toElement();
830 dhcp->set(
"shared-networks", shared_networks);
833 const std::vector<ElementPtr> networks = shared_networks->listValue();
834 for (
auto const& network : networks) {
835 const std::vector<ElementPtr> sh_list =
836 network->get(
"subnet4")->listValue();
837 for (
auto const& subnet : sh_list) {
838 sn_list.push_back(subnet);
846 for (
auto const& subnet : *subnets) {
849 subnet->getSharedNetwork(network);
854 sn_list.push_back(subnet_cfg);
855 plain_subnets->add(subnet_cfg);
857 dhcp->set(
"subnet6", plain_subnets);
860 ElementPtr shared_networks = cfg_shared_networks6_->toElement();
861 dhcp->set(
"shared-networks", shared_networks);
864 const std::vector<ElementPtr> networks = shared_networks->listValue();
865 for (
auto const& network : networks) {
866 const std::vector<ElementPtr> sh_list =
867 network->get(
"subnet6")->listValue();
868 for (
auto const& subnet : sh_list) {
869 sn_list.push_back(subnet);
880 if (global_resvs->size() > 0) {
881 dhcp->set(
"reservations", global_resvs);
885 for (
auto const& subnet : sn_list) {
890 SubnetID subnet_id =
id->intValue();
892 subnet->set(
"reservations", resvs);
897 dhcp->set(
"expired-leases-processing", expired);
898 if (family == AF_INET6) {
900 dhcp->set(
"server-id", cfg_duid_->toElement());
903 dhcp->set(
"relay-supplied-options", cfg_rsoo_->toElement());
911 if (hosts_databases->size() > 0) {
912 dhcp->set(
"hosts-databases", hosts_databases);
916 if (family == AF_INET) {
917 host_ids = cfg_host_operations4_->toElement();
919 host_ids = cfg_host_operations6_->toElement();
921 dhcp->set(
"host-reservation-identifiers", host_ids);
923 if (family == AF_INET6) {
924 dhcp->set(
"mac-sources", cfg_mac_source_.toElement());
928 if (!
isNull(unix_control_socket_)) {
929 for (
auto const& socket : unix_control_socket_->listValue()) {
933 if (!
isNull(http_control_socket_)) {
934 for (
auto const& socket : http_control_socket_->listValue()) {
938 if (!control_sockets->empty()) {
939 dhcp->set(
"control-sockets", control_sockets);
944 if (!client_classes->empty()) {
945 dhcp->set(
"client-classes", client_classes);
949 dhcp->set(
"hooks-libraries", hooks_libs);
951 result->set(family == AF_INET ?
"Dhcp4" :
"Dhcp6",
dhcp);
954 dhcp->set(
"sanity-checks", cfg_consist);
960 dhcp->set(
"config-control", info_elem);
965 if (dhcp_queue_control) {
966 dhcp->set(
"dhcp-queue-control", dhcp_queue_control);
971 if (dhcp_multi_threading) {
972 dhcp->set(
"multi-threading", dhcp_multi_threading);
1011 auto optional = pool_->getDdnsSendUpdates();
1012 if (!optional.unspecified()) {
1013 return (optional.get());
1017 return (d2_client_enabled_ && subnet_->getDdnsSendUpdates().get());
1027 auto optional = pool_->getDdnsOverrideNoUpdate();
1028 if (!optional.unspecified()) {
1029 return (optional.get());
1033 return (subnet_->getDdnsOverrideNoUpdate().get());
1042 auto optional = pool_->getDdnsOverrideClientUpdate();
1043 if (!optional.unspecified()) {
1044 return (optional.get());
1048 return (subnet_->getDdnsOverrideClientUpdate().get());
1058 auto optional = pool_->getDdnsReplaceClientNameMode();
1059 if (!optional.unspecified()) {
1060 return (optional.get());
1064 return (subnet_->getDdnsReplaceClientNameMode().get());
1074 auto optional = pool_->getDdnsGeneratedPrefix();
1075 if (!optional.unspecified()) {
1076 return (optional.get());
1080 return (subnet_->getDdnsGeneratedPrefix().get());
1090 auto optional = pool_->getDdnsQualifyingSuffix();
1091 if (!optional.unspecified()) {
1092 return (optional.get());
1096 return (subnet_->getDdnsQualifyingSuffix().get());
1105 return (subnet_->getHostnameCharSet().get());
1114 return (subnet_->getHostnameCharReplacement().get());
1122 if (!char_set.empty()) {
1126 }
catch (
const std::exception& ex) {
1128 "' is not a valid regular expression");
1150 if (has_ddns_ttl_min && has_ddns_ttl) {
1155 if (has_ddns_ttl_max) {
1160 if (has_ddns_ttl_min) {
1162 uint32_t ddns_ttl_min = has_ddns_ttl_min->intValue();
1163 uint32_t ddns_ttl_max = has_ddns_ttl_max->intValue();
1164 if (ddns_ttl_max < ddns_ttl_min) {
1166 <<
" must be greater than ddns-ttl-min: " << ddns_ttl_min);
1174 const std::string type =
"type";
1181 DatabaseConnection::ParameterMap::iterator it = parameters.find(type);
1182 if (it == parameters.end()) {
1184 "contain the 'type' keyword" << redacted);
1187 std::string db_type = it->second;
1188 bool allowed = (db_type ==
"mysql" || db_type ==
"postgresql");
1191 if (subnet->getAllocatorType() ==
"shared-flq") {
1193 isc_throw(
BadValue,
"shared-flq allocator is only supported by MySQL and PosgreSQL backends");
1201 if (subnet->getAllocatorType() ==
"shared-flq") {
1203 isc_throw(
BadValue,
"shared-flq allocator is only supported by MySQL and PosgreSQL backends");
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
A generic exception that is thrown if a function is called in a prohibited way.
A generic exception that is thrown if a parameter given to a method or function is considered invalid...
static ElementPtr create(const Position &pos=ZERO_POSITION())
Create a NullElement.
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
Notes: IntElement type is changed to int64_t.
static size_t setDefaults(isc::data::ElementPtr scope, const SimpleDefaults &default_values)
Sets the default values.
static std::string redactedAccessString(const ParameterMap ¶meters)
Redact database access string.
static ParameterMap parse(const std::string &dbaccess)
Parse database access string.
Parameters for various consistency checks.
Holds manual configuration of the server identifier (DUID).
Holds access parameters and the configuration of the lease and hosts database connection.
Holds configuration parameters pertaining to lease expiration and lease affinity.
Class to store configured global parameters.
Represents global configuration for host reservations.
Utility class to represent host reservation configurations internally as a map keyed by subnet IDs,...
isc::data::ConstElementPtr get(SubnetID id) const
Return the host reservations for a subnet ID.
void internalize(isc::data::ConstElementPtr list)
Internalize a list Element.
Represents the host reservations specified in the configuration file.
Represents selection of interfaces for DHCP server.
uint16_t getFamily() const
Returns address family.
static CfgMgr & instance()
returns a single instance of Configuration Manager
static void extract(data::ConstElementPtr value, bool &enabled, uint32_t &thread_count, uint32_t &queue_size)
Extract multi-threading parameters from a given configuration.
Represents option definitions used by the DHCP server.
Represents option data configuration for the DHCP server.
Represents configuration of the RSOO options for the DHCP server.
Represents configuration of IPv4 shared networks.
Represents configuration of IPv6 shared networks.
Holds subnets configured for the DHCPv4 server.
Holds subnets configured for the DHCPv6 server.
Maintains a list of ClientClassDef's.
static size_t setAllDefaults(isc::data::ConstElementPtr d2_config)
Sets all defaults for D2 client configuration.
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.
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.
std::string getQualifyingSuffix() const
Returns the suffix Kea should use when to qualify partial domain-names.
bool getOverrideNoUpdate() const
Returns whether or not Kea should perform updates, even if client requested no updates.
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.
static bool haveInstance()
Indicates if the lease manager has been instantiated.
static bool lenient_parsing_
Governs whether options should be parsed less strictly.
static void sanityChecksSflqAllocator6(Subnet6Ptr subnet)
Sanity checks the subnet and pool configuration for use with SFLQ.
static void sanityChecksSflqAllocator4(Subnet4Ptr subnet)
Sanity checks the subnet and pool configuration for use with SFLQ.
static const isc::data::SimpleDefaults DHCP_MULTI_THREADING4_DEFAULTS
This table defines default values for multi-threading in DHCPv4.
static const isc::data::SimpleDefaults SANITY_CHECKS4_DEFAULTS
This defines default values for sanity checking for DHCPv4.
static const isc::data::SimpleDefaults DHCP_QUEUE_CONTROL4_DEFAULTS
This table defines default values for dhcp-queue-control in DHCPv4.
static const isc::data::SimpleDefaults DHCP_QUEUE_CONTROL6_DEFAULTS
This table defines default values for dhcp-queue-control in DHCPv6.
static const isc::data::SimpleDefaults DHCP_MULTI_THREADING6_DEFAULTS
This table defines default values for multi-threading in DHCPv6.
static const isc::data::SimpleDefaults SANITY_CHECKS6_DEFAULTS
This defines default values for sanity checking for DHCPv6.
Specifies current DHCP configuration.
ClientClassDictionaryPtr getClientClassDictionary()
Returns pointer to the dictionary of global client class definitions.
static const uint32_t CFGSEL_SUBNET4
Number of IPv4 subnets.
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.
CfgGlobalsPtr getConfiguredGlobals()
Returns non-const pointer to configured global parameters.
void sanityChecksDdnsTtlParameters() const
Conducts sanity checks on global DDNS ttl parameters: ddns-ttl, ddns-ttl-percent, ddns-ttl-min,...
void setClientClassDictionary(const ClientClassDictionaryPtr &dictionary)
Sets the client class dictionary.
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.
isc::data::ConstElementPtr getConfiguredGlobal(std::string name) const
Returns pointer to a given configured global parameter.
CfgSharedNetworks6Ptr getCfgSharedNetworks6() const
Returns pointer to non-const object holding configuration of shared networks in DHCPv6.
bool getIgnoreRAILinkSelection() const
Get ignore RAI Link Selection compatibility flag.
void setD2ClientConfig(const D2ClientConfigPtr &d2_client_config)
Sets the D2 client configuration.
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.
CfgDUIDPtr getCfgDUID()
Returns pointer to the object holding configuration of the server identifier.
void sanityChecksSflqAllocator() const
Conducts sanity check in use of SFLQ allocator.
bool sequenceEquals(const SrvConfig &other)
Compares configuration sequence with other sequence.
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.
D2ClientConfigPtr getD2ClientConfig()
Returns pointer to the D2 client configuration.
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.
const isc::data::ConstElementPtr getDHCPMultiThreading() const
Returns DHCP multi threading information.
void setDHCPQueueControl(const isc::data::ConstElementPtr dhcp_queue_control)
Sets information about the dhcp queue control.
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.
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.
bool equals(const SrvConfig &other) const
Compares two objects for equality.
uint32_t getSequence() const
Returns configuration sequence number.
static const uint32_t CFGSEL_DDNS
DDNS enabled/disabled.
void setDeclinePeriod(const uint32_t decline_timer)
Sets decline probation-period.
void removeStatistics()
Removes statistics.
CfgExpirationPtr getCfgExpiration()
Returns pointer to the object holding configuration pertaining to processing expired leases.
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.
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.
void updateStatistics()
Updates statistics.
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...
bool getIgnoreServerIdentifier() const
Get ignore DHCP Server Identifier compatibility flag.
SrvConfig()
Default constructor.
CfgHostOperationsPtr getCfgHostOperations4()
Returns pointer to the object holding general configuration for host reservations in DHCPv4.
void clear()
Removes all configured hooks libraries.
void add(const std::string &libname, isc::data::ConstElementPtr parameters, const std::string &cfgname="")
Adds additional hooks libraries.
const isc::hooks::HookLibsCollection & get() const
Provides access to the configured hooks libraries.
Base class for all configurations.
process::ConstConfigControlInfoPtr getConfigControlInfo() const
Fetches a read-only copy of the configuration control information.
const process::LoggingInfoStorage & getLoggingInfo() const
Returns logging specific configuration.
void setServerTag(const util::Optional< std::string > &server_tag)
Sets the server's logical name.
void copy(ConfigBase &new_config) const
Copies the current configuration to a new configuration.
virtual void merge(ConfigBase &other)
Merges specified configuration into this configuration.
bool equals(const ConfigBase &other) const
Compares two configuration.
Statistics Manager class.
static StatsMgr & instance()
Statistics Manager accessor method.
Implements a regular expression based string scrubber.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
void setMaxSampleCountDefault(uint32_t max_samples)
Set default count limit.
void setMaxSampleAgeAll(const StatsDuration &duration)
Set duration limit for all collected statistics.
void setMaxSampleCountAll(uint32_t max_samples)
Set count limit for all collected statistics.
void setMaxSampleAgeDefault(const StatsDuration &duration)
Set default duration limit.
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
boost::shared_ptr< const Element > ConstElementPtr
bool isNull(ConstElementPtr p)
Checks whether the given ElementPtr is a null pointer.
std::vector< SimpleDefault > SimpleDefaults
This specifies all default values in a given scope (e.g. a subnet).
boost::shared_ptr< Element > ElementPtr
isc::log::Logger dhcpsrv_logger("dhcpsrv")
DHCP server library Logger.
boost::shared_ptr< CfgDUID > CfgDUIDPtr
Pointer to the Non-const object.
boost::shared_ptr< D2ClientConfig > D2ClientConfigPtr
Defines a pointer for D2ClientConfig instances.
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::multi_index_container< Subnet6Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > > > > Subnet6Collection
A collection of Subnet6 objects.
boost::shared_ptr< DdnsParams > DdnsParamsPtr
Defines a pointer for DdnsParams instances.
boost::shared_ptr< SharedNetwork6 > SharedNetwork6Ptr
Pointer to SharedNetwork6 object.
boost::multi_index_container< Subnet4Ptr, boost::multi_index::indexed_by< boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetSubnetIdIndexTag >, boost::multi_index::const_mem_fun< Subnet, SubnetID, &Subnet::getID > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SubnetPrefixIndexTag >, boost::multi_index::const_mem_fun< Subnet, std::string, &Subnet::toText > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetServerIdIndexTag >, boost::multi_index::const_mem_fun< Network4, asiolink::IOAddress, &Network4::getServerId > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SubnetModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > > > > Subnet4Collection
A collection of Subnet4 objects.
uint32_t SubnetID
Defines unique IPv4 or IPv6 subnet identifier.
const isc::log::MessageID DHCPSRV_CFGMGR_IP_RESERVATIONS_UNIQUE_DUPLICATES_POSSIBLE
boost::shared_ptr< SharedNetwork4 > SharedNetwork4Ptr
Pointer to SharedNetwork4 object.
boost::shared_ptr< const ConfigControlInfo > ConstConfigControlInfoPtr
Defines a pointer to a const ConfigControlInfo.
std::unique_ptr< StringSanitizer > StringSanitizerPtr
Type representing the pointer to the StringSanitizer.
Defines the logger used by the top-level component of kea-lfc.
Represents the position of the data element within a configuration string.
void contextToElement(data::ElementPtr map) const
Merge unparse a user_context object.
static data::ElementPtr toElement(data::ConstElementPtr map)
Copy an Element map.
virtual isc::data::ElementPtr toElement() const
Unparse.
utility class for unparsing
virtual isc::data::ElementPtr toElement() const
Unparse.