diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-06-13 21:15:05 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-06-17 00:38:51 +0200 |
commit | 283ea9e229fa362836992c61e4dcef4aef1a8564 (patch) | |
tree | 5fed00940921389ca34ca9a3ac08793769be9754 /include/libnftables/set.h | |
parent | faa855f4deaded25781a41af19ebfe82fa77bfc0 (diff) |
src: add nft_*_list_foreach
This patch adds a simplied iterator interface.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'include/libnftables/set.h')
-rw-r--r-- | include/libnftables/set.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libnftables/set.h b/include/libnftables/set.h index d1f6d16..f337f60 100644 --- a/include/libnftables/set.h +++ b/include/libnftables/set.h @@ -37,6 +37,7 @@ struct nft_set_list; struct nft_set_list *nft_set_list_alloc(void); void nft_set_list_free(struct nft_set_list *list); void nft_set_list_add(struct nft_set *s, struct nft_set_list *list); +int nft_set_list_foreach(struct nft_set_list *set_list, int (*cb)(struct nft_set *t, void *data), void *data); struct nft_set_list_iter; struct nft_set_list_iter *nft_set_list_iter_create(struct nft_set_list *l); @@ -80,6 +81,8 @@ int nft_set_elem_nlmsg_parse(const struct nlmsghdr *nlh, struct nft_set_elem *s) int nft_set_elem_snprintf(char *buf, size_t size, struct nft_set_elem *s, uint32_t type, uint32_t flags); +int nft_set_elem_foreach(struct nft_set *s, int (*cb)(struct nft_set_elem *e, void *data), void *data); + struct nft_set_elems_iter; struct nft_set_elems_iter *nft_set_elems_iter_create(struct nft_set *s); struct nft_set_elem *nft_set_elems_iter_cur(struct nft_set_elems_iter *iter); |