summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2018-03-05 17:06:51 +0100
committerPablo Neira Ayuso <pablo@netfilter.org>2018-03-05 17:08:01 +0100
commitbd9f363379322597e3b0939c9d076988289447c1 (patch)
treeb8d1772f963937f1709f0d8f7c8d9e10ece36733 /src
parent2d90a9e1bf69ed305fe5192a58aaa7b299edae45 (diff)
netlink: print table handle with --echo --handle
# nft --echo --handle add table x add table ip x # handle 80 Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src')
-rw-r--r--src/netlink.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/netlink.c b/src/netlink.c
index 9f6d24c8..eaefbb5f 100644
--- a/src/netlink.c
+++ b/src/netlink.c
@@ -16,6 +16,7 @@
#include <netinet/in.h>
#include <arpa/inet.h>
#include <stdlib.h>
+#include <inttypes.h>
#include <libnftnl/table.h>
#include <libnftnl/trace.h>
@@ -1888,8 +1889,12 @@ static int netlink_events_table_cb(const struct nlmsghdr *nlh, int type,
family = nftnl_table_get_u32(nlt, NFTNL_TABLE_FAMILY);
- nft_mon_print(monh, "%s %s\n", family2str(family),
+ nft_mon_print(monh, "%s %s", family2str(family),
nftnl_table_get_str(nlt, NFTNL_TABLE_NAME));
+ if (monh->ctx->octx->handle > 0)
+ nft_mon_print(monh, " # handle %" PRIu64 "",
+ nftnl_table_get_u64(nlt, NFTNL_TABLE_HANDLE));
+ nft_mon_print(monh, "\n");
break;
case NFTNL_OUTPUT_XML:
case NFTNL_OUTPUT_JSON: