fidl_fuchsia_posix_socket_packet

Enum SocketRequest

Source
pub enum SocketRequest {
Show 37 variants Clone2 { request: ServerEnd<CloneableMarker>, control_handle: SocketControlHandle, }, Close { responder: SocketCloseResponder, }, Query { responder: SocketQueryResponder, }, SetReuseAddress { value: bool, responder: SocketSetReuseAddressResponder, }, GetReuseAddress { responder: SocketGetReuseAddressResponder, }, GetError { responder: SocketGetErrorResponder, }, SetBroadcast { value: bool, responder: SocketSetBroadcastResponder, }, GetBroadcast { responder: SocketGetBroadcastResponder, }, SetSendBuffer { value_bytes: u64, responder: SocketSetSendBufferResponder, }, GetSendBuffer { responder: SocketGetSendBufferResponder, }, SetReceiveBuffer { value_bytes: u64, responder: SocketSetReceiveBufferResponder, }, GetReceiveBuffer { responder: SocketGetReceiveBufferResponder, }, SetKeepAlive { value: bool, responder: SocketSetKeepAliveResponder, }, GetKeepAlive { responder: SocketGetKeepAliveResponder, }, SetOutOfBandInline { value: bool, responder: SocketSetOutOfBandInlineResponder, }, GetOutOfBandInline { responder: SocketGetOutOfBandInlineResponder, }, SetNoCheck { value: bool, responder: SocketSetNoCheckResponder, }, GetNoCheck { responder: SocketGetNoCheckResponder, }, SetLinger { linger: bool, length_secs: u32, responder: SocketSetLingerResponder, }, GetLinger { responder: SocketGetLingerResponder, }, SetReusePort { value: bool, responder: SocketSetReusePortResponder, }, GetReusePort { responder: SocketGetReusePortResponder, }, GetAcceptConn { responder: SocketGetAcceptConnResponder, }, SetBindToDevice { value: String, responder: SocketSetBindToDeviceResponder, }, GetBindToDevice { responder: SocketGetBindToDeviceResponder, }, SetBindToInterfaceIndex { value: u64, responder: SocketSetBindToInterfaceIndexResponder, }, GetBindToInterfaceIndex { responder: SocketGetBindToInterfaceIndexResponder, }, SetTimestamp { value: TimestampOption, responder: SocketSetTimestampResponder, }, GetTimestamp { responder: SocketGetTimestampResponder, }, SetMark { domain: MarkDomain, mark: OptionalUint32, responder: SocketSetMarkResponder, }, GetMark { domain: MarkDomain, responder: SocketGetMarkResponder, }, Describe { responder: SocketDescribeResponder, }, Bind { protocol: Option<Box<ProtocolAssociation>>, bound_interface_id: BoundInterfaceId, responder: SocketBindResponder, }, GetInfo { responder: SocketGetInfoResponder, }, RecvMsg { want_packet_info: bool, data_len: u32, want_control: bool, flags: RecvMsgFlags, responder: SocketRecvMsgResponder, }, SendMsg { packet_info: Option<Box<PacketInfo>>, data: Vec<u8>, control: SendControlData, flags: SendMsgFlags, responder: SocketSendMsgResponder, }, AttachBpfFilterUnsafe { code: Vec<u64>, responder: SocketAttachBpfFilterUnsafeResponder, },
}
Expand description

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.

Variants§

§

Clone2

Fields

§request: ServerEnd<CloneableMarker>
§control_handle: SocketControlHandle
§

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.

Fields

§

Query

Fields

§

SetReuseAddress

Set SOL_SOCKET -> SO_REUSEADDR.

§

GetReuseAddress

Get SOL_SOCKET -> SO_REUSEADDR.

§

GetError

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

Fields

§

SetBroadcast

Set SOL_SOCKET -> SO_BROADCAST.

Fields

§value: bool
§

GetBroadcast

Get SOL_SOCKET -> SO_BROADCAST.

§

SetSendBuffer

Set SOL_SOCKET -> SO_SNDBUF.

Fields

§value_bytes: u64
§

GetSendBuffer

Get SOL_SOCKET -> SO_SNDBUF.

§

SetReceiveBuffer

Set SOL_SOCKET -> SO_RCVBUF.

Fields

§value_bytes: u64
§

GetReceiveBuffer

Get SOL_SOCKET -> SO_RCVBUF.

§

SetKeepAlive

Set SOL_SOCKET -> SO_KEEPALIVE.

Fields

§value: bool
§

GetKeepAlive

Get SOL_SOCKET -> SO_KEEPALIVE.

§

SetOutOfBandInline

Set SOL_SOCKET -> SO_OOBINLINE.

§

GetOutOfBandInline

Get SOL_SOCKET -> SO_OOBINLINE.

§

SetNoCheck

Set SOL_SOCKET -> SO_NO_CHECK.

Fields

§value: bool
§

GetNoCheck

Get SOL_SOCKET -> SO_NO_CHECK.

§

SetLinger

Set SOL_SOCKET -> SO_LINGER.

Fields

§linger: bool
§length_secs: u32
§

GetLinger

Get SOL_SOCKET -> SO_LINGER.

§

SetReusePort

Set SOL_SOCKET -> SO_REUSEPORT.

Fields

§value: bool
§

GetReusePort

Get SOL_SOCKET -> SO_REUSEPORT.

§

GetAcceptConn

Get SOL_SOCKET -> SO_ACCEPTCONN.

§

SetBindToDevice

Set SOL_SOCKET -> SO_BINDTODEVICE.

§

