BIND 10 trac2237, updated. a78e560343b41f0f692c7903c938b2b2b24bf56b [2237] Changes after review.
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 11 12:55:21 UTC 2012
The branch, trac2237 has been updated
via a78e560343b41f0f692c7903c938b2b2b24bf56b (commit)
from 5e39872cc6dc260c91596ee31f1601dbf53de503 (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 a78e560343b41f0f692c7903c938b2b2b24bf56b
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Thu Oct 11 14:55:04 2012 +0200
[2237] Changes after review.
-----------------------------------------------------------------------
Summary of changes:
ChangeLog | 2 +-
src/lib/dhcp/addr_utilities.cc | 31 ++++++++++++++++---------------
2 files changed, 17 insertions(+), 16 deletions(-)
-----------------------------------------------------------------------
diff --git a/ChangeLog b/ChangeLog
index 8e6d84e..c076355 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,6 @@
4XX. [func] tomek
libdhcpsrv: The DHCP Configuration Manager is now able to store
- information about IPv4 subnets and pool. It is still not possible
+ information about IPv4 subnets and pools. It is still not possible
to configure that information. This will be implemented in a near
future.
diff --git a/src/lib/dhcp/addr_utilities.cc b/src/lib/dhcp/addr_utilities.cc
index bf9889a..de1e8b4 100644
--- a/src/lib/dhcp/addr_utilities.cc
+++ b/src/lib/dhcp/addr_utilities.cc
@@ -35,10 +35,6 @@ const uint32_t bitMask4[] = { 0xffffffff, 0x7fffffff, 0x3fffffff, 0x1fffffff,
/// @brief mask used for first/last address calculation in a IPv6 prefix
const uint8_t bitMask6[]= { 0, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff };
-}
-
-namespace isc {
-namespace dhcp {
/// @brief calculates the first IPv6 address in a IPv6 prefix
///
@@ -92,21 +88,12 @@ isc::asiolink::IOAddress firstAddrInPrefix4(const isc::asiolink::IOAddress& pref
uint8_t len) {
uint32_t addr = prefix;
if (len > 32) {
- isc_throw(BadValue, "Too large netmask. 0..32 is allowed in IPv4");
+ isc_throw(isc::BadValue, "Too large netmask. 0..32 is allowed in IPv4");
}
return (IOAddress(addr & (~bitMask4[len])));
}
-isc::asiolink::IOAddress firstAddrInPrefix(const isc::asiolink::IOAddress& prefix,
- uint8_t len) {
- if (prefix.getFamily() == AF_INET) {
- return firstAddrInPrefix4(prefix, len);
- } else {
- return firstAddrInPrefix6(prefix, len);
- }
-}
-
/// @brief calculates the last IPv4 address in a IPv4 prefix
///
/// Note: This is a private function. Do not use it directly.
@@ -118,7 +105,7 @@ isc::asiolink::IOAddress lastAddrInPrefix4(const isc::asiolink::IOAddress& prefi
uint8_t len) {
uint32_t addr = prefix;
if (len>32) {
- isc_throw(BadValue, "Too large netmask. 0..32 is allowed in IPv4");
+ isc_throw(isc::BadValue, "Too large netmask. 0..32 is allowed in IPv4");
}
return (IOAddress(addr | bitMask4[len]));
@@ -167,6 +154,20 @@ isc::asiolink::IOAddress lastAddrInPrefix6(const isc::asiolink::IOAddress& prefi
return (isc::asiolink::IOAddress::from_bytes(AF_INET6, packed));
}
+}; // end of anonymous namespace
+
+namespace isc {
+namespace dhcp {
+
+isc::asiolink::IOAddress firstAddrInPrefix(const isc::asiolink::IOAddress& prefix,
+ uint8_t len) {
+ if (prefix.getFamily() == AF_INET) {
+ return firstAddrInPrefix4(prefix, len);
+ } else {
+ return firstAddrInPrefix6(prefix, len);
+ }
+}
+
isc::asiolink::IOAddress lastAddrInPrefix(const isc::asiolink::IOAddress& prefix,
uint8_t len) {
if (prefix.getFamily() == AF_INET) {
More information about the bind10-changes
mailing list