49namespace ph = std::placeholders;
54struct CtrlDhcp6Hooks {
55 int hooks_index_dhcp6_srv_configured_;
71static const char* SERVER_DUID_FILE =
"kea-dhcp6-serverid";
82void signalHandler(
int signo) {
84 if (signo == SIGHUP) {
86 }
else if ((signo == SIGTERM) || (signo == SIGINT)) {
101 start_ = boost::posix_time::second_clock::universal_time();
109 string reason = comment ? comment->stringValue() :
110 "no details available";
139 if (file_name.empty()) {
142 " Please use -c command line option.");
156 "a map, i.e., start with { and end with } and contain "
157 "at least an entry called 'Dhcp6' that itself is a map. "
159 <<
" is a valid JSON, but its top element is not a map."
160 " Did you forget to add { } around your configuration?");
170 "process command \"config-set\"");
178 string reason = comment ? comment->stringValue() :
179 "no details available";
182 }
catch (
const std::exception& ex) {
188 .arg(file_name).arg(ex.what());
190 << file_name <<
"': " << ex.
what());
202ControlledDhcpv6Srv::commandShutdownHandler(
const string&,
ConstElementPtr args) {
219 "parameter 'exit-value' is not an integer"));
222 exit_value = param->intValue();
231ControlledDhcpv6Srv::commandConfigReloadHandler(
const string&,
240 }
catch (
const std::exception& ex) {
247 "Config reload failed: " +
string(ex.what())));
252ControlledDhcpv6Srv::commandConfigGetHandler(
const string&,
262ControlledDhcpv6Srv::commandConfigHashGetHandler(
const string&,
274ControlledDhcpv6Srv::commandConfigWriteHandler(
const string&,
283 if (filename_param) {
286 "passed parameter 'filename' is not a string"));
288 filename = filename_param->stringValue();
292 if (filename.empty()) {
298 if (filename.empty()) {
300 "Please specify filename explicitly."));
323 + filename +
" successful", params));
327ControlledDhcpv6Srv::commandConfigSetHandler(
const string&,
336 message =
"Missing mandatory 'arguments' parameter.";
338 dhcp6 = args->get(
"Dhcp6");
340 message =
"Missing mandatory 'Dhcp6' parameter.";
342 message =
"'Dhcp6' parameter expected to be a map.";
347 if (message.empty()) {
348 for (
auto const& obj : args->mapValue()) {
349 const string& obj_name = obj.first;
350 if (obj_name !=
"Dhcp6") {
353 if (message.empty()) {
354 message =
"Unsupported '" + obj_name +
"' parameter";
356 message +=
" (and '" + obj_name +
"')";
360 if (!message.empty()) {
365 if (!message.empty()) {
422 }
catch (
const std::exception& ex) {
423 std::ostringstream err;
424 err <<
"Error initializing hooks: "
433ControlledDhcpv6Srv::commandConfigTestHandler(
const string&,
442 message =
"Missing mandatory 'arguments' parameter.";
444 dhcp6 = args->get(
"Dhcp6");
446 message =
"Missing mandatory 'Dhcp6' parameter.";
448 message =
"'Dhcp6' parameter expected to be a map.";
453 if (message.empty()) {
454 for (
auto const& obj : args->mapValue()) {
455 const string& obj_name = obj.first;
456 if (obj_name !=
"Dhcp6") {
459 if (message.empty()) {
460 message =
"Unsupported '" + obj_name +
"' parameter";
462 message +=
" (and '" + obj_name +
"')";
466 if (!message.empty()) {
471 if (!message.empty()) {
491ControlledDhcpv6Srv::commandDhcpDisableHandler(
const std::string&,
493 std::ostringstream message;
494 int64_t max_period = 0;
506 message <<
"arguments for the 'dhcp-disable' command must be a map";
511 if (max_period_element) {
514 message <<
"'max-period' argument must be a number";
518 max_period = max_period_element->intValue();
519 if (max_period <= 0) {
520 message <<
"'max-period' must be positive integer";
533 if (origin_id_element) {
535 type = origin_id_element->intValue();
537 message <<
"'origin-id' argument must be a number";
539 }
else if (origin_element) {
540 switch (origin_element->getType()) {
542 origin = origin_element->stringValue();
543 if (origin ==
"ha-partner") {
545 }
else if (origin !=
"user") {
546 if (origin.empty()) {
547 origin =
"(empty string)";
549 message <<
"invalid value used for 'origin' parameter: "
554 type = origin_element->intValue();
558 message <<
"'origin' argument must be a string or a number";
565 if (message.tellp() == 0) {
566 message <<
"DHCPv6 service disabled";
567 if (max_period > 0) {
568 message <<
" for " << max_period <<
" seconds";
573 network_state_->delayedEnableService(
static_cast<unsigned>(max_period),
587ControlledDhcpv6Srv::commandDhcpEnableHandler(
const std::string&,
589 std::ostringstream message;
600 message <<
"arguments for the 'dhcp-enable' command must be a map";
612 if (origin_id_element) {
614 type = origin_id_element->intValue();
616 message <<
"'origin-id' argument must be a number";
618 }
else if (origin_element) {
619 switch (origin_element->getType()) {
621 origin = origin_element->stringValue();
622 if (origin ==
"ha-partner") {
624 }
else if (origin !=
"user") {
625 if (origin.empty()) {
626 origin =
"(empty string)";
628 message <<
"invalid value used for 'origin' parameter: "
633 type = origin_element->intValue();
637 message <<
"'origin' argument must be a string or a number";
644 if (message.tellp() == 0) {
649 "DHCP service successfully enabled"));
657ControlledDhcpv6Srv::commandVersionGetHandler(
const string&,
ConstElementPtr) {
660 arguments->set(
"extended", extended);
668ControlledDhcpv6Srv::commandBuildReportHandler(
const string&,
676ControlledDhcpv6Srv::commandLeasesReclaimHandler(
const string&,
683 message =
"Missing mandatory 'remove' parameter.";
687 message =
"Missing mandatory 'remove' parameter.";
689 message =
"'remove' parameter expected to be a boolean.";
691 bool remove_lease = remove_name->boolValue();
692 server_->alloc_engine_->reclaimExpiredLeases6(0, 0, remove_lease);
694 message =
"Reclamation of expired leases is complete.";
702ControlledDhcpv6Srv::commandSubnet6SelectTestHandler(
const string&,
712 for (
auto const& entry : args->mapValue()) {
713 ostringstream errmsg;
714 if (entry.first ==
"interface") {
716 errmsg <<
"'interface' entry must be a string";
719 selector.iface_name_ = entry.second->stringValue();
721 }
if (entry.first ==
"interface-id") {
723 errmsg <<
"'interface-id' entry must be a string";
727 string str = entry.second->stringValue();
733 errmsg <<
"'interface-id' must be not empty";
741 errmsg <<
"value of 'interface-id' was not recognized";
744 }
else if (entry.first ==
"remote") {
746 errmsg <<
"'remote' entry must be a string";
750 IOAddress addr(entry.second->stringValue());
752 errmsg <<
"bad 'remote' entry: not IPv6";
755 selector.remote_address_ = addr;
757 }
catch (
const exception& ex) {
758 errmsg <<
"bad 'remote' entry: " << ex.what();
761 }
else if (entry.first ==
"link") {
763 errmsg <<
"'link' entry must be a string";
767 IOAddress addr(entry.second->stringValue());
769 errmsg <<
"bad 'link' entry: not IPv6";
772 selector.first_relay_linkaddr_ = addr;
774 }
catch (
const exception& ex) {
775 errmsg <<
"bad 'link' entry: " << ex.what();
778 }
else if (entry.first ==
"classes") {
781 "'classes' entry must be a list"));
783 for (
auto const& item : entry.second->listValue()) {
785 errmsg <<
"'classes' entry must be a list of strings";
789 if (!item->stringValue().empty()) {
790 selector.client_classes_.insert(item->stringValue());
795 errmsg <<
"unknown entry '" << entry.first <<
"'";
800 getCfgSubnets6()->selectSubnet(selector);
805 subnet->getSharedNetwork(network);
808 msg <<
"selected shared network '" << network->getName()
809 <<
"' starting with subnet '" << subnet->toText()
810 <<
"' id " << subnet->getID();
812 msg <<
"selected subnet '" << subnet->toText()
813 <<
"' id " << subnet->getID();
819ControlledDhcpv6Srv::commandServerTagGetHandler(
const std::string&,
821 const std::string& tag =
830ControlledDhcpv6Srv::commandConfigBackendPullHandler(
const std::string&,
852 server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
853 }
catch (
const std::exception& ex) {
857 "On demand configuration update failed: " +
861 "On demand configuration update successful."));
865ControlledDhcpv6Srv::commandStatusGetHandler(
const string&,
870 auto now = boost::posix_time::second_clock::universal_time();
872 if (!
start_.is_not_a_date_time()) {
873 auto uptime = now -
start_;
878 if (!last_commit.is_not_a_date_time()) {
879 auto reload = now - last_commit;
884 if (mt_mgr.getMode()) {
891 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(10)));
892 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(100)));
893 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(1000)));
894 status->set(
"packet-queue-statistics", queue_stats);
901 CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->getExtendedInfoTablesEnabled()));
906 for (std::string
const&
error : interface->getErrors()) {
913 if (socket_errors->empty()) {
918 if (reconnect_ctl && reconnect_ctl->retriesLeft()) {
923 sockets->set(
"errors", socket_errors);
925 status->set(
"sockets", sockets);
933ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler(
const string&,
936 ConstElementPtr answer = stats_mgr.statisticSetMaxSampleCountAllHandler(args);
938 long max_samples = stats_mgr.getMaxSampleCountDefault();
945ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler(
const string&,
948 ConstElementPtr answer = stats_mgr.statisticSetMaxSampleAgeAllHandler(args);
950 auto duration = stats_mgr.getMaxSampleAgeDefault();
966 std::ostringstream err;
969 err <<
"Server object not initialized, can't process config.";
974 .arg(srv->redactConfig(config)->str());
992 }
catch (
const std::exception& ex) {
993 err <<
"Failed to process configuration:" << ex.what();
1000 std::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, ph::_1);
1003 std::bind(&ControlledDhcpv6Srv::dbRecoveredCallback, srv, ph::_1);
1006 std::bind(&ControlledDhcpv6Srv::dbFailedCallback, srv, ph::_1);
1009 string params =
"universe=6";
1010 if (cfg_db->getExtendedInfoTablesEnabled()) {
1011 params +=
" extended-info-tables=true";
1013 cfg_db->setAppendedParameters(params);
1014 cfg_db->createManagers();
1016 srv->getNetworkState()->resetForDbConnection();
1017 srv->getNetworkState()->resetForLocalCommands();
1018 srv->getNetworkState()->resetForRemoteCommands();
1019 }
catch (
const std::exception& ex) {
1020 err <<
"Unable to open database: " << ex.what();
1026 const std::string duid_file =
1028 std::string(SERVER_DUID_FILE);
1033 .arg(duid->toText())
1037 }
catch (
const std::exception& ex) {
1038 err <<
"unable to configure server identifier: " << ex.what();
1045 }
catch (
const std::exception& ex) {
1046 err <<
"Error starting DHCP_DDNS client after server reconfiguration: "
1054 }
catch (
const std::exception& ex) {
1055 err <<
"error starting DHCPv4-over-DHCPv6 IPC "
1056 " after server reconfiguration: " << ex.what();
1069 }
catch (
const std::exception& ex) {
1070 err <<
"Error setting packet queue controls after server reconfiguration: "
1078 std::bind(&ControlledDhcpv6Srv::openSocketsFailedCallback, srv, ph::_1);
1088 openSockets(AF_INET6, srv->getServerPort());
1093 setupTimers(&ControlledDhcpv6Srv::reclaimExpiredLeases,
1094 &ControlledDhcpv6Srv::deleteExpiredReclaimedLeases,
1097 }
catch (
const std::exception& ex) {
1098 err <<
"unable to setup timers for periodically running the"
1099 " reclamation of the expired leases: "
1100 << ex.what() <<
".";
1105 auto ctl_info =
CfgMgr::instance().getStagingCfg()->getConfigControlInfo();
1107 long fetch_time =
static_cast<long>(ctl_info->getConfigFetchWaitTime());
1110 if (fetch_time > 0) {
1116 if (!server_->inTestMode()) {
1117 fetch_time = 1000 * fetch_time;
1120 boost::shared_ptr<unsigned> failure_count(
new unsigned(0));
1122 registerTimer(
"Dhcp6CBFetchTimer",
1123 std::bind(&ControlledDhcpv6Srv::cbFetchUpdates,
1137 if (notify_libraries) {
1138 return (notify_libraries);
1145 CfgMgr::instance().getStagingCfg()->getCfgSubnets6()->initAllocatorsAfterConfigure();
1147 }
catch (
const std::exception& ex) {
1148 err <<
"Error initializing the lease allocators: "
1159 }
catch (
const std::exception& ex) {
1160 err <<
"Error applying multi threading settings: "
1179 callout_handle->setArgument(
"io_context", srv->getIOService());
1180 callout_handle->setArgument(
"network_state", srv->getNetworkState());
1181 callout_handle->setArgument(
"json_config", config);
1182 callout_handle->setArgument(
"server_config",
CfgMgr::instance().getStagingCfg());
1191 callout_handle->getArgument(
"error",
error);
1193 error =
"unknown error";
1208 "Server object not initialized, can't process config.");
1213 .arg(srv->redactConfig(config)->str());
1219 uint16_t client_port )
1223 "There is another Dhcpv6Srv instance already.");
1249 std::bind(&ControlledDhcpv6Srv::commandBuildReportHandler,
this, ph::_1, ph::_2));
1252 std::bind(&ControlledDhcpv6Srv::commandConfigBackendPullHandler,
this, ph::_1, ph::_2));
1255 std::bind(&ControlledDhcpv6Srv::commandConfigGetHandler,
this, ph::_1, ph::_2));
1258 std::bind(&ControlledDhcpv6Srv::commandConfigHashGetHandler,
this, ph::_1, ph::_2));
1261 std::bind(&ControlledDhcpv6Srv::commandConfigReloadHandler,
this, ph::_1, ph::_2));
1264 std::bind(&ControlledDhcpv6Srv::commandConfigSetHandler,
this, ph::_1, ph::_2));
1267 std::bind(&ControlledDhcpv6Srv::commandConfigTestHandler,
this, ph::_1, ph::_2));
1270 std::bind(&ControlledDhcpv6Srv::commandConfigWriteHandler,
this, ph::_1, ph::_2));
1273 std::bind(&ControlledDhcpv6Srv::commandDhcpEnableHandler,
this, ph::_1, ph::_2));
1276 std::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler,
this, ph::_1, ph::_2));
1279 std::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler,
this, ph::_1, ph::_2));
1282 std::bind(&ControlledDhcpv6Srv::commandSubnet6SelectTestHandler,
this, ph::_1, ph::_2));
1285 std::bind(&ControlledDhcpv6Srv::commandServerTagGetHandler,
this, ph::_1, ph::_2));
1288 std::bind(&ControlledDhcpv6Srv::commandShutdownHandler,
this, ph::_1, ph::_2));
1291 std::bind(&ControlledDhcpv6Srv::commandStatusGetHandler,
this, ph::_1, ph::_2));
1294 std::bind(&ControlledDhcpv6Srv::commandVersionGetHandler,
this, ph::_1, ph::_2));
1319 std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler,
this, ph::_1, ph::_2));
1325 std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler,
this, ph::_1, ph::_2));
1346 timer_mgr_->unregisterTimers();
1394ControlledDhcpv6Srv::reclaimExpiredLeases(
const size_t max_leases,
1395 const uint16_t timeout,
1396 const bool remove_lease,
1397 const uint16_t max_unwarned_cycles) {
1399 server_->alloc_engine_->reclaimExpiredLeases6(max_leases, timeout,
1401 max_unwarned_cycles);
1402 }
catch (
const std::exception& ex) {
1411ControlledDhcpv6Srv::deleteExpiredReclaimedLeases(
const uint32_t secs) {
1412 server_->alloc_engine_->deleteExpiredReclaimedLeases6(secs);
1418ControlledDhcpv6Srv::dbLostCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1419 if (!db_reconnect_ctl) {
1426 if (db_reconnect_ctl->retriesLeft() == db_reconnect_ctl->maxRetries() &&
1427 db_reconnect_ctl->alterServiceState()) {
1435 if (!db_reconnect_ctl->retriesLeft() ||
1436 !db_reconnect_ctl->retryInterval()) {
1438 .arg(db_reconnect_ctl->retriesLeft())
1439 .arg(db_reconnect_ctl->retryInterval());
1440 if (db_reconnect_ctl->exitOnFailure()) {
1450ControlledDhcpv6Srv::dbRecoveredCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1451 if (!db_reconnect_ctl) {
1458 if (db_reconnect_ctl->alterServiceState()) {
1464 db_reconnect_ctl->resetRetries();
1470ControlledDhcpv6Srv::dbFailedCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1471 if (!db_reconnect_ctl) {
1478 .arg(db_reconnect_ctl->maxRetries());
1480 if (db_reconnect_ctl->exitOnFailure()) {
1488ControlledDhcpv6Srv::openSocketsFailedCallback(
ReconnectCtlPtr reconnect_ctl) {
1489 if (!reconnect_ctl) {
1496 .arg(reconnect_ctl->maxRetries());
1498 if (reconnect_ctl->exitOnFailure()) {
1504ControlledDhcpv6Srv::cbFetchUpdates(
const SrvConfigPtr& srv_cfg,
1505 boost::shared_ptr<unsigned> failure_count) {
1511 server_->getCBControl()->databaseConfigFetch(srv_cfg,
1513 (*failure_count) = 0;
1515 }
catch (
const std::exception& ex) {
1522 if (++(*failure_count) > 10) {
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.
A generic exception that is thrown if a function is called in a prohibited way.
The IOAddress class represents an IP addresses (version agnostic)
static const IOAddress & IPV6_ZERO_ADDRESS()
Returns an IPv6 zero address.
static IOServiceMgr & instance()
Access the IOServiceMgr singleton instance.
Implements an asynchronous "signal" for IOService driven processing.
static void setIOService(isc::asiolink::IOServicePtr io_service)
Set the I/O service.
static std::string getHash(const isc::data::ConstElementPtr &config)
returns a hash of a given Element structure
static CommandMgr & instance()
CommandMgr is a singleton class.
static std::string DEFAULT_AUTHENTICATION_REALM
Default HTTP authentication realm.
static isc::asiolink::IOAddress DEFAULT_SOCKET_ADDRESS
Default socket address (127.0.0.1).
static HttpCommandMgr & instance()
HttpCommandMgr is a singleton class.
static UnixCommandMgr & instance()
UnixCommandMgr is a singleton class.
static ElementPtr create(const Position &pos=ZERO_POSITION())
static ElementPtr createMap(const Position &pos=ZERO_POSITION())
Creates an empty MapElement type ElementPtr.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
static void setIOService(const isc::asiolink::IOServicePtr &io_service)
Sets IO service to be used by the database backends.
static DbCallback db_recovered_callback_
Optional callback function to invoke if an opened connection recovery succeeded.
static DbCallback db_failed_callback_
Optional callback function to invoke if an opened connection recovery failed.
static DbCallback db_lost_callback_
Optional callback function to invoke if an opened connection is lost.
RAII class to enable DB reconnect retries on server startup.
static const std::string FLUSH_RECLAIMED_TIMER_NAME
Name of the timer for flushing reclaimed leases.
static const std::string RECLAIM_EXPIRED_TIMER_NAME
Name of the timer for reclaiming expired leases.
static OpenSocketsFailedCallback open_sockets_failed_callback_
Optional callback function to invoke if all retries of the opening sockets fail.
static CfgMgr & instance()
returns a single instance of Configuration Manager
static void apply(data::ConstElementPtr value)
apply multi threading configuration
Controlled version of the DHCPv6 server.
void init(const std::string &config_file)
Initializes the server.
void cleanup()
Performs cleanup, immediately before termination.
static isc::data::ConstElementPtr finishConfigHookLibraries(isc::data::ConstElementPtr config)
Configuration checker for hook libraries.
virtual ~ControlledDhcpv6Srv()
Destructor.
static isc::data::ConstElementPtr processConfig(isc::data::ConstElementPtr config)
Configuration processor.
virtual void shutdownServer(int exit_value)
Initiates shutdown procedure for the whole DHCPv6 server.
static ControlledDhcpv6Srv * getInstance()
Returns pointer to the sole instance of Dhcpv6Srv.
isc::data::ConstElementPtr loadConfigFile(const std::string &file_name)
Configure DHCPv6 server using the configuration file specified.
static isc::data::ConstElementPtr checkConfig(isc::data::ConstElementPtr config)
Configuration checker.
ControlledDhcpv6Srv(uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
Constructor.
static Dhcp6to4Ipc & instance()
Returns pointer to the sole instance of Dhcp6to4Ipc.
void shutdown() override
Instructs the server to shut down.
NetworkStatePtr network_state_
Holds information about disabled DHCP service and/or disabled subnet/network scopes.
static std::string getVersion(bool extended)
returns Kea version on stdout and exit.
asiolink::IOServicePtr & getIOService()
Returns pointer to the IO service used by the server.
static void create()
Creates new instance of the HostMgr.
Handles network interfaces, transmission and reception.
static IfaceMgr & instance()
IfaceMgr is a singleton class.
static void destroy()
Destroy lease manager.
static void commitRuntimeOptionDefs()
Commits runtime option definitions.
static const unsigned int DB_CONNECTION
The network state is being altered by the DB connection recovery mechanics.
static const unsigned int USER_COMMAND
Origin of the network state transition.
static const unsigned int HA_REMOTE_COMMAND
The network state is being altered by a "dhcp-disable" or "dhcp-enable" command sent by a HA partner.
Evaluation context, an interface to the expression evaluation.
isc::data::ElementPtr parseFile(const std::string &filename, ParserType parser_type)
Run the parser on the file specified.
@ PARSER_DHCP6
This parser will parse the content as Dhcp6 config wrapped in a map (that's the regular config file)
Manages a pool of asynchronous interval timers.
static const TimerMgrPtr & instance()
Returns pointer to the sole instance of the TimerMgr.
@ NEXT_STEP_DROP
drop the packet
static int registerHook(const std::string &name)
Register Hook.
static bool calloutsPresent(int index)
Are callouts present?
static boost::shared_ptr< CalloutHandle > createCalloutHandle()
Return callout handle.
static void callCallouts(int index, CalloutHandle &handle)
Calls the callouts for a given hook.
std::string getConfigFile() const
Returns config file name.
virtual size_t writeConfigFile(const std::string &config_file, isc::data::ConstElementPtr cfg=isc::data::ConstElementPtr()) const
Writes current configuration to specified file.
isc::asiolink::IOSignalSetPtr signal_set_
A pointer to the object installing custom signal handlers.
boost::posix_time::ptime start_
Timestamp of the start of the daemon.
void setExitValue(int value)
Sets the exit value.
Statistics Manager class.
static StatsMgr & instance()
Statistics Manager accessor method.
RAII class creating a critical section.
static MultiThreadingMgr & instance()
Returns a single instance of Multi Threading Manager.
This file contains several functions and constants that are used for handling commands and responses ...
Defines the Dhcp6to4Ipc class.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
static isc::data::ConstElementPtr statisticResetHandler(const std::string &name, const isc::data::ConstElementPtr ¶ms)
Handles statistic-reset command.
static isc::data::ConstElementPtr statisticGetAllHandler(const std::string &name, const isc::data::ConstElementPtr ¶ms)
Handles statistic-get-all command.
static isc::data::ConstElementPtr statisticRemoveHandler(const std::string &name, const isc::data::ConstElementPtr ¶ms)
Handles statistic-remove command.
static isc::data::ConstElementPtr statisticGetHandler(const std::string &name, const isc::data::ConstElementPtr ¶ms)
Handles statistic-get command.
static isc::data::ConstElementPtr statisticResetAllHandler(const std::string &name, const isc::data::ConstElementPtr ¶ms)
Handles statistic-reset-all command.
static isc::data::ConstElementPtr statisticSetMaxSampleAgeHandler(const std::string &name, const isc::data::ConstElementPtr ¶ms)
Handles statistic-sample-age-set command.
static isc::data::ConstElementPtr statisticRemoveAllHandler(const std::string &name, const isc::data::ConstElementPtr ¶ms)
Handles statistic-remove-all command.
static isc::data::ConstElementPtr statisticSetMaxSampleCountHandler(const std::string &name, const isc::data::ConstElementPtr ¶ms)
Handles statistic-sample-count-set command.
#define LOG_ERROR(LOGGER, MESSAGE)
Macro to conveniently test error output and log it.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
#define LOG_FATAL(LOGGER, MESSAGE)
Macro to conveniently test fatal output and log it.
#define LOG_DEBUG(LOGGER, LEVEL, MESSAGE)
Macro to conveniently test debug output and log it.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
const int CONTROL_RESULT_EMPTY
Status code indicating that the specified command was completed correctly, but failed to produce any ...
ConstElementPtr createCommand(const std::string &command)
Creates a standard command message with no argument (of the form { "command": "my_command" })
const int CONTROL_RESULT_ERROR
Status code indicating a general failure.
ConstElementPtr createAnswer()
Creates a standard config/command level success answer message (i.e.
ConstElementPtr parseAnswer(int &rcode, const ConstElementPtr &msg)
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< Element > ElementPtr
std::string getConfigReport()
const isc::log::MessageID DHCP6_DB_RECONNECT_NO_DB_CTL
const isc::log::MessageID DHCP6_OPEN_SOCKETS_NO_RECONNECT_CTL
const isc::log::MessageID DHCP6_USING_SERVERID
const isc::log::MessageID DHCP6_CONFIG_LOAD_FAIL
boost::shared_ptr< const Subnet6 > ConstSubnet6Ptr
A const pointer to a Subnet6 object.
const isc::log::MessageID DHCP6_DB_RECONNECT_SUCCEEDED
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< CfgDbAccess > CfgDbAccessPtr
A pointer to the CfgDbAccess.
boost::shared_ptr< Iface > IfacePtr
Type definition for the pointer to an Iface object.
boost::shared_ptr< DUID > DuidPtr
const int DBG_DHCP6_COMMAND
Debug level used to log receiving commands.
const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_FAIL
const isc::log::MessageID DHCP6_RECLAIM_EXPIRED_LEASES_FAIL
const isc::log::MessageID DHCP6_OPEN_SOCKETS_FAILED
boost::shared_ptr< SrvConfig > SrvConfigPtr
Non-const pointer to the SrvConfig.
const isc::log::MessageID DHCP6_DYNAMIC_RECONFIGURATION_SUCCESS
const isc::log::MessageID DHCP6_CB_ON_DEMAND_FETCH_UPDATES_FAIL
const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED
const isc::log::MessageID DHCP6_NOT_RUNNING
boost::shared_ptr< SharedNetwork6 > SharedNetwork6Ptr
Pointer to SharedNetwork6 object.
const isc::log::MessageID DHCP6_DYNAMIC_RECONFIGURATION_FAIL
const isc::log::MessageID DHCP6_CONFIG_UNSUPPORTED_OBJECT
const isc::log::MessageID DHCP6_CONFIG_UNRECOVERABLE_ERROR
const isc::log::MessageID DHCP6_CONFIG_RECEIVED
const isc::log::MessageID DHCP6_DB_RECONNECT_DISABLED
const isc::log::MessageID DHCP6_DYNAMIC_RECONFIGURATION
const isc::log::MessageID DHCP6_DB_RECONNECT_LOST_CONNECTION
isc::log::Logger dhcp6_logger(DHCP6_APP_LOGGER_NAME)
Base logger for DHCPv6 server.
const isc::log::MessageID DHCP6_MULTI_THREADING_INFO
const isc::log::MessageID DHCP6_DB_RECONNECT_FAILED
boost::shared_ptr< Option > OptionPtr
const isc::log::MessageID DHCP6_CONFIG_PACKET_QUEUE
boost::shared_ptr< CalloutHandle > CalloutHandlePtr
A shared pointer to a CalloutHandle object.
long toSeconds(const StatsDuration &dur)
Returns the number of seconds in a duration.
void decodeFormattedHexString(const string &hex_string, vector< uint8_t > &binary)
Converts a formatted string of hexadecimal digits into a vector.
vector< uint8_t > quotedStringToBinary(const string "ed_string)
Converts a string in quotes into vector.
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Defines the logger used by the top-level component of kea-lfc.
Subnet selector used to specify parameters used to select a subnet.
asiolink::IOAddress remote_address_
Source address of the message.