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