[#Network]
= Network
:mrdocs:

A network type&period;

== Synopsis

Declared in `&lt;netaddress&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
enum Network;
----

== Description

[NOTE]
====
An address may belong to more than one network, for example `10&period;0&period;0&period;1` belongs to both `NET&lowbar;UNROUTABLE` and `NET&lowbar;IPV4`&period; Keep these sequential starting from 0 and `NET&lowbar;MAX` as the last entry&period; We have loops like `for (int i &equals; 0&semi; i &lt; NET&lowbar;MAX&semi; &plus;&plus;i)` that expect to iterate over all enum values and also `GetExtNetwork()` &quot;extends&quot; this enum by introducing standalone constants starting from `NET&lowbar;MAX`&period;

====

== Members

[cols="1,4"]
|===
| Name| Description
| `NET&lowbar;UNROUTABLE` 
| Addresses from these networks are not publicly routable on the global Internet&period;
| `NET&lowbar;IPV4` 
| IPv4
| `NET&lowbar;IPV6` 
| IPv6
| `NET&lowbar;ONION` 
| TOR (v2 or v3)
| `NET&lowbar;I2P` 
| I2P
| `NET&lowbar;CJDNS` 
| CJDNS
| `NET&lowbar;INTERNAL` 
| A set of addresses that represent the hash of a string or FQDN&period; We use them in AddrMan to keep track of which DNS seeds were used&period;
| `NET&lowbar;MAX` 
| Dummy value to indicate the number of NET&lowbar;&ast; constants&period;
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:GetNetworkName.adoc[`GetNetworkName`]
| Get the canonical name of a network&period;
| xref:GetProxy.adoc[`GetProxy`]
| Get the proxy configured for a given network, if any&period;
| xref:ParseNetwork.adoc[`ParseNetwork`]
| Parse a network name into its Network enumerator&period;
| xref:QueryDefaultGateway.adoc[`QueryDefaultGateway`]
| Query the OS for the default gateway for `network`&period; This only makes sense for NET&lowbar;IPV4 and NET&lowbar;IPV6&period; Returns std&colon;&colon;nullopt if it cannot be found, or there is no support for this OS&period;
| xref:SetProxy.adoc[`SetProxy`]
| Set the proxy used to reach a given network&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
