2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-08-31 05:55:28 +00:00

[#1790] add support for top level maps in global CB parameters

This commit is contained in:
Razvan Becheriu
2024-01-17 18:52:05 +02:00
parent 4d04d9169b
commit a48e9ee568
26 changed files with 376 additions and 106 deletions

View File

@@ -459,7 +459,7 @@ processDhcp4Config(isc::data::ConstElementPtr config_set) {
if (expiration_cfg) {
parameter_name = "expired-leases-processing";
ExpirationConfigParser parser;
parser.parse(expiration_cfg);
parser.parse(expiration_cfg, CfgMgr::instance().getStagingCfg()->getCfgExpiration());
}
// The hooks-libraries configuration must be parsed after parsing
@@ -577,32 +577,8 @@ processDhcp4Config(isc::data::ConstElementPtr config_set) {
ConstElementPtr compatibility = mutable_cfg->get("compatibility");
if (compatibility) {
for (auto const& kv : compatibility->mapValue()) {
if (!kv.second || (kv.second->getType() != Element::boolean)) {
isc_throw(DhcpConfigError,
"compatibility parameter values must be "
<< "boolean (" << kv.first << " at "
<< kv.second->getPosition() << ")");
}
if (kv.first == "lenient-option-parsing") {
CfgMgr::instance().getStagingCfg()->setLenientOptionParsing(
kv.second->boolValue());
} else if (kv.first == "ignore-dhcp-server-identifier") {
CfgMgr::instance().getStagingCfg()->setIgnoreServerIdentifier(
kv.second->boolValue());
} else if (kv.first == "ignore-rai-link-selection") {
CfgMgr::instance().getStagingCfg()->setIgnoreRAILinkSelection(
kv.second->boolValue());
} else if (kv.first == "exclude-first-last-24") {
CfgMgr::instance().getStagingCfg()->setExcludeFirstLast24(
kv.second->boolValue());
} else {
isc_throw(DhcpConfigError,
"unsupported compatibility parameter: "
<< kv.first << " (" << kv.second->getPosition()
<< ")");
}
}
CompatibilityParser parser;
parser.parse(compatibility, *CfgMgr::instance().getStagingCfg());
}
// Make parsers grouping.