summary refs log tree commit diff
path: root/libnm-glib
diff options
context:
space:
mode:
authorMichael Biebl <biebl@debian.org>2011-03-18 20:17:47 +0100
committerMichael Biebl <biebl@debian.org>2011-03-18 20:17:47 +0100
commite22c6e05e9ebc6cce941762020c5710b8014677b (patch)
tree7e9fd7f8ae24a94b03f683e0cef9a346968e1e8b /libnm-glib
parenta6b89d35fabd9f5934b84d7cde22e9268f92c3d3 (diff)
Imported Upstream version 0.8.3.998 upstream/0.8.3.998
Diffstat (limited to 'libnm-glib')
-rw-r--r--libnm-glib/Makefile.am4
-rw-r--r--libnm-glib/Makefile.in9
-rw-r--r--libnm-glib/libnm-glib-test.c5
-rw-r--r--libnm-glib/libnm-glib.ver5
-rw-r--r--libnm-glib/nm-client.c4
-rw-r--r--libnm-glib/nm-device.c14
-rw-r--r--libnm-glib/nm-exported-connection.c21
7 files changed, 51 insertions, 11 deletions
diff --git a/libnm-glib/Makefile.am b/libnm-glib/Makefile.am
index ec21a328..0c5fa137 100644
--- a/libnm-glib/Makefile.am
+++ b/libnm-glib/Makefile.am
@@ -52,7 +52,6 @@ lib_LTLIBRARIES = libnm-glib.la libnm-glib-vpn.la
 libnm_glib_la_CFLAGS = \
 	$(GLIB_CFLAGS) \
 	$(DBUS_CFLAGS) \
-	$(GCONF_CFLAGS) \
 	$(GUDEV_CFLAGS)
 
 libnmincludedir = $(includedir)/libnm-glib
@@ -128,11 +127,10 @@ libnm_glib_la_LIBADD = \
 	$(builddir)/libdeprecated-nm-glib.la \
 	$(GLIB_LIBS) \
 	$(DBUS_LIBS) \
-	$(GCONF_LIBS) \
 	$(GUDEV_LIBS)
 
 libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \
-	-version-info "6:2:4"
+	-version-info "6:3:4"
 
 noinst_PROGRAMS = libnm-glib-test
 
diff --git a/libnm-glib/Makefile.in b/libnm-glib/Makefile.in
index 1c8af1a2..822974dc 100644
--- a/libnm-glib/Makefile.in
+++ b/libnm-glib/Makefile.in
@@ -269,6 +269,10 @@ MSGFMT_OPTS = @MSGFMT_OPTS@
 MSGMERGE = @MSGMERGE@
 NM = @NM@
 NMEDIT = @NMEDIT@
+NM_MAJOR_VERSION = @NM_MAJOR_VERSION@
+NM_MICRO_VERSION = @NM_MICRO_VERSION@
+NM_MINOR_VERSION = @NM_MINOR_VERSION@
+NM_VERSION = @NM_VERSION@
 NSS_CFLAGS = @NSS_CFLAGS@
 NSS_LIBS = @NSS_LIBS@
 OBJDUMP = @OBJDUMP@
@@ -283,6 +287,7 @@ PACKAGE_TARNAME = @PACKAGE_TARNAME@
 PACKAGE_URL = @PACKAGE_URL@
 PACKAGE_VERSION = @PACKAGE_VERSION@
 PATH_SEPARATOR = @PATH_SEPARATOR@
+PKGCONFIG_PATH = @PKGCONFIG_PATH@
 PKG_CONFIG = @PKG_CONFIG@
 PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
 PKG_CONFIG_PATH = @PKG_CONFIG_PATH@
@@ -410,7 +415,6 @@ lib_LTLIBRARIES = libnm-glib.la libnm-glib-vpn.la
 libnm_glib_la_CFLAGS = \
 	$(GLIB_CFLAGS) \
 	$(DBUS_CFLAGS) \
-	$(GCONF_CFLAGS) \
 	$(GUDEV_CFLAGS)
 
 libnmincludedir = $(includedir)/libnm-glib
@@ -485,11 +489,10 @@ libnm_glib_la_LIBADD = \
 	$(builddir)/libdeprecated-nm-glib.la \
 	$(GLIB_LIBS) \
 	$(DBUS_LIBS) \
-	$(GCONF_LIBS) \
 	$(GUDEV_LIBS)
 
 libnm_glib_la_LDFLAGS = -Wl,--version-script=$(srcdir)/libnm-glib.ver \
-	-version-info "6:2:4"
+	-version-info "6:3:4"
 
 libnm_glib_test_SOURCES = libnm-glib-test.c
 libnm_glib_test_CFLAGS = $(GLIB_CFLAGS) $(DBUS_CFLAGS)
diff --git a/libnm-glib/libnm-glib-test.c b/libnm-glib/libnm-glib-test.c
index 3ac0a24c..6284feca 100644
--- a/libnm-glib/libnm-glib-test.c
+++ b/libnm-glib/libnm-glib-test.c
@@ -203,7 +203,7 @@ dump_wireless (NMDeviceWifi *device)
 
 	g_print ("AccessPoints:\n");
 	aps = nm_device_wifi_get_access_points (device);
-	for (i = 0; i < aps->len; i++) {
+	for (i = 0; aps && (i < aps->len); i++) {
 		dump_access_point (NM_ACCESS_POINT (g_ptr_array_index (aps, i)));
 		g_print ("\n");
 	}
@@ -320,7 +320,8 @@ test_get_active_connections (NMClient *client)
 
 		g_print ("    %s\n", nm_object_get_path (g_ptr_array_index (connections, i)));
 		devices = nm_active_connection_get_devices (g_ptr_array_index (connections, i));
-		g_ptr_array_foreach ((GPtrArray *) devices, show_active_connection_device, NULL);
+		if (devices)
+			g_ptr_array_foreach ((GPtrArray *) devices, show_active_connection_device, NULL);
 	}
 }
 
