A CService with information about it as peer
Synopsis
Declared in <protocol.h>
class CAddress
: public CService
Base Classes
Name |
Description |
A combination of a network address (CNetAddr) and a (TCP) port |
Types
Name |
Description |
Serialization parameters pairing a network encoding with a target format. |
Enums
Name |
Description |
BIP155 network ids recognized by this software. |
|
Wire encoding used when (un)serializing an address. |
|
Selects the serialization format used for an address. |
Member Functions
Name |
Description |
|
Constructors |
Get the raw address bytes. |
|
Fill an in6_addr with this address's IPv6 value. |
|
Fill an in_addr with this address's IPv4 value. |
|
Get a unique key identifying this service (address and port). |
|
For IPv4, mapped IPv4, SIIT translated IPv4, Teredo, 6to4 tunneled addresses, return the relevant IPv4 address as a uint32. |
|
Get the network class used for grouping this address. |
|
Get the network this address belongs to. |
|
Get the TCP port in host byte order. |
|
Calculate how reachable this address is from a given peer address. |
|
Get the address family |
|
Fill a sockaddr structure with this service's address and port. |
|
Whether the raw address begins with the CJDNS prefix byte. |
|
Whether this address has a linked IPv4 address (see GetLinkedIPv4()). |
|
Check if the current object can be serialized in pre‐ADDRv2/BIP155 format. |
|
Whether this address is the INADDR_ANY / "bind any" wildcard address. |
|
Whether this is a CJDNS address. |
|
Whether this is an IPv6 Hurricane Electric address (2001:0470::/36). |
|
Whether this is an I2P address. |
|
Whether this is an IPv4 address (::FFFF:0:0/96, 0.0.0.0/0). |
|
Whether this is a native IPv6 address (not mapped IPv4, not Tor). |
|
Whether this is an internal (NET_INTERNAL) address. |
|
Whether this is a local (loopback) address. |
|
Whether this object is a privacy network. TODO: consider adding IsCJDNS() here when more peers adopt CJDNS, see: https://github.com/bitcoin/bitcoin/pull/27411#issuecomment‐1497176155 |
|
Whether this is an IPv4 private‐network address (10/8, 192.168/16, 172.16/12). |
|
Whether this is an IPv4 inter‐network benchmarking address (198.18.0.0/15). |
|
Whether this is an IPv6 documentation address (2001:0DB8::/32). |
|
Whether this is an IPv4 link‐local autoconfig address (169.254.0.0/16). |
|
Whether this is an IPv6 6to4 tunnelling address (2002::/16). |
|
Whether this is an IPv6 unique‐local address (FC00::/7). |
|
Whether this is an IPv6 Teredo tunnelling address (2001::/32). |
|
Whether this is an IPv6 ORCHID (deprecated) address (2001:10::/28). |
|
Whether this is an IPv6 link‐local autoconfig address (FE80::/64). |
|
Whether this is an IPv4 documentation address (192.0.2/24, 198.51.100/24, 203.0.113/24). |
|
Whether this is an IPv6 well‐known prefix for IPv4‐embedded addresses (64:FF9B::/96). |
|
Whether this is an IPv6 IPv4‐translated address (::FFFF:0:0:0/96). |
|
Whether this is an IPv4 ISP‐level NAT (shared) address (100.64.0.0/10). |
|
Whether this is an IPv6 ORCHIDv2 address (2001:20::/28). |
|
Whether this address should be relayed to other peers even if we can't reach it ourselves. |
|
Whether this address is publicly routable. |
|
Whether this is a Tor onion address. |
|
Whether this address is valid. |
|
Copy the address value from another CNetAddr. |
|
Set this address to an internal address derived from a string or FQDN. |
|
Set from a legacy IPv6 address. Legacy IPv6 address may be a normal IPv6 address, or another address (e.g. IPv4) disguised as IPv6. This encoding is used in the legacy |
|
Set CService from a network sockaddr. |
|
Parse a Tor or I2P address and set this object to it. |
|
Get the address as a human‐readable string, without a port. |
|
Get a human‐readable representation of the address and port. |
Data Members
Static Data Members
Name |
Description |
Serialization parameters for the legacy ADDRv1 encoding. |
|
Serialization parameters for the V1 disk format. |
|
Serialization parameters for the V1 network format. |
|
Serialization parameters for the BIP155 ADDRv2 encoding. |
|
Serialization parameters for the V2 disk format. |
|
Serialization parameters for the V2 network format. |
Protected Data Members
Name |
Description |
Raw representation of the network address. In network byte order (big endian) for IPv4 and IPv6. |
|
Network to which this address belongs. |
|
Scope id if scoped/link‐local IPV6 address. See https://tools.ietf.org/html/rfc4007 |
|
TCP port number, in host byte order. |
Friends
Name |
Description |
Returns whether two addresses have equal time, service flags, and endpoint. |
Non-Member Functions
Name |
Description |
Record a local address that we may advertise, scored by nScore. |
|
Record a local address (with port) that we may advertise, scored by nScore. |
|
Create a socket and try to connect to the specified service, using the provided timeout. |
|
Create a socket and try to connect to the specified service. |
|
Return whether the given address is one of our known local addresses. |
|
Check whether an address is one of the configured proxies. |
|
If an IPv6 address belongs to the address range used by the CJDNS network and the CJDNS network is reachable (‐cjdnsreachable config is set), then change the type from NET_IPV6 to NET_CJDNS. |
|
Try to open a port using RFC 6886 NAT‐PMP. IPv4 only. |
|
Read the anchor IP address database (anchors.dat) |
|
Forget a previously recorded local address. |
|
Mark a local address as having been seen, returning whether it was already known. |
|
Order two services. |
|
Order two addresses. |
|
Compare two services for equality. |
|
Compare two addresses for equality. |
Created with MrDocs