fn disable_interface(&mut self, id: u64) -> Result<(), fidl_net_stack::Error> {
        match self.ctx.dispatcher_mut().devices.deactivate_device(id) {
            Ok((core_id, device_info)) => {
                // Sanity check that there is a reason that the device is disabled.
                assert!(!device_info.admin_enabled() || !device_info.phy_up());
                // Disabling the interface deactivates it in the bindings, and will remove
                // it completely from the core.
                match remove_device(&mut self.ctx, core_id) {
                    Some(_) => Ok(()), // TODO(rheacock): schedule and send the received frames
                    None => Ok(()),
                }
            }
            Err(toggle_error) => {
                match toggle_error {
                    ToggleError::NoChange => Ok(()),
                    ToggleError::NotFound => Err(fidl_net_stack::Error::NotFound), // Invalid device ID
                }
            }
        }
    }
/// Disables an interface, removing it from the core if it is currently enabled.
/// Either an Admin (fidl) or Phy change can disable an interface.
Disables an interface, removing it from the core if it is currently enabled.
Either an Admin (fidl) or Phy change can disable an interface.
Disables an interface removing it from the core if it is currently enabled . Either an Admin ( fidl ) or Phy change can disable an interface .
fn disable_interface(&mut self, id: u64) -> Result<(), fidl_net_stack::Error> {
        match self.ctx.dispatcher_mut().devices.deactivate_device(id) {
            Ok((core_id, device_info)) => {
                // Sanity check that there is a reason that the device is disabled.
                assert!(!device_info.admin_enabled() || !device_info.phy_up());
                // Disabling the interface deactivates it in the bindings, and will remove
                // it completely from the core.
                match remove_device(&mut self.ctx, core_id) {
                    Some(_) => Ok(()), // TODO(rheacock): schedule and send the received frames
                    None => Ok(()),
                }
            }
            Err(toggle_error) => {
                match toggle_error {
                    ToggleError::NoChange => Ok(()),
                    ToggleError::NotFound => Err(fidl_net_stack::Error::NotFound), // Invalid device ID
                }
            }
        }
    }
fn disable_interface ( & mut self , id : u64 ) -> Result < ( ) , fidl_net_stack :: Error > { match self . ctx . dispatcher_mut ( ) . devices . deactivate_device ( id ) { Ok ( ( core_id , device_info ) ) => { // Sanity check that there is a reason that the device is disabled. assert ! ( device_info admin_enabled ( ) device_info phy_up ( ) ) ; // Disabling the interface deactivates it in the bindings, and will remove // it completely from the core. match remove_device ( & mut self . ctx , core_id ) { Some ( _ ) => Ok ( ( ) ) , // TODO(rheacock): schedule and send the received frames None => Ok ( ( ) ) , } } Err ( toggle_error ) => { match toggle_error { ToggleError :: NoChange => Ok ( ( ) ) , ToggleError :: NotFound => Err ( fidl_net_stack :: Error :: NotFound ) , // Invalid device ID } } } }
Disables an interface, removing it from the core if it is currently enabled.
Disables an interface removing it from the core if it is currently enabled .
&mut self
id
u64