diff options
Diffstat (limited to 'lib/cache.c')
-rw-r--r-- | lib/cache.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/cache.c b/lib/cache.c index af4ee95..f21df2b 100644 --- a/lib/cache.c +++ b/lib/cache.c @@ -190,6 +190,7 @@ struct nl_cache *nl_cache_alloc(struct nl_cache_ops *ops) nl_init_list_head(&cache->c_items); cache->c_ops = ops; + cache->c_flags |= ops->co_flags; /* * If object type provides a hash keygen @@ -566,6 +567,26 @@ void nl_cache_set_arg2(struct nl_cache *cache, int arg) } /** + * Set cache ops flags + * @arg ops Cache ops + * @arg arg flags + */ +void nl_cache_ops_set_flags(struct nl_cache_ops *ops, unsigned int flags) +{ + ops->co_flags |= flags; +} + +/** + * Set cache flags + * @arg cache Cache + * @arg arg flags + */ +void nl_cache_set_flags(struct nl_cache *cache, unsigned int flags) +{ + cache->c_flags |= flags; +} + +/** * Invoke the request-update operation * @arg sk Netlink socket. * @arg cache Cache |