]> git.ipfire.org Git - thirdparty/kea.git/commitdiff
[3171] Changes after review:
authorTomek Mrugalski <tomasz@isc.org>
Thu, 3 Oct 2013 14:14:36 +0000 (16:14 +0200)
committerTomek Mrugalski <tomasz@isc.org>
Thu, 3 Oct 2013 14:14:36 +0000 (16:14 +0200)
 - non-const getPools() renamed to getPoolsWritable()
 - docs update

src/lib/dhcpsrv/libdhcpsrv.dox
src/lib/dhcpsrv/subnet.cc
src/lib/dhcpsrv/subnet.h

index a5d29fc51fe43de3d8d0206f81a021124ddc10bc..d56029a9c478e41594e1e87f2facdc6f9cc62e31 100644 (file)
@@ -99,14 +99,16 @@ returning clients are almost guaranteed to get a different address. Another
 drawback is that with almost depleted pools it is increasingly difficult to
 "guess" an address that is free. This allocator is currently not implemented.
 
-@subsection allocEnginePD Prefix Delegation support in AllocEngine
+@subsection allocEngineTypes Different lease types support
 
 Allocation Engine has been extended to support different types of leases. Four
 types are supported: TYPE_V4 (IPv4 addresses), TYPE_NA (normal IPv6 addresses),
 TYPE_TA (temporary IPv6 addresses) and TYPE_PD (delegated prefixes). Support for
 TYPE_TA is partial. Some routines are able to handle it, while other are
 not. The major missing piece is the RandomAllocator, so there is no way to randomly
-generate an address. This defeats the purpose of using temporary addresses.
+generate an address. This defeats the purpose of using temporary addresses for now.
+
+@subsection allocEnginePD Prefix Delegation support in AllocEngine
 
 The Allocation Engine supports allocation of the IPv6 addresses and prefixes.
 For a prefix pool, the iterative allocator "walks over"
index 8e5190677ffea87d69aae3518cf56a564bea7ec5..432073343472f302aff875aebeda774851eeb578 100644 (file)
@@ -169,7 +169,7 @@ const PoolCollection& Subnet::getPools(Lease::Type type) const {
     }
 }
 
-PoolCollection& Subnet::getPools(Lease::Type type) {
+PoolCollection& Subnet::getPoolsWritable(Lease::Type type) {
     // check if the type is valid (and throw if it isn't)
     checkType(type);
 
@@ -230,12 +230,12 @@ Subnet::addPool(const PoolPtr& pool) {
     checkType(pool->getType());
 
     // Add the pool to the appropriate pools collection
-    getPools(pool->getType()).push_back(pool);
+    getPoolsWritable(pool->getType()).push_back(pool);
 }
 
 void
 Subnet::delPools(Lease::Type type) {
-    getPools(type).clear();
+    getPoolsWritable(type).clear();
 }
 
 void
index 23548347c092aa7e8960fda0a79cc37115488e8d..ac6de0332dd5f56ccec62d871a6b62161865414c 100644 (file)
@@ -319,14 +319,6 @@ public:
     /// @return a collection of all pools
     const PoolCollection& getPools(Lease::Type type) const;
 
-    /// @brief Returns all pools (variable variant)
-    ///
-    /// The reference is only valid as long as the object that returned it.
-    ///
-    /// @param type lease type to be set
-    /// @return a collection of all pools
-    PoolCollection& getPools(Lease::Type type);
-
     /// @brief Sets name of the network interface for directly attached networks
     ///
     /// @param iface_name name of the interface
@@ -344,6 +336,14 @@ public:
     virtual std::string toText() const;
 
 protected:
+    /// @brief Returns all pools (non-const variant)
+    ///
+    /// The reference is only valid as long as the object that returned it.
+    ///
+    /// @param type lease type to be set
+    /// @return a collection of all pools
+    PoolCollection& getPoolsWritable(Lease::Type type);
+
     /// @brief Protected constructor
     //
     /// By making the constructor protected, we make sure that noone will