P2P: Allow GO to advertise Interworking element

This adds new wpa_supplicant configuration parameters (go_interworking,
go_access_network_type, go_internet, go_venue_group, go_venue_type) to
add a possibility of configuring the P2P GO to advertise Interworking
element.

Signed-off-by: Jouni Malinen <jouni@qca.qualcomm.com>
This commit is contained in:
Sunil Dutt 2017-07-31 18:05:05 +05:30 committed by Jouni Malinen
parent 3567641ebb
commit 63bc0ab0ed
7 changed files with 101 additions and 0 deletions

View file

@ -354,6 +354,24 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
wep->keys_set = 1; wep->keys_set = 1;
} }
if (wpa_s->conf->go_interworking) {
wpa_printf(MSG_DEBUG,
"P2P: Enable Interworking with access_network_type: %d",
wpa_s->conf->go_access_network_type);
bss->interworking = wpa_s->conf->go_interworking;
bss->access_network_type = wpa_s->conf->go_access_network_type;
bss->internet = wpa_s->conf->go_internet;
if (wpa_s->conf->go_venue_group) {
wpa_printf(MSG_DEBUG,
"P2P: Venue group: %d Venue type: %d",
wpa_s->conf->go_venue_group,
wpa_s->conf->go_venue_type);
bss->venue_group = wpa_s->conf->go_venue_group;
bss->venue_type = wpa_s->conf->go_venue_type;
bss->venue_info_set = 1;
}
}
if (ssid->ap_max_inactivity) if (ssid->ap_max_inactivity)
bss->ap_max_inactivity = ssid->ap_max_inactivity; bss->ap_max_inactivity = ssid->ap_max_inactivity;

View file