diff --git a/libnm-glib/libnm-glib.ver b/libnm-glib/libnm-glib.ver
index 1596afaa..22fc0e24 100644
--- a/libnm-glib/libnm-glib.ver
+++ b/libnm-glib/libnm-glib.ver
@@ -69,6 +69,7 @@ global:
 	nm_device_ethernet_new;
 	nm_device_get_capabilities;
 	nm_device_get_dhcp4_config;
+	nm_device_get_dhcp6_config;
 	nm_device_get_driver;
 	nm_device_get_firmware_missing;
 	nm_device_get_iface;
@@ -95,6 +96,10 @@ global:
 	nm_dhcp4_config_get_options;
 	nm_dhcp4_config_get_type;
 	nm_dhcp4_config_new;
+	nm_dhcp6_config_get_one_option;
+	nm_dhcp6_config_get_options;
+	nm_dhcp6_config_get_type;
+	nm_dhcp6_config_new;
 	nm_exported_connection_export;
 	nm_exported_connection_get_type;
 	nm_exported_connection_new;
diff --git a/libnm-glib/nm-client.c b/libnm-glib/nm-client.c
index 88fe15b5..1de7b863 100644
--- a/libnm-glib/nm-client.c
+++ b/libnm-glib/nm-client.c
@@ -18,7 +18,7 @@
  * Boston, MA 02110-1301 USA.
  *
  * Copyright (C) 2007 - 2008 Novell, Inc.
- * Copyright (C) 2007 - 2010 Red Hat, Inc.
+ * Copyright (C) 2007 - 2011 Red Hat, Inc.
  */
 
 #include <dbus/dbus-glib.h>
@@ -1244,7 +1244,7 @@ nm_client_get_state (NMClient *client)
  *
  * Whether networking is enabled or disabled.
  *
- * Returns: %TRUE if networking is disabled, %FALSE if networking is enabled
+ * Returns: %TRUE if networking is enabled, %FALSE if networking is disabled
  **/
 gboolean
 nm_client_networking_get_enabled (NMClient *client)
diff --git a/libnm-glib/nm-device.c b/libnm-glib/nm-device.c
index ea2a91d1..b8998f70 100644
--- a/libnm-glib/nm-device.c
+++ b/libnm-glib/nm-device.c
@@ -477,6 +477,20 @@ nm_device_class_init (NMDeviceClass *device_class)
 						  G_PARAM_READABLE));
 
 	/**
+	 * NMDevice:ip-interface:
+	 *
+	 * The IP interface of the device which should be used for all IP-related
+	 * operations like addressing and routing.
+	 **/
+	g_object_class_install_property
+		(object_class, PROP_IP_INTERFACE,
+		 g_param_spec_string (NM_DEVICE_IP_INTERFACE,
+						  "IP Interface",
+						  "IP Interface name",
+						  NULL,
+						  G_PARAM_READABLE));
+
+	/**
 	 * NMDevice:udi:
 	 *
 	 * The Unique Device Identifier of the device.
diff --git a/libnm-glib/nm-exported-connection.c b/libnm-glib/nm-exported-connection.c
index 3a8e51ce..b0e974cd 100644
--- a/libnm-glib/nm-exported-connection.c
+++ b/libnm-glib/nm-exported-connection.c
@@ -17,7 +17,7 @@
  * Boston, MA 02110-1301 USA.
  *
  * (C) Copyright 2008 Novell, Inc.
- * (C) Copyright 2008 - 2009 Red Hat, Inc.
+ * (C) Copyright 2008 - 2011 Red Hat, Inc.
  */
 
 #include <NetworkManager.h>
@@ -64,11 +64,16 @@ typedef struct {
 
 /**************************************************************/
 
+/* Has to be the same as NM_SYSCONFIG_SETTINGS_TIMESTAMP_TAG in nm-sysconfig-settings.h */
+#define CONNECTION_TIMESTAMP_TAG "timestamp-tag"
+
 static GHashTable *
 real_get_settings (NMExportedConnection *self, GError **error)
 {
 	NMConnection *no_secrets;
 	GHashTable *settings;
+	NMSettingConnection *s_con;
+	guint64 *timestamp;
 
 	/* Secrets should *never* be returned by the GetSettings method, they
 	 * get returned by the GetSecrets method which can be better
@@ -77,6 +82,20 @@ real_get_settings (NMExportedConnection *self, GError **error)
 	no_secrets = nm_connection_duplicate (NM_CONNECTION (self));
 	g_assert (no_secrets);
 	nm_connection_clear_secrets (no_secrets);
+
+	/* Timestamp is not updated internally in connection's 'timestamp'
+	 * property, because it would force updating the connection and in turn
+	 * writing to /etc periodically, which we want to avoid. Rather real
+	 * timestamps are kept track of in data associated with GObject.
+	 * Here we substitute connection's timestamp with the real one.
+	 */
+	timestamp = (guint64 *) g_object_get_data (G_OBJECT (self), CONNECTION_TIMESTAMP_TAG);
+	if (timestamp) {
+		s_con = NM_SETTING_CONNECTION (nm_connection_get_setting (NM_CONNECTION (no_secrets), NM_TYPE_SETTING_CONNECTION));
+		g_assert (s_con);
+		g_object_set (s_con, NM_SETTING_CONNECTION_TIMESTAMP, *timestamp, NULL);
+	}
+
 	settings = nm_connection_to_hash (no_secrets);
 	g_assert (settings);
 	g_object_unref (no_secrets);