fuchsia.posix.socket.packet

Added: 11

PROTOCOLS

Provider

Defined in fuchsia.posix.socket.packet/socket.fidl

A packet socket provider.

Socket

Requests a packet socket.

  • request kind the kind of packet socket to create.
  • response socket the packet socket.

Request

NameType
kind Kind

Response

NameType
payload Provider_Socket_Result

Socket

Defined in fuchsia.posix.socket.packet/socket.fidl

A packet socket.

This interface is essentially POSIX.

All methods on this type are nonblocking; their exact behaviors match their Linux counterparts.

Warning: This protocol is not yet ready for direct use by clients. Instead, clients should use the BSD sockets API to interact with sockets. We plan to change this protocol substantially and clients that couple directly to this protocol will make those changes more difficult.

AttachBpfFilterUnsafe

Attaches the specified eBPF filter. The filter is assumed to be verified with 2 arguments

  1. Pointer to the packet of size 0, i.e. not accessed directly (only using cBPF packet load instructions).
  2. Packet size (BPF_LOAD). Helper functions and maps are not supported.
Added: HEAD

Request

NameType
code vector<uint64>:4096

Response

NameType
payload Socket_AttachBpfFilterUnsafe_Result

Bind

Bind the socket to a protocol and/or interface.

  • request protocol the socket's new protocol association.
  • request bound_interface_id the socket's new interface binding.

Request

NameType
protocol ProtocolAssociation?
bound_interface_id BoundInterfaceId

Response

NameType
payload Socket_Bind_Result

Clone2

Request

NameType
request server_end:fuchsia.unknown/Cloneable

Close

Terminates the connection.

After calling Close, the client must not send any other requests.

Servers, after sending the status response, should close the connection regardless of status and without sending an epitaph.

Closing the client end of the channel should be semantically equivalent to calling Close without knowing when the close has completed or its status.

Request

<EMPTY>

Response

NameType
payload fuchsia.unknown/Closeable_Close_Result

Describe

Request

<EMPTY>

Response

NameType
payload SocketDescribeResponse

GetAcceptConn

Get SOL_SOCKET -> SO_ACCEPTCONN.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetAcceptConn_Result

GetBindToDevice

Get SOL_SOCKET -> SO_BINDTODEVICE.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetBindToDevice_Result

GetBindToInterfaceIndex

Get SOL_SOCKET -> SO_BINDTOIFINDEX.

Added: 20

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetBindToInterfaceIndex_Result

GetBroadcast

Get SOL_SOCKET -> SO_BROADCAST.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetBroadcast_Result

GetError

Get SOL_SOCKET -> SO_ERROR. Returns the last error if there is an error set on the socket.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetError_Result

GetInfo

Returns the the socket's properties.

  • response kind the socket's Kind.
  • response protocol the socket's protocol association, if associated.
  • response bound_interface properties of the socket's interface binding.

Request

<EMPTY>

Response

NameType
payload Socket_GetInfo_Result

GetKeepAlive

Get SOL_SOCKET -> SO_KEEPALIVE.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetKeepAlive_Result

GetLinger

Get SOL_SOCKET -> SO_LINGER.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetLinger_Result

GetMark

Like getting SOL_SOCKET -> SO_MARK. The major difference is that unlike the standard SO_MARK, this API has multiple mark domains and each mark can be retrieved independently in each domain.

Added: HEAD

Request

NameType
domain fuchsia.posix.socket/MarkDomain

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetMark_Result

GetNoCheck

Get SOL_SOCKET -> SO_NO_CHECK.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetNoCheck_Result

GetOutOfBandInline

Get SOL_SOCKET -> SO_OOBINLINE.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetOutOfBandInline_Result

GetReceiveBuffer

Get SOL_SOCKET -> SO_RCVBUF.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetReceiveBuffer_Result

GetReuseAddress

Get SOL_SOCKET -> SO_REUSEADDR.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetReuseAddress_Result

GetReusePort

Get SOL_SOCKET -> SO_REUSEPORT.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetReusePort_Result

GetSendBuffer

Get SOL_SOCKET -> SO_SNDBUF.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetSendBuffer_Result

GetTimestamp

Get SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

Request

<EMPTY>

Response

NameType
payload fuchsia.posix.socket/BaseSocket_GetTimestamp_Result

Query

Request

<EMPTY>

Response

NameType
protocol vector<uint8>

RecvMsg

Receives a message from the socket.

  • request want_packet_info request information about the packet to be returned.
  • request data_len the maximum allowed length of the response data buffer.
  • request want_control request ancillary data to be returned.
  • request flags flags for the receive request.
  • response packet_info information about the packet, if requested.
  • response data the message.
  • response control control messages, if requested.
  • response truncated indicates whether or not the returned message was truncated.

Request

NameType
want_packet_info bool
data_len uint32
want_control bool
flags fuchsia.posix.socket/RecvMsgFlags

Response

NameType
payload Socket_RecvMsg_Result

SendMsg

Sends a message on the socket.

  • request packet_info information about the packet.
  • request data the message.
  • request control ancillary data.
  • request flags flags for the send request.

Request

NameType
packet_info PacketInfo?
data vector<uint8>
control SendControlData
flags fuchsia.posix.socket/SendMsgFlags

Response

NameType
payload Socket_SendMsg_Result

SetBindToDevice

Set SOL_SOCKET -> SO_BINDTODEVICE.

Request

NameType
value fuchsia.net.interfaces/Name

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetBindToDevice_Result

SetBindToInterfaceIndex

Set SOL_SOCKET -> SO_BINDTOIFINDEX. If value is 0, this clears the bound interface.

Added: 20

Request

NameType
value fuchsia.net/InterfaceId

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetBindToInterfaceIndex_Result

SetBroadcast

Set SOL_SOCKET -> SO_BROADCAST.

Request

NameType
value bool

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetBroadcast_Result

SetKeepAlive

Set SOL_SOCKET -> SO_KEEPALIVE.

Request

NameType
value bool

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetKeepAlive_Result

SetLinger

Set SOL_SOCKET -> SO_LINGER.

Request

NameType
linger bool
length_secs uint32

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetLinger_Result

SetMark

Like setting SOL_SOCKET -> SO_MARK. The major difference is that unlike the standard SO_MARK, this API has multiple mark domains and each mark can be set independently in each domain.

Added: HEAD

Request

NameType
domain fuchsia.posix.socket/MarkDomain
mark fuchsia.posix.socket/OptionalUint32

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetMark_Result

SetNoCheck

Set SOL_SOCKET -> SO_NO_CHECK.

Request

NameType
value bool

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetNoCheck_Result

SetOutOfBandInline

Set SOL_SOCKET -> SO_OOBINLINE.

Request

NameType
value bool

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetOutOfBandInline_Result

SetReceiveBuffer

Set SOL_SOCKET -> SO_RCVBUF.

Request

NameType
value_bytes uint64

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetReceiveBuffer_Result

SetReuseAddress

Set SOL_SOCKET -> SO_REUSEADDR.

Request

NameType
value bool

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetReuseAddress_Result

SetReusePort

Set SOL_SOCKET -> SO_REUSEPORT.

Request

NameType
value bool

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetReusePort_Result

SetSendBuffer

Set SOL_SOCKET -> SO_SNDBUF.

Request

NameType
value_bytes uint64

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetSendBuffer_Result

SetTimestamp

Set SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

Request

NameType
value fuchsia.posix.socket/TimestampOption

Response

NameType
payload fuchsia.posix.socket/BaseSocket_SetTimestamp_Result

STRUCTS

Empty

Defined in fuchsia.posix.socket.packet/socket.fidl

<EMPTY>

InterfaceProperties

Defined in fuchsia.posix.socket.packet/socket.fidl

An interface's properties.

FieldTypeDescriptionDefault
id fuchsia.net/InterfaceId

The interface's ID.

No default
addr HardwareAddress

The interface's hardware address.

No default
type HardwareType

The interface's hardware type.

No default

PacketInfo

Defined in fuchsia.posix.socket.packet/socket.fidl

Information about a packet.

FieldTypeDescriptionDefault
protocol Protocol No default
interface_id fuchsia.net/InterfaceId No default
addr HardwareAddress No default

Provider_Socket_Response resource

Defined in fuchsia.posix.socket.packet/socket.fidl

FieldTypeDescriptionDefault
socket client_end:Socket No default

RecvPacketInfo

Defined in fuchsia.posix.socket.packet/socket.fidl

