![]() |
Kea
1.9.9-git
|
Commands Manager implementation for the Kea servers. More...
#include <command_mgr.h>
Public Member Functions | |
void | closeCommandSocket () |
Shuts down any open control sockets. More... | |
int | getControlSocketFD () |
Returns control socket descriptor. More... | |
void | openCommandSocket (const isc::data::ConstElementPtr &socket_info) |
Opens control socket with parameters specified in socket_info. More... | |
void | setConnectionTimeout (const long timeout) |
Override default connection timeout. More... | |
void | setIOService (const asiolink::IOServicePtr &io_service) |
Sets IO service to be used by the command manager. More... | |
![]() | |
HookedCommandMgr () | |
Constructor. More... | |
![]() | |
BaseCommandMgr () | |
Constructor. More... | |
virtual | ~BaseCommandMgr () |
Destructor. More... | |
void | deregisterAll () |
Auxiliary method that removes all installed commands. More... | |
void | deregisterCommand (const std::string &cmd) |
Deregisters specified command handler. More... | |
virtual isc::data::ConstElementPtr | processCommand (const isc::data::ConstElementPtr &cmd) |
Triggers command processing. More... | |
void | registerCommand (const std::string &cmd, CommandHandler handler) |
Registers specified command handler for a given command. More... | |
void | registerExtendedCommand (const std::string &cmd, ExtendedCommandHandler handler) |
Registers specified command handler for a given command. More... | |
Static Public Member Functions | |
static CommandMgr & | instance () |
CommandMgr is a singleton class. More... | |
Additional Inherited Members | |
![]() | |
typedef std::function< isc::data::ConstElementPtr(const std::string &name, const isc::data::ConstElementPtr ¶ms)> | CommandHandler |
Defines command handler type. More... | |
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. More... | |
![]() | |
typedef std::map< std::string, HandlersPair > | HandlerContainer |
Type of the container for command handlers. More... | |
![]() | |
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. More... | |
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. More... | |
![]() | |
HandlerContainer | handlers_ |
Container for command handlers. More... | |
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 626 of file command_mgr.cc.
References isc::dhcp::IfaceMgr::deleteExternalSocket(), and isc::dhcp::IfaceMgr::instance().
Referenced by isc::dhcp::configureCommandChannel(), and isc::d2::D2Process::reconfigureCommandChannel().
int isc::config::CommandMgr::getControlSocketFD | ( | ) |
Returns control socket descriptor.
This method should be used only in tests.
Definition at line 643 of file command_mgr.cc.
|
static |
CommandMgr is a singleton class.
This method returns reference to its sole instance.
Definition at line 649 of file command_mgr.cc.
Referenced by isc::dhcp::configureCommandChannel(), isc::d2::D2Process::init(), and isc::d2::D2Process::reconfigureCommandChannel().
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 622 of file command_mgr.cc.
Referenced by isc::dhcp::configureCommandChannel(), and isc::d2::D2Process::reconfigureCommandChannel().
void isc::config::CommandMgr::setConnectionTimeout | ( | const long | timeout | ) |
Override default connection timeout.
timeout | New connection timeout in milliseconds. |
Definition at line 660 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 655 of file command_mgr.cc.
Referenced by isc::d2::D2Process::init().