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.
24 #include <net/ethernet.h>
26 #include <netinet/if_ether.h>
29 #ifndef ETHER_ADDR_LEN
30 #define ETHER_ADDR_LEN ETHERADDRL
43 #include "isisd/dict.h"
44 #include "isisd/include-netbsd/iso.h"
45 #include "isisd/isis_constants.h"
46 #include "isisd/isis_common.h"
47 #include "isisd/isis_circuit.h"
48 #include "isisd/isis_tlv.h"
49 #include "isisd/isis_lsp.h"
50 #include "isisd/isis_pdu.h"
51 #include "isisd/isis_network.h"
52 #include "isisd/isis_misc.h"
53 #include "isisd/isis_constants.h"
54 #include "isisd/isis_adjacency.h"
55 #include "isisd/isis_dr.h"
56 #include "isisd/isis_flags.h"
57 #include "isisd/isisd.h"
58 #include "isisd/isis_csm.h"
59 #include "isisd/isis_events.h"
61 extern struct thread_master
*master
;
62 extern struct isis
*isis
;
67 void isis_circuit_down(struct isis_circuit
*);
68 int isis_interface_config_write(struct vty
*);
69 int isis_if_new_hook(struct interface
*);
70 int isis_if_delete_hook(struct interface
*);
75 struct isis_circuit
*circuit
;
78 circuit
= XCALLOC (MTYPE_ISIS_CIRCUIT
, sizeof (struct isis_circuit
));
81 /* set default metrics for circuit */
82 for (i
= 0; i
< 2; i
++)
84 circuit
->metrics
[i
].metric_default
= DEFAULT_CIRCUIT_METRICS
;
85 circuit
->metrics
[i
].metric_expense
= METRICS_UNSUPPORTED
;
86 circuit
->metrics
[i
].metric_error
= METRICS_UNSUPPORTED
;
87 circuit
->metrics
[i
].metric_delay
= METRICS_UNSUPPORTED
;
88 circuit
->te_metric
[i
] = DEFAULT_CIRCUIT_METRICS
;
93 zlog_err ("Can't malloc isis circuit");
101 isis_circuit_configure (struct isis_circuit
*circuit
, struct isis_area
*area
)
104 circuit
->area
= area
;
106 * The level for the circuit is same as for the area, unless configured
109 circuit
->circuit_is_type
= area
->is_type
;
113 for (i
= 0; i
< 2; i
++)
115 circuit
->hello_interval
[i
] = HELLO_INTERVAL
;
116 circuit
->hello_multiplier
[i
] = HELLO_MULTIPLIER
;
117 circuit
->csnp_interval
[i
] = CSNP_INTERVAL
;
118 circuit
->psnp_interval
[i
] = PSNP_INTERVAL
;
119 circuit
->u
.bc
.priority
[i
] = DEFAULT_PRIORITY
;
121 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
123 circuit
->u
.bc
.adjdb
[0] = list_new ();
124 circuit
->u
.bc
.adjdb
[1] = list_new ();
125 circuit
->u
.bc
.pad_hellos
= 1;
127 circuit
->lsp_interval
= LSP_INTERVAL
;
130 * Add the circuit into area
132 listnode_add (area
->circuit_list
, circuit
);
134 circuit
->idx
= flags_get_index (&area
->flags
);
135 circuit
->lsp_queue
= list_new ();
141 isis_circuit_deconfigure (struct isis_circuit
*circuit
,
142 struct isis_area
*area
)
145 /* Remove circuit from area */
146 listnode_delete (area
->circuit_list
, circuit
);
147 /* Free the index of SRM and SSN flags */
148 flags_free_index (&area
->flags
, circuit
->idx
);
153 struct isis_circuit
*
154 circuit_lookup_by_ifp (struct interface
*ifp
, struct list
*list
)
156 struct isis_circuit
*circuit
= NULL
;
157 struct listnode
*node
;
162 for (ALL_LIST_ELEMENTS_RO (list
, node
, circuit
))
163 if (circuit
->interface
== ifp
)
169 struct isis_circuit
*
170 circuit_scan_by_ifp (struct interface
*ifp
)
172 struct isis_area
*area
;
173 struct listnode
*node
;
174 struct isis_circuit
*circuit
;
176 if (!isis
->area_list
)
179 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node
, area
))
181 circuit
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
186 return circuit_lookup_by_ifp (ifp
, isis
->init_circ_list
);
190 isis_circuit_del (struct isis_circuit
*circuit
)
196 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
198 /* destroy adjacency databases */
199 if (circuit
->u
.bc
.adjdb
[0])
200 list_delete (circuit
->u
.bc
.adjdb
[0]);
201 if (circuit
->u
.bc
.adjdb
[1])
202 list_delete (circuit
->u
.bc
.adjdb
[1]);
203 /* destroy neighbour lists */
204 if (circuit
->u
.bc
.lan_neighs
[0])
205 list_delete (circuit
->u
.bc
.lan_neighs
[0]);
206 if (circuit
->u
.bc
.lan_neighs
[1])
207 list_delete (circuit
->u
.bc
.lan_neighs
[1]);
208 /* destroy addresses */
210 if (circuit
->ip_addrs
)
211 list_delete (circuit
->ip_addrs
);
213 if (circuit
->ipv6_link
)
214 list_delete (circuit
->ipv6_link
);
215 if (circuit
->ipv6_non_link
)
216 list_delete (circuit
->ipv6_non_link
);
217 #endif /* HAVE_IPV6 */
219 /* and lastly the circuit itself */
220 XFREE (MTYPE_ISIS_CIRCUIT
, circuit
);
226 isis_circuit_add_addr (struct isis_circuit
*circuit
,
227 struct connected
*connected
)
229 struct prefix_ipv4
*ipv4
;
232 struct prefix_ipv6
*ipv6
;
233 #endif /* HAVE_IPV6 */
235 if (!circuit
->ip_addrs
)
236 circuit
->ip_addrs
= list_new ();
238 if (!circuit
->ipv6_link
)
239 circuit
->ipv6_link
= list_new ();
240 if (!circuit
->ipv6_non_link
)
241 circuit
->ipv6_non_link
= list_new ();
242 #endif /* HAVE_IPV6 */
244 memset (&buf
, 0, BUFSIZ
);
245 if (connected
->address
->family
== AF_INET
)
247 ipv4
= prefix_ipv4_new ();
248 ipv4
->prefixlen
= connected
->address
->prefixlen
;
249 ipv4
->prefix
= connected
->address
->u
.prefix4
;
250 listnode_add (circuit
->ip_addrs
, ipv4
);
252 lsp_regenerate_schedule (circuit
->area
);
255 prefix2str (connected
->address
, buf
, BUFSIZ
);
256 zlog_debug ("Added IP address %s to circuit %d", buf
,
257 circuit
->circuit_id
);
258 #endif /* EXTREME_DEBUG */
261 if (connected
->address
->family
== AF_INET6
)
263 ipv6
= prefix_ipv6_new ();
264 ipv6
->prefixlen
= connected
->address
->prefixlen
;
265 ipv6
->prefix
= connected
->address
->u
.prefix6
;
267 if (IN6_IS_ADDR_LINKLOCAL (&ipv6
->prefix
))
268 listnode_add (circuit
->ipv6_link
, ipv6
);
270 listnode_add (circuit
->ipv6_non_link
, ipv6
);
272 lsp_regenerate_schedule (circuit
->area
);
275 prefix2str (connected
->address
, buf
, BUFSIZ
);
276 zlog_debug ("Added IPv6 address %s to circuit %d", buf
,
277 circuit
->circuit_id
);
278 #endif /* EXTREME_DEBUG */
280 #endif /* HAVE_IPV6 */
285 isis_circuit_del_addr (struct isis_circuit
*circuit
,
286 struct connected
*connected
)
288 struct prefix_ipv4
*ipv4
, *ip
= NULL
;
289 struct listnode
*node
;
292 struct prefix_ipv6
*ipv6
, *ip6
= NULL
;
294 #endif /* HAVE_IPV6 */
296 memset (&buf
, 0, BUFSIZ
);
297 if (connected
->address
->family
== AF_INET
)
299 ipv4
= prefix_ipv4_new ();
300 ipv4
->prefixlen
= connected
->address
->prefixlen
;
301 ipv4
->prefix
= connected
->address
->u
.prefix4
;
303 for (ALL_LIST_ELEMENTS_RO (circuit
->ip_addrs
, node
, ip
))
304 if (prefix_same ((struct prefix
*) ip
, (struct prefix
*) &ipv4
))
309 listnode_delete (circuit
->ip_addrs
, ip
);
311 lsp_regenerate_schedule (circuit
->area
);
315 prefix2str (connected
->address
, (char *)buf
, BUFSIZ
);
316 zlog_warn("Nonexitant ip address %s removal attempt from circuit \
317 %d", buf
, circuit
->circuit_id
);
321 if (connected
->address
->family
== AF_INET6
)
323 ipv6
= prefix_ipv6_new ();
324 ipv6
->prefixlen
= connected
->address
->prefixlen
;
325 ipv6
->prefix
= connected
->address
->u
.prefix6
;
327 if (IN6_IS_ADDR_LINKLOCAL (&ipv6
->prefix
))
329 for (ALL_LIST_ELEMENTS_RO (circuit
->ipv6_link
, node
, ip6
))
331 if (prefix_same ((struct prefix
*) ip6
, (struct prefix
*) ipv6
))
336 listnode_delete (circuit
->ipv6_link
, ip6
);
342 for (ALL_LIST_ELEMENTS_RO (circuit
->ipv6_non_link
, node
, ip6
))
344 if (prefix_same ((struct prefix
*) ip6
, (struct prefix
*) ipv6
))
349 listnode_delete (circuit
->ipv6_non_link
, ip6
);
356 prefix2str (connected
->address
, (char *)buf
, BUFSIZ
);
357 zlog_warn("Nonexitant ip address %s removal attempt from \
358 circuit %d", buf
, circuit
->circuit_id
);
362 lsp_regenerate_schedule (circuit
->area
);
364 #endif /* HAVE_IPV6 */
369 isis_circuit_if_add (struct isis_circuit
*circuit
, struct interface
*ifp
)
371 struct listnode
*node
, *nnode
;
372 struct connected
*conn
;
374 circuit
->interface
= ifp
;
377 circuit
->circuit_id
= ifp
->ifindex
% 255; /* FIXME: Why not ? */
379 /* isis_circuit_update_addrs (circuit, ifp); */
381 if (if_is_broadcast (ifp
))
383 circuit
->circ_type
= CIRCUIT_T_BROADCAST
;
385 * Get the Hardware Address
387 #ifdef HAVE_STRUCT_SOCKADDR_DL
389 if (circuit
->interface
->sdl
.sdl_alen
!= ETHER_ADDR_LEN
)
390 zlog_warn ("unsupported link layer");
392 memcpy (circuit
->u
.bc
.snpa
, LLADDR (&circuit
->interface
->sdl
),
396 if (circuit
->interface
->hw_addr_len
!= ETH_ALEN
)
398 zlog_warn ("unsupported link layer");
402 memcpy (circuit
->u
.bc
.snpa
, circuit
->interface
->hw_addr
, ETH_ALEN
);
405 zlog_debug ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
406 circuit
->interface
->ifindex
, ISO_MTU (circuit
),
407 snpa_print (circuit
->u
.bc
.snpa
));
409 #endif /* EXTREME_DEBUG */
410 #endif /* HAVE_STRUCT_SOCKADDR_DL */
412 else if (if_is_pointopoint (ifp
))
414 circuit
->circ_type
= CIRCUIT_T_P2P
;
418 /* It's normal in case of loopback etc. */
419 if (isis
->debugs
& DEBUG_EVENTS
)
420 zlog_debug ("isis_circuit_if_add: unsupported media");
423 for (ALL_LIST_ELEMENTS (ifp
->connected
, node
, nnode
, conn
))
424 isis_circuit_add_addr (circuit
, conn
);
430 isis_circuit_update_params (struct isis_circuit
*circuit
,
431 struct interface
*ifp
)
435 if (circuit
->circuit_id
!= ifp
->ifindex
)
437 zlog_warn ("changing circuit_id %d->%d", circuit
->circuit_id
,
439 circuit
->circuit_id
= ifp
->ifindex
% 255;
442 /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
443 /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig)
444 The areas MTU is the minimum of mtu's of circuits in the area
445 now we can't catch the change
446 if (circuit->mtu != ifp->mtu) {
447 zlog_warn ("changing circuit mtu %d->%d", circuit->mtu,
449 circuit->mtu = ifp->mtu;
453 * Get the Hardware Address
455 #ifdef HAVE_STRUCT_SOCKADDR_DL
457 if (circuit
->interface
->sdl
.sdl_alen
!= ETHER_ADDR_LEN
)
458 zlog_warn ("unsupported link layer");
460 memcpy (circuit
->u
.bc
.snpa
, LLADDR (&circuit
->interface
->sdl
), ETH_ALEN
);
463 if (circuit
->interface
->hw_addr_len
!= ETH_ALEN
)
465 zlog_warn ("unsupported link layer");
469 if (memcmp (circuit
->u
.bc
.snpa
, circuit
->interface
->hw_addr
, ETH_ALEN
))
471 zlog_warn ("changing circuit snpa %s->%s",
472 snpa_print (circuit
->u
.bc
.snpa
),
473 snpa_print (circuit
->interface
->hw_addr
));
478 if (if_is_broadcast (ifp
))
480 circuit
->circ_type
= CIRCUIT_T_BROADCAST
;
482 else if (if_is_pointopoint (ifp
))
484 circuit
->circ_type
= CIRCUIT_T_P2P
;
488 zlog_warn ("isis_circuit_update_params: unsupported media");
495 isis_circuit_if_del (struct isis_circuit
*circuit
)
497 circuit
->interface
->info
= NULL
;
498 circuit
->interface
= NULL
;
504 isis_circuit_up (struct isis_circuit
*circuit
)
507 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
509 if (circuit
->area
->min_bcast_mtu
== 0 ||
510 ISO_MTU (circuit
) < circuit
->area
->min_bcast_mtu
)
511 circuit
->area
->min_bcast_mtu
= ISO_MTU (circuit
);
513 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
516 /* initilizing the hello sending threads
520 /* 8.4.1 a) commence sending of IIH PDUs */
522 if (circuit
->circuit_is_type
& IS_LEVEL_1
)
524 thread_add_event (master
, send_lan_l1_hello
, circuit
, 0);
525 circuit
->u
.bc
.lan_neighs
[0] = list_new ();
528 if (circuit
->circuit_is_type
& IS_LEVEL_2
)
530 thread_add_event (master
, send_lan_l2_hello
, circuit
, 0);
531 circuit
->u
.bc
.lan_neighs
[1] = list_new ();
534 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
535 /* 8.4.1 c) FIXME: listen for ESH PDUs */
538 /* dr election will commence in... */
539 if (circuit
->circuit_is_type
& IS_LEVEL_1
)
540 THREAD_TIMER_ON (master
, circuit
->u
.bc
.t_run_dr
[0], isis_run_dr_l1
,
541 circuit
, 2 * circuit
->hello_interval
[0]);
542 if (circuit
->circuit_is_type
& IS_LEVEL_2
)
543 THREAD_TIMER_ON (master
, circuit
->u
.bc
.t_run_dr
[1], isis_run_dr_l2
,
544 circuit
, 2 * circuit
->hello_interval
[1]);
548 /* initializing the hello send threads
551 thread_add_event (master
, send_p2p_hello
, circuit
, 0);
555 /* initializing PSNP timers */
556 if (circuit
->circuit_is_type
& IS_LEVEL_1
)
558 THREAD_TIMER_ON (master
, circuit
->t_send_psnp
[0], send_l1_psnp
, circuit
,
559 isis_jitter (circuit
->psnp_interval
[0], PSNP_JITTER
));
562 if (circuit
->circuit_is_type
& IS_LEVEL_2
)
564 THREAD_TIMER_ON (master
, circuit
->t_send_psnp
[1], send_l2_psnp
, circuit
,
565 isis_jitter (circuit
->psnp_interval
[1], PSNP_JITTER
));
568 /* initialize the circuit streams */
569 if (circuit
->rcv_stream
== NULL
)
570 circuit
->rcv_stream
= stream_new (ISO_MTU (circuit
));
572 if (circuit
->snd_stream
== NULL
)
573 circuit
->snd_stream
= stream_new (ISO_MTU (circuit
));
575 /* unified init for circuits */
576 isis_sock_init (circuit
);
579 THREAD_READ_ON (master
, circuit
->t_read
, isis_receive
, circuit
,
582 THREAD_TIMER_ON (master
, circuit
->t_read
, isis_receive
, circuit
,
589 isis_circuit_down (struct isis_circuit
*circuit
)
591 /* Cancel all active threads -- FIXME: wrong place */
592 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
593 THREAD_OFF (circuit
->t_read
);
594 if (circuit
->circ_type
== CIRCUIT_T_BROADCAST
)
596 THREAD_TIMER_OFF (circuit
->u
.bc
.t_send_lan_hello
[0]);
597 THREAD_TIMER_OFF (circuit
->u
.bc
.t_send_lan_hello
[1]);
598 THREAD_TIMER_OFF (circuit
->u
.bc
.t_run_dr
[0]);
599 THREAD_TIMER_OFF (circuit
->u
.bc
.t_run_dr
[1]);
601 else if (circuit
->circ_type
== CIRCUIT_T_P2P
)
603 THREAD_TIMER_OFF (circuit
->u
.p2p
.t_send_p2p_hello
);
605 /* close the socket */
612 circuit_update_nlpids (struct isis_circuit
*circuit
)
614 circuit
->nlpids
.count
= 0;
616 if (circuit
->ip_router
)
618 circuit
->nlpids
.nlpids
[0] = NLPID_IP
;
619 circuit
->nlpids
.count
++;
622 if (circuit
->ipv6_router
)
624 circuit
->nlpids
.nlpids
[circuit
->nlpids
.count
] = NLPID_IPV6
;
625 circuit
->nlpids
.count
++;
627 #endif /* HAVE_IPV6 */
632 isis_interface_config_write (struct vty
*vty
)
636 struct listnode
*node
, *node2
;
637 struct interface
*ifp
;
638 struct isis_area
*area
;
639 struct isis_circuit
*c
;
642 for (ALL_LIST_ELEMENTS_RO (iflist
, node
, ifp
))
645 vty_out (vty
, "interface %s%s", ifp
->name
, VTY_NEWLINE
);
650 vty_out (vty
, " description %s%s", ifp
->desc
, VTY_NEWLINE
);
654 for (ALL_LIST_ELEMENTS_RO (isis
->area_list
, node2
, area
))
656 c
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
661 vty_out (vty
, " ip router isis %s%s", area
->area_tag
,
668 vty_out (vty
, " ipv6 router isis %s%s", area
->area_tag
,
672 #endif /* HAVE_IPV6 */
674 /* ISIS - circuit type */
675 if (c
->circuit_is_type
== IS_LEVEL_1
)
677 vty_out (vty
, " isis circuit-type level-1%s", VTY_NEWLINE
);
682 if (c
->circuit_is_type
== IS_LEVEL_2
)
684 vty_out (vty
, " isis circuit-type level-2-only%s",
690 /* ISIS - CSNP interval - FIXME: compare to cisco */
691 if (c
->csnp_interval
[0] == c
->csnp_interval
[1])
693 if (c
->csnp_interval
[0] != CSNP_INTERVAL
)
695 vty_out (vty
, " isis csnp-interval %d%s",
696 c
->csnp_interval
[0], VTY_NEWLINE
);
702 for (i
= 0; i
< 2; i
++)
704 if (c
->csnp_interval
[1] != CSNP_INTERVAL
)
706 vty_out (vty
, " isis csnp-interval %d level-%d%s",
707 c
->csnp_interval
[1], i
+ 1, VTY_NEWLINE
);
713 /* ISIS - Hello padding - Defaults to true so only display if false */
714 if (c
->circ_type
== CIRCUIT_T_BROADCAST
&& !c
->u
.bc
.pad_hellos
)
716 vty_out (vty
, " no isis hello padding%s", VTY_NEWLINE
);
720 /* ISIS - Hello interval - FIXME: compare to cisco */
721 if (c
->hello_interval
[0] == c
->hello_interval
[1])
723 if (c
->hello_interval
[0] != HELLO_INTERVAL
)
725 vty_out (vty
, " isis hello-interval %d%s",
726 c
->hello_interval
[0], VTY_NEWLINE
);
732 for (i
= 0; i
< 2; i
++)
734 if (c
->hello_interval
[i
] != HELLO_INTERVAL
)
736 if (c
->hello_interval
[i
] == HELLO_MINIMAL
)
739 " isis hello-interval minimal level-%d%s",
744 vty_out (vty
, " isis hello-interval %d level-%d%s",
745 c
->hello_interval
[i
], i
+ 1, VTY_NEWLINE
);
752 /* ISIS - Hello Multiplier */
753 if (c
->hello_multiplier
[0] == c
->hello_multiplier
[1])
755 if (c
->hello_multiplier
[0] != HELLO_MULTIPLIER
)
757 vty_out (vty
, " isis hello-multiplier %d%s",
758 c
->hello_multiplier
[0], VTY_NEWLINE
);
764 for (i
= 0; i
< 2; i
++)
766 if (c
->hello_multiplier
[i
] != HELLO_MULTIPLIER
)
768 vty_out (vty
, " isis hello-multiplier %d level-%d%s",
769 c
->hello_multiplier
[i
], i
+ 1, VTY_NEWLINE
);
774 /* ISIS - Priority */
775 if (c
->circ_type
== CIRCUIT_T_BROADCAST
)
777 if (c
->u
.bc
.priority
[0] == c
->u
.bc
.priority
[1])
779 if (c
->u
.bc
.priority
[0] != DEFAULT_PRIORITY
)
781 vty_out (vty
, " isis priority %d%s",
782 c
->u
.bc
.priority
[0], VTY_NEWLINE
);
788 for (i
= 0; i
< 2; i
++)
790 if (c
->u
.bc
.priority
[i
] != DEFAULT_PRIORITY
)
792 vty_out (vty
, " isis priority %d level-%d%s",
793 c
->u
.bc
.priority
[i
], i
+ 1, VTY_NEWLINE
);
800 if (c
->te_metric
[0] == c
->te_metric
[1])
802 if (c
->te_metric
[0] != DEFAULT_CIRCUIT_METRICS
)
804 vty_out (vty
, " isis metric %d%s", c
->te_metric
[0],
811 for (i
= 0; i
< 2; i
++)
813 if (c
->te_metric
[i
] != DEFAULT_CIRCUIT_METRICS
)
815 vty_out (vty
, " isis metric %d level-%d%s",
816 c
->te_metric
[i
], i
+ 1, VTY_NEWLINE
);
824 vty_out (vty
, "!%s", VTY_NEWLINE
);
830 DEFUN (ip_router_isis
,
832 "ip router isis WORD",
833 "Interface Internet Protocol config commands\n"
834 "IP router interface commands\n"
835 "IS-IS Routing for IP\n"
836 "Routing process tag\n")
838 struct isis_circuit
*c
;
839 struct interface
*ifp
;
840 struct isis_area
*area
;
842 ifp
= (struct interface
*) vty
->index
;
845 area
= isis_area_lookup (argv
[0]);
847 /* Prevent more than one circuit per interface */
849 c
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
852 if (c
&& (ifp
->info
!= NULL
))
855 if (c
->ipv6_router
== 0)
857 #endif /* HAVE_IPV6 */
858 /* FIXME: Find the way to warn only vty users. */
859 /* vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE); */
863 #endif /* HAVE_IPV6 */
866 /* this is here for ciscopability */
869 /* FIXME: Find the way to warn only vty users. */
870 /* vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); */
876 c
= circuit_lookup_by_ifp (ifp
, isis
->init_circ_list
);
877 c
= isis_csm_state_change (ISIS_ENABLE
, c
, area
);
878 c
->interface
= ifp
; /* this is automatic */
879 ifp
->info
= c
; /* hardly related to the FSM */
887 circuit_update_nlpids (c
);
889 vty
->node
= INTERFACE_NODE
;
894 DEFUN (no_ip_router_isis
,
895 no_ip_router_isis_cmd
,
896 "no ip router isis WORD",
898 "Interface Internet Protocol config commands\n"
899 "IP router interface commands\n"
900 "IS-IS Routing for IP\n"
901 "Routing process tag\n")
903 struct isis_circuit
*circuit
= NULL
;
904 struct interface
*ifp
;
905 struct isis_area
*area
;
906 struct listnode
*node
;
908 ifp
= (struct interface
*) vty
->index
;
911 area
= isis_area_lookup (argv
[0]);
914 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
917 for (ALL_LIST_ELEMENTS_RO (area
->circuit_list
, node
, circuit
))
918 if (circuit
->interface
== ifp
)
922 vty_out (vty
, "Can't find ISIS interface %s", VTY_NEWLINE
);
925 circuit
->ip_router
= 0;
928 if (circuit
->ipv6_router
== 0)
930 isis_csm_state_change (ISIS_DISABLE
, circuit
, area
);
935 DEFUN (isis_circuit_type
,
936 isis_circuit_type_cmd
,
937 "isis circuit-type (level-1|level-1-2|level-2-only)",
939 "Configure circuit type for interface\n"
940 "Level-1 only adjacencies are formed\n"
941 "Level-1-2 adjacencies are formed\n"
942 "Level-2 only adjacencies are formed\n")
944 struct isis_circuit
*circuit
;
945 struct interface
*ifp
;
951 /* UGLY - will remove l8r */
957 /* XXX what to do when ip_router_isis is not executed */
958 if (circuit
->area
== NULL
)
963 circuit_t
= string2circuit_t (argv
[0]);
967 vty_out (vty
, "Unknown circuit-type %s", VTY_NEWLINE
);
971 is_type
= circuit
->area
->is_type
;
972 if (is_type
== IS_LEVEL_1_AND_2
|| is_type
== circuit_t
)
973 isis_event_circuit_type_change (circuit
, circuit_t
);
976 vty_out (vty
, "invalid circuit level for area %s.%s",
977 circuit
->area
->area_tag
, VTY_NEWLINE
);
983 DEFUN (no_isis_circuit_type
,
984 no_isis_circuit_type_cmd
,
985 "no isis circuit-type (level-1|level-1-2|level-2-only)",
988 "Configure circuit type for interface\n"
989 "Level-1 only adjacencies are formed\n"
990 "Level-1-2 adjacencies are formed\n"
991 "Level-2 only adjacencies are formed\n")
993 struct isis_circuit
*circuit
;
994 struct interface
*ifp
;
1006 * Set the circuits level to its default value which is that of the area
1008 isis_event_circuit_type_change (circuit
, circuit
->area
->is_type
);
1015 "isis password WORD",
1017 "Configure the authentication password for interface\n"
1020 struct isis_circuit
*circuit
;
1021 struct interface
*ifp
;
1025 circuit
= ifp
->info
;
1026 if (circuit
== NULL
)
1031 len
= strlen (argv
[0]);
1034 vty_out (vty
, "Too long circuit password (>254)%s", VTY_NEWLINE
);
1037 circuit
->passwd
.len
= len
;
1038 circuit
->passwd
.type
= ISIS_PASSWD_TYPE_CLEARTXT
;
1039 strncpy ((char *)circuit
->passwd
.passwd
, argv
[0], 255);
1044 DEFUN (no_isis_passwd
,
1049 "Configure the authentication password for interface\n")
1051 struct isis_circuit
*circuit
;
1052 struct interface
*ifp
;
1055 circuit
= ifp
->info
;
1056 if (circuit
== NULL
)
1061 memset (&circuit
->passwd
, 0, sizeof (struct isis_passwd
));
1067 DEFUN (isis_priority
,
1069 "isis priority <0-127>",
1071 "Set priority for Designated Router election\n"
1074 struct isis_circuit
*circuit
;
1075 struct interface
*ifp
;
1079 circuit
= ifp
->info
;
1080 if (circuit
== NULL
)
1086 prio
= atoi (argv
[0]);
1088 circuit
->u
.bc
.priority
[0] = prio
;
1089 circuit
->u
.bc
.priority
[1] = prio
;
1094 DEFUN (no_isis_priority
,
1095 no_isis_priority_cmd
,
1099 "Set priority for Designated Router election\n")
1101 struct isis_circuit
*circuit
;
1102 struct interface
*ifp
;
1105 circuit
= ifp
->info
;
1106 if (circuit
== NULL
)
1112 circuit
->u
.bc
.priority
[0] = DEFAULT_PRIORITY
;
1113 circuit
->u
.bc
.priority
[1] = DEFAULT_PRIORITY
;
1118 ALIAS (no_isis_priority
,
1119 no_isis_priority_arg_cmd
,
1120 "no isis priority <0-127>",
1123 "Set priority for Designated Router election\n"
1126 DEFUN (isis_priority_l1
,
1127 isis_priority_l1_cmd
,
1128 "isis priority <0-127> level-1",
1130 "Set priority for Designated Router election\n"
1132 "Specify priority for level-1 routing\n")
1134 struct isis_circuit
*circuit
;
1135 struct interface
*ifp
;
1139 circuit
= ifp
->info
;
1140 if (circuit
== NULL
)
1146 prio
= atoi (argv
[0]);
1148 circuit
->u
.bc
.priority
[0] = prio
;
1153 DEFUN (no_isis_priority_l1
,
1154 no_isis_priority_l1_cmd
,
1155 "no isis priority level-1",
1158 "Set priority for Designated Router election\n"
1159 "Specify priority for level-1 routing\n")
1161 struct isis_circuit
*circuit
;
1162 struct interface
*ifp
;
1165 circuit
= ifp
->info
;
1166 if (circuit
== NULL
)
1172 circuit
->u
.bc
.priority
[0] = DEFAULT_PRIORITY
;
1177 ALIAS (no_isis_priority_l1
,
1178 no_isis_priority_l1_arg_cmd
,
1179 "no isis priority <0-127> level-1",
1182 "Set priority for Designated Router election\n"
1184 "Specify priority for level-1 routing\n")
1186 DEFUN (isis_priority_l2
,
1187 isis_priority_l2_cmd
,
1188 "isis priority <0-127> level-2",
1190 "Set priority for Designated Router election\n"
1192 "Specify priority for level-2 routing\n")
1194 struct isis_circuit
*circuit
;
1195 struct interface
*ifp
;
1199 circuit
= ifp
->info
;
1200 if (circuit
== NULL
)
1206 prio
= atoi (argv
[0]);
1208 circuit
->u
.bc
.priority
[1] = prio
;
1213 DEFUN (no_isis_priority_l2
,
1214 no_isis_priority_l2_cmd
,
1215 "no isis priority level-2",
1218 "Set priority for Designated Router election\n"
1219 "Specify priority for level-2 routing\n")
1221 struct isis_circuit
*circuit
;
1222 struct interface
*ifp
;
1225 circuit
= ifp
->info
;
1226 if (circuit
== NULL
)
1232 circuit
->u
.bc
.priority
[1] = DEFAULT_PRIORITY
;
1237 ALIAS (no_isis_priority_l2
,
1238 no_isis_priority_l2_arg_cmd
,
1239 "no isis priority <0-127> level-2",
1242 "Set priority for Designated Router election\n"
1244 "Specify priority for level-2 routing\n")
1246 /* Metric command */
1249 "isis metric <0-16777215>",
1251 "Set default metric for circuit\n"
1252 "Default metric value\n")
1254 struct isis_circuit
*circuit
;
1255 struct interface
*ifp
;
1259 circuit
= ifp
->info
;
1260 if (circuit
== NULL
)
1266 met
= atoi (argv
[0]);
1268 circuit
->te_metric
[0] = met
;
1269 circuit
->te_metric
[1] = met
;
1274 circuit
->metrics
[0].metric_default
= met
;
1275 circuit
->metrics
[1].metric_default
= met
;
1280 DEFUN (no_isis_metric
,
1285 "Set default metric for circuit\n")
1287 struct isis_circuit
*circuit
;
1288 struct interface
*ifp
;
1291 circuit
= ifp
->info
;
1292 if (circuit
== NULL
)
1298 circuit
->te_metric
[0] = DEFAULT_CIRCUIT_METRICS
;
1299 circuit
->te_metric
[1] = DEFAULT_CIRCUIT_METRICS
;
1300 circuit
->metrics
[0].metric_default
= DEFAULT_CIRCUIT_METRICS
;
1301 circuit
->metrics
[1].metric_default
= DEFAULT_CIRCUIT_METRICS
;
1306 ALIAS (no_isis_metric
,
1307 no_isis_metric_arg_cmd
,
1308 "no isis metric <0-16777215>",
1311 "Set default metric for circuit\n"
1312 "Default metric value\n")
1314 /* end of metrics */
1315 DEFUN (isis_hello_interval
,
1316 isis_hello_interval_cmd
,
1317 "isis hello-interval (<1-65535>|minimal)",
1319 "Set Hello interval\n"
1320 "Hello interval value\n"
1321 "Holdtime 1 seconds, interval depends on multiplier\n")
1323 struct isis_circuit
*circuit
;
1324 struct interface
*ifp
;
1329 circuit
= ifp
->info
;
1330 if (circuit
== NULL
)
1336 if (isdigit ((int) c
))
1338 interval
= atoi (argv
[0]);
1341 interval
= HELLO_MINIMAL
; /* FIXME: should be calculated */
1343 circuit
->hello_interval
[0] = (u_int16_t
) interval
;
1344 circuit
->hello_interval
[1] = (u_int16_t
) interval
;
1349 DEFUN (no_isis_hello_interval
,
1350 no_isis_hello_interval_cmd
,
1351 "no isis hello-interval",
1354 "Set Hello interval\n")
1356 struct isis_circuit
*circuit
;
1357 struct interface
*ifp
;
1360 circuit
= ifp
->info
;
1361 if (circuit
== NULL
)
1368 circuit
->hello_interval
[0] = HELLO_INTERVAL
; /* Default is 1 sec. */
1369 circuit
->hello_interval
[1] = HELLO_INTERVAL
;
1374 ALIAS (no_isis_hello_interval
,
1375 no_isis_hello_interval_arg_cmd
,
1376 "no isis hello-interval (<1-65535>|minimal)",
1379 "Set Hello interval\n"
1380 "Hello interval value\n"
1381 "Holdtime 1 second, interval depends on multiplier\n")
1383 DEFUN (isis_hello_interval_l1
,
1384 isis_hello_interval_l1_cmd
,
1385 "isis hello-interval (<1-65535>|minimal) level-1",
1387 "Set Hello interval\n"
1388 "Hello interval value\n"
1389 "Holdtime 1 second, interval depends on multiplier\n"
1390 "Specify hello-interval for level-1 IIHs\n")
1392 struct isis_circuit
*circuit
;
1393 struct interface
*ifp
;
1398 circuit
= ifp
->info
;
1399 if (circuit
== NULL
)
1406 if (isdigit ((int) c
))
1408 interval
= atoi (argv
[0]);
1411 interval
= HELLO_MINIMAL
;
1413 circuit
->hello_interval
[0] = (u_int16_t
) interval
;
1418 DEFUN (no_isis_hello_interval_l1
,
1419 no_isis_hello_interval_l1_cmd
,
1420 "no isis hello-interval level-1",
1423 "Set Hello interval\n"
1424 "Specify hello-interval for level-1 IIHs\n")
1426 struct isis_circuit
*circuit
;
1427 struct interface
*ifp
;
1430 circuit
= ifp
->info
;
1431 if (circuit
== NULL
)
1438 circuit
->hello_interval
[0] = HELLO_INTERVAL
; /* Default is 1 sec. */
1443 ALIAS (no_isis_hello_interval_l1
,
1444 no_isis_hello_interval_l1_arg_cmd
,
1445 "no isis hello-interval (<1-65535>|minimal) level-1",
1448 "Set Hello interval\n"
1449 "Hello interval value\n"
1450 "Holdtime 1 second, interval depends on multiplier\n"
1451 "Specify hello-interval for level-1 IIHs\n")
1453 DEFUN (isis_hello_interval_l2
,
1454 isis_hello_interval_l2_cmd
,
1455 "isis hello-interval (<1-65535>|minimal) level-2",
1457 "Set Hello interval\n"
1458 "Hello interval value\n"
1459 "Holdtime 1 second, interval depends on multiplier\n"
1460 "Specify hello-interval for level-2 IIHs\n")
1462 struct isis_circuit
*circuit
;
1463 struct interface
*ifp
;
1468 circuit
= ifp
->info
;
1469 if (circuit
== NULL
)
1476 if (isdigit ((int) c
))
1478 interval
= atoi (argv
[0]);
1481 interval
= HELLO_MINIMAL
;
1483 circuit
->hello_interval
[1] = (u_int16_t
) interval
;
1488 DEFUN (no_isis_hello_interval_l2
,
1489 no_isis_hello_interval_l2_cmd
,
1490 "no isis hello-interval level-2",
1493 "Set Hello interval\n"
1494 "Specify hello-interval for level-2 IIHs\n")
1496 struct isis_circuit
*circuit
;
1497 struct interface
*ifp
;
1500 circuit
= ifp
->info
;
1501 if (circuit
== NULL
)
1508 circuit
->hello_interval
[1] = HELLO_INTERVAL
; /* Default is 1 sec. */
1513 ALIAS (no_isis_hello_interval_l2
,
1514 no_isis_hello_interval_l2_arg_cmd
,
1515 "no isis hello-interval (<1-65535>|minimal) level-2",
1518 "Set Hello interval\n"
1519 "Hello interval value\n"
1520 "Holdtime 1 second, interval depends on multiplier\n"
1521 "Specify hello-interval for level-2 IIHs\n")
1523 DEFUN (isis_hello_multiplier
,
1524 isis_hello_multiplier_cmd
,
1525 "isis hello-multiplier <3-1000>",
1527 "Set multiplier for Hello holding time\n"
1528 "Hello multiplier value\n")
1530 struct isis_circuit
*circuit
;
1531 struct interface
*ifp
;
1535 circuit
= ifp
->info
;
1536 if (circuit
== NULL
)
1542 mult
= atoi (argv
[0]);
1544 circuit
->hello_multiplier
[0] = (u_int16_t
) mult
;
1545 circuit
->hello_multiplier
[1] = (u_int16_t
) mult
;
1550 DEFUN (no_isis_hello_multiplier
,
1551 no_isis_hello_multiplier_cmd
,
1552 "no isis hello-multiplier",
1555 "Set multiplier for Hello holding time\n")
1557 struct isis_circuit
*circuit
;
1558 struct interface
*ifp
;
1561 circuit
= ifp
->info
;
1562 if (circuit
== NULL
)
1568 circuit
->hello_multiplier
[0] = HELLO_MULTIPLIER
;
1569 circuit
->hello_multiplier
[1] = HELLO_MULTIPLIER
;
1574 ALIAS (no_isis_hello_multiplier
,
1575 no_isis_hello_multiplier_arg_cmd
,
1576 "no isis hello-multiplier <3-1000>",
1579 "Set multiplier for Hello holding time\n"
1580 "Hello multiplier value\n")
1582 DEFUN (isis_hello_multiplier_l1
,
1583 isis_hello_multiplier_l1_cmd
,
1584 "isis hello-multiplier <3-1000> level-1",
1586 "Set multiplier for Hello holding time\n"
1587 "Hello multiplier value\n"
1588 "Specify hello multiplier for level-1 IIHs\n")
1590 struct isis_circuit
*circuit
;
1591 struct interface
*ifp
;
1595 circuit
= ifp
->info
;
1596 if (circuit
== NULL
)
1602 mult
= atoi (argv
[0]);
1604 circuit
->hello_multiplier
[0] = (u_int16_t
) mult
;
1609 DEFUN (no_isis_hello_multiplier_l1
,
1610 no_isis_hello_multiplier_l1_cmd
,
1611 "no isis hello-multiplier level-1",
1614 "Set multiplier for Hello holding time\n"
1615 "Specify hello multiplier for level-1 IIHs\n")
1617 struct isis_circuit
*circuit
;
1618 struct interface
*ifp
;
1621 circuit
= ifp
->info
;
1622 if (circuit
== NULL
)
1628 circuit
->hello_multiplier
[0] = HELLO_MULTIPLIER
;
1633 ALIAS (no_isis_hello_multiplier_l1
,
1634 no_isis_hello_multiplier_l1_arg_cmd
,
1635 "no isis hello-multiplier <3-1000> level-1",
1638 "Set multiplier for Hello holding time\n"
1639 "Hello multiplier value\n"
1640 "Specify hello multiplier for level-1 IIHs\n")
1642 DEFUN (isis_hello_multiplier_l2
,
1643 isis_hello_multiplier_l2_cmd
,
1644 "isis hello-multiplier <3-1000> level-2",
1646 "Set multiplier for Hello holding time\n"
1647 "Hello multiplier value\n"
1648 "Specify hello multiplier for level-2 IIHs\n")
1650 struct isis_circuit
*circuit
;
1651 struct interface
*ifp
;
1655 circuit
= ifp
->info
;
1656 if (circuit
== NULL
)
1662 mult
= atoi (argv
[0]);
1664 circuit
->hello_multiplier
[1] = (u_int16_t
) mult
;
1669 DEFUN (no_isis_hello_multiplier_l2
,
1670 no_isis_hello_multiplier_l2_cmd
,
1671 "no isis hello-multiplier level-2",
1674 "Set multiplier for Hello holding time\n"
1675 "Specify hello multiplier for level-2 IIHs\n")
1677 struct isis_circuit
*circuit
;
1678 struct interface
*ifp
;
1681 circuit
= ifp
->info
;
1682 if (circuit
== NULL
)
1688 circuit
->hello_multiplier
[1] = HELLO_MULTIPLIER
;
1693 ALIAS (no_isis_hello_multiplier_l2
,
1694 no_isis_hello_multiplier_l2_arg_cmd
,
1695 "no isis hello-multiplier <3-1000> level-2",
1698 "Set multiplier for Hello holding time\n"
1699 "Hello multiplier value\n"
1700 "Specify hello multiplier for level-2 IIHs\n")
1704 "isis hello padding",
1706 "Add padding to IS-IS hello packets\n"
1707 "Pad hello packets\n"
1710 struct interface
*ifp
;
1711 struct isis_circuit
*circuit
;
1714 circuit
= ifp
->info
;
1715 if (circuit
== NULL
)
1721 circuit
->u
.bc
.pad_hellos
= 1;
1726 DEFUN (no_isis_hello
,
1728 "no isis hello padding",
1731 "Add padding to IS-IS hello packets\n"
1732 "Pad hello packets\n"
1735 struct isis_circuit
*circuit
;
1736 struct interface
*ifp
;
1739 circuit
= ifp
->info
;
1740 if (circuit
== NULL
)
1746 circuit
->u
.bc
.pad_hellos
= 0;
1751 DEFUN (csnp_interval
,
1753 "isis csnp-interval <0-65535>",
1755 "Set CSNP interval in seconds\n"
1756 "CSNP interval value\n")
1758 struct isis_circuit
*circuit
;
1759 struct interface
*ifp
;
1760 unsigned long interval
;
1763 circuit
= ifp
->info
;
1764 if (circuit
== NULL
)
1770 interval
= atol (argv
[0]);
1772 circuit
->csnp_interval
[0] = (u_int16_t
) interval
;
1773 circuit
->csnp_interval
[1] = (u_int16_t
) interval
;
1778 DEFUN (no_csnp_interval
,
1779 no_csnp_interval_cmd
,
1780 "no isis csnp-interval",
1783 "Set CSNP interval in seconds\n")
1785 struct isis_circuit
*circuit
;
1786 struct interface
*ifp
;
1789 circuit
= ifp
->info
;
1790 if (circuit
== NULL
)
1796 circuit
->csnp_interval
[0] = CSNP_INTERVAL
;
1797 circuit
->csnp_interval
[1] = CSNP_INTERVAL
;
1802 ALIAS (no_csnp_interval
,
1803 no_csnp_interval_arg_cmd
,
1804 "no isis csnp-interval <0-65535>",
1807 "Set CSNP interval in seconds\n"
1808 "CSNP interval value\n")
1810 DEFUN (csnp_interval_l1
,
1811 csnp_interval_l1_cmd
,
1812 "isis csnp-interval <0-65535> level-1",
1814 "Set CSNP interval in seconds\n"
1815 "CSNP interval value\n"
1816 "Specify interval for level-1 CSNPs\n")
1818 struct isis_circuit
*circuit
;
1819 struct interface
*ifp
;
1820 unsigned long interval
;
1823 circuit
= ifp
->info
;
1824 if (circuit
== NULL
)
1830 interval
= atol (argv
[0]);
1832 circuit
->csnp_interval
[0] = (u_int16_t
) interval
;
1837 DEFUN (no_csnp_interval_l1
,
1838 no_csnp_interval_l1_cmd
,
1839 "no isis csnp-interval level-1",
1842 "Set CSNP interval in seconds\n"
1843 "Specify interval for level-1 CSNPs\n")
1845 struct isis_circuit
*circuit
;
1846 struct interface
*ifp
;
1849 circuit
= ifp
->info
;
1850 if (circuit
== NULL
)
1856 circuit
->csnp_interval
[0] = CSNP_INTERVAL
;
1861 ALIAS (no_csnp_interval_l1
,
1862 no_csnp_interval_l1_arg_cmd
,
1863 "no isis csnp-interval <0-65535> level-1",
1866 "Set CSNP interval in seconds\n"
1867 "CSNP interval value\n"
1868 "Specify interval for level-1 CSNPs\n")
1870 DEFUN (csnp_interval_l2
,
1871 csnp_interval_l2_cmd
,
1872 "isis csnp-interval <0-65535> level-2",
1874 "Set CSNP interval in seconds\n"
1875 "CSNP interval value\n"
1876 "Specify interval for level-2 CSNPs\n")
1878 struct isis_circuit
*circuit
;
1879 struct interface
*ifp
;
1880 unsigned long interval
;
1883 circuit
= ifp
->info
;
1884 if (circuit
== NULL
)
1890 interval
= atol (argv
[0]);
1892 circuit
->csnp_interval
[1] = (u_int16_t
) interval
;
1897 DEFUN (no_csnp_interval_l2
,
1898 no_csnp_interval_l2_cmd
,
1899 "no isis csnp-interval level-2",
1902 "Set CSNP interval in seconds\n"
1903 "Specify interval for level-2 CSNPs\n")
1905 struct isis_circuit
*circuit
;
1906 struct interface
*ifp
;
1909 circuit
= ifp
->info
;
1910 if (circuit
== NULL
)
1916 circuit
->csnp_interval
[1] = CSNP_INTERVAL
;
1921 ALIAS (no_csnp_interval_l2
,
1922 no_csnp_interval_l2_arg_cmd
,
1923 "no isis csnp-interval <0-65535> level-2",
1926 "Set CSNP interval in seconds\n"
1927 "CSNP interval value\n"
1928 "Specify interval for level-2 CSNPs\n")
1931 DEFUN (ipv6_router_isis
,
1932 ipv6_router_isis_cmd
,
1933 "ipv6 router isis WORD",
1934 "IPv6 interface subcommands\n"
1935 "IPv6 Router interface commands\n"
1936 "IS-IS Routing for IPv6\n"
1937 "Routing process tag\n")
1939 struct isis_circuit
*c
;
1940 struct interface
*ifp
;
1941 struct isis_area
*area
;
1943 ifp
= (struct interface
*) vty
->index
;
1946 area
= isis_area_lookup (argv
[0]);
1948 /* Prevent more than one circuit per interface */
1950 c
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
1954 if (c
&& (ifp
->info
!= NULL
))
1956 if (c
->ipv6_router
== 1)
1958 vty_out (vty
, "ISIS circuit is already defined for IPv6%s",
1964 /* this is here for ciscopability */
1967 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
1973 c
= circuit_lookup_by_ifp (ifp
, isis
->init_circ_list
);
1974 c
= isis_csm_state_change (ISIS_ENABLE
, c
, area
);
1983 area
->ipv6_circuits
++;
1984 circuit_update_nlpids (c
);
1986 vty
->node
= INTERFACE_NODE
;
1991 DEFUN (no_ipv6_router_isis
,
1992 no_ipv6_router_isis_cmd
,
1993 "no ipv6 router isis WORD",
1995 "IPv6 interface subcommands\n"
1996 "IPv6 Router interface commands\n"
1997 "IS-IS Routing for IPv6\n"
1998 "Routing process tag\n")
2000 struct isis_circuit
*c
;
2001 struct interface
*ifp
;
2002 struct isis_area
*area
;
2004 ifp
= (struct interface
*) vty
->index
;
2005 /* UGLY - will remove l8r
2006 if (circuit == NULL) {
2011 area
= isis_area_lookup (argv
[0]);
2014 vty_out (vty
, "Can't find ISIS instance %s", VTY_NEWLINE
);
2018 c
= circuit_lookup_by_ifp (ifp
, area
->circuit_list
);
2023 area
->ipv6_circuits
--;
2024 if (c
->ip_router
== 0)
2025 isis_csm_state_change (ISIS_DISABLE
, c
, area
);
2029 #endif /* HAVE_IPV6 */
2031 struct cmd_node interface_node
= {
2038 isis_if_new_hook (struct interface
*ifp
)
2040 /* FIXME: Discuss if the circuit should be created here
2041 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2047 isis_if_delete_hook (struct interface
*ifp
)
2049 /* FIXME: Discuss if the circuit should be created here
2050 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2056 isis_circuit_init ()
2058 /* Initialize Zebra interface data structure */
2060 if_add_hook (IF_NEW_HOOK
, isis_if_new_hook
);
2061 if_add_hook (IF_DELETE_HOOK
, isis_if_delete_hook
);
2063 /* Install interface node */
2064 install_node (&interface_node
, isis_interface_config_write
);
2065 install_element (CONFIG_NODE
, &interface_cmd
);
2067 install_default (INTERFACE_NODE
);
2068 install_element (INTERFACE_NODE
, &interface_desc_cmd
);
2069 install_element (INTERFACE_NODE
, &no_interface_desc_cmd
);
2071 install_element (INTERFACE_NODE
, &ip_router_isis_cmd
);
2072 install_element (INTERFACE_NODE
, &no_ip_router_isis_cmd
);
2074 install_element (INTERFACE_NODE
, &isis_circuit_type_cmd
);
2075 install_element (INTERFACE_NODE
, &no_isis_circuit_type_cmd
);
2077 install_element (INTERFACE_NODE
, &isis_passwd_cmd
);
2078 install_element (INTERFACE_NODE
, &no_isis_passwd_cmd
);
2080 install_element (INTERFACE_NODE
, &isis_priority_cmd
);
2081 install_element (INTERFACE_NODE
, &no_isis_priority_cmd
);
2082 install_element (INTERFACE_NODE
, &no_isis_priority_arg_cmd
);
2083 install_element (INTERFACE_NODE
, &isis_priority_l1_cmd
);
2084 install_element (INTERFACE_NODE
, &no_isis_priority_l1_cmd
);
2085 install_element (INTERFACE_NODE
, &no_isis_priority_l1_arg_cmd
);
2086 install_element (INTERFACE_NODE
, &isis_priority_l2_cmd
);
2087 install_element (INTERFACE_NODE
, &no_isis_priority_l2_cmd
);
2088 install_element (INTERFACE_NODE
, &no_isis_priority_l2_arg_cmd
);
2090 install_element (INTERFACE_NODE
, &isis_metric_cmd
);
2091 install_element (INTERFACE_NODE
, &no_isis_metric_cmd
);
2092 install_element (INTERFACE_NODE
, &no_isis_metric_arg_cmd
);
2094 install_element (INTERFACE_NODE
, &isis_hello_interval_cmd
);
2095 install_element (INTERFACE_NODE
, &no_isis_hello_interval_cmd
);
2096 install_element (INTERFACE_NODE
, &no_isis_hello_interval_arg_cmd
);
2097 install_element (INTERFACE_NODE
, &isis_hello_interval_l1_cmd
);
2098 install_element (INTERFACE_NODE
, &no_isis_hello_interval_l1_cmd
);
2099 install_element (INTERFACE_NODE
, &no_isis_hello_interval_l1_arg_cmd
);
2100 install_element (INTERFACE_NODE
, &isis_hello_interval_l2_cmd
);
2101 install_element (INTERFACE_NODE
, &no_isis_hello_interval_l2_cmd
);
2102 install_element (INTERFACE_NODE
, &no_isis_hello_interval_l2_arg_cmd
);
2104 install_element (INTERFACE_NODE
, &isis_hello_multiplier_cmd
);
2105 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_cmd
);
2106 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_arg_cmd
);
2107 install_element (INTERFACE_NODE
, &isis_hello_multiplier_l1_cmd
);
2108 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_l1_cmd
);
2109 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_l1_arg_cmd
);
2110 install_element (INTERFACE_NODE
, &isis_hello_multiplier_l2_cmd
);
2111 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_l2_cmd
);
2112 install_element (INTERFACE_NODE
, &no_isis_hello_multiplier_l2_arg_cmd
);
2114 install_element (INTERFACE_NODE
, &isis_hello_cmd
);
2115 install_element (INTERFACE_NODE
, &no_isis_hello_cmd
);
2116 install_element (INTERFACE_NODE
, &csnp_interval_cmd
);
2117 install_element (INTERFACE_NODE
, &no_csnp_interval_cmd
);
2118 install_element (INTERFACE_NODE
, &no_csnp_interval_arg_cmd
);
2119 install_element (INTERFACE_NODE
, &csnp_interval_l1_cmd
);
2120 install_element (INTERFACE_NODE
, &no_csnp_interval_l1_cmd
);
2121 install_element (INTERFACE_NODE
, &no_csnp_interval_l1_arg_cmd
);
2122 install_element (INTERFACE_NODE
, &csnp_interval_l2_cmd
);
2123 install_element (INTERFACE_NODE
, &no_csnp_interval_l2_cmd
);
2124 install_element (INTERFACE_NODE
, &no_csnp_interval_l2_arg_cmd
);
2127 install_element (INTERFACE_NODE
, &ipv6_router_isis_cmd
);
2128 install_element (INTERFACE_NODE
, &no_ipv6_router_isis_cmd
);