about summary refs log tree commit diff
path: root/libnm/nm-remote-connection.c
diff options
context:
space:
mode:
authorSebastien Bacher <seb128@ubuntu.com>2018-08-24 11:00:09 +0200
committerSebastien Bacher <seb128@ubuntu.com>2018-08-24 11:06:47 +0200
commitb7db94545968c37886b7111d8c85f62eb063fbb4 (patch)
tree7c2aedd497b1fdcb26bf9d49f98cc63a530baf2e /libnm/nm-remote-connection.c
parent9d5cdc3adde9e7e57bf5a0e754e563b6a9e8e513 (diff)
parentcaf1db9d6fbc056cc6c76a24574890f6c7895f3d (diff)
Import Debian changes 1.12.2-0ubuntu3
network-manager (1.12.2-0ubuntu3) cosmic; urgency=medium

  * debian/rules:
    - use --with-libnm-glib, the default reversed since that's a legacy
      library but we still need it for unity-control-center

network-manager (1.12.2-0ubuntu2) cosmic; urgency=medium

  * debian/patches/git-newglib-test.patch:
    - backport upstream commit to fix the tests with the new glib 

network-manager (1.12.2-0ubuntu1) cosmic; urgency=medium

  * New upstream version
  * d/p/libnm-register-empty-NMClient-and-NetworkManager-when-loa.patch,
    d/p/e91f1a7d2a6b8400b6b331d5b72287dcb5164a39.patch,
    d/p/git_thunderbolt_connect.patch:
    - removed, those changes are in the new version
  * Backport Debian changes
  * Update symbols file for libnm0
  * Enable iwd support
  * Drop version requirements when oldstable ships a newer version
  * Drop dh_strip override, the dbgsym migration is done
  * Rebase patches
  * Make sure the example server.conf is actually installed
  * Update install path for plugins, it now includes a version number
  * Drop libnl3 build dependency.
    Upstream has copied the code directly from libnl3 for the few functions it
    needs with a few small modifications.
  * Drop libiw build dependency.
    Hasn't been needed for a long time and was simply a left over from older
    releases.
  * Bump Standards-Version to 4.1.5
  * Fix compile error due to NM_AVAILABLE_IN_1_12_2 macro (Closes: #905372)
Diffstat (limited to 'libnm/nm-remote-connection.c')
-rw-r--r--libnm/nm-remote-connection.c85
1 files changed, 84 insertions, 1 deletions
diff --git a/libnm/nm-remote-connection.c b/libnm/nm-remote-connection.c
index 80bf179d..6c1e0924 100644
--- a/libnm/nm-remote-connection.c
+++ b/libnm/nm-remote-connection.c
@@ -35,6 +35,14 @@
 
 #include "introspection/org.freedesktop.NetworkManager.Settings.Connection.h"
 
+/**
+ * SECTION:nm-remote-connection
+ * @short_description: A connection managed by NetworkManager server
+ *
+ * A #NMRemoteConnection represents a connection that is exported via
+ * NetworkManager D-Bus interface.
+ **/
+
 static void nm_remote_connection_connection_iface_init (NMConnectionInterface *iface);
 static void nm_remote_connection_initable_iface_init (GInitableIface *iface);
 static void nm_remote_connection_async_initable_iface_init (GAsyncInitableIface *iface);
@@ -50,6 +58,8 @@ G_DEFINE_TYPE_WITH_CODE (NMRemoteConnection, nm_remote_connection, NM_TYPE_OBJEC
 enum {
 	PROP_0,
 	PROP_UNSAVED,
+	PROP_FLAGS,
+	PROP_FILENAME,
 	PROP_VISIBLE,
 
 	LAST_PROP
@@ -59,6 +69,8 @@ typedef struct {
 	NMDBusSettingsConnection *proxy;
 
 	gboolean unsaved;
+	guint32 flags;
+	char *filename;
 
 	gboolean visible;
 } NMRemoteConnectionPrivate;
@@ -101,7 +113,7 @@ update2_cb (GObject *proxy, GAsyncResult *result, gpointer user_data)
  *
  * Asynchronously calls the Update2() D-Bus method.
  *
- * Since: 1.10.2
+ * Since: 1.12
  **/
 void
 nm_remote_connection_update2 (NMRemoteConnection *connection,
@@ -652,6 +664,38 @@ nm_remote_connection_get_unsaved (NMRemoteConnection *connection)
 }
 
 /**
+ * nm_remote_connection_get_flags:
+ * @connection: the #NMRemoteConnection
+ *
+ * Returns: the flags of the connection of type #NMSettingsConnectionFlags.
+ *
+ * Since: 1.12
+ **/
+NMSettingsConnectionFlags
+nm_remote_connection_get_flags (NMRemoteConnection *connection)
+{
+	g_return_val_if_fail (NM_IS_REMOTE_CONNECTION (connection), FALSE);
+
+	return (NMSettingsConnectionFlags) NM_REMOTE_CONNECTION_GET_PRIVATE (connection)->flags;
+}
+
+/**
+ * nm_remote_connection_get_filename:
+ * @connection: the #NMRemoteConnection
+ *
+ * Returns: file that stores the connection in case the connection is file-backed.
+ *
+ * Since: 1.12
+ **/
+const char *
+nm_remote_connection_get_filename (NMRemoteConnection *connection)
+{
+	g_return_val_if_fail (NM_IS_REMOTE_CONNECTION (connection), NULL);
+
+	return NM_REMOTE_CONNECTION_GET_PRIVATE (connection)->filename;
+}
+
+/**
  * nm_remote_connection_get_visible:
  * @connection: the #NMRemoteConnection
  *
@@ -741,6 +785,8 @@ init_dbus (NMObject *object)
 	NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (object);
 	const NMPropertiesInfo property_info[] = {
 		{ NM_REMOTE_CONNECTION_UNSAVED, &priv->unsaved },
+		{ NM_REMOTE_CONNECTION_FLAGS, &priv->flags },
+		{ NM_REMOTE_CONNECTION_FILENAME, &priv->filename },
 		{ NULL },
 	};
 
@@ -871,6 +917,12 @@ get_property (GObject *object, guint prop_id,
 	case PROP_UNSAVED:
 		g_value_set_boolean (value, NM_REMOTE_CONNECTION_GET_PRIVATE (object)->unsaved);
 		break;
+	case PROP_FLAGS:
+		g_value_set_boolean (value, NM_REMOTE_CONNECTION_GET_PRIVATE (object)->flags);
+		break;
+	case PROP_FILENAME:
+		g_value_set_string (value, NM_REMOTE_CONNECTION_GET_PRIVATE (object)->filename);
+		break;
 	case PROP_VISIBLE:
 		g_value_set_boolean (value, NM_REMOTE_CONNECTION_GET_PRIVATE (object)->visible);
 		break;
@@ -895,6 +947,7 @@ dispose (GObject *object)
 	NMRemoteConnectionPrivate *priv = NM_REMOTE_CONNECTION_GET_PRIVATE (object);
 
 	g_clear_object (&priv->proxy);
+	nm_clear_g_free (&priv->filename);
 
 	G_OBJECT_CLASS (nm_remote_connection_parent_class)->dispose (object);
 }
@@ -929,6 +982,36 @@ nm_remote_connection_class_init (NMRemoteConnectionClass *remote_class)
 		                       G_PARAM_STATIC_STRINGS));
 
 	/**
+	 * NMRemoteConnection:flags:
+	 *
+	 * The flags of the connection as unsigned integer. The values
+	 * correspond to the #NMSettingsConnectionFlags enum.
+	 *
+	 * Since: 1.12
+	 **/
+	g_object_class_install_property
+		(object_class, PROP_FLAGS,
+		 g_param_spec_uint (NM_REMOTE_CONNECTION_FLAGS, "", "",
+		                    0, G_MAXUINT32, 0,
+		                    G_PARAM_READABLE |
+		                    G_PARAM_STATIC_STRINGS));
+
+	/**
+	 * NMRemoteConnection:filename:
+	 *
+	 * File that stores the connection in case the connection is
+	 * file-backed.
+	 *
+	 * Since: 1.12
+	 **/
+	g_object_class_install_property
+	        (object_class, PROP_FILENAME,
+	         g_param_spec_string (NM_REMOTE_CONNECTION_FILENAME, "", "",
+	                              NULL,
+	                              G_PARAM_READABLE |
+	                              G_PARAM_STATIC_STRINGS));
+
+	/**
 	 * NMRemoteConnection:visible:
 	 *
 	 * %TRUE if the remote connection is visible to the current user, %FALSE if