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
kindKind

Response

NameType
payloadProvider_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
codevector<uint64>:4096

Response

NameType
payloadSocket_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
protocolProtocolAssociation?
bound_interface_idBoundInterfaceId

Response

NameType
payloadSocket_Bind_Result

Clone

Added: 26

Request

NameType
requestserver_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
payloadfuchsia.unknown/Closeable_Close_Result

Describe

Request

<EMPTY>

Response

NameType
payloadSocketDescribeResponse

GetAcceptConn

Get SOL_SOCKET -> SO_ACCEPTCONN.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetAcceptConn_Result

GetBindToDevice

Get SOL_SOCKET -> SO_BINDTODEVICE.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetBindToDevice_Result

GetBindToInterfaceIndex

Get SOL_SOCKET -> SO_BINDTOIFINDEX.

Added: 20

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetBindToInterfaceIndex_Result

GetBroadcast

Get SOL_SOCKET -> SO_BROADCAST.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetBroadcast_Result

GetCookie

Get SOL_SOCKET -> SO_COOKIE.

Added: HEAD

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetCookie_Result

GetError

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

Request

<EMPTY>

Response

NameType
payloadfuchsia.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
payloadSocket_GetInfo_Result

GetKeepAlive

Get SOL_SOCKET -> SO_KEEPALIVE.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetKeepAlive_Result

GetLinger

Get SOL_SOCKET -> SO_LINGER.

Request

<EMPTY>

Response

NameType
payloadfuchsia.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
domainfuchsia.net/MarkDomain

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetMark_Result

GetNoCheck

Get SOL_SOCKET -> SO_NO_CHECK.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetNoCheck_Result

GetOutOfBandInline

Get SOL_SOCKET -> SO_OOBINLINE.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetOutOfBandInline_Result

GetReceiveBuffer

Get SOL_SOCKET -> SO_RCVBUF.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetReceiveBuffer_Result

GetReuseAddress

Get SOL_SOCKET -> SO_REUSEADDR.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetReuseAddress_Result

GetReusePort

Get SOL_SOCKET -> SO_REUSEPORT.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetReusePort_Result

GetSendBuffer

Get SOL_SOCKET -> SO_SNDBUF.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetSendBuffer_Result

GetTimestamp

Get SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

Request

<EMPTY>

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_GetTimestamp_Result

Query

Request

<EMPTY>

Response

NameType
protocolvector<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_infobool
data_lenuint32
want_controlbool
flagsfuchsia.posix.socket/RecvMsgFlags

Response

NameType
payloadSocket_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_infoPacketInfo?
datavector<uint8>
controlSendControlData
flagsfuchsia.posix.socket/SendMsgFlags

Response

NameType
payloadSocket_SendMsg_Result

SetBindToDevice

Set SOL_SOCKET -> SO_BINDTODEVICE.

Request

NameType
valuefuchsia.net.interfaces/Name

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetBindToDevice_Result

SetBindToInterfaceIndex

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

Added: 20

Request

NameType
valuefuchsia.net/InterfaceId

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetBindToInterfaceIndex_Result

SetBroadcast

Set SOL_SOCKET -> SO_BROADCAST.

Request

NameType
valuebool

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetBroadcast_Result

SetKeepAlive

Set SOL_SOCKET -> SO_KEEPALIVE.

Request

NameType
valuebool

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetKeepAlive_Result

SetLinger

Set SOL_SOCKET -> SO_LINGER.

Request

NameType
lingerbool
length_secsuint32

Response

NameType
payloadfuchsia.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
domainfuchsia.net/MarkDomain
markfuchsia.posix.socket/OptionalUint32

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetMark_Result

SetNoCheck

Set SOL_SOCKET -> SO_NO_CHECK.

Request

NameType
valuebool

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetNoCheck_Result

SetOutOfBandInline

Set SOL_SOCKET -> SO_OOBINLINE.

Request

NameType
valuebool

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetOutOfBandInline_Result

SetReceiveBuffer

Set SOL_SOCKET -> SO_RCVBUF.

Request

NameType
value_bytesuint64

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetReceiveBuffer_Result

SetReuseAddress

Set SOL_SOCKET -> SO_REUSEADDR.

Request

NameType
valuebool

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetReuseAddress_Result

SetReusePort

Set SOL_SOCKET -> SO_REUSEPORT.

Request

NameType
valuebool

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetReusePort_Result

SetSendBuffer

Set SOL_SOCKET -> SO_SNDBUF.

Request

NameType
value_bytesuint64

Response

NameType
payloadfuchsia.posix.socket/BaseSocket_SetSendBuffer_Result

SetTimestamp

Set SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

Request

NameType
valuefuchsia.posix.socket/TimestampOption

Response

NameType
payloadfuchsia.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
idfuchsia.net/InterfaceId

The interface's ID.

No default
addrHardwareAddress

The interface's hardware address.

No default
typeHardwareType

The interface's hardware type.

No default

PacketInfo

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

Information about a packet.

FieldTypeDescriptionDefault
protocolProtocolNo default
interface_idfuchsia.net/InterfaceIdNo default
addrHardwareAddressNo default

Provider_Socket_Response resource

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

FieldTypeDescriptionDefault
socketclient_end:SocketNo default

RecvPacketInfo

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

FieldTypeDescriptionDefault
packet_infoPacketInfoNo default
packet_typePacketTypeNo default
interface_typeHardwareTypeNo 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
kindKindNo default
protocolProtocolAssociation?No default
bound_interfaceBoundInterfaceNo default

Socket_RecvMsg_Response

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

FieldTypeDescriptionDefault
packet_infoRecvPacketInfo?No default
datavector<uint8>No default
controlRecvControlDataNo default
truncateduint32No 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
socketfuchsia.posix.socket/SocketRecvControlData

Socket level ancillary data.

SendControlData

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

OrdinalFieldTypeDescription
socketfuchsia.posix.socket/SocketSendControlData

Socket level ancillary data.

SocketDescribeResponse resource

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

OrdinalFieldTypeDescription
eventhandle<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
allEmpty
specifiedInterfaceProperties

BoundInterfaceId strict

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

OrdinalVariantTypeDescription
allEmpty
specifiedfuchsia.net/InterfaceId

HardwareAddress flexible

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

A hardware address.

OrdinalVariantTypeDescription
noneEmpty

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

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

An association with all protocols.

specifiedProtocol

An association with a protocol.

Provider_Socket_Result strict resource

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

OrdinalVariantTypeDescription
responseProvider_Socket_Response
errfuchsia.posix/Errno

Socket_AttachBpfFilterUnsafe_Result strict

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

OrdinalVariantTypeDescription
responseSocket_AttachBpfFilterUnsafe_Response
errfuchsia.posix/Errno

Socket_Bind_Result strict

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

OrdinalVariantTypeDescription
responseSocket_Bind_Response
errfuchsia.posix/Errno

Socket_GetInfo_Result strict

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

OrdinalVariantTypeDescription
responseSocket_GetInfo_Response
errfuchsia.posix/Errno

Socket_RecvMsg_Result strict

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

OrdinalVariantTypeDescription
responseSocket_RecvMsg_Response
errfuchsia.posix/Errno

Socket_SendMsg_Result strict

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

OrdinalVariantTypeDescription
responseSocket_SendMsg_Response
errfuchsia.posix/Errno

CONSTANTS

NameValueTypeDescription
SOCKET_PROTOCOL_NAMEfuchsia.posix.socket.packet/SocketString

ALIASES

NameValueDescription
Protocoluint16

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

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