]>
Commit | Line | Data |
---|---|---|
0e8ce7e6 DS |
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 | * | |
896014f4 DL |
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 | |
0e8ce7e6 DS |
20 | */ |
21 | #include <zebra.h> | |
22 | ||
744d91b3 | 23 | #include "if.h" |
82f97584 | 24 | #include "vty.h" |
0e8ce7e6 DS |
25 | #include "routemap.h" |
26 | ||
27 | #include "pimd.h" | |
28 | ||
28b0c6b3 | 29 | |
d62a17ae | 30 | static void pim_route_map_mark_update(const char *rmap_name) |
28b0c6b3 | 31 | { |
d62a17ae | 32 | // placeholder |
33 | return; | |
28b0c6b3 DW |
34 | } |
35 | ||
d62a17ae | 36 | static void pim_route_map_add(const char *rmap_name) |
28b0c6b3 | 37 | { |
d62a17ae | 38 | if (route_map_mark_updated(rmap_name, 0) == 0) |
39 | pim_route_map_mark_update(rmap_name); | |
28b0c6b3 | 40 | |
d62a17ae | 41 | route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED); |
28b0c6b3 DW |
42 | } |
43 | ||
d62a17ae | 44 | static void pim_route_map_delete(const char *rmap_name) |
28b0c6b3 | 45 | { |
d62a17ae | 46 | if (route_map_mark_updated(rmap_name, 1) == 0) |
47 | pim_route_map_mark_update(rmap_name); | |
28b0c6b3 | 48 | |
d62a17ae | 49 | route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_DELETED); |
28b0c6b3 DW |
50 | } |
51 | ||
d62a17ae | 52 | static void pim_route_map_event(route_map_event_t event, const char *rmap_name) |
28b0c6b3 | 53 | { |
d62a17ae | 54 | if (route_map_mark_updated(rmap_name, 0) == 0) |
55 | pim_route_map_mark_update(rmap_name); | |
28b0c6b3 | 56 | |
d62a17ae | 57 | route_map_notify_dependencies(rmap_name, RMAP_EVENT_MATCH_ADDED); |
28b0c6b3 DW |
58 | } |
59 | ||
d62a17ae | 60 | void pim_route_map_init(void) |
0e8ce7e6 | 61 | { |
d62a17ae | 62 | route_map_init(); |
b2575bc0 | 63 | |
d62a17ae | 64 | route_map_add_hook(pim_route_map_add); |
65 | route_map_delete_hook(pim_route_map_delete); | |
66 | route_map_event_hook(pim_route_map_event); | |
28b0c6b3 DW |
67 | } |
68 | ||
d62a17ae | 69 | void pim_route_map_terminate(void) |
28b0c6b3 | 70 | { |
d62a17ae | 71 | route_map_add_hook(NULL); |
72 | route_map_delete_hook(NULL); | |
73 | route_map_event_hook(NULL); | |
74 | route_map_finish(); | |
0e8ce7e6 | 75 | } |