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.
This commit is contained in:
@@ -435,6 +435,7 @@ global:
|
||||
nm_setting_wireless_get_bssid;
|
||||
nm_setting_wireless_get_channel;
|
||||
nm_setting_wireless_get_cloned_mac_address;
|
||||
nm_setting_wireless_get_hidden;
|
||||
nm_setting_wireless_get_mac_address;
|
||||
nm_setting_wireless_get_mac_address_blacklist;
|
||||
nm_setting_wireless_get_mode;
|
||||
|
@@ -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
|
||||
};
|
||||
@@ -481,6 +483,20 @@ nm_setting_wireless_get_security (NMSettingWireless *setting)
|
||||
return NM_SETTING_WIRELESS_GET_PRIVATE (setting)->security;
|
||||
}
|
||||
|
||||
/**
|
||||
* 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
|
||||
@@ -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));
|
||||
}
|
||||
|
@@ -76,6 +76,7 @@ GQuark nm_setting_wireless_error_quark (void);
|
||||
#define NM_SETTING_WIRELESS_MTU "mtu"
|
||||
#define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids"
|
||||
#define NM_SETTING_WIRELESS_SEC "security"
|
||||
#define NM_SETTING_WIRELESS_HIDDEN "hidden"
|
||||
|
||||
/**
|
||||
* NM_SETTING_WIRELESS_MODE_ADHOC:
|
||||
@@ -122,6 +123,7 @@ const GByteArray *nm_setting_wireless_get_cloned_mac_address (NMSettingWireless
|
||||
const GSList *nm_setting_wireless_get_mac_address_blacklist (NMSettingWireless *setting);
|
||||
guint32 nm_setting_wireless_get_mtu (NMSettingWireless *setting);
|
||||
const char *nm_setting_wireless_get_security (NMSettingWireless *setting);
|
||||
gboolean nm_setting_wireless_get_hidden (NMSettingWireless *setting);
|
||||
|
||||
gboolean nm_setting_wireless_add_seen_bssid (NMSettingWireless *setting,
|
||||
const char *bssid);
|
||||
|
Reference in New Issue
Block a user