Kea: isc::config::UnixCommandMgrImpl Class Reference

| Kea 3.2.0-git

isc::config::UnixCommandMgrImpl Class Reference

Implementation of the `UnixCommandMgr`. More...

## Public Member Functions
| UnixCommandMgrImpl ()
| Constructor.
void | closeCommandSocket (UnixSocketInfoPtr info)
| Shuts down any open unix control sockets.
void | closeCommandSockets (bool remove=true)
| Shuts down any open unix control sockets.
void | doAccept (UnixSocketInfoPtr info)
| Asynchronously accepts next connection.
int | getControlSocketFD (UnixSocketInfoPtr info)
| Returns unix control socket descriptor.
void | openCommandSocket (const isc::data::ConstElementPtr config)
| Opens acceptor service allowing the control clients to connect.
void | openCommandSockets (const isc::data::ConstElementPtr config)
| Opens acceptor service allowing the control clients to connect.

## Public Attributes
ConnectionPool | connection_pool_
| Pool of connections.
IOServicePtr | io_service_
| Pointer to the IO service used by the server process for running asynchronous tasks.
std::map< std::string, UnixSocketInfoPtr > | sockets_
| The UNIX socket data (configuration, acceptor, etc.).
long | timeout_
| Connection timeout.
bool | use_external_
| Use external sockets flag.

## Detailed Description

Implementation of the `UnixCommandMgr`.

Definition at line 499 of file unix_command_mgr.cc.

## Constructor & Destructor Documentation

## ◆ UnixCommandMgrImpl()

isc::config::UnixCommandMgrImpl::UnixCommandMgrImpl | ( |  | ) |
| inline

Constructor.

Definition at line 503 of file unix_command_mgr.cc.

References timeout_, isc::config::TIMEOUT_DHCP_SERVER_RECEIVE_COMMAND, and use_external_.

## Member Function Documentation

## ◆ closeCommandSocket()

void isc::config::UnixCommandMgrImpl::closeCommandSocket | ( | UnixSocketInfoPtr | info | ) |

Shuts down any open unix control sockets.

Parameters

  info | Configuration information for the unix control socket.

Definition at line 672 of file unix_command_mgr.cc.

References closeCommandSockets(), connection_pool_, isc::dhcp::IfaceMgr::deleteExternalSocket(), isc::db::info, isc::dhcp::IfaceMgr::instance(), io_service_, sockets_, and use_external_.

Referenced by closeCommandSockets(), and openCommandSockets().

Here is the call graph for this function:

## ◆ closeCommandSockets()

void isc::config::UnixCommandMgrImpl::closeCommandSockets | ( | bool | remove = true | ) |

Shuts down any open unix control sockets.

Parameters

  remove | When true remove the listeners immediately.

Definition at line 707 of file unix_command_mgr.cc.

References closeCommandSocket(), isc::data::copy(), and sockets_.

Referenced by closeCommandSocket().

Here is the call graph for this function:

## ◆ doAccept()

void isc::config::UnixCommandMgrImpl::doAccept | ( | UnixSocketInfoPtr | info | ) |

Asynchronously accepts next connection.

Parameters

  info | Configuration information for the unix control socket.

Definition at line 718 of file unix_command_mgr.cc.

References if(), isc::db::info, and io_service_.

Referenced by openCommandSocket().

Here is the call graph for this function:

## ◆ getControlSocketFD()

int isc::config::UnixCommandMgrImpl::getControlSocketFD | ( | UnixSocketInfoPtr | info | ) |

Returns unix control socket descriptor.

This method should be used only in tests.

Parameters

  info | Configuration information for the unix control socket.

Returns
  The file descriptor of the specified unix control socket.

Definition at line 744 of file unix_command_mgr.cc.

References isc::db::info, and sockets_.

## ◆ openCommandSocket()

void isc::config::UnixCommandMgrImpl::openCommandSocket | ( | const isc::data::ConstElementPtr | config | ) |

Opens acceptor service allowing the control clients to connect.

Creates acceptor, or reuses the existing one.

Parameters

  config | Configuration information for the control socket.

Exceptions

  BadSocketInfo | When socket configuration is invalid.
  SocketError | When socket operation fails.

Definition at line 594 of file unix_command_mgr.cc.

References isc::dhcp::IfaceMgr::addExternalSocket(), isc::config::COMMAND_ACCEPTOR_START, isc::config::command_logger, doAccept(), isc::dhcp::IfaceMgr::instance(), io_service_, isc_throw, LOG_INFO, sockets_, and use_external_.

Referenced by openCommandSockets().

Here is the call graph for this function:

## ◆ openCommandSockets()

void isc::config::UnixCommandMgrImpl::openCommandSockets | ( | const isc::data::ConstElementPtr | config | ) |

Opens acceptor service allowing the control clients to connect.

Parameters

  config | Configuration information for the control socket.

Exceptions

  BadSocketInfo | When socket configuration is invalid.
  SocketError | When socket operation fails.

Definition at line 565 of file unix_command_mgr.cc.

References closeCommandSocket(), isc::data::copy(), isc_throw, Element::list, openCommandSocket(), and sockets_.

Here is the call graph for this function:

## Member Data Documentation

## ◆ connection_pool_

ConnectionPool isc::config::UnixCommandMgrImpl::connection_pool_

Pool of connections.

Definition at line 552 of file unix_command_mgr.cc.

Referenced by closeCommandSocket().

## ◆ io_service_

IOServicePtr isc::config::UnixCommandMgrImpl::io_service_

Pointer to the IO service used by the server process for running asynchronous tasks.

Definition at line 549 of file unix_command_mgr.cc.

Referenced by closeCommandSocket(), doAccept(), and openCommandSocket().

## ◆ sockets_

std::map<std::string, UnixSocketInfoPtr> isc::config::UnixCommandMgrImpl::sockets_

The UNIX socket data (configuration, acceptor, etc.).

Definition at line 555 of file unix_command_mgr.cc.

Referenced by closeCommandSocket(), closeCommandSockets(), getControlSocketFD(), openCommandSocket(), and openCommandSockets().

## ◆ timeout_

long isc::config::UnixCommandMgrImpl::timeout_

Connection timeout.

Definition at line 558 of file unix_command_mgr.cc.

Referenced by UnixCommandMgrImpl().

## ◆ use_external_

bool isc::config::UnixCommandMgrImpl::use_external_

Use external sockets flag.

Definition at line 561 of file unix_command_mgr.cc.

Referenced by UnixCommandMgrImpl(), closeCommandSocket(), and openCommandSocket().

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

- unix_command_mgr.cc