From bc3439d14ffcd41488d10aefe6961221aaa63398 Mon Sep 17 00:00:00 2001 From: Thomas Haller Date: Tue, 21 Jul 2020 12:14:17 +0200 Subject: [PATCH] platform: add nmp_object_link_get_ifname() helper --- src/platform/nmp-object.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/platform/nmp-object.h b/src/platform/nmp-object.h index 7866caa428..14287d1d2f 100644 --- a/src/platform/nmp-object.h +++ b/src/platform/nmp-object.h @@ -995,4 +995,14 @@ nm_platform_lookup_object_by_addr_family (NMPlatform *platform, return nm_platform_lookup (platform, &lookup); } +/*****************************************************************************/ + +static inline const char * +nmp_object_link_get_ifname (const NMPObject *obj) +{ + if (!obj) + return NULL; + return NMP_OBJECT_CAST_LINK (obj)->name; +} + #endif /* __NMP_OBJECT_H__ */