summaryrefslogtreecommitdiffstats
path: root/include/netlink
diff options
context:
space:
mode:
authorDavid Ahern <dsa@cumulusnetworks.com>2015-10-27 22:40:48 (GMT)
committerThomas Haller <thaller@redhat.com>2015-11-19 15:48:21 (GMT)
commit18d60cb9d72f61f2070f3758bcd347bb2e3747c1 (patch)
tree56b5794a49531dc4ebaa6d1511196ba8e3b8a95d /include/netlink
parent7ea15f60a726de67f02e6868a8125a59570e956d (diff)
downloadlibnl-18d60cb9d72f61f2070f3758bcd347bb2e3747c1.zip
libnl-18d60cb9d72f61f2070f3758bcd347bb2e3747c1.tar.gz
libnl-18d60cb9d72f61f2070f3758bcd347bb2e3747c1.tar.bz2
link/neigh: add flags option to link and neighbor caches
Both link and neighbor cache support specify multiple groups (nl_af_group), but the alloc_cache functions for both do not set the NL_CACHE_AF_ITER flag before populating the cache so only the first group is used by default. This patch adds an API to pass in flags to make that happen and updates the nl-neigh-list command to make use of it. http://lists.infradead.org/pipermail/libnl/2015-October/001996.html Signed-off-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
Diffstat (limited to 'include/netlink')
-rw-r--r--include/netlink/cli/link.h4
-rw-r--r--include/netlink/cli/neigh.h3
-rw-r--r--include/netlink/cli/utils.h4
-rw-r--r--include/netlink/route/link.h3
-rw-r--r--include/netlink/route/neighbour.h3
5 files changed, 16 insertions, 1 deletions
diff --git a/include/netlink/cli/link.h b/include/netlink/cli/link.h
index 3f37948..f2c720b 100644
--- a/include/netlink/cli/link.h
+++ b/include/netlink/cli/link.h
@@ -17,7 +17,11 @@
extern struct rtnl_link *nl_cli_link_alloc(void);
extern struct nl_cache *nl_cli_link_alloc_cache_family(struct nl_sock *, int);
+extern struct nl_cache *nl_cli_link_alloc_cache_family_flags(struct nl_sock *, int,
+ unsigned int);
extern struct nl_cache *nl_cli_link_alloc_cache(struct nl_sock *);
+extern struct nl_cache *nl_cli_link_alloc_cache_flags(struct nl_sock *,
+ unsigned int);
extern void nl_cli_link_parse_family(struct rtnl_link *, char *);
extern void nl_cli_link_parse_name(struct rtnl_link *, char *);
diff --git a/include/netlink/cli/neigh.h b/include/netlink/cli/neigh.h
index 5440012..1c1be91 100644
--- a/include/netlink/cli/neigh.h
+++ b/include/netlink/cli/neigh.h
@@ -15,7 +15,8 @@
#include <netlink/route/neighbour.h>
#define nl_cli_neigh_alloc_cache(sk) \
- nl_cli_alloc_cache((sk), "neighbour", rtnl_neigh_alloc_cache)
+ nl_cli_alloc_cache_flags((sk), "neighbour", NL_CACHE_AF_ITER, \
+ rtnl_neigh_alloc_cache_flags)
extern struct rtnl_neigh *nl_cli_neigh_alloc(void);
extern void nl_cli_neigh_parse_dst(struct rtnl_neigh *, char *);
diff --git a/include/netlink/cli/utils.h b/include/netlink/cli/utils.h
index da41c10..ea89fc6 100644
--- a/include/netlink/cli/utils.h
+++ b/include/netlink/cli/utils.h
@@ -73,6 +73,10 @@ extern int nl_cli_confirm(struct nl_object *,
extern struct nl_cache *nl_cli_alloc_cache(struct nl_sock *, const char *,
int (*ac)(struct nl_sock *, struct nl_cache **));
+extern struct nl_cache *nl_cli_alloc_cache_flags(struct nl_sock *, const char *,
+ unsigned int flags,
+ int (*ac)(struct nl_sock *, struct nl_cache **, unsigned int));
+
extern void nl_cli_load_module(const char *, const char *);
#ifdef __cplusplus
diff --git a/include/netlink/route/link.h b/include/netlink/route/link.h
index f7303f2..23b0183 100644
--- a/include/netlink/route/link.h
+++ b/include/netlink/route/link.h
@@ -109,6 +109,9 @@ extern struct rtnl_link *rtnl_link_alloc(void);
extern void rtnl_link_put(struct rtnl_link *);
extern int rtnl_link_alloc_cache(struct nl_sock *, int, struct nl_cache **);
+extern int rtnl_link_alloc_cache_flags(struct nl_sock *, int,
+ struct nl_cache **,
+ unsigned int flags);
extern struct rtnl_link *rtnl_link_get(struct nl_cache *, int);
extern struct rtnl_link *rtnl_link_get_by_name(struct nl_cache *, const char *);
diff --git a/include/netlink/route/neighbour.h b/include/netlink/route/neighbour.h
index b653cff..fb98113 100644
--- a/include/netlink/route/neighbour.h
+++ b/include/netlink/route/neighbour.h
@@ -26,6 +26,9 @@ extern struct rtnl_neigh *rtnl_neigh_alloc(void);
extern void rtnl_neigh_put(struct rtnl_neigh *);
extern int rtnl_neigh_alloc_cache(struct nl_sock *, struct nl_cache **);
+extern int rtnl_neigh_alloc_cache_flags(struct nl_sock *,
+ struct nl_cache **,
+ unsigned int);
extern struct rtnl_neigh *rtnl_neigh_get(struct nl_cache *, int,
struct nl_addr *);