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-07-31 15:51:57 +0800
commit1b16b3d9ece01d219ab3830f13d5a282f97d7dc9 (patch)
treec925971688e4d0b6055aa1ddbc5380ca09e87411 /gsupplicant
parente5736f61e110e84a011485f91ffcc5287f1beef1 (diff)
downloadconnman-1b16b3d9ece01d219ab3830f13d5a282f97d7dc9.tar.gz
connman-1b16b3d9ece01d219ab3830f13d5a282f97d7dc9.tar.bz2
connman-1b16b3d9ece01d219ab3830f13d5a282f97d7dc9.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 a5ec4059..bcff96c3 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -257,6 +257,16 @@ const char *g_supplicant_peer_get_identifier(GSupplicantPeer *peer);
const void *g_supplicant_peer_get_device_address(GSupplicantPeer *peer);
const char *g_supplicant_peer_get_name(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 2674298a..9e671a68 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -1011,6 +1011,55 @@ const char *g_supplicant_peer_get_name(GSupplicantPeer *peer)
return peer->name;
}
+#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;