2008-02-28 02:34:43 +01:00
|
|
|
/*
|
|
|
|
* hostapd / Station table
|
2017-03-12 00:26:43 +01:00
|
|
|
* Copyright (c) 2002-2017, Jouni Malinen <j@w1.fi>
|
2008-02-28 02:34:43 +01:00
|
|
|
*
|
2012-02-11 15:46:35 +01:00
|
|
|
* This software may be distributed under the terms of the BSD license.
|
|
|
|
* See README for more details.
|
2008-02-28 02:34:43 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef STA_INFO_H
|
|
|
|
#define STA_INFO_H
|
|
|
|
|
2014-03-11 05:07:01 +01:00
|
|
|
#include "common/defs.h"
|
2014-11-01 07:33:41 +01:00
|
|
|
#include "list.h"
|
2016-01-21 14:51:56 +01:00
|
|
|
#include "vlan.h"
|
2017-07-05 16:52:23 +02:00
|
|
|
#include "common/wpa_common.h"
|
2015-09-04 23:04:21 +02:00
|
|
|
#include "common/ieee802_11_defs.h"
|
2014-11-01 07:33:41 +01:00
|
|
|
|
2009-12-13 10:41:46 +01:00
|
|
|
/* STA flags */
|
|
|
|
#define WLAN_STA_AUTH BIT(0)
|
|
|
|
#define WLAN_STA_ASSOC BIT(1)
|
|
|
|
#define WLAN_STA_AUTHORIZED BIT(5)
|
|
|
|
#define WLAN_STA_PENDING_POLL BIT(6) /* pending activity poll not ACKed */
|
|
|
|
#define WLAN_STA_SHORT_PREAMBLE BIT(7)
|
|
|
|
#define WLAN_STA_PREAUTH BIT(8)
|
|
|
|
#define WLAN_STA_WMM BIT(9)
|
|
|
|
#define WLAN_STA_MFP BIT(10)
|
|
|
|
#define WLAN_STA_HT BIT(11)
|
|
|
|
#define WLAN_STA_WPS BIT(12)
|
|
|
|
#define WLAN_STA_MAYBE_WPS BIT(13)
|
2009-12-24 10:46:22 +01:00
|
|
|
#define WLAN_STA_WDS BIT(14)
|
2011-04-15 18:26:28 +02:00
|
|
|
#define WLAN_STA_ASSOC_REQ_OK BIT(15)
|
2011-08-28 18:16:59 +02:00
|
|
|
#define WLAN_STA_WPS2 BIT(16)
|
2012-02-26 21:34:19 +01:00
|
|
|
#define WLAN_STA_GAS BIT(17)
|
2012-08-10 18:49:18 +02:00
|
|
|
#define WLAN_STA_VHT BIT(18)
|
2013-12-27 18:06:52 +01:00
|
|
|
#define WLAN_STA_WNM_SLEEP_MODE BIT(19)
|
2014-02-10 13:43:05 +01:00
|
|
|
#define WLAN_STA_VHT_OPMODE_ENABLED BIT(20)
|
2014-11-10 16:12:29 +01:00
|
|
|
#define WLAN_STA_VENDOR_VHT BIT(21)
|
2015-09-04 23:04:21 +02:00
|
|
|
#define WLAN_STA_PENDING_FILS_ERP BIT(22)
|
2018-12-05 11:23:51 +01:00
|
|
|
#define WLAN_STA_MULTI_AP BIT(23)
|
2019-05-20 09:55:05 +02:00
|
|
|
#define WLAN_STA_HE BIT(24)
|
2020-04-25 00:45:41 +02:00
|
|
|
#define WLAN_STA_6GHZ BIT(25)
|
2011-09-06 20:03:02 +02:00
|
|
|
#define WLAN_STA_PENDING_DISASSOC_CB BIT(29)
|
|
|
|
#define WLAN_STA_PENDING_DEAUTH_CB BIT(30)
|
2009-12-13 10:41:46 +01:00
|
|
|
#define WLAN_STA_NONERP BIT(31)
|
|
|
|
|
2009-03-25 15:13:35 +01:00
|
|
|
/* Maximum number of supported rates (from both Supported Rates and Extended
|
|
|
|
* Supported Rates IEs). */
|
|
|
|
#define WLAN_SUPP_RATES_MAX 32
|
|
|
|
|
2017-04-21 17:42:00 +02:00
|
|
|
struct hostapd_data;
|
2009-03-25 15:13:35 +01:00
|
|
|
|
2016-02-22 19:37:21 +01:00
|
|
|
struct mbo_non_pref_chan_info {
|
|
|
|
struct mbo_non_pref_chan_info *next;
|
|
|
|
u8 op_class;
|
|
|
|
u8 pref;
|
|
|
|
u8 reason_code;
|
|
|
|
u8 num_channels;
|
|
|
|
u8 channels[];
|
|
|
|
};
|
|
|
|
|
2016-03-06 10:29:16 +01:00
|
|
|
struct pending_eapol_rx {
|
|
|
|
struct wpabuf *buf;
|
|
|
|
struct os_reltime rx_time;
|
|
|
|
};
|
|
|
|
|
2009-03-25 15:13:35 +01:00
|
|
|
struct sta_info {
|
|
|
|
struct sta_info *next; /* next entry in sta list */
|
|
|
|
struct sta_info *hnext; /* next entry in hash table list */
|
|
|
|
u8 addr[6];
|
AP: Add support for Proxy ARP, DHCP snooping mechanism
Proxy ARP allows the AP devices to keep track of the hardware address to
IP address mapping of the STA devices within the BSS. When a request for
such information is made (i.e., ARP request, Neighbor Solicitation), the
AP will respond on behalf of the STA device within the BSS. Such
requests could originate from a device within the BSS or also from the
bridge. In the process of the AP replying to the request (i.e., ARP
reply, Neighbor Advertisement), the AP will drop the original request
frame. The relevant STA will not even know that such information was
ever requested.
This feature is a requirement for Hotspot 2.0, and is defined in IEEE
Std 802.11-2012, 10.23.13. While the Proxy ARP support code mainly
resides in the kernel bridge code, in order to optimize the performance
and simplify kernel implementation, the DHCP snooping code was added to
the hostapd.
Signed-off-by: Kyeyoon Park <kyeyoonp@qca.qualcomm.com>
2014-09-26 07:32:55 +02:00
|
|
|
be32 ipaddr;
|
2014-11-01 07:33:41 +01:00
|
|
|
struct dl_list ip6addr; /* list head for struct ip6addr */
|
2009-03-25 15:13:35 +01:00
|
|
|
u16 aid; /* STA's unique AID (1 .. 2007) or 0 if not yet assigned */
|
2018-01-12 19:55:33 +01:00
|
|
|
u16 disconnect_reason_code; /* RADIUS server override */
|
2009-12-13 10:41:46 +01:00
|
|
|
u32 flags; /* Bitfield of WLAN_STA_* */
|
2009-03-25 15:13:35 +01:00
|
|
|
u16 capability;
|
|
|
|
u16 listen_interval; /* or beacon_int for APs */
|
|
|
|
u8 supported_rates[WLAN_SUPP_RATES_MAX];
|
|
|
|
int supported_rates_len;
|
2011-12-17 11:38:06 +01:00
|
|
|
u8 qosinfo; /* Valid when WLAN_STA_WMM is set */
|
2009-03-25 15:13:35 +01:00
|
|
|
|
2014-03-11 05:07:01 +01:00
|
|
|
#ifdef CONFIG_MESH
|
|
|
|
enum mesh_plink_state plink_state;
|
|
|
|
u16 peer_lid;
|
|
|
|
u16 my_lid;
|
2016-07-01 03:22:39 +02:00
|
|
|
u16 peer_aid;
|
2014-03-11 05:07:01 +01:00
|
|
|
u16 mpm_close_reason;
|
|
|
|
int mpm_retries;
|
2016-06-18 13:01:47 +02:00
|
|
|
u8 my_nonce[WPA_NONCE_LEN];
|
|
|
|
u8 peer_nonce[WPA_NONCE_LEN];
|
2014-09-01 06:23:29 +02:00
|
|
|
u8 aek[32]; /* SHA256 digest length */
|
2016-06-18 13:35:35 +02:00
|
|
|
u8 mtk[WPA_TK_MAX_LEN];
|
|
|
|
size_t mtk_len;
|
2016-06-18 13:11:23 +02:00
|
|
|
u8 mgtk_rsc[6];
|
2016-06-18 21:14:37 +02:00
|
|
|
u8 mgtk_key_id;
|
2016-06-18 13:45:35 +02:00
|
|
|
u8 mgtk[WPA_TK_MAX_LEN];
|
|
|
|
size_t mgtk_len;
|
2016-06-18 13:11:23 +02:00
|
|
|
u8 igtk_rsc[6];
|
2016-06-18 14:50:14 +02:00
|
|
|
u8 igtk[WPA_TK_MAX_LEN];
|
|
|
|
size_t igtk_len;
|
2016-06-18 13:11:23 +02:00
|
|
|
u16 igtk_key_id;
|
2014-09-01 06:23:31 +02:00
|
|
|
u8 sae_auth_retry;
|
2014-03-11 05:07:01 +01:00
|
|
|
#endif /* CONFIG_MESH */
|
|
|
|
|
2009-03-25 15:13:35 +01:00
|
|
|
unsigned int nonerp_set:1;
|
|
|
|
unsigned int no_short_slot_time_set:1;
|
|
|
|
unsigned int no_short_preamble_set:1;
|
|
|
|
unsigned int no_ht_gf_set:1;
|
|
|
|
unsigned int no_ht_set:1;
|
2014-04-14 19:40:56 +02:00
|
|
|
unsigned int ht40_intolerant_set:1;
|
2009-03-25 15:13:35 +01:00
|
|
|
unsigned int ht_20mhz_set:1;
|
2010-07-09 02:14:24 +02:00
|
|
|
unsigned int no_p2p_set:1;
|
2013-07-24 11:28:20 +02:00
|
|
|
unsigned int qos_map_enabled:1;
|
2012-11-21 23:48:48 +01:00
|
|
|
unsigned int remediation:1;
|
2013-07-26 21:13:58 +02:00
|
|
|
unsigned int hs20_deauth_requested:1;
|
2014-10-04 18:36:48 +02:00
|
|
|
unsigned int session_timeout_set:1;
|
2015-01-16 11:10:52 +01:00
|
|
|
unsigned int radius_das_match:1;
|
2015-09-08 11:46:20 +02:00
|
|
|
unsigned int ecsa_supported:1;
|
2016-02-16 10:54:32 +01:00
|
|
|
unsigned int added_unassoc:1;
|
2016-12-20 00:30:09 +01:00
|
|
|
unsigned int pending_wds_enable:1;
|
2017-10-06 17:03:25 +02:00
|
|
|
unsigned int power_capab:1;
|
2018-03-13 04:20:28 +01:00
|
|
|
unsigned int agreed_to_steer:1;
|
2018-04-23 23:05:44 +02:00
|
|
|
unsigned int hs20_t_c_filtering:1;
|
2019-01-04 21:58:56 +01:00
|
|
|
unsigned int ft_over_ds:1;
|
2019-05-29 11:11:48 +02:00
|
|
|
unsigned int external_dh_updated:1;
|
2020-05-25 20:55:49 +02:00
|
|
|
unsigned int post_csa_sa_query:1;
|
2009-03-25 15:13:35 +01:00
|
|
|
|
|
|
|
u16 auth_alg;
|
|
|
|
|
|
|
|
enum {
|
2013-04-05 17:41:26 +02:00
|
|
|
STA_NULLFUNC = 0, STA_DISASSOC, STA_DEAUTH, STA_REMOVE,
|
|
|
|
STA_DISASSOC_FROM_CLI
|
2009-03-25 15:13:35 +01:00
|
|
|
} timeout_next;
|
|
|
|
|
2011-08-28 22:07:02 +02:00
|
|
|
u16 deauth_reason;
|
|
|
|
u16 disassoc_reason;
|
|
|
|
|
2009-03-25 15:13:35 +01:00
|
|
|
/* IEEE 802.1X related data */
|
|
|
|
struct eapol_state_machine *eapol_sm;
|
|
|
|
|
2016-03-06 10:29:16 +01:00
|
|
|
struct pending_eapol_rx *pending_eapol_rx;
|
|
|
|
|
2016-01-24 12:37:46 +01:00
|
|
|
u64 acct_session_id;
|
2013-12-16 21:08:22 +01:00
|
|
|
struct os_reltime acct_session_start;
|
2009-03-25 15:13:35 +01:00
|
|
|
int acct_session_started;
|
|
|
|
int acct_terminate_cause; /* Acct-Terminate-Cause */
|
|
|
|
int acct_interim_interval; /* Acct-Interim-Interval */
|
2016-02-29 10:44:43 +01:00
|
|
|
unsigned int acct_interim_errors;
|
2009-03-25 15:13:35 +01:00
|
|
|
|
2016-02-19 16:22:25 +01:00
|
|
|
/* For extending 32-bit driver counters to 64-bit counters */
|
|
|
|
u32 last_rx_bytes_hi;
|
|
|
|
u32 last_rx_bytes_lo;
|
|
|
|
u32 last_tx_bytes_hi;
|
|
|
|
u32 last_tx_bytes_lo;
|
2009-03-25 15:13:35 +01:00
|
|
|
|
|
|
|
u8 *challenge; /* IEEE 802.11 Shared Key Authentication Challenge */
|
|
|
|
|
|
|
|
struct wpa_state_machine *wpa_sm;
|
|
|
|
struct rsn_preauth_interface *preauth_iface;
|
|
|
|
|
2015-04-10 14:49:46 +02:00
|
|
|
int vlan_id; /* 0: none, >0: VID */
|
2016-01-21 14:51:56 +01:00
|
|
|
struct vlan_description *vlan_desc;
|
Remove VLAN interface on STA free
Currently, vlan_remove_dynamic() is only called when the station VLAN ID
is changed (ap_sta_bind_vlan), but not when the station is freed. So
dynamic VLAN interfaces are not removed actually except within 1x
reauthentification VLAN ID change, although most of the code is already
there.
This patch fixes this by calling vlan_remove_dynamic() in ap_free_sta().
It cannot just use sta->vlan_id for this, as this might have been
changed without calling ap_sta_bind_vlan() (ap/ieee802_11.c:handle_auth
fetches from RADIUS cache for WPA-PSK), thus reference counting might
not have been updated. Additionally, reference counting might get wrong
due to old_vlanid = 0 being passed unconditionally, thus increasing the
reference counter multiple times.
So tracking the currently assigned (i.e., dynamic_vlan counter
increased) VLAN is done in a new variable sta->vlan_id_bound. Therefore,
the old_vlan_id argument of ap_sta_bind_vlan() is no longer needed and
setting the VLAN for the sta in driver happens unconditionally.
Additionally, vlan->dynamic_vlan is only incremented when it actually
is a dynamic VLAN.
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
2015-04-10 14:49:50 +02:00
|
|
|
int vlan_id_bound; /* updated by ap_sta_bind_vlan() */
|
2012-11-25 16:49:25 +01:00
|
|
|
/* PSKs from RADIUS authentication server */
|
|
|
|
struct hostapd_sta_wpa_psk_short *psk;
|
2009-03-25 15:13:35 +01:00
|
|
|
|
2012-08-19 13:20:10 +02:00
|
|
|
char *identity; /* User-Name from RADIUS */
|
|
|
|
char *radius_cui; /* Chargeable-User-Identity from RADIUS */
|
|
|
|
|
2009-11-29 20:07:52 +01:00
|
|
|
struct ieee80211_ht_capabilities *ht_capabilities;
|
2012-08-10 18:49:18 +02:00
|
|
|
struct ieee80211_vht_capabilities *vht_capabilities;
|
2018-08-06 21:46:24 +02:00
|
|
|
struct ieee80211_vht_operation *vht_operation;
|
2014-02-10 13:43:05 +01:00
|
|
|
u8 vht_opmode;
|
2019-05-20 09:55:05 +02:00
|
|
|
struct ieee80211_he_capabilities *he_capab;
|
|
|
|
size_t he_capab_len;
|
2020-04-25 00:45:41 +02:00
|
|
|
struct ieee80211_he_6ghz_band_cap *he_6ghz_capab;
|
2009-03-25 15:13:35 +01:00
|
|
|
|
|
|
|
int sa_query_count; /* number of pending SA Query requests;
|
|
|
|
* 0 = no SA Query in progress */
|
|
|
|
int sa_query_timed_out;
|
|
|
|
u8 *sa_query_trans_id; /* buffer of WLAN_SA_QUERY_TR_ID_LEN *
|
|
|
|
* sa_query_count octets of pending SA Query
|
|
|
|
* transaction identifiers */
|
2013-11-25 21:56:09 +01:00
|
|
|
struct os_reltime sa_query_start;
|
2009-03-25 15:13:35 +01:00
|
|
|
|
2017-06-15 21:16:45 +02:00
|
|
|
#if defined(CONFIG_INTERWORKING) || defined(CONFIG_DPP)
|
2012-02-26 21:34:19 +01:00
|
|
|
#define GAS_DIALOG_MAX 8 /* Max concurrent dialog number */
|
|
|
|
struct gas_dialog_info *gas_dialog;
|
|
|
|
u8 gas_dialog_next;
|
2017-06-15 21:16:45 +02:00
|
|
|
#endif /* CONFIG_INTERWORKING || CONFIG_DPP */
|
2012-02-26 21:34:19 +01:00
|
|
|
|
2009-03-25 15:13:35 +01:00
|
|
|
struct wpabuf *wps_ie; /* WPS IE from (Re)Association Request */
|
2010-07-18 23:30:25 +02:00
|
|
|
struct wpabuf *p2p_ie; /* P2P IE from (Re)Association Request */
|
2012-11-21 23:19:17 +01:00
|
|
|
struct wpabuf *hs20_ie; /* HS 2.0 IE from (Re)Association Request */
|
2018-04-17 12:08:31 +02:00
|
|
|
/* Hotspot 2.0 Roaming Consortium from (Re)Association Request */
|
|
|
|
struct wpabuf *roaming_consortium;
|
2012-11-21 23:48:48 +01:00
|
|
|
u8 remediation_method;
|
|
|
|
char *remediation_url; /* HS 2.0 Subscription Remediation Server URL */
|
2018-06-21 19:50:54 +02:00
|
|
|
char *t_c_url; /* HS 2.0 Terms and Conditions Server URL */
|
2013-07-26 21:13:58 +02:00
|
|
|
struct wpabuf *hs20_deauth_req;
|
2013-08-01 23:39:30 +02:00
|
|
|
char *hs20_session_info_url;
|
|
|
|
int hs20_disassoc_timer;
|
2015-01-21 14:30:48 +01:00
|
|
|
#ifdef CONFIG_FST
|
|
|
|
struct wpabuf *mb_ies; /* MB IEs from (Re)Association Request */
|
|
|
|
#endif /* CONFIG_FST */
|
2012-09-26 12:52:19 +02:00
|
|
|
|
2013-11-25 21:56:04 +01:00
|
|
|
struct os_reltime connected_time;
|
2012-09-30 18:51:07 +02:00
|
|
|
|
|
|
|
#ifdef CONFIG_SAE
|
2012-12-30 20:48:19 +01:00
|
|
|
struct sae_data *sae;
|
2016-03-09 10:16:14 +01:00
|
|
|
unsigned int mesh_sae_pmksa_caching:1;
|
2012-09-30 18:51:07 +02:00
|
|
|
#endif /* CONFIG_SAE */
|
2014-10-04 18:36:48 +02:00
|
|
|
|
2017-05-18 15:21:56 +02:00
|
|
|
/* valid only if session_timeout_set == 1 */
|
|
|
|
struct os_reltime session_timeout;
|
2014-11-05 09:50:34 +01:00
|
|
|
|
|
|
|
/* Last Authentication/(Re)Association Request/Action frame sequence
|
|
|
|
* control */
|
|
|
|
u16 last_seq_ctrl;
|
|
|
|
/* Last Authentication/(Re)Association Request/Action frame subtype */
|
|
|
|
u8 last_subtype;
|
2016-02-22 12:03:28 +01:00
|
|
|
|
|
|
|
#ifdef CONFIG_MBO
|
|
|
|
u8 cell_capa; /* 0 = unknown (not an MBO STA); otherwise,
|
|
|
|
* enum mbo_cellular_capa values */
|
2016-02-22 19:37:21 +01:00
|
|
|
struct mbo_non_pref_chan_info *non_pref_chan;
|
2019-01-01 17:17:02 +01:00
|
|
|
int auth_rssi; /* Last Authentication frame RSSI */
|
2016-02-22 12:03:28 +01:00
|
|
|
#endif /* CONFIG_MBO */
|
2016-02-24 11:20:31 +01:00
|
|
|
|
|
|
|
u8 *supp_op_classes; /* Supported Operating Classes element, if
|
|
|
|
* received, starting from the Length field */
|
2016-04-06 18:42:10 +02:00
|
|
|
|
|
|
|
u8 rrm_enabled_capa[5];
|
Passive Client Taxonomy
Implement the signature mechanism described in the paper
"Passive Taxonomy of Wifi Clients using MLME Frame Contents"
published by Denton Gentry and Avery Pennarun.
http://research.google.com/pubs/pub45429.html
https://arxiv.org/abs/1608.01725
This involves:
1. Add a CONFIG_TAXONOMY compile option. Enabling taxonomy incurs
a memory overhead of up to several kilobytes per associated
station.
2. If enabled, store the Probe Request and (Re)Associate Request frame in
struct sta_info.
3. Implement code to extract the ID of each Information Element,
plus selected fields and bitmasks from certain IEs, into a
descriptive text string. This is done in a new source file,
src/ap/taxonomy.c.
4. Implement a "signature qq:rr:ss:tt:uu:vv" command
in hostapd_cli to retrieve the signature.
Signatures take the form of a text string. For example, a signature
for the Nexus 5X is:
wifi4|probe:0,1,127,45,191,htcap:01ef,htagg:03,htmcs:0000ffff,vhtcap:338061b2,
vhtrxmcs:030cfffa,vhttxmcs:030cfffa,extcap:00000a0201000040|assoc:0,1,48,45,
221(0050f2,2),191,127,htcap:01ef,htagg:03,htmcs:0000ffff,vhtcap:339071b2,
vhtrxmcs:030cfffa,vhttxmcs:030cfffa,extcap:0000000000000040
Signed-off-by: dgentry@google.com (Denton Gentry)
Signed-off-by: denny@geekhold.com (Denton Gentry)
Signed-off-by: rofrankel@google.com (Richard Frankel)
Signed-off-by: richard@frankel.tv (Richard Frankel)
2016-08-15 06:42:48 +02:00
|
|
|
|
2017-10-06 17:03:25 +02:00
|
|
|
s8 min_tx_power;
|
|
|
|
s8 max_tx_power;
|
|
|
|
|
Passive Client Taxonomy
Implement the signature mechanism described in the paper
"Passive Taxonomy of Wifi Clients using MLME Frame Contents"
published by Denton Gentry and Avery Pennarun.
http://research.google.com/pubs/pub45429.html
https://arxiv.org/abs/1608.01725
This involves:
1. Add a CONFIG_TAXONOMY compile option. Enabling taxonomy incurs
a memory overhead of up to several kilobytes per associated
station.
2. If enabled, store the Probe Request and (Re)Associate Request frame in
struct sta_info.
3. Implement code to extract the ID of each Information Element,
plus selected fields and bitmasks from certain IEs, into a
descriptive text string. This is done in a new source file,
src/ap/taxonomy.c.
4. Implement a "signature qq:rr:ss:tt:uu:vv" command
in hostapd_cli to retrieve the signature.
Signatures take the form of a text string. For example, a signature
for the Nexus 5X is:
wifi4|probe:0,1,127,45,191,htcap:01ef,htagg:03,htmcs:0000ffff,vhtcap:338061b2,
vhtrxmcs:030cfffa,vhttxmcs:030cfffa,extcap:00000a0201000040|assoc:0,1,48,45,
221(0050f2,2),191,127,htcap:01ef,htagg:03,htmcs:0000ffff,vhtcap:339071b2,
vhtrxmcs:030cfffa,vhttxmcs:030cfffa,extcap:0000000000000040
Signed-off-by: dgentry@google.com (Denton Gentry)
Signed-off-by: denny@geekhold.com (Denton Gentry)
Signed-off-by: rofrankel@google.com (Richard Frankel)
Signed-off-by: richard@frankel.tv (Richard Frankel)
2016-08-15 06:42:48 +02:00
|
|
|
#ifdef CONFIG_TAXONOMY
|
|
|
|
struct wpabuf *probe_ie_taxonomy;
|
|
|
|
struct wpabuf *assoc_ie_taxonomy;
|
|
|
|
#endif /* CONFIG_TAXONOMY */
|
2015-09-04 23:04:21 +02:00
|
|
|
|
|
|
|
#ifdef CONFIG_FILS
|
|
|
|
u8 fils_snonce[FILS_NONCE_LEN];
|
|
|
|
u8 fils_session[FILS_SESSION_LEN];
|
2017-07-05 16:52:23 +02:00
|
|
|
u8 fils_erp_pmkid[PMKID_LEN];
|
2017-01-31 13:38:44 +01:00
|
|
|
u8 *fils_pending_assoc_req;
|
|
|
|
size_t fils_pending_assoc_req_len;
|
|
|
|
unsigned int fils_pending_assoc_is_reassoc:1;
|
|
|
|
unsigned int fils_dhcp_rapid_commit_proxy:1;
|
2017-07-05 16:52:23 +02:00
|
|
|
unsigned int fils_erp_pmkid_set:1;
|
2017-07-06 12:57:54 +02:00
|
|
|
unsigned int fils_drv_assoc_finish:1;
|
2017-01-31 13:38:44 +01:00
|
|
|
struct wpabuf *fils_hlp_resp;
|
|
|
|
struct wpabuf *hlp_dhcp_discover;
|
2017-04-21 17:42:00 +02:00
|
|
|
void (*fils_pending_cb)(struct hostapd_data *hapd, struct sta_info *sta,
|
|
|
|
u16 resp, struct wpabuf *data, int pub);
|
2017-03-12 21:40:56 +01:00
|
|
|
#ifdef CONFIG_FILS_SK_PFS
|
|
|
|
struct crypto_ecdh *fils_ecdh;
|
|
|
|
#endif /* CONFIG_FILS_SK_PFS */
|
|
|
|
struct wpabuf *fils_dh_ss;
|
2017-05-07 16:04:08 +02:00
|
|
|
struct wpabuf *fils_g_sta;
|
2015-09-04 23:04:21 +02:00
|
|
|
#endif /* CONFIG_FILS */
|
2017-03-12 00:26:43 +01:00
|
|
|
|
|
|
|
#ifdef CONFIG_OWE
|
|
|
|
u8 *owe_pmk;
|
2017-10-08 15:37:32 +02:00
|
|
|
size_t owe_pmk_len;
|
2017-03-12 00:26:43 +01:00
|
|
|
struct crypto_ecdh *owe_ecdh;
|
2017-10-08 15:37:32 +02:00
|
|
|
u16 owe_group;
|
2017-03-12 00:26:43 +01:00
|
|
|
#endif /* CONFIG_OWE */
|
2017-10-14 12:41:08 +02:00
|
|
|
|
2017-10-06 17:03:25 +02:00
|
|
|
u8 *ext_capability;
|
2018-04-20 11:05:36 +02:00
|
|
|
char *ifname_wds; /* WDS ifname, if in use */
|
2017-10-06 17:03:25 +02:00
|
|
|
|
2019-03-17 22:51:53 +01:00
|
|
|
#ifdef CONFIG_DPP2
|
|
|
|
struct dpp_pfs *dpp_pfs;
|
|
|
|
#endif /* CONFIG_DPP2 */
|
|
|
|
|
2017-10-14 12:41:08 +02:00
|
|
|
#ifdef CONFIG_TESTING_OPTIONS
|
|
|
|
enum wpa_alg last_tk_alg;
|
|
|
|
int last_tk_key_idx;
|
|
|
|
u8 last_tk[WPA_TK_MAX_LEN];
|
|
|
|
size_t last_tk_len;
|
2020-01-08 19:52:26 +01:00
|
|
|
u8 *sae_postponed_commit;
|
|
|
|
size_t sae_postponed_commit_len;
|
2017-10-14 12:41:08 +02:00
|
|
|
#endif /* CONFIG_TESTING_OPTIONS */
|
2019-03-20 15:58:52 +01:00
|
|
|
#ifdef CONFIG_AIRTIME_POLICY
|
|
|
|
unsigned int airtime_weight;
|
|
|
|
struct os_reltime backlogged_until;
|
|
|
|
#endif /* CONFIG_AIRTIME_POLICY */
|
2009-03-25 15:13:35 +01:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
/* Default value for maximum station inactivity. After AP_MAX_INACTIVITY has
|
|
|
|
* passed since last received frame from the station, a nullfunc data frame is
|
|
|
|
* sent to the station. If this frame is not acknowledged and no other frames
|
|
|
|
* have been received, the station will be disassociated after
|
2011-09-21 23:43:59 +02:00
|
|
|
* AP_DISASSOC_DELAY seconds. Similarly, the station will be deauthenticated
|
2009-03-25 15:13:35 +01:00
|
|
|
* after AP_DEAUTH_DELAY seconds has passed after disassociation. */
|
|
|
|
#define AP_MAX_INACTIVITY (5 * 60)
|
2015-10-06 15:26:58 +02:00
|
|
|
#define AP_DISASSOC_DELAY (3)
|
2009-03-25 15:13:35 +01:00
|
|
|
#define AP_DEAUTH_DELAY (1)
|
|
|
|
/* Number of seconds to keep STA entry with Authenticated flag after it has
|
|
|
|
* been disassociated. */
|
|
|
|
#define AP_MAX_INACTIVITY_AFTER_DISASSOC (1 * 30)
|
|
|
|
/* Number of seconds to keep STA entry after it has been deauthenticated. */
|
|
|
|
#define AP_MAX_INACTIVITY_AFTER_DEAUTH (1 * 5)
|
|
|
|
|
|
|
|
|
2008-02-28 02:34:43 +01:00
|
|
|
int ap_for_each_sta(struct hostapd_data *hapd,
|
|
|
|
int (*cb)(struct hostapd_data *hapd, struct sta_info *sta,
|
|
|
|
void *ctx),
|
|
|
|
void *ctx);
|
|
|
|
struct sta_info * ap_get_sta(struct hostapd_data *hapd, const u8 *sta);
|
2013-09-01 16:37:22 +02:00
|
|
|
struct sta_info * ap_get_sta_p2p(struct hostapd_data *hapd, const u8 *addr);
|
2008-02-28 02:34:43 +01:00
|
|
|
void ap_sta_hash_add(struct hostapd_data *hapd, struct sta_info *sta);
|
|
|
|
void ap_free_sta(struct hostapd_data *hapd, struct sta_info *sta);
|
2014-11-01 07:33:41 +01:00
|
|
|
void ap_sta_ip6addr_del(struct hostapd_data *hapd, struct sta_info *sta);
|
2008-02-28 02:34:43 +01:00
|
|
|
void hostapd_free_stas(struct hostapd_data *hapd);
|
|
|
|
void ap_handle_timer(void *eloop_ctx, void *timeout_ctx);
|
2013-11-06 22:20:28 +01:00
|
|
|
void ap_sta_replenish_timeout(struct hostapd_data *hapd, struct sta_info *sta,
|
|
|
|
u32 session_timeout);
|
2008-02-28 02:34:43 +01:00
|
|
|
void ap_sta_session_timeout(struct hostapd_data *hapd, struct sta_info *sta,
|
|
|
|
u32 session_timeout);
|
|
|
|
void ap_sta_no_session_timeout(struct hostapd_data *hapd,
|
|
|
|
struct sta_info *sta);
|
2013-08-01 23:39:30 +02:00
|
|
|
void ap_sta_session_warning_timeout(struct hostapd_data *hapd,
|
|
|
|
struct sta_info *sta, int warning_time);
|
2008-02-28 02:34:43 +01:00
|
|
|
struct sta_info * ap_sta_add(struct hostapd_data *hapd, const u8 *addr);
|
|
|
|
void ap_sta_disassociate(struct hostapd_data *hapd, struct sta_info *sta,
|
|
|
|
u16 reason);
|
|
|
|
void ap_sta_deauthenticate(struct hostapd_data *hapd, struct sta_info *sta,
|
|
|
|
u16 reason);
|
2012-03-19 07:23:31 +01:00
|
|
|
#ifdef CONFIG_WPS
|
|
|
|
int ap_sta_wps_cancel(struct hostapd_data *hapd,
|
|
|
|
struct sta_info *sta, void *ctx);
|
|
|
|
#endif /* CONFIG_WPS */
|
Remove VLAN interface on STA free
Currently, vlan_remove_dynamic() is only called when the station VLAN ID
is changed (ap_sta_bind_vlan), but not when the station is freed. So
dynamic VLAN interfaces are not removed actually except within 1x
reauthentification VLAN ID change, although most of the code is already
there.
This patch fixes this by calling vlan_remove_dynamic() in ap_free_sta().
It cannot just use sta->vlan_id for this, as this might have been
changed without calling ap_sta_bind_vlan() (ap/ieee802_11.c:handle_auth
fetches from RADIUS cache for WPA-PSK), thus reference counting might
not have been updated. Additionally, reference counting might get wrong
due to old_vlanid = 0 being passed unconditionally, thus increasing the
reference counter multiple times.
So tracking the currently assigned (i.e., dynamic_vlan counter
increased) VLAN is done in a new variable sta->vlan_id_bound. Therefore,
the old_vlan_id argument of ap_sta_bind_vlan() is no longer needed and
setting the VLAN for the sta in driver happens unconditionally.
Additionally, vlan->dynamic_vlan is only incremented when it actually
is a dynamic VLAN.
Signed-off-by: Michael Braun <michael-dev@fami-braun.de>
2015-04-10 14:49:50 +02:00
|
|
|
int ap_sta_bind_vlan(struct hostapd_data *hapd, struct sta_info *sta);
|
2016-01-21 14:51:56 +01:00
|
|
|
int ap_sta_set_vlan(struct hostapd_data *hapd, struct sta_info *sta,
|
|
|
|
struct vlan_description *vlan_desc);
|
2008-12-26 10:46:21 +01:00
|
|
|
void ap_sta_start_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
|
|
|
|
void ap_sta_stop_sa_query(struct hostapd_data *hapd, struct sta_info *sta);
|
2008-12-26 11:30:34 +01:00
|
|
|
int ap_check_sa_query_timeout(struct hostapd_data *hapd, struct sta_info *sta);
|
2019-01-16 13:35:19 +01:00
|
|
|
const char * ap_sta_wpa_get_keyid(struct hostapd_data *hapd,
|
|
|
|
struct sta_info *sta);
|
2009-12-24 19:41:30 +01:00
|
|
|
void ap_sta_disconnect(struct hostapd_data *hapd, struct sta_info *sta,
|
|
|
|
const u8 *addr, u16 reason);
|
2008-02-28 02:34:43 +01:00
|
|
|
|
2011-02-02 15:52:32 +01:00
|
|
|
void ap_sta_set_authorized(struct hostapd_data *hapd,
|
|
|
|
struct sta_info *sta, int authorized);
|
|
|
|
static inline int ap_sta_is_authorized(struct sta_info *sta)
|
|
|
|
{
|
|
|
|
return sta->flags & WLAN_STA_AUTHORIZED;
|
|
|
|
}
|
|
|
|
|
2011-08-28 22:07:02 +02:00
|
|
|
void ap_sta_deauth_cb(struct hostapd_data *hapd, struct sta_info *sta);
|
|
|
|
void ap_sta_disassoc_cb(struct hostapd_data *hapd, struct sta_info *sta);
|
2016-01-15 18:28:58 +01:00
|
|
|
void ap_sta_clear_disconnect_timeouts(struct hostapd_data *hapd,
|
|
|
|
struct sta_info *sta);
|
2011-08-28 22:07:02 +02:00
|
|
|
|
2013-12-27 18:24:24 +01:00
|
|
|
int ap_sta_flags_txt(u32 flags, char *buf, size_t buflen);
|
2016-12-06 17:12:11 +01:00
|
|
|
void ap_sta_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd,
|
|
|
|
struct sta_info *sta);
|
|
|
|
int ap_sta_pending_delayed_1x_auth_fail_disconnect(struct hostapd_data *hapd,
|
|
|
|
struct sta_info *sta);
|
2020-04-04 20:50:37 +02:00
|
|
|
int ap_sta_re_add(struct hostapd_data *hapd, struct sta_info *sta);
|
2013-12-27 18:24:24 +01:00
|
|
|
|
2008-02-28 02:34:43 +01:00
|
|
|
#endif /* STA_INFO_H */
|