mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2025-12-25 08:20:08 +01:00
platform: expose nm_platform_link_get_udev_property() function
This commit is contained in:
parent
2c9924482a
commit
47fa919720
2 changed files with 11 additions and 5 deletions
|
|
@ -1441,8 +1441,11 @@ nm_platform_link_get_type_name(NMPlatform *self, int ifindex)
|
|||
return obj->link.kind ?: "unknown";
|
||||
}
|
||||
|
||||
static gboolean
|
||||
link_get_udev_property(NMPlatform *self, int ifindex, const char *name, const char **out_value)
|
||||
gboolean
|
||||
nm_platform_link_get_udev_property(NMPlatform * self,
|
||||
int ifindex,
|
||||
const char * name,
|
||||
const char **out_value)
|
||||
{
|
||||
struct udev_device *udevice = NULL;
|
||||
const char * uproperty;
|
||||
|
|
@ -1473,7 +1476,7 @@ nm_platform_link_get_unmanaged(NMPlatform *self, int ifindex, gboolean *unmanage
|
|||
{
|
||||
const char *value;
|
||||
|
||||
if (link_get_udev_property(self, ifindex, "NM_UNMANAGED", &value)) {
|
||||
if (nm_platform_link_get_udev_property(self, ifindex, "NM_UNMANAGED", &value)) {
|
||||
NM_SET_OUT(unmanaged, nm_udev_utils_property_as_boolean(value));
|
||||
return TRUE;
|
||||
}
|
||||
|
|
@ -1633,8 +1636,7 @@ nm_platform_link_get_path(NMPlatform *self, int ifindex)
|
|||
{
|
||||
const char *value = NULL;
|
||||
|
||||
link_get_udev_property(self, ifindex, "ID_PATH", &value);
|
||||
|
||||
nm_platform_link_get_udev_property(self, ifindex, "ID_PATH", &value);
|
||||
return value;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1840,6 +1840,10 @@ nm_platform_link_change_flags(NMPlatform *self, int ifindex, unsigned value, gbo
|
|||
return nm_platform_link_change_flags_full(self, ifindex, value, set ? value : 0u);
|
||||
}
|
||||
|
||||
gboolean nm_platform_link_get_udev_property(NMPlatform * self,
|
||||
int ifindex,
|
||||
const char * name,
|
||||
const char **out_value);
|
||||
const char *nm_platform_link_get_udi(NMPlatform *self, int ifindex);
|
||||
const char *nm_platform_link_get_path(NMPlatform *self, int ifindex);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue