From ebfd6822498965cdb9961ec1a986f0463de5c9c0 Mon Sep 17 00:00:00 2001 From: Patrick McHardy Date: Tue, 28 Jul 2009 14:17:35 +0200 Subject: add support for new set API and standalone sets Signed-off-by: Patrick McHardy --- include/netlink.h | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'include/netlink.h') diff --git a/include/netlink.h b/include/netlink.h index ec9a6142..22ef489c 100644 --- a/include/netlink.h +++ b/include/netlink.h @@ -16,10 +16,12 @@ * * @msgs: message queue * @list: list of parsed rules/chains/tables + * @set: current set */ struct netlink_ctx { struct list_head *msgs; struct list_head list; + struct set *set; }; extern void netlink_dump_object(struct nl_object *obj); @@ -28,6 +30,7 @@ extern struct nfnl_nft_table *alloc_nft_table(const struct handle *h); extern struct nfnl_nft_chain *alloc_nft_chain(const struct handle *h); extern struct nfnl_nft_rule *alloc_nft_rule(const struct handle *h); extern struct nfnl_nft_expr *alloc_nft_expr(int (*init)(struct nfnl_nft_expr *)); +extern struct nfnl_nft_set *alloc_nft_set(const struct handle *h); extern struct nfnl_nft_data *alloc_nft_data(const void *data, unsigned int len); extern struct nfnl_nft_data *netlink_gen_data(const struct expr *expr); @@ -68,4 +71,17 @@ extern int netlink_get_table(struct netlink_ctx *ctx, const struct handle *h); extern int netlink_list_table(struct netlink_ctx *ctx, const struct handle *h); extern int netlink_flush_table(struct netlink_ctx *ctx, const struct handle *h); +extern int netlink_add_set(struct netlink_ctx *ctx, const struct handle *h, + struct set *set); +extern int netlink_delete_set(struct netlink_ctx *ctx, const struct handle *h); +extern int netlink_list_sets(struct netlink_ctx *ctx, const struct handle *h); +extern int netlink_get_set(struct netlink_ctx *ctx, const struct handle *h); + +extern int netlink_add_setelems(struct netlink_ctx *ctx, const struct handle *h, + const struct expr *expr); +extern int netlink_delete_setelems(struct netlink_ctx *ctx, const struct handle *h, + const struct expr *expr); +extern int netlink_get_setelems(struct netlink_ctx *ctx, const struct handle *h, + struct set *set); + #endif /* NFTABLES_NETLINK_H */ -- cgit v1.2.3