Kea  2.3.5-git
isc::config::CommandMgr Class Reference

Commands Manager implementation for the Kea servers. More...

#include <command_mgr.h>

+ Inheritance diagram for isc::config::CommandMgr:

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...
 
- Public Member Functions inherited from isc::config::HookedCommandMgr
 HookedCommandMgr ()
 Constructor. More...
 
- Public Member Functions inherited from isc::config::BaseCommandMgr
 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 CommandMgrinstance ()
 CommandMgr is a singleton class. More...
 

Additional Inherited Members

- Public Types inherited from isc::config::BaseCommandMgr
typedef std::function< isc::data::ConstElementPtr(const std::string &name, const isc::data::ConstElementPtr &params)> CommandHandler
 Defines command handler type. More...
 
typedef std::function< isc::data::ConstElementPtr(const std::string &name, const isc::data::ConstElementPtr &params, const isc::data::ConstElementPtr &original)> ExtendedCommandHandler
 Defines extended command handler type. More...
 
- Protected Types inherited from isc::config::BaseCommandMgr
typedef std::map< std::string, HandlersPairHandlerContainer
 Type of the container for command handlers. More...
 
- Protected Member Functions inherited from isc::config::HookedCommandMgr
bool delegateCommandToHookLibrary (const std::string &cmd_name, const isc::data::ConstElementPtr &params, 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 &params, const isc::data::ConstElementPtr &original_cmd)
 Handles the command having a given name and arguments. More...
 
- Protected Attributes inherited from isc::config::BaseCommandMgr
HandlerContainer handlers_
 Container for command handlers. More...
 

Detailed Description

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.

Member Function Documentation

◆ closeCommandSocket()

void isc::config::CommandMgr::closeCommandSocket ( )

Shuts down any open control sockets.

Definition at line 627 of file command_mgr.cc.

References isc::dhcp::IfaceMgr::deleteExternalSocket(), and isc::dhcp::IfaceMgr::instance().

Referenced by isc::dhcp::configureCommandChannel(), isc::d2::D2Controller::deregisterCommands(), and isc::d2::D2Process::reconfigureCommandChannel().

+ Here is the call graph for this function:

◆ getControlSocketFD()

int isc::config::CommandMgr::getControlSocketFD ( )

Returns control socket descriptor.

This method should be used only in tests.

Definition at line 644 of file command_mgr.cc.

◆ instance()

CommandMgr & isc::config::CommandMgr::instance ( )
static

◆ openCommandSocket()

void isc::config::CommandMgr::openCommandSocket ( const isc::data::ConstElementPtr socket_info)

Opens control socket with parameters specified in socket_info.

Currently supported types are:

  • unix (required parameters: socket-type: unix, socket-name:/unix/path)
Exceptions
BadSocketInfoWhen socket configuration is invalid.
SocketErrorWhen socket operation fails.
Parameters
socket_infoConfiguration information for the control socket.

Definition at line 623 of file command_mgr.cc.

Referenced by isc::dhcp::configureCommandChannel(), and isc::d2::D2Process::reconfigureCommandChannel().

◆ setConnectionTimeout()

void isc::config::CommandMgr::setConnectionTimeout ( const long  timeout)

Override default connection timeout.

Parameters
timeoutNew connection timeout in milliseconds.

Definition at line 661 of file command_mgr.cc.

◆ setIOService()

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.

Parameters
io_servicePointer to the IO service.

Definition at line 656 of file command_mgr.cc.

Referenced by isc::d2::D2Process::init().


The documentation for this class was generated from the following files: