pub enum DeviceControlRequest {
CreateInterface {
port: PortId,
control: ServerEnd<ControlMarker>,
options: Options,
control_handle: DeviceControlControlHandle,
},
Detach {
control_handle: DeviceControlControlHandle,
},
}
Expand description
Administrative control over an installed device on the network stack.
An instance of DeviceControl
maps to an instance of
[fuchsia.hardware.network/Session
]. All interfaces generated from a single
DeviceControl
instance share the same Session
and set of device buffers;
and are therefore subject to backpressure over the same pool of resources.
By the same measure, creating multiple DeviceControl
instances attached to
the same underlying device causes data copies, because each DeviceControl
starts a new Session
. For that reason, users should avoid creating
multiple DeviceControl
instances for the same device and prefer
instantiating ports into interfaces from a single DeviceControl
instance
per device.
This protocol encodes the underlying device’s lifetime in both directions; the device exists iff both ends of the protocol are open. That is:
- Closing the client end causes the device to be removed, including all interfaces created from it.
- Observing a closure of the server end indicates the device (and all interfaces created from it) no longer exists.
Variants§
CreateInterface
Creates an interface on the network stack.
- request
port
the device’s port to instantiate as an interface. - request
control
grants access to the created interface.
Detach
Detaches the client end from the device’s lifetime.
After calling Detach
, closing this client end no longer causes the
device or any of the interfaces created from it to be removed. Note that
the lifetime of any created interface will continue to be coupled with
the associated [Control
] client end.
Fields
control_handle: DeviceControlControlHandle
Implementations§
Source§impl DeviceControlRequest
impl DeviceControlRequest
pub fn into_create_interface( self, ) -> Option<(PortId, ServerEnd<ControlMarker>, Options, DeviceControlControlHandle)>
pub fn into_detach(self) -> Option<DeviceControlControlHandle>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL