fuchsia.net.interfaces

Added: 7

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.

  • request options specifies the behavior of the Watcher.
  • request watcher grants access to a Watcher. Closed if the queue cannot be allocated or if the queue is full when the server attempts to enqueue an event.

Request

NameType
options WatcherOptions
watcher server_end: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 server end of the protocol to be closed.

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 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.

Request

<EMPTY>

Response

NameType
event Event

STRUCTS

Empty

Defined in fuchsia.net.interfaces/interfaces.fidl

<EMPTY>

ENUMS

AddressAssignmentState strict

Type: uint32

Defined in fuchsia.net.interfaces/interfaces.fidl

Assignment state of an IP address.

Added: HEAD

NameValueDescription
1

Address assignment is in progress, e.g. Duplicate Address Detection is being performed. The address cannot be used when in this state (cannot bind to it yet or receive packets destined to it).

The Duplicate Address Detection mechanism is described in RFC 4862, section 5.4

2

The address is assigned to an interface.

3

The address is unavailable, e.g. if the interface holding the address is offline.

TABLES

Address

Defined in fuchsia.net.interfaces/interfaces.fidl

OrdinalFieldTypeDescription
addr fuchsia.net/Subnet

The address and prefix length.

Required.

valid_until zx/Time

The time after which the address will no longer be valid.

Its value must be greater than 0. A value of ZX_TIME_INFINITE indicates that the address will always be valid. The value is derived from the monotonic clock.

As a zx.Time, the value has monotonic clock semantics, which implies that it has no meaning outside of the host on which it was generated and no meaning across host restarts.

Optional; may be omitted due to disinterest.

preferred_lifetime_info PreferredLifetimeInfo

Preferred lifetime information.

Optional; may be omitted due to disinterest.

Added: 9
assignment_state AddressAssignmentState

The address's assignment state.

Required.

Added: HEAD

Properties

Defined in fuchsia.net.interfaces/interfaces.fidl

Properties of a network interface.

OrdinalFieldTypeDescription
id fuchsia.net/InterfaceId

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

addresses vector<Address>

The addresses currently installed on the interface.

Addresses are sorted on Address.addr, and no two addresses can have the same Address.addr value.

Only assigned addresses are included unless the watcher was created with WatcherOptions.include_non_assigned_addresses set to true.

online bool

The device is enabled and its physical state is online.

device_class DeviceClass

The device class of the interface. Immutable.

Deprecation

Replaced by port_class. Scheduled for removal in 2025.

Removed: 23 Deprecated: 22
has_default_ipv4_route bool

Whether there is a default IPv4 route through this interface.

has_default_ipv6_route bool

Whether there is a default IPv6 route through this interface.

name Name

The name of the interface. Immutable.

port_class PortClass

The port class of the interface. Immutable.

Added: 22

WatcherOptions

Defined in fuchsia.net.interfaces/interfaces.fidl

OrdinalFieldTypeDescription
address_properties_interest AddressPropertiesInterest

Bitfield for registering interest in address properties.

Optional; interpreted as all bits set to 0 if not present.

Added: HEAD
include_non_assigned_addresses bool

Flag to determine if only assigned addresses are returned (where the assignment state is AddressAssignmentState::Assigned) or all addresses are returned.

Optional; interpreted as false if not present.

Added: HEAD

UNIONS

DeviceClass strict

Defined in fuchsia.net.interfaces/interfaces.fidl

OrdinalVariantTypeDescription
loopback Empty

The interface is loopback.

device fuchsia.hardware.network/DeviceClass

Event strict

Defined in fuchsia.net.interfaces/interfaces.fidl

OrdinalVariantTypeDescription
existing Properties

Properties of an interface that existed when watching started.

All interested fields and Properties.id are set.

added Properties

Properties of an interface that was added while watching.

All interested fields and Properties.id are set.

removed fuchsia.net/InterfaceId

ID of an interface that was removed while watching.

changed Properties

Properties of an interface that changed while watching.

Only Properties.id and interested fields which have changed are set with the new values.

idle Empty

Sentinel value indicating no more existing events will be sent.

PortClass flexible

Defined in fuchsia.net.interfaces/interfaces.fidl

The port class of an interface.

Added: 22
OrdinalVariantTypeDescription
loopback Empty

The interface is loopback.

device fuchsia.hardware.network/PortClass

The interface's network device port class.

PreferredLifetimeInfo strict

Defined in fuchsia.net.interfaces/interfaces.fidl

Information about the preferred lifetime of an IP address or delegated prefix.

Added: 9
OrdinalVariantTypeDescription
preferred_until zx/Time

The end of the preferred lifetime.

The address/prefix should not be considered deprecated if zx.Time is in the past. preferred_until is exchanged as a means to inform the deadline where deprecation is expected to happen.

The preferred lifetime of addresses is defined in RFC 4862, section 2.

Addresses configured using a delegated prefix must have a preferred lifetime no longer than that of the prefix according to RFC 8415, section 6.3.

Must be greater than 0. If zx.Time.INFINITE, the preferred lifetime does not expire.

deprecated Empty

The address/prefix is deprecated.

Deprecated addresses should no longer be used for initiating new connections unless explicitly requested, or if no other non-deprecated addresses are assigned (as described in RFC 4862, section 1).

Addresses configured using a deprecated delegated prefix must also be deprecated according to RFC 8415, section 6.3.

An address/prefix can become undeprecated if its preferred lifetime is extended.

BITS

AddressPropertiesInterest flexible

Type: uint64

Defined in fuchsia.net.interfaces/interfaces.fidl

NameValueDescription
1
2

CONSTANTS

NameValueTypeDescription
INTERFACE_NAME_LENGTH 15 uint8

The maximum length of an interface name.

ALIASES

NameValueDescription
Name string[INTERFACE_NAME_LENGTH]

An interface name as a sequence of bytes.