Commit 2d472657 authored by Thomas Haller's avatar Thomas Haller
Browse files

device: add nm_device_get_unmanaged_mask()

parent c1f58e9b
......@@ -9124,6 +9124,24 @@ nm_device_get_managed (NMDevice *self, gboolean for_user_request)
return _get_managed_by_flags (priv->unmanaged_flags, priv->unmanaged_mask, for_user_request);
}
/**
* nm_device_get_unmanaged_mask:
* @self: the #NMDevice
* @flag: the unmanaged flags to check.
*
* Return the unmanaged flags mask set on this device.
*
* Returns: the flags of the device ( & @flag)
*/
NMUnmanagedFlags
nm_device_get_unmanaged_mask (NMDevice *self, NMUnmanagedFlags flag)
{
g_return_val_if_fail (NM_IS_DEVICE (self), NM_UNMANAGED_NONE);
g_return_val_if_fail (flag != NM_UNMANAGED_NONE, NM_UNMANAGED_NONE);
return NM_DEVICE_GET_PRIVATE (self)->unmanaged_mask & flag;
}
/**
* nm_device_get_unmanaged_flags:
* @self: the #NMDevice
......@@ -9136,8 +9154,8 @@ nm_device_get_managed (NMDevice *self, gboolean for_user_request)
NMUnmanagedFlags
nm_device_get_unmanaged_flags (NMDevice *self, NMUnmanagedFlags flag)
{
g_return_val_if_fail (NM_IS_DEVICE (self), FALSE);
g_return_val_if_fail (flag != NM_UNMANAGED_NONE, FALSE);
g_return_val_if_fail (NM_IS_DEVICE (self), NM_UNMANAGED_NONE);
g_return_val_if_fail (flag != NM_UNMANAGED_NONE, NM_UNMANAGED_NONE);
return NM_DEVICE_GET_PRIVATE (self)->unmanaged_flags & flag;
}
......
......@@ -472,6 +472,7 @@ typedef enum {
const char *nm_unmanaged_flags2str (NMUnmanagedFlags flags, char *buf, gsize len);
gboolean nm_device_get_managed (NMDevice *device, gboolean for_user_request);
NMUnmanagedFlags nm_device_get_unmanaged_mask (NMDevice *device, NMUnmanagedFlags flag);
NMUnmanagedFlags nm_device_get_unmanaged_flags (NMDevice *device, NMUnmanagedFlags flag);
void nm_device_set_unmanaged_flags (NMDevice *device,
NMUnmanagedFlags flags,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment