]> git.proxmox.com Git - mirror_frr.git/blame - pimd/pim_routemap.c
all: removed all DEFUN command stomps
[mirror_frr.git] / pimd / pim_routemap.c
CommitLineData
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
31static void
32pim_route_map_mark_update (const char *rmap_name)
33{
34 // placeholder
35 return;
36}
37
38static void
39pim_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
47static void
48pim_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
56static void
57pim_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
65void
66pim_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
75void
76pim_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}