19
#include "eapol_common.h"
20
#include "wpa_common.h"
23
#define ETH_P_EAPOL 0x888e
26
#ifndef ETH_P_RSN_PREAUTH
27
#define ETH_P_RSN_PREAUTH 0x88c7
18
#include "common/defs.h"
19
#include "common/eapol_common.h"
20
#include "common/wpa_common.h"
34
26
struct wpa_sm_ctx {
35
27
void *ctx; /* pointer to arbitrary upper level context */
28
void *msg_ctx; /* upper level context for wpa_msg() calls */
37
void (*set_state)(void *ctx, wpa_states state);
38
wpa_states (*get_state)(void *ctx);
30
void (*set_state)(void *ctx, enum wpa_states state);
31
enum wpa_states (*get_state)(void *ctx);
39
32
void (*deauthenticate)(void * ctx, int reason_code);
40
33
void (*disassociate)(void *ctx, int reason_code);
41
int (*set_key)(void *ctx, wpa_alg alg,
34
int (*set_key)(void *ctx, enum wpa_alg alg,
42
35
const u8 *addr, int key_idx, int set_tx,
43
36
const u8 *seq, size_t seq_len,
44
37
const u8 *key, size_t key_len);
62
55
int (*send_ft_action)(void *ctx, u8 action, const u8 *target_ap,
63
56
const u8 *ies, size_t ies_len);
57
int (*mark_authenticated)(void *ctx, const u8 *target_ap);
127
122
int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
128
123
const u8 *buf, size_t len);
129
124
int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data);
125
int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
126
void wpa_sm_drop_sa(struct wpa_sm *sm);
127
int wpa_sm_has_ptk(struct wpa_sm *sm);
131
129
#else /* CONFIG_NO_WPA */
259
static inline int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf,
265
static inline void wpa_sm_drop_sa(struct wpa_sm *sm)
269
static inline int wpa_sm_has_ptk(struct wpa_sm *sm)
261
274
#endif /* CONFIG_NO_WPA */
263
276
#ifdef CONFIG_PEERKEY
272
285
#ifdef CONFIG_IEEE80211R
274
int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *mobility_domain,
275
const u8 *r0kh_id, size_t r0kh_id_len,
277
int wpa_ft_prepare_auth_request(struct wpa_sm *sm);
287
int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len);
288
int wpa_ft_prepare_auth_request(struct wpa_sm *sm, const u8 *mdie);
278
289
int wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
279
int ft_action, const u8 *target_ap);
290
int ft_action, const u8 *target_ap,
291
const u8 *ric_ies, size_t ric_ies_len);
280
292
int wpa_ft_is_completed(struct wpa_sm *sm);
281
293
int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
282
294
size_t ies_len, const u8 *src_addr);
283
int wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap);
295
int wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap,
285
298
#else /* CONFIG_IEEE80211R */
287
300
static inline int
288
wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *mobility_domain,
289
const u8 *r0kh_id, const u8 *r1kh_id)
301
wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len)
294
static inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm)
306
static inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm,