| 410 | |
| 411 | |
| 412 | IPAddress IPAddress::operator | (const IPAddress& other) const |
| 413 | { |
| 414 | if (family() == other.family()) |
| 415 | { |
| 416 | if (family() == IPv4) |
| 417 | { |
| 418 | IPv4AddressImpl t(pImpl()->addr()); |
| 419 | IPv4AddressImpl o(other.pImpl()->addr()); |
| 420 | return IPAddress((t | o).addr(), sizeof(struct in_addr)); |
| 421 | } |
| 422 | #if defined(POCO_HAVE_IPv6) |
| 423 | else if (family() == IPv6) |
| 424 | { |
| 425 | const IPv6AddressImpl t(pImpl()->addr(), pImpl()->scope()); |
| 426 | const IPv6AddressImpl o(other.pImpl()->addr(), other.pImpl()->scope()); |
| 427 | const IPv6AddressImpl r = t | o; |
| 428 | return IPAddress(r.addr(), sizeof(struct in6_addr), r.scope()); |
| 429 | } |
| 430 | #endif |
| 431 | else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()"); |
| 432 | } |
| 433 | else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()"); |
| 434 | } |
| 435 | |
| 436 | |
| 437 | IPAddress IPAddress::operator ^ (const IPAddress& other) const |