BIND 10 trac1238, updated. 0b6937d0e075e1192c41891ae138532f2c733b47 [1238] IfaceMgr::openSocket() is now public method.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Nov 9 12:28:29 UTC 2011
The branch, trac1238 has been updated
via 0b6937d0e075e1192c41891ae138532f2c733b47 (commit)
from 5371b694b6cc564c3f1899a935769dd024f38e56 (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 0b6937d0e075e1192c41891ae138532f2c733b47
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Tue Nov 8 18:57:52 2011 +0100
[1238] IfaceMgr::openSocket() is now public method.
-----------------------------------------------------------------------
Summary of changes:
src/bin/dhcp6/iface_mgr.cc | 2 +-
src/bin/dhcp6/iface_mgr.h | 28 +++++++++++++++-------------
src/bin/dhcp6/tests/iface_mgr_unittest.cc | 6 ------
3 files changed, 16 insertions(+), 20 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/dhcp6/iface_mgr.cc b/src/bin/dhcp6/iface_mgr.cc
index 22511d3..fc370eb 100644
--- a/src/bin/dhcp6/iface_mgr.cc
+++ b/src/bin/dhcp6/iface_mgr.cc
@@ -229,7 +229,7 @@ IfaceMgr::getIface(const std::string& ifname) {
return (NULL); // not found
}
-int
+uint16_t
IfaceMgr::openSocket(const std::string& ifname,
const IOAddress& addr,
int port) {
diff --git a/src/bin/dhcp6/iface_mgr.h b/src/bin/dhcp6/iface_mgr.h
index f501b9a..2c306ef 100644
--- a/src/bin/dhcp6/iface_mgr.h
+++ b/src/bin/dhcp6/iface_mgr.h
@@ -161,6 +161,21 @@ public:
boost::shared_ptr<Pkt4> receive4();
+ ///
+ /// Opens UDP/IP socket and binds it to address, interface and port.
+ ///
+ /// Specific type of socket (UDP/IPv4 or UDP/IPv6) depends on passed addr
+ /// family.
+ ///
+ /// @param ifname name of the interface
+ /// @param addr address to be bound.
+ /// @param port UDP port.
+ ///
+ /// @return socket descriptor, if socket creation, binding and multicast
+ /// group join were all successful. -1 otherwise.
+ uint16_t openSocket(const std::string& ifname,
+ const isc::asiolink::IOAddress& addr, int port);
+
/// Opens sockets on detected interfaces.
void openSockets();
@@ -191,19 +206,6 @@ protected:
void
detectIfaces();
- ///
- /// Opens UDP/IP socket and binds it to address, interface and port.
- ///
- /// @param ifname name of the interface
- /// @param addr address to be bound.
- /// @param port UDP port.
- ///
- /// @return socket descriptor, if socket creation, binding and multicast
- /// group join were all successful. -1 otherwise.
- int openSocket(const std::string& ifname,
- const isc::asiolink::IOAddress& addr,
- int port);
-
// TODO: having 2 maps (ifindex->iface and ifname->iface would)
// probably be better for performance reasons
diff --git a/src/bin/dhcp6/tests/iface_mgr_unittest.cc b/src/bin/dhcp6/tests/iface_mgr_unittest.cc
index 80c07c0..d77532a 100644
--- a/src/bin/dhcp6/tests/iface_mgr_unittest.cc
+++ b/src/bin/dhcp6/tests/iface_mgr_unittest.cc
@@ -42,12 +42,6 @@ public:
IfaceCollection & getIfacesLst() { return ifaces_; }
void setSendSock(int sock) { sendsock_ = sock; }
void setRecvSock(int sock) { recvsock_ = sock; }
-
- int openSocket(const std::string& ifname,
- const isc::asiolink::IOAddress& addr,
- int port) {
- return IfaceMgr::openSocket(ifname, addr, port);
- }
};
// dummy class for now, but this will be expanded when needed
More information about the bind10-changes
mailing list