mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 01:20:07 +01:00
libnm-glib: add nm_device_is_software() function to NMDevice
It says whether the device is a software one, according to device capabilities.
This commit is contained in:
parent
bbf13002d3
commit
3dbe8041a7
3 changed files with 22 additions and 0 deletions
|
|
@ -156,6 +156,7 @@ global:
|
|||
nm_device_infiniband_get_hw_address;
|
||||
nm_device_infiniband_get_type;
|
||||
nm_device_infiniband_new;
|
||||
nm_device_is_software;
|
||||
nm_device_modem_error_get_type;
|
||||
nm_device_modem_error_quark;
|
||||
nm_device_modem_get_current_capabilities;
|
||||
|
|
|
|||
|
|
@ -2065,6 +2065,25 @@ nm_device_get_mtu (NMDevice *device)
|
|||
return NM_DEVICE_GET_PRIVATE (device)->mtu;
|
||||
}
|
||||
|
||||
/**
|
||||
* nm_device_is_software:
|
||||
* @device: a #NMDevice
|
||||
*
|
||||
* Whether the device is a software device.
|
||||
*
|
||||
* Returns: %TRUE if @device is a software device, %FALSE if it is a hardware device.
|
||||
*
|
||||
* Since: 1.0
|
||||
**/
|
||||
gboolean
|
||||
nm_device_is_software (NMDevice *device)
|
||||
{
|
||||
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
|
||||
|
||||
_nm_object_ensure_inited (NM_OBJECT (device));
|
||||
return !!(NM_DEVICE_GET_PRIVATE (device)->capabilities & NM_DEVICE_CAP_IS_SOFTWARE);
|
||||
}
|
||||
|
||||
typedef struct {
|
||||
NMDevice *device;
|
||||
NMDeviceDeactivateFn fn;
|
||||
|
|
|
|||
|
|
@ -142,6 +142,8 @@ NM_AVAILABLE_IN_0_9_10
|
|||
const char * nm_device_get_physical_port_id (NMDevice *device);
|
||||
NM_AVAILABLE_IN_0_9_10
|
||||
guint32 nm_device_get_mtu (NMDevice *device);
|
||||
NM_AVAILABLE_IN_1_0
|
||||
gboolean nm_device_is_software (NMDevice *device);
|
||||
|
||||
const char * nm_device_get_product (NMDevice *device);
|
||||
const char * nm_device_get_vendor (NMDevice *device);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue