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