45 void close(
bool remove);
101 current_config_->setEmulateAgentResponse(config->getEmulateAgentResponse());
110 IOAddress server_address = config->getSocketAddress();
111 uint16_t server_port = config->getSocketPort();
112 bool use_https =
false;
114 if (!config->getCertFile().empty()) {
115 TlsContext::configure(tls_context,
117 config->getTrustAnchor(),
118 config->getCertFile(),
119 config->getKeyFile(),
120 config->getCertRequired());
145 http_listener->start();
155 .arg(use_https ?
"HTTPS" :
"HTTP")
156 .arg(server_address.toText())
162 bool use_https =
false;
170 .arg(use_https ?
"HTTPS" :
"HTTP")
213 return (http_cmd_mgr);
216HttpCommandMgr::HttpCommandMgr()
222 impl_->io_service_ = io_service;
227 impl_->timeout_ = timeout;
232 impl_->idle_timeout_ = timeout;
237 impl_->use_external_ = use_external;
242 impl_->configure(config);
247 impl_->close(remove);
252 impl_->garbageCollectListeners();
257 return (impl_->getHttpListener());
The IOAddress class represents an IP addresses (version agnostic)
Command Manager which can delegate commands to a hook library.
Implementation of the HttpCommandMgr.
vector< HttpListenerPtr > http_listeners_
Active listeners.
bool use_external_
Use external sockets flag.
HttpCommandConfigPtr current_config_
Current config.
void close(bool remove)
Close control socket.
void configure(HttpCommandConfigPtr config)
Configure control socket from configuration.
ConstHttpListenerPtr getHttpListener() const
Returns a const pointer to the HTTP listener.
size_t active_
Number of active listeners (0 or 1).
void garbageCollectListeners()
Removes listeners which are no longer in use.
long idle_timeout_
Idle connection timeout.
IOServicePtr io_service_
Pointer to the IO service.
HttpCommandMgrImpl()
Constructor.
long timeout_
Connection timeout.
HTTP Commands Manager implementation for the Kea servers.
void setIdleConnectionTimeout(const long timeout)
Override default idle connection timeout.
isc::http::ConstHttpListenerPtr getHttpListener() const
Returns a const pointer to the HTTP listener.
void setConnectionTimeout(const long timeout)
Override default connection timeout.
void addExternalSockets(bool use_external=true)
Use external sockets flag.
static HttpCommandMgr & instance()
HttpCommandMgr is a singleton class.
void garbageCollectListeners()
Removes listeners which are no longer in use.
void setIOService(const asiolink::IOServicePtr &io_service)
Sets IO service to be used by the command manager.
void close(bool remove=true)
Close control socket.
void configure(HttpCommandConfigPtr config)
Configure control socket from configuration.
HTTP response creator factory for HTTP control socket.
#define LOG_INFO(LOGGER, MESSAGE)
Macro to conveniently test info output and log it.
#define LOG_WARN(LOGGER, MESSAGE)
Macro to conveniently test warn output and log it.
boost::shared_ptr< TlsContext > TlsContextPtr
The type of shared pointers to TlsContext objects.
boost::shared_ptr< IOService > IOServicePtr
Defines a smart pointer to an IOService instance.
constexpr long TIMEOUT_AGENT_IDLE_CONNECTION_TIMEOUT
Timeout for the idle connection to be closed.
const isc::log::MessageID HTTP_COMMAND_MGR_IGNORED_TLS_SETUP_CHANGES
const isc::log::MessageID HTTP_COMMAND_MGR_SERVICE_STARTED
const isc::log::MessageID HTTP_COMMAND_MGR_SERVICE_STOPPING
boost::shared_ptr< HttpCommandConfig > HttpCommandConfigPtr
Pointer to a HttpCommandConfig object.
isc::log::Logger command_logger("commands")
Command processing Logger.
constexpr long TIMEOUT_AGENT_RECEIVE_COMMAND
Timeout for the Control Agent to receive command over the RESTful interface.
boost::shared_ptr< const HttpListener > ConstHttpListenerPtr
Pointer to the const HttpListener.
boost::shared_ptr< HttpListener > HttpListenerPtr
Pointer to the HttpListener.
boost::shared_ptr< HttpResponseCreatorFactory > HttpResponseCreatorFactoryPtr
Pointer to the HttpResponseCreatorFactory.
Defines the logger used by the top-level component of kea-lfc.
HTTP request timeout value.