Kea 2.7.6
unix_command_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2015-2024 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#include <boost/noncopyable.hpp>
14#include <boost/shared_ptr.hpp>
15
16namespace isc {
17namespace config {
18
20class BadSocketInfo : public Exception {
21public:
22 BadSocketInfo(const char* file, size_t line, const char* what) :
23 isc::Exception(file, line, what) { }
24};
25
27class SocketError : public Exception {
28public:
29 SocketError(const char* file, size_t line, const char* what) :
30 isc::Exception(file, line, what) { }
31};
32
33class UnixCommandMgrImpl;
34
38class UnixCommandMgr : public boost::noncopyable {
39public:
40
45 static UnixCommandMgr& instance();
46
52 void setIOService(const asiolink::IOServicePtr& io_service);
53
57 void setConnectionTimeout(const long timeout);
58
65 void addExternalSockets(bool use_external = true);
66
74 void
76
78 void closeCommandSocket();
79
84
85private:
86
89
91 boost::shared_ptr<UnixCommandMgrImpl> impl_;
92};
93
94} // end of isc::config namespace
95} // end of isc namespace
96#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 that specified socket parameters are invalid.
BadSocketInfo(const char *file, size_t line, const char *what)
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.
int getControlSocketFD()
Returns unix control socket descriptor.
void setIOService(const asiolink::IOServicePtr &io_service)
Sets IO service to be used by the unix command manager.
void closeCommandSocket()
Shuts down any open unix control sockets.
void openCommandSocket(const isc::data::ConstElementPtr &socket_info)
Opens unix control socket with parameters specified in socket_info (required parameters: socket-type:...
void addExternalSockets(bool use_external=true)
Use external sockets flag.
void setConnectionTimeout(const long timeout)
Override default connection timeout.
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
Defines the logger used by the top-level component of kea-lfc.