summaryrefslogtreecommitdiffstats
path: root/lib/object.c
diff options
context:
space:
mode:
authorRoopa Prabhu <roopa@cumulusnetworks.com>2016-06-18 22:30:06 (GMT)
committerThomas Haller <thaller@redhat.com>2016-07-08 10:02:07 (GMT)
commit1db12c9e3208c98332cf169eb689a985d77c9a05 (patch)
tree16d8aa47c593f4794fb97ee21c0cfff20bfc0f67 /lib/object.c
parentb7d458c1939913c46b32c7643b412767b87d98c2 (diff)
downloadlibnl-1db12c9e3208c98332cf169eb689a985d77c9a05.zip
libnl-1db12c9e3208c98332cf169eb689a985d77c9a05.tar.gz
libnl-1db12c9e3208c98332cf169eb689a985d77c9a05.tar.bz2
cache: modify nl_cache_search to look at cache provided attributes for search
This patch adds a new cache operation co_cache_search_attrs_get to request for attributes to use in the search. This gives the cache an opportunity to use search attributes based on netlink message flags. This is mainly to give the route cache an ability to decide on the cache inclusion depending on the netlink header flags like NLM_F_APPEND and NLM_F_REPLACE. Signed-off-by: Roopa Prabhu <roopa@cumulusnetworks.com>
Diffstat (limited to 'lib/object.c')
-rw-r--r--lib/object.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/lib/object.c b/lib/object.c
index 06c2a95..dcf2a36 100644
--- a/lib/object.c
+++ b/lib/object.c
@@ -393,6 +393,17 @@ uint32_t nl_object_diff(struct nl_object *a, struct nl_object *b)
: (uint32_t) diff;
}
+uint32_t nl_object_diff_mask(struct nl_object *a, struct nl_object *b,
+ uint32_t mask)
+{
+ struct nl_object_ops *ops = obj_ops(a);
+
+ if (ops != obj_ops(b) || ops->oo_compare == NULL)
+ return UINT_MAX;
+
+ return ops->oo_compare(a, b, mask, 0);
+}
+
/**
* Match a filter against an object
* @arg obj object to check