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