GetBindToDevice

Get SOL_SOCKET -> SO_BINDTODEVICE.

§

SetBindToInterfaceIndex

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

§

GetBindToInterfaceIndex

Get SOL_SOCKET -> SO_BINDTOIFINDEX.

§

SetTimestamp

Set SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

Fields

§value: TimestampOption
§

GetTimestamp

Get SOL_SOCKET -> SO_TIMESTAMP or SO_TIMESTAMPNS.

§

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.

Fields

§domain: MarkDomain
§mark: OptionalUint32
§

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.

Fields

§domain: MarkDomain
§

Describe

Fields

§

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.

Fields

§bound_interface_id: BoundInterfaceId
§

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.

Fields

§

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.

Fields

§want_packet_info: bool
§data_len: u32
§want_control: bool
§flags: RecvMsgFlags
§

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.

Fields

§packet_info: Option<Box<PacketInfo>>
§data: Vec<u8>
§flags: SendMsgFlags
§

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.

Implementations§

Source§

impl SocketRequest

Source

pub fn into_clone2( self, ) -> Option<(ServerEnd<CloneableMarker>, SocketControlHandle)>

Source

pub fn into_close(self) -> Option<SocketCloseResponder>

Source

pub fn into_query(self) -> Option<SocketQueryResponder>

Source

pub fn into_set_reuse_address( self, ) -> Option<(bool, SocketSetReuseAddressResponder)>

Source

pub fn into_get_reuse_address(self) -> Option<SocketGetReuseAddressResponder>

Source

pub fn into_get_error(self) -> Option<SocketGetErrorResponder>

Source

pub fn into_set_broadcast(self) -> Option<(bool, SocketSetBroadcastResponder)>

Source

pub fn into_get_broadcast(self) -> Option<SocketGetBroadcastResponder>

Source

pub fn into_set_send_buffer(self) -> Option<(u64, SocketSetSendBufferResponder)>

Source

pub fn into_get_send_buffer(self) -> Option<SocketGetSendBufferResponder>

Source

pub fn into_set_receive_buffer( self, ) -> Option<(u64, SocketSetReceiveBufferResponder)>

Source

pub fn into_get_receive_buffer(self) -> Option<SocketGetReceiveBufferResponder>

Source

pub fn into_set_keep_alive(self) -> Option<(bool, SocketSetKeepAliveResponder)>

Source

pub fn into_get_keep_alive(self) -> Option<SocketGetKeepAliveResponder>

Source

pub fn into_set_out_of_band_inline( self, ) -> Option<(bool, SocketSetOutOfBandInlineResponder)>

Source

pub fn into_get_out_of_band_inline( self, ) -> Option<SocketGetOutOfBandInlineResponder>

Source

pub fn into_set_no_check(self) -> Option<(bool, SocketSetNoCheckResponder)>

Source

pub fn into_get_no_check(self) -> Option<SocketGetNoCheckResponder>

Source

pub fn into_set_linger(self) -> Option<(bool, u32, SocketSetLingerResponder)>

Source

pub fn into_get_linger(self) -> Option<SocketGetLingerResponder>

Source

pub fn into_set_reuse_port(self) -> Option<(bool, SocketSetReusePortResponder)>

Source

pub fn into_get_reuse_port(self) -> Option<SocketGetReusePortResponder>

Source

pub fn into_get_accept_conn(self) -> Option<SocketGetAcceptConnResponder>

Source

pub fn into_set_bind_to_device( self, ) -> Option<(String, SocketSetBindToDeviceResponder)>

Source

pub fn into_get_bind_to_device(self) -> Option<SocketGetBindToDeviceResponder>

Source

pub fn into_set_bind_to_interface_index( self, ) -> Option<(u64, SocketSetBindToInterfaceIndexResponder)>

Source

pub fn into_get_bind_to_interface_index( self, ) -> Option<SocketGetBindToInterfaceIndexResponder>

Source

pub fn into_set_timestamp( self, ) -> Option<(TimestampOption, SocketSetTimestampResponder)>

Source

pub fn into_get_timestamp(self) -> Option<SocketGetTimestampResponder>

Source

pub fn into_set_mark( self, ) -> Option<(MarkDomain, OptionalUint32, SocketSetMarkResponder)>

Source

pub fn into_get_mark(self) -> Option<(MarkDomain, SocketGetMarkResponder)>

Source

pub fn into_describe(self) -> Option<SocketDescribeResponder>

Source

pub fn into_bind( self, ) -> Option<(Option<Box<ProtocolAssociation>>, BoundInterfaceId, SocketBindResponder)>

Source

pub fn into_get_info(self) -> Option<SocketGetInfoResponder>

Source

pub fn into_recv_msg( self, ) -> Option<(bool, u32, bool, RecvMsgFlags, SocketRecvMsgResponder)>

Source

pub fn into_send_msg( self, ) -> Option<(Option<Box<PacketInfo>>, Vec<u8>, SendControlData, SendMsgFlags, SocketSendMsgResponder)>

Source

pub fn into_attach_bpf_filter_unsafe( self, ) -> Option<(Vec<u64>, SocketAttachBpfFilterUnsafeResponder)>

Source

pub fn method_name(&self) -> &'static str

Name of the method defined in FIDL

Trait Implementations§

Source§

impl Debug for SocketRequest

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T, D> Encode<Ambiguous1, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T, D> Encode<Ambiguous2, D> for T
where D: ResourceDialect,

§

unsafe fn encode( self, _encoder: &mut Encoder<'_, D>, _offset: usize, _depth: Depth, ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more