]> git.proxmox.com Git - mirror_frr.git/blame - isisd/isis_routemap.c
zebra: tweak deletion of routes without nexthop addr
[mirror_frr.git] / isisd / isis_routemap.c
CommitLineData
eb5d44eb 1/*
2 * IS-IS Rout(e)ing protocol - isis_routemap.c
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
8 *
9 * This program is free software; you can redistribute it and/or modify it
10 * under the terms of the GNU General Public Licenseas published by the Free
11 * Software Foundation; either version 2 of the License, or (at your option)
12 * any later version.
13 *
14 * This program is distributed in the hope that it will be useful,but WITHOUT
15 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
17 * more details.
18
19 * You should have received a copy of the GNU General Public License along
20 * with this program; if not, write to the Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
eb5d44eb 23#include <zebra.h>
eb5d44eb 24
25#include "thread.h"
26#include "linklist.h"
27#include "vty.h"
28#include "log.h"
29#include "memory.h"
30#include "prefix.h"
31#include "hash.h"
32#include "if.h"
33#include "table.h"
34#include "routemap.h"
35
36#include "isis_constants.h"
37#include "isis_common.h"
38#include "dict.h"
39#include "isisd.h"
40#include "isis_misc.h"
41#include "isis_adjacency.h"
42#include "isis_circuit.h"
43#include "isis_tlv.h"
44#include "isis_pdu.h"
45#include "isis_lsp.h"
46#include "isis_spf.h"
47#include "isis_route.h"
48#include "isis_zebra.h"
49
50extern struct isis *isis;
51
41b36e90
PJ
52/*
53 * Prototypes.
54 */
55void isis_route_map_upd(const char *);
56void isis_route_map_event(route_map_event_t, const char *);
57void isis_route_map_init(void);
58
59
eb5d44eb 60void
f90a5f6f 61isis_route_map_upd (const char *name)
eb5d44eb 62{
63 int i = 0;
f390d2c7 64
eb5d44eb 65 if (!isis)
66 return;
f390d2c7 67
68 for (i = 0; i <= ZEBRA_ROUTE_MAX; i++)
69 {
70 if (isis->rmap[i].name)
71 isis->rmap[i].map = isis->rmap[i].map =
72 route_map_lookup_by_name (isis->rmap[i].name);
73 else
74 isis->rmap[i].map = NULL;
75 }
eb5d44eb 76 /* FIXME: do the address family sub-mode AF_INET6 here ? */
77}
78
79void
f90a5f6f 80isis_route_map_event (route_map_event_t event, const char *name)
eb5d44eb 81{
82 int type;
83
84 if (!isis)
85 return;
86
f390d2c7 87 for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
88 {
89 if (isis->rmap[type].name && isis->rmap[type].map &&
90 !strcmp (isis->rmap[type].name, name))
91 {
92 isis_distribute_list_update (type);
93 }
eb5d44eb 94 }
eb5d44eb 95}
96
eb5d44eb 97void
98isis_route_map_init (void)
99{
100 route_map_init ();
101 route_map_init_vty ();
f390d2c7 102
eb5d44eb 103 route_map_add_hook (isis_route_map_upd);
104 route_map_delete_hook (isis_route_map_upd);
105 route_map_event_hook (isis_route_map_event);
eb5d44eb 106}