BIND 10 trac2187, updated. 79848f3dcca94147df133b8969c5c1aa0fddc299 [2187] Removed 'cout' statements from pktX and libdhcp++.
BIND 10 source code commits
bind10-changes at lists.isc.org
Wed Sep 26 09:16:32 UTC 2012
The branch, trac2187 has been updated
via 79848f3dcca94147df133b8969c5c1aa0fddc299 (commit)
from 26f07019946b185e191ce7490f4c398b830f8420 (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 79848f3dcca94147df133b8969c5c1aa0fddc299
Author: Marcin Siodelski <marcin at isc.org>
Date: Wed Sep 26 11:16:24 2012 +0200
[2187] Removed 'cout' statements from pktX and libdhcp++.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/libdhcp++.cc | 17 ++++-------------
src/lib/dhcp/pkt4.cc | 2 --
src/lib/dhcp/pkt6.cc | 10 ++++------
3 files changed, 8 insertions(+), 21 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc
index 22cd47b..12e1bbd 100644
--- a/src/lib/dhcp/libdhcp++.cc
+++ b/src/lib/dhcp/libdhcp++.cc
@@ -72,26 +72,23 @@ size_t LibDHCP::unpackOptions6(const OptionBuffer& buf,
offset += 2;
if (offset + opt_len > end) {
- cout << "Option " << opt_type << " truncated." << endl;
+ // @todo: consider throwing exception here.
return (offset);
}
OptionPtr opt;
switch (opt_type) {
case D6O_IA_NA:
case D6O_IA_PD:
- // cout << "Creating Option6IA" << endl;
opt = OptionPtr(new Option6IA(opt_type,
buf.begin() + offset,
buf.begin() + offset + opt_len));
break;
case D6O_IAADDR:
- // cout << "Creating Option6IAAddr" << endl;
opt = OptionPtr(new Option6IAAddr(opt_type,
buf.begin() + offset,
buf.begin() + offset + opt_len));
break;
default:
- // cout << "Creating Option" << endl;
opt = OptionPtr(new Option(Option::V6,
opt_type,
buf.begin() + offset,
@@ -151,15 +148,9 @@ size_t LibDHCP::unpackOptions4(const OptionBuffer& buf,
void LibDHCP::packOptions6(isc::util::OutputBuffer &buf,
const isc::dhcp::Option::OptionCollection& options) {
- try {
- for (Option::OptionCollection::const_iterator it = options.begin();
- it != options.end(); ++it) {
- it->second->pack(buf);
- }
- }
- catch (const Exception&) {
- cout << "Packet build failed (Option build failed)." << endl;
- throw;
+ for (Option::OptionCollection::const_iterator it = options.begin();
+ it != options.end(); ++it) {
+ it->second->pack(buf);
}
}
diff --git a/src/lib/dhcp/pkt4.cc b/src/lib/dhcp/pkt4.cc
index 2c3f1eb..405277d 100644
--- a/src/lib/dhcp/pkt4.cc
+++ b/src/lib/dhcp/pkt4.cc
@@ -197,8 +197,6 @@ void Pkt4::check() {
}
void Pkt4::repack() {
- cout << "Convering RX packet to TX packet: " << data_.size() << " bytes." << endl;
-
bufferOut_.writeData(&data_[0], data_.size());
}
diff --git a/src/lib/dhcp/pkt6.cc b/src/lib/dhcp/pkt6.cc
index e869c7b..330c97f 100644
--- a/src/lib/dhcp/pkt6.cc
+++ b/src/lib/dhcp/pkt6.cc
@@ -100,7 +100,7 @@ Pkt6::packUDP() {
LibDHCP::packOptions6(bufferOut_, options_);
}
catch (const Exception& e) {
- cout << "Packet build failed:" << e.what() << endl;
+ /// @todo: throw exception here once we turn this function to void.
return (false);
}
return (true);
@@ -129,8 +129,8 @@ Pkt6::unpack() {
bool
Pkt6::unpackUDP() {
if (data_.size() < 4) {
- std::cout << "DHCPv6 packet truncated. Only " << data_.size()
- << " bytes. Need at least 4." << std::endl;
+ // @todo: throw exception here informing that packet is truncated
+ // once we turn this function to void.
return (false);
}
msg_type_ = data_[0];
@@ -143,7 +143,7 @@ Pkt6::unpackUDP() {
LibDHCP::unpackOptions6(opt_buffer, options_);
} catch (const Exception& e) {
- cout << "Packet parsing failed:" << e.what() << endl;
+ // @todo: throw exception here once we turn this function to void.
return (false);
}
return (true);
@@ -197,8 +197,6 @@ Pkt6::delOption(uint16_t type) {
}
void Pkt6::repack() {
- cout << "Convering RX packet to TX packet: " << data_.size() << " bytes." << endl;
-
bufferOut_.writeData(&data_[0], data_.size());
}
More information about the bind10-changes
mailing list