BIND 10 trac1283, updated. 1d1e8b67f60e66804663fc9c3e8da4721f08074e [1283] Use IOAddress << operator in remaining places in DHCP code.
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Jan 16 15:07:47 UTC 2014
The branch, trac1283 has been updated
via 1d1e8b67f60e66804663fc9c3e8da4721f08074e (commit)
from 7607200420438907d7d3e036a967c20c6b9b3f99 (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 1d1e8b67f60e66804663fc9c3e8da4721f08074e
Author: Marcin Siodelski <marcin at isc.org>
Date: Thu Jan 16 16:07:39 2014 +0100
[1283] Use IOAddress << operator in remaining places in DHCP code.
-----------------------------------------------------------------------
Summary of changes:
src/bin/d2/d2_cfg_mgr.cc | 5 ++---
src/lib/dhcp/iface_mgr.cc | 4 ++--
src/lib/dhcp/option6_addrlst.cc | 6 +++---
src/lib/dhcp/option6_iaprefix.cc | 2 +-
src/lib/dhcp/tests/iface_mgr_unittest.cc | 4 ++--
src/lib/dhcpsrv/alloc_engine.cc | 2 +-
src/lib/dhcpsrv/subnet.cc | 8 ++++----
7 files changed, 15 insertions(+), 16 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/bin/d2/d2_cfg_mgr.cc b/src/bin/d2/d2_cfg_mgr.cc
index ef63a0a..efa4de5 100644
--- a/src/bin/d2/d2_cfg_mgr.cc
+++ b/src/bin/d2/d2_cfg_mgr.cc
@@ -119,7 +119,7 @@ std::string
D2CfgMgr::reverseV4Address(const isc::asiolink::IOAddress& ioaddr) {
if (!ioaddr.isV4()) {
isc_throw(D2CfgError, "D2CfgMgr address is not IPv4 address :"
- << ioaddr.toText());
+ << ioaddr);
}
// Get the address in byte vector form.
@@ -148,8 +148,7 @@ D2CfgMgr::reverseV4Address(const isc::asiolink::IOAddress& ioaddr) {
std::string
D2CfgMgr::reverseV6Address(const isc::asiolink::IOAddress& ioaddr) {
if (!ioaddr.isV6()) {
- isc_throw(D2CfgError, "D2Cfg address is not IPv6 address: "
- << ioaddr.toText());
+ isc_throw(D2CfgError, "D2Cfg address is not IPv6 address: " << ioaddr);
}
// Turn the address into a string of digits.
diff --git a/src/lib/dhcp/iface_mgr.cc b/src/lib/dhcp/iface_mgr.cc
index 71f6467..6681cd7 100644
--- a/src/lib/dhcp/iface_mgr.cc
+++ b/src/lib/dhcp/iface_mgr.cc
@@ -418,7 +418,7 @@ bool IfaceMgr::openSockets6(const uint16_t port) {
if (sock < 0) {
const char* errstr = strerror(errno);
isc_throw(SocketConfigError, "failed to open unicast socket on "
- << addr->toText() << " on interface " << iface->getName()
+ << *addr << " on interface " << iface->getName()
<< ", reason: " << errstr);
}
@@ -449,7 +449,7 @@ bool IfaceMgr::openSockets6(const uint16_t port) {
if (sock < 0) {
const char* errstr = strerror(errno);
isc_throw(SocketConfigError, "failed to open link-local socket on "
- << addr->toText() << " on interface "
+ << *addr << " on interface "
<< iface->getName() << ", reason: " << errstr);
}
diff --git a/src/lib/dhcp/option6_addrlst.cc b/src/lib/dhcp/option6_addrlst.cc
index cb14070..45c2262 100644
--- a/src/lib/dhcp/option6_addrlst.cc
+++ b/src/lib/dhcp/option6_addrlst.cc
@@ -102,9 +102,9 @@ std::string Option6AddrLst::toText(int indent /* =0 */) {
tmp << "type=" << type_ << " " << addrs_.size() << "addr(s): ";
- for (AddressContainer::const_iterator addr=addrs_.begin();
- addr!=addrs_.end(); ++addr) {
- tmp << addr->toText() << " ";
+ for (AddressContainer::const_iterator addr = addrs_.begin();
+ addr != addrs_.end(); ++addr) {
+ tmp << *addr << " ";
}
return tmp.str();
}
diff --git a/src/lib/dhcp/option6_iaprefix.cc b/src/lib/dhcp/option6_iaprefix.cc
index 9acdd88..d28b4f7 100644
--- a/src/lib/dhcp/option6_iaprefix.cc
+++ b/src/lib/dhcp/option6_iaprefix.cc
@@ -98,7 +98,7 @@ std::string Option6IAPrefix::toText(int indent /* =0 */) {
for (int i=0; i<indent; i++)
tmp << " ";
- tmp << "type=" << type_ << "(IAPREFIX) prefix=" << addr_.toText() << "/"
+ tmp << "type=" << type_ << "(IAPREFIX) prefix=" << addr_ << "/"
<< prefix_len_ << ", preferred-lft=" << preferred_ << ", valid-lft="
<< valid_ << endl;
diff --git a/src/lib/dhcp/tests/iface_mgr_unittest.cc b/src/lib/dhcp/tests/iface_mgr_unittest.cc
index 5e34b43..28ce90f 100644
--- a/src/lib/dhcp/tests/iface_mgr_unittest.cc
+++ b/src/lib/dhcp/tests/iface_mgr_unittest.cc
@@ -1752,7 +1752,7 @@ TEST_F(IfaceMgrTest, DISABLED_detectIfaces_linux) {
const Iface::AddressCollection& addrs = i->getAddresses();
for (Iface::AddressCollection::const_iterator a= addrs.begin();
a != addrs.end(); ++a) {
- cout << a->toText() << " ";
+ cout << *a << " ";
}
cout << endl;
}
@@ -1810,7 +1810,7 @@ TEST_F(IfaceMgrTest, DISABLED_detectIfaces_linux) {
<< " address on " << detected->getFullName() << " interface." << endl;
FAIL();
}
- cout << "Address " << addr->toText() << " on interface " << detected->getFullName()
+ cout << "Address " << *addr << " on interface " << detected->getFullName()
<< " matched with 'ifconfig -a' output." << endl;
}
}
diff --git a/src/lib/dhcpsrv/alloc_engine.cc b/src/lib/dhcpsrv/alloc_engine.cc
index dd1481e..37f2fdf 100644
--- a/src/lib/dhcpsrv/alloc_engine.cc
+++ b/src/lib/dhcpsrv/alloc_engine.cc
@@ -90,7 +90,7 @@ AllocEngine::IterativeAllocator::increasePrefix(const isc::asiolink::IOAddress&
const uint8_t prefix_len) {
if (!prefix.isV6()) {
isc_throw(BadValue, "Prefix operations are for IPv6 only (attempted to "
- "increase prefix " << prefix.toText() << ")");
+ "increase prefix " << prefix << ")");
}
// Get a buffer holding an address.
diff --git a/src/lib/dhcpsrv/subnet.cc b/src/lib/dhcpsrv/subnet.cc
index 3ed23e7..713def9 100644
--- a/src/lib/dhcpsrv/subnet.cc
+++ b/src/lib/dhcpsrv/subnet.cc
@@ -162,7 +162,7 @@ void Subnet::setLastAllocated(Lease::Type type,
std::string
Subnet::toText() const {
std::stringstream tmp;
- tmp << prefix_.toText() << "/" << static_cast<unsigned int>(prefix_len_);
+ tmp << prefix_ << "/" << static_cast<unsigned int>(prefix_len_);
return (tmp.str());
}
@@ -187,7 +187,7 @@ Subnet4::Subnet4(const isc::asiolink::IOAddress& prefix, uint8_t length,
void Subnet4::setSiaddr(const isc::asiolink::IOAddress& siaddr) {
if (!siaddr.isV4()) {
isc_throw(BadValue, "Can't set siaddr to non-IPv4 address "
- << siaddr.toText());
+ << siaddr);
}
siaddr_ = siaddr;
}
@@ -264,7 +264,7 @@ Subnet::addPool(const PoolPtr& pool) {
if (!inRange(first_addr) || !inRange(last_addr)) {
isc_throw(BadValue, "Pool (" << first_addr << "-" << last_addr
- << " does not belong in this (" << prefix_.toText() << "/"
+ << " does not belong in this (" << prefix_ << "/"
<< static_cast<int>(prefix_len_) << ") subnet");
}
@@ -331,7 +331,7 @@ Subnet6::Subnet6(const isc::asiolink::IOAddress& prefix, uint8_t length,
:Subnet(prefix, length, t1, t2, valid_lifetime),
preferred_(preferred_lifetime){
if (!prefix.isV6()) {
- isc_throw(BadValue, "Non IPv6 prefix " << prefix.toText()
+ isc_throw(BadValue, "Non IPv6 prefix " << prefix
<< " specified in subnet6");
}
}
More information about the bind10-changes
mailing list