1e5b75505Sopenharmony_ci/* 2e5b75505Sopenharmony_ci * wpa_supplicant - WPA definitions 3e5b75505Sopenharmony_ci * Copyright (c) 2003-2015, 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 WPA_H 10e5b75505Sopenharmony_ci#define WPA_H 11e5b75505Sopenharmony_ci 12e5b75505Sopenharmony_ci#include "common/defs.h" 13e5b75505Sopenharmony_ci#include "common/eapol_common.h" 14e5b75505Sopenharmony_ci#include "common/wpa_common.h" 15e5b75505Sopenharmony_ci#include "common/ieee802_11_defs.h" 16e5b75505Sopenharmony_ci 17e5b75505Sopenharmony_cistruct wpa_sm; 18e5b75505Sopenharmony_cistruct eapol_sm; 19e5b75505Sopenharmony_cistruct wpa_config_blob; 20e5b75505Sopenharmony_cistruct hostapd_freq_params; 21e5b75505Sopenharmony_cistruct wpa_channel_info; 22e5b75505Sopenharmony_ci 23e5b75505Sopenharmony_cistruct wpa_sm_ctx { 24e5b75505Sopenharmony_ci void *ctx; /* pointer to arbitrary upper level context */ 25e5b75505Sopenharmony_ci void *msg_ctx; /* upper level context for wpa_msg() calls */ 26e5b75505Sopenharmony_ci 27e5b75505Sopenharmony_ci void (*set_state)(void *ctx, enum wpa_states state); 28e5b75505Sopenharmony_ci enum wpa_states (*get_state)(void *ctx); 29e5b75505Sopenharmony_ci void (*deauthenticate)(void * ctx, u16 reason_code); 30e5b75505Sopenharmony_ci int (*set_key)(void *ctx, enum wpa_alg alg, 31e5b75505Sopenharmony_ci const u8 *addr, int key_idx, int set_tx, 32e5b75505Sopenharmony_ci const u8 *seq, size_t seq_len, 33e5b75505Sopenharmony_ci const u8 *key, size_t key_len); 34e5b75505Sopenharmony_ci void * (*get_network_ctx)(void *ctx); 35e5b75505Sopenharmony_ci int (*get_bssid)(void *ctx, u8 *bssid); 36e5b75505Sopenharmony_ci int (*ether_send)(void *ctx, const u8 *dest, u16 proto, const u8 *buf, 37e5b75505Sopenharmony_ci size_t len); 38e5b75505Sopenharmony_ci int (*get_beacon_ie)(void *ctx); 39e5b75505Sopenharmony_ci void (*cancel_auth_timeout)(void *ctx); 40e5b75505Sopenharmony_ci u8 * (*alloc_eapol)(void *ctx, u8 type, const void *data, u16 data_len, 41e5b75505Sopenharmony_ci size_t *msg_len, void **data_pos); 42e5b75505Sopenharmony_ci int (*add_pmkid)(void *ctx, void *network_ctx, const u8 *bssid, 43e5b75505Sopenharmony_ci const u8 *pmkid, const u8 *fils_cache_id, 44e5b75505Sopenharmony_ci const u8 *pmk, size_t pmk_len); 45e5b75505Sopenharmony_ci int (*remove_pmkid)(void *ctx, void *network_ctx, const u8 *bssid, 46e5b75505Sopenharmony_ci const u8 *pmkid, const u8 *fils_cache_id); 47e5b75505Sopenharmony_ci void (*set_config_blob)(void *ctx, struct wpa_config_blob *blob); 48e5b75505Sopenharmony_ci const struct wpa_config_blob * (*get_config_blob)(void *ctx, 49e5b75505Sopenharmony_ci const char *name); 50e5b75505Sopenharmony_ci int (*mlme_setprotection)(void *ctx, const u8 *addr, 51e5b75505Sopenharmony_ci int protection_type, int key_type); 52e5b75505Sopenharmony_ci int (*update_ft_ies)(void *ctx, const u8 *md, const u8 *ies, 53e5b75505Sopenharmony_ci size_t ies_len); 54e5b75505Sopenharmony_ci int (*send_ft_action)(void *ctx, u8 action, const u8 *target_ap, 55e5b75505Sopenharmony_ci const u8 *ies, size_t ies_len); 56e5b75505Sopenharmony_ci int (*mark_authenticated)(void *ctx, const u8 *target_ap); 57e5b75505Sopenharmony_ci#ifdef CONFIG_TDLS 58e5b75505Sopenharmony_ci int (*tdls_get_capa)(void *ctx, int *tdls_supported, 59e5b75505Sopenharmony_ci int *tdls_ext_setup, int *tdls_chan_switch); 60e5b75505Sopenharmony_ci int (*send_tdls_mgmt)(void *ctx, const u8 *dst, 61e5b75505Sopenharmony_ci u8 action_code, u8 dialog_token, 62e5b75505Sopenharmony_ci u16 status_code, u32 peer_capab, 63e5b75505Sopenharmony_ci int initiator, const u8 *buf, size_t len); 64e5b75505Sopenharmony_ci int (*tdls_oper)(void *ctx, int oper, const u8 *peer); 65e5b75505Sopenharmony_ci int (*tdls_peer_addset)(void *ctx, const u8 *addr, int add, u16 aid, 66e5b75505Sopenharmony_ci u16 capability, const u8 *supp_rates, 67e5b75505Sopenharmony_ci size_t supp_rates_len, 68e5b75505Sopenharmony_ci const struct ieee80211_ht_capabilities *ht_capab, 69e5b75505Sopenharmony_ci const struct ieee80211_vht_capabilities *vht_capab, 70e5b75505Sopenharmony_ci u8 qosinfo, int wmm, const u8 *ext_capab, 71e5b75505Sopenharmony_ci size_t ext_capab_len, const u8 *supp_channels, 72e5b75505Sopenharmony_ci size_t supp_channels_len, 73e5b75505Sopenharmony_ci const u8 *supp_oper_classes, 74e5b75505Sopenharmony_ci size_t supp_oper_classes_len); 75e5b75505Sopenharmony_ci int (*tdls_enable_channel_switch)( 76e5b75505Sopenharmony_ci void *ctx, const u8 *addr, u8 oper_class, 77e5b75505Sopenharmony_ci const struct hostapd_freq_params *params); 78e5b75505Sopenharmony_ci int (*tdls_disable_channel_switch)(void *ctx, const u8 *addr); 79e5b75505Sopenharmony_ci#endif /* CONFIG_TDLS */ 80e5b75505Sopenharmony_ci void (*set_rekey_offload)(void *ctx, const u8 *kek, size_t kek_len, 81e5b75505Sopenharmony_ci const u8 *kck, size_t kck_len, 82e5b75505Sopenharmony_ci const u8 *replay_ctr); 83e5b75505Sopenharmony_ci int (*key_mgmt_set_pmk)(void *ctx, const u8 *pmk, size_t pmk_len); 84e5b75505Sopenharmony_ci void (*fils_hlp_rx)(void *ctx, const u8 *dst, const u8 *src, 85e5b75505Sopenharmony_ci const u8 *pkt, size_t pkt_len); 86e5b75505Sopenharmony_ci int (*channel_info)(void *ctx, struct wpa_channel_info *ci); 87e5b75505Sopenharmony_ci}; 88e5b75505Sopenharmony_ci 89e5b75505Sopenharmony_ci 90e5b75505Sopenharmony_cienum wpa_sm_conf_params { 91e5b75505Sopenharmony_ci RSNA_PMK_LIFETIME /* dot11RSNAConfigPMKLifetime */, 92e5b75505Sopenharmony_ci RSNA_PMK_REAUTH_THRESHOLD /* dot11RSNAConfigPMKReauthThreshold */, 93e5b75505Sopenharmony_ci RSNA_SA_TIMEOUT /* dot11RSNAConfigSATimeout */, 94e5b75505Sopenharmony_ci WPA_PARAM_PROTO, 95e5b75505Sopenharmony_ci WPA_PARAM_PAIRWISE, 96e5b75505Sopenharmony_ci WPA_PARAM_GROUP, 97e5b75505Sopenharmony_ci WPA_PARAM_KEY_MGMT, 98e5b75505Sopenharmony_ci WPA_PARAM_MGMT_GROUP, 99e5b75505Sopenharmony_ci WPA_PARAM_RSN_ENABLED, 100e5b75505Sopenharmony_ci WPA_PARAM_MFP, 101e5b75505Sopenharmony_ci WPA_PARAM_OCV 102e5b75505Sopenharmony_ci}; 103e5b75505Sopenharmony_ci 104e5b75505Sopenharmony_cistruct rsn_supp_config { 105e5b75505Sopenharmony_ci void *network_ctx; 106e5b75505Sopenharmony_ci int allowed_pairwise_cipher; /* bitfield of WPA_CIPHER_* */ 107e5b75505Sopenharmony_ci int proactive_key_caching; 108e5b75505Sopenharmony_ci int eap_workaround; 109e5b75505Sopenharmony_ci void *eap_conf_ctx; 110e5b75505Sopenharmony_ci const u8 *ssid; 111e5b75505Sopenharmony_ci size_t ssid_len; 112e5b75505Sopenharmony_ci int wpa_ptk_rekey; 113e5b75505Sopenharmony_ci int p2p; 114e5b75505Sopenharmony_ci int wpa_rsc_relaxation; 115e5b75505Sopenharmony_ci const u8 *fils_cache_id; 116e5b75505Sopenharmony_ci}; 117e5b75505Sopenharmony_ci 118e5b75505Sopenharmony_ci#ifndef CONFIG_NO_WPA 119e5b75505Sopenharmony_ci 120e5b75505Sopenharmony_cistruct wpa_sm * wpa_sm_init(struct wpa_sm_ctx *ctx); 121e5b75505Sopenharmony_civoid wpa_sm_deinit(struct wpa_sm *sm); 122e5b75505Sopenharmony_civoid wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid); 123e5b75505Sopenharmony_civoid wpa_sm_notify_disassoc(struct wpa_sm *sm); 124e5b75505Sopenharmony_civoid wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len, 125e5b75505Sopenharmony_ci const u8 *pmkid, const u8 *bssid); 126e5b75505Sopenharmony_civoid wpa_sm_set_pmk_from_pmksa(struct wpa_sm *sm); 127e5b75505Sopenharmony_civoid wpa_sm_set_fast_reauth(struct wpa_sm *sm, int fast_reauth); 128e5b75505Sopenharmony_civoid wpa_sm_set_scard_ctx(struct wpa_sm *sm, void *scard_ctx); 129e5b75505Sopenharmony_civoid wpa_sm_set_config(struct wpa_sm *sm, struct rsn_supp_config *config); 130e5b75505Sopenharmony_civoid wpa_sm_set_own_addr(struct wpa_sm *sm, const u8 *addr); 131e5b75505Sopenharmony_civoid wpa_sm_set_ifname(struct wpa_sm *sm, const char *ifname, 132e5b75505Sopenharmony_ci const char *bridge_ifname); 133e5b75505Sopenharmony_civoid wpa_sm_set_eapol(struct wpa_sm *sm, struct eapol_sm *eapol); 134e5b75505Sopenharmony_ciint wpa_sm_set_assoc_wpa_ie(struct wpa_sm *sm, const u8 *ie, size_t len); 135e5b75505Sopenharmony_ciint wpa_sm_set_assoc_wpa_ie_default(struct wpa_sm *sm, u8 *wpa_ie, 136e5b75505Sopenharmony_ci size_t *wpa_ie_len); 137e5b75505Sopenharmony_ciint wpa_sm_set_ap_wpa_ie(struct wpa_sm *sm, const u8 *ie, size_t len); 138e5b75505Sopenharmony_ciint wpa_sm_set_ap_rsn_ie(struct wpa_sm *sm, const u8 *ie, size_t len); 139e5b75505Sopenharmony_ciint wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen); 140e5b75505Sopenharmony_ci 141e5b75505Sopenharmony_ciint wpa_sm_set_param(struct wpa_sm *sm, enum wpa_sm_conf_params param, 142e5b75505Sopenharmony_ci unsigned int value); 143e5b75505Sopenharmony_ci 144e5b75505Sopenharmony_ciint wpa_sm_get_status(struct wpa_sm *sm, char *buf, size_t buflen, 145e5b75505Sopenharmony_ci int verbose); 146e5b75505Sopenharmony_ciint wpa_sm_pmf_enabled(struct wpa_sm *sm); 147e5b75505Sopenharmony_ciint wpa_sm_ocv_enabled(struct wpa_sm *sm); 148e5b75505Sopenharmony_ci 149e5b75505Sopenharmony_civoid wpa_sm_key_request(struct wpa_sm *sm, int error, int pairwise); 150e5b75505Sopenharmony_ci 151e5b75505Sopenharmony_ciint wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len, 152e5b75505Sopenharmony_ci struct wpa_ie_data *data); 153e5b75505Sopenharmony_ci 154e5b75505Sopenharmony_civoid wpa_sm_aborted_cached(struct wpa_sm *sm); 155e5b75505Sopenharmony_ciint wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr, 156e5b75505Sopenharmony_ci const u8 *buf, size_t len); 157e5b75505Sopenharmony_ciint wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data); 158e5b75505Sopenharmony_ciint wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len); 159e5b75505Sopenharmony_cistruct rsn_pmksa_cache_entry * wpa_sm_pmksa_cache_head(struct wpa_sm *sm); 160e5b75505Sopenharmony_cistruct rsn_pmksa_cache_entry * 161e5b75505Sopenharmony_ciwpa_sm_pmksa_cache_add_entry(struct wpa_sm *sm, 162e5b75505Sopenharmony_ci struct rsn_pmksa_cache_entry * entry); 163e5b75505Sopenharmony_civoid wpa_sm_pmksa_cache_add(struct wpa_sm *sm, const u8 *pmk, size_t pmk_len, 164e5b75505Sopenharmony_ci const u8 *pmkid, const u8 *bssid, 165e5b75505Sopenharmony_ci const u8 *fils_cache_id); 166e5b75505Sopenharmony_ciint wpa_sm_pmksa_exists(struct wpa_sm *sm, const u8 *bssid, 167e5b75505Sopenharmony_ci const void *network_ctx); 168e5b75505Sopenharmony_civoid wpa_sm_drop_sa(struct wpa_sm *sm); 169e5b75505Sopenharmony_ciint wpa_sm_has_ptk(struct wpa_sm *sm); 170e5b75505Sopenharmony_ci 171e5b75505Sopenharmony_civoid wpa_sm_update_replay_ctr(struct wpa_sm *sm, const u8 *replay_ctr); 172e5b75505Sopenharmony_ci 173e5b75505Sopenharmony_civoid wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, void *network_ctx); 174e5b75505Sopenharmony_ci 175e5b75505Sopenharmony_ciint wpa_sm_get_p2p_ip_addr(struct wpa_sm *sm, u8 *buf); 176e5b75505Sopenharmony_ci 177e5b75505Sopenharmony_civoid wpa_sm_set_rx_replay_ctr(struct wpa_sm *sm, const u8 *rx_replay_counter); 178e5b75505Sopenharmony_civoid wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, 179e5b75505Sopenharmony_ci const u8 *ptk_kck, size_t ptk_kck_len, 180e5b75505Sopenharmony_ci const u8 *ptk_kek, size_t ptk_kek_len); 181e5b75505Sopenharmony_ciint wpa_fils_is_completed(struct wpa_sm *sm); 182e5b75505Sopenharmony_ci 183e5b75505Sopenharmony_ci#else /* CONFIG_NO_WPA */ 184e5b75505Sopenharmony_ci 185e5b75505Sopenharmony_cistatic inline struct wpa_sm * wpa_sm_init(struct wpa_sm_ctx *ctx) 186e5b75505Sopenharmony_ci{ 187e5b75505Sopenharmony_ci return (struct wpa_sm *) 1; 188e5b75505Sopenharmony_ci} 189e5b75505Sopenharmony_ci 190e5b75505Sopenharmony_cistatic inline void wpa_sm_deinit(struct wpa_sm *sm) 191e5b75505Sopenharmony_ci{ 192e5b75505Sopenharmony_ci} 193e5b75505Sopenharmony_ci 194e5b75505Sopenharmony_cistatic inline void wpa_sm_notify_assoc(struct wpa_sm *sm, const u8 *bssid) 195e5b75505Sopenharmony_ci{ 196e5b75505Sopenharmony_ci} 197e5b75505Sopenharmony_ci 198e5b75505Sopenharmony_cistatic inline void wpa_sm_notify_disassoc(struct wpa_sm *sm) 199e5b75505Sopenharmony_ci{ 200e5b75505Sopenharmony_ci} 201e5b75505Sopenharmony_ci 202e5b75505Sopenharmony_cistatic inline void wpa_sm_set_pmk(struct wpa_sm *sm, const u8 *pmk, 203e5b75505Sopenharmony_ci size_t pmk_len, const u8 *pmkid, 204e5b75505Sopenharmony_ci const u8 *bssid) 205e5b75505Sopenharmony_ci{ 206e5b75505Sopenharmony_ci} 207e5b75505Sopenharmony_ci 208e5b75505Sopenharmony_cistatic inline void wpa_sm_set_pmk_from_pmksa(struct wpa_sm *sm) 209e5b75505Sopenharmony_ci{ 210e5b75505Sopenharmony_ci} 211e5b75505Sopenharmony_ci 212e5b75505Sopenharmony_cistatic inline void wpa_sm_set_fast_reauth(struct wpa_sm *sm, int fast_reauth) 213e5b75505Sopenharmony_ci{ 214e5b75505Sopenharmony_ci} 215e5b75505Sopenharmony_ci 216e5b75505Sopenharmony_cistatic inline void wpa_sm_set_scard_ctx(struct wpa_sm *sm, void *scard_ctx) 217e5b75505Sopenharmony_ci{ 218e5b75505Sopenharmony_ci} 219e5b75505Sopenharmony_ci 220e5b75505Sopenharmony_cistatic inline void wpa_sm_set_config(struct wpa_sm *sm, 221e5b75505Sopenharmony_ci struct rsn_supp_config *config) 222e5b75505Sopenharmony_ci{ 223e5b75505Sopenharmony_ci} 224e5b75505Sopenharmony_ci 225e5b75505Sopenharmony_cistatic inline void wpa_sm_set_own_addr(struct wpa_sm *sm, const u8 *addr) 226e5b75505Sopenharmony_ci{ 227e5b75505Sopenharmony_ci} 228e5b75505Sopenharmony_ci 229e5b75505Sopenharmony_cistatic inline void wpa_sm_set_ifname(struct wpa_sm *sm, const char *ifname, 230e5b75505Sopenharmony_ci const char *bridge_ifname) 231e5b75505Sopenharmony_ci{ 232e5b75505Sopenharmony_ci} 233e5b75505Sopenharmony_ci 234e5b75505Sopenharmony_cistatic inline void wpa_sm_set_eapol(struct wpa_sm *sm, struct eapol_sm *eapol) 235e5b75505Sopenharmony_ci{ 236e5b75505Sopenharmony_ci} 237e5b75505Sopenharmony_ci 238e5b75505Sopenharmony_cistatic inline int wpa_sm_set_assoc_wpa_ie(struct wpa_sm *sm, const u8 *ie, 239e5b75505Sopenharmony_ci size_t len) 240e5b75505Sopenharmony_ci{ 241e5b75505Sopenharmony_ci return -1; 242e5b75505Sopenharmony_ci} 243e5b75505Sopenharmony_ci 244e5b75505Sopenharmony_cistatic inline int wpa_sm_set_assoc_wpa_ie_default(struct wpa_sm *sm, 245e5b75505Sopenharmony_ci u8 *wpa_ie, 246e5b75505Sopenharmony_ci size_t *wpa_ie_len) 247e5b75505Sopenharmony_ci{ 248e5b75505Sopenharmony_ci return -1; 249e5b75505Sopenharmony_ci} 250e5b75505Sopenharmony_ci 251e5b75505Sopenharmony_cistatic inline int wpa_sm_set_ap_wpa_ie(struct wpa_sm *sm, const u8 *ie, 252e5b75505Sopenharmony_ci size_t len) 253e5b75505Sopenharmony_ci{ 254e5b75505Sopenharmony_ci return -1; 255e5b75505Sopenharmony_ci} 256e5b75505Sopenharmony_ci 257e5b75505Sopenharmony_cistatic inline int wpa_sm_set_ap_rsn_ie(struct wpa_sm *sm, const u8 *ie, 258e5b75505Sopenharmony_ci size_t len) 259e5b75505Sopenharmony_ci{ 260e5b75505Sopenharmony_ci return -1; 261e5b75505Sopenharmony_ci} 262e5b75505Sopenharmony_ci 263e5b75505Sopenharmony_cistatic inline int wpa_sm_get_mib(struct wpa_sm *sm, char *buf, size_t buflen) 264e5b75505Sopenharmony_ci{ 265e5b75505Sopenharmony_ci return 0; 266e5b75505Sopenharmony_ci} 267e5b75505Sopenharmony_ci 268e5b75505Sopenharmony_cistatic inline int wpa_sm_set_param(struct wpa_sm *sm, 269e5b75505Sopenharmony_ci enum wpa_sm_conf_params param, 270e5b75505Sopenharmony_ci unsigned int value) 271e5b75505Sopenharmony_ci{ 272e5b75505Sopenharmony_ci return -1; 273e5b75505Sopenharmony_ci} 274e5b75505Sopenharmony_ci 275e5b75505Sopenharmony_cistatic inline int wpa_sm_get_status(struct wpa_sm *sm, char *buf, 276e5b75505Sopenharmony_ci size_t buflen, int verbose) 277e5b75505Sopenharmony_ci{ 278e5b75505Sopenharmony_ci return 0; 279e5b75505Sopenharmony_ci} 280e5b75505Sopenharmony_ci 281e5b75505Sopenharmony_cistatic inline int wpa_sm_pmf_enabled(struct wpa_sm *sm) 282e5b75505Sopenharmony_ci{ 283e5b75505Sopenharmony_ci return 0; 284e5b75505Sopenharmony_ci} 285e5b75505Sopenharmony_ci 286e5b75505Sopenharmony_cistatic inline int wpa_sm_ocv_enabled(struct wpa_sm *sm) 287e5b75505Sopenharmony_ci{ 288e5b75505Sopenharmony_ci return 0; 289e5b75505Sopenharmony_ci} 290e5b75505Sopenharmony_ci 291e5b75505Sopenharmony_cistatic inline void wpa_sm_key_request(struct wpa_sm *sm, int error, 292e5b75505Sopenharmony_ci int pairwise) 293e5b75505Sopenharmony_ci{ 294e5b75505Sopenharmony_ci} 295e5b75505Sopenharmony_ci 296e5b75505Sopenharmony_cistatic inline int wpa_parse_wpa_ie(const u8 *wpa_ie, size_t wpa_ie_len, 297e5b75505Sopenharmony_ci struct wpa_ie_data *data) 298e5b75505Sopenharmony_ci{ 299e5b75505Sopenharmony_ci return -1; 300e5b75505Sopenharmony_ci} 301e5b75505Sopenharmony_ci 302e5b75505Sopenharmony_cistatic inline void wpa_sm_aborted_cached(struct wpa_sm *sm) 303e5b75505Sopenharmony_ci{ 304e5b75505Sopenharmony_ci} 305e5b75505Sopenharmony_ci 306e5b75505Sopenharmony_cistatic inline int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr, 307e5b75505Sopenharmony_ci const u8 *buf, size_t len) 308e5b75505Sopenharmony_ci{ 309e5b75505Sopenharmony_ci return -1; 310e5b75505Sopenharmony_ci} 311e5b75505Sopenharmony_ci 312e5b75505Sopenharmony_cistatic inline int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, 313e5b75505Sopenharmony_ci struct wpa_ie_data *data) 314e5b75505Sopenharmony_ci{ 315e5b75505Sopenharmony_ci return -1; 316e5b75505Sopenharmony_ci} 317e5b75505Sopenharmony_ci 318e5b75505Sopenharmony_cistatic inline int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, 319e5b75505Sopenharmony_ci size_t len) 320e5b75505Sopenharmony_ci{ 321e5b75505Sopenharmony_ci return -1; 322e5b75505Sopenharmony_ci} 323e5b75505Sopenharmony_ci 324e5b75505Sopenharmony_cistatic inline void wpa_sm_drop_sa(struct wpa_sm *sm) 325e5b75505Sopenharmony_ci{ 326e5b75505Sopenharmony_ci} 327e5b75505Sopenharmony_ci 328e5b75505Sopenharmony_cistatic inline int wpa_sm_has_ptk(struct wpa_sm *sm) 329e5b75505Sopenharmony_ci{ 330e5b75505Sopenharmony_ci return 0; 331e5b75505Sopenharmony_ci} 332e5b75505Sopenharmony_ci 333e5b75505Sopenharmony_cistatic inline void wpa_sm_update_replay_ctr(struct wpa_sm *sm, 334e5b75505Sopenharmony_ci const u8 *replay_ctr) 335e5b75505Sopenharmony_ci{ 336e5b75505Sopenharmony_ci} 337e5b75505Sopenharmony_ci 338e5b75505Sopenharmony_cistatic inline void wpa_sm_pmksa_cache_flush(struct wpa_sm *sm, 339e5b75505Sopenharmony_ci void *network_ctx) 340e5b75505Sopenharmony_ci{ 341e5b75505Sopenharmony_ci} 342e5b75505Sopenharmony_ci 343e5b75505Sopenharmony_cistatic inline void wpa_sm_set_rx_replay_ctr(struct wpa_sm *sm, 344e5b75505Sopenharmony_ci const u8 *rx_replay_counter) 345e5b75505Sopenharmony_ci{ 346e5b75505Sopenharmony_ci} 347e5b75505Sopenharmony_ci 348e5b75505Sopenharmony_cistatic inline void wpa_sm_set_ptk_kck_kek(struct wpa_sm *sm, const u8 *ptk_kck, 349e5b75505Sopenharmony_ci size_t ptk_kck_len, 350e5b75505Sopenharmony_ci const u8 *ptk_kek, size_t ptk_kek_len) 351e5b75505Sopenharmony_ci{ 352e5b75505Sopenharmony_ci} 353e5b75505Sopenharmony_ci 354e5b75505Sopenharmony_cistatic inline int wpa_fils_is_completed(struct wpa_sm *sm) 355e5b75505Sopenharmony_ci{ 356e5b75505Sopenharmony_ci return 0; 357e5b75505Sopenharmony_ci} 358e5b75505Sopenharmony_ci 359e5b75505Sopenharmony_ci#endif /* CONFIG_NO_WPA */ 360e5b75505Sopenharmony_ci 361e5b75505Sopenharmony_ci#ifdef CONFIG_IEEE80211R 362e5b75505Sopenharmony_ci 363e5b75505Sopenharmony_ciint wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len); 364e5b75505Sopenharmony_ciint wpa_ft_prepare_auth_request(struct wpa_sm *sm, const u8 *mdie); 365e5b75505Sopenharmony_ciint wpa_ft_add_mdie(struct wpa_sm *sm, u8 *ies, size_t ies_len, 366e5b75505Sopenharmony_ci const u8 *mdie); 367e5b75505Sopenharmony_ciconst u8 * wpa_sm_get_ft_md(struct wpa_sm *sm); 368e5b75505Sopenharmony_ciint wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len, 369e5b75505Sopenharmony_ci int ft_action, const u8 *target_ap, 370e5b75505Sopenharmony_ci const u8 *ric_ies, size_t ric_ies_len); 371e5b75505Sopenharmony_ciint wpa_ft_is_completed(struct wpa_sm *sm); 372e5b75505Sopenharmony_civoid wpa_reset_ft_completed(struct wpa_sm *sm); 373e5b75505Sopenharmony_ciint wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies, 374e5b75505Sopenharmony_ci size_t ies_len, const u8 *src_addr); 375e5b75505Sopenharmony_ciint wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap, 376e5b75505Sopenharmony_ci const u8 *mdie); 377e5b75505Sopenharmony_ci 378e5b75505Sopenharmony_ci#else /* CONFIG_IEEE80211R */ 379e5b75505Sopenharmony_ci 380e5b75505Sopenharmony_cistatic inline int 381e5b75505Sopenharmony_ciwpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len) 382e5b75505Sopenharmony_ci{ 383e5b75505Sopenharmony_ci return 0; 384e5b75505Sopenharmony_ci} 385e5b75505Sopenharmony_ci 386e5b75505Sopenharmony_cistatic inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm, 387e5b75505Sopenharmony_ci const u8 *mdie) 388e5b75505Sopenharmony_ci{ 389e5b75505Sopenharmony_ci return 0; 390e5b75505Sopenharmony_ci} 391e5b75505Sopenharmony_ci 392e5b75505Sopenharmony_cistatic inline int wpa_ft_add_mdie(struct wpa_sm *sm, u8 *ies, size_t ies_len, 393e5b75505Sopenharmony_ci const u8 *mdie) 394e5b75505Sopenharmony_ci{ 395e5b75505Sopenharmony_ci return 0; 396e5b75505Sopenharmony_ci} 397e5b75505Sopenharmony_ci 398e5b75505Sopenharmony_cistatic inline int 399e5b75505Sopenharmony_ciwpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len, 400e5b75505Sopenharmony_ci int ft_action, const u8 *target_ap) 401e5b75505Sopenharmony_ci{ 402e5b75505Sopenharmony_ci return 0; 403e5b75505Sopenharmony_ci} 404e5b75505Sopenharmony_ci 405e5b75505Sopenharmony_cistatic inline int wpa_ft_is_completed(struct wpa_sm *sm) 406e5b75505Sopenharmony_ci{ 407e5b75505Sopenharmony_ci return 0; 408e5b75505Sopenharmony_ci} 409e5b75505Sopenharmony_ci 410e5b75505Sopenharmony_cistatic inline void wpa_reset_ft_completed(struct wpa_sm *sm) 411e5b75505Sopenharmony_ci{ 412e5b75505Sopenharmony_ci} 413e5b75505Sopenharmony_ci 414e5b75505Sopenharmony_cistatic inline int 415e5b75505Sopenharmony_ciwpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies, size_t ies_len, 416e5b75505Sopenharmony_ci const u8 *src_addr) 417e5b75505Sopenharmony_ci{ 418e5b75505Sopenharmony_ci return -1; 419e5b75505Sopenharmony_ci} 420e5b75505Sopenharmony_ci 421e5b75505Sopenharmony_ci#endif /* CONFIG_IEEE80211R */ 422e5b75505Sopenharmony_ci 423e5b75505Sopenharmony_ci 424e5b75505Sopenharmony_ci/* tdls.c */ 425e5b75505Sopenharmony_civoid wpa_tdls_ap_ies(struct wpa_sm *sm, const u8 *ies, size_t len); 426e5b75505Sopenharmony_civoid wpa_tdls_assoc_resp_ies(struct wpa_sm *sm, const u8 *ies, size_t len); 427e5b75505Sopenharmony_ciint wpa_tdls_start(struct wpa_sm *sm, const u8 *addr); 428e5b75505Sopenharmony_civoid wpa_tdls_remove(struct wpa_sm *sm, const u8 *addr); 429e5b75505Sopenharmony_ciint wpa_tdls_teardown_link(struct wpa_sm *sm, const u8 *addr, u16 reason_code); 430e5b75505Sopenharmony_ciint wpa_tdls_send_discovery_request(struct wpa_sm *sm, const u8 *addr); 431e5b75505Sopenharmony_ciint wpa_tdls_init(struct wpa_sm *sm); 432e5b75505Sopenharmony_civoid wpa_tdls_teardown_peers(struct wpa_sm *sm); 433e5b75505Sopenharmony_civoid wpa_tdls_deinit(struct wpa_sm *sm); 434e5b75505Sopenharmony_civoid wpa_tdls_enable(struct wpa_sm *sm, int enabled); 435e5b75505Sopenharmony_civoid wpa_tdls_disable_unreachable_link(struct wpa_sm *sm, const u8 *addr); 436e5b75505Sopenharmony_ciconst char * wpa_tdls_get_link_status(struct wpa_sm *sm, const u8 *addr); 437e5b75505Sopenharmony_ciint wpa_tdls_is_external_setup(struct wpa_sm *sm); 438e5b75505Sopenharmony_ciint wpa_tdls_enable_chan_switch(struct wpa_sm *sm, const u8 *addr, 439e5b75505Sopenharmony_ci u8 oper_class, 440e5b75505Sopenharmony_ci struct hostapd_freq_params *freq_params); 441e5b75505Sopenharmony_ciint wpa_tdls_disable_chan_switch(struct wpa_sm *sm, const u8 *addr); 442e5b75505Sopenharmony_ci#ifdef CONFIG_TDLS_TESTING 443e5b75505Sopenharmony_ciextern unsigned int tdls_testing; 444e5b75505Sopenharmony_ci#endif /* CONFIG_TDLS_TESTING */ 445e5b75505Sopenharmony_ci 446e5b75505Sopenharmony_ci 447e5b75505Sopenharmony_ciint wpa_wnmsleep_install_key(struct wpa_sm *sm, u8 subelem_id, u8 *buf); 448e5b75505Sopenharmony_civoid wpa_sm_set_test_assoc_ie(struct wpa_sm *sm, struct wpabuf *buf); 449e5b75505Sopenharmony_ciconst u8 * wpa_sm_get_anonce(struct wpa_sm *sm); 450e5b75505Sopenharmony_ciunsigned int wpa_sm_get_key_mgmt(struct wpa_sm *sm); 451e5b75505Sopenharmony_ci 452e5b75505Sopenharmony_cistruct wpabuf * fils_build_auth(struct wpa_sm *sm, int dh_group, const u8 *md); 453e5b75505Sopenharmony_ciint fils_process_auth(struct wpa_sm *sm, const u8 *bssid, const u8 *data, 454e5b75505Sopenharmony_ci size_t len); 455e5b75505Sopenharmony_cistruct wpabuf * fils_build_assoc_req(struct wpa_sm *sm, const u8 **kek, 456e5b75505Sopenharmony_ci size_t *kek_len, const u8 **snonce, 457e5b75505Sopenharmony_ci const u8 **anonce, 458e5b75505Sopenharmony_ci const struct wpabuf **hlp, 459e5b75505Sopenharmony_ci unsigned int num_hlp); 460e5b75505Sopenharmony_ciint fils_process_assoc_resp(struct wpa_sm *sm, const u8 *resp, size_t len); 461e5b75505Sopenharmony_ci 462e5b75505Sopenharmony_cistruct wpabuf * owe_build_assoc_req(struct wpa_sm *sm, u16 group); 463e5b75505Sopenharmony_ciint owe_process_assoc_resp(struct wpa_sm *sm, const u8 *bssid, 464e5b75505Sopenharmony_ci const u8 *resp_ies, size_t resp_ies_len); 465e5b75505Sopenharmony_ci 466e5b75505Sopenharmony_civoid wpa_sm_set_reset_fils_completed(struct wpa_sm *sm, int set); 467e5b75505Sopenharmony_civoid wpa_sm_set_fils_cache_id(struct wpa_sm *sm, const u8 *fils_cache_id); 468e5b75505Sopenharmony_civoid wpa_sm_set_dpp_z(struct wpa_sm *sm, const struct wpabuf *z); 469e5b75505Sopenharmony_ci 470e5b75505Sopenharmony_ci#endif /* WPA_H */ 471