![]() |
![]() |
![]() |
libnm-glib Reference Manual | ![]() |
---|---|---|---|---|
Top | Description | Object Hierarchy | Implemented Interfaces | Properties | Signals |
NMClient; void (*NMClientActivateFn) (NMClient *client
,NMActiveConnection *active_connection
,GError *error
,gpointer user_data
); void (*NMClientAddActivateFn) (NMClient *client
,NMActiveConnection *connection
,const char *new_connection_path
,GError *error
,gpointer user_data
); NMClientClass; enum NMClientPermission; enum NMClientPermissionResult; #define NM_CLIENT_ACTIVE_CONNECTIONS #define NM_CLIENT_MANAGER_RUNNING #define NM_CLIENT_NETWORKING_ENABLED #define NM_CLIENT_STATE #define NM_CLIENT_VERSION #define NM_CLIENT_WIMAX_ENABLED #define NM_CLIENT_WIMAX_HARDWARE_ENABLED #define NM_CLIENT_WIRELESS_ENABLED #define NM_CLIENT_WIRELESS_HARDWARE_ENABLED #define NM_CLIENT_WWAN_ENABLED #define NM_CLIENT_WWAN_HARDWARE_ENABLED void nm_client_activate_connection (NMClient *client
,NMConnection *connection
,NMDevice *device
,const char *specific_object
,NMClientActivateFn callback
,gpointer user_data
); void nm_client_add_and_activate_connection (NMClient *client
,NMConnection *partial
,NMDevice *device
,const char *specific_object
,NMClientAddActivateFn callback
,gpointer user_data
); void nm_client_deactivate_connection (NMClient *client
,NMActiveConnection *active
); const GPtrArray * nm_client_get_active_connections (NMClient *client
); NMDevice * nm_client_get_device_by_iface (NMClient *client
,const char *iface
); NMDevice * nm_client_get_device_by_path (NMClient *client
,const char *object_path
); const GPtrArray * nm_client_get_devices (NMClient *client
); gboolean nm_client_get_manager_running (NMClient *client
); NMClientPermissionResult nm_client_get_permission_result (NMClient *client
,NMClientPermission permission
); NMState nm_client_get_state (NMClient *client
); const char * nm_client_get_version (NMClient *client
); gboolean nm_client_networking_get_enabled (NMClient *client
); void nm_client_networking_set_enabled (NMClient *client
,gboolean enabled
); NMClient * nm_client_new (void
); void nm_client_new_async (GCancellable *cancellable
,GAsyncReadyCallback callback
,gpointer user_data
); NMClient * nm_client_new_finish (GAsyncResult *result
,GError **error
); void nm_client_sleep (NMClient *client
,gboolean sleep_
); gboolean nm_client_wimax_get_enabled (NMClient *client
); gboolean nm_client_wimax_hardware_get_enabled (NMClient *client
); void nm_client_wimax_set_enabled (NMClient *client
,gboolean enabled
); gboolean nm_client_wireless_get_enabled (NMClient *client
); gboolean nm_client_wireless_hardware_get_enabled (NMClient *client
); void nm_client_wireless_set_enabled (NMClient *client
,gboolean enabled
); gboolean nm_client_wwan_get_enabled (NMClient *client
); gboolean nm_client_wwan_hardware_get_enabled (NMClient *client
); void nm_client_wwan_set_enabled (NMClient *client
,gboolean enabled
);
"active-connections" NMObjectArray* : Read "manager-running" gboolean : Read "networking-enabled" gboolean : Read / Write "state" guint : Read "version" gchar* : Read "wimax-enabled" gboolean : Read / Write "wimax-hardware-enabled" gboolean : Read "wireless-enabled" gboolean : Read / Write "wireless-hardware-enabled" gboolean : Read "wwan-enabled" gboolean : Read / Write "wwan-hardware-enabled" gboolean : Read
void (*NMClientActivateFn) (NMClient *client
,NMActiveConnection *active_connection
,GError *error
,gpointer user_data
);
void (*NMClientAddActivateFn) (NMClient *client
,NMActiveConnection *connection
,const char *new_connection_path
,GError *error
,gpointer user_data
);
typedef struct { NMObjectClass parent; /* Signals */ void (*device_added) (NMClient *client, NMDevice *device); void (*device_removed) (NMClient *client, NMDevice *device); void (*permission_changed) (NMClient *client, NMClientPermission permission, NMClientPermissionResult result); /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); void (*_reserved5) (void); void (*_reserved6) (void); } NMClientClass;
typedef enum { NM_CLIENT_PERMISSION_NONE = 0, NM_CLIENT_PERMISSION_ENABLE_DISABLE_NETWORK = 1, NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIFI = 2, NM_CLIENT_PERMISSION_ENABLE_DISABLE_WWAN = 3, NM_CLIENT_PERMISSION_ENABLE_DISABLE_WIMAX = 4, NM_CLIENT_PERMISSION_SLEEP_WAKE = 5, NM_CLIENT_PERMISSION_NETWORK_CONTROL = 6, NM_CLIENT_PERMISSION_WIFI_SHARE_PROTECTED = 7, NM_CLIENT_PERMISSION_WIFI_SHARE_OPEN = 8, NM_CLIENT_PERMISSION_SETTINGS_MODIFY_SYSTEM = 9, NM_CLIENT_PERMISSION_SETTINGS_MODIFY_OWN = 10, NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME = 11, NM_CLIENT_PERMISSION_LAST = NM_CLIENT_PERMISSION_SETTINGS_MODIFY_HOSTNAME } NMClientPermission;
typedef enum { NM_CLIENT_PERMISSION_RESULT_UNKNOWN = 0, NM_CLIENT_PERMISSION_RESULT_YES, NM_CLIENT_PERMISSION_RESULT_AUTH, NM_CLIENT_PERMISSION_RESULT_NO } NMClientPermissionResult;
#define NM_CLIENT_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
void nm_client_activate_connection (NMClient *client
,NMConnection *connection
,NMDevice *device
,const char *specific_object
,NMClientActivateFn callback
,gpointer user_data
);
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 WiFi 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
.
|
a NMClient |
|
an NMConnection |
|
the NMDevice. [allow-none] |
|
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 NULL should be used
(ie, no specific object). For WiFi or WiMAX connections, pass the object
path of a NMAccessPoint or NMWimaxNsp owned by device , which you can
get using nm_object_get_path() , and which will be used to complete the
details of the newly added connection. [allow-none]
|
|
the function to call when the call is done. [scope async][allow-none] |
|
user data to pass to the callback function. [closure] |
void nm_client_add_and_activate_connection (NMClient *client
,NMConnection *partial
,NMDevice *device
,const char *specific_object
,NMClientAddActivateFn 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 activated. Cannot be used for VPN connections at this time.
|
a NMClient |
|
an NMConnection to add; the connection may be
partially filled (or even NULL) and will be completed by NetworkManager
using the given device and specific_object before being added. [allow-none]
|
|
the NMDevice |
|
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 NULL should be used
(ie, no specific object). For WiFi or WiMAX connections, pass the object
path of a NMAccessPoint or NMWimaxNsp owned by device , which you can
get using nm_object_get_path() , and which will be used to complete the
details of the newly added connection. [allow-none]
|
|
the function to call when the call is done. [scope async][allow-none] |
|
user data to pass to the callback function. [closure] |
void nm_client_deactivate_connection (NMClient *client
,NMActiveConnection *active
);
Deactivates an active NMActiveConnection.
|
a NMClient |
|
the NMActiveConnection to deactivate |
const GPtrArray * nm_client_get_active_connections (NMClient *client
);
Gets the active connections.
|
a NMClient |
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 NMClient.ActiveConnection] |
NMDevice * nm_client_get_device_by_iface (NMClient *client
,const char *iface
);
NMDevice * nm_client_get_device_by_path (NMClient *client
,const char *object_path
);
const GPtrArray * nm_client_get_devices (NMClient *client
);
Gets all the detected devices.
gboolean nm_client_get_manager_running (NMClient *client
);
Determines whether the daemon is running.
|
a NMClient |
Returns : |
TRUE if the daemon is running |
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
|
a NMClient |
|
the permission for which to return the result, one of NMClientPermission |
Returns : |
the permission's result, one of NMClientPermissionResult |
NMState nm_client_get_state (NMClient *client
);
Gets the current daemon state.
|
a NMClient |
Returns : |
the current NMState
|
const char * nm_client_get_version (NMClient *client
);
Gets NetworkManager version.
|
a NMClient |
Returns : |
string with the version |
gboolean nm_client_networking_get_enabled (NMClient *client
);
Whether networking is enabled or disabled.
|
a NMClient |
Returns : |
TRUE if networking is enabled, FALSE if networking is disabled |
void nm_client_networking_set_enabled (NMClient *client
,gboolean enabled
);
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.
|
a NMClient |
|
TRUE to set networking enabled, FALSE to set networking disabled |
NMClient * nm_client_new (void
);
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.
NOTE: NMClient provides information about devices and a mechanism to control them. To access and modify network configuration data, use the NMRemoteSettings object.
Returns : |
a new NMClient |
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: NMClient provides information about devices and a mechanism to control them. To access and modify network configuration data, use the NMRemoteSettings object.
|
a GCancellable, or NULL
|
|
callback to call when the client is created |
|
data for callback
|
NMClient * nm_client_new_finish (GAsyncResult *result
,GError **error
);
Gets the result of an nm_client_new_async()
call.
|
a GAsyncResult |
|
location for a GError, or NULL
|
Returns : |
a new NMClient, or NULL on error |
void nm_client_sleep (NMClient *client
,gboolean sleep_
);
Deprecated; use nm_client_networking_set_enabled()
instead.
|
a NMClient |
|
TRUE to put the daemon to sleep |
gboolean nm_client_wimax_get_enabled (NMClient *client
);
Determines whether WiMAX is enabled.
|
a NMClient |
Returns : |
TRUE if WiMAX is enabled |
gboolean nm_client_wimax_hardware_get_enabled
(NMClient *client
);
Determines whether the WiMAX hardware is enabled.
|
a NMClient |
Returns : |
TRUE if the WiMAX hardware is enabled |
void nm_client_wimax_set_enabled (NMClient *client
,gboolean enabled
);
Enables or disables WiMAX devices.
|
a NMClient |
|
TRUE to enable WiMAX |
gboolean nm_client_wireless_get_enabled (NMClient *client
);
Determines whether the wireless is enabled.
|
a NMClient |
Returns : |
TRUE if wireless is enabled |
gboolean nm_client_wireless_hardware_get_enabled
(NMClient *client
);
Determines whether the wireless hardware is enabled.
|
a NMClient |
Returns : |
TRUE if the wireless hardware is enabled |
void nm_client_wireless_set_enabled (NMClient *client
,gboolean enabled
);
Enables or disables wireless devices.
|
a NMClient |
|
TRUE to enable wireless |
gboolean nm_client_wwan_get_enabled (NMClient *client
);
Determines whether WWAN is enabled.
|
a NMClient |
Returns : |
TRUE if WWAN is enabled |
gboolean nm_client_wwan_hardware_get_enabled (NMClient *client
);
Determines whether the WWAN hardware is enabled.
|
a NMClient |
Returns : |
TRUE if the WWAN hardware is enabled |
"manager-running"
property "manager-running" gboolean : Read
Whether NetworkManager is running.
Default value: FALSE
"networking-enabled"
property "networking-enabled" gboolean : Read / Write
Is networking enabled.
Default value: TRUE
"state"
property "state" guint : Read
The current daemon state.
Allowed values: <= 70
Default value: 0
"wimax-enabled"
property "wimax-enabled" gboolean : Read / Write
Is WiMAX enabled.
Default value: FALSE
"wimax-hardware-enabled"
property "wimax-hardware-enabled" gboolean : Read
Is WiMAX hardware enabled.
Default value: FALSE
"wireless-enabled"
property "wireless-enabled" gboolean : Read / Write
Is wireless enabled.
Default value: FALSE
"wireless-hardware-enabled"
property "wireless-hardware-enabled" gboolean : Read
Is wireless hardware enabled.
Default value: TRUE
"wwan-enabled"
property "wwan-enabled" gboolean : Read / Write
Is WWAN enabled.
Default value: FALSE
"device-added"
signalvoid user_function (NMClient *client,
GObject *device,
gpointer user_data) : Run First
Notifies that a NMDevice is added.
|
the client that received the signal |
|
the new device. [type NMClient.Device] |
|
user data set when the signal handler was connected. |
"device-removed"
signalvoid user_function (NMClient *widget,
GObject *device,
gpointer user_data) : Run First
Notifies that a NMDevice is removed.
|
the client that received the signal |
|
the removed device. [type NMClient.Device] |
|
user data set when the signal handler was connected. |
"permission-changed"
signalvoid user_function (NMClient *widget,
guint permission,
guint result,
gpointer user_data) : Run First
Notifies that a permission has changed
|
the client that received the signal |
|
a permission from NMClientPermission |
|
the permission's result, one of NMClientPermissionResult |
|
user data set when the signal handler was connected. |