Commit 200a1b96 authored by Tomek Mrugalski's avatar Tomek Mrugalski 🛰
Browse files

[3464] PoolsListParser logic improved

parent eef93810
......@@ -401,6 +401,12 @@ temporarily override a list of interface names and listen on all interfaces.
in square brackets, even though only one range of addresses is
specified in this example.</para>
<para>Each <command>pool</command> is a structure that describes
the pool parameters. Currently there is only one parameter,
<command>pool</command>, which gives the range of addresses
in the pool. Additional parameters will be added in future
releases of Kea.</para>
<para>It is possible to define more than one pool in a subnet: continuing
the previous example, further assume that 192.0.2.64/26 should be also be
managed by the server. It could be written as 192.0.2.64 to
......
......@@ -962,13 +962,19 @@ PoolsListParser::build(ConstElementPtr pools) {
parser->build(pool);
// Before we can create a pool, we need to ask the pool parser
// to create it.
parser->commit();
// Let's store the parser, but do not commit anything yet
parsers_.push_back(parser);
}
}
void PoolsListParser::commit() {
// Commit each parser first. It will store the pool structure
// in pools_.
BOOST_FOREACH(ParserPtr parser, parsers_) {
parser->commit();
}
if (pools_) {
// local_pools_ holds the values produced by the build function.
// At this point parsing should have completed successfuly so
......
......@@ -902,6 +902,9 @@ protected:
/// A temporary storage for pools configuration. It is the
/// storage where pools are stored by the build function.
PoolStoragePtr local_pools_;
/// Collection of parsers;
ParserCollection parsers_;
};
/// @brief parser for additional relay information
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment