diff options
author | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-09-23 16:11:08 +0200 |
---|---|---|
committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2020-09-24 04:07:02 +0200 |
commit | eead0bc46b9ba49f49a4c2939c89e74b3266b452 (patch) | |
tree | ddc08aa87c3d9d312fe7f6be3c76432943caaf16 /zebra/rt_netlink.h | |
parent | Merge pull request #7018 from gouault6wind/show_ip_route (diff) | |
download | frr-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.h | 23 |
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 |