Provide nl_cache_set_arg{1,2}() to specify cache args

Added based on a RFE. This is required if allocation and
(re)filling is to be splitted.
This commit is contained in:
Thomas Graf 2011-04-10 10:22:27 +02:00
parent ef327ffd44
commit 23c27b4738
2 changed files with 28 additions and 0 deletions

View file

@ -65,6 +65,8 @@ extern int nl_cache_include(struct nl_cache *,
struct nl_object *,
change_func_t,
void *);
extern void nl_cache_set_arg1(struct nl_cache *, int);
extern void nl_cache_set_arg2(struct nl_cache *, int);
/* General */
extern int nl_cache_is_empty(struct nl_cache *);

View file

@ -462,6 +462,32 @@ void nl_cache_remove(struct nl_object *obj)
* @{
*/
/**
* Set synchronization arg1 of cache
* @arg cache Cache
* @arg arg argument
*
* Synchronization arguments are used to specify filters when
* requesting dumps from the kernel.
*/
void nl_cache_set_arg1(struct nl_cache *cache, int arg)
{
cache->c_iarg1 = arg;
}
/**
* Set synchronization arg2 of cache
* @arg cache Cache
* @arg arg argument
*
* Synchronization arguments are used to specify filters when
* requesting dumps from the kernel.
*/
void nl_cache_set_arg2(struct nl_cache *cache, int arg)
{
cache->c_iarg2 = arg;
}
/**
* Invoke the request-update operation
* @arg sk Netlink socket.