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

fuchsia.net

PROTOCOLS

Connectivity

Defined in fuchsia.net/connectivity.fidl

OnNetworkReachable

This is triggered on a state change in network reachability. Clients should expect that network requests will succeed when reachable is true.

Response

NameType
reachable bool

NameLookup

Defined in fuchsia.net/namelookup.fidl

LookupHostname

Look up a hostname by IP address.

Request

NameType
addr IpAddress

Response

NameType
result NameLookup_LookupHostname_Result

LookupIp

Look up a list of IP addresses by hostname.

If hostname is an Internationalized Domain Name, it must be encoded as per RFC 3490.

Request

NameType
hostname Hostname
options LookupIpOptions

Response

NameType
result NameLookup_LookupIp_Result

STRUCTS

Endpoint

Defined in fuchsia.net/net.fidl

Endpoint describes an IP address and port. The network protocol associated with the Endpoint will be known from context or communicated through additional structures.

NameTypeDescriptionDefault
addr IpAddress

The IP address of the endpoint.

No default
port uint16

The port number of the endpoint.

No default

IpAddressInfo

Defined in fuchsia.net/namelookup.fidl

NameTypeDescriptionDefault
ipv4_addrs vector<Ipv4Address>[256]

All of the IPv4 addresses for the requested hostname.

No default
ipv6_addrs vector<Ipv6Address>[256]

All of the IPv6 addresses for the requested hostname.

No default
canonical_name string[256]?

The canonical name of the requested hostname (usually the DNS CNAME record, if one exists).

No default

Ipv4Address

Defined in fuchsia.net/net.fidl

Ipv4Address is expressed in network byte order, so the most significant byte ("127" in the address "127.0.0.1") will be at index 0.

NameTypeDescriptionDefault
addr uint8[4] No default

Ipv4SocketAddress

Defined in fuchsia.net/socket.fidl

An IPv4 socket address, composed of an IPv4 address and a port.

Inspired by the address definition in the POSIX specification.

NameTypeDescriptionDefault
address Ipv4Address

IPv4 Address.

No default
port uint16

Transport-layer port.

No default

Ipv6Address

Defined in fuchsia.net/net.fidl

Ipv6Address is expressed in network byte order, so the most significant byte ("ff" in the address "ff02::1") will be at index 0.

NameTypeDescriptionDefault
addr uint8[16] No default

Ipv6SocketAddress

Defined in fuchsia.net/socket.fidl

An IPV6 socket address, composed of an IPv6 address, a port, and a scope identifier.

Inspired by the address definition in the POSIX specification.

NameTypeDescriptionDefault
address Ipv6Address

IPv6 Address.

No default
port uint16

Transport-layer port.

No default
zone_index uint64

Provides a means to identify to which zone a non-global address belongs.

A node may have interfaces attached to different zones of the same scope, for example different link-local zones are disambiguated by the use of a zone_index providing the interface identifier.

zone_index 0 is the default zone.

See RFC 4007 for terminology and examples.

No default

MacAddress

Defined in fuchsia.net/net.fidl

A MAC address used to identify a network interface on the data link layer within the network.

NameTypeDescriptionDefault
octets uint8[6] No default

NameLookup_LookupHostname_Response

Defined in fuchsia.net/namelookup.fidl

NameTypeDescriptionDefault
hostname Hostname No default

NameLookup_LookupIp_Response

Defined in fuchsia.net/namelookup.fidl

NameTypeDescriptionDefault
addr IpAddressInfo No default

Subnet

Defined in fuchsia.net/net.fidl

Subnet describes an IP subnetwork, where all host IP addresses share the same most significant bits.

NameTypeDescriptionDefault
addr IpAddress

The Ipv4 or Ipv6 address. Only the prefix_len most significant bits may be set in addr; all bits in the host portion of the address must be zero.

No default
prefix_len uint8

The prefix length of the netmask. E.g. for 192.168.1.0/24, the prefix length is 24, corresponding to a netmask of 255.255.255.0. For Ipv4, prefix_len must be in the range [0, 32]. For Ipv6, prefix_len must be in the range [0, 128].

No default

ENUMS

LookupError

Type: uint32

Defined in fuchsia.net/namelookup.fidl

NameValueDescription
NOT_FOUND 1

No result was found for this query.

TRANSIENT 2

The lookup failed, but may succeed at a later time. For instance, the network or DNS server may be unreachable.

INVALID_ARGS 3

The lookup failed due to an invalid argument (for instance, the hostname was not encoded correctly, or was too long).

INTERNAL_ERROR 4

The lookup failed due to an internal error.

UNIONS

IpAddress

Defined in fuchsia.net/net.fidl

Represents an IP address that may be either v4 or v6.

NameTypeDescription
ipv4 Ipv4Address
ipv6 Ipv6Address

NameLookup_LookupHostname_Result

Defined in fuchsia.net/namelookup.fidl

NameTypeDescription
response NameLookup_LookupHostname_Response
err LookupError

NameLookup_LookupIp_Result

Defined in fuchsia.net/namelookup.fidl

NameTypeDescription
response NameLookup_LookupIp_Response
err LookupError

SocketAddress

Defined in fuchsia.net/socket.fidl

Represents an IP socket address that may be either v4 or v6.

NameTypeDescription
ipv4 Ipv4SocketAddress
ipv6 Ipv6SocketAddress

BITS

LookupIpOptions

Type: uint8

NameValueDescription
V4_ADDRS 1

If the lookup should return IPv4 addresses.

V6_ADDRS 2

If the lookup should return IPv6 addresses.

CNAME_LOOKUP 4

If the lookup should return a canonical_name, if one exists.

CONSTANTS

NameValueTypeDescription
MAX_HOSTNAME_SIZE 255 uint64

The maximum length of a hostname, as per RFC 1035 section 2.3.4.

TYPE ALIASES

NameValueDescription
Hostname string[MAX_HOSTNAME_SIZE]

A hostname.

Although the maximum length of a domain or hostname is 255 characters, each label within a name must not be longer than 63 characters as per RFC 1035 section 2.3.4. A label in a host name is the alphanumeric characters or hyphens, seperated by a period (e.g. abc.com has two labels, 'abc' and 'com').