sta_info.h

Go to the documentation of this file.
00001 
00016 #ifndef STA_INFO_H
00017 #define STA_INFO_H
00018 
00019 #include "sta_flags.h"
00020 
00021 #ifdef CONFIG_IEEE80211N
00022 #include "ieee802_11_defs.h"
00023 #endif /* CONFIG_IEEE80211N */
00024 
00025 /* Maximum number of supported rates (from both Supported Rates and Extended
00026  * Supported Rates IEs). */
00027 #define WLAN_SUPP_RATES_MAX 32
00028 
00029 
00030 struct sta_info {
00031         struct sta_info *next; /* next entry in sta list */
00032         struct sta_info *hnext; /* next entry in hash table list */
00033         u8 addr[6];
00034         u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
00035         u32 flags;
00036         u16 capability;
00037         u16 listen_interval; /* or beacon_int for APs */
00038         u8 supported_rates[WLAN_SUPP_RATES_MAX];
00039         int supported_rates_len;
00040 
00041         unsigned int nonerp_set:1;
00042         unsigned int no_short_slot_time_set:1;
00043         unsigned int no_short_preamble_set:1;
00044         unsigned int no_ht_gf_set:1;
00045         unsigned int no_ht_set:1;
00046         unsigned int ht_20mhz_set:1;
00047 
00048         u16 auth_alg;
00049         u8 previous_ap[6];
00050 
00051         enum {
00052                 STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE
00053         } timeout_next;
00054 
00055         /* IEEE 802.1X related data */
00056         struct eapol_state_machine *eapol_sm;
00057 
00058         /* IEEE 802.11f (IAPP) related data */
00059         struct ieee80211_mgmt *last_assoc_req;
00060 
00061         u32 acct_session_id_hi;
00062         u32 acct_session_id_lo;
00063         time_t acct_session_start;
00064         int acct_session_started;
00065         int acct_terminate_cause; /* Acct-Terminate-Cause */
00066         int acct_interim_interval; /* Acct-Interim-Interval */
00067 
00068         unsigned long last_rx_bytes;
00069         unsigned long last_tx_bytes;
00070         u32 acct_input_gigawords; /* Acct-Input-Gigawords */
00071         u32 acct_output_gigawords; /* Acct-Output-Gigawords */
00072 
00073         u8 *challenge; /* IEEE 802.11 Shared Key Authentication Challenge */
00074 
00075         struct wpa_state_machine *wpa_sm;
00076         struct rsn_preauth_interface *preauth_iface;
00077 
00078         struct hostapd_ssid *ssid; /* SSID selection based on (Re)AssocReq */
00079         struct hostapd_ssid *ssid_probe; /* SSID selection based on ProbeReq */
00080 
00081         int vlan_id;
00082 
00083 #ifdef CONFIG_IEEE80211N
00084         struct ht_cap_ie ht_capabilities; /* IEEE 802.11n capabilities */
00085 #endif /* CONFIG_IEEE80211N */
00086 
00087 #ifdef CONFIG_IEEE80211W
00088         int sa_query_count; /* number of pending SA Query requests;
00089                              * 0 = no SA Query in progress */
00090         int sa_query_timed_out;
00091         u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
00092                                 * sa_query_count octets of pending SA Query
00093                                 * transaction identifiers */
00094         struct os_time sa_query_start;
00095 #endif /* CONFIG_IEEE80211W */
00096 
00097         struct wpabuf *wps_ie; /* WPS IE from (Re)Association Request */
00098 };
00099 
00100 
00101 /* Default value for maximum station inactivity. After AP_MAX_INACTIVITY has
00102  * passed since last received frame from the station, a nullfunc data frame is
00103  * sent to the station. If this frame is not acknowledged and no other frames
00104  * have been received, the station will be disassociated after
00105  * AP_DISASSOC_DELAY seconds. Similarily, the station will be deauthenticated
00106  * after AP_DEAUTH_DELAY seconds has passed after disassociation. */
00107 #define AP_MAX_INACTIVITY (5 * 60)
00108 #define AP_DISASSOC_DELAY (1)
00109 #define AP_DEAUTH_DELAY (1)
00110 /* Number of seconds to keep STA entry with Authenticated flag after it has
00111  * been disassociated. */
00112 #define AP_MAX_INACTIVITY_AFTER_DISASSOC (1 * 30)
00113 /* Number of seconds to keep STA entry after it has been deauthenticated. */
00114 #define AP_MAX_INACTIVITY_AFTER_DEAUTH (1 * 5)
00115 
00116 
00117 struct hostapd_data;
00118 
00119 int ap_for_each_sta(struct hostapd_data *hapd,
00120                     int (*cb)(struct hostapd_data *hapd, struct sta_info *sta,
00121                               void *ctx),
00122                     void *ctx);
00123 struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta);
00124 void ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta);
00125 void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta);
00126 void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta);
00127 void hostapd_free_stas(struct hostapd_data *hapd);
00128 void ap_handle_timer(void *eloop_ctx, void *timeout_ctx);
00129 void ap_sta_session_timeout(struct hostapd_data *hapd, struct sta_info *sta,
00130                             u32 session_timeout);
00131 void ap_sta_no_session_timeout(struct hostapd_data *hapd,
00132                                struct sta_info *sta);
00133 struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr);
00134 void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta,
00135                          u16 reason);
00136 void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta,
00137                            u16 reason);
00138 int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta,
00139                      int old_vlanid);
00140 void ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
00141 void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
00142 int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta);
00143 
00144 #endif /* STA_INFO_H */
00145 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines

Generated on Sat Nov 21 23:16:48 2009 for hostapd by  doxygen 1.6.1