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