Commit c604855f authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰

[#65,!88] Remaining changes after review:

 - Remaining methods renamed
 - comments expanded
 - size() > 0 replaced with !empty() checks.
parent c7965980
...@@ -104,11 +104,13 @@ AdaptorConfig::sharedNetworksAssignID(ConstElementPtr networks, ...@@ -104,11 +104,13 @@ AdaptorConfig::sharedNetworksAssignID(ConstElementPtr networks,
for (ConstElementPtr network : networks->listValue()) { for (ConstElementPtr network : networks->listValue()) {
ConstElementPtr subnets = network->get(subsel); ConstElementPtr subnets = network->get(subsel);
if (subnets && (subnets->size() > 0)) { if (!subnets || subnets->empty()) {
for (size_t i = 0; i < subnets->size(); ++i) { continue;
ElementPtr subnet = subnets->getNonConst(i); }
assignID(subnet, set, next);
} for (size_t i = 0; i < subnets->size(); ++i) {
ElementPtr subnet = subnets->getNonConst(i);
assignID(subnet, set, next);
} }
} }
} }
...@@ -154,9 +156,9 @@ AdaptorConfig::sanitizePoolsInSharedNetworks(ConstElementPtr networks, ...@@ -154,9 +156,9 @@ AdaptorConfig::sanitizePoolsInSharedNetworks(ConstElementPtr networks,
} }
void void
AdaptorConfig::optionDefList(ConstElementPtr defs, AdaptorConfig::sanitizeOptionDefList(ConstElementPtr defs,
const string& space, const string& space,
OptionCodes& codes) { OptionCodes& codes) {
if (!defs || defs->empty()) { if (!defs || defs->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -174,8 +176,9 @@ AdaptorConfig::optionDefList(ConstElementPtr defs, ...@@ -174,8 +176,9 @@ AdaptorConfig::optionDefList(ConstElementPtr defs,
} }
void void
AdaptorConfig::optionDataList(ConstElementPtr options,const string& space, AdaptorConfig::sanitizeOptionDataList(ConstElementPtr options,
const OptionCodes& codes) { const string& space,
const OptionCodes& codes) {
if (!options || options->empty()) { if (!options || options->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -191,30 +194,39 @@ AdaptorConfig::optionDataList(ConstElementPtr options,const string& space, ...@@ -191,30 +194,39 @@ AdaptorConfig::optionDataList(ConstElementPtr options,const string& space,
} }
void void
AdaptorConfig::optionClasses(ConstElementPtr classes, const string& space, AdaptorConfig::sanitizeOptionClasses(ConstElementPtr classes,
OptionCodes& codes) { const string& space,
OptionCodes& codes) {
if (!classes || classes->empty()) { if (!classes || classes->empty()) {
// nothing to do here. // nothing to do here.
return; return;
} }
// For every client class defined...
for (size_t i = 0; i < classes->size(); ++i) { for (size_t i = 0; i < classes->size(); ++i) {
ElementPtr cclass = classes->getNonConst(i); ElementPtr cclass = classes->getNonConst(i);
if (space == DHCP4_SPACE) { if (space == DHCP4_SPACE) {
ConstElementPtr options = cclass->get("option-def"); ConstElementPtr options = cclass->get("option-def");
if (options) { if (options) {
if (options->size() > 0) { if (!options->empty()) {
optionDefList(options, space, codes); // If present, sanitize it.
sanitizeOptionDefList(options, space, codes);
} else { } else {
// If empty, remove it.
cclass->remove("option-def"); cclass->remove("option-def");
} }
} }
} }
// also sanitize option data.
ConstElementPtr options = cclass->get("option-data"); ConstElementPtr options = cclass->get("option-data");
if (options) { if (options) {
if (options->size() > 0) { if (!options->empty()) {
optionDataList(options, space, codes); // If present, sanitize it.
sanitizeOptionDataList(options, space, codes);
} else { } else {
// If empty, remove it.
cclass->remove("option-data"); cclass->remove("option-data");
} }
} }
...@@ -222,8 +234,8 @@ AdaptorConfig::optionClasses(ConstElementPtr classes, const string& space, ...@@ -222,8 +234,8 @@ AdaptorConfig::optionClasses(ConstElementPtr classes, const string& space,
} }
void void
AdaptorConfig::optionPools(ConstElementPtr pools, const string& space, AdaptorConfig::sanitizeOptionPools(ConstElementPtr pools, const string& space,
const OptionCodes& codes) { const OptionCodes& codes) {
if (!pools || pools->empty()) { if (!pools || pools->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -233,8 +245,8 @@ AdaptorConfig::optionPools(ConstElementPtr pools, const string& space, ...@@ -233,8 +245,8 @@ AdaptorConfig::optionPools(ConstElementPtr pools, const string& space,
ElementPtr pool = pools->getNonConst(i); ElementPtr pool = pools->getNonConst(i);
ConstElementPtr options = pool->get("option-data"); ConstElementPtr options = pool->get("option-data");
if (options) { if (options) {
if (options->size() > 0) { if (!options->empty()) {
optionDataList(options, space, codes); sanitizeOptionDataList(options, space, codes);
} else { } else {
pool->remove("option-data"); pool->remove("option-data");
} }
...@@ -243,8 +255,8 @@ AdaptorConfig::optionPools(ConstElementPtr pools, const string& space, ...@@ -243,8 +255,8 @@ AdaptorConfig::optionPools(ConstElementPtr pools, const string& space,
} }
void void
AdaptorConfig::optionHosts(ConstElementPtr hosts, const string& space, AdaptorConfig::sanitizeOptionHosts(ConstElementPtr hosts, const string& space,
const OptionCodes& codes) { const OptionCodes& codes) {
if (!hosts || hosts->empty()) { if (!hosts || hosts->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -254,8 +266,8 @@ AdaptorConfig::optionHosts(ConstElementPtr hosts, const string& space, ...@@ -254,8 +266,8 @@ AdaptorConfig::optionHosts(ConstElementPtr hosts, const string& space,
ElementPtr host = hosts->getNonConst(i); ElementPtr host = hosts->getNonConst(i);
ConstElementPtr options = host->get("option-data"); ConstElementPtr options = host->get("option-data");
if (options) { if (options) {
if (options->size() > 0) { if (!options->empty()) {
optionDataList(options, space, codes); sanitizeOptionDataList(options, space, codes);
} else { } else {
host->remove("option-data"); host->remove("option-data");
} }
...@@ -264,8 +276,9 @@ AdaptorConfig::optionHosts(ConstElementPtr hosts, const string& space, ...@@ -264,8 +276,9 @@ AdaptorConfig::optionHosts(ConstElementPtr hosts, const string& space,
} }
void void
AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space, AdaptorConfig::sanitizeOptionSubnets(ConstElementPtr subnets,
const OptionCodes& codes) { const string& space,
const OptionCodes& codes) {
if (!subnets || subnets->empty()) { if (!subnets || subnets->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -277,8 +290,8 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space, ...@@ -277,8 +290,8 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space,
// Let's try to sanitize option-data first. // Let's try to sanitize option-data first.
ConstElementPtr options = subnet->get("option-data"); ConstElementPtr options = subnet->get("option-data");
if (options) { if (options) {
if (options->size() > 0) { if (!options->empty()) {
optionDataList(options, space, codes); sanitizeOptionDataList(options, space, codes);
} else { } else {
subnet->remove("option-data"); subnet->remove("option-data");
} }
...@@ -287,8 +300,8 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space, ...@@ -287,8 +300,8 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space,
// Then try to sanitize pools. // Then try to sanitize pools.
ConstElementPtr pools = subnet->get("pools"); ConstElementPtr pools = subnet->get("pools");
if (pools) { if (pools) {
if (pools->size() > 0) { if (!pools->empty()) {
optionPools(pools, space, codes); sanitizeOptionPools(pools, space, codes);
} else { } else {
subnet->remove("pools"); subnet->remove("pools");
} }
...@@ -298,8 +311,8 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space, ...@@ -298,8 +311,8 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space,
if (space == DHCP6_SPACE) { if (space == DHCP6_SPACE) {
ConstElementPtr pools = subnet->get("pd-pools"); ConstElementPtr pools = subnet->get("pd-pools");
if (pools) { if (pools) {
if (pools->size() > 0) { if (!pools->empty()) {
optionPools(pools, space, codes); sanitizeOptionPools(pools, space, codes);
} else { } else {
subnet->remove("pd-pools"); subnet->remove("pd-pools");
} }
...@@ -309,8 +322,8 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space, ...@@ -309,8 +322,8 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space,
// Finally, sanitize host reservations. // Finally, sanitize host reservations.
ConstElementPtr hosts = subnet->get("reservations"); ConstElementPtr hosts = subnet->get("reservations");
if (hosts) { if (hosts) {
if (hosts->size() > 0) { if (!hosts->empty()) {
optionHosts(hosts, space, codes); sanitizeOptionHosts(hosts, space, codes);
} else { } else {
subnet->remove("reservations"); subnet->remove("reservations");
} }
...@@ -319,9 +332,9 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space, ...@@ -319,9 +332,9 @@ AdaptorConfig::optionSubnets(ConstElementPtr subnets, const string& space,
} }
void void
AdaptorConfig::optionSharedNetworks(ConstElementPtr networks, AdaptorConfig::sanitizeOptionSharedNetworks(ConstElementPtr networks,
const string& space, const string& space,
const OptionCodes& codes) { const OptionCodes& codes) {
if (!networks || networks->empty()) { if (!networks || networks->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -334,8 +347,8 @@ AdaptorConfig::optionSharedNetworks(ConstElementPtr networks, ...@@ -334,8 +347,8 @@ AdaptorConfig::optionSharedNetworks(ConstElementPtr networks,
// try to sanitize shared network options first. // try to sanitize shared network options first.
ConstElementPtr options = network->get("option-data"); ConstElementPtr options = network->get("option-data");
if (options) { if (options) {
if (options->size() > 0) { if (!options->empty()) {
optionDataList(options, space, codes); sanitizeOptionDataList(options, space, codes);
} else { } else {
network->remove("option-data"); network->remove("option-data");
} }
...@@ -350,8 +363,8 @@ AdaptorConfig::optionSharedNetworks(ConstElementPtr networks, ...@@ -350,8 +363,8 @@ AdaptorConfig::optionSharedNetworks(ConstElementPtr networks,
// Now try to sanitize subnets. // Now try to sanitize subnets.
ConstElementPtr subnets = network->get(subnet); ConstElementPtr subnets = network->get(subnet);
if (subnets) { if (subnets) {
if (subnets->size() > 0) { if (!subnets->empty()) {
optionSubnets(subnets, space, codes); sanitizeOptionSubnets(subnets, space, codes);
} else { } else {
network->remove(subnet); network->remove(subnet);
} }
...@@ -360,7 +373,7 @@ AdaptorConfig::optionSharedNetworks(ConstElementPtr networks, ...@@ -360,7 +373,7 @@ AdaptorConfig::optionSharedNetworks(ConstElementPtr networks,
} }
void void
AdaptorConfig::requireClassesPools(ConstElementPtr pools) { AdaptorConfig::sanitizeRequireClassesPools(ConstElementPtr pools) {
if (!pools || pools->empty()) { if (!pools || pools->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -376,7 +389,7 @@ AdaptorConfig::requireClassesPools(ConstElementPtr pools) { ...@@ -376,7 +389,7 @@ AdaptorConfig::requireClassesPools(ConstElementPtr pools) {
} }
void void
AdaptorConfig::requireClassesSubnets(ConstElementPtr subnets) { AdaptorConfig::sanitizeRequireClassesSubnets(ConstElementPtr subnets) {
if (!subnets || subnets->empty()) { if (!subnets || subnets->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -384,10 +397,10 @@ AdaptorConfig::requireClassesSubnets(ConstElementPtr subnets) { ...@@ -384,10 +397,10 @@ AdaptorConfig::requireClassesSubnets(ConstElementPtr subnets) {
for (size_t i = 0; i < subnets->size(); ++i) { for (size_t i = 0; i < subnets->size(); ++i) {
ElementPtr subnet = subnets->getNonConst(i); ElementPtr subnet = subnets->getNonConst(i);
requireClassesPools(subnet->get("pools")); sanitizeRequireClassesPools(subnet->get("pools"));
requireClassesPools(subnet->get("pd-pools")); sanitizeRequireClassesPools(subnet->get("pd-pools"));
ConstElementPtr requires = subnet->get("require-client-classes"); ConstElementPtr requires = subnet->get("require-client-classes");
if (requires && (requires->size() == 0)) { if (requires && requires->empty()) {
subnet->remove("require-client-classes"); subnet->remove("require-client-classes");
} }
} }
...@@ -403,16 +416,16 @@ AdaptorConfig::requireClassesSharedNetworks(ConstElementPtr networks, ...@@ -403,16 +416,16 @@ AdaptorConfig::requireClassesSharedNetworks(ConstElementPtr networks,
for (size_t i = 0; i < networks->size(); ++i) { for (size_t i = 0; i < networks->size(); ++i) {
ElementPtr network = networks->getNonConst(i); ElementPtr network = networks->getNonConst(i);
requireClassesSubnets(network->get(subsel)); sanitizeRequireClassesSubnets(network->get(subsel));
ConstElementPtr requires = network->get("require-client-classes"); ConstElementPtr requires = network->get("require-client-classes");
if (requires && (requires->size() == 0)) { if (requires && requires->empty()) {
network->remove("require-client-classes"); network->remove("require-client-classes");
} }
} }
} }
void void
AdaptorConfig::hostList(ConstElementPtr hosts) { AdaptorConfig::sanitizeHostList(ConstElementPtr hosts) {
if (!hosts || hosts->empty()) { if (!hosts || hosts->empty()) {
// nothing to do here. // nothing to do here.
...@@ -426,7 +439,7 @@ AdaptorConfig::hostList(ConstElementPtr hosts) { ...@@ -426,7 +439,7 @@ AdaptorConfig::hostList(ConstElementPtr hosts) {
} }
void void
AdaptorConfig::hostSubnets(ConstElementPtr subnets) { AdaptorConfig::sanitizeHostSubnets(ConstElementPtr subnets) {
if (!subnets || subnets->empty()) { if (!subnets || subnets->empty()) {
// nothing to do here. // nothing to do here.
...@@ -434,12 +447,12 @@ AdaptorConfig::hostSubnets(ConstElementPtr subnets) { ...@@ -434,12 +447,12 @@ AdaptorConfig::hostSubnets(ConstElementPtr subnets) {
} }
for (ConstElementPtr subnet : subnets->listValue()) { for (ConstElementPtr subnet : subnets->listValue()) {
hostList(subnet->get("reservations")); sanitizeHostList(subnet->get("reservations"));
} }
} }
void void
AdaptorConfig::hostSharedNetworks(ConstElementPtr networks, AdaptorConfig::SanitizeHostsInSharedNetworks(ConstElementPtr networks,
const string& space) { const string& space) {
if (!networks || networks->empty()) { if (!networks || networks->empty()) {
// nothing to do here. // nothing to do here.
...@@ -448,15 +461,15 @@ AdaptorConfig::hostSharedNetworks(ConstElementPtr networks, ...@@ -448,15 +461,15 @@ AdaptorConfig::hostSharedNetworks(ConstElementPtr networks,
for (ConstElementPtr network : networks->listValue()) { for (ConstElementPtr network : networks->listValue()) {
if (space == DHCP4_SPACE) { if (space == DHCP4_SPACE) {
hostSubnets(network->get("subnet4")); sanitizeHostSubnets(network->get("subnet4"));
} else { } else {
hostSubnets(network->get("subnet6")); sanitizeHostSubnets(network->get("subnet6"));
} }
} }
} }
void void
AdaptorConfig::relaySubnets(ConstElementPtr subnets) { AdaptorConfig::sanitizeRelaySubnets(ConstElementPtr subnets) {
if (!subnets || subnets->empty()) { if (!subnets || subnets->empty()) {
// nothing to do here. // nothing to do here.
return; return;
...@@ -469,7 +482,7 @@ AdaptorConfig::relaySubnets(ConstElementPtr subnets) { ...@@ -469,7 +482,7 @@ AdaptorConfig::relaySubnets(ConstElementPtr subnets) {
} }
void void
AdaptorConfig::relaySharedNetworks(ConstElementPtr networks, AdaptorConfig::sanitizeRelayInSharedNetworks(ConstElementPtr networks,
const string& subsel) { const string& subsel) {
if (!networks || networks->empty()) { if (!networks || networks->empty()) {
// nothing to do here. // nothing to do here.
...@@ -479,12 +492,12 @@ AdaptorConfig::relaySharedNetworks(ConstElementPtr networks, ...@@ -479,12 +492,12 @@ AdaptorConfig::relaySharedNetworks(ConstElementPtr networks,
for (size_t i = 0; i < networks->size(); ++i) { for (size_t i = 0; i < networks->size(); ++i) {
ElementPtr network = networks->getNonConst(i); ElementPtr network = networks->getNonConst(i);
updateRelay(network); updateRelay(network);
relaySubnets(network->get(subsel)); sanitizeRelaySubnets(network->get(subsel));
} }
} }
void void
AdaptorConfig::updateDatabase(ConstElementPtr dhcp) { AdaptorConfig::sanitizeDatabase(ConstElementPtr dhcp) {
ConstElementPtr database = dhcp->get("hosts-database"); ConstElementPtr database = dhcp->get("hosts-database");
if (!database) { if (!database) {
return; return;
...@@ -498,7 +511,7 @@ AdaptorConfig::updateDatabase(ConstElementPtr dhcp) { ...@@ -498,7 +511,7 @@ AdaptorConfig::updateDatabase(ConstElementPtr dhcp) {
} }
void void
AdaptorConfig::relaySuppliedOptions(ConstElementPtr dhcp) { AdaptorConfig::sanitizeRelaySuppliedOptions(ConstElementPtr dhcp) {
ConstElementPtr options = dhcp->get("relay-supplied-options"); ConstElementPtr options = dhcp->get("relay-supplied-options");
if (!options || options->empty()) { if (!options || options->empty()) {
return; return;
...@@ -517,7 +530,7 @@ AdaptorConfig::preProcess(ElementPtr dhcp, const string& subsel, ...@@ -517,7 +530,7 @@ AdaptorConfig::preProcess(ElementPtr dhcp, const string& subsel,
SubnetIDSet set; SubnetIDSet set;
ConstElementPtr subnets = dhcp->get(subsel); ConstElementPtr subnets = dhcp->get(subsel);
if (subnets) { if (subnets) {
if (subnets->size() > 0) { if (!subnets->empty()) {
if (!subnetsCollectID(subnets, set)) { if (!subnetsCollectID(subnets, set)) {
have_ids = false; have_ids = false;
} }
...@@ -527,7 +540,7 @@ AdaptorConfig::preProcess(ElementPtr dhcp, const string& subsel, ...@@ -527,7 +540,7 @@ AdaptorConfig::preProcess(ElementPtr dhcp, const string& subsel,
} }
ConstElementPtr networks = dhcp->get("shared-networks"); ConstElementPtr networks = dhcp->get("shared-networks");
if (networks) { if (networks) {
if (networks->size() > 0) { if (!networks->empty()) {
if (!sharedNetworksCollectID(networks, set, subsel)) { if (!sharedNetworksCollectID(networks, set, subsel)) {
have_ids = false; have_ids = false;
} }
...@@ -546,55 +559,55 @@ AdaptorConfig::preProcess(ElementPtr dhcp, const string& subsel, ...@@ -546,55 +559,55 @@ AdaptorConfig::preProcess(ElementPtr dhcp, const string& subsel,
initCodes(codes, space);; initCodes(codes, space);;
ConstElementPtr defs = dhcp->get("option-def"); ConstElementPtr defs = dhcp->get("option-def");
if (defs) { if (defs) {
if (defs->size() > 0) { if (!defs->empty()) {
optionDefList(defs, space, codes); sanitizeOptionDefList(defs, space, codes);
} else { } else {
dhcp->remove("option-def"); dhcp->remove("option-def");
} }
} }
ConstElementPtr options = dhcp->get("option-data"); ConstElementPtr options = dhcp->get("option-data");
if (options) { if (options) {
if (options->size() > 0) { if (!options->empty()) {
optionDataList(options, space, codes); sanitizeOptionDataList(options, space, codes);
} else { } else {
dhcp->remove("option-data"); dhcp->remove("option-data");
} }
} }
ConstElementPtr classes = dhcp->get("client-classes"); ConstElementPtr classes = dhcp->get("client-classes");
if (classes) { if (classes) {
if (classes->size() > 0) { if (!classes->empty()) {
optionClasses(classes, space, codes); sanitizeOptionClasses(classes, space, codes);
} else { } else {
dhcp->remove("client-classes"); dhcp->remove("client-classes");
} }
} }
ConstElementPtr hosts = dhcp->get("reservations"); ConstElementPtr hosts = dhcp->get("reservations");
if (hosts) { if (hosts) {
if (hosts->size() > 0) { if (!hosts->empty()) {
optionHosts(hosts, space, codes); sanitizeOptionHosts(hosts, space, codes);
} else { } else {
dhcp->remove("reservations"); dhcp->remove("reservations");
} }
} }
optionSubnets(subnets, space, codes); sanitizeOptionSubnets(subnets, space, codes);
optionSharedNetworks(networks, space, codes); sanitizeOptionSharedNetworks(networks, space, codes);
sanitizePoolsInSubnets(subnets); sanitizePoolsInSubnets(subnets);
sanitizePoolsInSharedNetworks(networks, subsel); sanitizePoolsInSharedNetworks(networks, subsel);
hostSubnets(subnets); sanitizeHostSubnets(subnets);
hostSharedNetworks(networks, space); SanitizeHostsInSharedNetworks(networks, space);
relaySubnets(subnets); sanitizeRelaySubnets(subnets);
relaySharedNetworks(networks, subsel); sanitizeRelayInSharedNetworks(networks, subsel);
requireClassesSubnets(subnets); sanitizeRequireClassesSubnets(subnets);
requireClassesSharedNetworks(networks, subsel); requireClassesSharedNetworks(networks, subsel);
updateDatabase(dhcp); sanitizeDatabase(dhcp);
if (space == DHCP6_SPACE) { if (space == DHCP6_SPACE) {
relaySuppliedOptions(dhcp); sanitizeRelaySuppliedOptions(dhcp);
} }
} }
......
...@@ -134,21 +134,24 @@ protected: ...@@ -134,21 +134,24 @@ protected:
/// @brief Collect option definitions from an option definition list. /// @brief Collect option definitions from an option definition list.
/// ///
/// Collects options definitions, but also sets missing option space
/// with default.
///
/// @param defs The option definition list. /// @param defs The option definition list.
/// @param space The default space name. /// @param space The default space name (missing will be filled with this)
/// @param codes Option definitions. /// @param codes Option definitions.
static void optionDefList(isc::data::ConstElementPtr defs, static void sanitizeOptionDefList(isc::data::ConstElementPtr defs,
const std::string& space, const std::string& space,
OptionCodes& codes); OptionCodes& codes);
/// @brief Set missing option codes to an option data list. /// @brief Set missing option codes to an option data list.
/// ///
/// @param options The option data list. /// @param options The option data list.
/// @param space The default space name. /// @param space The default space name.
/// @param codes Option definitions. /// @param codes Option definitions.
static void optionDataList(isc::data::ConstElementPtr options, static void sanitizeOptionDataList(isc::data::ConstElementPtr options,
const std::string& space, const std::string& space,
const OptionCodes& codes); const OptionCodes& codes);
/// @brief Collect option definitions from a client class list /// @brief Collect option definitions from a client class list
/// and set missing option codes. /// and set missing option codes.
...@@ -156,59 +159,59 @@ protected: ...@@ -156,59 +159,59 @@ protected:
/// @param classes The client class list. /// @param classes The client class list.
/// @param space The default space name. /// @param space The default space name.
/// @param codes Option definitions. /// @param codes Option definitions.
static void optionClasses(isc::data::ConstElementPtr classes, static void sanitizeOptionClasses(isc::data::ConstElementPtr classes,
const std::string& space, const std::string& space,
OptionCodes& codes); OptionCodes& codes);
/// @brief Set missing option codes to a pool list. /// @brief Set missing option codes to a pool list.
/// ///
/// @param pools The pool list. /// @param pools The pool list.
/// @param space The default space name. /// @param space The default space name.
/// @param codes Option definitions. /// @param codes Option definitions.
static void optionPools(isc::data::ConstElementPtr pools, static void sanitizeOptionPools(isc::data::ConstElementPtr pools,
const std::string& space, const std::string& space,
const OptionCodes& codes); const OptionCodes& codes);
/// @brief Set missing option codes to a host reservation list. /// @brief Set missing option codes to a host reservation list.
/// ///
/// @param hosts The host reservation list. /// @param hosts The host reservation list.
/// @param space The default space name. /// @param space The default space name.
/// @param codes Option definitions. /// @param codes Option definitions.
static void optionHosts(isc::data::ConstElementPtr hosts, static void sanitizeOptionHosts(isc::data::ConstElementPtr hosts,
const std::string& space, const std::string& space,
const OptionCodes& codes); const OptionCodes& codes);
/// @brief Set missing option codes to a subnet list. /// @brief Set missing option codes to a subnet list.
/// ///
/// @param subnets The subnet list. /// @param subnets The subnet list.
/// @param space The default space name. /// @param space The default space name.
/// @param codes Option definitions. /// @param codes Option definitions.
static void optionSubnets(isc::data::ConstElementPtr subnets, static void sanitizeOptionSubnets(isc::data::ConstElementPtr subnets,
const std::string& space, const std::string& space,
const OptionCodes& codes); const OptionCodes& codes);
/// @brief Set missing option codes to a shared network list. /// @brief Set missing option codes to a shared network list.
/// ///
/// @param networks The shared network list. /// @param networks The shared network list.
/// @param space The default space name. /// @param space The default space name.
/// @param codes Option definitions. /// @param codes Option definitions.
static void optionSharedNetworks(isc::data::ConstElementPtr networks, static void sanitizeOptionSharedNetworks(isc::data::ConstElementPtr networks,
const std::string&