Top |
Functions
Properties
NMActiveConnection * | activating-connection | Read |
GPtrArray * | active-connections | Read |
GPtrArray * | all-devices | Read |
gboolean | can-modify | Read |
GPtrArray * | checkpoints | Read |
GPtrArray * | connections | Read |
NMConnectivityState | connectivity | Read |
gboolean | connectivity-check-available | Read |
gboolean | connectivity-check-enabled | Read / Write |
GPtrArray * | devices | Read |
GPtrArray * | dns-configuration | Read |
gchar * | dns-mode | Read |
gchar * | dns-rc-manager | Read |
gchar * | hostname | Read |
guint | metered | Read |
gboolean | networking-enabled | Read / Write |
gboolean | nm-running | Read |
NMActiveConnection * | primary-connection | Read |
gboolean | startup | Read |
NMState | state | Read |
gchar * | version | Read |
gboolean | wimax-enabled | Read / Write |
gboolean | wimax-hardware-enabled | Read |
gboolean | wireless-enabled | Read / Write |
gboolean | wireless-hardware-enabled | Read |
gboolean | wwan-enabled | Read / Write |
gboolean | wwan-hardware-enabled | Read |
Signals
void | active-connection-added | Run First |
void | active-connection-removed | Run First |
void | any-device-added | Run First |
void | any-device-removed | Run First |
void | connection-added | Run First |
void | connection-removed | Run First |
void | device-added | Run First |
void | device-removed | Run First |
void | permission-changed | Run First |
Types and Values
Object Hierarchy
GBoxed ╰── NMDnsEntry GEnum ├── NMClientError ├── NMClientPermission ╰── NMClientPermissionResult GObject ╰── NMClient
Functions
nm_client_error_quark ()
GQuark
nm_client_error_quark (void
);
Registers an error quark for NMClient if necessary.
nm_dns_entry_unref ()
void
nm_dns_entry_unref (NMDnsEntry *entry
);
Decreases the reference count of the object. If the reference count reaches zero, the object will be destroyed.
Since: 1.6
nm_dns_entry_get_interface ()
const char *
nm_dns_entry_get_interface (NMDnsEntry *entry
);
Gets the interface on which name servers are contacted.
Since: 1.6
nm_dns_entry_get_nameservers ()
const char * const *
nm_dns_entry_get_nameservers (NMDnsEntry *entry
);
Gets the list of name servers for this entry.
Since: 1.6
nm_dns_entry_get_domains ()
const char * const *
nm_dns_entry_get_domains (NMDnsEntry *entry
);
Gets the list of DNS domains.
Since: 1.6
nm_dns_entry_get_priority ()
int
nm_dns_entry_get_priority (NMDnsEntry *entry
);
Gets the priority of the entry
Since: 1.6
nm_dns_entry_get_vpn ()
gboolean
nm_dns_entry_get_vpn (NMDnsEntry *entry
);
Gets whether the entry refers to VPN name servers.
Since: 1.6
nm_client_new ()
NMClient * nm_client_new (GCancellable *cancellable
,GError **error
);
Creates a new NMClient.
Note that this will do blocking D-Bus calls to initialize the
client. You can use nm_client_new_async()
if you want to avoid
that.
nm_client_new_async ()
void nm_client_new_async (GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Creates a new NMClient and begins asynchronously initializing it.
callback
will be called when it is done; use
nm_client_new_finish()
to get the result. Note that on an error,
the callback can be invoked with two first parameters as NULL.
Parameters
cancellable |
a GCancellable, or |
|
callback |
callback to call when the client is created |
|
user_data |
data for |
nm_client_new_finish ()
NMClient * nm_client_new_finish (GAsyncResult *result
,GError **error
);
Gets the result of an nm_client_new_async()
call.
nm_client_get_version ()
const char *
nm_client_get_version (NMClient *client
);
Gets NetworkManager version.
nm_client_get_state ()
NMState
nm_client_get_state (NMClient *client
);
Gets the current daemon state.
nm_client_get_startup ()
gboolean
nm_client_get_startup (NMClient *client
);
Tests whether the daemon is still in the process of activating connections at startup.
nm_client_get_nm_running ()
gboolean
nm_client_get_nm_running (NMClient *client
);
Determines whether the daemon is running.
nm_client_networking_get_enabled ()
gboolean
nm_client_networking_get_enabled (NMClient *client
);
Whether networking is enabled or disabled.
nm_client_networking_set_enabled ()
gboolean nm_client_networking_set_enabled (NMClient *client
,gboolean enabled
,GError **error
);
Enables or disables networking. When networking is disabled, all controlled interfaces are disconnected and deactivated. When networking is enabled, all controlled interfaces are available for activation.
nm_client_wireless_get_enabled ()
gboolean
nm_client_wireless_get_enabled (NMClient *client
);
Determines whether the wireless is enabled.
nm_client_wireless_set_enabled ()
void nm_client_wireless_set_enabled (NMClient *client
,gboolean enabled
);
Enables or disables wireless devices.
nm_client_wireless_hardware_get_enabled ()
gboolean
nm_client_wireless_hardware_get_enabled
(NMClient *client
);
Determines whether the wireless hardware is enabled.
nm_client_wwan_get_enabled ()
gboolean
nm_client_wwan_get_enabled (NMClient *client
);
Determines whether WWAN is enabled.
nm_client_wwan_set_enabled ()
void nm_client_wwan_set_enabled (NMClient *client
,gboolean enabled
);
Enables or disables WWAN devices.
nm_client_wwan_hardware_get_enabled ()
gboolean
nm_client_wwan_hardware_get_enabled (NMClient *client
);
Determines whether the WWAN hardware is enabled.
nm_client_wimax_get_enabled ()
gboolean
nm_client_wimax_get_enabled (NMClient *client
);
Determines whether WiMAX is enabled.
nm_client_wimax_set_enabled ()
void nm_client_wimax_set_enabled (NMClient *client
,gboolean enabled
);
Enables or disables WiMAX devices.
nm_client_wimax_hardware_get_enabled ()
gboolean
nm_client_wimax_hardware_get_enabled (NMClient *client
);
Determines whether the WiMAX hardware is enabled.
nm_client_connectivity_check_get_available ()
gboolean
nm_client_connectivity_check_get_available
(NMClient *client
);
Determine whether connectivity checking is available. This requires that the URI of a connectivity service has been set in the configuration file.
Since: 1.10
nm_client_connectivity_check_get_enabled ()
gboolean
nm_client_connectivity_check_get_enabled
(NMClient *client
);
Determine whether connectivity checking is enabled.
Since: 1.10
nm_client_connectivity_check_set_enabled ()
void nm_client_connectivity_check_set_enabled (NMClient *client
,gboolean enabled
);
Enable or disable connectivity checking. Note that if a connectivity checking URI has not been configured, this will not have any effect.
Since: 1.10
nm_client_get_logging ()
gboolean nm_client_get_logging (NMClient *client
,char **level
,char **domains
,GError **error
);
Gets NetworkManager current logging level and domains.
nm_client_set_logging ()
gboolean nm_client_set_logging (NMClient *client
,const char *level
,const char *domains
,GError **error
);
Sets NetworkManager logging level and/or domains.
nm_client_get_permission_result ()
NMClientPermissionResult nm_client_get_permission_result (NMClient *client
,NMClientPermission permission
);
Requests the result of a specific permission, which indicates whether the client can or cannot perform the action the permission represents
Parameters
client |
a NMClient |
|
permission |
the permission for which to return the result, one of NMClientPermission |
nm_client_get_connectivity ()
NMConnectivityState
nm_client_get_connectivity (NMClient *client
);
Gets the current network connectivity state. Contrast
nm_client_check_connectivity()
and
nm_client_check_connectivity_async()
, which re-check the
connectivity state first before returning any information.
nm_client_check_connectivity ()
NMConnectivityState nm_client_check_connectivity (NMClient *client
,GCancellable *cancellable
,GError **error
);
Updates the network connectivity state and returns the (new)
current state. Contrast nm_client_get_connectivity()
, which returns
the most recent known state without re-checking.
This is a blocking call; use nm_client_check_connectivity_async()
if you do not want to block.
nm_client_check_connectivity_async ()
void nm_client_check_connectivity_async (NMClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously updates the network connectivity state and invokes
callback
when complete. Contrast nm_client_get_connectivity()
,
which (immediately) returns the most recent known state without
re-checking, and nm_client_check_connectivity()
, which blocks.
Parameters
client |
an NMClient |
|
cancellable |
||
callback |
callback to call with the result |
|
user_data |
data for |
nm_client_check_connectivity_finish ()
NMConnectivityState nm_client_check_connectivity_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Retrieves the result of an nm_client_check_connectivity_async()
call.
nm_client_save_hostname ()
gboolean nm_client_save_hostname (NMClient *client
,const char *hostname
,GCancellable *cancellable
,GError **error
);
Requests that the machine's persistent hostname be set to the specified value or cleared.
Parameters
client |
the |
|
hostname |
the new persistent hostname to set, or |
[allow-none] |
cancellable |
a GCancellable, or |
|
error |
return location for GError |
nm_client_save_hostname_async ()
void nm_client_save_hostname_async (NMClient *client
,const char *hostname
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Requests that the machine's persistent hostname be set to the specified value or cleared.
Parameters
client |
the |
|
hostname |
the new persistent hostname to set, or |
[allow-none] |
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the operation completes. |
[scope async] |
user_data |
caller-specific data passed to |
[closure] |
nm_client_save_hostname_finish ()
gboolean nm_client_save_hostname_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of an nm_client_save_hostname_async()
call.
Parameters
client |
the |
|
result |
the result passed to the GAsyncReadyCallback |
|
error |
return location for GError |
nm_client_get_devices ()
const GPtrArray *
nm_client_get_devices (NMClient *client
);
Gets all the known network devices. Use nm_device_get_type()
or the
NM_IS_DEVICE_XXXX
functions to determine what kind of
device member of the returned array is, and then you may use device-specific
methods such as nm_device_ethernet_get_hw_address()
.
nm_client_get_all_devices ()
const GPtrArray *
nm_client_get_all_devices (NMClient *client
);
Gets both real devices and device placeholders (eg, software devices which
do not currently exist, but could be created automatically by NetworkManager
if one of their NMDevice::ActivatableConnections was activated). Use
nm_device_is_real()
to determine whether each device is a real device or
a placeholder.
Use nm_device_get_type()
or the NM_IS_DEVICE_XXXX()
functions to determine
what kind of device each member of the returned array is, and then you may
use device-specific methods such as nm_device_ethernet_get_hw_address()
.
Returns
a GPtrArray containing all the NMDevices. The returned array is owned by the NMClient object and should not be modified.
[transfer none][element-type NMDevice]
Since: 1.2
nm_client_get_device_by_path ()
NMDevice * nm_client_get_device_by_path (NMClient *client
,const char *object_path
);
nm_client_get_device_by_iface ()
NMDevice * nm_client_get_device_by_iface (NMClient *client
,const char *iface
);
nm_client_get_active_connections ()
const GPtrArray *
nm_client_get_active_connections (NMClient *client
);
Gets the active connections.
Returns
a GPtrArray containing all the active NMActiveConnections. The returned array is owned by the client and should not be modified.
[transfer none][element-type NMActiveConnection]
nm_client_get_primary_connection ()
NMActiveConnection *
nm_client_get_primary_connection (NMClient *client
);
Gets the NMActiveConnection corresponding to the primary active network device.
In particular, when there is no VPN active, or the VPN does not have the default route, this returns the active connection that has the default route. If there is a VPN active with the default route, then this function returns the active connection that contains the route to the VPN endpoint.
If there is no default route, or the default route is over a
non-NetworkManager-recognized device, this will return NULL
.
nm_client_get_activating_connection ()
NMActiveConnection *
nm_client_get_activating_connection (NMClient *client
);
Gets the NMActiveConnection corresponding to a currently-activating connection that is expected to become the new “primary-connection” upon successful activation.
nm_client_activate_connection_async ()
void nm_client_activate_connection_async (NMClient *client
,NMConnection *connection
,NMDevice *device
,const char *specific_object
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously starts a connection to a particular network using the
configuration settings from connection
and the network device device
.
Certain connection types also take a "specific object" which is the object
path of a connection- specific object, like an NMAccessPoint for Wi-Fi
connections, or an NMWimaxNsp for WiMAX connections, to which you wish to
connect. If the specific object is not given, NetworkManager can, in some
cases, automatically determine which network to connect to given the settings
in connection
.
If connection
is not given for a device-based activation, NetworkManager
picks the best available connection for the device and activates it.
Note that the callback is invoked when NetworkManager has started activating the new connection, not when it finishes. You can use the returned NMActiveConnection object (in particular, “state”) to track the activation to its completion.
Parameters
client |
a NMClient |
|
connection |
an NMConnection. |
[allow-none] |
device |
the NMDevice. |
[allow-none] |
specific_object |
the object path of a connection-type-specific
object this activation should use. This parameter is currently ignored for
wired and mobile broadband connections, and the value of |
[allow-none] |
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the activation has started |
|
user_data |
caller-specific data passed to |
nm_client_activate_connection_finish ()
NMActiveConnection * nm_client_activate_connection_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_client_activate_connection_async()
.
Returns
the new NMActiveConnection on success, NULL
on
failure, in which case error
will be set.
[transfer full]
nm_client_add_and_activate_connection_async ()
void nm_client_add_and_activate_connection_async (NMClient *client
,NMConnection *partial
,NMDevice *device
,const char *specific_object
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Adds a new connection using the given details (if any) as a template,
automatically filling in missing settings with the capabilities of the given
device and specific object. The new connection is then asynchronously
activated as with nm_client_activate_connection_async()
. Cannot be used for
VPN connections at this time.
Note that the callback is invoked when NetworkManager has started activating the new connection, not when it finishes. You can used the returned NMActiveConnection object (in particular, “state”) to track the activation to its completion.
Parameters
client |
a NMClient |
|
partial |
an NMConnection to add; the connection may be
partially filled (or even |
[allow-none] |
device |
the NMDevice |
|
specific_object |
the object path of a connection-type-specific
object this activation should use. This parameter is currently ignored for
wired and mobile broadband connections, and the value of |
[allow-none] |
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the activation has started |
|
user_data |
caller-specific data passed to |
nm_client_add_and_activate_connection_finish ()
NMActiveConnection * nm_client_add_and_activate_connection_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_client_add_and_activate_connection_async()
.
You can call nm_active_connection_get_connection()
on the returned
NMActiveConnection to find the path of the created NMConnection.
Returns
the new NMActiveConnection on success, NULL
on
failure, in which case error
will be set.
[transfer full]
nm_client_deactivate_connection ()
gboolean nm_client_deactivate_connection (NMClient *client
,NMActiveConnection *active
,GCancellable *cancellable
,GError **error
);
Deactivates an active NMActiveConnection.
Parameters
client |
a NMClient |
|
active |
the NMActiveConnection to deactivate |
|
cancellable |
a GCancellable, or |
|
error |
nm_client_deactivate_connection_async ()
void nm_client_deactivate_connection_async (NMClient *client
,NMActiveConnection *active
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Asynchronously deactivates an active NMActiveConnection.
Parameters
client |
a NMClient |
|
active |
the NMActiveConnection to deactivate |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the deactivation has completed |
|
user_data |
caller-specific data passed to |
nm_client_deactivate_connection_finish ()
gboolean nm_client_deactivate_connection_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_client_deactivate_connection_async()
.
nm_client_get_connections ()
const GPtrArray *
nm_client_get_connections (NMClient *client
);
Returns
an array containing all connections provided by the remote settings service. The returned array is owned by the NMClient object and should not be modified.
The connections are as received from D-Bus and might not validate according
to nm_connection_verify()
.
[transfer none][element-type NMRemoteConnection]
nm_client_get_connection_by_id ()
NMRemoteConnection * nm_client_get_connection_by_id (NMClient *client
,const char *id
);
Returns the first matching NMRemoteConnection
matching a given id
.
Returns
the remote connection object on success, or NULL
if no
matching object was found.
The connection is as received from D-Bus and might not validate according
to nm_connection_verify()
.
[transfer none]
nm_client_get_connection_by_path ()
NMRemoteConnection * nm_client_get_connection_by_path (NMClient *client
,const char *path
);
Returns the NMRemoteConnection
representing the connection at path
.
Returns
the remote connection object on success, or NULL
if the object was
not known
The connection is as received from D-Bus and might not validate according
to nm_connection_verify()
.
[transfer none]
nm_client_get_connection_by_uuid ()
NMRemoteConnection * nm_client_get_connection_by_uuid (NMClient *client
,const char *uuid
);
Returns the NMRemoteConnection
identified by uuid
.
Returns
the remote connection object on success, or NULL
if the object was
not known
The connection is as received from D-Bus and might not validate according
to nm_connection_verify()
.
[transfer none]
nm_client_add_connection_async ()
void nm_client_add_connection_async (NMClient *client
,NMConnection *connection
,gboolean save_to_disk
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Requests that the remote settings service add the given settings to a new
connection. If save_to_disk
is TRUE
, the connection is immediately written
to disk; otherwise it is initially only stored in memory, but may be saved
later by calling the connection's nm_remote_connection_commit_changes()
method.
connection
is untouched by this function and only serves as a template of
the settings to add. The NMRemoteConnection object that represents what
NetworkManager actually added is returned to callback
when the addition
operation is complete.
Note that the NMRemoteConnection returned in callback
may not contain
identical settings to connection
as NetworkManager may perform automatic
completion and/or normalization of connection properties.
Parameters
client |
the |
|
connection |
the connection to add. Note that this object's settings will be added, not the object itself |
|
save_to_disk |
whether to immediately save the connection to disk |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the add operation completes. |
[scope async] |
user_data |
caller-specific data passed to |
[closure] |
nm_client_add_connection_finish ()
NMRemoteConnection * nm_client_add_connection_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_client_add_connection_async()
.
Returns
the new NMRemoteConnection on success, NULL
on
failure, in which case error
will be set.
[transfer full]
nm_client_load_connections ()
gboolean nm_client_load_connections (NMClient *client
,char **filenames
,char ***failures
,GCancellable *cancellable
,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
client
'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.
nm_client_load_connections_async ()
void nm_client_load_connections_async (NMClient *client
,char **filenames
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Requests that the remote settings service asynchronously load or reload the given files, adding or updating the connections described within.
See nm_client_load_connections()
for more details.
Parameters
client |
the |
|
filenames |
|
[array zero-terminated=1] |
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the operation completes. |
[scope async] |
user_data |
caller-specific data passed to |
[closure] |
nm_client_load_connections_finish ()
gboolean nm_client_load_connections_finish (NMClient *client
,char ***failures
,GAsyncResult *result
,GError **error
);
Gets the result of an nm_client_load_connections_async()
call.
See nm_client_load_connections()
for more details.
Parameters
client |
the |
|
failures |
on return, a
|
[out][transfer full][array zero-terminated=1] |
result |
the result passed to the GAsyncReadyCallback |
|
error |
nm_client_reload_connections ()
gboolean nm_client_reload_connections (NMClient *client
,GCancellable *cancellable
,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.
nm_client_reload_connections_async ()
void nm_client_reload_connections_async (NMClient *client
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Requests that the remote settings service begin reloading all connection files from disk, adding, updating, and removing connections until the in-memory state matches the on-disk state.
Parameters
client |
the NMClient |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the reload operation completes. |
[scope async] |
user_data |
caller-specific data passed to |
[closure] |
nm_client_reload_connections_finish ()
gboolean nm_client_reload_connections_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of an nm_client_reload_connections_async()
call.
Parameters
client |
the NMClient |
|
result |
the result passed to the GAsyncReadyCallback |
|
error |
return location for GError |
nm_client_get_dns_mode ()
const char *
nm_client_get_dns_mode (NMClient *client
);
Gets the current DNS processing mode.
Since: 1.6
nm_client_get_dns_rc_manager ()
const char *
nm_client_get_dns_rc_manager (NMClient *client
);
Gets the current DNS resolv.conf manager.
Since: 1.6
nm_client_get_dns_configuration ()
const GPtrArray *
nm_client_get_dns_configuration (NMClient *client
);
Gets the current DNS configuration
Returns
a GPtrArray
containing NMDnsEntry elements or NULL
in case the value is not
available. The returned array is owned by the NMClient object
and should not be modified.
[transfer none][element-type NMDnsEntry]
Since: 1.6
nm_client_get_checkpoints ()
const GPtrArray *
nm_client_get_checkpoints (NMClient *client
);
Gets all the active checkpoints.
Returns
a GPtrArray containing all the NMCheckpoint. The returned array is owned by the NMClient object and should not be modified.
[transfer none][element-type NMCheckpoint]
Since: 1.12
nm_client_checkpoint_create ()
void nm_client_checkpoint_create (NMClient *client
,const GPtrArray *devices
,guint32 rollback_timeout
,NMCheckpointCreateFlags flags
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Creates a checkpoint of the current networking configuration
for given interfaces. An empty devices
argument means all
devices. If rollback_timeout
is not zero, a rollback is
automatically performed after the given timeout.
Parameters
client |
the |
|
devices |
a list of devices for which a checkpoint should be created. |
[element-type NMDevice] |
rollback_timeout |
the rollback timeout in seconds |
|
flags |
creation flags |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the add operation completes. |
[scope async] |
user_data |
caller-specific data passed to |
[closure] |
Since: 1.12
nm_client_checkpoint_create_finish ()
NMCheckpoint * nm_client_checkpoint_create_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_client_checkpoint_create()
.
Returns
the new NMCheckpoint on success, NULL
on
failure, in which case error
will be set.
[transfer full]
Since: 1.12
nm_client_checkpoint_destroy ()
void nm_client_checkpoint_destroy (NMClient *client
,const char *checkpoint_path
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Destroys an existing checkpoint without performing a rollback.
Parameters
client |
the |
|
checkpoint_path |
the D-Bus path for the checkpoint |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the add operation completes. |
[scope async] |
user_data |
caller-specific data passed to |
[closure] |
Since: 1.12
nm_client_checkpoint_destroy_finish ()
gboolean nm_client_checkpoint_destroy_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_client_checkpoint_destroy()
.
Since: 1.12
nm_client_checkpoint_rollback ()
void nm_client_checkpoint_rollback (NMClient *client
,const char *checkpoint_path
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Performs the rollback of a checkpoint before the timeout is reached.
Parameters
client |
the |
|
checkpoint_path |
the D-Bus path to the checkpoint |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the add operation completes. |
[scope async] |
user_data |
caller-specific data passed to |
[closure] |
Since: 1.12
nm_client_checkpoint_rollback_finish ()
GHashTable * nm_client_checkpoint_rollback_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_client_checkpoint_rollback()
.
Returns
an hash table of devices and results. Devices are represented by their original D-Bus path; each result is a NMRollbackResult.
[transfer full][element-type utf8 guint32]
Since: 1.12
nm_client_checkpoint_adjust_rollback_timeout ()
void nm_client_checkpoint_adjust_rollback_timeout (NMClient *client
,const char *checkpoint_path
,guint32 add_timeout
,GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
);
Resets the timeout for the checkpoint with path checkpoint_path
to timeout_add
.
Parameters
client |
the |
|
checkpoint_path |
a D-Bus path to a checkpoint |
|
add_timeout |
the timeout in seconds counting from now. Set to zero, to disable the timeout. |
|
cancellable |
a GCancellable, or |
|
callback |
callback to be called when the add operation completes. |
[scope async] |
user_data |
caller-specific data passed to |
[closure] |
Since: 1.12
nm_client_checkpoint_adjust_rollback_timeout_finish ()
gboolean nm_client_checkpoint_adjust_rollback_timeout_finish (NMClient *client
,GAsyncResult *result
,GError **error
);
Gets the result of a call to nm_client_checkpoint_adjust_rollback_timeout()
.
Since: 1.12
Types and Values
NM_CLIENT_WIRELESS_HARDWARE_ENABLED
#define NM_CLIENT_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
NM_CLIENT_CONNECTIVITY_CHECK_AVAILABLE
#define NM_CLIENT_CONNECTIVITY_CHECK_AVAILABLE "connectivity-check-available"
NM_CLIENT_CONNECTIVITY_CHECK_ENABLED
#define NM_CLIENT_CONNECTIVITY_CHECK_ENABLED "connectivity-check-enabled"
NM_CLIENT_ACTIVE_CONNECTION_ADDED
#define NM_CLIENT_ACTIVE_CONNECTION_ADDED "active-connection-added"
NM_CLIENT_ACTIVE_CONNECTION_REMOVED
#define NM_CLIENT_ACTIVE_CONNECTION_REMOVED "active-connection-removed"
enum NMClientPermission
NMClientPermission values indicate various permissions that NetworkManager clients can obtain to perform certain tasks on behalf of the current user.
Members
unknown or no permission |
||
controls whether networking can be globally enabled or disabled |
||
controls whether Wi-Fi can be globally enabled or disabled |
||
controls whether WWAN (3G) can be globally enabled or disabled |
||
controls whether WiMAX can be globally enabled or disabled |
||
controls whether the client can ask NetworkManager to sleep and wake |
||
controls whether networking connections can be started, stopped, and changed |
||
controls whether a password protected Wi-Fi hotspot can be created |
||
controls whether an open Wi-Fi hotspot can be created |
||
controls whether connections that are available to all users can be modified |
||
controls whether connections owned by the current user can be modified |
||
controls whether the persistent hostname can be changed |
||
modify persistent global DNS configuration |
||
controls access to Reload. |
||
permission to create checkpoints. |
||
controls whether device statistics can be globally enabled or disabled |
||
controls whether connectivity check can be enabled or disabled |
||
a reserved boundary value |
enum NMClientPermissionResult
NMClientPermissionResult values indicate what authorizations and permissions the user requires to obtain a given NMClientPermission
enum NMClientError
Describes errors that may result from operations involving a NMClient.
D-Bus operations may also return errors from other domains, including NMManagerError, NMSettingsError, NMAgentManagerError, and NMConnectionError.
Members
unknown or unclassified error |
||
an operation that requires NetworkManager failed because NetworkManager is not running |
||
NetworkManager claimed that an operation succeeded, but the object that was allegedly created (eg, NMRemoteConnection, NMActiveConnection) was apparently destroyed before NMClient could create a representation of it. |
Property Details
The “activating-connection”
property
“activating-connection” NMActiveConnection *
The NMActiveConnection of the activating connection that is likely to become the new “primary-connection”.
Flags: Read
The “active-connections”
property
“active-connections” GPtrArray *
The active connections.
[type GPtrArray(NMActiveConnection)]
Flags: Read
The “all-devices”
property
“all-devices” GPtrArray *
List of both real devices and device placeholders.
[type GPtrArray(NMDevice)]
Flags: Read
Since: 1.2
The “can-modify”
property
“can-modify” gboolean
If TRUE
, adding and modifying connections is supported.
Flags: Read
Default value: FALSE
The “checkpoints”
property
“checkpoints” GPtrArray *
The list of active checkpoints.
[type GPtrArray(NMCheckpoint)]
Flags: Read
Since: 1.12
The “connections”
property
“connections” GPtrArray *
The list of configured connections that are available to the user. (Note that this differs from the underlying D-Bus property, which may also contain the object paths of connections that the user does not have permission to read the details of.)
[type GPtrArray(NMRemoteConnection)]
Flags: Read
The “connectivity”
property
“connectivity” NMConnectivityState
The network connectivity state.
Flags: Read
Default value: NM_CONNECTIVITY_UNKNOWN
The “connectivity-check-available”
property
“connectivity-check-available” gboolean
Flags: Read
Default value: FALSE
The “connectivity-check-enabled”
property
“connectivity-check-enabled” gboolean
Flags: Read / Write
Default value: FALSE
The “devices”
property
“devices” GPtrArray *
List of real network devices. Does not include placeholder devices.
[type GPtrArray(NMDevice)]
Flags: Read
The “dns-configuration”
property
“dns-configuration” GPtrArray *
The current DNS configuration represented as an array of dictionaries. Each dictionary has the "nameservers", "priority" keys and, optionally, "interface" and "vpn". "nameservers" is the list of DNS servers, "priority" their relative priority, "interface" the interface on which these servers are contacted, "vpn" a boolean telling whether the configuration was obtained from a VPN connection.
[type GPtrArray(GVariant)]
Flags: Read
Since: 1.6
The “dns-mode”
property
“dns-mode” gchar *
The current DNS processing mode.
Flags: Read
Default value: ""
Since: 1.6
The “dns-rc-manager”
property
“dns-rc-manager” gchar *
The current resolv.conf management mode.
Flags: Read
Default value: ""
Since: 1.6
The “hostname”
property
“hostname” gchar *
The machine hostname stored in persistent configuration. This can be
modified by calling nm_client_save_hostname()
.
Flags: Read
Default value: NULL
The “metered”
property
“metered” guint
Whether the connectivity is metered.
Flags: Read
Default value: 0
Since: 1.2
The “networking-enabled”
property
“networking-enabled” gboolean
Whether networking is enabled.
Flags: Read / Write
Default value: TRUE
The “nm-running”
property
“nm-running” gboolean
Whether the daemon is running.
Flags: Read
Default value: FALSE
The “primary-connection”
property
“primary-connection” NMActiveConnection *
The NMActiveConnection of the device with the default route;
see nm_client_get_primary_connection()
for more details.
Flags: Read
The “startup”
property
“startup” gboolean
Whether the daemon is still starting up.
Flags: Read
Default value: FALSE
The “state”
property
“state” NMState
The current daemon state.
Flags: Read
Default value: NM_STATE_UNKNOWN
The “version”
property
“version” gchar *
The NetworkManager version.
Flags: Read
Default value: NULL
The “wimax-enabled”
property
“wimax-enabled” gboolean
Whether WiMAX functionality is enabled.
Flags: Read / Write
Default value: FALSE
The “wimax-hardware-enabled”
property
“wimax-hardware-enabled” gboolean
Whether the WiMAX hardware is enabled.
Flags: Read
Default value: FALSE
The “wireless-enabled”
property
“wireless-enabled” gboolean
Whether wireless is enabled.
Flags: Read / Write
Default value: FALSE
The “wireless-hardware-enabled”
property
“wireless-hardware-enabled” gboolean
Whether the wireless hardware is enabled.
Flags: Read
Default value: TRUE
The “wwan-enabled”
property
“wwan-enabled” gboolean
Whether WWAN functionality is enabled.
Flags: Read / Write
Default value: FALSE
The “wwan-hardware-enabled”
property
“wwan-hardware-enabled” gboolean
Whether the WWAN hardware is enabled.
Flags: Read
Default value: FALSE
Signal Details
The “active-connection-added”
signal
void user_function (NMClient *client, NMActiveConnection *active_connection, gpointer user_data)
Notifies that a NMActiveConnection has been added.
Parameters
client |
the settings object that received the signal |
|
active_connection |
the new active connection |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
The “active-connection-removed”
signal
void user_function (NMClient *client, NMActiveConnection *active_connection, gpointer user_data)
Notifies that a NMActiveConnection has been removed.
Parameters
client |
the settings object that received the signal |
|
active_connection |
the removed active connection |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
The “any-device-added”
signal
void user_function (NMClient *client, GObject *device, gpointer user_data)
Notifies that a NMDevice is added. This signal is emitted for both regular devices and placeholder devices.
Parameters
client |
the client that received the signal |
|
device |
the new device. |
[type NMDevice] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
The “any-device-removed”
signal
void user_function (NMClient *client, GObject *device, gpointer user_data)
Notifies that a NMDevice is removed. This signal is emitted for both regular devices and placeholder devices.
Parameters
client |
the client that received the signal |
|
device |
the removed device. |
[type NMDevice] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
The “connection-added”
signal
void user_function (NMClient *client, NMRemoteConnection *connection, gpointer user_data)
Notifies that a NMConnection has been added.
Parameters
client |
the settings object that received the signal |
|
connection |
the new connection |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
The “connection-removed”
signal
void user_function (NMClient *client, NMRemoteConnection *connection, gpointer user_data)
Notifies that a NMConnection has been removed.
Parameters
client |
the settings object that received the signal |
|
connection |
the removed connection |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First
The “device-added”
signal
void user_function (NMClient *client, GObject *device, gpointer user_data)
Notifies that a NMDevice is added. This signal is not emitted for placeholder devices.
Parameters
client |
the client that received the signal |
|
device |
the new device. |
[type NMDevice] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
The “device-removed”
signal
void user_function (NMClient *client, GObject *device, gpointer user_data)
Notifies that a NMDevice is removed. This signal is not emitted for placeholder devices.
Parameters
client |
the client that received the signal |
|
device |
the removed device. |
[type NMDevice] |
user_data |
user data set when the signal handler was connected. |
Flags: Run First
The “permission-changed”
signal
void user_function (NMClient *client, guint permission, guint result, gpointer user_data)
Notifies that a permission has changed
Parameters
client |
the client that received the signal |
|
permission |
a permission from NMClientPermission |
|
result |
the permission's result, one of NMClientPermissionResult |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First