<br />

Added: 11

## **PROTOCOLS**

## Provider

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=246)*

A packet socket provider.

<br />

### Socket

Requests a packet socket.

- request `kind` the kind of packet socket to create.

<!-- -->

- response `socket` the packet socket.

#### Request

| Name | Type |
|---|---|
| `kind` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Kind` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Provider_Socket_Result` |

### SocketWithOptions

Requests a packet socket with creation options.

- request `kind` the kind of packet socket to create.
- request `opts` creation options for the socket.

<!-- -->

- response `socket` the packet socket.

Added: HEAD

#### Request

| Name | Type |
|---|---|
| `kind` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Kind` |
| `opts` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#SocketCreationOptions` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Provider_SocketWithOptions_Result` |

## Socket

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=142)*

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.

<br />

### 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

| Name | Type |
|---|---|
| `code` | `vector<uint64>:4096` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#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

| Name | Type |
|---|---|
| `protocol` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#ProtocolAssociation?` |
| `bound_interface_id` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#BoundInterfaceId` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket_Bind_Result` |

### Clone

Added: 26

#### Request

| Name | Type |
|---|---|
| `request` | `server_end:https://fuchsia.dev/reference/fuchsia.unknown//https://fuchsia.dev/reference/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` | `https://fuchsia.dev/reference/fuchsia.unknown//https://fuchsia.dev/reference/fuchsia.unknown#Closeable_Close_Result` |

### Describe

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#SocketDescribeResponse` |

### GetAcceptConn

Get `SOL_SOCKET` -\> `SO_ACCEPTCONN`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetAcceptConn_Result` |

### GetBindToDevice

Get `SOL_SOCKET` -\> `SO_BINDTODEVICE`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetBindToDevice_Result` |

### GetBindToInterfaceIndex

Get `SOL_SOCKET` -\> `SO_BINDTOIFINDEX`.
Added: 20

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetBindToInterfaceIndex_Result` |

### GetBroadcast

Get `SOL_SOCKET` -\> `SO_BROADCAST`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetBroadcast_Result` |

### GetCookie

Get `SOL_SOCKET` -\> `SO_COOKIE`.
Added: HEAD

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/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` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/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

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket_GetInfo_Result` |

### GetKeepAlive

Get `SOL_SOCKET` -\> `SO_KEEPALIVE`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetKeepAlive_Result` |

### GetLinger

Get `SOL_SOCKET` -\> `SO_LINGER`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/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

| Name | Type |
|---|---|
| `domain` | `https://fuchsia.dev/reference/fuchsia.net//https://fuchsia.dev/reference/fuchsia.net#MarkDomain` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetMark_Result` |

### GetNoCheck

Get `SOL_SOCKET` -\> `SO_NO_CHECK`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetNoCheck_Result` |

### GetOutOfBandInline

Get `SOL_SOCKET` -\> `SO_OOBINLINE`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetOutOfBandInline_Result` |

### GetReceiveBuffer

Get `SOL_SOCKET` -\> `SO_RCVBUF`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetReceiveBuffer_Result` |

### GetReuseAddress

Get `SOL_SOCKET` -\> `SO_REUSEADDR`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetReuseAddress_Result` |

### GetReusePort

Get `SOL_SOCKET` -\> `SO_REUSEPORT`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetReusePort_Result` |

### GetSendBuffer

Get `SOL_SOCKET` -\> `SO_SNDBUF`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_GetSendBuffer_Result` |

### GetTimestamp

Get `SOL_SOCKET` -\> `SO_TIMESTAMP` or `SO_TIMESTAMPNS`.

#### Request

\<EMPTY\>

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/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_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

| Name | Type |
|---|---|
| `want_packet_info` | `bool` |
| `data_len` | `uint32` |
| `want_control` | `bool` |
| `flags` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#RecvMsgFlags` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#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

| Name | Type |
|---|---|
| `packet_info` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#PacketInfo?` |
| `data` | `vector<uint8>` |
| `control` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#SendControlData` |
| `flags` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#SendMsgFlags` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket_SendMsg_Result` |

### SetBindToDevice

Set `SOL_SOCKET` -\> `SO_BINDTODEVICE`.

#### Request

| Name | Type |
|---|---|
| `value` | `https://fuchsia.dev/reference/fuchsia.net.interfaces//https://fuchsia.dev/reference/fuchsia.net.interfaces#Name` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetBindToDevice_Result` |

### SetBindToInterfaceIndex

Set `SOL_SOCKET` -\> `SO_BINDTOIFINDEX`.
If `value` is 0, this clears the bound interface.
Added: 20

#### Request

| Name | Type |
|---|---|
| `value` | `https://fuchsia.dev/reference/fuchsia.net//https://fuchsia.dev/reference/fuchsia.net#InterfaceId` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetBindToInterfaceIndex_Result` |

