summaryrefslogtreecommitdiff
path: root/pimd/pim_routemap.c
diff options
context:
space:
mode:
authorQuentin Young <qlyoung@cumulusnetworks.com>2016-09-21 22:11:53 +0000
committerQuentin Young <qlyoung@cumulusnetworks.com>2016-09-21 22:11:53 +0000
commit844ec28cee41395cdd1cc0cdf8cf0168f9dc1adf (patch)
treef2fe0a9a71bb075a5f6f43cd992b89f46b95574f /pimd/pim_routemap.c
parentd0bfb22c223d645e554290ca82581eb06f94ac3b (diff)
parent039dc61292de5f3ed5f46316b1940ab6bb184c3f (diff)
Merge branch 'cmaster-next' into vtysh-grammar
Signed-off-by: Quentin Young <qlyoung@cumulusnetworks.com> Conflicts: lib/.gitignore lib/command.c lib/command.h
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 ced7c87484..adfd4fd2c3 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();
}