jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1 | /* |
| 2 | * IS-IS Rout(e)ing protocol - isis_circuit.h |
| 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 | #include <stdlib.h> |
| 23 | #include <stdio.h> |
| 24 | #include <ctype.h> |
| 25 | #include <zebra.h> |
hasso | 37da8c0 | 2004-05-19 11:38:40 +0000 | [diff] [blame] | 26 | #ifdef GNU_LINUX |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 27 | #include <net/ethernet.h> |
hasso | 37da8c0 | 2004-05-19 11:38:40 +0000 | [diff] [blame] | 28 | #else |
| 29 | #include <netinet/if_ether.h> |
| 30 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 31 | |
| 32 | #include "log.h" |
| 33 | #include "memory.h" |
| 34 | #include "if.h" |
| 35 | #include "linklist.h" |
| 36 | #include "command.h" |
| 37 | #include "thread.h" |
| 38 | #include "hash.h" |
| 39 | #include "prefix.h" |
| 40 | #include "stream.h" |
| 41 | |
| 42 | #include "isisd/dict.h" |
| 43 | #include "isisd/include-netbsd/iso.h" |
| 44 | #include "isisd/isis_constants.h" |
| 45 | #include "isisd/isis_common.h" |
| 46 | #include "isisd/isis_circuit.h" |
| 47 | #include "isisd/isis_tlv.h" |
| 48 | #include "isisd/isis_lsp.h" |
| 49 | #include "isisd/isis_pdu.h" |
| 50 | #include "isisd/isis_network.h" |
| 51 | #include "isisd/isis_misc.h" |
| 52 | #include "isisd/isis_constants.h" |
| 53 | #include "isisd/isis_adjacency.h" |
| 54 | #include "isisd/isis_dr.h" |
| 55 | #include "isisd/isis_flags.h" |
| 56 | #include "isisd/isisd.h" |
| 57 | #include "isisd/isis_csm.h" |
| 58 | #include "isisd/isis_events.h" |
| 59 | |
| 60 | extern struct thread_master *master; |
| 61 | extern struct isis *isis; |
| 62 | |
| 63 | struct isis_circuit * |
| 64 | isis_circuit_new () |
| 65 | { |
| 66 | struct isis_circuit *circuit; |
| 67 | int i; |
| 68 | |
| 69 | circuit = XMALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit)); |
| 70 | if (circuit) { |
| 71 | memset (circuit, 0, sizeof (struct isis_circuit)); |
| 72 | /* set default metrics for circuit */ |
| 73 | for (i = 0; i < 2; i++) { |
| 74 | circuit->metrics[i].metric_default = DEFAULT_CIRCUIT_METRICS; |
| 75 | circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED; |
| 76 | circuit->metrics[i].metric_error = METRICS_UNSUPPORTED; |
| 77 | circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED; |
| 78 | } |
| 79 | } else { |
| 80 | zlog_err ("Can't malloc isis circuit"); |
| 81 | return NULL; |
| 82 | } |
| 83 | |
| 84 | return circuit; |
| 85 | } |
| 86 | |
| 87 | |
| 88 | void |
| 89 | isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area) |
| 90 | { |
| 91 | int i; |
| 92 | circuit->area = area; |
| 93 | /* |
| 94 | * The level for the circuit is same as for the area, unless configured |
| 95 | * otherwise. |
| 96 | */ |
| 97 | circuit->circuit_is_type = area->is_type; |
| 98 | /* |
| 99 | * Default values |
| 100 | */ |
| 101 | for (i = 0; i < 2; i++) { |
| 102 | circuit->hello_interval[i] = HELLO_INTERVAL; |
| 103 | circuit->hello_multiplier[i] = HELLO_MULTIPLIER; |
| 104 | circuit->csnp_interval[i] = CSNP_INTERVAL; |
| 105 | circuit->psnp_interval[i] = PSNP_INTERVAL; |
| 106 | circuit->u.bc.priority[i] = DEFAULT_PRIORITY; |
| 107 | } |
| 108 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) { |
| 109 | circuit->u.bc.adjdb[0] = list_new (); |
| 110 | circuit->u.bc.adjdb[1] = list_new (); |
| 111 | circuit->u.bc.pad_hellos = 1; |
| 112 | } |
| 113 | circuit->lsp_interval = LSP_INTERVAL; |
| 114 | |
| 115 | /* |
| 116 | * Add the circuit into area |
| 117 | */ |
| 118 | listnode_add (area->circuit_list, circuit); |
| 119 | |
| 120 | circuit->idx = flags_get_index (&area->flags); |
| 121 | circuit->lsp_queue = list_new (); |
| 122 | |
| 123 | return; |
| 124 | } |
| 125 | |
| 126 | void |
| 127 | isis_circuit_deconfigure (struct isis_circuit *circuit, |
| 128 | struct isis_area *area) |
| 129 | { |
| 130 | |
| 131 | /* Remove circuit from area */ |
| 132 | listnode_delete (area->circuit_list, circuit); |
| 133 | /* Free the index of SRM and SSN flags */ |
| 134 | flags_free_index (&area->flags, circuit->idx); |
| 135 | |
| 136 | return; |
| 137 | } |
| 138 | |
| 139 | struct isis_circuit * |
| 140 | circuit_lookup_by_ifp (struct interface *ifp, struct list *list) |
| 141 | { |
| 142 | struct isis_circuit *circuit = NULL; |
| 143 | struct listnode *node; |
| 144 | |
| 145 | if (!list) |
| 146 | return NULL; |
| 147 | |
| 148 | for (node = listhead (list); node; nextnode (node)) { |
| 149 | circuit = getdata (node); |
| 150 | if (circuit->interface == ifp) |
| 151 | return circuit; |
| 152 | } |
| 153 | |
| 154 | return NULL; |
| 155 | } |
| 156 | |
| 157 | struct isis_circuit * |
| 158 | circuit_scan_by_ifp (struct interface *ifp) |
| 159 | { |
| 160 | struct isis_area *area; |
| 161 | struct listnode *node; |
| 162 | struct isis_circuit *circuit; |
| 163 | |
| 164 | if (!isis->area_list) |
| 165 | return NULL; |
| 166 | |
| 167 | for (node = listhead (isis->area_list); node; nextnode (node)) { |
| 168 | area = getdata (node); |
| 169 | circuit = circuit_lookup_by_ifp (ifp, area->circuit_list); |
| 170 | if (circuit) |
| 171 | return circuit; |
| 172 | } |
| 173 | |
| 174 | return circuit_lookup_by_ifp (ifp, isis->init_circ_list); |
| 175 | } |
| 176 | |
| 177 | void |
| 178 | isis_circuit_del (struct isis_circuit *circuit) |
| 179 | { |
| 180 | |
| 181 | if (!circuit) |
| 182 | return; |
| 183 | |
| 184 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) { |
| 185 | /* destroy adjacency databases */ |
| 186 | list_delete (circuit->u.bc.adjdb[0]); |
| 187 | list_delete (circuit->u.bc.adjdb[1]); |
| 188 | /* destroy neighbour lists */ |
| 189 | if (circuit->u.bc.lan_neighs[0]) |
| 190 | list_delete (circuit->u.bc.lan_neighs[0]); |
| 191 | if (circuit->u.bc.lan_neighs[1]) |
| 192 | list_delete (circuit->u.bc.lan_neighs[1]); |
| 193 | /* destroy addresses */ |
| 194 | } |
| 195 | if (circuit->ip_addrs) |
| 196 | list_delete (circuit->ip_addrs); |
| 197 | #ifdef HAVE_IPV6 |
| 198 | if (circuit->ipv6_link) |
| 199 | list_delete (circuit->ipv6_link); |
| 200 | if (circuit->ipv6_non_link) |
| 201 | list_delete (circuit->ipv6_non_link); |
| 202 | #endif /* HAVE_IPV6 */ |
| 203 | |
| 204 | /* and lastly the circuit itself */ |
| 205 | XFREE (MTYPE_ISIS_CIRCUIT, circuit); |
| 206 | |
| 207 | return; |
| 208 | } |
| 209 | |
| 210 | void |
| 211 | isis_circuit_add_addr (struct isis_circuit *circuit, |
| 212 | struct connected *conn) |
| 213 | { |
| 214 | struct prefix_ipv4 *ipv4; |
| 215 | u_char buf [BUFSIZ]; |
| 216 | #ifdef HAVE_IPV6 |
| 217 | struct prefix_ipv6 *ipv6; |
| 218 | #endif /* HAVE_IPV6 */ |
| 219 | if (!circuit->ip_addrs) { |
| 220 | circuit->ip_addrs = list_new (); |
| 221 | } |
| 222 | #ifdef HAVE_IPV6 |
| 223 | if (!circuit->ipv6_link) { |
| 224 | circuit->ipv6_link = list_new (); |
| 225 | } |
| 226 | if (!circuit->ipv6_non_link) { |
| 227 | circuit->ipv6_non_link = list_new (); |
| 228 | } |
| 229 | #endif /* HAVE_IPV6 */ |
| 230 | |
| 231 | memset (&buf, 0, BUFSIZ); |
| 232 | if (conn->address->family == AF_INET) { |
| 233 | ipv4 = prefix_ipv4_new (); |
| 234 | ipv4->prefixlen = conn->address->prefixlen; |
| 235 | ipv4->prefix = conn->address->u.prefix4; |
| 236 | listnode_add (circuit->ip_addrs, ipv4); |
| 237 | prefix2str (conn->address, buf, BUFSIZ); |
| 238 | #ifdef EXTREME_DEBUG |
| 239 | zlog_info ("Added IP address %s to circuit %d", buf, |
| 240 | circuit->circuit_id); |
| 241 | #endif /* EXTREME_DEBUG */ |
| 242 | } |
| 243 | #ifdef HAVE_IPV6 |
| 244 | if (conn->address->family == AF_INET6) { |
| 245 | ipv6 = prefix_ipv6_new (); |
| 246 | ipv6->prefixlen = conn->address->prefixlen; |
| 247 | ipv6->prefix = conn->address->u.prefix6; |
| 248 | if (IN6_IS_ADDR_LINKLOCAL(&ipv6->prefix)) { |
| 249 | listnode_add (circuit->ipv6_link, ipv6); |
| 250 | } else { |
| 251 | listnode_add (circuit->ipv6_non_link, ipv6); |
| 252 | } |
| 253 | prefix2str (conn->address, buf, BUFSIZ); |
| 254 | #ifdef EXTREME_DEBUG |
| 255 | zlog_info ("Added IPv6 address %s to circuit %d", buf, |
| 256 | circuit->circuit_id); |
| 257 | #endif /* EXTREME_DEBUG */ |
| 258 | } |
| 259 | #endif /* HAVE_IPV6 */ |
| 260 | |
| 261 | |
| 262 | return; |
| 263 | } |
| 264 | |
| 265 | void |
| 266 | isis_circuit_del_addr (struct isis_circuit *circuit, |
| 267 | struct connected *connected) |
| 268 | { |
| 269 | |
| 270 | } |
| 271 | |
| 272 | void |
| 273 | isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp) |
| 274 | { |
| 275 | struct listnode *node; |
| 276 | struct connected *conn; |
| 277 | |
| 278 | circuit->interface = ifp; |
| 279 | ifp->info = circuit; |
| 280 | |
| 281 | circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */ |
| 282 | |
| 283 | /* isis_circuit_update_addrs (circuit, ifp); */ |
| 284 | |
| 285 | if (if_is_broadcast (ifp)) { |
| 286 | circuit->circ_type = CIRCUIT_T_BROADCAST; |
| 287 | /* |
| 288 | * Get the Hardware Address |
| 289 | */ |
| 290 | #ifdef HAVE_SOCKADDR_DL |
| 291 | if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN) |
| 292 | zlog_warn ("unsupported link layer"); |
| 293 | else |
| 294 | memcpy (circuit->u.bc.snpa, LLADDR(&circuit->interface->sdl), ETH_ALEN); |
| 295 | #else |
| 296 | if (circuit->interface->hw_addr_len != ETH_ALEN) { |
| 297 | zlog_warn ("unsupported link layer"); |
| 298 | } else { |
| 299 | memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN); |
| 300 | } |
| 301 | #ifdef EXTREME_DEGUG |
| 302 | zlog_info ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s", |
| 303 | circuit->interface->ifindex, ISO_MTU (circuit), |
| 304 | snpa_print (circuit->u.bc.snpa)); |
| 305 | |
| 306 | #endif /* EXTREME_DEBUG */ |
| 307 | #endif /* HAVE_SOCKADDR_DL */ |
| 308 | } else if (if_is_pointopoint (ifp)) { |
| 309 | circuit->circ_type = CIRCUIT_T_P2P; |
| 310 | } else { |
| 311 | zlog_warn ("isis_circuit_if_add: unsupported media"); |
| 312 | } |
| 313 | |
| 314 | for (node = ifp->connected ? listhead (ifp->connected) : NULL; node; |
| 315 | nextnode (node)) { |
| 316 | conn = getdata (node); |
| 317 | isis_circuit_add_addr (circuit, conn); |
| 318 | } |
| 319 | |
| 320 | return; |
| 321 | } |
| 322 | |
| 323 | void |
| 324 | isis_circuit_update_params (struct isis_circuit *circuit, |
| 325 | struct interface *ifp) |
| 326 | { |
| 327 | assert (circuit); |
| 328 | |
| 329 | if (circuit->circuit_id != ifp->ifindex) { |
| 330 | zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id, |
| 331 | ifp->ifindex); |
| 332 | circuit->circuit_id = ifp->ifindex % 255; |
| 333 | } |
| 334 | |
| 335 | /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */ |
| 336 | /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig) |
| 337 | The areas MTU is the minimum of mtu's of circuits in the area |
| 338 | now we can't catch the change |
| 339 | if (circuit->mtu != ifp->mtu) { |
| 340 | zlog_warn ("changing circuit mtu %d->%d", circuit->mtu, |
| 341 | ifp->mtu); |
| 342 | circuit->mtu = ifp->mtu; |
| 343 | } |
| 344 | */ |
| 345 | /* |
| 346 | * Get the Hardware Address |
| 347 | */ |
| 348 | #ifdef HAVE_SOCKADDR_DL |
| 349 | if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN) |
| 350 | zlog_warn ("unsupported link layer"); |
| 351 | else |
| 352 | memcpy (circuit->u.bc.snpa, LLADDR(&circuit->interface->sdl), ETH_ALEN); |
| 353 | #else |
| 354 | if (circuit->interface->hw_addr_len != ETH_ALEN) { |
| 355 | zlog_warn ("unsupported link layer"); |
| 356 | } else { |
| 357 | if (memcmp(circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN)) { |
| 358 | zlog_warn ("changing circuit snpa %s->%s", |
| 359 | snpa_print (circuit->u.bc.snpa), |
| 360 | snpa_print (circuit->interface->hw_addr)); |
| 361 | } |
| 362 | } |
| 363 | #endif |
| 364 | |
| 365 | |
| 366 | |
| 367 | if (if_is_broadcast (ifp)) { |
| 368 | circuit->circ_type = CIRCUIT_T_BROADCAST; |
| 369 | } else if (if_is_pointopoint (ifp)) { |
| 370 | circuit->circ_type = CIRCUIT_T_P2P; |
| 371 | } else { |
| 372 | zlog_warn ("isis_circuit_update_params: unsupported media"); |
| 373 | } |
| 374 | |
| 375 | return; |
| 376 | } |
| 377 | |
| 378 | void |
| 379 | isis_circuit_if_del (struct isis_circuit *circuit) |
| 380 | { |
| 381 | circuit->interface->info = NULL; |
| 382 | circuit->interface = NULL; |
| 383 | |
| 384 | return; |
| 385 | } |
| 386 | |
| 387 | void |
| 388 | isis_circuit_up (struct isis_circuit *circuit) |
| 389 | { |
| 390 | |
| 391 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) { |
| 392 | if (circuit->area->min_bcast_mtu == 0 || |
| 393 | ISO_MTU(circuit) < circuit->area->min_bcast_mtu ) |
| 394 | circuit->area->min_bcast_mtu = ISO_MTU(circuit); |
| 395 | /* |
| 396 | * ISO 10589 - 8.4.1 Enabling of broadcast circuits |
| 397 | */ |
| 398 | |
| 399 | /* initilizing the hello sending threads |
| 400 | * for a broadcast IF |
| 401 | */ |
| 402 | |
| 403 | /* 8.4.1 a) commence sending of IIH PDUs */ |
| 404 | |
| 405 | if (circuit->circuit_is_type & IS_LEVEL_1) { |
| 406 | thread_add_event (master, send_lan_l1_hello, circuit, 0); |
| 407 | circuit->u.bc.lan_neighs[0] = list_new (); |
| 408 | } |
| 409 | |
| 410 | if (circuit->circuit_is_type & IS_LEVEL_2) { |
| 411 | thread_add_event (master, send_lan_l2_hello, circuit, 0); |
| 412 | circuit->u.bc.lan_neighs[1] = list_new (); |
| 413 | } |
| 414 | |
| 415 | /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */ |
| 416 | /* 8.4.1 c) FIXME: listen for ESH PDUs */ |
| 417 | |
| 418 | /* 8.4.1 d) */ |
| 419 | /* dr election will commence in... */ |
| 420 | if (circuit->circuit_is_type & IS_LEVEL_1) |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 421 | THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1, |
| 422 | circuit, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 423 | 2 * circuit->hello_multiplier[0] * circuit->hello_interval[0]); |
| 424 | if (circuit->circuit_is_type & IS_LEVEL_2) |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 425 | THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2, |
| 426 | circuit, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 427 | 2 * circuit->hello_multiplier[1] * circuit->hello_interval[1]); |
| 428 | } else { |
| 429 | /* initializing the hello send threads |
| 430 | * for a ptp IF |
| 431 | */ |
| 432 | thread_add_event (master, send_p2p_hello, circuit, 0); |
| 433 | |
| 434 | } |
| 435 | |
| 436 | /* initializing PSNP timers */ |
| 437 | if (circuit->circuit_is_type & IS_LEVEL_1) { |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 438 | THREAD_TIMER_ON(master, circuit->t_send_psnp[0], send_l1_psnp, circuit, |
| 439 | isis_jitter(circuit->psnp_interval[0], PSNP_JITTER)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 440 | } |
| 441 | |
| 442 | if (circuit->circuit_is_type & IS_LEVEL_2) { |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 443 | THREAD_TIMER_ON(master, circuit->t_send_psnp[1], send_l2_psnp, circuit, |
| 444 | isis_jitter(circuit->psnp_interval[1], PSNP_JITTER)); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 445 | } |
| 446 | |
| 447 | /* initialize the circuit streams */ |
| 448 | if (circuit->rcv_stream == NULL) |
| 449 | circuit->rcv_stream = stream_new (ISO_MTU(circuit)); |
| 450 | |
| 451 | if (circuit->snd_stream == NULL) |
| 452 | circuit->snd_stream = stream_new (ISO_MTU(circuit)); |
| 453 | |
| 454 | /* unified init for circuits */ |
| 455 | isis_sock_init (circuit); |
| 456 | |
| 457 | #ifdef GNU_LINUX |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 458 | THREAD_READ_ON(master, circuit->t_read, isis_receive, circuit, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 459 | circuit->fd); |
| 460 | #else |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 461 | THREAD_TIMER_ON(master, circuit->t_read, isis_receive, circuit, |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 462 | circuit->fd); |
| 463 | #endif |
| 464 | return; |
| 465 | } |
| 466 | |
| 467 | void |
| 468 | isis_circuit_down (struct isis_circuit *circuit) |
| 469 | { |
| 470 | /* Cancel all active threads -- FIXME: wrong place*/ |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 471 | /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */ |
| 472 | THREAD_OFF(circuit->t_read); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 473 | if (circuit->circ_type == CIRCUIT_T_BROADCAST) { |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 474 | THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[0]); |
| 475 | THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[1]); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 476 | } else if (circuit->circ_type == CIRCUIT_T_P2P) { |
hasso | d70f99e | 2004-02-11 20:26:31 +0000 | [diff] [blame] | 477 | THREAD_TIMER_OFF(circuit->u.p2p.t_send_p2p_hello); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 478 | } |
| 479 | /* close the socket */ |
| 480 | close (circuit->fd); |
| 481 | |
| 482 | return; |
| 483 | } |
| 484 | |
| 485 | void |
| 486 | circuit_update_nlpids (struct isis_circuit *circuit) |
| 487 | { |
| 488 | circuit->nlpids.count = 0; |
| 489 | |
| 490 | if (circuit->ip_router) { |
| 491 | circuit->nlpids.nlpids[0] = NLPID_IP; |
| 492 | circuit->nlpids.count++; |
| 493 | } |
| 494 | #ifdef HAVE_IPV6 |
| 495 | if (circuit->ipv6_router) { |
| 496 | circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6; |
| 497 | circuit->nlpids.count++; |
| 498 | } |
| 499 | #endif /* HAVE_IPV6 */ |
| 500 | return; |
| 501 | } |
| 502 | |
| 503 | int |
| 504 | isis_interface_config_write (struct vty *vty) |
| 505 | { |
| 506 | |
| 507 | int write = 0; |
| 508 | listnode node; |
| 509 | listnode node2; |
| 510 | listnode node3; |
| 511 | struct interface *ifp; |
| 512 | struct isis_area *area; |
| 513 | struct isis_circuit *c; |
| 514 | struct prefix_ipv4 *ip; |
| 515 | int i; |
| 516 | #ifdef HAVE_IPV6 |
| 517 | struct prefix_ipv6 *ipv6; |
| 518 | #endif /*HAVE_IPV6 */ |
| 519 | |
| 520 | char buf[BUFSIZ]; |
| 521 | |
| 522 | |
| 523 | LIST_LOOP (iflist, ifp, node) |
| 524 | { |
| 525 | /* IF name */ |
| 526 | vty_out (vty, "interface %s%s", ifp->name,VTY_NEWLINE); |
| 527 | write++; |
| 528 | /* IF desc */ |
| 529 | if (ifp->desc) { |
| 530 | vty_out (vty, " description %s%s", ifp->desc,VTY_NEWLINE); |
| 531 | write++; |
| 532 | } |
| 533 | /* ISIS Circuit */ |
| 534 | LIST_LOOP (isis->area_list, area, node2) |
| 535 | { |
| 536 | c = circuit_lookup_by_ifp (ifp, area->circuit_list); |
| 537 | if (c) { |
| 538 | if (c->ip_router) { |
| 539 | vty_out (vty, " ip router isis %s%s",area->area_tag,VTY_NEWLINE); |
| 540 | write++; |
| 541 | } |
| 542 | #ifdef HAVE_IPV6 |
| 543 | if (c->ipv6_router) { |
| 544 | vty_out (vty, " ipv6 router isis %s%s",area->area_tag,VTY_NEWLINE); |
| 545 | write++; |
| 546 | } |
| 547 | #endif /* HAVE_IPV6 */ |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 548 | |
| 549 | /* ISIS - circuit type */ |
| 550 | if (c->circuit_is_type == IS_LEVEL_1) { |
| 551 | vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE); |
| 552 | write ++; |
| 553 | } else {if (c->circuit_is_type == IS_LEVEL_2) { |
| 554 | vty_out (vty, " isis circuit-type level-2-only%s", VTY_NEWLINE); |
| 555 | write ++; |
| 556 | }} |
| 557 | |
| 558 | /* ISIS - CSNP interval - FIXME: compare to cisco*/ |
| 559 | if (c->csnp_interval[0] == c->csnp_interval[1]) { |
| 560 | if (c->csnp_interval[0] != CSNP_INTERVAL) { |
| 561 | vty_out (vty, " isis csnp-interval %d%s", c->csnp_interval[0], |
| 562 | VTY_NEWLINE); |
| 563 | write ++; |
| 564 | } |
| 565 | } else { |
| 566 | for (i=0;i<2;i++) { |
| 567 | if (c->csnp_interval[1] != CSNP_INTERVAL) { |
| 568 | vty_out (vty, " isis csnp-interval %d level-%d%s", |
| 569 | c->csnp_interval[1],i+1, VTY_NEWLINE); |
| 570 | write ++; |
| 571 | } |
| 572 | } |
| 573 | } |
| 574 | |
| 575 | /* ISIS - Hello padding - Defaults to true so only display if false */ |
| 576 | if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos) { |
| 577 | vty_out (vty, " no isis hello padding%s", VTY_NEWLINE); |
| 578 | write ++; |
| 579 | } |
| 580 | |
| 581 | /* ISIS - Hello interval - FIXME: compare to cisco */ |
| 582 | if (c->hello_interval[0] == c->hello_interval[1]) { |
| 583 | if (c->hello_interval[0] != HELLO_INTERVAL) { |
| 584 | vty_out (vty, " isis hello-interval %d%s", c->hello_interval[0], |
| 585 | VTY_NEWLINE); |
| 586 | write ++; |
| 587 | } |
| 588 | } else { |
| 589 | for (i=0;i<2;i++) { |
| 590 | if (c->hello_interval[i] != HELLO_INTERVAL) { |
| 591 | if (c->hello_interval[i] == HELLO_MINIMAL) { |
| 592 | vty_out (vty, " isis hello-interval minimal level-%d%s", i+1, |
| 593 | VTY_NEWLINE); |
| 594 | } else { |
| 595 | vty_out (vty, " isis hello-interval %d level-%d%s", |
| 596 | c->hello_interval[i],i+1, VTY_NEWLINE); |
| 597 | } |
| 598 | write ++; |
| 599 | } |
| 600 | } |
| 601 | } |
| 602 | |
| 603 | /* ISIS - Hello Multiplier */ |
| 604 | if (c->hello_multiplier[0] == c->hello_multiplier[1]) { |
| 605 | if (c->hello_multiplier[0] != HELLO_MULTIPLIER ) { |
| 606 | vty_out (vty, " isis hello-multiplier %d%s", |
| 607 | c->hello_multiplier[0], VTY_NEWLINE); |
| 608 | write ++; |
| 609 | } |
| 610 | } else { |
| 611 | for (i=0;i<2;i++) { |
| 612 | if (c->hello_multiplier[i] != HELLO_MULTIPLIER) { |
| 613 | vty_out (vty, " isis hello-multiplier %d level-%d%s", |
| 614 | c->hello_multiplier[i],i+1, VTY_NEWLINE); |
| 615 | write ++; |
| 616 | } |
| 617 | } |
| 618 | } |
| 619 | /* ISIS - Priority */ |
| 620 | if (c->circ_type == CIRCUIT_T_BROADCAST) { |
| 621 | if (c->u.bc.priority[0] == c->u.bc.priority[1]) { |
| 622 | if (c->u.bc.priority[0] != DEFAULT_PRIORITY) { |
| 623 | vty_out (vty, " isis priority %d%s", c->u.bc.priority[0], |
| 624 | VTY_NEWLINE); |
| 625 | write ++; |
| 626 | } |
| 627 | } else { |
| 628 | for (i=0;i<2;i++) { |
| 629 | if (c->u.bc.priority[i] != DEFAULT_PRIORITY) { |
| 630 | vty_out (vty, " isis priority %d level-%d%s", |
| 631 | c->u.bc.priority[i],i+1, VTY_NEWLINE); |
| 632 | write ++; |
| 633 | } |
| 634 | } |
| 635 | } |
| 636 | } |
| 637 | /* ISIS - Metric */ |
| 638 | if (c->metrics[0].metric_default == c->metrics[1].metric_default) { |
| 639 | if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS) { |
| 640 | vty_out (vty, " isis metric %d%s", c->metrics[0].metric_default, |
| 641 | VTY_NEWLINE); |
| 642 | write ++; |
| 643 | } |
| 644 | } else { |
| 645 | for (i=0;i<2;i++) { |
| 646 | if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS) { |
| 647 | vty_out (vty, " isis metric %d level-%d%s", |
| 648 | c->metrics[i].metric_default,i+1, VTY_NEWLINE); |
| 649 | write ++; |
| 650 | } |
| 651 | } |
| 652 | } |
| 653 | |
| 654 | } |
| 655 | } |
hasso | 2097cd8 | 2003-12-23 11:51:08 +0000 | [diff] [blame] | 656 | vty_out (vty, "!%s",VTY_NEWLINE); |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 657 | } |
| 658 | |
| 659 | return write; |
| 660 | } |
| 661 | |
| 662 | |
| 663 | DEFUN (ip_router_isis, |
| 664 | ip_router_isis_cmd, |
| 665 | "ip router isis WORD", |
| 666 | "Interface Internet Protocol config commands\n" |
| 667 | "IP router interface commands\n" |
| 668 | "IS-IS Routing for IP\n" |
| 669 | "Routing process tag\n" |
| 670 | ) |
| 671 | { |
| 672 | struct isis_circuit *c; |
| 673 | struct interface *ifp; |
| 674 | struct isis_area *area; |
| 675 | |
| 676 | ifp = (struct interface *)vty->index; |
| 677 | assert (ifp); |
| 678 | |
| 679 | area = isis_area_lookup (argv[0]); |
| 680 | |
| 681 | /* Prevent more than one circuit per interface */ |
| 682 | if (area) |
| 683 | c = circuit_lookup_by_ifp (ifp, area->circuit_list); |
| 684 | else c = NULL; |
| 685 | if (c && (ifp->info != NULL)) { |
| 686 | #ifdef HAVE_IPV6 |
| 687 | if (c->ipv6_router == 0) { |
| 688 | #endif /* HAVE_IPV6 */ |
| 689 | vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE); |
| 690 | return CMD_WARNING; |
| 691 | #ifdef HAVE_IPV6 |
| 692 | } |
| 693 | #endif /* HAVE_IPV6 */ |
| 694 | } |
| 695 | |
| 696 | /* this is here for ciscopability */ |
| 697 | if (!area) { |
| 698 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 699 | return CMD_WARNING; |
| 700 | } |
| 701 | |
| 702 | if (!c) { |
| 703 | c = circuit_lookup_by_ifp (ifp, isis->init_circ_list); |
| 704 | c = isis_csm_state_change (ISIS_ENABLE, c, area); |
| 705 | c->interface = ifp; /* this is automatic */ |
| 706 | ifp->info = c; /* hardly related to the FSM */ |
| 707 | } |
| 708 | |
| 709 | if(!c) |
| 710 | return CMD_WARNING; |
| 711 | |
| 712 | c->ip_router = 1; |
| 713 | area->ip_circuits++; |
| 714 | circuit_update_nlpids (c); |
| 715 | |
| 716 | vty->node = INTERFACE_NODE; |
| 717 | |
| 718 | return CMD_SUCCESS; |
| 719 | } |
| 720 | |
| 721 | DEFUN (no_ip_router_isis, |
| 722 | no_ip_router_isis_cmd, |
| 723 | "no ip router isis WORD", |
| 724 | NO_STR |
| 725 | "Interface Internet Protocol config commands\n" |
| 726 | "IP router interface commands\n" |
| 727 | "IS-IS Routing for IP\n" |
| 728 | "Routing process tag\n" |
| 729 | ) |
| 730 | { |
| 731 | struct isis_circuit *circuit = NULL; |
| 732 | struct interface *ifp; |
| 733 | struct isis_area *area; |
| 734 | struct listnode *node; |
| 735 | |
| 736 | ifp = (struct interface *)vty->index; |
| 737 | assert (ifp); |
| 738 | |
| 739 | area = isis_area_lookup (argv[0]); |
| 740 | if (!area) { |
| 741 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 742 | return CMD_WARNING; |
| 743 | } |
| 744 | LIST_LOOP (area->circuit_list, circuit, node) |
| 745 | if (circuit->interface == ifp) |
| 746 | break; |
| 747 | if (!circuit) { |
| 748 | vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE); |
| 749 | return CMD_WARNING; |
| 750 | } |
| 751 | circuit->ip_router = 0; |
| 752 | area->ip_circuits--; |
| 753 | #ifdef HAVE_IPV6 |
| 754 | if (circuit->ipv6_router == 0) |
| 755 | #endif |
| 756 | isis_csm_state_change (ISIS_DISABLE, circuit, area); |
| 757 | |
| 758 | return CMD_SUCCESS; |
| 759 | } |
| 760 | |
| 761 | DEFUN (isis_circuit_type, |
| 762 | isis_circuit_type_cmd, |
| 763 | "isis circuit-type (level-1|level-1-2|level-2-only)", |
| 764 | "IS-IS commands\n" |
| 765 | "Configure circuit type for interface\n" |
| 766 | "Level-1 only adjacencies are formed\n" |
| 767 | "Level-1-2 adjacencies are formed\n" |
| 768 | "Level-2 only adjacencies are formed\n" |
| 769 | ) |
| 770 | { |
| 771 | struct isis_circuit *circuit; |
| 772 | struct interface *ifp; |
| 773 | int circuit_t; |
| 774 | int is_type; |
| 775 | |
| 776 | ifp = vty->index; |
| 777 | circuit = ifp->info; |
| 778 | /* UGLY - will remove l8r */ |
| 779 | if (circuit == NULL) { |
| 780 | return CMD_WARNING; |
| 781 | } |
| 782 | |
| 783 | assert (circuit); |
| 784 | |
| 785 | circuit_t = string2circuit_t (argv[0]); |
| 786 | |
| 787 | if (!circuit_t) { |
| 788 | vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE); |
| 789 | return CMD_SUCCESS; |
| 790 | } |
| 791 | |
| 792 | is_type = circuit->area->is_type; |
| 793 | if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t) |
| 794 | isis_event_circuit_type_change (circuit, circuit_t); |
| 795 | else { |
| 796 | vty_out (vty, "invalid circuit level for area %s.%s", |
| 797 | circuit->area->area_tag, VTY_NEWLINE); |
| 798 | } |
| 799 | |
| 800 | return CMD_SUCCESS; |
| 801 | } |
| 802 | |
| 803 | DEFUN (no_isis_circuit_type, |
| 804 | no_isis_circuit_type_cmd, |
| 805 | "no isis circuit-type (level-1|level-1-2|level-2-only)", |
| 806 | NO_STR |
| 807 | "IS-IS commands\n" |
| 808 | "Configure circuit type for interface\n" |
| 809 | "Level-1 only adjacencies are formed\n" |
| 810 | "Level-1-2 adjacencies are formed\n" |
| 811 | "Level-2 only adjacencies are formed\n" |
| 812 | ) |
| 813 | { |
| 814 | struct isis_circuit *circuit; |
| 815 | struct interface *ifp; |
| 816 | |
| 817 | ifp = vty->index; |
| 818 | circuit = ifp->info; |
| 819 | if (circuit == NULL) { |
| 820 | return CMD_WARNING; |
| 821 | } |
| 822 | |
| 823 | assert(circuit); |
| 824 | |
| 825 | /* |
| 826 | * Set the circuits level to its default value which is that of the area |
| 827 | */ |
| 828 | isis_event_circuit_type_change (circuit, circuit->area->is_type); |
| 829 | |
| 830 | return CMD_SUCCESS; |
| 831 | } |
| 832 | |
| 833 | DEFUN (isis_passwd, |
| 834 | isis_passwd_cmd, |
| 835 | "isis password WORD", |
| 836 | "IS-IS commands\n" |
| 837 | "Configure the authentication password for interface\n" |
| 838 | "Password\n") |
| 839 | { |
| 840 | struct isis_circuit *circuit; |
| 841 | struct interface *ifp; |
| 842 | int len; |
| 843 | |
| 844 | ifp = vty->index; |
| 845 | circuit = ifp->info; |
| 846 | if (circuit == NULL) { |
| 847 | return CMD_WARNING; |
| 848 | } |
| 849 | |
| 850 | len = strlen (argv[0]); |
| 851 | if (len > 254) { |
| 852 | vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE); |
| 853 | return CMD_WARNING; |
| 854 | } |
| 855 | circuit->passwd.len = len; |
| 856 | circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT; |
| 857 | strncpy (circuit->passwd.passwd, argv[0], 255); |
| 858 | |
| 859 | return CMD_SUCCESS; |
| 860 | } |
| 861 | |
| 862 | DEFUN (no_isis_passwd, |
| 863 | no_isis_passwd_cmd, |
| 864 | "no isis password", |
| 865 | NO_STR |
| 866 | "IS-IS commands\n" |
| 867 | "Configure the authentication password for interface\n") |
| 868 | { |
| 869 | struct isis_circuit *circuit; |
| 870 | struct interface *ifp; |
| 871 | |
| 872 | ifp = vty->index; |
| 873 | circuit = ifp->info; |
| 874 | if (circuit == NULL) { |
| 875 | return CMD_WARNING; |
| 876 | } |
| 877 | |
| 878 | memset (&circuit->passwd, 0, sizeof (struct isis_passwd)); |
| 879 | |
| 880 | return CMD_SUCCESS; |
| 881 | } |
| 882 | |
| 883 | |
| 884 | DEFUN (isis_priority, |
| 885 | isis_priority_cmd, |
| 886 | "isis priority <0-127>", |
| 887 | "IS-IS commands\n" |
| 888 | "Set priority for Designated Router election\n" |
| 889 | "Priority value\n" |
| 890 | ) |
| 891 | { |
| 892 | struct isis_circuit *circuit; |
| 893 | struct interface *ifp; |
| 894 | int prio; |
| 895 | |
| 896 | ifp = vty->index; |
| 897 | circuit = ifp->info; |
| 898 | if (circuit == NULL) { |
| 899 | return CMD_WARNING; |
| 900 | } |
| 901 | assert (circuit); |
| 902 | |
| 903 | prio = atoi (argv[0]); |
| 904 | |
| 905 | circuit->u.bc.priority[0] = prio; |
| 906 | circuit->u.bc.priority[1] = prio; |
| 907 | |
| 908 | return CMD_SUCCESS; |
| 909 | } |
| 910 | |
| 911 | DEFUN (no_isis_priority, |
| 912 | no_isis_priority_cmd, |
| 913 | "no isis priority", |
| 914 | NO_STR |
| 915 | "IS-IS commands\n" |
| 916 | "Set priority for Designated Router election\n" |
| 917 | ) |
| 918 | { |
| 919 | struct isis_circuit *circuit; |
| 920 | struct interface *ifp; |
| 921 | |
| 922 | ifp = vty->index; |
| 923 | circuit = ifp->info; |
| 924 | if (circuit == NULL) { |
| 925 | return CMD_WARNING; |
| 926 | } |
| 927 | assert (circuit); |
| 928 | |
| 929 | circuit->u.bc.priority[0] = DEFAULT_PRIORITY; |
| 930 | circuit->u.bc.priority[1] = DEFAULT_PRIORITY; |
| 931 | |
| 932 | return CMD_SUCCESS; |
| 933 | } |
| 934 | |
| 935 | ALIAS (no_isis_priority, |
| 936 | no_isis_priority_arg_cmd, |
| 937 | "no isis priority <0-127>", |
| 938 | NO_STR |
| 939 | "IS-IS commands\n" |
| 940 | "Set priority for Designated Router election\n" |
| 941 | "Priority value\n" |
| 942 | ) |
| 943 | |
| 944 | DEFUN (isis_priority_l1, |
| 945 | isis_priority_l1_cmd, |
| 946 | "isis priority <0-127> level-1", |
| 947 | "IS-IS commands\n" |
| 948 | "Set priority for Designated Router election\n" |
| 949 | "Priority value\n" |
| 950 | "Specify priority for level-1 routing\n" |
| 951 | ) |
| 952 | { |
| 953 | struct isis_circuit *circuit; |
| 954 | struct interface *ifp; |
| 955 | int prio; |
| 956 | |
| 957 | ifp = vty->index; |
| 958 | circuit = ifp->info; |
| 959 | if (circuit == NULL) { |
| 960 | return CMD_WARNING; |
| 961 | } |
| 962 | assert (circuit); |
| 963 | |
| 964 | prio = atoi (argv[0]); |
| 965 | |
| 966 | circuit->u.bc.priority[0] = prio; |
| 967 | |
| 968 | return CMD_SUCCESS; |
| 969 | } |
| 970 | |
| 971 | DEFUN (no_isis_priority_l1, |
| 972 | no_isis_priority_l1_cmd, |
| 973 | "no isis priority level-1", |
| 974 | NO_STR |
| 975 | "IS-IS commands\n" |
| 976 | "Set priority for Designated Router election\n" |
| 977 | "Specify priority for level-1 routing\n" |
| 978 | ) |
| 979 | { |
| 980 | struct isis_circuit *circuit; |
| 981 | struct interface *ifp; |
| 982 | |
| 983 | ifp = vty->index; |
| 984 | circuit = ifp->info; |
| 985 | if (circuit == NULL) { |
| 986 | return CMD_WARNING; |
| 987 | } |
| 988 | assert (circuit); |
| 989 | |
| 990 | circuit->u.bc.priority[0] = DEFAULT_PRIORITY; |
| 991 | |
| 992 | return CMD_SUCCESS; |
| 993 | } |
| 994 | |
| 995 | ALIAS (no_isis_priority_l1, |
| 996 | no_isis_priority_l1_arg_cmd, |
| 997 | "no isis priority <0-127> level-1", |
| 998 | NO_STR |
| 999 | "IS-IS commands\n" |
| 1000 | "Set priority for Designated Router election\n" |
| 1001 | "Priority value\n" |
| 1002 | "Specify priority for level-1 routing\n" |
| 1003 | ) |
| 1004 | |
| 1005 | DEFUN (isis_priority_l2, |
| 1006 | isis_priority_l2_cmd, |
| 1007 | "isis priority <0-127> level-2", |
| 1008 | "IS-IS commands\n" |
| 1009 | "Set priority for Designated Router election\n" |
| 1010 | "Priority value\n" |
| 1011 | "Specify priority for level-2 routing\n" |
| 1012 | ) |
| 1013 | { |
| 1014 | struct isis_circuit *circuit; |
| 1015 | struct interface *ifp; |
| 1016 | int prio; |
| 1017 | |
| 1018 | ifp = vty->index; |
| 1019 | circuit = ifp->info; |
| 1020 | if (circuit == NULL) { |
| 1021 | return CMD_WARNING; |
| 1022 | } |
| 1023 | assert (circuit); |
| 1024 | |
| 1025 | prio = atoi (argv[0]); |
| 1026 | |
| 1027 | circuit->u.bc.priority[1] = prio; |
| 1028 | |
| 1029 | return CMD_SUCCESS; |
| 1030 | } |
| 1031 | |
| 1032 | DEFUN (no_isis_priority_l2, |
| 1033 | no_isis_priority_l2_cmd, |
| 1034 | "no isis priority level-2", |
| 1035 | NO_STR |
| 1036 | "IS-IS commands\n" |
| 1037 | "Set priority for Designated Router election\n" |
| 1038 | "Specify priority for level-2 routing\n" |
| 1039 | ) |
| 1040 | { |
| 1041 | struct isis_circuit *circuit; |
| 1042 | struct interface *ifp; |
| 1043 | |
| 1044 | ifp = vty->index; |
| 1045 | circuit = ifp->info; |
| 1046 | if (circuit == NULL) { |
| 1047 | return CMD_WARNING; |
| 1048 | } |
| 1049 | assert (circuit); |
| 1050 | |
| 1051 | circuit->u.bc.priority[1] = DEFAULT_PRIORITY; |
| 1052 | |
| 1053 | return CMD_SUCCESS; |
| 1054 | } |
| 1055 | |
| 1056 | ALIAS (no_isis_priority_l2, |
| 1057 | no_isis_priority_l2_arg_cmd, |
| 1058 | "no isis priority <0-127> level-2", |
| 1059 | NO_STR |
| 1060 | "IS-IS commands\n" |
| 1061 | "Set priority for Designated Router election\n" |
| 1062 | "Priority value\n" |
| 1063 | "Specify priority for level-2 routing\n" |
| 1064 | ) |
| 1065 | |
| 1066 | /* Metric command */ |
| 1067 | |
| 1068 | DEFUN (isis_metric, |
| 1069 | isis_metric_cmd, |
| 1070 | "isis metric <0-63>", |
| 1071 | "IS-IS commands\n" |
| 1072 | "Set default metric for circuit\n" |
| 1073 | "Default metric value\n" |
| 1074 | ) |
| 1075 | { |
| 1076 | struct isis_circuit *circuit; |
| 1077 | struct interface *ifp; |
| 1078 | int met; |
| 1079 | |
| 1080 | ifp = vty->index; |
| 1081 | circuit = ifp->info; |
| 1082 | if (circuit == NULL) { |
| 1083 | return CMD_WARNING; |
| 1084 | } |
| 1085 | assert (circuit); |
| 1086 | |
| 1087 | met = atoi (argv[0]); |
| 1088 | |
| 1089 | circuit->metrics[0].metric_default = met; |
| 1090 | circuit->metrics[1].metric_default = met; |
| 1091 | |
| 1092 | return CMD_SUCCESS; |
| 1093 | } |
| 1094 | |
| 1095 | DEFUN (no_isis_metric, |
| 1096 | no_isis_metric_cmd, |
| 1097 | "no isis metric", |
| 1098 | NO_STR |
| 1099 | "IS-IS commands\n" |
| 1100 | "Set default metric for circuit\n" |
| 1101 | ) |
| 1102 | { |
| 1103 | struct isis_circuit *circuit; |
| 1104 | struct interface *ifp; |
| 1105 | |
| 1106 | ifp = vty->index; |
| 1107 | circuit = ifp->info; |
| 1108 | if (circuit == NULL) { |
| 1109 | return CMD_WARNING; |
| 1110 | } |
| 1111 | assert (circuit); |
| 1112 | |
| 1113 | circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS; |
| 1114 | circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS; |
| 1115 | |
| 1116 | return CMD_SUCCESS; |
| 1117 | } |
| 1118 | |
| 1119 | ALIAS (no_isis_metric, |
| 1120 | no_isis_metric_arg_cmd, |
| 1121 | "no isis metric <0-127>", |
| 1122 | NO_STR |
| 1123 | "IS-IS commands\n" |
| 1124 | "Set default metric for circuit\n" |
| 1125 | "Default metric value\n" |
| 1126 | ) |
| 1127 | /* end of metrics */ |
| 1128 | |
| 1129 | |
| 1130 | DEFUN (isis_hello_interval, |
| 1131 | isis_hello_interval_cmd, |
| 1132 | "isis hello-interval (<1-65535>|minimal)", |
| 1133 | "IS-IS commands\n" |
| 1134 | "Set Hello interval\n" |
| 1135 | "Hello interval value\n" |
| 1136 | "Holdtime 1 seconds, interval depends on multiplier\n" |
| 1137 | ) |
| 1138 | { |
| 1139 | struct isis_circuit *circuit; |
| 1140 | struct interface *ifp; |
| 1141 | int interval; |
| 1142 | char c; |
| 1143 | |
| 1144 | ifp = vty->index; |
| 1145 | circuit = ifp->info; |
| 1146 | if (circuit == NULL) { |
| 1147 | return CMD_WARNING; |
| 1148 | } |
| 1149 | assert (circuit); |
| 1150 | c = *argv[0]; |
| 1151 | if (isdigit((int)c)) { |
| 1152 | interval = atoi (argv[0]); |
| 1153 | } else |
| 1154 | interval = HELLO_MINIMAL; /* FIXME: should be calculated */ |
| 1155 | |
| 1156 | circuit->hello_interval[0] = (u_int16_t)interval; |
| 1157 | circuit->hello_interval[1] = (u_int16_t)interval; |
| 1158 | |
| 1159 | return CMD_SUCCESS; |
| 1160 | } |
| 1161 | |
| 1162 | DEFUN (no_isis_hello_interval, |
| 1163 | no_isis_hello_interval_cmd, |
| 1164 | "no isis hello-interval", |
| 1165 | NO_STR |
| 1166 | "IS-IS commands\n" |
| 1167 | "Set Hello interval\n" |
| 1168 | ) |
| 1169 | { |
| 1170 | struct isis_circuit *circuit; |
| 1171 | struct interface *ifp; |
| 1172 | |
| 1173 | ifp = vty->index; |
| 1174 | circuit = ifp->info; |
| 1175 | if (circuit == NULL) { |
| 1176 | return CMD_WARNING; |
| 1177 | } |
| 1178 | assert (circuit); |
| 1179 | |
| 1180 | |
| 1181 | circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */ |
| 1182 | circuit->hello_interval[1] = HELLO_INTERVAL; |
| 1183 | |
| 1184 | return CMD_SUCCESS; |
| 1185 | } |
| 1186 | |
| 1187 | ALIAS (no_isis_hello_interval, |
| 1188 | no_isis_hello_interval_arg_cmd, |
| 1189 | "no isis hello-interval (<1-65535>|minimal)", |
| 1190 | NO_STR |
| 1191 | "IS-IS commands\n" |
| 1192 | "Set Hello interval\n" |
| 1193 | "Hello interval value\n" |
| 1194 | "Holdtime 1 second, interval depends on multiplier\n" |
| 1195 | ) |
| 1196 | |
| 1197 | DEFUN (isis_hello_interval_l1, |
| 1198 | isis_hello_interval_l1_cmd, |
| 1199 | "isis hello-interval (<1-65535>|minimal) level-1", |
| 1200 | "IS-IS commands\n" |
| 1201 | "Set Hello interval\n" |
| 1202 | "Hello interval value\n" |
| 1203 | "Holdtime 1 second, interval depends on multiplier\n" |
| 1204 | "Specify hello-interval for level-1 IIHs\n" |
| 1205 | ) |
| 1206 | { |
| 1207 | struct isis_circuit *circuit; |
| 1208 | struct interface *ifp; |
| 1209 | long interval; |
| 1210 | char c; |
| 1211 | |
| 1212 | ifp = vty->index; |
| 1213 | circuit = ifp->info; |
| 1214 | if (circuit == NULL) { |
| 1215 | return CMD_WARNING; |
| 1216 | } |
| 1217 | assert (circuit); |
| 1218 | |
| 1219 | c = *argv[0]; |
| 1220 | if (isdigit((int)c)) { |
| 1221 | interval = atoi (argv[0]); |
| 1222 | } else |
| 1223 | interval = HELLO_MINIMAL; |
| 1224 | |
| 1225 | circuit->hello_interval[0] = (u_int16_t)interval; |
| 1226 | |
| 1227 | return CMD_SUCCESS; |
| 1228 | } |
| 1229 | |
| 1230 | DEFUN (no_isis_hello_interval_l1, |
| 1231 | no_isis_hello_interval_l1_cmd, |
| 1232 | "no isis hello-interval level-1", |
| 1233 | NO_STR |
| 1234 | "IS-IS commands\n" |
| 1235 | "Set Hello interval\n" |
| 1236 | "Specify hello-interval for level-1 IIHs\n" |
| 1237 | ) |
| 1238 | { |
| 1239 | struct isis_circuit *circuit; |
| 1240 | struct interface *ifp; |
| 1241 | |
| 1242 | ifp = vty->index; |
| 1243 | circuit = ifp->info; |
| 1244 | if (circuit == NULL) { |
| 1245 | return CMD_WARNING; |
| 1246 | } |
| 1247 | assert (circuit); |
| 1248 | |
| 1249 | |
| 1250 | circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */ |
| 1251 | |
| 1252 | return CMD_SUCCESS; |
| 1253 | } |
| 1254 | |
| 1255 | ALIAS (no_isis_hello_interval_l1, |
| 1256 | no_isis_hello_interval_l1_arg_cmd, |
| 1257 | "no isis hello-interval (<1-65535>|minimal) level-1", |
| 1258 | NO_STR |
| 1259 | "IS-IS commands\n" |
| 1260 | "Set Hello interval\n" |
| 1261 | "Hello interval value\n" |
| 1262 | "Holdtime 1 second, interval depends on multiplier\n" |
| 1263 | "Specify hello-interval for level-1 IIHs\n" |
| 1264 | ) |
| 1265 | |
| 1266 | DEFUN (isis_hello_interval_l2, |
| 1267 | isis_hello_interval_l2_cmd, |
| 1268 | "isis hello-interval (<1-65535>|minimal) level-2", |
| 1269 | "IS-IS commands\n" |
| 1270 | "Set Hello interval\n" |
| 1271 | "Hello interval value\n" |
| 1272 | "Holdtime 1 second, interval depends on multiplier\n" |
| 1273 | "Specify hello-interval for level-2 IIHs\n" |
| 1274 | ) |
| 1275 | { |
| 1276 | struct isis_circuit *circuit; |
| 1277 | struct interface *ifp; |
| 1278 | long interval; |
| 1279 | char c; |
| 1280 | |
| 1281 | ifp = vty->index; |
| 1282 | circuit = ifp->info; |
| 1283 | if (circuit == NULL) { |
| 1284 | return CMD_WARNING; |
| 1285 | } |
| 1286 | assert (circuit); |
| 1287 | |
| 1288 | c = *argv[0]; |
| 1289 | if (isdigit((int)c)) { |
| 1290 | interval = atoi (argv[0]); |
| 1291 | } else |
| 1292 | interval = HELLO_MINIMAL; |
| 1293 | |
| 1294 | circuit->hello_interval[1] = (u_int16_t)interval; |
| 1295 | |
| 1296 | return CMD_SUCCESS; |
| 1297 | } |
| 1298 | |
| 1299 | DEFUN (no_isis_hello_interval_l2, |
| 1300 | no_isis_hello_interval_l2_cmd, |
| 1301 | "no isis hello-interval level-2", |
| 1302 | NO_STR |
| 1303 | "IS-IS commands\n" |
| 1304 | "Set Hello interval\n" |
| 1305 | "Specify hello-interval for level-2 IIHs\n" |
| 1306 | ) |
| 1307 | { |
| 1308 | struct isis_circuit *circuit; |
| 1309 | struct interface *ifp; |
| 1310 | |
| 1311 | ifp = vty->index; |
| 1312 | circuit = ifp->info; |
| 1313 | if (circuit == NULL) { |
| 1314 | return CMD_WARNING; |
| 1315 | } |
| 1316 | assert (circuit); |
| 1317 | |
| 1318 | |
| 1319 | circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */ |
| 1320 | |
| 1321 | return CMD_SUCCESS; |
| 1322 | } |
| 1323 | |
| 1324 | ALIAS (no_isis_hello_interval_l2, |
| 1325 | no_isis_hello_interval_l2_arg_cmd, |
| 1326 | "no isis hello-interval (<1-65535>|minimal) level-2", |
| 1327 | NO_STR |
| 1328 | "IS-IS commands\n" |
| 1329 | "Set Hello interval\n" |
| 1330 | "Hello interval value\n" |
| 1331 | "Holdtime 1 second, interval depends on multiplier\n" |
| 1332 | "Specify hello-interval for level-2 IIHs\n" |
| 1333 | ) |
| 1334 | |
| 1335 | |
| 1336 | DEFUN (isis_hello_multiplier, |
| 1337 | isis_hello_multiplier_cmd, |
| 1338 | "isis hello-multiplier <3-1000>", |
| 1339 | "IS-IS commands\n" |
| 1340 | "Set multiplier for Hello holding time\n" |
| 1341 | "Hello multiplier value\n" |
| 1342 | ) |
| 1343 | { |
| 1344 | struct isis_circuit *circuit; |
| 1345 | struct interface *ifp; |
| 1346 | int mult; |
| 1347 | |
| 1348 | ifp = vty->index; |
| 1349 | circuit = ifp->info; |
| 1350 | if (circuit == NULL) { |
| 1351 | return CMD_WARNING; |
| 1352 | } |
| 1353 | assert (circuit); |
| 1354 | |
| 1355 | mult = atoi (argv[0]); |
| 1356 | |
| 1357 | circuit->hello_multiplier[0] = (u_int16_t)mult; |
| 1358 | circuit->hello_multiplier[1] = (u_int16_t)mult; |
| 1359 | |
| 1360 | return CMD_SUCCESS; |
| 1361 | } |
| 1362 | |
| 1363 | DEFUN (no_isis_hello_multiplier, |
| 1364 | no_isis_hello_multiplier_cmd, |
| 1365 | "no isis hello-multiplier", |
| 1366 | NO_STR |
| 1367 | "IS-IS commands\n" |
| 1368 | "Set multiplier for Hello holding time\n" |
| 1369 | ) |
| 1370 | { |
| 1371 | struct isis_circuit *circuit; |
| 1372 | struct interface *ifp; |
| 1373 | |
| 1374 | ifp = vty->index; |
| 1375 | circuit = ifp->info; |
| 1376 | if (circuit == NULL) { |
| 1377 | return CMD_WARNING; |
| 1378 | } |
| 1379 | assert (circuit); |
| 1380 | |
| 1381 | circuit->hello_multiplier[0] = HELLO_MULTIPLIER; |
| 1382 | circuit->hello_multiplier[1] = HELLO_MULTIPLIER; |
| 1383 | |
| 1384 | return CMD_SUCCESS; |
| 1385 | } |
| 1386 | |
| 1387 | ALIAS (no_isis_hello_multiplier, |
| 1388 | no_isis_hello_multiplier_arg_cmd, |
| 1389 | "no isis hello-multiplier <3-1000>", |
| 1390 | NO_STR |
| 1391 | "IS-IS commands\n" |
| 1392 | "Set multiplier for Hello holding time\n" |
| 1393 | "Hello multiplier value\n" |
| 1394 | ) |
| 1395 | |
| 1396 | DEFUN (isis_hello_multiplier_l1, |
| 1397 | isis_hello_multiplier_l1_cmd, |
| 1398 | "isis hello-multiplier <3-1000> level-1", |
| 1399 | "IS-IS commands\n" |
| 1400 | "Set multiplier for Hello holding time\n" |
| 1401 | "Hello multiplier value\n" |
| 1402 | "Specify hello multiplier for level-1 IIHs\n" |
| 1403 | ) |
| 1404 | { |
| 1405 | struct isis_circuit *circuit; |
| 1406 | struct interface *ifp; |
| 1407 | int mult; |
| 1408 | |
| 1409 | ifp = vty->index; |
| 1410 | circuit = ifp->info; |
| 1411 | if (circuit == NULL) { |
| 1412 | return CMD_WARNING; |
| 1413 | } |
| 1414 | assert (circuit); |
| 1415 | |
| 1416 | mult = atoi (argv[0]); |
| 1417 | |
| 1418 | circuit->hello_multiplier[0] = (u_int16_t)mult; |
| 1419 | |
| 1420 | return CMD_SUCCESS; |
| 1421 | } |
| 1422 | |
| 1423 | DEFUN (no_isis_hello_multiplier_l1, |
| 1424 | no_isis_hello_multiplier_l1_cmd, |
| 1425 | "no isis hello-multiplier level-1", |
| 1426 | NO_STR |
| 1427 | "IS-IS commands\n" |
| 1428 | "Set multiplier for Hello holding time\n" |
| 1429 | "Specify hello multiplier for level-1 IIHs\n" |
| 1430 | ) |
| 1431 | { |
| 1432 | struct isis_circuit *circuit; |
| 1433 | struct interface *ifp; |
| 1434 | |
| 1435 | ifp = vty->index; |
| 1436 | circuit = ifp->info; |
| 1437 | if (circuit == NULL) { |
| 1438 | return CMD_WARNING; |
| 1439 | } |
| 1440 | assert (circuit); |
| 1441 | |
| 1442 | circuit->hello_multiplier[0] = HELLO_MULTIPLIER; |
| 1443 | |
| 1444 | return CMD_SUCCESS; |
| 1445 | } |
| 1446 | |
| 1447 | ALIAS (no_isis_hello_multiplier_l1, |
| 1448 | no_isis_hello_multiplier_l1_arg_cmd, |
| 1449 | "no isis hello-multiplier <3-1000> level-1", |
| 1450 | NO_STR |
| 1451 | "IS-IS commands\n" |
| 1452 | "Set multiplier for Hello holding time\n" |
| 1453 | "Hello multiplier value\n" |
| 1454 | "Specify hello multiplier for level-1 IIHs\n" |
| 1455 | ) |
| 1456 | |
| 1457 | DEFUN (isis_hello_multiplier_l2, |
| 1458 | isis_hello_multiplier_l2_cmd, |
| 1459 | "isis hello-multiplier <3-1000> level-2", |
| 1460 | "IS-IS commands\n" |
| 1461 | "Set multiplier for Hello holding time\n" |
| 1462 | "Hello multiplier value\n" |
| 1463 | "Specify hello multiplier for level-2 IIHs\n" |
| 1464 | ) |
| 1465 | { |
| 1466 | struct isis_circuit *circuit; |
| 1467 | struct interface *ifp; |
| 1468 | int mult; |
| 1469 | |
| 1470 | ifp = vty->index; |
| 1471 | circuit = ifp->info; |
| 1472 | if (circuit == NULL) { |
| 1473 | return CMD_WARNING; |
| 1474 | } |
| 1475 | assert (circuit); |
| 1476 | |
| 1477 | mult = atoi (argv[0]); |
| 1478 | |
| 1479 | circuit->hello_multiplier[1] = (u_int16_t)mult; |
| 1480 | |
| 1481 | return CMD_SUCCESS; |
| 1482 | } |
| 1483 | |
| 1484 | DEFUN (no_isis_hello_multiplier_l2, |
| 1485 | no_isis_hello_multiplier_l2_cmd, |
| 1486 | "no isis hello-multiplier level-2", |
| 1487 | NO_STR |
| 1488 | "IS-IS commands\n" |
| 1489 | "Set multiplier for Hello holding time\n" |
| 1490 | "Specify hello multiplier for level-2 IIHs\n" |
| 1491 | ) |
| 1492 | { |
| 1493 | struct isis_circuit *circuit; |
| 1494 | struct interface *ifp; |
| 1495 | |
| 1496 | ifp = vty->index; |
| 1497 | circuit = ifp->info; |
| 1498 | if (circuit == NULL) { |
| 1499 | return CMD_WARNING; |
| 1500 | } |
| 1501 | assert (circuit); |
| 1502 | |
| 1503 | circuit->hello_multiplier[1] = HELLO_MULTIPLIER; |
| 1504 | |
| 1505 | return CMD_SUCCESS; |
| 1506 | } |
| 1507 | |
| 1508 | ALIAS (no_isis_hello_multiplier_l2, |
| 1509 | no_isis_hello_multiplier_l2_arg_cmd, |
| 1510 | "no isis hello-multiplier <3-1000> level-2", |
| 1511 | NO_STR |
| 1512 | "IS-IS commands\n" |
| 1513 | "Set multiplier for Hello holding time\n" |
| 1514 | "Hello multiplier value\n" |
| 1515 | "Specify hello multiplier for level-2 IIHs\n" |
| 1516 | ) |
| 1517 | |
| 1518 | DEFUN (isis_hello, |
| 1519 | isis_hello_cmd, |
| 1520 | "isis hello padding", |
| 1521 | "IS-IS commands\n" |
| 1522 | "Add padding to IS-IS hello packets\n" |
| 1523 | "Pad hello packets\n" |
| 1524 | "<cr>\n") |
| 1525 | { |
| 1526 | struct interface *ifp; |
| 1527 | struct isis_circuit *circuit; |
| 1528 | |
| 1529 | ifp = vty->index; |
| 1530 | circuit = ifp->info; |
| 1531 | if (circuit == NULL) { |
| 1532 | return CMD_WARNING; |
| 1533 | } |
| 1534 | assert (circuit); |
| 1535 | |
| 1536 | circuit->u.bc.pad_hellos = 1; |
| 1537 | |
| 1538 | return CMD_SUCCESS; |
| 1539 | } |
| 1540 | |
hasso | 54301ce | 2004-01-27 10:07:34 +0000 | [diff] [blame] | 1541 | #if 0 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1542 | DEFUN (ip_address, |
| 1543 | ip_address_cmd, |
| 1544 | "ip address A.B.C.D/A", |
| 1545 | "Interface Internet Protocol config commands\n" |
| 1546 | "Set the IP address of an interface\n" |
| 1547 | "IP address (e.g. 10.0.0.1/8\n") |
| 1548 | |
| 1549 | { |
| 1550 | struct interface *ifp; |
| 1551 | struct isis_circuit *circuit; |
| 1552 | struct prefix_ipv4 *ipv4, *ip; |
| 1553 | struct listnode *node; |
| 1554 | int ret, found = 1; |
| 1555 | |
| 1556 | ifp = vty->index; |
| 1557 | circuit = ifp->info; |
| 1558 | if (circuit == NULL) { |
| 1559 | return CMD_WARNING; |
| 1560 | } |
| 1561 | |
| 1562 | assert (circuit); |
| 1563 | #ifdef HAVE_IPV6 |
| 1564 | zlog_info ("ip_address_cmd circuit %d", circuit->interface->ifindex); |
| 1565 | #endif /* HAVE_IPV6 */ |
| 1566 | |
| 1567 | ipv4 = prefix_ipv4_new (); |
| 1568 | |
| 1569 | ret = str2prefix_ipv4 (argv[0], ipv4); |
| 1570 | if (ret <= 0) { |
| 1571 | zlog_warn ("ip_address_cmd(): malformed address"); |
| 1572 | vty_out (vty, "%% Malformed address %s", VTY_NEWLINE); |
| 1573 | return CMD_WARNING; |
| 1574 | } |
| 1575 | |
| 1576 | if (!circuit->ip_addrs) |
| 1577 | circuit->ip_addrs = list_new (); |
| 1578 | else { |
| 1579 | for (node = listhead (circuit->ip_addrs); node; nextnode (node)) { |
| 1580 | ip = getdata (node); |
| 1581 | if (prefix_same ((struct prefix *)ip, (struct prefix *)ipv4)) |
| 1582 | found = 1; |
| 1583 | } |
| 1584 | if (found) { |
| 1585 | prefix_ipv4_free (ipv4); |
| 1586 | return CMD_SUCCESS; |
| 1587 | } |
| 1588 | } |
| 1589 | |
| 1590 | |
| 1591 | listnode_add (circuit->ip_addrs, ipv4); |
| 1592 | #ifdef EXTREME_DEBUG |
| 1593 | zlog_info ("added IP address %s to circuit %d", argv[0], |
| 1594 | circuit->interface->ifindex); |
| 1595 | #endif /* EXTREME_DEBUG */ |
| 1596 | return CMD_SUCCESS; |
| 1597 | } |
| 1598 | |
| 1599 | DEFUN (no_ip_address, |
| 1600 | no_ip_address_cmd, |
| 1601 | "no ip address A.B.C.D/A", |
| 1602 | NO_STR |
| 1603 | "Interface Internet Protocol config commands\n" |
| 1604 | "Set the IP address of an interface\n" |
| 1605 | "IP address (e.g. 10.0.0.1/8\n") |
| 1606 | { |
| 1607 | struct interface *ifp; |
| 1608 | struct isis_circuit *circuit; |
| 1609 | struct prefix_ipv4 ipv4, *ip = NULL; |
| 1610 | struct listnode *node; |
| 1611 | int ret; |
| 1612 | |
| 1613 | ifp = vty->index; |
| 1614 | circuit = ifp->info; |
| 1615 | /* UGLY - will remove l8r */ |
| 1616 | if (circuit == NULL) { |
| 1617 | return CMD_WARNING; |
| 1618 | } |
| 1619 | assert (circuit); |
| 1620 | |
| 1621 | if (!circuit->ip_addrs || circuit->ip_addrs->count == 0) { |
| 1622 | vty_out (vty, "Invalid address %s", VTY_NEWLINE); |
| 1623 | return CMD_WARNING; |
| 1624 | } |
| 1625 | ret = str2prefix_ipv4 (argv[0], &ipv4); |
| 1626 | if (ret <= 0) { |
| 1627 | vty_out (vty, "%% Malformed address %s", VTY_NEWLINE); |
| 1628 | return CMD_WARNING; |
| 1629 | } |
| 1630 | |
| 1631 | for (node = listhead (circuit->ip_addrs); node; nextnode (node)) { |
| 1632 | ip = getdata (node); |
| 1633 | if (prefix_same ((struct prefix *)ip, (struct prefix *)&ipv4)) |
| 1634 | break; |
| 1635 | } |
| 1636 | |
| 1637 | if (ip) { |
| 1638 | listnode_delete (circuit->ip_addrs, ip); |
| 1639 | } else { |
| 1640 | vty_out (vty, "Invalid address %s", VTY_NEWLINE); |
| 1641 | } |
| 1642 | |
| 1643 | return CMD_SUCCESS; |
| 1644 | } |
hasso | 54301ce | 2004-01-27 10:07:34 +0000 | [diff] [blame] | 1645 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 1646 | |
| 1647 | DEFUN (no_isis_hello, |
| 1648 | no_isis_hello_cmd, |
| 1649 | "no isis hello padding", |
| 1650 | NO_STR |
| 1651 | "IS-IS commands\n" |
| 1652 | "Add padding to IS-IS hello packets\n" |
| 1653 | "Pad hello packets\n" |
| 1654 | "<cr>\n") |
| 1655 | { |
| 1656 | struct isis_circuit *circuit; |
| 1657 | struct interface *ifp; |
| 1658 | |
| 1659 | ifp = vty->index; |
| 1660 | circuit = ifp->info; |
| 1661 | if (circuit == NULL) { |
| 1662 | return CMD_WARNING; |
| 1663 | } |
| 1664 | assert (circuit); |
| 1665 | |
| 1666 | circuit->u.bc.pad_hellos = 0; |
| 1667 | |
| 1668 | return CMD_SUCCESS; |
| 1669 | } |
| 1670 | |
| 1671 | DEFUN (csnp_interval, |
| 1672 | csnp_interval_cmd, |
| 1673 | "isis csnp-interval <0-65535>", |
| 1674 | "IS-IS commands\n" |
| 1675 | "Set CSNP interval in seconds\n" |
| 1676 | "CSNP interval value\n") |
| 1677 | { |
| 1678 | struct isis_circuit *circuit; |
| 1679 | struct interface *ifp; |
| 1680 | unsigned long interval; |
| 1681 | |
| 1682 | ifp = vty->index; |
| 1683 | circuit = ifp->info; |
| 1684 | if (circuit == NULL) { |
| 1685 | return CMD_WARNING; |
| 1686 | } |
| 1687 | assert (circuit); |
| 1688 | |
| 1689 | interval = atol (argv[0]); |
| 1690 | |
| 1691 | circuit->csnp_interval[0] = (u_int16_t)interval; |
| 1692 | circuit->csnp_interval[1] = (u_int16_t)interval; |
| 1693 | |
| 1694 | return CMD_SUCCESS; |
| 1695 | } |
| 1696 | |
| 1697 | DEFUN (no_csnp_interval, |
| 1698 | no_csnp_interval_cmd, |
| 1699 | "no isis csnp-interval", |
| 1700 | NO_STR |
| 1701 | "IS-IS commands\n" |
| 1702 | "Set CSNP interval in seconds\n" |
| 1703 | ) |
| 1704 | { |
| 1705 | struct isis_circuit *circuit; |
| 1706 | struct interface *ifp; |
| 1707 | |
| 1708 | ifp = vty->index; |
| 1709 | circuit = ifp->info; |
| 1710 | if (circuit == NULL) { |
| 1711 | return CMD_WARNING; |
| 1712 | } |
| 1713 | assert (circuit); |
| 1714 | |
| 1715 | circuit->csnp_interval[0] = CSNP_INTERVAL; |
| 1716 | circuit->csnp_interval[1] = CSNP_INTERVAL; |
| 1717 | |
| 1718 | return CMD_SUCCESS; |
| 1719 | } |
| 1720 | |
| 1721 | ALIAS (no_csnp_interval, |
| 1722 | no_csnp_interval_arg_cmd, |
| 1723 | "no isis csnp-interval <0-65535>", |
| 1724 | NO_STR |
| 1725 | "IS-IS commands\n" |
| 1726 | "Set CSNP interval in seconds\n" |
| 1727 | "CSNP interval value\n") |
| 1728 | |
| 1729 | |
| 1730 | DEFUN (csnp_interval_l1, |
| 1731 | csnp_interval_l1_cmd, |
| 1732 | "isis csnp-interval <0-65535> level-1", |
| 1733 | "IS-IS commands\n" |
| 1734 | "Set CSNP interval in seconds\n" |
| 1735 | "CSNP interval value\n" |
| 1736 | "Specify interval for level-1 CSNPs\n") |
| 1737 | { |
| 1738 | struct isis_circuit *circuit; |
| 1739 | struct interface *ifp; |
| 1740 | unsigned long interval; |
| 1741 | |
| 1742 | ifp = vty->index; |
| 1743 | circuit = ifp->info; |
| 1744 | if (circuit == NULL) { |
| 1745 | return CMD_WARNING; |
| 1746 | } |
| 1747 | assert (circuit); |
| 1748 | |
| 1749 | interval = atol (argv[0]); |
| 1750 | |
| 1751 | circuit->csnp_interval[0] = (u_int16_t)interval; |
| 1752 | |
| 1753 | return CMD_SUCCESS; |
| 1754 | } |
| 1755 | |
| 1756 | DEFUN (no_csnp_interval_l1, |
| 1757 | no_csnp_interval_l1_cmd, |
| 1758 | "no isis csnp-interval level-1", |
| 1759 | NO_STR |
| 1760 | "IS-IS commands\n" |
| 1761 | "Set CSNP interval in seconds\n" |
| 1762 | "Specify interval for level-1 CSNPs\n") |
| 1763 | { |
| 1764 | struct isis_circuit *circuit; |
| 1765 | struct interface *ifp; |
| 1766 | |
| 1767 | ifp = vty->index; |
| 1768 | circuit = ifp->info; |
| 1769 | if (circuit == NULL) { |
| 1770 | return CMD_WARNING; |
| 1771 | } |
| 1772 | assert (circuit); |
| 1773 | |
| 1774 | circuit->csnp_interval[0] = CSNP_INTERVAL; |
| 1775 | |
| 1776 | return CMD_SUCCESS; |
| 1777 | } |
| 1778 | |
| 1779 | ALIAS (no_csnp_interval_l1, |
| 1780 | no_csnp_interval_l1_arg_cmd, |
| 1781 | "no isis csnp-interval <0-65535> level-1", |
| 1782 | NO_STR |
| 1783 | "IS-IS commands\n" |
| 1784 | "Set CSNP interval in seconds\n" |
| 1785 | "CSNP interval value\n" |
| 1786 | "Specify interval for level-1 CSNPs\n") |
| 1787 | |
| 1788 | |
| 1789 | DEFUN (csnp_interval_l2, |
| 1790 | csnp_interval_l2_cmd, |
| 1791 | "isis csnp-interval <0-65535> level-2", |
| 1792 | "IS-IS commands\n" |
| 1793 | "Set CSNP interval in seconds\n" |
| 1794 | "CSNP interval value\n" |
| 1795 | "Specify interval for level-2 CSNPs\n") |
| 1796 | { |
| 1797 | struct isis_circuit *circuit; |
| 1798 | struct interface *ifp; |
| 1799 | unsigned long interval; |
| 1800 | |
| 1801 | ifp = vty->index; |
| 1802 | circuit = ifp->info; |
| 1803 | if (circuit == NULL) { |
| 1804 | return CMD_WARNING; |
| 1805 | } |
| 1806 | assert (circuit); |
| 1807 | |
| 1808 | interval = atol (argv[0]); |
| 1809 | |
| 1810 | circuit->csnp_interval[1] = (u_int16_t)interval; |
| 1811 | |
| 1812 | return CMD_SUCCESS; |
| 1813 | } |
| 1814 | |
| 1815 | DEFUN (no_csnp_interval_l2, |
| 1816 | no_csnp_interval_l2_cmd, |
| 1817 | "no isis csnp-interval level-2", |
| 1818 | NO_STR |
| 1819 | "IS-IS commands\n" |
| 1820 | "Set CSNP interval in seconds\n" |
| 1821 | "Specify interval for level-2 CSNPs\n") |
| 1822 | { |
| 1823 | struct isis_circuit *circuit; |
| 1824 | struct interface *ifp; |
| 1825 | |
| 1826 | ifp = vty->index; |
| 1827 | circuit = ifp->info; |
| 1828 | if (circuit == NULL) { |
| 1829 | return CMD_WARNING; |
| 1830 | } |
| 1831 | assert (circuit); |
| 1832 | |
| 1833 | circuit->csnp_interval[1] = CSNP_INTERVAL; |
| 1834 | |
| 1835 | return CMD_SUCCESS; |
| 1836 | } |
| 1837 | |
| 1838 | ALIAS (no_csnp_interval_l2, |
| 1839 | no_csnp_interval_l2_arg_cmd, |
| 1840 | "no isis csnp-interval <0-65535> level-2", |
| 1841 | NO_STR |
| 1842 | "IS-IS commands\n" |
| 1843 | "Set CSNP interval in seconds\n" |
| 1844 | "CSNP interval value\n" |
| 1845 | "Specify interval for level-2 CSNPs\n") |
| 1846 | |
| 1847 | |
| 1848 | #ifdef HAVE_IPV6 |
| 1849 | DEFUN (ipv6_router_isis, |
| 1850 | ipv6_router_isis_cmd, |
| 1851 | "ipv6 router isis WORD", |
| 1852 | "IPv6 interface subcommands\n" |
| 1853 | "IPv6 Router interface commands\n" |
| 1854 | "IS-IS Routing for IPv6\n" |
| 1855 | "Routing process tag\n") |
| 1856 | { |
| 1857 | struct isis_circuit *c; |
| 1858 | struct interface *ifp; |
| 1859 | struct isis_area *area; |
| 1860 | |
| 1861 | ifp = (struct interface *)vty->index; |
| 1862 | assert (ifp); |
| 1863 | |
| 1864 | area = isis_area_lookup (argv[0]); |
| 1865 | |
| 1866 | /* Prevent more than one circuit per interface */ |
| 1867 | if (area) |
| 1868 | c = circuit_lookup_by_ifp (ifp, area->circuit_list); |
| 1869 | else c = NULL; |
| 1870 | |
| 1871 | if (c && (ifp->info != NULL)) { |
| 1872 | if (c->ipv6_router == 1) { |
| 1873 | vty_out (vty, "ISIS circuit is already defined for IPv6%s", VTY_NEWLINE); |
| 1874 | return CMD_WARNING; |
| 1875 | } |
| 1876 | } |
| 1877 | |
| 1878 | /* this is here for ciscopability */ |
| 1879 | if (!area) { |
| 1880 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 1881 | return CMD_WARNING; |
| 1882 | } |
| 1883 | |
| 1884 | if (!c) { |
| 1885 | c = circuit_lookup_by_ifp (ifp, isis->init_circ_list); |
| 1886 | c = isis_csm_state_change (ISIS_ENABLE, c, area); |
| 1887 | c->interface = ifp; |
| 1888 | ifp->info = c; |
| 1889 | } |
| 1890 | |
| 1891 | if(!c) |
| 1892 | return CMD_WARNING; |
| 1893 | |
| 1894 | c->ipv6_router = 1; |
| 1895 | area->ipv6_circuits++; |
| 1896 | circuit_update_nlpids (c); |
| 1897 | |
| 1898 | vty->node = INTERFACE_NODE; |
| 1899 | |
| 1900 | return CMD_SUCCESS; |
| 1901 | } |
| 1902 | |
| 1903 | DEFUN (no_ipv6_router_isis, |
| 1904 | no_ipv6_router_isis_cmd, |
| 1905 | "no ipv6 router isis WORD", |
| 1906 | NO_STR |
| 1907 | "IPv6 interface subcommands\n" |
| 1908 | "IPv6 Router interface commands\n" |
| 1909 | "IS-IS Routing for IPv6\n" |
| 1910 | "Routing process tag\n") |
| 1911 | { |
| 1912 | struct isis_circuit *c; |
| 1913 | struct interface *ifp; |
| 1914 | struct isis_area *area; |
| 1915 | |
| 1916 | ifp = (struct interface *)vty->index; |
| 1917 | /* UGLY - will remove l8r |
| 1918 | if (circuit == NULL) { |
| 1919 | return CMD_WARNING; |
| 1920 | } */ |
| 1921 | assert (ifp); |
| 1922 | |
| 1923 | area = isis_area_lookup (argv[0]); |
| 1924 | if (!area) { |
| 1925 | vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); |
| 1926 | return CMD_WARNING; |
| 1927 | } |
| 1928 | |
| 1929 | c = circuit_lookup_by_ifp (ifp, area->circuit_list); |
| 1930 | if (!c) |
| 1931 | return CMD_WARNING; |
| 1932 | |
| 1933 | c->ipv6_router = 0; |
| 1934 | area->ipv6_circuits--; |
| 1935 | if (c->ip_router == 0) |
| 1936 | isis_csm_state_change (ISIS_DISABLE, c, area); |
| 1937 | |
| 1938 | return CMD_SUCCESS; |
| 1939 | } |
| 1940 | |
| 1941 | #if 0 /* Guess we don't really need these */ |
| 1942 | |
| 1943 | DEFUN (ipv6_address, |
| 1944 | ipv6_address_cmd, |
| 1945 | "ipv6 address X:X::X:X/M", |
| 1946 | "Interface Internet Protocol config commands\n" |
| 1947 | "Set the IP address of an interface\n" |
| 1948 | "IPv6 address (e.g. 3ffe:506::1/48)\n") |
| 1949 | { |
| 1950 | struct interface *ifp; |
| 1951 | struct isis_circuit *circuit; |
| 1952 | struct prefix_ipv6 *ipv6, *ip6; |
| 1953 | struct listnode *node; |
| 1954 | int ret, found = 1; |
| 1955 | |
| 1956 | ifp = vty->index; |
| 1957 | circuit = ifp->info; |
| 1958 | /* UGLY - will remove l8r */ |
| 1959 | if (circuit == NULL) { |
| 1960 | return CMD_WARNING; |
| 1961 | } |
| 1962 | assert (circuit); |
| 1963 | #ifdef EXTREME_DEBUG |
| 1964 | zlog_info ("ipv6_address_cmd circuit %d", circuit->idx); |
| 1965 | #endif /* EXTREME_DEBUG */ |
| 1966 | |
| 1967 | if (circuit == NULL) { |
| 1968 | zlog_warn ("ipv6_address_cmd(): no circuit"); |
| 1969 | return CMD_WARNING; |
| 1970 | } |
| 1971 | |
| 1972 | |
| 1973 | ipv6 = prefix_ipv6_new (); |
| 1974 | |
| 1975 | ret = str2prefix_ipv6 (argv[0], ipv6); |
| 1976 | if (ret <= 0) { |
| 1977 | vty_out (vty, "%% Malformed address %s", VTY_NEWLINE); |
| 1978 | return CMD_WARNING; |
| 1979 | } |
| 1980 | |
| 1981 | if (!circuit->ipv6_addrs) |
| 1982 | circuit->ipv6_addrs = list_new (); |
| 1983 | else { |
| 1984 | for (node = listhead (circuit->ipv6_addrs); node; nextnode (node)) { |
| 1985 | ip6 = getdata (node); |
| 1986 | if (prefix_same ((struct prefix *)ip6, (struct prefix *)ipv6)) |
| 1987 | found = 1; |
| 1988 | } |
| 1989 | if (found) { |
| 1990 | prefix_ipv6_free (ipv6); |
| 1991 | return CMD_SUCCESS; |
| 1992 | } |
| 1993 | } |
| 1994 | |
| 1995 | |
| 1996 | listnode_add (circuit->ipv6_addrs, ipv6); |
| 1997 | #ifdef EXTREME_DEBUG |
| 1998 | zlog_info ("added IPv6 address %s to circuit %d", argv[0], circuit->idx); |
| 1999 | #endif /* EXTREME_DEBUG */ |
| 2000 | |
| 2001 | return CMD_SUCCESS; |
| 2002 | } |
| 2003 | |
| 2004 | DEFUN (no_ipv6_address, |
| 2005 | no_ipv6_address_cmd, |
| 2006 | "no ipv6 address X:X::X:X/M", |
| 2007 | NO_STR |
| 2008 | "Interface Internet Protocol config commands\n" |
| 2009 | "Set the IP address of an interface\n" |
| 2010 | "IPv6 address (e.g. 3ffe:506::1/48)\n") |
| 2011 | { |
| 2012 | struct interface *ifp; |
| 2013 | struct isis_circuit *circuit; |
| 2014 | struct prefix_ipv6 ipv6, *ip6 = NULL; |
| 2015 | struct listnode *node; |
| 2016 | int ret; |
| 2017 | |
| 2018 | ifp = vty->index; |
| 2019 | circuit = ifp->info; |
| 2020 | /* UGLY - will remove l8r */ |
| 2021 | if (circuit == NULL) { |
| 2022 | return CMD_WARNING; |
| 2023 | } |
| 2024 | assert (circuit); |
| 2025 | |
| 2026 | if (!circuit->ipv6_addrs || circuit->ipv6_addrs->count == 0) { |
| 2027 | vty_out (vty, "Invalid address %s", VTY_NEWLINE); |
| 2028 | return CMD_WARNING; |
| 2029 | } |
| 2030 | ret = str2prefix_ipv6 (argv[0], &ipv6); |
| 2031 | if (ret <= 0) { |
| 2032 | vty_out (vty, "%% Malformed address %s", VTY_NEWLINE); |
| 2033 | return CMD_WARNING; |
| 2034 | } |
| 2035 | |
| 2036 | for (node = listhead (circuit->ipv6_addrs); node; nextnode (node)) { |
| 2037 | ip6 = getdata (node); |
| 2038 | if (prefix_same ((struct prefix *)ip6, (struct prefix *)&ipv6)) |
| 2039 | break; |
| 2040 | } |
| 2041 | |
| 2042 | if (ip6) { |
| 2043 | listnode_delete (circuit->ipv6_addrs, ip6); |
| 2044 | } else { |
| 2045 | vty_out (vty, "Invalid address %s", VTY_NEWLINE); |
| 2046 | } |
| 2047 | |
| 2048 | return CMD_SUCCESS; |
| 2049 | } |
| 2050 | #endif /* 0 */ |
| 2051 | #endif /* HAVE_IPV6 */ |
| 2052 | |
| 2053 | |
| 2054 | struct cmd_node interface_node = |
| 2055 | { |
| 2056 | INTERFACE_NODE, |
| 2057 | "%s(config-if)# ", |
| 2058 | 1, |
| 2059 | }; |
| 2060 | |
| 2061 | |
| 2062 | int |
| 2063 | isis_if_new_hook (struct interface *ifp) |
| 2064 | { |
| 2065 | /* FIXME: Discuss if the circuit should be created here |
| 2066 | ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */ |
| 2067 | ifp->info = NULL; |
| 2068 | return 0; |
| 2069 | } |
| 2070 | |
| 2071 | int |
| 2072 | isis_if_delete_hook (struct interface *ifp) |
| 2073 | { |
| 2074 | /* FIXME: Discuss if the circuit should be created here |
| 2075 | XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/ |
| 2076 | ifp->info = NULL; |
| 2077 | return 0; |
| 2078 | } |
| 2079 | |
| 2080 | |
| 2081 | void |
| 2082 | isis_circuit_init () |
| 2083 | { |
| 2084 | |
| 2085 | /* Initialize Zebra interface data structure */ |
| 2086 | if_init (); |
| 2087 | if_add_hook (IF_NEW_HOOK, isis_if_new_hook); |
| 2088 | if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook); |
| 2089 | |
| 2090 | /* Install interface node */ |
| 2091 | install_node (&interface_node, isis_interface_config_write); |
| 2092 | install_element (CONFIG_NODE, &interface_cmd); |
| 2093 | |
| 2094 | install_default (INTERFACE_NODE); |
| 2095 | install_element (INTERFACE_NODE, &interface_desc_cmd); |
| 2096 | install_element (INTERFACE_NODE, &no_interface_desc_cmd); |
| 2097 | |
| 2098 | install_element (INTERFACE_NODE, &ip_router_isis_cmd); |
| 2099 | install_element (INTERFACE_NODE, &no_ip_router_isis_cmd); |
| 2100 | |
| 2101 | install_element (INTERFACE_NODE, &isis_circuit_type_cmd); |
| 2102 | install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd); |
| 2103 | |
| 2104 | install_element (INTERFACE_NODE, &isis_passwd_cmd); |
| 2105 | install_element (INTERFACE_NODE, &no_isis_passwd_cmd); |
| 2106 | |
| 2107 | install_element (INTERFACE_NODE, &isis_priority_cmd); |
| 2108 | install_element (INTERFACE_NODE, &no_isis_priority_cmd); |
| 2109 | install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd); |
| 2110 | install_element (INTERFACE_NODE, &isis_priority_l1_cmd); |
| 2111 | install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd); |
| 2112 | install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd); |
| 2113 | install_element (INTERFACE_NODE, &isis_priority_l2_cmd); |
| 2114 | install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd); |
| 2115 | install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd); |
| 2116 | |
| 2117 | install_element (INTERFACE_NODE, &isis_metric_cmd); |
| 2118 | install_element (INTERFACE_NODE, &no_isis_metric_cmd); |
| 2119 | install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd); |
| 2120 | |
| 2121 | install_element (INTERFACE_NODE, &isis_hello_interval_cmd); |
| 2122 | install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd); |
| 2123 | install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd); |
| 2124 | install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd); |
| 2125 | install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd); |
| 2126 | install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd); |
| 2127 | install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd); |
| 2128 | install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd); |
| 2129 | install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd); |
| 2130 | |
| 2131 | install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd); |
| 2132 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd); |
| 2133 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd); |
| 2134 | install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd); |
| 2135 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd); |
| 2136 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd); |
| 2137 | install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd); |
| 2138 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd); |
| 2139 | install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd); |
| 2140 | |
| 2141 | install_element (INTERFACE_NODE, &isis_hello_cmd); |
| 2142 | install_element (INTERFACE_NODE, &no_isis_hello_cmd); |
hasso | 38a61c7 | 2004-01-27 13:40:14 +0000 | [diff] [blame] | 2143 | #if 0 |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2144 | install_element (INTERFACE_NODE, &ip_address_cmd); |
| 2145 | install_element (INTERFACE_NODE, &no_ip_address_cmd); |
hasso | 38a61c7 | 2004-01-27 13:40:14 +0000 | [diff] [blame] | 2146 | #endif |
jardin | eb5d44e | 2003-12-23 08:09:43 +0000 | [diff] [blame] | 2147 | install_element (INTERFACE_NODE, &csnp_interval_cmd); |
| 2148 | install_element (INTERFACE_NODE, &no_csnp_interval_cmd); |
| 2149 | install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd); |
| 2150 | install_element (INTERFACE_NODE, &csnp_interval_l1_cmd); |
| 2151 | install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd); |
| 2152 | install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd); |
| 2153 | install_element (INTERFACE_NODE, &csnp_interval_l2_cmd); |
| 2154 | install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd); |
| 2155 | install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd); |
| 2156 | |
| 2157 | #ifdef HAVE_IPV6 |
| 2158 | install_element (INTERFACE_NODE, &ipv6_router_isis_cmd); |
| 2159 | install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd); |
| 2160 | #if 0 |
| 2161 | install_element (INTERFACE_NODE, &ipv6_address_cmd); |
| 2162 | install_element (INTERFACE_NODE, &no_ipv6_address_cmd); |
| 2163 | #endif |
| 2164 | #endif |
| 2165 | |
| 2166 | } |