Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Jun 2009 05:51:23 GMT
From:      Nikhil Bysani <nikron@FreeBSD.org>
To:        Perforce Change Reviews <perforce@FreeBSD.org>
Subject:   PERFORCE change 164929 for review
Message-ID:  <200906230551.n5N5pNPU043630@repoman.freebsd.org>

next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=164929

Change 164929 by nikron@nmfreebsd on 2009/06/23 05:50:43

	Updates from upstream, changes to configure.ac to ignore gudev and changes in libnm-util to allow compiling.

Affected files ...

.. //depot/projects/soc2009/nm-port/NetworkManager/configure.ac#5 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/libnm-glib/Makefile.am#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/marshallers/nm-marshal.list#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/policy/Makefile.am#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/dhcp-manager/nm-dhcp-manager.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/modem-manager/nm-modem-gsm.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/modem-manager/nm-modem-gsm.h#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/modem-manager/nm-modem.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/modem-manager/nm-modem.h#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/nm-device-ethernet.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/nm-device-ethernet.h#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/supplicant-manager/nm-supplicant-config.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/supplicant-manager/nm-supplicant-interface.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/vpn-manager/nm-vpn-connection.h#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/src/vpn-manager/nm-vpn-service.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/ifcfg-rh/plugin.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/ifcfg-rh/tests/test-ifcfg-rh.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/ifcfg-suse/Makefile.am#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/ifcfg-suse/parser.c#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/keyfile/Makefile.am#4 edit
.. //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/keyfile/plugin.c#4 edit

Differences ...

==== //depot/projects/soc2009/nm-port/NetworkManager/configure.ac#5 (text+ko) ====

@@ -199,6 +199,12 @@
 AC_SUBST(GMODULE_CFLAGS)
 AC_SUBST(GMODULE_LIBS)
 
