Bitcoin Core 28.99.0
P2P Digital Currency
|
#include <compat/compat.h>
#include <crypto/siphash.h>
#include <prevector.h>
#include <random.h>
#include <serialize.h>
#include <tinyformat.h>
#include <util/strencodings.h>
#include <util/string.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... | |
struct | CNetAddr::SerParams |
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... | |
Functions | |
std::string | OnionToString (Span< const uint8_t > addr) |
Variables | |
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 uint8_t | CJDNS_PREFIX {0xFC} |
All CJDNS addresses start with 0xFC. 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_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 32 of file netaddress.h.
std::string OnionToString | ( | Span< const uint8_t > | addr | ) |
Definition at line 573 of file netaddress.cpp.
|
staticconstexpr |
Size of CJDNS address (in bytes).
Definition at line 98 of file netaddress.h.
|
staticconstexpr |
Size of I2P address (in bytes).
Definition at line 95 of file netaddress.h.
|
staticconstexpr |
Size of "internal" (NET_INTERNAL) address (in bytes).
Definition at line 101 of file netaddress.h.
|
staticconstexpr |
Size of IPv4 address (in bytes).
Definition at line 85 of file netaddress.h.
|
staticconstexpr |
Size of IPv6 address (in bytes).
Definition at line 88 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 92 of file netaddress.h.
|
staticconstexpr |
All CJDNS addresses start with 0xFC.
See https://github.com/cjdelisle/cjdns/blob/master/doc/Whitepaper.md#pulling-it-all-together
Definition at line 82 of file netaddress.h.
|
staticconstexpr |
SAM 3.1 and earlier do not support specifying ports and force the port to 0.
Definition at line 104 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 76 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 61 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 68 of file netaddress.h.