Google is committed to advancing racial equity for Black communities. See how.

fuchsia.net.interfaces

PROTOCOLS

State

Defined in fuchsia.net.interfaces/interfaces.fidl

Network interface state inspection and observation.

GetWatcher

Initialize a watcher for interface state.

The server enqueues interface addition, deletion and property changes as they occur, which can then be retrieved via the pipelined protocol. If the queue cannot be allocated, the channel will be closed. Also, if the queue is full and a change event cannot be enqueued, the channel will be closed.

  • request watcher the protocol channel over which changes can be observed.

Request

NameType
options WatcherOptions
watcher request<Watcher>

Watcher

Defined in fuchsia.net.interfaces/interfaces.fidl

Observer protocol for changes to network interfaces (addition, deletion, and interface property changes).

Watch

Hanging get for an interface addition/deletion change.

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 channel to be closed.

If there are N interfaces present at the time the channel was initialized, then the first N invocations of this method will return Event.existing followed by a single Event.idle 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.

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.

  • response event 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.

Request

NameType

Response

NameType
event Event

STRUCTS

Empty

Defined in fuchsia.net.interfaces/interfaces.fidl

NameTypeDescriptionDefault

TABLES

Address

Defined in fuchsia.net.interfaces/interfaces.fidl

An address and its properties.

OrdinalNameTypeDescription
1 addr fuchsia.net/Subnet

The address and prefix length.

Properties

Defined in fuchsia.net.interfaces/interfaces.fidl

Properties of a network interface.

OrdinalNameTypeDescription
1 id fuchsia.net/interface_id

An opaque identifier for the interface. Its value will not be reused even if the device is removed and subsequently re-added. Immutable.

2 addresses vector<Address>

The addresses currently assigned to the interface.

3 online bool

The device is enabled and its physical state is online.

4 device_class DeviceClass

The device class of the interface. Immutable.

5 has_default_ipv4_route bool

Whether there is a default IPv4 route through this interface.

6 has_default_ipv6_route bool

Whether there is a default IPv6 route through this interface.

7 name fuchsia.posix.socket/interface_name

The name of the interface. Immutable.

WatcherOptions

Defined in fuchsia.net.interfaces/interfaces.fidl

Options for configuring the interface state watcher.

OrdinalNameTypeDescription

UNIONS

DeviceClass

Defined in fuchsia.net.interfaces/interfaces.fidl

An interface's device class.

NameTypeDescription
loopback Empty

The interface is loopback.

device fuchsia.hardware.network/DeviceClass

The interface's network device class.

Event

Defined in fuchsia.net.interfaces/interfaces.fidl

An interface-state change event.

NameTypeDescription
existing Properties

Properties of an interface that existed when watching started.

All fields are set.

added Properties

Properties of an interface that was added while watching.

All fields are set.

removed fuchsia.net/interface_id

ID of an interface that was removed while watching.

changed Properties

Properties of an interface that changed while watching.

Only Properties.id and changed fields are set.

idle Empty

Sentinel value indicating no more existing events will be sent.