// Create roughly over 2k bytes BssInfo
Create roughly over 2k bytes BssInfo
Create roughly over 2k bytes BssInfo
fn random_bss_info(rng: &mut ThreadRng) -> BssInfo {
        let mut ies = vec![];
        // SSID
        let ssid =
            (0..fidl_ieee80211::MAX_SSID_BYTE_LEN).map(|_| rng.gen::<u8>()).collect::<Vec<_>>();
        ies.extend_from_slice(&[0, 32]);
        ies.extend_from_slice(&ssid[..]);
        // Supported rates
        ies.extend_from_slice(&[1, 5]);
        ies.extend_from_slice(&rng.gen::<[u8; 5]>()[..]);
        // Eight giant vendor IEs
        for _j in 0..8 {
            ies.extend_from_slice(&[221, 250]);
            ies.extend((0..250).map(|_| rng.gen::<u8>()))
        }
        let bss_desc = fidl_fuchsia_wlan_internal::BssDescription {
            bssid: (0..6).map(|_| rng.gen::<u8>()).collect::<Vec<u8>>().try_into().unwrap(),
            bss_type: fidl_fuchsia_wlan_internal::BssTypes::Infrastructure,
            beacon_period: rng.gen::<u16>(),
            timestamp: rng.gen::<u64>(),
            local_time: rng.gen::<u64>(),
            cap: rng.gen::<u16>(),
            ies,
            rssi_dbm: rng.gen::<i8>(),
            chan: fidl_common::WlanChan {
                primary: rng.gen_range(1, 255),
                cbw: fidl_common::Cbw::Cbw20,
                secondary80: 0,
            },
            snr_db: rng.gen::<i8>(),
        };
        let bss_info = BssInfo {
            bssid: bss_desc.bssid.clone(),
            ssid,
            rssi_dbm: bss_desc.rssi_dbm,
            snr_db: bss_desc.snr_db,
            signal_report_time: zx::Time::ZERO,
            channel: Channel::from_fidl(bss_desc.chan),
            protection: Protection::Open,
            compatible: rng.gen::<bool>(),
            ht_cap: None,
            vht_cap: None,
            probe_resp_wsc: None,
            wmm_param: None,
            bss_desc: Some(bss_desc),
        };
        bss_info
    }
fn random_bss_info ( rng : & mut ThreadRng ) -> BssInfo { let mut ies = vec ! [ ] ; // SSID let ssid = ( 0 .. fidl_ieee80211 :: MAX_SSID_BYTE_LEN ) . map ( | _ | rng . gen :: < u8 > ( ) ) . collect :: < Vec < _ > > ( ) ; ies . extend_from_slice ( & [ 0 , 32 ] ) ; ies . extend_from_slice ( & ssid [ .. ] ) ; // Supported rates ies . extend_from_slice ( & [ 1 , 5 ] ) ; ies . extend_from_slice ( & rng . gen :: < [ u8 ; 5 ] > ( ) [ .. ] ) ; // Eight giant vendor IEs for _j in 0 .. 8 { ies . extend_from_slice ( & [ 221 , 250 ] ) ; ies . extend ( ( 0 .. 250 ) . map ( | _ | rng . gen :: < u8 > ( ) ) ) } let bss_desc = fidl_fuchsia_wlan_internal :: BssDescription { bssid : ( 0 .. 6 ) . map ( | _ | rng . gen :: < u8 > ( ) ) . collect :: < Vec < u8 > > ( ) . try_into ( ) . unwrap ( ) , bss_type : fidl_fuchsia_wlan_internal :: BssTypes :: Infrastructure , beacon_period : rng . gen :: < u16 > ( ) , timestamp : rng . gen :: < u64 > ( ) , local_time : rng . gen :: < u64 > ( ) , cap : rng . gen :: < u16 > ( ) , ies , rssi_dbm : rng . gen :: < i8 > ( ) , chan : fidl_common :: WlanChan { primary : rng . gen_range ( 1 , 255 ) , cbw : fidl_common :: Cbw :: Cbw20 , secondary80 : 0 , } , snr_db : rng . gen :: < i8 > ( ) , } ; let bss_info = BssInfo { bssid : bss_desc . bssid . clone ( ) , ssid , rssi_dbm : bss_desc . rssi_dbm , snr_db : bss_desc . snr_db , signal_report_time : zx :: Time :: ZERO , channel : Channel :: from_fidl ( bss_desc . chan ) , protection : Protection :: Open , compatible : rng . gen :: < bool > ( ) , ht_cap : None , vht_cap : None , probe_resp_wsc : None , wmm_param : None , bss_desc : Some ( bss_desc ) , } ; bss_info }
Create roughly over 2k bytes BssInfo
Create roughly over 2k bytes BssInfo
rng
&mut ThreadRng