IPAddress IPAddress::operator ^ (const IPAddress& other) const { if (family() == other.family()) { if (family() == IPv4) { IPv4AddressImpl t(pImpl()->addr()); IPv4AddressImpl o(other.pImpl()->addr()); return IPAddress((t ^ o).addr(), sizeof(struct in_addr)); } #if defined(POCO_HAVE_IPv6) else if (family() == IPv6) { const IPv6AddressImpl t(pImpl()->addr(), pImpl()->scope()); const IPv6AddressImpl o(other.pImpl()->addr(), other.pImpl()->scope()); const IPv6AddressImpl r = t ^ o; return IPAddress(r.addr(), sizeof(struct in6_addr), r.scope()); } #endif else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()"); } else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()"); }
void IPAddress::mask(const IPAddress& mask, const IPAddress& set) { pImpl()->mask(mask.pImpl(), set.pImpl()); }
void IPAddress::mask(const IPAddress& mask) { IPAddress null; pImpl()->mask(mask.pImpl(), null.pImpl()); }