+if ! (test x"$with_distro" = "xfreebsd"); then
+	PKG_CHECK_MODULES(GUDEV, gudev-1.0)
+	AC_SUBST(GUDEV_CFLAGS)
+	AC_SUBST(GUDEV_LIBS)
+fi
+
 PKG_CHECK_EXISTS(gio-2.0,[have_gio=yes],[have_gio=no])
 if test x"$have_gio" = "xno"; then
 	AC_DEFINE([NO_GIO],[1],[Define if you don't have GIO])
@@ -458,6 +464,7 @@
 src/dnsmasq-manager/Makefile
 src/modem-manager/Makefile
 src/bluez-manager/Makefile
+src/system-settings/Makefile
 src/backends/Makefile
 libnm-util/libnm-util.pc
 libnm-util/Makefile
@@ -470,7 +477,6 @@
 callouts/Makefile
 tools/Makefile
 system-settings/Makefile
-system-settings/src/Makefile
 system-settings/plugins/Makefile
 system-settings/plugins/ifupdown/Makefile
 system-settings/plugins/ifcfg-rh/Makefile

==== //depot/projects/soc2009/nm-port/NetworkManager/libnm-glib/Makefile.am#4 (text+ko) ====

@@ -22,19 +22,19 @@
 
 lib_LTLIBRARIES = libnm_glib.la libnm_glib_vpn.la
 
-libnm_glib_la_CFLAGS = 		\
-	$(GLIB_CFLAGS)		\
-	$(DBUS_CFLAGS)		\
-	$(GCONF_CFLAGS)		\
-	$(GNOME_KEYRING_CFLAGS)
+libnm_glib_la_CFLAGS = \
+	$(GLIB_CFLAGS) \
+	$(DBUS_CFLAGS) \
+	$(GCONF_CFLAGS) \
+	$(GUDEV_CFLAGS)
 
 libnmincludedir = $(includedir)/libnm-glib
 
 libnminclude_HEADERS = \
-	libnm_glib.h		\
-	nm-object.h		\
-	nm-client.h		\
-	nm-device.h		\
+	libnm_glib.h \
+	nm-object.h \
+	nm-client.h \
+	nm-device.h \
 	nm-device-ethernet.h \
 	nm-device-wifi.h \
 	nm-access-point.h \
@@ -54,23 +54,23 @@
 	nm-dhcp4-config.h
 
 libnm_glib_la_SOURCES = \
-	libnm_glib.c		\
-	nm-object.c		\
+	libnm_glib.c \
+	nm-object.c \
 	nm-object-private.h \
-	nm-client.c		\
-	nm-dbus-utils.c		\
-	nm-dbus-utils.h		\
-	nm-device.c		\
-	nm-device-private.h	\
+	nm-client.c \
+	nm-dbus-utils.c \
+	nm-dbus-utils.h \
+	nm-device.c \
+	nm-device-private.h \
 	nm-device-ethernet.c \
 	nm-device-wifi.c \
-	nm-access-point.c	\
-	nm-ip4-config.c		\
-	nm-settings.c		\
-	nm-gsm-device.c	\
-	nm-cdma-device.c	\
+	nm-access-point.c \
+	nm-ip4-config.c \
+	nm-settings.c \
+	nm-gsm-device.c \
+	nm-cdma-device.c \
 	nm-serial-device.c \
-	nm-vpn-connection.c	\
+	nm-vpn-connection.c \
 	nm-types.c \
 	nm-types-private.h \
 	nm-object-cache.c \
@@ -82,12 +82,12 @@
 	nm-dhcp4-config.c
 
 libnm_glib_la_LIBADD = \
-	$(top_builddir)/libnm-util/libnm-util.la	\
-	$(top_builddir)/marshallers/libmarshallers.la	\
-	$(GLIB_LIBS)					\
-	$(DBUS_LIBS)					\
-	$(GCONF_LIBS)					\
-	$(GNOME_KEYRING_LIBS)
+	$(top_builddir)/libnm-util/libnm-util.la \
+	$(top_builddir)/marshallers/libmarshallers.la \
+	$(GLIB_LIBS) \
+	$(DBUS_LIBS) \
+	$(GCONF_LIBS) \
+	$(GUDEV_LIBS)
 
 libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm_glib.ver \
 	-version-info "1:0:1"

==== //depot/projects/soc2009/nm-port/NetworkManager/marshallers/nm-marshal.list#4 (text+ko) ====

@@ -11,7 +11,7 @@
 VOID:STRING,STRING
 VOID:STRING,UCHAR
 VOID:STRING,OBJECT
-VOID:STRING,STRING,POINTER,POINTER
+VOID:POINTER,POINTER
 VOID:STRING,STRING,STRING,UINT
 VOID:OBJECT,UINT,UINT
 VOID:STRING,INT
@@ -20,3 +20,5 @@
 VOID:POINTER,STRING
 POINTER:POINTER
 VOID:STRING,BOXED
+BOOLEAN:POINTER,STRING,BOOLEAN,UINT,STRING,STRING
+

==== //depot/projects/soc2009/nm-port/NetworkManager/policy/Makefile.am#4 (text+ko) ====

@@ -22,3 +22,4 @@
 clean-local :
 	rm -f *~
 
+EXTRA_DIST = $(dist_polkit_policy_in_files)

==== //depot/projects/soc2009/nm-port/NetworkManager/src/dhcp-manager/nm-dhcp-manager.c#4 (text+ko) ====

@@ -508,7 +508,7 @@
 {
 	NMDHCPDevice *device = (NMDHCPDevice *) user_data;
 
-	nm_info ("Device '%s' DHCP transaction took too long (>%ds), stopping it.",
+	nm_info ("(%s): DHCP transaction took too long (>%ds), stopping it.",
 			 device->iface, NM_DHCP_TIMEOUT);
 
 	nm_dhcp_manager_cancel_transaction (device->manager, device->iface);
@@ -698,7 +698,7 @@
 
 	nm_dhcp_client_stop (device, device->pid);
 
-	nm_info ("%s: canceled DHCP transaction, dhcp client pid %d",
+	nm_info ("(%s): canceled DHCP transaction, dhcp client pid %d",
 	         device->iface,
 	         device->pid);
 

==== //depot/projects/soc2009/nm-port/NetworkManager/src/modem-manager/nm-modem-gsm.c#4 (text+ko) ====

@@ -15,15 +15,19 @@
 
 // FIXME: use MM headers when MM exports this stuff
 typedef enum {
-    MM_MODEM_GSM_NETWORK_MODE_ANY       = 0,
-    MM_MODEM_GSM_NETWORK_MODE_GPRS      = 1,
-    MM_MODEM_GSM_NETWORK_MODE_EDGE      = 2,
-    MM_MODEM_GSM_NETWORK_MODE_3G        = 3,
-    MM_MODEM_GSM_NETWORK_MODE_HSDPA     = 4,
-    MM_MODEM_GSM_NETWORK_MODE_PREFER_2G = 5,
-    MM_MODEM_GSM_NETWORK_MODE_PREFER_3G = 6,
+    MM_MODEM_GSM_NETWORK_MODE_ANY          = 0,
+    MM_MODEM_GSM_NETWORK_MODE_GPRS         = 1,
+    MM_MODEM_GSM_NETWORK_MODE_EDGE         = 2,
+    MM_MODEM_GSM_NETWORK_MODE_UMTS         = 3,
+    MM_MODEM_GSM_NETWORK_MODE_HSDPA        = 4,
+    MM_MODEM_GSM_NETWORK_MODE_2G_PREFERRED = 5,
+    MM_MODEM_GSM_NETWORK_MODE_3G_PREFERRED = 6,
+    MM_MODEM_GSM_NETWORK_MODE_2G_ONLY      = 7,
+    MM_MODEM_GSM_NETWORK_MODE_3G_ONLY      = 8,
+    MM_MODEM_GSM_NETWORK_MODE_HSUPA        = 9,
+    MM_MODEM_GSM_NETWORK_MODE_HSPA         = 10,
 
-    MM_MODEM_GSM_NETWORK_MODE_LAST = MM_MODEM_GSM_NETWORK_MODE_PREFER_3G
+    MM_MODEM_GSM_NETWORK_MODE_LAST = MM_MODEM_GSM_NETWORK_MODE_HSPA
 } MMModemGsmNetworkMode;
 
 
@@ -31,13 +35,58 @@
 
 G_DEFINE_TYPE (NMModemGsm, nm_modem_gsm, NM_TYPE_MODEM)
 
+
+typedef enum {
+	NM_GSM_ERROR_CONNECTION_NOT_GSM = 0,
+	NM_GSM_ERROR_CONNECTION_INVALID,
+	NM_GSM_ERROR_CONNECTION_INCOMPATIBLE,
+} NMGsmError;
+
+#define NM_GSM_ERROR (nm_gsm_error_quark ())
+#define NM_TYPE_GSM_ERROR (nm_gsm_error_get_type ())
+
+static GQuark
+nm_gsm_error_quark (void)
+{
+	static GQuark quark = 0;
+	if (!quark)
+		quark = g_quark_from_static_string ("nm-gsm-error");
+	return quark;
+}
+
+/* This should really be standard. */
+#define ENUM_ENTRY(NAME, DESC) { NAME, "" #NAME "", DESC }
+
+static GType
+nm_gsm_error_get_type (void)
+{
+	static GType etype = 0;
+
+	if (etype == 0) {
+		static const GEnumValue values[] = {
+			/* Connection was not a GSM connection. */
+			ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_NOT_GSM, "ConnectionNotGsm"),
+			/* Connection was not a valid GSM connection. */
+			ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_INVALID, "ConnectionInvalid"),
+			/* Connection does not apply to this device. */
+			ENUM_ENTRY (NM_GSM_ERROR_CONNECTION_INCOMPATIBLE, "ConnectionIncompatible"),
+			{ 0, 0, 0 }
+		};
+		etype = g_enum_register_static ("NMGsmError", values);
+	}
+	return etype;
+}
+
+
 NMDevice *
 nm_modem_gsm_new (const char *path,
-				  const char *data_device,
-				  const char *driver,
-				  guint32 ip_method)
+                  const char *device,
+                  const char *data_device,
+                  const char *driver,
+                  guint32 ip_method)
 {
 	g_return_val_if_fail (path != NULL, NULL);
+	g_return_val_if_fail (device != NULL, NULL);
 	g_return_val_if_fail (data_device != NULL, NULL);
 	g_return_val_if_fail (driver != NULL, NULL);
 
@@ -45,9 +94,9 @@
 									  NM_DEVICE_INTERFACE_UDI, path,
 									  NM_DEVICE_INTERFACE_IFACE, data_device,
 									  NM_DEVICE_INTERFACE_DRIVER, driver,
-									  NM_DEVICE_INTERFACE_MANAGED, TRUE,
 									  NM_MODEM_PATH, path,
 									  NM_MODEM_IP_METHOD, ip_method,
+									  NM_MODEM_DEVICE, device,
 									  NULL);
 }
 
@@ -129,12 +178,12 @@
 
 		if (required_secret) {
 			nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE);
-			nm_act_request_request_connection_secrets (nm_device_get_act_request (device),
-													   NM_SETTING_GSM_SETTING_NAME,
-													   retry_secret,
-													   SECRETS_CALLER_GSM,
-													   required_secret,
-													   NULL);
+			nm_act_request_get_secrets (nm_device_get_act_request (device),
+			                            NM_SETTING_GSM_SETTING_NAME,
+			                            retry_secret,
+			                            SECRETS_CALLER_GSM,
+			                            required_secret,
+			                            NULL);
 		} else
 			nm_device_state_changed (device, NM_DEVICE_STATE_FAILED, translate_mm_error (error));
 
