From 11540c0b214dbc6645efd244ec731eb0178bc848 Mon Sep 17 00:00:00 2001 From: Jouni Malinen Date: Fri, 21 Oct 2011 12:44:29 +0300 Subject: [PATCH] Interworking: Allow ANT to be configured for Probe Request frames Access Network Type can now be configured (default: 15 = wildcard) to limit which APs reply to the scan. --- wpa_supplicant/config.c | 4 +++- wpa_supplicant/config.h | 10 ++++++++++ wpa_supplicant/config_file.c | 3 +++ wpa_supplicant/scan.c | 2 +- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/wpa_supplicant/config.c b/wpa_supplicant/config.c index ff054c2d7..b446a3f44 100644 --- a/wpa_supplicant/config.c +++ b/wpa_supplicant/config.c @@ -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 diff --git a/wpa_supplicant/config.h b/wpa_supplicant/config.h index 3741b9b71..ae496ff54 100644 --- a/wpa_supplicant/config.h +++ b/wpa_supplicant/config.h @@ -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 * diff --git a/wpa_supplicant/config_file.c b/wpa_supplicant/config_file.c index 6c3aa9c37..ee8b45150 100644 --- a/wpa_supplicant/config_file.c +++ b/wpa_supplicant/config_file.c @@ -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 */ } diff --git a/wpa_supplicant/scan.c b/wpa_supplicant/scan.c index 2d3a38f92..fab43f1ee 100644 --- a/wpa_supplicant/scan.c +++ b/wpa_supplicant/scan.c @@ -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);