14 #include <boost/foreach.hpp>
27 <<
" not found (" << map->getPosition() <<
")");
29 std::string str = value->stringValue();
32 }
catch (
const std::exception& ex) {
34 "invalid NameChangeRequest protocol (" << str
35 <<
") specified for parameter '" << name
36 <<
"' (" << value->getPosition() <<
")");
45 <<
" not found (" << map->getPosition() <<
")");
47 std::string str = value->stringValue();
50 }
catch (
const std::exception& ex) {
52 "invalid NameChangeRequest format (" << str
53 <<
") specified for parameter '" << name
54 <<
"' (" << value->getPosition() <<
")");
125 cnt = setDefaults(global, D2_GLOBAL_DEFAULTS);
128 if (global->find(
"tsig-keys")) {
130 cnt += setListDefaults(keys, TSIG_KEY_DEFAULTS);
134 global->set(
"tsig-keys", list);
139 cnt += setManagerDefaults(global,
"forward-ddns", DDNS_DOMAIN_MGR_DEFAULTS);
142 cnt += setManagerDefaults(global,
"reverse-ddns", DDNS_DOMAIN_MGR_DEFAULTS);
152 cnt += setDefaults(domain, domain_defaults);
153 if (domain->find(
"dns-servers")) {
156 cnt += setListDefaults(servers, DNS_SERVER_DEFAULTS);
165 const std::string& mgr_name,
169 if (!global->find(mgr_name)) {
172 global->set(mgr_name, map);
177 boost::const_pointer_cast<
Element>(global->get(mgr_name));
180 cnt += setDefaults(mgr, mgr_defaults);
185 if (mgr->find(
"ddns-domains")) {
187 BOOST_FOREACH(
ElementPtr domain, domains->listValue()) {
190 cnt += setDdnsDomainDefaults(domain, DDNS_DOMAIN_DEFAULTS);
211 ctx->setKeys(parser.
parse(keys));
219 ctx->setForwardMgr(mgr);
227 ctx->setReverseMgr(mgr);
234 uint32_t dns_server_timeout = 0;
240 if ((ip_address.
toText() ==
"0.0.0.0") ||
241 (ip_address.
toText() ==
"::")) {
243 << ip_address <<
"\""
244 <<
" (" << config->get(
"ip-address")->getPosition() <<
")");
251 ncr_protocol = getProtocol(config,
"ncr-protocol");
255 <<
" is not yet supported ("
256 << config->get(
"ncr-protocol")->getPosition() <<
")");
259 ncr_format = getFormat(config,
"ncr-format");
263 <<
" is not yet supported"
264 <<
" (" << config->get(
"ncr-format")->getPosition() <<
")");
269 ctx->setContext(user);
276 ", i.e. a structure defined within { }");
278 ctx->setControlSocketInfo(socket);
287 hooks_parser.
parse(libraries, hooks);
294 ncr_protocol, ncr_format));
296 ctx->getD2Params() = params;
302 HooksManager::prepareUnloadLibraries();
303 static_cast<void>(HooksManager::unloadLibraries());
boost::shared_ptr< D2Params > D2ParamsPtr
Defines a pointer for D2Params instances.
Parser for hooks library list.
const isc::hooks::HookLibsCollection & get() const
Provides access to the configured hooks libraries.
NameChangeProtocol stringToNcrProtocol(const std::string &protocol_str)
Function which converts text labels to NameChangeProtocol enums.
DdnsDomainListMgrPtr parse(data::ConstElementPtr mgr_config, const std::string &mgr_name, const TSIGKeyInfoMapPtr keys)
Performs the actual parsing of the given manager element.
boost::shared_ptr< DdnsDomainListMgr > DdnsDomainListMgrPtr
Defines a pointer for DdnsDomain instances.
std::vector< SimpleDefault > SimpleDefaults
This specifies all default values in a given scope (e.g. a subnet).
Parser for DdnsDomainListMgr.
Exception thrown when the error during configuration handling occurs.
boost::shared_ptr< Element > ElementPtr
Wrapper class that holds hooks libraries configuration.
NameChangeFormat
Defines the list of data wire formats supported.
TSIGKeyInfoMapPtr parse(data::ConstElementPtr key_list_config)
Performs the parsing of the given list "tsig-key" elements.
#define isc_throw(type, stream)
A shortcut macro to insert known values into exception arguments.
std::string ncrProtocolToString(NameChangeProtocol protocol)
Function which converts NameChangeProtocol enums to text labels.
boost::shared_ptr< const Element > ConstElementPtr
boost::shared_ptr< D2CfgContext > D2CfgContextPtr
Pointer to a configuration context.
uint32_t getUint32(isc::data::ConstElementPtr scope, const std::string &name)
Returns a value converted to uint32_t.
void loadLibraries() const
Commits hooks libraries configuration.
static isc::asiolink::IOAddress getAddress(const ConstElementPtr &scope, const std::string &name)
Returns a IOAddress parameter from a scope.
Defines the logger used by the top-level component of kea-dhcp-ddns.
std::string ncrFormatToString(NameChangeFormat format)
Function which converts NameChangeFormat enums to text labels.
The Element class represents a piece of data, used by the command channel and configuration parts...
std::string toText() const
Convert the address to a string.
NameChangeProtocol
Defines the list of socket protocols supported.
NameChangeFormat stringToNcrFormat(const std::string &fmt_str)
Function which converts labels to NameChangeFormat enum values.
Parser for a list of TSIGKeyInfos.
The IOAddress class represents an IP addresses (version agnostic)
A collection of classes for housing and parsing the application configuration necessary for the DHCP-...
void parse(HooksConfig &libraries, isc::data::ConstElementPtr value)
Parses parameters value.
void verifyLibraries(const isc::data::Element::Position &position) const
Verifies that libraries stored in libraries_ are valid.
Acts as a storage vault for D2 global scalar parameters.