2 * hostapd / Station table data structures
3 * Copyright (c) 2002-2004, Jouni Malinen <j@w1.fi>
4 * Copyright (c) 2007-2008, Intel Corporation
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
10 * Alternatively, this software may be distributed under the terms of BSD
13 * See README and COPYING for more details.
19 #ifdef CONFIG_IEEE80211N
20 #include "ieee802_11_defs.h"
21 #endif /* CONFIG_IEEE80211N */
24 #define WLAN_STA_AUTH BIT(0)
25 #define WLAN_STA_ASSOC BIT(1)
26 #define WLAN_STA_PS BIT(2)
27 #define WLAN_STA_TIM BIT(3)
28 #define WLAN_STA_PERM BIT(4)
29 #define WLAN_STA_AUTHORIZED BIT(5)
30 #define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */
31 #define WLAN_STA_SHORT_PREAMBLE BIT(7)
32 #define WLAN_STA_PREAUTH BIT(8)
33 #define WLAN_STA_WME BIT(9)
34 #define WLAN_STA_MFP BIT(10)
35 #define WLAN_STA_HT BIT(11)
36 #define WLAN_STA_NONERP BIT(31)
38 /* Maximum number of supported rates (from both Supported Rates and Extended
39 * Supported Rates IEs). */
40 #define WLAN_SUPP_RATES_MAX 32
44 struct sta_info *next; /* next entry in sta list */
45 struct sta_info *hnext; /* next entry in hash table list */
47 u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
50 u16 listen_interval; /* or beacon_int for APs */
51 u8 supported_rates[WLAN_SUPP_RATES_MAX];
52 int supported_rates_len;
54 unsigned int nonerp_set:1;
55 unsigned int no_short_slot_time_set:1;
56 unsigned int no_short_preamble_set:1;
62 STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE
65 /* IEEE 802.1X related data */
66 struct eapol_state_machine *eapol_sm;
68 /* IEEE 802.11f (IAPP) related data */
69 struct ieee80211_mgmt *last_assoc_req;
71 u32 acct_session_id_hi;
72 u32 acct_session_id_lo;
73 time_t acct_session_start;
74 int acct_session_started;
75 int acct_terminate_cause; /* Acct-Terminate-Cause */
76 int acct_interim_interval; /* Acct-Interim-Interval */
78 unsigned long last_rx_bytes;
79 unsigned long last_tx_bytes;
80 u32 acct_input_gigawords; /* Acct-Input-Gigawords */
81 u32 acct_output_gigawords; /* Acct-Output-Gigawords */
83 u8 *challenge; /* IEEE 802.11 Shared Key Authentication Challenge */
85 struct wpa_state_machine *wpa_sm;
86 struct rsn_preauth_interface *preauth_iface;
88 struct hostapd_ssid *ssid; /* SSID selection based on (Re)AssocReq */
89 struct hostapd_ssid *ssid_probe; /* SSID selection based on ProbeReq */
93 #ifdef CONFIG_IEEE80211N
94 struct ht_cap_ie ht_capabilities; /* IEEE 802.11n capabilities */
95 #endif /* CONFIG_IEEE80211N */
97 #ifdef CONFIG_IEEE80211W
98 int ping_count; /* number of pending ping requests;
99 * 0 = no ping in progress */
101 u8 *ping_trans_id; /* buffer of WLAN_PING_TRANS_ID_LEN * ping_count
102 * octets of pending ping transaction identifiers */
103 #endif /* CONFIG_IEEE80211W */
107 /* Maximum number of AIDs to use for STAs; must be 2007 or lower
108 * (8802.11 limitation) */
109 #define MAX_AID_TABLE_SIZE 128
111 #define STA_HASH_SIZE 256
112 #define STA_HASH(sta) (sta[5])
115 /* Default value for maximum station inactivity. After AP_MAX_INACTIVITY has
116 * passed since last received frame from the station, a nullfunc data frame is
117 * sent to the station. If this frame is not acknowledged and no other frames
118 * have been received, the station will be disassociated after
119 * AP_DISASSOC_DELAY seconds. Similarily, the station will be deauthenticated
120 * after AP_DEAUTH_DELAY seconds has passed after disassociation. */
121 #define AP_MAX_INACTIVITY (5 * 60)
122 #define AP_DISASSOC_DELAY (1)
123 #define AP_DEAUTH_DELAY (1)
124 /* Number of seconds to keep STA entry with Authenticated flag after it has
125 * been disassociated. */
126 #define AP_MAX_INACTIVITY_AFTER_DISASSOC (1 * 30)
127 /* Number of seconds to keep STA entry after it has been deauthenticated. */
128 #define AP_MAX_INACTIVITY_AFTER_DEAUTH (1 * 5)