16d49e1aeSJan Lentfer /*
26d49e1aeSJan Lentfer * wpa_supplicant - WPA definitions
3*a1157835SDaniel Fojt * Copyright (c) 2003-2015, Jouni Malinen <j@w1.fi>
46d49e1aeSJan Lentfer *
53ff40c12SJohn Marino * This software may be distributed under the terms of the BSD license.
63ff40c12SJohn Marino * See README for more details.
76d49e1aeSJan Lentfer */
86d49e1aeSJan Lentfer
96d49e1aeSJan Lentfer #ifndef WPA_H
106d49e1aeSJan Lentfer #define WPA_H
116d49e1aeSJan Lentfer
123ff40c12SJohn Marino #include "common/defs.h"
133ff40c12SJohn Marino #include "common/eapol_common.h"
143ff40c12SJohn Marino #include "common/wpa_common.h"
153ff40c12SJohn Marino #include "common/ieee802_11_defs.h"
166d49e1aeSJan Lentfer
176d49e1aeSJan Lentfer struct wpa_sm;
186d49e1aeSJan Lentfer struct eapol_sm;
196d49e1aeSJan Lentfer struct wpa_config_blob;
20*a1157835SDaniel Fojt struct hostapd_freq_params;
21*a1157835SDaniel Fojt struct wpa_channel_info;
226d49e1aeSJan Lentfer
236d49e1aeSJan Lentfer struct wpa_sm_ctx {
246d49e1aeSJan Lentfer void *ctx; /* pointer to arbitrary upper level context */
253ff40c12SJohn Marino void *msg_ctx; /* upper level context for wpa_msg() calls */
266d49e1aeSJan Lentfer
273ff40c12SJohn Marino void (*set_state)(void *ctx, enum wpa_states state);
283ff40c12SJohn Marino enum wpa_states (*get_state)(void *ctx);
29*a1157835SDaniel Fojt void (*deauthenticate)(void * ctx, u16 reason_code);
303ff40c12SJohn Marino int (*set_key)(void *ctx, enum wpa_alg alg,
316d49e1aeSJan Lentfer const u8 *addr, int key_idx, int set_tx,
326d49e1aeSJan Lentfer const u8 *seq, size_t seq_len,
336d49e1aeSJan Lentfer const u8 *key, size_t key_len);
346d49e1aeSJan Lentfer void * (*get_network_ctx)(void *ctx);
356d49e1aeSJan Lentfer int (*get_bssid)(void *ctx, u8 *bssid);
366d49e1aeSJan Lentfer int (*ether_send)(void *ctx, const u8 *dest, u16 proto, const u8 *buf,
376d49e1aeSJan Lentfer size_t len);
386d49e1aeSJan Lentfer int (*get_beacon_ie)(void *ctx);
396d49e1aeSJan Lentfer void (*cancel_auth_timeout)(void *ctx);
406d49e1aeSJan Lentfer u8 * (*alloc_eapol)(void *ctx, u8 type, const void *data, u16 data_len,
416d49e1aeSJan Lentfer size_t *msg_len, void **data_pos);
42*a1157835SDaniel Fojt int (*add_pmkid)(void *ctx, void *network_ctx, const u8 *bssid,
43*a1157835SDaniel Fojt const u8 *pmkid, const u8 *fils_cache_id,
44*a1157835SDaniel Fojt const u8 *pmk, size_t pmk_len);
45*a1157835SDaniel Fojt int (*remove_pmkid)(void *ctx, void *network_ctx, const u8 *bssid,
46*a1157835SDaniel Fojt const u8 *pmkid, const u8 *fils_cache_id);
476d49e1aeSJan Lentfer void (*set_config_blob)(void *ctx, struct wpa_config_blob *blob);
486d49e1aeSJan Lentfer const struct wpa_config_blob * (*get_config_blob)(void *ctx,
496d49e1aeSJan Lentfer const char *name);
506d49e1aeSJan Lentfer int (*mlme_setprotection)(void *ctx, const u8 *addr,
516d49e1aeSJan Lentfer int protection_type, int key_type);
526d49e1aeSJan Lentfer int (*update_ft_ies)(void *ctx, const u8 *md, const u8 *ies,
536d49e1aeSJan Lentfer size_t ies_len);
546d49e1aeSJan Lentfer int (*send_ft_action)(void *ctx, u8 action, const u8 *target_ap,
556d49e1aeSJan Lentfer const u8 *ies, size_t ies_len);
563ff40c12SJohn Marino int (*mark_authenticated)(void *ctx, const u8 *target_ap);
573ff40c12SJohn Marino #ifdef CONFIG_TDLS
583ff40c12SJohn Marino int (*tdls_get_capa)(void *ctx, int *tdls_supported,
59*a1157835SDaniel Fojt int *tdls_ext_setup, int *tdls_chan_switch);
603ff40c12SJohn Marino int (*send_tdls_mgmt)(void *ctx, const u8 *dst,
613ff40c12SJohn Marino u8 action_code, u8 dialog_token,
62*a1157835SDaniel Fojt u16 status_code, u32 peer_capab,
63*a1157835SDaniel Fojt int initiator, const u8 *buf, size_t len);
643ff40c12SJohn Marino int (*tdls_oper)(void *ctx, int oper, const u8 *peer);
653ff40c12SJohn Marino int (*tdls_peer_addset)(void *ctx, const u8 *addr, int add, u16 aid,
663ff40c12SJohn Marino u16 capability, const u8 *supp_rates,
673ff40c12SJohn Marino size_t supp_rates_len,
683ff40c12SJohn Marino const struct ieee80211_ht_capabilities *ht_capab,
693ff40c12SJohn Marino const struct ieee80211_vht_capabilities *vht_capab,
70*a1157835SDaniel Fojt u8 qosinfo, int wmm, const u8 *ext_capab,
713ff40c12SJohn Marino size_t ext_capab_len, const u8 *supp_channels,
723ff40c12SJohn Marino size_t supp_channels_len,
733ff40c12SJohn Marino const u8 *supp_oper_classes,
743ff40c12SJohn Marino size_t supp_oper_classes_len);
75*a1157835SDaniel Fojt int (*tdls_enable_channel_switch)(
76*a1157835SDaniel Fojt void *ctx, const u8 *addr, u8 oper_class,
77*a1157835SDaniel Fojt const struct hostapd_freq_params *params);
78*a1157835SDaniel Fojt int (*tdls_disable_channel_switch)(void *ctx, const u8 *addr);
793ff40c12SJohn Marino #endif /* CONFIG_TDLS */
80*a1157835SDaniel Fojt void (*set_rekey_offload)(void *ctx, const u8 *kek, size_t kek_len,
81*a1157835SDaniel Fojt const u8 *kck, size_t kck_len,
823ff40c12SJohn Marino const u8 *replay_ctr);
83*a1157835SDaniel Fojt int (*key_mgmt_set_pmk)(void *ctx, const u8 *pmk, size_t pmk_len);
84*a1157835SDaniel Fojt void (*fils_hlp_rx)(void *ctx, const u8 *dst, const u8 *src,
85*a1157835SDaniel Fojt const u8 *pkt, size_t pkt_len);
86*a1157835SDaniel Fojt int (*channel_info)(void *ctx, struct wpa_channel_info *ci);
876d49e1aeSJan Lentfer };
886d49e1aeSJan Lentfer
896d49e1aeSJan Lentfer
906d49e1aeSJan Lentfer enum wpa_sm_conf_params {
916d49e1aeSJan Lentfer RSNA_PMK_LIFETIME /* dot11RSNAConfigPMKLifetime */,
926d49e1aeSJan Lentfer RSNA_PMK_REAUTH_THRESHOLD /* dot11RSNAConfigPMKReauthThreshold */,
936d49e1aeSJan Lentfer RSNA_SA_TIMEOUT /* dot11RSNAConfigSATimeout */,
946d49e1aeSJan Lentfer WPA_PARAM_PROTO,
956d49e1aeSJan Lentfer WPA_PARAM_PAIRWISE,
966d49e1aeSJan Lentfer WPA_PARAM_GROUP,
976d49e1aeSJan Lentfer WPA_PARAM_KEY_MGMT,
986d49e1aeSJan Lentfer WPA_PARAM_MGMT_GROUP,
993ff40c12SJohn Marino WPA_PARAM_RSN_ENABLED,
100*a1157835SDaniel Fojt WPA_PARAM_MFP,
101*a1157835SDaniel Fojt WPA_PARAM_OCV
1026d49e1aeSJan Lentfer };
1036d49e1aeSJan Lentfer
1046d49e1aeSJan Lentfer struct rsn_supp_config {
1056d49e1aeSJan Lentfer void *network_ctx;
1066d49e1aeSJan Lentfer int allowed_pairwise_cipher; /* bitfield of WPA_CIPHER_* */
1076d49e1aeSJan Lentfer int proactive_key_caching;
1086d49e1aeSJan Lentfer int eap_workaround;
1096d49e1aeSJan Lentfer void *eap_conf_ctx;
1106d49e1aeSJan Lentfer const u8 *ssid;
1116d49e1aeSJan Lentfer size_t ssid_len;
1126d49e1aeSJan Lentfer int wpa_ptk_rekey;
1133ff40c12SJohn Marino int p2p;
114*a1157835SDaniel Fojt int wpa_rsc_relaxation;
115*a1157835SDaniel Fojt const u8 *fils_cache_id;
1166d49e1aeSJan Lentfer };
1176d49e1aeSJan Lentfer
1186d49e1aeSJan Lentfer #ifndef CONFIG_NO_WPA
1196d49e1aeSJan Lentfer
1206d49e1aeSJan Lentfer struct wpa_sm * wpa_sm_init(struct wpa_sm_ctx *ctx);
1216d49e1aeSJan Lentfer void wpa_sm_deinit(struct wpa_sm *sm);
1226d49e1aeSJan Lentfer void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid);
1236d49e1aeSJan Lentfer void wpa_sm_notify_disassoc(struct wpa_sm *sm);
124*a1157835SDaniel Fojt void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len,
125*a1157835SDaniel Fojt const u8 *pmkid, const u8 *bssid);
1266d49e1aeSJan Lentfer void wpa_sm_set_pmk_from_pmksa(struct wpa_sm *sm);
1276d49e1aeSJan Lentfer void wpa_sm_set_fast_reauth(struct wpa_sm *sm, int fast_reauth);
1286d49e1aeSJan Lentfer void wpa_sm_set_scard_ctx(struct wpa_sm *sm, void *scard_ctx);
1296d49e1aeSJan Lentfer void wpa_sm_set_config(struct wpa_sm *sm, struct rsn_supp_config *config);
1306d49e1aeSJan Lentfer void wpa_sm_set_own_addr(struct wpa_sm *sm, const u8 *addr);
1316d49e1aeSJan Lentfer void wpa_sm_set_ifname(struct wpa_sm *sm, const char *ifname,
1326d49e1aeSJan Lentfer const char *bridge_ifname);
1336d49e1aeSJan Lentfer void wpa_sm_set_eapol(struct wpa_sm *sm, struct eapol_sm *eapol);
1346d49e1aeSJan Lentfer int wpa_sm_set_assoc_wpa_ie(struct wpa_sm *sm, const u8 *ie, size_t len);
1356d49e1aeSJan Lentfer int wpa_sm_set_assoc_wpa_ie_default(struct wpa_sm *sm, u8 *wpa_ie,
1366d49e1aeSJan Lentfer size_t *wpa_ie_len);
1376d49e1aeSJan Lentfer int wpa_sm_set_ap_wpa_ie(struct wpa_sm *sm, const u8 *ie, size_t len);
1386d49e1aeSJan Lentfer int wpa_sm_set_ap_rsn_ie(struct wpa_sm *sm, const u8 *ie, size_t len);
1396d49e1aeSJan Lentfer int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen);
1406d49e1aeSJan Lentfer
1416d49e1aeSJan Lentfer int wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param,
1426d49e1aeSJan Lentfer unsigned int value);
1436d49e1aeSJan Lentfer
1446d49e1aeSJan Lentfer int wpa_sm_get_status(struct wpa_sm *sm, char *buf, size_t buflen,
1456d49e1aeSJan Lentfer int verbose);
1463ff40c12SJohn Marino int wpa_sm_pmf_enabled(struct wpa_sm *sm);
147*a1157835SDaniel Fojt int wpa_sm_ocv_enabled(struct wpa_sm *sm);
1486d49e1aeSJan Lentfer
1496d49e1aeSJan Lentfer void wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise);
1506d49e1aeSJan Lentfer
1516d49e1aeSJan Lentfer int wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len,
1526d49e1aeSJan Lentfer struct wpa_ie_data *data);
1536d49e1aeSJan Lentfer
1546d49e1aeSJan Lentfer void wpa_sm_aborted_cached(struct wpa_sm *sm);
1556d49e1aeSJan Lentfer int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
1566d49e1aeSJan Lentfer const u8 *buf, size_t len);
1576d49e1aeSJan Lentfer int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data);
1583ff40c12SJohn Marino int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
159*a1157835SDaniel Fojt struct rsn_pmksa_cache_entry * wpa_sm_pmksa_cache_head(struct wpa_sm *sm);
160*a1157835SDaniel Fojt struct rsn_pmksa_cache_entry *
161*a1157835SDaniel Fojt wpa_sm_pmksa_cache_add_entry(struct wpa_sm *sm,
162*a1157835SDaniel Fojt struct rsn_pmksa_cache_entry * entry);
163*a1157835SDaniel Fojt void wpa_sm_pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len,
164*a1157835SDaniel Fojt const u8 *pmkid, const u8 *bssid,
165*a1157835SDaniel Fojt const u8 *fils_cache_id);
166*a1157835SDaniel Fojt int wpa_sm_pmksa_exists(struct wpa_sm *sm, const u8 *bssid,
167*a1157835SDaniel Fojt const void *network_ctx);
1683ff40c12SJohn Marino void wpa_sm_drop_sa(struct wpa_sm *sm);
1693ff40c12SJohn Marino int wpa_sm_has_ptk(struct wpa_sm *sm);
1703ff40c12SJohn Marino
1713ff40c12SJohn Marino void wpa_sm_update_replay_ctr(struct wpa_sm *sm, const u8 *replay_ctr);
1723ff40c12SJohn Marino
1733ff40c12SJohn Marino void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx);
1743ff40c12SJohn Marino
1753ff40c12SJohn Marino int wpa_sm_get_p2p_ip_addr(struct wpa_sm *sm, u8 *buf);
1766d49e1aeSJan Lentfer
177*a1157835SDaniel Fojt void wpa_sm_set_rx_replay_ctr(struct wpa_sm *sm, const u8 *rx_replay_counter);
178*a1157835SDaniel Fojt void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm,
179*a1157835SDaniel Fojt const u8 *ptk_kck, size_t ptk_kck_len,
180*a1157835SDaniel Fojt const u8 *ptk_kek, size_t ptk_kek_len);
181*a1157835SDaniel Fojt int wpa_fils_is_completed(struct wpa_sm *sm);
182*a1157835SDaniel Fojt
1836d49e1aeSJan Lentfer #else /* CONFIG_NO_WPA */
1846d49e1aeSJan Lentfer
wpa_sm_init(struct wpa_sm_ctx * ctx)1856d49e1aeSJan Lentfer static inline struct wpa_sm * wpa_sm_init(struct wpa_sm_ctx *ctx)
1866d49e1aeSJan Lentfer {
1876d49e1aeSJan Lentfer return (struct wpa_sm *) 1;
1886d49e1aeSJan Lentfer }
1896d49e1aeSJan Lentfer
wpa_sm_deinit(struct wpa_sm * sm)1906d49e1aeSJan Lentfer static inline void wpa_sm_deinit(struct wpa_sm *sm)
1916d49e1aeSJan Lentfer {
1926d49e1aeSJan Lentfer }
1936d49e1aeSJan Lentfer
wpa_sm_notify_assoc(struct wpa_sm * sm,const u8 * bssid)1946d49e1aeSJan Lentfer static inline void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid)
1956d49e1aeSJan Lentfer {
1966d49e1aeSJan Lentfer }
1976d49e1aeSJan Lentfer
wpa_sm_notify_disassoc(struct wpa_sm * sm)1986d49e1aeSJan Lentfer static inline void wpa_sm_notify_disassoc(struct wpa_sm *sm)
1996d49e1aeSJan Lentfer {
2006d49e1aeSJan Lentfer }
2016d49e1aeSJan Lentfer
wpa_sm_set_pmk(struct wpa_sm * sm,const u8 * pmk,size_t pmk_len,const u8 * pmkid,const u8 * bssid)2026d49e1aeSJan Lentfer static inline void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk,
203*a1157835SDaniel Fojt size_t pmk_len, const u8 *pmkid,
204*a1157835SDaniel Fojt const u8 *bssid)
2056d49e1aeSJan Lentfer {
2066d49e1aeSJan Lentfer }
2076d49e1aeSJan Lentfer
wpa_sm_set_pmk_from_pmksa(struct wpa_sm * sm)2086d49e1aeSJan Lentfer static inline void wpa_sm_set_pmk_from_pmksa(struct wpa_sm *sm)
2096d49e1aeSJan Lentfer {
2106d49e1aeSJan Lentfer }
2116d49e1aeSJan Lentfer
wpa_sm_set_fast_reauth(struct wpa_sm * sm,int fast_reauth)2126d49e1aeSJan Lentfer static inline void wpa_sm_set_fast_reauth(struct wpa_sm *sm, int fast_reauth)
2136d49e1aeSJan Lentfer {
2146d49e1aeSJan Lentfer }
2156d49e1aeSJan Lentfer
wpa_sm_set_scard_ctx(struct wpa_sm * sm,void * scard_ctx)2166d49e1aeSJan Lentfer static inline void wpa_sm_set_scard_ctx(struct wpa_sm *sm, void *scard_ctx)
2176d49e1aeSJan Lentfer {
2186d49e1aeSJan Lentfer }
2196d49e1aeSJan Lentfer
wpa_sm_set_config(struct wpa_sm * sm,struct rsn_supp_config * config)2206d49e1aeSJan Lentfer static inline void wpa_sm_set_config(struct wpa_sm *sm,
2216d49e1aeSJan Lentfer struct rsn_supp_config *config)
2226d49e1aeSJan Lentfer {
2236d49e1aeSJan Lentfer }
2246d49e1aeSJan Lentfer
wpa_sm_set_own_addr(struct wpa_sm * sm,const u8 * addr)2256d49e1aeSJan Lentfer static inline void wpa_sm_set_own_addr(struct wpa_sm *sm, const u8 *addr)
2266d49e1aeSJan Lentfer {
2276d49e1aeSJan Lentfer }
2286d49e1aeSJan Lentfer
wpa_sm_set_ifname(struct wpa_sm * sm,const char * ifname,const char * bridge_ifname)2296d49e1aeSJan Lentfer static inline void wpa_sm_set_ifname(struct wpa_sm *sm, const char *ifname,
2306d49e1aeSJan Lentfer const char *bridge_ifname)
2316d49e1aeSJan Lentfer {
2326d49e1aeSJan Lentfer }
2336d49e1aeSJan Lentfer
wpa_sm_set_eapol(struct wpa_sm * sm,struct eapol_sm * eapol)2346d49e1aeSJan Lentfer static inline void wpa_sm_set_eapol(struct wpa_sm *sm, struct eapol_sm *eapol)
2356d49e1aeSJan Lentfer {
2366d49e1aeSJan Lentfer }
2376d49e1aeSJan Lentfer
wpa_sm_set_assoc_wpa_ie(struct wpa_sm * sm,const u8 * ie,size_t len)2386d49e1aeSJan Lentfer static inline int wpa_sm_set_assoc_wpa_ie(struct wpa_sm *sm, const u8 *ie,
2396d49e1aeSJan Lentfer size_t len)
2406d49e1aeSJan Lentfer {
2416d49e1aeSJan Lentfer return -1;
2426d49e1aeSJan Lentfer }
2436d49e1aeSJan Lentfer
wpa_sm_set_assoc_wpa_ie_default(struct wpa_sm * sm,u8 * wpa_ie,size_t * wpa_ie_len)2446d49e1aeSJan Lentfer static inline int wpa_sm_set_assoc_wpa_ie_default(struct wpa_sm *sm,
2456d49e1aeSJan Lentfer u8 *wpa_ie,
2466d49e1aeSJan Lentfer size_t *wpa_ie_len)
2476d49e1aeSJan Lentfer {
2486d49e1aeSJan Lentfer return -1;
2496d49e1aeSJan Lentfer }
2506d49e1aeSJan Lentfer
wpa_sm_set_ap_wpa_ie(struct wpa_sm * sm,const u8 * ie,size_t len)2516d49e1aeSJan Lentfer static inline int wpa_sm_set_ap_wpa_ie(struct wpa_sm *sm, const u8 *ie,
2526d49e1aeSJan Lentfer size_t len)
2536d49e1aeSJan Lentfer {
2546d49e1aeSJan Lentfer return -1;
2556d49e1aeSJan Lentfer }
2566d49e1aeSJan Lentfer
wpa_sm_set_ap_rsn_ie(struct wpa_sm * sm,const u8 * ie,size_t len)2576d49e1aeSJan Lentfer static inline int wpa_sm_set_ap_rsn_ie(struct wpa_sm *sm, const u8 *ie,
2586d49e1aeSJan Lentfer size_t len)
2596d49e1aeSJan Lentfer {
2606d49e1aeSJan Lentfer return -1;
2616d49e1aeSJan Lentfer }
2626d49e1aeSJan Lentfer
wpa_sm_get_mib(struct wpa_sm * sm,char * buf,size_t buflen)2636d49e1aeSJan Lentfer static inline int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen)
2646d49e1aeSJan Lentfer {
2656d49e1aeSJan Lentfer return 0;
2666d49e1aeSJan Lentfer }
2676d49e1aeSJan Lentfer
wpa_sm_set_param(struct wpa_sm * sm,enum wpa_sm_conf_params param,unsigned int value)2686d49e1aeSJan Lentfer static inline int wpa_sm_set_param(struct wpa_sm *sm,
2696d49e1aeSJan Lentfer enum wpa_sm_conf_params param,
2706d49e1aeSJan Lentfer unsigned int value)
2716d49e1aeSJan Lentfer {
2726d49e1aeSJan Lentfer return -1;
2736d49e1aeSJan Lentfer }
2746d49e1aeSJan Lentfer
wpa_sm_get_status(struct wpa_sm * sm,char * buf,size_t buflen,int verbose)2756d49e1aeSJan Lentfer static inline int wpa_sm_get_status(struct wpa_sm *sm, char *buf,
2766d49e1aeSJan Lentfer size_t buflen, int verbose)
2776d49e1aeSJan Lentfer {
2786d49e1aeSJan Lentfer return 0;
2796d49e1aeSJan Lentfer }
2806d49e1aeSJan Lentfer
wpa_sm_pmf_enabled(struct wpa_sm * sm)2813ff40c12SJohn Marino static inline int wpa_sm_pmf_enabled(struct wpa_sm *sm)
2823ff40c12SJohn Marino {
2833ff40c12SJohn Marino return 0;
2843ff40c12SJohn Marino }
2853ff40c12SJohn Marino
wpa_sm_ocv_enabled(struct wpa_sm * sm)286*a1157835SDaniel Fojt static inline int wpa_sm_ocv_enabled(struct wpa_sm *sm)
287*a1157835SDaniel Fojt {
288*a1157835SDaniel Fojt return 0;
289*a1157835SDaniel Fojt }
290*a1157835SDaniel Fojt
wpa_sm_key_request(struct wpa_sm * sm,int error,int pairwise)2916d49e1aeSJan Lentfer static inline void wpa_sm_key_request(struct wpa_sm *sm, int error,
2926d49e1aeSJan Lentfer int pairwise)
2936d49e1aeSJan Lentfer {
2946d49e1aeSJan Lentfer }
2956d49e1aeSJan Lentfer
wpa_parse_wpa_ie(const u8 * wpa_ie,size_t wpa_ie_len,struct wpa_ie_data * data)2966d49e1aeSJan Lentfer static inline int wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len,
2976d49e1aeSJan Lentfer struct wpa_ie_data *data)
2986d49e1aeSJan Lentfer {
2996d49e1aeSJan Lentfer return -1;
3006d49e1aeSJan Lentfer }
3016d49e1aeSJan Lentfer
wpa_sm_aborted_cached(struct wpa_sm * sm)3026d49e1aeSJan Lentfer static inline void wpa_sm_aborted_cached(struct wpa_sm *sm)
3036d49e1aeSJan Lentfer {
3046d49e1aeSJan Lentfer }
3056d49e1aeSJan Lentfer
wpa_sm_rx_eapol(struct wpa_sm * sm,const u8 * src_addr,const u8 * buf,size_t len)3066d49e1aeSJan Lentfer static inline int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
3076d49e1aeSJan Lentfer const u8 *buf, size_t len)
3086d49e1aeSJan Lentfer {
3096d49e1aeSJan Lentfer return -1;
3106d49e1aeSJan Lentfer }
3116d49e1aeSJan Lentfer
wpa_sm_parse_own_wpa_ie(struct wpa_sm * sm,struct wpa_ie_data * data)3126d49e1aeSJan Lentfer static inline int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm,
3136d49e1aeSJan Lentfer struct wpa_ie_data *data)
3146d49e1aeSJan Lentfer {
3156d49e1aeSJan Lentfer return -1;
3166d49e1aeSJan Lentfer }
3176d49e1aeSJan Lentfer
wpa_sm_pmksa_cache_list(struct wpa_sm * sm,char * buf,size_t len)3183ff40c12SJohn Marino static inline int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf,
3193ff40c12SJohn Marino size_t len)
3203ff40c12SJohn Marino {
3213ff40c12SJohn Marino return -1;
3223ff40c12SJohn Marino }
3233ff40c12SJohn Marino
wpa_sm_drop_sa(struct wpa_sm * sm)3243ff40c12SJohn Marino static inline void wpa_sm_drop_sa(struct wpa_sm *sm)
3253ff40c12SJohn Marino {
3263ff40c12SJohn Marino }
3273ff40c12SJohn Marino
wpa_sm_has_ptk(struct wpa_sm * sm)3283ff40c12SJohn Marino static inline int wpa_sm_has_ptk(struct wpa_sm *sm)
3293ff40c12SJohn Marino {
3303ff40c12SJohn Marino return 0;
3313ff40c12SJohn Marino }
3323ff40c12SJohn Marino
wpa_sm_update_replay_ctr(struct wpa_sm * sm,const u8 * replay_ctr)3333ff40c12SJohn Marino static inline void wpa_sm_update_replay_ctr(struct wpa_sm *sm,
3343ff40c12SJohn Marino const u8 *replay_ctr)
3353ff40c12SJohn Marino {
3363ff40c12SJohn Marino }
3373ff40c12SJohn Marino
wpa_sm_pmksa_cache_flush(struct wpa_sm * sm,void * network_ctx)3383ff40c12SJohn Marino static inline void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm,
3393ff40c12SJohn Marino void *network_ctx)
3403ff40c12SJohn Marino {
3413ff40c12SJohn Marino }
3423ff40c12SJohn Marino
wpa_sm_set_rx_replay_ctr(struct wpa_sm * sm,const u8 * rx_replay_counter)343*a1157835SDaniel Fojt static inline void wpa_sm_set_rx_replay_ctr(struct wpa_sm *sm,
344*a1157835SDaniel Fojt const u8 *rx_replay_counter)
3456d49e1aeSJan Lentfer {
3466d49e1aeSJan Lentfer }
3473ff40c12SJohn Marino
wpa_sm_set_ptk_kck_kek(struct wpa_sm * sm,const u8 * ptk_kck,size_t ptk_kck_len,const u8 * ptk_kek,size_t ptk_kek_len)348*a1157835SDaniel Fojt static inline void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, const u8 *ptk_kck,
349*a1157835SDaniel Fojt size_t ptk_kck_len,
350*a1157835SDaniel Fojt const u8 *ptk_kek, size_t ptk_kek_len)
351*a1157835SDaniel Fojt {
352*a1157835SDaniel Fojt }
353*a1157835SDaniel Fojt
wpa_fils_is_completed(struct wpa_sm * sm)354*a1157835SDaniel Fojt static inline int wpa_fils_is_completed(struct wpa_sm *sm)
3553ff40c12SJohn Marino {
3563ff40c12SJohn Marino return 0;
3573ff40c12SJohn Marino }
358*a1157835SDaniel Fojt
359*a1157835SDaniel Fojt #endif /* CONFIG_NO_WPA */
3606d49e1aeSJan Lentfer
3616d49e1aeSJan Lentfer #ifdef CONFIG_IEEE80211R
3626d49e1aeSJan Lentfer
3633ff40c12SJohn Marino int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len);
3643ff40c12SJohn Marino int wpa_ft_prepare_auth_request(struct wpa_sm *sm, const u8 *mdie);
365*a1157835SDaniel Fojt int wpa_ft_add_mdie(struct wpa_sm *sm, u8 *ies, size_t ies_len,
366*a1157835SDaniel Fojt const u8 *mdie);
367*a1157835SDaniel Fojt const u8 * wpa_sm_get_ft_md(struct wpa_sm *sm);
3686d49e1aeSJan Lentfer int wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
3693ff40c12SJohn Marino int ft_action, const u8 *target_ap,
3703ff40c12SJohn Marino const u8 *ric_ies, size_t ric_ies_len);
3716d49e1aeSJan Lentfer int wpa_ft_is_completed(struct wpa_sm *sm);
3723ff40c12SJohn Marino void wpa_reset_ft_completed(struct wpa_sm *sm);
3736d49e1aeSJan Lentfer int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
3746d49e1aeSJan Lentfer size_t ies_len, const u8 *src_addr);
3753ff40c12SJohn Marino int wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap,
3763ff40c12SJohn Marino const u8 *mdie);
3776d49e1aeSJan Lentfer
3786d49e1aeSJan Lentfer #else /* CONFIG_IEEE80211R */
3796d49e1aeSJan Lentfer
3806d49e1aeSJan Lentfer static inline int
wpa_sm_set_ft_params(struct wpa_sm * sm,const u8 * ies,size_t ies_len)3813ff40c12SJohn Marino wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len)
3826d49e1aeSJan Lentfer {
3836d49e1aeSJan Lentfer return 0;
3846d49e1aeSJan Lentfer }
3856d49e1aeSJan Lentfer
wpa_ft_prepare_auth_request(struct wpa_sm * sm,const u8 * mdie)3863ff40c12SJohn Marino static inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm,
3873ff40c12SJohn Marino const u8 *mdie)
3886d49e1aeSJan Lentfer {
3896d49e1aeSJan Lentfer return 0;
3906d49e1aeSJan Lentfer }
3916d49e1aeSJan Lentfer
wpa_ft_add_mdie(struct wpa_sm * sm,u8 * ies,size_t ies_len,const u8 * mdie)392*a1157835SDaniel Fojt static inline int wpa_ft_add_mdie(struct wpa_sm *sm, u8 *ies, size_t ies_len,
393*a1157835SDaniel Fojt const u8 *mdie)
394*a1157835SDaniel Fojt {
395*a1157835SDaniel Fojt return 0;
396*a1157835SDaniel Fojt }
397*a1157835SDaniel Fojt
3986d49e1aeSJan Lentfer static inline int
wpa_ft_process_response(struct wpa_sm * sm,const u8 * ies,size_t ies_len,int ft_action,const u8 * target_ap)3996d49e1aeSJan Lentfer wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
4006d49e1aeSJan Lentfer int ft_action, const u8 *target_ap)
4016d49e1aeSJan Lentfer {
4026d49e1aeSJan Lentfer return 0;
4036d49e1aeSJan Lentfer }
4046d49e1aeSJan Lentfer
wpa_ft_is_completed(struct wpa_sm * sm)4056d49e1aeSJan Lentfer static inline int wpa_ft_is_completed(struct wpa_sm *sm)
4066d49e1aeSJan Lentfer {
4076d49e1aeSJan Lentfer return 0;
4086d49e1aeSJan Lentfer }
4096d49e1aeSJan Lentfer
wpa_reset_ft_completed(struct wpa_sm * sm)4103ff40c12SJohn Marino static inline void wpa_reset_ft_completed(struct wpa_sm *sm)
4113ff40c12SJohn Marino {
4123ff40c12SJohn Marino }
4133ff40c12SJohn Marino
4146d49e1aeSJan Lentfer static inline int
wpa_ft_validate_reassoc_resp(struct wpa_sm * sm,const u8 * ies,size_t ies_len,const u8 * src_addr)4156d49e1aeSJan Lentfer wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
4166d49e1aeSJan Lentfer const u8 *src_addr)
4176d49e1aeSJan Lentfer {
4186d49e1aeSJan Lentfer return -1;
4196d49e1aeSJan Lentfer }
4206d49e1aeSJan Lentfer
4216d49e1aeSJan Lentfer #endif /* CONFIG_IEEE80211R */
4226d49e1aeSJan Lentfer
4233ff40c12SJohn Marino
4243ff40c12SJohn Marino /* tdls.c */
4253ff40c12SJohn Marino void wpa_tdls_ap_ies(struct wpa_sm *sm, const u8 *ies, size_t len);
4263ff40c12SJohn Marino void wpa_tdls_assoc_resp_ies(struct wpa_sm *sm, const u8 *ies, size_t len);
4273ff40c12SJohn Marino int wpa_tdls_start(struct wpa_sm *sm, const u8 *addr);
4283ff40c12SJohn Marino void wpa_tdls_remove(struct wpa_sm *sm, const u8 *addr);
4293ff40c12SJohn Marino int wpa_tdls_teardown_link(struct wpa_sm *sm, const u8 *addr, u16 reason_code);
4303ff40c12SJohn Marino int wpa_tdls_send_discovery_request(struct wpa_sm *sm, const u8 *addr);
4313ff40c12SJohn Marino int wpa_tdls_init(struct wpa_sm *sm);
4323ff40c12SJohn Marino void wpa_tdls_teardown_peers(struct wpa_sm *sm);
4333ff40c12SJohn Marino void wpa_tdls_deinit(struct wpa_sm *sm);
4343ff40c12SJohn Marino void wpa_tdls_enable(struct wpa_sm *sm, int enabled);
435*a1157835SDaniel Fojt void wpa_tdls_disable_unreachable_link(struct wpa_sm *sm, const u8 *addr);
4363ff40c12SJohn Marino const char * wpa_tdls_get_link_status(struct wpa_sm *sm, const u8 *addr);
4373ff40c12SJohn Marino int wpa_tdls_is_external_setup(struct wpa_sm *sm);
438*a1157835SDaniel Fojt int wpa_tdls_enable_chan_switch(struct wpa_sm *sm, const u8 *addr,
439*a1157835SDaniel Fojt u8 oper_class,
440*a1157835SDaniel Fojt struct hostapd_freq_params *freq_params);
441*a1157835SDaniel Fojt int wpa_tdls_disable_chan_switch(struct wpa_sm *sm, const u8 *addr);
442*a1157835SDaniel Fojt #ifdef CONFIG_TDLS_TESTING
443*a1157835SDaniel Fojt extern unsigned int tdls_testing;
444*a1157835SDaniel Fojt #endif /* CONFIG_TDLS_TESTING */
445*a1157835SDaniel Fojt
4463ff40c12SJohn Marino
4473ff40c12SJohn Marino int wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf);
448*a1157835SDaniel Fojt void wpa_sm_set_test_assoc_ie(struct wpa_sm *sm, struct wpabuf *buf);
449*a1157835SDaniel Fojt const u8 * wpa_sm_get_anonce(struct wpa_sm *sm);
450*a1157835SDaniel Fojt unsigned int wpa_sm_get_key_mgmt(struct wpa_sm *sm);
451*a1157835SDaniel Fojt
452*a1157835SDaniel Fojt struct wpabuf * fils_build_auth(struct wpa_sm *sm, int dh_group, const u8 *md);
453*a1157835SDaniel Fojt int fils_process_auth(struct wpa_sm *sm, const u8 *bssid, const u8 *data,
454*a1157835SDaniel Fojt size_t len);
455*a1157835SDaniel Fojt struct wpabuf * fils_build_assoc_req(struct wpa_sm *sm, const u8 **kek,
456*a1157835SDaniel Fojt size_t *kek_len, const u8 **snonce,
457*a1157835SDaniel Fojt const u8 **anonce,
458*a1157835SDaniel Fojt const struct wpabuf **hlp,
459*a1157835SDaniel Fojt unsigned int num_hlp);
460*a1157835SDaniel Fojt int fils_process_assoc_resp(struct wpa_sm *sm, const u8 *resp, size_t len);
461*a1157835SDaniel Fojt
462*a1157835SDaniel Fojt struct wpabuf * owe_build_assoc_req(struct wpa_sm *sm, u16 group);
463*a1157835SDaniel Fojt int owe_process_assoc_resp(struct wpa_sm *sm, const u8 *bssid,
464*a1157835SDaniel Fojt const u8 *resp_ies, size_t resp_ies_len);
465*a1157835SDaniel Fojt
466*a1157835SDaniel Fojt void wpa_sm_set_reset_fils_completed(struct wpa_sm *sm, int set);
467*a1157835SDaniel Fojt void wpa_sm_set_fils_cache_id(struct wpa_sm *sm, const u8 *fils_cache_id);
468*a1157835SDaniel Fojt void wpa_sm_set_dpp_z(struct wpa_sm *sm, const struct wpabuf *z);
4693ff40c12SJohn Marino
4706d49e1aeSJan Lentfer #endif /* WPA_H */
471