### SetBroadcast

Set `SOL_SOCKET` -\> `SO_BROADCAST`.

#### Request

| Name | Type |
|---|---|
| `value` | `bool` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetBroadcast_Result` |

### SetKeepAlive

Set `SOL_SOCKET` -\> `SO_KEEPALIVE`.

#### Request

| Name | Type |
|---|---|
| `value` | `bool` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetKeepAlive_Result` |

### SetLinger

Set `SOL_SOCKET` -\> `SO_LINGER`.

#### Request

| Name | Type |
|---|---|
| `linger` | `bool` |
| `length_secs` | `uint32` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/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

| Name | Type |
|---|---|
| `domain` | `https://fuchsia.dev/reference/fuchsia.net//https://fuchsia.dev/reference/fuchsia.net#MarkDomain` |
| `mark` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#OptionalUint32` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetMark_Result` |

### SetNoCheck

Set `SOL_SOCKET` -\> `SO_NO_CHECK`.

#### Request

| Name | Type |
|---|---|
| `value` | `bool` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetNoCheck_Result` |

### SetOutOfBandInline

Set `SOL_SOCKET` -\> `SO_OOBINLINE`.

#### Request

| Name | Type |
|---|---|
| `value` | `bool` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetOutOfBandInline_Result` |

### SetReceiveBuffer

Set `SOL_SOCKET` -\> `SO_RCVBUF`.

#### Request

| Name | Type |
|---|---|
| `value_bytes` | `uint64` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetReceiveBuffer_Result` |

### SetReuseAddress

Set `SOL_SOCKET` -\> `SO_REUSEADDR`.

#### Request

| Name | Type |
|---|---|
| `value` | `bool` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetReuseAddress_Result` |

### SetReusePort

Set `SOL_SOCKET` -\> `SO_REUSEPORT`.
Added: 30

#### Request

| Name | Type |
|---|---|
| `value` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#ReusePortOption` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetReusePort_Result` |

### SetReusePortDeprecated

Deprecated: 30 Added: 30

#### Request

| Name | Type |
|---|---|
| `value` | `bool` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetReusePortDeprecated_Result` |

### SetSendBuffer

Set `SOL_SOCKET` -\> `SO_SNDBUF`.

#### Request

| Name | Type |
|---|---|
| `value_bytes` | `uint64` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetSendBuffer_Result` |

### SetTimestamp

Set `SOL_SOCKET` -\> `SO_TIMESTAMP` or `SO_TIMESTAMPNS`.

#### Request

| Name | Type |
|---|---|
| `value` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#TimestampOption` |

#### Response

| Name | Type |
|---|---|
| `payload` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#BaseSocket_SetTimestamp_Result` |

## **STRUCTS**

### Empty

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=12)*

\<EMPTY\>

### InterfaceProperties

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=107)*

An interface's properties.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `id` | `https://fuchsia.dev/reference/fuchsia.net//https://fuchsia.dev/reference/fuchsia.net#InterfaceId` | The interface's ID. | No default |
| `addr` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#HardwareAddress` | The interface's hardware address. | No default |
| `type` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#HardwareType` | The interface's hardware type. | No default |

### PacketInfo

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=119)*

Information about a packet.

<br />

| Field | Type | Description | Default |
|---|---|---|---|
| `protocol` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Protocol` |   | No default |
| `interface_id` | `https://fuchsia.dev/reference/fuchsia.net//https://fuchsia.dev/reference/fuchsia.net#InterfaceId` |   | No default |
| `addr` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#HardwareAddress` |   | No default |

### Provider_SocketWithOptions_Response [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=266)*

| Field | Type | Description | Default |
|---|---|---|---|
| `socket` | `client_end:https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket` |   | No default |

### Provider_Socket_Response [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=253)*

| Field | Type | Description | Default |
|---|---|---|---|
| `socket` | `client_end:https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket` |   | No default |

### RecvPacketInfo

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=201)*

| Field | Type | Description | Default |
|---|---|---|---|
| `packet_info` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#PacketInfo` |   | No default |
| `packet_type` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#PacketType` |   | No default |
| `interface_type` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#HardwareType` |   | No default |

### Socket_AttachBpfFilterUnsafe_Response

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=241)*

\<EMPTY\>

