ieee802_11_common.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475
  1. /*
  2. * IEEE 802.11 Common routines
  3. * Copyright (c) 2002-2008, 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 IEEE802_11_COMMON_H
  15. #define IEEE802_11_COMMON_H
  16. /* Parsed Information Elements */
  17. struct ieee802_11_elems {
  18. u8 *ssid;
  19. u8 ssid_len;
  20. u8 *supp_rates;
  21. u8 supp_rates_len;
  22. u8 *fh_params;
  23. u8 fh_params_len;
  24. u8 *ds_params;
  25. u8 ds_params_len;
  26. u8 *cf_params;
  27. u8 cf_params_len;
  28. u8 *tim;
  29. u8 tim_len;
  30. u8 *ibss_params;
  31. u8 ibss_params_len;
  32. u8 *challenge;
  33. u8 challenge_len;
  34. u8 *erp_info;
  35. u8 erp_info_len;
  36. u8 *ext_supp_rates;
  37. u8 ext_supp_rates_len;
  38. u8 *wpa_ie;
  39. u8 wpa_ie_len;
  40. u8 *rsn_ie;
  41. u8 rsn_ie_len;
  42. u8 *wmm; /* WMM Information or Parameter Element */
  43. u8 wmm_len; /* 7 = WMM Information; 24 = WMM Parameter */
  44. u8 *wmm_tspec;
  45. u8 wmm_tspec_len;
  46. u8 *wps_ie;
  47. u8 wps_ie_len;
  48. u8 *power_cap;
  49. u8 power_cap_len;
  50. u8 *supp_channels;
  51. u8 supp_channels_len;
  52. u8 *mdie;
  53. u8 mdie_len;
  54. u8 *ftie;
  55. u8 ftie_len;
  56. u8 *timeout_int;
  57. u8 timeout_int_len;
  58. u8 *ht_capabilities;
  59. u8 ht_capabilities_len;
  60. u8 *ht_operation;
  61. u8 ht_operation_len;
  62. u8 *vendor_ht_cap;
  63. u8 vendor_ht_cap_len;
  64. };
  65. typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
  66. ParseRes ieee802_11_parse_elems(u8 *start, size_t len,
  67. struct ieee802_11_elems *elems,
  68. int show_errors);
  69. int ieee802_11_ie_count(const u8 *ies, size_t ies_len);
  70. #endif /* IEEE802_11_COMMON_H */