blob: 67b7e88ac786922220637873162621429d921d13 [file] [log] [blame] [view]
<link rel="stylesheet" href="../style.css" />
[TOC]
# fuchsia.net.interfaces
<div class="fidl-version-div"><span class="fidl-attribute fidl-version">Added: 7</span></div>
## **PROTOCOLS**
## State {#State}
*Defined in [fuchsia.net.interfaces/interfaces.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=63)*
<p>Network interface state inspection and observation.</p>
### GetWatcher {#State.GetWatcher}
<p>Initialize a watcher for interface state.</p>
<p>The server enqueues interface addition, deletion and property changes as
they occur, which can then be retrieved via the pipelined protocol.</p>
<ul>
<li>request <code>options</code> specifies the behavior of the <a class='link' href='#Watcher'>Watcher</a>.</li>
<li>request <code>watcher</code> grants access to a <a class='link' href='#Watcher'>Watcher</a>. Closed if the queue
cannot be allocated or if the queue is full when the server attempts
to enqueue an event.</li>
</ul>
#### Request {#State.GetWatcher_Request}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>options</code></td>
<td>
<code><a class='link' href='#WatcherOptions'>WatcherOptions</a></code>
</td>
</tr>
<tr>
<td><code>watcher</code></td>
<td>
<code>request&lt;<a class='link' href='#Watcher'>Watcher</a>&gt;</code>
</td>
</tr>
</table>
## Watcher {#Watcher}
*Defined in [fuchsia.net.interfaces/interfaces.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=85)*
<p>Observer protocol for changes to network interfaces (addition, deletion, and
interface property changes).</p>
### Watch {#Watcher.Watch}
<p>Hanging get for an interface addition/deletion change.</p>
<p>Clients should only have one call of this method at a time; a second
call to this method while a call is already pending will cause the
server end of the protocol to be closed.</p>
<p>If there are N interfaces present at the time the server end of the
protocol is initialized, then the first N invocations of this method
will return <a class='link' href='#Event.existing'>Event.existing</a> followed by a single <a class='link' href='#Event.idle'>Event.idle</a>
indicating that all existing interfaces have been sent. Subsequent calls
will immediately return if there is a change to be reported, or block
until a change occurs.</p>
<p>The server may choose to coalesce property change events, e.g. when
multiple independent property changes occur. As a result, clients cannot
assume that the order in which they observe the interface changes is the
order in which the changes occurred.</p>
<ul>
<li>response <code>event</code> the interface change event. Properties of an added or
existing interface will have all fields present. Property change
events will always have the interface ID field present (the ID never
changes); while other fields will only be present with the new value
if the property has changed.</li>
</ul>
#### Request {#Watcher.Watch_Request}
&lt;EMPTY&gt;
#### Response {#Watcher.Watch_Response}
<table>
<tr><th>Name</th><th>Type</th></tr>
<tr>
<td><code>event</code></td>
<td>
<code><a class='link' href='#Event'>Event</a></code>
</td>
</tr>
</table>
## **STRUCTS**
### Empty {#Empty data-text="Empty"}
*Defined in [fuchsia.net.interfaces/interfaces.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=20)*
&lt;EMPTY&gt;
## **TABLES**
### Address {#Address data-text="Address"}
*Defined in [fuchsia.net.interfaces/interfaces.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=28)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="Address.addr">
<td><h3 id="Address.addr" class="add-link hide-from-toc">1</h3></td>
<td><code>addr</code></td>
<td>
<code><a class='link' href='../fuchsia.net/'>fuchsia.net</a>/<a class='link' href='../fuchsia.net/#Subnet'>Subnet</a></code>
</td>
<td><p>The address and prefix length.</p>
</td>
</tr>
<tr id="Address.valid_until">
<td><h3 id="Address.valid_until" class="add-link hide-from-toc">2</h3></td>
<td><code>valid_until</code></td>
<td>
<code><a class='link' href='../zx/'>zx</a>/<a class='link' href='../zx/#time'>time</a></code>
</td>
<td><p>The time after which the address will no longer be valid.</p>
<p>Its value must be greater than 0. A value of <code>ZX_TIME_INFINITE</code>
indicates that the address will always be valid. The value is
derived from the monotonic clock.</p>
<p>As a <code>zx.time</code>, the value has
<a href="https://fuchsia.dev/fuchsia-src/concepts/time/monotonic">monotonic clock semantics</a>,
which implies that it has no meaning outside of the host on which it
was generated and no meaning across host restarts.</p>
</td>
</tr>
</table>
### Properties {#Properties data-text="Properties"}
*Defined in [fuchsia.net.interfaces/interfaces.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=23)*
<p>Properties of a network interface.</p>
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
<tr id="Properties.id">
<td><h3 id="Properties.id" class="add-link hide-from-toc">1</h3></td>
<td><code>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>An opaque identifier for the interface. Its value will not be reused
even if the device is removed and subsequently re-added. Immutable.</p>
</td>
</tr>
<tr id="Properties.addresses">
<td><h3 id="Properties.addresses" class="add-link hide-from-toc">2</h3></td>
<td><code>addresses</code></td>
<td>
<code>vector&lt;<a class='link' href='#Address'>Address</a>&gt;</code>
</td>
<td><p>The addresses currently assigned to the interface.</p>
</td>
</tr>
<tr id="Properties.online">
<td><h3 id="Properties.online" class="add-link hide-from-toc">3</h3></td>
<td><code>online</code></td>
<td>
<code>bool</code>
</td>
<td><p>The device is enabled and its physical state is online.</p>
</td>
</tr>
<tr id="Properties.device_class">
<td><h3 id="Properties.device_class" class="add-link hide-from-toc">4</h3></td>
<td><code>device_class</code></td>
<td>
<code><a class='link' href='#DeviceClass'>DeviceClass</a></code>
</td>
<td><p>The device class of the interface. Immutable.</p>
</td>
</tr>
<tr id="Properties.has_default_ipv4_route">
<td><h3 id="Properties.has_default_ipv4_route" class="add-link hide-from-toc">5</h3></td>
<td><code>has_default_ipv4_route</code></td>
<td>
<code>bool</code>
</td>
<td><p>Whether there is a default IPv4 route through this interface.</p>
</td>
</tr>
<tr id="Properties.has_default_ipv6_route">
<td><h3 id="Properties.has_default_ipv6_route" class="add-link hide-from-toc">6</h3></td>
<td><code>has_default_ipv6_route</code></td>
<td>
<code>bool</code>
</td>
<td><p>Whether there is a default IPv6 route through this interface.</p>
</td>
</tr>
<tr id="Properties.name">
<td><h3 id="Properties.name" class="add-link hide-from-toc">7</h3></td>
<td><code>name</code></td>
<td>
<code><a class='link' href='#name'>name</a></code>
</td>
<td><p>The name of the interface. Immutable.</p>
</td>
</tr>
</table>
### WatcherOptions {#WatcherOptions data-text="WatcherOptions"}
*Defined in [fuchsia.net.interfaces/interfaces.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=78)*
<table>
<tr><th>Ordinal</th><th>Field</th><th>Type</th><th>Description</th></tr>
</table>
## **UNIONS**
### DeviceClass [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#DeviceClass data-text="DeviceClass"}
*Defined in [fuchsia.net.interfaces/interfaces.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=46)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="DeviceClass.loopback">
<td><h3 id="DeviceClass.loopback" class="add-link hide-from-toc">1</h3></td>
<td><code>loopback</code></td>
<td>
<code><a class='link' href='#Empty'>Empty</a></code>
</td>
<td><p>The interface is loopback.</p>
</td>
</tr>
<tr id="DeviceClass.device">
<td><h3 id="DeviceClass.device" class="add-link hide-from-toc">2</h3></td>
<td><code>device</code></td>
<td>
<code><a class='link' href='../fuchsia.hardware.network/'>fuchsia.hardware.network</a>/<a class='link' href='../fuchsia.hardware.network/#DeviceClass'>DeviceClass</a></code>
</td>
<td><p>The interface's network device class.</p>
</td>
</tr>
</table>
### Event [strict](/fuchsia-src/reference/fidl/language/language.md#strict-vs-flexible){:.fidl-attribute} {#Event data-text="Event"}
*Defined in [fuchsia.net.interfaces/interfaces.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=110)*
<table>
<tr><th>Ordinal</th><th>Variant</th><th>Type</th><th>Description</th></tr>
<tr id="Event.existing">
<td><h3 id="Event.existing" class="add-link hide-from-toc">1</h3></td>
<td><code>existing</code></td>
<td>
<code><a class='link' href='#Properties'>Properties</a></code>
</td>
<td><p>Properties of an interface that existed when watching started.</p>
<p>All fields are set.</p>
</td>
</tr>
<tr id="Event.added">
<td><h3 id="Event.added" class="add-link hide-from-toc">2</h3></td>
<td><code>added</code></td>
<td>
<code><a class='link' href='#Properties'>Properties</a></code>
</td>
<td><p>Properties of an interface that was added while watching.</p>
<p>All fields are set.</p>
</td>
</tr>
<tr id="Event.removed">
<td><h3 id="Event.removed" class="add-link hide-from-toc">3</h3></td>
<td><code>removed</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>ID of an interface that was removed while watching.</p>
</td>
</tr>
<tr id="Event.changed">
<td><h3 id="Event.changed" class="add-link hide-from-toc">4</h3></td>
<td><code>changed</code></td>
<td>
<code><a class='link' href='#Properties'>Properties</a></code>
</td>
<td><p>Properties of an interface that changed while watching.</p>
<p>Only <a class='link' href='#Properties.id'>Properties.id</a> and changed fields are set.</p>
</td>
</tr>
<tr id="Event.idle">
<td><h3 id="Event.idle" class="add-link hide-from-toc">5</h3></td>
<td><code>idle</code></td>
<td>
<code><a class='link' href='#Empty'>Empty</a></code>
</td>
<td><p>Sentinel value indicating no more <a class='link' href='#existing'>existing</a> events will be
sent.</p>
</td>
</tr>
</table>
## **CONSTANTS**
<table>
<tr><th>Name</th><th>Value</th><th>Type</th><th>Description</th></tr>
<tr id="INTERFACE_NAME_LENGTH">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=14">INTERFACE_NAME_LENGTH</a></td>
<td>
<code>15</code>
</td>
<td><code>uint8</code></td>
<td><p>The maximum length of an interface name.</p>
</td>
</tr>
</table>
## **TYPE ALIASES**
<table>
<tr><th>Name</th><th>Value</th><th>Description</th></tr>
<tr id="name">
<td><a href="https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.net.interfaces/interfaces.fidl;l=17">name</a></td>
<td>
<code>string</code>[<code><a class='link' href='#INTERFACE_NAME_LENGTH'>INTERFACE_NAME_LENGTH</a></code>]</td>
<td><p>An interface name as a sequence of bytes.</p>
</td>
</tr>
</table>