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