Bitcoin Core  0.20.99
P2P Digital Currency
Public Member Functions | Public Attributes | Static Private Attributes | List of all members
CAddress Class Reference

A CService with information about it as peer. More...

#include <protocol.h>

Inheritance diagram for CAddress:
Collaboration diagram for CAddress:

Public Member Functions

 CAddress ()
 CAddress (CService ipIn, ServiceFlags nServicesIn)
- Public Member Functions inherited from CService
 CService ()
 CService (const CNetAddr &ip, uint16_t port)
 CService (const struct in_addr &ipv4Addr, uint16_t port)
 CService (const struct sockaddr_in &addr)
uint16_t GetPort () const
bool GetSockAddr (struct sockaddr *paddr, socklen_t *addrlen) const
 Obtain the IPv4/6 socket address this represents. More...
bool SetSockAddr (const struct sockaddr *paddr)
std::vector< unsigned char > GetKey () const
std::string ToString () const
std::string ToStringPort () const
std::string ToStringIPPort () const
 CService (const struct in6_addr &ipv6Addr, uint16_t port)
 CService (const struct sockaddr_in6 &addr)
- Public Member Functions inherited from CNetAddr
 CNetAddr ()
 Construct an unspecified IPv6 network address (::/128). More...
 CNetAddr (const struct in_addr &ipv4Addr)
void SetIP (const CNetAddr &ip)
void SetLegacyIPv6 (Span< const uint8_t > ipv6)
 Set from a legacy IPv6 address. More...
bool SetInternal (const std::string &name)
 Create an "internal" address that represents a name or FQDN. More...
bool SetSpecial (const std::string &strName)
 Parse a TORv2 address and set this object to it. More...
bool IsBindAny () const
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 IsRFC7343 () const
bool IsRFC4862 () const
bool IsRFC6052 () const
bool IsRFC6145 () const
bool IsHeNet () 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
uint64_t GetHash () const
bool GetInAddr (struct in_addr *pipv4Addr) const
 Try to get our IPv4 address. More...
uint32_t GetNetClass () const
uint32_t GetLinkedIPv4 () const
 For IPv4, mapped IPv4, SIIT translated IPv4, Teredo, 6to4 tunneled addresses, return the relevant IPv4 address as a uint32. More...
bool HasLinkedIPv4 () const
 Whether this address has a linked IPv4 address (see GetLinkedIPv4()). More...
uint32_t GetMappedAS (const std::vector< bool > &asmap) const
std::vector< unsigned char > GetGroup (const std::vector< bool > &asmap) const
 Get the canonical identifier of our network group. More...
std::vector< unsigned char > GetAddrBytes () 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
 Try to get our IPv6 address. More...
template<typename Stream >
void Serialize (Stream &s) const
 Serialize to a stream. More...
template<typename Stream >
void Unserialize (Stream &s)
 Unserialize from a stream. More...

Public Attributes

uint32_t nTime {TIME_INIT}
ServiceFlags nServices {NODE_NONE}

Static Private Attributes

static constexpr uint32_t TIME_INIT {100000000}

Additional Inherited Members

- Protected Attributes inherited from CService
uint16_t port
- Protected Attributes inherited from CNetAddr
prevector< ADDR_IPV6_SIZE, uint8_t > m_addr {ADDR_IPV6_SIZE, 0x0}
 Raw representation of the network address. More...
Network m_net {NET_IPV6}
 Network to which this address belongs. More...
uint32_t scopeId {0}

Detailed Description

A CService with information about it as peer.

Definition at line 348 of file protocol.h.

Constructor & Destructor Documentation

◆ CAddress() [1/2]

CAddress::CAddress ( )

Definition at line 353 of file protocol.h.

◆ CAddress() [2/2]

CAddress::CAddress ( CService  ipIn,
ServiceFlags  nServicesIn 

Definition at line 354 of file protocol.h.

Member Function Documentation


CAddress::SERIALIZE_METHODS ( CAddress  ,

Definition at line 356 of file protocol.h.

Here is the call graph for this function:

Member Data Documentation

◆ nServices

ServiceFlags CAddress::nServices {NODE_NONE}

Definition at line 380 of file protocol.h.

◆ nTime

uint32_t CAddress::nTime {TIME_INIT}

Definition at line 378 of file protocol.h.


constexpr uint32_t CAddress::TIME_INIT {100000000}

Definition at line 350 of file protocol.h.

The documentation for this class was generated from the following file: