Kea 2.5.8
command_mgr.h
Go to the documentation of this file.
1// Copyright (C) 2015-2018 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 COMMAND_MGR_H
8#define COMMAND_MGR_H
9
10#include <asiolink/io_service.h>
11#include <cc/data.h>
14#include <boost/noncopyable.hpp>
15#include <boost/shared_ptr.hpp>
16
17namespace isc {
18namespace config {
19
21class BadSocketInfo : public Exception {
22public:
23 BadSocketInfo(const char* file, size_t line, const char* what) :
24 isc::Exception(file, line, what) { };
25};
26
28class SocketError : public Exception {
29public:
30 SocketError(const char* file, size_t line, const char* what) :
31 isc::Exception(file, line, what) { };
32};
33
34
35class CommandMgrImpl;
36
41class CommandMgr : public HookedCommandMgr, public boost::noncopyable {
42public:
43
48 static CommandMgr& instance();
49
55 void setIOService(const asiolink::IOServicePtr& io_service);
56
60 void setConnectionTimeout(const long timeout);
61
71 void
73
75 void closeCommandSocket();
76
81
82private:
83
85 CommandMgr();
86
88 boost::shared_ptr<CommandMgrImpl> impl_;
89};
90
91}; // end of isc::config namespace
92}; // end of isc namespace
93
94#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.
Definition: command_mgr.h:21
BadSocketInfo(const char *file, size_t line, const char *what)
Definition: command_mgr.h:23
Commands Manager implementation for the Kea servers.
Definition: command_mgr.h:41
int getControlSocketFD()
Returns control socket descriptor.
Definition: command_mgr.cc:641
void closeCommandSocket()
Shuts down any open control sockets.
Definition: command_mgr.cc:624
static CommandMgr & instance()
CommandMgr is a singleton class.
Definition: command_mgr.cc:646
void setIOService(const asiolink::IOServicePtr &io_service)
Sets IO service to be used by the command manager.
Definition: command_mgr.cc:652
void setConnectionTimeout(const long timeout)
Override default connection timeout.
Definition: command_mgr.cc:657
void openCommandSocket(const isc::data::ConstElementPtr &socket_info)
Opens control socket with parameters specified in socket_info.
Definition: command_mgr.cc:620
Command Manager which can delegate commands to a hook library.
An exception indicating a problem with socket operation.
Definition: command_mgr.h:28
SocketError(const char *file, size_t line, const char *what)
Definition: command_mgr.h:30
boost::shared_ptr< const Element > ConstElementPtr
Definition: data.h:29
Defines the logger used by the top-level component of kea-lfc.