if (id == NULL)
return FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
s_con = (NMSettingConnection *) nm_setting_connection_new ();
g_assert (s_con);
}
/* Create a new connection object */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Build up the 'connection' setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
/* Duplicate the connection and use that so that we need not
* differentiate existing vs. new later
*/
- connection = nm_connection_duplicate (found_con);
+ connection = nm_simple_connection_new_clone (found_con);
s_con = nm_connection_get_setting_connection (connection);
g_assert (s_con);
g_free (tmp_str);
/* Create a new connection object */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Build up the 'connection' setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
/* If there are some connection data from user, create a connection and
* fill them into proper settings. */
if (con_name || private || bssid2_arr || password)
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
if (con_name || private) {
s_con = (NMSettingConnection *) nm_setting_connection_new ();
if (password) {
if (!connection)
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
s_wsec = (NMSettingWirelessSecurity *) nm_setting_wireless_security_new ();
nm_connection_add_setting (connection, NM_SETTING (s_wsec));
return NULL;
}
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
nm_connection_add_setting (connection, NM_SETTING (s_con));
const char *setting_name;
NmtSyncOp op;
- edit_connection = nm_connection_duplicate (orig_connection);
+ edit_connection = nm_simple_connection_new_clone (orig_connection);
if (!NM_IS_REMOTE_CONNECTION (orig_connection))
return edit_connection;
GError *error = NULL;
/* Create a new connection object */
- connection = (NMConnection *) nm_connection_new ();
+ connection = (NMConnection *) nm_simple_connection_new ();
/* Build up the 'connection' Setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
gboolean success;
/* Create a new connection object */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Build up the 'connection' Setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
/* Using the raw configuration, create an NMConnection object for it. This
* step also verifies that the data we got from NetworkManager are valid. */
- connection = nm_connection_new_from_hash (hash, &error);
+ connection = nm_simple_connection_new_from_hash (hash, &error);
if (!connection) {
g_warning ("Received invalid connection data: %s", error->message);
g_error_free (error);
#endif
-#ifdef __NM_CONNECTION_H__
+#ifdef __NM_SIMPLE_CONNECTION_H__
inline static NMConnection *
nmtst_create_minimal_connection (const char *id, const char *uuid, const char *type, NMSettingConnection **out_s_con)
g_assert (NM_IS_SETTING (s_base));
}
- con = nm_connection_new ();
+ con = nm_simple_connection_new ();
s_con = NM_SETTING_CONNECTION (nm_setting_connection_new ());
g_object_set (s_con,
$(core)/nm-setting-wireless-security.h \
$(core)/nm-setting-wireless.h \
$(core)/nm-setting.h \
+ $(core)/nm-simple-connection.h \
$(core)/nm-utils.h \
$(core)/nm-vpn-dbus-interface.h
$(core)/nm-setting-wireless-security.c \
$(core)/nm-setting-wireless.c \
$(core)/nm-setting.c \
+ $(core)/nm-simple-connection.c \
$(core)/nm-utils.c \
$(core)/nm-value-transforms.c
}
typedef struct {
+ NMConnection *self;
+
GHashTable *settings;
/* D-Bus path of the connection, if any */
char *path;
} NMConnectionPrivate;
-#define NM_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), NM_TYPE_CONNECTION, NMConnectionPrivate))
-
-G_DEFINE_TYPE (NMConnection, nm_connection, G_TYPE_OBJECT)
+static NMConnectionPrivate *nm_connection_get_private (NMConnection *connection);
+#define NM_CONNECTION_GET_PRIVATE(o) (nm_connection_get_private ((NMConnection *)o))
-enum {
- PROP_0,
- PROP_PATH,
-
- LAST_PROP
-};
+G_DEFINE_INTERFACE (NMConnection, nm_connection, G_TYPE_OBJECT)
enum {
SECRETS_UPDATED,
return nm_setting_get_virtual_iface_name (base);
}
-/**
- * nm_connection_new:
- *
- * Creates a new #NMConnection object with no #NMSetting objects.
- *
- * Returns: the new empty #NMConnection object
- **/
-NMConnection *
-nm_connection_new (void)
-{
- return (NMConnection *) g_object_new (NM_TYPE_CONNECTION, NULL);
-}
-
-/**
- * nm_connection_new_from_hash:
- * @hash: (element-type utf8 GLib.HashTable): the #GHashTable describing
- * the connection
- * @error: on unsuccessful return, an error
- *
- * Creates a new #NMConnection from a hash table describing the connection. See
- * nm_connection_to_hash() for a description of the expected hash table.
- *
- * Returns: the new #NMConnection object, populated with settings created
- * from the values in the hash table, or %NULL if the connection failed to
- * validate
- **/
-NMConnection *
-nm_connection_new_from_hash (GHashTable *hash, GError **error)
-{
- NMConnection *connection;
-
- g_return_val_if_fail (hash != NULL, NULL);
-
- if (!validate_permissions_type (hash, error))
- return NULL;
-
- connection = nm_connection_new ();
- if (!hash_to_connection (connection, hash, error)) {
- g_object_unref (connection);
- return NULL;
- }
- return connection;
-}
-
-/**
- * nm_connection_duplicate:
- * @connection: the #NMConnection to duplicate
- *
- * Duplicates a #NMConnection.
- *
- * Returns: (transfer full): a new #NMConnection containing the same settings and properties
- * as the source #NMConnection
- **/
-NMConnection *
-nm_connection_duplicate (NMConnection *connection)
-{
- NMConnection *dup;
- GHashTableIter iter;
- NMSetting *setting;
-
- g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
-
- dup = nm_connection_new ();
- nm_connection_set_path (dup, nm_connection_get_path (connection));
-
- g_hash_table_iter_init (&iter, NM_CONNECTION_GET_PRIVATE (connection)->settings);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer) &setting))
- nm_connection_add_setting (dup, nm_setting_duplicate (setting));
-
- return dup;
-}
-
/**
* nm_connection_get_uuid:
* @connection: the #NMConnection
/*************************************************************/
static void
-nm_connection_init (NMConnection *connection)
-{
- NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (connection);
-
- priv->settings = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
-}
-
-static void
-dispose (GObject *object)
+nm_connection_private_free (NMConnectionPrivate *priv)
{
- NMConnection *self = NM_CONNECTION (object);
- NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (self);
+ NMConnection *self = priv->self;
GHashTableIter iter;
NMSetting *setting;
g_hash_table_iter_init (&iter, priv->settings);
- while (g_hash_table_iter_next (&iter, NULL, (gpointer) &setting)) {
+ while (g_hash_table_iter_next (&iter, NULL, (gpointer) &setting))
g_signal_handlers_disconnect_by_func (setting, setting_changed_cb, self);
- g_hash_table_iter_remove (&iter);
- }
+ g_hash_table_destroy (priv->settings);
- G_OBJECT_CLASS (nm_connection_parent_class)->dispose (object);
+ g_slice_free (NMConnectionPrivate, priv);
}
-static void
-finalize (GObject *object)
+static NMConnectionPrivate *
+nm_connection_get_private (NMConnection *connection)
{
- NMConnection *connection = NM_CONNECTION (object);
- NMConnectionPrivate *priv = NM_CONNECTION_GET_PRIVATE (connection);
+ NMConnectionPrivate *priv;
- g_hash_table_destroy (priv->settings);
- g_free (priv->path);
+ priv = g_object_get_data (G_OBJECT (connection), "NMConnectionPrivate");
+ if (!priv) {
+ priv = g_slice_new0 (NMConnectionPrivate);
+ g_object_set_data_full (G_OBJECT (connection), "NMConnectionPrivate",
+ priv, (GDestroyNotify) nm_connection_private_free);
- G_OBJECT_CLASS (nm_connection_parent_class)->finalize (object);
-}
-
-static void
-set_property (GObject *object, guint prop_id,
- const GValue *value, GParamSpec *pspec)
-{
- NMConnection *connection = NM_CONNECTION (object);
-
- switch (prop_id) {
- case PROP_PATH:
- nm_connection_set_path (connection, g_value_get_string (value));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
+ priv->self = connection;
+ priv->settings = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_object_unref);
}
-}
-static void
-get_property (GObject *object, guint prop_id,
- GValue *value, GParamSpec *pspec)
-{
- NMConnection *connection = NM_CONNECTION (object);
-
- switch (prop_id) {
- case PROP_PATH:
- g_value_set_string (value, nm_connection_get_path (connection));
- break;
- default:
- G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
- break;
- }
+ return priv;
}
static void
-nm_connection_class_init (NMConnectionClass *klass)
+nm_connection_default_init (NMConnectionInterface *iface)
{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
-
- g_type_class_add_private (klass, sizeof (NMConnectionPrivate));
-
- /* virtual methods */
- object_class->set_property = set_property;
- object_class->get_property = get_property;
- object_class->dispose = dispose;
- object_class->finalize = finalize;
-
- /* Properties */
-
- /**
- * NMConnection:path:
- *
- * The connection's D-Bus path, used only by the calling process as a record
- * of the D-Bus path of the connection as provided by a settings service.
- **/
- g_object_class_install_property
- (object_class, PROP_PATH,
- g_param_spec_string (NM_CONNECTION_PATH, "", "",
- NULL,
- G_PARAM_READWRITE |
- G_PARAM_CONSTRUCT |
- G_PARAM_STATIC_STRINGS));
-
/* Signals */
/**
*/
signals[SECRETS_UPDATED] =
g_signal_new (NM_CONNECTION_SECRETS_UPDATED,
- G_OBJECT_CLASS_TYPE (object_class),
+ NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMConnectionClass, secrets_updated),
+ G_STRUCT_OFFSET (NMConnectionInterface, secrets_updated),
NULL, NULL,
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
*/
signals[SECRETS_CLEARED] =
g_signal_new (NM_CONNECTION_SECRETS_CLEARED,
- G_OBJECT_CLASS_TYPE (object_class),
+ NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMConnectionClass, secrets_cleared),
+ G_STRUCT_OFFSET (NMConnectionInterface, secrets_cleared),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
*/
signals[CHANGED] =
g_signal_new (NM_CONNECTION_CHANGED,
- G_OBJECT_CLASS_TYPE (object_class),
+ NM_TYPE_CONNECTION,
G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (NMConnectionClass, changed),
+ G_STRUCT_OFFSET (NMConnectionInterface, changed),
NULL, NULL,
g_cclosure_marshal_VOID__VOID,
G_TYPE_NONE, 0);
G_BEGIN_DECLS
-#define NM_TYPE_CONNECTION (nm_connection_get_type ())
-#define NM_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONNECTION, NMConnection))
-#define NM_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_CONNECTION, NMConnectionClass))
-#define NM_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION))
-#define NM_IS_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_CONNECTION))
-#define NM_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_CONNECTION, NMConnectionClass))
+#define NM_TYPE_CONNECTION (nm_connection_get_type ())
+#define NM_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_CONNECTION, NMConnection))
+#define NM_IS_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_CONNECTION))
+#define NM_CONNECTION_GET_INTERFACE(obj) (G_TYPE_INSTANCE_GET_INTERFACE ((obj), NM_TYPE_CONNECTION, NMConnectionClass))
/* Signals */
#define NM_CONNECTION_SECRETS_UPDATED "secrets-updated"
#define NM_CONNECTION_SECRETS_CLEARED "secrets-cleared"
#define NM_CONNECTION_CHANGED "changed"
-/* Properties */
-#define NM_CONNECTION_PATH "path"
-
/**
* NMConnectionError:
* @NM_CONNECTION_ERROR_UNKNOWN: unknown or unclassified error
/**
* NMConnection:
*
- * The NMConnection struct contains only private data.
- * It should only be accessed through the functions described below.
+ * NMConnection is the interface implemented by #NMRemoteConnection on the
+ * client side, and #NMSettingsConnection on the daemon side.
*/
-typedef struct {
- GObject parent;
-} NMConnection;
+typedef struct _NMConnection NMConnection;
typedef struct {
- GObjectClass parent;
+ GTypeInterface parent;
/* Signals */
void (*secrets_updated) (NMConnection *connection,
void (*secrets_cleared) (NMConnection *connection);
void (*changed) (NMConnection *connection);
- /*< private >*/
- gpointer padding[8];
-} NMConnectionClass;
+} NMConnectionInterface;
GType nm_connection_get_type (void);
-NMConnection *nm_connection_new (void);
-
-NMConnection *nm_connection_new_from_hash (GHashTable *hash, GError **error);
-
-NMConnection *nm_connection_duplicate (NMConnection *connection);
-
void nm_connection_add_setting (NMConnection *connection,
NMSetting *setting);
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ * Copyright 2007 - 2008 Novell, Inc.
+ * Copyright 2007 - 2014 Red Hat, Inc.
+ */
+
+#include "nm-simple-connection.h"
+
+static void nm_simple_connection_interface_init (NMConnectionInterface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (NMSimpleConnection, nm_simple_connection, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (NM_TYPE_CONNECTION, nm_simple_connection_interface_init);
+ )
+
+static void
+nm_simple_connection_init (NMSimpleConnection *self)
+{
+}
+
+/**
+ * nm_simple_connection_new:
+ *
+ * Creates a new #NMSimpleConnection object with no #NMSetting objects. An
+ * #NMSimpleConnection does not directly represent a D-Bus-exported connection,
+ * but might be used in the process of creating a new one.
+ *
+ * Returns: (transfer full): the new empty #NMConnection object
+ **/
+NMConnection *
+nm_simple_connection_new (void)
+{
+ return (NMConnection *) g_object_new (NM_TYPE_SIMPLE_CONNECTION, NULL);
+}
+
+/**
+ * nm_simple_connection_new_from_hash:
+ * @hash: (element-type utf8 GLib.HashTable): the #GHashTable describing
+ * the connection
+ * @error: on unsuccessful return, an error
+ *
+ * Creates a new #NMSimpleConnection from a hash table describing the
+ * connection. See nm_connection_to_hash() for a description of the expected
+ * hash table.
+ *
+ * Returns: (transfer full): the new #NMSimpleConnection object, populated with
+ * settings created from the values in the hash table, or %NULL if the
+ * connection failed to validate
+ **/
+NMConnection *
+nm_simple_connection_new_from_hash (GHashTable *hash, GError **error)
+{
+ NMConnection *connection;
+
+ g_return_val_if_fail (hash != NULL, NULL);
+
+ connection = nm_simple_connection_new ();
+ if (!nm_connection_replace_settings (connection, hash, error)) {
+ g_object_unref (connection);
+ return NULL;
+ }
+ return connection;
+}
+
+/**
+ * nm_simple_connection_new_clone:
+ * @connection: the #NMConnection to clone
+ *
+ * Clones an #NMConnection as an #NMSimpleConnection.
+ *
+ * Returns: (transfer full): a new #NMConnection containing the same settings
+ * and properties as the source #NMConnection
+ **/
+NMConnection *
+nm_simple_connection_new_clone (NMConnection *connection)
+{
+ NMConnection *clone;
+
+ g_return_val_if_fail (NM_IS_CONNECTION (connection), NULL);
+
+ clone = nm_simple_connection_new ();
+ nm_connection_set_path (clone, nm_connection_get_path (connection));
+ nm_connection_replace_settings_from_connection (clone, connection, NULL);
+
+ return clone;
+}
+
+static void
+nm_simple_connection_class_init (NMSimpleConnectionClass *simple_class)
+{
+}
+
+static void
+nm_simple_connection_interface_init (NMConnectionInterface *iface)
+{
+}
--- /dev/null
+/* -*- Mode: C; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
+/*
+ * This library is free software; you can redistribute it and/or
+ * modify it under the terms of the GNU Lesser General Public
+ * License as published by the Free Software Foundation; either
+ * version 2 of the License, or (at your option) any later version.
+ *
+ * This library is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this library; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301 USA.
+ *
+ * Copyright 2014 Red Hat, Inc.
+ */
+
+#ifndef __NM_SIMPLE_CONNECTION_H__
+#define __NM_SIMPLE_CONNECTION_H__
+
+#if !defined (__NETWORKMANAGER_H_INSIDE__) && !defined (NETWORKMANAGER_COMPILATION)
+#error "Only <NetworkManager.h> can be included directly."
+#endif
+
+#include <nm-connection.h>
+
+G_BEGIN_DECLS
+
+#define NM_TYPE_SIMPLE_CONNECTION (nm_simple_connection_get_type ())
+#define NM_SIMPLE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), NM_TYPE_SIMPLE_CONNECTION, NMSimpleConnection))
+#define NM_SIMPLE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), NM_TYPE_SIMPLE_CONNECTION, NMSimpleConnectionClass))
+#define NM_IS_SIMPLE_CONNECTION(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), NM_TYPE_SIMPLE_CONNECTION))
+#define NM_IS_SIMPLE_CONNECTION_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), NM_TYPE_SIMPLE_CONNECTION))
+#define NM_SIMPLE_CONNECTION_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), NM_TYPE_SIMPLE_CONNECTION, NMSimpleConnectionClass))
+
+typedef struct {
+ GObject parent;
+} NMSimpleConnection;
+
+typedef struct {
+ GObjectClass parent_class;
+
+ /*< private >*/
+ gpointer padding[4];
+} NMSimpleConnectionClass;
+
+GType nm_simple_connection_get_type (void);
+
+NMConnection *nm_simple_connection_new (void);
+
+NMConnection *nm_simple_connection_new_from_hash (GHashTable *hash,
+ GError **error);
+
+NMConnection *nm_simple_connection_new_clone (NMConnection *connection);
+
+G_END_DECLS
+
+#endif /* __NM_SIMPLE_CONNECTION__ */
#include <linux/if_infiniband.h>
#include "nm-connection.h"
+#include "nm-simple-connection.h"
#include "nm-core-enum-types.h"
G_BEGIN_DECLS
const char *val1 = "value1";
const char *val2 = "value2";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
ASSERT (connection != NULL,
"vpn-update-secrets",
"error creating connection");
NMSettingWirelessSecurity *s_wsec;
GHashTable *hash;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
s_wsec = make_test_wsec_setting ("connection-to-hash-setting-name");
nm_connection_add_setting (connection, NM_SETTING (s_wsec));
char *uuid;
guint64 timestamp = time (NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
setting = nm_setting_connection_new ();
uuid = nm_utils_uuid_generate ();
connection = new_test_connection ();
g_assert (connection);
- replacement = nm_connection_new ();
+ replacement = nm_simple_connection_new ();
g_assert (replacement);
/* New connection setting */
g_assert (new_settings);
/* Replace settings and test */
- connection = nm_connection_new_from_hash (new_settings, &error);
+ connection = nm_simple_connection_new_from_hash (new_settings, &error);
g_assert_no_error (error);
g_assert (connection);
NMConnection *a, *b;
a = new_test_connection ();
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
g_assert (nm_connection_compare (a, b, NM_SETTING_COMPARE_FLAG_EXACT));
g_object_unref (a);
g_object_unref (b);
NMSettingConnection *s_con;
a = new_test_connection ();
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
s_con = (NMSettingConnection *) nm_connection_get_setting (b, NM_TYPE_SETTING_CONNECTION);
g_assert (s_con);
g_object_set (s_con, NM_SETTING_CONNECTION_TIMESTAMP, (guint64) 0, NULL);
NMConnection *a, *b;
a = new_test_connection ();
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
nm_connection_remove_setting (b, NM_TYPE_SETTING_IP4_CONFIG);
g_assert (!nm_connection_compare (a, b, NM_SETTING_COMPARE_FLAG_EXACT));
g_object_unref (a);
NMSettingConnection *s_con;
a = new_test_connection ();
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
s_con = (NMSettingConnection *) nm_connection_get_setting (b, NM_TYPE_SETTING_CONNECTION);
g_assert (s_con);
g_object_set (s_con, NM_SETTING_CONNECTION_TIMESTAMP, (guint64) 0, NULL);
NMConnection *a, *b;
a = new_test_connection ();
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
nm_connection_remove_setting (a, NM_TYPE_SETTING_IP4_CONFIG);
g_assert (!nm_connection_compare (a, b, NM_SETTING_COMPARE_FLAG_EXACT));
g_object_unref (a);
gboolean same;
a = new_test_connection ();
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
same = nm_connection_diff (a, b, NM_SETTING_COMPARE_FLAG_EXACT, &out_diffs);
g_assert (same == TRUE);
};
a = new_test_connection ();
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
s_ip4 = nm_connection_get_setting_ip4_config (a);
g_assert (s_ip4);
g_object_set (G_OBJECT (s_ip4),
NULL);
nm_connection_add_setting (a, s_pppoe);
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
/* Add a secret to B */
s_pppoe = NM_SETTING (nm_connection_get_setting_pppoe (b));
};
a = new_test_connection ();
- b = nm_connection_duplicate (a);
+ b = nm_simple_connection_new_clone (a);
/* Change the UUID, wired MTU, and set ignore-auto-dns */
s_con = nm_connection_get_setting_connection (a);
const guint8 bdaddr[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
/* Try a basic wired connection */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_WIRED_SETTING_NAME);
setting = nm_setting_wired_new ();
nm_connection_add_setting (connection, setting);
g_object_unref (connection);
/* Try a wired PPPoE connection */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_PPPOE_SETTING_NAME);
setting = nm_setting_pppoe_new ();
g_object_set (setting, NM_SETTING_PPPOE_USERNAME, "bob smith", NULL);
g_object_unref (connection);
/* Wifi connection */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_WIRELESS_SETTING_NAME);
setting = nm_setting_wireless_new ();
g_object_unref (connection);
/* Bluetooth connection */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_BLUETOOTH_SETTING_NAME);
setting = nm_setting_bluetooth_new ();
g_object_unref (connection);
/* WiMAX connection */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_WIMAX_SETTING_NAME);
setting = nm_setting_wimax_new ();
g_object_set (setting, NM_SETTING_WIMAX_NETWORK_NAME, "CLEAR", NULL);
g_object_unref (connection);
/* GSM connection */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_GSM_SETTING_NAME);
setting = nm_setting_gsm_new ();
nm_connection_add_setting (connection, setting);
/* CDMA connection */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_CDMA_SETTING_NAME);
setting = nm_setting_cdma_new ();
*/
/* Connection setting */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_CONNECTION_SETTING_NAME);
setting = nm_setting_wired_new ();
nm_connection_add_setting (connection, setting);
g_clear_error (&error);
/* PPP setting */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_PPP_SETTING_NAME);
setting = nm_setting_wired_new ();
nm_connection_add_setting (connection, setting);
g_clear_error (&error);
/* Serial setting */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_SERIAL_SETTING_NAME);
setting = nm_setting_wired_new ();
nm_connection_add_setting (connection, setting);
g_clear_error (&error);
/* IP4 setting */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_IP4_CONFIG_SETTING_NAME);
setting = nm_setting_wired_new ();
nm_connection_add_setting (connection, setting);
g_clear_error (&error);
/* IP6 setting */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
add_generic_settings (connection, NM_SETTING_IP6_CONFIG_SETTING_NAME);
setting = nm_setting_wired_new ();
nm_connection_add_setting (connection, setting);
NMSettingConnection *s_con;
char *uuid;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
gboolean changed = FALSE;
NMSettingBond *s_bond;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
NMIP4Address *addr;
NMIP4Route *route;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
NMIP6Route *route;
const struct in6_addr t = { { { 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 } } };
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
gboolean changed = FALSE;
NMSettingVlan *s_vlan;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
gboolean changed = FALSE;
NMSettingVpn *s_vpn;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
gboolean changed = FALSE;
NMSettingWired *s_wired;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
gboolean changed = FALSE;
NMSettingWireless *s_wifi;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
gboolean changed = FALSE;
NMSettingWirelessSecurity *s_wsec;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
gboolean changed = FALSE;
NMSetting8021x *s_8021x;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_signal_connect (connection,
NM_CONNECTION_CHANGED,
(GCallback) test_connection_changed_cb,
NM_SETTING_BOND_INTERFACE_NAME, "bond-x",
NULL);
- con = nm_connection_new ();
+ con = nm_simple_connection_new ();
nm_connection_add_setting (con, NM_SETTING (s_con));
nm_connection_add_setting (con, NM_SETTING (s_bond));
const char *IFACE_VIRT = "iface-X";
gboolean modified = FALSE;
- con = nm_connection_new ();
+ con = nm_simple_connection_new ();
setting = nm_setting_ip4_config_new ();
g_object_set (setting,
gboolean success;
GError *error = NULL;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
gboolean success;
GError *error = NULL;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *uuid;
GByteArray *ssid;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
#include <nm-setting-wireless-security.h>
#include <nm-setting-wireless.h>
#include <nm-setting.h>
+#include <nm-simple-connection.h>
#include <nm-types.h>
#include <nm-utils.h>
#include <nm-version.h>
nm_connection_compare;
nm_connection_diff;
nm_connection_dump;
- nm_connection_duplicate;
nm_connection_error_get_type;
nm_connection_error_quark;
nm_connection_for_each_setting_value;
nm_connection_get_virtual_iface_name;
nm_connection_is_type;
nm_connection_need_secrets;
- nm_connection_new;
- nm_connection_new_from_hash;
nm_connection_normalize;
nm_connection_remove_setting;
nm_connection_replace_settings;
nm_setting_wireless_security_remove_proto;
nm_setting_wireless_security_remove_proto_by_value;
nm_setting_wireless_security_set_wep_key;
+ nm_simple_connection_get_type;
+ nm_simple_connection_new;
+ nm_simple_connection_new_clone;
+ nm_simple_connection_new_from_hash;
nm_ssid_get_type;
nm_state_get_type;
nm_string_array_get_type;
#include "nm-glib-compat.h"
#include "nm-dbus-helpers-private.h"
+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);
-G_DEFINE_TYPE_WITH_CODE (NMRemoteConnection, nm_remote_connection, NM_TYPE_CONNECTION,
+G_DEFINE_TYPE_WITH_CODE (NMRemoteConnection, nm_remote_connection, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (NM_TYPE_CONNECTION, nm_remote_connection_connection_iface_init);
G_IMPLEMENT_INTERFACE (G_TYPE_INITABLE, nm_remote_connection_initable_iface_init);
G_IMPLEMENT_INTERFACE (G_TYPE_ASYNC_INITABLE, nm_remote_connection_async_initable_iface_init);
)
enum {
PROP_0,
PROP_DBUS_CONNECTION,
+ PROP_PATH,
PROP_UNSAVED,
PROP_VISIBLE,
GValue *value, GParamSpec *pspec)
{
switch (prop_id) {
+ case PROP_PATH:
+ g_value_set_string (value, nm_connection_get_path (NM_CONNECTION (object)));
+ break;
case PROP_UNSAVED:
g_value_set_boolean (value, NM_REMOTE_CONNECTION_GET_PRIVATE (object)->unsaved);
break;
/* Construct only */
priv->bus = g_value_dup_boxed (value);
break;
+ case PROP_PATH:
+ /* Construct only */
+ nm_connection_set_path (NM_CONNECTION (object), g_value_get_string (value));
+ break;
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec);
break;
G_PARAM_CONSTRUCT_ONLY |
G_PARAM_STATIC_STRINGS));
+ /**
+ * NMRemoteConnection:path:
+ *
+ * The D-Bus path of the connection that the #NMRemoteConnection represents.
+ */
+ g_object_class_install_property
+ (object_class, PROP_PATH,
+ g_param_spec_string (NM_REMOTE_CONNECTION_PATH, "", "",
+ NULL,
+ G_PARAM_WRITABLE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
/**
* NMRemoteConnection:unsaved:
*
G_PARAM_STATIC_STRINGS));
}
+static void
+nm_remote_connection_connection_iface_init (NMConnectionInterface *iface)
+{
+}
+
static void
nm_remote_connection_initable_iface_init (GInitableIface *iface)
{
/* Properties */
#define NM_REMOTE_CONNECTION_DBUS_CONNECTION "dbus-connection"
+#define NM_REMOTE_CONNECTION_PATH "path"
#define NM_REMOTE_CONNECTION_UNSAVED "unsaved"
#define NM_REMOTE_CONNECTION_VISIBLE "visible"
typedef struct {
- NMConnection parent;
+ GObject parent;
} NMRemoteConnection;
typedef struct {
- NMConnectionClass parent_class;
+ GObjectClass parent_class;
/*< private >*/
gpointer padding[8];
* char *uuid;
* gboolean success;
*
- * connection = nm_connection_new ();
+ * connection = nm_simple_connection_new ();
*
* /* Build up the 'connection' setting */
* s_con = (NMSettingConnection *) nm_setting_connection_new ();
#include "nm-secret-agent.h"
#include "nm-enum-types.h"
#include "nm-dbus-helpers-private.h"
+#include "nm-simple-connection.h"
static void impl_secret_agent_get_secrets (NMSecretAgent *self,
GHashTable *connection_hash,
/* Make sure the given connection is valid */
g_assert (out_connection);
- connection = nm_connection_new_from_hash (connection_hash, &local);
+ connection = nm_simple_connection_new_from_hash (connection_hash, &local);
if (connection) {
nm_connection_set_path (connection, connection_path);
*out_connection = connection;
#include "nm-vpn-plugin.h"
#include "nm-vpn-enum-types.h"
#include "nm-utils.h"
-#include "nm-connection.h"
#include "nm-dbus-glib-types.h"
static gboolean impl_vpn_plugin_connect (NMVpnPlugin *plugin,
return FALSE;
}
- connection = nm_connection_new_from_hash (properties, &local);
+ connection = nm_simple_connection_new_from_hash (properties, &local);
if (!connection) {
g_set_error (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
"Invalid connection: (%d) %s",
g_return_val_if_fail (NM_IS_VPN_PLUGIN (plugin), FALSE);
g_return_val_if_fail (properties != NULL, FALSE);
- connection = nm_connection_new_from_hash (properties, &cnfh_err);
+ connection = nm_simple_connection_new_from_hash (properties, &cnfh_err);
if (!connection) {
g_set_error (err,
NM_VPN_PLUGIN_ERROR,
return FALSE;
}
- connection = nm_connection_new_from_hash (properties, &local);
+ connection = nm_simple_connection_new_from_hash (properties, &local);
if (!connection) {
g_set_error (error, NM_VPN_PLUGIN_ERROR, NM_VPN_PLUGIN_ERROR_BAD_ARGUMENTS,
"Invalid connection: (%d) %s",
#include <sys/types.h>
#include <signal.h>
-#include "nm-dbus-interface.h"
-#include "nm-client.h"
-#include "nm-device-wifi.h"
-#include "nm-device-ethernet.h"
-#include "nm-device-wimax.h"
+#include <NetworkManager.h>
#include "nm-glib-compat.h"
#include "common.h"
#include <sys/types.h>
#include <signal.h>
-#include <nm-dbus-interface.h>
-#include <nm-setting-connection.h>
-#include <nm-setting-wired.h>
-#include <nm-utils.h>
+#include <NetworkManager.h>
-#include "nm-remote-settings.h"
#include "common.h"
#include "nm-test-utils.h"
/* create a new connection */
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Setting: Connection */
uuid = nm_utils_uuid_generate ();
return NULL;
}
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
s_con = nm_setting_connection_new ();
uuid = nm_utils_uuid_generate ();
NMSettingWireless *s_wifi = NULL;
GByteArray *tmp;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
s_wifi = (NMSettingWireless *) nm_setting_wireless_new ();
nm_connection_add_setting (connection, NM_SETTING (s_wifi));
gboolean success;
GError *error = NULL;
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
success = complete_connection (ssid, bssid,
NM_802_11_MODE_INFRA, NM_802_11_AP_FLAGS_NONE,
NM_802_11_AP_SEC_NONE, NM_802_11_AP_SEC_NONE,
* SSID and Infra modes of the given AP details.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
success = complete_connection (ssid, bssid,
NM_802_11_MODE_INFRA, NM_802_11_AP_FLAGS_NONE,
NM_802_11_AP_SEC_NONE, NM_802_11_AP_SEC_NONE,
* the AP to have the Privacy bit set.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
if (add_wifi)
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
* WEP or LEAP) is rejected when completion is attempted with an open AP.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
* attempted with an open AP.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
if (add_wifi)
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
gboolean success;
GError *error = NULL;
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
if (add_wifi)
fill_wifi_empty (src);
fill_wsec (src, both_wsec);
gboolean success;
GError *error = NULL;
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
if (add_wifi)
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
* connection when completed with an AP with the Privacy bit set.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
success = complete_connection (ssid, bssid,
NM_802_11_MODE_INFRA, NM_802_11_AP_FLAGS_PRIVACY,
NM_802_11_AP_SEC_NONE, NM_802_11_AP_SEC_NONE,
* with an AP with the Privacy bit set.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
if (add_wifi)
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
* with an AP with the Privacy bit set.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
success = complete_connection ("blahblah", bssid,
* Dynamic WEP connection when completed with an AP with the Privacy bit set.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
fill_8021x (src, both_8021x);
* WEP connection when completed with an AP with the Privacy bit set.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
fill_8021x (src, both_8021x);
* setting is rejected, as 802.1x is incompatible with 'shared' auth.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
fill_8021x (src, src_8021x);
* or RSN flags.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
success = complete_connection (ssid, bssid,
NM_802_11_MODE_INFRA, NM_802_11_AP_FLAGS_PRIVACY,
wpa_flags_for_idx (idx),
* rejected since WPA APs (usually) do not support LEAP.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
success = complete_connection (ssid, bssid,
* rejected since WPA APs (usually) do not support LEAP.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
success = complete_connection ("blahblah", bssid,
* rejected since WPA APs (usually) do not support Dynamic WEP.
*/
- src = nm_connection_new ();
+ src = nm_simple_connection_new ();
fill_wifi_empty (src);
fill_wsec (src, src_wsec);
success = complete_connection ("blahblah", bssid,
{ NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0 },
{ NULL } };
- expected = nm_connection_new ();
+ expected = nm_simple_connection_new ();
fill_wsec (expected, exp_wsec);
test_ap_wpa_psk_connection_base (NULL, NULL,
NM_802_11_AP_FLAGS_PRIVACY,
{ NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0 },
{ NULL } };
- expected = nm_connection_new ();
+ expected = nm_simple_connection_new ();
fill_wsec (expected, exp_wsec);
test_ap_wpa_psk_connection_base (NULL, NULL,
NM_802_11_AP_FLAGS_PRIVACY,
{ NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0 },
{ NULL } };
- expected = nm_connection_new ();
+ expected = nm_simple_connection_new ();
fill_wsec (expected, exp_wsec);
test_ap_wpa_psk_connection_base (NULL, "open",
NM_802_11_AP_FLAGS_PRIVACY,
{ NM_SETTING_WIRELESS_SECURITY_AUTH_ALG, "open", 0 },
{ NULL } };
- expected = nm_connection_new ();
+ expected = nm_simple_connection_new ();
fill_wsec (expected, exp_wsec);
test_ap_wpa_psk_connection_base ("wpa-psk", "open",
NM_802_11_AP_FLAGS_PRIVACY,
* specific data being in the connection till then (especially in
* validate_activation_request()).
*/
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
if (settings && g_hash_table_size (settings))
nm_connection_replace_settings (connection, settings, NULL);
#include "nm-auth-subject.h"
#include "nm-dbus-manager.h"
#include "nm-session-monitor.h"
+#include "nm-simple-connection.h"
G_DEFINE_TYPE (NMAgentManager, nm_agent_manager, G_TYPE_OBJECT)
Request *parent = (Request *) req;
NMConnection *tmp;
- tmp = nm_connection_duplicate (req->connection);
+ tmp = nm_simple_connection_new_clone (req->connection);
nm_connection_clear_secrets (tmp);
if (include_system_secrets) {
if (req->existing_secrets)
* ask a secret agent for more. This allows admins to provide generic
* secrets but allow additional user-specific ones as well.
*/
- tmp = nm_connection_duplicate (req->connection);
+ tmp = nm_simple_connection_new_clone (req->connection);
g_assert (tmp);
if (!nm_connection_update_secrets (tmp, req->setting_name, req->existing_secrets, &error)) {
#include "nm-glib-compat.h"
#include "nm-logging.h"
#include "nm-auth-subject.h"
+#include "nm-simple-connection.h"
G_DEFINE_TYPE (NMSecretAgent, nm_secret_agent, G_TYPE_OBJECT)
#include "nm-settings-connection-glue.h"
-G_DEFINE_TYPE (NMSettingsConnection, nm_settings_connection, NM_TYPE_CONNECTION)
+static void nm_settings_connection_connection_interface_init (NMConnectionInterface *iface);
+
+G_DEFINE_TYPE_WITH_CODE (NMSettingsConnection, nm_settings_connection, G_TYPE_OBJECT,
+ G_IMPLEMENT_INTERFACE (NM_TYPE_CONNECTION, nm_settings_connection_connection_interface_init)
+ )
#define NM_SETTINGS_CONNECTION_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), \
NM_TYPE_SETTINGS_CONNECTION, \
if (priv->system_secrets)
g_object_unref (priv->system_secrets);
- priv->system_secrets = nm_connection_duplicate (NM_CONNECTION (self));
+ priv->system_secrets = nm_simple_connection_new_clone (NM_CONNECTION (self));
/* Clear out non-system-owned and not-saved secrets */
nm_connection_clear_secrets_with_flags (priv->system_secrets,
if (priv->agent_secrets)
g_object_unref (priv->agent_secrets);
- priv->agent_secrets = nm_connection_duplicate (new ? new : NM_CONNECTION (self));
+ priv->agent_secrets = nm_simple_connection_new_clone (new ? new : NM_CONNECTION (self));
/* Clear out non-system-owned secrets */
nm_connection_clear_secrets_with_flags (priv->agent_secrets,
set_visible (connection, FALSE);
/* Tell agents to remove secrets for this connection */
- for_agents = nm_connection_duplicate (NM_CONNECTION (connection));
+ for_agents = nm_simple_connection_new_clone (NM_CONNECTION (connection));
nm_connection_clear_secrets (for_agents);
nm_agent_manager_delete_secrets (priv->agent_mgr, for_agents);
g_object_unref (for_agents);
guint64 timestamp = 0;
GSList *bssid_list;
- dupl_con = nm_connection_duplicate (NM_CONNECTION (self));
+ dupl_con = nm_simple_connection_new_clone (NM_CONNECTION (self));
g_assert (dupl_con);
/* Timestamp is not updated in connection's 'timestamp' property,
* as agent-owned secrets are the only ones we send back be saved.
* Only send secrets to agents of the same UID that called update too.
*/
- for_agent = nm_connection_duplicate (NM_CONNECTION (self));
+ for_agent = nm_simple_connection_new_clone (NM_CONNECTION (self));
nm_connection_clear_secrets_with_flags (for_agent,
secrets_filter_cb,
GUINT_TO_POINTER (NM_SETTING_SECRET_FLAG_AGENT_OWNED));
/* Check if the settings are valid first */
if (new_settings) {
- tmp = nm_connection_new_from_hash (new_settings, &error);
+ tmp = nm_simple_connection_new_from_hash (new_settings, &error);
if (!tmp) {
g_assert (error);
goto error;
G_TYPE_FROM_CLASS (class),
&dbus_glib_nm_settings_connection_object_info);
}
+
+static void
+nm_settings_connection_connection_interface_init (NMConnectionInterface *iface)
+{
+}
+
gpointer user_data);
struct _NMSettingsConnection {
- NMConnection parent;
+ GObject parent;
};
struct _NMSettingsConnectionClass {
- NMConnectionClass parent;
+ GObjectClass parent;
/* virtual methods */
void (*commit_changes) (NMSettingsConnection *connection,
* as agent-owned secrets are the only ones we send back to be saved.
* Only send secrets to agents of the same UID that called update too.
*/
- for_agent = nm_connection_duplicate (NM_CONNECTION (connection));
+ for_agent = nm_simple_connection_new_clone (NM_CONNECTION (connection));
nm_connection_clear_secrets_with_flags (for_agent,
secrets_filter_cb,
GUINT_TO_POINTER (NM_SETTING_SECRET_FLAG_AGENT_OWNED));
NMConnection *connection;
GError *error = NULL;
- connection = nm_connection_new_from_hash (settings, &error);
+ connection = nm_simple_connection_new_from_hash (settings, &error);
if (connection) {
nm_settings_add_connection_dbus (self,
- connection,
- save_to_disk,
- context,
- impl_settings_add_connection_add_cb,
- NULL);
+ connection,
+ save_to_disk,
+ context,
+ impl_settings_add_connection_add_cb,
+ NULL);
g_object_unref (connection);
} else {
g_assert (error);
if (!hw_address)
return;
- connection = nm_connection_new ();
- g_assert (connection);
+ connection = nm_simple_connection_new ();
setting = nm_setting_connection_new ();
- g_assert (setting);
nm_connection_add_setting (connection, setting);
defname = nm_settings_utils_get_default_wired_name (priv->connections);
g_return_val_if_fail (error != NULL, NULL);
g_return_val_if_fail (*error == NULL, NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Wireless */
wireless_setting = make_wireless_setting (ifcfg, error);
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (ifcfg != NULL, NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
con_setting = make_connection_setting (file, ifcfg, NM_SETTING_WIRED_SETTING_NAME, NULL, NULL);
if (!con_setting) {
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (ifcfg != NULL, NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
con_setting = make_connection_setting (file, ifcfg, NM_SETTING_INFINIBAND_SETTING_NAME, NULL, NULL);
if (!con_setting) {
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (ifcfg != NULL, NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
con_setting = make_connection_setting (file, ifcfg, NM_SETTING_BOND_SETTING_NAME, NULL, _("Bond"));
if (!con_setting) {
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (ifcfg != NULL, NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
con_setting = make_connection_setting (file, ifcfg, NM_SETTING_TEAM_SETTING_NAME, NULL, _("Team"));
if (!con_setting) {
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (ifcfg != NULL, NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
con_setting = make_connection_setting (file, ifcfg, NM_SETTING_BRIDGE_SETTING_NAME, NULL, _("Bridge"));
if (!con_setting) {
g_return_val_if_fail (file != NULL, NULL);
g_return_val_if_fail (ifcfg != NULL, NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
con_setting = make_connection_setting (file, ifcfg, NM_SETTING_VLAN_SETTING_NAME, NULL, "Vlan");
if (!con_setting) {
g_assert (out_spec != NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Get NAME, UUID, etc. We need to set a connection type (generic) and add
* an empty type-specific setting as well, to make sure it passes
GByteArray *ssid;
const unsigned char ssid_data[] = { 0x54, 0x65, 0x73, 0x74, 0x20, 0x53, 0x53, 0x49, 0x44 };
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
inet_pton (AF_INET6, "fade:0102:0103::face", &dns6_1);
inet_pton (AF_INET6, "cafe:ffff:eeee:dddd:cccc:bbbb:aaaa:feed", &dns6_2);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
inet_pton (AF_INET6, "1003:1234:abcd::1", &ip6);
inet_pton (AF_INET6, "fade:0102:0103::face", &dns6);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
if (gateway6)
inet_ntop (AF_INET6, gateway6, s_gateway6, sizeof (s_gateway6));
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const char *pw;
char *tmp;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection != NULL);
/* Connection setting */
shvarFile *ifcfg;
int i, j;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
ASSERT (connection != NULL,
"wired-aliases-write", "failed to allocate new connection");
struct in_addr ip1, ip2, gw1, gw2;
const guint32 prefix = 24;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
shvarFile *ifcfg;
char *tmp;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
GByteArray *ssid;
const unsigned char ssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66, 0x77, 0x88, 0x99, 0xaa, 0xbb, 0xcc, 0xdd };
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const unsigned char ssid_data[] = "blahblah";
struct stat statbuf;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const guint32 dns1 = htonl (0x04020201);
const guint32 prefix = 24;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const unsigned char ssid_data[] = "blahblah";
struct stat statbuf;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const unsigned char ssid_data[] = "blahblah40";
struct stat statbuf;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const unsigned char ssid_data[] = "blahblah104";
struct stat statbuf;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const unsigned char ssid_data[] = "blahblah";
struct stat statbuf;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
GByteArray *ssid;
const unsigned char ssid_data[] = "blahblah";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
g_return_if_fail (psk != NULL);
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const guint32 dns1 = htonl (0x04020201);
const guint32 prefix = 24;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
GByteArray *ssid;
const char *ssid_data = "blahblah";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
GByteArray *ssid;
const char *ssid_data = "blahblah";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
GByteArray *ssid;
const char *ssid_data = "blahblah";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
* config doesn't leave various WPA-related keys lying around in the ifcfg.
*/
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
* config works and doesn't cause infinite loop or other issues.
*/
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
shvarFile *ifcfg;
char *tmp;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
shvarFile *ifcfg;
char *tmp;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection != NULL);
/* Connection setting */
GError *error = NULL;
char *testfile = NULL;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
GError *error = NULL;
char *testfile = NULL;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
GError *error = NULL;
char *testfile = NULL;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
char *route6file = NULL;
gboolean ignore_error = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const guint traffic_classes[8] = { 3, 4, 7, 2, 1, 0, 5, 6 };
const gboolean pfcs[8] = { TRUE, TRUE, FALSE, TRUE, FALSE, TRUE, TRUE, FALSE };
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
s_con = (NMSettingConnection *) nm_setting_connection_new ();
nm_connection_add_setting (connection, NM_SETTING (s_con));
gboolean success, ignore_error;
char *uuid, *testfile;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
s_con = (NMSettingConnection *) nm_setting_connection_new ();
nm_connection_add_setting (connection, NM_SETTING (s_con));
const char *escaped_expected_config = "\"{ \\\"device\\\": \\\"team0\\\", \\\"link_watch\\\": { \\\"name\\\": \\\"ethtool\\\" } }\"";
shvarFile *f;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const char *escaped_expected_config = "\"{ \\\"p4p1\\\": { \\\"prio\\\": -10, \\\"sticky\\\": true } }\"";
shvarFile *f;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
gchar *id, *uuid;
gboolean success = FALSE;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
setting = nm_connection_get_setting_connection (connection);
if (!setting) {
setting = NM_SETTING_CONNECTION (nm_setting_connection_new ());
init_ifparser_with_file (path, file);
block = ifparser_getfirst ();
- connection = nm_connection_new();
+ connection = nm_simple_connection_new();
ifupdown_update_connection_from_if_block(connection, block, &error);
ASSERT (connection != NULL,
init_ifparser_with_file (path, file);
block = ifparser_getfirst ();
- connection = nm_connection_new();
+ connection = nm_simple_connection_new();
ifupdown_update_connection_from_if_block(connection, block, &error);
ASSERT (connection != NULL,
init_ifparser_with_file (path, file);
block = ifparser_getfirst ();
- connection = nm_connection_new();
+ connection = nm_simple_connection_new();
ifupdown_update_connection_from_if_block(connection, block, &error);
ASSERT (connection != NULL,
if (!g_key_file_load_from_file (key_file, filename, G_KEY_FILE_NONE, error))
goto out;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
groups = g_key_file_get_groups (key_file, &length);
for (i = 0; i < length; i++) {
const char *route6_4_nh = "::";
guint64 timestamp = 0x12345678L;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
const char *address = "abcd::beef";
const char *gw = "dcba::beef";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
uid_t owner_uid;
guint64 timestamp = 0x12344433L;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
uid_t owner_uid;
GKeyFile *keyfile;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
gint *intlist;
gsize len = 0, i;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
GKeyFile *keyfile;
char *tmp;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
GKeyFile *keyfile;
char *tmp;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
uid_t owner_uid;
guint64 timestamp = 0x12344433L;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
uid_t owner_uid;
guint64 timestamp = 0x12344433L;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
gboolean success;
GError *error = NULL;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection != NULL);
/* Connection setting */
pid_t owner_grp;
uid_t owner_uid;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
pid_t owner_grp;
uid_t owner_uid;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
pid_t owner_grp;
uid_t owner_uid;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
char *s;
gint mtu;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
g_assert (connection);
/* Connection setting */
GKeyFile *kf;
char *s;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
#include <glib.h>
#include <glib-object.h>
-#include <nm-connection.h>
+#include <nm-simple-connection.h>
#include <nm-setting-connection.h>
#include "nm-settings-utils.h"
NMConnection *a;
NMSetting *setting;
- a = nm_connection_new ();
+ a = nm_simple_connection_new ();
setting = nm_setting_connection_new ();
g_object_set (setting, NM_SETTING_CONNECTION_ID, id, NULL);
nm_connection_add_setting (a, setting);
const unsigned char bssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
const char *bssid_str = "11:22:33:44:55:66";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const unsigned char bssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
const char *bssid_str = "11:22:33:44:55:66";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
const unsigned char bssid_data[] = { 0x11, 0x22, 0x33, 0x44, 0x55, 0x66 };
const char *bssid_str = "11:22:33:44:55:66";
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
/* Connection setting */
s_con = (NMSettingConnection *) nm_setting_connection_new ();
NMSettingIP6Config *s_ip6;
char *uuid;
- connection = nm_connection_new ();
+ connection = nm_simple_connection_new ();
s_con = (NMSettingConnection *) nm_setting_connection_new ();
nm_connection_add_setting (connection, (NMSetting *) s_con);
NMSettingIP4Config *s_ip4;
orig = _match_connection_new ();
- copy = nm_connection_duplicate (orig);
+ copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
matched = nm_utils_match_connection (connections, orig, TRUE, NULL, NULL);
NMSettingIP6Config *s_ip6;
orig = _match_connection_new ();
- copy = nm_connection_duplicate (orig);
+ copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
/* Check that if the generated connection is IPv6 method=link-local, and the
NMSettingIP6Config *s_ip6;
orig = _match_connection_new ();
- copy = nm_connection_duplicate (orig);
+ copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
/* Check that if the generated connection is IPv6 method=link-local, and the
NMSettingIP6Config *s_ip6;
orig = _match_connection_new ();
- copy = nm_connection_duplicate (orig);
+ copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
/* Check that if the generated connection is IPv6 method=auto, and the
NMSettingIP4Config *s_ip4;
orig = _match_connection_new ();
- copy = nm_connection_duplicate (orig);
+ copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
/* Check that if the generated connection is IPv4 method=disabled, and the
NMSettingConnection *s_con;
orig = _match_connection_new ();
- copy = nm_connection_duplicate (orig);
+ copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
/* Check that if the generated connection has an interface name and the
g_ptr_array_add (subchan_arr, "0.0.8002");
orig = _match_connection_new ();
- copy = nm_connection_duplicate (orig);
+ copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
mac = nm_utils_hwaddr_atoba ("52:54:00:ab:db:23", ETH_ALEN);
guint32 addr, gw;
orig = _match_connection_new ();
- copy = nm_connection_duplicate (orig);
+ copy = nm_simple_connection_new_clone (orig);
connections = g_slist_append (connections, copy);
/* Check that if we have two differences, ipv6.method (exception we allow) and
if (username == NULL || existing)
return nm_connection_to_hash (connection, NM_SETTING_HASH_FLAG_ALL);
- dup = nm_connection_duplicate (connection);
+ dup = nm_simple_connection_new_clone (connection);
g_assert (dup);
s_vpn = nm_connection_get_setting_vpn (dup);
g_assert (s_vpn);