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