aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/ctrl.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2011-12-22 14:59:25 (GMT)
committerJouni Malinen <j@w1.fi>2011-12-22 14:59:25 (GMT)
commitfd848ab9e3bcdc5f8412118c3c7712a333f60351 (patch)
treedd06ea5ef2d01dd079431d99a66c9bec73593541 /wlantest/ctrl.c
parent3c56f0e2757edef2bfcadf928e2aba1270779870 (diff)
downloadhostap-fd848ab9e3bcdc5f8412118c3c7712a333f60351.zip
hostap-fd848ab9e3bcdc5f8412118c3c7712a333f60351.tar.gz
hostap-fd848ab9e3bcdc5f8412118c3c7712a333f60351.tar.bz2
wlantest: Store last received GTK for each STA
This allows info_sta command to be used to fetch the last received GTK separately for each STA. Signed-hostap: Jouni Malinen <j@w1.fi>
Diffstat (limited to 'wlantest/ctrl.c')
-rw-r--r--wlantest/ctrl.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/wlantest/ctrl.c b/wlantest/ctrl.c
index 2132b2b..32509b3 100644
--- a/wlantest/ctrl.c
+++ b/wlantest/ctrl.c
@@ -990,6 +990,15 @@ static void info_print_state(char *buf, size_t len, int state)
}
+static void info_print_gtk(char *buf, size_t len, struct wlantest_sta *sta)
+{
+ size_t pos;
+
+ pos = os_snprintf(buf, len, "IDX=%d,GTK=", sta->gtk_idx);
+ wpa_snprintf_hex(buf + pos, len - pos, sta->gtk, sta->gtk_len);
+}
+
+
static void ctrl_info_sta(struct wlantest *wt, int sock, u8 *cmd, size_t clen)
{
u8 *addr;
@@ -1029,6 +1038,9 @@ static void ctrl_info_sta(struct wlantest *wt, int sock, u8 *cmd, size_t clen)
case WLANTEST_STA_INFO_STATE:
info_print_state(resp, sizeof(resp), sta->state);
break;
+ case WLANTEST_STA_INFO_GTK:
+ info_print_gtk(resp, sizeof(resp), sta);
+ break;
default:
ctrl_send_simple(wt, sock, WLANTEST_CTRL_INVALID_CMD);
return;