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