summaryrefslogtreecommitdiffstats
path: root/src/netlink.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/netlink.c')
-rw-r--r--src/netlink.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 5b2d5e16..d4ed09bf 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -1547,6 +1547,24 @@ int netlink_add_flowtable(struct netlink_ctx *ctx, const struct handle *h,
return err;
}
+int netlink_delete_flowtable(struct netlink_ctx *ctx, const struct handle *h,
+ struct location *loc)
+{
+ struct nftnl_flowtable *flo;
+ int err;
+
+ flo = alloc_nftnl_flowtable(h, NULL);
+ netlink_dump_flowtable(flo, ctx);
+
+ err = mnl_nft_flowtable_batch_del(flo, ctx->batch, 0, ctx->seqnum);
+ if (err < 0)
+ netlink_io_error(ctx, loc, "Could not delete flowtable: %s",
+ strerror(errno));
+ nftnl_flowtable_free(flo);
+
+ return err;
+}
+
static int list_obj_cb(struct nftnl_obj *nls, void *arg)
{
struct netlink_ctx *ctx = arg;