summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLubomir Rintel <lkundrak@v3.sk>2017-04-30 22:54:40 +0200
committerLubomir Rintel <lkundrak@v3.sk>2017-05-15 12:59:55 +0200
commit5c80571006d784bba4c55cafdb9da0667980011f (patch)
tree98d5387c65fd5ee4dde30f97f8a4d0da3f7d1f19
parenta3040bf92f417aa5e3d4bb826ea92cfefba14c4e (diff)
downloadNetworkManager-5c80571006d784bba4c55cafdb9da0667980011f.tar.gz
wifi/ap: maintain the WPS flags
Exposure of this property on D-Bus would be useful for the GUIs to encourage the users to enter a PIN or push a button. We'll also use it to decide whether a connection will initiate WPS enrollment unless the user overrides the default.
-rw-r--r--src/devices/wifi/nm-wifi-ap.c14
-rw-r--r--src/devices/wifi/nm-wifi-ap.h2
2 files changed, 14 insertions, 2 deletions
diff --git a/src/devices/wifi/nm-wifi-ap.c b/src/devices/wifi/nm-wifi-ap.c
index 90cf8e669c..bc823af0a5 100644
--- a/src/devices/wifi/nm-wifi-ap.c
+++ b/src/devices/wifi/nm-wifi-ap.c
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2004 - 2011 Red Hat, Inc.
+ * Copyright (C) 2004 - 2017 Red Hat, Inc.
* Copyright (C) 2006 - 2008 Novell, Inc.
*/
@@ -790,6 +790,18 @@ nm_wifi_ap_update_from_properties (NMWifiAP *ap,
if (g_variant_lookup (properties, "Privacy", "b", &b) && b)
changed |= nm_wifi_ap_set_flags (ap, priv->flags | NM_802_11_AP_FLAGS_PRIVACY);
+ v = g_variant_lookup_value (properties, "WPS", G_VARIANT_TYPE_VARDICT);
+ if (v) {
+ if (g_variant_lookup (v, "Type", "&s", &s)) {
+ changed |= nm_wifi_ap_set_flags (ap, priv->flags | NM_802_11_AP_FLAGS_WPS);
+ if (strcmp (s, "pbc") == 0)
+ changed |= nm_wifi_ap_set_flags (ap, priv->flags | NM_802_11_AP_FLAGS_WPS_PBC);
+ else if (strcmp (s, "pin") == 0)
+ changed |= nm_wifi_ap_set_flags (ap, priv->flags | NM_802_11_AP_FLAGS_WPS_PIN);
+ }
+ g_variant_unref (v);
+ }
+
if (g_variant_lookup (properties, "Mode", "&s", &s)) {
if (!g_strcmp0 (s, "infrastructure"))
changed |= nm_wifi_ap_set_mode (ap, NM_802_11_MODE_INFRA);
diff --git a/src/devices/wifi/nm-wifi-ap.h b/src/devices/wifi/nm-wifi-ap.h
index c9b4772fa0..dd5a4ad12b 100644
--- a/src/devices/wifi/nm-wifi-ap.h
+++ b/src/devices/wifi/nm-wifi-ap.h
@@ -15,7 +15,7 @@
* with this program; if not, write to the Free Software Foundation, Inc.,
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
*
- * Copyright (C) 2004 - 2011 Red Hat, Inc.
+ * Copyright (C) 2004 - 2017 Red Hat, Inc.
* Copyright (C) 2006 - 2008 Novell, Inc.
*/