Changeset View
Changeset View
Standalone View
Standalone View
src/netaddress.cpp
Show First 20 Lines • Show All 661 Lines • ▼ Show 20 Lines | uint32_t CNetAddr::GetLinkedIPv4() const { | ||||
} else if (IsRFC4380()) { | } else if (IsRFC4380()) { | ||||
// Teredo tunneled IPv4: the IPv4 address is in the last 4 bytes of the | // Teredo tunneled IPv4: the IPv4 address is in the last 4 bytes of the | ||||
// address, but bitflipped | // address, but bitflipped | ||||
return ~ReadBE32(MakeSpan(m_addr).last(ADDR_IPV4_SIZE).data()); | return ~ReadBE32(MakeSpan(m_addr).last(ADDR_IPV4_SIZE).data()); | ||||
} | } | ||||
assert(false); | assert(false); | ||||
} | } | ||||
uint32_t CNetAddr::GetNetClass() const { | Network CNetAddr::GetNetClass() const { | ||||
// Make sure that if we return NET_IPV6, then IsIPv6() is true. The callers | // Make sure that if we return NET_IPV6, then IsIPv6() is true. The callers | ||||
// expect that. | // expect that. | ||||
// Check for "internal" first because such addresses are also !IsRoutable() | // Check for "internal" first because such addresses are also !IsRoutable() | ||||
// and we don't want to return NET_UNROUTABLE in that case. | // and we don't want to return NET_UNROUTABLE in that case. | ||||
if (IsInternal()) { | if (IsInternal()) { | ||||
return NET_INTERNAL; | return NET_INTERNAL; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 508 Lines • Show Last 20 Lines |