31 <<
" not found (" << map->getPosition() <<
")");
33 std::string str = value->stringValue();
36 }
catch (
const std::exception& ex) {
38 "invalid NameChangeRequest protocol (" << str
39 <<
") specified for parameter '" << name
40 <<
"' (" << value->getPosition() <<
")");
49 <<
" not found (" << map->getPosition() <<
")");
51 std::string str = value->stringValue();
54 }
catch (
const std::exception& ex) {
56 "invalid NameChangeRequest format (" << str
57 <<
") specified for parameter '" << name
58 <<
"' (" << value->getPosition() <<
")");
133 if (global->find(
"tsig-keys")) {
139 global->set(
"tsig-keys", list);
158 if (domain->find(
"dns-servers")) {
170 const std::string& mgr_name,
174 if (!global->find(mgr_name)) {
177 global->set(mgr_name, map);
182 boost::const_pointer_cast<Element>(global->get(mgr_name));
190 if (mgr->find(
"ddns-domains")) {
192 for (
auto const& domain : domains->listValue()) {
216 ctx->setKeys(parser.
parse(keys));
224 ctx->setForwardMgr(mgr);
232 ctx->setReverseMgr(mgr);
239 uint32_t dns_server_timeout = 0;
247 ncr_protocol = getProtocol(config,
"ncr-protocol");
251 <<
" is not yet supported ("
252 << config->get(
"ncr-protocol")->getPosition() <<
")");
255 ncr_format = getFormat(config,
"ncr-format");
259 <<
" is not yet supported"
260 <<
" (" << config->get(
"ncr-format")->getPosition() <<
")");
265 ctx->setContext(user);
271 if (control_socket) {
276 if (control_sockets) {
280 "Specified control-sockets is expected to be a list");
282 bool seen_unix(
false);
285 for (
ElementPtr socket : control_sockets->listValue()) {
289 "Specified control-sockets is expected to be a list of maps");
294 "'socket-type' parameter is mandatory in control-sockets items");
299 "'socket-type' parameter is expected to be a string");
301 std::string type = socket_type->stringValue();
302 if (type ==
"unix") {
305 "control socket of type 'unix' already configured");
309 unix_config->add(socket);
310 }
else if ((type ==
"http") || (type ==
"https")) {
312 http_config->add(socket);
316 "unsupported 'socket-type': '" << type
317 <<
"' not 'unix', 'http' or 'https'");
320 if (unix_config->size()) {
321 ctx->setUnixControlSocketInfo(unix_config);
323 if (http_config->size()) {
324 ctx->setHttpControlSocketInfo(http_config);
334 hooks_parser.
parse(libraries, hooks);
341 ncr_protocol, ncr_format));
343 ctx->getD2Params() = params;
349 HooksManager::prepareUnloadLibraries();
350 static_cast<void>(HooksManager::unloadLibraries());
The IOAddress class represents an IP addresses (version agnostic)
void clearIOServices()
Clear the list of IOService objects.
static IOServiceMgr & instance()
Access the IOServiceMgr singleton instance.
HTTP command config aka HTTP control socket info class.
UNIX command config aka UNIX control socket info class.
Exception thrown when the error during configuration handling occurs.
Acts as a storage vault for D2 global scalar parameters.
static const data::SimpleDefaults D2_GLOBAL_DEFAULTS
This table defines default global values for D2.
static size_t setManagerDefaults(data::ElementPtr global, const std::string &mgr_name, const data::SimpleDefaults &mgr_defaults)
Adds default values to a DDNS Domain List Manager.
static const data::SimpleDefaults TSIG_KEY_DEFAULTS
Supplies defaults for ddns-domains list elements (i.e. DdnsDomains)
static size_t setDdnsDomainDefaults(data::ElementPtr domain, const data::SimpleDefaults &domain_defaults)
Adds default values to a DDNS Domain element.
void parse(const D2CfgContextPtr &ctx, const isc::data::ConstElementPtr &config, bool check_only)
Parses the whole D2 configuration.
static size_t setAllDefaults(data::ElementPtr global)
Sets all defaults for D2 configuration.
static const data::SimpleDefaults DNS_SERVER_DEFAULTS
Supplies defaults for optional values DdnsDomain entries.
static const data::SimpleDefaults DDNS_DOMAIN_MGR_DEFAULTS
Supplies defaults for optional values in DDNS domain managers (e.g.
static const data::SimpleDefaults DDNS_DOMAIN_DEFAULTS
Supplies defaults for ddns-domains list elements (i.e. DdnsDomains)
Parser for DdnsDomainListMgr.
DdnsDomainListMgrPtr parse(data::ConstElementPtr mgr_config, const std::string &mgr_name, const TSIGKeyInfoMapPtr keys)
Performs the actual parsing of the given manager element.
Parser for a list of TSIGKeyInfos.
TSIGKeyInfoMapPtr parse(data::ConstElementPtr key_list_config)
Performs the parsing of the given list "tsig-key" elements.
static ElementPtr createList(const Position &pos=ZERO_POSITION())
Creates an empty ListElement type ElementPtr.
static size_t setListDefaults(isc::data::ConstElementPtr list, const SimpleDefaults &default_values)
Sets the default values for all entries in a list.
static isc::asiolink::IOAddress getAddress(const ConstElementPtr &scope, const std::string &name)
Returns a IOAddress parameter from a scope.
uint32_t getUint32(isc::data::ConstElementPtr scope, const std::string &name)
Returns a value converted to uint32_t.
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, bool multi_threading_enabled) const
Verifies that libraries stored in libraries_ are valid.
void loadLibraries(bool multi_threading_enabled) const
Commits hooks libraries configuration.
Parser for hooks library list.
void parse(HooksConfig &libraries, isc::data::ConstElementPtr value)
Parses parameters value.
A collection of classes for housing and parsing the application configuration necessary for the DHCP-...
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
boost::shared_ptr< DdnsDomainListMgr > DdnsDomainListMgrPtr
Defines a pointer for DdnsDomain instances.
boost::shared_ptr< D2CfgContext > D2CfgContextPtr
Pointer to a configuration context.
boost::shared_ptr< D2Params > D2ParamsPtr
Defines a pointer for D2Params instances.
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
NameChangeProtocol stringToNcrProtocol(const std::string &protocol_str)
Function which converts text labels to NameChangeProtocol enums.
NameChangeFormat
Defines the list of data wire formats supported.
NameChangeProtocol
Defines the list of socket protocols supported.
std::string ncrProtocolToString(NameChangeProtocol protocol)
Function which converts NameChangeProtocol enums to text labels.
NameChangeFormat stringToNcrFormat(const std::string &fmt_str)
Function which converts labels to NameChangeFormat enum values.
std::string ncrFormatToString(NameChangeFormat format)
Function which converts NameChangeFormat enums to text labels.
Defines the logger used by the top-level component of kea-lfc.
static data::ElementPtr toElement(data::ConstElementPtr map)
Copy an Element map.