A network type.

Synopsis

Declared in <netaddress.h>

enum Network;

Description

Note

An address may belong to more than one network, for example 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.

Members

Name

Description

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.

Non-Member Functions

Name

Description

GetNetworkName

Get the canonical name of a network.

GetProxy

Get the proxy configured for a given network, if any.

ParseNetwork

Parse a network name into its Network enumerator.

QueryDefaultGateway

Query the OS for the default gateway for network. This only makes sense for NET_IPV4 and NET_IPV6. Returns std::nullopt if it cannot be found, or there is no support for this OS.

SetProxy

Set the proxy used to reach a given network.

Created with MrDocs