Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
netaddress.cpp
Go to the documentation of this file.
62 std::vector<unsigned char> vchAddr = DecodeBase32(strName.substr(0, strName.size() - 6).c_str());
131 return GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x0D && GetByte(12) == 0xB8;
169 return (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x00 && (GetByte(12) & 0xF0) == 0x10);
236 return !(IsRFC2544() || IsRFC3927() || IsRFC4862() || IsRFC6598() || IsRFC5737() || (IsRFC4193() && !IsTor()) || IsRFC4843() || IsLocal() || IsInternal());
266 return EncodeBase32(ip + sizeof(g_internal_prefix), sizeof(ip) - sizeof(g_internal_prefix)) + ".internal";
274 if (!getnameinfo((const struct sockaddr*)&sockaddr, socklen, name, sizeof(name), nullptr, 0, NI_NUMERICHOST))
373 else if (GetByte(15) == 0x20 && GetByte(14) == 0x01 && GetByte(13) == 0x04 && GetByte(12) == 0x70)
444 case NET_IPV6: return fTunnel ? REACH_IPV6_WEAK : REACH_IPV6_STRONG; // only prefer giving our IPv6 address if it's not tunnelled
480 CService::CService(const struct in_addr& ipv4Addr, unsigned short portIn) : CNetAddr(ipv4Addr), port(portIn)
484 CService::CService(const struct in6_addr& ipv6Addr, unsigned short portIn) : CNetAddr(ipv6Addr), port(portIn)
488 CService::CService(const struct sockaddr_in& addr) : CNetAddr(addr.sin_addr), port(ntohs(addr.sin_port))
493 CService::CService(const struct sockaddr_in6 &addr) : CNetAddr(addr.sin6_addr, addr.sin6_scope_id), port(ntohs(addr.sin6_port))
723 return (a.network < b.network || (a.network == b.network && memcmp(a.netmask, b.netmask, 16) < 0));
int GetReachabilityFrom(const CNetAddr *paddrPartner=nullptr) const
Calculates a metric for how reachable (*this) is from a given partner.
Definition: netaddress.cpp:414
Definition: netaddress.h:26
Definition: netaddress.h:27
Definition: netaddress.h:29
Definition: netaddress.h:24
std::string ToStringIP(bool fUseGetnameinfo=true) const
Definition: netaddress.cpp:261
Definition: netaddress.h:105
bool GetSockAddr(struct sockaddr *paddr, socklen_t *addrlen) const
Definition: netaddress.cpp:527
std::vector< unsigned char > DecodeBase32(const char *p, bool *pfInvalid)
Definition: utilstrencodings.cpp:330
A combination of a network address (CNetAddr) and a (TCP) port.
Definition: netaddress.h:143
uint256 Hash(const T1 pbegin, const T1 pend)
Compute the 256-bit hash of an object.
Definition: hash.h:84
IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96))
Definition: netaddress.h:33
Definition: netaddress.h:25
void SetRaw(Network network, const uint8_t *data)
Set raw IPv4 or IPv6 address (in network byte order)
Definition: netaddress.cpp:31
std::string EncodeBase32(const unsigned char *pch, size_t len)
Definition: utilstrencodings.cpp:266
std::string ToStringIPPort(bool fUseGetnameinfo=true) const
Definition: netaddress.cpp:572
bool SetInternal(const std::string &name)
Transform an arbitrary string into a non-routable ipv6 address.
Definition: netaddress.cpp:47
Definition: netaddress.h:23