@@ -184,10 +233,10 @@
 		value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_MODE_EDGE);
 		break;
 	case NM_GSM_NETWORK_PREFER_UMTS_HSPA:
-		value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_MODE_PREFER_3G);
+		value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_MODE_3G_PREFERRED);
 		break;
 	case NM_GSM_NETWORK_PREFER_GPRS_EDGE:
-		value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_MODE_PREFER_2G);
+		value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_MODE_2G_PREFERRED);
 		break;
 	default:
 		value_hash_add_uint (properties, "network_mode", MM_MODEM_GSM_NETWORK_MODE_ANY);
@@ -237,12 +286,12 @@
 	nm_device_state_changed (device, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_NONE);
 
 	tries = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (connection), GSM_SECRETS_TRIES));
-	nm_act_request_request_connection_secrets (req,
-											   setting_name,
-											   tries ? TRUE : FALSE,
-											   SECRETS_CALLER_GSM,
-											   hint1,
-											   hint2);
+	nm_act_request_get_secrets (req,
+	                            setting_name,
+	                            tries ? TRUE : FALSE,
+	                            SECRETS_CALLER_GSM,
+	                            hint1,
+	                            hint2);
 	g_object_set_data (G_OBJECT (connection), GSM_SECRETS_TRIES, GUINT_TO_POINTER (++tries));
 
 	if (hints)
@@ -337,6 +386,35 @@
 	nm_device_activate_schedule_stage1_device_prepare (dev);
 }
 
+static gboolean
+real_check_connection_compatible (NMDevice *device,
+                                  NMConnection *connection,
+                                  GError **error)
+{
+	NMSettingConnection *s_con;
+	NMSettingGsm *s_gsm;
+
+	s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (connection, NM_TYPE_SETTING_CONNECTION));
+	g_assert (s_con);
+
+	if (strcmp (nm_setting_connection_get_connection_type (s_con), NM_SETTING_GSM_SETTING_NAME)) {
+		g_set_error (error,
+		             NM_GSM_ERROR, NM_GSM_ERROR_CONNECTION_NOT_GSM,
+		             "The connection was not a GSM connection.");
+		return FALSE;
+	}
+
+	s_gsm = NM_SETTING_GSM (nm_connection_get_setting (connection, NM_TYPE_SETTING_GSM));
+	if (!s_gsm) {
+		g_set_error (error,
+		             NM_GSM_ERROR, NM_GSM_ERROR_CONNECTION_INVALID,
+		             "The connection was not a valid GSM connection.");
+		return FALSE;
+	}
+
+	return TRUE;
+}
+
 static const char *
 real_get_ppp_name (NMModem *device, NMConnection *connection)
 {
@@ -366,8 +444,12 @@
 	device_class->get_best_auto_connection = real_get_best_auto_connection;
 	device_class->connection_secrets_updated = real_connection_secrets_updated;
 	device_class->act_stage1_prepare = real_act_stage1_prepare;
+	device_class->check_connection_compatible = real_check_connection_compatible;
+
 	modem_class->get_ppp_name = real_get_ppp_name;
 
 	dbus_g_object_type_install_info (G_TYPE_FROM_CLASS (klass),
 									 &dbus_glib_nm_device_gsm_object_info);
+
+	dbus_g_error_domain_register (NM_GSM_ERROR, NULL, NM_TYPE_GSM_ERROR);
 }

==== //depot/projects/soc2009/nm-port/NetworkManager/src/modem-manager/nm-modem-gsm.h#4 (text+ko) ====

@@ -28,9 +28,10 @@
 GType nm_modem_gsm_get_type (void);
 
 NMDevice *nm_modem_gsm_new (const char *path,
-							const char *data_device,
-							const char *driver,
-							guint32 ip_method);
+                            const char *device,
+                            const char *data_device,
+                            const char *driver,
+                            guint32 ip_method);
 
 G_END_DECLS
 

==== //depot/projects/soc2009/nm-port/NetworkManager/src/modem-manager/nm-modem.c#4 (text+ko) ====

@@ -21,6 +21,7 @@
 
 enum {
 	PROP_0,
+	PROP_DEVICE,
 	PROP_PATH,
 	PROP_IP_METHOD,
 
@@ -34,6 +35,7 @@
 	NMPPPManager *ppp_manager;
 	NMIP4Config	 *pending_ip4_config;
 	guint32 ip_method;
+	char *device;
 
 	guint state_to_disconnected_id;
 
@@ -503,6 +505,11 @@
 
 	priv = NM_MODEM_GET_PRIVATE (object);
 
+	if (!priv->device) {
+		g_warning ("Modem device not provided");
+		goto err;
+	}
+
 	if (!priv->path) {
 		g_warning ("DBus path not provided");
 		goto err;
@@ -530,6 +537,9 @@
 	case PROP_PATH:
 		g_value_set_string (value, priv->path);
 		break;
+	case PROP_DEVICE:
+		g_value_set_string (value, priv->device);
+		break;
 	case PROP_IP_METHOD:
 		g_value_set_uint (value, priv->ip_method);
 		break;
@@ -551,6 +561,10 @@
 		/* Construct only */
 		priv->path = g_value_dup_string (value);
 		break;
+	case PROP_DEVICE:
+		/* Construct only */
+		priv->device = g_value_dup_string (value);
+		break;
 	case PROP_IP_METHOD:
 		priv->ip_method = g_value_get_uint (value);
 		break;
@@ -575,6 +589,9 @@
 
 	g_object_unref (priv->dbus_mgr);
 
+	g_free (priv->path);
+	g_free (priv->device);
+
 	G_OBJECT_CLASS (nm_modem_parent_class)->finalize (object);
 }
 
@@ -610,6 +627,14 @@
 							  G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
 
 	g_object_class_install_property
+		(object_class, PROP_DEVICE,
+		 g_param_spec_string (NM_MODEM_DEVICE,
+		                      "Device",
+		                      "Master modem parent device",
+		                      NULL,
+		                      G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
+	g_object_class_install_property
 		(object_class, PROP_IP_METHOD,
 		 g_param_spec_uint (NM_MODEM_IP_METHOD,
 							"IP method",

==== //depot/projects/soc2009/nm-port/NetworkManager/src/modem-manager/nm-modem.h#4 (text+ko) ====

@@ -17,6 +17,7 @@
 #define NM_MODEM_GET_CLASS(obj)	(G_TYPE_INSTANCE_GET_CLASS ((obj),	NM_TYPE_MODEM, NMModemClass))
 
 #define NM_MODEM_PATH      "path"
+#define NM_MODEM_DEVICE    "device"
 #define NM_MODEM_IP_METHOD "ip-method"
 
 typedef struct {

==== //depot/projects/soc2009/nm-port/NetworkManager/src/nm-device-ethernet.c#4 (text+ko) ====

@@ -104,6 +104,7 @@
 
 	struct ether_addr	hw_addr;
 	gboolean			carrier;
+	guint32				ifindex;
 	guint				state_to_disconnected_id;
 
 	char *			carrier_file_path;
@@ -131,6 +132,7 @@
 	PROP_HW_ADDRESS,
 	PROP_SPEED,
 	PROP_CARRIER,
+	PROP_IFINDEX,
 
 	LAST_PROP
 };
@@ -386,7 +388,7 @@
 nm_device_ethernet_new (const char *udi,
 						const char *iface,
 						const char *driver,
-						gboolean managed)
+						guint32 ifindex)
 {
 	g_return_val_if_fail (udi != NULL, NULL);
 	g_return_val_if_fail (iface != NULL, NULL);
@@ -396,7 +398,7 @@
 										 NM_DEVICE_INTERFACE_UDI, udi,
 										 NM_DEVICE_INTERFACE_IFACE, iface,
 										 NM_DEVICE_INTERFACE_DRIVER, driver,
-										 NM_DEVICE_INTERFACE_MANAGED, managed,
+										 NM_DEVICE_ETHERNET_IFINDEX, ifindex,
 										 NULL);
 }
 
@@ -427,6 +429,14 @@
 	return NM_DEVICE_ETHERNET_GET_PRIVATE (self)->carrier;
 }
 
+guint32
+nm_device_ethernet_get_ifindex (NMDeviceEthernet *self)
+{
+	g_return_val_if_fail (self != NULL, FALSE);
+
+	return NM_DEVICE_ETHERNET_GET_PRIVATE (self)->ifindex;
+}
+
 /* Returns speed in Mb/s */
 static guint32
 nm_device_ethernet_get_speed (NMDeviceEthernet *self)
@@ -801,8 +811,12 @@
 	supplicant_interface_release (self);
 
 	nm_device_state_changed (dev, NM_DEVICE_STATE_NEED_AUTH, NM_DEVICE_STATE_REASON_SUPPLICANT_DISCONNECT);
-	nm_act_request_request_connection_secrets (req, setting_name, TRUE,
-	                                           SECRETS_CALLER_ETHERNET, NULL, NULL);
+	nm_act_request_get_secrets (req,
+	                            setting_name,
+	                            TRUE,
+	                            SECRETS_CALLER_ETHERNET,
+	                            NULL,
+	                            NULL);
 
 	return FALSE;
 
@@ -1078,8 +1092,12 @@
 		 * only ask for new secrets after the first failure.
 		 */
 		get_new = new_secrets ? TRUE : (tries ? TRUE : FALSE);
-		nm_act_request_request_connection_secrets (req, setting_name, get_new,
-		                                           SECRETS_CALLER_ETHERNET, NULL, NULL);
+		nm_act_request_get_secrets (req,
+		                            setting_name,
+		                            get_new,
+		                            SECRETS_CALLER_ETHERNET,
+		                            NULL,
+		                            NULL);
 
 		g_object_set_data (G_OBJECT (connection), WIRED_SECRETS_TRIES, GUINT_TO_POINTER (++tries));
 	} else
@@ -1445,6 +1463,21 @@
 	return TRUE;
 }
 
+static gboolean
+spec_match_list (NMDevice *device, const GSList *specs)
+{
+	struct ether_addr ether;
+	char *hwaddr;
+	gboolean matched;
+
+	nm_device_ethernet_get_address (NM_DEVICE_ETHERNET (device), &ether);
+	hwaddr = nm_ether_ntop (&ether);
+	matched = nm_match_spec_hwaddr (specs, hwaddr);
+	g_free (hwaddr);
+
+	return matched;
+}
+
 static void
 nm_device_ethernet_dispose (GObject *object)
 {
@@ -1512,13 +1545,32 @@
 	case PROP_CARRIER:
 		g_value_set_boolean (value, nm_device_ethernet_get_carrier (device));
 		break;
+	case PROP_IFINDEX:
+		g_value_set_uint (value, nm_device_ethernet_get_ifindex (device));
+		break;
 	default:
 		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
 		break;
 	}
 }
 
