[#QueryDefaultGateway]
= QueryDefaultGateway
:mrdocs:

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;

== Synopsis

Declared in `&lt;common&sol;netif&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
std::optional&lt;CNetAddr&gt;
QueryDefaultGateway(xref:Network.adoc[Network] network);
----

== Return Value

The gateway address, or std&colon;&colon;nullopt if unavailable&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *network*
| The network family to query (NET&lowbar;IPV4 or NET&lowbar;IPV6)&period;
|===


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