]> git.proxmox.com Git - mirror_frr.git/blob - pimd/pim_routemap.c
debian: add pkg-config to build-depends
[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
18 * along with Quagga; see the file COPYING. If not, write to the Free
19 * Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
20 * 02111-1307, USA.
21 */
22 #include <zebra.h>
23
24 #include "if.h"
25 #include "vty.h"
26 #include "routemap.h"
27
28 #include "pimd.h"
29
30
31 static void pim_route_map_mark_update(const char *rmap_name)
32 {
33 // placeholder
34 return;
35 }
36
37 static void pim_route_map_add(const char *rmap_name)
38 {
39 if (route_map_mark_updated(rmap_name, 0) == 0)
40 pim_route_map_mark_update(rmap_name);
41
42 route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);
43 }
44
45 static void pim_route_map_delete(const char *rmap_name)
46 {
47 if (route_map_mark_updated(rmap_name, 1) == 0)
48 pim_route_map_mark_update(rmap_name);
49
50 route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_DELETED);
51 }
52
53 static void pim_route_map_event(route_map_event_t event, const char *rmap_name)
54 {
55 if (route_map_mark_updated(rmap_name, 0) == 0)
56 pim_route_map_mark_update(rmap_name);
57
58 route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED);
59 }
60
61 void pim_route_map_init(void)
62 {
63 route_map_init();
64
65 route_map_add_hook(pim_route_map_add);
66 route_map_delete_hook(pim_route_map_delete);
67 route_map_event_hook(pim_route_map_event);
68 }
69
70 void pim_route_map_terminate(void)
71 {
72 route_map_add_hook(NULL);
73 route_map_delete_hook(NULL);
74 route_map_event_hook(NULL);
75 route_map_finish();
76 }