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.

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.

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

Bind

Sets the local address used for the socket.

Request

NameType
addr vector<uint8>[128]

Response

NameType
code int16

Connect

Initiates a connection to a remote address.

Request

NameType
addr vector<uint8>[128]

Response

NameType
code int16

Listen

Begins listening for new incoming connections. At most backlog connections will be buffered.

Request

NameType
backlog int16

Response

NameType
code int16

Accept

Accepts a buffered incoming connection.

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>[128]

GetPeerName

Retrieves the remote socket address.

Request

NameType

Response

NameType
code int16
addr vector<uint8>[128]

SetSockOpt

Sets the value of a socket option.

Request

NameType
level int16
optname int16
optval vector<uint8>[900]

Response

NameType
code int16

GetSockOpt

Retrieves the value of a socket option.

Request

NameType
level int16
optname int16

Response

NameType
code int16
optval vector<uint8>[900]

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?