| Top |
| #define | NM_CONNECTION_SECRETS_UPDATED |
| #define | NM_CONNECTION_SECRETS_CLEARED |
| #define | NM_CONNECTION_CHANGED |
| #define | NM_CONNECTION_PATH |
| enum | NMConnectionError |
| #define | NM_CONNECTION_NORMALIZE_PARAM_IP6_CONFIG_METHOD |
| #define | NM_CONNECTION_ERROR |
| NMConnection |
An NMConnection describes all the settings and configuration values that are necessary to configure network devices for operation on a specific network. Connections are the fundamental operating object for NetworkManager; no device is connected without a NMConnection, or disconnected without having been connected with a NMConnection.
Each NMConnection contains a list of NMSetting objects usually referenced
by name (using nm_connection_get_setting_by_name()) or by type (with
nm_connection_get_setting()). The settings describe the actual parameters
with which the network devices are configured, including device-specific
parameters (MTU, SSID, APN, channel, rate, etc) and IP-level parameters
(addresses, routes, addressing methods, etc).
GQuark
nm_connection_error_quark (void);
Registers an error quark for NMConnection if necessary.
NMConnection *
nm_connection_new (void);
Creates a new NMConnection object with no NMSetting objects.
NMConnection * nm_connection_new_from_hash (GHashTable *hash,GError **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.
hash |
the GHashTable describing the connection. |
[element-type utf8 GLib.HashTable] |
error |
on unsuccessful return, an error |
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_duplicate (NMConnection *connection);
Duplicates a NMConnection.
a new NMConnection containing the same settings and properties as the source NMConnection.
[transfer full]
NMSetting *
nm_connection_create_setting (const char *name);
Create a new NMSetting object of the desired type, given a setting name.
void nm_connection_add_setting (NMConnection *connection,NMSetting *setting);
Adds a NMSetting to the connection, replacing any previous NMSetting of the same name which has previously been added to the NMConnection. The connection takes ownership of the NMSetting object and does not increase the setting object's reference count.
void nm_connection_remove_setting (NMConnection *connection,GType setting_type);
Removes the NMSetting with the given GType from the NMConnection. This operation dereferences the NMSetting object.
NMSetting * nm_connection_get_setting (NMConnection *connection,GType setting_type);
Gets the NMSetting with the given GType, if one has been previously added to the NMConnection.
the NMSetting, or NULL if no setting of that type was previously
added to the NMConnection.
[transfer none]
NMSetting * nm_connection_get_setting_by_name (NMConnection *connection,const char *name);
Gets the NMSetting with the given name, if one has been previously added the NMConnection.
the NMSetting, or NULL if no setting with that name was previously
added to the NMConnection.
[transfer none]
gboolean nm_connection_replace_settings (NMConnection *connection,GHashTable *new_settings,GError **error);
connection |
||
new_settings |
a GHashTable of settings. |
[element-type utf8 GLib.HashTable] |
error |
location to store error, or |
gboolean nm_connection_replace_settings_from_connection (NMConnection *connection,NMConnection *new_connection,GError **error);
Deep-copies the settings of new_conenction
and replaces the settings of connection
with the copied settings.
connection |
||
new_connection |
a NMConnection to replace the settings of |
|
error |
location to store error, or |
TRUE if the settings were valid after replacing the connection, FALSE
if they were not. Regardless of whether TRUE or FALSE is returned, the connection
is successfully replaced. FALSE only means, that the connection does not verify
at the end of the operation.
Since: 0.9.10
gboolean nm_connection_compare (NMConnection *a,NMConnection *b,NMSettingCompareFlags flags);
Compares two NMConnection objects for similarity, with comparison behavior
modified by a set of flags. See nm_setting_compare() for a description of
each flag's behavior.
a |
||
b |
a second NMConnection to compare with the first |
|
flags |
compare flags, e.g. |