+static void
+set_property (GObject *object, guint prop_id,
+			  const GValue *value, GParamSpec *pspec)
+{
+	NMDeviceEthernetPrivate *priv = NM_DEVICE_ETHERNET_GET_PRIVATE (object);
 
+	switch (prop_id) {
+	case PROP_IFINDEX:
+		/* construct-only */
+		priv->ifindex = g_value_get_uint (value);
+		break;
+	default:
+		G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
+		break;
+	}
+}
+
 static void
 nm_device_ethernet_class_init (NMDeviceEthernetClass *klass)
 {
@@ -1531,6 +1583,7 @@
 	object_class->constructor = constructor;
 	object_class->dispose = nm_device_ethernet_dispose;
 	object_class->get_property = get_property;
+	object_class->set_property = set_property;
 	object_class->finalize = nm_device_ethernet_finalize;
 
 	parent_class->get_generic_capabilities = real_get_generic_capabilities;
@@ -1550,6 +1603,7 @@
 	parent_class->act_stage2_config = real_act_stage2_config;
 	parent_class->act_stage4_get_ip4_config = real_act_stage4_get_ip4_config;
 	parent_class->deactivate_quickly = real_deactivate_quickly;
+	parent_class->spec_match_list = spec_match_list;
 
 	/* properties */
 	g_object_class_install_property
@@ -1576,6 +1630,14 @@
 							   FALSE,
 							   G_PARAM_READABLE));
 
+	g_object_class_install_property
+		(object_class, PROP_IFINDEX,
+		 g_param_spec_uint (NM_DEVICE_ETHERNET_IFINDEX,
+						   "Ifindex",
+						   "Interface index",
+						   0, G_MAXUINT32, 0,
+						   G_PARAM_READWRITE | G_PARAM_CONSTRUCT_ONLY));
+
 	/* Signals */
 	signals[PROPERTIES_CHANGED] = 
 		nm_properties_changed_signal_new (object_class,

==== //depot/projects/soc2009/nm-port/NetworkManager/src/nm-device-ethernet.h#4 (text+ko) ====

@@ -39,6 +39,7 @@
 #define NM_DEVICE_ETHERNET_HW_ADDRESS "hw-address"
 #define NM_DEVICE_ETHERNET_SPEED "speed"
 #define NM_DEVICE_ETHERNET_CARRIER "carrier"
+#define NM_DEVICE_ETHERNET_IFINDEX "ifindex"
 
 typedef struct {
 	NMDevice parent;
@@ -56,15 +57,17 @@
 
 
 NMDeviceEthernet *nm_device_ethernet_new (const char *udi,
-										  const char *iface,
-										  const char *driver,
-										  gboolean managed);
+                                          const char *iface,
+                                          const char *driver,
+                                          guint32 ifindex);
 
 void nm_device_ethernet_get_address (NMDeviceEthernet *dev,
 								   struct ether_addr *addr);
 
 gboolean nm_device_ethernet_get_carrier (NMDeviceEthernet *dev);
 
+guint32 nm_device_ethernet_get_ifindex (NMDeviceEthernet *dev);
+
 G_END_DECLS
 
 #endif	/* NM_DEVICE_ETHERNET_H */

==== //depot/projects/soc2009/nm-port/NetworkManager/src/supplicant-manager/nm-supplicant-config.c#4 (text+ko) ====

@@ -609,7 +609,7 @@
 				nm_warning ("Error adding 'psk' to supplicant config.");
 				return FALSE;
 			}
-		} else if (psk_len >= 8 && psk_len < 63) {
+		} else if (psk_len >= 8 && psk_len <= 63) {
 			/* Use TYPE_STRING here so that it gets pushed to the
 			 * supplicant as a string, and therefore gets quoted,
 			 * and therefore the supplicant will interpret it as a

==== //depot/projects/soc2009/nm-port/NetworkManager/src/supplicant-manager/nm-supplicant-interface.c#4 (text+ko) ====

@@ -282,10 +282,13 @@
 }
 
 static void
-try_remove_iface (DBusGConnection * g_connection,
-                  const char * path)
+try_remove_iface (DBusGConnection *g_connection,
+                  const char *path)
 {
-	DBusGProxy * proxy;
+	DBusGProxy *proxy;
+
+	g_return_if_fail (g_connection != NULL);
+	g_return_if_fail (path != NULL);
 
 	proxy = dbus_g_proxy_new_for_name (g_connection,
 	                                   WPAS_DBUS_SERVICE,
@@ -316,8 +319,10 @@
 	/* Ask wpa_supplicant to remove this interface */
 	sm_state = nm_supplicant_manager_get_state (priv->smgr);
 	if (sm_state == NM_SUPPLICANT_MANAGER_STATE_IDLE) {
-		try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr),
-		                  priv->object_path);
+		if (priv->object_path) {
+			try_remove_iface (nm_dbus_manager_get_connection (priv->dbus_mgr),
+			                  priv->object_path);
+		}
 	}
 
 	if (priv->iface_proxy)

==== //depot/projects/soc2009/nm-port/NetworkManager/src/vpn-manager/nm-vpn-connection.h#4 (text+ko) ====

@@ -27,6 +27,7 @@
 #include "NetworkManagerVPN.h"
 #include "nm-device.h"
 #include "nm-activation-request.h"
+#include "nm-secrets-provider-interface.h"
 
 #define NM_TYPE_VPN_CONNECTION            (nm_vpn_connection_get_type ())
 #define NM_VPN_CONNECTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_VPN_CONNECTION, NMVPNConnection))
