jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IS-IS Rout(e)ing protocol - isisd.c |
| 3 | * |
| 4 | * Copyright (C) 2001,2002 Sampo Saaristo |
| 5 | * Tampere University of Technology |
| 6 | * Institute of Communications Engineering |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify it |
| 9 | * under the terms of the GNU General Public Licenseas published by the Free |
| 10 | * Software Foundation; either version 2 of the License, or (at your option) |
| 11 | * any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful,but WITHOUT |
| 14 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
| 15 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for |
| 16 | * more details. |
| 17 | |
| 18 | * You should have received a copy of the GNU General Public License along |
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 20 | * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
| 21 | */ |
| 22 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 23 | #include <zebra.h> |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 24 | |
| 25 | #include "thread.h" |
| 26 | #include "vty.h" |
| 27 | #include "command.h" |
| 28 | #include "log.h" |
| 29 | #include "memory.h" |
| 30 | #include "linklist.h" |
| 31 | #include "if.h" |
| 32 | #include "hash.h" |
| 33 | #include "stream.h" |
| 34 | #include "prefix.h" |
| 35 | #include "table.h" |
| 36 | |
| 37 | #include "isisd/dict.h" |
| 38 | #include "isisd/include-netbsd/iso.h" |
| 39 | #include "isisd/isis_constants.h" |
| 40 | #include "isisd/isis_common.h" |
| 41 | #include "isisd/isis_circuit.h" |
| 42 | #include "isisd/isis_flags.h" |
| 43 | #include "isisd/isisd.h" |
| 44 | #include "isisd/isis_dynhn.h" |
| 45 | #include "isisd/isis_adjacency.h" |
| 46 | #include "isisd/isis_pdu.h" |
| 47 | #include "isisd/isis_misc.h" |
| 48 | #include "isisd/isis_constants.h" |
| 49 | #include "isisd/isis_tlv.h" |
| 50 | #include "isisd/isis_lsp.h" |
| 51 | #include "isisd/isis_spf.h" |
| 52 | #include "isisd/isis_route.h" |
| 53 | #include "isisd/isis_zebra.h" |
| 54 | #include "isisd/isis_events.h" |
| 55 | |
| 56 | #ifdef TOPOLOGY_GENERATE |
| 57 | #include "spgrid.h" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 58 | u_char DEFAULT_TOPOLOGY_BASEIS[6] = { 0xFE, 0xED, 0xFE, 0xED, 0x00, 0x00 }; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 59 | #endif /* TOPOLOGY_GENERATE */ |
| 60 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 61 | struct isis *isis = NULL; |
hasso | 73d1aea | 2004-09-24 10:45:28 +0000 | [diff] [blame] | 62 | extern struct thread_master *master; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 63 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 64 | void |
| 65 | isis_new (unsigned long process_id) |
| 66 | { |
hasso | aac372f | 2005-09-01 17:52:33 +0000 | [diff] [blame] | 67 | isis = XCALLOC (MTYPE_ISIS, sizeof (struct isis)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 68 | /* |
| 69 | * Default values |
| 70 | */ |
| 71 | isis->max_area_addrs = 3; |
| 72 | |
| 73 | isis->process_id = process_id; |
| 74 | isis->area_list = list_new (); |
| 75 | isis->init_circ_list = list_new (); |
| 76 | isis->uptime = time (NULL); |
| 77 | isis->nexthops = list_new (); |
| 78 | #ifdef HAVE_IPV6 |
| 79 | isis->nexthops6 = list_new (); |
| 80 | #endif /* HAVE_IPV6 */ |
| 81 | /* |
| 82 | * uncomment the next line for full debugs |
| 83 | */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 84 | /* isis->debugs = 0xFFFF; */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 85 | } |
| 86 | |
| 87 | struct isis_area * |
| 88 | isis_area_create () |
| 89 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 90 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 91 | |
hasso | aac372f | 2005-09-01 17:52:33 +0000 | [diff] [blame] | 92 | area = XCALLOC (MTYPE_ISIS_AREA, sizeof (struct isis_area)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 93 | |
| 94 | /* |
| 95 | * The first instance is level-1-2 rest are level-1, unless otherwise |
| 96 | * configured |
| 97 | */ |
| 98 | if (listcount (isis->area_list) > 0) |
| 99 | area->is_type = IS_LEVEL_1; |
| 100 | else |
| 101 | area->is_type = IS_LEVEL_1_AND_2; |
| 102 | /* |
| 103 | * intialize the databases |
| 104 | */ |
| 105 | area->lspdb[0] = lsp_db_init (); |
| 106 | area->lspdb[1] = lsp_db_init (); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 107 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 108 | spftree_area_init (area); |
| 109 | area->route_table = route_table_init (); |
| 110 | #ifdef HAVE_IPV6 |
| 111 | area->route_table6 = route_table_init (); |
| 112 | #endif /* HAVE_IPV6 */ |
| 113 | area->circuit_list = list_new (); |
| 114 | area->area_addrs = list_new (); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 115 | THREAD_TIMER_ON (master, area->t_tick, lsp_tick, area, 1); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 116 | area->flags.maxindex = -1; |
| 117 | /* |
| 118 | * Default values |
| 119 | */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 120 | area->max_lsp_lifetime[0] = MAX_AGE; /* 1200 */ |
| 121 | area->max_lsp_lifetime[1] = MAX_AGE; /* 1200 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 122 | area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT; |
| 123 | area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 124 | area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900 */ |
| 125 | area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 126 | area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL; |
| 127 | area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL; |
| 128 | area->dynhostname = 1; |
| 129 | area->lsp_frag_threshold = 90; |
| 130 | #ifdef TOPOLOGY_GENERATE |
| 131 | memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN); |
| 132 | #endif /* TOPOLOGY_GENERATE */ |
| 133 | |
| 134 | /* FIXME: Think of a better way... */ |
| 135 | area->min_bcast_mtu = 1497; |
| 136 | |
| 137 | return area; |
| 138 | } |
| 139 | |
| 140 | struct isis_area * |
hasso | f90a5f6 | 2004-10-11 13:11:56 +0000 | [diff] [blame] | 141 | isis_area_lookup (const char *area_tag) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 142 | { |
| 143 | struct isis_area *area; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 144 | struct listnode *node, *nnode; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 145 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 146 | for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 147 | if ((area->area_tag == NULL && area_tag == NULL) || |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 148 | (area->area_tag && area_tag |
| 149 | && strcmp (area->area_tag, area_tag) == 0)) |
| 150 | return area; |
| 151 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 152 | return NULL; |
| 153 | } |
| 154 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 155 | int |
hasso | f90a5f6 | 2004-10-11 13:11:56 +0000 | [diff] [blame] | 156 | isis_area_get (struct vty *vty, const char *area_tag) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 157 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 158 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 159 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 160 | area = isis_area_lookup (area_tag); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 161 | |
| 162 | if (area) |
| 163 | { |
| 164 | vty->node = ISIS_NODE; |
| 165 | vty->index = area; |
| 166 | return CMD_SUCCESS; |
| 167 | } |
| 168 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 169 | area = isis_area_create (); |
| 170 | area->area_tag = strdup (area_tag); |
| 171 | listnode_add (isis->area_list, area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 172 | |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 173 | if (isis->debugs & DEBUG_EVENTS) |
| 174 | zlog_debug ("New IS-IS area instance %s", area->area_tag); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 175 | |
| 176 | vty->node = ISIS_NODE; |
| 177 | vty->index = area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 178 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 179 | return CMD_SUCCESS; |
| 180 | } |
| 181 | |
| 182 | int |
hasso | f90a5f6 | 2004-10-11 13:11:56 +0000 | [diff] [blame] | 183 | isis_area_destroy (struct vty *vty, const char *area_tag) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 184 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 185 | struct isis_area *area; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 186 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 187 | struct isis_circuit *circuit; |
| 188 | |
| 189 | area = isis_area_lookup (area_tag); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 190 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 191 | if (area == NULL) |
| 192 | { |
| 193 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 194 | return CMD_WARNING; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 195 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 196 | |
| 197 | if (area->circuit_list) |
| 198 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 199 | for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit)) |
| 200 | isis_circuit_del (circuit); |
| 201 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 202 | list_delete (area->circuit_list); |
| 203 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 204 | listnode_delete (isis->area_list, area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 205 | THREAD_TIMER_OFF (area->t_tick); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 206 | if (area->t_remove_aged) |
| 207 | thread_cancel (area->t_remove_aged); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 208 | THREAD_TIMER_OFF (area->t_lsp_refresh[0]); |
| 209 | THREAD_TIMER_OFF (area->t_lsp_refresh[1]); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 210 | |
| 211 | XFREE (MTYPE_ISIS_AREA, area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 212 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 213 | return CMD_SUCCESS; |
| 214 | } |
| 215 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 216 | int |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 217 | area_net_title (struct vty *vty, u_char *net_title) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 218 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 219 | struct isis_area *area; |
| 220 | struct area_addr *addr; |
| 221 | struct area_addr *addrp; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 222 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 223 | |
| 224 | u_char buff[255]; |
| 225 | area = vty->index; |
| 226 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 227 | if (!area) |
| 228 | { |
| 229 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 230 | return CMD_WARNING; |
| 231 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 232 | |
| 233 | /* We check that we are not over the maximal number of addresses */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 234 | if (listcount (area->area_addrs) >= isis->max_area_addrs) |
| 235 | { |
| 236 | vty_out (vty, "Maximum of area addresses (%d) already reached %s", |
| 237 | isis->max_area_addrs, VTY_NEWLINE); |
| 238 | return CMD_WARNING; |
| 239 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 240 | |
| 241 | addr = XMALLOC (MTYPE_ISIS_AREA_ADDR, sizeof (struct area_addr)); |
| 242 | addr->addr_len = dotformat2buff (buff, net_title); |
| 243 | memcpy (addr->area_addr, buff, addr->addr_len); |
| 244 | #ifdef EXTREME_DEBUG |
hasso | 529d65b | 2004-12-24 00:14:50 +0000 | [diff] [blame] | 245 | zlog_debug ("added area address %s for area %s (address length %d)", |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 246 | net_title, area->area_tag, addr->addr_len); |
| 247 | #endif /* EXTREME_DEBUG */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 248 | if (addr->addr_len < 8 || addr->addr_len > 20) |
| 249 | { |
| 250 | zlog_warn ("area address must be at least 8..20 octets long (%d)", |
| 251 | addr->addr_len); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 252 | XFREE (MTYPE_ISIS_AREA_ADDR, addr); |
| 253 | return CMD_WARNING; |
| 254 | } |
| 255 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 256 | if (isis->sysid_set == 0) |
| 257 | { |
| 258 | /* |
| 259 | * First area address - get the SystemID for this router |
| 260 | */ |
| 261 | memcpy (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), ISIS_SYS_ID_LEN); |
| 262 | isis->sysid_set = 1; |
hasso | c89c05d | 2005-09-04 21:36:36 +0000 | [diff] [blame] | 263 | if (isis->debugs & DEBUG_EVENTS) |
| 264 | zlog_debug ("Router has SystemID %s", sysid_print (isis->sysid)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 265 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 266 | else |
| 267 | { |
| 268 | /* |
| 269 | * Check that the SystemID portions match |
| 270 | */ |
| 271 | if (memcmp (isis->sysid, GETSYSID (addr, ISIS_SYS_ID_LEN), |
| 272 | ISIS_SYS_ID_LEN)) |
| 273 | { |
| 274 | vty_out (vty, |
| 275 | "System ID must not change when defining additional area" |
| 276 | " addresses%s", VTY_NEWLINE); |
| 277 | XFREE (MTYPE_ISIS_AREA_ADDR, addr); |
| 278 | return CMD_WARNING; |
| 279 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 280 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 281 | /* now we see that we don't already have this address */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 282 | for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 283 | { |
| 284 | if ((addrp->addr_len + ISIS_SYS_ID_LEN + 1) == (addr->addr_len)) |
| 285 | { |
| 286 | if (!memcmp (addrp->area_addr, addr->area_addr, addr->addr_len)) |
| 287 | { |
| 288 | XFREE (MTYPE_ISIS_AREA_ADDR, addr); |
| 289 | return CMD_SUCCESS; /* silent fail */ |
| 290 | } |
| 291 | } |
| 292 | } |
| 293 | |
| 294 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 295 | /* |
| 296 | * Forget the systemID part of the address |
| 297 | */ |
| 298 | addr->addr_len -= (ISIS_SYS_ID_LEN + 1); |
| 299 | listnode_add (area->area_addrs, addr); |
| 300 | |
| 301 | /* only now we can safely generate our LSPs for this area */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 302 | if (listcount (area->area_addrs) > 0) |
| 303 | { |
| 304 | lsp_l1_generate (area); |
| 305 | lsp_l2_generate (area); |
| 306 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 307 | |
| 308 | return CMD_SUCCESS; |
| 309 | } |
| 310 | |
| 311 | int |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 312 | area_clear_net_title (struct vty *vty, u_char *net_title) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 313 | { |
| 314 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 315 | struct area_addr addr, *addrp = NULL; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 316 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 317 | u_char buff[255]; |
| 318 | |
| 319 | area = vty->index; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 320 | if (!area) |
| 321 | { |
| 322 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 323 | return CMD_WARNING; |
| 324 | } |
| 325 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 326 | addr.addr_len = dotformat2buff (buff, net_title); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 327 | if (addr.addr_len < 8 || addr.addr_len > 20) |
| 328 | { |
| 329 | vty_out (vty, "Unsupported area address length %d, should be 8...20 %s", |
| 330 | addr.addr_len, VTY_NEWLINE); |
| 331 | return CMD_WARNING; |
| 332 | } |
| 333 | |
| 334 | memcpy (addr.area_addr, buff, (int) addr.addr_len); |
| 335 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 336 | for (ALL_LIST_ELEMENTS (area->area_addrs, node, nnode, addrp)) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 337 | if (addrp->addr_len == addr.addr_len && |
| 338 | !memcmp (addrp->area_addr, addr.area_addr, addr.addr_len)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 339 | break; |
| 340 | |
| 341 | if (!addrp) |
| 342 | { |
| 343 | vty_out (vty, "No area address %s for area %s %s", net_title, |
| 344 | area->area_tag, VTY_NEWLINE); |
| 345 | return CMD_WARNING; |
| 346 | } |
| 347 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 348 | listnode_delete (area->area_addrs, addrp); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 349 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 350 | return CMD_SUCCESS; |
| 351 | } |
| 352 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 353 | /* |
| 354 | * 'show clns neighbors' command |
| 355 | */ |
| 356 | |
| 357 | int |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 358 | show_clns_neigh (struct vty *vty, char detail) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 359 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 360 | struct listnode *anode, *annode, *cnode, *cnnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 361 | struct isis_area *area; |
| 362 | struct isis_circuit *circuit; |
| 363 | struct list *db; |
| 364 | int i; |
| 365 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 366 | if (!isis) |
| 367 | { |
| 368 | vty_out (vty, "IS-IS Routing Process not enabled%s", VTY_NEWLINE); |
| 369 | return CMD_SUCCESS; |
| 370 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 371 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 372 | for (ALL_LIST_ELEMENTS (isis->area_list, anode, annode, area)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 373 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 374 | vty_out (vty, "Area %s:%s", area->area_tag, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 375 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 376 | if (detail == ISIS_UI_LEVEL_BRIEF) |
| 377 | vty_out (vty, " System Id Interface L State " |
| 378 | "Holdtime SNPA%s", VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 379 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 380 | for (ALL_LIST_ELEMENTS (area->circuit_list, cnode, cnnode, circuit)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 381 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 382 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) |
| 383 | { |
| 384 | for (i = 0; i < 2; i++) |
| 385 | { |
| 386 | db = circuit->u.bc.adjdb[i]; |
| 387 | if (db && db->count) |
| 388 | { |
| 389 | if (detail == ISIS_UI_LEVEL_BRIEF) |
| 390 | isis_adjdb_iterate (db, |
| 391 | (void (*) |
| 392 | (struct isis_adjacency *, |
| 393 | void *)) isis_adj_print_vty, |
| 394 | vty); |
| 395 | if (detail == ISIS_UI_LEVEL_DETAIL) |
| 396 | isis_adjdb_iterate (db, |
| 397 | (void (*) |
| 398 | (struct isis_adjacency *, |
| 399 | void *)) |
| 400 | isis_adj_print_vty_detail, vty); |
| 401 | if (detail == ISIS_UI_LEVEL_EXTENSIVE) |
| 402 | isis_adjdb_iterate (db, |
| 403 | (void (*) |
| 404 | (struct isis_adjacency *, |
| 405 | void *)) |
| 406 | isis_adj_print_vty_extensive, |
| 407 | vty); |
| 408 | } |
| 409 | } |
| 410 | } |
| 411 | else if (circuit->circ_type == CIRCUIT_T_P2P && |
| 412 | circuit->u.p2p.neighbor) |
| 413 | { |
| 414 | if (detail == ISIS_UI_LEVEL_BRIEF) |
| 415 | isis_adj_p2p_print_vty (circuit->u.p2p.neighbor, vty); |
| 416 | if (detail == ISIS_UI_LEVEL_DETAIL) |
| 417 | isis_adj_p2p_print_vty_detail (circuit->u.p2p.neighbor, vty); |
| 418 | if (detail == ISIS_UI_LEVEL_EXTENSIVE) |
| 419 | isis_adj_p2p_print_vty_extensive (circuit->u.p2p.neighbor, |
| 420 | vty); |
| 421 | } |
| 422 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 423 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 424 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 425 | return CMD_SUCCESS; |
| 426 | } |
| 427 | |
| 428 | DEFUN (show_clns_neighbors, |
| 429 | show_clns_neighbors_cmd, |
| 430 | "show clns neighbors", |
| 431 | SHOW_STR |
| 432 | "clns network information\n" |
| 433 | "CLNS neighbor adjacencies\n") |
| 434 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 435 | return show_clns_neigh (vty, ISIS_UI_LEVEL_BRIEF); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 436 | } |
| 437 | |
| 438 | ALIAS (show_clns_neighbors, |
| 439 | show_isis_neighbors_cmd, |
| 440 | "show isis neighbors", |
| 441 | SHOW_STR |
| 442 | "IS-IS network information\n" |
| 443 | "IS-IS neighbor adjacencies\n") |
| 444 | |
| 445 | DEFUN (show_clns_neighbors_detail, |
| 446 | show_clns_neighbors_detail_cmd, |
| 447 | "show clns neighbors detail", |
| 448 | SHOW_STR |
| 449 | "clns network information\n" |
| 450 | "CLNS neighbor adjacencies\n" |
| 451 | "show detailed information\n") |
| 452 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 453 | return show_clns_neigh (vty, ISIS_UI_LEVEL_DETAIL); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 454 | } |
| 455 | |
| 456 | ALIAS (show_clns_neighbors_detail, |
| 457 | show_isis_neighbors_detail_cmd, |
| 458 | "show isis neighbors detail", |
| 459 | SHOW_STR |
| 460 | "IS-IS network information\n" |
| 461 | "IS-IS neighbor adjacencies\n" |
| 462 | "show detailed information\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 463 | /* |
| 464 | * 'isis debug', 'show debugging' |
| 465 | */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 466 | void |
| 467 | print_debug (struct vty *vty, int flags, int onoff) |
| 468 | { |
| 469 | char onoffs[4]; |
| 470 | if (onoff) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 471 | strcpy (onoffs, "on"); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 472 | else |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 473 | strcpy (onoffs, "off"); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 474 | |
| 475 | if (flags & DEBUG_ADJ_PACKETS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 476 | vty_out (vty, "IS-IS Adjacency related packets debugging is %s%s", onoffs, |
| 477 | VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 478 | if (flags & DEBUG_CHECKSUM_ERRORS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 479 | vty_out (vty, "IS-IS checksum errors debugging is %s%s", onoffs, |
| 480 | VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 481 | if (flags & DEBUG_LOCAL_UPDATES) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 482 | vty_out (vty, "IS-IS local updates debugging is %s%s", onoffs, |
| 483 | VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 484 | if (flags & DEBUG_PROTOCOL_ERRORS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 485 | vty_out (vty, "IS-IS protocol errors debugging is %s%s", onoffs, |
| 486 | VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 487 | if (flags & DEBUG_SNP_PACKETS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 488 | vty_out (vty, "IS-IS CSNP/PSNP packets debugging is %s%s", onoffs, |
| 489 | VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 490 | if (flags & DEBUG_SPF_EVENTS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 491 | vty_out (vty, "IS-IS SPF events debugging is %s%s", onoffs, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 492 | if (flags & DEBUG_SPF_STATS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 493 | vty_out (vty, "IS-IS SPF Timing and Statistics Data debugging is %s%s", |
| 494 | onoffs, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 495 | if (flags & DEBUG_SPF_TRIGGERS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 496 | vty_out (vty, "IS-IS SPF triggering events debugging is %s%s", onoffs, |
| 497 | VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 498 | if (flags & DEBUG_UPDATE_PACKETS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 499 | vty_out (vty, "IS-IS Update related packet debugging is %s%s", onoffs, |
| 500 | VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 501 | if (flags & DEBUG_RTE_EVENTS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 502 | vty_out (vty, "IS-IS Route related debuggin is %s%s", onoffs, |
| 503 | VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 504 | if (flags & DEBUG_EVENTS) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 505 | vty_out (vty, "IS-IS Event debugging is %s%s", onoffs, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 506 | |
| 507 | } |
| 508 | |
| 509 | DEFUN (show_debugging, |
| 510 | show_debugging_cmd, |
| 511 | "show debugging", |
| 512 | SHOW_STR |
| 513 | "State of each debugging option\n") |
| 514 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 515 | vty_out (vty, "IS-IS:%s", VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 516 | print_debug (vty, isis->debugs, 1); |
| 517 | return CMD_SUCCESS; |
| 518 | } |
| 519 | |
jardin | 9e867fe | 2003-12-23 08:56:18 +0000 | [diff] [blame] | 520 | /* Debug node. */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 521 | static struct cmd_node debug_node = { |
jardin | 9e867fe | 2003-12-23 08:56:18 +0000 | [diff] [blame] | 522 | DEBUG_NODE, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 523 | "", |
| 524 | 1 |
jardin | 9e867fe | 2003-12-23 08:56:18 +0000 | [diff] [blame] | 525 | }; |
| 526 | |
| 527 | static int |
| 528 | config_write_debug (struct vty *vty) |
| 529 | { |
| 530 | int write = 0; |
| 531 | int flags = isis->debugs; |
| 532 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 533 | if (flags & DEBUG_ADJ_PACKETS) |
| 534 | { |
| 535 | vty_out (vty, "debug isis adj-packets%s", VTY_NEWLINE); |
| 536 | write++; |
| 537 | } |
| 538 | if (flags & DEBUG_CHECKSUM_ERRORS) |
| 539 | { |
| 540 | vty_out (vty, "debug isis checksum-errors%s", VTY_NEWLINE); |
| 541 | write++; |
| 542 | } |
| 543 | if (flags & DEBUG_LOCAL_UPDATES) |
| 544 | { |
| 545 | vty_out (vty, "debug isis local-updates%s", VTY_NEWLINE); |
| 546 | write++; |
| 547 | } |
| 548 | if (flags & DEBUG_PROTOCOL_ERRORS) |
| 549 | { |
| 550 | vty_out (vty, "debug isis protocol-errors%s", VTY_NEWLINE); |
| 551 | write++; |
| 552 | } |
| 553 | if (flags & DEBUG_SNP_PACKETS) |
| 554 | { |
| 555 | vty_out (vty, "debug isis snp-packets%s", VTY_NEWLINE); |
| 556 | write++; |
| 557 | } |
| 558 | if (flags & DEBUG_SPF_EVENTS) |
| 559 | { |
| 560 | vty_out (vty, "debug isis spf-events%s", VTY_NEWLINE); |
| 561 | write++; |
| 562 | } |
| 563 | if (flags & DEBUG_SPF_STATS) |
| 564 | { |
| 565 | vty_out (vty, "debug isis spf-statistics%s", VTY_NEWLINE); |
| 566 | write++; |
| 567 | } |
| 568 | if (flags & DEBUG_SPF_TRIGGERS) |
| 569 | { |
| 570 | vty_out (vty, "debug isis spf-triggers%s", VTY_NEWLINE); |
| 571 | write++; |
| 572 | } |
| 573 | if (flags & DEBUG_UPDATE_PACKETS) |
| 574 | { |
| 575 | vty_out (vty, "debug isis update-packets%s", VTY_NEWLINE); |
| 576 | write++; |
| 577 | } |
| 578 | if (flags & DEBUG_RTE_EVENTS) |
| 579 | { |
| 580 | vty_out (vty, "debug isis route-events%s", VTY_NEWLINE); |
| 581 | write++; |
| 582 | } |
| 583 | if (flags & DEBUG_EVENTS) |
| 584 | { |
| 585 | vty_out (vty, "debug isis events%s", VTY_NEWLINE); |
| 586 | write++; |
| 587 | } |
jardin | 9e867fe | 2003-12-23 08:56:18 +0000 | [diff] [blame] | 588 | |
| 589 | return write; |
| 590 | } |
| 591 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 592 | DEFUN (debug_isis_adj, |
| 593 | debug_isis_adj_cmd, |
| 594 | "debug isis adj-packets", |
| 595 | DEBUG_STR |
| 596 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 597 | "IS-IS Adjacency related packets\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 598 | { |
| 599 | isis->debugs |= DEBUG_ADJ_PACKETS; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 600 | print_debug (vty, DEBUG_ADJ_PACKETS, 1); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 601 | |
| 602 | return CMD_SUCCESS; |
| 603 | } |
| 604 | |
| 605 | DEFUN (no_debug_isis_adj, |
| 606 | no_debug_isis_adj_cmd, |
| 607 | "no debug isis adj-packets", |
| 608 | UNDEBUG_STR |
| 609 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 610 | "IS-IS Adjacency related packets\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 611 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 612 | isis->debugs &= ~DEBUG_ADJ_PACKETS; |
| 613 | print_debug (vty, DEBUG_ADJ_PACKETS, 0); |
| 614 | |
| 615 | return CMD_SUCCESS; |
| 616 | } |
| 617 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 618 | DEFUN (debug_isis_csum, |
| 619 | debug_isis_csum_cmd, |
| 620 | "debug isis checksum-errors", |
| 621 | DEBUG_STR |
| 622 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 623 | "IS-IS LSP checksum errors\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 624 | { |
| 625 | isis->debugs |= DEBUG_CHECKSUM_ERRORS; |
| 626 | print_debug (vty, DEBUG_CHECKSUM_ERRORS, 1); |
| 627 | |
| 628 | return CMD_SUCCESS; |
| 629 | } |
| 630 | |
| 631 | DEFUN (no_debug_isis_csum, |
| 632 | no_debug_isis_csum_cmd, |
| 633 | "no debug isis checksum-errors", |
| 634 | UNDEBUG_STR |
| 635 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 636 | "IS-IS LSP checksum errors\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 637 | { |
| 638 | isis->debugs &= ~DEBUG_CHECKSUM_ERRORS; |
| 639 | print_debug (vty, DEBUG_CHECKSUM_ERRORS, 0); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 640 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 641 | return CMD_SUCCESS; |
| 642 | } |
| 643 | |
| 644 | DEFUN (debug_isis_lupd, |
| 645 | debug_isis_lupd_cmd, |
| 646 | "debug isis local-updates", |
| 647 | DEBUG_STR |
| 648 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 649 | "IS-IS local update packets\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 650 | { |
| 651 | isis->debugs |= DEBUG_LOCAL_UPDATES; |
| 652 | print_debug (vty, DEBUG_LOCAL_UPDATES, 1); |
| 653 | |
| 654 | return CMD_SUCCESS; |
| 655 | } |
| 656 | |
| 657 | DEFUN (no_debug_isis_lupd, |
| 658 | no_debug_isis_lupd_cmd, |
| 659 | "no debug isis local-updates", |
| 660 | UNDEBUG_STR |
| 661 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 662 | "IS-IS local update packets\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 663 | { |
| 664 | isis->debugs &= ~DEBUG_LOCAL_UPDATES; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 665 | print_debug (vty, DEBUG_LOCAL_UPDATES, 0); |
| 666 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 667 | return CMD_SUCCESS; |
| 668 | } |
| 669 | |
| 670 | DEFUN (debug_isis_err, |
| 671 | debug_isis_err_cmd, |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 672 | "debug isis protocol-errors", |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 673 | DEBUG_STR |
| 674 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 675 | "IS-IS LSP protocol errors\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 676 | { |
| 677 | isis->debugs |= DEBUG_PROTOCOL_ERRORS; |
| 678 | print_debug (vty, DEBUG_PROTOCOL_ERRORS, 1); |
| 679 | |
| 680 | return CMD_SUCCESS; |
| 681 | } |
| 682 | |
| 683 | DEFUN (no_debug_isis_err, |
| 684 | no_debug_isis_err_cmd, |
| 685 | "no debug isis protocol-errors", |
| 686 | UNDEBUG_STR |
| 687 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 688 | "IS-IS LSP protocol errors\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 689 | { |
| 690 | isis->debugs &= ~DEBUG_PROTOCOL_ERRORS; |
| 691 | print_debug (vty, DEBUG_PROTOCOL_ERRORS, 0); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 692 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 693 | return CMD_SUCCESS; |
| 694 | } |
| 695 | |
| 696 | DEFUN (debug_isis_snp, |
| 697 | debug_isis_snp_cmd, |
| 698 | "debug isis snp-packets", |
| 699 | DEBUG_STR |
| 700 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 701 | "IS-IS CSNP/PSNP packets\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 702 | { |
| 703 | isis->debugs |= DEBUG_SNP_PACKETS; |
| 704 | print_debug (vty, DEBUG_SNP_PACKETS, 1); |
| 705 | |
| 706 | return CMD_SUCCESS; |
| 707 | } |
| 708 | |
| 709 | DEFUN (no_debug_isis_snp, |
| 710 | no_debug_isis_snp_cmd, |
| 711 | "no debug isis snp-packets", |
| 712 | UNDEBUG_STR |
| 713 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 714 | "IS-IS CSNP/PSNP packets\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 715 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 716 | isis->debugs &= ~DEBUG_SNP_PACKETS; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 717 | print_debug (vty, DEBUG_SNP_PACKETS, 0); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 718 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 719 | return CMD_SUCCESS; |
| 720 | } |
| 721 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 722 | DEFUN (debug_isis_upd, |
| 723 | debug_isis_upd_cmd, |
| 724 | "debug isis update-packets", |
| 725 | DEBUG_STR |
| 726 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 727 | "IS-IS Update related packets\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 728 | { |
| 729 | isis->debugs |= DEBUG_UPDATE_PACKETS; |
| 730 | print_debug (vty, DEBUG_UPDATE_PACKETS, 1); |
| 731 | |
| 732 | return CMD_SUCCESS; |
| 733 | } |
| 734 | |
| 735 | DEFUN (no_debug_isis_upd, |
| 736 | no_debug_isis_upd_cmd, |
| 737 | "no debug isis update-packets", |
| 738 | UNDEBUG_STR |
| 739 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 740 | "IS-IS Update related packets\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 741 | { |
| 742 | isis->debugs &= ~DEBUG_UPDATE_PACKETS; |
| 743 | print_debug (vty, DEBUG_UPDATE_PACKETS, 0); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 744 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 745 | return CMD_SUCCESS; |
| 746 | } |
| 747 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 748 | DEFUN (debug_isis_spfevents, |
| 749 | debug_isis_spfevents_cmd, |
| 750 | "debug isis spf-events", |
| 751 | DEBUG_STR |
| 752 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 753 | "IS-IS Shortest Path First Events\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 754 | { |
| 755 | isis->debugs |= DEBUG_SPF_EVENTS; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 756 | print_debug (vty, DEBUG_SPF_EVENTS, 1); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 757 | |
| 758 | return CMD_SUCCESS; |
| 759 | } |
| 760 | |
| 761 | DEFUN (no_debug_isis_spfevents, |
| 762 | no_debug_isis_spfevents_cmd, |
| 763 | "no debug isis spf-events", |
| 764 | UNDEBUG_STR |
| 765 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 766 | "IS-IS Shortest Path First Events\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 767 | { |
| 768 | isis->debugs &= ~DEBUG_SPF_EVENTS; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 769 | print_debug (vty, DEBUG_SPF_EVENTS, 0); |
| 770 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 771 | return CMD_SUCCESS; |
| 772 | } |
| 773 | |
| 774 | |
| 775 | DEFUN (debug_isis_spfstats, |
| 776 | debug_isis_spfstats_cmd, |
| 777 | "debug isis spf-statistics ", |
| 778 | DEBUG_STR |
| 779 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 780 | "IS-IS SPF Timing and Statistic Data\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 781 | { |
| 782 | isis->debugs |= DEBUG_SPF_STATS; |
| 783 | print_debug (vty, DEBUG_SPF_STATS, 1); |
| 784 | |
| 785 | return CMD_SUCCESS; |
| 786 | } |
| 787 | |
| 788 | DEFUN (no_debug_isis_spfstats, |
| 789 | no_debug_isis_spfstats_cmd, |
| 790 | "no debug isis spf-statistics", |
| 791 | UNDEBUG_STR |
| 792 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 793 | "IS-IS SPF Timing and Statistic Data\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 794 | { |
| 795 | isis->debugs &= ~DEBUG_SPF_STATS; |
| 796 | print_debug (vty, DEBUG_SPF_STATS, 0); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 797 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 798 | return CMD_SUCCESS; |
| 799 | } |
| 800 | |
| 801 | DEFUN (debug_isis_spftrigg, |
| 802 | debug_isis_spftrigg_cmd, |
| 803 | "debug isis spf-triggers", |
| 804 | DEBUG_STR |
| 805 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 806 | "IS-IS SPF triggering events\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 807 | { |
| 808 | isis->debugs |= DEBUG_SPF_TRIGGERS; |
| 809 | print_debug (vty, DEBUG_SPF_TRIGGERS, 1); |
| 810 | |
| 811 | return CMD_SUCCESS; |
| 812 | } |
| 813 | |
| 814 | DEFUN (no_debug_isis_spftrigg, |
| 815 | no_debug_isis_spftrigg_cmd, |
| 816 | "no debug isis spf-triggers", |
| 817 | UNDEBUG_STR |
| 818 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 819 | "IS-IS SPF triggering events\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 820 | { |
| 821 | isis->debugs &= ~DEBUG_SPF_TRIGGERS; |
| 822 | print_debug (vty, DEBUG_SPF_TRIGGERS, 0); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 823 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 824 | return CMD_SUCCESS; |
| 825 | } |
| 826 | |
| 827 | DEFUN (debug_isis_rtevents, |
| 828 | debug_isis_rtevents_cmd, |
| 829 | "debug isis route-events", |
| 830 | DEBUG_STR |
| 831 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 832 | "IS-IS Route related events\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 833 | { |
| 834 | isis->debugs |= DEBUG_RTE_EVENTS; |
| 835 | print_debug (vty, DEBUG_RTE_EVENTS, 1); |
| 836 | |
| 837 | return CMD_SUCCESS; |
| 838 | } |
| 839 | |
| 840 | DEFUN (no_debug_isis_rtevents, |
| 841 | no_debug_isis_rtevents_cmd, |
| 842 | "no debug isis route-events", |
| 843 | UNDEBUG_STR |
| 844 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 845 | "IS-IS Route related events\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 846 | { |
| 847 | isis->debugs &= ~DEBUG_RTE_EVENTS; |
| 848 | print_debug (vty, DEBUG_RTE_EVENTS, 0); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 849 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 850 | return CMD_SUCCESS; |
| 851 | } |
| 852 | |
| 853 | DEFUN (debug_isis_events, |
| 854 | debug_isis_events_cmd, |
| 855 | "debug isis events", |
| 856 | DEBUG_STR |
| 857 | "IS-IS information\n" |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 858 | "IS-IS Events\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 859 | { |
| 860 | isis->debugs |= DEBUG_EVENTS; |
| 861 | print_debug (vty, DEBUG_EVENTS, 1); |
| 862 | |
| 863 | return CMD_SUCCESS; |
| 864 | } |
| 865 | |
| 866 | DEFUN (no_debug_isis_events, |
| 867 | no_debug_isis_events_cmd, |
| 868 | "no debug isis events", |
| 869 | UNDEBUG_STR |
| 870 | "IS-IS information\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 871 | "IS-IS Events\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 872 | { |
| 873 | isis->debugs &= ~DEBUG_EVENTS; |
| 874 | print_debug (vty, DEBUG_EVENTS, 0); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 875 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 876 | return CMD_SUCCESS; |
| 877 | } |
| 878 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 879 | DEFUN (show_hostname, |
| 880 | show_hostname_cmd, |
| 881 | "show isis hostname", |
| 882 | SHOW_STR |
| 883 | "IS-IS information\n" |
| 884 | "IS-IS Dynamic hostname mapping\n") |
| 885 | { |
| 886 | dynhn_print_all (vty); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 887 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 888 | return CMD_SUCCESS; |
| 889 | } |
| 890 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 891 | DEFUN (show_database, |
| 892 | show_database_cmd, |
| 893 | "show isis database", |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 894 | SHOW_STR "IS-IS information\n" "IS-IS link state database\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 895 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 896 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 897 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 898 | int level, lsp_count; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 899 | |
| 900 | if (isis->area_list->count == 0) |
| 901 | return CMD_SUCCESS; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 902 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 903 | for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 904 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 905 | vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null", |
| 906 | VTY_NEWLINE); |
| 907 | for (level = 0; level < ISIS_LEVELS; level++) |
| 908 | { |
| 909 | if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0) |
| 910 | { |
| 911 | vty_out (vty, "IS-IS Level-%d link-state database:%s", |
| 912 | level + 1, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 913 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 914 | lsp_count = lsp_print_all (vty, area->lspdb[level], |
| 915 | ISIS_UI_LEVEL_BRIEF, |
| 916 | area->dynhostname); |
| 917 | |
| 918 | vty_out (vty, "%s %u LSPs%s%s", |
| 919 | VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE); |
| 920 | } |
| 921 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 922 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 923 | |
| 924 | return CMD_SUCCESS; |
| 925 | } |
| 926 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 927 | DEFUN (show_database_detail, |
| 928 | show_database_detail_cmd, |
| 929 | "show isis database detail", |
| 930 | SHOW_STR |
| 931 | "IS-IS information\n" |
| 932 | "IS-IS link state database\n") |
| 933 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 934 | struct listnode *node, *nnode; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 935 | struct isis_area *area; |
| 936 | int level, lsp_count; |
| 937 | |
| 938 | if (isis->area_list->count == 0) |
| 939 | return CMD_SUCCESS; |
| 940 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 941 | for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 942 | { |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 943 | vty_out (vty, "Area %s:%s", area->area_tag ? area->area_tag : "null", |
| 944 | VTY_NEWLINE); |
| 945 | for (level = 0; level < ISIS_LEVELS; level++) |
| 946 | { |
| 947 | if (area->lspdb[level] && dict_count (area->lspdb[level]) > 0) |
| 948 | { |
| 949 | vty_out (vty, "IS-IS Level-%d Link State Database:%s", |
| 950 | level + 1, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 951 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 952 | lsp_count = lsp_print_all (vty, area->lspdb[level], |
| 953 | ISIS_UI_LEVEL_DETAIL, |
| 954 | area->dynhostname); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 955 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 956 | vty_out (vty, "%s %u LSPs%s%s", |
| 957 | VTY_NEWLINE, lsp_count, VTY_NEWLINE, VTY_NEWLINE); |
| 958 | } |
| 959 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 960 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 961 | |
| 962 | return CMD_SUCCESS; |
| 963 | } |
| 964 | |
| 965 | /* |
| 966 | * 'router isis' command |
| 967 | */ |
| 968 | DEFUN (router_isis, |
| 969 | router_isis_cmd, |
| 970 | "router isis WORD", |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 971 | ROUTER_STR |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 972 | "ISO IS-IS\n" |
| 973 | "ISO Routing area tag") |
| 974 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 975 | return isis_area_get (vty, argv[0]); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 976 | } |
| 977 | |
| 978 | /* |
| 979 | *'no router isis' command |
| 980 | */ |
| 981 | DEFUN (no_router_isis, |
| 982 | no_router_isis_cmd, |
| 983 | "no router isis WORD", |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 984 | "no\n" ROUTER_STR "ISO IS-IS\n" "ISO Routing area tag") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 985 | { |
| 986 | return isis_area_destroy (vty, argv[0]); |
| 987 | } |
| 988 | |
| 989 | /* |
| 990 | * 'net' command |
| 991 | */ |
| 992 | DEFUN (net, |
| 993 | net_cmd, |
| 994 | "net WORD", |
| 995 | "A Network Entity Title for this process (OSI only)\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 996 | "XX.XXXX. ... .XXX.XX Network entity title (NET)\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 997 | { |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 998 | return area_net_title (vty, (u_char *)argv[0]); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 999 | } |
| 1000 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1001 | /* |
| 1002 | * 'no net' command |
| 1003 | */ |
| 1004 | DEFUN (no_net, |
| 1005 | no_net_cmd, |
| 1006 | "no net WORD", |
| 1007 | NO_STR |
| 1008 | "A Network Entity Title for this process (OSI only)\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1009 | "XX.XXXX. ... .XXX.XX Network entity title (NET)\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1010 | { |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 1011 | return area_clear_net_title (vty, (u_char *)argv[0]); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1012 | } |
| 1013 | |
| 1014 | DEFUN (area_passwd, |
| 1015 | area_passwd_cmd, |
| 1016 | "area-password WORD", |
| 1017 | "Configure the authentication password for an area\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1018 | "Area password\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1019 | { |
| 1020 | struct isis_area *area; |
| 1021 | int len; |
| 1022 | |
| 1023 | area = vty->index; |
| 1024 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1025 | if (!area) |
| 1026 | { |
| 1027 | vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE); |
| 1028 | return CMD_WARNING; |
| 1029 | } |
| 1030 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1031 | len = strlen (argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1032 | if (len > 254) |
| 1033 | { |
| 1034 | vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE); |
| 1035 | return CMD_WARNING; |
| 1036 | } |
| 1037 | area->area_passwd.len = (u_char) len; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1038 | area->area_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT; |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 1039 | strncpy ((char *)area->area_passwd.passwd, argv[0], 255); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1040 | |
hasso | 1cbc562 | 2005-01-01 10:29:51 +0000 | [diff] [blame] | 1041 | if (argc > 1) |
| 1042 | { |
| 1043 | SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND); |
| 1044 | if (strncmp(argv[1], "v", 1) == 0) |
| 1045 | SET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV); |
| 1046 | else |
| 1047 | UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV); |
| 1048 | } |
| 1049 | else |
| 1050 | { |
| 1051 | UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND); |
| 1052 | UNSET_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV); |
| 1053 | } |
| 1054 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1055 | return CMD_SUCCESS; |
| 1056 | } |
| 1057 | |
hasso | 1cbc562 | 2005-01-01 10:29:51 +0000 | [diff] [blame] | 1058 | ALIAS (area_passwd, |
| 1059 | area_passwd_snpauth_cmd, |
| 1060 | "area-password WORD authenticate snp (send-only|validate)", |
| 1061 | "Configure the authentication password for an area\n" |
| 1062 | "Area password\n" |
| 1063 | "Authentication\n" |
| 1064 | "SNP PDUs\n" |
| 1065 | "Send but do not check PDUs on receiving\n" |
| 1066 | "Send and check PDUs on receiving\n"); |
| 1067 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1068 | DEFUN (no_area_passwd, |
| 1069 | no_area_passwd_cmd, |
| 1070 | "no area-password", |
| 1071 | NO_STR |
| 1072 | "Configure the authentication password for an area\n") |
| 1073 | { |
| 1074 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1075 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1076 | area = vty->index; |
| 1077 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1078 | if (!area) |
| 1079 | { |
| 1080 | vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE); |
| 1081 | return CMD_WARNING; |
| 1082 | } |
| 1083 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1084 | memset (&area->area_passwd, 0, sizeof (struct isis_passwd)); |
| 1085 | |
| 1086 | return CMD_SUCCESS; |
| 1087 | } |
| 1088 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1089 | DEFUN (domain_passwd, |
| 1090 | domain_passwd_cmd, |
| 1091 | "domain-password WORD", |
| 1092 | "Set the authentication password for a routing domain\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1093 | "Routing domain password\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1094 | { |
| 1095 | struct isis_area *area; |
| 1096 | int len; |
| 1097 | |
| 1098 | area = vty->index; |
| 1099 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1100 | if (!area) |
| 1101 | { |
| 1102 | vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE); |
| 1103 | return CMD_WARNING; |
| 1104 | } |
| 1105 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1106 | len = strlen (argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1107 | if (len > 254) |
| 1108 | { |
| 1109 | vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE); |
| 1110 | return CMD_WARNING; |
| 1111 | } |
| 1112 | area->domain_passwd.len = (u_char) len; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1113 | area->domain_passwd.type = ISIS_PASSWD_TYPE_CLEARTXT; |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 1114 | strncpy ((char *)area->domain_passwd.passwd, argv[0], 255); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1115 | |
hasso | 1cbc562 | 2005-01-01 10:29:51 +0000 | [diff] [blame] | 1116 | if (argc > 1) |
| 1117 | { |
| 1118 | SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND); |
| 1119 | if (strncmp(argv[1], "v", 1) == 0) |
| 1120 | SET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV); |
| 1121 | else |
| 1122 | UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV); |
| 1123 | } |
| 1124 | else |
| 1125 | { |
| 1126 | UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND); |
| 1127 | UNSET_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV); |
| 1128 | } |
| 1129 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1130 | return CMD_SUCCESS; |
| 1131 | } |
| 1132 | |
hasso | 1cbc562 | 2005-01-01 10:29:51 +0000 | [diff] [blame] | 1133 | ALIAS (domain_passwd, |
| 1134 | domain_passwd_snpauth_cmd, |
| 1135 | "domain-password WORD authenticate snp (send-only|validate)", |
| 1136 | "Set the authentication password for a routing domain\n" |
| 1137 | "Routing domain password\n" |
| 1138 | "Authentication\n" |
| 1139 | "SNP PDUs\n" |
| 1140 | "Send but do not check PDUs on receiving\n" |
| 1141 | "Send and check PDUs on receiving\n"); |
| 1142 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1143 | DEFUN (no_domain_passwd, |
| 1144 | no_domain_passwd_cmd, |
| 1145 | "no domain-password WORD", |
| 1146 | NO_STR |
| 1147 | "Set the authentication password for a routing domain\n") |
| 1148 | { |
| 1149 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1150 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1151 | area = vty->index; |
| 1152 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1153 | if (!area) |
| 1154 | { |
| 1155 | vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE); |
| 1156 | return CMD_WARNING; |
| 1157 | } |
| 1158 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1159 | memset (&area->domain_passwd, 0, sizeof (struct isis_passwd)); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1160 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1161 | return CMD_SUCCESS; |
| 1162 | } |
| 1163 | |
| 1164 | DEFUN (is_type, |
| 1165 | is_type_cmd, |
| 1166 | "is-type (level-1|level-1-2|level-2-only)", |
| 1167 | "IS Level for this routing process (OSI only)\n" |
| 1168 | "Act as a station router only\n" |
| 1169 | "Act as both a station router and an area router\n" |
| 1170 | "Act as an area router only\n") |
| 1171 | { |
| 1172 | struct isis_area *area; |
| 1173 | int type; |
| 1174 | |
| 1175 | area = vty->index; |
| 1176 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1177 | if (!area) |
| 1178 | { |
| 1179 | vty_out (vty, "Cant find IS-IS instance%s", VTY_NEWLINE); |
| 1180 | return CMD_WARNING; |
| 1181 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1182 | |
hasso | f7c43dc | 2004-09-26 16:24:14 +0000 | [diff] [blame] | 1183 | type = string2circuit_t ((u_char *)argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1184 | if (!type) |
| 1185 | { |
| 1186 | vty_out (vty, "Unknown IS level %s", VTY_NEWLINE); |
| 1187 | return CMD_SUCCESS; |
| 1188 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1189 | |
| 1190 | isis_event_system_type_change (area, type); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1191 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1192 | return CMD_SUCCESS; |
| 1193 | } |
| 1194 | |
| 1195 | DEFUN (no_is_type, |
| 1196 | no_is_type_cmd, |
| 1197 | "no is-type (level-1|level-1-2|level-2-only)", |
| 1198 | NO_STR |
| 1199 | "IS Level for this routing process (OSI only)\n" |
| 1200 | "Act as a station router only\n" |
| 1201 | "Act as both a station router and an area router\n" |
| 1202 | "Act as an area router only\n") |
| 1203 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1204 | struct isis_area *area; |
| 1205 | int type; |
| 1206 | |
| 1207 | area = vty->index; |
| 1208 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1209 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1210 | /* |
| 1211 | * Put the is-type back to default. Which is level-1-2 on first |
| 1212 | * circuit for the area level-1 for the rest |
| 1213 | */ |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1214 | if (listgetdata (listhead (isis->area_list)) == area) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1215 | type = IS_LEVEL_1_AND_2; |
| 1216 | else |
| 1217 | type = IS_LEVEL_1; |
| 1218 | |
| 1219 | isis_event_system_type_change (area, type); |
| 1220 | |
| 1221 | return CMD_SUCCESS; |
| 1222 | } |
| 1223 | |
| 1224 | DEFUN (lsp_gen_interval, |
| 1225 | lsp_gen_interval_cmd, |
| 1226 | "lsp-gen-interval <1-120>", |
| 1227 | "Minimum interval between regenerating same LSP\n" |
| 1228 | "Minimum interval in seconds\n") |
| 1229 | { |
| 1230 | struct isis_area *area; |
| 1231 | uint16_t interval; |
| 1232 | |
| 1233 | area = vty->index; |
| 1234 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1235 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1236 | interval = atoi (argv[0]); |
| 1237 | area->lsp_gen_interval[0] = interval; |
| 1238 | area->lsp_gen_interval[1] = interval; |
| 1239 | |
| 1240 | return CMD_SUCCESS; |
| 1241 | } |
| 1242 | |
| 1243 | DEFUN (no_lsp_gen_interval, |
| 1244 | no_lsp_gen_interval_cmd, |
| 1245 | "no lsp-gen-interval", |
| 1246 | NO_STR |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1247 | "Minimum interval between regenerating same LSP\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1248 | { |
| 1249 | struct isis_area *area; |
| 1250 | |
| 1251 | area = vty->index; |
| 1252 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1253 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1254 | area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT; |
| 1255 | area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT; |
| 1256 | |
| 1257 | return CMD_SUCCESS; |
| 1258 | } |
| 1259 | |
| 1260 | ALIAS (no_lsp_gen_interval, |
| 1261 | no_lsp_gen_interval_arg_cmd, |
| 1262 | "no lsp-gen-interval <1-120>", |
| 1263 | NO_STR |
| 1264 | "Minimum interval between regenerating same LSP\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1265 | "Minimum interval in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1266 | |
| 1267 | DEFUN (lsp_gen_interval_l1, |
| 1268 | lsp_gen_interval_l1_cmd, |
| 1269 | "lsp-gen-interval level-1 <1-120>", |
| 1270 | "Minimum interval between regenerating same LSP\n" |
| 1271 | "Set interval for level 1 only\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1272 | "Minimum interval in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1273 | { |
| 1274 | struct isis_area *area; |
| 1275 | uint16_t interval; |
| 1276 | |
| 1277 | area = vty->index; |
| 1278 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1279 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1280 | interval = atoi (argv[0]); |
| 1281 | area->lsp_gen_interval[0] = interval; |
| 1282 | |
| 1283 | return CMD_SUCCESS; |
| 1284 | } |
| 1285 | |
| 1286 | DEFUN (no_lsp_gen_interval_l1, |
| 1287 | no_lsp_gen_interval_l1_cmd, |
| 1288 | "no lsp-gen-interval level-1", |
| 1289 | NO_STR |
| 1290 | "Minimum interval between regenerating same LSP\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1291 | "Set interval for level 1 only\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1292 | { |
| 1293 | struct isis_area *area; |
| 1294 | |
| 1295 | area = vty->index; |
| 1296 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1297 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1298 | area->lsp_gen_interval[0] = LSP_GEN_INTERVAL_DEFAULT; |
| 1299 | |
| 1300 | return CMD_SUCCESS; |
| 1301 | } |
| 1302 | |
| 1303 | ALIAS (no_lsp_gen_interval_l1, |
| 1304 | no_lsp_gen_interval_l1_arg_cmd, |
| 1305 | "no lsp-gen-interval level-1 <1-120>", |
| 1306 | NO_STR |
| 1307 | "Minimum interval between regenerating same LSP\n" |
| 1308 | "Set interval for level 1 only\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1309 | "Minimum interval in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1310 | |
| 1311 | DEFUN (lsp_gen_interval_l2, |
| 1312 | lsp_gen_interval_l2_cmd, |
| 1313 | "lsp-gen-interval level-2 <1-120>", |
| 1314 | "Minimum interval between regenerating same LSP\n" |
| 1315 | "Set interval for level 2 only\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1316 | "Minimum interval in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1317 | { |
| 1318 | struct isis_area *area; |
| 1319 | int interval; |
| 1320 | |
| 1321 | area = vty->index; |
| 1322 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1323 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1324 | interval = atoi (argv[0]); |
| 1325 | area->lsp_gen_interval[1] = interval; |
| 1326 | |
| 1327 | return CMD_SUCCESS; |
| 1328 | } |
| 1329 | |
| 1330 | DEFUN (no_lsp_gen_interval_l2, |
| 1331 | no_lsp_gen_interval_l2_cmd, |
| 1332 | "no lsp-gen-interval level-2", |
| 1333 | NO_STR |
| 1334 | "Minimum interval between regenerating same LSP\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1335 | "Set interval for level 2 only\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1336 | { |
| 1337 | struct isis_area *area; |
| 1338 | int interval; |
| 1339 | |
| 1340 | area = vty->index; |
| 1341 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1342 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1343 | interval = atoi (argv[0]); |
| 1344 | area->lsp_gen_interval[1] = LSP_GEN_INTERVAL_DEFAULT; |
| 1345 | |
| 1346 | return CMD_SUCCESS; |
| 1347 | } |
| 1348 | |
| 1349 | ALIAS (no_lsp_gen_interval_l2, |
| 1350 | no_lsp_gen_interval_l2_arg_cmd, |
| 1351 | "no lsp-gen-interval level-2 <1-120>", |
| 1352 | NO_STR |
| 1353 | "Minimum interval between regenerating same LSP\n" |
| 1354 | "Set interval for level 2 only\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1355 | "Minimum interval in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1356 | |
| 1357 | DEFUN (metric_style, |
| 1358 | metric_style_cmd, |
| 1359 | "metric-style (narrow|wide)", |
| 1360 | "Use old-style (ISO 10589) or new-style packet formats\n" |
| 1361 | "Use old style of TLVs with narrow metric\n" |
| 1362 | "Use new style of TLVs to carry wider metric\n") |
| 1363 | { |
| 1364 | struct isis_area *area; |
| 1365 | |
| 1366 | area = vty->index; |
| 1367 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1368 | if (!strcmp (argv[0], "wide")) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1369 | area->newmetric = 1; |
| 1370 | else |
| 1371 | area->newmetric = 0; |
| 1372 | |
| 1373 | return CMD_SUCCESS; |
| 1374 | } |
| 1375 | |
| 1376 | DEFUN (no_metric_style, |
| 1377 | no_metric_style_cmd, |
| 1378 | "no metric-style (narrow|wide)", |
| 1379 | NO_STR |
| 1380 | "Use old-style (ISO 10589) or new-style packet formats\n" |
| 1381 | "Use old style of TLVs with narrow metric\n" |
| 1382 | "Use new style of TLVs to carry wider metric\n") |
| 1383 | { |
| 1384 | struct isis_area *area; |
| 1385 | |
| 1386 | area = vty->index; |
| 1387 | assert (area); |
| 1388 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1389 | if (!strcmp (argv[0], "wide")) |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1390 | area->newmetric = 0; |
| 1391 | else |
| 1392 | area->newmetric = 1; |
| 1393 | |
| 1394 | return CMD_SUCCESS; |
| 1395 | } |
| 1396 | |
| 1397 | DEFUN (dynamic_hostname, |
| 1398 | dynamic_hostname_cmd, |
| 1399 | "hostname dynamic", |
| 1400 | "Dynamic hostname for IS-IS\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1401 | "Dynamic hostname\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1402 | { |
| 1403 | struct isis_area *area; |
| 1404 | |
| 1405 | area = vty->index; |
| 1406 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1407 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1408 | area->dynhostname = 1; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1409 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1410 | return CMD_SUCCESS; |
| 1411 | } |
| 1412 | |
| 1413 | DEFUN (no_dynamic_hostname, |
| 1414 | no_dynamic_hostname_cmd, |
| 1415 | "no hostname dynamic", |
| 1416 | NO_STR |
| 1417 | "Dynamic hostname for IS-IS\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1418 | "Dynamic hostname\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1419 | { |
| 1420 | struct isis_area *area; |
| 1421 | |
| 1422 | area = vty->index; |
| 1423 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1424 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1425 | area->dynhostname = 0; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1426 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1427 | return CMD_SUCCESS; |
| 1428 | } |
| 1429 | |
| 1430 | DEFUN (spf_interval, |
| 1431 | spf_interval_cmd, |
| 1432 | "spf-interval <1-120>", |
hasso | 2097cd8 | 2003-12-23 11:51:08 +0000 | [diff] [blame] | 1433 | "Minimum interval between SPF calculations\n" |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1434 | "Minimum interval between consecutive SPFs in seconds\n") |
| 1435 | { |
| 1436 | struct isis_area *area; |
| 1437 | u_int16_t interval; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1438 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1439 | area = vty->index; |
| 1440 | interval = atoi (argv[0]); |
| 1441 | area->min_spf_interval[0] = interval; |
| 1442 | area->min_spf_interval[1] = interval; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1443 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1444 | return CMD_SUCCESS; |
| 1445 | } |
| 1446 | |
| 1447 | DEFUN (no_spf_interval, |
| 1448 | no_spf_interval_cmd, |
| 1449 | "no spf-interval", |
| 1450 | NO_STR |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1451 | "Minimum interval between SPF calculations\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1452 | { |
| 1453 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1454 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1455 | area = vty->index; |
| 1456 | |
| 1457 | area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL; |
| 1458 | area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1459 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1460 | return CMD_SUCCESS; |
| 1461 | } |
| 1462 | |
| 1463 | ALIAS (no_spf_interval, |
| 1464 | no_spf_interval_arg_cmd, |
| 1465 | "no spf-interval <1-120>", |
| 1466 | NO_STR |
| 1467 | "Minimum interval between SPF calculations\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1468 | "Minimum interval between consecutive SPFs in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1469 | |
| 1470 | DEFUN (spf_interval_l1, |
| 1471 | spf_interval_l1_cmd, |
| 1472 | "spf-interval level-1 <1-120>", |
| 1473 | "Minimum interval between SPF calculations\n" |
| 1474 | "Set interval for level 1 only\n" |
| 1475 | "Minimum interval between consecutive SPFs in seconds\n") |
| 1476 | { |
| 1477 | struct isis_area *area; |
| 1478 | u_int16_t interval; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1479 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1480 | area = vty->index; |
| 1481 | interval = atoi (argv[0]); |
| 1482 | area->min_spf_interval[0] = interval; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1483 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1484 | return CMD_SUCCESS; |
| 1485 | } |
| 1486 | |
| 1487 | DEFUN (no_spf_interval_l1, |
| 1488 | no_spf_interval_l1_cmd, |
| 1489 | "no spf-interval level-1", |
| 1490 | NO_STR |
| 1491 | "Minimum interval between SPF calculations\n" |
| 1492 | "Set interval for level 1 only\n") |
| 1493 | { |
| 1494 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1495 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1496 | area = vty->index; |
| 1497 | |
| 1498 | area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1499 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1500 | return CMD_SUCCESS; |
| 1501 | } |
| 1502 | |
| 1503 | ALIAS (no_spf_interval, |
| 1504 | no_spf_interval_l1_arg_cmd, |
| 1505 | "no spf-interval level-1 <1-120>", |
| 1506 | NO_STR |
| 1507 | "Minimum interval between SPF calculations\n" |
| 1508 | "Set interval for level 1 only\n" |
| 1509 | "Minimum interval between consecutive SPFs in seconds\n") |
| 1510 | |
| 1511 | DEFUN (spf_interval_l2, |
| 1512 | spf_interval_l2_cmd, |
| 1513 | "spf-interval level-2 <1-120>", |
| 1514 | "Minimum interval between SPF calculations\n" |
| 1515 | "Set interval for level 2 only\n" |
| 1516 | "Minimum interval between consecutive SPFs in seconds\n") |
| 1517 | { |
| 1518 | struct isis_area *area; |
| 1519 | u_int16_t interval; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1520 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1521 | area = vty->index; |
| 1522 | interval = atoi (argv[0]); |
| 1523 | area->min_spf_interval[1] = interval; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1524 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1525 | return CMD_SUCCESS; |
| 1526 | } |
| 1527 | |
| 1528 | DEFUN (no_spf_interval_l2, |
| 1529 | no_spf_interval_l2_cmd, |
| 1530 | "no spf-interval level-2", |
| 1531 | NO_STR |
| 1532 | "Minimum interval between SPF calculations\n" |
| 1533 | "Set interval for level 2 only\n") |
| 1534 | { |
| 1535 | struct isis_area *area; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1536 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1537 | area = vty->index; |
| 1538 | |
| 1539 | area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1540 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1541 | return CMD_SUCCESS; |
| 1542 | } |
| 1543 | |
| 1544 | ALIAS (no_spf_interval, |
| 1545 | no_spf_interval_l2_arg_cmd, |
| 1546 | "no spf-interval level-2 <1-120>", |
| 1547 | NO_STR |
| 1548 | "Minimum interval between SPF calculations\n" |
| 1549 | "Set interval for level 2 only\n" |
| 1550 | "Minimum interval between consecutive SPFs in seconds\n") |
| 1551 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1552 | #ifdef TOPOLOGY_GENERATE |
| 1553 | DEFUN (topology_generate_grid, |
| 1554 | topology_generate_grid_cmd, |
| 1555 | "topology generate grid <1-100> <1-100> <1-65000> [param] [param] " |
| 1556 | "[param]", |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1557 | "Topology generation for IS-IS\n" |
| 1558 | "Topology generation\n" |
| 1559 | "Grid topology\n" |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1560 | "X parameter of the grid\n" |
| 1561 | "Y parameter of the grid\n" |
| 1562 | "Random seed\n" |
| 1563 | "Optional param 1\n" |
| 1564 | "Optional param 2\n" |
| 1565 | "Optional param 3\n" |
| 1566 | "Topology\n") |
| 1567 | { |
| 1568 | struct isis_area *area; |
| 1569 | |
| 1570 | area = vty->index; |
| 1571 | assert (area); |
| 1572 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1573 | if (!spgrid_check_params (vty, argc, argv)) |
| 1574 | { |
| 1575 | if (area->topology) |
| 1576 | list_delete (area->topology); |
| 1577 | area->topology = list_new (); |
| 1578 | memcpy (area->top_params, vty->buf, 200); |
| 1579 | gen_spgrid_topology (vty, area->topology); |
| 1580 | remove_topology_lsps (area); |
| 1581 | generate_topology_lsps (area); |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1582 | /* Regenerate L1 LSP to get two way connection to the generated |
| 1583 | * topology. */ |
| 1584 | lsp_regenerate_schedule (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1585 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1586 | |
| 1587 | return CMD_SUCCESS; |
| 1588 | } |
| 1589 | |
hasso | f695b01 | 2005-04-02 19:03:39 +0000 | [diff] [blame] | 1590 | DEFUN (show_isis_generated_topology, |
| 1591 | show_isis_generated_topology_cmd, |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1592 | "show isis generated-topologies", |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1593 | SHOW_STR |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1594 | "CLNS network information\n" |
| 1595 | "Show generated topologies\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1596 | { |
| 1597 | struct isis_area *area; |
paul | 92c9f22 | 2005-05-25 12:21:13 +0000 | [diff] [blame] | 1598 | struct listnode *node; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1599 | struct listnode *node2; |
| 1600 | struct arc *arc; |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1601 | |
paul | 92c9f22 | 2005-05-25 12:21:13 +0000 | [diff] [blame] | 1602 | for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area)) |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1603 | { |
| 1604 | if (!area->topology) |
| 1605 | continue; |
| 1606 | |
| 1607 | vty_out (vty, "Topology for isis area: %s%s", area->area_tag, |
| 1608 | VTY_NEWLINE); |
| 1609 | vty_out (vty, "From node To node Distance%s", VTY_NEWLINE); |
| 1610 | |
| 1611 | for (ALL_LIST_ELEMENTS_RO (area->topology, node2, arc)) |
| 1612 | vty_out (vty, "%9ld %11ld %12ld%s", arc->from_node, arc->to_node, |
| 1613 | arc->distance, VTY_NEWLINE); |
| 1614 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1615 | return CMD_SUCCESS; |
| 1616 | } |
| 1617 | |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1618 | /* Base IS for topology generation. */ |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1619 | DEFUN (topology_baseis, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1620 | topology_baseis_cmd, |
| 1621 | "topology base-is WORD", |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1622 | "Topology generation for IS-IS\n" |
| 1623 | "A Network IS Base for this topology\n" |
| 1624 | "XXXX.XXXX.XXXX Network entity title (NET)\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1625 | { |
| 1626 | struct isis_area *area; |
| 1627 | u_char buff[ISIS_SYS_ID_LEN]; |
| 1628 | |
| 1629 | area = vty->index; |
| 1630 | assert (area); |
| 1631 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1632 | if (sysid2buff (buff, argv[0])) |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1633 | sysid2buff (area->topology_baseis, argv[0]); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1634 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1635 | return CMD_SUCCESS; |
| 1636 | } |
| 1637 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1638 | DEFUN (no_topology_baseis, |
| 1639 | no_topology_baseis_cmd, |
| 1640 | "no topology base-is WORD", |
| 1641 | NO_STR |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1642 | "Topology generation for IS-IS\n" |
| 1643 | "A Network IS Base for this topology\n" |
| 1644 | "XXXX.XXXX.XXXX Network entity title (NET)\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1645 | { |
| 1646 | struct isis_area *area; |
| 1647 | |
| 1648 | area = vty->index; |
| 1649 | assert (area); |
| 1650 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1651 | memcpy (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, ISIS_SYS_ID_LEN); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1652 | return CMD_SUCCESS; |
| 1653 | } |
| 1654 | |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1655 | ALIAS (no_topology_baseis, |
| 1656 | no_topology_baseis_noid_cmd, |
| 1657 | "no topology base-is", |
| 1658 | NO_STR |
| 1659 | "Topology generation for IS-IS\n" |
| 1660 | "A Network IS Base for this topology\n") |
| 1661 | |
| 1662 | DEFUN (topology_basedynh, |
| 1663 | topology_basedynh_cmd, |
| 1664 | "topology base-dynh WORD", |
| 1665 | "Topology generation for IS-IS\n" |
| 1666 | "Dynamic hostname base for this topology\n" |
| 1667 | "Dynamic hostname base\n") |
| 1668 | { |
| 1669 | struct isis_area *area; |
| 1670 | |
| 1671 | area = vty->index; |
| 1672 | assert (area); |
| 1673 | |
| 1674 | /* I hope that it's enough. */ |
| 1675 | area->topology_basedynh = strndup (argv[0], 16); |
| 1676 | return CMD_SUCCESS; |
| 1677 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1678 | #endif /* TOPOLOGY_GENERATE */ |
| 1679 | |
| 1680 | DEFUN (lsp_lifetime, |
| 1681 | lsp_lifetime_cmd, |
| 1682 | "lsp-lifetime <380-65535>", |
| 1683 | "Maximum LSP lifetime\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1684 | "LSP lifetime in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1685 | { |
| 1686 | struct isis_area *area; |
| 1687 | uint16_t interval; |
| 1688 | |
| 1689 | area = vty->index; |
| 1690 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1691 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1692 | interval = atoi (argv[0]); |
| 1693 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1694 | if (interval < ISIS_MIN_LSP_LIFETIME) |
| 1695 | { |
| 1696 | vty_out (vty, "LSP lifetime (%us) below %us%s", |
| 1697 | interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1698 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1699 | return CMD_WARNING; |
| 1700 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1701 | |
| 1702 | |
| 1703 | area->max_lsp_lifetime[0] = interval; |
| 1704 | area->max_lsp_lifetime[1] = interval; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1705 | area->lsp_refresh[0] = interval - 300; |
| 1706 | area->lsp_refresh[1] = interval - 300; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1707 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1708 | if (area->t_lsp_refresh[0]) |
| 1709 | { |
| 1710 | thread_cancel (area->t_lsp_refresh[0]); |
| 1711 | thread_execute (master, lsp_refresh_l1, area, 0); |
| 1712 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1713 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1714 | if (area->t_lsp_refresh[1]) |
| 1715 | { |
| 1716 | thread_cancel (area->t_lsp_refresh[1]); |
| 1717 | thread_execute (master, lsp_refresh_l2, area, 0); |
| 1718 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1719 | |
| 1720 | |
| 1721 | return CMD_SUCCESS; |
| 1722 | } |
| 1723 | |
| 1724 | DEFUN (no_lsp_lifetime, |
| 1725 | no_lsp_lifetime_cmd, |
| 1726 | "no lsp-lifetime", |
| 1727 | NO_STR |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1728 | "LSP lifetime in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1729 | { |
| 1730 | struct isis_area *area; |
| 1731 | |
| 1732 | area = vty->index; |
| 1733 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1734 | |
| 1735 | area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */ |
| 1736 | area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */ |
| 1737 | area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */ |
| 1738 | area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1739 | |
| 1740 | return CMD_SUCCESS; |
| 1741 | } |
| 1742 | |
| 1743 | ALIAS (no_lsp_lifetime, |
| 1744 | no_lsp_lifetime_arg_cmd, |
| 1745 | "no lsp-lifetime <380-65535>", |
| 1746 | NO_STR |
| 1747 | "Maximum LSP lifetime\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1748 | "LSP lifetime in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1749 | |
| 1750 | DEFUN (lsp_lifetime_l1, |
| 1751 | lsp_lifetime_l1_cmd, |
| 1752 | "lsp-lifetime level-1 <380-65535>", |
| 1753 | "Maximum LSP lifetime for Level 1 only\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1754 | "LSP lifetime for Level 1 only in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1755 | { |
| 1756 | struct isis_area *area; |
| 1757 | uint16_t interval; |
| 1758 | |
| 1759 | area = vty->index; |
| 1760 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1761 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1762 | interval = atoi (argv[0]); |
| 1763 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1764 | if (interval < ISIS_MIN_LSP_LIFETIME) |
| 1765 | { |
| 1766 | vty_out (vty, "Level-1 LSP lifetime (%us) below %us%s", |
| 1767 | interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1768 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1769 | return CMD_WARNING; |
| 1770 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1771 | |
| 1772 | |
| 1773 | area->max_lsp_lifetime[0] = interval; |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1774 | area->lsp_refresh[0] = interval - 300; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1775 | |
| 1776 | return CMD_SUCCESS; |
| 1777 | } |
| 1778 | |
| 1779 | DEFUN (no_lsp_lifetime_l1, |
| 1780 | no_lsp_lifetime_l1_cmd, |
| 1781 | "no lsp-lifetime level-1", |
| 1782 | NO_STR |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1783 | "LSP lifetime for Level 1 only in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1784 | { |
| 1785 | struct isis_area *area; |
| 1786 | |
| 1787 | area = vty->index; |
| 1788 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1789 | |
| 1790 | area->max_lsp_lifetime[0] = MAX_AGE; /* 1200s */ |
| 1791 | area->lsp_refresh[0] = MAX_LSP_GEN_INTERVAL; /* 900s */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1792 | |
| 1793 | return CMD_SUCCESS; |
| 1794 | } |
| 1795 | |
| 1796 | ALIAS (no_lsp_lifetime_l1, |
| 1797 | no_lsp_lifetime_l1_arg_cmd, |
| 1798 | "no lsp-lifetime level-1 <380-65535>", |
| 1799 | NO_STR |
| 1800 | "Maximum LSP lifetime for Level 1 only\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1801 | "LSP lifetime for Level 1 only in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1802 | |
| 1803 | DEFUN (lsp_lifetime_l2, |
| 1804 | lsp_lifetime_l2_cmd, |
| 1805 | "lsp-lifetime level-2 <380-65535>", |
| 1806 | "Maximum LSP lifetime for Level 2 only\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1807 | "LSP lifetime for Level 2 only in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1808 | { |
| 1809 | struct isis_area *area; |
| 1810 | uint16_t interval; |
| 1811 | |
| 1812 | area = vty->index; |
| 1813 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1814 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1815 | interval = atoi (argv[0]); |
| 1816 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1817 | if (interval < ISIS_MIN_LSP_LIFETIME) |
| 1818 | { |
| 1819 | vty_out (vty, "Level-2 LSP lifetime (%us) below %us%s", |
| 1820 | interval, ISIS_MIN_LSP_LIFETIME, VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1821 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1822 | return CMD_WARNING; |
| 1823 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1824 | |
| 1825 | area->max_lsp_lifetime[1] = interval; |
| 1826 | area->lsp_refresh[1] = interval - 300; |
| 1827 | |
| 1828 | return CMD_SUCCESS; |
| 1829 | } |
| 1830 | |
| 1831 | DEFUN (no_lsp_lifetime_l2, |
| 1832 | no_lsp_lifetime_l2_cmd, |
| 1833 | "no lsp-lifetime level-2", |
| 1834 | NO_STR |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1835 | "LSP lifetime for Level 2 only in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1836 | { |
| 1837 | struct isis_area *area; |
| 1838 | |
| 1839 | area = vty->index; |
| 1840 | assert (area); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1841 | |
| 1842 | area->max_lsp_lifetime[1] = MAX_AGE; /* 1200s */ |
| 1843 | area->lsp_refresh[1] = MAX_LSP_GEN_INTERVAL; /* 900s */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1844 | |
| 1845 | return CMD_SUCCESS; |
| 1846 | } |
| 1847 | |
| 1848 | ALIAS (no_lsp_lifetime_l2, |
| 1849 | no_lsp_lifetime_l2_arg_cmd, |
| 1850 | "no lsp-lifetime level-2 <380-65535>", |
| 1851 | NO_STR |
| 1852 | "Maximum LSP lifetime for Level 2 only\n" |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1853 | "LSP lifetime for Level 2 only in seconds\n") |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1854 | |
| 1855 | /* IS-IS configuration write function */ |
| 1856 | int |
| 1857 | isis_config_write (struct vty *vty) |
| 1858 | { |
| 1859 | int write = 0; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1860 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1861 | if (isis != NULL) |
| 1862 | { |
| 1863 | struct isis_area *area; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1864 | struct listnode *node, *nnode; |
| 1865 | struct listnode *node2, *nnode2; |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1866 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1867 | for (ALL_LIST_ELEMENTS (isis->area_list, node, nnode, area)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1868 | { |
| 1869 | /* ISIS - Area name */ |
| 1870 | vty_out (vty, "router isis %s%s", area->area_tag, VTY_NEWLINE); |
| 1871 | write++; |
| 1872 | /* ISIS - Net */ |
| 1873 | if (listcount (area->area_addrs) > 0) |
| 1874 | { |
| 1875 | struct area_addr *area_addr; |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1876 | for (ALL_LIST_ELEMENTS (area->area_addrs, node2, nnode2, area_addr)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1877 | { |
| 1878 | vty_out (vty, " net %s%s", |
| 1879 | isonet_print (area_addr->area_addr, |
| 1880 | area_addr->addr_len + ISIS_SYS_ID_LEN + |
| 1881 | 1), VTY_NEWLINE); |
| 1882 | write++; |
| 1883 | } |
| 1884 | } |
| 1885 | /* ISIS - Dynamic hostname - Defaults to true so only display if false */ |
| 1886 | if (!area->dynhostname) |
| 1887 | { |
| 1888 | vty_out (vty, " no hostname dynamic%s", VTY_NEWLINE); |
| 1889 | write++; |
| 1890 | } |
| 1891 | /* ISIS - Metric-Style - when true displays wide */ |
| 1892 | if (area->newmetric) |
| 1893 | { |
| 1894 | vty_out (vty, " metric-style wide%s", VTY_NEWLINE); |
| 1895 | write++; |
| 1896 | } |
| 1897 | /* ISIS - Area is-type (level-1-2 is default) */ |
| 1898 | if (area->is_type == IS_LEVEL_1) |
| 1899 | { |
| 1900 | vty_out (vty, " is-type level-1%s", VTY_NEWLINE); |
| 1901 | write++; |
| 1902 | } |
| 1903 | else |
| 1904 | { |
| 1905 | if (area->is_type == IS_LEVEL_2) |
| 1906 | { |
| 1907 | vty_out (vty, " is-type level-2-only%s", VTY_NEWLINE); |
| 1908 | write++; |
| 1909 | } |
| 1910 | } |
| 1911 | /* ISIS - Lsp generation interval */ |
| 1912 | if (area->lsp_gen_interval[0] == area->lsp_gen_interval[1]) |
| 1913 | { |
| 1914 | if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT) |
| 1915 | { |
| 1916 | vty_out (vty, " lsp-gen-interval %d%s", |
| 1917 | area->lsp_gen_interval[0], VTY_NEWLINE); |
| 1918 | write++; |
| 1919 | } |
| 1920 | } |
| 1921 | else |
| 1922 | { |
| 1923 | if (area->lsp_gen_interval[0] != LSP_GEN_INTERVAL_DEFAULT) |
| 1924 | { |
| 1925 | vty_out (vty, " lsp-gen-interval level-1 %d%s", |
| 1926 | area->lsp_gen_interval[0], VTY_NEWLINE); |
| 1927 | write++; |
| 1928 | } |
| 1929 | if (area->lsp_gen_interval[1] != LSP_GEN_INTERVAL_DEFAULT) |
| 1930 | { |
| 1931 | vty_out (vty, " lsp-gen-interval level-2 %d%s", |
| 1932 | area->lsp_gen_interval[1], VTY_NEWLINE); |
| 1933 | write++; |
| 1934 | } |
| 1935 | } |
| 1936 | /* ISIS - LSP lifetime */ |
| 1937 | if (area->max_lsp_lifetime[0] == area->max_lsp_lifetime[1]) |
| 1938 | { |
| 1939 | if (area->max_lsp_lifetime[0] != MAX_AGE) |
| 1940 | { |
| 1941 | vty_out (vty, " lsp-lifetime %u%s", area->max_lsp_lifetime[0], |
| 1942 | VTY_NEWLINE); |
| 1943 | write++; |
| 1944 | } |
| 1945 | } |
| 1946 | else |
| 1947 | { |
| 1948 | if (area->max_lsp_lifetime[0] != MAX_AGE) |
| 1949 | { |
| 1950 | vty_out (vty, " lsp-lifetime level-1 %u%s", |
| 1951 | area->max_lsp_lifetime[0], VTY_NEWLINE); |
| 1952 | write++; |
| 1953 | } |
| 1954 | if (area->max_lsp_lifetime[1] != MAX_AGE) |
| 1955 | { |
| 1956 | vty_out (vty, " lsp-lifetime level-2 %u%s", |
| 1957 | area->max_lsp_lifetime[1], VTY_NEWLINE); |
| 1958 | write++; |
| 1959 | } |
| 1960 | } |
hasso | 53c997c | 2004-09-15 16:21:59 +0000 | [diff] [blame] | 1961 | /* Authentication passwords. */ |
| 1962 | if (area->area_passwd.len > 0) |
| 1963 | { |
hasso | 1cbc562 | 2005-01-01 10:29:51 +0000 | [diff] [blame] | 1964 | vty_out(vty, " area-password %s", area->area_passwd.passwd); |
| 1965 | if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_SEND)) |
| 1966 | { |
| 1967 | vty_out(vty, " authenticate snp "); |
| 1968 | if (CHECK_FLAG(area->area_passwd.snp_auth, SNP_AUTH_RECV)) |
| 1969 | vty_out(vty, "validate"); |
| 1970 | else |
| 1971 | vty_out(vty, "send-only"); |
| 1972 | } |
| 1973 | vty_out(vty, "%s", VTY_NEWLINE); |
hasso | 53c997c | 2004-09-15 16:21:59 +0000 | [diff] [blame] | 1974 | write++; |
| 1975 | } |
| 1976 | if (area->domain_passwd.len > 0) |
| 1977 | { |
hasso | 1cbc562 | 2005-01-01 10:29:51 +0000 | [diff] [blame] | 1978 | vty_out(vty, " domain-password %s", area->domain_passwd.passwd); |
| 1979 | if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_SEND)) |
| 1980 | { |
| 1981 | vty_out(vty, " authenticate snp "); |
| 1982 | if (CHECK_FLAG(area->domain_passwd.snp_auth, SNP_AUTH_RECV)) |
| 1983 | vty_out(vty, "validate"); |
| 1984 | else |
| 1985 | vty_out(vty, "send-only"); |
| 1986 | } |
| 1987 | vty_out(vty, "%s", VTY_NEWLINE); |
hasso | 53c997c | 2004-09-15 16:21:59 +0000 | [diff] [blame] | 1988 | write++; |
| 1989 | } |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1990 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 1991 | #ifdef TOPOLOGY_GENERATE |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 1992 | if (memcmp (area->topology_baseis, DEFAULT_TOPOLOGY_BASEIS, |
| 1993 | ISIS_SYS_ID_LEN)) |
| 1994 | { |
| 1995 | vty_out (vty, " topology base-is %s%s", |
| 1996 | sysid_print (area->topology_baseis), VTY_NEWLINE); |
| 1997 | write++; |
| 1998 | } |
| 1999 | if (area->topology_basedynh) |
| 2000 | { |
| 2001 | vty_out (vty, " topology base-dynh %s%s", |
| 2002 | area->topology_basedynh, VTY_NEWLINE); |
| 2003 | write++; |
| 2004 | } |
| 2005 | /* We save the whole command line here. */ |
| 2006 | if (strlen(area->top_params)) |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2007 | { |
| 2008 | vty_out (vty, " %s%s", area->top_params, VTY_NEWLINE); |
| 2009 | write++; |
| 2010 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2011 | #endif /* TOPOLOGY_GENERATE */ |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 2012 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2013 | } |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2014 | } |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2015 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2016 | return write; |
| 2017 | } |
| 2018 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2019 | struct cmd_node isis_node = { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2020 | ISIS_NODE, |
hasso | 2097cd8 | 2003-12-23 11:51:08 +0000 | [diff] [blame] | 2021 | "%s(config-router)# ", |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2022 | 1 |
| 2023 | }; |
| 2024 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2025 | void |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2026 | isis_init () |
| 2027 | { |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2028 | /* Install IS-IS top node */ |
| 2029 | install_node (&isis_node, isis_config_write); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2030 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2031 | install_element (VIEW_NODE, &show_clns_neighbors_cmd); |
| 2032 | install_element (VIEW_NODE, &show_isis_neighbors_cmd); |
| 2033 | install_element (VIEW_NODE, &show_clns_neighbors_detail_cmd); |
| 2034 | install_element (VIEW_NODE, &show_isis_neighbors_detail_cmd); |
| 2035 | |
| 2036 | install_element (VIEW_NODE, &show_hostname_cmd); |
| 2037 | install_element (VIEW_NODE, &show_database_cmd); |
| 2038 | install_element (VIEW_NODE, &show_database_detail_cmd); |
| 2039 | |
| 2040 | install_element (ENABLE_NODE, &show_clns_neighbors_cmd); |
| 2041 | install_element (ENABLE_NODE, &show_isis_neighbors_cmd); |
| 2042 | install_element (ENABLE_NODE, &show_clns_neighbors_detail_cmd); |
| 2043 | install_element (ENABLE_NODE, &show_isis_neighbors_detail_cmd); |
| 2044 | |
| 2045 | install_element (ENABLE_NODE, &show_hostname_cmd); |
| 2046 | install_element (ENABLE_NODE, &show_database_cmd); |
| 2047 | install_element (ENABLE_NODE, &show_database_detail_cmd); |
| 2048 | install_element (ENABLE_NODE, &show_debugging_cmd); |
| 2049 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2050 | install_node (&debug_node, config_write_debug); |
jardin | 9e867fe | 2003-12-23 08:56:18 +0000 | [diff] [blame] | 2051 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2052 | install_element (ENABLE_NODE, &debug_isis_adj_cmd); |
| 2053 | install_element (ENABLE_NODE, &no_debug_isis_adj_cmd); |
| 2054 | install_element (ENABLE_NODE, &debug_isis_csum_cmd); |
| 2055 | install_element (ENABLE_NODE, &no_debug_isis_csum_cmd); |
| 2056 | install_element (ENABLE_NODE, &debug_isis_lupd_cmd); |
| 2057 | install_element (ENABLE_NODE, &no_debug_isis_lupd_cmd); |
| 2058 | install_element (ENABLE_NODE, &debug_isis_err_cmd); |
| 2059 | install_element (ENABLE_NODE, &no_debug_isis_err_cmd); |
| 2060 | install_element (ENABLE_NODE, &debug_isis_snp_cmd); |
| 2061 | install_element (ENABLE_NODE, &no_debug_isis_snp_cmd); |
| 2062 | install_element (ENABLE_NODE, &debug_isis_upd_cmd); |
| 2063 | install_element (ENABLE_NODE, &no_debug_isis_upd_cmd); |
| 2064 | install_element (ENABLE_NODE, &debug_isis_spfevents_cmd); |
| 2065 | install_element (ENABLE_NODE, &no_debug_isis_spfevents_cmd); |
| 2066 | install_element (ENABLE_NODE, &debug_isis_spfstats_cmd); |
| 2067 | install_element (ENABLE_NODE, &no_debug_isis_spfstats_cmd); |
| 2068 | install_element (ENABLE_NODE, &debug_isis_spftrigg_cmd); |
| 2069 | install_element (ENABLE_NODE, &no_debug_isis_spftrigg_cmd); |
| 2070 | install_element (ENABLE_NODE, &debug_isis_rtevents_cmd); |
| 2071 | install_element (ENABLE_NODE, &no_debug_isis_rtevents_cmd); |
| 2072 | install_element (ENABLE_NODE, &debug_isis_events_cmd); |
| 2073 | install_element (ENABLE_NODE, &no_debug_isis_events_cmd); |
| 2074 | |
jardin | 9e867fe | 2003-12-23 08:56:18 +0000 | [diff] [blame] | 2075 | install_element (CONFIG_NODE, &debug_isis_adj_cmd); |
| 2076 | install_element (CONFIG_NODE, &no_debug_isis_adj_cmd); |
| 2077 | install_element (CONFIG_NODE, &debug_isis_csum_cmd); |
| 2078 | install_element (CONFIG_NODE, &no_debug_isis_csum_cmd); |
| 2079 | install_element (CONFIG_NODE, &debug_isis_lupd_cmd); |
| 2080 | install_element (CONFIG_NODE, &no_debug_isis_lupd_cmd); |
| 2081 | install_element (CONFIG_NODE, &debug_isis_err_cmd); |
| 2082 | install_element (CONFIG_NODE, &no_debug_isis_err_cmd); |
| 2083 | install_element (CONFIG_NODE, &debug_isis_snp_cmd); |
| 2084 | install_element (CONFIG_NODE, &no_debug_isis_snp_cmd); |
| 2085 | install_element (CONFIG_NODE, &debug_isis_upd_cmd); |
| 2086 | install_element (CONFIG_NODE, &no_debug_isis_upd_cmd); |
| 2087 | install_element (CONFIG_NODE, &debug_isis_spfevents_cmd); |
| 2088 | install_element (CONFIG_NODE, &no_debug_isis_spfevents_cmd); |
| 2089 | install_element (CONFIG_NODE, &debug_isis_spfstats_cmd); |
| 2090 | install_element (CONFIG_NODE, &no_debug_isis_spfstats_cmd); |
| 2091 | install_element (CONFIG_NODE, &debug_isis_spftrigg_cmd); |
| 2092 | install_element (CONFIG_NODE, &no_debug_isis_spftrigg_cmd); |
| 2093 | install_element (CONFIG_NODE, &debug_isis_rtevents_cmd); |
| 2094 | install_element (CONFIG_NODE, &no_debug_isis_rtevents_cmd); |
| 2095 | install_element (CONFIG_NODE, &debug_isis_events_cmd); |
| 2096 | install_element (CONFIG_NODE, &no_debug_isis_events_cmd); |
| 2097 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2098 | install_element (CONFIG_NODE, &router_isis_cmd); |
| 2099 | install_element (CONFIG_NODE, &no_router_isis_cmd); |
| 2100 | |
| 2101 | install_default (ISIS_NODE); |
| 2102 | |
| 2103 | install_element (ISIS_NODE, &net_cmd); |
| 2104 | install_element (ISIS_NODE, &no_net_cmd); |
| 2105 | |
| 2106 | install_element (ISIS_NODE, &is_type_cmd); |
| 2107 | install_element (ISIS_NODE, &no_is_type_cmd); |
| 2108 | |
| 2109 | install_element (ISIS_NODE, &area_passwd_cmd); |
hasso | 1cbc562 | 2005-01-01 10:29:51 +0000 | [diff] [blame] | 2110 | install_element (ISIS_NODE, &area_passwd_snpauth_cmd); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2111 | install_element (ISIS_NODE, &no_area_passwd_cmd); |
| 2112 | |
| 2113 | install_element (ISIS_NODE, &domain_passwd_cmd); |
hasso | 1cbc562 | 2005-01-01 10:29:51 +0000 | [diff] [blame] | 2114 | install_element (ISIS_NODE, &domain_passwd_snpauth_cmd); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2115 | install_element (ISIS_NODE, &no_domain_passwd_cmd); |
| 2116 | |
| 2117 | install_element (ISIS_NODE, &lsp_gen_interval_cmd); |
| 2118 | install_element (ISIS_NODE, &no_lsp_gen_interval_cmd); |
| 2119 | install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd); |
| 2120 | install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd); |
| 2121 | install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd); |
| 2122 | install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd); |
| 2123 | install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd); |
| 2124 | install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd); |
| 2125 | install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd); |
| 2126 | |
| 2127 | install_element (ISIS_NODE, &spf_interval_cmd); |
| 2128 | install_element (ISIS_NODE, &no_spf_interval_cmd); |
| 2129 | install_element (ISIS_NODE, &no_spf_interval_arg_cmd); |
| 2130 | install_element (ISIS_NODE, &spf_interval_l1_cmd); |
| 2131 | install_element (ISIS_NODE, &no_spf_interval_l1_cmd); |
| 2132 | install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd); |
| 2133 | install_element (ISIS_NODE, &spf_interval_l2_cmd); |
| 2134 | install_element (ISIS_NODE, &no_spf_interval_l2_cmd); |
| 2135 | install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd); |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2136 | |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2137 | install_element (ISIS_NODE, &lsp_lifetime_cmd); |
| 2138 | install_element (ISIS_NODE, &no_lsp_lifetime_cmd); |
| 2139 | install_element (ISIS_NODE, &no_lsp_lifetime_arg_cmd); |
| 2140 | install_element (ISIS_NODE, &lsp_lifetime_l1_cmd); |
| 2141 | install_element (ISIS_NODE, &no_lsp_lifetime_l1_cmd); |
| 2142 | install_element (ISIS_NODE, &no_lsp_lifetime_l1_arg_cmd); |
| 2143 | install_element (ISIS_NODE, &lsp_lifetime_l2_cmd); |
| 2144 | install_element (ISIS_NODE, &no_lsp_lifetime_l2_cmd); |
| 2145 | install_element (ISIS_NODE, &no_lsp_lifetime_l2_arg_cmd); |
| 2146 | |
| 2147 | install_element (ISIS_NODE, &dynamic_hostname_cmd); |
| 2148 | install_element (ISIS_NODE, &no_dynamic_hostname_cmd); |
| 2149 | |
| 2150 | install_element (ISIS_NODE, &metric_style_cmd); |
| 2151 | install_element (ISIS_NODE, &no_metric_style_cmd); |
| 2152 | #ifdef TOPOLOGY_GENERATE |
| 2153 | install_element (ISIS_NODE, &topology_generate_grid_cmd); |
| 2154 | install_element (ISIS_NODE, &topology_baseis_cmd); |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 2155 | install_element (ISIS_NODE, &topology_basedynh_cmd); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2156 | install_element (ISIS_NODE, &no_topology_baseis_cmd); |
hasso | f1082d1 | 2005-09-19 04:23:34 +0000 | [diff] [blame] | 2157 | install_element (ISIS_NODE, &no_topology_baseis_noid_cmd); |
hasso | f695b01 | 2005-04-02 19:03:39 +0000 | [diff] [blame] | 2158 | install_element (VIEW_NODE, &show_isis_generated_topology_cmd); |
| 2159 | install_element (ENABLE_NODE, &show_isis_generated_topology_cmd); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2160 | #endif /* TOPOLOGY_GENERATE */ |
| 2161 | |
hasso | f390d2c | 2004-09-10 20:48:21 +0000 | [diff] [blame] | 2162 | isis_new (0); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2163 | isis_circuit_init (); |
| 2164 | isis_zebra_init (); |
| 2165 | isis_spf_cmds_init (); |
| 2166 | } |