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
impl SecurityMode
Sourcepub const fn permits(self, negotiated: Self, raw_key: bool) -> bool
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.
Sourcepub fn strongest_compatible(
self,
advertised: u16,
supported: u16,
raw_key: bool,
) -> Option<Self>
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.
Sourcepub const fn from_code(code: u8) -> Option<Self>
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.
Sourcepub const fn bit(self) -> u16
pub const fn bit(self) -> u16
This mode’s bit in a ScanResult::modes set.
Sourcepub const fn has_credential_form(self) -> bool
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.
Sourcepub const fn derives_key_from_passphrase(self) -> bool
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.
Sourcepub const fn may_be_offered(self) -> bool
pub const fn may_be_offered(self) -> bool
Whether an access point may offer this mode.
Sourcepub const fn passphrase_len_bounds(self) -> Option<(usize, usize)>
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
impl Clone for SecurityMode
Source§fn clone(&self) -> SecurityMode
fn clone(&self) -> SecurityMode
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SecurityMode
impl Debug for SecurityMode
Source§impl PartialEq for SecurityMode
impl PartialEq for SecurityMode
impl Copy for SecurityMode
impl Eq for SecurityMode
impl StructuralPartialEq for SecurityMode
Auto Trait Implementations§
impl Freeze for SecurityMode
impl RefUnwindSafe for SecurityMode
impl Send for SecurityMode
impl Sync for SecurityMode
impl Unpin for SecurityMode
impl UnwindSafe for SecurityMode
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)