libnm-glib Reference Manual | ||||
---|---|---|---|---|
Top | Description | Object Hierarchy | Properties | Signals |
Synopsis
#define NM_CLIENT_STATE #define NM_CLIENT_MANAGER_RUNNING #define NM_CLIENT_NETWORKING_ENABLED #define NM_CLIENT_WIRELESS_ENABLED #define NM_CLIENT_WIRELESS_HARDWARE_ENABLED #define NM_CLIENT_WWAN_ENABLED #define NM_CLIENT_WWAN_HARDWARE_ENABLED #define NM_CLIENT_ACTIVE_CONNECTIONS enum NMClientPermission; enum NMClientPermissionResult; NMClient; NMClientClass; NMClient * nm_client_new (void
); const GPtrArray * nm_client_get_devices (NMClient *client
); NMDevice * nm_client_get_device_by_path (NMClient *client
,const char *object_path
); void (*NMClientActivateDeviceFn) (gpointer user_data
,const char *object_path
,GError *error
); void nm_client_activate_connection (NMClient *client
,const char *service_name
,const char *connection_path
,NMDevice *device
,const char *specific_object
,NMClientActivateDeviceFn callback
,gpointer user_data
); void nm_client_deactivate_connection (NMClient *client
,NMActiveConnection *active
); gboolean nm_client_networking_get_enabled (NMClient *client
); void nm_client_networking_set_enabled (NMClient *client
,gboolean enabled
); gboolean nm_client_wireless_get_enabled (NMClient *client
); void nm_client_wireless_set_enabled (NMClient *client
,gboolean enabled
); gboolean nm_client_wireless_hardware_get_enabled (NMClient *client
); gboolean nm_client_wwan_get_enabled (NMClient *client
); void nm_client_wwan_set_enabled (NMClient *client
,gboolean enabled
); gboolean nm_client_wwan_hardware_get_enabled (NMClient *client
); NMState nm_client_get_state (NMClient *client
); gboolean nm_client_get_manager_running (NMClient *client
); const GPtrArray * nm_client_get_active_connections (NMClient *client
); void nm_client_sleep (NMClient *client
,gboolean sleep
); NMClientPermissionResult nm_client_get_permission_result (NMClient *client
,NMClientPermission permission
);
Properties
"active-connections" nm-object-array* : Read "manager-running" gboolean : Read "networking-enabled" gboolean : Read "state" guint : Read "wireless-enabled" gboolean : Read / Write "wireless-hardware-enabled" gboolean : Read "wwan-enabled" gboolean : Read / Write / Construct "wwan-hardware-enabled" gboolean : Read / Write / Construct Only
Details
NM_CLIENT_WIRELESS_HARDWARE_ENABLED
#define NM_CLIENT_WIRELESS_HARDWARE_ENABLED "wireless-hardware-enabled"
enum NMClientPermission
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_USE_USER_CONNECTIONS = 4, NM_CLIENT_PERMISSION_LAST = NM_CLIENT_PERMISSION_USE_USER_CONNECTIONS } NMClientPermission;
enum NMClientPermissionResult
typedef enum { NM_CLIENT_PERMISSION_RESULT_UNKNOWN = 0, NM_CLIENT_PERMISSION_RESULT_YES, NM_CLIENT_PERMISSION_RESULT_AUTH, NM_CLIENT_PERMISSION_RESULT_NO } NMClientPermissionResult;
NMClientClass
typedef struct { NMObjectClass parent; /* Signals */ void (*device_added) (NMClient *client, NMDevice *device); void (*device_removed) (NMClient *client, NMDevice *device); /* Padding for future expansion */ void (*_reserved1) (void); void (*_reserved2) (void); void (*_reserved3) (void); void (*_reserved4) (void); void (*_reserved5) (void); void (*_reserved6) (void); } NMClientClass;
nm_client_get_devices ()
const GPtrArray * nm_client_get_devices (NMClient *client
);
Gets all the detected devices.
nm_client_get_device_by_path ()
NMDevice * nm_client_get_device_by_path (NMClient *client
,const char *object_path
);
NMClientActivateDeviceFn ()
void (*NMClientActivateDeviceFn) (gpointer user_data
,const char *object_path
,GError *error
);
|
|
|
|
|
nm_client_activate_connection ()
void nm_client_activate_connection (NMClient *client
,const char *service_name
,const char *connection_path
,NMDevice *device
,const char *specific_object
,NMClientActivateDeviceFn callback
,gpointer user_data
);
Activates a connection with the given NMDevice.
|
a NMClient |
|
the connection's service name |
|
the connection's DBus path |
|
the NMDevice |
|
the device specific object (currently used only for activating wireless devices and should be the NMAccessPoint's path. |
|
the function to call when the call is done |
|
user data to pass to the callback function |
nm_client_deactivate_connection ()
void nm_client_deactivate_connection (NMClient *client
,NMActiveConnection *active
);
Deactivates an active NMActiveConnection.
|
a NMClient |
|
the NMActiveConnection to deactivate |
nm_client_networking_get_enabled ()
gboolean nm_client_networking_get_enabled (NMClient *client
);
Whether networking is enabled or disabled.
nm_client_networking_set_enabled ()
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.
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_get_state ()
NMState nm_client_get_state (NMClient *client
);
Gets the current daemon state.
|
a NMClient |
Returns : |
the current NMState
|
nm_client_get_manager_running ()
gboolean nm_client_get_manager_running (NMClient *client
);
Determines whether the daemon is running.
nm_client_get_active_connections ()
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. |
nm_client_sleep ()
void nm_client_sleep (NMClient *client
,gboolean sleep
);
Deprecated; use nm_client_networking_set_enabled()
instead.
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
|
a NMClient |
|
the permission for which to return the result, one of NMClientPermission |
Returns : |
the permission's result, one of NMClientPermissionResult |
Property Details
The "manager-running"
property
"manager-running" gboolean : Read
Whether NetworkManager is running.
Default value: FALSE
The "networking-enabled"
property
"networking-enabled" gboolean : Read
Is networking enabled.
Default value: TRUE
The "state"
property
"state" guint : Read
The current daemon state.
Allowed values: <= 4
Default value: 0
The "wireless-enabled"
property
"wireless-enabled" gboolean : Read / Write
Is wireless enabled.
Default value: TRUE
The "wireless-hardware-enabled"
property
"wireless-hardware-enabled" gboolean : Read
Is wireless hardware enabled.
Default value: TRUE
The "wwan-enabled"
property
"wwan-enabled" gboolean : Read / Write / Construct
Is WWAN enabled.
Default value: TRUE
The "wwan-hardware-enabled"
property
"wwan-hardware-enabled" gboolean : Read / Write / Construct Only
Is WWAN hardware enabled.
Default value: TRUE
Signal Details
The "device-added"
signal
void 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 |
|
user data set when the signal handler was connected. |
The "device-removed"
signal
void 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 |
|
user data set when the signal handler was connected. |
The "permission-changed"
signal
void 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. |