11 #include <boost/foreach.hpp>
287 const ParamsList SimpleParser4::INHERIT_TO_SUBNET4 = {
292 "min-valid-lifetime",
293 "max-valid-lifetime",
294 "calculate-tee-times",
297 "store-extended-info",
322 const SimpleKeywords SimpleParser4::SHARED_NETWORK4_PARAMETERS = {
377 const SimpleDefaults SimpleParser4::DHCP_QUEUE_CONTROL4_DEFAULTS = {
384 const SimpleDefaults SimpleParser4::DHCP_MULTI_THREADING4_DEFAULTS = {
405 cnt = setDefaults(global, GLOBAL4_DEFAULTS);
410 BOOST_FOREACH(
ElementPtr option_def, option_defs->listValue()) {
418 cnt += setListDefaults(options, OPTION4_DEFAULTS);
424 cnt += setListDefaults(subnets, SUBNET4_DEFAULTS);
431 cnt += setDefaults(mutable_cfg, IFACE4_DEFAULTS);
437 BOOST_FOREACH(
ElementPtr net, shared->listValue()) {
439 cnt += setDefaults(net, SHARED_NETWORK4_DEFAULTS);
443 cnt += setListDefaults(subs, SHARED_SUBNET4_DEFAULTS);
453 mutable_cfg = boost::const_pointer_cast<
Element>(queue_control);
456 global->set(
"dhcp-queue-control", mutable_cfg);
459 cnt += setDefaults(mutable_cfg, DHCP_QUEUE_CONTROL4_DEFAULTS);
464 if (multi_threading) {
465 mutable_cfg = boost::const_pointer_cast<
Element>(multi_threading);
468 global->set(
"multi-threading", mutable_cfg);
471 cnt += setDefaults(mutable_cfg, DHCP_MULTI_THREADING4_DEFAULTS);
477 mutable_cfg = boost::const_pointer_cast<
Element>(sanity_checks);
480 global->set(
"sanity-checks", mutable_cfg);
483 cnt += setDefaults(mutable_cfg, SANITY_CHECKS4_DEFAULTS);
494 BOOST_FOREACH(
ElementPtr single_subnet, subnets->listValue()) {
505 BOOST_FOREACH(
ElementPtr net, shared->listValue()) {
513 subnets = net->get(
"subnet4");
515 BOOST_FOREACH(
ElementPtr single_subnet, subnets->listValue()) {
std::map< std::string, isc::data::Element::types > SimpleKeywords
This specifies all accepted keywords with their types.
std::vector< SimpleDefault > SimpleDefaults
This specifies all default values in a given scope (e.g. a subnet).
boost::shared_ptr< Element > ElementPtr
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static size_t deriveParams(isc::data::ConstElementPtr parent, isc::data::ElementPtr child, const ParamsList ¶ms)
Derives (inherits) parameters from parent scope to a child.
static size_t setDefaults(isc::data::ElementPtr scope, const SimpleDefaults &default_values)
Sets the default values.
boost::shared_ptr< const Element > ConstElementPtr
Defines the logger used by the top-level component of kea-dhcp-ddns.
std::vector< std::string > ParamsList
This defines a list of all parameters that are derived (or inherited) between contexts.
The Element class represents a piece of data, used by the command channel and configuration parts...