summaryrefslogtreecommitdiffstats
path: root/zebra/rt_netlink.h
diff options
context:
space:
mode:
authorRafael Zalamena <rzalamena@opensourcerouting.org>2020-09-23 16:11:08 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2020-09-24 04:07:02 +0200
commiteead0bc46b9ba49f49a4c2939c89e74b3266b452 (patch)
treeddc08aa87c3d9d312fe7f6be3c76432943caaf16 /zebra/rt_netlink.h
parentMerge pull request #7018 from gouault6wind/show_ip_route (diff)
downloadfrr-eead0bc46b9ba49f49a4c2939c89e74b3266b452.tar.xz
frr-eead0bc46b9ba49f49a4c2939c89e74b3266b452.zip
zebra: human readable netlink dumps
Add new compile option to enable human readable netlink dumps with `debug zebra kernel msgdump`. Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
Diffstat (limited to 'zebra/rt_netlink.h')
-rw-r--r--zebra/rt_netlink.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/zebra/rt_netlink.h b/zebra/rt_netlink.h
index e1bb84478..6ce0d4554 100644
--- a/zebra/rt_netlink.h
+++ b/zebra/rt_netlink.h
@@ -118,6 +118,29 @@ netlink_put_lsp_update_msg(struct nl_batch *bth, struct zebra_dplane_ctx *ctx);
extern enum netlink_msg_status
netlink_put_pw_update_msg(struct nl_batch *bth, struct zebra_dplane_ctx *ctx);
+#ifdef NETLINK_DEBUG
+const char *nlmsg_type2str(uint16_t type);
+const char *af_type2str(int type);
+const char *ifi_type2str(int type);
+const char *rta_type2str(int type);
+const char *rtm_type2str(int type);
+const char *rtm_protocol2str(int type);
+const char *rtm_scope2str(int type);
+const char *rtm_rta2str(int type);
+const char *neigh_rta2str(int type);
+const char *ifa_rta2str(int type);
+const char *nhm_rta2str(int type);
+const char *nlmsg_flags2str(uint16_t flags, char *buf, size_t buflen);
+const char *if_flags2str(uint32_t flags, char *buf, size_t buflen);
+const char *rtm_flags2str(uint32_t flags, char *buf, size_t buflen);
+const char *neigh_state2str(uint32_t flags, char *buf, size_t buflen);
+const char *neigh_flags2str(uint32_t flags, char *buf, size_t buflen);
+const char *ifa_flags2str(uint32_t flags, char *buf, size_t buflen);
+const char *nh_flags2str(uint32_t flags, char *buf, size_t buflen);
+
+void nl_dump(void *msg, size_t msglen);
+#endif /* NETLINK_DEBUG */
+
#ifdef __cplusplus
}
#endif