jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 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> |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 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 | |
| 52 | extern struct isis *isis; |
| 53 | |
| 54 | void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 55 | isis_route_map_upd () |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 56 | { |
| 57 | int i = 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 58 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 59 | if (!isis) |
| 60 | return; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 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 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 70 | /* FIXME: do the address family sub-mode AF_INET6 here ? */ |
| 71 | } |
| 72 | |
| 73 | void |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 74 | isis_route_map_event (route_map_event_t event, char *name) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 75 | { |
| 76 | int type; |
| 77 | |
| 78 | if (!isis) |
| 79 | return; |
| 80 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 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 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 88 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 89 | } |
| 90 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 91 | void |
| 92 | isis_route_map_init (void) |
| 93 | { |
| 94 | route_map_init (); |
| 95 | route_map_init_vty (); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 96 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 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); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 100 | } |