1e5b75505Sopenharmony_ci/*
2e5b75505Sopenharmony_ci * hostapd / Station table
3e5b75505Sopenharmony_ci * Copyright (c) 2002-2017, Jouni Malinen <j@w1.fi>
4e5b75505Sopenharmony_ci *
5e5b75505Sopenharmony_ci * This software may be distributed under the terms of the BSD license.
6e5b75505Sopenharmony_ci * See README for more details.
7e5b75505Sopenharmony_ci */
8e5b75505Sopenharmony_ci
9e5b75505Sopenharmony_ci#ifndef STA_INFO_H
10e5b75505Sopenharmony_ci#define STA_INFO_H
11e5b75505Sopenharmony_ci
12e5b75505Sopenharmony_ci#include "common/defs.h"
13e5b75505Sopenharmony_ci#include "list.h"
14e5b75505Sopenharmony_ci#include "vlan.h"
15e5b75505Sopenharmony_ci#include "common/wpa_common.h"
16e5b75505Sopenharmony_ci#include "common/ieee802_11_defs.h"
17e5b75505Sopenharmony_ci
18e5b75505Sopenharmony_ci/* STA flags */
19e5b75505Sopenharmony_ci#define WLAN_STA_AUTH BIT(0)
20e5b75505Sopenharmony_ci#define WLAN_STA_ASSOC BIT(1)
21e5b75505Sopenharmony_ci#define WLAN_STA_AUTHORIZED BIT(5)
22e5b75505Sopenharmony_ci#define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */
23e5b75505Sopenharmony_ci#define WLAN_STA_SHORT_PREAMBLE BIT(7)
24e5b75505Sopenharmony_ci#define WLAN_STA_PREAUTH BIT(8)
25e5b75505Sopenharmony_ci#define WLAN_STA_WMM BIT(9)
26e5b75505Sopenharmony_ci#define WLAN_STA_MFP BIT(10)
27e5b75505Sopenharmony_ci#define WLAN_STA_HT BIT(11)
28e5b75505Sopenharmony_ci#define WLAN_STA_WPS BIT(12)
29e5b75505Sopenharmony_ci#define WLAN_STA_MAYBE_WPS BIT(13)
30e5b75505Sopenharmony_ci#define WLAN_STA_WDS BIT(14)
31e5b75505Sopenharmony_ci#define WLAN_STA_ASSOC_REQ_OK BIT(15)
32e5b75505Sopenharmony_ci#define WLAN_STA_WPS2 BIT(16)
33e5b75505Sopenharmony_ci#define WLAN_STA_GAS BIT(17)
34e5b75505Sopenharmony_ci#define WLAN_STA_VHT BIT(18)
35e5b75505Sopenharmony_ci#define WLAN_STA_WNM_SLEEP_MODE BIT(19)
36e5b75505Sopenharmony_ci#define WLAN_STA_VHT_OPMODE_ENABLED BIT(20)
37e5b75505Sopenharmony_ci#define WLAN_STA_VENDOR_VHT BIT(21)
38e5b75505Sopenharmony_ci#define WLAN_STA_PENDING_FILS_ERP BIT(22)
39e5b75505Sopenharmony_ci#define WLAN_STA_MULTI_AP BIT(23)
40e5b75505Sopenharmony_ci#define WLAN_STA_HE BIT(24)
41e5b75505Sopenharmony_ci#define WLAN_STA_PENDING_DISASSOC_CB BIT(29)
42e5b75505Sopenharmony_ci#define WLAN_STA_PENDING_DEAUTH_CB BIT(30)
43e5b75505Sopenharmony_ci#define WLAN_STA_NONERP BIT(31)
44e5b75505Sopenharmony_ci
45e5b75505Sopenharmony_ci/* Maximum number of supported rates (from both Supported Rates and Extended
46e5b75505Sopenharmony_ci * Supported Rates IEs). */
47e5b75505Sopenharmony_ci#define WLAN_SUPP_RATES_MAX 32
48e5b75505Sopenharmony_ci
49e5b75505Sopenharmony_cistruct hostapd_data;
50e5b75505Sopenharmony_ci
51e5b75505Sopenharmony_cistruct mbo_non_pref_chan_info {
52e5b75505Sopenharmony_ci	struct mbo_non_pref_chan_info *next;
53e5b75505Sopenharmony_ci	u8 op_class;
54e5b75505Sopenharmony_ci	u8 pref;
55e5b75505Sopenharmony_ci	u8 reason_code;
56e5b75505Sopenharmony_ci	u8 num_channels;
57e5b75505Sopenharmony_ci	u8 channels[];
58e5b75505Sopenharmony_ci};
59e5b75505Sopenharmony_ci
60e5b75505Sopenharmony_cistruct pending_eapol_rx {
61e5b75505Sopenharmony_ci	struct wpabuf *buf;
62e5b75505Sopenharmony_ci	struct os_reltime rx_time;
63e5b75505Sopenharmony_ci};
64e5b75505Sopenharmony_ci
65e5b75505Sopenharmony_cistruct sta_info {
66e5b75505Sopenharmony_ci	struct sta_info *next; /* next entry in sta list */
67e5b75505Sopenharmony_ci	struct sta_info *hnext; /* next entry in hash table list */
68e5b75505Sopenharmony_ci	u8 addr[6];
69e5b75505Sopenharmony_ci	be32 ipaddr;
70e5b75505Sopenharmony_ci	struct dl_list ip6addr; /* list head for struct ip6addr */
71e5b75505Sopenharmony_ci	u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
72e5b75505Sopenharmony_ci	u16 disconnect_reason_code; /* RADIUS server override */
73e5b75505Sopenharmony_ci	u32 flags; /* Bitfield of WLAN_STA_* */
74e5b75505Sopenharmony_ci	u16 capability;
75e5b75505Sopenharmony_ci	u16 listen_interval; /* or beacon_int for APs */
76e5b75505Sopenharmony_ci	u8 supported_rates[WLAN_SUPP_RATES_MAX];
77e5b75505Sopenharmony_ci	int supported_rates_len;
78e5b75505Sopenharmony_ci	u8 qosinfo; /* Valid when WLAN_STA_WMM is set */
79e5b75505Sopenharmony_ci
80e5b75505Sopenharmony_ci#ifdef CONFIG_MESH
81e5b75505Sopenharmony_ci	enum mesh_plink_state plink_state;
82e5b75505Sopenharmony_ci	u16 peer_lid;
83e5b75505Sopenharmony_ci	u16 my_lid;
84e5b75505Sopenharmony_ci	u16 peer_aid;
85e5b75505Sopenharmony_ci	u16 mpm_close_reason;
86e5b75505Sopenharmony_ci	int mpm_retries;
87e5b75505Sopenharmony_ci	u8 my_nonce[WPA_NONCE_LEN];
88e5b75505Sopenharmony_ci	u8 peer_nonce[WPA_NONCE_LEN];
89e5b75505Sopenharmony_ci	u8 aek[32];	/* SHA256 digest length */
90e5b75505Sopenharmony_ci	u8 mtk[WPA_TK_MAX_LEN];
91e5b75505Sopenharmony_ci	size_t mtk_len;
92e5b75505Sopenharmony_ci	u8 mgtk_rsc[6];
93e5b75505Sopenharmony_ci	u8 mgtk_key_id;
94e5b75505Sopenharmony_ci	u8 mgtk[WPA_TK_MAX_LEN];
95e5b75505Sopenharmony_ci	size_t mgtk_len;
96e5b75505Sopenharmony_ci	u8 igtk_rsc[6];
97e5b75505Sopenharmony_ci	u8 igtk[WPA_TK_MAX_LEN];
98e5b75505Sopenharmony_ci	size_t igtk_len;
99e5b75505Sopenharmony_ci	u16 igtk_key_id;
100e5b75505Sopenharmony_ci	u8 sae_auth_retry;
101e5b75505Sopenharmony_ci#endif /* CONFIG_MESH */
102e5b75505Sopenharmony_ci
103e5b75505Sopenharmony_ci	unsigned int nonerp_set:1;
104e5b75505Sopenharmony_ci	unsigned int no_short_slot_time_set:1;
105e5b75505Sopenharmony_ci	unsigned int no_short_preamble_set:1;
106e5b75505Sopenharmony_ci	unsigned int no_ht_gf_set:1;
107e5b75505Sopenharmony_ci	unsigned int no_ht_set:1;
108e5b75505Sopenharmony_ci	unsigned int ht40_intolerant_set:1;
109e5b75505Sopenharmony_ci	unsigned int ht_20mhz_set:1;
110e5b75505Sopenharmony_ci	unsigned int no_p2p_set:1;
111e5b75505Sopenharmony_ci	unsigned int qos_map_enabled:1;
112e5b75505Sopenharmony_ci	unsigned int remediation:1;
113e5b75505Sopenharmony_ci	unsigned int hs20_deauth_requested:1;
114e5b75505Sopenharmony_ci	unsigned int session_timeout_set:1;
115e5b75505Sopenharmony_ci	unsigned int radius_das_match:1;
116e5b75505Sopenharmony_ci	unsigned int ecsa_supported:1;
117e5b75505Sopenharmony_ci	unsigned int added_unassoc:1;
118e5b75505Sopenharmony_ci	unsigned int pending_wds_enable:1;
119e5b75505Sopenharmony_ci	unsigned int power_capab:1;
120e5b75505Sopenharmony_ci	unsigned int agreed_to_steer:1;
121e5b75505Sopenharmony_ci	unsigned int hs20_t_c_filtering:1;
122e5b75505Sopenharmony_ci	unsigned int ft_over_ds:1;
123e5b75505Sopenharmony_ci	unsigned int external_dh_updated:1;
124e5b75505Sopenharmony_ci
125e5b75505Sopenharmony_ci	u16 auth_alg;
126e5b75505Sopenharmony_ci
127e5b75505Sopenharmony_ci	enum {
128e5b75505Sopenharmony_ci		STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE,
129e5b75505Sopenharmony_ci		STA_DISASSOC_FROM_CLI
130e5b75505Sopenharmony_ci	} timeout_next;
131e5b75505Sopenharmony_ci
132e5b75505Sopenharmony_ci	u16 deauth_reason;
133e5b75505Sopenharmony_ci	u16 disassoc_reason;
134e5b75505Sopenharmony_ci
135e5b75505Sopenharmony_ci	/* IEEE 802.1X related data */
136e5b75505Sopenharmony_ci	struct eapol_state_machine *eapol_sm;
137e5b75505Sopenharmony_ci
138e5b75505Sopenharmony_ci	struct pending_eapol_rx *pending_eapol_rx;
139e5b75505Sopenharmony_ci
140e5b75505Sopenharmony_ci	u64 acct_session_id;
141e5b75505Sopenharmony_ci	struct os_reltime acct_session_start;
142e5b75505Sopenharmony_ci	int acct_session_started;
143e5b75505Sopenharmony_ci	int acct_terminate_cause; /* Acct-Terminate-Cause */
144e5b75505Sopenharmony_ci	int acct_interim_interval; /* Acct-Interim-Interval */
145e5b75505Sopenharmony_ci	unsigned int acct_interim_errors;
146e5b75505Sopenharmony_ci
147e5b75505Sopenharmony_ci	/* For extending 32-bit driver counters to 64-bit counters */
148e5b75505Sopenharmony_ci	u32 last_rx_bytes_hi;
149e5b75505Sopenharmony_ci	u32 last_rx_bytes_lo;
150e5b75505Sopenharmony_ci	u32 last_tx_bytes_hi;
151e5b75505Sopenharmony_ci	u32 last_tx_bytes_lo;
152e5b75505Sopenharmony_ci
153e5b75505Sopenharmony_ci	u8 *challenge; /* IEEE 802.11 Shared Key Authentication Challenge */
154e5b75505Sopenharmony_ci
155e5b75505Sopenharmony_ci	struct wpa_state_machine *wpa_sm;
156e5b75505Sopenharmony_ci	struct rsn_preauth_interface *preauth_iface;
157e5b75505Sopenharmony_ci
158e5b75505Sopenharmony_ci	int vlan_id; /* 0: none, >0: VID */
159e5b75505Sopenharmony_ci	struct vlan_description *vlan_desc;
160e5b75505Sopenharmony_ci	int vlan_id_bound; /* updated by ap_sta_bind_vlan() */
161e5b75505Sopenharmony_ci	 /* PSKs from RADIUS authentication server */
162e5b75505Sopenharmony_ci	struct hostapd_sta_wpa_psk_short *psk;
163e5b75505Sopenharmony_ci
164e5b75505Sopenharmony_ci	char *identity; /* User-Name from RADIUS */
165e5b75505Sopenharmony_ci	char *radius_cui; /* Chargeable-User-Identity from RADIUS */
166e5b75505Sopenharmony_ci
167e5b75505Sopenharmony_ci	struct ieee80211_ht_capabilities *ht_capabilities;
168e5b75505Sopenharmony_ci	struct ieee80211_vht_capabilities *vht_capabilities;
169e5b75505Sopenharmony_ci	struct ieee80211_vht_operation *vht_operation;
170e5b75505Sopenharmony_ci	u8 vht_opmode;
171e5b75505Sopenharmony_ci	struct ieee80211_he_capabilities *he_capab;
172e5b75505Sopenharmony_ci	size_t he_capab_len;
173e5b75505Sopenharmony_ci
174e5b75505Sopenharmony_ci#ifdef CONFIG_IEEE80211W
175e5b75505Sopenharmony_ci	int sa_query_count; /* number of pending SA Query requests;
176e5b75505Sopenharmony_ci			     * 0 = no SA Query in progress */
177e5b75505Sopenharmony_ci	int sa_query_timed_out;
178e5b75505Sopenharmony_ci	u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
179e5b75505Sopenharmony_ci				* sa_query_count octets of pending SA Query
180e5b75505Sopenharmony_ci				* transaction identifiers */
181e5b75505Sopenharmony_ci	struct os_reltime sa_query_start;
182e5b75505Sopenharmony_ci#endif /* CONFIG_IEEE80211W */
183e5b75505Sopenharmony_ci
184e5b75505Sopenharmony_ci#if defined(CONFIG_INTERWORKING) || defined(CONFIG_DPP)
185e5b75505Sopenharmony_ci#define GAS_DIALOG_MAX 8 /* Max concurrent dialog number */
186e5b75505Sopenharmony_ci	struct gas_dialog_info *gas_dialog;
187e5b75505Sopenharmony_ci	u8 gas_dialog_next;
188e5b75505Sopenharmony_ci#endif /* CONFIG_INTERWORKING || CONFIG_DPP */
189e5b75505Sopenharmony_ci
190e5b75505Sopenharmony_ci	struct wpabuf *wps_ie; /* WPS IE from (Re)Association Request */
191e5b75505Sopenharmony_ci	struct wpabuf *p2p_ie; /* P2P IE from (Re)Association Request */
192e5b75505Sopenharmony_ci	struct wpabuf *hs20_ie; /* HS 2.0 IE from (Re)Association Request */
193e5b75505Sopenharmony_ci	/* Hotspot 2.0 Roaming Consortium from (Re)Association Request */
194e5b75505Sopenharmony_ci	struct wpabuf *roaming_consortium;
195e5b75505Sopenharmony_ci	u8 remediation_method;
196e5b75505Sopenharmony_ci	char *remediation_url; /* HS 2.0 Subscription Remediation Server URL */
197e5b75505Sopenharmony_ci	char *t_c_url; /* HS 2.0 Terms and Conditions Server URL */
198e5b75505Sopenharmony_ci	struct wpabuf *hs20_deauth_req;
199e5b75505Sopenharmony_ci	char *hs20_session_info_url;
200e5b75505Sopenharmony_ci	int hs20_disassoc_timer;
201e5b75505Sopenharmony_ci#ifdef CONFIG_FST
202e5b75505Sopenharmony_ci	struct wpabuf *mb_ies; /* MB IEs from (Re)Association Request */
203e5b75505Sopenharmony_ci#endif /* CONFIG_FST */
204e5b75505Sopenharmony_ci
205e5b75505Sopenharmony_ci	struct os_reltime connected_time;
206e5b75505Sopenharmony_ci
207e5b75505Sopenharmony_ci#ifdef CONFIG_SAE
208e5b75505Sopenharmony_ci	struct sae_data *sae;
209e5b75505Sopenharmony_ci	unsigned int mesh_sae_pmksa_caching:1;
210e5b75505Sopenharmony_ci#endif /* CONFIG_SAE */
211e5b75505Sopenharmony_ci
212e5b75505Sopenharmony_ci	/* valid only if session_timeout_set == 1 */
213e5b75505Sopenharmony_ci	struct os_reltime session_timeout;
214e5b75505Sopenharmony_ci
215e5b75505Sopenharmony_ci	/* Last Authentication/(Re)Association Request/Action frame sequence
216e5b75505Sopenharmony_ci	 * control */
217e5b75505Sopenharmony_ci	u16 last_seq_ctrl;
218e5b75505Sopenharmony_ci	/* Last Authentication/(Re)Association Request/Action frame subtype */
219e5b75505Sopenharmony_ci	u8 last_subtype;
220e5b75505Sopenharmony_ci
221e5b75505Sopenharmony_ci#ifdef CONFIG_MBO
222e5b75505Sopenharmony_ci	u8 cell_capa; /* 0 = unknown (not an MBO STA); otherwise,
223e5b75505Sopenharmony_ci		       * enum mbo_cellular_capa values */
224e5b75505Sopenharmony_ci	struct mbo_non_pref_chan_info *non_pref_chan;
225e5b75505Sopenharmony_ci	int auth_rssi; /* Last Authentication frame RSSI */
226e5b75505Sopenharmony_ci#endif /* CONFIG_MBO */
227e5b75505Sopenharmony_ci
228e5b75505Sopenharmony_ci	u8 *supp_op_classes; /* Supported Operating Classes element, if
229e5b75505Sopenharmony_ci			      * received, starting from the Length field */
230e5b75505Sopenharmony_ci
231e5b75505Sopenharmony_ci	u8 rrm_enabled_capa[5];
232e5b75505Sopenharmony_ci
233e5b75505Sopenharmony_ci	s8 min_tx_power;
234e5b75505Sopenharmony_ci	s8 max_tx_power;
235e5b75505Sopenharmony_ci
236e5b75505Sopenharmony_ci#ifdef CONFIG_TAXONOMY
237e5b75505Sopenharmony_ci	struct wpabuf *probe_ie_taxonomy;
238e5b75505Sopenharmony_ci	struct wpabuf *assoc_ie_taxonomy;
239e5b75505Sopenharmony_ci#endif /* CONFIG_TAXONOMY */
240e5b75505Sopenharmony_ci
241e5b75505Sopenharmony_ci#ifdef CONFIG_FILS
242e5b75505Sopenharmony_ci	u8 fils_snonce[FILS_NONCE_LEN];
243e5b75505Sopenharmony_ci	u8 fils_session[FILS_SESSION_LEN];
244e5b75505Sopenharmony_ci	u8 fils_erp_pmkid[PMKID_LEN];
245e5b75505Sopenharmony_ci	u8 *fils_pending_assoc_req;
246e5b75505Sopenharmony_ci	size_t fils_pending_assoc_req_len;
247e5b75505Sopenharmony_ci	unsigned int fils_pending_assoc_is_reassoc:1;
248e5b75505Sopenharmony_ci	unsigned int fils_dhcp_rapid_commit_proxy:1;
249e5b75505Sopenharmony_ci	unsigned int fils_erp_pmkid_set:1;
250e5b75505Sopenharmony_ci	unsigned int fils_drv_assoc_finish:1;
251e5b75505Sopenharmony_ci	struct wpabuf *fils_hlp_resp;
252e5b75505Sopenharmony_ci	struct wpabuf *hlp_dhcp_discover;
253e5b75505Sopenharmony_ci	void (*fils_pending_cb)(struct hostapd_data *hapd, struct sta_info *sta,
254e5b75505Sopenharmony_ci				u16 resp, struct wpabuf *data, int pub);
255e5b75505Sopenharmony_ci#ifdef CONFIG_FILS_SK_PFS
256e5b75505Sopenharmony_ci	struct crypto_ecdh *fils_ecdh;
257e5b75505Sopenharmony_ci#endif /* CONFIG_FILS_SK_PFS */
258e5b75505Sopenharmony_ci	struct wpabuf *fils_dh_ss;
259e5b75505Sopenharmony_ci	struct wpabuf *fils_g_sta;
260e5b75505Sopenharmony_ci#endif /* CONFIG_FILS */
261e5b75505Sopenharmony_ci
262e5b75505Sopenharmony_ci#ifdef CONFIG_OWE
263e5b75505Sopenharmony_ci	u8 *owe_pmk;
264e5b75505Sopenharmony_ci	size_t owe_pmk_len;
265e5b75505Sopenharmony_ci	struct crypto_ecdh *owe_ecdh;
266e5b75505Sopenharmony_ci	u16 owe_group;
267e5b75505Sopenharmony_ci#endif /* CONFIG_OWE */
268e5b75505Sopenharmony_ci
269e5b75505Sopenharmony_ci	u8 *ext_capability;
270e5b75505Sopenharmony_ci	char *ifname_wds; /* WDS ifname, if in use */
271e5b75505Sopenharmony_ci
272e5b75505Sopenharmony_ci#ifdef CONFIG_DPP2
273e5b75505Sopenharmony_ci	struct dpp_pfs *dpp_pfs;
274e5b75505Sopenharmony_ci#endif /* CONFIG_DPP2 */
275e5b75505Sopenharmony_ci
276e5b75505Sopenharmony_ci#ifdef CONFIG_TESTING_OPTIONS
277e5b75505Sopenharmony_ci	enum wpa_alg last_tk_alg;
278e5b75505Sopenharmony_ci	int last_tk_key_idx;
279e5b75505Sopenharmony_ci	u8 last_tk[WPA_TK_MAX_LEN];
280e5b75505Sopenharmony_ci	size_t last_tk_len;
281e5b75505Sopenharmony_ci#endif /* CONFIG_TESTING_OPTIONS */
282e5b75505Sopenharmony_ci#ifdef CONFIG_AIRTIME_POLICY
283e5b75505Sopenharmony_ci	unsigned int airtime_weight;
284e5b75505Sopenharmony_ci	struct os_reltime backlogged_until;
285e5b75505Sopenharmony_ci#endif /* CONFIG_AIRTIME_POLICY */
286e5b75505Sopenharmony_ci};
287e5b75505Sopenharmony_ci
288e5b75505Sopenharmony_ci
289e5b75505Sopenharmony_ci/* Default value for maximum station inactivity. After AP_MAX_INACTIVITY has
290e5b75505Sopenharmony_ci * passed since last received frame from the station, a nullfunc data frame is
291e5b75505Sopenharmony_ci * sent to the station. If this frame is not acknowledged and no other frames
292e5b75505Sopenharmony_ci * have been received, the station will be disassociated after
293e5b75505Sopenharmony_ci * AP_DISASSOC_DELAY seconds. Similarly, the station will be deauthenticated
294e5b75505Sopenharmony_ci * after AP_DEAUTH_DELAY seconds has passed after disassociation. */
295e5b75505Sopenharmony_ci#define AP_MAX_INACTIVITY (5 * 60)
296e5b75505Sopenharmony_ci#define AP_DISASSOC_DELAY (3)
297e5b75505Sopenharmony_ci#define AP_DEAUTH_DELAY (1)
298e5b75505Sopenharmony_ci/* Number of seconds to keep STA entry with Authenticated flag after it has
299e5b75505Sopenharmony_ci * been disassociated. */
300e5b75505Sopenharmony_ci#define AP_MAX_INACTIVITY_AFTER_DISASSOC (1 * 30)
301e5b75505Sopenharmony_ci/* Number of seconds to keep STA entry after it has been deauthenticated. */
302e5b75505Sopenharmony_ci#define AP_MAX_INACTIVITY_AFTER_DEAUTH (1 * 5)
303e5b75505Sopenharmony_ci
304e5b75505Sopenharmony_ci
305e5b75505Sopenharmony_ciint ap_for_each_sta(struct hostapd_data *hapd,
306e5b75505Sopenharmony_ci		    int (*cb)(struct hostapd_data *hapd, struct sta_info *sta,
307e5b75505Sopenharmony_ci			      void *ctx),
308e5b75505Sopenharmony_ci		    void *ctx);
309e5b75505Sopenharmony_cistruct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta);
310e5b75505Sopenharmony_cistruct sta_info * ap_get_sta_p2p(struct hostapd_data *hapd, const u8 *addr);
311e5b75505Sopenharmony_civoid ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta);
312e5b75505Sopenharmony_civoid ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta);
313e5b75505Sopenharmony_civoid ap_sta_ip6addr_del(struct hostapd_data *hapd, struct sta_info *sta);
314e5b75505Sopenharmony_civoid hostapd_free_stas(struct hostapd_data *hapd);
315e5b75505Sopenharmony_civoid ap_handle_timer(void *eloop_ctx, void *timeout_ctx);
316e5b75505Sopenharmony_civoid ap_sta_replenish_timeout(struct hostapd_data *hapd, struct sta_info *sta,
317e5b75505Sopenharmony_ci			      u32 session_timeout);
318e5b75505Sopenharmony_civoid ap_sta_session_timeout(struct hostapd_data *hapd, struct sta_info *sta,
319e5b75505Sopenharmony_ci			    u32 session_timeout);
320e5b75505Sopenharmony_civoid ap_sta_no_session_timeout(struct hostapd_data *hapd,
321e5b75505Sopenharmony_ci			       struct sta_info *sta);
322e5b75505Sopenharmony_civoid ap_sta_session_warning_timeout(struct hostapd_data *hapd,
323e5b75505Sopenharmony_ci				    struct sta_info *sta, int warning_time);
324e5b75505Sopenharmony_cistruct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr);
325e5b75505Sopenharmony_civoid ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta,
326e5b75505Sopenharmony_ci			 u16 reason);
327e5b75505Sopenharmony_civoid ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta,
328e5b75505Sopenharmony_ci			   u16 reason);
329e5b75505Sopenharmony_ci#ifdef CONFIG_WPS
330e5b75505Sopenharmony_ciint ap_sta_wps_cancel(struct hostapd_data *hapd,
331e5b75505Sopenharmony_ci		      struct sta_info *sta, void *ctx);
332e5b75505Sopenharmony_ci#endif /* CONFIG_WPS */
333e5b75505Sopenharmony_ciint ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta);
334e5b75505Sopenharmony_ciint ap_sta_set_vlan(struct hostapd_data *hapd, struct sta_info *sta,
335e5b75505Sopenharmony_ci		    struct vlan_description *vlan_desc);
336e5b75505Sopenharmony_civoid ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
337e5b75505Sopenharmony_civoid ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
338e5b75505Sopenharmony_ciint ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta);
339e5b75505Sopenharmony_ciconst char * ap_sta_wpa_get_keyid(struct hostapd_data *hapd,
340e5b75505Sopenharmony_ci				  struct sta_info *sta);
341e5b75505Sopenharmony_civoid ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
342e5b75505Sopenharmony_ci		       const u8 *addr, u16 reason);
343e5b75505Sopenharmony_ci
344e5b75505Sopenharmony_civoid ap_sta_set_authorized(struct hostapd_data *hapd,
345e5b75505Sopenharmony_ci			   struct sta_info *sta, int authorized);
346e5b75505Sopenharmony_cistatic inline int ap_sta_is_authorized(struct sta_info *sta)
347e5b75505Sopenharmony_ci{
348e5b75505Sopenharmony_ci	return sta->flags & WLAN_STA_AUTHORIZED;
349e5b75505Sopenharmony_ci}
350e5b75505Sopenharmony_ci
351e5b75505Sopenharmony_civoid ap_sta_deauth_cb(struct hostapd_data *hapd, struct sta_info *sta);
352e5b75505Sopenharmony_civoid ap_sta_disassoc_cb(struct hostapd_data *hapd, struct sta_info *sta);
353e5b75505Sopenharmony_civoid ap_sta_clear_disconnect_timeouts(struct hostapd_data *hapd,
354e5b75505Sopenharmony_ci				      struct sta_info *sta);
355e5b75505Sopenharmony_ci
356e5b75505Sopenharmony_ciint ap_sta_flags_txt(u32 flags, char *buf, size_t buflen);
357e5b75505Sopenharmony_civoid ap_sta_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd,
358e5b75505Sopenharmony_ci					    struct sta_info *sta);
359e5b75505Sopenharmony_ciint ap_sta_pending_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd,
360e5b75505Sopenharmony_ci						   struct sta_info *sta);
361e5b75505Sopenharmony_ci
362e5b75505Sopenharmony_ci#endif /* STA_INFO_H */
363