MCPcopy Create free account
hub / github.com/ElementsProject/elements / GetNetClass

Method GetNetClass

src/netaddress.cpp:707–723  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

705}
706
707Network CNetAddr::GetNetClass() const
708{
709 // Make sure that if we return NET_IPV6, then IsIPv6() is true. The callers expect that.
710
711 // Check for "internal" first because such addresses are also !IsRoutable()
712 // and we don't want to return NET_UNROUTABLE in that case.
713 if (IsInternal()) {
714 return NET_INTERNAL;
715 }
716 if (!IsRoutable()) {
717 return NET_UNROUTABLE;
718 }
719 if (HasLinkedIPv4()) {
720 return NET_IPV4;
721 }
722 return m_net;
723}
724
725uint32_t CNetAddr::GetMappedAS(const std::vector<bool> &asmap) const {
726 uint32_t net_class = GetNetClass();

Callers 4

GetAddr_Method · 0.80
FUZZ_TARGETFunction · 0.80
getnodeaddressesFunction · 0.80

Calls

no outgoing calls

Tested by 1

FUZZ_TARGETFunction · 0.64