mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-31 14:05:33 +00:00
[3464] DHCPv4 parsers updated, fix in common parsers.
This commit is contained in:
@@ -152,6 +152,18 @@ protected:
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
class Pools4ListParser : public PoolsListParser {
|
||||||
|
public:
|
||||||
|
Pools4ListParser(const std::string& dummy, PoolStoragePtr pools)
|
||||||
|
:PoolsListParser(dummy, pools) {
|
||||||
|
}
|
||||||
|
|
||||||
|
protected:
|
||||||
|
virtual ParserPtr poolParserMaker(PoolStoragePtr storage) {
|
||||||
|
return (ParserPtr(new Pool4Parser("pool", storage)));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
/// @brief This class parses a single IPv4 subnet.
|
/// @brief This class parses a single IPv4 subnet.
|
||||||
///
|
///
|
||||||
/// This is the IPv4 derivation of the SubnetConfigParser class and it parses
|
/// This is the IPv4 derivation of the SubnetConfigParser class and it parses
|
||||||
@@ -227,8 +239,8 @@ protected:
|
|||||||
(config_id.compare("client-class") == 0) ||
|
(config_id.compare("client-class") == 0) ||
|
||||||
(config_id.compare("next-server") == 0)) {
|
(config_id.compare("next-server") == 0)) {
|
||||||
parser = new StringParser(config_id, string_values_);
|
parser = new StringParser(config_id, string_values_);
|
||||||
} else if (config_id.compare("pool") == 0) {
|
} else if (config_id.compare("pools") == 0) {
|
||||||
parser = new Pool4Parser(config_id, pools_);
|
parser = new Pools4ListParser(config_id, pools_);
|
||||||
} else if (config_id.compare("relay") == 0) {
|
} else if (config_id.compare("relay") == 0) {
|
||||||
parser = new RelayInfoParser(config_id, relay_info_, Option::V4);
|
parser = new RelayInfoParser(config_id, relay_info_, Option::V4);
|
||||||
} else if (config_id.compare("option-data") == 0) {
|
} else if (config_id.compare("option-data") == 0) {
|
||||||
|
@@ -992,6 +992,11 @@ PoolParser::build(ConstElementPtr pool_structure) {
|
|||||||
|
|
||||||
ConstElementPtr text_pool = pool_structure->get("pool");
|
ConstElementPtr text_pool = pool_structure->get("pool");
|
||||||
|
|
||||||
|
if (!text_pool) {
|
||||||
|
isc_throw(DhcpConfigError, "Mandatory 'pool' entry missing in "
|
||||||
|
"definition: (" << text_pool->getPosition() << ")");
|
||||||
|
}
|
||||||
|
|
||||||
// That should be a single pool representation. It should contain
|
// That should be a single pool representation. It should contain
|
||||||
// text is form prefix/len or first - last. Note that spaces
|
// text is form prefix/len or first - last. Note that spaces
|
||||||
// are allowed
|
// are allowed
|
||||||
|
Reference in New Issue
Block a user