13ff40c12SJohn Marino /*
23ff40c12SJohn Marino  * hostapd / Station table
3*a1157835SDaniel Fojt  * Copyright (c) 2002-2017, Jouni Malinen <j@w1.fi>
43ff40c12SJohn Marino  *
53ff40c12SJohn Marino  * This software may be distributed under the terms of the BSD license.
63ff40c12SJohn Marino  * See README for more details.
73ff40c12SJohn Marino  */
83ff40c12SJohn Marino 
93ff40c12SJohn Marino #ifndef STA_INFO_H
103ff40c12SJohn Marino #define STA_INFO_H
113ff40c12SJohn Marino 
12*a1157835SDaniel Fojt #include "common/defs.h"
13*a1157835SDaniel Fojt #include "list.h"
14*a1157835SDaniel Fojt #include "vlan.h"
15*a1157835SDaniel Fojt #include "common/wpa_common.h"
16*a1157835SDaniel Fojt #include "common/ieee802_11_defs.h"
17*a1157835SDaniel Fojt 
183ff40c12SJohn Marino /* STA flags */
193ff40c12SJohn Marino #define WLAN_STA_AUTH BIT(0)
203ff40c12SJohn Marino #define WLAN_STA_ASSOC BIT(1)
213ff40c12SJohn Marino #define WLAN_STA_AUTHORIZED BIT(5)
223ff40c12SJohn Marino #define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */
233ff40c12SJohn Marino #define WLAN_STA_SHORT_PREAMBLE BIT(7)
243ff40c12SJohn Marino #define WLAN_STA_PREAUTH BIT(8)
253ff40c12SJohn Marino #define WLAN_STA_WMM BIT(9)
263ff40c12SJohn Marino #define WLAN_STA_MFP BIT(10)
273ff40c12SJohn Marino #define WLAN_STA_HT BIT(11)
283ff40c12SJohn Marino #define WLAN_STA_WPS BIT(12)
293ff40c12SJohn Marino #define WLAN_STA_MAYBE_WPS BIT(13)
303ff40c12SJohn Marino #define WLAN_STA_WDS BIT(14)
313ff40c12SJohn Marino #define WLAN_STA_ASSOC_REQ_OK BIT(15)
323ff40c12SJohn Marino #define WLAN_STA_WPS2 BIT(16)
333ff40c12SJohn Marino #define WLAN_STA_GAS BIT(17)
343ff40c12SJohn Marino #define WLAN_STA_VHT BIT(18)
353ff40c12SJohn Marino #define WLAN_STA_WNM_SLEEP_MODE BIT(19)
36*a1157835SDaniel Fojt #define WLAN_STA_VHT_OPMODE_ENABLED BIT(20)
37*a1157835SDaniel Fojt #define WLAN_STA_VENDOR_VHT BIT(21)
38*a1157835SDaniel Fojt #define WLAN_STA_PENDING_FILS_ERP BIT(22)
39*a1157835SDaniel Fojt #define WLAN_STA_MULTI_AP BIT(23)
40*a1157835SDaniel Fojt #define WLAN_STA_HE BIT(24)
413ff40c12SJohn Marino #define WLAN_STA_PENDING_DISASSOC_CB BIT(29)
423ff40c12SJohn Marino #define WLAN_STA_PENDING_DEAUTH_CB BIT(30)
433ff40c12SJohn Marino #define WLAN_STA_NONERP BIT(31)
443ff40c12SJohn Marino 
453ff40c12SJohn Marino /* Maximum number of supported rates (from both Supported Rates and Extended
463ff40c12SJohn Marino  * Supported Rates IEs). */
473ff40c12SJohn Marino #define WLAN_SUPP_RATES_MAX 32
483ff40c12SJohn Marino 
49*a1157835SDaniel Fojt struct hostapd_data;
50*a1157835SDaniel Fojt 
51*a1157835SDaniel Fojt struct mbo_non_pref_chan_info {
52*a1157835SDaniel Fojt 	struct mbo_non_pref_chan_info *next;
53*a1157835SDaniel Fojt 	u8 op_class;
54*a1157835SDaniel Fojt 	u8 pref;
55*a1157835SDaniel Fojt 	u8 reason_code;
56*a1157835SDaniel Fojt 	u8 num_channels;
57*a1157835SDaniel Fojt 	u8 channels[];
58*a1157835SDaniel Fojt };
59*a1157835SDaniel Fojt 
60*a1157835SDaniel Fojt struct pending_eapol_rx {
61*a1157835SDaniel Fojt 	struct wpabuf *buf;
62*a1157835SDaniel Fojt 	struct os_reltime rx_time;
63*a1157835SDaniel Fojt };
643ff40c12SJohn Marino 
653ff40c12SJohn Marino struct sta_info {
663ff40c12SJohn Marino 	struct sta_info *next; /* next entry in sta list */
673ff40c12SJohn Marino 	struct sta_info *hnext; /* next entry in hash table list */
683ff40c12SJohn Marino 	u8 addr[6];
69*a1157835SDaniel Fojt 	be32 ipaddr;
70*a1157835SDaniel Fojt 	struct dl_list ip6addr; /* list head for struct ip6addr */
713ff40c12SJohn Marino 	u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
72*a1157835SDaniel Fojt 	u16 disconnect_reason_code; /* RADIUS server override */
733ff40c12SJohn Marino 	u32 flags; /* Bitfield of WLAN_STA_* */
743ff40c12SJohn Marino 	u16 capability;
753ff40c12SJohn Marino 	u16 listen_interval; /* or beacon_int for APs */
763ff40c12SJohn Marino 	u8 supported_rates[WLAN_SUPP_RATES_MAX];
773ff40c12SJohn Marino 	int supported_rates_len;
783ff40c12SJohn Marino 	u8 qosinfo; /* Valid when WLAN_STA_WMM is set */
793ff40c12SJohn Marino 
80*a1157835SDaniel Fojt #ifdef CONFIG_MESH
81*a1157835SDaniel Fojt 	enum mesh_plink_state plink_state;
82*a1157835SDaniel Fojt 	u16 peer_lid;
83*a1157835SDaniel Fojt 	u16 my_lid;
84*a1157835SDaniel Fojt 	u16 peer_aid;
85*a1157835SDaniel Fojt 	u16 mpm_close_reason;
86*a1157835SDaniel Fojt 	int mpm_retries;
87*a1157835SDaniel Fojt 	u8 my_nonce[WPA_NONCE_LEN];
88*a1157835SDaniel Fojt 	u8 peer_nonce[WPA_NONCE_LEN];
89*a1157835SDaniel Fojt 	u8 aek[32];	/* SHA256 digest length */
90*a1157835SDaniel Fojt 	u8 mtk[WPA_TK_MAX_LEN];
91*a1157835SDaniel Fojt 	size_t mtk_len;
92*a1157835SDaniel Fojt 	u8 mgtk_rsc[6];
93*a1157835SDaniel Fojt 	u8 mgtk_key_id;
94*a1157835SDaniel Fojt 	u8 mgtk[WPA_TK_MAX_LEN];
95*a1157835SDaniel Fojt 	size_t mgtk_len;
96*a1157835SDaniel Fojt 	u8 igtk_rsc[6];
97*a1157835SDaniel Fojt 	u8 igtk[WPA_TK_MAX_LEN];
98*a1157835SDaniel Fojt 	size_t igtk_len;
99*a1157835SDaniel Fojt 	u16 igtk_key_id;
100*a1157835SDaniel Fojt 	u8 sae_auth_retry;
101*a1157835SDaniel Fojt #endif /* CONFIG_MESH */
102*a1157835SDaniel Fojt 
1033ff40c12SJohn Marino 	unsigned int nonerp_set:1;
1043ff40c12SJohn Marino 	unsigned int no_short_slot_time_set:1;
1053ff40c12SJohn Marino 	unsigned int no_short_preamble_set:1;
1063ff40c12SJohn Marino 	unsigned int no_ht_gf_set:1;
1073ff40c12SJohn Marino 	unsigned int no_ht_set:1;
108*a1157835SDaniel Fojt 	unsigned int ht40_intolerant_set:1;
1093ff40c12SJohn Marino 	unsigned int ht_20mhz_set:1;
1103ff40c12SJohn Marino 	unsigned int no_p2p_set:1;
1113ff40c12SJohn Marino 	unsigned int qos_map_enabled:1;
112*a1157835SDaniel Fojt 	unsigned int remediation:1;
113*a1157835SDaniel Fojt 	unsigned int hs20_deauth_requested:1;
114*a1157835SDaniel Fojt 	unsigned int session_timeout_set:1;
115*a1157835SDaniel Fojt 	unsigned int radius_das_match:1;
116*a1157835SDaniel Fojt 	unsigned int ecsa_supported:1;
117*a1157835SDaniel Fojt 	unsigned int added_unassoc:1;
118*a1157835SDaniel Fojt 	unsigned int pending_wds_enable:1;
119*a1157835SDaniel Fojt 	unsigned int power_capab:1;
120*a1157835SDaniel Fojt 	unsigned int agreed_to_steer:1;
121*a1157835SDaniel Fojt 	unsigned int hs20_t_c_filtering:1;
122*a1157835SDaniel Fojt 	unsigned int ft_over_ds:1;
123*a1157835SDaniel Fojt 	unsigned int external_dh_updated:1;
1243ff40c12SJohn Marino 
1253ff40c12SJohn Marino 	u16 auth_alg;
1263ff40c12SJohn Marino 
1273ff40c12SJohn Marino 	enum {
1283ff40c12SJohn Marino 		STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE,
1293ff40c12SJohn Marino 		STA_DISASSOC_FROM_CLI
1303ff40c12SJohn Marino 	} timeout_next;
1313ff40c12SJohn Marino 
1323ff40c12SJohn Marino 	u16 deauth_reason;
1333ff40c12SJohn Marino 	u16 disassoc_reason;
1343ff40c12SJohn Marino 
1353ff40c12SJohn Marino 	/* IEEE 802.1X related data */
1363ff40c12SJohn Marino 	struct eapol_state_machine *eapol_sm;
1373ff40c12SJohn Marino 
138*a1157835SDaniel Fojt 	struct pending_eapol_rx *pending_eapol_rx;
1393ff40c12SJohn Marino 
140*a1157835SDaniel Fojt 	u64 acct_session_id;
1413ff40c12SJohn Marino 	struct os_reltime acct_session_start;
1423ff40c12SJohn Marino 	int acct_session_started;
1433ff40c12SJohn Marino 	int acct_terminate_cause; /* Acct-Terminate-Cause */
1443ff40c12SJohn Marino 	int acct_interim_interval; /* Acct-Interim-Interval */
145*a1157835SDaniel Fojt 	unsigned int acct_interim_errors;
1463ff40c12SJohn Marino 
147*a1157835SDaniel Fojt 	/* For extending 32-bit driver counters to 64-bit counters */
148*a1157835SDaniel Fojt 	u32 last_rx_bytes_hi;
149*a1157835SDaniel Fojt 	u32 last_rx_bytes_lo;
150*a1157835SDaniel Fojt 	u32 last_tx_bytes_hi;
151*a1157835SDaniel Fojt 	u32 last_tx_bytes_lo;
1523ff40c12SJohn Marino 
1533ff40c12SJohn Marino 	u8 *challenge; /* IEEE 802.11 Shared Key Authentication Challenge */
1543ff40c12SJohn Marino 
1553ff40c12SJohn Marino 	struct wpa_state_machine *wpa_sm;
1563ff40c12SJohn Marino 	struct rsn_preauth_interface *preauth_iface;
1573ff40c12SJohn Marino 
158*a1157835SDaniel Fojt 	int vlan_id; /* 0: none, >0: VID */
159*a1157835SDaniel Fojt 	struct vlan_description *vlan_desc;
160*a1157835SDaniel Fojt 	int vlan_id_bound; /* updated by ap_sta_bind_vlan() */
1613ff40c12SJohn Marino 	 /* PSKs from RADIUS authentication server */
1623ff40c12SJohn Marino 	struct hostapd_sta_wpa_psk_short *psk;
1633ff40c12SJohn Marino 
1643ff40c12SJohn Marino 	char *identity; /* User-Name from RADIUS */
1653ff40c12SJohn Marino 	char *radius_cui; /* Chargeable-User-Identity from RADIUS */
1663ff40c12SJohn Marino 
1673ff40c12SJohn Marino 	struct ieee80211_ht_capabilities *ht_capabilities;
1683ff40c12SJohn Marino 	struct ieee80211_vht_capabilities *vht_capabilities;
169*a1157835SDaniel Fojt 	struct ieee80211_vht_operation *vht_operation;
170*a1157835SDaniel Fojt 	u8 vht_opmode;
171*a1157835SDaniel Fojt 	struct ieee80211_he_capabilities *he_capab;
172*a1157835SDaniel Fojt 	size_t he_capab_len;
1733ff40c12SJohn Marino 
1743ff40c12SJohn Marino #ifdef CONFIG_IEEE80211W
1753ff40c12SJohn Marino 	int sa_query_count; /* number of pending SA Query requests;
1763ff40c12SJohn Marino 			     * 0 = no SA Query in progress */
1773ff40c12SJohn Marino 	int sa_query_timed_out;
1783ff40c12SJohn Marino 	u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
1793ff40c12SJohn Marino 				* sa_query_count octets of pending SA Query
1803ff40c12SJohn Marino 				* transaction identifiers */
1813ff40c12SJohn Marino 	struct os_reltime sa_query_start;
1823ff40c12SJohn Marino #endif /* CONFIG_IEEE80211W */
1833ff40c12SJohn Marino 
184*a1157835SDaniel Fojt #if defined(CONFIG_INTERWORKING) || defined(CONFIG_DPP)
1853ff40c12SJohn Marino #define GAS_DIALOG_MAX 8 /* Max concurrent dialog number */
1863ff40c12SJohn Marino 	struct gas_dialog_info *gas_dialog;
1873ff40c12SJohn Marino 	u8 gas_dialog_next;
188*a1157835SDaniel Fojt #endif /* CONFIG_INTERWORKING || CONFIG_DPP */
1893ff40c12SJohn Marino 
1903ff40c12SJohn Marino 	struct wpabuf *wps_ie; /* WPS IE from (Re)Association Request */
1913ff40c12SJohn Marino 	struct wpabuf *p2p_ie; /* P2P IE from (Re)Association Request */
1923ff40c12SJohn Marino 	struct wpabuf *hs20_ie; /* HS 2.0 IE from (Re)Association Request */
193*a1157835SDaniel Fojt 	/* Hotspot 2.0 Roaming Consortium from (Re)Association Request */
194*a1157835SDaniel Fojt 	struct wpabuf *roaming_consortium;
195*a1157835SDaniel Fojt 	u8 remediation_method;
196*a1157835SDaniel Fojt 	char *remediation_url; /* HS 2.0 Subscription Remediation Server URL */
197*a1157835SDaniel Fojt 	char *t_c_url; /* HS 2.0 Terms and Conditions Server URL */
198*a1157835SDaniel Fojt 	struct wpabuf *hs20_deauth_req;
199*a1157835SDaniel Fojt 	char *hs20_session_info_url;
200*a1157835SDaniel Fojt 	int hs20_disassoc_timer;
201*a1157835SDaniel Fojt #ifdef CONFIG_FST
202*a1157835SDaniel Fojt 	struct wpabuf *mb_ies; /* MB IEs from (Re)Association Request */
203*a1157835SDaniel Fojt #endif /* CONFIG_FST */
2043ff40c12SJohn Marino 
2053ff40c12SJohn Marino 	struct os_reltime connected_time;
2063ff40c12SJohn Marino 
2073ff40c12SJohn Marino #ifdef CONFIG_SAE
2083ff40c12SJohn Marino 	struct sae_data *sae;
209*a1157835SDaniel Fojt 	unsigned int mesh_sae_pmksa_caching:1;
2103ff40c12SJohn Marino #endif /* CONFIG_SAE */
211*a1157835SDaniel Fojt 
212*a1157835SDaniel Fojt 	/* valid only if session_timeout_set == 1 */
213*a1157835SDaniel Fojt 	struct os_reltime session_timeout;
214*a1157835SDaniel Fojt 
215*a1157835SDaniel Fojt 	/* Last Authentication/(Re)Association Request/Action frame sequence
216*a1157835SDaniel Fojt 	 * control */
217*a1157835SDaniel Fojt 	u16 last_seq_ctrl;
218*a1157835SDaniel Fojt 	/* Last Authentication/(Re)Association Request/Action frame subtype */
219*a1157835SDaniel Fojt 	u8 last_subtype;
220*a1157835SDaniel Fojt 
221*a1157835SDaniel Fojt #ifdef CONFIG_MBO
222*a1157835SDaniel Fojt 	u8 cell_capa; /* 0 = unknown (not an MBO STA); otherwise,
223*a1157835SDaniel Fojt 		       * enum mbo_cellular_capa values */
224*a1157835SDaniel Fojt 	struct mbo_non_pref_chan_info *non_pref_chan;
225*a1157835SDaniel Fojt 	int auth_rssi; /* Last Authentication frame RSSI */
226*a1157835SDaniel Fojt #endif /* CONFIG_MBO */
227*a1157835SDaniel Fojt 
228*a1157835SDaniel Fojt 	u8 *supp_op_classes; /* Supported Operating Classes element, if
229*a1157835SDaniel Fojt 			      * received, starting from the Length field */
230*a1157835SDaniel Fojt 
231*a1157835SDaniel Fojt 	u8 rrm_enabled_capa[5];
232*a1157835SDaniel Fojt 
233*a1157835SDaniel Fojt 	s8 min_tx_power;
234*a1157835SDaniel Fojt 	s8 max_tx_power;
235*a1157835SDaniel Fojt 
236*a1157835SDaniel Fojt #ifdef CONFIG_TAXONOMY
237*a1157835SDaniel Fojt 	struct wpabuf *probe_ie_taxonomy;
238*a1157835SDaniel Fojt 	struct wpabuf *assoc_ie_taxonomy;
239*a1157835SDaniel Fojt #endif /* CONFIG_TAXONOMY */
240*a1157835SDaniel Fojt 
241*a1157835SDaniel Fojt #ifdef CONFIG_FILS
242*a1157835SDaniel Fojt 	u8 fils_snonce[FILS_NONCE_LEN];
243*a1157835SDaniel Fojt 	u8 fils_session[FILS_SESSION_LEN];
244*a1157835SDaniel Fojt 	u8 fils_erp_pmkid[PMKID_LEN];
245*a1157835SDaniel Fojt 	u8 *fils_pending_assoc_req;
246*a1157835SDaniel Fojt 	size_t fils_pending_assoc_req_len;
247*a1157835SDaniel Fojt 	unsigned int fils_pending_assoc_is_reassoc:1;
248*a1157835SDaniel Fojt 	unsigned int fils_dhcp_rapid_commit_proxy:1;
249*a1157835SDaniel Fojt 	unsigned int fils_erp_pmkid_set:1;
250*a1157835SDaniel Fojt 	unsigned int fils_drv_assoc_finish:1;
251*a1157835SDaniel Fojt 	struct wpabuf *fils_hlp_resp;
252*a1157835SDaniel Fojt 	struct wpabuf *hlp_dhcp_discover;
253*a1157835SDaniel Fojt 	void (*fils_pending_cb)(struct hostapd_data *hapd, struct sta_info *sta,
254*a1157835SDaniel Fojt 				u16 resp, struct wpabuf *data, int pub);
255*a1157835SDaniel Fojt #ifdef CONFIG_FILS_SK_PFS
256*a1157835SDaniel Fojt 	struct crypto_ecdh *fils_ecdh;
257*a1157835SDaniel Fojt #endif /* CONFIG_FILS_SK_PFS */
258*a1157835SDaniel Fojt 	struct wpabuf *fils_dh_ss;
259*a1157835SDaniel Fojt 	struct wpabuf *fils_g_sta;
260*a1157835SDaniel Fojt #endif /* CONFIG_FILS */
261*a1157835SDaniel Fojt 
262*a1157835SDaniel Fojt #ifdef CONFIG_OWE
263*a1157835SDaniel Fojt 	u8 *owe_pmk;
264*a1157835SDaniel Fojt 	size_t owe_pmk_len;
265*a1157835SDaniel Fojt 	struct crypto_ecdh *owe_ecdh;
266*a1157835SDaniel Fojt 	u16 owe_group;
267*a1157835SDaniel Fojt #endif /* CONFIG_OWE */
268*a1157835SDaniel Fojt 
269*a1157835SDaniel Fojt 	u8 *ext_capability;
270*a1157835SDaniel Fojt 	char *ifname_wds; /* WDS ifname, if in use */
271*a1157835SDaniel Fojt 
272*a1157835SDaniel Fojt #ifdef CONFIG_DPP2
273*a1157835SDaniel Fojt 	struct dpp_pfs *dpp_pfs;
274*a1157835SDaniel Fojt #endif /* CONFIG_DPP2 */
275*a1157835SDaniel Fojt 
276*a1157835SDaniel Fojt #ifdef CONFIG_TESTING_OPTIONS
277*a1157835SDaniel Fojt 	enum wpa_alg last_tk_alg;
278*a1157835SDaniel Fojt 	int last_tk_key_idx;
279*a1157835SDaniel Fojt 	u8 last_tk[WPA_TK_MAX_LEN];
280*a1157835SDaniel Fojt 	size_t last_tk_len;
281*a1157835SDaniel Fojt #endif /* CONFIG_TESTING_OPTIONS */
282*a1157835SDaniel Fojt #ifdef CONFIG_AIRTIME_POLICY
283*a1157835SDaniel Fojt 	unsigned int airtime_weight;
284*a1157835SDaniel Fojt 	struct os_reltime backlogged_until;
285*a1157835SDaniel Fojt #endif /* CONFIG_AIRTIME_POLICY */
2863ff40c12SJohn Marino };
2873ff40c12SJohn Marino 
2883ff40c12SJohn Marino 
2893ff40c12SJohn Marino /* Default value for maximum station inactivity. After AP_MAX_INACTIVITY has
2903ff40c12SJohn Marino  * passed since last received frame from the station, a nullfunc data frame is
2913ff40c12SJohn Marino  * sent to the station. If this frame is not acknowledged and no other frames
2923ff40c12SJohn Marino  * have been received, the station will be disassociated after
2933ff40c12SJohn Marino  * AP_DISASSOC_DELAY seconds. Similarly, the station will be deauthenticated
2943ff40c12SJohn Marino  * after AP_DEAUTH_DELAY seconds has passed after disassociation. */
2953ff40c12SJohn Marino #define AP_MAX_INACTIVITY (5 * 60)
296*a1157835SDaniel Fojt #define AP_DISASSOC_DELAY (3)
2973ff40c12SJohn Marino #define AP_DEAUTH_DELAY (1)
2983ff40c12SJohn Marino /* Number of seconds to keep STA entry with Authenticated flag after it has
2993ff40c12SJohn Marino  * been disassociated. */
3003ff40c12SJohn Marino #define AP_MAX_INACTIVITY_AFTER_DISASSOC (1 * 30)
3013ff40c12SJohn Marino /* Number of seconds to keep STA entry after it has been deauthenticated. */
3023ff40c12SJohn Marino #define AP_MAX_INACTIVITY_AFTER_DEAUTH (1 * 5)
3033ff40c12SJohn Marino 
3043ff40c12SJohn Marino 
3053ff40c12SJohn Marino int ap_for_each_sta(struct hostapd_data *hapd,
3063ff40c12SJohn Marino 		    int (*cb)(struct hostapd_data *hapd, struct sta_info *sta,
3073ff40c12SJohn Marino 			      void *ctx),
3083ff40c12SJohn Marino 		    void *ctx);
3093ff40c12SJohn Marino struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta);
3103ff40c12SJohn Marino struct sta_info * ap_get_sta_p2p(struct hostapd_data *hapd, const u8 *addr);
3113ff40c12SJohn Marino void ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta);
3123ff40c12SJohn Marino void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta);
313*a1157835SDaniel Fojt void ap_sta_ip6addr_del(struct hostapd_data *hapd, struct sta_info *sta);
3143ff40c12SJohn Marino void hostapd_free_stas(struct hostapd_data *hapd);
3153ff40c12SJohn Marino void ap_handle_timer(void *eloop_ctx, void *timeout_ctx);
3163ff40c12SJohn Marino void ap_sta_replenish_timeout(struct hostapd_data *hapd, struct sta_info *sta,
3173ff40c12SJohn Marino 			      u32 session_timeout);
3183ff40c12SJohn Marino void ap_sta_session_timeout(struct hostapd_data *hapd, struct sta_info *sta,
3193ff40c12SJohn Marino 			    u32 session_timeout);
3203ff40c12SJohn Marino void ap_sta_no_session_timeout(struct hostapd_data *hapd,
3213ff40c12SJohn Marino 			       struct sta_info *sta);
322*a1157835SDaniel Fojt void ap_sta_session_warning_timeout(struct hostapd_data *hapd,
323*a1157835SDaniel Fojt 				    struct sta_info *sta, int warning_time);
3243ff40c12SJohn Marino struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr);
3253ff40c12SJohn Marino void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta,
3263ff40c12SJohn Marino 			 u16 reason);
3273ff40c12SJohn Marino void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta,
3283ff40c12SJohn Marino 			   u16 reason);
3293ff40c12SJohn Marino #ifdef CONFIG_WPS
3303ff40c12SJohn Marino int ap_sta_wps_cancel(struct hostapd_data *hapd,
3313ff40c12SJohn Marino 		      struct sta_info *sta, void *ctx);
3323ff40c12SJohn Marino #endif /* CONFIG_WPS */
333*a1157835SDaniel Fojt int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta);
334*a1157835SDaniel Fojt int ap_sta_set_vlan(struct hostapd_data *hapd, struct sta_info *sta,
335*a1157835SDaniel Fojt 		    struct vlan_description *vlan_desc);
3363ff40c12SJohn Marino void ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
3373ff40c12SJohn Marino void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
3383ff40c12SJohn Marino int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta);
339*a1157835SDaniel Fojt const char * ap_sta_wpa_get_keyid(struct hostapd_data *hapd,
340*a1157835SDaniel Fojt 				  struct sta_info *sta);
3413ff40c12SJohn Marino void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
3423ff40c12SJohn Marino 		       const u8 *addr, u16 reason);
3433ff40c12SJohn Marino 
3443ff40c12SJohn Marino void ap_sta_set_authorized(struct hostapd_data *hapd,
3453ff40c12SJohn Marino 			   struct sta_info *sta, int authorized);
ap_sta_is_authorized(struct sta_info * sta)3463ff40c12SJohn Marino static inline int ap_sta_is_authorized(struct sta_info *sta)
3473ff40c12SJohn Marino {
3483ff40c12SJohn Marino 	return sta->flags & WLAN_STA_AUTHORIZED;
3493ff40c12SJohn Marino }
3503ff40c12SJohn Marino 
3513ff40c12SJohn Marino void ap_sta_deauth_cb(struct hostapd_data *hapd, struct sta_info *sta);
3523ff40c12SJohn Marino void ap_sta_disassoc_cb(struct hostapd_data *hapd, struct sta_info *sta);
353*a1157835SDaniel Fojt void ap_sta_clear_disconnect_timeouts(struct hostapd_data *hapd,
354*a1157835SDaniel Fojt 				      struct sta_info *sta);
3553ff40c12SJohn Marino 
3563ff40c12SJohn Marino int ap_sta_flags_txt(u32 flags, char *buf, size_t buflen);
357*a1157835SDaniel Fojt void ap_sta_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd,
358*a1157835SDaniel Fojt 					    struct sta_info *sta);
359*a1157835SDaniel Fojt int ap_sta_pending_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd,
360*a1157835SDaniel Fojt 						   struct sta_info *sta);
3613ff40c12SJohn Marino 
3623ff40c12SJohn Marino #endif /* STA_INFO_H */
363