Add SME support (separate authentication and association)
[mech_eap.git] / wpa_supplicant / wpa_supplicant_i.h
index a8fb6d2..ff012b9 100644 (file)
 
 #include "drivers/driver.h"
 
+extern const char *wpa_supplicant_version;
+extern const char *wpa_supplicant_license;
+#ifndef CONFIG_NO_STDOUT_DEBUG
+extern const char *wpa_supplicant_full_license1;
+extern const char *wpa_supplicant_full_license2;
+extern const char *wpa_supplicant_full_license3;
+extern const char *wpa_supplicant_full_license4;
+extern const char *wpa_supplicant_full_license5;
+#endif /* CONFIG_NO_STDOUT_DEBUG */
+
+extern struct wpa_driver_ops *wpa_supplicant_drivers[];
+
+
 struct wpa_scan_result;
 struct wpa_sm;
 struct wpa_supplicant;
+struct ibss_rsn;
 
 /*
  * Forward declarations of private structures used within the ctrl_iface
@@ -143,6 +157,11 @@ struct wpa_params {
         * wpa_debug_file_path - Path of debug file or %NULL to use stdout
         */
        const char *wpa_debug_file_path;
+
+       /**
+        * wpa_debug_syslog - Enable log output through syslog
+        */
+       int wpa_debug_syslog;
 };
 
 /**
@@ -156,6 +175,8 @@ struct wpa_global {
        struct wpa_params params;
        struct ctrl_iface_global_priv *ctrl_iface;
        struct ctrl_iface_dbus_priv *dbus_ctrl_iface;
+       void **drv_priv;
+       size_t drv_count;
 };
 
 
@@ -293,11 +314,11 @@ struct wpa_supplicant {
 
        struct wpa_ssid *prev_scan_ssid; /* previously scanned SSID;
                                          * NULL = not yet initialized (start
-                                         * with broadcast SSID)
-                                         * BROADCAST_SSID_SCAN = broadcast
+                                         * with wildcard SSID)
+                                         * WILDCARD_SSID_SCAN = wildcard
                                          * SSID was used in the previous scan
                                          */
-#define BROADCAST_SSID_SCAN ((struct wpa_ssid *) 1)
+#define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
 
        struct wpa_scan_results *scan_res;
 
@@ -330,14 +351,36 @@ struct wpa_supplicant {
                             * results without a new scan request; this is used
                             * to speed up the first association if the driver
                             * has already available scan results. */
+       int scan_runs; /* number of scan runs since WPS was started */
 
        struct wpa_client_mlme mlme;
-       int use_client_mlme;
-       int driver_4way_handshake;
+       unsigned int drv_flags;
+       int max_scan_ssids;
 
        int pending_mic_error_report;
        int pending_mic_error_pairwise;
        int mic_errors_seen; /* Michael MIC errors with the current PTK */
+
+       struct wps_context *wps;
+       int wps_success; /* WPS success event received */
+       int blacklist_cleared;
+
+       struct ibss_rsn *ibss_rsn;
+
+#ifdef CONFIG_SME
+       struct {
+               u8 ssid[32];
+               size_t ssid_len;
+               int freq;
+               u8 assoc_req_ie[80];
+               size_t assoc_req_ie_len;
+               int mfp;
+               int ft_used;
+               u8 mobility_domain[2];
+               u8 *ft_ies;
+               size_t ft_ies_len;
+       } sme;
+#endif /* CONFIG_SME */
 };
 
 
@@ -394,6 +437,8 @@ void wpa_supplicant_mark_disassoc(struct wpa_supplicant *wpa_s);
 static inline void * wpa_drv_init(struct wpa_supplicant *wpa_s,
                                  const char *ifname)
 {
+       if (wpa_s->driver->init2)
+               return wpa_s->driver->init2(wpa_s, ifname, wpa_s->global);
        if (wpa_s->driver->init) {
                return wpa_s->driver->init(wpa_s, ifname);
        }
@@ -460,6 +505,14 @@ static inline int wpa_drv_set_mode(struct wpa_supplicant *wpa_s, int mode)
        return 0;
 }
 
+static inline int wpa_drv_authenticate(struct wpa_supplicant *wpa_s,
+                                      struct wpa_driver_auth_params *params)
+{
+       if (wpa_s->driver->authenticate)
+               return wpa_s->driver->authenticate(wpa_s->drv_priv, params);
+       return -1;
+}
+
 static inline int wpa_drv_associate(struct wpa_supplicant *wpa_s,
                                    struct wpa_driver_associate_params *params)
 {
@@ -469,12 +522,15 @@ static inline int wpa_drv_associate(struct wpa_supplicant *wpa_s,
        return -1;
 }
 
-static inline int wpa_drv_scan(struct wpa_supplicant *wpa_s, const u8 *ssid,
-                              size_t ssid_len)
+static inline int wpa_drv_scan(struct wpa_supplicant *wpa_s,
+                              struct wpa_driver_scan_params *params)
 {
-       if (wpa_s->driver->scan) {
-               return wpa_s->driver->scan(wpa_s->drv_priv, ssid, ssid_len);
-       }
+       if (wpa_s->driver->scan2)
+               return wpa_s->driver->scan2(wpa_s->drv_priv, params);
+       if (wpa_s->driver->scan)
+               return wpa_s->driver->scan(wpa_s->drv_priv,
+                                          params->ssids[0].ssid,
+                                          params->ssids[0].ssid_len);
        return -1;
 }
 
@@ -674,6 +730,14 @@ static inline int wpa_drv_set_bssid(struct wpa_supplicant *wpa_s,
        return -1;
 }
 
+static inline int wpa_drv_set_country(struct wpa_supplicant *wpa_s,
+                                     const char *alpha2)
+{
+       if (wpa_s->driver->set_country)
+               return wpa_s->driver->set_country(wpa_s->drv_priv, alpha2);
+       return 0;
+}
+
 static inline int wpa_drv_send_mlme(struct wpa_supplicant *wpa_s,
                                    const u8 *data, size_t data_len)
 {