}
} catch (...) {
ConstElementPtr next = params->get("next-server");
- string pos("(missing)");
+ string pos;
if (next)
pos = next->getPosition().str();
+ else
+ pos = params->getPosition().str();
isc_throw(DhcpConfigError, "invalid parameter next-server : "
<< next_server << "(" << pos << ")");
}
size_t slash = subnet4o6.find("/");
if (slash == std::string::npos) {
isc_throw(DhcpConfigError, "Missing / in the 4o6-subnet parameter:"
- + subnet4o6 +", expected format: prefix6/length");
+ << subnet4o6 << ", expected format: prefix6/length");
}
string prefix = subnet4o6.substr(0, slash);
string lenstr = subnet4o6.substr(slash + 1);
len = boost::lexical_cast<unsigned int>(lenstr.c_str());
} catch (const boost::bad_lexical_cast &) {
isc_throw(DhcpConfigError, "Invalid prefix length specified in "
- "4o6-subnet parameter: " + subnet4o6 + ", expected 0..128 value");
+ "4o6-subnet parameter: " << subnet4o6 << ", expected 0..128 value");
}
subnet4->get4o6().setSubnet4o6(IOAddress(prefix), len);
subnet4->get4o6().enabled(true);
subnet4->get4o6().enabled(true);
}
- // client-class processing is now generic so in DhcpConfigParser
+ /// client-class processing is now generic and handled in the common
+ /// code (see @ref isc::data::SubnetConfigParser::createSubnet)
}
};
// SimpleParser6::setAllDefaults.
SubnetID subnet_id = static_cast<SubnetID>(getInteger(params, "id"));
+ // We want to log whether rapid-commit is enabled, so we get this
+ // before the actual subnet creation.
bool rapid_commit = getBoolean(params, "rapid-commit");
std::ostringstream output;
// Create a new subnet.
Subnet6* subnet6 = new Subnet6(addr, len, t1, t2, pref, valid,
subnet_id);
+ subnet_.reset(subnet6);
+
+ // Enable or disable Rapid Commit option support for the subnet.
+ subnet6->setRapidCommit(rapid_commit);
// Get interface-id option content. For now we support string
// representation only
"parser error: interface (defined for locally reachable "
"subnets) and interface-id (defined for subnets reachable"
" via relays) cannot be defined at the same time for "
- "subnet " << addr << "/" << (int)len);
+ "subnet " << addr << "/" << (int)len << "("
+ << params->getPosition() << ")");
}
// Configure interface-id for remote interfaces, if defined
subnet6->setInterfaceId(opt);
}
- // Enable or disable Rapid Commit option support for the subnet.
- subnet6->setRapidCommit(rapid_commit);
-
- // client-class processing is now generic so in DhcpConfigParser
-
- subnet_.reset(subnet6);
+ /// client-class processing is now generic and handled in the common
+ /// code (see @ref isc::data::SubnetConfigParser::createSubnet)
}
};
namespace isc {
namespace dhcp {
-/// @brief creates global parsers
-///
-/// This method creates global parsers that parse global parameters, i.e.
-/// those that take format of Dhcp6/param1, Dhcp6/param2 and so forth.
-///
-/// @param config_id pointer to received global configuration entry
-/// @param element pointer to the element to be parsed
-/// @return parser for specified global DHCPv6 parameter
-/// @throw NotImplemented if trying to create a parser for unknown config
-/// element
-DhcpConfigParser* createGlobal6DhcpConfigParser(const std::string& config_id,
- ConstElementPtr element) {
- DhcpConfigParser* parser = NULL;
- // preferred-lifetime, valid-lifetime, renew-timer, rebind-timer,
- // decline-probation-period and dhcp4o6-port are now migrated to
- // SimpleParser.
- // subnet6 has been converted to SimpleParser.
- // option-data and option-def are no longer needed here. They're now
- // converted to SimpleParser and are handled in configureDhcp6Server.
- // interfaces-config has been converted to SimpleParser.
- // version was removed - it was a leftover from bindctrl.
-
- // lease-database migrated
- // hosts-database migrated
-
- // hooks-libraries is now converted to SimpleParser.
- // lease-database and hosts-database have been converted to SimpleParser already.
- // mac-source has been converted to SimpleParser.
- // dhcp-ddns has been converted to SimpleParser
- // rsoo has been converted to SimpleParser.
- // control-socket has been converted to SimpleParser.
- // expired-leases-processing has been converted to SimpleParser.
- // client-classes has been converted to SimpleParser.
- // host-reservation-identifiers have been converted to SimpleParser already.
- // server-id has been migrated to SimpleParser
- {
- isc_throw(DhcpConfigError,
- "unsupported global configuration parameter: "
- << config_id << " (" << element->getPosition() << ")");
- }
-
- return (parser);
-}
-
/// @brief Initialize the command channel based on the staging configuration
///
/// Only close the current channel, if the new channel configuration is