Dash Core Source Documentation (0.16.0.1)
Find detailed information regarding the Dash Core source code.
A combination of a network address (CNetAddr) and a (TCP) port. More...
#include <netaddress.h>
Inheritance diagram for CService:
Collaboration diagram for CService: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) | |
| 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 (bool fUseGetnameinfo=true) const |
| std::string | ToStringPort () const |
| std::string | ToStringIPPort (bool fUseGetnameinfo=true) const |
| CService (const struct in6_addr &ipv6Addr, unsigned short port) | |
| CService (const struct sockaddr_in6 &addr) | |
| template<typename Stream , typename Operation > | |
| void | SerializationOp (Stream &s, Operation ser_action) |
Public Member Functions inherited from CNetAddr | |
| 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 (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=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 | |
Public Attributes inherited from CNetAddr | |
| ADD_SERIALIZE_METHODS | |
Protected Attributes | |
| unsigned short | port |
Protected Attributes inherited from CNetAddr | |
| unsigned char | ip [16] |
| uint32_t | scopeId |
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) |
Detailed Description
A combination of a network address (CNetAddr) and a (TCP) port.
Definition at line 143 of file netaddress.h.
Constructor & Destructor Documentation
◆ CService() [1/6]
| CService::CService | ( | ) |
Definition at line 472 of file netaddress.cpp.
Referenced by SetSockAddr().
◆ CService() [2/6]
| CService::CService | ( | const CNetAddr & | ip, |
| unsigned short | port | ||
| ) |
Definition at line 476 of file netaddress.cpp.
◆ CService() [3/6]
| CService::CService | ( | const struct in_addr & | ipv4Addr, |
| unsigned short | port | ||
| ) |
Definition at line 480 of file netaddress.cpp.
◆ CService() [4/6]
|
explicit |
Definition at line 488 of file netaddress.cpp.
◆ CService() [5/6]
| CService::CService | ( | const struct in6_addr & | ipv6Addr, |
| unsigned short | port | ||
| ) |
Definition at line 484 of file netaddress.cpp.
◆ CService() [6/6]
|
explicit |
Definition at line 493 of file netaddress.cpp.
Member Function Documentation
◆ GetKey()
| std::vector< unsigned char > CService::GetKey | ( | ) | const |
Definition at line 557 of file netaddress.cpp.
References CNetAddr::ip, memcpy(), and port.
Referenced by CNode::AddAddressKnown(), CAddrInfo::GetBucketPosition(), CAddrInfo::GetTriedBucket(), CNode::PushAddress(), and PeerLogicValidation::SendMessages().
◆ GetPort()
| unsigned short CService::GetPort | ( | ) | const |
Definition at line 512 of file netaddress.cpp.
References port.
Referenced by AddLocal(), AppInitMain(), CConnman::ConnectNode(), OptionsModel::getProxySettings(), CConnman::OpenNetworkConnection(), and CConnman::ThreadOpenConnections().
◆ GetSockAddr()
| bool CService::GetSockAddr | ( | struct sockaddr * | paddr, |
| socklen_t * | addrlen | ||
| ) | const |
Definition at line 527 of file netaddress.cpp.
References CNetAddr::GetIn6Addr(), CNetAddr::GetInAddr(), CNetAddr::IsIPv4(), CNetAddr::IsIPv6(), port, and CNetAddr::scopeId.
Referenced by CConnman::BindListenPort(), ConnectSocketDirectly(), CreateSocket(), and CNetAddr::ToStringIP().
◆ SerializationOp()
|
inline |
Definition at line 171 of file netaddress.h.
References FLATDATA, CNetAddr::ip, port, and READWRITE.
◆ SetPort()
| void CService::SetPort | ( | unsigned short | portIn | ) |
Definition at line 586 of file netaddress.cpp.
References port.
Referenced by CAddrMan::Create(), CAddrMan::Delete(), and CAddrMan::Find().
◆ SetSockAddr()
| bool CService::SetSockAddr | ( | const struct sockaddr * | paddr | ) |
Definition at line 498 of file netaddress.cpp.
References CService().
Referenced by CConnman::AcceptConnection(), and GetBindAddress().
◆ ToString()
| std::string CService::ToString | ( | bool | fUseGetnameinfo = true | ) | const |
Definition at line 581 of file netaddress.cpp.
References ToStringIPPort().
Referenced by CConnman::AcceptConnection(), TorController::add_onion_cb(), AddLocal(), AdvertiseLocal(), CConnman::BindListenPort(), CConnman::ConnectNode(), ConnectSocketDirectly(), CNode::copyStats(), CreateSocket(), CConnman::DisconnectNodes(), CNode::GetLogString(), CAddrMan::Good_(), HTTPReq_JSONRPC(), CActiveMasternodeManager::Init(), masternode_status(), CConnman::OpenNetworkConnection(), CMasternodeUtils::ProcessMasternodeConnections(), CPrivateSendServer::ProcessMessage(), CPrivateSendClientSession::ProcessMessage(), ProcessMessage(), CPrivateSendClientSession::ProcessPendingDsaRequest(), RemoveLocal(), CNode::SetAddrLocal(), CConnman::ThreadOpenConnections(), CProRegTx::ToJson(), CSimplifiedMNListEntry::ToJson(), CProUpServTx::ToJson(), CProRegTx::ToString(), CSimplifiedMNListEntry::ToString(), and CProUpServTx::ToString().
◆ ToStringIPPort()
| std::string CService::ToStringIPPort | ( | bool | fUseGetnameinfo = true | ) | const |
Definition at line 572 of file netaddress.cpp.
References CNetAddr::IsInternal(), CNetAddr::IsIPv4(), CNetAddr::IsTor(), CNetAddr::ToStringIP(), and ToStringPort().
Referenced by CAddrMan::Add(), CNode::CNode(), GetNetworksInfo(), CConnman::OpenNetworkConnection(), CDeterministicMNState::ToJson(), CDeterministicMNState::ToString(), and ToString().
◆ ToStringPort()
| std::string CService::ToStringPort | ( | ) | const |
Definition at line 567 of file netaddress.cpp.
References port, and strprintf.
Referenced by ToStringIPPort(), and OptionsDialog::updateDefaultProxyNets().
Friends And Related Function Documentation
◆ operator!=
Definition at line 158 of file netaddress.h.
◆ operator<
Definition at line 522 of file netaddress.cpp.
◆ operator==
Definition at line 517 of file netaddress.cpp.
Member Data Documentation
◆ ADD_SERIALIZE_METHODS
| CService::ADD_SERIALIZE_METHODS |
Definition at line 168 of file netaddress.h.
◆ port
|
protected |
Definition at line 146 of file netaddress.h.
Referenced by GetKey(), GetPort(), GetSockAddr(), operator<(), operator==(), SerializationOp(), SetPort(), and ToStringPort().
The documentation for this class was generated from the following files:
- src/netaddress.h
- src/netaddress.cpp

