Kea 2.7.7
unix_command_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2015-2025 Internet Systems Consortium, Inc. ("ISC")
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at http://mozilla.org/MPL/2.0/.
6
7#ifndef UNIX_COMMAND_MGR_H
8#define UNIX_COMMAND_MGR_H
9
10#include <asiolink/io_service.h>
11#include <cc/data.h>
13
15#include <boost/noncopyable.hpp>
16#include <boost/shared_ptr.hpp>
17
18namespace isc {
19namespace config {
20
22class SocketError : public Exception {
23public:
24 SocketError(const char* file, size_t line, const char* what) :
25 isc::Exception(file, line, what) { }
26};
27
28class UnixCommandMgrImpl;
29
33class UnixCommandMgr : public boost::noncopyable {
34public:
35
40 static UnixCommandMgr& instance();
41
47 void setIOService(const asiolink::IOServicePtr& io_service);
48
52 void setConnectionTimeout(const long timeout);
53
60 void addExternalSockets(bool use_external = true);
61
70
84
92
95
104
105private:
106
109
111 boost::shared_ptr<UnixCommandMgrImpl> impl_;
112};
113
114} // end of isc::config namespace
115} // end of isc namespace
116#endif
This is a base class for exceptions thrown from the DNS library module.
virtual const char * what() const
Returns a C-style character string of the cause of the exception.
An exception indicating a problem with socket operation.
SocketError(const char *file, size_t line, const char *what)
Unix Commands Manager implementation for the Kea servers.
static UnixCommandMgr & instance()
UnixCommandMgr is a singleton class.
void setIOService(const asiolink::IOServicePtr &io_service)
Sets IO service to be used by the unix command manager.
int getControlSocketFD(UnixSocketInfoPtr info=UnixSocketInfoPtr())
Returns unix control socket descriptor.
void openCommandSockets(const isc::data::ConstElementPtr config)
Opens unix control socket with parameters specified in socket_info (required parameters: socket-type:...
void closeCommandSockets()
Shuts down any open unix control sockets.
void addExternalSockets(bool use_external=true)
Use external sockets flag.
void closeCommandSocket(UnixSocketInfoPtr info=UnixSocketInfoPtr())
Shuts down any open unix control sockets.
void setConnectionTimeout(const long timeout)
Override default connection timeout.
void openCommandSocket(const isc::data::ConstElementPtr config)
Opens unix control socket with parameters specified in socket_info (required parameters: socket-type:...
boost::shared_ptr< UnixSocketInfo > UnixSocketInfoPtr
Pointer to a UnixSocketInfo object.
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
Defines the logger used by the top-level component of kea-lfc.