ieee802_11.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. /*
  2. * hostapd / IEEE 802.11 Management
  3. * Copyright (c) 2002-2006, Jouni Malinen <j@w1.fi>
  4. * Copyright (c) 2007-2008, Intel Corporation
  5. *
  6. * This program is free software; you can redistribute it and/or modify
  7. * it under the terms of the GNU General Public License version 2 as
  8. * published by the Free Software Foundation.
  9. *
  10. * Alternatively, this software may be distributed under the terms of BSD
  11. * license.
  12. *
  13. * See README and COPYING for more details.
  14. */
  15. #ifndef IEEE802_11_H
  16. #define IEEE802_11_H
  17. #include "ieee802_11_defs.h"
  18. /* Parsed Information Elements */
  19. struct ieee802_11_elems {
  20. u8 *ssid;
  21. u8 ssid_len;
  22. u8 *supp_rates;
  23. u8 supp_rates_len;
  24. u8 *fh_params;
  25. u8 fh_params_len;
  26. u8 *ds_params;
  27. u8 ds_params_len;
  28. u8 *cf_params;
  29. u8 cf_params_len;
  30. u8 *tim;
  31. u8 tim_len;
  32. u8 *ibss_params;
  33. u8 ibss_params_len;
  34. u8 *challenge;
  35. u8 challenge_len;
  36. u8 *erp_info;
  37. u8 erp_info_len;
  38. u8 *ext_supp_rates;
  39. u8 ext_supp_rates_len;
  40. u8 *wpa_ie;
  41. u8 wpa_ie_len;
  42. u8 *rsn_ie;
  43. u8 rsn_ie_len;
  44. u8 *wme;
  45. u8 wme_len;
  46. u8 *wme_tspec;
  47. u8 wme_tspec_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 *ht_capabilities;
  57. u8 ht_capabilities_len;
  58. u8 *ht_operation;
  59. u8 ht_operation_len;
  60. };
  61. typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
  62. struct hostapd_frame_info {
  63. u32 phytype;
  64. u32 channel;
  65. u32 datarate;
  66. u32 ssi_signal;
  67. unsigned int passive_scan:1;
  68. };
  69. struct hostapd_iface;
  70. struct hostapd_data;
  71. struct sta_info;
  72. void ieee802_11_send_deauth(struct hostapd_data *hapd, u8 *addr, u16 reason);
  73. void ieee802_11_mgmt(struct hostapd_data *hapd, u8 *buf, size_t len,
  74. u16 stype, struct hostapd_frame_info *fi);
  75. void ieee802_11_mgmt_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
  76. u16 stype, int ok);
  77. ParseRes ieee802_11_parse_elems(struct hostapd_data *hapd, u8 *start,
  78. size_t len,
  79. struct ieee802_11_elems *elems,
  80. int show_errors);
  81. void ieee802_11_print_ssid(char *buf, const u8 *ssid, u8 len);
  82. void ieee80211_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr,
  83. int local);
  84. int ieee802_11_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
  85. int ieee802_11_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
  86. char *buf, size_t buflen);
  87. u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta,
  88. int probe);
  89. u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid);
  90. u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid);
  91. u8 * hostapd_eid_ht_capabilities_info(struct hostapd_data *hapd, u8 *eid);
  92. u8 * hostapd_eid_ht_operation(struct hostapd_data *hapd, u8 *eid);
  93. int hostapd_ht_operation_update(struct hostapd_iface *iface);
  94. #endif /* IEEE802_11_H */