aboutsummaryrefslogtreecommitdiffstats
path: root/wpa_supplicant/hs20_supplicant.c
diff options
context:
space:
mode:
authorJouni Malinen <jouni@qca.qualcomm.com>2012-10-03 10:58:56 (GMT)
committerJouni Malinen <j@w1.fi>2012-10-03 10:58:56 (GMT)
commit2edcd5046a8e090de69e162088925317393eb66b (patch)
tree5fbbc35cc436789ed6732f1ac3b4df7fe2ddbe9b /wpa_supplicant/hs20_supplicant.c
parent315dbfb11e391d648a11204e24a7333c3827c9df (diff)
downloadhostap-2edcd5046a8e090de69e162088925317393eb66b.zip
hostap-2edcd5046a8e090de69e162088925317393eb66b.tar.gz
hostap-2edcd5046a8e090de69e162088925317393eb66b.tar.bz2
HS 2.0: Include parsed WAN Metrics in RX-HS20-ANQP event
This adds parsed version of WAN Metrics information to the control event message as follows: RX-HS20-ANQP 02:00:00:00:01:00 WAN Metrics 01:8000:1000:80:240:3000 format: <WAN Info>:<DL Speed>:<UL Speed>:<DL Load>:<UL Load>:<LMD> WAN Info: B0-B1: Link Status, B2: Symmetric Link, B3: At Capabity (encoded as two hex digits) Downlink Speed: Estimate of WAN backhaul link current downlink speed in kbps; 1..4294967295; 0 = unknown Uplink Speed: Estimate of WAN backhaul link current uplink speed in kbps 1..4294967295; 0 = unknown Downlink Load: Current load of downlink WAN connection (scaled to 255 = 100%) Uplink Load: Current load of uplink WAN connection (scaled to 255 = 100%) Load Measurement Duration: Duration for measuring downlink/uplink load in tenths of a second (1..65535); 0 if load cannot be determined Signed-hostap: Jouni Malinen <jouni@qca.qualcomm.com>
Diffstat (limited to 'wpa_supplicant/hs20_supplicant.c')
-rw-r--r--wpa_supplicant/hs20_supplicant.c11
1 files changed, 9 insertions, 2 deletions
diff --git a/wpa_supplicant/hs20_supplicant.c b/wpa_supplicant/hs20_supplicant.c
index 0eb6119..a2577c9 100644
--- a/wpa_supplicant/hs20_supplicant.c
+++ b/wpa_supplicant/hs20_supplicant.c
@@ -141,9 +141,16 @@ void hs20_parse_rx_hs20_anqp_resp(struct wpa_supplicant *wpa_s,
}
break;
case HS20_STYPE_WAN_METRICS:
+ wpa_hexdump(MSG_DEBUG, "WAN Metrics", pos, slen);
+ if (slen < 13) {
+ wpa_dbg(wpa_s, MSG_DEBUG, "HS 2.0: Too short WAN "
+ "Metrics value from " MACSTR, MAC2STR(sa));
+ break;
+ }
wpa_msg(wpa_s, MSG_INFO, "RX-HS20-ANQP " MACSTR
- " WAN Metrics", MAC2STR(sa));
- wpa_hexdump_ascii(MSG_DEBUG, "WAN Metrics", pos, slen);
+ " WAN Metrics %02x:%u:%u:%u:%u:%u", MAC2STR(sa),
+ pos[0], WPA_GET_LE32(pos + 1), WPA_GET_LE32(pos + 5),
+ pos[9], pos[10], WPA_GET_LE16(pos + 11));
if (anqp) {
wpabuf_free(anqp->hs20_wan_metrics);
anqp->hs20_wan_metrics = wpabuf_alloc_copy(pos, slen);