diff options
author | Harsha Sharma <harshasharmaiitr@gmail.com> | 2018-01-14 21:48:46 +0530 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2018-03-05 16:41:07 +0100 |
commit | f4a34d25f6d5f4188573dbe16613ce96327f0e6c (patch) | |
tree | 1e22f0cf48ec94c66b6a6016b671ad9168775d6a /src/rule.c | |
parent | 51d3592d22ea5b0d5e5740a3b3cc4b62a2fabb36 (diff) |
src: list set handle and delete set via set handle
Print 'handle' attribute in sets when listing via '-a' option and
delete sets via their unique set handles listed with '-a' option.
For e.g.
nft delete set [<family>] <table-name> [handle <handle>]
Signed-off-by: Harsha Sharma <harshasharmaiitr@gmail.com>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/rule.c')
-rw-r--r-- | src/rule.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -377,7 +377,11 @@ static void do_set_print(const struct set *set, struct print_fmt_options *opts, expr_print(set->init, octx); nft_print(octx, "%s", opts->nl); } - nft_print(octx, "%s}%s", opts->tab, opts->nl); + nft_print(octx, "%s}", opts->tab); + if (octx->handle > 0) + nft_print(octx, " # handle %" PRIu64, set->handle.handle.id); + nft_print(octx, "%s", opts->nl); + } void set_print(const struct set *s, struct output_ctx *octx) |