Trait wlancfg_lib::mode_management::phy_manager::PhyManagerApi
source · pub trait PhyManagerApi {
Show 19 methods
// Required methods
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 remove_phy(&mut self, phy_id: u16);
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_removed(&mut self, iface_id: u16);
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 client_connections_enabled(&self) -> bool;
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 get_client(&mut self) -> Option<u16>;
fn get_wpa3_capable_client(&mut self) -> Option<u16>;
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 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_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 suggest_ap_mac(&mut self, mac: MacAddr);
fn get_phy_ids(&self) -> Vec<u16>;
fn log_phy_add_failure(&mut self);
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 has_wpa3_client_iface(&self) -> bool;
fn record_defect(&mut self, defect: Defect);
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;
}
Required Methods§
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn 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.
sourcefn get_phy_ids(&self) -> Vec<u16>
fn get_phy_ids(&self) -> Vec<u16>
Returns the IDs for all currently known PHYs.
sourcefn log_phy_add_failure(&mut self)
fn log_phy_add_failure(&mut self)
Logs phy add failure inspect metrics.
sourcefn 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.
sourcefn has_wpa3_client_iface(&self) -> bool
fn has_wpa3_client_iface(&self) -> bool
Returns whether any PHY has a client interface that supports WPA3.
sourcefn record_defect(&mut self, defect: Defect)
fn record_defect(&mut self, defect: Defect)
Store a record for the provided defect.
sourcefn 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.