summaryrefslogtreecommitdiffstats
path: root/src/rule.c
diff options
context:
space:
mode:
authorHarsha Sharma <harshasharmaiitr@gmail.com>2017-12-23 11:45:25 -0800
committerPablo Neira Ayuso <pablo@netfilter.org>2018-03-05 16:38:08 +0100
commit0f8302635ad3f7bea70044df823ea783b6bcf4d6 (patch)
tree1f2e6a1ed919a8c10e83cc216f8ea1e9cc959012 /src/rule.c
parent1ec8f41af4dd53ac9edc5da1a2810dd5bac4d4a3 (diff)
src: print 'handle' attribute in tables
Print 'handle' attribute in tables, when listing via '-a' option For eg. nft list ruleset -a table ip test-ip4 { chain input { ip saddr 8.8.8.8 counter packets 0 bytes 0 # handle 3 } # handle 1} table ip filter { chain output { tcp dport ssh counter packets 0 bytes 0 # handle 4 } # handle 2} table ip xyz { # handle 3} 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.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/rule.c b/src/rule.c
index 771b2a12..52b6adac 100644
--- a/src/rule.c
+++ b/src/rule.c
@@ -879,6 +879,8 @@ static void table_print(const struct table *table, struct output_ctx *octx)
chain_print(chain, octx);
delim = "\n";
}
+ if (octx->handle > 0)
+ nft_print(octx, " # handle %" PRIu64, table->handle.handle.id);
nft_print(octx, "}\n");
}