summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorArron Wang <arron.wang@intel.com>2012-09-24 14:18:07 +0800
committerZhang zhengguang <zhengguang.zhang@intel.com>2014-10-31 16:06:20 +0800
commit98894f533f23fe532a4449ddaafaa69d39441980 (patch)
tree7d8a04c01fb90ad4f7c6584ac089a63ec925e1c3 /gsupplicant
parent8b828d775adb413be2e02a5377d83af9ecb979ed (diff)
downloadconnman-98894f533f23fe532a4449ddaafaa69d39441980.tar.gz
connman-98894f533f23fe532a4449ddaafaa69d39441980.tar.bz2
connman-98894f533f23fe532a4449ddaafaa69d39441980.zip
Tizen: Export more wifi info in ConnMan network API
Network client requires additional wifi specific info Export the BSSID property Export the MaxRate property Export the detailed info for encryption mode(mixed,aes,tkip,wep,none) Export the connman_network get/set method for bssid, maxrate, encryption_mode property Change-Id: Ic5744978282e49cb2f70165aaadc7822dc718dfb
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/gsupplicant.h10
-rw-r--r--gsupplicant/supplicant.c49
2 files changed, 59 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index e49aaa6a..27826dc0 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -336,6 +336,16 @@ GSupplicantInterface *g_supplicant_peer_get_group_interface(GSupplicantPeer *pee
bool g_supplicant_peer_is_client(GSupplicantPeer *peer);
bool g_supplicant_peer_has_requested_connection(GSupplicantPeer *peer);
+#if defined TIZEN_EXT
+/*
+* Description: Network client requires additional wifi specific info
+*/
+const unsigned char *g_supplicant_network_get_bssid(
+ GSupplicantNetwork *network);
+unsigned int g_supplicant_network_get_maxrate(GSupplicantNetwork *network);
+const char *g_supplicant_network_get_enc_mode(GSupplicantNetwork *network);
+#endif
+
struct _GSupplicantCallbacks {
void (*system_ready) (void);
void (*system_killed) (void);
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 909a6178..d2e4a649 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1169,6 +1169,55 @@ bool g_supplicant_peer_has_requested_connection(GSupplicantPeer *peer)
return peer->connection_requested;
}
+#if defined TIZEN_EXT
+/*
+ * Description: Network client requires additional wifi specific info
+ */
+const unsigned char *g_supplicant_network_get_bssid(GSupplicantNetwork *network)
+{
+ if (network == NULL || network->best_bss == NULL)
+ return NULL;
+
+ return (const unsigned char *)network->best_bss->bssid;
+}
+
+unsigned int g_supplicant_network_get_maxrate(GSupplicantNetwork *network)
+{
+ if (network == NULL || network->best_bss == NULL)
+ return 0;
+
+ return network->best_bss->maxrate;
+}
+
+const char *g_supplicant_network_get_enc_mode(GSupplicantNetwork *network)
+{
+ if (network == NULL || network->best_bss == NULL)
+ return NULL;
+
+ if (network->best_bss->security == G_SUPPLICANT_SECURITY_PSK ||
+ network->best_bss->security == G_SUPPLICANT_SECURITY_IEEE8021X) {
+ unsigned int pairwise;
+
+ pairwise = network->best_bss->rsn_pairwise |
+ network->best_bss->wpa_pairwise;
+
+ if ((pairwise & G_SUPPLICANT_PAIRWISE_CCMP) &&
+ (pairwise & G_SUPPLICANT_PAIRWISE_TKIP))
+ return "mixed";
+ else if (pairwise & G_SUPPLICANT_PAIRWISE_CCMP)
+ return "aes";
+ else if (pairwise & G_SUPPLICANT_PAIRWISE_TKIP)
+ return "tkip";
+
+ } else if (network->best_bss->security == G_SUPPLICANT_SECURITY_WEP)
+ return "wep";
+ else if (network->best_bss->security == G_SUPPLICANT_SECURITY_NONE)
+ return "none";
+
+ return NULL;
+}
+#endif
+
static void merge_network(GSupplicantNetwork *network)
{
GString *str;