[SPIN] add keymgmt property for bss. 43/74643/4
authorNiraj Kumar Goit <niraj.g@samsung.com>
Wed, 15 Jun 2016 11:04:28 +0000 (16:34 +0530)
committerNiraj Kumar Goit <niraj.g@samsung.com>
Fri, 17 Jun 2016 10:32:06 +0000 (03:32 -0700)
Change-Id: Id436db5828febaabd8273c2e0aab91f9ee9572ff
Signed-off-by: Niraj Kumar Goit <niraj.g@samsung.com>
gsupplicant/gsupplicant.h
gsupplicant/supplicant.c
include/network.h
plugins/wifi.c
src/network.c
src/service.c

index 9d53d16..83525e3 100755 (executable)
@@ -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 {
index fb71df6..8449fb9 100755 (executable)
@@ -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,
index a095b52..c3d75ac 100755 (executable)
@@ -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,
index 499c73e..f8642ad 100755 (executable)
@@ -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);
index cf74682..f67dbb6 100755 (executable)
@@ -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,
index 2baf871..1fbcc74 100755 (executable)
@@ -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