MCPcopy Create free account
hub / github.com/F-Stack/f-stack / list_stations

Function list_stations

tools/ifconfig/ifieee80211.c:3865–3960  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3863}
3864
3865static void
3866list_stations(int s)
3867{
3868 union {
3869 struct ieee80211req_sta_req req;
3870 uint8_t buf[24*1024];
3871 } u;
3872 enum ieee80211_opmode opmode = get80211opmode(s);
3873 const uint8_t *cp;
3874 int len;
3875
3876 /* broadcast address =>'s get all stations */
3877 (void) memset(u.req.is_u.macaddr, 0xff, IEEE80211_ADDR_LEN);
3878 if (opmode == IEEE80211_M_STA) {
3879 /*
3880 * Get information about the associated AP.
3881 */
3882 (void) get80211(s, IEEE80211_IOC_BSSID,
3883 u.req.is_u.macaddr, IEEE80211_ADDR_LEN);
3884 }
3885 if (get80211len(s, IEEE80211_IOC_STA_INFO, &u, sizeof(u), &len) < 0)
3886 errx(1, "unable to get station information");
3887 if (len < sizeof(struct ieee80211req_sta_info))
3888 return;
3889
3890 getchaninfo(s);
3891
3892 if (opmode == IEEE80211_M_MBSS)
3893 printf("%-17.17s %4s %5s %5s %7s %4s %4s %4s %6s %6s\n"
3894 , "ADDR"
3895 , "CHAN"
3896 , "LOCAL"
3897 , "PEER"
3898 , "STATE"
3899 , "RATE"
3900 , "RSSI"
3901 , "IDLE"
3902 , "TXSEQ"
3903 , "RXSEQ"
3904 );
3905 else
3906 printf("%-17.17s %4s %4s %4s %4s %4s %6s %6s %4s %-12s\n"
3907 , "ADDR"
3908 , "AID"
3909 , "CHAN"
3910 , "RATE"
3911 , "RSSI"
3912 , "IDLE"
3913 , "TXSEQ"
3914 , "RXSEQ"
3915 , "CAPS"
3916 , "FLAG"
3917 );
3918 cp = (const uint8_t *) u.req.info;
3919 do {
3920 const struct ieee80211req_sta_info *si;
3921
3922 si = (const struct ieee80211req_sta_info *) cp;

Callers 1

ifieee80211.cFile · 0.85

Calls 14

get80211opmodeFunction · 0.85
memsetFunction · 0.85
get80211Function · 0.85
get80211lenFunction · 0.85
getchaninfoFunction · 0.85
mesh_linkstate_stringFunction · 0.85
gettxseqFunction · 0.85
getrxseqFunction · 0.85
getcapsFunction · 0.85
printiesFunction · 0.85
printmimoFunction · 0.85
ieee80211_mhz2ieeeFunction · 0.70

Tested by

no test coverage detected