2
0
mirror of https://gitlab.isc.org/isc-projects/kea synced 2025-09-03 15:35:17 +00:00

[5357] Parser for shared-networks in DHCPv6 implemented.

This commit is contained in:
Tomek Mrugalski
2017-09-13 10:38:27 +02:00
parent b9c54a65ae
commit a5abebaa0f
6 changed files with 521 additions and 18 deletions

View File

@@ -89,7 +89,6 @@ public:
cfg->setDhcp4o6Port(dhcp4o6_port);
}
/// @brief Copies subnets from shared networks to regular subnets container
///
/// @param from pointer to shared networks container (copy from here)
@@ -156,6 +155,13 @@ public:
sharedNetworksSanityChecks(const SharedNetwork4Collection& networks,
ConstElementPtr json) {
/// @todo: in case of errors, use json to extract line numbers.
if (!json) {
// No json? That means that the shared-networks was never specified
// in the config.
return;
}
// Used for names uniqueness checks.
std::set<string> names;
@@ -315,6 +321,8 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set,
parser.parse(cfg_option_def, option_defs);
}
// This parser is used in several places, so it should be available
// early.
Dhcp4ConfigParser global_parser;
// Make parsers grouping.
@@ -427,9 +435,10 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set,
/// as well.
SharedNetworks4ListParser parser;
CfgSharedNetworks4Ptr cfg = srv_cfg->getCfgSharedNetworks4();
parser.parse(cfg, config_pair.second);
// We also need to put the subnets it contains into normal
// subnets list.
global_parser.copySubnets4(srv_cfg->getCfgSubnets4(), cfg);
continue;
}