diff options
author | Florian Westphal <fw@strlen.de> | 2021-01-27 14:29:50 +0100 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2021-06-09 23:19:11 +0200 |
commit | 4694f7230195bfcff179ed418ddcdd5ff7d5a8e1 (patch) | |
tree | 3fecd1b0484773b98de9b5344b89855c9fc6f580 /include/mnl.h | |
parent | 6a24ffb04642e8bee982cbb0c6686e834e3eea9f (diff) |
src: add support for base hook dumping
Example output:
$ nft list hook ip input
family ip hook input {
+0000000000 nft_do_chain_inet [nf_tables] # nft table ip filter chain input
+0000000010 nft_do_chain_inet [nf_tables] # nft table ip firewalld chain filter_INPUT
+0000000100 nf_nat_ipv4_local_in [nf_nat]
+2147483647 ipv4_confirm [nf_conntrack]
}
$ nft list hooks netdev type ingress device lo
family netdev hook ingress device lo {
+0000000000 nft_do_chain_netdev [nf_tables]
}
$ nft list hooks inet
family ip hook prerouting {
-0000000400 ipv4_conntrack_defrag [nf_defrag_ipv4]
-0000000300 iptable_raw_hook [iptable_raw]
-0000000290 nft_do_chain_inet [nf_tables] # nft table ip firewalld chain raw_PREROUTING
-0000000200 ipv4_conntrack_in [nf_conntrack]
-0000000140 nft_do_chain_inet [nf_tables] # nft table ip firewalld chain mangle_PREROUTING
-0000000100 nf_nat_ipv4_pre_routing [nf_nat]
}
...
'nft list hooks' will display everyting except the netdev family
via successive dump request for all family:hook combinations.
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'include/mnl.h')
-rw-r--r-- | include/mnl.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/mnl.h b/include/mnl.h index 979929c3..68ec80cd 100644 --- a/include/mnl.h +++ b/include/mnl.h @@ -82,6 +82,9 @@ int mnl_nft_flowtable_add(struct netlink_ctx *ctx, struct cmd *cmd, unsigned int flags); int mnl_nft_flowtable_del(struct netlink_ctx *ctx, struct cmd *cmd); +int mnl_nft_dump_nf_hooks(struct netlink_ctx *ctx, int family, int hook, + const char *devname); + int mnl_nft_event_listener(struct mnl_socket *nf_sock, unsigned int debug_mask, struct output_ctx *octx, int (*cb)(const struct nlmsghdr *nlh, void *data), |