Blacklist机制
15610 07-15 16:09:55.194 2442 2442 D wpa_supplicant: Added BSSID a0:63:91:ef:0b:f3 into blacklist
15933 07-15 16:10:01.604 2442 2442 D wpa_supplicant: Removed BSSID a0:63:91:ef:0b:f3 from blacklist (clear)
//blacklist 添加函数
int wpa_blacklist_add(struct wpa_supplicant *wpa_s, const u8 *bssid)
{
struct wpa_blacklist *e;
if (wpa_s == NULL || bssid == NULL)
return -1;
e = wpa_blacklist_get(wpa_s, bssid);
if (e) {
e->count++;
wpa_printf(MSG_DEBUG, "BSSID " MACSTR " blacklist count "
"incremented to %d",
MAC2STR(bssid), e->count);
return e->count;
}
e = os_zalloc(sizeof(*e));
if (e == NULL)
return -1;
os_memcpy(e->bssid, bssid, ETH_ALEN);
e->count = 1;
e->next = wpa_s->blacklist;
wpa_s->blacklist = e;
wpa_printf(MSG_DEBUG, "Added BSSID " MACSTR " into blacklist",
MAC2STR(bssid));
return e->count;
}
//
4388 4388 I wpa_supplicant: wlan0: CTRL-EVENT-DISCONNECTED bssid=a0:63:91:ef:0b:f3 reason=15
static int
atheros_sta_deauth(void *priv, const u8 *own_addr, const u8 *addr,
int reason_code)
{
struct atheros_driver_data *drv = priv;
struct ieee80211req_mlme mlme;
int ret;
wpa_printf(MSG_DEBUG, "%s: addr=%s reason_code=%d",
__func__, ether_sprintf(addr), reason_code);
mlme.im_op = IEEE80211_MLME_DEAUTH;
mlme.im_reason = reason_code;
os_memcpy(mlme.im_macaddr, addr, IEEE80211_ADDR_LEN);
ret = set80211priv(drv, IEEE80211_IOCTL_SETMLME, &mlme, sizeof(mlme));
if (ret < 0) {
wpa_printf(MSG_DEBUG, "%s: Failed to deauth STA (addr " MACSTR
" reason %d)",
__func__, MAC2STR(addr), reason_code);
}
return ret;
}
WIFI唤醒机制