pimd: add support for configuring multicast static routes
Hi,
This patch adds the ability to configure multicast static routes
directly into pimd. Two source files are introduced to implement the new
feature in addition to changes to existing files.
Here is how it can be used the CLI:
interface <incoming interface>
ip mroute <outgoing interface> <group addr> #
for asm
or ip mroute <outgoing interface> <group addr> <source> # for ssm
Please let me know if you have any questions or concerns,
Regards,
Jafar
Acked-by: Donald Sharp <sharpd@cumulusnetworks.com>
diff --git a/pimd/pimd.c b/pimd/pimd.c
index 3797d4f..97fb223 100644
--- a/pimd/pimd.c
+++ b/pimd/pimd.c
@@ -36,6 +36,7 @@
#include "pim_upstream.h"
#include "pim_rpf.h"
#include "pim_ssmpingd.h"
+#include "pim_static.h"
const char *const PIM_ALL_SYSTEMS = MCAST_ALL_SYSTEMS;
const char *const PIM_ALL_ROUTERS = MCAST_ALL_ROUTERS;
@@ -68,6 +69,7 @@
int64_t qpim_mroute_add_last = 0;
int64_t qpim_mroute_del_events = 0;
int64_t qpim_mroute_del_last = 0;
+struct list *qpim_static_route_list = 0;
static void pim_free()
{
@@ -78,6 +80,9 @@
if (qpim_upstream_list)
list_free(qpim_upstream_list);
+
+ if (qpim_static_route_list)
+ list_free(qpim_static_route_list);
}
void pim_init()
@@ -109,6 +114,14 @@
}
qpim_upstream_list->del = (void (*)(void *)) pim_upstream_free;
+ qpim_static_route_list = list_new();
+ if (!qpim_static_route_list) {
+ zlog_err("%s %s: failure: static_route_list=list_new()",
+ __FILE__, __PRETTY_FUNCTION__);
+ return;
+ }
+ qpim_static_route_list->del = (void (*)(void *)) pim_static_route_free;
+
qpim_mroute_socket_fd = -1; /* mark mroute as disabled */
qpim_mroute_oif_highest_vif_index = -1;