From f1f6c326d78594fd0dc279d4870502addcd6fcc2 Mon Sep 17 00:00:00 2001 From: Pablo Neira Ayuso Date: Fri, 19 Jan 2018 01:41:38 +0100 Subject: src: delete flowtable This patch allows you to delete an existing flowtable: # nft delete flowtable x m Signed-off-by: Pablo Neira Ayuso --- src/mnl.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'src/mnl.c') diff --git a/src/mnl.c b/src/mnl.c index be6e05da..f620a3bd 100644 --- a/src/mnl.c +++ b/src/mnl.c @@ -1027,6 +1027,22 @@ int mnl_nft_flowtable_batch_add(struct nftnl_flowtable *flo, return 0; } +int mnl_nft_flowtable_batch_del(struct nftnl_flowtable *flo, + struct nftnl_batch *batch, unsigned int flags, + uint32_t seqnum) +{ + struct nlmsghdr *nlh; + + nlh = nftnl_nlmsg_build_hdr(nftnl_batch_buffer(batch), + NFT_MSG_DELFLOWTABLE, + nftnl_flowtable_get_u32(flo, NFTNL_FLOWTABLE_FAMILY), + flags, seqnum); + nftnl_flowtable_nlmsg_build_payload(nlh, flo); + mnl_nft_batch_continue(batch); + + return 0; +} + /* * ruleset */ -- cgit v1.2.3