![]() |
Dash Core
0.12.2.1
P2P Digital Currency
|
#include <netaddress.h>
Public Member Functions | |
CNetAddr () | |
CNetAddr (const struct in_addr &ipv4Addr) | |
void | Init () |
void | SetIP (const CNetAddr &ip) |
void | SetRaw (Network network, const uint8_t *data) |
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 | IsValid () const |
bool | IsMulticast () const |
enum Network | GetNetwork () const |
std::string | ToString () const |
std::string | ToStringIP (bool fUseGetnameinfo=true) 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=NULL) const |
CNetAddr (const struct in6_addr &pipv6Addr) | |
bool | GetIn6Addr (struct in6_addr *pipv6Addr) const |
template<typename Stream , typename Operation > | |
void | SerializationOp (Stream &s, Operation ser_action, int nType, int nVersion) |
Public Attributes | |
ADD_SERIALIZE_METHODS | |
Protected Attributes | |
unsigned char | ip [16] |
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 30 of file netaddress.h.
CNetAddr::CNetAddr | ( | ) |
Definition at line 58 of file netaddress.cpp.
CNetAddr::CNetAddr | ( | const struct in_addr & | ipv4Addr | ) |
Definition at line 63 of file netaddress.cpp.
CNetAddr::CNetAddr | ( | const struct in6_addr & | pipv6Addr | ) |
Definition at line 68 of file netaddress.cpp.
unsigned int CNetAddr::GetByte | ( | int | n | ) | const |
Definition at line 73 of file netaddress.cpp.
Referenced by GetGroup(), IsLocal(), IsMulticast(), IsRFC1918(), IsRFC2544(), IsRFC3849(), IsRFC3927(), IsRFC3964(), IsRFC4193(), IsRFC4380(), IsRFC4843(), IsRFC5737(), IsRFC6598(), and ToStringIP().
std::vector< unsigned char > CNetAddr::GetGroup | ( | ) | const |
Definition at line 302 of file netaddress.cpp.
Referenced by CNode::CalculateKeyedNetGroup(), CAddrInfo::GetNewBucket(), CAddrInfo::GetTriedBucket(), and CConnman::ThreadOpenConnections().
uint64_t CNetAddr::GetHash | ( | ) | const |
Definition at line 369 of file netaddress.cpp.
Referenced by CAddrInfo::GetBucketPosition(), CAddrInfo::GetNewBucket(), CAddrInfo::GetTriedBucket(), and RelayAddress().
bool CNetAddr::GetIn6Addr | ( | struct in6_addr * | pipv6Addr | ) | const |
Definition at line 294 of file netaddress.cpp.
Referenced by CService::GetSockAddr().
bool CNetAddr::GetInAddr | ( | struct in_addr * | pipv4Addr | ) | const |
Definition at line 286 of file netaddress.cpp.
Referenced by CService::GetSockAddr().
enum Network CNetAddr::GetNetwork | ( | ) | const |
Definition at line 227 of file netaddress.cpp.
Referenced by ConnectSocket(), GetExtNetwork(), IsLimited(), IsPeerAddrLocalGood(), and IsReachable().
int CNetAddr::GetReachabilityFrom | ( | const CNetAddr * | paddrPartner = NULL | ) | const |
Calculates a metric for how reachable (*this) is from a given partner
Definition at line 391 of file netaddress.cpp.
void CNetAddr::Init | ( | ) |
Definition at line 18 of file netaddress.cpp.
Referenced by CNetAddr().
bool CNetAddr::IsIPv4 | ( | ) | const |
Definition at line 78 of file netaddress.cpp.
Referenced by CSubNet::CSubNet(), GetGroup(), GetInAddr(), GetNetwork(), CService::GetSockAddr(), IsIPv6(), IsLocal(), IsMulticast(), IsRFC1918(), IsRFC2544(), IsRFC3927(), IsRFC5737(), IsRFC6598(), IsValid(), CMasternode::IsValidNetAddr(), CActiveMasternode::ManageStateInitial(), CSubNet::ToString(), ToStringIP(), and CService::ToStringIPPort().
bool CNetAddr::IsIPv6 | ( | ) | const |
Definition at line 83 of file netaddress.cpp.
Referenced by CConnman::BindListenPort(), and CService::GetSockAddr().
bool CNetAddr::IsLocal | ( | ) | const |
Definition at line 166 of file netaddress.cpp.
Referenced by CMasternodeMan::DsegUpdate(), GetGroup(), IsRoutable(), CMasternodeMan::ProcessMessage(), and SendMessages().
bool CNetAddr::IsMulticast | ( | ) | const |
Definition at line 180 of file netaddress.cpp.
bool CNetAddr::IsRFC1918 | ( | ) | const |
Definition at line 88 of file netaddress.cpp.
Referenced by CMasternodeMan::DsegUpdate(), IsRoutable(), and CMasternodeMan::ProcessMessage().
bool CNetAddr::IsRFC2544 | ( | ) | const |
Definition at line 96 of file netaddress.cpp.
Referenced by IsRoutable().
bool CNetAddr::IsRFC3849 | ( | ) | const |
Definition at line 118 of file netaddress.cpp.
Referenced by IsValid().
bool CNetAddr::IsRFC3927 | ( | ) | const |
Definition at line 101 of file netaddress.cpp.
Referenced by IsRoutable().
bool CNetAddr::IsRFC3964 | ( | ) | const |
Definition at line 123 of file netaddress.cpp.
Referenced by GetGroup(), and GetReachabilityFrom().
bool CNetAddr::IsRFC4193 | ( | ) | const |
Definition at line 145 of file netaddress.cpp.
Referenced by IsRoutable().
bool CNetAddr::IsRFC4380 | ( | ) | const |
Definition at line 134 of file netaddress.cpp.
Referenced by GetExtNetwork(), and GetGroup().
bool CNetAddr::IsRFC4843 | ( | ) | const |
Definition at line 156 of file netaddress.cpp.
Referenced by IsRoutable().
bool CNetAddr::IsRFC4862 | ( | ) | const |
Definition at line 139 of file netaddress.cpp.
Referenced by IsRoutable().
bool CNetAddr::IsRFC5737 | ( | ) | const |
Definition at line 111 of file netaddress.cpp.
Referenced by IsRoutable().
bool CNetAddr::IsRFC6052 | ( | ) | const |
Definition at line 128 of file netaddress.cpp.
Referenced by GetGroup(), and GetReachabilityFrom().
bool CNetAddr::IsRFC6145 | ( | ) | const |
Definition at line 150 of file netaddress.cpp.
Referenced by GetGroup(), and GetReachabilityFrom().
bool CNetAddr::IsRFC6598 | ( | ) | const |
Definition at line 106 of file netaddress.cpp.
Referenced by IsRoutable().
bool CNetAddr::IsRoutable | ( | ) | const |
Definition at line 222 of file netaddress.cpp.
Referenced by CAddrMan::Add_(), AddLocal(), AdvertiseLocal(), CConnman::BindListenPort(), GetGroup(), GetNetwork(), GetReachabilityFrom(), IsPeerAddrLocalGood(), CMasternode::IsValidNetAddr(), and ProcessMessage().
bool CNetAddr::IsTor | ( | ) | const |
Definition at line 161 of file netaddress.cpp.
Referenced by GetGroup(), GetNetwork(), IsIPv6(), IsRoutable(), ToStringIP(), and CService::ToStringIPPort().
bool CNetAddr::IsValid | ( | ) | const |
Definition at line 186 of file netaddress.cpp.
Referenced by AppInit2(), ClientAllowed(), CConnman::ConnectNode(), CNode::copyStats(), TorController::disconnected_cb(), CConnman::GetAddedNodeInfo(), IsRoutable(), proxyType::IsValid(), CSubNet::Match(), CNode::PushAddress(), setban(), CConnman::ThreadOpenConnections(), and TorController::~TorController().
|
inline |
Definition at line 87 of file netaddress.h.
void CNetAddr::SetIP | ( | const CNetAddr & | ip | ) |
Definition at line 23 of file netaddress.cpp.
Referenced by AdvertiseLocal(), and ProcessMessage().
void CNetAddr::SetRaw | ( | Network | network, |
const uint8_t * | data | ||
) |
Set raw IPv4 or IPv6 address (in network byte order)
Definition at line 28 of file netaddress.cpp.
Referenced by CNetAddr().
bool CNetAddr::SetSpecial | ( | const std::string & | strName | ) |
Definition at line 44 of file netaddress.cpp.
Referenced by LookupIntern().
std::string CNetAddr::ToString | ( | ) | const |
Definition at line 266 of file netaddress.cpp.
Referenced by Discover(), and CSubNet::ToString().
std::string CNetAddr::ToStringIP | ( | bool | fUseGetnameinfo = true | ) | const |
Definition at line 241 of file netaddress.cpp.
Referenced by ConnectSocket(), OptionsModel::getProxySettings(), ToString(), CService::ToStringIPPort(), and OptionsDialog::updateDefaultProxyNets().
|
friend |
Definition at line 91 of file netaddress.h.
Definition at line 276 of file netaddress.cpp.
Definition at line 281 of file netaddress.cpp.
Definition at line 271 of file netaddress.cpp.
CNetAddr::ADD_SERIALIZE_METHODS |
Definition at line 84 of file netaddress.h.
|
protected |
Definition at line 33 of file netaddress.h.
Referenced by CSubNet::CSubNet(), GetByte(), GetHash(), GetIn6Addr(), GetInAddr(), CService::GetKey(), Init(), IsIPv4(), IsLocal(), IsRFC4862(), IsRFC6052(), IsRFC6145(), IsTor(), IsValid(), CSubNet::Match(), operator!=(), operator<(), operator==(), SerializationOp(), CService::SerializationOp(), SetIP(), SetRaw(), SetSpecial(), and ToStringIP().