summaryrefslogtreecommitdiff
path: root/gsupplicant
diff options
context:
space:
mode:
authorSamuel Ortiz <sameo@linux.intel.com>2011-02-02 23:38:37 (GMT)
committerSamuel Ortiz <sameo@linux.intel.com>2011-02-02 23:38:37 (GMT)
commit609ea53e487a55298d7a168e616ab9bb91214084 (patch)
tree7ad21c3c5263586c55986ed9979f9328d32b98c9 /gsupplicant
parent779bdfff2ace6ac14c1d472a1522481d7491f243 (diff)
downloadconnman-609ea53e487a55298d7a168e616ab9bb91214084.zip
connman-609ea53e487a55298d7a168e616ab9bb91214084.tar.gz
connman-609ea53e487a55298d7a168e616ab9bb91214084.tar.bz2
gsupplicant: Set WPA protocol
Diffstat (limited to 'gsupplicant')
-rw-r--r--gsupplicant/gsupplicant.h4
-rw-r--r--gsupplicant/supplicant.c35
2 files changed, 39 insertions, 0 deletions
diff --git a/gsupplicant/gsupplicant.h b/gsupplicant/gsupplicant.h
index c6d10ab..5c453aa 100644
--- a/gsupplicant/gsupplicant.h
+++ b/gsupplicant/gsupplicant.h
@@ -61,6 +61,9 @@ extern "C" {
#define G_SUPPLICANT_KEYMGMT_WPA_EAP_256 (1 << 8)
#define G_SUPPLICANT_KEYMGMT_WPS (1 << 9)
+#define G_SUPPLICANT_PROTO_WPA (1 << 0)
+#define G_SUPPLICANT_PROTO_RSN (1 << 1)
+
#define G_SUPPLICANT_GROUP_WEP40 (1 << 0)
#define G_SUPPLICANT_GROUP_WEP104 (1 << 1)
#define G_SUPPLICANT_GROUP_TKIP (1 << 2)
@@ -110,6 +113,7 @@ struct _GSupplicantSSID {
unsigned int scan_ssid;
GSupplicantMode mode;
GSupplicantSecurity security;
+ unsigned int protocol;
unsigned int pairwise_cipher;
unsigned int group_cipher;
unsigned int freq;
diff --git a/gsupplicant/supplicant.c b/gsupplicant/supplicant.c
index 3dc5091..97e5858 100644
--- a/gsupplicant/supplicant.c
+++ b/gsupplicant/supplicant.c
@@ -2726,6 +2726,39 @@ static void add_network_security_ciphers(DBusMessageIter *dict,
g_free(group);
}
+static void add_network_security_proto(DBusMessageIter *dict,
+ GSupplicantSSID *ssid)
+{
+ unsigned int protocol, i;
+ char *proto;
+ char *protos[3];
+
+ protocol = ssid->protocol;
+
+ if (protocol == 0)
+ return;
+
+ i = 0;
+
+ if (protocol & G_SUPPLICANT_PROTO_RSN)
+ protos[i++] = "RSN";
+
+ if (protocol & G_SUPPLICANT_PROTO_WPA)
+ protos[i++] = "WPA";
+
+ protos[i] = NULL;
+
+ proto = g_strjoinv(" ", protos);
+
+ SUPPLICANT_DBG("proto %s", proto);
+
+ supplicant_dbus_dict_append_basic(dict, "proto",
+ DBUS_TYPE_STRING,
+ &proto);
+
+ g_free(proto);
+}
+
static void add_network_security(DBusMessageIter *dict, GSupplicantSSID *ssid)
{
char *key_mgmt;
@@ -2740,10 +2773,12 @@ static void add_network_security(DBusMessageIter *dict, GSupplicantSSID *ssid)
case G_SUPPLICANT_SECURITY_PSK:
key_mgmt = "WPA-PSK";
add_network_security_psk(dict, ssid);
+ add_network_security_proto(dict, ssid);
break;
case G_SUPPLICANT_SECURITY_IEEE8021X:
key_mgmt = "WPA-EAP";
add_network_security_eap(dict, ssid);
+ add_network_security_proto(dict, ssid);
break;
}