FieldTypeDescriptionDefault
packet_info PacketInfo No default
packet_type PacketType No default
interface_type HardwareType No default

Socket_AttachBpfFilterUnsafe_Response

Defined in fuchsia.posix.socket.packet/socket.fidl

<EMPTY>

Socket_Bind_Response

Defined in fuchsia.posix.socket.packet/socket.fidl

<EMPTY>

Socket_GetInfo_Response

Defined in fuchsia.posix.socket.packet/socket.fidl

FieldTypeDescriptionDefault
kind Kind No default
protocol ProtocolAssociation? No default
bound_interface BoundInterface No default

Socket_RecvMsg_Response

Defined in fuchsia.posix.socket.packet/socket.fidl

FieldTypeDescriptionDefault
packet_info RecvPacketInfo? No default
data vector<uint8> No default
control RecvControlData No default
truncated uint32 No default

Socket_SendMsg_Response

Defined in fuchsia.posix.socket.packet/socket.fidl

<EMPTY>

ENUMS

HardwareType strict

Type: uint32

Defined in fuchsia.posix.socket.packet/socket.fidl

The type of a hardware.

NameValueDescription
1

Hardware that operates only at the network layer; a pure L3 interface.

Hardware of this type have no L2 headers/addressing.

2

Hardware that operates on ethernet-based links.

3

Hardware that loops back packets.

Kind strict

Type: uint32

Defined in fuchsia.posix.socket.packet/socket.fidl

A kind of packet socket.

NameValueDescription
1

A packet socket that operates with network-layer packets.

PacketType strict

Type: uint32

Defined in fuchsia.posix.socket.packet/socket.fidl

The type of a packet.

NameValueDescription
1

A packet that arrived at its destination.

2

A packet that was broadcasted.

3

A packet that was multicasted.

4

A packet that arrived at a host that isn't its destination.

5

A packet that is being sent on a local interface, regardless of how it is being sent (unicasted, multicasted, broadcasted).

TABLES

RecvControlData

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalFieldTypeDescription
socket fuchsia.posix.socket/SocketRecvControlData

Socket level ancillary data.

SendControlData

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalFieldTypeDescription
socket fuchsia.posix.socket/SocketSendControlData

Socket level ancillary data.

SocketDescribeResponse resource

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalFieldTypeDescription
event handle<eventpair>

Signals additional information about the state of the socket such as readiness or shutdown-ness.

UNIONS

BoundInterface strict

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalVariantTypeDescription
all Empty
specified InterfaceProperties

BoundInterfaceId strict

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalVariantTypeDescription
all Empty
specified fuchsia.net/InterfaceId

HardwareAddress flexible

Defined in fuchsia.posix.socket.packet/socket.fidl

A hardware address.

OrdinalVariantTypeDescription
none Empty

Indicates that the hardware does not support link-layer addressing.

eui48 fuchsia.net/MacAddress

An EUI-48 based address.

ProtocolAssociation strict

Defined in fuchsia.posix.socket.packet/socket.fidl

The protocol association for a packet socket.

OrdinalVariantTypeDescription
all Empty

An association with all protocols.

specified Protocol

An association with a protocol.

Provider_Socket_Result strict resource

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalVariantTypeDescription
response Provider_Socket_Response
err fuchsia.posix/Errno

Socket_AttachBpfFilterUnsafe_Result strict

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalVariantTypeDescription
response Socket_AttachBpfFilterUnsafe_Response
err fuchsia.posix/Errno

Socket_Bind_Result strict

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalVariantTypeDescription
response Socket_Bind_Response
err fuchsia.posix/Errno

Socket_GetInfo_Result strict

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalVariantTypeDescription
response Socket_GetInfo_Response
err fuchsia.posix/Errno

Socket_RecvMsg_Result strict

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalVariantTypeDescription
response Socket_RecvMsg_Response
err fuchsia.posix/Errno

Socket_SendMsg_Result strict

Defined in fuchsia.posix.socket.packet/socket.fidl

OrdinalVariantTypeDescription
response Socket_SendMsg_Response
err fuchsia.posix/Errno

CONSTANTS

NameValueTypeDescription
SOCKET_PROTOCOL_NAME fuchsia.posix.socket.packet/Socket String

ALIASES

NameValueDescription
Protocol uint16

A network-layer protocol (above link-layer).

Values are defined by https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml.