summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSaurav Babu <saurav.babu@samsung.com>2017-12-27 10:43:05 (GMT)
committerSaurav Babu <saurav.babu@samsung.com>2017-12-27 12:41:28 (GMT)
commit9458c40dfd9b99b9da24e3cdb249dbc116e8750c (patch)
tree4e89981bf4b6f446183c990e52d2a842fe170b53
parentf911da60ac8a5058b8182c30f765e12d7bdaf943 (diff)
downloadconnman-9458c40dfd9b99b9da24e3cdb249dbc116e8750c.zip
connman-9458c40dfd9b99b9da24e3cdb249dbc116e8750c.tar.gz
connman-9458c40dfd9b99b9da24e3cdb249dbc116e8750c.tar.bz2
Change-Id: I21d3a4ba5632d5a00a3254137b12dfdbd1dbe3dc Signed-off-by: Saurav Babu <saurav.babu@samsung.com>
-rwxr-xr-xgsupplicant/gsupplicant.h2
-rwxr-xr-xgsupplicant/supplicant.c13
-rwxr-xr-xinclude/network.h3
-rwxr-xr-xplugins/wifi.c5
-rwxr-xr-xsrc/network.c25
-rwxr-xr-xsrc/service.c2
6 files changed, 21 insertions, 29 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index a33dab0..9177275 100755
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -372,7 +372,7 @@ const unsigned char *g_supplicant_network_get_bssid(
unsigned int g_supplicant_network_get_maxrate(GSupplicantNetwork *network);
const char *g_supplicant_network_get_enc_mode(GSupplicantNetwork *network);
bool g_supplicant_network_get_rsn_mode(GSupplicantNetwork *network);
-unsigned int g_supplicant_network_is_hs20AP(GSupplicantNetwork *network);
+bool g_supplicant_network_is_hs20AP(GSupplicantNetwork *network);
const char *g_supplicant_network_get_eap(GSupplicantNetwork *network);
const char *g_supplicant_network_get_identity(GSupplicantNetwork *network);
const char *g_supplicant_network_get_phase2(GSupplicantNetwork *network);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index b1232a5..d84c893 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -213,6 +213,7 @@ struct g_supplicant_bss {
dbus_bool_t ft_ieee8021x;
char *wifi_vsie;
unsigned int wifi_vsie_len;
+ dbus_bool_t hs20;
#endif
unsigned int wps_capabilities;
};
@@ -234,7 +235,7 @@ struct _GSupplicantNetwork {
GHashTable *bss_table;
GHashTable *config_table;
#if defined TIZEN_EXT
- unsigned int isHS20AP;
+ bool isHS20AP;
char *eap;
char *identity;
char *phase2;
@@ -1182,7 +1183,7 @@ const char *g_supplicant_peer_get_name(GSupplicantPeer *peer)
}
#if defined TIZEN_EXT
-unsigned int g_supplicant_network_is_hs20AP(GSupplicantNetwork *network)
+bool g_supplicant_network_is_hs20AP(GSupplicantNetwork *network)
{
if (!network)
return 0;
@@ -1685,6 +1686,8 @@ static void add_or_replace_bss_to_network(struct g_supplicant_bss *bss)
SUPPLICANT_DBG("Failed to allocate memory for wifi_vsie");
}
}
+
+ network->isHS20AP = bss->hs20;
#endif
SUPPLICANT_DBG("New network %s created", network->name);
@@ -2101,6 +2104,12 @@ static void bss_property(const char *key, DBusMessageIter *iter,
bss->rsn_selected = FALSE;
supplicant_dbus_property_foreach(iter, bss_wpa, bss);
+#if defined TIZEN_EXT
+ } else if (g_strcmp0(key, "HS20") == 0) {
+ dbus_bool_t hs20 = FALSE;
+ dbus_message_iter_get_basic(iter, &hs20);
+ bss->hs20 = hs20;
+#endif
} else if (g_strcmp0(key, "IEs") == 0)
bss_process_ies(iter, bss);
else
diff --git a/include/network.h b/include/network.h
index 6403b16..4be5fbf 100755
--- a/include/network.h
+++ b/include/network.h
@@ -147,9 +147,6 @@ int connman_network_set_proxy(struct connman_network *network,
const char *proxies);
void connman_network_clear_associating(struct connman_network *network);
-int connman_network_set_is_hs20AP(struct connman_network *network,
- unsigned int isHS20AP);
-unsigned int connman_network_get_is_hs20AP(struct connman_network *network);
int connman_network_set_keymgmt(struct connman_network *network,
unsigned int keymgmt);
diff --git a/plugins/wifi.c b/plugins/wifi.c
index d34f811..9c453b3 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -3287,6 +3287,8 @@ static void network_added(GSupplicantNetwork *supplicant_network)
g_supplicant_network_get_rsn_mode(supplicant_network));
connman_network_set_keymgmt(network,
g_supplicant_network_get_keymgmt(supplicant_network));
+ connman_network_set_bool(network, "WiFi.HS20AP",
+ g_supplicant_network_is_hs20AP(supplicant_network));
#endif
connman_network_set_available(network, true);
connman_network_set_string(network, "WiFi.Mode", mode);
@@ -3627,7 +3629,7 @@ static void network_merged(GSupplicantNetwork *network)
struct wifi_data *wifi;
const char *identifier;
struct connman_network *connman_network;
- unsigned int ishs20AP = 0;
+ bool ishs20AP = 0;
char *temp = NULL;
interface = g_supplicant_network_get_interface(network);
@@ -3669,7 +3671,6 @@ static void network_merged(GSupplicantNetwork *network)
}
ishs20AP = g_supplicant_network_is_hs20AP(network);
- connman_network_set_is_hs20AP(connman_network, ishs20AP);
if (ishs20AP &&
g_strcmp0(g_supplicant_network_get_security(network), "ieee8021x") == 0) {
diff --git a/src/network.c b/src/network.c
index 64c26cc..5aac8d6 100755
--- a/src/network.c
+++ b/src/network.c
@@ -103,7 +103,7 @@ struct connman_network {
char encryption_mode[WIFI_ENCYPTION_MODE_LEN_MAX];
unsigned char bssid[WIFI_BSSID_LEN_MAX];
unsigned int maxrate;
- unsigned int isHS20AP;
+ bool isHS20AP;
unsigned int keymgmt;
char *keymgmt_type;
bool rsn_mode;
@@ -2022,25 +2022,6 @@ int connman_network_set_proxy(struct connman_network *network,
return 0;
}
-int connman_network_set_is_hs20AP(struct connman_network *network,
- unsigned int isHS20AP)
-{
- if (!network)
- return 0;
-
- network->wifi.isHS20AP = isHS20AP;
-
- return 0;
-}
-
-unsigned int connman_network_get_is_hs20AP(struct connman_network *network)
-{
- if (!network)
- return 0;
-
- return network->wifi.isHS20AP;
-}
-
int connman_network_set_keymgmt(struct connman_network *network,
unsigned int keymgmt)
{
@@ -2377,6 +2358,8 @@ int connman_network_set_bool(struct connman_network *network,
#if defined TIZEN_EXT
else if (g_strcmp0(key, "DefaultInternet") == 0)
network->default_internet = value;
+ else if (g_strcmp0(key, "WiFi.HS20AP") == 0)
+ network->wifi.isHS20AP = value;
#endif
return -EINVAL;
@@ -2405,6 +2388,8 @@ bool connman_network_get_bool(struct connman_network *network,
#if defined TIZEN_EXT
else if (g_str_equal(key, "DefaultInternet"))
return network->default_internet;
+ else if (g_str_equal(key, "WiFi.HS20AP"))
+ return network->wifi.isHS20AP;
#endif
return false;
diff --git a/src/service.c b/src/service.c
index 3d491a8..129b410 100755
--- a/src/service.c
+++ b/src/service.c
@@ -3175,7 +3175,7 @@ static void append_wifi_ext_info(DBusMessageIter *dict,
maxrate = connman_network_get_maxrate(network);
frequency = connman_network_get_frequency(network);
enc_mode = connman_network_get_enc_mode(network);
- passpoint = connman_network_get_is_hs20AP(network);
+ passpoint = connman_network_get_bool(network, "WiFi.HS20AP");
keymgmt = connman_network_get_keymgmt(network);
snprintf(bssid_str, WIFI_BSSID_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x",