]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3464] PoolsListParser logic improved
authorTomek Mrugalski <tomasz@isc.org>
Fri, 8 Aug 2014 15:09:04 +0000 (17:09 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Fri, 8 Aug 2014 15:09:04 +0000 (17:09 +0200)
doc/guide/dhcp4-srv.xml
src/lib/dhcpsrv/dhcp_parsers.cc
src/lib/dhcpsrv/dhcp_parsers.h

index 89ada06ba18bf22c394204bf75fd5ab8d1a6997b..1ae77b43ad0622b4860272f0346d7f4113225bfc 100644 (file)
@@ -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
index 38dc96002b707ffd41fec18bfb89be414c3fda23..bc0e61fab77acdd38998e2abc9bf631ede70e5cd 100644 (file)
@@ -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
index 453a589b440ec889b0e699b22b0a5f31ce4d13f3..b9a0ca234416c449177d08a496051d08cd97cd66 100644 (file)
@@ -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