From: Tomek Mrugalski Date: Thu, 3 Oct 2013 14:14:36 +0000 (+0200) Subject: [3171] Changes after review: X-Git-Tag: bind10-1.2.0beta1-release~192^2~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=15c8b6ac63fd8f81b085fec8a0fd6d22085ea898;p=thirdparty%2Fkea.git [3171] Changes after review: - non-const getPools() renamed to getPoolsWritable() - docs update --- diff --git a/src/lib/dhcpsrv/libdhcpsrv.dox b/src/lib/dhcpsrv/libdhcpsrv.dox index a5d29fc51f..d56029a9c4 100644 --- a/src/lib/dhcpsrv/libdhcpsrv.dox +++ b/src/lib/dhcpsrv/libdhcpsrv.dox @@ -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" diff --git a/src/lib/dhcpsrv/subnet.cc b/src/lib/dhcpsrv/subnet.cc index 8e5190677f..4320733434 100644 --- a/src/lib/dhcpsrv/subnet.cc +++ b/src/lib/dhcpsrv/subnet.cc @@ -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 diff --git a/src/lib/dhcpsrv/subnet.h b/src/lib/dhcpsrv/subnet.h index 23548347c0..ac6de0332d 100644 --- a/src/lib/dhcpsrv/subnet.h +++ b/src/lib/dhcpsrv/subnet.h @@ -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