hostapd.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163
  1. /*
  2. * hostapd / Initialization and configuration
  3. * Host AP kernel driver
  4. * Copyright (c) 2002-2008, Jouni Malinen <j@w1.fi>
  5. * Copyright (c) 2007-2008, Intel Corporation
  6. *
  7. * This program is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License version 2 as
  9. * published by the Free Software Foundation.
  10. *
  11. * Alternatively, this software may be distributed under the terms of BSD
  12. * license.
  13. *
  14. * See README and COPYING for more details.
  15. */
  16. #ifndef HOSTAPD_H
  17. #define HOSTAPD_H
  18. #include "common.h"
  19. #include "ap.h"
  20. #include "hostapd_defs.h"
  21. #include "config.h"
  22. struct wpa_driver_ops;
  23. struct wpa_ctrl_dst;
  24. struct radius_server_data;
  25. struct upnp_wps_device_sm;
  26. #ifdef CONFIG_FULL_DYNAMIC_VLAN
  27. struct full_dynamic_vlan;
  28. #endif /* CONFIG_FULL_DYNAMIC_VLAN */
  29. /**
  30. * struct hostapd_data - hostapd per-BSS data structure
  31. */
  32. struct hostapd_data {
  33. struct hostapd_iface *iface;
  34. struct hostapd_config *iconf;
  35. struct hostapd_bss_config *conf;
  36. int interface_added; /* virtual interface added for this BSS */
  37. u8 own_addr[ETH_ALEN];
  38. int num_sta; /* number of entries in sta_list */
  39. struct sta_info *sta_list; /* STA info list head */
  40. struct sta_info *sta_hash[STA_HASH_SIZE];
  41. /* pointers to STA info; based on allocated AID or NULL if AID free
  42. * AID is in the range 1-2007, so sta_aid[0] corresponders to AID 1
  43. * and so on
  44. */
  45. struct sta_info *sta_aid[MAX_AID_TABLE_SIZE];
  46. const struct wpa_driver_ops *driver;
  47. void *drv_priv;
  48. u8 *default_wep_key;
  49. u8 default_wep_key_idx;
  50. struct radius_client_data *radius;
  51. int radius_client_reconfigured;
  52. u32 acct_session_id_hi, acct_session_id_lo;
  53. struct iapp_data *iapp;
  54. struct hostapd_cached_radius_acl *acl_cache;
  55. struct hostapd_acl_query_data *acl_queries;
  56. struct wpa_authenticator *wpa_auth;
  57. struct eapol_authenticator *eapol_auth;
  58. struct rsn_preauth_interface *preauth_iface;
  59. time_t michael_mic_failure;
  60. int michael_mic_failures;
  61. int tkip_countermeasures;
  62. int ctrl_sock;
  63. struct wpa_ctrl_dst *ctrl_dst;
  64. void *ssl_ctx;
  65. void *eap_sim_db_priv;
  66. struct radius_server_data *radius_srv;
  67. int parameter_set_count;
  68. #ifdef CONFIG_FULL_DYNAMIC_VLAN
  69. struct full_dynamic_vlan *full_dynamic_vlan;
  70. #endif /* CONFIG_FULL_DYNAMIC_VLAN */
  71. struct l2_packet_data *l2;
  72. struct wps_context *wps;
  73. #ifdef CONFIG_WPS
  74. u8 *wps_beacon_ie;
  75. size_t wps_beacon_ie_len;
  76. u8 *wps_probe_resp_ie;
  77. size_t wps_probe_resp_ie_len;
  78. unsigned int ap_pin_failures;
  79. struct upnp_wps_device_sm *wps_upnp;
  80. #endif /* CONFIG_WPS */
  81. };
  82. /**
  83. * struct hostapd_iface - hostapd per-interface data structure
  84. */
  85. struct hostapd_iface {
  86. char *config_fname;
  87. struct hostapd_config *conf;
  88. size_t num_bss;
  89. struct hostapd_data **bss;
  90. int num_ap; /* number of entries in ap_list */
  91. struct ap_info *ap_list; /* AP info list head */
  92. struct ap_info *ap_hash[STA_HASH_SIZE];
  93. struct ap_info *ap_iter_list;
  94. struct hostapd_hw_modes *hw_features;
  95. int num_hw_features;
  96. struct hostapd_hw_modes *current_mode;
  97. /* Rates that are currently used (i.e., filtered copy of
  98. * current_mode->channels */
  99. int num_rates;
  100. struct hostapd_rate_data *current_rates;
  101. u16 hw_flags;
  102. /* Number of associated Non-ERP stations (i.e., stations using 802.11b
  103. * in 802.11g BSS) */
  104. int num_sta_non_erp;
  105. /* Number of associated stations that do not support Short Slot Time */
  106. int num_sta_no_short_slot_time;
  107. /* Number of associated stations that do not support Short Preamble */
  108. int num_sta_no_short_preamble;
  109. int olbc; /* Overlapping Legacy BSS Condition */
  110. /* Number of HT associated stations that do not support greenfield */
  111. int num_sta_ht_no_gf;
  112. /* Number of associated non-HT stations */
  113. int num_sta_no_ht;
  114. /* Number of HT associated stations 20 MHz */
  115. int num_sta_ht_20mhz;
  116. /* Overlapping BSS information */
  117. int olbc_ht;
  118. #ifdef CONFIG_IEEE80211N
  119. u16 ht_op_mode;
  120. #endif /* CONFIG_IEEE80211N */
  121. };
  122. int hostapd_reload_config(struct hostapd_iface *iface);
  123. int hostapd_for_each_interface(int (*cb)(struct hostapd_iface *iface,
  124. void *ctx), void *ctx);
  125. #endif /* HOSTAPD_H */