15#include <boost/foreach.hpp>
40 {
"http-host", Element::string,
"127.0.0.1" },
41 {
"http-port", Element::integer,
"8000" },
42 {
"trust-anchor", Element::string,
"" },
43 {
"cert-file", Element::string,
"" },
44 {
"key-file", Element::string,
"" },
45 {
"cert-required", Element::boolean,
"true" }
50 {
"type", Element::string,
"basic" },
51 {
"realm", Element::string,
"kea-control-agent" },
52 {
"directory", Element::string,
"" }
58 {
"socket-type", Element::string,
"unix" }
76 ElementPtr auth = boost::const_pointer_cast<Element>(authentication);
85 ElementPtr d2 = boost::const_pointer_cast<Element>(sockets->get(
"d2"));
90 ElementPtr d4 = boost::const_pointer_cast<Element>(sockets->get(
"dhcp4"));
95 ElementPtr d6 = boost::const_pointer_cast<Element>(sockets->get(
"dhcp6"));
109 bool have_ca = (ca && !ca->stringValue().empty());
110 bool have_cert = (cert && !cert->stringValue().empty());
111 bool have_key = (key && !key->stringValue().empty());
112 if (!have_ca && !have_cert && !have_key) {
119 " all or none of TLS parameters must be set");
123 " all or none of TLS parameters must be set");
127 " all or none of TLS parameters must be set");
137 ctx->setHttpHost(SimpleParser::getString(config,
"http-host"));
138 ctx->setHttpPort(SimpleParser::getIntType<uint16_t>(config,
"http-port"));
141 ctx->setTrustAnchor(SimpleParser::getString(config,
"trust-anchor"));
142 ctx->setCertFile(SimpleParser::getString(config,
"cert-file"));
143 ctx->setKeyFile(SimpleParser::getString(config,
"key-file"));
144 ctx->setCertRequired(SimpleParser::getBoolean(config,
"cert-required"));
149 auto sockets_map = ctrl_sockets->mapValue();
150 for (
auto cs = sockets_map.cbegin(); cs != sockets_map.cend(); ++cs) {
151 ctx->setControlSocketInfo(cs->second, cs->first);
160 auth->parse(auth_config);
161 ctx->setAuthConfig(auth);
167 ctx->setContext(user_context);
176 hooks_parser.
parse(libraries, hooks);
184 HooksManager::prepareUnloadLibraries();
185 static_cast<void>(HooksManager::unloadLibraries());
An exception that is thrown if an error occurs while configuring any server.
void checkTlsSetup(const isc::data::ConstElementPtr &config)
Check TLS setup consistency i.e.
static const isc::data::SimpleDefaults AUTH_DEFAULTS
This table defines default values for authentication.
static const isc::data::SimpleDefaults SOCKET_DEFAULTS
This table defines default values for control sockets.
static const isc::data::SimpleDefaults AGENT_DEFAULTS
This table defines default values for global options.
void parse(const CtrlAgentCfgContextPtr &ctx, const isc::data::ConstElementPtr &config, bool check_only)
Parses the control agent configuration.
static size_t setAllDefaults(const isc::data::ElementPtr &global)
Sets all defaults for Control Agent configuration.
static size_t setDefaults(isc::data::ElementPtr scope, const SimpleDefaults &default_values)
Sets the default values.
Wrapper class that holds hooks libraries configuration.
const isc::hooks::HookLibsCollection & get() const
Provides access to the configured hooks libraries.
void verifyLibraries(const isc::data::Element::Position &position) const
Verifies that libraries stored in libraries_ are valid.
void loadLibraries() const
Commits hooks libraries configuration.
Parser for hooks library list.
void parse(HooksConfig &libraries, isc::data::ConstElementPtr value)
Parses parameters value.
Basic HTTP authentication configuration.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< CtrlAgentCfgContext > CtrlAgentCfgContextPtr
Pointer to a configuration context.
boost::shared_ptr< const Element > ConstElementPtr
std::vector< SimpleDefault > SimpleDefaults
This specifies all default values in a given scope (e.g. a subnet).
boost::shared_ptr< Element > ElementPtr
boost::shared_ptr< BasicHttpAuthConfig > BasicHttpAuthConfigPtr
Type of shared pointers to basic HTTP authentication configuration.
Defines the logger used by the top-level component of kea-lfc.