set: Export nftnl_set_list_lookup_byname()
Phil Sutter
reviewerPATCH v2 1/1 set: Export nftnl_set_list_lookup_byname()
Rename and optimize internal function nftnl_set_lookup() for external use. Just like with nftnl_chain_list, use a hash table for fast set name lookups.
Signed-off-by Phil Sutter <[email protected]>
---
Changes since v1:
- Adjust LIBVERSION according to libtool documentation.
--- Make_global.am | 2 +- include/libnftnl/set.h | 2 ++ include/set.h | 1 + src/libnftnl.map | 4 ++++ src/set.c | 53 +++++++++++++++++++++++++++--------------- 5 files changed, 42 insertions(+), 20 deletions(-)
Make_global.am +1 -1
@@ -18,7 +18,7 @@ # set age to 0. # </snippet> # -LIBVERSION=12:0:1 +LIBVERSION=13:0:2 AM_CPPFLAGS = ${regular_CPPFLAGS} -I${top_srcdir}/include ${LIBMNL_CFLAGS} ${LIBMXML_CFLAGS} AM_CFLAGS = ${regular_CFLAGS} ${GCC_FVISIBILITY_HIDDEN}
include/libnftnl/set.h +2 -0
@@ -75,6 +75,8 @@ void nftnl_set_list_add(struct nftnl_set *s, struct nftnl_set_list *list);void nftnl_set_list_add_tail (struct nftnl_set *s,struct nftnl_set_list *list);void nftnl_set_list_del (struct nftnl_set *s);int nftnl_set_list_foreach (struct nftnl_set_list *set_list,int (*cb)(struct nftnl_set *t,void *data),void *data); +struct nftnl_set *nftnl_set_list_lookup_byname (struct nftnl_set_list *set_list, +const char *set);struct nftnl_set_list_iter ;struct nftnl_set_list_iter *nftnl_set_list_iter_create (const struct nftnl_set_list *l);
include/set.h +1 -0
@@ -5,6 +5,7 @@struct nftnl_set {struct list_head head; +struct hlist_node hnode;uint32_t family;uint32_t set_flags;
src/libnftnl.map +4 -0
@@ -351,3 +351,7 @@ LIBNFTNL_12 { nftnl_chain_list_lookup_byname; nftnl_rule_lookup_byindex; } LIBNFTNL_11; + +LIBNFTNL_13 { + nftnl_set_list_lookup_byname; +} LIBNFTNL_12;
src/set.c +34 -19
116 lines not on this page · raw message
Signature · 1 line
2.23.0
Quoted 5 lines · Phil Sutter
Rename and optimize internal function
nftnl_set_lookup()for external use. Just like withnftnl_chain_list, use a hash table for fast set name lookups.Signed-off-by Phil Sutter <[email protected]>
Thanks Phil.