| 435 | |
| 436 | |
| 437 | IPAddress IPAddress::operator ^ (const IPAddress& other) const |
| 438 | { |
| 439 | if (family() == other.family()) |
| 440 | { |
| 441 | if (family() == IPv4) |
| 442 | { |
| 443 | IPv4AddressImpl t(pImpl()->addr()); |
| 444 | IPv4AddressImpl o(other.pImpl()->addr()); |
| 445 | return IPAddress((t ^ o).addr(), sizeof(struct in_addr)); |
| 446 | } |
| 447 | #if defined(POCO_HAVE_IPv6) |
| 448 | else if (family() == IPv6) |
| 449 | { |
| 450 | const IPv6AddressImpl t(pImpl()->addr(), pImpl()->scope()); |
| 451 | const IPv6AddressImpl o(other.pImpl()->addr(), other.pImpl()->scope()); |
| 452 | const IPv6AddressImpl r = t ^ o; |
| 453 | return IPAddress(r.addr(), sizeof(struct in6_addr), r.scope()); |
| 454 | } |
| 455 | #endif |
| 456 | else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()"); |
| 457 | } |
| 458 | else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()"); |
| 459 | } |
| 460 | |
| 461 | |
| 462 | IPAddress IPAddress::operator ~ () const |