]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Add option for overriding scan result handler for a single scan
authorJouni Malinen <jouni.malinen@atheros.com>
Sun, 11 Apr 2010 16:53:31 +0000 (19:53 +0300)
committerJouni Malinen <j@w1.fi>
Sun, 11 Apr 2010 16:53:31 +0000 (19:53 +0300)
wpa_supplicant/events.c
wpa_supplicant/wpa_supplicant_i.h

index fa0dc9d9b2c8426b2691f3ba00fa5808b3fc0832..67a164afd7e812275a41369e257bf03bf3accb9f 100644 (file)
@@ -899,6 +899,13 @@ static void wpa_supplicant_event_scan_results(struct wpa_supplicant *wpa_s,
                return;
        }
 
+       if (wpa_s->scan_res_handler) {
+               wpa_s->scan_res_handler(wpa_s, scan_res);
+               wpa_s->scan_res_handler = NULL;
+               wpa_scan_results_free(scan_res);
+               return;
+       }
+
        /*
         * Don't post the results if this was the initial cached
         * and there were no results.
index 2ac882685de68f2c31ec503f1a4df43959534330..6465cb192a09fd4dc868aa30daee0b24c348f614 100644 (file)
@@ -33,6 +33,7 @@ struct wpa_supplicant;
 struct ibss_rsn;
 struct scan_info;
 struct wpa_bss;
+struct wpa_scan_results;
 
 /*
  * Forward declarations of private structures used within the ctrl_iface
@@ -343,6 +344,8 @@ struct wpa_supplicant {
                                          */
 #define WILDCARD_SSID_SCAN ((struct wpa_ssid *) 1)
 
+       void (*scan_res_handler)(struct wpa_supplicant *wpa_s,
+                                struct wpa_scan_results *scan_res);
        struct dl_list bss; /* struct wpa_bss::list */
        struct dl_list bss_id; /* struct wpa_bss::list_id */
        size_t num_bss;