summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--pimd/pim_routemap.c47
-rw-r--r--pimd/pimd.c2
-rw-r--r--pimd/pimd.h1
-rwxr-xr-xvtysh/extract.pl.in4
4 files changed, 52 insertions, 2 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();
}
diff --git a/pimd/pimd.c b/pimd/pimd.c
index 5b6824da58..91d8d56afc 100644
--- a/pimd/pimd.c
+++ b/pimd/pimd.c
@@ -87,6 +87,8 @@ static void pim_free()
if (qpim_static_route_list)
list_free(qpim_static_route_list);
+
+ pim_route_map_terminate();
}
void pim_init()
diff --git a/pimd/pimd.h b/pimd/pimd.h
index 0a376aa905..6d48d83621 100644
--- a/pimd/pimd.h
+++ b/pimd/pimd.h
@@ -177,5 +177,6 @@ void pim_init(void);
void pim_terminate(void);
extern void pim_route_map_init (void);
+extern void pim_route_map_terminate(void);
#endif /* PIMD_H */
diff --git a/vtysh/extract.pl.in b/vtysh/extract.pl.in
index 31ab3b3ad8..7563daa506 100755
--- a/vtysh/extract.pl.in
+++ b/vtysh/extract.pl.in
@@ -121,7 +121,7 @@ foreach (@ARGV) {
$protocol = "VTYSH_RIPD";
}
elsif ($file =~ /lib\/routemap\.c$/) {
- $protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";
+ $protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA|VTYSH_PIMD";
}
elsif ($file =~ /lib\/vrf\.c$/) {
$protocol = "VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";
@@ -136,7 +136,7 @@ foreach (@ARGV) {
if ($defun_array[1] =~ m/ipv6/) {
$protocol = "VTYSH_RIPNGD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA";
} else {
- $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD|VTYSH_ZEBRA";
+ $protocol = "VTYSH_RIPD|VTYSH_OSPFD|VTYSH_BGPD|VTYSH_ZEBRA|VTYSH_PIMD";
}
}
elsif ($file =~ /lib\/distribute\.c$/) {