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) {
84 }
else if ((signo == SIGTERM) || (signo == SIGINT)) {
99 start_ = boost::posix_time::second_clock::universal_time();
107 string reason = comment ? comment->stringValue() :
108 "no details available";
137 if (file_name.empty()) {
140 " Please use -c command line option.");
154 "a map, i.e., start with { and end with } and contain "
155 "at least an entry called 'Dhcp6' that itself is a map. "
157 <<
" is a valid JSON, but its top element is not a map."
158 " Did you forget to add { } around your configuration?");
168 "process command \"config-set\"");
176 string reason = comment ? comment->stringValue() :
177 "no details available";
180 }
catch (
const std::exception& ex) {
186 .arg(file_name).arg(ex.what());
188 << file_name <<
"': " << ex.what());
200ControlledDhcpv6Srv::commandShutdownHandler(
const string&,
ConstElementPtr args) {
217 "parameter 'exit-value' is not an integer"));
220 exit_value = param->intValue();
229ControlledDhcpv6Srv::commandConfigReloadHandler(
const string&,
238 }
catch (
const std::exception& ex) {
245 "Config reload failed: " +
string(ex.what())));
250ControlledDhcpv6Srv::commandConfigGetHandler(
const string&,
260ControlledDhcpv6Srv::commandConfigHashGetHandler(
const string&,
272ControlledDhcpv6Srv::commandConfigWriteHandler(
const string&,
281 if (filename_param) {
284 "passed parameter 'filename' is not a string"));
286 filename = filename_param->stringValue();
290 if (filename.empty()) {
296 if (filename.empty()) {
298 "Please specify filename explicitly."));
306 }
catch (
const isc::Exception& ex) {
321 + filename +
" successful", params));
325ControlledDhcpv6Srv::commandConfigSetHandler(
const string&,
334 message =
"Missing mandatory 'arguments' parameter.";
336 dhcp6 = args->get(
"Dhcp6");
338 message =
"Missing mandatory 'Dhcp6' parameter.";
340 message =
"'Dhcp6' parameter expected to be a map.";
345 if (message.empty()) {
346 for (
auto const& obj : args->mapValue()) {
347 const string& obj_name = obj.first;
348 if (obj_name !=
"Dhcp6") {
351 if (message.empty()) {
352 message =
"Unsupported '" + obj_name +
"' parameter";
354 message +=
" (and '" + obj_name +
"')";
358 if (!message.empty()) {
363 if (!message.empty()) {
371 MultiThreadingCriticalSection cs;
420 }
catch (
const std::exception& ex) {
421 std::ostringstream err;
422 err <<
"Error initializing hooks: "
431ControlledDhcpv6Srv::commandConfigTestHandler(
const string&,
440 message =
"Missing mandatory 'arguments' parameter.";
442 dhcp6 = args->get(
"Dhcp6");
444 message =
"Missing mandatory 'Dhcp6' parameter.";
446 message =
"'Dhcp6' parameter expected to be a map.";
451 if (message.empty()) {
452 for (
auto const& obj : args->mapValue()) {
453 const string& obj_name = obj.first;
454 if (obj_name !=
"Dhcp6") {
457 if (message.empty()) {
458 message =
"Unsupported '" + obj_name +
"' parameter";
460 message +=
" (and '" + obj_name +
"')";
464 if (!message.empty()) {
469 if (!message.empty()) {
477 MultiThreadingCriticalSection cs;
489ControlledDhcpv6Srv::commandDhcpDisableHandler(
const std::string&,
491 std::ostringstream message;
492 int64_t max_period = 0;
504 message <<
"arguments for the 'dhcp-disable' command must be a map";
509 if (max_period_element) {
512 message <<
"'max-period' argument must be a number";
516 max_period = max_period_element->intValue();
517 if (max_period <= 0) {
518 message <<
"'max-period' must be positive integer";
531 if (origin_id_element) {
533 type = origin_id_element->intValue();
535 message <<
"'origin-id' argument must be a number";
537 }
else if (origin_element) {
538 switch (origin_element->getType()) {
540 origin = origin_element->stringValue();
541 if (origin ==
"ha-partner") {
543 }
else if (origin !=
"user") {
544 if (origin.empty()) {
545 origin =
"(empty string)";
547 message <<
"invalid value used for 'origin' parameter: "
552 type = origin_element->intValue();
556 message <<
"'origin' argument must be a string or a number";
563 if (message.tellp() == 0) {
564 message <<
"DHCPv6 service disabled";
565 if (max_period > 0) {
566 message <<
" for " << max_period <<
" seconds";
571 network_state_->delayedEnableService(
static_cast<unsigned>(max_period),
585ControlledDhcpv6Srv::commandDhcpEnableHandler(
const std::string&,
587 std::ostringstream message;
598 message <<
"arguments for the 'dhcp-enable' command must be a map";
610 if (origin_id_element) {
612 type = origin_id_element->intValue();
614 message <<
"'origin-id' argument must be a number";
616 }
else if (origin_element) {
617 switch (origin_element->getType()) {
619 origin = origin_element->stringValue();
620 if (origin ==
"ha-partner") {
622 }
else if (origin !=
"user") {
623 if (origin.empty()) {
624 origin =
"(empty string)";
626 message <<
"invalid value used for 'origin' parameter: "
631 type = origin_element->intValue();
635 message <<
"'origin' argument must be a string or a number";
642 if (message.tellp() == 0) {
647 "DHCP service successfully enabled"));
655ControlledDhcpv6Srv::commandVersionGetHandler(
const string&,
ConstElementPtr) {
658 arguments->set(
"extended", extended);
666ControlledDhcpv6Srv::commandBuildReportHandler(
const string&,
674ControlledDhcpv6Srv::commandLeasesReclaimHandler(
const string&,
681 message =
"Missing mandatory 'remove' parameter.";
685 message =
"Missing mandatory 'remove' parameter.";
687 message =
"'remove' parameter expected to be a boolean.";
689 bool remove_lease = remove_name->boolValue();
690 server_->alloc_engine_->reclaimExpiredLeases6(0, 0, remove_lease);
692 message =
"Reclamation of expired leases is complete.";
700ControlledDhcpv6Srv::commandServerTagGetHandler(
const std::string&,
702 const std::string& tag =
711ControlledDhcpv6Srv::commandConfigBackendPullHandler(
const std::string&,
719 MultiThreadingCriticalSection cs;
732 auto mode = CBControlDHCPv6::FetchMode::FETCH_UPDATE;
733 server_->getCBControl()->databaseConfigFetch(srv_cfg, mode);
734 }
catch (
const std::exception& ex) {
738 "On demand configuration update failed: " +
742 "On demand configuration update successful."));
746ControlledDhcpv6Srv::commandStatusGetHandler(
const string&,
751 auto now = boost::posix_time::second_clock::universal_time();
753 if (!
start_.is_not_a_date_time()) {
754 auto uptime = now -
start_;
759 if (!last_commit.is_not_a_date_time()) {
760 auto reload = now - last_commit;
765 if (mt_mgr.getMode()) {
772 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(10)));
773 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(100)));
774 queue_stats->add(
Element::create(mt_mgr.getThreadPool().getQueueStat(1000)));
775 status->set(
"packet-queue-statistics", queue_stats);
782 CfgMgr::instance().getCurrentCfg()->getCfgDbAccess()->getExtendedInfoTablesEnabled()));
787 for (std::string
const&
error : interface->getErrors()) {
794 if (socket_errors->empty()) {
799 if (reconnect_ctl && reconnect_ctl->retriesLeft()) {
804 sockets->set(
"errors", socket_errors);
806 status->set(
"sockets", sockets);
814ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler(
const string&,
826ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler(
const string&,
847 std::ostringstream err;
850 err <<
"Server object not initialized, can't process config.";
867 }
catch (
const std::exception& ex) {
868 err <<
"Failed to process configuration:" << ex.what();
875 std::bind(&ControlledDhcpv6Srv::dbLostCallback, srv, ph::_1);
878 std::bind(&ControlledDhcpv6Srv::dbRecoveredCallback, srv, ph::_1);
881 std::bind(&ControlledDhcpv6Srv::dbFailedCallback, srv, ph::_1);
884 string params =
"universe=6";
885 if (cfg_db->getExtendedInfoTablesEnabled()) {
886 params +=
" extended-info-tables=true";
888 cfg_db->setAppendedParameters(params);
889 cfg_db->createManagers();
894 }
catch (
const std::exception& ex) {
895 err <<
"Unable to open database: " << ex.what();
901 const std::string duid_file =
903 std::string(SERVER_DUID_FILE);
912 }
catch (
const std::exception& ex) {
913 err <<
"unable to configure server identifier: " << ex.what();
920 }
catch (
const std::exception& ex) {
921 err <<
"Error starting DHCP_DDNS client after server reconfiguration: "
929 }
catch (
const std::exception& ex) {
930 err <<
"error starting DHCPv4-over-DHCPv6 IPC "
931 " after server reconfiguration: " << ex.what();
944 }
catch (
const std::exception& ex) {
945 err <<
"Error setting packet queue controls after server reconfiguration: "
953 std::bind(&ControlledDhcpv6Srv::openSocketsFailedCallback, srv, ph::_1);
968 setupTimers(&ControlledDhcpv6Srv::reclaimExpiredLeases,
969 &ControlledDhcpv6Srv::deleteExpiredReclaimedLeases,
972 }
catch (
const std::exception& ex) {
973 err <<
"unable to setup timers for periodically running the"
974 " reclamation of the expired leases: "
982 long fetch_time =
static_cast<long>(ctl_info->getConfigFetchWaitTime());
985 if (fetch_time > 0) {
991 if (!server_->inTestMode()) {
992 fetch_time = 1000 * fetch_time;
995 boost::shared_ptr<unsigned> failure_count(
new unsigned(0));
997 registerTimer(
"Dhcp6CBFetchTimer",
998 std::bind(&ControlledDhcpv6Srv::cbFetchUpdates,
1012 if (notify_libraries) {
1013 return (notify_libraries);
1022 }
catch (
const std::exception& ex) {
1023 err <<
"Error initializing the lease allocators: "
1034 }
catch (
const std::exception& ex) {
1035 err <<
"Error applying multi threading settings: "
1054 callout_handle->setArgument(
"io_context", srv->
getIOService());
1056 callout_handle->setArgument(
"json_config",
config);
1057 callout_handle->setArgument(
"server_config",
CfgMgr::instance().getStagingCfg());
1066 callout_handle->getArgument(
"error",
error);
1068 error =
"unknown error";
1083 "Server object not initialized, can't process config.");
1094 uint16_t client_port )
1098 "There is another Dhcpv6Srv instance already.");
1117 std::bind(&ControlledDhcpv6Srv::commandBuildReportHandler,
this, ph::_1, ph::_2));
1120 std::bind(&ControlledDhcpv6Srv::commandConfigBackendPullHandler,
this, ph::_1, ph::_2));
1123 std::bind(&ControlledDhcpv6Srv::commandConfigGetHandler,
this, ph::_1, ph::_2));
1126 std::bind(&ControlledDhcpv6Srv::commandConfigHashGetHandler,
this, ph::_1, ph::_2));
1129 std::bind(&ControlledDhcpv6Srv::commandConfigReloadHandler,
this, ph::_1, ph::_2));
1132 std::bind(&ControlledDhcpv6Srv::commandConfigSetHandler,
this, ph::_1, ph::_2));
1135 std::bind(&ControlledDhcpv6Srv::commandConfigTestHandler,
this, ph::_1, ph::_2));
1138 std::bind(&ControlledDhcpv6Srv::commandConfigWriteHandler,
this, ph::_1, ph::_2));
1141 std::bind(&ControlledDhcpv6Srv::commandDhcpEnableHandler,
this, ph::_1, ph::_2));
1144 std::bind(&ControlledDhcpv6Srv::commandDhcpDisableHandler,
this, ph::_1, ph::_2));
1147 std::bind(&ControlledDhcpv6Srv::commandLeasesReclaimHandler,
this, ph::_1, ph::_2));
1150 std::bind(&ControlledDhcpv6Srv::commandServerTagGetHandler,
this, ph::_1, ph::_2));
1153 std::bind(&ControlledDhcpv6Srv::commandShutdownHandler,
this, ph::_1, ph::_2));
1156 std::bind(&ControlledDhcpv6Srv::commandStatusGetHandler,
this, ph::_1, ph::_2));
1159 std::bind(&ControlledDhcpv6Srv::commandVersionGetHandler,
this, ph::_1, ph::_2));
1184 std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleAgeAllHandler,
this, ph::_1, ph::_2));
1190 std::bind(&ControlledDhcpv6Srv::commandStatisticSetMaxSampleCountAllHandler,
this, ph::_1, ph::_2));
1211 timer_mgr_->unregisterTimers();
1257ControlledDhcpv6Srv::reclaimExpiredLeases(
const size_t max_leases,
1258 const uint16_t timeout,
1259 const bool remove_lease,
1260 const uint16_t max_unwarned_cycles) {
1262 server_->
alloc_engine_->reclaimExpiredLeases6(max_leases, timeout,
1264 max_unwarned_cycles);
1265 }
catch (
const std::exception& ex) {
1274ControlledDhcpv6Srv::deleteExpiredReclaimedLeases(
const uint32_t secs) {
1275 server_->alloc_engine_->deleteExpiredReclaimedLeases6(secs);
1281ControlledDhcpv6Srv::dbLostCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1282 if (!db_reconnect_ctl) {
1289 if (db_reconnect_ctl->retriesLeft() == db_reconnect_ctl->maxRetries() &&
1290 db_reconnect_ctl->alterServiceState()) {
1295 .arg(db_reconnect_ctl->id())
1296 .arg(db_reconnect_ctl->timerName());
1300 if (!db_reconnect_ctl->retriesLeft() ||
1301 !db_reconnect_ctl->retryInterval()) {
1303 .arg(db_reconnect_ctl->retriesLeft())
1304 .arg(db_reconnect_ctl->retryInterval())
1305 .arg(db_reconnect_ctl->id())
1306 .arg(db_reconnect_ctl->timerName());
1307 if (db_reconnect_ctl->exitOnFailure()) {
1317ControlledDhcpv6Srv::dbRecoveredCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1318 if (!db_reconnect_ctl) {
1325 if (db_reconnect_ctl->retriesLeft() != db_reconnect_ctl->maxRetries() &&
1326 db_reconnect_ctl->alterServiceState()) {
1331 .arg(db_reconnect_ctl->id())
1332 .arg(db_reconnect_ctl->timerName());
1334 db_reconnect_ctl->resetRetries();
1340ControlledDhcpv6Srv::dbFailedCallback(
ReconnectCtlPtr db_reconnect_ctl) {
1341 if (!db_reconnect_ctl) {
1348 .arg(db_reconnect_ctl->maxRetries())
1349 .arg(db_reconnect_ctl->id())
1350 .arg(db_reconnect_ctl->timerName());
1352 if (db_reconnect_ctl->exitOnFailure()) {
1360ControlledDhcpv6Srv::openSocketsFailedCallback(
ReconnectCtlPtr reconnect_ctl) {
1361 if (!reconnect_ctl) {
1368 .arg(reconnect_ctl->maxRetries());
1370 if (reconnect_ctl->exitOnFailure()) {
1376ControlledDhcpv6Srv::cbFetchUpdates(
const SrvConfigPtr& srv_cfg,
1377 boost::shared_ptr<unsigned> failure_count) {
1379 MultiThreadingCriticalSection cs;
1383 server_->getCBControl()->databaseConfigFetch(srv_cfg,
1384 CBControlDHCPv6::FetchMode::FETCH_UPDATE);
1385 (*failure_count) = 0;
1387 }
catch (
const std::exception& ex) {
1394 if (++(*failure_count) > 10) {
when the call the UDPServer carries on at the same position As a result
it forwards queries to a single upstream resolver and passes the answers back to the client It is constructed with the address of the forward server Queries are initiated with the question to ask the forward a buffer into which to write the answer
A generic exception that is thrown if a parameter given to a method is considered invalid in that con...
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.
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.
virtual isc::data::ConstElementPtr processCommand(const isc::data::ConstElementPtr &cmd)
Triggers command processing.
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.
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.
void clearStagingConfiguration()
Remove staging configuration.
SrvConfigPtr getCurrentCfg()
Returns a pointer to the current configuration.
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.
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.
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.
Dhcpv6Srv(uint16_t server_port=DHCP6_SERVER_PORT, uint16_t client_port=0)
Default constructor.
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.
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 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.
isc::data::ConstElementPtr redactConfig(isc::data::ConstElementPtr const &config)
Redact a configuration.
static StatsMgr & instance()
Statistics Manager accessor method.
static MultiThreadingMgr & instance()
Returns a single instance of Multi Threading Manager.
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 ...
ConstElementPtr parseAnswer(int &rcode, const ConstElementPtr &msg)
Parses a standard config/command level answer and returns arguments or text status code.
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(const int status_code, const std::string &text, const ConstElementPtr &arg)
Creates a standard config/command level answer message.
ConstElementPtr createAnswer()
Creates a standard config/command level success answer message (i.e.
const int CONTROL_RESULT_SUCCESS
Status code indicating a successful operation.
boost::shared_ptr< const Element > ConstElementPtr
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_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_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
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.
boost::shared_ptr< ReconnectCtl > ReconnectCtlPtr
Pointer to an instance of ReconnectCtl.
Defines the logger used by the top-level component of kea-lfc.