47namespace ph = std::placeholders;
52struct CtrlDhcp6Hooks {
53 int hooks_index_dhcp6_srv_configured_;
69static const char* SERVER_DUID_FILE =
"kea-dhcp6-serverid";
80void signalHandler(
int signo) {
82 if (signo == SIGHUP) {
85 }
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";
143 if (file_name.empty()) {
146 " Please use -c command line option.");
160 "a map, i.e., start with { and end with } and contain "
161 "at least an entry called 'Dhcp6' that itself is a map. "
163 <<
" is a valid JSON, but its top element is not a map."
164 " Did you forget to add { } around your configuration?");
174 "processCommand(\"config-set\", json)");
182 string reason = comment ? comment->stringValue() :
183 "no details available";
186 }
catch (
const std::exception& ex) {
192 .arg(file_name).arg(ex.what());
194 << file_name <<
"': " << ex.
what());
206ControlledDhcpv6Srv::commandShutdownHandler(
const string&,
ConstElementPtr args) {
223 "parameter 'exit-value' is not an integer"));
226 exit_value = param->intValue();
235ControlledDhcpv6Srv::commandLibReloadHandler(
const string&,
ConstElementPtr) {
250 bool multi_threading_enabled =
true;
251 uint32_t thread_count = 0;
252 uint32_t queue_size = 0;
254 multi_threading_enabled, thread_count, queue_size);
258 "(WARNING: libreload is deprecated).");
260 }
catch (
const std::exception& ex) {
266 "Hooks libraries successfully reloaded "
267 "(WARNING: libreload is deprecated).");
272ControlledDhcpv6Srv::commandConfigReloadHandler(
const string&,
281 }
catch (
const std::exception& ex) {
288 "Config reload failed: " +
string(ex.what())));
293ControlledDhcpv6Srv::commandConfigGetHandler(
const string&,
303ControlledDhcpv6Srv::commandConfigHashGetHandler(
const string&,
314ControlledDhcpv6Srv::commandConfigWriteHandler(
const string&,
323 if (filename_param) {
326 "passed parameter 'filename' is not a string"));
328 filename = filename_param->stringValue();
332 if (filename.empty()) {
338 if (filename.empty()) {
340 "Please specify filename explicitly."));
363 + filename +
" successful", params));
367ControlledDhcpv6Srv::commandConfigSetHandler(
const string&,
376 message =
"Missing mandatory 'arguments' parameter.";
378 dhcp6 = args->get(
"Dhcp6");
380 message =
"Missing mandatory 'Dhcp6' parameter.";
382 message =
"'Dhcp6' parameter expected to be a map.";
387 if (message.empty()) {
388 for (
auto const& obj : args->mapValue()) {
389 const string& obj_name = obj.first;
390 if (obj_name !=
"Dhcp6") {
393 if (message.empty()) {
394 message =
"Unsupported '" + obj_name +
"' parameter";
396 message +=
" (and '" + obj_name +
"')";
400 if (!message.empty()) {
405 if (!message.empty()) {
462 }
catch (
const std::exception& ex) {
463 std::ostringstream err;
464 err <<
"Error initializing hooks: "
473ControlledDhcpv6Srv::commandConfigTestHandler(
const string&,
482 message =
"Missing mandatory 'arguments' parameter.";
484 dhcp6 = args->get(
"Dhcp6");
486 message =
"Missing mandatory 'Dhcp6' parameter.";
488 message =
"'Dhcp6' parameter expected to be a map.";
493 if (message.empty()) {
494 for (
auto const& obj : args->mapValue()) {
495 const string& obj_name = obj.first;
496 if (obj_name !=
"Dhcp6") {
499 if (message.empty()) {
500 message =
"Unsupported '" + obj_name +
"' parameter";
502 message +=
" (and '" + obj_name +
"')";
506 if (!message.empty()) {
511 if (!message.empty()) {
531ControlledDhcpv6Srv::commandDhcpDisableHandler(
const std::string&,
533 std::ostringstream message;
534 int64_t max_period = 0;
546 message <<
"arguments for the 'dhcp-disable' command must be a map";
551 if (max_period_element) {
554 message <<
"'max-period' argument must be a number";
558 max_period = max_period_element->intValue();
559 if (max_period <= 0) {
560 message <<
"'max-period' must be positive integer";
566 if (origin_element) {
567 switch (origin_element->getType()) {
569 origin = origin_element->stringValue();
570 if (origin ==
"ha-partner") {
572 }
else if (origin !=
"user") {
573 if (origin.empty()) {
574 origin =
"(empty string)";
576 message <<
"invalid value used for 'origin' parameter: "
581 type = origin_element->intValue();
585 message <<
"'origin' argument must be a string or a number";
592 if (message.tellp() == 0) {
593 message <<
"DHCPv6 service disabled";
594 if (max_period > 0) {
595 message <<
" for " << max_period <<
" seconds";
600 network_state_->delayedEnableService(
static_cast<unsigned>(max_period),
614ControlledDhcpv6Srv::commandDhcpEnableHandler(
const std::string&,
616 std::ostringstream message;
627 message <<
"arguments for the 'dhcp-enable' command must be a map";
632 if (origin_element) {
633 switch (origin_element->getType()) {
635 origin = origin_element->stringValue();
636 if (origin ==
"ha-partner") {
638 }
else if (origin !=
"user") {
639 if (origin.empty()) {
640 origin =
"(empty string)";
642 message <<
"invalid value used for 'origin' parameter: "
647 type = origin_element->intValue();
651 message <<
"'origin' argument must be a string or a number";
658 if (message.tellp() == 0) {
663 "DHCP service successfully enabled"));
671ControlledDhcpv6Srv::commandVersionGetHandler(
const string&,
ConstElementPtr) {
674 arguments->set(
"extended", extended);
682ControlledDhcpv6Srv::commandBuildReportHandler(
const string&,
690ControlledDhcpv6Srv::commandLeasesReclaimHandler(
const string&,
697 message =
"Missing mandatory 'remove' parameter.";
701 message =
"Missing mandatory 'remove' parameter.";
703 message =
"'remove' parameter expected to be a boolean.";
705 bool remove_lease = remove_name->boolValue();
706 server_->
alloc_engine_->reclaimExpiredLeases6(0, 0, remove_lease);
708 message =
"Reclamation of expired leases is complete.";
716ControlledDhcpv6Srv::commandServerTagGetHandler(
const std::string&,
718 const std::string& tag =
727ControlledDhcpv6Srv::commandConfigBackendPullHandler(
const std::string&,
749 server_->
getCBControl()->databaseConfigFetch(srv_cfg, mode);
750 }
catch (
const std::exception& ex) {
754 "On demand configuration update failed: " +
758 "On demand configuration update successful."));
762ControlledDhcpv6Srv::commandStatusGetHandler(
const string&,
767 auto now = boost::posix_time::second_clock::universal_time();
769 if (!
start_.is_not_a_date_time()) {
770 auto uptime = now -
start_;
775 if (!last_commit.is_not_a_date_time()) {
776 auto reload = now - last_commit;
781 if (mt_mgr.getMode()) {
788 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(10)));
789 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(100)));
790 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(1000)));
791 status->set(
"packet-queue-statistics", queue_stats);
797 status->set(
"extended-info-tables",
803 for (std::string
const&
error : interface->getErrors()) {
810 if (socket_errors->empty()) {
815 if (reconnect_ctl && reconnect_ctl->retriesLeft()) {
820 sockets->set(
"errors", socket_errors);
822 status->set(
"sockets", sockets);
828ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler(
const string&,
840ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler(
const string&,
855 string txt = args ? args->str() :
"(none)";
858 .arg(command).arg(txt);
864 "Server object not initialized, so can't process command '" +
865 command +
"', arguments: '" + txt +
"'.");
870 if (command ==
"shutdown") {
871 return (srv->commandShutdownHandler(command, args));
873 }
else if (command ==
"libreload") {
874 return (srv->commandLibReloadHandler(command, args));
876 }
else if (command ==
"config-reload") {
877 return (srv->commandConfigReloadHandler(command, args));
879 }
else if (command ==
"config-set") {
880 return (srv->commandConfigSetHandler(command, args));
882 }
else if (command ==
"config-get") {
883 return (srv->commandConfigGetHandler(command, args));
885 }
else if (command ==
"config-hash-get") {
886 return (srv->commandConfigHashGetHandler(command, args));
888 }
else if (command ==
"config-test") {
889 return (srv->commandConfigTestHandler(command, args));
891 }
else if (command ==
"dhcp-disable") {
892 return (srv->commandDhcpDisableHandler(command, args));
894 }
else if (command ==
"dhcp-enable") {
895 return (srv->commandDhcpEnableHandler(command, args));
897 }
else if (command ==
"version-get") {
898 return (srv->commandVersionGetHandler(command, args));
900 }
else if (command ==
"build-report") {
901 return (srv->commandBuildReportHandler(command, args));
903 }
else if (command ==
"leases-reclaim") {
904 return (srv->commandLeasesReclaimHandler(command, args));
906 }
else if (command ==
"config-write") {
907 return (srv->commandConfigWriteHandler(command, args));
909 }
else if (command ==
"server-tag-get") {
910 return (srv->commandServerTagGetHandler(command, args));
912 }
else if (command ==
"config-backend-pull") {
913 return (srv->commandConfigBackendPullHandler(command, args));
915 }
else if (command ==
"status-get") {
916 return (srv->commandStatusGetHandler(command, args));
924 + command +
"': " + ex.
what() +
925 ", params: '" + txt +
"'"));
938 std::ostringstream err;
941 err <<
"Server object not initialized, can't process config.";
958 }
catch (
const std::exception& ex) {
959 err <<
"Failed to process configuration:" << ex.what();
966 std::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, ph::_1);
969 std::bind(&ControlledDhcpv6Srv::dbRecoveredCallback, srv, ph::_1);
972 std::bind(&ControlledDhcpv6Srv::dbFailedCallback, srv, ph::_1);
975 string params =
"universe=6";
976 if (cfg_db->getExtendedInfoTablesEnabled()) {
977 params +=
" extended-info-tables=true";
979 cfg_db->setAppendedParameters(params);
980 cfg_db->createManagers();
983 }
catch (
const std::exception& ex) {
984 err <<
"Unable to open database: " << ex.what();
990 const std::string duid_file =
992 std::string(SERVER_DUID_FILE);
1001 }
catch (
const std::exception& ex) {
1002 err <<
"unable to configure server identifier: " << ex.what();
1009 }
catch (
const std::exception& ex) {
1010 err <<
"Error starting DHCP_DDNS client after server reconfiguration: "
1018 }
catch (
const std::exception& ex) {
1019 err <<
"error starting DHCPv4-over-DHCPv6 IPC "
1020 " after server reconfiguration: " << ex.what();
1033 }
catch (
const std::exception& ex) {
1034 err <<
"Error setting packet queue controls after server reconfiguration: "
1042 std::bind(&ControlledDhcpv6Srv::openSocketsFailedCallback, srv, ph::_1);
1057 setupTimers(&ControlledDhcpv6Srv::reclaimExpiredLeases,
1058 &ControlledDhcpv6Srv::deleteExpiredReclaimedLeases,
1061 }
catch (
const std::exception& ex) {
1062 err <<
"unable to setup timers for periodically running the"
1063 " reclamation of the expired leases: "
1064 << ex.what() <<
".";
1071 long fetch_time =
static_cast<long>(ctl_info->getConfigFetchWaitTime());
1074 if (fetch_time > 0) {
1081 fetch_time = 1000 * fetch_time;
1084 boost::shared_ptr<unsigned> failure_count(
new unsigned(0));
1086 registerTimer(
"Dhcp6CBFetchTimer",
1087 std::bind(&ControlledDhcpv6Srv::cbFetchUpdates,
1101 if (notify_libraries) {
1102 return (notify_libraries);
1111 }
catch (
const std::exception& ex) {
1112 err <<
"Error initializing the lease allocators: "
1123 }
catch (
const std::exception& ex) {
1124 err <<
"Error applying multi threading settings: "
1143 callout_handle->setArgument(
"io_context", srv->
getIOService());
1145 callout_handle->setArgument(
"json_config", config);
1146 callout_handle->setArgument(
"server_config",
CfgMgr::instance().getStagingCfg());
1155 callout_handle->getArgument(
"error",
error);
1157 error =
"unknown error";
1172 "Server object not initialized, can't process config.");
1183 uint16_t client_port )
1187 "There is another Dhcpv6Srv instance already.");
1206 std::bind(&ControlledDhcpv6Srv::commandBuildReportHandler,
this, ph::_1, ph::_2));
1209 std::bind(&ControlledDhcpv6Srv::commandConfigBackendPullHandler,
this, ph::_1, ph::_2));
1212 std::bind(&ControlledDhcpv6Srv::commandConfigGetHandler,
this, ph::_1, ph::_2));
1215 std::bind(&ControlledDhcpv6Srv::commandConfigHashGetHandler,
this, ph::_1, ph::_2));
1218 std::bind(&ControlledDhcpv6Srv::commandConfigReloadHandler,
this, ph::_1, ph::_2));
1221 std::bind(&ControlledDhcpv6Srv::commandConfigSetHandler,
this, ph::_1, ph::_2));
1224 std::bind(&ControlledDhcpv6Srv::commandConfigTestHandler,
this, ph::_1, ph::_2));
1227 std::bind(&ControlledDhcpv6Srv::commandConfigWriteHandler,
this, ph::_1, ph::_2));
1230 std::bind(&ControlledDhcpv6Srv::commandDhcpEnableHandler,
this, ph::_1, ph::_2));
1233 std::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler,
this, ph::_1, ph::_2));
1236 std::bind(&ControlledDhcpv6Srv::commandLibReloadHandler,
this, ph::_1, ph::_2));
1239 std::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler,
this, ph::_1, ph::_2));
1242 std::bind(&ControlledDhcpv6Srv::commandServerTagGetHandler,
this, ph::_1, ph::_2));
1245 std::bind(&ControlledDhcpv6Srv::commandShutdownHandler,
this, ph::_1, ph::_2));
1248 std::bind(&ControlledDhcpv6Srv::commandStatusGetHandler,
this, ph::_1, ph::_2));
1251 std::bind(&ControlledDhcpv6Srv::commandVersionGetHandler,
this, ph::_1, ph::_2));
1276 std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler,
this, ph::_1, ph::_2));
1282 std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler,
this, ph::_1, ph::_2));
1303 timer_mgr_->unregisterTimers();
1350ControlledDhcpv6Srv::reclaimExpiredLeases(
const size_t max_leases,
1351 const uint16_t timeout,
1352 const bool remove_lease,
1353 const uint16_t max_unwarned_cycles) {
1355 server_->
alloc_engine_->reclaimExpiredLeases6(max_leases, timeout,
1357 max_unwarned_cycles);
1358 }
catch (
const std::exception& ex) {
1367ControlledDhcpv6Srv::deleteExpiredReclaimedLeases(
const uint32_t secs) {
1368 server_->
alloc_engine_->deleteExpiredReclaimedLeases6(secs);
1374ControlledDhcpv6Srv::dbLostCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1375 if (!db_reconnect_ctl) {
1382 if (db_reconnect_ctl->retriesLeft() == db_reconnect_ctl->maxRetries() &&
1383 db_reconnect_ctl->alterServiceState()) {
1391 if (!db_reconnect_ctl->retriesLeft() ||
1392 !db_reconnect_ctl->retryInterval()) {
1394 .arg(db_reconnect_ctl->retriesLeft())
1395 .arg(db_reconnect_ctl->retryInterval());
1396 if (db_reconnect_ctl->exitOnFailure()) {
1406ControlledDhcpv6Srv::dbRecoveredCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1407 if (!db_reconnect_ctl) {
1414 if (db_reconnect_ctl->alterServiceState()) {
1420 db_reconnect_ctl->resetRetries();
1426ControlledDhcpv6Srv::dbFailedCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1427 if (!db_reconnect_ctl) {
1434 .arg(db_reconnect_ctl->maxRetries());
1436 if (db_reconnect_ctl->exitOnFailure()) {
1444ControlledDhcpv6Srv::openSocketsFailedCallback(
ReconnectCtlPtr reconnect_ctl) {
1445 if (!reconnect_ctl) {
1452 .arg(reconnect_ctl->maxRetries());
1454 if (reconnect_ctl->exitOnFailure()) {
1460ControlledDhcpv6Srv::cbFetchUpdates(
const SrvConfigPtr& srv_cfg,
1461 boost::shared_ptr<unsigned> failure_count) {
1469 (*failure_count) = 0;
1471 }
catch (
const std::exception& ex) {
1478 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.
A generic exception that is thrown when an unexpected error condition occurs.
void clearIOServices()
Clear the list of IOService objects.
static IOServiceMgr & instance()
Access the IOServiceMgr singleton instance.
void pollIOServices()
Poll IOService objects.
Implements an asynchronous "signal" for IOService driven processing.
static void setIOService(isc::asiolink::IOServicePtr io_service)
Set the I/O service.
void registerCommand(const std::string &cmd, CommandHandler handler)
Registers specified command handler for a given command.
static std::string getHash(const isc::data::ConstElementPtr &config)
returns a hash of a given Element structure
void deregisterCommand(const std::string &cmd)
Deregisters specified command handler.
void closeCommandSocket()
Shuts down any open control sockets.
static CommandMgr & instance()
CommandMgr is a singleton class.
void setIOService(const asiolink::IOServicePtr &io_service)
Sets IO service to be used by the command manager.
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.
void rollback()
Removes staging configuration.
static CfgMgr & instance()
returns a single instance of Configuration Manager
SrvConfigPtr getStagingCfg()
Returns a pointer to the staging configuration.
void commit()
Commits the staging configuration.
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
static void apply(data::ConstElementPtr value)
apply multi threading configuration
static void extract(data::ConstElementPtr value, bool &enabled, uint32_t &thread_count, uint32_t &queue_size)
Extract multi-threading parameters from a given 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.
static isc::data::ConstElementPtr processCommand(const std::string &command, isc::data::ConstElementPtr args)
Command 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.
virtual void open()
Open communication socket.
static Dhcp6to4Ipc & instance()
Returns pointer to the sole instance of Dhcp6to4Ipc.
void shutdown() override
Instructs the server to shut down.
boost::shared_ptr< AllocEngine > alloc_engine_
Allocation Engine.
uint16_t getServerPort() const
Get UDP port on which server should listen.
OptionPtr serverid_
Server DUID (to be sent in server-identifier option)
NetworkStatePtr & getNetworkState()
Returns pointer to the network state used by the server.
NetworkStatePtr network_state_
Holds information about disabled DHCP service and/or disabled subnet/network scopes.
CBControlDHCPv6Ptr getCBControl() const
Returns an object which controls access to the configuration backends.
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.
bool inTestMode() const
Checks if the server is running in unit test mode.
void startD2()
Starts DHCP_DDNS client IO if DDNS updates are enabled.
static void create()
Creates new instance of the HostMgr.
static IfaceMgr & instance()
IfaceMgr is a singleton class.
static TrackingLeaseMgr & instance()
Return current lease manager.
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 bool unloadLibraries()
Unload libraries.
static bool loadLibraries(const HookLibsCollection &libraries, bool multi_threading_enabled=false)
Load and reload libraries.
static boost::shared_ptr< CalloutHandle > createCalloutHandle()
Return callout handle.
static void callCallouts(int index, CalloutHandle &handle)
Calls the callouts for a given hook.
static HookLibsCollection getLibraryInfo()
Return list of loaded libraries with its parameters.
static void prepareUnloadLibraries()
Prepare the unloading of libraries.
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.
isc::data::ConstElementPtr redactConfig(isc::data::ConstElementPtr const &config)
Redact a configuration.
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.
ThreadPool< std::function< void()> > & getThreadPool()
Get the dhcp thread pool.
void apply(bool enabled, uint32_t thread_count, uint32_t queue_size)
Apply the multi-threading related settings.
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.
isc::data::ConstElementPtr statisticSetMaxSampleCountAllHandler(const isc::data::ConstElementPtr ¶ms)
Handles statistic-sample-count-set-all command.
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.
isc::data::ConstElementPtr statisticSetMaxSampleAgeAllHandler(const isc::data::ConstElementPtr ¶ms)
Handles statistic-sample-age-set-all 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.
uint32_t getMaxSampleCountDefault() const
Get default count limit.
const StatsDuration & getMaxSampleAgeDefault() const
Get default duration limit.
#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 ...
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
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_COMMAND_RECEIVED
const isc::log::MessageID DHCP6_CB_PERIODIC_FETCH_UPDATES_RETRIES_EXHAUSTED
const isc::log::MessageID DHCP6_NOT_RUNNING
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_DEPRECATED
const isc::log::MessageID DHCP6_DB_RECONNECT_LOST_CONNECTION
const isc::log::MessageID DHCP6_HOOKS_LIBS_RELOAD_FAIL
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
const isc::log::MessageID DHCP6_CONFIG_PACKET_QUEUE
std::vector< HookLibInfo > HookLibsCollection
A storage for information about hook libraries.
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.
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Defines the logger used by the top-level component of kea-lfc.
void reset()
reset the thread pool stopping threads and clearing the internal queue