aboutsummaryrefslogtreecommitdiffstats
path: root/wlantest/sta.c
diff options
context:
space:
mode:
authorJouni Malinen <j@w1.fi>2010-11-06 16:10:34 (GMT)
committerJouni Malinen <j@w1.fi>2010-11-07 21:29:01 (GMT)
commit021a6fe49954768221f025d644851579b1aa6c6c (patch)
treed3c7246252dff247017ad6542361275bc2cdf16a /wlantest/sta.c
parent2d73f0a875df46d03c16c5e54d5c935cfdc2ee75 (diff)
downloadhostap-021a6fe49954768221f025d644851579b1aa6c6c.zip
hostap-021a6fe49954768221f025d644851579b1aa6c6c.tar.gz
hostap-021a6fe49954768221f025d644851579b1aa6c6c.tar.bz2
wlantest: Maintain a copy of WPA/RSN IE from (Re)AssocReq
Diffstat (limited to 'wlantest/sta.c')
-rw-r--r--wlantest/sta.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/wlantest/sta.c b/wlantest/sta.c
index fc84ee1..447bd7a 100644
--- a/wlantest/sta.c
+++ b/wlantest/sta.c
@@ -15,6 +15,7 @@
#include "utils/includes.h"
#include "utils/common.h"
+#include "common/ieee802_11_common.h"
#include "wlantest.h"
@@ -46,3 +47,26 @@ void sta_deinit(struct wlantest_sta *sta)
dl_list_del(&sta->list);
os_free(sta);
}
+
+
+void sta_update_assoc(struct wlantest_sta *sta, struct ieee802_11_elems *elems)
+{
+ if (elems->wpa_ie && elems->rsn_ie) {
+ wpa_printf(MSG_INFO, "Both WPA IE and RSN IE included in "
+ "Association Request frame from " MACSTR,
+ MAC2STR(sta->addr));
+ }
+
+ if (elems->rsn_ie) {
+ wpa_hexdump(MSG_DEBUG, "RSN IE", elems->rsn_ie - 2,
+ elems->rsn_ie_len + 2);
+ os_memcpy(sta->rsnie, elems->rsn_ie - 2,
+ elems->rsn_ie_len + 2);
+ } else if (elems->wpa_ie) {
+ wpa_hexdump(MSG_DEBUG, "WPA IE", elems->wpa_ie - 2,
+ elems->wpa_ie_len + 2);
+ os_memcpy(sta->rsnie, elems->wpa_ie - 2,
+ elems->wpa_ie_len + 2);
+ } else
+ sta->rsnie[0] = 0;
+}