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.
This commit is contained in:
Jouni Malinen 2011-10-21 12:44:29 +03:00 committed by Jouni Malinen
parent 122ba57936
commit 11540c0b21
4 changed files with 17 additions and 2 deletions

View 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

View 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
*

View 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 */
}

View 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);