Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #ifndef STA_INFO_H
00016 #define STA_INFO_H
00017
00018
00019 #define WLAN_STA_AUTH BIT(0)
00020 #define WLAN_STA_ASSOC BIT(1)
00021 #define WLAN_STA_PS BIT(2)
00022 #define WLAN_STA_TIM BIT(3)
00023 #define WLAN_STA_PERM BIT(4)
00024 #define WLAN_STA_AUTHORIZED BIT(5)
00025 #define WLAN_STA_PENDING_POLL BIT(6)
00026 #define WLAN_STA_SHORT_PREAMBLE BIT(7)
00027 #define WLAN_STA_PREAUTH BIT(8)
00028 #define WLAN_STA_WMM BIT(9)
00029 #define WLAN_STA_MFP BIT(10)
00030 #define WLAN_STA_HT BIT(11)
00031 #define WLAN_STA_WPS BIT(12)
00032 #define WLAN_STA_MAYBE_WPS BIT(13)
00033 #define WLAN_STA_WDS BIT(14)
00034 #define WLAN_STA_NONERP BIT(31)
00035
00036
00037
00038 #define WLAN_SUPP_RATES_MAX 32
00039
00040
00041 struct sta_info {
00042 struct sta_info *next;
00043 struct sta_info *hnext;
00044 u8 addr[6];
00045 u16 aid;
00046 u32 flags;
00047 u16 capability;
00048 u16 listen_interval;
00049 u8 supported_rates[WLAN_SUPP_RATES_MAX];
00050 int supported_rates_len;
00051
00052 unsigned int nonerp_set:1;
00053 unsigned int no_short_slot_time_set:1;
00054 unsigned int no_short_preamble_set:1;
00055 unsigned int no_ht_gf_set:1;
00056 unsigned int no_ht_set:1;
00057 unsigned int ht_20mhz_set:1;
00058
00059 u16 auth_alg;
00060 u8 previous_ap[6];
00061
00062 enum {
00063 STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE
00064 } timeout_next;
00065
00066
00067 struct eapol_state_machine *eapol_sm;
00068
00069
00070 struct ieee80211_mgmt *last_assoc_req;
00071
00072 u32 acct_session_id_hi;
00073 u32 acct_session_id_lo;
00074 time_t acct_session_start;
00075 int acct_session_started;
00076 int acct_terminate_cause;
00077 int acct_interim_interval;
00078
00079 unsigned long last_rx_bytes;
00080 unsigned long last_tx_bytes;
00081 u32 acct_input_gigawords;
00082 u32 acct_output_gigawords;
00083
00084 u8 *challenge;
00085
00086 struct wpa_state_machine *wpa_sm;
00087 struct rsn_preauth_interface *preauth_iface;
00088
00089 struct hostapd_ssid *ssid;
00090 struct hostapd_ssid *ssid_probe;
00091
00092 int vlan_id;
00093
00094 struct ieee80211_ht_capabilities *ht_capabilities;
00095
00096 #ifdef CONFIG_IEEE80211W
00097 int sa_query_count;
00098
00099 int sa_query_timed_out;
00100 u8 *sa_query_trans_id;
00101
00102
00103 struct os_time sa_query_start;
00104 #endif
00105
00106 struct wpabuf *wps_ie;
00107 };
00108
00109
00110
00111
00112
00113
00114
00115
00116 #define AP_MAX_INACTIVITY (5 * 60)
00117 #define AP_DISASSOC_DELAY (1)
00118 #define AP_DEAUTH_DELAY (1)
00119
00120
00121 #define AP_MAX_INACTIVITY_AFTER_DISASSOC (1 * 30)
00122
00123 #define AP_MAX_INACTIVITY_AFTER_DEAUTH (1 * 5)
00124
00125
00126 struct hostapd_data;
00127
00128 int ap_for_each_sta(struct hostapd_data *hapd,
00129 int (*cb)(struct hostapd_data *hapd, struct sta_info *sta,
00130 void *ctx),
00131 void *ctx);
00132 struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta);
00133 void ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta);
00134 void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta);
00135 void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta);
00136 void hostapd_free_stas(struct hostapd_data *hapd);
00137 void ap_handle_timer(void *eloop_ctx, void *timeout_ctx);
00138 void ap_sta_session_timeout(struct hostapd_data *hapd, struct sta_info *sta,
00139 u32 session_timeout);
00140 void ap_sta_no_session_timeout(struct hostapd_data *hapd,
00141 struct sta_info *sta);
00142 struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr);
00143 void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta,
00144 u16 reason);
00145 void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta,
00146 u16 reason);
00147 int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta,
00148 int old_vlanid);
00149 void ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
00150 void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
00151 int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta);
00152 void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
00153 const u8 *addr, u16 reason);
00154
00155 #endif