[#Network] = Network :mrdocs: A network type. == Synopsis Declared in `<netaddress.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- 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 [cols="1,4"] |=== | 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 [cols="1,4"] |=== | Name| Description | xref:GetNetworkName.adoc[`GetNetworkName`] | Get the canonical name of a network. | xref:GetProxy.adoc[`GetProxy`] | Get the proxy configured for a given network, if any. | xref:ParseNetwork.adoc[`ParseNetwork`] | Parse a network name into its Network enumerator. | xref:QueryDefaultGateway.adoc[`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. | xref:SetProxy.adoc[`SetProxy`] | Set the proxy used to reach a given network. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#