15 #include <boost/foreach.hpp>
78 const ParamsList NetconfSimpleParser::INHERIT_TO_SERVERS = {
90 size_t NetconfSimpleParser::setAllDefaults(
const ElementPtr& global) {
94 cnt = setDefaults(global, NETCONF_DEFAULTS);
98 for (
auto it : servers->mapValue()) {
99 cnt += setServerDefaults(it.first, it.second);
112 for (
auto it : servers->mapValue()) {
114 boost::const_pointer_cast<
Element>(it.second);
125 NetconfSimpleParser::setServerDefaults(
const std::string name,
130 boost::const_pointer_cast<
Element>(server);
131 if (name ==
"dhcp4") {
132 cnt += setDefaults(mutable_server, DHCP4_DEFAULTS);
133 }
else if (name ==
"dhcp6") {
134 cnt += setDefaults(mutable_server, DHCP6_DEFAULTS);
135 }
else if (name ==
"d2") {
136 cnt += setDefaults(mutable_server, D2_DEFAULTS);
137 }
else if (name ==
"ca") {
138 cnt += setDefaults(mutable_server, CA_DEFAULTS);
146 boost::const_pointer_cast<
Element>(ctrl_sock);
147 cnt += setDefaults(mutable_ctrl_sock, CTRL_SOCK_DEFAULTS);
160 ctx->setContext(user_context);
166 for (
auto it : servers->mapValue()) {
169 ctx->getCfgServersMap()->insert(make_pair(it.first, server));
179 hooks_parser.
parse(libraries, hooks);
187 HooksManager::prepareUnloadLibraries();
188 static_cast<void>(HooksManager::unloadLibraries());
Parser for hooks library list.
const isc::hooks::HookLibsCollection & get() const
Provides access to the configured hooks libraries.
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 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.
The Element class represents a piece of data, used by the command channel and configuration parts...
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.
void verifyLibraries(const isc::data::Element::Position &position) const
Verifies that libraries stored in libraries_ are valid.
boost::shared_ptr< NetconfConfig > NetconfConfigPtr
Pointer to a configuration context.