PROTOCOLS
Provider
Defined in fuchsia.posix.socket.packet/socket.fidl
A packet socket provider.
Socket
Requests a packet socket.
- request
kindthe kind of packet socket to create.
- response
socketthe packet socket.
Request
| Name | Type |
|---|---|
kind |
Kind
|
Response
| Name | Type |
|---|---|
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
- Pointer to the packet of size 0, i.e. not accessed directly (only using cBPF packet load instructions).
- Packet size (BPF_LOAD). Helper functions and maps are not supported.
Request
| Name | Type |
|---|---|
code |
vector<uint64>:4096
|
Response
| Name | Type |
|---|---|
payload |
Socket_AttachBpfFilterUnsafe_Result
|
Bind
Bind the socket to a protocol and/or interface.
- request
protocolthe socket's new protocol association. - request
bound_interface_idthe socket's new interface binding.
Request
| Name | Type |
|---|---|
protocol |
ProtocolAssociation?
|
bound_interface_id |
BoundInterfaceId
|
Response
| Name | Type |
|---|---|
payload |
Socket_Bind_Result
|
Clone
Request
| Name | Type |
|---|---|
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
| Name | Type |
|---|---|
payload |
fuchsia.unknown/Closeable_Close_Result
|
Describe
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
SocketDescribeResponse
|
GetAcceptConn
Get SOL_SOCKET -> SO_ACCEPTCONN.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetAcceptConn_Result
|
GetBindToDevice
Get SOL_SOCKET -> SO_BINDTODEVICE.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetBindToDevice_Result
|
GetBindToInterfaceIndex
Get SOL_SOCKET -> SO_BINDTOIFINDEX.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetBindToInterfaceIndex_Result
|
GetBroadcast
Get SOL_SOCKET -> SO_BROADCAST.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetBroadcast_Result
|
GetCookie
Get SOL_SOCKET -> SO_COOKIE.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.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
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetError_Result
|
GetInfo
Returns the the socket's properties.
- response
kindthe socket'sKind. - response
protocolthe socket's protocol association, if associated. - response
bound_interfaceproperties of the socket's interface binding.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
Socket_GetInfo_Result
|
GetKeepAlive
Get SOL_SOCKET -> SO_KEEPALIVE.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetKeepAlive_Result
|
GetLinger
Get SOL_SOCKET -> SO_LINGER.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
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.
Request
| Name | Type |
|---|---|
domain |
fuchsia.net/MarkDomain
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetMark_Result
|
GetNoCheck
Get SOL_SOCKET -> SO_NO_CHECK.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetNoCheck_Result
|
GetOutOfBandInline
Get SOL_SOCKET -> SO_OOBINLINE.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetOutOfBandInline_Result
|
GetReceiveBuffer
Get SOL_SOCKET -> SO_RCVBUF.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetReceiveBuffer_Result
|
GetReuseAddress
Get SOL_SOCKET -> SO_REUSEADDR.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetReuseAddress_Result
|
GetReusePort
Get SOL_SOCKET -> SO_REUSEPORT.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetReusePort_Result
|
GetSendBuffer
Get SOL_SOCKET -> SO_SNDBUF.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetSendBuffer_Result
|
GetTimestamp
Get SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.
Request
<EMPTY>
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_GetTimestamp_Result
|
Query
Request
<EMPTY>
Response
| Name | Type |
|---|---|
protocol |
vector<uint8>
|
RecvMsg
Receives a message from the socket.
- request
want_packet_inforequest information about the packet to be returned. - request
data_lenthe maximum allowed length of the response data buffer. - request
want_controlrequest ancillary data to be returned. - request
flagsflags for the receive request.
- response
packet_infoinformation about the packet, if requested. - response
datathe message. - response
controlcontrol messages, if requested. - response
truncatedindicates whether or not the returned message was truncated.
Request
| Name | Type |
|---|---|
want_packet_info |
bool
|
data_len |
uint32
|
want_control |
bool
|
flags |
fuchsia.posix.socket/RecvMsgFlags
|
Response
| Name | Type |
|---|---|
payload |
Socket_RecvMsg_Result
|
SendMsg
Sends a message on the socket.
- request
packet_infoinformation about the packet. - request
datathe message. - request
controlancillary data. - request
flagsflags for the send request.
Request
| Name | Type |
|---|---|
packet_info |
PacketInfo?
|
data |
vector<uint8>
|
control |
SendControlData
|
flags |
fuchsia.posix.socket/SendMsgFlags
|
Response
| Name | Type |
|---|---|
payload |
Socket_SendMsg_Result
|
SetBindToDevice
Set SOL_SOCKET -> SO_BINDTODEVICE.
Request
| Name | Type |
|---|---|
value |
fuchsia.net.interfaces/Name
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetBindToDevice_Result
|
SetBindToInterfaceIndex
Set SOL_SOCKET -> SO_BINDTOIFINDEX.
If value is 0, this clears the bound interface.
Request
| Name | Type |
|---|---|
value |
fuchsia.net/InterfaceId
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetBindToInterfaceIndex_Result
|
SetBroadcast
Set SOL_SOCKET -> SO_BROADCAST.
Request
| Name | Type |
|---|---|
value |
bool
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetBroadcast_Result
|
SetKeepAlive
Set SOL_SOCKET -> SO_KEEPALIVE.
Request
| Name | Type |
|---|---|
value |
bool
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetKeepAlive_Result
|
SetLinger
Set SOL_SOCKET -> SO_LINGER.
Request
| Name | Type |
|---|---|
linger |
bool
|
length_secs |
uint32
|
Response
| Name | Type |
|---|---|
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.
Request
| Name | Type |
|---|---|
domain |
fuchsia.net/MarkDomain
|
mark |
fuchsia.posix.socket/OptionalUint32
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetMark_Result
|
SetNoCheck
Set SOL_SOCKET -> SO_NO_CHECK.
Request
| Name | Type |
|---|---|
value |
bool
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetNoCheck_Result
|
SetOutOfBandInline
Set SOL_SOCKET -> SO_OOBINLINE.
Request
| Name | Type |
|---|---|
value |
bool
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetOutOfBandInline_Result
|
SetReceiveBuffer
Set SOL_SOCKET -> SO_RCVBUF.
Request
| Name | Type |
|---|---|
value_bytes |
uint64
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetReceiveBuffer_Result
|
SetReuseAddress
Set SOL_SOCKET -> SO_REUSEADDR.
Request
| Name | Type |
|---|---|
value |
bool
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetReuseAddress_Result
|
SetReusePort
Set SOL_SOCKET -> SO_REUSEPORT.
Request
| Name | Type |
|---|---|
value |
bool
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetReusePort_Result
|
SetSendBuffer
Set SOL_SOCKET -> SO_SNDBUF.
Request
| Name | Type |
|---|---|
value_bytes |
uint64
|
Response
| Name | Type |
|---|---|
payload |
fuchsia.posix.socket/BaseSocket_SetSendBuffer_Result
|
SetTimestamp
Set SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.
Request
| Name | Type |
|---|---|
value |
fuchsia.posix.socket/TimestampOption
|
Response
| Name | Type |
|---|---|
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.
| Field | Type | Description | Default |
|---|---|---|---|
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.
| Field | Type | Description | Default |
|---|---|---|---|
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
| Field | Type | Description | Default |
|---|---|---|---|
socket |
client_end:Socket
|
No default |
RecvPacketInfo
Defined in fuchsia.posix.socket.packet/socket.fidl
| Field | Type | Description | Default |
|---|---|---|---|
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
| Field | Type | Description | Default |
|---|---|---|---|
kind |
Kind
|
No default | |
protocol |
ProtocolAssociation?
|
No default | |
bound_interface |
BoundInterface
|
No default |
Socket_RecvMsg_Response
Defined in fuchsia.posix.socket.packet/socket.fidl
| Field | Type | Description | Default |
|---|---|---|---|
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.
| Name | Value | Description |
|---|---|---|
NETWORK_ONLY |
1 |
Hardware that operates only at the network layer; a pure L3 interface. Hardware of this type have no L2 headers/addressing. |
ETHERNET |
2 |
Hardware that operates on ethernet-based links. |
LOOPBACK |
3 |
Hardware that loops back packets. |
Kind strict
Type: uint32
Defined in fuchsia.posix.socket.packet/socket.fidl
A kind of packet socket.
| Name | Value | Description |
|---|---|---|
NETWORK |
1 |
A packet socket that operates with network-layer packets. |
LINK |
2 |
A packet socket that operates with link-layer packets. Packets are passed unmodified between the wire and client when the packet socket is of this kind. |
PacketType strict
Type: uint32
Defined in fuchsia.posix.socket.packet/socket.fidl
The type of a packet.
| Name | Value | Description |
|---|---|---|
HOST |
1 |
A packet that arrived at its destination. |
BROADCAST |
2 |
A packet that was broadcasted. |
MULTICAST |
3 |
A packet that was multicasted. |
OTHER_HOST |
4 |
A packet that arrived at a host that isn't its destination. |
OUTGOING |
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
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
socket |
fuchsia.posix.socket/SocketRecvControlData
|
Socket level ancillary data. |
SendControlData
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
socket |
fuchsia.posix.socket/SocketSendControlData
|
Socket level ancillary data. |
SocketDescribeResponse resource
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Field | Type | Description |
|---|---|---|---|
1 |
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
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
all |
Empty
|
|
2 |
specified |
InterfaceProperties
|
BoundInterfaceId strict
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
all |
Empty
|
|
2 |
specified |
fuchsia.net/InterfaceId
|
HardwareAddress flexible
Defined in fuchsia.posix.socket.packet/socket.fidl
A hardware address.
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
none |
Empty
|
Indicates that the hardware does not support link-layer addressing. |
2 |
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.
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
all |
Empty
|
An association with all protocols. |
2 |
specified |
Protocol
|
An association with a protocol. |
Provider_Socket_Result strict resource
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Provider_Socket_Response
|
|
2 |
err |
fuchsia.posix/Errno
|
Socket_AttachBpfFilterUnsafe_Result strict
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Socket_AttachBpfFilterUnsafe_Response
|
|
2 |
err |
fuchsia.posix/Errno
|
Socket_Bind_Result strict
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Socket_Bind_Response
|
|
2 |
err |
fuchsia.posix/Errno
|
Socket_GetInfo_Result strict
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Socket_GetInfo_Response
|
|
2 |
err |
fuchsia.posix/Errno
|
Socket_RecvMsg_Result strict
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Socket_RecvMsg_Response
|
|
2 |
err |
fuchsia.posix/Errno
|
Socket_SendMsg_Result strict
Defined in fuchsia.posix.socket.packet/socket.fidl
| Ordinal | Variant | Type | Description |
|---|---|---|---|
1 |
response |
Socket_SendMsg_Response
|
|
2 |
err |
fuchsia.posix/Errno
|
CONSTANTS
| Name | Value | Type | Description |
|---|---|---|---|
| SOCKET_PROTOCOL_NAME | fuchsia.posix.socket.packet/Socket |
String |
Legacy protocol name. Use the generated discoverable protocol name instead. Removed: 29
|
ALIASES
| Name | Value | Description |
|---|---|---|
| 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. |