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