]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
P2P: Allow GO to advertise Interworking element
authorSunil Dutt <usdutt@qti.qualcomm.com>
Mon, 31 Jul 2017 12:35:05 +0000 (18:05 +0530)
committerJouni Malinen <j@w1.fi>
Thu, 5 Oct 2017 11:42:16 +0000 (14:42 +0300)
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>
wpa_supplicant/ap.c
wpa_supplicant/config.c
wpa_supplicant/config.h
wpa_supplicant/config_file.c
wpa_supplicant/p2p_supplicant.c
wpa_supplicant/wpa_cli.c
wpa_supplicant/wpa_supplicant.conf

index 3fc8e94145edfa91af1884e9800cd3331c9ab000..6668d5822a8ddafa38c8ed20fedcd3027830f8cf 100644 (file)
@@ -354,6 +354,24 @@ static int wpa_supplicant_conf_ap(struct wpa_supplicant *wpa_s,
                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)
                bss->ap_max_inactivity = ssid->ap_max_inactivity;
 
index 0ea34e0ce99551b24cb2aaf67c4406f73c042700..bf3defbf7c64cf2c3ba1b510057454630e72b5ee 100644 (file)
@@ -4562,6 +4562,11 @@ static const struct global_parse_data global_fields[] = {
        { INT_RANGE(interworking, 0, 1), 0 },
        { FUNC(hessid), 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 },
        { STR(autoscan), 0 },
        { INT_RANGE(wps_nfc_dev_pw_id, 0x10, 0xffff),
index 90e7e4a4c39dad2004121278a0cf87d4f8cdeca6..07b67e6b46d4e3fa5547714effb29fb2e93c462a 100644 (file)
@@ -882,6 +882,34 @@ struct wpa_config {
         */
        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
         *
index ab11af9590b5ec2b4e6d41c66ac6e8343b26b893..3b351e8b64d60eecd4a896a4f0c7662c87120739 100644 (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)
                fprintf(f, "access_network_type=%d\n",
                        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 */
        if (config->pbc_in_m1)
                fprintf(f, "pbc_in_m1=%d\n", config->pbc_in_m1);
index 978aaa3903e9f1f4f04e5d2faadeea6945e67016..d4bd19a3bc72a986067a8714787be3233fe35fa7 100644 (file)
@@ -2002,6 +2002,11 @@ do {                                    \
                d->wps_nfc_dh_pubkey = wpabuf_dup(s->wps_nfc_dh_pubkey);
        }
        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;
 }
 
 
index 10cd2439277bba1a13be981d0ed854f442130323..e12a360a78c6b37151f0b63406ad286e33072d8c 100644 (file)
@@ -479,6 +479,8 @@ static char ** wpa_cli_complete_set(const char *str, int pos)
                "hs20",
 #endif /* CONFIG_HS20 */
                "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",
                "wps_nfc_dh_privkey", "wps_nfc_dev_pw", "ext_password_backend",
                "p2p_go_max_inactivity", "auto_interworking", "okc", "pmf",
@@ -574,6 +576,8 @@ static char ** wpa_cli_complete_get(const char *str, int pos)
                "hs20",
 #endif /* CONFIG_HS20 */
                "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",
                "p2p_go_max_inactivity", "auto_interworking", "okc", "pmf",
                "dtim_period", "beacon_int", "ignore_old_scan_res",
index fbf3e72c9b3d8d75264096aa1d2e2584ac1af268..93b6e70429912007681d876101e598451227c1ec 100644 (file)
@@ -442,6 +442,36 @@ fast_reauth=1
 # Enable Interworking
 # 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
 # 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