fuchsia.netstack

PROTOCOLS

Netstack

Defined in fuchsia.netstack/netstack.fidl

GetPortForService

Finds the port number from a given service name and protocol. [service] can be a number like "42", or a service name like "http". If [protocol] is UNSPECIFIED, the service is checked for TCP first, then UDP.

Request

NameType
service string
protocol Protocol

Response

NameType
port uint16

GetAddress

Finds the IP address for a given host name and port. This may issue network requests via DNS to look up domain names. E.g. GetAddress("example.com", 80) -> [{142.42.42.1}]

Request

NameType
address string
port uint16

Response

NameType
addresses vector<SocketAddress>
err NetErr

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>

GetStats

Request

NameType
nicid uint32

Response

NameType
stats NetInterfaceStats

SetInterfaceStatus

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

Request

NameType
nicid uint32
enabled bool

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

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

SetInterfaceMetric

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

Request

NameType
nicid uint32
metric uint32

Response

NameType
result NetErr

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

AddEthernetDevice

Request

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

Response

NameType
nicid uint32

GetDhcpClient

Request

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

Response

NameType
result Netstack_GetDhcpClient_Result

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 int32

OnInterfacesChanged

Response

NameType
interfaces vector<NetInterface>

ResolverAdmin

Defined in fuchsia.netstack/netstack.fidl

SetNameServers

Request

NameType
servers vector<fuchsia.net/IpAddress>

RouteTableTransaction

Defined in fuchsia.netstack/netstack.fidl

AddRoute

Request

NameType
r RouteTableEntry2

Response

NameType
status int32

DelRoute

Request

NameType
r RouteTableEntry2

Response

NameType
status int32

STRUCTS

Netstack_GetDhcpClient_Response

generated

NameTypeDescriptionDefault

NetErr

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault
status Status No default
message string No default

NetTrafficStats

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault
pkts_total uint64 No default
bytes_total uint64 No default

NetInterfaceStats

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault
up_since int64 Placeholder for all statistics regarding the network interface, including, but not limited to traffic itself. No default
rx NetTrafficStats No default
tx NetTrafficStats No default

InterfaceConfig

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescriptionDefault
name string 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

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 string No default
addr fuchsia.net/IpAddress No default
netmask fuchsia.net/IpAddress No default
broadaddr fuchsia.net/IpAddress 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 string No default
addr fuchsia.net/IpAddress No default
netmask fuchsia.net/IpAddress No default
broadaddr fuchsia.net/IpAddress No default
ipv6addrs vector<fuchsia.net/Subnet> No default
hwaddr vector<uint8> No default

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

Netstack_GetDhcpClient_Result

generated

NameTypeDescription
response Netstack_GetDhcpClient_Response
err int32

IpAddressConfig

Defined in fuchsia.netstack/netstack.fidl

NameTypeDescription
static_ip fuchsia.net/Subnet
dhcp bool

CONSTANTS

NameValueTypeDescription
NetInterfaceFlagUp 1 uint32 Flags for NetInterface.flags.
NetInterfaceFlagDhcp 2 uint32