wlantest.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. /*
  2. * wlantest - IEEE 802.11 protocol monitoring and testing tool
  3. * Copyright (c) 2010, Jouni Malinen <j@w1.fi>
  4. *
  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.
  8. *
  9. * Alternatively, this software may be distributed under the terms of BSD
  10. * license.
  11. *
  12. * See README and COPYING for more details.
  13. */
  14. #ifndef WLANTEST_H
  15. #define WLANTEST_H
  16. #include "utils/list.h"
  17. struct wlantest_sta {
  18. struct dl_list list;
  19. u8 addr[ETH_ALEN];
  20. };
  21. struct wlantest_bss {
  22. struct dl_list list;
  23. u8 bssid[ETH_ALEN];
  24. u16 capab_info;
  25. u8 ssid[32];
  26. size_t ssid_len;
  27. int proberesp_seen;
  28. int parse_error_reported;
  29. u8 wpaie[257];
  30. u8 rsnie[257];
  31. struct dl_list sta; /* struct wlantest_sta */
  32. };
  33. struct wlantest {
  34. int monitor_sock;
  35. struct dl_list bss; /* struct wlantest_bss */
  36. unsigned int rx_mgmt;
  37. unsigned int rx_ctrl;
  38. unsigned int rx_data;
  39. unsigned int fcs_error;
  40. };
  41. int read_cap_file(struct wlantest *wt, const char *fname);
  42. void wlantest_process(struct wlantest *wt, const u8 *data, size_t len);
  43. u32 crc32(const u8 *frame, size_t frame_len);
  44. int monitor_init(struct wlantest *wt, const char *ifname);
  45. void monitor_deinit(struct wlantest *wt);
  46. struct wlantest_bss * bss_get(struct wlantest *wt, const u8 *bssid);
  47. void bss_deinit(struct wlantest_bss *bss);
  48. struct wlantest_sta * sta_get(struct wlantest_bss *bss, const u8 *addr);
  49. void sta_deinit(struct wlantest_sta *sta);
  50. #endif /* WLANTEST_H */