### Socket_Bind_Response

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=163)*

\<EMPTY\>

### Socket_GetInfo_Response

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=171)*

| Field | Type | Description | Default |
|---|---|---|---|
| `kind` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Kind` |   | No default |
| `protocol` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#ProtocolAssociation?` |   | No default |
| `bound_interface` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#BoundInterface` |   | No default |

### Socket_RecvMsg_Response

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=200)*

| Field | Type | Description | Default |
|---|---|---|---|
| `packet_info` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#RecvPacketInfo?` |   | No default |
| `data` | `vector<uint8>` |   | No default |
| `control` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#RecvControlData` |   | No default |
| `truncated` | `uint32` |   | No default |

### Socket_SendMsg_Response

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=228)*

\<EMPTY\>

## **ENUMS**

### HardwareType [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=51)*

The type of a hardware.

<br />

| 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](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=16)*

A kind of packet socket.

<br />

| 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](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

Type: `uint32`

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=71)*

The type of a packet.

<br />

| 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](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=207)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `socket` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#SocketRecvControlData` | Socket level ancillary data. |

### SendControlData

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=223)*

| Ordinal | Field | Type | Description |
|---|---|---|---|
| ### 1 | `socket` | `https://fuchsia.dev/reference/fuchsia.posix.socket//https://fuchsia.dev/reference/fuchsia.posix.socket#SocketSendControlData` | Socket level ancillary data. |

### SocketDescribeResponse [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=145)*

| 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](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=176)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `all` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Empty` |   |
| ### 2 | `specified` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#InterfaceProperties` |   |

<br />

### BoundInterfaceId [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=159)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `all` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Empty` |   |
| ### 2 | `specified` | `https://fuchsia.dev/reference/fuchsia.net//https://fuchsia.dev/reference/fuchsia.net#InterfaceId` |   |

<br />

### HardwareAddress [flexible](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=96)*

A hardware address.

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `none` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Empty` | Indicates that the hardware does not support link-layer addressing. |
| ### 2 | `eui48` | `https://fuchsia.dev/reference/fuchsia.net//https://fuchsia.dev/reference/fuchsia.net#MacAddress` | An EUI-48 based address. |

<br />

### ProtocolAssociation [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=39)*

The protocol association for a packet socket.

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `all` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Empty` | An association with all protocols. |
| ### 2 | `specified` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Protocol` | An association with a protocol. |

<br />

### Provider_SocketWithOptions_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible) [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=266)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Provider_SocketWithOptions_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.posix//https://fuchsia.dev/reference/fuchsia.posix#Errno` |   |

<br />

### Provider_Socket_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible) [resource](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#value-vs-resource)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=253)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Provider_Socket_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.posix//https://fuchsia.dev/reference/fuchsia.posix#Errno` |   |

<br />

### Socket_AttachBpfFilterUnsafe_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=241)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket_AttachBpfFilterUnsafe_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.posix//https://fuchsia.dev/reference/fuchsia.posix#Errno` |   |

<br />

### Socket_Bind_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=163)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket_Bind_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.posix//https://fuchsia.dev/reference/fuchsia.posix#Errno` |   |

<br />

### Socket_GetInfo_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=171)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket_GetInfo_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.posix//https://fuchsia.dev/reference/fuchsia.posix#Errno` |   |

<br />

### Socket_RecvMsg_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=200)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket_RecvMsg_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.posix//https://fuchsia.dev/reference/fuchsia.posix#Errno` |   |

<br />

### Socket_SendMsg_Result [strict](https://fuchsia.dev/fuchsia-src/reference/fidl/language/language#strict-vs-flexible)

*Defined in [fuchsia.posix.socket.packet/socket.fidl](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=228)*

| Ordinal | Variant | Type | Description |
|---|---|---|---|
| ### 1 | `response` | `https://fuchsia.dev/reference/fidl/fuchsia.posix.socket.packet#Socket_SendMsg_Response` |   |
| ### 2 | `err` | `https://fuchsia.dev/reference/fuchsia.posix//https://fuchsia.dev/reference/fuchsia.posix#Errno` |   |

<br />

## **ALIASES**

| Name | Value | Description |
|---|---|---|
| [Protocol](https://cs.opensource.google/fuchsia/fuchsia/+/main:sdk/fidl/fuchsia.posix.socket.packet/socket.fidl;l=35) | `uint16` | A network-layer protocol (above link-layer). Values are defined by https://www.iana.org/assignments/ieee-802-numbers/ieee-802-numbers.xhtml. |