14 #include <boost/foreach.hpp> 77 const ParamsList NetconfSimpleParser::INHERIT_TO_SERVERS = {
89 size_t NetconfSimpleParser::setAllDefaults(
const ElementPtr& global) {
93 cnt = setDefaults(global, NETCONF_DEFAULTS);
97 for (
auto it : servers->mapValue()) {
98 cnt += setServerDefaults(it.first, it.second);
111 for (
auto it : servers->mapValue()) {
113 boost::const_pointer_cast<Element>(it.second);
124 NetconfSimpleParser::setServerDefaults(
const std::string name,
129 boost::const_pointer_cast<Element>(server);
130 if (name ==
"dhcp4") {
131 cnt += setDefaults(mutable_server, DHCP4_DEFAULTS);
132 }
else if (name ==
"dhcp6") {
133 cnt += setDefaults(mutable_server, DHCP6_DEFAULTS);
134 }
else if (name ==
"d2") {
135 cnt += setDefaults(mutable_server, D2_DEFAULTS);
136 }
else if (name ==
"ca") {
137 cnt += setDefaults(mutable_server, CA_DEFAULTS);
145 boost::const_pointer_cast<Element>(ctrl_sock);
146 cnt += setDefaults(mutable_ctrl_sock, CTRL_SOCK_DEFAULTS);
159 ctx->setContext(user_context);
165 for (
auto it : servers->mapValue()) {
168 ctx->getCfgServersMap()->insert(make_pair(it.first, server));
178 hooks_parser.
parse(libraries, hooks);
Parser for hooks library list.
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< CfgServer > CfgServerPtr
Defines a pointer for CfgServer instances.
Wrapper class that holds hooks libraries configuration.
static size_t deriveParams(isc::data::ConstElementPtr parent, isc::data::ElementPtr child, const ParamsList ¶ms)
Derives (inherits) parameters from parent scope to a child.
A collection of classes for housing and parsing the application configuration necessary for the Netco...
boost::shared_ptr< const Element > ConstElementPtr
void verifyLibraries(const isc::data::Element::Position &position) const
Verifies that libraries stored in libraries_ are valid.
void loadLibraries() const
Commits hooks libraries configuration.
Defines the logger used by the top-level component of kea-dhcp-ddns.
std::vector< std::string > ParamsList
This defines a list of all parameters that are derived (or inherited) between contexts.
const isc::hooks::HookLibsCollection & get() const
Provides access to the configured hooks libraries.
void parse(HooksConfig &libraries, isc::data::ConstElementPtr value)
Parses parameters value.
CfgServerPtr parse(data::ConstElementPtr server_config)
Performs the actual parsing of the given value from the "managed-servers" map.
boost::shared_ptr< NetconfConfig > NetconfConfigPtr
Pointer to a configuration context.