summaryrefslogtreecommitdiff
path: root/zebra/kernel_netlink.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@nvidia.com>2021-05-04 08:50:00 -0400
committerMark Stapp <mstapp@nvidia.com>2022-02-25 09:53:02 -0500
commitebb61fcaf5b94c4cafac1016625200e9bafe5ab9 (patch)
tree91541b65dd8ec70fb511fc6bf732bde1a6ca1559 /zebra/kernel_netlink.c
parent7bf63db79b7848b73e1cef49f3496038644bea16 (diff)
zebra: Start of work to get data about mpls from kernel
a) We'll need to pass the info up via some dataplane control method (This way bsd and linux can both be zebra agnostic of each other) b) We'll need to modify `struct interface *` to track this data and when it changes to notify upper level protocols about it. c) Work is needed to dump the entire mpls state at the start so we can gather interface state. This should be done after interface data gathering from the kernel. Signed-off-by: Donald Sharp <sharpd@nvidia.com> Signed-off-by: Mark Stapp <mstapp@nvidia.com>
Diffstat (limited to 'zebra/kernel_netlink.c')
-rw-r--r--zebra/kernel_netlink.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/zebra/kernel_netlink.c b/zebra/kernel_netlink.c
index 23e7098d04..0cd69e6c2c 100644
--- a/zebra/kernel_netlink.c
+++ b/zebra/kernel_netlink.c
@@ -48,6 +48,7 @@
#include "zebra/rt_netlink.h"
#include "zebra/if_netlink.h"
#include "zebra/rule_netlink.h"
+#include "zebra/netconf_netlink.h"
#include "zebra/zebra_errors.h"
#ifndef SO_RCVBUFFORCE
@@ -108,6 +109,8 @@ static const struct message nlmsg_str[] = {{RTM_NEWROUTE, "RTM_NEWROUTE"},
{RTM_NEWNEXTHOP, "RTM_NEWNEXTHOP"},
{RTM_DELNEXTHOP, "RTM_DELNEXTHOP"},
{RTM_GETNEXTHOP, "RTM_GETNEXTHOP"},
+ {RTM_NEWNETCONF, "RTM_NEWNETCONF"},
+ {RTM_DELNETCONF, "RTM_DELNETCONF"},
{0}};
static const struct message rtproto_str[] = {
@@ -370,6 +373,10 @@ static int netlink_information_fetch(struct nlmsghdr *h, ns_id_t ns_id,
case RTM_DELNEXTHOP:
return netlink_nexthop_change(h, ns_id, startup);
+ case RTM_NEWNETCONF:
+ case RTM_DELNETCONF:
+ return netlink_netconf_change(h, ns_id, startup);
+
/* Messages handled in the dplane thread */
case RTM_NEWADDR:
case RTM_DELADDR:
@@ -1593,7 +1600,9 @@ void kernel_init(struct zebra_ns *zns)
RTMGRP_NEIGH |
((uint32_t) 1 << (RTNLGRP_IPV4_RULE - 1)) |
((uint32_t) 1 << (RTNLGRP_IPV6_RULE - 1)) |
- ((uint32_t) 1 << (RTNLGRP_NEXTHOP - 1));
+ ((uint32_t) 1 << (RTNLGRP_NEXTHOP - 1)) |
+ ((uint32_t) 1 << (RTNLGRP_IPV4_NETCONF - 1)) |
+ ((uint32_t) 1 << (RTNLGRP_MPLS_NETCONF - 1));
dplane_groups = (RTMGRP_LINK |
RTMGRP_IPV4_IFADDR |