]> git.proxmox.com Git - mirror_frr.git/blob - pimd/pim_routemap.c
Merge remote-tracking branch 'origin/stable/2.0'
[mirror_frr.git] / pimd / pim_routemap.c
1 /* PIM Route-map Code
2 * Copyright (C) 2016 Cumulus Networks <sharpd@cumulusnetworks.com>
3 * Copyright (C) 1999 Kunihiro Ishiguro <kunihiro@zebra.org>
4 *
5 * This file is part of Quagga
6 *
7 * Quagga is free software; you can redistribute it and/or modify it
8 * under the terms of the GNU General Public License as published by the
9 * Free Software Foundation; either version 2, or (at your option) any
10 * later version.
11 *
12 * Quagga is distributed in the hope that it will be useful, but
13 * WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License along
18 * with this program; see the file COPYING; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21 #include <zebra.h>
22
23 #include "if.h"
24 #include "vty.h"
25 #include "routemap.h"
26
27 #include "pimd.h"
28
29
30 static void
31 pim_route_map_mark_update (const char *rmap_name)
32 {
33 // placeholder
34 return;
35 }
36
37 static void
38 pim_route_map_add (const char *rmap_name)
39 {
40 if (route_map_mark_updated(rmap_name, 0) == 0)
41 pim_route_map_mark_update(rmap_name);
42
43 route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);
44 }
45
46 static void
47 pim_route_map_delete (const char *rmap_name)
48 {
49 if (route_map_mark_updated(rmap_name, 1) == 0)
50 pim_route_map_mark_update(rmap_name);
51
52 route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_DELETED);
53 }
54
55 static void
56 pim_route_map_event (route_map_event_t event, const char *rmap_name)
57 {
58 if (route_map_mark_updated(rmap_name, 0) == 0)
59 pim_route_map_mark_update(rmap_name);
60
61 route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);
62 }
63
64 void
65 pim_route_map_init (void)
66 {
67 route_map_init ();
68
69 route_map_add_hook (pim_route_map_add);
70 route_map_delete_hook (pim_route_map_delete);
71 route_map_event_hook (pim_route_map_event);
72 }
73
74 void
75 pim_route_map_terminate (void)
76 {
77 route_map_add_hook (NULL);
78 route_map_delete_hook (NULL);
79 route_map_event_hook (NULL);
80 route_map_finish();
81 }