pub enum ConnectorRequest {
Connect {
remote_cid: u32,
remote_port: u32,
con: ConnectionTransport,
responder: ConnectorConnectResponder,
},
Listen {
local_port: u32,
acceptor: ClientEnd<AcceptorMarker>,
responder: ConnectorListenResponder,
},
Bind {
remote_cid: u32,
local_port: u32,
listener: ServerEnd<ListenerMarker>,
responder: ConnectorBindResponder,
},
GetCid {
responder: ConnectorGetCidResponder,
},
}
Expand description
Exposed by a service that can act as a bridge to the underlying vsock driver and provides the ability for listeners to be multiplexed by port and manages dynamic port allocation for outbound connections.
Variants§
Connect
Attempt to establish a connection to the specified remote cid/port pair. No local port is specified as an ephemeral one will automatically be allocated.
Listen
Registers a listener for a local port. There can only be one listener for a single port at a time.
Bind
Registers a listener for a local port. There can only be one listener for a single port at a time.
GetCid
Query the current context id of the system. The local CID is should not
necessary in interactions with the same device; instead you may pass
VMADDR_CID_LOCAL
, which will alias to local CID this returns. The cid returned
by this method is useful for debugging or if you have some other communication
channel to a different host and you would like to send them your CID to then
establish a vsock connection on.
Fields
responder: ConnectorGetCidResponder
Implementations§
Source§impl ConnectorRequest
impl ConnectorRequest
pub fn into_connect( self, ) -> Option<(u32, u32, ConnectionTransport, ConnectorConnectResponder)>
pub fn into_listen( self, ) -> Option<(u32, ClientEnd<AcceptorMarker>, ConnectorListenResponder)>
pub fn into_bind( self, ) -> Option<(u32, u32, ServerEnd<ListenerMarker>, ConnectorBindResponder)>
pub fn into_get_cid(self) -> Option<ConnectorGetCidResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL