![]() |
![]() |
![]() |
libnm-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
enum NMRemoteSettingsError; #define NM_REMOTE_SETTINGS_ERROR GQuark nm_remote_settings_error_quark (void
); #define NM_REMOTE_SETTINGS_BUS #define NM_REMOTE_SETTINGS_SERVICE_RUNNING #define NM_REMOTE_SETTINGS_HOSTNAME #define NM_REMOTE_SETTINGS_CAN_MODIFY #define NM_REMOTE_SETTINGS_NEW_CONNECTION #define NM_REMOTE_SETTINGS_CONNECTIONS_READ void (*NMRemoteSettingsAddConnectionFunc) (NMRemoteSettings *settings
,NMRemoteConnection *connection
,GError *error
,gpointer user_data
); void (*NMRemoteSettingsLoadConnectionsFunc) (NMRemoteSettings *settings
,char **failures
,GError *error
,gpointer user_data
); void (*NMRemoteSettingsSaveHostnameFunc) (NMRemoteSettings *settings
,GError *error
,gpointer user_data
); struct NMRemoteSettings; struct NMRemoteSettingsClass; NMRemoteSettings * nm_remote_settings_new (DBusGConnection *bus
); void nm_remote_settings_new_async (DBusGConnection *bus
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); NMRemoteSettings * nm_remote_settings_new_finish (GAsyncResult *result
,GError **error
); GSList * nm_remote_settings_list_connections (NMRemoteSettings *settings
); NMRemoteConnection * nm_remote_settings_get_connection_by_id (NMRemoteSettings *settings
,const char *id
); NMRemoteConnection * nm_remote_settings_get_connection_by_path (NMRemoteSettings *settings
,const char *path
); NMRemoteConnection * nm_remote_settings_get_connection_by_uuid (NMRemoteSettings *settings
,const char *uuid
); gboolean nm_remote_settings_add_connection (NMRemoteSettings *settings
,NMConnection *connection
,NMRemoteSettingsAddConnectionFunc callback
,gpointer user_data
); gboolean nm_remote_settings_add_connection_unsaved (NMRemoteSettings *settings
,NMConnection *connection
,NMRemoteSettingsAddConnectionFunc callback
,gpointer user_data
); gboolean nm_remote_settings_load_connections (NMRemoteSettings *settings
,char **filenames
,char ***failures
,GError **error
); gboolean nm_remote_settings_reload_connections (NMRemoteSettings *settings
,GError **error
); gboolean nm_remote_settings_save_hostname (NMRemoteSettings *settings
,const char *hostname
,NMRemoteSettingsSaveHostnameFunc callback
,gpointer user_data
);
"bus" DBusGConnection* : Read / Write / Construct Only "can-modify" gboolean : Read "hostname" gchar* : Read "service-running" gboolean : Read
typedef enum { NM_REMOTE_SETTINGS_ERROR_UNKNOWN = 0, /*< nick=UnknownError >*/ NM_REMOTE_SETTINGS_ERROR_CONNECTION_REMOVED, /*< nick=ConnectionRemoved >*/ NM_REMOTE_SETTINGS_ERROR_CONNECTION_UNAVAILABLE, /*< nick=ConnectionUnavailable >*/ NM_REMOTE_SETTINGS_ERROR_SERVICE_UNAVAILABLE, /*< nick=ServiceUnavailable >*/ } NMRemoteSettingsError;
Describes errors that may result from operations involving a NMRemoteSettings.
unknown or unclassified error | |
the NMRemoteConnection object was removed before it was completely initialized | |
the NMRemoteConnection object is not visible or otherwise unreadable | |
NetworkManager is not running. (Since 0.9.10) |
GQuark nm_remote_settings_error_quark (void
);
Registers an error quark for NMRemoteSettings if necessary.
Returns : |
the error quark used for NMRemoteSettings errors. |
void (*NMRemoteSettingsAddConnectionFunc) (NMRemoteSettings *settings
,NMRemoteConnection *connection
,GError *error
,gpointer user_data
);
void (*NMRemoteSettingsLoadConnectionsFunc) (NMRemoteSettings *settings
,char **failures
,GError *error
,gpointer user_data
);
void (*NMRemoteSettingsSaveHostnameFunc) (NMRemoteSettings *settings
,GError *error
,gpointer user_data
);
struct NMRemoteSettingsClass { GObjectClass parent; /* Signals */ void (*new_connection) (NMRemoteSettings *settings, NMRemoteConnection *connection); void (*connections_read) (NMRemoteSettings *settings); /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); void (*_reserved5) (void); void (*_reserved6) (void); };
NMRemoteSettings * nm_remote_settings_new (DBusGConnection *bus
);
Creates a new object representing the remote settings service.
Note that this will do blocking D-Bus calls to initialize the
settings object. You can use nm_remote_settings_new_async()
if you
want to avoid that.
|
a valid and connected D-Bus connection. [allow-none] |
Returns : |
the new remote settings object on success, or NULL on failure |
void nm_remote_settings_new_async (DBusGConnection *bus
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Creates a new object representing the remote settings service and
begins asynchronously initializing it. callback
will be called
when it is done; use nm_remote_settings_new_finish()
to get the
result.
|
a valid and connected D-Bus connection. [allow-none] |
|
a GCancellable, or NULL
|
|
callback to call when the settings object is created |
|
data for callback
|
NMRemoteSettings * nm_remote_settings_new_finish (GAsyncResult *result
,GError **error
);
Gets the result of an nm_remote_settings_new_async()
call.
|
a GAsyncResult |
|
location for a GError, or NULL
|
Returns : |
a new NMRemoteSettings object, or NULL on error |
GSList * nm_remote_settings_list_connections (NMRemoteSettings *settings
);
|
the NMRemoteSettings
|
Returns : |
a
list containing all connections provided by the remote settings service.
Each element of the returned list is a NMRemoteConnection instance, which is
owned by the NMRemoteSettings object and should not be freed by the caller.
The returned list is, however, owned by the caller and should be freed
using g_slist_free() when no longer required. [transfer container][element-type NMClient.RemoteConnection]
|
NMRemoteConnection * nm_remote_settings_get_connection_by_id (NMRemoteSettings *settings
,const char *id
);
Returns the first matching NMRemoteConnection
matching a given id
.
|
the NMRemoteSettings
|
|
the id of the remote connection |
Returns : |
the remote connection object on success, or NULL if no
matching object was found. [transfer none]
|
Since 0.9.10
NMRemoteConnection * nm_remote_settings_get_connection_by_path (NMRemoteSettings *settings
,const char *path
);
Returns the NMRemoteConnection
representing the connection at path
.
|
the NMRemoteSettings
|
|
the D-Bus object path of the remote connection |
Returns : |
the remote connection object on success, or NULL if the object was
not known. [transfer none]
|
NMRemoteConnection * nm_remote_settings_get_connection_by_uuid (NMRemoteSettings *settings
,const char *uuid
);
Returns the NMRemoteConnection
identified by uuid
.
|
the NMRemoteSettings
|
|
the UUID of the remote connection |
Returns : |
the remote connection object on success, or NULL if the object was
not known. [transfer none]
|
gboolean nm_remote_settings_add_connection (NMRemoteSettings *settings
,NMConnection *connection
,NMRemoteSettingsAddConnectionFunc callback
,gpointer user_data
);
Requests that the remote settings service add the given settings to a new connection. The connection is immediately written to disk.
|
the NMRemoteSettings
|
|
the connection to add. Note that this object's settings will be added, not the object itself |
|
callback to be called when the add operation completes. [scope async] |
|
caller-specific data passed to callback . [closure]
|
Returns : |
TRUE if the request was successful, FALSE if it failed |
gboolean nm_remote_settings_add_connection_unsaved (NMRemoteSettings *settings
,NMConnection *connection
,NMRemoteSettingsAddConnectionFunc callback
,gpointer user_data
);
Requests that the remote settings service add the given settings to a new
connection. The connection is not written to disk, which may be done at
a later time by calling the connection's nm_remote_connection_commit_changes()
method.
|
the NMRemoteSettings
|
|
the connection to add. Note that this object's settings will be added, not the object itself |
|
callback to be called when the add operation completes. [scope async] |
|
caller-specific data passed to callback . [closure]
|
Returns : |
TRUE if the request was successful, FALSE if it failed |
Since 0.9.10
gboolean nm_remote_settings_load_connections (NMRemoteSettings *settings
,char **filenames
,char ***failures
,GError **error
);
Requests that the remote settings service load or reload the given files, adding or updating the connections described within.
The changes to the indicated files will not yet be reflected in
settings
's connections array when the function returns.
If all of the indicated files were successfully loaded, the
function will return TRUE
, and failures
will be set to NULL
. If
NetworkManager tried to load the files, but some (or all) failed,
then failures
will be set to a NULL
-terminated array of the
filenames that failed to load.
|
the NMRemoteSettings
|
|
NULL -terminated array of filenames to load |
|
on return, a NULL -terminated array of
filenames that failed to load. [out][transfer full]
|
|
return location for GError |
Returns : |
TRUE if NetworkManager at least tried to load filenames ,
FALSE if an error occurred (eg, permission denied). |
Since 0.9.10
gboolean nm_remote_settings_reload_connections (NMRemoteSettings *settings
,GError **error
);
Requests that the remote settings service reload all connection files from disk, adding, updating, and removing connections until the in-memory state matches the on-disk state.
|
the NMRemoteSettings |
|
return location for GError |
Returns : |
TRUE on success, FALSE on failure |
Since 0.9.10
gboolean nm_remote_settings_save_hostname (NMRemoteSettings *settings
,const char *hostname
,NMRemoteSettingsSaveHostnameFunc callback
,gpointer user_data
);
Requests that the machine's persistent hostname be set to the specified value or cleared.
|
the NMRemoteSettings
|
|
the new persistent hostname to set, or NULL to clear any existing
persistent hostname |
|
callback to be called when the hostname operation completes. [scope async][allow-none] |
|
caller-specific data passed to callback . [closure]
|
Returns : |
TRUE if the request was successful, FALSE if it failed |
"can-modify"
property"can-modify" gboolean : Read
Can modify anything (hostname, connections, etc).
Default value: FALSE
"service-running"
property"service-running" gboolean : Read
Is service running.
Default value: FALSE
"connections-read"
signalvoid user_function (NMRemoteSettings *nmremotesettings,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |
"new-connection"
signalvoid user_function (NMRemoteSettings *nmremotesettings,
GObject *arg1,
gpointer user_data) : Run First
|
the object which received the signal. |
|
user data set when the signal handler was connected. |