]> git.proxmox.com Git - mirror_frr.git/blame - isisd/isis_routemap.c
Sync bgpd and ripd set_metric_addsub_cmd commands. Fixes bugzilla #192.
[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 */
23#include <stdlib.h>
24#include <stdio.h>
25#include <zebra.h>
eb5d44eb 26
27#include "thread.h"
28#include "linklist.h"
29#include "vty.h"
30#include "log.h"
31#include "memory.h"
32#include "prefix.h"
33#include "hash.h"
34#include "if.h"
35#include "table.h"
36#include "routemap.h"
37
38#include "isis_constants.h"
39#include "isis_common.h"
40#include "dict.h"
41#include "isisd.h"
42#include "isis_misc.h"
43#include "isis_adjacency.h"
44#include "isis_circuit.h"
45#include "isis_tlv.h"
46#include "isis_pdu.h"
47#include "isis_lsp.h"
48#include "isis_spf.h"
49#include "isis_route.h"
50#include "isis_zebra.h"
51
52extern struct isis *isis;
53
54void
f90a5f6f 55isis_route_map_upd (const char *name)
eb5d44eb 56{
57 int i = 0;
f390d2c7 58
eb5d44eb 59 if (!isis)
60 return;
f390d2c7 61
62 for (i = 0; i <= ZEBRA_ROUTE_MAX; i++)
63 {
64 if (isis->rmap[i].name)
65 isis->rmap[i].map = isis->rmap[i].map =
66 route_map_lookup_by_name (isis->rmap[i].name);
67 else
68 isis->rmap[i].map = NULL;
69 }
eb5d44eb 70 /* FIXME: do the address family sub-mode AF_INET6 here ? */
71}
72
73void
f90a5f6f 74isis_route_map_event (route_map_event_t event, const char *name)
eb5d44eb 75{
76 int type;
77
78 if (!isis)
79 return;
80
f390d2c7 81 for (type = 0; type <= ZEBRA_ROUTE_MAX; type++)
82 {
83 if (isis->rmap[type].name && isis->rmap[type].map &&
84 !strcmp (isis->rmap[type].name, name))
85 {
86 isis_distribute_list_update (type);
87 }
eb5d44eb 88 }
eb5d44eb 89}
90
eb5d44eb 91void
92isis_route_map_init (void)
93{
94 route_map_init ();
95 route_map_init_vty ();
f390d2c7 96
eb5d44eb 97 route_map_add_hook (isis_route_map_upd);
98 route_map_delete_hook (isis_route_map_upd);
99 route_map_event_hook (isis_route_map_event);
eb5d44eb 100}