ieee802_11.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /*
  2. * hostapd / IEEE 802.11 Management
  3. * Copyright (c) 2002-2006, 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_H
  15. #define IEEE802_11_H
  16. #include "ieee802_11_defs.h"
  17. /* Parsed Information Elements */
  18. struct ieee802_11_elems {
  19. u8 *ssid;
  20. u8 ssid_len;
  21. u8 *supp_rates;
  22. u8 supp_rates_len;
  23. u8 *fh_params;
  24. u8 fh_params_len;
  25. u8 *ds_params;
  26. u8 ds_params_len;
  27. u8 *cf_params;
  28. u8 cf_params_len;
  29. u8 *tim;
  30. u8 tim_len;
  31. u8 *ibss_params;
  32. u8 ibss_params_len;
  33. u8 *challenge;
  34. u8 challenge_len;
  35. u8 *erp_info;
  36. u8 erp_info_len;
  37. u8 *ext_supp_rates;
  38. u8 ext_supp_rates_len;
  39. u8 *wpa_ie;
  40. u8 wpa_ie_len;
  41. u8 *rsn_ie;
  42. u8 rsn_ie_len;
  43. u8 *wme;
  44. u8 wme_len;
  45. u8 *wme_tspec;
  46. u8 wme_tspec_len;
  47. u8 *power_cap;
  48. u8 power_cap_len;
  49. u8 *supp_channels;
  50. u8 supp_channels_len;
  51. u8 *mdie;
  52. u8 mdie_len;
  53. u8 *ftie;
  54. u8 ftie_len;
  55. };
  56. typedef enum { ParseOK = 0, ParseUnknown = 1, ParseFailed = -1 } ParseRes;
  57. struct hostapd_frame_info {
  58. u32 phytype;
  59. u32 channel;
  60. u32 datarate;
  61. u32 ssi_signal;
  62. unsigned int passive_scan:1;
  63. };
  64. struct hostapd_data;
  65. struct sta_info;
  66. void ieee802_11_send_deauth(struct hostapd_data *hapd, u8 *addr, u16 reason);
  67. void ieee802_11_mgmt(struct hostapd_data *hapd, u8 *buf, size_t len,
  68. u16 stype, struct hostapd_frame_info *fi);
  69. void ieee802_11_mgmt_cb(struct hostapd_data *hapd, u8 *buf, size_t len,
  70. u16 stype, int ok);
  71. ParseRes ieee802_11_parse_elems(struct hostapd_data *hapd, u8 *start,
  72. size_t len,
  73. struct ieee802_11_elems *elems,
  74. int show_errors);
  75. void ieee802_11_print_ssid(char *buf, const u8 *ssid, u8 len);
  76. void ieee80211_michael_mic_failure(struct hostapd_data *hapd, const u8 *addr,
  77. int local);
  78. int ieee802_11_get_mib(struct hostapd_data *hapd, char *buf, size_t buflen);
  79. int ieee802_11_get_mib_sta(struct hostapd_data *hapd, struct sta_info *sta,
  80. char *buf, size_t buflen);
  81. u16 hostapd_own_capab_info(struct hostapd_data *hapd, struct sta_info *sta,
  82. int probe);
  83. u8 * hostapd_eid_supp_rates(struct hostapd_data *hapd, u8 *eid);
  84. u8 * hostapd_eid_ext_supp_rates(struct hostapd_data *hapd, u8 *eid);
  85. #endif /* IEEE802_11_H */