2 * IS-IS Rout(e)ing protocol - isis_circuit.h
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
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)
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
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.
27 #include <net/ethernet.h>
29 #include <netinet/if_ether.h>
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"
60 extern struct thread_master
*master
;
61 extern struct isis
*isis
;
66 struct isis_circuit
*circuit
;
69 circuit
= XMALLOC (MTYPE_ISIS_CIRCUIT
, sizeof (struct isis_circuit
));
72 memset (circuit
, 0, sizeof (struct isis_circuit
));
73 /* set default metrics for circuit */
74 for (i
= 0; i
< 2; i
++)
76 circuit
->metrics
[i
].metric_default
= DEFAULT_CIRCUIT_METRICS
;
77 circuit
->metrics
[i
].metric_expense
= METRICS_UNSUPPORTED
;
78 circuit
->metrics
[i
].metric_error
= METRICS_UNSUPPORTED
;
79 circuit
->metrics
[i
].metric_delay
= METRICS_UNSUPPORTED
;
84 zlog_err ("Can't malloc isis circuit");
92 isis_circuit_configure (struct isis_circuit
*circuit
, struct isis_area
*area
)
97 * The level for the circuit is same as for the area, unless configured
100 circuit
->circuit_is_type
= area
->is_type
;
104 for (i
= 0; i
< 2; i
++)
106 circuit
->hello_interval
[i
] = HELLO_INTERVAL
;
107 circuit
->hello_multiplier
[i
] = HELLO_MULTIPLIER
;
108 circuit
->csnp_interval
[i
] = CSNP_INTERVAL
;
109 circuit
->psnp_interval
[i
] = PSNP_INTERVAL
;
110 circuit
->u
.bc
.priority
[i
] = DEFAULT_PRIORITY
;
112 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
114 circuit
->u
.bc
.adjdb
[0] = list_new ();
115 circuit
->u
.bc
.adjdb
[1] = list_new ();
116 circuit
->u
.bc
.pad_hellos
= 1;
118 circuit
->lsp_interval
= LSP_INTERVAL
;
121 * Add the circuit into area
123 listnode_add (area
->circuit_list
, circuit
);
125 circuit
->idx
= flags_get_index (&area
->flags
);
126 circuit
->lsp_queue
= list_new ();
132 isis_circuit_deconfigure (struct isis_circuit
*circuit
,
133 struct isis_area
*area
)
136 /* Remove circuit from area */
137 listnode_delete (area
->circuit_list
, circuit
);
138 /* Free the index of SRM and SSN flags */
139 flags_free_index (&area
->flags
, circuit
->idx
);
144 struct isis_circuit
*
145 circuit_lookup_by_ifp (struct interface
*ifp
, struct list
*list
)
147 struct isis_circuit
*circuit
= NULL
;
148 struct listnode
*node
;
153 for (ALL_LIST_ELEMENTS_RO (list
, node
, circuit
))
154 if (circuit
->interface
== ifp
)
160 struct isis_circuit
*
161 circuit_scan_by_ifp (struct interface
*ifp
)
163 struct isis_area
*area
;
164 struct listnode
*node
;
165 struct isis_circuit
*circuit
;
167 if (!isis
->area_list
)
170 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
172 circuit
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
177 return circuit_lookup_by_ifp (ifp
, isis
->init_circ_list
);
181 isis_circuit_del (struct isis_circuit
*circuit
)
187 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
189 /* destroy adjacency databases */
190 if (circuit
->u
.bc
.adjdb
[0])
191 list_delete (circuit
->u
.bc
.adjdb
[0]);
192 if (circuit
->u
.bc
.adjdb
[1])
193 list_delete (circuit
->u
.bc
.adjdb
[1]);
194 /* destroy neighbour lists */
195 if (circuit
->u
.bc
.lan_neighs
[0])
196 list_delete (circuit
->u
.bc
.lan_neighs
[0]);
197 if (circuit
->u
.bc
.lan_neighs
[1])
198 list_delete (circuit
->u
.bc
.lan_neighs
[1]);
199 /* destroy addresses */
201 if (circuit
->ip_addrs
)
202 list_delete (circuit
->ip_addrs
);
204 if (circuit
->ipv6_link
)
205 list_delete (circuit
->ipv6_link
);
206 if (circuit
->ipv6_non_link
)
207 list_delete (circuit
->ipv6_non_link
);
208 #endif /* HAVE_IPV6 */
210 /* and lastly the circuit itself */
211 XFREE (MTYPE_ISIS_CIRCUIT
, circuit
);
217 isis_circuit_add_addr (struct isis_circuit
*circuit
,
218 struct connected
*connected
)
220 struct prefix_ipv4
*ipv4
;
223 struct prefix_ipv6
*ipv6
;
224 #endif /* HAVE_IPV6 */
226 if (!circuit
->ip_addrs
)
227 circuit
->ip_addrs
= list_new ();
229 if (!circuit
->ipv6_link
)
230 circuit
->ipv6_link
= list_new ();
231 if (!circuit
->ipv6_non_link
)
232 circuit
->ipv6_non_link
= list_new ();
233 #endif /* HAVE_IPV6 */
235 memset (&buf
, 0, BUFSIZ
);
236 if (connected
->address
->family
== AF_INET
)
238 ipv4
= prefix_ipv4_new ();
239 ipv4
->prefixlen
= connected
->address
->prefixlen
;
240 ipv4
->prefix
= connected
->address
->u
.prefix4
;
241 listnode_add (circuit
->ip_addrs
, ipv4
);
243 lsp_regenerate_schedule (circuit
->area
);
246 prefix2str (connected
->address
, buf
, BUFSIZ
);
247 zlog_debug ("Added IP address %s to circuit %d", buf
,
248 circuit
->circuit_id
);
249 #endif /* EXTREME_DEBUG */
252 if (connected
->address
->family
== AF_INET6
)
254 ipv6
= prefix_ipv6_new ();
255 ipv6
->prefixlen
= connected
->address
->prefixlen
;
256 ipv6
->prefix
= connected
->address
->u
.prefix6
;
258 if (IN6_IS_ADDR_LINKLOCAL (&ipv6
->prefix
))
259 listnode_add (circuit
->ipv6_link
, ipv6
);
261 listnode_add (circuit
->ipv6_non_link
, ipv6
);
263 lsp_regenerate_schedule (circuit
->area
);
266 prefix2str (connected
->address
, buf
, BUFSIZ
);
267 zlog_debug ("Added IPv6 address %s to circuit %d", buf
,
268 circuit
->circuit_id
);
269 #endif /* EXTREME_DEBUG */
271 #endif /* HAVE_IPV6 */
276 isis_circuit_del_addr (struct isis_circuit
*circuit
,
277 struct connected
*connected
)
279 struct prefix_ipv4
*ipv4
, *ip
= NULL
;
280 struct listnode
*node
;
284 struct prefix_ipv6
*ipv6
, *ip6
= NULL
;
285 #endif /* HAVE_IPV6 */
287 memset (&buf
, 0, BUFSIZ
);
288 if (connected
->address
->family
== AF_INET
)
290 ipv4
= prefix_ipv4_new ();
291 ipv4
->prefixlen
= connected
->address
->prefixlen
;
292 ipv4
->prefix
= connected
->address
->u
.prefix4
;
294 for (ALL_LIST_ELEMENTS_RO (circuit
->ip_addrs
, node
, ip
))
295 if (prefix_same ((struct prefix
*) ip
, (struct prefix
*) &ipv4
))
300 listnode_delete (circuit
->ip_addrs
, ip
);
302 lsp_regenerate_schedule (circuit
->area
);
306 prefix2str (connected
->address
, (char *)buf
, BUFSIZ
);
307 zlog_warn("Nonexitant ip address %s removal attempt from circuit \
308 %d", buf
, circuit
->circuit_id
);
312 if (connected
->address
->family
== AF_INET6
)
314 ipv6
= prefix_ipv6_new ();
315 ipv6
->prefixlen
= connected
->address
->prefixlen
;
316 ipv6
->prefix
= connected
->address
->u
.prefix6
;
318 if (IN6_IS_ADDR_LINKLOCAL (&ipv6
->prefix
))
320 for (ALL_LIST_ELEMENTS_RO (circuit
->ipv6_link
, node
, ip6
))
322 if (prefix_same ((struct prefix
*) ip6
, (struct prefix
*) ipv6
))
327 listnode_delete (circuit
->ipv6_link
, ip6
);
333 for (ALL_LIST_ELEMENTS_RO (circuit
->ipv6_non_link
, node
, ip6
))
335 if (prefix_same ((struct prefix
*) ip6
, (struct prefix
*) ipv6
))
340 listnode_delete (circuit
->ipv6_non_link
, ip6
);
347 prefix2str (connected
->address
, (char *)buf
, BUFSIZ
);
348 zlog_warn("Nonexitant ip address %s removal attempt from \
349 circuit %d", buf
, circuit
->circuit_id
);
353 lsp_regenerate_schedule (circuit
->area
);
355 #endif /* HAVE_IPV6 */
360 isis_circuit_if_add (struct isis_circuit
*circuit
, struct interface
*ifp
)
362 struct listnode
*node
, *nnode
;
363 struct connected
*conn
;
365 circuit
->interface
= ifp
;
368 circuit
->circuit_id
= ifp
->ifindex
% 255; /* FIXME: Why not ? */
370 /* isis_circuit_update_addrs (circuit, ifp); */
372 if (if_is_broadcast (ifp
))
374 circuit
->circ_type
= CIRCUIT_T_BROADCAST
;
376 * Get the Hardware Address
378 #ifdef HAVE_SOCKADDR_DL
379 if (circuit
->interface
->sdl
.sdl_alen
!= ETHER_ADDR_LEN
)
380 zlog_warn ("unsupported link layer");
382 memcpy (circuit
->u
.bc
.snpa
, LLADDR (&circuit
->interface
->sdl
),
385 if (circuit
->interface
->hw_addr_len
!= ETH_ALEN
)
387 zlog_warn ("unsupported link layer");
391 memcpy (circuit
->u
.bc
.snpa
, circuit
->interface
->hw_addr
, ETH_ALEN
);
394 zlog_debug ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
395 circuit
->interface
->ifindex
, ISO_MTU (circuit
),
396 snpa_print (circuit
->u
.bc
.snpa
));
398 #endif /* EXTREME_DEBUG */
399 #endif /* HAVE_SOCKADDR_DL */
401 else if (if_is_pointopoint (ifp
))
403 circuit
->circ_type
= CIRCUIT_T_P2P
;
407 zlog_warn ("isis_circuit_if_add: unsupported media");
410 for (ALL_LIST_ELEMENTS (ifp
->connected
, node
, nnode
, conn
))
411 isis_circuit_add_addr (circuit
, conn
);
417 isis_circuit_update_params (struct isis_circuit
*circuit
,
418 struct interface
*ifp
)
422 if (circuit
->circuit_id
!= ifp
->ifindex
)
424 zlog_warn ("changing circuit_id %d->%d", circuit
->circuit_id
,
426 circuit
->circuit_id
= ifp
->ifindex
% 255;
429 /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
430 /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig)
431 The areas MTU is the minimum of mtu's of circuits in the area
432 now we can't catch the change
433 if (circuit->mtu != ifp->mtu) {
434 zlog_warn ("changing circuit mtu %d->%d", circuit->mtu,
436 circuit->mtu = ifp->mtu;
440 * Get the Hardware Address
442 #ifdef HAVE_SOCKADDR_DL
443 if (circuit
->interface
->sdl
.sdl_alen
!= ETHER_ADDR_LEN
)
444 zlog_warn ("unsupported link layer");
446 memcpy (circuit
->u
.bc
.snpa
, LLADDR (&circuit
->interface
->sdl
), ETH_ALEN
);
448 if (circuit
->interface
->hw_addr_len
!= ETH_ALEN
)
450 zlog_warn ("unsupported link layer");
454 if (memcmp (circuit
->u
.bc
.snpa
, circuit
->interface
->hw_addr
, ETH_ALEN
))
456 zlog_warn ("changing circuit snpa %s->%s",
457 snpa_print (circuit
->u
.bc
.snpa
),
458 snpa_print (circuit
->interface
->hw_addr
));
463 if (if_is_broadcast (ifp
))
465 circuit
->circ_type
= CIRCUIT_T_BROADCAST
;
467 else if (if_is_pointopoint (ifp
))
469 circuit
->circ_type
= CIRCUIT_T_P2P
;
473 zlog_warn ("isis_circuit_update_params: unsupported media");
480 isis_circuit_if_del (struct isis_circuit
*circuit
)
482 circuit
->interface
->info
= NULL
;
483 circuit
->interface
= NULL
;
489 isis_circuit_up (struct isis_circuit
*circuit
)
492 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
494 if (circuit
->area
->min_bcast_mtu
== 0 ||
495 ISO_MTU (circuit
) < circuit
->area
->min_bcast_mtu
)
496 circuit
->area
->min_bcast_mtu
= ISO_MTU (circuit
);
498 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
501 /* initilizing the hello sending threads
505 /* 8.4.1 a) commence sending of IIH PDUs */
507 if (circuit
->circuit_is_type
& IS_LEVEL_1
)
509 thread_add_event (master
, send_lan_l1_hello
, circuit
, 0);
510 circuit
->u
.bc
.lan_neighs
[0] = list_new ();
513 if (circuit
->circuit_is_type
& IS_LEVEL_2
)
515 thread_add_event (master
, send_lan_l2_hello
, circuit
, 0);
516 circuit
->u
.bc
.lan_neighs
[1] = list_new ();
519 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
520 /* 8.4.1 c) FIXME: listen for ESH PDUs */
523 /* dr election will commence in... */
524 if (circuit
->circuit_is_type
& IS_LEVEL_1
)
525 THREAD_TIMER_ON (master
, circuit
->u
.bc
.t_run_dr
[0], isis_run_dr_l1
,
526 circuit
, 2 * circuit
->hello_interval
[0]);
527 if (circuit
->circuit_is_type
& IS_LEVEL_2
)
528 THREAD_TIMER_ON (master
, circuit
->u
.bc
.t_run_dr
[1], isis_run_dr_l2
,
529 circuit
, 2 * circuit
->hello_interval
[1]);
533 /* initializing the hello send threads
536 thread_add_event (master
, send_p2p_hello
, circuit
, 0);
540 /* initializing PSNP timers */
541 if (circuit
->circuit_is_type
& IS_LEVEL_1
)
543 THREAD_TIMER_ON (master
, circuit
->t_send_psnp
[0], send_l1_psnp
, circuit
,
544 isis_jitter (circuit
->psnp_interval
[0], PSNP_JITTER
));
547 if (circuit
->circuit_is_type
& IS_LEVEL_2
)
549 THREAD_TIMER_ON (master
, circuit
->t_send_psnp
[1], send_l2_psnp
, circuit
,
550 isis_jitter (circuit
->psnp_interval
[1], PSNP_JITTER
));
553 /* initialize the circuit streams */
554 if (circuit
->rcv_stream
== NULL
)
555 circuit
->rcv_stream
= stream_new (ISO_MTU (circuit
));
557 if (circuit
->snd_stream
== NULL
)
558 circuit
->snd_stream
= stream_new (ISO_MTU (circuit
));
560 /* unified init for circuits */
561 isis_sock_init (circuit
);
564 THREAD_READ_ON (master
, circuit
->t_read
, isis_receive
, circuit
,
567 THREAD_TIMER_ON (master
, circuit
->t_read
, isis_receive
, circuit
,
574 isis_circuit_down (struct isis_circuit
*circuit
)
576 /* Cancel all active threads -- FIXME: wrong place */
577 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
578 THREAD_OFF (circuit
->t_read
);
579 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
581 THREAD_TIMER_OFF (circuit
->u
.bc
.t_send_lan_hello
[0]);
582 THREAD_TIMER_OFF (circuit
->u
.bc
.t_send_lan_hello
[1]);
583 THREAD_TIMER_OFF (circuit
->u
.bc
.t_run_dr
[0]);
584 THREAD_TIMER_OFF (circuit
->u
.bc
.t_run_dr
[1]);
586 else if (circuit
->circ_type
== CIRCUIT_T_P2P
)
588 THREAD_TIMER_OFF (circuit
->u
.p2p
.t_send_p2p_hello
);
590 /* close the socket */
597 circuit_update_nlpids (struct isis_circuit
*circuit
)
599 circuit
->nlpids
.count
= 0;
601 if (circuit
->ip_router
)
603 circuit
->nlpids
.nlpids
[0] = NLPID_IP
;
604 circuit
->nlpids
.count
++;
607 if (circuit
->ipv6_router
)
609 circuit
->nlpids
.nlpids
[circuit
->nlpids
.count
] = NLPID_IPV6
;
610 circuit
->nlpids
.count
++;
612 #endif /* HAVE_IPV6 */
617 isis_interface_config_write (struct vty
*vty
)
621 struct listnode
*node
, *nnode
;
622 struct listnode
*node2
, *nnode2
;
623 struct interface
*ifp
;
624 struct isis_area
*area
;
625 struct isis_circuit
*c
;
628 for (ALL_LIST_ELEMENTS (iflist
, node
, nnode
, ifp
))
631 vty_out (vty
, "interface %s%s", ifp
->name
, VTY_NEWLINE
);
636 vty_out (vty
, " description %s%s", ifp
->desc
, VTY_NEWLINE
);
640 for (ALL_LIST_ELEMENTS (isis
->area_list
, node2
, nnode2
, area
))
642 c
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
647 vty_out (vty
, " ip router isis %s%s", area
->area_tag
,
654 vty_out (vty
, " ipv6 router isis %s%s", area
->area_tag
,
658 #endif /* HAVE_IPV6 */
660 /* ISIS - circuit type */
661 if (c
->circuit_is_type
== IS_LEVEL_1
)
663 vty_out (vty
, " isis circuit-type level-1%s", VTY_NEWLINE
);
668 if (c
->circuit_is_type
== IS_LEVEL_2
)
670 vty_out (vty
, " isis circuit-type level-2-only%s",
676 /* ISIS - CSNP interval - FIXME: compare to cisco */
677 if (c
->csnp_interval
[0] == c
->csnp_interval
[1])
679 if (c
->csnp_interval
[0] != CSNP_INTERVAL
)
681 vty_out (vty
, " isis csnp-interval %d%s",
682 c
->csnp_interval
[0], VTY_NEWLINE
);
688 for (i
= 0; i
< 2; i
++)
690 if (c
->csnp_interval
[1] != CSNP_INTERVAL
)
692 vty_out (vty
, " isis csnp-interval %d level-%d%s",
693 c
->csnp_interval
[1], i
+ 1, VTY_NEWLINE
);
699 /* ISIS - Hello padding - Defaults to true so only display if false */
700 if (c
->circ_type
== CIRCUIT_T_BROADCAST
&& !c
->u
.bc
.pad_hellos
)
702 vty_out (vty
, " no isis hello padding%s", VTY_NEWLINE
);
706 /* ISIS - Hello interval - FIXME: compare to cisco */
707 if (c
->hello_interval
[0] == c
->hello_interval
[1])
709 if (c
->hello_interval
[0] != HELLO_INTERVAL
)
711 vty_out (vty
, " isis hello-interval %d%s",
712 c
->hello_interval
[0], VTY_NEWLINE
);
718 for (i
= 0; i
< 2; i
++)
720 if (c
->hello_interval
[i
] != HELLO_INTERVAL
)
722 if (c
->hello_interval
[i
] == HELLO_MINIMAL
)
725 " isis hello-interval minimal level-%d%s",
730 vty_out (vty
, " isis hello-interval %d level-%d%s",
731 c
->hello_interval
[i
], i
+ 1, VTY_NEWLINE
);
738 /* ISIS - Hello Multiplier */
739 if (c
->hello_multiplier
[0] == c
->hello_multiplier
[1])
741 if (c
->hello_multiplier
[0] != HELLO_MULTIPLIER
)
743 vty_out (vty
, " isis hello-multiplier %d%s",
744 c
->hello_multiplier
[0], VTY_NEWLINE
);
750 for (i
= 0; i
< 2; i
++)
752 if (c
->hello_multiplier
[i
] != HELLO_MULTIPLIER
)
754 vty_out (vty
, " isis hello-multiplier %d level-%d%s",
755 c
->hello_multiplier
[i
], i
+ 1, VTY_NEWLINE
);
760 /* ISIS - Priority */
761 if (c
->circ_type
== CIRCUIT_T_BROADCAST
)
763 if (c
->u
.bc
.priority
[0] == c
->u
.bc
.priority
[1])
765 if (c
->u
.bc
.priority
[0] != DEFAULT_PRIORITY
)
767 vty_out (vty
, " isis priority %d%s",
768 c
->u
.bc
.priority
[0], VTY_NEWLINE
);
774 for (i
= 0; i
< 2; i
++)
776 if (c
->u
.bc
.priority
[i
] != DEFAULT_PRIORITY
)
778 vty_out (vty
, " isis priority %d level-%d%s",
779 c
->u
.bc
.priority
[i
], i
+ 1, VTY_NEWLINE
);
786 if (c
->metrics
[0].metric_default
== c
->metrics
[1].metric_default
)
788 if (c
->metrics
[0].metric_default
!= DEFAULT_CIRCUIT_METRICS
)
790 vty_out (vty
, " isis metric %d%s",
791 c
->metrics
[0].metric_default
, VTY_NEWLINE
);
797 for (i
= 0; i
< 2; i
++)
799 if (c
->metrics
[i
].metric_default
!= DEFAULT_CIRCUIT_METRICS
)
801 vty_out (vty
, " isis metric %d level-%d%s",
802 c
->metrics
[i
].metric_default
, i
+ 1,
811 vty_out (vty
, "!%s", VTY_NEWLINE
);
817 DEFUN (ip_router_isis
,
819 "ip router isis WORD",
820 "Interface Internet Protocol config commands\n"
821 "IP router interface commands\n"
822 "IS-IS Routing for IP\n"
823 "Routing process tag\n")
825 struct isis_circuit
*c
;
826 struct interface
*ifp
;
827 struct isis_area
*area
;
829 ifp
= (struct interface
*) vty
->index
;
832 area
= isis_area_lookup (argv
[0]);
834 /* Prevent more than one circuit per interface */
836 c
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
839 if (c
&& (ifp
->info
!= NULL
))
842 if (c
->ipv6_router
== 0)
844 #endif /* HAVE_IPV6 */
845 vty_out (vty
, "ISIS circuit is already defined%s", VTY_NEWLINE
);
849 #endif /* HAVE_IPV6 */
852 /* this is here for ciscopability */
855 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
861 c
= circuit_lookup_by_ifp (ifp
, isis
->init_circ_list
);
862 c
= isis_csm_state_change (ISIS_ENABLE
, c
, area
);
863 c
->interface
= ifp
; /* this is automatic */
864 ifp
->info
= c
; /* hardly related to the FSM */
872 circuit_update_nlpids (c
);
874 vty
->node
= INTERFACE_NODE
;
879 DEFUN (no_ip_router_isis
,
880 no_ip_router_isis_cmd
,
881 "no ip router isis WORD",
883 "Interface Internet Protocol config commands\n"
884 "IP router interface commands\n"
885 "IS-IS Routing for IP\n"
886 "Routing process tag\n")
888 struct isis_circuit
*circuit
= NULL
;
889 struct interface
*ifp
;
890 struct isis_area
*area
;
891 struct listnode
*node
, *nnode
;
893 ifp
= (struct interface
*) vty
->index
;
896 area
= isis_area_lookup (argv
[0]);
899 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
902 for (ALL_LIST_ELEMENTS (area
->circuit_list
, node
, nnode
, circuit
))
903 if (circuit
->interface
== ifp
)
907 vty_out (vty
, "Can't find ISIS interface %s", VTY_NEWLINE
);
910 circuit
->ip_router
= 0;
913 if (circuit
->ipv6_router
== 0)
915 isis_csm_state_change (ISIS_DISABLE
, circuit
, area
);
920 DEFUN (isis_circuit_type
,
921 isis_circuit_type_cmd
,
922 "isis circuit-type (level-1|level-1-2|level-2-only)",
924 "Configure circuit type for interface\n"
925 "Level-1 only adjacencies are formed\n"
926 "Level-1-2 adjacencies are formed\n"
927 "Level-2 only adjacencies are formed\n")
929 struct isis_circuit
*circuit
;
930 struct interface
*ifp
;
936 /* UGLY - will remove l8r */
942 /* XXX what to do when ip_router_isis is not executed */
943 if (circuit
->area
== NULL
)
948 circuit_t
= string2circuit_t ((u_char
*)argv
[0]);
952 vty_out (vty
, "Unknown circuit-type %s", VTY_NEWLINE
);
956 is_type
= circuit
->area
->is_type
;
957 if (is_type
== IS_LEVEL_1_AND_2
|| is_type
== circuit_t
)
958 isis_event_circuit_type_change (circuit
, circuit_t
);
961 vty_out (vty
, "invalid circuit level for area %s.%s",
962 circuit
->area
->area_tag
, VTY_NEWLINE
);
968 DEFUN (no_isis_circuit_type
,
969 no_isis_circuit_type_cmd
,
970 "no isis circuit-type (level-1|level-1-2|level-2-only)",
973 "Configure circuit type for interface\n"
974 "Level-1 only adjacencies are formed\n"
975 "Level-1-2 adjacencies are formed\n"
976 "Level-2 only adjacencies are formed\n")
978 struct isis_circuit
*circuit
;
979 struct interface
*ifp
;
991 * Set the circuits level to its default value which is that of the area
993 isis_event_circuit_type_change (circuit
, circuit
->area
->is_type
);
1000 "isis password WORD",
1002 "Configure the authentication password for interface\n"
1005 struct isis_circuit
*circuit
;
1006 struct interface
*ifp
;
1010 circuit
= ifp
->info
;
1011 if (circuit
== NULL
)
1016 len
= strlen (argv
[0]);
1019 vty_out (vty
, "Too long circuit password (>254)%s", VTY_NEWLINE
);
1022 circuit
->passwd
.len
= len
;
1023 circuit
->passwd
.type
= ISIS_PASSWD_TYPE_CLEARTXT
;
1024 strncpy ((char *)circuit
->passwd
.passwd
, argv
[0], 255);
1029 DEFUN (no_isis_passwd
,
1034 "Configure the authentication password for interface\n")
1036 struct isis_circuit
*circuit
;
1037 struct interface
*ifp
;
1040 circuit
= ifp
->info
;
1041 if (circuit
== NULL
)
1046 memset (&circuit
->passwd
, 0, sizeof (struct isis_passwd
));
1052 DEFUN (isis_priority
,
1054 "isis priority <0-127>",
1056 "Set priority for Designated Router election\n"
1059 struct isis_circuit
*circuit
;
1060 struct interface
*ifp
;
1064 circuit
= ifp
->info
;
1065 if (circuit
== NULL
)
1071 prio
= atoi (argv
[0]);
1073 circuit
->u
.bc
.priority
[0] = prio
;
1074 circuit
->u
.bc
.priority
[1] = prio
;
1079 DEFUN (no_isis_priority
,
1080 no_isis_priority_cmd
,
1084 "Set priority for Designated Router election\n")
1086 struct isis_circuit
*circuit
;
1087 struct interface
*ifp
;
1090 circuit
= ifp
->info
;
1091 if (circuit
== NULL
)
1097 circuit
->u
.bc
.priority
[0] = DEFAULT_PRIORITY
;
1098 circuit
->u
.bc
.priority
[1] = DEFAULT_PRIORITY
;
1103 ALIAS (no_isis_priority
,
1104 no_isis_priority_arg_cmd
,
1105 "no isis priority <0-127>",
1108 "Set priority for Designated Router election\n"
1111 DEFUN (isis_priority_l1
,
1112 isis_priority_l1_cmd
,
1113 "isis priority <0-127> level-1",
1115 "Set priority for Designated Router election\n"
1117 "Specify priority for level-1 routing\n")
1119 struct isis_circuit
*circuit
;
1120 struct interface
*ifp
;
1124 circuit
= ifp
->info
;
1125 if (circuit
== NULL
)
1131 prio
= atoi (argv
[0]);
1133 circuit
->u
.bc
.priority
[0] = prio
;
1138 DEFUN (no_isis_priority_l1
,
1139 no_isis_priority_l1_cmd
,
1140 "no isis priority level-1",
1143 "Set priority for Designated Router election\n"
1144 "Specify priority for level-1 routing\n")
1146 struct isis_circuit
*circuit
;
1147 struct interface
*ifp
;
1150 circuit
= ifp
->info
;
1151 if (circuit
== NULL
)
1157 circuit
->u
.bc
.priority
[0] = DEFAULT_PRIORITY
;
1162 ALIAS (no_isis_priority_l1
,
1163 no_isis_priority_l1_arg_cmd
,
1164 "no isis priority <0-127> level-1",
1167 "Set priority for Designated Router election\n"
1169 "Specify priority for level-1 routing\n")
1171 DEFUN (isis_priority_l2
,
1172 isis_priority_l2_cmd
,
1173 "isis priority <0-127> level-2",
1175 "Set priority for Designated Router election\n"
1177 "Specify priority for level-2 routing\n")
1179 struct isis_circuit
*circuit
;
1180 struct interface
*ifp
;
1184 circuit
= ifp
->info
;
1185 if (circuit
== NULL
)
1191 prio
= atoi (argv
[0]);
1193 circuit
->u
.bc
.priority
[1] = prio
;
1198 DEFUN (no_isis_priority_l2
,
1199 no_isis_priority_l2_cmd
,
1200 "no isis priority level-2",
1203 "Set priority for Designated Router election\n"
1204 "Specify priority for level-2 routing\n")
1206 struct isis_circuit
*circuit
;
1207 struct interface
*ifp
;
1210 circuit
= ifp
->info
;
1211 if (circuit
== NULL
)
1217 circuit
->u
.bc
.priority
[1] = DEFAULT_PRIORITY
;
1222 ALIAS (no_isis_priority_l2
,
1223 no_isis_priority_l2_arg_cmd
,
1224 "no isis priority <0-127> level-2",
1227 "Set priority for Designated Router election\n"
1229 "Specify priority for level-2 routing\n")
1231 /* Metric command */
1234 "isis metric <0-63>",
1236 "Set default metric for circuit\n"
1237 "Default metric value\n")
1239 struct isis_circuit
*circuit
;
1240 struct interface
*ifp
;
1244 circuit
= ifp
->info
;
1245 if (circuit
== NULL
)
1251 met
= atoi (argv
[0]);
1253 circuit
->metrics
[0].metric_default
= met
;
1254 circuit
->metrics
[1].metric_default
= met
;
1259 DEFUN (no_isis_metric
,
1264 "Set default metric for circuit\n")
1266 struct isis_circuit
*circuit
;
1267 struct interface
*ifp
;
1270 circuit
= ifp
->info
;
1271 if (circuit
== NULL
)
1277 circuit
->metrics
[0].metric_default
= DEFAULT_CIRCUIT_METRICS
;
1278 circuit
->metrics
[1].metric_default
= DEFAULT_CIRCUIT_METRICS
;
1283 ALIAS (no_isis_metric
,
1284 no_isis_metric_arg_cmd
,
1285 "no isis metric <0-127>",
1288 "Set default metric for circuit\n"
1289 "Default metric value\n")
1291 /* end of metrics */
1292 DEFUN (isis_hello_interval
,
1293 isis_hello_interval_cmd
,
1294 "isis hello-interval (<1-65535>|minimal)",
1296 "Set Hello interval\n"
1297 "Hello interval value\n"
1298 "Holdtime 1 seconds, interval depends on multiplier\n")
1300 struct isis_circuit
*circuit
;
1301 struct interface
*ifp
;
1306 circuit
= ifp
->info
;
1307 if (circuit
== NULL
)
1313 if (isdigit ((int) c
))
1315 interval
= atoi (argv
[0]);
1318 interval
= HELLO_MINIMAL
; /* FIXME: should be calculated */
1320 circuit
->hello_interval
[0] = (u_int16_t
) interval
;
1321 circuit
->hello_interval
[1] = (u_int16_t
) interval
;
1326 DEFUN (no_isis_hello_interval
,
1327 no_isis_hello_interval_cmd
,
1328 "no isis hello-interval",
1331 "Set Hello interval\n")
1333 struct isis_circuit
*circuit
;
1334 struct interface
*ifp
;
1337 circuit
= ifp
->info
;
1338 if (circuit
== NULL
)
1345 circuit
->hello_interval
[0] = HELLO_INTERVAL
; /* Default is 1 sec. */
1346 circuit
->hello_interval
[1] = HELLO_INTERVAL
;
1351 ALIAS (no_isis_hello_interval
,
1352 no_isis_hello_interval_arg_cmd
,
1353 "no isis hello-interval (<1-65535>|minimal)",
1356 "Set Hello interval\n"
1357 "Hello interval value\n"
1358 "Holdtime 1 second, interval depends on multiplier\n")
1360 DEFUN (isis_hello_interval_l1
,
1361 isis_hello_interval_l1_cmd
,
1362 "isis hello-interval (<1-65535>|minimal) level-1",
1364 "Set Hello interval\n"
1365 "Hello interval value\n"
1366 "Holdtime 1 second, interval depends on multiplier\n"
1367 "Specify hello-interval for level-1 IIHs\n")
1369 struct isis_circuit
*circuit
;
1370 struct interface
*ifp
;
1375 circuit
= ifp
->info
;
1376 if (circuit
== NULL
)
1383 if (isdigit ((int) c
))
1385 interval
= atoi (argv
[0]);
1388 interval
= HELLO_MINIMAL
;
1390 circuit
->hello_interval
[0] = (u_int16_t
) interval
;
1395 DEFUN (no_isis_hello_interval_l1
,
1396 no_isis_hello_interval_l1_cmd
,
1397 "no isis hello-interval level-1",
1400 "Set Hello interval\n"
1401 "Specify hello-interval for level-1 IIHs\n")
1403 struct isis_circuit
*circuit
;
1404 struct interface
*ifp
;
1407 circuit
= ifp
->info
;
1408 if (circuit
== NULL
)
1415 circuit
->hello_interval
[0] = HELLO_INTERVAL
; /* Default is 1 sec. */
1420 ALIAS (no_isis_hello_interval_l1
,
1421 no_isis_hello_interval_l1_arg_cmd
,
1422 "no isis hello-interval (<1-65535>|minimal) level-1",
1425 "Set Hello interval\n"
1426 "Hello interval value\n"
1427 "Holdtime 1 second, interval depends on multiplier\n"
1428 "Specify hello-interval for level-1 IIHs\n")
1430 DEFUN (isis_hello_interval_l2
,
1431 isis_hello_interval_l2_cmd
,
1432 "isis hello-interval (<1-65535>|minimal) level-2",
1434 "Set Hello interval\n"
1435 "Hello interval value\n"
1436 "Holdtime 1 second, interval depends on multiplier\n"
1437 "Specify hello-interval for level-2 IIHs\n")
1439 struct isis_circuit
*circuit
;
1440 struct interface
*ifp
;
1445 circuit
= ifp
->info
;
1446 if (circuit
== NULL
)
1453 if (isdigit ((int) c
))
1455 interval
= atoi (argv
[0]);
1458 interval
= HELLO_MINIMAL
;
1460 circuit
->hello_interval
[1] = (u_int16_t
) interval
;
1465 DEFUN (no_isis_hello_interval_l2
,
1466 no_isis_hello_interval_l2_cmd
,
1467 "no isis hello-interval level-2",
1470 "Set Hello interval\n"
1471 "Specify hello-interval for level-2 IIHs\n")
1473 struct isis_circuit
*circuit
;
1474 struct interface
*ifp
;
1477 circuit
= ifp
->info
;
1478 if (circuit
== NULL
)
1485 circuit
->hello_interval
[1] = HELLO_INTERVAL
; /* Default is 1 sec. */
1490 ALIAS (no_isis_hello_interval_l2
,
1491 no_isis_hello_interval_l2_arg_cmd
,
1492 "no isis hello-interval (<1-65535>|minimal) level-2",
1495 "Set Hello interval\n"
1496 "Hello interval value\n"
1497 "Holdtime 1 second, interval depends on multiplier\n"
1498 "Specify hello-interval for level-2 IIHs\n")
1500 DEFUN (isis_hello_multiplier
,
1501 isis_hello_multiplier_cmd
,
1502 "isis hello-multiplier <3-1000>",
1504 "Set multiplier for Hello holding time\n"
1505 "Hello multiplier value\n")
1507 struct isis_circuit
*circuit
;
1508 struct interface
*ifp
;
1512 circuit
= ifp
->info
;
1513 if (circuit
== NULL
)
1519 mult
= atoi (argv
[0]);
1521 circuit
->hello_multiplier
[0] = (u_int16_t
) mult
;
1522 circuit
->hello_multiplier
[1] = (u_int16_t
) mult
;
1527 DEFUN (no_isis_hello_multiplier
,
1528 no_isis_hello_multiplier_cmd
,
1529 "no isis hello-multiplier",
1532 "Set multiplier for Hello holding time\n")
1534 struct isis_circuit
*circuit
;
1535 struct interface
*ifp
;
1538 circuit
= ifp
->info
;
1539 if (circuit
== NULL
)
1545 circuit
->hello_multiplier
[0] = HELLO_MULTIPLIER
;
1546 circuit
->hello_multiplier
[1] = HELLO_MULTIPLIER
;
1551 ALIAS (no_isis_hello_multiplier
,
1552 no_isis_hello_multiplier_arg_cmd
,
1553 "no isis hello-multiplier <3-1000>",
1556 "Set multiplier for Hello holding time\n"
1557 "Hello multiplier value\n")
1559 DEFUN (isis_hello_multiplier_l1
,
1560 isis_hello_multiplier_l1_cmd
,
1561 "isis hello-multiplier <3-1000> level-1",
1563 "Set multiplier for Hello holding time\n"
1564 "Hello multiplier value\n"
1565 "Specify hello multiplier for level-1 IIHs\n")
1567 struct isis_circuit
*circuit
;
1568 struct interface
*ifp
;
1572 circuit
= ifp
->info
;
1573 if (circuit
== NULL
)
1579 mult
= atoi (argv
[0]);
1581 circuit
->hello_multiplier
[0] = (u_int16_t
) mult
;
1586 DEFUN (no_isis_hello_multiplier_l1
,
1587 no_isis_hello_multiplier_l1_cmd
,
1588 "no isis hello-multiplier level-1",
1591 "Set multiplier for Hello holding time\n"
1592 "Specify hello multiplier for level-1 IIHs\n")
1594 struct isis_circuit
*circuit
;
1595 struct interface
*ifp
;
1598 circuit
= ifp
->info
;
1599 if (circuit
== NULL
)
1605 circuit
->hello_multiplier
[0] = HELLO_MULTIPLIER
;
1610 ALIAS (no_isis_hello_multiplier_l1
,
1611 no_isis_hello_multiplier_l1_arg_cmd
,
1612 "no isis hello-multiplier <3-1000> level-1",
1615 "Set multiplier for Hello holding time\n"
1616 "Hello multiplier value\n"
1617 "Specify hello multiplier for level-1 IIHs\n")
1619 DEFUN (isis_hello_multiplier_l2
,
1620 isis_hello_multiplier_l2_cmd
,
1621 "isis hello-multiplier <3-1000> level-2",
1623 "Set multiplier for Hello holding time\n"
1624 "Hello multiplier value\n"
1625 "Specify hello multiplier for level-2 IIHs\n")
1627 struct isis_circuit
*circuit
;
1628 struct interface
*ifp
;
1632 circuit
= ifp
->info
;
1633 if (circuit
== NULL
)
1639 mult
= atoi (argv
[0]);
1641 circuit
->hello_multiplier
[1] = (u_int16_t
) mult
;
1646 DEFUN (no_isis_hello_multiplier_l2
,
1647 no_isis_hello_multiplier_l2_cmd
,
1648 "no isis hello-multiplier level-2",
1651 "Set multiplier for Hello holding time\n"
1652 "Specify hello multiplier for level-2 IIHs\n")
1654 struct isis_circuit
*circuit
;
1655 struct interface
*ifp
;
1658 circuit
= ifp
->info
;
1659 if (circuit
== NULL
)
1665 circuit
->hello_multiplier
[1] = HELLO_MULTIPLIER
;
1670 ALIAS (no_isis_hello_multiplier_l2
,
1671 no_isis_hello_multiplier_l2_arg_cmd
,
1672 "no isis hello-multiplier <3-1000> level-2",
1675 "Set multiplier for Hello holding time\n"
1676 "Hello multiplier value\n"
1677 "Specify hello multiplier for level-2 IIHs\n")
1681 "isis hello padding",
1683 "Add padding to IS-IS hello packets\n"
1684 "Pad hello packets\n"
1687 struct interface
*ifp
;
1688 struct isis_circuit
*circuit
;
1691 circuit
= ifp
->info
;
1692 if (circuit
== NULL
)
1698 circuit
->u
.bc
.pad_hellos
= 1;
1703 DEFUN (no_isis_hello
,
1705 "no isis hello padding",
1708 "Add padding to IS-IS hello packets\n"
1709 "Pad hello packets\n"
1712 struct isis_circuit
*circuit
;
1713 struct interface
*ifp
;
1716 circuit
= ifp
->info
;
1717 if (circuit
== NULL
)
1723 circuit
->u
.bc
.pad_hellos
= 0;
1728 DEFUN (csnp_interval
,
1730 "isis csnp-interval <0-65535>",
1732 "Set CSNP interval in seconds\n"
1733 "CSNP interval value\n")
1735 struct isis_circuit
*circuit
;
1736 struct interface
*ifp
;
1737 unsigned long interval
;
1740 circuit
= ifp
->info
;
1741 if (circuit
== NULL
)
1747 interval
= atol (argv
[0]);
1749 circuit
->csnp_interval
[0] = (u_int16_t
) interval
;
1750 circuit
->csnp_interval
[1] = (u_int16_t
) interval
;
1755 DEFUN (no_csnp_interval
,
1756 no_csnp_interval_cmd
,
1757 "no isis csnp-interval",
1760 "Set CSNP interval in seconds\n")
1762 struct isis_circuit
*circuit
;
1763 struct interface
*ifp
;
1766 circuit
= ifp
->info
;
1767 if (circuit
== NULL
)
1773 circuit
->csnp_interval
[0] = CSNP_INTERVAL
;
1774 circuit
->csnp_interval
[1] = CSNP_INTERVAL
;
1779 ALIAS (no_csnp_interval
,
1780 no_csnp_interval_arg_cmd
,
1781 "no isis csnp-interval <0-65535>",
1784 "Set CSNP interval in seconds\n"
1785 "CSNP interval value\n")
1787 DEFUN (csnp_interval_l1
,
1788 csnp_interval_l1_cmd
,
1789 "isis csnp-interval <0-65535> level-1",
1791 "Set CSNP interval in seconds\n"
1792 "CSNP interval value\n"
1793 "Specify interval for level-1 CSNPs\n")
1795 struct isis_circuit
*circuit
;
1796 struct interface
*ifp
;
1797 unsigned long interval
;
1800 circuit
= ifp
->info
;
1801 if (circuit
== NULL
)
1807 interval
= atol (argv
[0]);
1809 circuit
->csnp_interval
[0] = (u_int16_t
) interval
;
1814 DEFUN (no_csnp_interval_l1
,
1815 no_csnp_interval_l1_cmd
,
1816 "no isis csnp-interval level-1",
1819 "Set CSNP interval in seconds\n"
1820 "Specify interval for level-1 CSNPs\n")
1822 struct isis_circuit
*circuit
;
1823 struct interface
*ifp
;
1826 circuit
= ifp
->info
;
1827 if (circuit
== NULL
)
1833 circuit
->csnp_interval
[0] = CSNP_INTERVAL
;
1838 ALIAS (no_csnp_interval_l1
,
1839 no_csnp_interval_l1_arg_cmd
,
1840 "no isis csnp-interval <0-65535> level-1",
1843 "Set CSNP interval in seconds\n"
1844 "CSNP interval value\n"
1845 "Specify interval for level-1 CSNPs\n")
1847 DEFUN (csnp_interval_l2
,
1848 csnp_interval_l2_cmd
,
1849 "isis csnp-interval <0-65535> level-2",
1851 "Set CSNP interval in seconds\n"
1852 "CSNP interval value\n"
1853 "Specify interval for level-2 CSNPs\n")
1855 struct isis_circuit
*circuit
;
1856 struct interface
*ifp
;
1857 unsigned long interval
;
1860 circuit
= ifp
->info
;
1861 if (circuit
== NULL
)
1867 interval
= atol (argv
[0]);
1869 circuit
->csnp_interval
[1] = (u_int16_t
) interval
;
1874 DEFUN (no_csnp_interval_l2
,
1875 no_csnp_interval_l2_cmd
,
1876 "no isis csnp-interval level-2",
1879 "Set CSNP interval in seconds\n"
1880 "Specify interval for level-2 CSNPs\n")
1882 struct isis_circuit
*circuit
;
1883 struct interface
*ifp
;
1886 circuit
= ifp
->info
;
1887 if (circuit
== NULL
)
1893 circuit
->csnp_interval
[1] = CSNP_INTERVAL
;
1898 ALIAS (no_csnp_interval_l2
,
1899 no_csnp_interval_l2_arg_cmd
,
1900 "no isis csnp-interval <0-65535> level-2",
1903 "Set CSNP interval in seconds\n"
1904 "CSNP interval value\n"
1905 "Specify interval for level-2 CSNPs\n")
1908 DEFUN (ipv6_router_isis
,
1909 ipv6_router_isis_cmd
,
1910 "ipv6 router isis WORD",
1911 "IPv6 interface subcommands\n"
1912 "IPv6 Router interface commands\n"
1913 "IS-IS Routing for IPv6\n"
1914 "Routing process tag\n")
1916 struct isis_circuit
*c
;
1917 struct interface
*ifp
;
1918 struct isis_area
*area
;
1920 ifp
= (struct interface
*) vty
->index
;
1923 area
= isis_area_lookup (argv
[0]);
1925 /* Prevent more than one circuit per interface */
1927 c
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
1931 if (c
&& (ifp
->info
!= NULL
))
1933 if (c
->ipv6_router
== 1)
1935 vty_out (vty
, "ISIS circuit is already defined for IPv6%s",
1941 /* this is here for ciscopability */
1944 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
1950 c
= circuit_lookup_by_ifp (ifp
, isis
->init_circ_list
);
1951 c
= isis_csm_state_change (ISIS_ENABLE
, c
, area
);
1960 area
->ipv6_circuits
++;
1961 circuit_update_nlpids (c
);
1963 vty
->node
= INTERFACE_NODE
;
1968 DEFUN (no_ipv6_router_isis
,
1969 no_ipv6_router_isis_cmd
,
1970 "no ipv6 router isis WORD",
1972 "IPv6 interface subcommands\n"
1973 "IPv6 Router interface commands\n"
1974 "IS-IS Routing for IPv6\n"
1975 "Routing process tag\n")
1977 struct isis_circuit
*c
;
1978 struct interface
*ifp
;
1979 struct isis_area
*area
;
1981 ifp
= (struct interface
*) vty
->index
;
1982 /* UGLY - will remove l8r
1983 if (circuit == NULL) {
1988 area
= isis_area_lookup (argv
[0]);
1991 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
1995 c
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
2000 area
->ipv6_circuits
--;
2001 if (c
->ip_router
== 0)
2002 isis_csm_state_change (ISIS_DISABLE
, c
, area
);
2006 #endif /* HAVE_IPV6 */
2008 struct cmd_node interface_node
= {
2015 isis_if_new_hook (struct interface
*ifp
)
2017 /* FIXME: Discuss if the circuit should be created here
2018 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2024 isis_if_delete_hook (struct interface
*ifp
)
2026 /* FIXME: Discuss if the circuit should be created here
2027 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2033 isis_circuit_init ()
2035 /* Initialize Zebra interface data structure */
2037 if_add_hook (IF_NEW_HOOK
, isis_if_new_hook
);
2038 if_add_hook (IF_DELETE_HOOK
, isis_if_delete_hook
);
2040 /* Install interface node */
2041 install_node (&interface_node
, isis_interface_config_write
);
2042 install_element (CONFIG_NODE
, &interface_cmd
);
2044 install_default (INTERFACE_NODE
);
2045 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
2046 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
2048 install_element (INTERFACE_NODE
, &ip_router_isis_cmd
);
2049 install_element (INTERFACE_NODE
, &no_ip_router_isis_cmd
);
2051 install_element (INTERFACE_NODE
, &isis_circuit_type_cmd
);
2052 install_element (INTERFACE_NODE
, &no_isis_circuit_type_cmd
);
2054 install_element (INTERFACE_NODE
, &isis_passwd_cmd
);
2055 install_element (INTERFACE_NODE
, &no_isis_passwd_cmd
);
2057 install_element (INTERFACE_NODE
, &isis_priority_cmd
);
2058 install_element (INTERFACE_NODE
, &no_isis_priority_cmd
);
2059 install_element (INTERFACE_NODE
, &no_isis_priority_arg_cmd
);
2060 install_element (INTERFACE_NODE
, &isis_priority_l1_cmd
);
2061 install_element (INTERFACE_NODE
, &no_isis_priority_l1_cmd
);
2062 install_element (INTERFACE_NODE
, &no_isis_priority_l1_arg_cmd
);
2063 install_element (INTERFACE_NODE
, &isis_priority_l2_cmd
);
2064 install_element (INTERFACE_NODE
, &no_isis_priority_l2_cmd
);
2065 install_element (INTERFACE_NODE
, &no_isis_priority_l2_arg_cmd
);
2067 install_element (INTERFACE_NODE
, &isis_metric_cmd
);
2068 install_element (INTERFACE_NODE
, &no_isis_metric_cmd
);
2069 install_element (INTERFACE_NODE
, &no_isis_metric_arg_cmd
);
2071 install_element (INTERFACE_NODE
, &isis_hello_interval_cmd
);
2072 install_element (INTERFACE_NODE
, &no_isis_hello_interval_cmd
);
2073 install_element (INTERFACE_NODE
, &no_isis_hello_interval_arg_cmd
);
2074 install_element (INTERFACE_NODE
, &isis_hello_interval_l1_cmd
);
2075 install_element (INTERFACE_NODE
, &no_isis_hello_interval_l1_cmd
);
2076 install_element (INTERFACE_NODE
, &no_isis_hello_interval_l1_arg_cmd
);
2077 install_element (INTERFACE_NODE
, &isis_hello_interval_l2_cmd
);
2078 install_element (INTERFACE_NODE
, &no_isis_hello_interval_l2_cmd
);
2079 install_element (INTERFACE_NODE
, &no_isis_hello_interval_l2_arg_cmd
);
2081 install_element (INTERFACE_NODE
, &isis_hello_multiplier_cmd
);
2082 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_cmd
);
2083 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_arg_cmd
);
2084 install_element (INTERFACE_NODE
, &isis_hello_multiplier_l1_cmd
);
2085 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_l1_cmd
);
2086 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_l1_arg_cmd
);
2087 install_element (INTERFACE_NODE
, &isis_hello_multiplier_l2_cmd
);
2088 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_l2_cmd
);
2089 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_l2_arg_cmd
);
2091 install_element (INTERFACE_NODE
, &isis_hello_cmd
);
2092 install_element (INTERFACE_NODE
, &no_isis_hello_cmd
);
2093 install_element (INTERFACE_NODE
, &csnp_interval_cmd
);
2094 install_element (INTERFACE_NODE
, &no_csnp_interval_cmd
);
2095 install_element (INTERFACE_NODE
, &no_csnp_interval_arg_cmd
);
2096 install_element (INTERFACE_NODE
, &csnp_interval_l1_cmd
);
2097 install_element (INTERFACE_NODE
, &no_csnp_interval_l1_cmd
);
2098 install_element (INTERFACE_NODE
, &no_csnp_interval_l1_arg_cmd
);
2099 install_element (INTERFACE_NODE
, &csnp_interval_l2_cmd
);
2100 install_element (INTERFACE_NODE
, &no_csnp_interval_l2_cmd
);
2101 install_element (INTERFACE_NODE
, &no_csnp_interval_l2_arg_cmd
);
2104 install_element (INTERFACE_NODE
, &ipv6_router_isis_cmd
);
2105 install_element (INTERFACE_NODE
, &no_ipv6_router_isis_cmd
);