@@ -72,6 +73,6 @@
 NMIP4Config *        nm_vpn_connection_get_ip4_config  (NMVPNConnection *connection);
 const char *         nm_vpn_connection_get_ip_iface    (NMVPNConnection *connection);
 NMDevice *           nm_vpn_connection_get_parent_device (NMVPNConnection *connection);
-guint32        nm_vpn_connection_get_ip4_internal_gateway (NMVPNConnection *connection);
+guint32              nm_vpn_connection_get_ip4_internal_gateway (NMVPNConnection *connection);
 
 #endif /* NM_VPN_CONNECTION_H */

==== //depot/projects/soc2009/nm-port/NetworkManager/src/vpn-manager/nm-vpn-service.c#4 (text+ko) ====

@@ -323,6 +323,7 @@
 
 	priv = NM_VPN_SERVICE_GET_PRIVATE (service);
 
+g_message ("%s: new VPNConnection for %s", __func__, nm_connection_get_path (connection));
 	vpn = nm_vpn_connection_new (connection, act_request, device);
 	g_signal_connect (vpn, "vpn-state-changed",
 				   G_CALLBACK (connection_vpn_state_changed),

==== //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/ifcfg-rh/nm-ifcfg-connection.h#4 (text+ko) ====

@@ -25,7 +25,6 @@
 
 #include <NetworkManager.h>
 #include <nm-sysconfig-connection.h>
-#include "nm-system-config-hal-manager.h"
 
 #define NM_TYPE_IFCFG_CONNECTION            (nm_ifcfg_connection_get_type ())
 #define NM_IFCFG_CONNECTION(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_IFCFG_CONNECTION, NMIfcfgConnection))
@@ -49,16 +48,12 @@
 GType nm_ifcfg_connection_get_type (void);
 
 NMIfcfgConnection *nm_ifcfg_connection_new (const char *filename,
-                                            DBusGConnection *g_connection,
-                                            NMSystemConfigHalManager *hal_mgr,
                                             GError **error,
                                             gboolean *ignore_error);
 
 const char *nm_ifcfg_connection_get_filename (NMIfcfgConnection *self);
 
-const char *nm_ifcfg_connection_get_udi (NMIfcfgConnection *self);
-
-gboolean nm_ifcfg_connection_get_unmanaged (NMIfcfgConnection *self);
+const char *nm_ifcfg_connection_get_unmanaged_spec (NMIfcfgConnection *self);
 
 gboolean nm_ifcfg_connection_update (NMIfcfgConnection *self,
                                      GHashTable *new_settings,

==== //depot/projects/soc2009/nm-port/NetworkManager/system-settings/plugins/ifcfg-rh/plugin.c#4 (text+ko) ====

@@ -72,9 +72,6 @@
 
 
 typedef struct {
-	DBusGConnection *g_connection;
-	NMSystemConfigHalManager *hal_mgr;
-
 	GHashTable *connections;
 
 	gulong ih_event_id;
@@ -87,40 +84,6 @@
 
 
 static void
-check_unmanaged (gpointer key, gpointer data, gpointer user_data)
-{
-	GSList **list = (GSList **) user_data;
-	NMIfcfgConnection *connection = NM_IFCFG_CONNECTION (data);
-	const char *udi;
-	GSList *iter;
-
-	if (!nm_ifcfg_connection_get_unmanaged (connection))
-		return;
-
-	udi = nm_ifcfg_connection_get_udi (connection);
-	if (!udi)
-		return;
-
-	/* Just return if the UDI is already in the list */
-	for (iter = *list; iter; iter = g_slist_next (iter)) {
-		if (!strcmp ((char *) iter->data, udi))
-			return;
-	}
-
-	*list = g_slist_prepend (*list, g_strdup (udi));
-}
-
-static GSList *
-get_unmanaged_devices (NMSystemConfigInterface *config)
-{
-	SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (config);	
-	GSList *list = NULL;
-
-	g_hash_table_foreach (priv->connections, check_unmanaged, &list);
-	return list;
-}
-
-static void
 connection_unmanaged_changed (NMIfcfgConnection *connection,
                               GParamSpec *pspec,
                               gpointer user_data)
@@ -152,7 +115,7 @@
 
 	PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "parsing %s ... ", filename);
 
-	connection = nm_ifcfg_connection_new (filename, priv->g_connection, priv->hal_mgr, &error, &ignore_error);
+	connection = nm_ifcfg_connection_new (filename, &error, &ignore_error);
 	if (connection) {
 		NMConnection *wrapped;
 		NMSettingConnection *s_con;
@@ -171,7 +134,7 @@
 		                     g_object_ref (connection));
 		PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "    read connection '%s'", cid);
 
-		if (nm_ifcfg_connection_get_unmanaged (connection)) {
+		if (nm_ifcfg_connection_get_unmanaged_spec (connection)) {
 			PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "Ignoring connection '%s' and its "
 			              "device because NM_CONTROLLED was false.", cid);
 			g_signal_emit_by_name (plugin, "unmanaged-devices-changed");
@@ -271,11 +234,11 @@
                             gboolean *do_remove,
                             gboolean *do_new)
 {
-	SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (plugin);
 	NMIfcfgConnection *tmp;
 	GError *error = NULL;
 	GHashTable *settings;
-	gboolean new_unmanaged, old_unmanaged, ignore_error = FALSE;
+	gboolean ignore_error = FALSE;
+	const char *new_unmanaged = NULL, *old_unmanaged = NULL;
 
 	g_return_if_fail (plugin != NULL);
 	g_return_if_fail (path != NULL);
@@ -285,10 +248,7 @@
 
 	PLUGIN_PRINT (IFCFG_PLUGIN_NAME, "updating %s", path);
 
-	tmp = (NMIfcfgConnection *) nm_ifcfg_connection_new (path, priv->g_connection,
-	                                                     priv->hal_mgr,
-	                                                     &error,
-	                                                     &ignore_error);
+	tmp = (NMIfcfgConnection *) nm_ifcfg_connection_new (path, &error, &ignore_error);
 	if (!tmp) {
 		/* errors reading connection; remove it */
 		if (!ignore_error) {
@@ -304,8 +264,8 @@
 
 	/* Successfully read connection changes */
 
-	old_unmanaged = nm_ifcfg_connection_get_unmanaged (NM_IFCFG_CONNECTION (connection));
-	new_unmanaged = nm_ifcfg_connection_get_unmanaged (NM_IFCFG_CONNECTION (tmp));
+	old_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (connection));
+	new_unmanaged = nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (tmp));
 
 	if (new_unmanaged) {
 		if (!old_unmanaged) {
@@ -318,7 +278,7 @@
 		new_wrapped = nm_exported_connection_get_connection (NM_EXPORTED_CONNECTION (tmp));
 		old_wrapped = nm_exported_connection_get_connection (NM_EXPORTED_CONNECTION (connection));
 
-		if (old_unmanaged) {  /* no longer unmanaged */
+		if (old_unmanaged) {  /* now managed */
 			NMSettingConnection *s_con;
 			const char *cid;
 
@@ -364,11 +324,11 @@
 	g_return_if_fail (path != NULL);
 
 	if (do_remove) {
-		gboolean unmanaged;
+		const char *unmanaged;
 
 		g_return_if_fail (connection != NULL);
 
-		unmanaged = nm_ifcfg_connection_get_unmanaged (connection);
+		unmanaged = nm_ifcfg_connection_get_unmanaged_spec (connection);
 		g_hash_table_remove (priv->connections, path);
 		nm_exported_connection_signal_removed (NM_EXPORTED_CONNECTION (connection));
 
@@ -380,7 +340,7 @@
 	if (do_new) {
 		connection = read_one_connection (plugin, path);
 		if (connection) {
-			if (!nm_ifcfg_connection_get_unmanaged (NM_IFCFG_CONNECTION (connection)))
+			if (!nm_ifcfg_connection_get_unmanaged_spec (NM_IFCFG_CONNECTION (connection)))
 				g_signal_emit_by_name (plugin, "connection-added", connection);
 		}
 	}
@@ -454,7 +414,7 @@
 	NMIfcfgConnection *exported = NM_IFCFG_CONNECTION (value);
 	GSList **list = (GSList **) user_data;
 
-	if (!nm_ifcfg_connection_get_unmanaged (exported))
+	if (!nm_ifcfg_connection_get_unmanaged_spec (exported))
 		*list = g_slist_prepend (*list, value);
 }
 
@@ -475,6 +435,43 @@
 	return list;
 }
 
+static void
+check_unmanaged (gpointer key, gpointer data, gpointer user_data)
+{
+	GSList **list = (GSList **) user_data;
+	NMIfcfgConnection *connection = NM_IFCFG_CONNECTION (data);
+	const char *unmanaged_spec;
+	GSList *iter;
+
+	unmanaged_spec = nm_ifcfg_connection_get_unmanaged_spec (connection);
+	if (!unmanaged_spec)
+		return;
+
+	/* Just return if the unmanaged spec is already in the list */
+	for (iter = *list; iter; iter = g_slist_next (iter)) {
+		if (!strcmp ((char *) iter->data, unmanaged_spec))
+			return;
+	}
+
+	*list = g_slist_prepend (*list, g_strdup (unmanaged_spec));
+}
+
+static GSList *
+get_unmanaged_specs (NMSystemConfigInterface *config)
+{
+	SCPluginIfcfg *plugin = SC_PLUGIN_IFCFG (config);
+	SCPluginIfcfgPrivate *priv = SC_PLUGIN_IFCFG_GET_PRIVATE (config);
+	GSList *list = NULL;
+
+	if (!priv->connections) {
+		setup_ifcfg_monitoring (plugin);
+		read_connections (plugin);
+	}
+
+	g_hash_table_foreach (priv->connections, check_unmanaged, &list);
+	return list;
+}

>>> TRUNCATED FOR MAIL (1000 lines) <<<



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200906230551.n5N5pNPU043630>