@ -4562,6 +4562,11 @@ static const struct global_parse_data global_fields[] = {
{ INT_RANGE(interworking, 0, 1), 0 }, { INT_RANGE(interworking, 0, 1), 0 },
{ FUNC(hessid), 0 }, { FUNC(hessid), 0 },
{ INT_RANGE(access_network_type, 0, 15), 0 }, { INT_RANGE(access_network_type, 0, 15), 0 },
{ INT_RANGE(go_interworking, 0, 1), 0 },
{ INT_RANGE(go_access_network_type, 0, 15), 0 },
{ INT_RANGE(go_internet, 0, 1), 0 },
{ INT_RANGE(go_venue_group, 0, 255), 0 },
{ INT_RANGE(go_venue_type, 0, 255), 0 },
{ INT_RANGE(pbc_in_m1, 0, 1), 0 }, { INT_RANGE(pbc_in_m1, 0, 1), 0 },
{ STR(autoscan), 0 }, { STR(autoscan), 0 },
{ INT_RANGE(wps_nfc_dev_pw_id, 0x10, 0xffff), { INT_RANGE(wps_nfc_dev_pw_id, 0x10, 0xffff),

View file

@ -882,6 +882,34 @@ struct wpa_config {
*/ */
int access_network_type; int access_network_type;
/**
* go_interworking - Whether Interworking for P2P GO is enabled
*/
int go_interworking;
/**
* go_access_network_type - P2P GO Access Network Type
*
* This indicates which access network type to advertise if Interworking
* is enabled for P2P GO.
*/
int go_access_network_type;
/**
* go_internet - Interworking: Internet connectivity (0 or 1)
*/
int go_internet;
/**
* go_venue_group - Interworking: Venue group
*/
int go_venue_group;
/**
* go_venue_type: Interworking: Venue type
*/
int go_venue_type;
/** /**
* hessid - Homogenous ESS identifier * hessid - Homogenous ESS identifier
* *

View file

@ -1292,6 +1292,17 @@ static void wpa_config_write_global(FILE *f, struct wpa_config *config)
if (config->access_network_type != DEFAULT_ACCESS_NETWORK_TYPE) if (config->access_network_type != DEFAULT_ACCESS_NETWORK_TYPE)
fprintf(f, "access_network_type=%d\n", fprintf(f, "access_network_type=%d\n",
config->access_network_type); config->access_network_type);
if (config->go_interworking)
fprintf(f, "go_interworking=%d\n", config->go_interworking);
if (config->go_access_network_type)
fprintf(f, "go_access_network_type=%d\n",
config->go_access_network_type);
if (config->go_internet)
fprintf(f, "go_internet=%d\n", config->go_internet);
if (config->go_venue_group)
fprintf(f, "go_venue_group=%d\n", config->go_venue_group);
if (config->go_venue_type)
fprintf(f, "go_venue_type=%d\n", config->go_venue_type);
#endif /* CONFIG_INTERWORKING */ #endif /* CONFIG_INTERWORKING */
if (config->pbc_in_m1) if (config->pbc_in_m1)
fprintf(f, "pbc_in_m1=%d\n", config->pbc_in_m1); fprintf(f, "pbc_in_m1=%d\n", config->pbc_in_m1);

View file

@ -2002,6 +2002,11 @@ do { \
d->wps_nfc_dh_pubkey = wpabuf_dup(s->wps_nfc_dh_pubkey); d->wps_nfc_dh_pubkey = wpabuf_dup(s->wps_nfc_dh_pubkey);
} }
d->p2p_cli_probe = s->p2p_cli_probe; d->p2p_cli_probe = s->p2p_cli_probe;
d->go_interworking = s->go_interworking;
d->go_access_network_type = s->go_access_network_type;
d->go_internet = s->go_internet;
d->go_venue_group = s->go_venue_group;
d->go_venue_type = s->go_venue_type;
} }

View file

@ -479,6 +479,8 @@ static char ** wpa_cli_complete_set(const char *str, int pos)
"hs20", "hs20",
#endif /* CONFIG_HS20 */ #endif /* CONFIG_HS20 */
"interworking", "hessid", "access_network_type", "pbc_in_m1", "interworking", "hessid", "access_network_type", "pbc_in_m1",
"go_interworking", "go_access_network_type", "go_internet",
"go_venue_group", "go_venue_type",
"autoscan", "wps_nfc_dev_pw_id", "wps_nfc_dh_pubkey", "autoscan", "wps_nfc_dev_pw_id", "wps_nfc_dh_pubkey",
"wps_nfc_dh_privkey", "wps_nfc_dev_pw", "ext_password_backend", "wps_nfc_dh_privkey", "wps_nfc_dev_pw", "ext_password_backend",
"p2p_go_max_inactivity", "auto_interworking", "okc", "pmf", "p2p_go_max_inactivity", "auto_interworking", "okc", "pmf",
@ -574,6 +576,8 @@ static char ** wpa_cli_complete_get(const char *str, int pos)
"hs20", "hs20",
#endif /* CONFIG_HS20 */ #endif /* CONFIG_HS20 */
"interworking", "access_network_type", "pbc_in_m1", "autoscan", "interworking", "access_network_type", "pbc_in_m1", "autoscan",
"go_interworking", "go_access_network_type", "go_internet",
"go_venue_group", "go_venue_type",
"wps_nfc_dev_pw_id", "ext_password_backend", "wps_nfc_dev_pw_id", "ext_password_backend",
"p2p_go_max_inactivity", "auto_interworking", "okc", "pmf", "p2p_go_max_inactivity", "auto_interworking", "okc", "pmf",
"dtim_period", "beacon_int", "ignore_old_scan_res", "dtim_period", "beacon_int", "ignore_old_scan_res",

View file

@ -442,6 +442,36 @@ fast_reauth=1
# Enable Interworking # Enable Interworking
# interworking=1 # interworking=1
# Enable P2P GO advertisement of Interworking
# go_interworking=1
# P2P GO Interworking: Access Network Type
# 0 = Private network
# 1 = Private network with guest access
# 2 = Chargeable public network
# 3 = Free public network
# 4 = Personal device network
# 5 = Emergency services only network
# 14 = Test or experimental
# 15 = Wildcard
#go_access_network_type=0
# P2P GO Interworking: Whether the network provides connectivity to the Internet
# 0 = Unspecified
# 1 = Network provides connectivity to the Internet
#go_internet=1
# P2P GO Interworking: Group Venue Info (optional)
# The available values are defined in IEEE Std 802.11-2016, 9.4.1.35.
# Example values (group,type):
# 0,0 = Unspecified
# 1,7 = Convention Center
# 1,13 = Coffee Shop
# 2,0 = Unspecified Business
# 7,1 Private Residence
#go_venue_group=7
#go_venue_type=1
# Homogenous ESS identifier # Homogenous ESS identifier
# If this is set, scans will be used to request response only from BSSes # If this is set, scans will be used to request response only from BSSes
# belonging to the specified Homogeneous ESS. This is used only if interworking # belonging to the specified Homogeneous ESS. This is used only if interworking