summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorroopa <roopa@cumulusnetworks.com>2012-11-12 20:38:32 (GMT)
committerThomas Graf <tgraf@suug.ch>2012-11-12 20:51:03 (GMT)
commit30d862650bcc26588ddcb07d1126b43e0ec4c121 (patch)
tree4dd75ecaca021e52f2336b937ce3de8f9c4b7445 /include
parentdd8a87da9653848bb8811cc61ed97574254536c9 (diff)
downloadlibnl-30d862650bcc26588ddcb07d1126b43e0ec4c121.zip
libnl-30d862650bcc26588ddcb07d1126b43e0ec4c121.tar.gz
libnl-30d862650bcc26588ddcb07d1126b43e0ec4c121.tar.bz2
New cache manager add cache api
This patch is an attempt to add a new nl_cache_mngr_add_cache api to allow adding an existing cache to cache manager. Since the new api is similar to nl_cache_mngr_add except for allocating the cache, the patch moves most of the nl_cache_mngr_add code to nl_cache_mngr_add_cache and changes nl_cache_mngr_add to call nl_cache_mngr_add_cache. One use case for this api as pointed out by thomas would be to set cache flags before associating the cache with a cache manager. nl_cache_alloc_name("route/link", &cache); nl_cache_set_flags(cache, NL_CACHE_AF_ITER); nl_cache_mngr_add_cache(mngr, cache, ...); Signed-off-by: Thomas Graf <tgraf@suug.ch>
Diffstat (limited to 'include')
-rw-r--r--include/netlink/cache.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/netlink/cache.h b/include/netlink/cache.h
index ee3b5d8..7de389d 100644
--- a/include/netlink/cache.h
+++ b/include/netlink/cache.h
@@ -124,6 +124,9 @@ extern int nl_cache_mngr_add(struct nl_cache_mngr *,
change_func_t,
void *,
struct nl_cache **);
+extern int nl_cache_mngr_add_cache(struct nl_cache_mngr *mngr,
+ struct nl_cache *cache,
+ change_func_t cb, void *data);
extern int nl_cache_mngr_get_fd(struct nl_cache_mngr *);
extern int nl_cache_mngr_poll(struct nl_cache_mngr *,
int);