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

[3747] Renamed parameter record-client-id to match-client-id.

Also fixed a couple of failing unit tests.
This commit is contained in:
Marcin Siodelski
2015-05-13 19:41:48 +02:00
parent fa00f7c6fd
commit d21a9b2bd6
12 changed files with 70 additions and 114 deletions

View File

@@ -194,7 +194,7 @@ protected:
parser = new RelayInfoParser(config_id, relay_info_, Option::V4);
} else if (config_id.compare("option-data") == 0) {
parser = new OptionDataListParser(config_id, options_, AF_INET);
} else if (config_id.compare("record-client-id") == 0) {
} else if (config_id.compare("match-client-id") == 0) {
parser = new BooleanParser(config_id, boolean_values_);
} else {
isc_throw(NotImplemented, "unsupported parameter: " << config_id);
@@ -252,26 +252,26 @@ protected:
Subnet4Ptr subnet4(new Subnet4(addr, len, t1, t2, valid, subnet_id));
subnet_ = subnet4;
// record-client-id
isc::util::OptionalValue<bool> record_client_id;
// match-client-id
isc::util::OptionalValue<bool> match_client_id;
try {
record_client_id = boolean_values_->getParam("record-client-id");
match_client_id = boolean_values_->getParam("match-client-id");
} catch (...) {
// Ignore because this parameter is optional and it may be specified
// in the global scope.
}
// If the record-client-id wasn't specified as a subnet specific parameter
// If the match-client-id wasn't specified as a subnet specific parameter
// check if there is global value specified.
if (!record_client_id.isSpecified()) {
if (!match_client_id.isSpecified()) {
// If not specified, use false.
record_client_id.specify(globalContext()->boolean_values_->
getOptionalParam("record-client-id", true));
match_client_id.specify(globalContext()->boolean_values_->
getOptionalParam("match-client-id", true));
}
// Set the record-client-id value for the subnet.
subnet4->setRecordClientId(record_client_id.get());
// Set the match-client-id value for the subnet.
subnet4->setMatchClientId(match_client_id.get());
// next-server
try {
@@ -397,7 +397,7 @@ namespace dhcp {
parser = new BooleanParser(config_id, globalContext()->boolean_values_);
} else if (config_id.compare("dhcp-ddns") == 0) {
parser = new D2ClientConfigParser(config_id);
} else if (config_id.compare("record-client-id") == 0) {
} else if (config_id.compare("match-client-id") == 0) {
parser = new BooleanParser(config_id, globalContext()->boolean_values_);
} else {
isc_throw(DhcpConfigError,
@@ -433,6 +433,9 @@ configureDhcp4Server(Dhcpv4Srv&, isc::data::ConstElementPtr config_set) {
LOG_DEBUG(dhcp4_logger, DBG_DHCP4_COMMAND,
DHCP4_CONFIG_START).arg(config_set->str());
// Reset global context.
globalContext().reset(new ParserContext(Option::V4));
// Before starting any subnet operations, let's reset the subnet-id counter,
// so newly recreated configuration starts with first subnet-id equal 1.
Subnet::resetSubnetID();