Merge from vendor branch GCC:
[dragonfly.git] / contrib / hostapd-0.4.9 / ap.h
1 #ifndef AP_H
2 #define AP_H
3
4 /* STA flags */
5 #define WLAN_STA_AUTH BIT(0)
6 #define WLAN_STA_ASSOC BIT(1)
7 #define WLAN_STA_PS BIT(2)
8 #define WLAN_STA_TIM BIT(3)
9 #define WLAN_STA_PERM BIT(4)
10 #define WLAN_STA_AUTHORIZED BIT(5)
11 #define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */
12 #define WLAN_STA_PREAUTH BIT(7)
13
14 #define WLAN_RATE_1M BIT(0)
15 #define WLAN_RATE_2M BIT(1)
16 #define WLAN_RATE_5M5 BIT(2)
17 #define WLAN_RATE_11M BIT(3)
18 #define WLAN_RATE_COUNT 4
19
20 /* Maximum size of Supported Rates info element. IEEE 802.11 has a limit of 8,
21  * but some pre-standard IEEE 802.11g products use longer elements. */
22 #define WLAN_SUPP_RATES_MAX 32
23
24
25 struct sta_info {
26         struct sta_info *next; /* next entry in sta list */
27         struct sta_info *hnext; /* next entry in hash table list */
28         u8 addr[6];
29         u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
30         u32 flags;
31         u16 capability;
32         u16 listen_interval; /* or beacon_int for APs */
33         u8 supported_rates[WLAN_SUPP_RATES_MAX];
34         u8 tx_supp_rates;
35
36         enum {
37                 STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE
38         } timeout_next;
39
40         /* IEEE 802.1X related data */
41         struct eapol_state_machine *eapol_sm;
42
43         /* IEEE 802.11f (IAPP) related data */
44         struct ieee80211_mgmt *last_assoc_req;
45
46         u32 acct_session_id_hi;
47         u32 acct_session_id_lo;
48         time_t acct_session_start;
49         int acct_session_started;
50         int acct_terminate_cause; /* Acct-Terminate-Cause */
51         int acct_interim_interval; /* Acct-Interim-Interval */
52
53         unsigned long last_rx_bytes;
54         unsigned long last_tx_bytes;
55         u32 acct_input_gigawords; /* Acct-Input-Gigawords */
56         u32 acct_output_gigawords; /* Acct-Output-Gigawords */
57
58         u8 *challenge; /* IEEE 802.11 Shared Key Authentication Challenge */
59
60         int pairwise; /* Pairwise cipher suite, WPA_CIPHER_* */
61         u8 *wpa_ie;
62         size_t wpa_ie_len;
63         struct wpa_state_machine *wpa_sm;
64         enum {
65                 WPA_VERSION_NO_WPA = 0 /* WPA not used */,
66                 WPA_VERSION_WPA = 1 /* WPA / IEEE 802.11i/D3.0 */,
67                 WPA_VERSION_WPA2 = 2 /* WPA2 / IEEE 802.11i */
68         } wpa;
69         int wpa_key_mgmt; /* the selected WPA_KEY_MGMT_* */
70         struct rsn_pmksa_cache *pmksa;
71         struct rsn_preauth_interface *preauth_iface;
72         u8 req_replay_counter[8 /* WPA_REPLAY_COUNTER_LEN */];
73         int req_replay_counter_used;
74         u32 dot11RSNAStatsTKIPLocalMICFailures;
75         u32 dot11RSNAStatsTKIPRemoteMICFailures;
76 };
77
78
79 #define MAX_STA_COUNT 1024
80
81 /* Maximum number of AIDs to use for STAs; must be 2007 or lower
82  * (8802.11 limitation) */
83 #define MAX_AID_TABLE_SIZE 128
84
85 #define STA_HASH_SIZE 256
86 #define STA_HASH(sta) (sta[5])
87
88
89 /* Default value for maximum station inactivity. After AP_MAX_INACTIVITY has
90  * passed since last received frame from the station, a nullfunc data frame is
91  * sent to the station. If this frame is not acknowledged and no other frames
92  * have been received, the station will be disassociated after
93  * AP_DISASSOC_DELAY seconds. Similarily, the station will be deauthenticated
94  * after AP_DEAUTH_DELAY seconds has passed after disassociation. */
95 #define AP_MAX_INACTIVITY (5 * 60)
96 #define AP_DISASSOC_DELAY (1)
97 #define AP_DEAUTH_DELAY (1)
98
99 #endif /* AP_H */