1
0
mirror of https://github.com/mfontanini/libtins synced 2026-01-28 12:44:25 +01:00

Added IPv4Address, IPv6Address and HWAddress<> 'is_multicast' member function.

This commit is contained in:
Matias Fontanini
2013-09-08 17:23:08 -03:00
parent a01fff411e
commit e21e34e194
12 changed files with 139 additions and 46 deletions

View File

@@ -174,16 +174,7 @@ bool increment(IPv4Address &addr) {
}
bool increment(IPv6Address &addr) {
IPv6Address::iterator it = addr.end() - 1;
while(it >= addr.begin() && *it == 0xff) {
*it = 0;
--it;
}
// reached end
if(it < addr.begin())
return true;
(*it)++;
return false;
return increment_buffer(addr);
}
bool decrement(IPv4Address &addr) {
@@ -194,16 +185,7 @@ bool decrement(IPv4Address &addr) {
}
bool decrement(IPv6Address &addr) {
IPv6Address::iterator it = addr.end() - 1;
while(it >= addr.begin() && *it == 0) {
*it = 0xff;
--it;
}
// reached end
if(it < addr.begin())
return true;
(*it)--;
return false;
return decrement_buffer(addr);
}
} // namespace Internals
} // namespace Tins