Add POLL_STA command to check connectivity in AP mode

The hostapd "POLL_STA <addr>" control interface command can be used to
check whether an associated station ACKs a QoS Data frame. The received
ACK for such a frame is reported as an event message ("AP-STA-POLL-OK
<addr>").

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Jouni Malinen 2016-04-08 19:37:08 +03:00 committed by Jouni Malinen
parent 36533aff3c
commit 1854eeca19
5 changed files with 29 additions and 0 deletions

View File

@ -2153,6 +2153,9 @@ static int hostapd_ctrl_iface_receive_process(struct hostapd_data *hapd,
} else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) { } else if (os_strncmp(buf, "DISASSOCIATE ", 13) == 0) {
if (hostapd_ctrl_iface_disassociate(hapd, buf + 13)) if (hostapd_ctrl_iface_disassociate(hapd, buf + 13))
reply_len = -1; reply_len = -1;
} else if (os_strncmp(buf, "POLL_STA ", 9) == 0) {
if (hostapd_ctrl_iface_poll_sta(hapd, buf + 9))
reply_len = -1;
} else if (os_strcmp(buf, "STOP_AP") == 0) { } else if (os_strcmp(buf, "STOP_AP") == 0) {
if (hostapd_ctrl_iface_stop_ap(hapd)) if (hostapd_ctrl_iface_stop_ap(hapd))
reply_len = -1; reply_len = -1;

View File

@ -429,6 +429,27 @@ int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd,
} }
int hostapd_ctrl_iface_poll_sta(struct hostapd_data *hapd,
const char *txtaddr)
{
u8 addr[ETH_ALEN];
struct sta_info *sta;
wpa_dbg(hapd->msg_ctx, MSG_DEBUG, "CTRL_IFACE POLL_STA %s", txtaddr);
if (hwaddr_aton(txtaddr, addr))
return -1;
sta = ap_get_sta(hapd, addr);
if (!sta)
return -1;
hostapd_drv_poll_client(hapd, hapd->own_addr, addr,
sta->flags & WLAN_STA_WMM);
return 0;
}
int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf, int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
size_t buflen) size_t buflen)
{ {

View File

@ -19,6 +19,8 @@ int hostapd_ctrl_iface_deauthenticate(struct hostapd_data *hapd,
const char *txtaddr); const char *txtaddr);
int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd, int hostapd_ctrl_iface_disassociate(struct hostapd_data *hapd,
const char *txtaddr); const char *txtaddr);
int hostapd_ctrl_iface_poll_sta(struct hostapd_data *hapd,
const char *txtaddr);
int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf, int hostapd_ctrl_iface_status(struct hostapd_data *hapd, char *buf,
size_t buflen); size_t buflen);
int hostapd_parse_csa_settings(const char *pos, int hostapd_parse_csa_settings(const char *pos,

View File

@ -3013,6 +3013,8 @@ void hostapd_client_poll_ok(struct hostapd_data *hapd, const u8 *addr)
} }
if (sta == NULL) if (sta == NULL)
return; return;
wpa_msg(hapd->msg_ctx, MSG_INFO, AP_STA_POLL_OK MACSTR,
MAC2STR(sta->addr));
if (!(sta->flags & WLAN_STA_PENDING_POLL)) if (!(sta->flags & WLAN_STA_PENDING_POLL))
return; return;

View File

@ -245,6 +245,7 @@ extern "C" {
#define AP_STA_CONNECTED "AP-STA-CONNECTED " #define AP_STA_CONNECTED "AP-STA-CONNECTED "
#define AP_STA_DISCONNECTED "AP-STA-DISCONNECTED " #define AP_STA_DISCONNECTED "AP-STA-DISCONNECTED "
#define AP_STA_POSSIBLE_PSK_MISMATCH "AP-STA-POSSIBLE-PSK-MISMATCH " #define AP_STA_POSSIBLE_PSK_MISMATCH "AP-STA-POSSIBLE-PSK-MISMATCH "
#define AP_STA_POLL_OK "AP-STA-POLL-OK "
#define AP_REJECTED_MAX_STA "AP-REJECTED-MAX-STA " #define AP_REJECTED_MAX_STA "AP-REJECTED-MAX-STA "
#define AP_REJECTED_BLOCKED_STA "AP-REJECTED-BLOCKED-STA " #define AP_REJECTED_BLOCKED_STA "AP-REJECTED-BLOCKED-STA "