NetworkManager r3697 - in trunk: . libnm-util
- From: dcbw svn gnome org
- To: svn-commits-list gnome org
- Subject: NetworkManager r3697 - in trunk: . libnm-util
- Date: Wed, 28 May 2008 21:30:53 +0000 (UTC)
Author: dcbw
Date: Wed May 28 21:30:53 2008
New Revision: 3697
URL: http://svn.gnome.org/viewvc/NetworkManager?rev=3697&view=rev
Log:
2008-05-28 Dan Williams <dcbw redhat com>
* libnm-util/nm-setting-wireless.c
libnm-util/nm-setting-wireless.h
- (set_property, get_property, nm_setting_wireless_class_init): add the
'adhoc-create' property, which when TRUE indicates that NM should
create this connection as an adhoc wifi network if it's not found
as an adhoc network during scanning. Can be used to auto-create
adhoc networks when used in combination with autoconnect.
Modified:
trunk/ChangeLog
trunk/libnm-util/nm-setting-wireless.c
trunk/libnm-util/nm-setting-wireless.h
Modified: trunk/libnm-util/nm-setting-wireless.c
==============================================================================
--- trunk/libnm-util/nm-setting-wireless.c (original)
+++ trunk/libnm-util/nm-setting-wireless.c Wed May 28 21:30:53 2008
@@ -18,6 +18,7 @@
PROP_0,
PROP_SSID,
PROP_MODE,
+ PROP_ADHOC_CREATE,
PROP_BAND,
PROP_CHANNEL,
PROP_BSSID,
@@ -225,6 +226,11 @@
return FALSE;
}
+ if (self->mode && strcmp (self->mode, "adhoc") && self->adhoc_create) {
+ g_warning ("Key 'adhoc-create' only valid with Ad-Hoc mode.");
+ return FALSE;
+ }
+
if (self->band && !nm_utils_string_in_list (self->band, valid_bands)) {
g_warning ("Invalid band. Should be either 'a' or 'bg'");
return FALSE;
@@ -330,6 +336,9 @@
g_free (setting->mode);
setting->mode = g_value_dup_string (value);
break;
+ case PROP_ADHOC_CREATE:
+ setting->adhoc_create = g_value_get_boolean (value);
+ break;
case PROP_BAND:
g_free (setting->band);
setting->band = g_value_dup_string (value);
@@ -383,6 +392,9 @@
case PROP_MODE:
g_value_set_string (value, setting->mode);
break;
+ case PROP_ADHOC_CREATE:
+ g_value_set_boolean (value, setting->adhoc_create);
+ break;
case PROP_BAND:
g_value_set_string (value, setting->band);
break;
@@ -446,6 +458,14 @@
G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
g_object_class_install_property
+ (object_class, PROP_ADHOC_CREATE,
+ g_param_spec_boolean (NM_SETTING_WIRELESS_ADHOC_CREATE,
+ "Ad-Hoc Create",
+ "Ad-Hoc Create",
+ FALSE,
+ G_PARAM_READWRITE | NM_SETTING_PARAM_SERIALIZE));
+
+ g_object_class_install_property
(object_class, PROP_BAND,
g_param_spec_string (NM_SETTING_WIRELESS_BAND,
"Band",
Modified: trunk/libnm-util/nm-setting-wireless.h
==============================================================================
--- trunk/libnm-util/nm-setting-wireless.h (original)
+++ trunk/libnm-util/nm-setting-wireless.h Wed May 28 21:30:53 2008
@@ -17,23 +17,25 @@
#define NM_SETTING_WIRELESS_SETTING_NAME "802-11-wireless"
-#define NM_SETTING_WIRELESS_SSID "ssid"
-#define NM_SETTING_WIRELESS_MODE "mode"
-#define NM_SETTING_WIRELESS_BAND "band"
-#define NM_SETTING_WIRELESS_CHANNEL "channel"
-#define NM_SETTING_WIRELESS_BSSID "bssid"
-#define NM_SETTING_WIRELESS_RATE "rate"
-#define NM_SETTING_WIRELESS_TX_POWER "tx-power"
-#define NM_SETTING_WIRELESS_MAC_ADDRESS "mac-address"
-#define NM_SETTING_WIRELESS_MTU "mtu"
-#define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids"
-#define NM_SETTING_WIRELESS_SEC "security"
+#define NM_SETTING_WIRELESS_SSID "ssid"
+#define NM_SETTING_WIRELESS_MODE "mode"
+#define NM_SETTING_WIRELESS_ADHOC_CREATE "adhoc-create"
+#define NM_SETTING_WIRELESS_BAND "band"
+#define NM_SETTING_WIRELESS_CHANNEL "channel"
+#define NM_SETTING_WIRELESS_BSSID "bssid"
+#define NM_SETTING_WIRELESS_RATE "rate"
+#define NM_SETTING_WIRELESS_TX_POWER "tx-power"
+#define NM_SETTING_WIRELESS_MAC_ADDRESS "mac-address"
+#define NM_SETTING_WIRELESS_MTU "mtu"
+#define NM_SETTING_WIRELESS_SEEN_BSSIDS "seen-bssids"
+#define NM_SETTING_WIRELESS_SEC "security"
typedef struct {
NMSetting parent;
GByteArray *ssid;
char *mode;
+ gboolean adhoc_create;
char *band;
guint32 channel;
GByteArray *bssid;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]