Struct wlancfg_lib::mode_management::phy_manager::PhyManager
source · pub struct PhyManager { /* private fields */ }
Expand description
Maintains a record of all PHYs that are present and their associated interfaces.
Implementations§
source§impl PhyManager
impl PhyManager
sourcepub fn new(
device_monitor: DeviceMonitorProxy,
recovery_profile: RecoveryProfile,
recovery_enabled: bool,
node: Node,
telemetry_sender: TelemetrySender,
recovery_action_sender: Sender<RecoverySummary>
) -> Self
pub fn new( device_monitor: DeviceMonitorProxy, recovery_profile: RecoveryProfile, recovery_enabled: bool, node: Node, telemetry_sender: TelemetrySender, recovery_action_sender: Sender<RecoverySummary> ) -> Self
Internally stores a DeviceMonitorProxy to query PHY and interface properties and create and destroy interfaces as requested.
Trait Implementations§
source§impl PhyManagerApi for PhyManager
impl PhyManagerApi for PhyManager
source§fn add_phy<'life0, 'async_trait>(
&'life0 mut self,
phy_id: u16
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn add_phy<'life0, 'async_trait>(
&'life0 mut self,
phy_id: u16
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Checks to see if this PHY is already accounted for. If it is not, queries its PHY
attributes and places it in the hash map.
source§fn remove_phy(&mut self, phy_id: u16)
fn remove_phy(&mut self, phy_id: u16)
If the PHY is accounted for, removes the associated
PhyContainer
from the hash map.source§fn on_iface_added<'life0, 'async_trait>(
&'life0 mut self,
iface_id: u16
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn on_iface_added<'life0, 'async_trait>(
&'life0 mut self,
iface_id: u16
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Queries the interface properties to get the PHY ID. If the
PhyContainer
representing the interface’s parent PHY is already present and its
interface information is obsolete, updates it. The PhyManager will track ifaces
as it creates and deletes them, but it is possible that another caller circumvents the
policy layer and creates an interface. If no PhyContainer
exists
for the new interface, creates one and adds the newly discovered interface
ID to it.source§fn on_iface_removed(&mut self, iface_id: u16)
fn on_iface_removed(&mut self, iface_id: u16)
Ensures that the
iface_id
is not present in any of the PhyContainer
interface lists.source§fn create_all_client_ifaces<'life0, 'async_trait>(
&'life0 mut self,
reason: CreateClientIfacesReason
) -> Pin<Box<dyn Future<Output = Result<Vec<u16>, (Vec<u16>, PhyManagerError)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_all_client_ifaces<'life0, 'async_trait>(
&'life0 mut self,
reason: CreateClientIfacesReason
) -> Pin<Box<dyn Future<Output = Result<Vec<u16>, (Vec<u16>, PhyManagerError)>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Creates client interfaces for all PHYs that are capable of acting as clients. For newly
discovered PHYs, create client interfaces if the PHY can support them. This method returns
a vector containing all newly-created client interface IDs along with a representation of
any errors encountered along the way.
source§fn client_connections_enabled(&self) -> bool
fn client_connections_enabled(&self) -> bool
The PhyManager is the authoritative source of whether or not the policy layer is allowed to
create client interfaces. This method allows other parts of the policy layer to determine
whether the API client has allowed client interfaces to be created.
source§fn destroy_all_client_ifaces<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn destroy_all_client_ifaces<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Destroys all client interfaces. Do not allow the creation of client interfaces for newly
discovered PHYs.
source§fn get_client(&mut self) -> Option<u16>
fn get_client(&mut self) -> Option<u16>
Finds a PHY with a client interface and returns the interface’s ID to the caller.
source§fn get_wpa3_capable_client(&mut self) -> Option<u16>
fn get_wpa3_capable_client(&mut self) -> Option<u16>
Finds a WPA3 capable PHY with a client interface and returns the interface’s ID.
source§fn create_or_get_ap_iface<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<u16>, PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn create_or_get_ap_iface<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<Option<u16>, PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Finds a PHY that is capable of functioning as an AP. PHYs that do not yet have AP ifaces
associated with them are searched first. If one is found, an AP iface is created and its
ID is returned. If all AP-capable PHYs already have AP ifaces associated with them, one of
the existing AP iface IDs is returned. If there are no AP-capable PHYs, None is returned.
source§fn destroy_ap_iface<'life0, 'async_trait>(
&'life0 mut self,
iface_id: u16
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn destroy_ap_iface<'life0, 'async_trait>(
&'life0 mut self,
iface_id: u16
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Destroys the interface associated with the given interface ID.
source§fn destroy_all_ap_ifaces<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn destroy_all_ap_ifaces<'life0, 'async_trait>(
&'life0 mut self
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Destroys all AP interfaces.
source§fn suggest_ap_mac(&mut self, mac: MacAddr)
fn suggest_ap_mac(&mut self, mac: MacAddr)
Sets a suggested MAC address to be used by new AP interfaces.
source§fn get_phy_ids(&self) -> Vec<u16>
fn get_phy_ids(&self) -> Vec<u16>
Returns the IDs for all currently known PHYs.
source§fn log_phy_add_failure(&mut self)
fn log_phy_add_failure(&mut self)
Logs phy add failure inspect metrics.
source§fn set_country_code<'life0, 'async_trait>(
&'life0 mut self,
country_code: Option<[u8; 2]>
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_country_code<'life0, 'async_trait>(
&'life0 mut self,
country_code: Option<[u8; 2]>
) -> Pin<Box<dyn Future<Output = Result<(), PhyManagerError>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Sets the country code on all known PHYs and stores the country code to be applied to
newly-discovered PHYs.
source§fn has_wpa3_client_iface(&self) -> bool
fn has_wpa3_client_iface(&self) -> bool
Returns whether any PHY has a client interface that supports WPA3.
source§fn record_defect(&mut self, defect: Defect)
fn record_defect(&mut self, defect: Defect)
Store a record for the provided defect.
source§fn perform_recovery<'life0, 'async_trait>(
&'life0 mut self,
summary: RecoverySummary
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn perform_recovery<'life0, 'async_trait>(
&'life0 mut self,
summary: RecoverySummary
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Take the recovery action proposed by the recovery summary.
Auto Trait Implementations§
impl Freeze for PhyManager
impl !RefUnwindSafe for PhyManager
impl Send for PhyManager
impl Sync for PhyManager
impl Unpin for PhyManager
impl !UnwindSafe for PhyManager
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