FT: Clean up wpa_sm_set_ft_params() by using common parse
[libeap.git] / src / rsn_supp / wpa.h
index bdf7785..72bf8f4 100644 (file)
 #ifndef WPA_H
 #define WPA_H
 
-#include "defs.h"
-#include "eapol_common.h"
-#include "wpa_common.h"
-
-#ifndef ETH_P_EAPOL
-#define ETH_P_EAPOL 0x888e
-#endif
-
-#ifndef ETH_P_RSN_PREAUTH
-#define ETH_P_RSN_PREAUTH 0x88c7
-#endif
+#include "common/defs.h"
+#include "common/eapol_common.h"
+#include "common/wpa_common.h"
 
 struct wpa_sm;
 struct eapol_sm;
@@ -33,12 +25,13 @@ struct wpa_config_blob;
 
 struct wpa_sm_ctx {
        void *ctx; /* pointer to arbitrary upper level context */
+       void *msg_ctx; /* upper level context for wpa_msg() calls */
 
-       void (*set_state)(void *ctx, wpa_states state);
-       wpa_states (*get_state)(void *ctx);
+       void (*set_state)(void *ctx, enum wpa_states state);
+       enum wpa_states (*get_state)(void *ctx);
        void (*deauthenticate)(void * ctx, int reason_code); 
        void (*disassociate)(void *ctx, int reason_code);
-       int (*set_key)(void *ctx, wpa_alg alg,
+       int (*set_key)(void *ctx, enum wpa_alg alg,
                       const u8 *addr, int key_idx, int set_tx,
                       const u8 *seq, size_t seq_len,
                       const u8 *key, size_t key_len);
@@ -61,6 +54,7 @@ struct wpa_sm_ctx {
                             size_t ies_len);
        int (*send_ft_action)(void *ctx, u8 action, const u8 *target_ap,
                              const u8 *ies, size_t ies_len);
+       int (*mark_authenticated)(void *ctx, const u8 *target_ap);
 };
 
 
@@ -73,7 +67,8 @@ enum wpa_sm_conf_params {
        WPA_PARAM_GROUP,
        WPA_PARAM_KEY_MGMT,
        WPA_PARAM_MGMT_GROUP,
-       WPA_PARAM_RSN_ENABLED
+       WPA_PARAM_RSN_ENABLED,
+       WPA_PARAM_MFP
 };
 
 struct rsn_supp_config {
@@ -127,6 +122,8 @@ void wpa_sm_aborted_cached(struct wpa_sm *sm);
 int wpa_sm_rx_eapol(struct wpa_sm *sm, const u8 *src_addr,
                    const u8 *buf, size_t len);
 int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm, struct wpa_ie_data *data);
+int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf, size_t len);
+void wpa_sm_drop_sa(struct wpa_sm *sm);
 
 #else /* CONFIG_NO_WPA */
 
@@ -258,6 +255,16 @@ static inline int wpa_sm_parse_own_wpa_ie(struct wpa_sm *sm,
        return -1;
 }
 
+static inline int wpa_sm_pmksa_cache_list(struct wpa_sm *sm, char *buf,
+                                         size_t len)
+{
+       return -1;
+}
+
+static inline void wpa_sm_drop_sa(struct wpa_sm *sm)
+{
+}
+
 #endif /* CONFIG_NO_WPA */
 
 #ifdef CONFIG_PEERKEY
@@ -271,16 +278,16 @@ static inline int wpa_sm_stkstart(struct wpa_sm *sm, const u8 *peer)
 
 #ifdef CONFIG_IEEE80211R
 
-int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *mobility_domain,
-                        const u8 *r0kh_id, size_t r0kh_id_len,
-                        const u8 *r1kh_id);
-int wpa_ft_prepare_auth_request(struct wpa_sm *sm);
+int wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *ies, size_t ies_len);
+int wpa_ft_prepare_auth_request(struct wpa_sm *sm, const u8 *mdie);
 int wpa_ft_process_response(struct wpa_sm *sm, const u8 *ies, size_t ies_len,
-                           int ft_action, const u8 *target_ap);
+                           int ft_action, const u8 *target_ap,
+                           const u8 *ric_ies, size_t ric_ies_len);
 int wpa_ft_is_completed(struct wpa_sm *sm);
 int wpa_ft_validate_reassoc_resp(struct wpa_sm *sm, const u8 *ies,
                                 size_t ies_len, const u8 *src_addr);
-int wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap);
+int wpa_ft_start_over_ds(struct wpa_sm *sm, const u8 *target_ap,
+                        const u8 *mdie);
 
 #else /* CONFIG_IEEE80211R */
 
@@ -291,7 +298,8 @@ wpa_sm_set_ft_params(struct wpa_sm *sm, const u8 *mobility_domain,
        return 0;
 }
 
-static inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm)
+static inline int wpa_ft_prepare_auth_request(struct wpa_sm *sm,
+                                             const u8 *mdie)
 {
        return 0;
 }