2 * wlantest - IEEE 802.11 protocol monitoring and testing tool
3 * Copyright (c) 2010, Jouni Malinen <j@w1.fi>
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
9 * Alternatively, this software may be distributed under the terms of BSD
12 * See README and COPYING for more details.
18 #include "utils/list.h"
19 #include "common/wpa_common.h"
21 struct ieee802_11_elems;
24 #define MAX_RADIUS_SECRET_LEN 128
26 struct wlantest_radius_secret {
28 char secret[MAX_RADIUS_SECRET_LEN];
31 struct wlantest_passphrase {
48 STATE1 /* not authenticated */,
49 STATE2 /* authenticated */,
50 STATE3 /* associated */
53 u8 rsnie[257]; /* WPA/RSN IE */
54 u8 anonce[32]; /* ANonce from the previous EAPOL-Key msg 1/4 or 3/4 */
55 u8 snonce[32]; /* SNonce from the previous EAPOL-Key msg 2/4 */
56 struct wpa_ptk ptk; /* Derived PTK */
67 int parse_error_reported;
70 struct dl_list sta; /* struct wlantest_sta */
71 struct dl_list pmk; /* struct wlantest_pmk */
78 struct wlantest_radius {
82 struct radius_msg *last_req;
89 struct dl_list passphrase; /* struct wlantest_passphrase */
90 struct dl_list bss; /* struct wlantest_bss */
91 struct dl_list secret; /* struct wlantest_radius_secret */
92 struct dl_list radius; /* struct wlantest_radius */
93 struct dl_list pmk; /* struct wlantest_pmk */
98 unsigned int fcs_error;
101 int read_cap_file(struct wlantest *wt, const char *fname);
102 int read_wired_cap_file(struct wlantest *wt, const char *fname);
103 void wlantest_process(struct wlantest *wt, const u8 *data, size_t len);
104 void wlantest_process_wired(struct wlantest *wt, const u8 *data, size_t len);
105 u32 crc32(const u8 *frame, size_t frame_len);
106 int monitor_init(struct wlantest *wt, const char *ifname);
107 int monitor_init_wired(struct wlantest *wt, const char *ifname);
108 void monitor_deinit(struct wlantest *wt);
109 void rx_mgmt(struct wlantest *wt, const u8 *data, size_t len);
110 void rx_data(struct wlantest *wt, const u8 *data, size_t len);
112 struct wlantest_bss * bss_get(struct wlantest *wt, const u8 *bssid);
113 void bss_deinit(struct wlantest_bss *bss);
114 void bss_update(struct wlantest *wt, struct wlantest_bss *bss,
115 struct ieee802_11_elems *elems);
116 void pmk_deinit(struct wlantest_pmk *pmk);
118 struct wlantest_sta * sta_get(struct wlantest_bss *bss, const u8 *addr);
119 void sta_deinit(struct wlantest_sta *sta);
120 void sta_update_assoc(struct wlantest_sta *sta,
121 struct ieee802_11_elems *elems);
123 #endif /* WLANTEST_H */