Bitcoin ABC 0.30.7
P2P Digital Currency
|
#include <compat.h>
#include <crypto/siphash.h>
#include <prevector.h>
#include <random.h>
#include <serialize.h>
#include <util/strencodings.h>
#include <util/string.h>
#include <tinyformat.h>
#include <array>
#include <cstdint>
#include <ios>
#include <string>
#include <vector>
Go to the source code of this file.
Classes | |
class | CNetAddr |
Network address. More... | |
class | CSubNet |
class | CService |
A combination of a network address (CNetAddr) and a (TCP) port. More... | |
class | CServiceHash |
Enumerations | |
enum | Network { NET_UNROUTABLE = 0 , NET_IPV4 , NET_IPV6 , NET_ONION , NET_I2P , NET_CJDNS , NET_INTERNAL , NET_MAX } |
A network type. More... | |
Variables | |
static constexpr int | ADDRV2_FORMAT = 0x20000000 |
A flag that is ORed into the protocol version to designate that addresses should be serialized in (unserialized from) v2 format (BIP155). More... | |
static const std::array< uint8_t, 12 > | IPV4_IN_IPV6_PREFIX |
Prefix of an IPv6 address when it contains an embedded IPv4 address. More... | |
static const std::array< uint8_t, 6 > | TORV2_IN_IPV6_PREFIX |
Prefix of an IPv6 address when it contains an embedded TORv2 address. More... | |
static const std::array< uint8_t, 6 > | INTERNAL_IN_IPV6_PREFIX |
Prefix of an IPv6 address when it contains an embedded "internal" address. More... | |
static constexpr size_t | ADDR_IPV4_SIZE = 4 |
Size of IPv4 address (in bytes). More... | |
static constexpr size_t | ADDR_IPV6_SIZE = 16 |
Size of IPv6 address (in bytes). More... | |
static constexpr size_t | ADDR_TORV2_SIZE = 10 |
Size of TORv2 address (in bytes). More... | |
static constexpr size_t | ADDR_TORV3_SIZE = 32 |
Size of TORv3 address (in bytes). More... | |
static constexpr size_t | ADDR_I2P_SIZE = 32 |
Size of I2P address (in bytes). More... | |
static constexpr size_t | ADDR_CJDNS_SIZE = 16 |
Size of CJDNS address (in bytes). More... | |
static constexpr size_t | ADDR_INTERNAL_SIZE = 10 |
Size of "internal" (NET_INTERNAL) address (in bytes). More... | |
static constexpr uint16_t | I2P_SAM31_PORT {0} |
SAM 3.1 and earlier do not support specifying ports and force the port to 0. More... | |
enum Network |
A network type.
10.0.0.1
belongs to both NET_UNROUTABLE
and NET_IPV4
. Keep these sequential starting from 0 and NET_MAX
as the last entry. We have loops like for (int i = 0; i < NET_MAX; ++i)
that expect to iterate over all enum values and also GetExtNetwork()
"extends" this enum by introducing standalone constants starting from NET_MAX
. Enumerator | |
---|---|
NET_UNROUTABLE | Addresses from these networks are not publicly routable on the global Internet. |
NET_IPV4 | IPv4. |
NET_IPV6 | IPv6. |
NET_ONION | TOR (v2 or v3) |
NET_I2P | I2P. |
NET_CJDNS | CJDNS. |
NET_INTERNAL | A set of addresses that represent the hash of a string or FQDN. We use them in AddrMan to keep track of which DNS seeds were used. |
NET_MAX | Dummy value to indicate the number of NET_* constants. |
Definition at line 44 of file netaddress.h.
|
staticconstexpr |
Size of CJDNS address (in bytes).
Definition at line 110 of file netaddress.h.
|
staticconstexpr |
Size of I2P address (in bytes).
Definition at line 107 of file netaddress.h.
|
staticconstexpr |
Size of "internal" (NET_INTERNAL) address (in bytes).
Definition at line 113 of file netaddress.h.
|
staticconstexpr |
Size of IPv4 address (in bytes).
Definition at line 94 of file netaddress.h.
|
staticconstexpr |
Size of IPv6 address (in bytes).
Definition at line 97 of file netaddress.h.
|
staticconstexpr |
Size of TORv2 address (in bytes).
Definition at line 100 of file netaddress.h.
|
staticconstexpr |
Size of TORv3 address (in bytes).
This is the length of just the address as used in BIP155, without the checksum and the version byte.
Definition at line 104 of file netaddress.h.
|
staticconstexpr |
A flag that is ORed into the protocol version to designate that addresses should be serialized in (unserialized from) v2 format (BIP155).
Make sure that this does not collide with any of the values in version.h
.
Definition at line 33 of file netaddress.h.
|
staticconstexpr |
SAM 3.1 and earlier do not support specifying ports and force the port to 0.
Definition at line 116 of file netaddress.h.
|
static |
Prefix of an IPv6 address when it contains an embedded "internal" address.
Used when (un)serializing addresses in ADDRv1 format (pre-BIP155). The prefix comes from 0xFD + SHA256("bitcoin")[0:5]. Such dummy IPv6 addresses are guaranteed to not be publicly routable as they fall under RFC4193's fc00::/7 subnet allocated to unique-local addresses.
Definition at line 89 of file netaddress.h.
|
static |
Prefix of an IPv6 address when it contains an embedded IPv4 address.
Used when (un)serializing addresses in ADDRv1 format (pre-BIP155).
Definition at line 74 of file netaddress.h.
|
static |
Prefix of an IPv6 address when it contains an embedded TORv2 address.
Used when (un)serializing addresses in ADDRv1 format (pre-BIP155). Such dummy IPv6 addresses are guaranteed to not be publicly routable as they fall under RFC4193's fc00::/7 subnet allocated to unique-local addresses.
Definition at line 81 of file netaddress.h.