BIND 10 trac2324, updated. 7e2dedc024cd77a301d7e30d180e16fa2132cbf5 [2324] Changes after review (including compilation fixes for Sol, Fedora and Mac OS)
BIND 10 source code commits
bind10-changes at lists.isc.org
Mon Oct 29 11:02:49 UTC 2012
The branch, trac2324 has been updated
via 7e2dedc024cd77a301d7e30d180e16fa2132cbf5 (commit)
from 8aa188a10298e3a55b725db36502a99d2a8d638a (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 7e2dedc024cd77a301d7e30d180e16fa2132cbf5
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Mon Oct 29 12:02:24 2012 +0100
[2324] Changes after review (including compilation fixes for Sol, Fedora and Mac OS)
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 7 +++++++
src/lib/dhcp/alloc_engine.h | 4 ++++
src/lib/dhcp/lease_mgr.h | 4 ++--
src/lib/dhcp/tests/alloc_engine_unittest.cc | 6 +++++-
src/lib/dhcp/tests/memfile_lease_mgr.cc | 4 ++--
src/lib/dhcp/tests/memfile_lease_mgr.h | 8 ++++----
6 files changed, 24 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 9e76a18..6ec7aec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+4XX. [func] tomek
+ DHCPv6 Allocation Engine implemented. It allows address allocation
+ from the configured subnets/pools. It currently features a single
+ allocator: IterativeAllocator, which assigns addresses iteratively.
+ Other allocators (hashed, random) are planned.
+ (Trac #2324, git TBD)
+
494. [bug] jinmei
Fixed a problem that shutting down BIND 10 kept some of the
processes alive. It was two-fold: when the main bind10 process
diff --git a/src/lib/dhcp/alloc_engine.h b/src/lib/dhcp/alloc_engine.h
index 74e30dd..496703a 100644
--- a/src/lib/dhcp/alloc_engine.h
+++ b/src/lib/dhcp/alloc_engine.h
@@ -67,6 +67,10 @@ protected:
virtual isc::asiolink::IOAddress
pickAddress(const Subnet6Ptr& subnet, const DuidPtr& duid,
const isc::asiolink::IOAddress& hint) = 0;
+
+ /// @brief virtual destructor
+ virtual ~Allocator() {
+ }
protected:
};
diff --git a/src/lib/dhcp/lease_mgr.h b/src/lib/dhcp/lease_mgr.h
index 7541a15..e859dea 100644
--- a/src/lib/dhcp/lease_mgr.h
+++ b/src/lib/dhcp/lease_mgr.h
@@ -398,7 +398,7 @@ public:
/// @param addr address of the searched lease
///
/// @return smart pointer to the lease (or NULL if a lease is not found)
- virtual Lease6Ptr getLease6(isc::asiolink::IOAddress addr) const = 0;
+ virtual Lease6Ptr getLease6(const isc::asiolink::IOAddress& addr) const = 0;
/// @brief Returns existing IPv6 leases for a given DUID+IA combination
///
@@ -450,7 +450,7 @@ public:
/// @param addr IPv4 address of the lease to be deleted.
///
/// @return true if deletion was successful, false if no such lease exists
- virtual bool deleteLease6(isc::asiolink::IOAddress addr) = 0;
+ virtual bool deleteLease6(const isc::asiolink::IOAddress& addr) = 0;
/// @brief Returns backend name.
///
diff --git a/src/lib/dhcp/tests/alloc_engine_unittest.cc b/src/lib/dhcp/tests/alloc_engine_unittest.cc
index b50a2c5..bbb4bbd 100644
--- a/src/lib/dhcp/tests/alloc_engine_unittest.cc
+++ b/src/lib/dhcp/tests/alloc_engine_unittest.cc
@@ -22,6 +22,7 @@
#include <boost/shared_ptr.hpp>
#include <iostream>
#include <sstream>
+#include <map>
#include <gtest/gtest.h>
using namespace std;
@@ -35,6 +36,9 @@ namespace {
class NakedAllocEngine : public AllocEngine {
public:
+ NakedAllocEngine(AllocEngine::AllocType engine_type, unsigned int attempts)
+ :AllocEngine(engine_type, attempts) {
+ }
using AllocEngine::Allocator;
using AllocEngine::IterativeAllocator;
};
@@ -308,7 +312,7 @@ TEST_F(AllocEngineTest, IterativeAllocator_manyPools) {
// there are 8 extra pools with 9 addresses in each.
// Let's keep picked addresses here and check their uniqueness.
- map<IOAddress, int> generated_addrs;
+ std::map<IOAddress, int> generated_addrs;
int cnt = 0;
while (++cnt) {
IOAddress candidate = alloc->pickAddress(subnet_, duid_, IOAddress("::"));
diff --git a/src/lib/dhcp/tests/memfile_lease_mgr.cc b/src/lib/dhcp/tests/memfile_lease_mgr.cc
index ac3316d..195fd8b 100644
--- a/src/lib/dhcp/tests/memfile_lease_mgr.cc
+++ b/src/lib/dhcp/tests/memfile_lease_mgr.cc
@@ -65,7 +65,7 @@ Lease4Collection Memfile_LeaseMgr::getLease4(const ClientId& ) const {
return (Lease4Collection());
}
-Lease6Ptr Memfile_LeaseMgr::getLease6(isc::asiolink::IOAddress addr) const {
+Lease6Ptr Memfile_LeaseMgr::getLease6(const isc::asiolink::IOAddress& addr) const {
Lease6Storage::iterator l = storage6_.find(addr);
if (l == storage6_.end()) {
return (Lease6Ptr());
@@ -95,7 +95,7 @@ bool Memfile_LeaseMgr::deleteLease4(uint32_t ) {
return (false);
}
-bool Memfile_LeaseMgr::deleteLease6(isc::asiolink::IOAddress addr) {
+bool Memfile_LeaseMgr::deleteLease6(const isc::asiolink::IOAddress& addr) {
Lease6Storage::iterator l = storage6_.find(addr);
if (l == storage6_.end()) {
// no such lease
diff --git a/src/lib/dhcp/tests/memfile_lease_mgr.h b/src/lib/dhcp/tests/memfile_lease_mgr.h
index 666db6a..c5a41e6 100644
--- a/src/lib/dhcp/tests/memfile_lease_mgr.h
+++ b/src/lib/dhcp/tests/memfile_lease_mgr.h
@@ -132,7 +132,7 @@ public:
/// @param addr address of the searched lease
///
/// @return smart pointer to the lease (or NULL if a lease is not found)
- Lease6Ptr getLease6(isc::asiolink::IOAddress addr) const;
+ Lease6Ptr getLease6(const isc::asiolink::IOAddress& addr) const;
/// @brief Returns existing IPv6 lease for a given DUID+IA combination
///
@@ -187,12 +187,12 @@ public:
/// @param addr IPv4 address of the lease to be deleted.
///
/// @return true if deletion was successful, false if no such lease exists
- bool deleteLease6(isc::asiolink::IOAddress addr);
+ bool deleteLease6(const isc::asiolink::IOAddress& addr);
/// @brief Returns backend name.
///
/// Each backend have specific name, e.g. "mysql" or "sqlite".
- std::string getName() const { return "memfile"; }
+ std::string getName() const { return ("memfile"); }
/// @brief Returns description of the backend.
///
@@ -200,7 +200,7 @@ public:
std::string getDescription() const;
/// @brief Returns backend version.
- std::string getVersion() const { return "test-version"; }
+ std::string getVersion() const { return ("test-version"); }
using LeaseMgr::getParameter;
More information about the bind10-changes
mailing list