/// Match the protection type we receive from the SME in scan results to the Policy layer
/// security type.
Match the protection type we receive from the SME in scan results to the Policy layer
security type.
Match the protection type we receive from the SME in scan results to the Policy layer security type .
pub fn security_from_sme_protection(
    protection: fidl_sme::Protection,
    wpa3_supported: bool,
) -> Option<fidl_policy::SecurityType> {
    use fidl_policy::SecurityType;
    use fidl_sme::Protection::*;
    match protection {
        Wpa3Enterprise | Wpa3Personal | Wpa2Wpa3Personal => {
            Some(if wpa3_supported { SecurityType::Wpa3 } else { SecurityType::Wpa2 })
        }
        Wpa2Enterprise
        | Wpa2Personal
        | Wpa1Wpa2Personal
        | Wpa2PersonalTkipOnly
        | Wpa1Wpa2PersonalTkipOnly => Some(SecurityType::Wpa2),
        Wpa1 => Some(SecurityType::Wpa),
        Wep => Some(SecurityType::Wep),
        Open => Some(SecurityType::None),
        Unknown => None,
    }
}
pub fn security_from_sme_protection ( protection : fidl_sme :: Protection , wpa3_supported : bool , ) -> Option < fidl_policy :: SecurityType > { use fidl_policy :: SecurityType ; use fidl_sme :: Protection :: * ; match protection { Wpa3Enterprise | Wpa3Personal | Wpa2Wpa3Personal => { Some ( if wpa3_supported { SecurityType :: Wpa3 } else { SecurityType :: Wpa2 } ) } Wpa2Enterprise | Wpa2Personal | Wpa1Wpa2Personal | Wpa2PersonalTkipOnly | Wpa1Wpa2PersonalTkipOnly => Some ( SecurityType :: Wpa2 ) , Wpa1 => Some ( SecurityType :: Wpa ) , Wep => Some ( SecurityType :: Wep ) , Open => Some ( SecurityType :: None ) , Unknown => None , } }
Match the protection type we receive from the SME in scan results to the Policy layer
security type.
Match the protection type we receive from the SME in scan results to the Policy layer security type .
protection
fidl_sme::Protection
wpa3_supported
bool