MCPcopy Create free account
hub / github.com/ClickHouse/ClickHouse / operator &

Method operator &

base/poco/Net/src/IPAddress.cpp:387–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

385
386
387IPAddress IPAddress::operator & (const IPAddress& other) const
388{
389 if (family() == other.family())
390 {
391 if (family() == IPv4)
392 {
393 IPv4AddressImpl t(pImpl()->addr());
394 IPv4AddressImpl o(other.pImpl()->addr());
395 return IPAddress((t & o).addr(), sizeof(struct in_addr));
396 }
397#if defined(POCO_HAVE_IPv6)
398 else if (family() == IPv6)
399 {
400 const IPv6AddressImpl t(pImpl()->addr(), pImpl()->scope());
401 const IPv6AddressImpl o(other.pImpl()->addr(), other.pImpl()->scope());
402 const IPv6AddressImpl r = t & o;
403 return IPAddress(r.addr(), sizeof(struct in6_addr), r.scope());
404 }
405#endif
406 else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()");
407 }
408 else throw Poco::InvalidArgumentException("Invalid or unsupported address family passed to IPAddress()");
409}
410
411
412IPAddress IPAddress::operator | (const IPAddress& other) const

Callers

nothing calls this directly

Calls 5

IPAddressClass · 0.50
familyMethod · 0.45
addrMethod · 0.45
pImplMethod · 0.45
scopeMethod · 0.45

Tested by

no test coverage detected