summaryrefslogtreecommitdiff
path: root/zebra/kernel_netlink.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2016-08-10 08:54:58 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2017-01-17 18:34:17 -0500
commitb339bde737fedb6d53f06b978132a046822cee4f (patch)
tree3658c0a9c4fec277139b48c9014820e0ea447c32 /zebra/kernel_netlink.c
parenta9ea959fae3c2b985867f49dd41bdde2b54c9b83 (diff)
zebra: Fully decode mcast messages
Fully decode mcast messages from the kernel. We are not doing anything with this at the moment, but that will change. Additionally convert over to using lookup for displaying the route type. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'zebra/kernel_netlink.c')
-rw-r--r--zebra/kernel_netlink.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index 9142d4d151..20c4b5afe2 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -95,6 +95,21 @@ static const struct message rtproto_str[] = {
{0, NULL}
};
+static const struct message family_str[] = {
+ {AF_INET, "ipv4"},
+ {AF_INET6, "ipv6"},
+ {AF_BRIDGE, "bridge"},
+ {RTNL_FAMILY_IPMR, "ipv4MR"},
+ {RTNL_FAMILY_IP6MR, "ipv6MR"},
+ {0, NULL},
+};
+
+static const struct message rttype_str[] = {
+ {RTN_UNICAST, "unicast"},
+ {RTN_MULTICAST, "multicast"},
+ {0, NULL},
+};
+
extern struct thread_master *master;
extern u_int32_t nl_rcvbufsize;
@@ -398,6 +413,19 @@ nl_rtproto_to_str (u_char rtproto)
{
return lookup (rtproto_str, rtproto);
}
+
+const char *
+nl_family_to_str (u_char family)
+{
+ return lookup (family_str, family);
+}
+
+const char *
+nl_rttype_to_str (u_char rttype)
+{
+ return lookup (rttype_str, rttype);
+}
+
/* Receive message from netlink interface and pass those information
to the given function. */
int