SecurityMode

Enum SecurityMode 

Source
pub enum SecurityMode {
    Open = 0,
    Owe = 1,
    Wpa2 = 2,
    Wpa3 = 3,
    Wpa = 4,
    Wep = 5,
    Wpa2Ent = 6,
    Wpa3Ent = 7,
    Wpa3Ent192 = 8,
}
Expand description

A station’s minimum security requirement, or an advertised/AP mode. Numeric codes are not a security ranking; use Self::permits.

Variants§

§

Open = 0

WIFI_SEC_OPEN: no security at all.

§

Owe = 1

WIFI_SEC_OWE: Enhanced Open. Encrypted against anyone listening, authenticated against nobody, and the only credential-free mode permitted on 6 GHz.

§

Wpa2 = 2

WIFI_SEC_WPA2: WPA2-Personal, covering the mixed networks that negotiate CCMP.

§

Wpa3 = 3

WIFI_SEC_WPA3: WPA3-Personal, SAE.

§

Wpa = 4

WIFI_SEC_WPA: the TKIP-only remainder, which a device may decline to join.

§

Wep = 5

WIFI_SEC_WEP: reportable, not joinable. No credential form is defined.

§

Wpa2Ent = 6

WIFI_SEC_WPA2_ENT: reportable, not joinable here.

§

Wpa3Ent = 7

WIFI_SEC_WPA3_ENT: reportable, not joinable here.

§

Wpa3Ent192 = 8

WIFI_SEC_WPA3_ENT_192: reportable, not joinable here.

Implementations§

Source§

impl SecurityMode

Source

pub const fn permits(self, negotiated: Self, raw_key: bool) -> bool

Whether an authentication mode satisfies this station requirement with the stored credential. A raw PMK cannot authenticate with SAE.

Source

pub fn strongest_compatible( self, advertised: u16, supported: u16, raw_key: bool, ) -> Option<Self>

Strongest advertised mode supported by both the device and credential. This preference order is explicit; wire codes are not a ranking.

Source

pub const fn code(self) -> u8

The wire code for this mode.

Source

pub const fn from_code(code: u8) -> Option<Self>

Strict conversion from a wire octet. Codes 9 through 15 are reserved and 16 upward cannot be reported at all, since a scan result carries these as a 16-bit set.

Source

pub const fn bit(self) -> u16

This mode’s bit in a ScanResult::modes set.

Source

pub const fn has_credential_form(self) -> bool

Whether a host can express a credential for this mode, and so whether an entry naming it can be inserted at all. The four that cannot are numbered so that a scan result can say what it heard.

Source

pub const fn derives_key_from_passphrase(self) -> bool

Whether this mode’s credential is a passphrase from which the device derives a pairwise master key, and so whether FLAG_RAW_KEY may stand in for one. SAE derives its key through the exchange rather than from the password, so a stored key is not a substitute there.

Source

pub const fn may_be_offered(self) -> bool

Whether an access point may offer this mode.

Source

pub const fn passphrase_len_bounds(self) -> Option<(usize, usize)>

The credential length bounds for this mode, as a passphrase. None when the mode takes no credential or defines no form.

Trait Implementations§

Source§

impl Clone for SecurityMode

Source§

fn clone(&self) -> SecurityMode

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for SecurityMode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for SecurityMode

Source§

fn eq(&self, other: &SecurityMode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for SecurityMode

Source§

impl Eq for SecurityMode

Source§

impl StructuralPartialEq for SecurityMode

Auto Trait Implementations§

Blanket Implementations§

§

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

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

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

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

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

§

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

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

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

§

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, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

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

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

Performs the conversion.
§

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.
§

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

Performs the conversion.