Kea 2.7.8
dhcp6/json_config_parser.cc
Go to the documentation of this file.
1// Copyright (C) 2012-2025 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#include <config.h>
8
11#include <cc/data.h>
13#include <config/command_mgr.h>
19#include <dhcp6/dhcp6_log.h>
20#include <dhcp6/dhcp6_srv.h>
22#include <dhcp/libdhcp++.h>
23#include <dhcp/iface_mgr.h>
27#include <dhcpsrv/cfg_option.h>
28#include <dhcpsrv/cfgmgr.h>
29#include <dhcpsrv/db_type.h>
45#include <dhcpsrv/host_mgr.h>
46#include <dhcpsrv/pool.h>
47#include <dhcpsrv/subnet.h>
48#include <dhcpsrv/timer_mgr.h>
49#include <hooks/hooks_manager.h>
50#include <hooks/hooks_parser.h>
51#include <log/logger_support.h>
53#include <util/encode/encode.h>
55#include <util/triplet.h>
56#include <boost/algorithm/string.hpp>
57#include <boost/lexical_cast.hpp>
58#include <boost/scoped_ptr.hpp>
59#include <boost/shared_ptr.hpp>
60
61#include <iostream>
62#include <limits>
63#include <map>
64#include <netinet/in.h>
65#include <vector>
66
67#include <stdint.h>
68
69using namespace isc::asiolink;
70using namespace isc::config;
71using namespace isc::data;
72using namespace isc::db;
73using namespace isc::dhcp;
74using namespace isc::hooks;
75using namespace isc::process;
76using namespace isc::util;
77using namespace isc;
78using namespace std;
79
80//
81// Register database backends
82//
83namespace {
84
89void dirExists(const string& dir_path) {
90 struct stat statbuf;
91 if (stat(dir_path.c_str(), &statbuf) < 0) {
92 isc_throw(BadValue, "Bad directory '" << dir_path
93 << "': " << strerror(errno));
94 }
95 if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
96 isc_throw(BadValue, "'" << dir_path << "' is not a directory");
97 }
98}
99
108class RSOOListConfigParser : public isc::data::SimpleParser {
109public:
110
118 void parse(const SrvConfigPtr& cfg, const isc::data::ConstElementPtr& value) {
119 try {
120 for (auto const& source_elem : value->listValue()) {
121 std::string option_str = source_elem->stringValue();
122 // This option can be either code (integer) or name. Let's try code first
123 int64_t code = 0;
124 try {
125 code = boost::lexical_cast<int64_t>(option_str);
126 // Protect against the negative value and too high value.
127 if (code < 0) {
128 isc_throw(BadValue, "invalid option code value specified '"
129 << option_str << "', the option code must be a"
130 " non-negative value");
131
132 } else if (code > std::numeric_limits<uint16_t>::max()) {
133 isc_throw(BadValue, "invalid option code value specified '"
134 << option_str << "', the option code must not be"
135 " greater than '" << std::numeric_limits<uint16_t>::max()
136 << "'");
137 }
138
139 } catch (const boost::bad_lexical_cast &) {
140 // Oh well, it's not a number
141 }
142
143 if (!code) {
145 option_str);
146 if (def) {
147 code = def->getCode();
148 } else {
149 isc_throw(BadValue, "unable to find option code for the "
150 " specified option name '" << option_str << "'"
151 " while parsing the list of enabled"
152 " relay-supplied-options");
153 }
154 }
155 cfg->getCfgRSOO()->enable(code);
156 }
157 } catch (const std::exception& ex) {
158 // Rethrow exception with the appended position of the parsed
159 // element.
160 isc_throw(DhcpConfigError, ex.what() << " (" << value->getPosition() << ")");
161 }
162 }
163};
164
173class Dhcp6ConfigParser : public isc::data::SimpleParser {
174public:
175
190 void parse(const SrvConfigPtr& cfg, const ConstElementPtr& global) {
191
192 // Set the data directory for server id file.
193 if (global->contains("data-directory")) {
194 CfgMgr::instance().setDataDir(getString(global, "data-directory"),
195 false);
196 }
197
198 // Set the probation period for decline handling.
199 uint32_t probation_period =
200 getUint32(global, "decline-probation-period");
201 cfg->setDeclinePeriod(probation_period);
202
203 // Set the DHCPv4-over-DHCPv6 interserver port.
204 uint16_t dhcp4o6_port = getUint16(global, "dhcp4o6-port");
205 cfg->setDhcp4o6Port(dhcp4o6_port);
206
207 // Set the global user context.
208 ConstElementPtr user_context = global->get("user-context");
209 if (user_context) {
210 cfg->setContext(user_context);
211 }
212
213 // Set the server's logical name
214 std::string server_tag = getString(global, "server-tag");
215 cfg->setServerTag(server_tag);
216 }
217
229 void parseEarly(const SrvConfigPtr& cfg, const ConstElementPtr& global) {
230 // Set ip-reservations-unique flag.
231 bool ip_reservations_unique = getBoolean(global, "ip-reservations-unique");
232 cfg->setIPReservationsUnique(ip_reservations_unique);
233 }
234
241 void
242 copySubnets6(const CfgSubnets6Ptr& dest, const CfgSharedNetworks6Ptr& from) {
243
244 if (!dest || !from) {
245 isc_throw(BadValue, "Unable to copy subnets: at least one pointer is null");
246 }
247
248 const SharedNetwork6Collection* networks = from->getAll();
249 if (!networks) {
250 // Nothing to copy. Technically, it should return a pointer to empty
251 // container, but let's handle null pointer as well.
252 return;
253 }
254
255 // Let's go through all the networks one by one
256 for (auto const& net : *networks) {
257
258 // For each network go through all the subnets in it.
259 const Subnet6SimpleCollection* subnets = net->getAllSubnets();
260 if (!subnets) {
261 // Shared network without subnets it weird, but we decided to
262 // accept such configurations.
263 continue;
264 }
265
266 // For each subnet, add it to a list of regular subnets.
267 for (auto const& subnet : *subnets) {
268 dest->add(subnet);
269 }
270 }
271 }
272
281 void
282 sanityChecks(const SrvConfigPtr& cfg, const ConstElementPtr& global) {
283
285 cfg->sanityChecksLifetime("preferred-lifetime");
286 cfg->sanityChecksLifetime("valid-lifetime");
287
289 cfg->sanityChecksDdnsTtlParameters();
290
292 const SharedNetwork6Collection* networks = cfg->getCfgSharedNetworks6()->getAll();
293 if (networks) {
294 sharedNetworksSanityChecks(*networks, global->get("shared-networks"));
295 }
296 }
297
304 void
305 sharedNetworksSanityChecks(const SharedNetwork6Collection& networks,
306 ConstElementPtr json) {
307
309 if (!json) {
310 // No json? That means that the shared-networks was never specified
311 // in the config.
312 return;
313 }
314
315 // Used for names uniqueness checks.
316 std::set<string> names;
317
318 // Let's go through all the networks one by one
319 for (auto const& net : networks) {
320 string txt;
321
322 // Let's check if all subnets have either the same interface
323 // or don't have the interface specified at all.
324 string iface = net->getIface();
325
326 const Subnet6SimpleCollection* subnets = net->getAllSubnets();
327 if (subnets) {
328
329 bool rapid_commit = false;
330
331 // Rapid commit must either be enabled or disabled in all subnets
332 // in the shared network.
333 if (subnets->size()) {
334 // If this is the first subnet, remember the value.
335 rapid_commit = (*subnets->begin())->getRapidCommit();
336 }
337
338 // For each subnet, add it to a list of regular subnets.
339 for (auto const& subnet : *subnets) {
340 // Ok, this is the second or following subnets. The value
341 // must match what was set in the first subnet.
342 if (rapid_commit != subnet->getRapidCommit()) {
343 isc_throw(DhcpConfigError, "All subnets in a shared network "
344 "must have the same rapid-commit value. Subnet "
345 << subnet->toText()
346 << " has specified rapid-commit "
347 << (subnet->getRapidCommit() ? "true" : "false")
348 << ", but earlier subnet in the same shared-network"
349 << " or the shared-network itself used rapid-commit "
350 << (rapid_commit ? "true" : "false"));
351 }
352
353 if (iface.empty()) {
354 iface = subnet->getIface();
355 continue;
356 }
357
358 if (subnet->getIface().empty()) {
359 continue;
360 }
361
362 if (subnet->getIface() != iface) {
363 isc_throw(DhcpConfigError, "Subnet " << subnet->toText()
364 << " has specified interface " << subnet->getIface()
365 << ", but earlier subnet in the same shared-network"
366 << " or the shared-network itself used " << iface);
367 }
368
369 // Let's collect the subnets in case we later find out the
370 // subnet doesn't have a mandatory name.
371 txt += subnet->toText() + " ";
372 }
373 }
374
375 // Next, let's check name of the shared network.
376 if (net->getName().empty()) {
377 isc_throw(DhcpConfigError, "Shared-network with subnets "
378 << txt << " is missing mandatory 'name' parameter");
379 }
380
381 // Is it unique?
382 if (names.find(net->getName()) != names.end()) {
383 isc_throw(DhcpConfigError, "A shared-network with "
384 "name " << net->getName() << " defined twice.");
385 }
386 names.insert(net->getName());
387
388 }
389 }
390};
391
392} // anonymous namespace
393
394namespace isc {
395namespace dhcp {
396
405 // Get new UNIX socket configuration.
406 ConstElementPtr unix_config =
407 CfgMgr::instance().getStagingCfg()->getUnixControlSocketInfo();
408
409 // Get current UNIX socket configuration.
410 ConstElementPtr current_unix_config =
411 CfgMgr::instance().getCurrentCfg()->getUnixControlSocketInfo();
412
413 // Determine if the socket configuration has changed. It has if
414 // both old and new configuration is specified but respective
415 // data elements aren't equal.
416 bool sock_changed = (unix_config && current_unix_config &&
417 !unix_config->equals(*current_unix_config));
418
419 // If the previous or new socket configuration doesn't exist or
420 // the new configuration differs from the old configuration we
421 // close the existing socket and open a new socket as appropriate.
422 // Note that closing an existing socket means the client will not
423 // receive the configuration result.
424 if (!unix_config || !current_unix_config || sock_changed) {
425 if (unix_config) {
426 // This will create a control socket and install the external
427 // socket in IfaceMgr. That socket will be monitored when
428 // Dhcp6Srv::receivePacket() calls IfaceMgr::receive6() and
429 // callback in CommandMgr will be called, if necessary.
431 } else if (current_unix_config) {
433 }
434 }
435
436 // Get new HTTP/HTTPS socket configuration.
437 ConstElementPtr http_config =
438 CfgMgr::instance().getStagingCfg()->getHttpControlSocketInfo();
439
440 // Get current HTTP/HTTPS socket configuration.
441 ConstElementPtr current_http_config =
442 CfgMgr::instance().getCurrentCfg()->getHttpControlSocketInfo();
443
444 if (http_config) {
446 } else if (current_http_config) {
448 }
449}
450
457 // Revert any runtime option definitions configured so far and not committed.
459 // Let's set empty container in case a user hasn't specified any configuration
460 // for option definitions. This is equivalent to committing empty container.
462
463 // Answer will hold the result.
464 ConstElementPtr answer;
465
466 // Global parameter name in case of an error.
467 string parameter_name;
468 ElementPtr mutable_cfg;
469 SrvConfigPtr srv_config;
470 try {
471 // Get the staging configuration.
472 srv_config = CfgMgr::instance().getStagingCfg();
473
474 // This is a way to convert ConstElementPtr to ElementPtr.
475 // We need a config that can be edited, because we will insert
476 // default values and will insert derived values as well.
477 mutable_cfg = boost::const_pointer_cast<Element>(config_set);
478
479 // Set all default values if not specified by the user.
481
482 // And now derive (inherit) global parameters to subnets, if not specified.
484
485 // In principle we could have the following code structured as a series
486 // of long if else if clauses. That would give a marginal performance
487 // boost, but would make the code less readable. We had serious issues
488 // with the parser code debugability, so I decided to keep it as a
489 // series of independent ifs.
490
491 // This parser is used in several places.
492 Dhcp6ConfigParser global_parser;
493
494 // Apply global options in the staging config, e.g. ip-reservations-unique
495 global_parser.parseEarly(srv_config, mutable_cfg);
496
497 // Specific check for this global parameter.
498 ConstElementPtr data_directory = mutable_cfg->get("data-directory");
499 if (data_directory) {
500 parameter_name = "data-directory";
501 dirExists(data_directory->stringValue());
502 }
503
504 // We need definitions first
505 ConstElementPtr option_defs = mutable_cfg->get("option-def");
506 if (option_defs) {
507 parameter_name = "option-def";
508 OptionDefListParser parser(AF_INET6);
509 CfgOptionDefPtr cfg_option_def = srv_config->getCfgOptionDef();
510 parser.parse(cfg_option_def, option_defs);
511 }
512
513 ConstElementPtr option_datas = mutable_cfg->get("option-data");
514 if (option_datas) {
515 parameter_name = "option-data";
516 OptionDataListParser parser(AF_INET6);
517 CfgOptionPtr cfg_option = srv_config->getCfgOption();
518 parser.parse(cfg_option, option_datas);
519 }
520
521 ConstElementPtr mac_sources = mutable_cfg->get("mac-sources");
522 if (mac_sources) {
523 parameter_name = "mac-sources";
525 CfgMACSource& mac_source = srv_config->getMACSources();
526 parser.parse(mac_source, mac_sources);
527 }
528
529 ConstElementPtr control_socket = mutable_cfg->get("control-socket");
530 if (control_socket) {
531 mutable_cfg->remove("control-socket");
533 l->add(UserContext::toElement(control_socket));
534 mutable_cfg->set("control-sockets", l);
535 }
536
537 ConstElementPtr control_sockets = mutable_cfg->get("control-sockets");
538 if (control_sockets) {
539 parameter_name = "control-sockets";
541 parser.parse(*srv_config, control_sockets);
542 }
543
544 ConstElementPtr multi_threading = mutable_cfg->get("multi-threading");
545 if (multi_threading) {
546 parameter_name = "multi-threading";
548 parser.parse(*srv_config, multi_threading);
549 }
550
551 bool multi_threading_enabled = true;
552 uint32_t thread_count = 0;
553 uint32_t queue_size = 0;
554 CfgMultiThreading::extract(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading(),
555 multi_threading_enabled, thread_count, queue_size);
556
558 ConstElementPtr queue_control = mutable_cfg->get("dhcp-queue-control");
559 if (queue_control) {
560 parameter_name = "dhcp-queue-control";
562 srv_config->setDHCPQueueControl(parser.parse(queue_control, multi_threading_enabled));
563 }
564
566 ConstElementPtr reservations_lookup_first = mutable_cfg->get("reservations-lookup-first");
567 if (reservations_lookup_first) {
568 parameter_name = "reservations-lookup-first";
569 if (multi_threading_enabled) {
571 }
572 srv_config->setReservationsLookupFirst(reservations_lookup_first->boolValue());
573 }
574
575 ConstElementPtr hr_identifiers =
576 mutable_cfg->get("host-reservation-identifiers");
577 if (hr_identifiers) {
578 parameter_name = "host-reservation-identifiers";
580 parser.parse(hr_identifiers);
581 }
582
583 ConstElementPtr server_id = mutable_cfg->get("server-id");
584 if (server_id) {
585 parameter_name = "server-id";
586 DUIDConfigParser parser;
587 const CfgDUIDPtr& cfg = srv_config->getCfgDUID();
588 parser.parse(cfg, server_id);
589 }
590
591 ConstElementPtr sanity_checks = mutable_cfg->get("sanity-checks");
592 if (sanity_checks) {
593 parameter_name = "sanity-checks";
594 SanityChecksParser parser;
595 parser.parse(*srv_config, sanity_checks);
596 }
597
598 ConstElementPtr expiration_cfg =
599 mutable_cfg->get("expired-leases-processing");
600 if (expiration_cfg) {
601 parameter_name = "expired-leases-processing";
603 parser.parse(expiration_cfg, CfgMgr::instance().getStagingCfg()->getCfgExpiration());
604 }
605
606 // The hooks-libraries configuration must be parsed after parsing
607 // multi-threading configuration so that libraries are checked
608 // for multi-threading compatibility.
609 ConstElementPtr hooks_libraries = mutable_cfg->get("hooks-libraries");
610 if (hooks_libraries) {
611 parameter_name = "hooks-libraries";
612 HooksLibrariesParser hooks_parser;
613 HooksConfig& libraries = srv_config->getHooksConfig();
614 hooks_parser.parse(libraries, hooks_libraries);
615 libraries.verifyLibraries(hooks_libraries->getPosition(),
616 multi_threading_enabled);
617 }
618
619 // D2 client configuration.
620 D2ClientConfigPtr d2_client_cfg;
621
622 // Legacy DhcpConfigParser stuff below.
623 ConstElementPtr dhcp_ddns = mutable_cfg->get("dhcp-ddns");
624 if (dhcp_ddns) {
625 parameter_name = "dhcp-ddns";
626 // Apply defaults
629 d2_client_cfg = parser.parse(dhcp_ddns);
630 }
631
632 ConstElementPtr client_classes = mutable_cfg->get("client-classes");
633 if (client_classes) {
634 parameter_name = "client-classes";
636 ClientClassDictionaryPtr dictionary =
637 parser.parse(client_classes, AF_INET6);
638 srv_config->setClientClassDictionary(dictionary);
639 }
640
641 // Please move at the end when migration will be finished.
642 ConstElementPtr lease_database = mutable_cfg->get("lease-database");
643 if (lease_database) {
644 parameter_name = "lease-database";
645 db::DbAccessParser parser;
646 std::string access_string;
647 parser.parse(access_string, lease_database);
648 CfgDbAccessPtr cfg_db_access = srv_config->getCfgDbAccess();
649 cfg_db_access->setLeaseDbAccessString(access_string);
650 }
651
652 ConstElementPtr hosts_database = mutable_cfg->get("hosts-database");
653 if (hosts_database) {
654 parameter_name = "hosts-database";
655 db::DbAccessParser parser;
656 std::string access_string;
657 parser.parse(access_string, hosts_database);
658 CfgDbAccessPtr cfg_db_access = srv_config->getCfgDbAccess();
659 cfg_db_access->setHostDbAccessString(access_string);
660 }
661
662 ConstElementPtr hosts_databases = mutable_cfg->get("hosts-databases");
663 if (hosts_databases) {
664 parameter_name = "hosts-databases";
665 CfgDbAccessPtr cfg_db_access = srv_config->getCfgDbAccess();
666 for (auto const& it : hosts_databases->listValue()) {
667 db::DbAccessParser parser;
668 std::string access_string;
669 parser.parse(access_string, it);
670 cfg_db_access->setHostDbAccessString(access_string);
671 }
672 }
673
674 // Keep relative orders of shared networks and subnets.
675 ConstElementPtr shared_networks = mutable_cfg->get("shared-networks");
676 if (shared_networks) {
677 parameter_name = "shared-networks";
684 CfgSharedNetworks6Ptr cfg = srv_config->getCfgSharedNetworks6();
685 parser.parse(cfg, shared_networks);
686
687 // We also need to put the subnets it contains into normal
688 // subnets list.
689 global_parser.copySubnets6(srv_config->getCfgSubnets6(), cfg);
690 }
691
692 ConstElementPtr subnet6 = mutable_cfg->get("subnet6");
693 if (subnet6) {
694 parameter_name = "subnet6";
695 Subnets6ListConfigParser subnets_parser;
696 // parse() returns number of subnets parsed. We may log it one day.
697 subnets_parser.parse(srv_config, subnet6);
698 }
699
700 ConstElementPtr reservations = mutable_cfg->get("reservations");
701 if (reservations) {
702 parameter_name = "reservations";
703 HostCollection hosts;
705 parser.parse(SUBNET_ID_GLOBAL, reservations, hosts);
706 for (auto const& h : hosts) {
707 srv_config->getCfgHosts()->add(h);
708 }
709 }
710
711 ConstElementPtr config_control = mutable_cfg->get("config-control");
712 if (config_control) {
713 parameter_name = "config-control";
714 ConfigControlParser parser;
715 ConfigControlInfoPtr config_ctl_info = parser.parse(config_control);
716 CfgMgr::instance().getStagingCfg()->setConfigControlInfo(config_ctl_info);
717 }
718
719 ConstElementPtr rsoo_list = mutable_cfg->get("relay-supplied-options");
720 if (rsoo_list) {
721 parameter_name = "relay-supplied-options";
722 RSOOListConfigParser parser;
723 parser.parse(srv_config, rsoo_list);
724 }
725
726 ConstElementPtr compatibility = mutable_cfg->get("compatibility");
727 if (compatibility) {
728 CompatibilityParser parser;
729 parser.parse(compatibility, *CfgMgr::instance().getStagingCfg());
730 }
731
732 // Make parsers grouping.
733 const std::map<std::string, ConstElementPtr>& values_map =
734 mutable_cfg->mapValue();
735
736 for (auto const& config_pair : values_map) {
737 parameter_name = config_pair.first;
738
739 // These are converted to SimpleParser and are handled already above.
740 if ((config_pair.first == "data-directory") ||
741 (config_pair.first == "option-def") ||
742 (config_pair.first == "option-data") ||
743 (config_pair.first == "mac-sources") ||
744 (config_pair.first == "control-socket") ||
745 (config_pair.first == "control-sockets") ||
746 (config_pair.first == "multi-threading") ||
747 (config_pair.first == "dhcp-queue-control") ||
748 (config_pair.first == "host-reservation-identifiers") ||
749 (config_pair.first == "server-id") ||
750 (config_pair.first == "interfaces-config") ||
751 (config_pair.first == "sanity-checks") ||
752 (config_pair.first == "expired-leases-processing") ||
753 (config_pair.first == "hooks-libraries") ||
754 (config_pair.first == "dhcp-ddns") ||
755 (config_pair.first == "client-classes") ||
756 (config_pair.first == "lease-database") ||
757 (config_pair.first == "hosts-database") ||
758 (config_pair.first == "hosts-databases") ||
759 (config_pair.first == "subnet6") ||
760 (config_pair.first == "shared-networks") ||
761 (config_pair.first == "reservations") ||
762 (config_pair.first == "config-control") ||
763 (config_pair.first == "relay-supplied-options") ||
764 (config_pair.first == "loggers") ||
765 (config_pair.first == "compatibility")) {
766 continue;
767 }
768
769 // As of Kea 1.6.0 we have two ways of inheriting the global parameters.
770 // The old method is used in JSON configuration parsers when the global
771 // parameters are derived into the subnets and shared networks and are
772 // being treated as explicitly specified. The new way used by the config
773 // backend is the dynamic inheritance whereby each subnet and shared
774 // network uses a callback function to return global parameter if it
775 // is not specified at lower level. This callback uses configured globals.
776 // We deliberately include both default and explicitly specified globals
777 // so as the callback can access the appropriate global values regardless
778 // whether they are set to a default or other value.
779 if ( (config_pair.first == "renew-timer") ||
780 (config_pair.first == "rebind-timer") ||
781 (config_pair.first == "preferred-lifetime") ||
782 (config_pair.first == "min-preferred-lifetime") ||
783 (config_pair.first == "max-preferred-lifetime") ||
784 (config_pair.first == "valid-lifetime") ||
785 (config_pair.first == "min-valid-lifetime") ||
786 (config_pair.first == "max-valid-lifetime") ||
787 (config_pair.first == "decline-probation-period") ||
788 (config_pair.first == "dhcp4o6-port") ||
789 (config_pair.first == "server-tag") ||
790 (config_pair.first == "reservations-global") ||
791 (config_pair.first == "reservations-in-subnet") ||
792 (config_pair.first == "reservations-out-of-pool") ||
793 (config_pair.first == "calculate-tee-times") ||
794 (config_pair.first == "t1-percent") ||
795 (config_pair.first == "t2-percent") ||
796 (config_pair.first == "cache-threshold") ||
797 (config_pair.first == "cache-max-age") ||
798 (config_pair.first == "hostname-char-set") ||
799 (config_pair.first == "hostname-char-replacement") ||
800 (config_pair.first == "ddns-send-updates") ||
801 (config_pair.first == "ddns-override-no-update") ||
802 (config_pair.first == "ddns-override-client-update") ||
803 (config_pair.first == "ddns-replace-client-name") ||
804 (config_pair.first == "ddns-generated-prefix") ||
805 (config_pair.first == "ddns-qualifying-suffix") ||
806 (config_pair.first == "ddns-update-on-renew") ||
807 (config_pair.first == "ddns-use-conflict-resolution") ||
808 (config_pair.first == "ddns-conflict-resolution-mode") ||
809 (config_pair.first == "ddns-ttl-percent") ||
810 (config_pair.first == "store-extended-info") ||
811 (config_pair.first == "statistic-default-sample-count") ||
812 (config_pair.first == "statistic-default-sample-age") ||
813 (config_pair.first == "early-global-reservations-lookup") ||
814 (config_pair.first == "ip-reservations-unique") ||
815 (config_pair.first == "reservations-lookup-first") ||
816 (config_pair.first == "parked-packet-limit") ||
817 (config_pair.first == "allocator") ||
818 (config_pair.first == "ddns-ttl") ||
819 (config_pair.first == "ddns-ttl-min") ||
820 (config_pair.first == "ddns-ttl-max") ||
821 (config_pair.first == "pd-allocator") ) {
822 CfgMgr::instance().getStagingCfg()->addConfiguredGlobal(config_pair.first,
823 config_pair.second);
824 continue;
825 }
826
827 // Nothing to configure for the user-context.
828 if (config_pair.first == "user-context") {
829 continue;
830 }
831
832 // If we got here, no code handled this parameter, so we bail out.
834 "unsupported global configuration parameter: " << config_pair.first
835 << " (" << config_pair.second->getPosition() << ")");
836 }
837
838 // Reset parameter name.
839 parameter_name = "<post parsing>";
840
841 // Apply global options in the staging config.
842 global_parser.parse(srv_config, mutable_cfg);
843
844 // This method conducts final sanity checks and tweaks. In particular,
845 // it checks that there is no conflict between plain subnets and those
846 // defined as part of shared networks.
847 global_parser.sanityChecks(srv_config, mutable_cfg);
848
849 // Validate D2 client configuration.
850 if (!d2_client_cfg) {
851 d2_client_cfg.reset(new D2ClientConfig());
852 }
853 d2_client_cfg->validateContents();
854 srv_config->setD2ClientConfig(d2_client_cfg);
855 } catch (const isc::Exception& ex) {
857 .arg(parameter_name).arg(ex.what());
859 } catch (...) {
860 // For things like bad_cast in boost::lexical_cast
861 LOG_ERROR(dhcp6_logger, DHCP6_PARSER_EXCEPTION).arg(parameter_name);
862 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration "
863 "processing error");
864 }
865
866 if (!answer) {
867 answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration seems sane. "
868 "Control-socket, hook-libraries, and D2 configuration "
869 "were sanity checked, but not applied.");
870 }
871
872 return (answer);
873}
874
877 bool check_only, bool extra_checks) {
878 if (!config_set) {
880 "Can't parse NULL config");
881 return (answer);
882 }
883
885 .arg(server.redactConfig(config_set)->str());
886
887 if (check_only) {
889 }
890
891 auto answer = processDhcp6Config(config_set);
892
893 int status_code = CONTROL_RESULT_SUCCESS;
894 isc::config::parseAnswer(status_code, answer);
895
896 SrvConfigPtr srv_config;
897
898 if (status_code == CONTROL_RESULT_SUCCESS) {
899 if (check_only) {
900 if (extra_checks) {
901 std::ostringstream err;
902 // Configure DHCP packet queueing
903 try {
905 qc = CfgMgr::instance().getStagingCfg()->getDHCPQueueControl();
906 if (IfaceMgr::instance().configureDHCPPacketQueue(AF_INET6, qc)) {
908 .arg(IfaceMgr::instance().getPacketQueue6()->getInfoStr());
909 }
910
911 } catch (const std::exception& ex) {
912 err << "Error setting packet queue controls after server reconfiguration: "
913 << ex.what();
915 status_code = CONTROL_RESULT_ERROR;
916 }
917 }
918 } else {
919 // disable multi-threading (it will be applied by new configuration)
920 // this must be done in order to properly handle MT to ST transition
921 // when 'multi-threading' structure is missing from new config and
922 // to properly drop any task items stored in the thread pool which
923 // might reference some handles to loaded hooks, preventing them
924 // from being unloaded.
925 MultiThreadingMgr::instance().apply(false, 0, 0);
926
927 // Close DHCP sockets and remove any existing timers.
929 TimerMgr::instance()->unregisterTimers();
930 server.discardPackets();
931 server.getCBControl()->reset();
932 }
933
934 if (status_code == CONTROL_RESULT_SUCCESS) {
935 string parameter_name;
936 ElementPtr mutable_cfg;
937 try {
938 // Get the staging configuration.
939 srv_config = CfgMgr::instance().getStagingCfg();
940
941 // This is a way to convert ConstElementPtr to ElementPtr.
942 // We need a config that can be edited, because we will insert
943 // default values and will insert derived values as well.
944 mutable_cfg = boost::const_pointer_cast<Element>(config_set);
945
946 ConstElementPtr ifaces_config = mutable_cfg->get("interfaces-config");
947 if (ifaces_config) {
948 parameter_name = "interfaces-config";
949 IfacesConfigParser parser(AF_INET6, check_only);
950 CfgIfacePtr cfg_iface = srv_config->getCfgIface();
951 cfg_iface->reset();
952 parser.parse(cfg_iface, ifaces_config);
953 }
954 } catch (const isc::Exception& ex) {
956 .arg(parameter_name).arg(ex.what());
958 status_code = CONTROL_RESULT_ERROR;
959 } catch (...) {
960 // For things like bad_cast in boost::lexical_cast
961 LOG_ERROR(dhcp6_logger, DHCP6_PARSER_EXCEPTION).arg(parameter_name);
962 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration"
963 " processing error");
964 status_code = CONTROL_RESULT_ERROR;
965 }
966 }
967 }
968
969 // So far so good, there was no parsing error so let's commit the
970 // configuration. This will add created subnets and option values into
971 // the server's configuration.
972 // This operation should be exception safe but let's make sure.
973 if (status_code == CONTROL_RESULT_SUCCESS && !check_only) {
974 try {
975
976 // Setup the command channel.
978 } catch (const isc::Exception& ex) {
981 status_code = CONTROL_RESULT_ERROR;
982 } catch (...) {
983 // For things like bad_cast in boost::lexical_cast
985 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration"
986 " parsing error");
987 status_code = CONTROL_RESULT_ERROR;
988 }
989 }
990
991 if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
992 try {
993 // No need to commit interface names as this is handled by the
994 // CfgMgr::commit() function.
995
996 // Apply the staged D2ClientConfig, used to be done by parser commit
998 cfg = CfgMgr::instance().getStagingCfg()->getD2ClientConfig();
1000 } catch (const isc::Exception& ex) {
1003 status_code = CONTROL_RESULT_ERROR;
1004 } catch (...) {
1005 // For things like bad_cast in boost::lexical_cast
1007 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration"
1008 " parsing error");
1009 status_code = CONTROL_RESULT_ERROR;
1010 }
1011 }
1012
1013 if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
1014 try {
1015 // This occurs last as if it succeeds, there is no easy way to
1016 // revert it. As a result, the failure to commit a subsequent
1017 // change causes problems when trying to roll back.
1019 static_cast<void>(HooksManager::unloadLibraries());
1021 const HooksConfig& libraries =
1022 CfgMgr::instance().getStagingCfg()->getHooksConfig();
1023 bool multi_threading_enabled = true;
1024 uint32_t thread_count = 0;
1025 uint32_t queue_size = 0;
1026 CfgMultiThreading::extract(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading(),
1027 multi_threading_enabled, thread_count, queue_size);
1028 libraries.loadLibraries(multi_threading_enabled);
1029 } catch (const isc::Exception& ex) {
1032 status_code = CONTROL_RESULT_ERROR;
1033 } catch (...) {
1034 // For things like bad_cast in boost::lexical_cast
1036 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration"
1037 " parsing error");
1038 status_code = CONTROL_RESULT_ERROR;
1039 }
1040
1041 if (extra_checks && status_code == CONTROL_RESULT_SUCCESS) {
1042 // Re-open lease and host database with new parameters.
1043 try {
1044 // Get the staging configuration.
1045 srv_config = CfgMgr::instance().getStagingCfg();
1046
1047 CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
1048 string params = "universe=6 persist=false";
1049 if (cfg_db->getExtendedInfoTablesEnabled()) {
1050 params += " extended-info-tables=true";
1051 }
1052 cfg_db->setAppendedParameters(params);
1053 cfg_db->createManagers();
1054 } catch (const std::exception& ex) {
1056 status_code = CONTROL_RESULT_ERROR;
1057 }
1058 }
1059 }
1060
1061 // Log the list of known backends.
1063
1064 // Log the list of known backends.
1066
1067 // Log the list of known backends.
1069
1070 // Log the list of known backends.
1072
1073 // Moved from the commit block to add the config backend indication.
1074 if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
1075 try {
1076 // If there are config backends, fetch and merge into staging config
1077 server.getCBControl()->databaseConfigFetch(srv_config,
1078 CBControlDHCPv6::FetchMode::FETCH_ALL);
1079 } catch (const isc::Exception& ex) {
1080 std::ostringstream err;
1081 err << "during update from config backend database: " << ex.what();
1084 status_code = CONTROL_RESULT_ERROR;
1085 } catch (...) {
1086 // For things like bad_cast in boost::lexical_cast
1087 std::ostringstream err;
1088 err << "during update from config backend database: "
1089 << "undefined configuration parsing error";
1092 status_code = CONTROL_RESULT_ERROR;
1093 }
1094 }
1095
1096 // Rollback changes as the configuration parsing failed.
1097 if (check_only || status_code != CONTROL_RESULT_SUCCESS) {
1098 // Revert to original configuration of runtime option definitions
1099 // in the libdhcp++.
1101
1102 if (status_code == CONTROL_RESULT_SUCCESS && extra_checks) {
1103 auto notify_libraries = ControlledDhcpv6Srv::finishConfigHookLibraries(config_set);
1104 if (notify_libraries) {
1105 return (notify_libraries);
1106 }
1107
1109 try {
1110 // Handle events registered by hooks using external IOService objects.
1112 } catch (const std::exception& ex) {
1113 std::ostringstream err;
1114 err << "Error initializing hooks: "
1115 << ex.what();
1117 }
1118 }
1119
1120 return (answer);
1121 }
1122
1124 .arg(CfgMgr::instance().getStagingCfg()->
1125 getConfigSummary(SrvConfig::CFGSEL_ALL6));
1126
1127 // Also calculate SHA256 hash of the config that was just set and
1128 // append it to the response.
1129 ConstElementPtr config = CfgMgr::instance().getStagingCfg()->toElement();
1130 string hash = BaseCommandMgr::getHash(config);
1131 ElementPtr hash_map = Element::createMap();
1132 hash_map->set("hash", Element::create(hash));
1133
1134 // Everything was fine. Configuration is successful.
1135 answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful.", hash_map);
1136 return (answer);
1137}
1138
1139} // namespace dhcp
1140} // namespace isc
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
void logRegistered()
Logs out all registered backends.
static std::string getHash(const isc::data::ConstElementPtr &config)
returns a hash of a given Element structure
void closeCommandSockets()
Close http control sockets.
static HttpCommandMgr & instance()
HttpCommandMgr is a singleton class.
void openCommandSockets(const isc::data::ConstElementPtr config)
Open http control sockets using configuration.
static UnixCommandMgr & instance()
UnixCommandMgr is a singleton class.
void openCommandSockets(const isc::data::ConstElementPtr config)
Opens unix control socket with parameters specified in socket_info (required parameters: socket-type:...
void closeCommandSockets()
Shuts down any open unix control sockets.
static ElementPtr create(const Position &pos=ZERO_POSITION())
Definition data.cc:249
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
Definition data.cc:304
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
Definition data.cc:299
Parse Database Parameters.
void parse(std::string &access_string, isc::data::ConstElementPtr database_config)
Parse configuration value.
Wrapper class that holds MAC/hardware address sources.
void setD2ClientConfig(D2ClientConfigPtr &new_config)
Updates the DHCP-DDNS client configuration to the given value.
Definition cfgmgr.cc:44
static CfgMgr & instance()
returns a single instance of Configuration Manager
Definition cfgmgr.cc:28
void setDataDir(const std::string &datadir, bool unspecified=true)
Sets new data directory.
Definition cfgmgr.cc:39
SrvConfigPtr getStagingCfg()
Returns a pointer to the staging configuration.
Definition cfgmgr.cc:120
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
Definition cfgmgr.cc:115
static void extract(data::ConstElementPtr value, bool &enabled, uint32_t &thread_count, uint32_t &queue_size)
Extract multi-threading parameters from a given configuration.
Parser for a list of client class definitions.
ClientClassDictionaryPtr parse(isc::data::ConstElementPtr class_def_list, uint16_t family, bool check_dependencies=true)
Parse configuration entries.
void parse(isc::data::ConstElementPtr cfg, isc::dhcp::SrvConfig &srv_cfg)
Parse compatibility flags.
static ConfigBackendDHCPv6Mgr & instance()
Returns a sole instance of the ConfigBackendDHCPv6Mgr.
Parser for the control-sockets structure.
void parse(SrvConfig &srv_cfg, isc::data::ConstElementPtr value)
"Parses" control-sockets structure
static isc::data::ConstElementPtr finishConfigHookLibraries(isc::data::ConstElementPtr config)
Configuration checker for hook libraries.
Parser for D2ClientConfig.
D2ClientConfigPtr parse(isc::data::ConstElementPtr d2_client_cfg)
Parses a given dhcp-ddns element into D2ClientConfig.
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.
Parser for the configuration of DHCP packet queue controls.
data::ElementPtr parse(const isc::data::ConstElementPtr &control_elem, bool multi_threading_enabled)
Parses content of the "dhcp-queue-control".
Parser for server DUID configuration.
void parse(const CfgDUIDPtr &cfg, isc::data::ConstElementPtr duid_configuration)
Parses DUID configuration.
To be removed. Please use ConfigError instead.
DHCPv6 server service.
Definition dhcp6_srv.h:66
CBControlDHCPv6Ptr getCBControl() const
Returns an object which controls access to the configuration backends.
Definition dhcp6_srv.h:124
void discardPackets()
Discards parked packets Clears the packet parking lots of all packets.
Parser for the configuration parameters pertaining to the processing of expired leases.
void parse(isc::data::ConstElementPtr expiration_config, isc::dhcp::CfgExpirationPtr expiration)
Parses parameters in the JSON map, pertaining to the processing of the expired leases.
static void logRegistered()
Logs out all registered backends.
Parser for a list of host identifiers for DHCPv6.
void parse(isc::data::ConstElementPtr ids_list)
Parses a list of host identifiers.
Parser for a list of host reservations for a subnet.
void parse(const SubnetID &subnet_id, isc::data::ConstElementPtr hr_list, HostCollection &hosts_list)
Parses a list of host reservation entries for a subnet.
static IfaceMgr & instance()
IfaceMgr is a singleton class.
Definition iface_mgr.cc:54
void closeSockets()
Closes all open sockets.
Definition iface_mgr.cc:286
Parser for the configuration of interfaces.
void parse(const CfgIfacePtr &config, const isc::data::ConstElementPtr &values)
Parses content of the "interfaces-config".
static void logRegistered()
Logs out all registered backends.
static void logRegistered()
Logs out all registered backends.
static void setRuntimeOptionDefs(const OptionDefSpaceContainer &defs)
Copies option definitions created at runtime.
Definition libdhcp++.cc:224
static OptionDefinitionPtr getOptionDef(const std::string &space, const uint16_t code)
Return the first option definition matching a particular option code.
Definition libdhcp++.cc:132
static void revertRuntimeOptionDefs()
Reverts uncommitted changes to runtime option definitions.
Definition libdhcp++.cc:243
parser for MAC/hardware acquisition sources
void parse(CfgMACSource &mac_sources, isc::data::ConstElementPtr value)
parses parameters value
Simple parser for multi-threading structure.
void parse(SrvConfig &srv_cfg, const isc::data::ConstElementPtr &value)
parses JSON structure.
Parser for option data values within a subnet.
void parse(const CfgOptionPtr &cfg, isc::data::ConstElementPtr option_data_list, bool encapsulate=true)
Parses a list of options, instantiates them and stores in cfg.
Parser for a list of option definitions.
void parse(CfgOptionDefPtr cfg, isc::data::ConstElementPtr def_list)
Parses a list of option definitions, create them and store in cfg.
Class of option definition space container.
Simple parser for sanity-checks structure.
void parse(SrvConfig &srv_cfg, const isc::data::ConstElementPtr &value)
parses JSON structure
Parser for a list of shared networks.
void parse(CfgSharedNetworksTypePtr &cfg, const data::ConstElementPtr &shared_networks_list_data)
Parses a list of shared networks.
static size_t deriveParameters(isc::data::ElementPtr global)
Derives (inherits) all parameters from global to more specific scopes.
static size_t setAllDefaults(isc::data::ElementPtr global)
Sets all defaults for DHCPv6 configuration.
static const uint32_t CFGSEL_ALL6
IPv6 related config.
Definition srv_config.h:76
this class parses a list of DHCP6 subnets
size_t parse(SrvConfigPtr cfg, data::ConstElementPtr subnets_list, bool encapsulate_options=true)
parses contents of the list
static const TimerMgrPtr & instance()
Returns pointer to the sole instance of the TimerMgr.
Definition timer_mgr.cc:446
Wrapper class that holds hooks libraries configuration.
void verifyLibraries(const isc::data::Element::Position &position, bool multi_threading_enabled) const
Verifies that libraries stored in libraries_ are valid.
void loadLibraries(bool multi_threading_enabled) const
Commits hooks libraries configuration.
Parser for hooks library list.
void parse(HooksConfig &libraries, isc::data::ConstElementPtr value)
Parses parameters value.
static bool unloadLibraries()
Unload libraries.
static void prepareUnloadLibraries()
Prepare the unloading of libraries.
Implements parser for config control information, "config-control".
ConfigControlInfoPtr parse(const data::ConstElementPtr &config_control)
Parses a configuration control Element.
isc::data::ConstElementPtr redactConfig(isc::data::ConstElementPtr const &config)
Redact a configuration.
Definition daemon.cc:259
static MultiThreadingMgr & instance()
Returns a single instance of Multi Threading Manager.
void setTestMode(const bool test_mode)
Sets or clears the test mode for MultiThreadingMgr.
void apply(bool enabled, uint32_t thread_count, uint32_t queue_size)
Apply the multi-threading related settings.
Parsers for client class definitions.
This file contains several functions and constants that are used for handling commands and responses ...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
Logging initialization functions.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
Definition macros.h:32
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
Definition macros.h:20
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
Definition macros.h:26
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
Definition macros.h:14
ConstElementPtr parseAnswer(int &rcode, const ConstElementPtr &msg)
Parses a standard config/command level answer and returns arguments or text status code.
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
ConstElementPtr createAnswer()
Creates a standard config/command level success answer message (i.e.
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< Element > ElementPtr
Definition data.h:28
void configureCommandChannel()
Initialize the command channel based on the staging configuration.
boost::shared_ptr< CfgDUID > CfgDUIDPtr
Pointer to the Non-const object.
Definition cfg_duid.h:161
const isc::log::MessageID DHCP6_PARSER_FAIL
const isc::log::MessageID DHCP6_PARSER_EXCEPTION
boost::shared_ptr< D2ClientConfig > D2ClientConfigPtr
Defines a pointer for D2ClientConfig instances.
boost::shared_ptr< CfgOption > CfgOptionPtr
Non-const pointer.
Definition cfg_option.h:892
boost::multi_index_container< SharedNetwork6Ptr, boost::multi_index::indexed_by< boost::multi_index::random_access< boost::multi_index::tag< SharedNetworkRandomAccessIndexTag > >, boost::multi_index::hashed_non_unique< boost::multi_index::tag< SharedNetworkIdIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, uint64_t, &data::BaseStampedElement::getId > >, boost::multi_index::ordered_unique< boost::multi_index::tag< SharedNetworkNameIndexTag >, boost::multi_index::const_mem_fun< SharedNetwork6, std::string, &SharedNetwork6::getName > >, boost::multi_index::ordered_non_unique< boost::multi_index::tag< SharedNetworkModificationTimeIndexTag >, boost::multi_index::const_mem_fun< data::BaseStampedElement, boost::posix_time::ptime, &data::BaseStampedElement::getModificationTime > > > > SharedNetwork6Collection
Multi index container holding shared networks.
isc::data::ConstElementPtr configureDhcp6Server(Dhcpv6Srv &server, isc::data::ConstElementPtr config_set, bool check_only, bool extra_checks)
Configure DHCPv6 server (Dhcpv6Srv) with a set of configuration values.
boost::shared_ptr< CfgOptionDef > CfgOptionDefPtr
Non-const pointer.
boost::shared_ptr< CfgDbAccess > CfgDbAccessPtr
A pointer to the CfgDbAccess.
isc::data::ConstElementPtr processDhcp6Config(isc::data::ConstElementPtr config_set)
Process a DHCPv6 confguration and return an answer stating if the configuration is valid,...
const int DBG_DHCP6_COMMAND
Debug level used to log receiving commands.
Definition dhcp6_log.h:28
const isc::log::MessageID DHCP6_CONFIG_COMPLETE
boost::shared_ptr< CfgIface > CfgIfacePtr
A pointer to the CfgIface .
Definition cfg_iface.h:501
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
boost::shared_ptr< CfgSubnets6 > CfgSubnets6Ptr
Non-const pointer.
std::vector< HostPtr > HostCollection
Collection of the Host objects.
Definition host.h:846
const isc::log::MessageID DHCP6_RESERVATIONS_LOOKUP_FIRST_ENABLED
boost::shared_ptr< OptionDefinition > OptionDefinitionPtr
Pointer to option definition object.
boost::shared_ptr< ClientClassDictionary > ClientClassDictionaryPtr
Defines a pointer to a ClientClassDictionary.
boost::shared_ptr< CfgSharedNetworks6 > CfgSharedNetworks6Ptr
Pointer to the configuration of IPv6 shared networks.
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 > > > > Subnet6SimpleCollection
A simple collection of Subnet6 objects.
Definition subnet.h:890
const isc::log::MessageID DHCP6_PARSER_COMMIT_EXCEPTION
const isc::log::MessageID DHCP6_CONFIG_START
const isc::log::MessageID DHCP6_PARSER_COMMIT_FAIL
isc::log::Logger dhcp6_logger(DHCP6_APP_LOGGER_NAME)
Base logger for DHCPv6 server.
Definition dhcp6_log.h:88
const isc::log::MessageID DHCP6_CONFIG_PACKET_QUEUE
boost::shared_ptr< ConfigControlInfo > ConfigControlInfoPtr
Defines a pointer to a ConfigControlInfo.
Defines the logger used by the top-level component of kea-lfc.
#define DHCP6_OPTION_SPACE
static data::ElementPtr toElement(data::ConstElementPtr map)
Copy an Element map.