![]() |
Master Core
v0.0.9 - 2abfd2849db8ba7a83957c64eb976b406713c123
|
A combination of a network address (CNetAddr) and a (TCP) port. More...
#include <netbase.h>
Public Member Functions | |
CService () | |
CService (const CNetAddr &ip, unsigned short port) | |
CService (const struct in_addr &ipv4Addr, unsigned short port) | |
CService (const struct sockaddr_in &addr) | |
CService (const char *pszIpPort, int portDefault, bool fAllowLookup=false) | |
CService (const char *pszIpPort, bool fAllowLookup=false) | |
CService (const std::string &strIpPort, int portDefault, bool fAllowLookup=false) | |
CService (const std::string &strIpPort, bool fAllowLookup=false) | |
void | Init () |
void | SetPort (unsigned short portIn) |
unsigned short | GetPort () const |
bool | GetSockAddr (struct sockaddr *paddr, socklen_t *addrlen) const |
bool | SetSockAddr (const struct sockaddr *paddr) |
std::vector< unsigned char > | GetKey () const |
std::string | ToString () const |
std::string | ToStringPort () const |
std::string | ToStringIPPort () const |
void | print () const |
CService (const struct in6_addr &ipv6Addr, unsigned short port) | |
CService (const struct sockaddr_in6 &addr) | |
![]() | |
CNetAddr () | |
CNetAddr (const struct in_addr &ipv4Addr) | |
CNetAddr (const char *pszIp, bool fAllowLookup=false) | |
CNetAddr (const std::string &strIp, bool fAllowLookup=false) | |
void | Init () |
void | SetIP (const CNetAddr &ip) |
bool | SetSpecial (const std::string &strName) |
bool | IsIPv4 () const |
bool | IsIPv6 () const |
bool | IsRFC1918 () 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 () 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 |
Calculates a metric for how reachable (*this) is from a given partner. More... | |
void | print () const |
CNetAddr (const struct in6_addr &pipv6Addr) | |
bool | GetIn6Addr (struct in6_addr *pipv6Addr) const |
Protected Attributes | |
unsigned short | port |
![]() | |
unsigned char | ip [16] |
Friends | |
bool | operator== (const CService &a, const CService &b) |
bool | operator!= (const CService &a, const CService &b) |
bool | operator< (const CService &a, const CService &b) |
A combination of a network address (CNetAddr) and a (TCP) port.
CService::CService | ( | ) |
Definition at line 965 of file netbase.cpp.
Referenced by SetSockAddr().
CService::CService | ( | const CNetAddr & | ip, |
unsigned short | port | ||
) |
Definition at line 970 of file netbase.cpp.
CService::CService | ( | const struct in_addr & | ipv4Addr, |
unsigned short | port | ||
) |
Definition at line 974 of file netbase.cpp.
CService::CService | ( | const struct sockaddr_in & | addr | ) |
Definition at line 982 of file netbase.cpp.
|
explicit |
Definition at line 1014 of file netbase.cpp.
References Init(), CNetAddr::ip, and Lookup().
|
explicit |
Definition at line 1006 of file netbase.cpp.
References Init(), CNetAddr::ip, and Lookup().
|
explicit |
Definition at line 1030 of file netbase.cpp.
References Init(), CNetAddr::ip, and Lookup().
|
explicit |
Definition at line 1022 of file netbase.cpp.
References Init(), CNetAddr::ip, and Lookup().
CService::CService | ( | const struct in6_addr & | ipv6Addr, |
unsigned short | port | ||
) |
Definition at line 978 of file netbase.cpp.
CService::CService | ( | const struct sockaddr_in6 & | addr | ) |
Definition at line 987 of file netbase.cpp.
std::vector< unsigned char > CService::GetKey | ( | ) | const |
Definition at line 1087 of file netbase.cpp.
References CNetAddr::ip, memcpy(), and port.
unsigned short CService::GetPort | ( | ) | const |
Definition at line 1038 of file netbase.cpp.
References port.
Referenced by AddLocal(), ConnectSocket(), and ThreadOpenConnections().
bool CService::GetSockAddr | ( | sockaddr * | paddr, |
socklen_t * | addrlen | ||
) | const |
Definition at line 1058 of file netbase.cpp.
References CNetAddr::GetIn6Addr(), CNetAddr::GetInAddr(), CNetAddr::IsIPv4(), CNetAddr::IsIPv6(), and port.
Referenced by BindListenPort(), ConnectSocketDirectly(), Socks4(), and CNetAddr::ToStringIP().
void CService::Init | ( | ) |
Definition at line 960 of file netbase.cpp.
Referenced by CService().
void CService::print | ( | ) | const |
Definition at line 1116 of file netbase.cpp.
References LogPrintf, and ToString().
void CService::SetPort | ( | unsigned short | portIn | ) |
Definition at line 1121 of file netbase.cpp.
References port.
bool CService::SetSockAddr | ( | const struct sockaddr * | paddr | ) |
Definition at line 992 of file netbase.cpp.
References CService().
Referenced by ThreadSocketHandler().
std::string CService::ToString | ( | ) | const |
Definition at line 1111 of file netbase.cpp.
References ToStringIPPort().
Referenced by AddLocal(), BindListenPort(), ConnectNode(), ConnectSocketDirectly(), getaddednodeinfo(), GetMyExternalIP2(), CAddrMan::Good_(), print(), ProcessMessage(), CNode::PushVersion(), SendMessages(), Socks4(), and ThreadSocketHandler().
std::string CService::ToStringIPPort | ( | ) | const |
Definition at line 1102 of file netbase.cpp.
References CNetAddr::IsIPv4(), CNetAddr::IsTor(), CNetAddr::ToStringIP(), and ToStringPort().
Referenced by CAddrMan::Add(), CNode::CNode(), and ToString().
std::string CService::ToStringPort | ( | ) | const |
Definition at line 1097 of file netbase.cpp.
References port, and strprintf.
Referenced by ToStringIPPort().
Definition at line 1048 of file netbase.cpp.
Definition at line 1053 of file netbase.cpp.
Definition at line 1043 of file netbase.cpp.
|
protected |
Definition at line 97 of file netbase.h.
Referenced by GetKey(), GetPort(), GetSockAddr(), operator!=(), operator<(), operator==(), SetPort(), and ToStringPort().