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

fuchsia.netstack

PROTOCOLS

Netstack

Defined in fuchsia.netstack/netstack.fidl

AddEthernetDevice

Request

NameType
topological_path string
interfaceConfig InterfaceConfig
device fuchsia.hardware.ethernet/Device

Response

NameType
nicid uint32

BridgeInterfaces

Creates a bridge and returns the newly created nicid or an error if the creation fails.

Request

NameType
nicids vector<uint32>

Response

NameType
result NetErr
nicid uint32

GetDhcpClient

Request

NameType
nicid uint32
client request<fuchsia.net.dhcp/Client>

Response

NameType
result Netstack_GetDhcpClient_Result

GetInterfaces

Returns the list of registered network interfaces.

Request

NameType

Response

NameType
interfaces vector<NetInterface>

GetInterfaces2

Request

NameType

Response

NameType
interfaces vector<NetInterface2>

GetRouteTable

Returns current route table.

Request

NameType

Response

NameType
rt vector<RouteTableEntry>

GetRouteTable2

Request

NameType

Response

NameType
rt vector<RouteTableEntry2>

OnInterfacesChanged

Response

NameType
interfaces vector<NetInterface>

RemoveInterfaceAddress

Removes the address for the interface with the given nicid. Masks off addr.PrefixLen bits from addr.Addr to set the subnet.

Request

NameType
nicid uint32
addr fuchsia.net/IpAddress
prefixLen uint8

Response

NameType
result NetErr

SetInterfaceAddress

Sets the address for the interface with the given nicid. Masks off addr.PrefixLen bits from addr.Addr to set the subnet.

Request

NameType
nicid uint32
addr fuchsia.net/IpAddress
prefixLen uint8

Response

NameType
result NetErr

SetInterfaceMetric

Sets the route metric for the interface with the given nicid.

Request

NameType
nicid uint32
metric uint32

Response

NameType
result NetErr

SetInterfaceStatus

Sets the status (up or down) for the interface with the given nicid.

Request

NameType
nicid uint32
enabled bool

StartRouteTableTransaction

Begin a route transaction for atomically getting and setting the route table. Returns true if a transaction can be started.

Request

NameType
routeTableTransaction request<RouteTableTransaction>

Response

NameType
status zx/status

RouteTableTransaction

Defined in fuchsia.netstack/netstack.fidl

AddRoute

Request

NameType
r RouteTableEntry2

Response

NameType
status zx/status

DelRoute

Request

NameType
r RouteTableEntry2

Response

NameType
status zx/status

STRUCTS

InterfaceConfig

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault
name fuchsia.posix.socket/interface_name No default
filepath string

An unstable file path corresponding to the interface. Used in watching the creation and destruction of the interface, or in accessing the interface using netdump.

No default
metric uint32 No default
ip_address_config IpAddressConfig

Deprecated; to configure a network interface, use SetDhcpClientStatus and SetInterfaceAddress instead.

No default

NetErr

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault
status Status No default
message string No default

NetInterface

Defined in fuchsia.netstack/netstack.fidl

https://linux.die.net/man/7/netdevice

NameTypeDescriptionDefault
id uint32 No default
flags uint32 No default
features uint32 No default
configuration uint32 No default
name fuchsia.posix.socket/interface_name No default
addr fuchsia.net/IpAddress

addr is one of the interface's IPv4 addresses, even if the interface holds multiple. No guarantees are made about which address is used when an interface has multiple IPv4 addresses.

If the interface does not have an IPv4 address, addr is the unspecified IPv4 address (0.0.0.0).

No default
netmask fuchsia.net/IpAddress

netmask is addr's corresponding network mask.

If the interface does not have an IPv4 address, netmask is the 0 netmask (0.0.0.0).

No default
broadaddr fuchsia.net/IpAddress

netmask is addr's corresponding network's broadcast address.

If the interface does not have an IPv4 address, broadaddr is the unspecified IPv4 address (0.0.0.0).

No default
ipv6addrs vector<fuchsia.net/Subnet> No default
hwaddr vector<uint8> No default

NetInterface2

Defined in fuchsia.netstack/netstack.fidl

New version that includes a metric value.

NameTypeDescriptionDefault
id uint32 No default
flags uint32 No default
features uint32 No default
configuration uint32 No default
metric uint32 No default
name fuchsia.posix.socket/interface_name No default
addr fuchsia.net/IpAddress

addr is one of the interface's IPv4 addresses, even if the interface holds multiple. No guarantees are made about which address is used when an interface has multiple IPv4 addresses.

If the interface does not have an IPv4 address, addr is the unspecified IPv4 address (0.0.0.0).

No default
netmask fuchsia.net/IpAddress

netmask is addr's corresponding network mask.

If the interface does not have an IPv4 address, netmask is the 0 netmask (0.0.0.0).

No default
broadaddr fuchsia.net/IpAddress

netmask is addr's corresponding network's broadcast address.

If the interface does not have an IPv4 address, broadaddr is the unspecified IPv4 address (0.0.0.0).

No default
ipv6addrs vector<fuchsia.net/Subnet> No default
hwaddr vector<uint8> No default

Netstack_GetDhcpClient_Response

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault

RouteTableEntry

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault
destination fuchsia.net/IpAddress No default
netmask fuchsia.net/IpAddress No default
gateway fuchsia.net/IpAddress No default
nicid uint32 No default

RouteTableEntry2

Defined in fuchsia.netstack/netstack.fidl

New version that includes a metric value.

NameTypeDescriptionDefault
destination fuchsia.net/IpAddress No default
netmask fuchsia.net/IpAddress No default
gateway fuchsia.net/IpAddress? No default
nicid uint32 No default
metric uint32 No default

SocketAddress

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault
addr fuchsia.net/IpAddress No default
port uint16 No default

ENUMS

Protocol

Type: uint32

Defined in fuchsia.netstack/netstack.fidl

NameValueDescription
UNSPECIFIED 0
UDP 1
TCP 2

Status

Type: uint32

Defined in fuchsia.netstack/netstack.fidl

NameValueDescription
OK 0
UNKNOWN_ERROR 1
DNS_ERROR 2
PARSE_ERROR 3
IPV4_ONLY 4
UNKNOWN_INTERFACE 5

UNIONS

IpAddressConfig

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescription
static_ip fuchsia.net/Subnet
dhcp bool

Netstack_GetDhcpClient_Result

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescription
response Netstack_GetDhcpClient_Response
err zx/status

CONSTANTS

NameValueTypeDescription
NetInterfaceFlagDhcp 2 uint32
NetInterfaceFlagUp 1 uint32

Flags for NetInterface.flags.