Kea 2.7.3
|
Commands Manager implementation for the Kea servers. More...
#include <command_mgr.h>
Public Member Functions | |
void | closeCommandSocket () |
Shuts down any open control sockets. | |
int | getControlSocketFD () |
Returns control socket descriptor. | |
void | openCommandSocket (const isc::data::ConstElementPtr &socket_info) |
Opens control socket with parameters specified in socket_info. | |
void | setConnectionTimeout (const long timeout) |
Override default connection timeout. | |
void | setIOService (const asiolink::IOServicePtr &io_service) |
Sets IO service to be used by the command manager. | |
Public Member Functions inherited from isc::config::HookedCommandMgr | |
HookedCommandMgr () | |
Constructor. | |
Public Member Functions inherited from isc::config::BaseCommandMgr | |
BaseCommandMgr () | |
Constructor. | |
virtual | ~BaseCommandMgr () |
Destructor. | |
void | deregisterAll () |
Auxiliary method that removes all installed commands. | |
void | deregisterCommand (const std::string &cmd) |
Deregisters specified command handler. | |
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. | |
void | registerExtendedCommand (const std::string &cmd, ExtendedCommandHandler handler) |
Registers specified command handler for a given command. | |
Static Public Member Functions | |
static CommandMgr & | instance () |
CommandMgr is a singleton class. | |
Static Public Member Functions inherited from isc::config::BaseCommandMgr | |
static std::string | getHash (const isc::data::ConstElementPtr &config) |
returns a hash of a given Element structure | |
Additional Inherited Members | |
Public Types inherited from isc::config::BaseCommandMgr | |
typedef std::function< isc::data::ConstElementPtr(const std::string &name, const isc::data::ConstElementPtr ¶ms) | CommandHandler) |
Defines command handler type. | |
typedef std::function< isc::data::ConstElementPtr(const std::string &name, const isc::data::ConstElementPtr ¶ms, const isc::data::ConstElementPtr &original) | ExtendedCommandHandler) |
Defines extended command handler type. | |
Protected Types inherited from isc::config::BaseCommandMgr | |
typedef std::map< std::string, HandlersPair > | HandlerContainer |
Type of the container for command handlers. | |
Protected Member Functions inherited from isc::config::HookedCommandMgr | |
bool | delegateCommandToHookLibrary (const std::string &cmd_name, const isc::data::ConstElementPtr ¶ms, const isc::data::ConstElementPtr &original_cmd, isc::data::ElementPtr &answer) |
Handles the command within the hooks libraries. | |
virtual isc::data::ConstElementPtr | handleCommand (const std::string &cmd_name, const isc::data::ConstElementPtr ¶ms, const isc::data::ConstElementPtr &original_cmd) |
Handles the command having a given name and arguments. | |
Protected Attributes inherited from isc::config::BaseCommandMgr | |
HandlerContainer | handlers_ |
Container for command handlers. | |
Commands Manager implementation for the Kea servers.
This class extends BaseCommandMgr with the ability to receive and respond to commands over unix domain sockets.
Definition at line 41 of file command_mgr.h.
void isc::config::CommandMgr::closeCommandSocket | ( | ) |
Shuts down any open control sockets.
Definition at line 624 of file command_mgr.cc.
References isc::dhcp::IfaceMgr::instance().
int isc::config::CommandMgr::getControlSocketFD | ( | ) |
Returns control socket descriptor.
This method should be used only in tests.
Definition at line 641 of file command_mgr.cc.
|
static |
CommandMgr is a singleton class.
This method returns reference to its sole instance.
Definition at line 646 of file command_mgr.cc.
Referenced by isc::dhcp::ControlledDhcpv4Srv::ControlledDhcpv4Srv(), isc::dhcp::ControlledDhcpv6Srv::ControlledDhcpv6Srv(), isc::dhcp::ControlledDhcpv4Srv::~ControlledDhcpv4Srv(), isc::dhcp::ControlledDhcpv6Srv::~ControlledDhcpv6Srv(), isc::dhcp::configureCommandChannel(), isc::d2::D2Controller::deregisterCommands(), isc::d2::D2Process::init(), isc::dhcp::ControlledDhcpv4Srv::loadConfigFile(), isc::dhcp::ControlledDhcpv6Srv::loadConfigFile(), isc::d2::D2Process::reconfigureCommandChannel(), and isc::d2::D2Controller::registerCommands().
void isc::config::CommandMgr::openCommandSocket | ( | const isc::data::ConstElementPtr & | socket_info | ) |
Opens control socket with parameters specified in socket_info.
Currently supported types are:
BadSocketInfo | When socket configuration is invalid. |
SocketError | When socket operation fails. |
socket_info | Configuration information for the control socket. |
Definition at line 620 of file command_mgr.cc.
void isc::config::CommandMgr::setConnectionTimeout | ( | const long | timeout | ) |
Override default connection timeout.
timeout | New connection timeout in milliseconds. |
Definition at line 657 of file command_mgr.cc.
void isc::config::CommandMgr::setIOService | ( | const asiolink::IOServicePtr & | io_service | ) |
Sets IO service to be used by the command manager.
The server should use this method to provide the Command Manager with the common IO service used by the server.
io_service | Pointer to the IO service. |
Definition at line 652 of file command_mgr.cc.