BIND 10 trac2187, updated. 02dd6ed0dd458e7627e06bcab6a5168354e929d6 [2187] Improve doxygen comments.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 26 10:50:45 UTC 2012
The branch, trac2187 has been updated
via 02dd6ed0dd458e7627e06bcab6a5168354e929d6 (commit)
via bbf34f3ba16d91fabcfa53a5b989e999d9c19875 (commit)
via 237def8395cbe9f2d1193e804443c403294b8c6f (commit)
from 1a7e6f8b2d18a98bfac5f4a47f55f8f288e4d0ab (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 02dd6ed0dd458e7627e06bcab6a5168354e929d6
Author: Marcin Siodelski <marcin at isc.org>
Date: Wed Sep 26 12:49:27 2012 +0200
[2187] Improve doxygen comments.
commit bbf34f3ba16d91fabcfa53a5b989e999d9c19875
Author: Marcin Siodelski <marcin at isc.org>
Date: Wed Sep 26 12:38:23 2012 +0200
[2187] Catch exceptions in perfdhcp if packet reception failed.
commit 237def8395cbe9f2d1193e804443c403294b8c6f
Author: Marcin Siodelski <marcin at isc.org>
Date: Wed Sep 26 12:09:25 2012 +0200
[2187] Fixed typos.
-----------------------------------------------------------------------
Summary of changes:
src/bin/dhcp4/dhcp4_messages.mes | 2 +-
src/bin/dhcp4/dhcp4_srv.cc | 4 ++--
src/bin/dhcp6/dhcp6_messages.mes | 2 +-
src/bin/dhcp6/dhcp6_srv.cc | 6 +++---
src/lib/dhcp/iface_mgr.h | 6 ++++++
tests/tools/perfdhcp/test_control.cc | 16 ++++++++++++++--
tests/tools/perfdhcp/test_control.h | 16 ++++++++++++++++
7 files changed, 43 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/dhcp4/dhcp4_messages.mes b/src/bin/dhcp4/dhcp4_messages.mes
index 8784ea9..2ff8f53 100644
--- a/src/bin/dhcp4/dhcp4_messages.mes
+++ b/src/bin/dhcp4/dhcp4_messages.mes
@@ -53,7 +53,7 @@ packet on the specified interface. Note that a packet marked as UNKNOWN
may well be a valid DHCP packet, just a type not expected by the server
(e.g. it will report a received OFFER packet as UNKNOWN).
-% DHCPV4_PACKET_SEND_FAIL failed to send DHCPv4 packet: %1
+% DHCP4_PACKET_SEND_FAIL failed to send DHCPv4 packet: %1
This error is output if IPv6 DHCP server fails to send assembled DHCP
message to a client. The reason for the error is included in the message.
diff --git a/src/bin/dhcp4/dhcp4_srv.cc b/src/bin/dhcp4/dhcp4_srv.cc
index c9db82f..67943c5 100644
--- a/src/bin/dhcp4/dhcp4_srv.cc
+++ b/src/bin/dhcp4/dhcp4_srv.cc
@@ -149,8 +149,8 @@ Dhcpv4Srv::run() {
if (rsp->pack()) {
try {
IfaceMgr::instance().send(rsp);
- } catch (const std::exception& ex) {
- LOG_ERROR(dhcp4_logger, DHCP4_PACKET_SEND_FAIL).arg(ex.what());
+ } catch (const std::exception& e) {
+ LOG_ERROR(dhcp4_logger, DHCP4_PACKET_SEND_FAIL).arg(e.what());
}
} else {
LOG_ERROR(dhcp4_logger, DHCP4_PACK_FAIL);
diff --git a/src/bin/dhcp6/dhcp6_messages.mes b/src/bin/dhcp6/dhcp6_messages.mes
index 8dc0fbf..424e253 100644
--- a/src/bin/dhcp6/dhcp6_messages.mes
+++ b/src/bin/dhcp6/dhcp6_messages.mes
@@ -56,7 +56,7 @@ of packet. Note that a packet marked as UNKNOWN may well be a valid
DHCP packet, just a type not expected by the server (e.g. it will report
a received OFFER packet as UNKNOWN).
-% DHCPV6_PACKET_SEND_FAIL failed to send DHCPv6 packet: %1
+% DHCP6_PACKET_SEND_FAIL failed to send DHCPv6 packet: %1
This error is output if IPv6 DHCP server fails to send assembled DHCP
message to a client. The reason fo the error is included in the message.
diff --git a/src/bin/dhcp6/dhcp6_srv.cc b/src/bin/dhcp6/dhcp6_srv.cc
index 120e82b..54fa2b5 100644
--- a/src/bin/dhcp6/dhcp6_srv.cc
+++ b/src/bin/dhcp6/dhcp6_srv.cc
@@ -89,7 +89,7 @@ bool Dhcpv6Srv::run() {
try {
query = IfaceMgr::instance().receive6(timeout);
- } catch (const std::exception& ex) {
+ } catch (const std::exception& e) {
LOG_ERROR(dhcp6_logger, DHCP6_PACKET_RECEIVE_FAIL).arg(e.what());
}
@@ -162,8 +162,8 @@ bool Dhcpv6Srv::run() {
if (rsp->pack()) {
try {
IfaceMgr::instance().send(rsp);
- } catch (const std::exception& ex) {
- LOG_ERROR(dhcp6_logger, DHCP6_PACKET_SEND_FAIL).arg(ex.what());
+ } catch (const std::exception& e) {
+ LOG_ERROR(dhcp6_logger, DHCP6_PACKET_SEND_FAIL).arg(e.what());
}
} else {
LOG_ERROR(dhcp6_logger, DHCP6_PACK_FAIL);
diff --git a/src/lib/dhcp/iface_mgr.h b/src/lib/dhcp/iface_mgr.h
index ed7b0c2..a7b9a78 100644
--- a/src/lib/dhcp/iface_mgr.h
+++ b/src/lib/dhcp/iface_mgr.h
@@ -372,6 +372,8 @@ public:
///
/// @param pkt packet to be sent
///
+ /// @throw isc::BadValue if invalid interface specified in the packet.
+ /// @throw isc::dhcp::SocketWriteError if sendmsg() failed to send packet.
/// @return true if sending was successful
bool send(const Pkt6Ptr& pkt);
@@ -383,6 +385,8 @@ public:
///
/// @param pkt a packet to be sent
///
+ /// @throw isc::BadValue if invalid interface specified in the packet.
+ /// @throw isc::dhcp::SocketWriteError if sendmsg() failed to send packet.
/// @return true if sending was successful
bool send(const Pkt4Ptr& pkt);
@@ -401,6 +405,7 @@ public:
/// (in microseconds)
///
/// @throw isc::BadValue if timeout_usec is greater than one million
+ /// @throw isc::dhcp::SocketReadError if error occured when receiving a packet.
/// @return Pkt6 object representing received packet (or NULL)
Pkt6Ptr receive6(uint32_t timeout_sec, uint32_t timeout_usec = 0);
@@ -415,6 +420,7 @@ public:
/// (in microseconds)
///
/// @throw isc::BadValue if timeout_usec is greater than one million
+ /// @throw isc::dhcp::SocketReadError if error occured when receiving a packet.
/// @return Pkt4 object representing received packet (or NULL)
Pkt4Ptr receive4(uint32_t timeout_sec, uint32_t timeout_usec = 0);
diff --git a/tests/tools/perfdhcp/test_control.cc b/tests/tools/perfdhcp/test_control.cc
index c154cf9..55a3c3c 100644
--- a/tests/tools/perfdhcp/test_control.cc
+++ b/tests/tools/perfdhcp/test_control.cc
@@ -784,7 +784,13 @@ TestControl::receivePackets(const TestControlSocket& socket) {
uint64_t received = 0;
while (receiving) {
if (CommandOptions::instance().getIpVersion() == 4) {
- Pkt4Ptr pkt4 = IfaceMgr::instance().receive4(timeout);
+ Pkt4Ptr pkt4;
+ try {
+ pkt4 = IfaceMgr::instance().receive4(timeout);
+ } catch (const Exception& e) {
+ std::cout << "Failed to receive DHCPv4 packet: "
+ << e.what() << std::endl;
+ }
if (!pkt4) {
receiving = false;
} else {
@@ -796,7 +802,13 @@ TestControl::receivePackets(const TestControlSocket& socket) {
processReceivedPacket4(socket, pkt4);
}
} else if (CommandOptions::instance().getIpVersion() == 6) {
- Pkt6Ptr pkt6 = IfaceMgr::instance().receive6(timeout);
+ Pkt6Ptr pkt6;
+ try {
+ pkt6 = IfaceMgr::instance().receive6(timeout);
+ } catch (const Exception& e) {
+ std::cout << "Failed to receive DHCPv6 packet: "
+ << e.what() << std::endl;
+ }
if (!pkt6) {
receiving = false;
} else {
diff --git a/tests/tools/perfdhcp/test_control.h b/tests/tools/perfdhcp/test_control.h
index 1b0b83c..bdf165a 100644
--- a/tests/tools/perfdhcp/test_control.h
+++ b/tests/tools/perfdhcp/test_control.h
@@ -550,8 +550,10 @@ protected:
///
/// \param socket socket to be used to send the message.
/// \param preload preload mode, packets not included in statistics.
+ ///
/// \throw isc::Unexpected if failed to create new packet instance.
/// \throw isc::BadValue if MAC address has invalid length.
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendDiscover4(const TestControlSocket& socket,
const bool preload = false);
@@ -567,7 +569,9 @@ protected:
/// \param socket socket to be used to send the message.
/// \param template_buf buffer holding template packet.
/// \param preload preload mode, packets not included in statistics.
+ ///
/// \throw isc::OutOfRange if randomization offset is out of bounds.
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendDiscover4(const TestControlSocket& socket,
const std::vector<uint8_t>& template_buf,
const bool preload = false);
@@ -581,9 +585,11 @@ protected:
/// \param socket socket to be used to send message.
/// \param discover_pkt4 DISCOVER packet sent.
/// \param offer_pkt4 OFFER packet object.
+ ///
/// \throw isc::Unexpected if unexpected error occured.
/// \throw isc::InvalidOperation if Statistics Manager has not been
/// initialized.
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendRequest4(const TestControlSocket& socket,
const dhcp::Pkt4Ptr& discover_pkt4,
const dhcp::Pkt4Ptr& offer_pkt4);
@@ -598,6 +604,8 @@ protected:
/// \param template_buf buffer holding template packet.
/// \param discover_pkt4 DISCOVER packet sent.
/// \param offer_pkt4 OFFER packet received.
+ ///
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendRequest4(const TestControlSocket& socket,
const std::vector<uint8_t>& template_buf,
const dhcp::Pkt4Ptr& discover_pkt4,
@@ -618,6 +626,8 @@ protected:
/// \throw isc::Unexpected if unexpected error occured.
/// \throw isc::InvalidOperation if Statistics Manager has not been
/// initialized.
+ ///
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendRequest6(const TestControlSocket& socket,
const dhcp::Pkt6Ptr& advertise_pkt6);
@@ -630,6 +640,8 @@ protected:
/// \param socket socket to be used to send message.
/// \param template_buf packet template buffer.
/// \param advertise_pkt6 ADVERTISE packet object.
+ ///
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendRequest6(const TestControlSocket& socket,
const std::vector<uint8_t>& template_buf,
const dhcp::Pkt6Ptr& advertise_pkt6);
@@ -648,7 +660,9 @@ protected:
///
/// \param socket socket to be used to send the message.
/// \param preload mode, packets not included in statistics.
+ ///
/// \throw isc::Unexpected if failed to create new packet instance.
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendSolicit6(const TestControlSocket& socket,
const bool preload = false);
@@ -661,6 +675,8 @@ protected:
/// \param socket socket to be used to send the message.
/// \param template_buf packet template buffer.
/// \param preload mode, packets not included in statistics.
+ ///
+ /// \throw isc::dhcp::SocketWriteError if failed to send the packet.
void sendSolicit6(const TestControlSocket& socket,
const std::vector<uint8_t>& template_buf,
const bool preload = false);
More information about the bind10-changes
mailing list