![]() |
Bitcoin Core
0.15.99
P2P Digital Currency
|
IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96)) More...
#include <netaddress.h>
Public Member Functions | |
CNetAddr () | |
CNetAddr (const struct in_addr &ipv4Addr) | |
void | SetIP (const CNetAddr &ip) |
bool | SetInternal (const std::string &name) |
Transform an arbitrary string into a non-routable ipv6 address. More... | |
bool | SetSpecial (const std::string &strName) |
bool | IsIPv4 () const |
bool | IsIPv6 () const |
bool | IsRFC1918 () const |
bool | IsRFC2544 () const |
bool | IsRFC6598 () const |
bool | IsRFC5737 () const |
bool | IsRFC3849 () const |
bool | IsRFC3927 () const |
bool | IsRFC3964 () const |
bool | IsRFC4193 () const |
bool | IsRFC4380 () const |
bool | IsRFC4843 () const |
bool | IsRFC4862 () const |
bool | IsRFC6052 () const |
bool | IsRFC6145 () const |
bool | IsTor () const |
bool | IsLocal () const |
bool | IsRoutable () const |
bool | IsInternal () const |
bool | IsValid () const |
enum Network | GetNetwork () const |
std::string | ToString () const |
std::string | ToStringIP () const |
unsigned int | GetByte (int n) const |
uint64_t | GetHash () const |
bool | GetInAddr (struct in_addr *pipv4Addr) const |
std::vector< unsigned char > | GetGroup () const |
int | GetReachabilityFrom (const CNetAddr *paddrPartner=nullptr) const |
Calculates a metric for how reachable (*this) is from a given partner. More... | |
CNetAddr (const struct in6_addr &pipv6Addr, const uint32_t scope=0) | |
bool | GetIn6Addr (struct in6_addr *pipv6Addr) const |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action) |
Public Attributes | |
ADD_SERIALIZE_METHODS | |
Protected Attributes | |
unsigned char | ip [16] |
uint32_t | scopeId |
Private Member Functions | |
void | SetRaw (Network network, const uint8_t *data) |
Set raw IPv4 or IPv6 address (in network byte order) More... | |
Friends | |
class | CSubNet |
bool | operator== (const CNetAddr &a, const CNetAddr &b) |
bool | operator!= (const CNetAddr &a, const CNetAddr &b) |
bool | operator< (const CNetAddr &a, const CNetAddr &b) |
IP address (IPv6, or IPv4 using mapped IPv6 range (::FFFF:0:0/96))
Definition at line 32 of file netaddress.h.
CNetAddr::CNetAddr | ( | ) |
Definition at line 17 of file netaddress.cpp.
|
explicit |
|
explicit |
unsigned int CNetAddr::GetByte | ( | int | n | ) | const |
std::vector< unsigned char > CNetAddr::GetGroup | ( | ) | const |
Definition at line 309 of file netaddress.cpp.
uint64_t CNetAddr::GetHash | ( | ) | const |
Definition at line 382 of file netaddress.cpp.
bool CNetAddr::GetIn6Addr | ( | struct in6_addr * | pipv6Addr | ) | const |
Definition at line 301 of file netaddress.cpp.
bool CNetAddr::GetInAddr | ( | struct in_addr * | pipv4Addr | ) | const |
Definition at line 293 of file netaddress.cpp.
enum Network CNetAddr::GetNetwork | ( | ) | const |
Definition at line 237 of file netaddress.cpp.
int CNetAddr::GetReachabilityFrom | ( | const CNetAddr * | paddrPartner = nullptr | ) | const |
Calculates a metric for how reachable (*this) is from a given partner.
Definition at line 404 of file netaddress.cpp.
bool CNetAddr::IsInternal | ( | ) | const |
bool CNetAddr::IsIPv4 | ( | ) | const |
bool CNetAddr::IsIPv6 | ( | ) | const |
Definition at line 91 of file netaddress.cpp.
bool CNetAddr::IsLocal | ( | ) | const |
Definition at line 174 of file netaddress.cpp.
bool CNetAddr::IsRFC1918 | ( | ) | const |
Definition at line 96 of file netaddress.cpp.
bool CNetAddr::IsRFC2544 | ( | ) | const |
Definition at line 104 of file netaddress.cpp.
bool CNetAddr::IsRFC3849 | ( | ) | const |
Definition at line 126 of file netaddress.cpp.
bool CNetAddr::IsRFC3927 | ( | ) | const |
Definition at line 109 of file netaddress.cpp.
bool CNetAddr::IsRFC3964 | ( | ) | const |
Definition at line 131 of file netaddress.cpp.
bool CNetAddr::IsRFC4193 | ( | ) | const |
Definition at line 153 of file netaddress.cpp.
bool CNetAddr::IsRFC4380 | ( | ) | const |
Definition at line 142 of file netaddress.cpp.
bool CNetAddr::IsRFC4843 | ( | ) | const |
Definition at line 164 of file netaddress.cpp.
bool CNetAddr::IsRFC4862 | ( | ) | const |
bool CNetAddr::IsRFC5737 | ( | ) | const |
Definition at line 119 of file netaddress.cpp.
bool CNetAddr::IsRFC6052 | ( | ) | const |
bool CNetAddr::IsRFC6145 | ( | ) | const |
bool CNetAddr::IsRFC6598 | ( | ) | const |
Definition at line 114 of file netaddress.cpp.
bool CNetAddr::IsRoutable | ( | ) | const |
Definition at line 227 of file netaddress.cpp.
bool CNetAddr::IsTor | ( | ) | const |
bool CNetAddr::IsValid | ( | ) | const |
Definition at line 188 of file netaddress.cpp.
|
inline |
Definition at line 97 of file netaddress.h.
bool CNetAddr::SetInternal | ( | const std::string & | name | ) |
Transform an arbitrary string into a non-routable ipv6 address.
Useful for mapping resolved addresses back to their source.
Definition at line 44 of file netaddress.cpp.
void CNetAddr::SetIP | ( | const CNetAddr & | ip | ) |
Definition at line 23 of file netaddress.cpp.
|
private |
Set raw IPv4 or IPv6 address (in network byte order)
Definition at line 28 of file netaddress.cpp.
bool CNetAddr::SetSpecial | ( | const std::string & | strName | ) |
Definition at line 56 of file netaddress.cpp.
std::string CNetAddr::ToString | ( | ) | const |
Definition at line 278 of file netaddress.cpp.
std::string CNetAddr::ToStringIP | ( | ) | const |
Definition at line 254 of file netaddress.cpp.
|
friend |
Definition at line 101 of file netaddress.h.
Definition at line 91 of file netaddress.h.
Definition at line 288 of file netaddress.cpp.
Definition at line 283 of file netaddress.cpp.
CNetAddr::ADD_SERIALIZE_METHODS |
Definition at line 94 of file netaddress.h.
|
protected |
Definition at line 35 of file netaddress.h.
|
protected |
Definition at line 36 of file netaddress.h.