Kea 2.7.5
|
Classes | |
class | BadSocketInfo |
An exception indicating that specified socket parameters are invalid. More... | |
class | BaseCommandMgr |
Commands Manager, responsible for processing external commands. More... | |
class | ClientConnection |
Represents client side connection over the unix domain socket. More... | |
class | ClientConnectionImpl |
Implementation of the ClientConnection. More... | |
class | CmdHttpListener |
A multi-threaded HTTP listener that can process API commands requests. More... | |
class | CmdResponseCreator |
Concrete implementation of the HTTP response creator used for processing API commands. More... | |
class | CmdResponseCreatorFactory |
HTTP response creator factory for an API listener. More... | |
class | CmdsImpl |
Base class that command handler implementers may use for common tasks. More... | |
class | CommandMgr |
Commands Manager implementation for the Kea servers. More... | |
class | CtrlChannelError |
A standard control channel exception that is thrown if a function is there is a problem with one of the messages. More... | |
class | HookedCommandMgr |
Command Manager which can delegate commands to a hook library. More... | |
class | HttpCommandConfig |
HTTP command config aka HTTP control socket info class. More... | |
class | HttpCommandMgr |
HTTP Commands Manager implementation for the Kea servers. More... | |
class | HttpCommandMgrImpl |
Implementation of the HttpCommandMgr . More... | |
class | HttpCommandResponseCreator |
Concrete implementation of the HTTP response creator used for HTTP control socket. More... | |
class | HttpCommandResponseCreatorFactory |
HTTP response creator factory for HTTP control socket. More... | |
class | InvalidCommandHandler |
Exception indicating that the handler specified is not valid. More... | |
class | InvalidCommandName |
Exception indicating that the command name is not valid. More... | |
class | JSONFeed |
State model for asynchronous read of data in JSON format. More... | |
class | JSONFeedError |
A generic exception thrown upon an error in the JSONFeed. More... | |
class | SocketError |
An exception indicating a problem with socket operation. More... | |
class | UnixCommandMgr |
Unix Commands Manager implementation for the Kea servers. More... | |
class | UnixCommandMgrImpl |
Implementation of the UnixCommandMgr . More... | |
Typedefs | |
typedef boost::shared_ptr< ClientConnection > | ClientConnectionPtr |
Type of the pointer to the ClientConnection object. | |
typedef boost::shared_ptr< CmdHttpListener > | CmdHttpListenerPtr |
Defines a shared pointer to CmdHttpListener. | |
typedef boost::shared_ptr< CmdResponseCreator > | CmdResponseCreatorPtr |
Pointer to the CmdResponseCreator. | |
typedef boost::shared_ptr< const JSONFeed > | ConstJSONFeedPtr |
Pointer to the const JSONFeed. | |
typedef boost::shared_ptr< HttpCommandConfig > | HttpCommandConfigPtr |
Pointer to a HttpCommandConfig object. | |
typedef boost::shared_ptr< HttpCommandResponseCreator > | HttpCommandResponseCreatorPtr |
Pointer to the HttpCommandResponseCreator. | |
typedef boost::shared_ptr< JSONFeed > | JSONFeedPtr |
Pointer to the JSONFeed. | |
Functions | |
std::string | answerToText (const ConstElementPtr &msg) |
std::string | answerToText (const isc::data::ConstElementPtr &msg) |
Converts answer to printable text. | |
ConstElementPtr | combineCommandsLists (const ConstElementPtr &response1, const ConstElementPtr &response2) |
isc::data::ConstElementPtr | combineCommandsLists (const isc::data::ConstElementPtr &response1, const isc::data::ConstElementPtr &response2) |
Combines lists of commands carried in two responses. | |
ConstElementPtr | createAnswer () |
Creates a standard config/command level success answer message (i.e. | |
ConstElementPtr | createAnswer (const int status_code, const ConstElementPtr &arg) |
isc::data::ConstElementPtr | createAnswer (const int status_code, const isc::data::ConstElementPtr &arg) |
Creates a standard config/command level answer message (i.e. | |
isc::data::ConstElementPtr | createAnswer (const int status_code, const std::string &status, const isc::data::ConstElementPtr &arg) |
Creates a standard config/command level answer message. | |
ConstElementPtr | createAnswer (const int status_code, const std::string &status_text) |
Creates a standard config/command level answer message (i.e. | |
ConstElementPtr | createAnswer (const int status_code, const std::string &text, const ConstElementPtr &arg) |
ConstElementPtr | createCommand (const std::string &command) |
Creates a standard command message with no argument (of the form { "command": "my_command" }) | |
ConstElementPtr | createCommand (const std::string &command, const std::string &service) |
Creates a standard config/command command message with no argument and with the given service (of the form { "command": "my_command", "service": [ service ] }) | |
ConstElementPtr | createCommand (const std::string &command, ConstElementPtr arg) |
ConstElementPtr | createCommand (const std::string &command, ConstElementPtr arg, const std::string &service) |
isc::data::ConstElementPtr | createCommand (const std::string &command, isc::data::ConstElementPtr arg) |
Creates a standard command message with the given argument (of the form { "command": "my_command", "arguments": arg }. | |
isc::data::ConstElementPtr | createCommand (const std::string &command, isc::data::ConstElementPtr arg, const std::string &service) |
Creates a standard config/command command message with the given argument and given service (of the form { "command": "my_command", "arguments": arg, "service": [ service ] }. | |
ConstElementPtr | parseAnswer (int &rcode, const ConstElementPtr &msg) |
isc::data::ConstElementPtr | parseAnswer (int &status_code, const isc::data::ConstElementPtr &msg) |
Parses a standard config/command level answer and returns arguments or text status code. | |
ConstElementPtr | parseAnswerText (int &rcode, const ConstElementPtr &msg) |
isc::data::ConstElementPtr | parseAnswerText (int &rcode, const isc::data::ConstElementPtr &msg) |
Parses a standard config/command level answer and returns text status. | |
std::string | parseCommand (ConstElementPtr &arg, ConstElementPtr command) |
std::string | parseCommand (isc::data::ConstElementPtr &arg, isc::data::ConstElementPtr command) |
Parses the given command into a string containing the actual command and an ElementPtr containing the optional argument. | |
std::string | parseCommandWithArgs (ConstElementPtr &arg, ConstElementPtr command) |
std::string | parseCommandWithArgs (isc::data::ConstElementPtr &arg, isc::data::ConstElementPtr command) |
Parses the given command into a string containing the command name and an ElementPtr containing the mandatory argument. | |
Variables | |
const isc::log::MessageID | COMMAND_ACCEPTOR_START = "COMMAND_ACCEPTOR_START" |
const isc::log::MessageID | COMMAND_DEREGISTERED = "COMMAND_DEREGISTERED" |
const isc::log::MessageID | COMMAND_EXTENDED_REGISTERED = "COMMAND_EXTENDED_REGISTERED" |
const isc::log::MessageID | COMMAND_HTTP_LISTENER_COMMAND_REJECTED = "COMMAND_HTTP_LISTENER_COMMAND_REJECTED" |
const isc::log::MessageID | COMMAND_HTTP_LISTENER_STARTED = "COMMAND_HTTP_LISTENER_STARTED" |
const isc::log::MessageID | COMMAND_HTTP_LISTENER_STOPPED = "COMMAND_HTTP_LISTENER_STOPPED" |
const isc::log::MessageID | COMMAND_HTTP_LISTENER_STOPPING = "COMMAND_HTTP_LISTENER_STOPPING" |
isc::log::Logger | command_logger ("commands") |
Command processing Logger. | |
const isc::log::MessageID | COMMAND_PROCESS_ERROR1 = "COMMAND_PROCESS_ERROR1" |
const isc::log::MessageID | COMMAND_PROCESS_ERROR2 = "COMMAND_PROCESS_ERROR2" |
const isc::log::MessageID | COMMAND_RECEIVED = "COMMAND_RECEIVED" |
const isc::log::MessageID | COMMAND_REGISTERED = "COMMAND_REGISTERED" |
const isc::log::MessageID | COMMAND_RESPONSE_ERROR = "COMMAND_RESPONSE_ERROR" |
const isc::log::MessageID | COMMAND_SOCKET_ACCEPT_FAIL = "COMMAND_SOCKET_ACCEPT_FAIL" |
const isc::log::MessageID | COMMAND_SOCKET_CLOSED_BY_FOREIGN_HOST = "COMMAND_SOCKET_CLOSED_BY_FOREIGN_HOST" |
const isc::log::MessageID | COMMAND_SOCKET_CONNECTION_CANCEL_FAIL = "COMMAND_SOCKET_CONNECTION_CANCEL_FAIL" |
const isc::log::MessageID | COMMAND_SOCKET_CONNECTION_CLOSE_FAIL = "COMMAND_SOCKET_CONNECTION_CLOSE_FAIL" |
const isc::log::MessageID | COMMAND_SOCKET_CONNECTION_CLOSED = "COMMAND_SOCKET_CONNECTION_CLOSED" |
const isc::log::MessageID | COMMAND_SOCKET_CONNECTION_OPENED = "COMMAND_SOCKET_CONNECTION_OPENED" |
const isc::log::MessageID | COMMAND_SOCKET_CONNECTION_SHUTDOWN_FAIL = "COMMAND_SOCKET_CONNECTION_SHUTDOWN_FAIL" |
const isc::log::MessageID | COMMAND_SOCKET_CONNECTION_TIMEOUT = "COMMAND_SOCKET_CONNECTION_TIMEOUT" |
const isc::log::MessageID | COMMAND_SOCKET_READ = "COMMAND_SOCKET_READ" |
const isc::log::MessageID | COMMAND_SOCKET_READ_FAIL = "COMMAND_SOCKET_READ_FAIL" |
const isc::log::MessageID | COMMAND_SOCKET_WRITE = "COMMAND_SOCKET_WRITE" |
const isc::log::MessageID | COMMAND_SOCKET_WRITE_FAIL = "COMMAND_SOCKET_WRITE_FAIL" |
const isc::log::MessageID | COMMAND_WATCH_SOCKET_CLEAR_ERROR = "COMMAND_WATCH_SOCKET_CLEAR_ERROR" |
const isc::log::MessageID | COMMAND_WATCH_SOCKET_CLOSE_ERROR = "COMMAND_WATCH_SOCKET_CLOSE_ERROR" |
const isc::log::MessageID | COMMAND_WATCH_SOCKET_MARK_READY_ERROR = "COMMAND_WATCH_SOCKET_MARK_READY_ERROR" |
const char * | CONTROL_ARGUMENTS = "arguments" |
String used for arguments map ("arguments") | |
const char * | CONTROL_COMMAND = "command" |
String used for commands ("command") | |
const char * | CONTROL_REMOTE_ADDRESS = "remote-address" |
String used for remote address ("remote-address") | |
const char * | CONTROL_RESULT = "result" |
String used for result, i.e. integer status ("result") | |
const int | CONTROL_RESULT_COMMAND_UNSUPPORTED = 2 |
Status code indicating that the specified command is not supported. | |
const int | CONTROL_RESULT_CONFLICT = 4 |
Status code indicating that the command was unsuccessful due to a conflict between the command arguments and the server state. | |
const int | CONTROL_RESULT_EMPTY = 3 |
Status code indicating that the specified command was completed correctly, but failed to produce any results. | |
const int | CONTROL_RESULT_ERROR = 1 |
Status code indicating a general failure. | |
const int | CONTROL_RESULT_SUCCESS = 0 |
Status code indicating a successful operation. | |
const char * | CONTROL_SERVICE = "service" |
String used for service list ("service") | |
const char * | CONTROL_TEXT = "text" |
String used for storing textual description ("text") | |
const int | DBG_COMMAND = isc::log::DBGLVL_COMMAND |
const isc::log::MessageID | HTTP_COMMAND_MGR_IGNORED_TLS_SETUP_CHANGES = "HTTP_COMMAND_MGR_IGNORED_TLS_SETUP_CHANGES" |
const isc::log::MessageID | HTTP_COMMAND_MGR_SERVICE_STARTED = "HTTP_COMMAND_MGR_SERVICE_STARTED" |
const isc::log::MessageID | HTTP_COMMAND_MGR_SERVICE_STOPPING = "HTTP_COMMAND_MGR_SERVICE_STOPPING" |
constexpr long | TIMEOUT_AGENT_FORWARD_COMMAND = 60000 |
Timeout for the Control Agent to forward command to a Kea server, e.g. | |
constexpr long | TIMEOUT_AGENT_IDLE_CONNECTION_TIMEOUT = 30000 |
Timeout for the idle connection to be closed. | |
constexpr long | TIMEOUT_AGENT_RECEIVE_COMMAND = 10000 |
Timeout for the Control Agent to receive command over the RESTful interface. | |
constexpr long | TIMEOUT_DEFAULT_HTTP_CLIENT_REQUEST = 10000 |
Timeout for the HTTP clients awaiting a response to a request. | |
constexpr long | TIMEOUT_DHCP_SERVER_RECEIVE_COMMAND = 10000 |
Timeout for the DHCP server to receive command over the unix domain socket. | |
typedef boost::shared_ptr<ClientConnection> isc::config::ClientConnectionPtr |
Type of the pointer to the ClientConnection object.
Definition at line 154 of file client_connection.h.
typedef boost::shared_ptr<CmdHttpListener> isc::config::CmdHttpListenerPtr |
Defines a shared pointer to CmdHttpListener.
Definition at line 155 of file cmd_http_listener.h.
typedef boost::shared_ptr<CmdResponseCreator> isc::config::CmdResponseCreatorPtr |
Pointer to the CmdResponseCreator.
Definition at line 127 of file cmd_response_creator.h.
typedef boost::shared_ptr<const JSONFeed> isc::config::ConstJSONFeedPtr |
Pointer to the const JSONFeed.
Definition at line 27 of file json_feed.h.
typedef boost::shared_ptr<HttpCommandConfig> isc::config::HttpCommandConfigPtr |
Pointer to a HttpCommandConfig object.
Definition at line 214 of file http_command_config.h.
typedef boost::shared_ptr<HttpCommandResponseCreator> isc::config::HttpCommandResponseCreatorPtr |
Pointer to the HttpCommandResponseCreator.
Definition at line 98 of file http_command_response_creator.h.
typedef boost::shared_ptr<JSONFeed> isc::config::JSONFeedPtr |
Pointer to the JSONFeed.
Definition at line 24 of file json_feed.h.
std::string isc::config::answerToText | ( | const ConstElementPtr & | msg | ) |
Definition at line 130 of file command_interpreter.cc.
References CONTROL_RESULT, CONTROL_TEXT, and isc_throw.
Referenced by isc::netconf::NetconfAgent::change(), isc::netconf::NetconfAgent::done(), isc::netconf::NetconfAgent::keaConfig(), isc::process::DCfgMgrBase::simpleParseConfig(), and isc::netconf::NetconfAgent::yangConfig().
std::string isc::config::answerToText | ( | const isc::data::ConstElementPtr & | msg | ) |
Converts answer to printable text.
msg | answer to be parsed |
ConstElementPtr isc::config::combineCommandsLists | ( | const ConstElementPtr & | response1, |
const ConstElementPtr & | response2 ) |
Definition at line 267 of file command_interpreter.cc.
References CONTROL_RESULT_SUCCESS, createAnswer(), and parseAnswer().
Referenced by isc::config::HookedCommandMgr::handleCommand().
isc::data::ConstElementPtr isc::config::combineCommandsLists | ( | const isc::data::ConstElementPtr & | response1, |
const isc::data::ConstElementPtr & | response2 ) |
Combines lists of commands carried in two responses.
This method is used to combine list of commands returned by the two command managers.
If the same command appears in two responses only a single instance is returned in the combined response.
response1 | First command response. |
response2 | Second command response. |
isc::data::ConstElementPtr isc::config::createAnswer | ( | ) |
Creates a standard config/command level success answer message (i.e.
of the form { "result": 0 }
Definition at line 54 of file command_interpreter.cc.
References CONTROL_RESULT_SUCCESS, and createAnswer().
Referenced by isc::process::DControllerBase::buildReportHandler(), isc::dhcp::ControlledDhcpv4Srv::checkConfig(), isc::dhcp::ControlledDhcpv6Srv::checkConfig(), combineCommandsLists(), isc::process::DControllerBase::configFromFile(), isc::process::DControllerBase::configGetHandler(), isc::process::DControllerBase::configHashGetHandler(), isc::netconf::StdoutControlSocket::configSet(), isc::process::DControllerBase::configSetHandler(), isc::netconf::StdoutControlSocket::configTest(), isc::process::DControllerBase::configTestHandler(), isc::agent::CtrlAgentProcess::configure(), isc::d2::D2Process::configure(), isc::netconf::NetconfProcess::configure(), isc::dhcp::configureDhcp4Server(), isc::dhcp::configureDhcp6Server(), isc::process::DControllerBase::configWriteHandler(), isc::ha::HAImpl::continueHandler(), createAnswer(), createAnswer(), createAnswer(), isc::dhcp::ControlledDhcpv4Srv::finishConfigHookLibraries(), isc::dhcp::ControlledDhcpv6Srv::finishConfigHookLibraries(), isc::agent::CtrlAgentCommandMgr::handleCommand(), isc::config::BaseCommandMgr::handleCommand(), isc::config::HookedCommandMgr::handleCommand(), isc::ha::HAImpl::haResetHandler(), isc::ha::HAImpl::heartbeatHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6BulkApplyHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetAllHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByClientIdHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByDuidHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByHostnameHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByHwAddressHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetPageHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseWriteHandler(), isc::ha::HAImpl::maintenanceNotifyHandler(), isc::agent::CtrlAgentCfgMgr::parse(), isc::d2::D2CfgMgr::parse(), isc::netconf::NetconfCfgMgr::parse(), isc::perfmon::PerfMonMgr::perfmonControlHandler(), isc::perfmon::PerfMonMgr::perfmonGetAllDurationsHandler(), isc::config::BaseCommandMgr::processCommand(), isc::dhcp::ControlledDhcpv4Srv::processConfig(), isc::dhcp::ControlledDhcpv6Srv::processConfig(), isc::ha::HAService::processContinue(), isc::dhcp::processDhcp4Config(), isc::dhcp::processDhcp6Config(), isc::ha::HAService::processHAReset(), isc::ha::HAService::processHeartbeat(), isc::ha::HAService::processMaintenanceCancel(), isc::ha::HAService::processMaintenanceNotify(), isc::ha::HAService::processMaintenanceStart(), isc::ha::HAService::processScopes(), isc::ha::HAService::processSyncCompleteNotify(), isc::ha::HAService::processSynchronize(), isc::ha::HAImpl::scopesHandler(), isc::process::DControllerBase::serverTagGetHandler(), isc::config::CmdsImpl::setErrorResponse(), isc::config::CmdsImpl::setSuccessResponse(), isc::agent::CtrlAgentProcess::shutdown(), isc::d2::D2Process::shutdown(), isc::netconf::NetconfProcess::shutdown(), isc::process::DControllerBase::shutdownHandler(), isc::process::DControllerBase::shutdownProcess(), isc::process::DCfgMgrBase::simpleParseConfig(), isc::stats::StatsMgr::statisticGetAllHandler(), isc::stats::StatsMgr::statisticGetHandler(), isc::stats::StatsMgr::statisticRemoveAllHandler(), isc::stats::StatsMgr::statisticRemoveHandler(), isc::stats::StatsMgr::statisticResetAllHandler(), isc::stats::StatsMgr::statisticResetHandler(), isc::stats::StatsMgr::statisticSetMaxSampleAgeAllHandler(), isc::stats::StatsMgr::statisticSetMaxSampleAgeHandler(), isc::stats::StatsMgr::statisticSetMaxSampleCountAllHandler(), isc::stats::StatsMgr::statisticSetMaxSampleCountHandler(), isc::stat_cmds::LeaseStatCmdsImpl::statLease4GetHandler(), isc::stat_cmds::LeaseStatCmdsImpl::statLease6GetHandler(), isc::process::DControllerBase::statusGetHandler(), isc::ha::HAImpl::syncCompleteNotifyHandler(), isc::ha::HAImpl::synchronizeHandler(), and isc::process::DControllerBase::versionGetHandler().
ConstElementPtr isc::config::createAnswer | ( | const int | status_code, |
const ConstElementPtr & | arg ) |
Definition at line 64 of file command_interpreter.cc.
References createAnswer().
isc::data::ConstElementPtr isc::config::createAnswer | ( | const int | status_code, |
const isc::data::ConstElementPtr & | arg ) |
Creates a standard config/command level answer message (i.e.
of the form { "result": status_code, "arguments": arg }
status_code | The return code (0 for success) |
arg | The optional argument for the answer. This can be of any Element type. May be NULL. |
isc::data::ConstElementPtr isc::config::createAnswer | ( | const int | status_code, |
const std::string & | status, | ||
const isc::data::ConstElementPtr & | arg ) |
Creates a standard config/command level answer message.
status_code | The return code (0 for success) |
status | textual representation of the status (used mostly for errors) |
arg | The optional argument for the answer. This can be of any Element type. May be NULL. |
isc::data::ConstElementPtr isc::config::createAnswer | ( | const int | status_code, |
const std::string & | status_text ) |
Creates a standard config/command level answer message (i.e.
of the form { "result": 1, "text": "Invalid command received" }
status_code | The return code (0 for success) |
status_text | A string to put into the "text" argument |
Definition at line 59 of file command_interpreter.cc.
References createAnswer().
ConstElementPtr isc::config::createAnswer | ( | const int | status_code, |
const std::string & | text, | ||
const ConstElementPtr & | arg ) |
Definition at line 34 of file command_interpreter.cc.
References CONTROL_ARGUMENTS, CONTROL_RESULT, CONTROL_TEXT, and isc_throw.
isc::data::ConstElementPtr isc::config::createCommand | ( | const std::string & | command | ) |
Creates a standard command message with no argument (of the form { "command": "my_command" })
command | The command string |
Definition at line 168 of file command_interpreter.cc.
References createCommand().
Referenced by isc::netconf::HttpControlSocket::configGet(), isc::netconf::UnixControlSocket::configGet(), isc::netconf::HttpControlSocket::configSet(), isc::netconf::UnixControlSocket::configSet(), isc::netconf::HttpControlSocket::configTest(), isc::netconf::UnixControlSocket::configTest(), createCommand(), createCommand(), createCommand(), isc::ha::CommandCreator::createDHCPDisable(), isc::ha::CommandCreator::createDHCPEnable(), isc::ha::CommandCreator::createHAReset(), isc::ha::CommandCreator::createHeartbeat(), isc::ha::CommandCreator::createLease4Delete(), isc::ha::CommandCreator::createLease4GetAll(), isc::ha::CommandCreator::createLease4GetPage(), isc::ha::CommandCreator::createLease4Update(), isc::ha::CommandCreator::createLease6BulkApply(), isc::ha::CommandCreator::createLease6BulkApply(), isc::ha::CommandCreator::createLease6Delete(), isc::ha::CommandCreator::createLease6GetAll(), isc::ha::CommandCreator::createLease6GetPage(), isc::ha::CommandCreator::createLease6Update(), isc::ha::CommandCreator::createMaintenanceNotify(), isc::ha::CommandCreator::createSyncCompleteNotify(), isc::config::HookedCommandMgr::delegateCommandToHookLibrary(), isc::dhcp::ControlledDhcpv4Srv::loadConfigFile(), and isc::dhcp::ControlledDhcpv6Srv::loadConfigFile().
isc::data::ConstElementPtr isc::config::createCommand | ( | const std::string & | command, |
const std::string & | service ) |
Creates a standard config/command command message with no argument and with the given service (of the form { "command": "my_command", "service": [ service ] })
command | The command string |
service | The target service. May be empty. |
Definition at line 178 of file command_interpreter.cc.
References createCommand().
ConstElementPtr isc::config::createCommand | ( | const std::string & | command, |
ConstElementPtr | arg ) |
Definition at line 173 of file command_interpreter.cc.
References createCommand().
ConstElementPtr isc::config::createCommand | ( | const std::string & | command, |
ConstElementPtr | arg, | ||
const std::string & | service ) |
Definition at line 183 of file command_interpreter.cc.
References CONTROL_ARGUMENTS, CONTROL_COMMAND, and CONTROL_SERVICE.
isc::data::ConstElementPtr isc::config::createCommand | ( | const std::string & | command, |
isc::data::ConstElementPtr | arg ) |
Creates a standard command message with the given argument (of the form { "command": "my_command", "arguments": arg }.
command | The command string |
arg | The optional argument for the command. This can be of any Element type. May be NULL. |
isc::data::ConstElementPtr isc::config::createCommand | ( | const std::string & | command, |
isc::data::ConstElementPtr | arg, | ||
const std::string & | service ) |
Creates a standard config/command command message with the given argument and given service (of the form { "command": "my_command", "arguments": arg, "service": [ service ] }.
command | The command string |
arg | The optional argument for the command. This can be of any Element type. May be NULL. |
service | The target service. May be empty. |
ConstElementPtr isc::config::parseAnswer | ( | int & | rcode, |
const ConstElementPtr & | msg ) |
Definition at line 96 of file command_interpreter.cc.
References CONTROL_ARGUMENTS, CONTROL_RESULT, CONTROL_TEXT, and isc_throw.
Referenced by isc::netconf::NetconfAgent::change(), isc::process::DControllerBase::checkConfigOnly(), combineCommandsLists(), isc::process::DControllerBase::configSetHandler(), isc::agent::CtrlAgentProcess::configure(), isc::d2::D2Process::configure(), isc::netconf::NetconfProcess::configure(), isc::dhcp::configureDhcp4Server(), isc::dhcp::configureDhcp6Server(), isc::netconf::NetconfAgent::done(), isc::agent::CtrlAgentCommandMgr::handleCommand(), isc::dhcp::ControlledDhcpv4Srv::init(), isc::dhcp::ControlledDhcpv6Srv::init(), isc::netconf::NetconfAgent::keaConfig(), isc::process::DControllerBase::launch(), isc::dhcp::ControlledDhcpv4Srv::loadConfigFile(), isc::dhcp::ControlledDhcpv6Srv::loadConfigFile(), main(), isc::ha::HAImpl::maintenanceStartHandler(), isc::dhcp::ControlledDhcpv4Srv::processConfig(), isc::dhcp::ControlledDhcpv6Srv::processConfig(), isc::process::DControllerBase::processSignal(), isc::process::DCfgMgrBase::simpleParseConfig(), isc::ha::HAService::verifyAsyncResponse(), and isc::netconf::NetconfAgent::yangConfig().
isc::data::ConstElementPtr isc::config::parseAnswer | ( | int & | status_code, |
const isc::data::ConstElementPtr & | msg ) |
Parses a standard config/command level answer and returns arguments or text status code.
If you need to get the text status, please use parseAnswerText.
status_code | This value will be set to the return code contained in the message |
msg | The message to parse |
ConstElementPtr isc::config::parseAnswerText | ( | int & | rcode, |
const ConstElementPtr & | msg ) |
Definition at line 69 of file command_interpreter.cc.
References CONTROL_RESULT, CONTROL_TEXT, and isc_throw.
isc::data::ConstElementPtr isc::config::parseAnswerText | ( | int & | rcode, |
const isc::data::ConstElementPtr & | msg ) |
Parses a standard config/command level answer and returns text status.
This method returns the text status. If you need to get the arguments provided, please use parseAnswer.
rcode | This value will be set to the return code contained in the message |
msg | The message to parse |
std::string isc::config::parseCommand | ( | ConstElementPtr & | arg, |
ConstElementPtr | command ) |
Definition at line 201 of file command_interpreter.cc.
References CONTROL_ARGUMENTS, CONTROL_COMMAND, CONTROL_REMOTE_ADDRESS, CONTROL_SERVICE, and isc_throw.
Referenced by isc::ha::HAImpl::continueHandler(), isc::config::CmdsImpl::extractCommand(), isc::ha::HAImpl::haResetHandler(), isc::ha::HAImpl::heartbeatHandler(), parseCommandWithArgs(), isc::config::BaseCommandMgr::processCommand(), isc::ha::HAImpl::scopesHandler(), isc::ha::HAImpl::syncCompleteNotifyHandler(), and isc::ha::HAImpl::synchronizeHandler().
std::string isc::config::parseCommand | ( | isc::data::ConstElementPtr & | arg, |
isc::data::ConstElementPtr | command ) |
Parses the given command into a string containing the actual command and an ElementPtr containing the optional argument.
CtrlChannelError | if this is not a well-formed command |
arg | This value will be set to the ElementPtr pointing to the argument, or to an empty Map (ElementPtr) if there was none. |
command | The command message containing the command (as made by createCommand() |
std::string isc::config::parseCommandWithArgs | ( | ConstElementPtr & | arg, |
ConstElementPtr | command ) |
Definition at line 239 of file command_interpreter.cc.
References CONTROL_ARGUMENTS, isc_throw, and parseCommand().
Referenced by isc::ha::HAImpl::maintenanceNotifyHandler().
std::string isc::config::parseCommandWithArgs | ( | isc::data::ConstElementPtr & | arg, |
isc::data::ConstElementPtr | command ) |
Parses the given command into a string containing the command name and an ElementPtr containing the mandatory argument.
This function expects that command arguments are specified and are a map.
CtrlChannelError | if this is not a well-formed command, arguments are not specified or are not a map. |
arg | Reference to the data element to which command arguments will be assigned. |
command | The command message containing the command and the arguments. |
|
extern |
Definition at line 11 of file config_messages.h.
Referenced by isc::config::UnixCommandMgrImpl::openCommandSocket().
|
extern |
Definition at line 12 of file config_messages.h.
Referenced by isc::config::BaseCommandMgr::deregisterCommand().
|
extern |
Definition at line 13 of file config_messages.h.
Referenced by isc::config::BaseCommandMgr::registerExtendedCommand().
|
extern |
Definition at line 14 of file config_messages.h.
Referenced by isc::config::CmdResponseCreator::filterCommand().
|
extern |
Definition at line 15 of file config_messages.h.
Referenced by isc::config::CmdHttpListener::start().
|
extern |
Definition at line 16 of file config_messages.h.
Referenced by isc::config::CmdHttpListener::stop().
|
extern |
Definition at line 17 of file config_messages.h.
Referenced by isc::config::CmdHttpListener::stop().
isc::log::Logger isc::config::command_logger | ( | "commands" | ) |
Command processing Logger.
Define the logger used to log messages related to command processing. We could define it in multiple modules, but defining in a single module and linking to it saves time and space.
Definition at line 21 of file config_log.h.
Referenced by isc::config::HttpCommandMgrImpl::close(), isc::config::HttpCommandMgrImpl::configure(), isc::config::BaseCommandMgr::deregisterCommand(), isc::config::UnixCommandMgrImpl::doAccept(), isc::config::CmdResponseCreator::filterCommand(), isc::config::UnixCommandMgrImpl::openCommandSocket(), isc::config::BaseCommandMgr::processCommand(), isc::config::BaseCommandMgr::registerCommand(), isc::config::BaseCommandMgr::registerExtendedCommand(), isc::config::CmdHttpListener::start(), and isc::config::CmdHttpListener::stop().
|
extern |
Definition at line 18 of file config_messages.h.
|
extern |
Definition at line 19 of file config_messages.h.
Referenced by isc::config::BaseCommandMgr::processCommand().
|
extern |
Definition at line 20 of file config_messages.h.
Referenced by isc::config::BaseCommandMgr::processCommand().
|
extern |
Definition at line 21 of file config_messages.h.
Referenced by isc::config::BaseCommandMgr::registerCommand().
|
extern |
Definition at line 22 of file config_messages.h.
|
extern |
Definition at line 23 of file config_messages.h.
Referenced by isc::config::UnixCommandMgrImpl::doAccept().
|
extern |
Definition at line 24 of file config_messages.h.
|
extern |
Definition at line 25 of file config_messages.h.
|
extern |
Definition at line 27 of file config_messages.h.
|
extern |
Definition at line 26 of file config_messages.h.
|
extern |
Definition at line 28 of file config_messages.h.
|
extern |
Definition at line 29 of file config_messages.h.
|
extern |
Definition at line 30 of file config_messages.h.
|
extern |
Definition at line 31 of file config_messages.h.
|
extern |
Definition at line 32 of file config_messages.h.
|
extern |
Definition at line 33 of file config_messages.h.
|
extern |
Definition at line 34 of file config_messages.h.
|
extern |
Definition at line 35 of file config_messages.h.
|
extern |
Definition at line 36 of file config_messages.h.
|
extern |
Definition at line 37 of file config_messages.h.
const char * isc::config::CONTROL_ARGUMENTS = "arguments" |
String used for arguments map ("arguments")
Definition at line 28 of file command_interpreter.cc.
Referenced by createAnswer(), createCommand(), parseAnswer(), parseCommand(), and parseCommandWithArgs().
const char * isc::config::CONTROL_COMMAND = "command" |
String used for commands ("command")
Definition at line 25 of file command_interpreter.cc.
Referenced by createCommand(), isc::config::CmdResponseCreator::filterCommand(), and parseCommand().
const char * isc::config::CONTROL_REMOTE_ADDRESS = "remote-address" |
String used for remote address ("remote-address")
Definition at line 30 of file command_interpreter.cc.
Referenced by parseCommand().
const char * isc::config::CONTROL_RESULT = "result" |
String used for result, i.e. integer status ("result")
Definition at line 26 of file command_interpreter.cc.
Referenced by answerToText(), createAnswer(), isc::config::CmdResponseCreator::filterCommand(), parseAnswer(), parseAnswerText(), and isc::ha::HAService::verifyAsyncResponse().
const int isc::config::CONTROL_RESULT_COMMAND_UNSUPPORTED = 2 |
Status code indicating that the specified command is not supported.
Definition at line 48 of file command_interpreter.h.
Referenced by isc::ha::HAService::asyncSyncCompleteNotify(), isc::agent::CtrlAgentCommandMgr::handleCommand(), isc::config::BaseCommandMgr::handleCommand(), isc::ha::HAService::synchronize(), and isc::ha::HAService::verifyAsyncResponse().
const int isc::config::CONTROL_RESULT_CONFLICT = 4 |
Status code indicating that the command was unsuccessful due to a conflict between the command arguments and the server state.
For example, a lease4-add fails when the subnet identifier in the command does not match the subnet identifier in the server configuration.
Definition at line 59 of file command_interpreter.h.
Referenced by isc::lease_cmds::LeaseCmdsImpl::lease4ResendDdnsHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4UpdateHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6BulkApplyHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6ResendDdnsHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6UpdateHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseAddHandler(), and isc::ha::HAService::verifyAsyncResponse().
const int isc::config::CONTROL_RESULT_EMPTY = 3 |
Status code indicating that the specified command was completed correctly, but failed to produce any results.
For example, get completed the search, but couldn't find the object it was looking for.
Definition at line 53 of file command_interpreter.h.
Referenced by isc::lease_cmds::LeaseCmdsImpl::lease4DelHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4ResendDdnsHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6BulkApplyHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6DelHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6ResendDdnsHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetAllHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByClientIdHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByDuidHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByHostnameHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByHwAddressHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetPageHandler(), isc::perfmon::PerfMonMgr::perfmonGetAllDurationsHandler(), isc::stat_cmds::LeaseStatCmdsImpl::statLease4GetHandler(), isc::stat_cmds::LeaseStatCmdsImpl::statLease6GetHandler(), and isc::ha::HAService::verifyAsyncResponse().
const int isc::config::CONTROL_RESULT_ERROR = 1 |
Status code indicating a general failure.
Definition at line 45 of file command_interpreter.h.
Referenced by isc::dhcp::ControlledDhcpv4Srv::checkConfig(), isc::dhcp::ControlledDhcpv6Srv::checkConfig(), isc::process::DControllerBase::configFromFile(), isc::process::DControllerBase::configSetHandler(), isc::process::DControllerBase::configTestHandler(), isc::agent::CtrlAgentProcess::configure(), isc::d2::D2Process::configure(), isc::netconf::NetconfProcess::configure(), isc::dhcp::configureDhcp4Server(), isc::dhcp::configureDhcp6Server(), isc::process::DControllerBase::configWriteHandler(), isc::ha::HAImpl::continueHandler(), isc::dhcp::ControlledDhcpv4Srv::finishConfigHookLibraries(), isc::dhcp::ControlledDhcpv6Srv::finishConfigHookLibraries(), isc::agent::CtrlAgentCommandMgr::handleCommand(), isc::ha::HAImpl::haResetHandler(), isc::ha::HAImpl::heartbeatHandler(), isc::lease_cmds::LeaseCmdsImpl::lease4ResendDdnsHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6BulkApplyHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6ResendDdnsHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetAllHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByClientIdHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByDuidHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByHostnameHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByHwAddressHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetPageHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseWriteHandler(), load(), isc::ha::HAImpl::maintenanceNotifyHandler(), isc::agent::CtrlAgentCfgMgr::parse(), isc::d2::D2CfgMgr::parse(), isc::netconf::NetconfCfgMgr::parse(), isc::config::BaseCommandMgr::processCommand(), isc::dhcp::ControlledDhcpv4Srv::processConfig(), isc::dhcp::ControlledDhcpv6Srv::processConfig(), isc::dhcp::processDhcp4Config(), isc::dhcp::processDhcp6Config(), isc::ha::HAService::processMaintenanceCancel(), isc::ha::HAService::processMaintenanceNotify(), isc::ha::HAService::processMaintenanceStart(), isc::ha::HAService::processScopes(), isc::ha::HAService::processSynchronize(), isc::ha::HAImpl::scopesHandler(), isc::d2::D2Process::shutdown(), isc::process::DControllerBase::shutdownHandler(), isc::process::DCfgMgrBase::simpleParseConfig(), isc::stats::StatsMgr::statisticGetHandler(), isc::stats::StatsMgr::statisticRemoveHandler(), isc::stats::StatsMgr::statisticResetHandler(), isc::stats::StatsMgr::statisticSetMaxSampleAgeAllHandler(), isc::stats::StatsMgr::statisticSetMaxSampleAgeHandler(), isc::stats::StatsMgr::statisticSetMaxSampleCountAllHandler(), isc::stats::StatsMgr::statisticSetMaxSampleCountHandler(), isc::ha::HAImpl::syncCompleteNotifyHandler(), isc::ha::HAService::synchronize(), isc::ha::HAImpl::synchronizeHandler(), and isc::ha::HAService::verifyAsyncResponse().
const int isc::config::CONTROL_RESULT_SUCCESS = 0 |
Status code indicating a successful operation.
Definition at line 42 of file command_interpreter.h.
Referenced by isc::ha::HAService::asyncSendLeaseUpdatesFromBacklog(), isc::process::DControllerBase::buildReportHandler(), isc::netconf::NetconfAgent::change(), combineCommandsLists(), isc::process::DControllerBase::configGetHandler(), isc::process::DControllerBase::configHashGetHandler(), isc::dhcp::configureDhcp4Server(), isc::dhcp::configureDhcp6Server(), isc::process::DControllerBase::configWriteHandler(), createAnswer(), isc::netconf::NetconfAgent::done(), isc::config::HookedCommandMgr::handleCommand(), isc::dhcp::ControlledDhcpv4Srv::init(), isc::dhcp::ControlledDhcpv6Srv::init(), isc::netconf::NetconfAgent::keaConfig(), isc::lease_cmds::LeaseCmdsImpl::lease4WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6BulkApplyHandler(), isc::lease_cmds::LeaseCmdsImpl::lease6WipeHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetAllHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByClientIdHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByDuidHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByHostnameHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetByHwAddressHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseGetPageHandler(), isc::lease_cmds::LeaseCmdsImpl::leaseWriteHandler(), isc::dhcp::ControlledDhcpv4Srv::loadConfigFile(), isc::dhcp::ControlledDhcpv6Srv::loadConfigFile(), isc::ha::HAImpl::maintenanceStartHandler(), isc::agent::CtrlAgentCfgMgr::parse(), isc::d2::D2CfgMgr::parse(), isc::netconf::NetconfCfgMgr::parse(), isc::perfmon::PerfMonMgr::perfmonControlHandler(), isc::perfmon::PerfMonMgr::perfmonGetAllDurationsHandler(), isc::ha::HAService::processContinue(), isc::dhcp::processDhcp4Config(), isc::dhcp::processDhcp6Config(), isc::ha::HAService::processHAReset(), isc::ha::HAService::processHeartbeat(), isc::ha::HAService::processMaintenanceNotify(), isc::ha::HAService::processScopes(), isc::ha::HAService::processSyncCompleteNotify(), isc::process::DControllerBase::serverTagGetHandler(), isc::config::CmdsImpl::setSuccessResponse(), isc::agent::CtrlAgentProcess::shutdown(), isc::d2::D2Process::shutdown(), isc::netconf::NetconfProcess::shutdown(), isc::process::DControllerBase::shutdownProcess(), isc::stats::StatsMgr::statisticGetAllHandler(), isc::stats::StatsMgr::statisticGetHandler(), isc::stats::StatsMgr::statisticRemoveAllHandler(), isc::stats::StatsMgr::statisticRemoveHandler(), isc::stats::StatsMgr::statisticResetAllHandler(), isc::stats::StatsMgr::statisticResetHandler(), isc::stats::StatsMgr::statisticSetMaxSampleAgeAllHandler(), isc::stats::StatsMgr::statisticSetMaxSampleAgeHandler(), isc::stats::StatsMgr::statisticSetMaxSampleCountAllHandler(), isc::stats::StatsMgr::statisticSetMaxSampleCountHandler(), isc::stat_cmds::LeaseStatCmdsImpl::statLease4GetHandler(), isc::stat_cmds::LeaseStatCmdsImpl::statLease6GetHandler(), isc::process::DControllerBase::statusGetHandler(), isc::ha::HAService::synchronize(), isc::ha::HAService::verifyAsyncResponse(), isc::process::DControllerBase::versionGetHandler(), and isc::netconf::NetconfAgent::yangConfig().
const char * isc::config::CONTROL_SERVICE = "service" |
String used for service list ("service")
Definition at line 29 of file command_interpreter.cc.
Referenced by createCommand(), and parseCommand().
const char * isc::config::CONTROL_TEXT = "text" |
String used for storing textual description ("text")
Definition at line 27 of file command_interpreter.cc.
Referenced by answerToText(), createAnswer(), isc::config::CmdResponseCreator::filterCommand(), isc::agent::CtrlAgentCommandMgr::handleCommand(), parseAnswer(), parseAnswerText(), and isc::ha::HAService::verifyAsyncResponse().
|
extern |
Definition at line 24 of file config_log.h.
Referenced by isc::config::BaseCommandMgr::deregisterCommand(), isc::config::CmdResponseCreator::filterCommand(), isc::config::BaseCommandMgr::registerCommand(), isc::config::BaseCommandMgr::registerExtendedCommand(), isc::config::CmdHttpListener::start(), and isc::config::CmdHttpListener::stop().
|
extern |
Definition at line 38 of file config_messages.h.
Referenced by isc::config::HttpCommandMgrImpl::configure().
|
extern |
Definition at line 39 of file config_messages.h.
Referenced by isc::config::HttpCommandMgrImpl::configure().
|
extern |
Definition at line 40 of file config_messages.h.
Referenced by isc::config::HttpCommandMgrImpl::close().
|
constexpr |
Timeout for the Control Agent to forward command to a Kea server, e.g.
DHCP server.
This value is high to ensure that the server have enough time to generate large responses, e.g. dump whole lease database.
Definition at line 31 of file timeouts.h.
|
constexpr |
Timeout for the idle connection to be closed.
Definition at line 24 of file timeouts.h.
Referenced by isc::agent::CtrlAgentProcess::configure(), and isc::config::CmdHttpListener::start().
|
constexpr |
Timeout for the Control Agent to receive command over the RESTful interface.
Definition at line 21 of file timeouts.h.
Referenced by isc::agent::CtrlAgentProcess::configure(), and isc::config::CmdHttpListener::start().
|
constexpr |
Timeout for the HTTP clients awaiting a response to a request.
This value is high to ensure that the client waits long enough for the fulfilling server to generate a response. Specified milliseconds.
Definition at line 38 of file timeouts.h.
|
constexpr |
Timeout for the DHCP server to receive command over the unix domain socket.
Definition at line 17 of file timeouts.h.