// dummy TBD int getUptime_ath9k(char *ifname, unsigned char *mac) { unsigned char rmac[32]; ether_etoa(mac, rmac); struct mac80211_info *mac80211_info; struct wifi_client_info *wc; mac80211_info = mac80211_assoclist(ifname); for (wc = mac80211_info->wci; wc; wc = wc->next) { if (!strcmp(wc->mac, rmac)) { free_wifi_clients(mac80211_info->wci); free(mac80211_info); return wc->uptime; } } free_wifi_clients(mac80211_info->wci); free(mac80211_info); return 0; }
int ej_active_wireless_if_ath9k(webs_t wp, int argc, char_t ** argv, char *ifname, int cnt, int turbo, int macmask) { char mac[32]; struct mac80211_info *mac80211_info; struct wifi_client_info *wc; char nb[32]; int bias, qual, it; int co = 0; sprintf(nb, "%s_bias", ifname); bias = atoi(nvram_default_get(nb, "0")); // sprintf(it, "inactivity_time", ifname); // it = atoi(nvram_default_get("inacttime", "300000")); mac80211_info = mac80211_assoclist(ifname); for (wc = mac80211_info->wci; wc; wc = wc->next) { strncpy(mac, wc->mac, 31); if (nvram_match("maskmac", "1") && macmask) { mac[0] = 'x'; mac[1] = 'x'; mac[3] = 'x'; mac[4] = 'x'; mac[6] = 'x'; mac[7] = 'x'; mac[9] = 'x'; mac[10] = 'x'; } qual = wc->signal * 124 + 11600; qual /= 10; // if (wc->inactive_time < it) { if (cnt) websWrite(wp, ","); websWrite(wp, "'%s','%s','%s','%dM','%dM','%d','%d','%d','%d'", mac, wc->ifname, UPTIME(wc->uptime), wc->txrate / 10, wc->rxrate / 10, wc->signal + bias, wc->noise + bias, wc->signal - wc->noise, qual); cnt++; // } } free_wifi_clients(mac80211_info->wci); free(mac80211_info); return cnt; }
// dummy TBD int getassoclist_ath9k(char *ifname, unsigned char *list) { unsigned int *count = (unsigned int *)list; struct mac80211_info *mac80211_info; struct wifi_client_info *wc; unsigned char *l = (unsigned char *)list; mac80211_info = mac80211_assoclist(ifname); l += 4; count[0]=0; for (wc = mac80211_info->wci; wc; wc = wc->next) { ether_atoe(wc->mac,l); l+=6; count[0]++; } free_wifi_clients(mac80211_info->wci); free(mac80211_info); return count[0]; }