From 7514efc2f38c9ace4557d4e69d68e7d380389030 Mon Sep 17 00:00:00 2001
From: Michael Biebl
To add a new network connection to the NetworkManager settings service, first -build up a template NMConnection object. Since this connection is not yet +build up a template NMConnection object. Since this connection is not yet added to NetworkManager, it is known only to your program and is not yet an NMRemoteConnection. Then ask NMRemoteSettings to add your connection. When the connection is added successfully, the supplied callback is called @@ -377,16 +377,16 @@ the stored object known to NetworkManager.
static gboolean add_wired_connection (const char *human_name) { - NMConnection *connection; + NMConnection *connection; NMSettingConnection *s_con; NMSettingWired *s_wired; char *uuid; gboolean success; - connection = nm_connection_new (); + connection = nm_connection_new (); /* Build up the 'connection' setting */ - s_con = (NMSettingConnection *) nm_setting_connection_new (); + s_con = (NMSettingConnection *) nm_setting_connection_new (); uuid = nm_utils_uuid_generate (); g_object_set (G_OBJECT (s_con), NM_SETTING_CONNECTION_UUID, uuid, @@ -394,24 +394,24 @@ the stored object known to NetworkManager. NM_SETTING_CONNECTION_TYPE, NM_SETTING_WIRED_SETTING_NAME, NULL); g_free (uuid); - nm_connection_add_setting (connection, NM_SETTING (s_con)); + nm_connection_add_setting (connection, NM_SETTING (s_con)); /* Add the required 'wired' setting as this is a wired connection */ - nm_connection_add_setting (connection, nm_setting_wired_new ()); + nm_connection_add_setting (connection, nm_setting_wired_new ()); /* Add an 'ipv4' setting using AUTO configuration (eg DHCP) */ - s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); + s_ip4 = (NMSettingIP4Config *) nm_setting_ip4_config_new (); g_object_set (G_OBJECT (s_ip4), NM_SETTING_IP4_CONFIG_METHOD, NM_SETTING_IP4_CONFIG_METHOD_AUTO, NULL); - nm_connection_add_setting (connection, NM_SETTING (s_ip4)); + nm_connection_add_setting (connection, NM_SETTING (s_ip4)); /* Ask NetworkManager to store the connection */ - success = nm_remote_settings_add_connection (settings, connection, added_cb, loop); + success = nm_remote_settings_add_connection (settings, connection, added_cb, loop); /* Release the template connection; the actual stored connection will * be returned in added_cb() */ - g_object_unref (connection); + g_object_unref (connection); /* Let glib event loop run and added_cb() will be called when NetworkManager * is done adding the new connection. */ @@ -433,7 +433,7 @@ the stored object known to NetworkManager. nm_remote_settings_error_quark (void);
Registers an error quark for NMRemoteSettings if necessary.
@@ -474,7 +474,7 @@ nm_remote_settings_new (nm_remote_settings_new_async() if you
want to avoid that.
@@ -507,7 +507,7 @@ begins asynchronously initializing it. callbacknm_remote_settings_new_finish() to get the
result.
-Parameters
+Parameters