]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Interworking: Allow ANT to be configured for Probe Request frames
authorJouni Malinen <jouni@qca.qualcomm.com>
Fri, 21 Oct 2011 09:44:29 +0000 (12:44 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 21 Oct 2011 09:44:29 +0000 (12:44 +0300)
Access Network Type can now be configured (default: 15 = wildcard) to
limit which APs reply to the scan.

wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/scan.c

index ff054c2d7832544bd80b880e946f63a8ba14e85f..b446a3f44413837e756c2991f0448d8730e7dfb5 100644 (file)
@@ -2200,6 +2200,7 @@ struct wpa_config * wpa_config_alloc_empty(const char *ctrl_interface,
        config->bss_expiration_age = DEFAULT_BSS_EXPIRATION_AGE;
        config->bss_expiration_scan_count = DEFAULT_BSS_EXPIRATION_SCAN_COUNT;
        config->max_num_sta = DEFAULT_MAX_NUM_STA;
+       config->access_network_type = DEFAULT_ACCESS_NETWORK_TYPE;
 
        if (ctrl_interface)
                config->ctrl_interface = os_strdup(ctrl_interface);
@@ -2494,7 +2495,8 @@ static const struct global_parse_data global_fields[] = {
        { STR(home_imsi), 0 },
        { STR(home_milenage), 0 },
        { INT_RANGE(interworking, 0, 1), 0 },
-       { FUNC(hessid), 0 }
+       { FUNC(hessid), 0 },
+       { INT_RANGE(access_network_type, 0, 15), 0 }
 };
 
 #undef FUNC
index 3741b9b716ab80dc8d9834d64dcf79bbc4b40f71..ae496ff544a3b5d38089ab12fd5ae2c36a67820d 100644 (file)
@@ -28,6 +28,7 @@
 #define DEFAULT_BSS_EXPIRATION_AGE 180
 #define DEFAULT_BSS_EXPIRATION_SCAN_COUNT 2
 #define DEFAULT_MAX_NUM_STA 128
+#define DEFAULT_ACCESS_NETWORK_TYPE 15
 
 #include "config_ssid.h"
 #include "wps/wps.h"
@@ -432,6 +433,15 @@ struct wpa_config {
         */
        int interworking;
 
+       /**
+        * access_network_type - Access Network Type
+        *
+        * When Interworking is enabled, scans will be limited to APs that
+        * advertise the specified Access Network Type (0..15; with 15
+        * indicating wildcard match).
+        */
+       int access_network_type;
+
        /**
         * hessid - Homogenous ESS identifier
         *
index 6c3aa9c378f5933f1d275ab7f513d6828e2effb7..ee8b45150e8d89c7f1fb602131a41c0e0b020ddb 100644 (file)
@@ -720,6 +720,9 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
                fprintf(f, "interworking=%u\n", config->interworking);
        if (!is_zero_ether_addr(config->hessid))
                fprintf(f, "hessid=" MACSTR "\n", MAC2STR(config->hessid));
+       if (config->access_network_type != DEFAULT_ACCESS_NETWORK_TYPE)
+               fprintf(f, "access_network_type=%d\n",
+                       config->access_network_type);
 #endif /* CONFIG_INTERWORKING */
 }
 
index 2d3a38f92e7299e5a396cd1f93e4009725ad9a57..fab43f1ee7f5353507e597274d44d3cb575dd503 100644 (file)
@@ -371,7 +371,7 @@ static void wpas_add_interworking_elements(struct wpa_supplicant *wpa_s,
        wpabuf_put_u8(buf, WLAN_EID_INTERWORKING);
        wpabuf_put_u8(buf, is_zero_ether_addr(wpa_s->conf->hessid) ? 1 :
                      1 + ETH_ALEN);
-       wpabuf_put_u8(buf, INTERWORKING_ANT_WILDCARD);
+       wpabuf_put_u8(buf, wpa_s->conf->access_network_type);
        /* No Venue Info */
        if (!is_zero_ether_addr(wpa_s->conf->hessid))
                wpabuf_put_data(buf, wpa_s->conf->hessid, ETH_ALEN);