pub struct PhyManager { /* private fields */ }
Expand description

Maintains a record of all PHYs that are present and their associated interfaces.

Implementations§

source§

impl PhyManager

source

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

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,

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)

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,

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)

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,

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

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,

Destroys all client interfaces. Do not allow the creation of client interfaces for newly discovered PHYs.
source§

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>

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,

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,

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,

Destroys all AP interfaces.
source§

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>

Returns the IDs for all currently known PHYs.
source§

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,

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

Returns whether any PHY has a client interface that supports WPA3.
source§

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,

Take the recovery action proposed by the recovery summary.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Encode<Ambiguous1> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
§

impl<T> Encode<Ambiguous2> for T

§

unsafe fn encode( self, _encoder: &mut Encoder<'_>, _offset: usize, _depth: Depth ) -> Result<(), Error>

Encodes the object into the encoder’s buffers. Any handles stored in the object are swapped for Handle::INVALID. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoAny for T
where T: 'static + Send + Sync,

§

fn into_any(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Cast the given object into a dyn std::any::Any.
source§

impl<T> OptionalField for T
where T: ?Sized,

source§

const PRESENT: Presence<Self> = _

source§

const ABSENT: Presence<Self> = _

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more