summaryrefslogtreecommitdiff
path: root/libnm-util/nm-setting-wireless.c
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2012-05-02 11:40:32 -0500
committerDan Williams <dcbw@redhat.com>2012-05-02 17:33:17 -0500
commitbbd2c6e2e6ac53f52bbbee125026e45bc425cfb7 (patch)
tree60bce70e548637d295227b0fc750d917e10d0a0c /libnm-util/nm-setting-wireless.c
parent4980a6882b4fb4505c5cd2b844eea36742be17e8 (diff)
downloadNetworkManager-bbd2c6e2e6ac53f52bbbee125026e45bc425cfb7.tar.gz
libnm-util: add 'hidden' property to the wireless setting
Used as a hint to indicate the network is not broadcasting the SSID and that workarounds should be used for more reliable connection.
Diffstat (limited to 'libnm-util/nm-setting-wireless.c')
-rw-r--r--libnm-util/nm-setting-wireless.c47
1 files changed, 46 insertions, 1 deletions
diff --git a/libnm-util/nm-setting-wireless.c b/libnm-util/nm-setting-wireless.c
index 31882516d8..f9ed310898 100644
--- a/libnm-util/nm-setting-wireless.c
+++ b/libnm-util/nm-setting-wireless.c
@@ -19,7 +19,7 @@
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301 USA.
*
- * (C) Copyright 2007 - 2011 Red Hat, Inc.
+ * (C) Copyright 2007 - 2012 Red Hat, Inc.
* (C) Copyright 2007 - 2008 Novell, Inc.
*/
@@ -80,6 +80,7 @@ typedef struct {
guint32 mtu;
GSList *seen_bssids;
char *security;
+ gboolean hidden;
} NMSettingWirelessPrivate;
enum {
@@ -97,6 +98,7 @@ enum {
PROP_MTU,
PROP_SEEN_BSSIDS,
PROP_SEC,
+ PROP_HIDDEN,
LAST_PROP
};
@@ -482,6 +484,20 @@ nm_setting_wireless_get_security (NMSettingWireless *setting)
}
/**
+ * nm_setting_wireless_get_hidden:
+ * @setting: the #NMSettingWireless
+ *
+ * Returns: the #NMSettingWireless:hidden property of the setting
+ **/
+gboolean
+nm_setting_wireless_get_hidden (NMSettingWireless *setting)
+{
+ g_return_val_if_fail (NM_IS_SETTING_WIRELESS (setting), FALSE);
+
+ return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->hidden;
+}
+
+/**
* nm_setting_wireless_add_seen_bssid:
* @setting: the #NMSettingWireless
* @bssid: the new BSSID to add to the list
@@ -770,6 +786,9 @@ set_property (GObject *object, guint prop_id,
g_free (priv->security);
priv->security = g_value_dup_string (value);
break;
+ case PROP_HIDDEN:
+ priv->hidden = g_value_get_boolean (value);
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -822,6 +841,9 @@ get_property (GObject *object, guint prop_id,
case PROP_SEC:
g_value_set_string (value, nm_setting_wireless_get_security (setting));
break;
+ case PROP_HIDDEN:
+ g_value_set_boolean (value, nm_setting_wireless_get_hidden (setting));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
@@ -1082,4 +1104,27 @@ nm_setting_wireless_class_init (NMSettingWirelessClass *setting_class)
NM_SETTING_WIRELESS_SECURITY_SETTING_NAME " setting.",
NULL,
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
+
+ /**
+ * NMSettingWireless:hidden:
+ *
+ * If %TRUE, indicates this network is a non-broadcasting network that
+ * hides its SSID. In this case various workarounds may take place, such
+ * as probe-scanning the SSID for more reliable network discovery. However,
+ * these workarounds expose inherent insecurities with hidden SSID networks,
+ * and thus hidden SSID networks should be used with caution.
+ **/
+ g_object_class_install_property
+ (object_class, PROP_HIDDEN,
+ g_param_spec_boolean (NM_SETTING_WIRELESS_HIDDEN,
+ "Hidden",
+ "If TRUE, indicates this network is a non-broadcasting "
+ "network that hides its SSID. In this case various "
+ "workarounds may take place, such as probe-scanning "
+ "the SSID for more reliable network discovery. "
+ "However, these workarounds expose inherent "
+ "insecurities with hidden SSID networks, and thus "
+ "hidden SSID networks should be used with caution.",
+ FALSE,
+ G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
}