fuchsia.posix.socket

PROTOCOLS

Control

Defined in fuchsia.posix.socket/socket.fidl

The control plane for a network socket. Once a socket has been retrieved from a Provider, this interface is then used to further configure and use the socket. This interface is essentially POSIX. Its implementation must support Linux-specific arguments to {Get,Set}SockOpt.

Clone

Create another connection to the same remote object.

flags may be any of: - OPEN_RIGHT_* - OPEN_FLAG_APPEND - OPEN_FLAG_NO_REMOTE - OPEN_FLAG_DESCRIBE - CLONE_FLAG_SAME_RIGHTS

All other flags are ignored.

The OPEN_RIGHT_* bits in flags request corresponding rights over the resulting cloned object. The cloned object must have rights less than or equal to the original object. Alternatively, pass CLONE_FLAG_SAME_RIGHTS to inherit the rights on the source connection. It is invalid to pass any of the OPEN_RIGHT_* flags together with CLONE_FLAG_SAME_RIGHTS.

Request

NameType
flags uint32
object request<fuchsia.io/Node>

Close

Terminates connection with object.

This method does not require any rights.

Request

NameType

Response

NameType
s int32

Describe

Returns extra information about the type of the object. If the Describe operation fails, the connection is closed.

This method does not require any rights.

Request

NameType

Response

NameType
info fuchsia.io/NodeInfo

OnOpen

An event produced eagerly by a FIDL server if requested by OPEN_FLAG_DESCRIBE.

Indicates the success or failure of the open operation, and optionally describes the object. If the status is ZX_OK, info contains descriptive information about the object (the same as would be returned by Describe).

Response

NameType
s int32
info fuchsia.io/NodeInfo?

Sync

Synchronizes updates to the node to the underlying media, if it exists.

This method does not require any rights.

Request

NameType

Response

NameType
s int32

GetAttr

Acquires information about the node.

This method does not require any rights.

Request

NameType

Response

NameType
s int32
attributes fuchsia.io/NodeAttributes

SetAttr

Updates information about the node. flags may be any of NODE_ATTRIBUTE_FLAG_*.

This method requires following rights: OPEN_RIGHT_WRITABLE.

Request

NameType
flags uint32
attributes fuchsia.io/NodeAttributes

Response

NameType
s int32

Ioctl

Deprecated. Only for use with compatibility with devhost.

Request

NameType
opcode uint32
max_out uint64
handles vector<handle>[2]
in vector<uint8>[8192]

Response

NameType
s int32
handles vector<handle>[2]
out vector<uint8>[8192]

Bind

Sets the local address used for the socket.

Request

NameType
addr vector<uint8>

Response

NameType
code int16

Connect

Initiates a connection to a network endpoint.

Request

NameType
addr vector<uint8>

Response

NameType
code int16

Listen

Begin listening for new connections from network endpoints. At most backlog connections will be buffered.

Request

NameType
backlog int16

Response

NameType
code int16

Accept

Accepts an incoming connection from a network endpoint.

Request

NameType
flags int16

Response

NameType
code int16
s Control?

GetSockName

Retrieves the local socket address.

Request

NameType

Response

NameType
code int16
addr vector<uint8>

GetPeerName

Retrieves the remote socket address.

Request

NameType

Response

NameType
code int16
addr vector<uint8>

SetSockOpt

Sets a socket option. TODO(NET-1699): link to description of supported socket options.

Request

NameType
level int16
optname int16
optval vector<uint8>

Response

NameType
code int16

GetSockOpt

Retrieves the current value of a socket option.

Request

NameType
level int16
optname int16

Response

NameType
code int16
optval vector<uint8>

IoctlPOSIX

Runs operations (e.g., get the receive timestamp of the last packet) on the socket.

Request

NameType
req int16
in vector<uint8>

Response

NameType
code int16
out vector<uint8>

Provider

Defined in fuchsia.posix.socket/socket.fidl

Provider implements the POSIX sockets API.

Socket

Requests a socket with the specified parameters. Values for code are defined in errno.h.

Request

NameType
domain int16
type int16
protocol int16

Response

NameType
code int16
s Control?