utils_security_valid

Function utils_security_valid 

Source
pub fn utils_security_valid(
    type_: UtilsSecurityType,
    wifi_caps: DeviceWifiCapabilities,
    have_ap: bool,
    adhoc: bool,
    ap_flags: NM80211ApFlags,
    ap_wpa: NM80211ApSecurityFlags,
    ap_rsn: NM80211ApSecurityFlags,
) -> bool
Expand description

Given a set of device capabilities, and a desired security type to check against, determines whether the combination of device, desired security type, and AP capabilities intersect.

NOTE: this function cannot handle checking security for AP/Hotspot mode; use nm_utils_ap_mode_security_valid() instead.

§type_

the security type to check AP flags and device capabilities against, e.g. #NMU_SEC_STATIC_WEP

§wifi_caps

bitfield of the capabilities of the specific Wi-Fi device, e.g. #NM_WIFI_DEVICE_CAP_CIPHER_WEP40

§have_ap

whether the @ap_flags, @ap_wpa, and @ap_rsn arguments are valid

§adhoc

whether the capabilities being tested are from an Ad-Hoc AP (IBSS)

§ap_flags

bitfield of AP capabilities, e.g. #NM_802_11_AP_FLAGS_PRIVACY

§ap_wpa

bitfield of AP capabilities derived from the AP’s WPA beacon, e.g. (#NM_802_11_AP_SEC_PAIR_TKIP | #NM_802_11_AP_SEC_KEY_MGMT_PSK)

§ap_rsn

bitfield of AP capabilities derived from the AP’s RSN/WPA2 beacon, e.g. (#NM_802_11_AP_SEC_PAIR_CCMP | #NM_802_11_AP_SEC_PAIR_TKIP)

§Returns

true if the device capabilities and AP capabilities intersect and are compatible with the desired @type_, false if they are not