aboutsummaryrefslogtreecommitdiffstats
path: root/src/ap
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2017-01-01 23:08:01 (GMT)
committerJouni Malinen <j@w1.fi>2017-01-03 14:02:58 (GMT)
commitec45927b8ac8bc77699988dc76cbdbf4f7a5a1b8 (patch)
treed4ecaaa8d9e890137a435b6bdac4aac019ca64b9 /src/ap
parentf3383366aa64e15e43fd99fd6a46d62e640d8e40 (diff)
downloadhostap-ec45927b8ac8bc77699988dc76cbdbf4f7a5a1b8.zip
hostap-ec45927b8ac8bc77699988dc76cbdbf4f7a5a1b8.tar.gz
hostap-ec45927b8ac8bc77699988dc76cbdbf4f7a5a1b8.tar.bz2
Report received beacon report with BEACON-RESP-RX event
The new hostapd control interface event "BEACON-RESP-RX <STA address> <dialog token> <report mode> <beacon report>" is now used to report received beacon reports as a reponse to the REQ_BEACON operation. Signed-off-by: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'src/ap')
-rw-r--r--src/ap/rrm.c33
1 files changed, 30 insertions, 3 deletions
diff --git a/src/ap/rrm.c b/src/ap/rrm.c
index 1ca7428..28e8cc9 100644
--- a/src/ap/rrm.c
+++ b/src/ap/rrm.c
@@ -71,24 +71,47 @@ static void hostapd_handle_range_report(struct hostapd_data *hapd, u8 token,
}
+static void hostapd_handle_beacon_report(struct hostapd_data *hapd,
+ const u8 *addr, u8 token, u8 rep_mode,
+ const u8 *pos, size_t len)
+{
+ char report[2 * 255 + 1];
+
+ wpa_printf(MSG_DEBUG, "Beacon report token %u len %zu from " MACSTR,
+ token, len, MAC2STR(addr));
+ /* Skip to the beginning of the Beacon report */
+ if (len < 3)
+ return;
+ pos += 3;
+ len -= 3;
+ report[0] = '\0';
+ if (wpa_snprintf_hex(report, sizeof(report), pos, len) < 0)
+ return;
+ wpa_msg(hapd->msg_ctx, MSG_INFO, BEACON_RESP_RX MACSTR " %u %02x %s",
+ MAC2STR(addr), token, rep_mode, report);
+}
+
+
static void hostapd_handle_radio_msmt_report(struct hostapd_data *hapd,
const u8 *buf, size_t len)
{
const struct ieee80211_mgmt *mgmt = (const struct ieee80211_mgmt *) buf;
const u8 *pos, *ie, *end;
- u8 token;
+ u8 token, rep_mode;
end = buf + len;
token = mgmt->u.action.u.rrm.dialog_token;
pos = mgmt->u.action.u.rrm.variable;
while ((ie = get_ie(pos, end - pos, WLAN_EID_MEASURE_REPORT))) {
- if (ie[1] < 5) {
+ if (ie[1] < 3) {
wpa_printf(MSG_DEBUG, "Bad Measurement Report element");
break;
}
- wpa_printf(MSG_DEBUG, "Measurement report type %u", ie[4]);
+ rep_mode = ie[3];
+ wpa_printf(MSG_DEBUG, "Measurement report mode 0x%x type %u",
+ rep_mode, ie[4]);
switch (ie[4]) {
case MEASURE_TYPE_LCI:
@@ -97,6 +120,10 @@ static void hostapd_handle_radio_msmt_report(struct hostapd_data *hapd,
case MEASURE_TYPE_FTM_RANGE:
hostapd_handle_range_report(hapd, token, ie + 2, ie[1]);
break;
+ case MEASURE_TYPE_BEACON:
+ hostapd_handle_beacon_report(hapd, mgmt->sa, token,
+ rep_mode, ie + 2, ie[1]);
+ break;
default:
wpa_printf(MSG_DEBUG,
"Measurement report type %u is not supported",