summaryrefslogtreecommitdiffstats
path: root/pimd/pim_routemap.c
diff options
context:
space:
mode:
authorDaniel Walton <dwalton@cumulusnetworks.com>2016-09-09 22:24:31 +0200
committerDaniel Walton <dwalton@cumulusnetworks.com>2016-09-09 22:24:31 +0200
commit28b0c6b377e56e76c674c27e384238a755b173b2 (patch)
treed14bf0f3ae26a5d918edbff14b7decef358463e8 /pimd/pim_routemap.c
parentospfd: Fix crash with usage of incorrect command (diff)
downloadfrr-28b0c6b377e56e76c674c27e384238a755b173b2.tar.xz
frr-28b0c6b377e56e76c674c27e384238a755b173b2.zip
Unable to remove route-map from quagga
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com> Reviewed-by: Donald Sharp <sharpd@cumulusnetworks.com> Ticket: CM-12816 pim was missing route-map hooks
Diffstat (limited to 'pimd/pim_routemap.c')
-rw-r--r--pimd/pim_routemap.c47
1 files changed, 47 insertions, 0 deletions
diff --git a/pimd/pim_routemap.c b/pimd/pim_routemap.c
index ced7c8748..adfd4fd2c 100644
--- a/pimd/pim_routemap.c
+++ b/pimd/pim_routemap.c
@@ -26,9 +26,56 @@
#include "pimd.h"
+
+static void
+pim_route_map_mark_update (const char *rmap_name)
+{
+ // placeholder
+ return;
+}
+
+static void
+pim_route_map_add (const char *rmap_name)
+{
+ if (route_map_mark_updated(rmap_name, 0) == 0)
+ pim_route_map_mark_update(rmap_name);
+
+ route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);
+}
+
+static void
+pim_route_map_delete (const char *rmap_name)
+{
+ if (route_map_mark_updated(rmap_name, 1) == 0)
+ pim_route_map_mark_update(rmap_name);
+
+ route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_DELETED);
+}
+
+static void
+pim_route_map_event (route_map_event_t event, const char *rmap_name)
+{
+ if (route_map_mark_updated(rmap_name, 0) == 0)
+ pim_route_map_mark_update(rmap_name);
+
+ route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);
+}
+
void
pim_route_map_init (void)
{
route_map_init ();
route_map_init_vty ();
+ route_map_add_hook (pim_route_map_add);
+ route_map_delete_hook (pim_route_map_delete);
+ route_map_event_hook (pim_route_map_event);
+}
+
+void
+pim_route_map_terminate (void)
+{
+ route_map_add_hook (NULL);
+ route_map_delete_hook (NULL);
+ route_map_event_hook (NULL);
+ route_map_finish();
}