pub enum NetworkRequest {
AddPort {
port: ClientEnd<PortMarker>,
interface: ServerEnd<InterfaceMarker>,
control_handle: NetworkControlHandle,
},
GetConfig {
responder: NetworkGetConfigResponder,
},
GetName {
responder: NetworkGetNameResponder,
},
SetConfig {
config: NetworkConfig,
responder: NetworkSetConfigResponder,
},
AttachEndpoint {
name: String,
responder: NetworkAttachEndpointResponder,
},
RemoveEndpoint {
name: String,
responder: NetworkRemoveEndpointResponder,
},
CreateFakeEndpoint {
ep: ServerEnd<FakeEndpointMarker>,
control_handle: NetworkControlHandle,
},
StartCapture {
name: String,
responder: NetworkStartCaptureResponder,
},
StopCapture {
responder: NetworkStopCaptureResponder,
},
}
Expand description
Virtual network.
Variants§
AddPort
Adds a port to the network.
- request
port
port to be added. - request
interface
provides control over the interface.
Fields
§
port: ClientEnd<PortMarker>
§
interface: ServerEnd<InterfaceMarker>
§
control_handle: NetworkControlHandle
GetConfig
Gets network configuration.
Fields
§
responder: NetworkGetConfigResponder
GetName
Gets network name.
Fields
§
responder: NetworkGetNameResponder
SetConfig
Updates network configuration.
AttachEndpoint
Attaches endpoint with given name to network.
RemoveEndpoint
Removes endpoint with given name from network.
CreateFakeEndpoint
Injects a fake endpoint.
StartCapture
Starts capturing packet in this network.
The packet capture will be stored at /custom_artifacts/{name}.pcapng
.
Returns [ZX_ERR_ALREADY_EXISTS
] if the capturing is already started
in this network.
StopCapture
Stops capturing packets. This function is guaranteed to succeed.
The packet capture will be stored in the file at the path chosen when capturing started. The packet capture will stop automatically once the network is destroyed regardless of whether this method is called.
Fields
§
responder: NetworkStopCaptureResponder
Implementations§
Source§impl NetworkRequest
impl NetworkRequest
pub fn into_add_port( self, ) -> Option<(ClientEnd<PortMarker>, ServerEnd<InterfaceMarker>, NetworkControlHandle)>
pub fn into_get_config(self) -> Option<NetworkGetConfigResponder>
pub fn into_get_name(self) -> Option<NetworkGetNameResponder>
pub fn into_set_config( self, ) -> Option<(NetworkConfig, NetworkSetConfigResponder)>
pub fn into_attach_endpoint( self, ) -> Option<(String, NetworkAttachEndpointResponder)>
pub fn into_remove_endpoint( self, ) -> Option<(String, NetworkRemoveEndpointResponder)>
pub fn into_create_fake_endpoint( self, ) -> Option<(ServerEnd<FakeEndpointMarker>, NetworkControlHandle)>
pub fn into_start_capture( self, ) -> Option<(String, NetworkStartCaptureResponder)>
pub fn into_stop_capture(self) -> Option<NetworkStopCaptureResponder>
Sourcepub fn method_name(&self) -> &'static str
pub fn method_name(&self) -> &'static str
Name of the method defined in FIDL
Trait Implementations§
Auto Trait Implementations§
impl Freeze for NetworkRequest
impl !RefUnwindSafe for NetworkRequest
impl Send for NetworkRequest
impl Sync for NetworkRequest
impl Unpin for NetworkRequest
impl !UnwindSafe for NetworkRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more