From cdc3af7c29f82b71c2ce76fb6aa28dd6b3d9e5cd Mon Sep 17 00:00:00 2001 From: Chengyi Zhao Date: Thu, 11 Jul 2013 10:00:31 +0800 Subject: Tethering: Add hidden access point support in technology Change-Id: I73fccf5f322ee2597f8f58d5e3d7f60ddeb0a641 --- plugins/bluetooth.c | 2 +- plugins/bluetooth_legacy.c | 2 +- plugins/ethernet.c | 2 +- plugins/gadget.c | 2 +- plugins/wifi.c | 13 ++++++++++--- 5 files changed, 14 insertions(+), 7 deletions(-) (limited to 'plugins') diff --git a/plugins/bluetooth.c b/plugins/bluetooth.c index 28df4067..f8abeac8 100644 --- a/plugins/bluetooth.c +++ b/plugins/bluetooth.c @@ -854,7 +854,7 @@ static void bluetooth_tech_remove(struct connman_technology *technology) static int bluetooth_tech_set_tethering(struct connman_technology *technology, const char *identifier, const char *passphrase, - const char *bridge, bool enabled) + const char *bridge, bool enabled, bool hidden) { GHashTableIter hash_iter; gpointer key, value; diff --git a/plugins/bluetooth_legacy.c b/plugins/bluetooth_legacy.c index 2d7a9e01..a9ff5743 100644 --- a/plugins/bluetooth_legacy.c +++ b/plugins/bluetooth_legacy.c @@ -1234,7 +1234,7 @@ static void disable_nap(gpointer key, gpointer value, gpointer user_data) static int tech_set_tethering(struct connman_technology *technology, const char *identifier, const char *passphrase, - const char *bridge, bool enabled) + const char *bridge, bool enabled, bool hidden) { struct tethering_info info = { .technology = technology, diff --git a/plugins/ethernet.c b/plugins/ethernet.c index b8e52ce0..4e713461 100644 --- a/plugins/ethernet.c +++ b/plugins/ethernet.c @@ -309,7 +309,7 @@ static void eth_tech_disable_tethering(struct connman_technology *technology, static int eth_tech_set_tethering(struct connman_technology *technology, const char *identifier, const char *passphrase, - const char *bridge, bool enabled) + const char *bridge, bool enabled, bool hidden) { if (!connman_technology_is_tethering_allowed( CONNMAN_SERVICE_TYPE_ETHERNET)) diff --git a/plugins/gadget.c b/plugins/gadget.c index 94f66487..97807d87 100644 --- a/plugins/gadget.c +++ b/plugins/gadget.c @@ -291,7 +291,7 @@ static void gadget_tech_disable_tethering(struct connman_technology *technology, static int gadget_tech_set_tethering(struct connman_technology *technology, const char *identifier, const char *passphrase, - const char *bridge, bool enabled) + const char *bridge, bool enabled, bool hidden) { DBG("bridge %s enabled %d", bridge, enabled); diff --git a/plugins/wifi.c b/plugins/wifi.c index b5bc3bae..21f9912d 100644 --- a/plugins/wifi.c +++ b/plugins/wifi.c @@ -2927,7 +2927,8 @@ struct wifi_tethering_info { GSupplicantSSID *ssid; }; -static GSupplicantSSID *ssid_ap_init(const char *ssid, const char *passphrase) +static GSupplicantSSID *ssid_ap_init(const char *ssid, + const char *passphrase, bool hidden) { GSupplicantSSID *ap; @@ -2952,6 +2953,12 @@ static GSupplicantSSID *ssid_ap_init(const char *ssid, const char *passphrase) ap->passphrase = passphrase; } + if (hidden) + ap->ignore_broadcast_ssid = + G_SUPPLICANT_AP_HIDDEN_SSID_ZERO_CONTENTS; + else + ap->ignore_broadcast_ssid = G_SUPPLICANT_AP_NO_SSID_HIDING; + return ap; } @@ -3032,7 +3039,7 @@ static void sta_remove_callback(int result, static int tech_set_tethering(struct connman_technology *technology, const char *identifier, const char *passphrase, - const char *bridge, bool enabled) + const char *bridge, bool enabled, bool hidden) { GList *list; GSupplicantInterface *interface; @@ -3085,7 +3092,7 @@ static int tech_set_tethering(struct connman_technology *technology, info->wifi = wifi; info->technology = technology; info->wifi->bridge = bridge; - info->ssid = ssid_ap_init(identifier, passphrase); + info->ssid = ssid_ap_init(identifier, passphrase, hidden); if (!info->ssid) { g_free(info); continue; -- cgit v1.2.3