summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNiraj Kumar Goit <niraj.g@samsung.com>2016-06-15 16:34:28 +0530
committerNiraj Kumar Goit <niraj.g@samsung.com>2016-06-17 03:32:06 -0700
commit9e422dc9ba4eeee4162e72f05fd18cddff6dda27 (patch)
treecdb026b67ed3548c56b455b997eaa04e987a497e
parentd6b5205c4674173e05d9fc421dcf898314c62d8d (diff)
downloadconnman-9e422dc9ba4eeee4162e72f05fd18cddff6dda27.tar.gz
connman-9e422dc9ba4eeee4162e72f05fd18cddff6dda27.tar.bz2
connman-9e422dc9ba4eeee4162e72f05fd18cddff6dda27.zip
[SPIN] add keymgmt property for bss.
Change-Id: Id436db5828febaabd8273c2e0aab91f9ee9572ff Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
-rwxr-xr-xgsupplicant/gsupplicant.h1
-rwxr-xr-xgsupplicant/supplicant.c13
-rwxr-xr-xinclude/network.h4
-rwxr-xr-xplugins/wifi.c2
-rwxr-xr-xsrc/network.c21
-rwxr-xr-xsrc/service.c4
6 files changed, 45 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index 9d53d161..83525e36 100755
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -376,6 +376,7 @@ unsigned int 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);
+unsigned int g_supplicant_network_get_keymgmt(GSupplicantNetwork *network);
#endif
struct _GSupplicantCallbacks {
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index fb71df63..8449fb97 100755
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -233,6 +233,7 @@ struct _GSupplicantNetwork {
char *eap;
char *identity;
char *phase2;
+ unsigned int keymgmt;
#endif
};
@@ -1171,6 +1172,14 @@ const char *g_supplicant_network_get_phase2(GSupplicantNetwork *network)
return network->phase2;
}
+
+unsigned int g_supplicant_network_get_keymgmt(GSupplicantNetwork *network)
+{
+ if (network == NULL)
+ return 0;
+
+ return network->keymgmt;
+}
#endif
const unsigned char *g_supplicant_peer_get_widi_ies(GSupplicantPeer *peer,
@@ -1606,6 +1615,10 @@ static void add_or_replace_bss_to_network(struct g_supplicant_bss *bss)
network->frequency = bss->frequency;
network->best_bss = bss;
+#if defined TIZEN_EXT
+ network->keymgmt = bss->keymgmt;
+#endif
+
SUPPLICANT_DBG("New network %s created", network->name);
network->bss_table = g_hash_table_new_full(g_str_hash, g_str_equal,
diff --git a/include/network.h b/include/network.h
index a095b525..c3d75acb 100755
--- a/include/network.h
+++ b/include/network.h
@@ -145,6 +145,10 @@ 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);
+unsigned int connman_network_get_keymgmt(struct connman_network *network);
#endif
int connman_network_set_name(struct connman_network *network,
diff --git a/plugins/wifi.c b/plugins/wifi.c
index 499c73e4..f8642ad0 100755
--- a/plugins/wifi.c
+++ b/plugins/wifi.c
@@ -2970,6 +2970,8 @@ static void network_added(GSupplicantNetwork *supplicant_network)
g_supplicant_network_get_enc_mode(supplicant_network));
connman_network_set_rsn_selected(network,
g_supplicant_network_get_rsn_selected(supplicant_network));
+ connman_network_set_keymgmt(network,
+ g_supplicant_network_get_keymgmt(supplicant_network));
#endif
connman_network_set_available(network, true);
connman_network_set_string(network, "WiFi.Mode", mode);
diff --git a/src/network.c b/src/network.c
index cf746829..f67dbb68 100755
--- a/src/network.c
+++ b/src/network.c
@@ -97,6 +97,8 @@ struct connman_network {
unsigned char bssid[WIFI_BSSID_LEN_MAX];
unsigned int maxrate;
unsigned int isHS20AP;
+ unsigned int keymgmt;
+ char *keymgmt_type;
bool rsn_selected;
#endif
} wifi;
@@ -1941,6 +1943,25 @@ unsigned int connman_network_get_is_hs20AP(struct connman_network *network)
return network->wifi.isHS20AP;
}
+
+int connman_network_set_keymgmt(struct connman_network *network,
+ unsigned int keymgmt)
+{
+ if (network == NULL)
+ return 0;
+
+ network->wifi.keymgmt = keymgmt;
+
+ return 0;
+}
+
+unsigned int connman_network_get_keymgmt(struct connman_network *network)
+{
+ if (network == NULL)
+ return 0;
+
+ return network->wifi.keymgmt;
+}
#endif
int connman_network_set_nameservers(struct connman_network *network,
diff --git a/src/service.c b/src/service.c
index 2baf8716..1fbcc74f 100755
--- a/src/service.c
+++ b/src/service.c
@@ -2727,6 +2727,7 @@ static void append_wifi_ext_info(DBusMessageIter *dict,
char *bssid_str = bssid_buff;
unsigned char *bssid;
unsigned int maxrate;
+ unsigned int keymgmt;
uint16_t frequency;
const char *enc_mode;
gboolean passpoint;
@@ -2736,6 +2737,7 @@ static void append_wifi_ext_info(DBusMessageIter *dict,
frequency = connman_network_get_frequency(network);
enc_mode = connman_network_get_enc_mode(network);
passpoint = connman_network_get_is_hs20AP(network);
+ keymgmt = connman_network_get_keymgmt(network);
snprintf(bssid_str, WIFI_BSSID_STR_LEN, "%02x:%02x:%02x:%02x:%02x:%02x",
bssid[0], bssid[1], bssid[2],
@@ -2751,6 +2753,8 @@ static void append_wifi_ext_info(DBusMessageIter *dict,
DBUS_TYPE_STRING, &enc_mode);
connman_dbus_dict_append_basic(dict, "Passpoint",
DBUS_TYPE_BOOLEAN, &passpoint);
+ connman_dbus_dict_append_basic(dict, "Keymgmt",
+ DBUS_TYPE_UINT32, &keymgmt);
}
#endif