summaryrefslogtreecommitdiffstats
path: root/include/libnftables/rule.h
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2013-06-13 21:15:05 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2013-06-17 00:38:51 +0200
commit283ea9e229fa362836992c61e4dcef4aef1a8564 (patch)
tree5fed00940921389ca34ca9a3ac08793769be9754 /include/libnftables/rule.h
parentfaa855f4deaded25781a41af19ebfe82fa77bfc0 (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/rule.h')
-rw-r--r--include/libnftables/rule.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/libnftables/rule.h b/include/libnftables/rule.h
index 9989f19..ce8bd1f 100644
--- a/include/libnftables/rule.h
+++ b/include/libnftables/rule.h
@@ -56,6 +56,10 @@ int nft_rule_snprintf(char *buf, size_t size, struct nft_rule *t, uint32_t type,
struct nlmsghdr *nft_rule_nlmsg_build_hdr(char *buf, uint16_t cmd, uint16_t family, uint16_t type, uint32_t seq);
int nft_rule_nlmsg_parse(const struct nlmsghdr *nlh, struct nft_rule *t);
+int nft_rule_expr_foreach(struct nft_rule *r,
+ int (*cb)(struct nft_rule_expr *e, void *data),
+ void *data);
+
struct nft_rule_expr_iter;
struct nft_rule_expr_iter *nft_rule_expr_iter_create(struct nft_rule *r);
@@ -67,6 +71,7 @@ struct nft_rule_list;
struct nft_rule_list *nft_rule_list_alloc(void);
void nft_rule_list_free(struct nft_rule_list *list);
void nft_rule_list_add(struct nft_rule *r, struct nft_rule_list *list);
+int nft_rule_list_foreach(struct nft_rule_list *rule_list, int (*cb)(struct nft_rule *t, void *data), void *data);
struct nft_rule_list_iter;