Kea 2.7.7
ca_process.h
Go to the documentation of this file.
1// Copyright (C) 2016-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 CTRL_AGENT_PROCESS_H
8#define CTRL_AGENT_PROCESS_H
9
10#include <agent/ca_cfg_mgr.h>
11#include <http/listener.h>
12#include <process/d_process.h>
13#include <vector>
14
15namespace isc {
16namespace agent {
17
37
39typedef boost::shared_ptr<HttpSocketInfo> HttpSocketInfoPtr;
40
56public:
63 CtrlAgentProcess(const char* name, const asiolink::IOServicePtr& io_service);
64
66 virtual ~CtrlAgentProcess();
67
75 virtual void init();
76
80 virtual void run();
81
97
130 bool check_only = false);
131
134
142
146 bool isListening() const;
147
149 void closeCommandSockets();
150
151private:
152
157 size_t runIO();
158
160 std::map<std::pair<isc::asiolink::IOAddress, uint16_t>, HttpSocketInfoPtr> sockets_;
161};
162
164typedef boost::shared_ptr<CtrlAgentProcess> CtrlAgentProcessPtr;
165
166} // namespace isc::agent
167} // namespace isc
168
169#endif // CTRL_AGENT_PROCESS_H
Kea Control Agent Application Process.
Definition ca_process.h:55
bool isListening() const
Checks if the process is listening to the HTTP requests.
isc::http::ConstHttpListenerPtr getHttpListener(HttpSocketInfoPtr info=HttpSocketInfoPtr()) const
Returns a const pointer to the HTTP listener.
virtual isc::data::ConstElementPtr shutdown(isc::data::ConstElementPtr args)
Initiates the process's shutdown process.
Definition ca_process.cc:97
virtual ~CtrlAgentProcess()
Destructor.
Definition ca_process.cc:35
CtrlAgentProcess(const char *name, const asiolink::IOServicePtr &io_service)
Constructor.
Definition ca_process.cc:30
virtual void init()
Initialize the Control Agent process.
Definition ca_process.cc:39
CtrlAgentCfgMgrPtr getCtrlAgentCfgMgr()
Returns a pointer to the configuration manager.
virtual isc::data::ConstElementPtr configure(isc::data::ConstElementPtr config_set, bool check_only=false)
Processes the given configuration.
void closeCommandSockets()
Close http control sockets.
virtual void run()
Implements the process's event loop.
Definition ca_process.cc:43
Application Process Interface.
Definition d_process.h:75
boost::shared_ptr< CtrlAgentCfgContext > CtrlAgentCfgContextPtr
Pointer to a configuration context.
Definition ca_cfg_mgr.h:24
boost::shared_ptr< CtrlAgentProcess > CtrlAgentProcessPtr
Defines a shared pointer to CtrlAgentProcess.
Definition ca_process.h:164
boost::shared_ptr< CtrlAgentCfgMgr > CtrlAgentCfgMgrPtr
Defines a shared pointer to CtrlAgentCfgMgr.
Definition ca_cfg_mgr.h:329
boost::shared_ptr< HttpSocketInfo > HttpSocketInfoPtr
Pointer to a HttpSocketInfo object.
Definition ca_process.h:39
boost::shared_ptr< const Element > ConstElementPtr
Definition data.h:29
boost::shared_ptr< const HttpListener > ConstHttpListenerPtr
Pointer to the const HttpListener.
Definition listener.h:159
boost::shared_ptr< HttpListener > HttpListenerPtr
Pointer to the HttpListener.
Definition listener.h:156
Defines the logger used by the top-level component of kea-lfc.
Structure used to store HTTP/HTTPS connection data.
Definition ca_process.h:20
HttpSocketInfo()
Constructor.
Definition ca_process.h:31
~HttpSocketInfo()=default
Destructor.
bool usable_
Flag which indicates if socket can be reused.
Definition ca_process.h:22
CtrlAgentCfgContextPtr config_
Pointer to the socket config.
Definition ca_process.h:25
isc::http::HttpListenerPtr listener_
Pointer to HTTP/HTTPS listener.
Definition ca_process.h:28