Kea 2.7.6
dhcp6/json_config_parser.cc
Go to the documentation of this file.
1// Copyright (C) 2012-2024 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>
26#include <dhcpsrv/cfg_option.h>
27#include <dhcpsrv/cfgmgr.h>
28#include <dhcpsrv/db_type.h>
44#include <dhcpsrv/host_mgr.h>
45#include <dhcpsrv/pool.h>
46#include <dhcpsrv/subnet.h>
47#include <dhcpsrv/timer_mgr.h>
48#include <hooks/hooks_manager.h>
49#include <hooks/hooks_parser.h>
50#include <log/logger_support.h>
52#include <util/encode/encode.h>
54#include <util/triplet.h>
55#include <boost/algorithm/string.hpp>
56#include <boost/lexical_cast.hpp>
57#include <boost/scoped_ptr.hpp>
58#include <boost/shared_ptr.hpp>
59
60#include <iostream>
61#include <limits>
62#include <map>
63#include <netinet/in.h>
64#include <vector>
65
66#include <stdint.h>
67
68using namespace isc::asiolink;
69using namespace isc::config;
70using namespace isc::data;
71using namespace isc::db;
72using namespace isc::dhcp;
73using namespace isc::hooks;
74using namespace isc::process;
75using namespace isc::util;
76using namespace isc;
77using namespace std;
78
79//
80// Register database backends
81//
82namespace {
83
88void dirExists(const string& dir_path) {
89 struct stat statbuf;
90 if (stat(dir_path.c_str(), &statbuf) < 0) {
91 isc_throw(BadValue, "Bad directory '" << dir_path
92 << "': " << strerror(errno));
93 }
94 if ((statbuf.st_mode & S_IFMT) != S_IFDIR) {
95 isc_throw(BadValue, "'" << dir_path << "' is not a directory");
96 }
97}
98
107class RSOOListConfigParser : public isc::data::SimpleParser {
108public:
109
117 void parse(const SrvConfigPtr& cfg, const isc::data::ConstElementPtr& value) {
118 try {
119 for (auto const& source_elem : value->listValue()) {
120 std::string option_str = source_elem->stringValue();
121 // This option can be either code (integer) or name. Let's try code first
122 int64_t code = 0;
123 try {
124 code = boost::lexical_cast<int64_t>(option_str);
125 // Protect against the negative value and too high value.
126 if (code < 0) {
127 isc_throw(BadValue, "invalid option code value specified '"
128 << option_str << "', the option code must be a"
129 " non-negative value");
130
131 } else if (code > std::numeric_limits<uint16_t>::max()) {
132 isc_throw(BadValue, "invalid option code value specified '"
133 << option_str << "', the option code must not be"
134 " greater than '" << std::numeric_limits<uint16_t>::max()
135 << "'");
136 }
137
138 } catch (const boost::bad_lexical_cast &) {
139 // Oh well, it's not a number
140 }
141
142 if (!code) {
144 option_str);
145 if (def) {
146 code = def->getCode();
147 } else {
148 isc_throw(BadValue, "unable to find option code for the "
149 " specified option name '" << option_str << "'"
150 " while parsing the list of enabled"
151 " relay-supplied-options");
152 }
153 }
154 cfg->getCfgRSOO()->enable(code);
155 }
156 } catch (const std::exception& ex) {
157 // Rethrow exception with the appended position of the parsed
158 // element.
159 isc_throw(DhcpConfigError, ex.what() << " (" << value->getPosition() << ")");
160 }
161 }
162};
163
172class Dhcp6ConfigParser : public isc::data::SimpleParser {
173public:
174
189 void parse(const SrvConfigPtr& cfg, const ConstElementPtr& global) {
190
191 // Set the data directory for server id file.
192 if (global->contains("data-directory")) {
193 CfgMgr::instance().setDataDir(getString(global, "data-directory"),
194 false);
195 }
196
197 // Set the probation period for decline handling.
198 uint32_t probation_period =
199 getUint32(global, "decline-probation-period");
200 cfg->setDeclinePeriod(probation_period);
201
202 // Set the DHCPv4-over-DHCPv6 interserver port.
203 uint16_t dhcp4o6_port = getUint16(global, "dhcp4o6-port");
204 cfg->setDhcp4o6Port(dhcp4o6_port);
205
206 // Set the global user context.
207 ConstElementPtr user_context = global->get("user-context");
208 if (user_context) {
209 cfg->setContext(user_context);
210 }
211
212 // Set the server's logical name
213 std::string server_tag = getString(global, "server-tag");
214 cfg->setServerTag(server_tag);
215 }
216
228 void parseEarly(const SrvConfigPtr& cfg, const ConstElementPtr& global) {
229 // Set ip-reservations-unique flag.
230 bool ip_reservations_unique = getBoolean(global, "ip-reservations-unique");
231 cfg->setIPReservationsUnique(ip_reservations_unique);
232 }
233
240 void
241 copySubnets6(const CfgSubnets6Ptr& dest, const CfgSharedNetworks6Ptr& from) {
242
243 if (!dest || !from) {
244 isc_throw(BadValue, "Unable to copy subnets: at least one pointer is null");
245 }
246
247 const SharedNetwork6Collection* networks = from->getAll();
248 if (!networks) {
249 // Nothing to copy. Technically, it should return a pointer to empty
250 // container, but let's handle null pointer as well.
251 return;
252 }
253
254 // Let's go through all the networks one by one
255 for (auto const& net : *networks) {
256
257 // For each network go through all the subnets in it.
258 const Subnet6SimpleCollection* subnets = net->getAllSubnets();
259 if (!subnets) {
260 // Shared network without subnets it weird, but we decided to
261 // accept such configurations.
262 continue;
263 }
264
265 // For each subnet, add it to a list of regular subnets.
266 for (auto const& subnet : *subnets) {
267 dest->add(subnet);
268 }
269 }
270 }
271
280 void
281 sanityChecks(const SrvConfigPtr& cfg, const ConstElementPtr& global) {
282
284 cfg->sanityChecksLifetime("preferred-lifetime");
285 cfg->sanityChecksLifetime("valid-lifetime");
286
288 cfg->sanityChecksDdnsTtlParameters();
289
291 const SharedNetwork6Collection* networks = cfg->getCfgSharedNetworks6()->getAll();
292 if (networks) {
293 sharedNetworksSanityChecks(*networks, global->get("shared-networks"));
294 }
295 }
296
303 void
304 sharedNetworksSanityChecks(const SharedNetwork6Collection& networks,
305 ConstElementPtr json) {
306
308 if (!json) {
309 // No json? That means that the shared-networks was never specified
310 // in the config.
311 return;
312 }
313
314 // Used for names uniqueness checks.
315 std::set<string> names;
316
317 // Let's go through all the networks one by one
318 for (auto const& net : networks) {
319 string txt;
320
321 // Let's check if all subnets have either the same interface
322 // or don't have the interface specified at all.
323 string iface = net->getIface();
324
325 const Subnet6SimpleCollection* subnets = net->getAllSubnets();
326 if (subnets) {
327
328 bool rapid_commit = false;
329
330 // Rapid commit must either be enabled or disabled in all subnets
331 // in the shared network.
332 if (subnets->size()) {
333 // If this is the first subnet, remember the value.
334 rapid_commit = (*subnets->begin())->getRapidCommit();
335 }
336
337 // For each subnet, add it to a list of regular subnets.
338 for (auto const& subnet : *subnets) {
339 // Ok, this is the second or following subnets. The value
340 // must match what was set in the first subnet.
341 if (rapid_commit != subnet->getRapidCommit()) {
342 isc_throw(DhcpConfigError, "All subnets in a shared network "
343 "must have the same rapid-commit value. Subnet "
344 << subnet->toText()
345 << " has specified rapid-commit "
346 << (subnet->getRapidCommit() ? "true" : "false")
347 << ", but earlier subnet in the same shared-network"
348 << " or the shared-network itself used rapid-commit "
349 << (rapid_commit ? "true" : "false"));
350 }
351
352 if (iface.empty()) {
353 iface = subnet->getIface();
354 continue;
355 }
356
357 if (subnet->getIface().empty()) {
358 continue;
359 }
360
361 if (subnet->getIface() != iface) {
362 isc_throw(DhcpConfigError, "Subnet " << subnet->toText()
363 << " has specified interface " << subnet->getIface()
364 << ", but earlier subnet in the same shared-network"
365 << " or the shared-network itself used " << iface);
366 }
367
368 // Let's collect the subnets in case we later find out the
369 // subnet doesn't have a mandatory name.
370 txt += subnet->toText() + " ";
371 }
372 }
373
374 // Next, let's check name of the shared network.
375 if (net->getName().empty()) {
376 isc_throw(DhcpConfigError, "Shared-network with subnets "
377 << txt << " is missing mandatory 'name' parameter");
378 }
379
380 // Is it unique?
381 if (names.find(net->getName()) != names.end()) {
382 isc_throw(DhcpConfigError, "A shared-network with "
383 "name " << net->getName() << " defined twice.");
384 }
385 names.insert(net->getName());
386
387 }
388 }
389};
390
391} // anonymous namespace
392
393namespace isc {
394namespace dhcp {
395
404 // Get new UNIX socket configuration.
405 ConstElementPtr sock_cfg =
406 CfgMgr::instance().getStagingCfg()->getUnixControlSocketInfo();
407
408 // Get current UNIX socket configuration.
409 ConstElementPtr current_sock_cfg =
410 CfgMgr::instance().getCurrentCfg()->getUnixControlSocketInfo();
411
412 // Determine if the socket configuration has changed. It has if
413 // both old and new configuration is specified but respective
414 // data elements aren't equal.
415 bool sock_changed = (sock_cfg && current_sock_cfg &&
416 !sock_cfg->equals(*current_sock_cfg));
417
418 // If the previous or new socket configuration doesn't exist or
419 // the new configuration differs from the old configuration we
420 // close the existing socket and open a new socket as appropriate.
421 // Note that closing an existing socket means the client will not
422 // receive the configuration result.
423 if (!sock_cfg || !current_sock_cfg || sock_changed) {
424 // Close the existing socket (if any).
426
427 if (sock_cfg) {
428 // This will create a control socket and install the external
429 // socket in IfaceMgr. That socket will be monitored when
430 // Dhcp6Srv::receivePacket() calls IfaceMgr::receive6() and
431 // callback in CommandMgr will be called, if necessary.
433 }
434 }
435
436 // HTTP control socket is simpler: just (re)configure it.
437
438 // Get new config.
439 HttpCommandConfigPtr http_config =
440 CfgMgr::instance().getStagingCfg()->getHttpControlSocketInfo();
441 HttpCommandMgr::instance().configure(http_config);
442}
443
450 // Revert any runtime option definitions configured so far and not committed.
452 // Let's set empty container in case a user hasn't specified any configuration
453 // for option definitions. This is equivalent to committing empty container.
455
456 // Answer will hold the result.
457 ConstElementPtr answer;
458
459 // Global parameter name in case of an error.
460 string parameter_name;
461 ElementPtr mutable_cfg;
462 SrvConfigPtr srv_config;
463 try {
464 // Get the staging configuration.
465 srv_config = CfgMgr::instance().getStagingCfg();
466
467 // This is a way to convert ConstElementPtr to ElementPtr.
468 // We need a config that can be edited, because we will insert
469 // default values and will insert derived values as well.
470 mutable_cfg = boost::const_pointer_cast<Element>(config_set);
471
472 // Set all default values if not specified by the user.
474
475 // And now derive (inherit) global parameters to subnets, if not specified.
477
478 // In principle we could have the following code structured as a series
479 // of long if else if clauses. That would give a marginal performance
480 // boost, but would make the code less readable. We had serious issues
481 // with the parser code debugability, so I decided to keep it as a
482 // series of independent ifs.
483
484 // This parser is used in several places.
485 Dhcp6ConfigParser global_parser;
486
487 // Apply global options in the staging config, e.g. ip-reservations-unique
488 global_parser.parseEarly(srv_config, mutable_cfg);
489
490 // Specific check for this global parameter.
491 ConstElementPtr data_directory = mutable_cfg->get("data-directory");
492 if (data_directory) {
493 parameter_name = "data-directory";
494 dirExists(data_directory->stringValue());
495 }
496
497 // We need definitions first
498 ConstElementPtr option_defs = mutable_cfg->get("option-def");
499 if (option_defs) {
500 parameter_name = "option-def";
501 OptionDefListParser parser(AF_INET6);
502 CfgOptionDefPtr cfg_option_def = srv_config->getCfgOptionDef();
503 parser.parse(cfg_option_def, option_defs);
504 }
505
506 ConstElementPtr option_datas = mutable_cfg->get("option-data");
507 if (option_datas) {
508 parameter_name = "option-data";
509 OptionDataListParser parser(AF_INET6);
510 CfgOptionPtr cfg_option = srv_config->getCfgOption();
511 parser.parse(cfg_option, option_datas);
512 }
513
514 ConstElementPtr mac_sources = mutable_cfg->get("mac-sources");
515 if (mac_sources) {
516 parameter_name = "mac-sources";
518 CfgMACSource& mac_source = srv_config->getMACSources();
519 parser.parse(mac_source, mac_sources);
520 }
521
522 ConstElementPtr control_socket = mutable_cfg->get("control-socket");
523 if (control_socket) {
524 mutable_cfg->remove("control-socket");
526 l->add(UserContext::toElement(control_socket));
527 mutable_cfg->set("control-sockets", l);
528 }
529
530 ConstElementPtr control_sockets = mutable_cfg->get("control-sockets");
531 if (control_sockets) {
532 parameter_name = "control-sockets";
534 parser.parse(*srv_config, control_sockets);
535 }
536
537 ConstElementPtr multi_threading = mutable_cfg->get("multi-threading");
538 if (multi_threading) {
539 parameter_name = "multi-threading";
541 parser.parse(*srv_config, multi_threading);
542 }
543
544 bool multi_threading_enabled = true;
545 uint32_t thread_count = 0;
546 uint32_t queue_size = 0;
547 CfgMultiThreading::extract(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading(),
548 multi_threading_enabled, thread_count, queue_size);
549
551 ConstElementPtr queue_control = mutable_cfg->get("dhcp-queue-control");
552 if (queue_control) {
553 parameter_name = "dhcp-queue-control";
555 srv_config->setDHCPQueueControl(parser.parse(queue_control, multi_threading_enabled));
556 }
557
559 ConstElementPtr reservations_lookup_first = mutable_cfg->get("reservations-lookup-first");
560 if (reservations_lookup_first) {
561 parameter_name = "reservations-lookup-first";
562 if (multi_threading_enabled) {
564 }
565 srv_config->setReservationsLookupFirst(reservations_lookup_first->boolValue());
566 }
567
568 ConstElementPtr hr_identifiers =
569 mutable_cfg->get("host-reservation-identifiers");
570 if (hr_identifiers) {
571 parameter_name = "host-reservation-identifiers";
573 parser.parse(hr_identifiers);
574 }
575
576 ConstElementPtr server_id = mutable_cfg->get("server-id");
577 if (server_id) {
578 parameter_name = "server-id";
579 DUIDConfigParser parser;
580 const CfgDUIDPtr& cfg = srv_config->getCfgDUID();
581 parser.parse(cfg, server_id);
582 }
583
584 ConstElementPtr sanity_checks = mutable_cfg->get("sanity-checks");
585 if (sanity_checks) {
586 parameter_name = "sanity-checks";
587 SanityChecksParser parser;
588 parser.parse(*srv_config, sanity_checks);
589 }
590
591 ConstElementPtr expiration_cfg =
592 mutable_cfg->get("expired-leases-processing");
593 if (expiration_cfg) {
594 parameter_name = "expired-leases-processing";
596 parser.parse(expiration_cfg, CfgMgr::instance().getStagingCfg()->getCfgExpiration());
597 }
598
599 // The hooks-libraries configuration must be parsed after parsing
600 // multi-threading configuration so that libraries are checked
601 // for multi-threading compatibility.
602 ConstElementPtr hooks_libraries = mutable_cfg->get("hooks-libraries");
603 if (hooks_libraries) {
604 parameter_name = "hooks-libraries";
605 HooksLibrariesParser hooks_parser;
606 HooksConfig& libraries = srv_config->getHooksConfig();
607 hooks_parser.parse(libraries, hooks_libraries);
608 libraries.verifyLibraries(hooks_libraries->getPosition(),
609 multi_threading_enabled);
610 }
611
612 // D2 client configuration.
613 D2ClientConfigPtr d2_client_cfg;
614
615 // Legacy DhcpConfigParser stuff below.
616 ConstElementPtr dhcp_ddns = mutable_cfg->get("dhcp-ddns");
617 if (dhcp_ddns) {
618 parameter_name = "dhcp-ddns";
619 // Apply defaults
622 d2_client_cfg = parser.parse(dhcp_ddns);
623 }
624
625 ConstElementPtr client_classes = mutable_cfg->get("client-classes");
626 if (client_classes) {
627 parameter_name = "client-classes";
629 ClientClassDictionaryPtr dictionary =
630 parser.parse(client_classes, AF_INET6);
631 srv_config->setClientClassDictionary(dictionary);
632 }
633
634 // Please move at the end when migration will be finished.
635 ConstElementPtr lease_database = mutable_cfg->get("lease-database");
636 if (lease_database) {
637 parameter_name = "lease-database";
638 db::DbAccessParser parser;
639 std::string access_string;
640 parser.parse(access_string, lease_database);
641 CfgDbAccessPtr cfg_db_access = srv_config->getCfgDbAccess();
642 cfg_db_access->setLeaseDbAccessString(access_string);
643 }
644
645 ConstElementPtr hosts_database = mutable_cfg->get("hosts-database");
646 if (hosts_database) {
647 parameter_name = "hosts-database";
648 db::DbAccessParser parser;
649 std::string access_string;
650 parser.parse(access_string, hosts_database);
651 CfgDbAccessPtr cfg_db_access = srv_config->getCfgDbAccess();
652 cfg_db_access->setHostDbAccessString(access_string);
653 }
654
655 ConstElementPtr hosts_databases = mutable_cfg->get("hosts-databases");
656 if (hosts_databases) {
657 parameter_name = "hosts-databases";
658 CfgDbAccessPtr cfg_db_access = srv_config->getCfgDbAccess();
659 for (auto const& it : hosts_databases->listValue()) {
660 db::DbAccessParser parser;
661 std::string access_string;
662 parser.parse(access_string, it);
663 cfg_db_access->setHostDbAccessString(access_string);
664 }
665 }
666
667 // Keep relative orders of shared networks and subnets.
668 ConstElementPtr shared_networks = mutable_cfg->get("shared-networks");
669 if (shared_networks) {
670 parameter_name = "shared-networks";
677 CfgSharedNetworks6Ptr cfg = srv_config->getCfgSharedNetworks6();
678 parser.parse(cfg, shared_networks);
679
680 // We also need to put the subnets it contains into normal
681 // subnets list.
682 global_parser.copySubnets6(srv_config->getCfgSubnets6(), cfg);
683 }
684
685 ConstElementPtr subnet6 = mutable_cfg->get("subnet6");
686 if (subnet6) {
687 parameter_name = "subnet6";
688 Subnets6ListConfigParser subnets_parser;
689 // parse() returns number of subnets parsed. We may log it one day.
690 subnets_parser.parse(srv_config, subnet6);
691 }
692
693 ConstElementPtr reservations = mutable_cfg->get("reservations");
694 if (reservations) {
695 parameter_name = "reservations";
696 HostCollection hosts;
698 parser.parse(SUBNET_ID_GLOBAL, reservations, hosts);
699 for (auto const& h : hosts) {
700 srv_config->getCfgHosts()->add(h);
701 }
702 }
703
704 ConstElementPtr config_control = mutable_cfg->get("config-control");
705 if (config_control) {
706 parameter_name = "config-control";
707 ConfigControlParser parser;
708 ConfigControlInfoPtr config_ctl_info = parser.parse(config_control);
709 CfgMgr::instance().getStagingCfg()->setConfigControlInfo(config_ctl_info);
710 }
711
712 ConstElementPtr rsoo_list = mutable_cfg->get("relay-supplied-options");
713 if (rsoo_list) {
714 parameter_name = "relay-supplied-options";
715 RSOOListConfigParser parser;
716 parser.parse(srv_config, rsoo_list);
717 }
718
719 ConstElementPtr compatibility = mutable_cfg->get("compatibility");
720 if (compatibility) {
721 CompatibilityParser parser;
722 parser.parse(compatibility, *CfgMgr::instance().getStagingCfg());
723 }
724
725 // Make parsers grouping.
726 const std::map<std::string, ConstElementPtr>& values_map =
727 mutable_cfg->mapValue();
728
729 for (auto const& config_pair : values_map) {
730 parameter_name = config_pair.first;
731
732 // These are converted to SimpleParser and are handled already above.
733 if ((config_pair.first == "data-directory") ||
734 (config_pair.first == "option-def") ||
735 (config_pair.first == "option-data") ||
736 (config_pair.first == "mac-sources") ||
737 (config_pair.first == "control-socket") ||
738 (config_pair.first == "control-sockets") ||
739 (config_pair.first == "multi-threading") ||
740 (config_pair.first == "dhcp-queue-control") ||
741 (config_pair.first == "host-reservation-identifiers") ||
742 (config_pair.first == "server-id") ||
743 (config_pair.first == "interfaces-config") ||
744 (config_pair.first == "sanity-checks") ||
745 (config_pair.first == "expired-leases-processing") ||
746 (config_pair.first == "hooks-libraries") ||
747 (config_pair.first == "dhcp-ddns") ||
748 (config_pair.first == "client-classes") ||
749 (config_pair.first == "lease-database") ||
750 (config_pair.first == "hosts-database") ||
751 (config_pair.first == "hosts-databases") ||
752 (config_pair.first == "subnet6") ||
753 (config_pair.first == "shared-networks") ||
754 (config_pair.first == "reservations") ||
755 (config_pair.first == "config-control") ||
756 (config_pair.first == "relay-supplied-options") ||
757 (config_pair.first == "loggers") ||
758 (config_pair.first == "compatibility")) {
759 continue;
760 }
761
762 // As of Kea 1.6.0 we have two ways of inheriting the global parameters.
763 // The old method is used in JSON configuration parsers when the global
764 // parameters are derived into the subnets and shared networks and are
765 // being treated as explicitly specified. The new way used by the config
766 // backend is the dynamic inheritance whereby each subnet and shared
767 // network uses a callback function to return global parameter if it
768 // is not specified at lower level. This callback uses configured globals.
769 // We deliberately include both default and explicitly specified globals
770 // so as the callback can access the appropriate global values regardless
771 // whether they are set to a default or other value.
772 if ( (config_pair.first == "renew-timer") ||
773 (config_pair.first == "rebind-timer") ||
774 (config_pair.first == "preferred-lifetime") ||
775 (config_pair.first == "min-preferred-lifetime") ||
776 (config_pair.first == "max-preferred-lifetime") ||
777 (config_pair.first == "valid-lifetime") ||
778 (config_pair.first == "min-valid-lifetime") ||
779 (config_pair.first == "max-valid-lifetime") ||
780 (config_pair.first == "decline-probation-period") ||
781 (config_pair.first == "dhcp4o6-port") ||
782 (config_pair.first == "server-tag") ||
783 (config_pair.first == "reservations-global") ||
784 (config_pair.first == "reservations-in-subnet") ||
785 (config_pair.first == "reservations-out-of-pool") ||
786 (config_pair.first == "calculate-tee-times") ||
787 (config_pair.first == "t1-percent") ||
788 (config_pair.first == "t2-percent") ||
789 (config_pair.first == "cache-threshold") ||
790 (config_pair.first == "cache-max-age") ||
791 (config_pair.first == "hostname-char-set") ||
792 (config_pair.first == "hostname-char-replacement") ||
793 (config_pair.first == "ddns-send-updates") ||
794 (config_pair.first == "ddns-override-no-update") ||
795 (config_pair.first == "ddns-override-client-update") ||
796 (config_pair.first == "ddns-replace-client-name") ||
797 (config_pair.first == "ddns-generated-prefix") ||
798 (config_pair.first == "ddns-qualifying-suffix") ||
799 (config_pair.first == "ddns-update-on-renew") ||
800 (config_pair.first == "ddns-use-conflict-resolution") ||
801 (config_pair.first == "ddns-conflict-resolution-mode") ||
802 (config_pair.first == "ddns-ttl-percent") ||
803 (config_pair.first == "store-extended-info") ||
804 (config_pair.first == "statistic-default-sample-count") ||
805 (config_pair.first == "statistic-default-sample-age") ||
806 (config_pair.first == "early-global-reservations-lookup") ||
807 (config_pair.first == "ip-reservations-unique") ||
808 (config_pair.first == "reservations-lookup-first") ||
809 (config_pair.first == "parked-packet-limit") ||
810 (config_pair.first == "allocator") ||
811 (config_pair.first == "ddns-ttl") ||
812 (config_pair.first == "ddns-ttl-min") ||
813 (config_pair.first == "ddns-ttl-max") ||
814 (config_pair.first == "pd-allocator") ) {
815 CfgMgr::instance().getStagingCfg()->addConfiguredGlobal(config_pair.first,
816 config_pair.second);
817 continue;
818 }
819
820 // Nothing to configure for the user-context.
821 if (config_pair.first == "user-context") {
822 continue;
823 }
824
825 // If we got here, no code handled this parameter, so we bail out.
827 "unsupported global configuration parameter: " << config_pair.first
828 << " (" << config_pair.second->getPosition() << ")");
829 }
830
831 // Reset parameter name.
832 parameter_name = "<post parsing>";
833
834 // Apply global options in the staging config.
835 global_parser.parse(srv_config, mutable_cfg);
836
837 // This method conducts final sanity checks and tweaks. In particular,
838 // it checks that there is no conflict between plain subnets and those
839 // defined as part of shared networks.
840 global_parser.sanityChecks(srv_config, mutable_cfg);
841
842 // Validate D2 client configuration.
843 if (!d2_client_cfg) {
844 d2_client_cfg.reset(new D2ClientConfig());
845 }
846 d2_client_cfg->validateContents();
847 srv_config->setD2ClientConfig(d2_client_cfg);
848 } catch (const isc::Exception& ex) {
850 .arg(parameter_name).arg(ex.what());
852 } catch (...) {
853 // For things like bad_cast in boost::lexical_cast
854 LOG_ERROR(dhcp6_logger, DHCP6_PARSER_EXCEPTION).arg(parameter_name);
855 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration "
856 "processing error");
857 }
858
859 if (!answer) {
860 answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration seems sane. "
861 "Control-socket, hook-libraries, and D2 configuration "
862 "were sanity checked, but not applied.");
863 }
864
865 return (answer);
866}
867
870 bool check_only, bool extra_checks) {
871 if (!config_set) {
873 "Can't parse NULL config");
874 return (answer);
875 }
876
878 .arg(server.redactConfig(config_set)->str());
879
880 if (check_only) {
882 }
883
884 auto answer = processDhcp6Config(config_set);
885
886 int status_code = CONTROL_RESULT_SUCCESS;
887 isc::config::parseAnswer(status_code, answer);
888
889 SrvConfigPtr srv_config;
890
891 if (status_code == CONTROL_RESULT_SUCCESS) {
892 if (check_only) {
893 if (extra_checks) {
894 std::ostringstream err;
895 // Configure DHCP packet queueing
896 try {
898 qc = CfgMgr::instance().getStagingCfg()->getDHCPQueueControl();
899 if (IfaceMgr::instance().configureDHCPPacketQueue(AF_INET6, qc)) {
901 .arg(IfaceMgr::instance().getPacketQueue6()->getInfoStr());
902 }
903
904 } catch (const std::exception& ex) {
905 err << "Error setting packet queue controls after server reconfiguration: "
906 << ex.what();
908 status_code = CONTROL_RESULT_ERROR;
909 }
910 }
911 } else {
912 // disable multi-threading (it will be applied by new configuration)
913 // this must be done in order to properly handle MT to ST transition
914 // when 'multi-threading' structure is missing from new config and
915 // to properly drop any task items stored in the thread pool which
916 // might reference some handles to loaded hooks, preventing them
917 // from being unloaded.
918 MultiThreadingMgr::instance().apply(false, 0, 0);
919
920 // Close DHCP sockets and remove any existing timers.
922 TimerMgr::instance()->unregisterTimers();
923 server.discardPackets();
924 server.getCBControl()->reset();
925 }
926
927 if (status_code == CONTROL_RESULT_SUCCESS) {
928 string parameter_name;
929 ElementPtr mutable_cfg;
930 try {
931 // Get the staging configuration.
932 srv_config = CfgMgr::instance().getStagingCfg();
933
934 // This is a way to convert ConstElementPtr to ElementPtr.
935 // We need a config that can be edited, because we will insert
936 // default values and will insert derived values as well.
937 mutable_cfg = boost::const_pointer_cast<Element>(config_set);
938
939 ConstElementPtr ifaces_config = mutable_cfg->get("interfaces-config");
940 if (ifaces_config) {
941 parameter_name = "interfaces-config";
942 IfacesConfigParser parser(AF_INET6, check_only);
943 CfgIfacePtr cfg_iface = srv_config->getCfgIface();
944 cfg_iface->reset();
945 parser.parse(cfg_iface, ifaces_config);
946 }
947 } catch (const isc::Exception& ex) {
949 .arg(parameter_name).arg(ex.what());
951 status_code = CONTROL_RESULT_ERROR;
952 } catch (...) {
953 // For things like bad_cast in boost::lexical_cast
954 LOG_ERROR(dhcp6_logger, DHCP6_PARSER_EXCEPTION).arg(parameter_name);
955 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration"
956 " processing error");
957 status_code = CONTROL_RESULT_ERROR;
958 }
959 }
960 }
961
962 // So far so good, there was no parsing error so let's commit the
963 // configuration. This will add created subnets and option values into
964 // the server's configuration.
965 // This operation should be exception safe but let's make sure.
966 if (status_code == CONTROL_RESULT_SUCCESS && !check_only) {
967 try {
968
969 // Setup the command channel.
971 } catch (const isc::Exception& ex) {
974 status_code = CONTROL_RESULT_ERROR;
975 } catch (...) {
976 // For things like bad_cast in boost::lexical_cast
978 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration"
979 " parsing error");
980 status_code = CONTROL_RESULT_ERROR;
981 }
982 }
983
984 if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
985 try {
986 // No need to commit interface names as this is handled by the
987 // CfgMgr::commit() function.
988
989 // Apply the staged D2ClientConfig, used to be done by parser commit
991 cfg = CfgMgr::instance().getStagingCfg()->getD2ClientConfig();
993 } catch (const isc::Exception& ex) {
996 status_code = CONTROL_RESULT_ERROR;
997 } catch (...) {
998 // For things like bad_cast in boost::lexical_cast
1000 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration"
1001 " parsing error");
1002 status_code = CONTROL_RESULT_ERROR;
1003 }
1004 }
1005
1006 if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
1007 try {
1008 // This occurs last as if it succeeds, there is no easy way to
1009 // revert it. As a result, the failure to commit a subsequent
1010 // change causes problems when trying to roll back.
1012 static_cast<void>(HooksManager::unloadLibraries());
1014 const HooksConfig& libraries =
1015 CfgMgr::instance().getStagingCfg()->getHooksConfig();
1016 bool multi_threading_enabled = true;
1017 uint32_t thread_count = 0;
1018 uint32_t queue_size = 0;
1019 CfgMultiThreading::extract(CfgMgr::instance().getStagingCfg()->getDHCPMultiThreading(),
1020 multi_threading_enabled, thread_count, queue_size);
1021 libraries.loadLibraries(multi_threading_enabled);
1022 } catch (const isc::Exception& ex) {
1025 status_code = CONTROL_RESULT_ERROR;
1026 } catch (...) {
1027 // For things like bad_cast in boost::lexical_cast
1029 answer = isc::config::createAnswer(CONTROL_RESULT_ERROR, "undefined configuration"
1030 " parsing error");
1031 status_code = CONTROL_RESULT_ERROR;
1032 }
1033
1034 if (extra_checks && status_code == CONTROL_RESULT_SUCCESS) {
1035 // Re-open lease and host database with new parameters.
1036 try {
1037 // Get the staging configuration.
1038 srv_config = CfgMgr::instance().getStagingCfg();
1039
1040 CfgDbAccessPtr cfg_db = CfgMgr::instance().getStagingCfg()->getCfgDbAccess();
1041 string params = "universe=6 persist=false";
1042 if (cfg_db->getExtendedInfoTablesEnabled()) {
1043 params += " extended-info-tables=true";
1044 }
1045 cfg_db->setAppendedParameters(params);
1046 cfg_db->createManagers();
1047 } catch (const std::exception& ex) {
1049 status_code = CONTROL_RESULT_ERROR;
1050 }
1051 }
1052 }
1053
1054 // Log the list of known backends.
1056
1057 // Log the list of known backends.
1059
1060 // Moved from the commit block to add the config backend indication.
1061 if (status_code == CONTROL_RESULT_SUCCESS && (!check_only || extra_checks)) {
1062 try {
1063 // If there are config backends, fetch and merge into staging config
1064 server.getCBControl()->databaseConfigFetch(srv_config,
1065 CBControlDHCPv6::FetchMode::FETCH_ALL);
1066 } catch (const isc::Exception& ex) {
1067 std::ostringstream err;
1068 err << "during update from config backend database: " << ex.what();
1071 status_code = CONTROL_RESULT_ERROR;
1072 } catch (...) {
1073 // For things like bad_cast in boost::lexical_cast
1074 std::ostringstream err;
1075 err << "during update from config backend database: "
1076 << "undefined configuration parsing error";
1079 status_code = CONTROL_RESULT_ERROR;
1080 }
1081 }
1082
1083 // Rollback changes as the configuration parsing failed.
1084 if (check_only || status_code != CONTROL_RESULT_SUCCESS) {
1085 // Revert to original configuration of runtime option definitions
1086 // in the libdhcp++.
1088
1089 if (status_code == CONTROL_RESULT_SUCCESS && extra_checks) {
1090 auto notify_libraries = ControlledDhcpv6Srv::finishConfigHookLibraries(config_set);
1091 if (notify_libraries) {
1092 return (notify_libraries);
1093 }
1094
1096 try {
1097 // Handle events registered by hooks using external IOService objects.
1099 } catch (const std::exception& ex) {
1100 std::ostringstream err;
1101 err << "Error initializing hooks: "
1102 << ex.what();
1104 }
1105 }
1106
1107 return (answer);
1108 }
1109
1111 .arg(CfgMgr::instance().getStagingCfg()->
1112 getConfigSummary(SrvConfig::CFGSEL_ALL6));
1113
1114 // Also calculate SHA256 hash of the config that was just set and
1115 // append it to the response.
1116 ConstElementPtr config = CfgMgr::instance().getStagingCfg()->toElement();
1117 string hash = BaseCommandMgr::getHash(config);
1118 ElementPtr hash_map = Element::createMap();
1119 hash_map->set("hash", Element::create(hash));
1120
1121 // Everything was fine. Configuration is successful.
1122 answer = isc::config::createAnswer(CONTROL_RESULT_SUCCESS, "Configuration successful.", hash_map);
1123 return (answer);
1124}
1125
1126} // namespace dhcp
1127} // 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.
static std::string getHash(const isc::data::ConstElementPtr &config)
returns a hash of a given Element structure
static HttpCommandMgr & instance()
HttpCommandMgr is a singleton class.
void configure(HttpCommandConfigPtr config)
Configure http control socket from configuration.
static UnixCommandMgr & instance()
UnixCommandMgr is a singleton class.
void closeCommandSocket()
Shuts down any open unix control sockets.
void openCommandSocket(const isc::data::ConstElementPtr &socket_info)
Opens unix control socket with parameters specified in socket_info (required parameters: socket-type:...
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.
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 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:235
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.
boost::shared_ptr< HttpCommandConfig > HttpCommandConfigPtr
Pointer to a HttpCommandConfig object.
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:832
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.