blob: 8b7191fb0eebe97282dc048e6f8e364254808f21 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.net.routes
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## State {#State}
*Defined in [fuchsia.net.routes/routes.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.routes/routes.fidl;l=27)*
<p>Provides access to the system's routing state.</p>
### Resolve {#State.Resolve}
<p>Resolves the route to a destination.</p>
<ul>
<li>request <code>destination</code> the IP address to resolve a route to. If the
unspecified address (all zeroes) is provided, the default route will
be returned. The variant of <code>destination</code> determines variant of
<a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#IpAddress'>IpAddress</a> fields in the resolved route.</li>
</ul>
<ul>
<li>response <code>result</code> contains the resolved route to <code>destination</code>.</li>
</ul>
<ul>
<li>error <code>ZX_ERR_ADDRESS_UNREACHABLE</code> if <code>destination</code> can't be resolved.</li>
</ul>
#### Request {#State.Resolve_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>destination</code></td>
<td>
<code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#IpAddress'>IpAddress</a></code>
</td>
</tr>
</table>
#### Response {#State.Resolve_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>result</code></td>
<td>
<code><a class='link' href='#State_Resolve_Result'>State_Resolve_Result</a></code>
</td>
</tr>
</table>
## **STRUCTS**
### State_Resolve_Response {#State_Resolve_Response data-text="State_Resolve_Response"}
*Defined in [fuchsia.net.routes/routes.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.routes/routes.fidl;l=42)*
<table>
<tr><th>Field</th><th>Type</th><th>Description</th><th>Default</th></tr>
<tr id="State_Resolve_Response.result">
<td><code>result</code></td>
<td>
<code><a class='link' href='#Resolved'>Resolved</a></code>
</td>
<td><p>A resolved route.</p>
<p>Contains the information for the &quot;next-hop&quot; or immediate-destination
that is the result of a route resolution. A resolved route is only
meaningful in the context of a requested destination.</p>
</td>
<td>No default</td>
</tr>
</table>
## **TABLES**
### Destination {#Destination data-text="Destination"}
*Defined in [fuchsia.net.routes/routes.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.routes/routes.fidl;l=13)*
<p>Collection of addresses and identifiers describing a network destination.</p>
<p>A <code>Destination</code> is the &quot;next-hop&quot; for a routed packet.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="Destination.address">
<td><h3 id="Destination.address" class="add-link hide-from-toc">1</h3></td>
<td><code>address</code></td>
<td>
<code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#IpAddress'>IpAddress</a></code>
</td>
<td><p>The IP address of the destination.</p>
</td>
</tr>
<tr id="Destination.mac">
<td><h3 id="Destination.mac" class="add-link hide-from-toc">2</h3></td>
<td><code>mac</code></td>
<td>
<code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#MacAddress'>MacAddress</a></code>
</td>
<td><p>The MAC address of the destination. Only set if the destination is on a
link that requires a MAC address.</p>
</td>
</tr>
<tr id="Destination.interface_id">
<td><h3 id="Destination.interface_id" class="add-link hide-from-toc">3</h3></td>
<td><code>interface_id</code></td>
<td>
<code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#interface_id'>interface_id</a></code>
</td>
<td><p>The interface identifier over which the destination can be reached.</p>
</td>
</tr>
<tr id="Destination.source_address">
<td><h3 id="Destination.source_address" class="add-link hide-from-toc">4</h3></td>
<td><code>source_address</code></td>
<td>
<code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#IpAddress'>IpAddress</a></code>
</td>
<td><p>The preferred local IP address used to communicate with the destination.</p>
</td>
</tr>
</table>
## **UNIONS**
### Resolved [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Resolved data-text="Resolved"}
*Defined in [fuchsia.net.routes/routes.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.routes/routes.fidl;l=48)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Resolved.direct">
<td><h3 id="Resolved.direct" class="add-link hide-from-toc">1</h3></td>
<td><code>direct</code></td>
<td>
<code><a class='link' href='#Destination'>Destination</a></code>
</td>
<td><p>The requested destination is directly reachable.</p>
</td>
</tr>
<tr id="Resolved.gateway">
<td><h3 id="Resolved.gateway" class="add-link hide-from-toc">2</h3></td>
<td><code>gateway</code></td>
<td>
<code><a class='link' href='#Destination'>Destination</a></code>
</td>
<td><p>The requested destination is reachable through a gateway, thus
the next hop is the gateway.</p>
</td>
</tr>
</table>
### State_Resolve_Result [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#State_Resolve_Result data-text="State_Resolve_Result"}
*Defined in [fuchsia.net.routes/routes.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.routes/routes.fidl;l=42)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="State_Resolve_Result.response">
<td><h3 id="State_Resolve_Result.response" class="add-link hide-from-toc">1</h3></td>
<td><code>response</code></td>
<td>
<code><a class='link' href='#State_Resolve_Response'>State_Resolve_Response</a></code>
</td>
<td></td>
</tr>
<tr id="State_Resolve_Result.err">
<td><h3 id="State_Resolve_Result.err" class="add-link hide-from-toc">2</h3></td>
<td><code>err</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#status'>status</a></code>
</td>
<td></td>
</tr>
</table>