summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Haller <thaller@redhat.com>2020-07-28 13:29:07 +0200
committerThomas Haller <thaller@redhat.com>2020-07-31 08:53:04 +0200
commit1a4cc800f6d7619fc222be6dfc3650ceea7e45e5 (patch)
tree08d363430f61a02eeda1c83c48f5120e502f40f1
parent14fa487a60acc7761c818c6f09a38c1593d740ba (diff)
downloadNetworkManager-1a4cc800f6d7619fc222be6dfc3650ceea7e45e5.tar.gz
platform: add nmp_object_indirect_id_*() helpers
-rw-r--r--src/platform/nmp-object.c19
-rw-r--r--src/platform/nmp-object.h3
2 files changed, 22 insertions, 0 deletions
diff --git a/src/platform/nmp-object.c b/src/platform/nmp-object.c
index 1cd61a8e7d..8f32b11007 100644
--- a/src/platform/nmp-object.c
+++ b/src/platform/nmp-object.c
@@ -1570,6 +1570,25 @@ _vt_cmd_plobj_hash_update_routing_rule (const NMPlatformObject *obj, NMHashState
return nm_platform_routing_rule_hash_update ((const NMPlatformRoutingRule *) obj, NM_PLATFORM_ROUTING_RULE_CMP_TYPE_FULL, h);
}
+guint
+nmp_object_indirect_id_hash (gconstpointer a)
+{
+ const NMPObject *const*p_obj = a;
+
+ return nmp_object_id_hash (*p_obj);
+}
+
+gboolean
+nmp_object_indirect_id_equal (gconstpointer a, gconstpointer b)
+{
+ const NMPObject *const*p_obj_a = a;
+ const NMPObject *const*p_obj_b = b;
+
+ return nmp_object_id_equal (*p_obj_a, *p_obj_b);
+}
+
+/*****************************************************************************/
+
gboolean
nmp_object_is_alive (const NMPObject *obj)
{
diff --git a/src/platform/nmp-object.h b/src/platform/nmp-object.h
index c31548cb18..388ea9dd5e 100644
--- a/src/platform/nmp-object.h
+++ b/src/platform/nmp-object.h
@@ -674,6 +674,9 @@ nmp_object_id_equal (const NMPObject *obj1, const NMPObject *obj2)
return nmp_object_id_cmp (obj1, obj2) == 0;
}
+guint nmp_object_indirect_id_hash (gconstpointer a);
+gboolean nmp_object_indirect_id_equal (gconstpointer a, gconstpointer b);
+
gboolean nmp_object_is_alive (const NMPObject *obj);
gboolean nmp_object_is_visible (const NMPObject *obj);