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.
26
#include <net/ethernet.h>
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"
56
extern struct thread_master *master;
57
extern struct isis *isis;
62
struct isis_circuit *circuit;
65
circuit = XMALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_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;
76
zlog_err ("Can't malloc isis circuit");
85
isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area)
90
* The level for the circuit is same as for the area, unless configured
93
circuit->circuit_is_type = area->is_type;
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;
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;
109
circuit->lsp_interval = LSP_INTERVAL;
112
* Add the circuit into area
114
listnode_add (area->circuit_list, circuit);
116
circuit->idx = flags_get_index (&area->flags);
117
circuit->lsp_queue = list_new ();
123
isis_circuit_deconfigure (struct isis_circuit *circuit,
124
struct isis_area *area)
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);
135
struct isis_circuit *
136
circuit_lookup_by_ifp (struct interface *ifp, struct list *list)
138
struct isis_circuit *circuit = NULL;
139
struct listnode *node;
144
for (node = listhead (list); node; nextnode (node)) {
145
circuit = getdata (node);
146
if (circuit->interface == ifp)
153
struct isis_circuit *
154
circuit_scan_by_ifp (struct interface *ifp)
156
struct isis_area *area;
157
struct listnode *node;
158
struct isis_circuit *circuit;
160
if (!isis->area_list)
163
for (node = listhead (isis->area_list); node; nextnode (node)) {
164
area = getdata (node);
165
circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
170
return circuit_lookup_by_ifp (ifp, isis->init_circ_list);
174
isis_circuit_del (struct isis_circuit *circuit)
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 */
191
if (circuit->ip_addrs)
192
list_delete (circuit->ip_addrs);
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 */
200
/* and lastly the circuit itself */
201
XFREE (MTYPE_ISIS_CIRCUIT, circuit);
207
isis_circuit_add_addr (struct isis_circuit *circuit,
208
struct connected *conn)
210
struct prefix_ipv4 *ipv4;
213
struct prefix_ipv6 *ipv6;
214
#endif /* HAVE_IPV6 */
215
if (!circuit->ip_addrs) {
216
circuit->ip_addrs = list_new ();
219
if (!circuit->ipv6_link) {
220
circuit->ipv6_link = list_new ();
222
if (!circuit->ipv6_non_link) {
223
circuit->ipv6_non_link = list_new ();
225
#endif /* HAVE_IPV6 */
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);
235
zlog_info ("Added IP address %s to circuit %d", buf,
236
circuit->circuit_id);
237
#endif /* EXTREME_DEBUG */
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);
247
listnode_add (circuit->ipv6_non_link, ipv6);
249
prefix2str (conn->address, buf, BUFSIZ);
251
zlog_info ("Added IPv6 address %s to circuit %d", buf,
252
circuit->circuit_id);
253
#endif /* EXTREME_DEBUG */
255
#endif /* HAVE_IPV6 */
262
isis_circuit_del_addr (struct isis_circuit *circuit,
263
struct connected *connected)
269
isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
271
struct listnode *node;
272
struct connected *conn;
274
circuit->interface = ifp;
277
circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */
279
/* isis_circuit_update_addrs (circuit, ifp); */
281
if (if_is_broadcast (ifp)) {
282
circuit->circ_type = CIRCUIT_T_BROADCAST;
284
* Get the Hardware Address
286
#ifdef HAVE_SOCKADDR_DL
287
if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
288
zlog_warn ("unsupported link layer");
290
memcpy (circuit->u.bc.snpa, LLADDR(&circuit->interface->sdl), ETH_ALEN);
292
if (circuit->interface->hw_addr_len != ETH_ALEN) {
293
zlog_warn ("unsupported link layer");
295
memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN);
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));
302
#endif /* EXTREME_DEBUG */
303
#endif /* HAVE_SOCKADDR_DL */
304
} else if (if_is_pointopoint (ifp)) {
305
circuit->circ_type = CIRCUIT_T_P2P;
307
zlog_warn ("isis_circuit_if_add: unsupported media");
310
for (node = ifp->connected ? listhead (ifp->connected) : NULL; node;
312
conn = getdata (node);
313
isis_circuit_add_addr (circuit, conn);
320
isis_circuit_update_params (struct isis_circuit *circuit,
321
struct interface *ifp)
325
if (circuit->circuit_id != ifp->ifindex) {
326
zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
328
circuit->circuit_id = ifp->ifindex % 255;
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,
338
circuit->mtu = ifp->mtu;
342
* Get the Hardware Address
344
#ifdef HAVE_SOCKADDR_DL
345
if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
346
zlog_warn ("unsupported link layer");
348
memcpy (circuit->u.bc.snpa, LLADDR(&circuit->interface->sdl), ETH_ALEN);
350
if (circuit->interface->hw_addr_len != ETH_ALEN) {
351
zlog_warn ("unsupported link layer");
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));
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;
368
zlog_warn ("isis_circuit_update_params: unsupported media");
375
isis_circuit_if_del (struct isis_circuit *circuit)
377
circuit->interface->info = NULL;
378
circuit->interface = NULL;
384
isis_circuit_up (struct isis_circuit *circuit)
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);
392
* ISO 10589 - 8.4.1 Enabling of broadcast circuits
395
/* initilizing the hello sending threads
399
/* 8.4.1 a) commence sending of IIH PDUs */
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 ();
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 ();
411
/* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
412
/* 8.4.1 c) FIXME: listen for ESH PDUs */
415
/* dr election will commence in... */
416
if (circuit->circuit_is_type & IS_LEVEL_1)
417
THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
419
2 * circuit->hello_multiplier[0] * circuit->hello_interval[0]);
420
if (circuit->circuit_is_type & IS_LEVEL_2)
421
THREAD_TIMER_ON(master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
423
2 * circuit->hello_multiplier[1] * circuit->hello_interval[1]);
425
/* initializing the hello send threads
428
thread_add_event (master, send_p2p_hello, circuit, 0);
432
/* initializing PSNP timers */
433
if (circuit->circuit_is_type & IS_LEVEL_1) {
434
THREAD_TIMER_ON(master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
435
isis_jitter(circuit->psnp_interval[0], PSNP_JITTER));
438
if (circuit->circuit_is_type & IS_LEVEL_2) {
439
THREAD_TIMER_ON(master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
440
isis_jitter(circuit->psnp_interval[1], PSNP_JITTER));
443
/* initialize the circuit streams */
444
if (circuit->rcv_stream == NULL)
445
circuit->rcv_stream = stream_new (ISO_MTU(circuit));
447
if (circuit->snd_stream == NULL)
448
circuit->snd_stream = stream_new (ISO_MTU(circuit));
450
/* unified init for circuits */
451
isis_sock_init (circuit);
454
THREAD_READ_ON(master, circuit->t_read, isis_receive, circuit,
457
THREAD_TIMER_ON(master, circuit->t_read, isis_receive, circuit,
464
isis_circuit_down (struct isis_circuit *circuit)
466
/* Cancel all active threads -- FIXME: wrong place*/
467
/* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
468
THREAD_OFF(circuit->t_read);
469
if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
470
THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[0]);
471
THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[1]);
472
} else if (circuit->circ_type == CIRCUIT_T_P2P) {
473
THREAD_TIMER_OFF(circuit->u.p2p.t_send_p2p_hello);
475
/* close the socket */
482
circuit_update_nlpids (struct isis_circuit *circuit)
484
circuit->nlpids.count = 0;
486
if (circuit->ip_router) {
487
circuit->nlpids.nlpids[0] = NLPID_IP;
488
circuit->nlpids.count++;
491
if (circuit->ipv6_router) {
492
circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
493
circuit->nlpids.count++;
495
#endif /* HAVE_IPV6 */
500
isis_interface_config_write (struct vty *vty)
507
struct interface *ifp;
508
struct isis_area *area;
509
struct isis_circuit *c;
510
struct prefix_ipv4 *ip;
513
struct prefix_ipv6 *ipv6;
514
#endif /*HAVE_IPV6 */
519
LIST_LOOP (iflist, ifp, node)
522
vty_out (vty, "interface %s%s", ifp->name,VTY_NEWLINE);
526
vty_out (vty, " description %s%s", ifp->desc,VTY_NEWLINE);
530
LIST_LOOP (isis->area_list, area, node2)
532
c = circuit_lookup_by_ifp (ifp, area->circuit_list);
535
vty_out (vty, " ip router isis %s%s",area->area_tag,VTY_NEWLINE);
539
if (c->ipv6_router) {
540
vty_out (vty, " ipv6 router isis %s%s",area->area_tag,VTY_NEWLINE);
543
#endif /* HAVE_IPV6 */
545
/* ISIS - circuit type */
546
if (c->circuit_is_type == IS_LEVEL_1) {
547
vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
549
} else {if (c->circuit_is_type == IS_LEVEL_2) {
550
vty_out (vty, " isis circuit-type level-2-only%s", VTY_NEWLINE);
554
/* ISIS - CSNP interval - FIXME: compare to cisco*/
555
if (c->csnp_interval[0] == c->csnp_interval[1]) {
556
if (c->csnp_interval[0] != CSNP_INTERVAL) {
557
vty_out (vty, " isis csnp-interval %d%s", c->csnp_interval[0],
563
if (c->csnp_interval[1] != CSNP_INTERVAL) {
564
vty_out (vty, " isis csnp-interval %d level-%d%s",
565
c->csnp_interval[1],i+1, VTY_NEWLINE);
571
/* ISIS - Hello padding - Defaults to true so only display if false */
572
if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos) {
573
vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
577
/* ISIS - Hello interval - FIXME: compare to cisco */
578
if (c->hello_interval[0] == c->hello_interval[1]) {
579
if (c->hello_interval[0] != HELLO_INTERVAL) {
580
vty_out (vty, " isis hello-interval %d%s", c->hello_interval[0],
586
if (c->hello_interval[i] != HELLO_INTERVAL) {
587
if (c->hello_interval[i] == HELLO_MINIMAL) {
588
vty_out (vty, " isis hello-interval minimal level-%d%s", i+1,
591
vty_out (vty, " isis hello-interval %d level-%d%s",
592
c->hello_interval[i],i+1, VTY_NEWLINE);
599
/* ISIS - Hello Multiplier */
600
if (c->hello_multiplier[0] == c->hello_multiplier[1]) {
601
if (c->hello_multiplier[0] != HELLO_MULTIPLIER ) {
602
vty_out (vty, " isis hello-multiplier %d%s",
603
c->hello_multiplier[0], VTY_NEWLINE);
608
if (c->hello_multiplier[i] != HELLO_MULTIPLIER) {
609
vty_out (vty, " isis hello-multiplier %d level-%d%s",
610
c->hello_multiplier[i],i+1, VTY_NEWLINE);
615
/* ISIS - Priority */
616
if (c->circ_type == CIRCUIT_T_BROADCAST) {
617
if (c->u.bc.priority[0] == c->u.bc.priority[1]) {
618
if (c->u.bc.priority[0] != DEFAULT_PRIORITY) {
619
vty_out (vty, " isis priority %d%s", c->u.bc.priority[0],
625
if (c->u.bc.priority[i] != DEFAULT_PRIORITY) {
626
vty_out (vty, " isis priority %d level-%d%s",
627
c->u.bc.priority[i],i+1, VTY_NEWLINE);
634
if (c->metrics[0].metric_default == c->metrics[1].metric_default) {
635
if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS) {
636
vty_out (vty, " isis metric %d%s", c->metrics[0].metric_default,
642
if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS) {
643
vty_out (vty, " isis metric %d level-%d%s",
644
c->metrics[i].metric_default,i+1, VTY_NEWLINE);
652
vty_out (vty, "!%s",VTY_NEWLINE);
659
DEFUN (ip_router_isis,
661
"ip router isis WORD",
662
"Interface Internet Protocol config commands\n"
663
"IP router interface commands\n"
664
"IS-IS Routing for IP\n"
665
"Routing process tag\n"
668
struct isis_circuit *c;
669
struct interface *ifp;
670
struct isis_area *area;
672
ifp = (struct interface *)vty->index;
675
area = isis_area_lookup (argv[0]);
677
/* Prevent more than one circuit per interface */
679
c = circuit_lookup_by_ifp (ifp, area->circuit_list);
681
if (c && (ifp->info != NULL)) {
683
if (c->ipv6_router == 0) {
684
#endif /* HAVE_IPV6 */
685
vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE);
689
#endif /* HAVE_IPV6 */
692
/* this is here for ciscopability */
694
vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
699
c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
700
c = isis_csm_state_change (ISIS_ENABLE, c, area);
701
c->interface = ifp; /* this is automatic */
702
ifp->info = c; /* hardly related to the FSM */
710
circuit_update_nlpids (c);
712
vty->node = INTERFACE_NODE;
717
DEFUN (no_ip_router_isis,
718
no_ip_router_isis_cmd,
719
"no ip router isis WORD",
721
"Interface Internet Protocol config commands\n"
722
"IP router interface commands\n"
723
"IS-IS Routing for IP\n"
724
"Routing process tag\n"
727
struct isis_circuit *circuit = NULL;
728
struct interface *ifp;
729
struct isis_area *area;
730
struct listnode *node;
732
ifp = (struct interface *)vty->index;
735
area = isis_area_lookup (argv[0]);
737
vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
740
LIST_LOOP (area->circuit_list, circuit, node)
741
if (circuit->interface == ifp)
744
vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE);
747
circuit->ip_router = 0;
750
if (circuit->ipv6_router == 0)
752
isis_csm_state_change (ISIS_DISABLE, circuit, area);
757
DEFUN (isis_circuit_type,
758
isis_circuit_type_cmd,
759
"isis circuit-type (level-1|level-1-2|level-2-only)",
761
"Configure circuit type for interface\n"
762
"Level-1 only adjacencies are formed\n"
763
"Level-1-2 adjacencies are formed\n"
764
"Level-2 only adjacencies are formed\n"
767
struct isis_circuit *circuit;
768
struct interface *ifp;
774
/* UGLY - will remove l8r */
775
if (circuit == NULL) {
781
circuit_t = string2circuit_t (argv[0]);
784
vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
788
is_type = circuit->area->is_type;
789
if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t)
790
isis_event_circuit_type_change (circuit, circuit_t);
792
vty_out (vty, "invalid circuit level for area %s.%s",
793
circuit->area->area_tag, VTY_NEWLINE);
799
DEFUN (no_isis_circuit_type,
800
no_isis_circuit_type_cmd,
801
"no isis circuit-type (level-1|level-1-2|level-2-only)",
804
"Configure circuit type for interface\n"
805
"Level-1 only adjacencies are formed\n"
806
"Level-1-2 adjacencies are formed\n"
807
"Level-2 only adjacencies are formed\n"
810
struct isis_circuit *circuit;
811
struct interface *ifp;
815
if (circuit == NULL) {
822
* Set the circuits level to its default value which is that of the area
824
isis_event_circuit_type_change (circuit, circuit->area->is_type);
831
"isis password WORD",
833
"Configure the authentication password for interface\n"
836
struct isis_circuit *circuit;
837
struct interface *ifp;
842
if (circuit == NULL) {
846
len = strlen (argv[0]);
848
vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
851
circuit->passwd.len = len;
852
circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
853
strncpy (circuit->passwd.passwd, argv[0], 255);
858
DEFUN (no_isis_passwd,
863
"Configure the authentication password for interface\n")
865
struct isis_circuit *circuit;
866
struct interface *ifp;
870
if (circuit == NULL) {
874
memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
880
DEFUN (isis_priority,
882
"isis priority <0-127>",
884
"Set priority for Designated Router election\n"
888
struct isis_circuit *circuit;
889
struct interface *ifp;
894
if (circuit == NULL) {
899
prio = atoi (argv[0]);
901
circuit->u.bc.priority[0] = prio;
902
circuit->u.bc.priority[1] = prio;
907
DEFUN (no_isis_priority,
908
no_isis_priority_cmd,
912
"Set priority for Designated Router election\n"
915
struct isis_circuit *circuit;
916
struct interface *ifp;
920
if (circuit == NULL) {
925
circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
926
circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
931
ALIAS (no_isis_priority,
932
no_isis_priority_arg_cmd,
933
"no isis priority <0-127>",
936
"Set priority for Designated Router election\n"
940
DEFUN (isis_priority_l1,
941
isis_priority_l1_cmd,
942
"isis priority <0-127> level-1",
944
"Set priority for Designated Router election\n"
946
"Specify priority for level-1 routing\n"
949
struct isis_circuit *circuit;
950
struct interface *ifp;
955
if (circuit == NULL) {
960
prio = atoi (argv[0]);
962
circuit->u.bc.priority[0] = prio;
967
DEFUN (no_isis_priority_l1,
968
no_isis_priority_l1_cmd,
969
"no isis priority level-1",
972
"Set priority for Designated Router election\n"
973
"Specify priority for level-1 routing\n"
976
struct isis_circuit *circuit;
977
struct interface *ifp;
981
if (circuit == NULL) {
986
circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
991
ALIAS (no_isis_priority_l1,
992
no_isis_priority_l1_arg_cmd,
993
"no isis priority <0-127> level-1",
996
"Set priority for Designated Router election\n"
998
"Specify priority for level-1 routing\n"
1001
DEFUN (isis_priority_l2,
1002
isis_priority_l2_cmd,
1003
"isis priority <0-127> level-2",
1005
"Set priority for Designated Router election\n"
1007
"Specify priority for level-2 routing\n"
1010
struct isis_circuit *circuit;
1011
struct interface *ifp;
1015
circuit = ifp->info;
1016
if (circuit == NULL) {
1021
prio = atoi (argv[0]);
1023
circuit->u.bc.priority[1] = prio;
1028
DEFUN (no_isis_priority_l2,
1029
no_isis_priority_l2_cmd,
1030
"no isis priority level-2",
1033
"Set priority for Designated Router election\n"
1034
"Specify priority for level-2 routing\n"
1037
struct isis_circuit *circuit;
1038
struct interface *ifp;
1041
circuit = ifp->info;
1042
if (circuit == NULL) {
1047
circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
1052
ALIAS (no_isis_priority_l2,
1053
no_isis_priority_l2_arg_cmd,
1054
"no isis priority <0-127> level-2",
1057
"Set priority for Designated Router election\n"
1059
"Specify priority for level-2 routing\n"
1062
/* Metric command */
1066
"isis metric <0-63>",
1068
"Set default metric for circuit\n"
1069
"Default metric value\n"
1072
struct isis_circuit *circuit;
1073
struct interface *ifp;
1077
circuit = ifp->info;
1078
if (circuit == NULL) {
1083
met = atoi (argv[0]);
1085
circuit->metrics[0].metric_default = met;
1086
circuit->metrics[1].metric_default = met;
1091
DEFUN (no_isis_metric,
1096
"Set default metric for circuit\n"
1099
struct isis_circuit *circuit;
1100
struct interface *ifp;
1103
circuit = ifp->info;
1104
if (circuit == NULL) {
1109
circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1110
circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1115
ALIAS (no_isis_metric,
1116
no_isis_metric_arg_cmd,
1117
"no isis metric <0-127>",
1120
"Set default metric for circuit\n"
1121
"Default metric value\n"
1123
/* end of metrics */
1126
DEFUN (isis_hello_interval,
1127
isis_hello_interval_cmd,
1128
"isis hello-interval (<1-65535>|minimal)",
1130
"Set Hello interval\n"
1131
"Hello interval value\n"
1132
"Holdtime 1 seconds, interval depends on multiplier\n"
1135
struct isis_circuit *circuit;
1136
struct interface *ifp;
1141
circuit = ifp->info;
1142
if (circuit == NULL) {
1147
if (isdigit((int)c)) {
1148
interval = atoi (argv[0]);
1150
interval = HELLO_MINIMAL; /* FIXME: should be calculated */
1152
circuit->hello_interval[0] = (u_int16_t)interval;
1153
circuit->hello_interval[1] = (u_int16_t)interval;
1158
DEFUN (no_isis_hello_interval,
1159
no_isis_hello_interval_cmd,
1160
"no isis hello-interval",
1163
"Set Hello interval\n"
1166
struct isis_circuit *circuit;
1167
struct interface *ifp;
1170
circuit = ifp->info;
1171
if (circuit == NULL) {
1177
circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1178
circuit->hello_interval[1] = HELLO_INTERVAL;
1183
ALIAS (no_isis_hello_interval,
1184
no_isis_hello_interval_arg_cmd,
1185
"no isis hello-interval (<1-65535>|minimal)",
1188
"Set Hello interval\n"
1189
"Hello interval value\n"
1190
"Holdtime 1 second, interval depends on multiplier\n"
1193
DEFUN (isis_hello_interval_l1,
1194
isis_hello_interval_l1_cmd,
1195
"isis hello-interval (<1-65535>|minimal) level-1",
1197
"Set Hello interval\n"
1198
"Hello interval value\n"
1199
"Holdtime 1 second, interval depends on multiplier\n"
1200
"Specify hello-interval for level-1 IIHs\n"
1203
struct isis_circuit *circuit;
1204
struct interface *ifp;
1209
circuit = ifp->info;
1210
if (circuit == NULL) {
1216
if (isdigit((int)c)) {
1217
interval = atoi (argv[0]);
1219
interval = HELLO_MINIMAL;
1221
circuit->hello_interval[0] = (u_int16_t)interval;
1226
DEFUN (no_isis_hello_interval_l1,
1227
no_isis_hello_interval_l1_cmd,
1228
"no isis hello-interval level-1",
1231
"Set Hello interval\n"
1232
"Specify hello-interval for level-1 IIHs\n"
1235
struct isis_circuit *circuit;
1236
struct interface *ifp;
1239
circuit = ifp->info;
1240
if (circuit == NULL) {
1246
circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1251
ALIAS (no_isis_hello_interval_l1,
1252
no_isis_hello_interval_l1_arg_cmd,
1253
"no isis hello-interval (<1-65535>|minimal) level-1",
1256
"Set Hello interval\n"
1257
"Hello interval value\n"
1258
"Holdtime 1 second, interval depends on multiplier\n"
1259
"Specify hello-interval for level-1 IIHs\n"
1262
DEFUN (isis_hello_interval_l2,
1263
isis_hello_interval_l2_cmd,
1264
"isis hello-interval (<1-65535>|minimal) level-2",
1266
"Set Hello interval\n"
1267
"Hello interval value\n"
1268
"Holdtime 1 second, interval depends on multiplier\n"
1269
"Specify hello-interval for level-2 IIHs\n"
1272
struct isis_circuit *circuit;
1273
struct interface *ifp;
1278
circuit = ifp->info;
1279
if (circuit == NULL) {
1285
if (isdigit((int)c)) {
1286
interval = atoi (argv[0]);
1288
interval = HELLO_MINIMAL;
1290
circuit->hello_interval[1] = (u_int16_t)interval;
1295
DEFUN (no_isis_hello_interval_l2,
1296
no_isis_hello_interval_l2_cmd,
1297
"no isis hello-interval level-2",
1300
"Set Hello interval\n"
1301
"Specify hello-interval for level-2 IIHs\n"
1304
struct isis_circuit *circuit;
1305
struct interface *ifp;
1308
circuit = ifp->info;
1309
if (circuit == NULL) {
1315
circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1320
ALIAS (no_isis_hello_interval_l2,
1321
no_isis_hello_interval_l2_arg_cmd,
1322
"no isis hello-interval (<1-65535>|minimal) level-2",
1325
"Set Hello interval\n"
1326
"Hello interval value\n"
1327
"Holdtime 1 second, interval depends on multiplier\n"
1328
"Specify hello-interval for level-2 IIHs\n"
1332
DEFUN (isis_hello_multiplier,
1333
isis_hello_multiplier_cmd,
1334
"isis hello-multiplier <3-1000>",
1336
"Set multiplier for Hello holding time\n"
1337
"Hello multiplier value\n"
1340
struct isis_circuit *circuit;
1341
struct interface *ifp;
1345
circuit = ifp->info;
1346
if (circuit == NULL) {
1351
mult = atoi (argv[0]);
1353
circuit->hello_multiplier[0] = (u_int16_t)mult;
1354
circuit->hello_multiplier[1] = (u_int16_t)mult;
1359
DEFUN (no_isis_hello_multiplier,
1360
no_isis_hello_multiplier_cmd,
1361
"no isis hello-multiplier",
1364
"Set multiplier for Hello holding time\n"
1367
struct isis_circuit *circuit;
1368
struct interface *ifp;
1371
circuit = ifp->info;
1372
if (circuit == NULL) {
1377
circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1378
circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1383
ALIAS (no_isis_hello_multiplier,
1384
no_isis_hello_multiplier_arg_cmd,
1385
"no isis hello-multiplier <3-1000>",
1388
"Set multiplier for Hello holding time\n"
1389
"Hello multiplier value\n"
1392
DEFUN (isis_hello_multiplier_l1,
1393
isis_hello_multiplier_l1_cmd,
1394
"isis hello-multiplier <3-1000> level-1",
1396
"Set multiplier for Hello holding time\n"
1397
"Hello multiplier value\n"
1398
"Specify hello multiplier for level-1 IIHs\n"
1401
struct isis_circuit *circuit;
1402
struct interface *ifp;
1406
circuit = ifp->info;
1407
if (circuit == NULL) {
1412
mult = atoi (argv[0]);
1414
circuit->hello_multiplier[0] = (u_int16_t)mult;
1419
DEFUN (no_isis_hello_multiplier_l1,
1420
no_isis_hello_multiplier_l1_cmd,
1421
"no isis hello-multiplier level-1",
1424
"Set multiplier for Hello holding time\n"
1425
"Specify hello multiplier for level-1 IIHs\n"
1428
struct isis_circuit *circuit;
1429
struct interface *ifp;
1432
circuit = ifp->info;
1433
if (circuit == NULL) {
1438
circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1443
ALIAS (no_isis_hello_multiplier_l1,
1444
no_isis_hello_multiplier_l1_arg_cmd,
1445
"no isis hello-multiplier <3-1000> level-1",
1448
"Set multiplier for Hello holding time\n"
1449
"Hello multiplier value\n"
1450
"Specify hello multiplier for level-1 IIHs\n"
1453
DEFUN (isis_hello_multiplier_l2,
1454
isis_hello_multiplier_l2_cmd,
1455
"isis hello-multiplier <3-1000> level-2",
1457
"Set multiplier for Hello holding time\n"
1458
"Hello multiplier value\n"
1459
"Specify hello multiplier for level-2 IIHs\n"
1462
struct isis_circuit *circuit;
1463
struct interface *ifp;
1467
circuit = ifp->info;
1468
if (circuit == NULL) {
1473
mult = atoi (argv[0]);
1475
circuit->hello_multiplier[1] = (u_int16_t)mult;
1480
DEFUN (no_isis_hello_multiplier_l2,
1481
no_isis_hello_multiplier_l2_cmd,
1482
"no isis hello-multiplier level-2",
1485
"Set multiplier for Hello holding time\n"
1486
"Specify hello multiplier for level-2 IIHs\n"
1489
struct isis_circuit *circuit;
1490
struct interface *ifp;
1493
circuit = ifp->info;
1494
if (circuit == NULL) {
1499
circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1504
ALIAS (no_isis_hello_multiplier_l2,
1505
no_isis_hello_multiplier_l2_arg_cmd,
1506
"no isis hello-multiplier <3-1000> level-2",
1509
"Set multiplier for Hello holding time\n"
1510
"Hello multiplier value\n"
1511
"Specify hello multiplier for level-2 IIHs\n"
1516
"isis hello padding",
1518
"Add padding to IS-IS hello packets\n"
1519
"Pad hello packets\n"
1522
struct interface *ifp;
1523
struct isis_circuit *circuit;
1526
circuit = ifp->info;
1527
if (circuit == NULL) {
1532
circuit->u.bc.pad_hellos = 1;
1540
"ip address A.B.C.D/A",
1541
"Interface Internet Protocol config commands\n"
1542
"Set the IP address of an interface\n"
1543
"IP address (e.g. 10.0.0.1/8\n")
1546
struct interface *ifp;
1547
struct isis_circuit *circuit;
1548
struct prefix_ipv4 *ipv4, *ip;
1549
struct listnode *node;
1553
circuit = ifp->info;
1554
if (circuit == NULL) {
1560
zlog_info ("ip_address_cmd circuit %d", circuit->interface->ifindex);
1561
#endif /* HAVE_IPV6 */
1563
ipv4 = prefix_ipv4_new ();
1565
ret = str2prefix_ipv4 (argv[0], ipv4);
1567
zlog_warn ("ip_address_cmd(): malformed address");
1568
vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
1572
if (!circuit->ip_addrs)
1573
circuit->ip_addrs = list_new ();
1575
for (node = listhead (circuit->ip_addrs); node; nextnode (node)) {
1576
ip = getdata (node);
1577
if (prefix_same ((struct prefix *)ip, (struct prefix *)ipv4))
1581
prefix_ipv4_free (ipv4);
1587
listnode_add (circuit->ip_addrs, ipv4);
1588
#ifdef EXTREME_DEBUG
1589
zlog_info ("added IP address %s to circuit %d", argv[0],
1590
circuit->interface->ifindex);
1591
#endif /* EXTREME_DEBUG */
1595
DEFUN (no_ip_address,
1597
"no ip address A.B.C.D/A",
1599
"Interface Internet Protocol config commands\n"
1600
"Set the IP address of an interface\n"
1601
"IP address (e.g. 10.0.0.1/8\n")
1603
struct interface *ifp;
1604
struct isis_circuit *circuit;
1605
struct prefix_ipv4 ipv4, *ip = NULL;
1606
struct listnode *node;
1610
circuit = ifp->info;
1611
/* UGLY - will remove l8r */
1612
if (circuit == NULL) {
1617
if (!circuit->ip_addrs || circuit->ip_addrs->count == 0) {
1618
vty_out (vty, "Invalid address %s", VTY_NEWLINE);
1621
ret = str2prefix_ipv4 (argv[0], &ipv4);
1623
vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
1627
for (node = listhead (circuit->ip_addrs); node; nextnode (node)) {
1628
ip = getdata (node);
1629
if (prefix_same ((struct prefix *)ip, (struct prefix *)&ipv4))
1634
listnode_delete (circuit->ip_addrs, ip);
1636
vty_out (vty, "Invalid address %s", VTY_NEWLINE);
1643
DEFUN (no_isis_hello,
1645
"no isis hello padding",
1648
"Add padding to IS-IS hello packets\n"
1649
"Pad hello packets\n"
1652
struct isis_circuit *circuit;
1653
struct interface *ifp;
1656
circuit = ifp->info;
1657
if (circuit == NULL) {
1662
circuit->u.bc.pad_hellos = 0;
1667
DEFUN (csnp_interval,
1669
"isis csnp-interval <0-65535>",
1671
"Set CSNP interval in seconds\n"
1672
"CSNP interval value\n")
1674
struct isis_circuit *circuit;
1675
struct interface *ifp;
1676
unsigned long interval;
1679
circuit = ifp->info;
1680
if (circuit == NULL) {
1685
interval = atol (argv[0]);
1687
circuit->csnp_interval[0] = (u_int16_t)interval;
1688
circuit->csnp_interval[1] = (u_int16_t)interval;
1693
DEFUN (no_csnp_interval,
1694
no_csnp_interval_cmd,
1695
"no isis csnp-interval",
1698
"Set CSNP interval in seconds\n"
1701
struct isis_circuit *circuit;
1702
struct interface *ifp;
1705
circuit = ifp->info;
1706
if (circuit == NULL) {
1711
circuit->csnp_interval[0] = CSNP_INTERVAL;
1712
circuit->csnp_interval[1] = CSNP_INTERVAL;
1717
ALIAS (no_csnp_interval,
1718
no_csnp_interval_arg_cmd,
1719
"no isis csnp-interval <0-65535>",
1722
"Set CSNP interval in seconds\n"
1723
"CSNP interval value\n")
1726
DEFUN (csnp_interval_l1,
1727
csnp_interval_l1_cmd,
1728
"isis csnp-interval <0-65535> level-1",
1730
"Set CSNP interval in seconds\n"
1731
"CSNP interval value\n"
1732
"Specify interval for level-1 CSNPs\n")
1734
struct isis_circuit *circuit;
1735
struct interface *ifp;
1736
unsigned long interval;
1739
circuit = ifp->info;
1740
if (circuit == NULL) {
1745
interval = atol (argv[0]);
1747
circuit->csnp_interval[0] = (u_int16_t)interval;
1752
DEFUN (no_csnp_interval_l1,
1753
no_csnp_interval_l1_cmd,
1754
"no isis csnp-interval level-1",
1757
"Set CSNP interval in seconds\n"
1758
"Specify interval for level-1 CSNPs\n")
1760
struct isis_circuit *circuit;
1761
struct interface *ifp;
1764
circuit = ifp->info;
1765
if (circuit == NULL) {
1770
circuit->csnp_interval[0] = CSNP_INTERVAL;
1775
ALIAS (no_csnp_interval_l1,
1776
no_csnp_interval_l1_arg_cmd,
1777
"no isis csnp-interval <0-65535> level-1",
1780
"Set CSNP interval in seconds\n"
1781
"CSNP interval value\n"
1782
"Specify interval for level-1 CSNPs\n")
1785
DEFUN (csnp_interval_l2,
1786
csnp_interval_l2_cmd,
1787
"isis csnp-interval <0-65535> level-2",
1789
"Set CSNP interval in seconds\n"
1790
"CSNP interval value\n"
1791
"Specify interval for level-2 CSNPs\n")
1793
struct isis_circuit *circuit;
1794
struct interface *ifp;
1795
unsigned long interval;
1798
circuit = ifp->info;
1799
if (circuit == NULL) {
1804
interval = atol (argv[0]);
1806
circuit->csnp_interval[1] = (u_int16_t)interval;
1811
DEFUN (no_csnp_interval_l2,
1812
no_csnp_interval_l2_cmd,
1813
"no isis csnp-interval level-2",
1816
"Set CSNP interval in seconds\n"
1817
"Specify interval for level-2 CSNPs\n")
1819
struct isis_circuit *circuit;
1820
struct interface *ifp;
1823
circuit = ifp->info;
1824
if (circuit == NULL) {
1829
circuit->csnp_interval[1] = CSNP_INTERVAL;
1834
ALIAS (no_csnp_interval_l2,
1835
no_csnp_interval_l2_arg_cmd,
1836
"no isis csnp-interval <0-65535> level-2",
1839
"Set CSNP interval in seconds\n"
1840
"CSNP interval value\n"
1841
"Specify interval for level-2 CSNPs\n")
1845
DEFUN (ipv6_router_isis,
1846
ipv6_router_isis_cmd,
1847
"ipv6 router isis WORD",
1848
"IPv6 interface subcommands\n"
1849
"IPv6 Router interface commands\n"
1850
"IS-IS Routing for IPv6\n"
1851
"Routing process tag\n")
1853
struct isis_circuit *c;
1854
struct interface *ifp;
1855
struct isis_area *area;
1857
ifp = (struct interface *)vty->index;
1860
area = isis_area_lookup (argv[0]);
1862
/* Prevent more than one circuit per interface */
1864
c = circuit_lookup_by_ifp (ifp, area->circuit_list);
1867
if (c && (ifp->info != NULL)) {
1868
if (c->ipv6_router == 1) {
1869
vty_out (vty, "ISIS circuit is already defined for IPv6%s", VTY_NEWLINE);
1874
/* this is here for ciscopability */
1876
vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1881
c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1882
c = isis_csm_state_change (ISIS_ENABLE, c, area);
1891
area->ipv6_circuits++;
1892
circuit_update_nlpids (c);
1894
vty->node = INTERFACE_NODE;
1899
DEFUN (no_ipv6_router_isis,
1900
no_ipv6_router_isis_cmd,
1901
"no ipv6 router isis WORD",
1903
"IPv6 interface subcommands\n"
1904
"IPv6 Router interface commands\n"
1905
"IS-IS Routing for IPv6\n"
1906
"Routing process tag\n")
1908
struct isis_circuit *c;
1909
struct interface *ifp;
1910
struct isis_area *area;
1912
ifp = (struct interface *)vty->index;
1913
/* UGLY - will remove l8r
1914
if (circuit == NULL) {
1919
area = isis_area_lookup (argv[0]);
1921
vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1925
c = circuit_lookup_by_ifp (ifp, area->circuit_list);
1930
area->ipv6_circuits--;
1931
if (c->ip_router == 0)
1932
isis_csm_state_change (ISIS_DISABLE, c, area);
1937
#if 0 /* Guess we don't really need these */
1939
DEFUN (ipv6_address,
1941
"ipv6 address X:X::X:X/M",
1942
"Interface Internet Protocol config commands\n"
1943
"Set the IP address of an interface\n"
1944
"IPv6 address (e.g. 3ffe:506::1/48)\n")
1946
struct interface *ifp;
1947
struct isis_circuit *circuit;
1948
struct prefix_ipv6 *ipv6, *ip6;
1949
struct listnode *node;
1953
circuit = ifp->info;
1954
/* UGLY - will remove l8r */
1955
if (circuit == NULL) {
1959
#ifdef EXTREME_DEBUG
1960
zlog_info ("ipv6_address_cmd circuit %d", circuit->idx);
1961
#endif /* EXTREME_DEBUG */
1963
if (circuit == NULL) {
1964
zlog_warn ("ipv6_address_cmd(): no circuit");
1969
ipv6 = prefix_ipv6_new ();
1971
ret = str2prefix_ipv6 (argv[0], ipv6);
1973
vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
1977
if (!circuit->ipv6_addrs)
1978
circuit->ipv6_addrs = list_new ();
1980
for (node = listhead (circuit->ipv6_addrs); node; nextnode (node)) {
1981
ip6 = getdata (node);
1982
if (prefix_same ((struct prefix *)ip6, (struct prefix *)ipv6))
1986
prefix_ipv6_free (ipv6);
1992
listnode_add (circuit->ipv6_addrs, ipv6);
1993
#ifdef EXTREME_DEBUG
1994
zlog_info ("added IPv6 address %s to circuit %d", argv[0], circuit->idx);
1995
#endif /* EXTREME_DEBUG */
2000
DEFUN (no_ipv6_address,
2001
no_ipv6_address_cmd,
2002
"no ipv6 address X:X::X:X/M",
2004
"Interface Internet Protocol config commands\n"
2005
"Set the IP address of an interface\n"
2006
"IPv6 address (e.g. 3ffe:506::1/48)\n")
2008
struct interface *ifp;
2009
struct isis_circuit *circuit;
2010
struct prefix_ipv6 ipv6, *ip6 = NULL;
2011
struct listnode *node;
2015
circuit = ifp->info;
2016
/* UGLY - will remove l8r */
2017
if (circuit == NULL) {
2022
if (!circuit->ipv6_addrs || circuit->ipv6_addrs->count == 0) {
2023
vty_out (vty, "Invalid address %s", VTY_NEWLINE);
2026
ret = str2prefix_ipv6 (argv[0], &ipv6);
2028
vty_out (vty, "%% Malformed address %s", VTY_NEWLINE);
2032
for (node = listhead (circuit->ipv6_addrs); node; nextnode (node)) {
2033
ip6 = getdata (node);
2034
if (prefix_same ((struct prefix *)ip6, (struct prefix *)&ipv6))
2039
listnode_delete (circuit->ipv6_addrs, ip6);
2041
vty_out (vty, "Invalid address %s", VTY_NEWLINE);
2047
#endif /* HAVE_IPV6 */
2050
struct cmd_node interface_node =
2059
isis_if_new_hook (struct interface *ifp)
2061
/* FIXME: Discuss if the circuit should be created here
2062
ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2068
isis_if_delete_hook (struct interface *ifp)
2070
/* FIXME: Discuss if the circuit should be created here
2071
XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2078
isis_circuit_init ()
2081
/* Initialize Zebra interface data structure */
2083
if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2084
if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2086
/* Install interface node */
2087
install_node (&interface_node, isis_interface_config_write);
2088
install_element (CONFIG_NODE, &interface_cmd);
2090
install_default (INTERFACE_NODE);
2091
install_element (INTERFACE_NODE, &interface_desc_cmd);
2092
install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2094
install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2095
install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2097
install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2098
install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2100
install_element (INTERFACE_NODE, &isis_passwd_cmd);
2101
install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2103
install_element (INTERFACE_NODE, &isis_priority_cmd);
2104
install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2105
install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2106
install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2107
install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2108
install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2109
install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2110
install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2111
install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2113
install_element (INTERFACE_NODE, &isis_metric_cmd);
2114
install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2115
install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2117
install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2118
install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2119
install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2120
install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2121
install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2122
install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2123
install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2124
install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2125
install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2127
install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2128
install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2129
install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2130
install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2131
install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2132
install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2133
install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2134
install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2135
install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2137
install_element (INTERFACE_NODE, &isis_hello_cmd);
2138
install_element (INTERFACE_NODE, &no_isis_hello_cmd);
2140
install_element (INTERFACE_NODE, &ip_address_cmd);
2141
install_element (INTERFACE_NODE, &no_ip_address_cmd);
2143
install_element (INTERFACE_NODE, &csnp_interval_cmd);
2144
install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2145
install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2146
install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2147
install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2148
install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2149
install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2150
install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2151
install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2154
install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2155
install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
2157
install_element (INTERFACE_NODE, &ipv6_address_cmd);
2158
install_element (INTERFACE_NODE, &no_ipv6_address_cmd);