]> git.proxmox.com Git - mirror_frr.git/blob - isisd/isis_circuit.c
Merge pull request #3418 from pguibert6WIND/bgp_rfapi_path_info_extra_free
[mirror_frr.git] / isisd / isis_circuit.c
1 /*
2 * IS-IS Rout(e)ing protocol - isis_circuit.h
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17 *
18 * You should have received a copy of the GNU General Public License along
19 * with this program; see the file COPYING; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22 #include <zebra.h>
23 #ifdef GNU_LINUX
24 #include <net/ethernet.h>
25 #else
26 #include <netinet/if_ether.h>
27 #endif
28
29 #include "log.h"
30 #include "memory.h"
31 #include "vrf.h"
32 #include "if.h"
33 #include "linklist.h"
34 #include "command.h"
35 #include "thread.h"
36 #include "vty.h"
37 #include "hash.h"
38 #include "prefix.h"
39 #include "stream.h"
40 #include "qobj.h"
41
42 #include "isisd/dict.h"
43 #include "isisd/isis_constants.h"
44 #include "isisd/isis_common.h"
45 #include "isisd/isis_flags.h"
46 #include "isisd/isis_circuit.h"
47 #include "isisd/isis_lsp.h"
48 #include "isisd/isis_pdu.h"
49 #include "isisd/isis_network.h"
50 #include "isisd/isis_misc.h"
51 #include "isisd/isis_constants.h"
52 #include "isisd/isis_adjacency.h"
53 #include "isisd/isis_dr.h"
54 #include "isisd/isisd.h"
55 #include "isisd/isis_csm.h"
56 #include "isisd/isis_events.h"
57 #include "isisd/isis_te.h"
58 #include "isisd/isis_mt.h"
59 #include "isisd/isis_errors.h"
60 #include "isisd/isis_tx_queue.h"
61
62 DEFINE_QOBJ_TYPE(isis_circuit)
63
64 /*
65 * Prototypes.
66 */
67 int isis_interface_config_write(struct vty *);
68 int isis_if_new_hook(struct interface *);
69 int isis_if_delete_hook(struct interface *);
70
71 struct isis_circuit *isis_circuit_new()
72 {
73 struct isis_circuit *circuit;
74 int i;
75
76 circuit = XCALLOC(MTYPE_ISIS_CIRCUIT, sizeof(struct isis_circuit));
77
78 /*
79 * Default values
80 */
81 circuit->is_type = IS_LEVEL_1_AND_2;
82 circuit->flags = 0;
83 circuit->pad_hellos = 1;
84 for (i = 0; i < 2; i++) {
85 circuit->hello_interval[i] = DEFAULT_HELLO_INTERVAL;
86 circuit->hello_multiplier[i] = DEFAULT_HELLO_MULTIPLIER;
87 circuit->csnp_interval[i] = DEFAULT_CSNP_INTERVAL;
88 circuit->psnp_interval[i] = DEFAULT_PSNP_INTERVAL;
89 circuit->priority[i] = DEFAULT_PRIORITY;
90 circuit->metric[i] = DEFAULT_CIRCUIT_METRIC;
91 circuit->te_metric[i] = DEFAULT_CIRCUIT_METRIC;
92 circuit->level_arg[i].level = i + 1;
93 circuit->level_arg[i].circuit = circuit;
94 }
95
96 circuit->mtc = mpls_te_circuit_new();
97
98 circuit_mt_init(circuit);
99
100 QOBJ_REG(circuit, isis_circuit);
101
102 return circuit;
103 }
104
105 void isis_circuit_del(struct isis_circuit *circuit)
106 {
107 if (!circuit)
108 return;
109
110 QOBJ_UNREG(circuit);
111
112 isis_circuit_if_unbind(circuit, circuit->interface);
113
114 circuit_mt_finish(circuit);
115
116 /* and lastly the circuit itself */
117 XFREE(MTYPE_ISIS_CIRCUIT, circuit);
118
119 return;
120 }
121
122 void isis_circuit_configure(struct isis_circuit *circuit,
123 struct isis_area *area)
124 {
125 assert(area);
126 circuit->area = area;
127
128 /*
129 * Whenever the is-type of an area is changed, the is-type of each
130 * circuit
131 * in that area is updated to a non-empty subset of the area is-type.
132 * Inversely, when configuring a new circuit, this property should be
133 * ensured as well.
134 */
135 if (area->is_type != IS_LEVEL_1_AND_2)
136 circuit->is_type = area->is_type;
137
138 /*
139 * Add the circuit into area
140 */
141 listnode_add(area->circuit_list, circuit);
142
143 circuit->idx = flags_get_index(&area->flags);
144
145 return;
146 }
147
148 void isis_circuit_deconfigure(struct isis_circuit *circuit,
149 struct isis_area *area)
150 {
151 /* Free the index of SRM and SSN flags */
152 flags_free_index(&area->flags, circuit->idx);
153 circuit->idx = 0;
154 /* Remove circuit from area */
155 assert(circuit->area == area);
156 listnode_delete(area->circuit_list, circuit);
157 circuit->area = NULL;
158
159 return;
160 }
161
162 struct isis_circuit *circuit_lookup_by_ifp(struct interface *ifp,
163 struct list *list)
164 {
165 struct isis_circuit *circuit = NULL;
166 struct listnode *node;
167
168 if (!list)
169 return NULL;
170
171 for (ALL_LIST_ELEMENTS_RO(list, node, circuit))
172 if (circuit->interface == ifp) {
173 assert(ifp->info == circuit);
174 return circuit;
175 }
176
177 return NULL;
178 }
179
180 struct isis_circuit *circuit_scan_by_ifp(struct interface *ifp)
181 {
182 struct isis_area *area;
183 struct listnode *node;
184 struct isis_circuit *circuit;
185
186 if (ifp->info)
187 return (struct isis_circuit *)ifp->info;
188
189 if (isis->area_list) {
190 for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
191 circuit =
192 circuit_lookup_by_ifp(ifp, area->circuit_list);
193 if (circuit)
194 return circuit;
195 }
196 }
197 return circuit_lookup_by_ifp(ifp, isis->init_circ_list);
198 }
199
200 void isis_circuit_add_addr(struct isis_circuit *circuit,
201 struct connected *connected)
202 {
203 struct listnode *node;
204 struct prefix_ipv4 *ipv4;
205 #if defined(EXTREME_DEBUG)
206 char buf[PREFIX2STR_BUFFER];
207 #endif
208 struct prefix_ipv6 *ipv6;
209
210 if (connected->address->family == AF_INET) {
211 uint32_t addr = connected->address->u.prefix4.s_addr;
212 addr = ntohl(addr);
213 if (IPV4_NET0(addr) || IPV4_NET127(addr) || IN_CLASSD(addr)
214 || IPV4_LINKLOCAL(addr))
215 return;
216
217 for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node, ipv4))
218 if (prefix_same((struct prefix *)ipv4,
219 connected->address))
220 return;
221
222 ipv4 = prefix_ipv4_new();
223 ipv4->prefixlen = connected->address->prefixlen;
224 ipv4->prefix = connected->address->u.prefix4;
225 listnode_add(circuit->ip_addrs, ipv4);
226
227 /* Update MPLS TE Local IP address parameter */
228 set_circuitparams_local_ipaddr(circuit->mtc, ipv4->prefix);
229
230 if (circuit->area)
231 lsp_regenerate_schedule(circuit->area, circuit->is_type,
232 0);
233
234 #ifdef EXTREME_DEBUG
235 prefix2str(connected->address, buf, sizeof(buf));
236 zlog_debug("Added IP address %s to circuit %s", buf,
237 circuit->interface->name);
238 #endif /* EXTREME_DEBUG */
239 }
240 if (connected->address->family == AF_INET6) {
241 if (IN6_IS_ADDR_LOOPBACK(&connected->address->u.prefix6))
242 return;
243
244 for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node, ipv6))
245 if (prefix_same((struct prefix *)ipv6,
246 connected->address))
247 return;
248 for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node, ipv6))
249 if (prefix_same((struct prefix *)ipv6,
250 connected->address))
251 return;
252
253 ipv6 = prefix_ipv6_new();
254 ipv6->prefixlen = connected->address->prefixlen;
255 ipv6->prefix = connected->address->u.prefix6;
256
257 if (IN6_IS_ADDR_LINKLOCAL(&ipv6->prefix))
258 listnode_add(circuit->ipv6_link, ipv6);
259 else
260 listnode_add(circuit->ipv6_non_link, ipv6);
261 if (circuit->area)
262 lsp_regenerate_schedule(circuit->area, circuit->is_type,
263 0);
264
265 #ifdef EXTREME_DEBUG
266 prefix2str(connected->address, buf, sizeof(buf));
267 zlog_debug("Added IPv6 address %s to circuit %s", buf,
268 circuit->interface->name);
269 #endif /* EXTREME_DEBUG */
270 }
271 return;
272 }
273
274 void isis_circuit_del_addr(struct isis_circuit *circuit,
275 struct connected *connected)
276 {
277 struct prefix_ipv4 *ipv4, *ip = NULL;
278 struct listnode *node;
279 char buf[PREFIX2STR_BUFFER];
280 struct prefix_ipv6 *ipv6, *ip6 = NULL;
281 int found = 0;
282
283 if (connected->address->family == AF_INET) {
284 ipv4 = prefix_ipv4_new();
285 ipv4->prefixlen = connected->address->prefixlen;
286 ipv4->prefix = connected->address->u.prefix4;
287
288 for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node, ip))
289 if (prefix_same((struct prefix *)ip,
290 (struct prefix *)ipv4))
291 break;
292
293 if (ip) {
294 listnode_delete(circuit->ip_addrs, ip);
295 prefix_ipv4_free(ip);
296 if (circuit->area)
297 lsp_regenerate_schedule(circuit->area,
298 circuit->is_type, 0);
299 } else {
300 prefix2str(connected->address, buf, sizeof(buf));
301 zlog_warn(
302 "Nonexistent ip address %s removal attempt from \
303 circuit %s",
304 buf, circuit->interface->name);
305 zlog_warn("Current ip addresses on %s:",
306 circuit->interface->name);
307 for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node,
308 ip)) {
309 prefix2str(ip, buf, sizeof(buf));
310 zlog_warn(" %s", buf);
311 }
312 zlog_warn("End of addresses");
313 }
314
315 prefix_ipv4_free(ipv4);
316 }
317 if (connected->address->family == AF_INET6) {
318 ipv6 = prefix_ipv6_new();
319 ipv6->prefixlen = connected->address->prefixlen;
320 ipv6->prefix = connected->address->u.prefix6;
321
322 if (IN6_IS_ADDR_LINKLOCAL(&ipv6->prefix)) {
323 for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node,
324 ip6)) {
325 if (prefix_same((struct prefix *)ip6,
326 (struct prefix *)ipv6))
327 break;
328 }
329 if (ip6) {
330 listnode_delete(circuit->ipv6_link, ip6);
331 prefix_ipv6_free(ip6);
332 found = 1;
333 }
334 } else {
335 for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node,
336 ip6)) {
337 if (prefix_same((struct prefix *)ip6,
338 (struct prefix *)ipv6))
339 break;
340 }
341 if (ip6) {
342 listnode_delete(circuit->ipv6_non_link, ip6);
343 prefix_ipv6_free(ip6);
344 found = 1;
345 }
346 }
347
348 if (!found) {
349 prefix2str(connected->address, buf, sizeof(buf));
350 zlog_warn(
351 "Nonexistent ip address %s removal attempt from \
352 circuit %s",
353 buf, circuit->interface->name);
354 zlog_warn("Current ip addresses on %s:",
355 circuit->interface->name);
356 for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node,
357 ip6)) {
358 prefix2str((struct prefix *)ip6, (char *)buf,
359 sizeof(buf));
360 zlog_warn(" %s", buf);
361 }
362 zlog_warn(" -----");
363 for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node,
364 ip6)) {
365 prefix2str((struct prefix *)ip6, (char *)buf,
366 sizeof(buf));
367 zlog_warn(" %s", buf);
368 }
369 zlog_warn("End of addresses");
370 } else if (circuit->area)
371 lsp_regenerate_schedule(circuit->area, circuit->is_type,
372 0);
373
374 prefix_ipv6_free(ipv6);
375 }
376 return;
377 }
378
379 static uint8_t isis_circuit_id_gen(struct isis *isis, struct interface *ifp)
380 {
381 /* Circuit ids MUST be unique for any broadcast circuits. Otherwise,
382 * Pseudo-Node LSPs cannot be generated correctly.
383 *
384 * Currently, allocate one circuit ID for any circuit, limiting the total
385 * numer of circuits IS-IS can run on to 255.
386 *
387 * We should revisit this when implementing 3-way adjacencies for p2p, since
388 * we then have extended interface IDs available.
389 */
390 uint8_t id = ifp->ifindex;
391 unsigned int i;
392
393 for (i = 0; i < 256; i++) {
394 if (id && !_ISIS_CHECK_FLAG(isis->circuit_ids_used, id))
395 break;
396 id++;
397 }
398
399 if (i == 256) {
400 zlog_warn("Could not allocate a circuit id for '%s'",
401 ifp->name);
402 return 0;
403 }
404
405 _ISIS_SET_FLAG(isis->circuit_ids_used, id);
406 return id;
407 }
408
409 void isis_circuit_if_add(struct isis_circuit *circuit, struct interface *ifp)
410 {
411 struct listnode *node, *nnode;
412 struct connected *conn;
413
414 isis_circuit_if_bind(circuit, ifp);
415
416 if (if_is_broadcast(ifp)) {
417 if (fabricd || circuit->circ_type_config == CIRCUIT_T_P2P)
418 circuit->circ_type = CIRCUIT_T_P2P;
419 else
420 circuit->circ_type = CIRCUIT_T_BROADCAST;
421 } else if (if_is_pointopoint(ifp)) {
422 circuit->circ_type = CIRCUIT_T_P2P;
423 } else if (if_is_loopback(ifp)) {
424 circuit->circ_type = CIRCUIT_T_LOOPBACK;
425 circuit->is_passive = 1;
426 } else {
427 /* It's normal in case of loopback etc. */
428 if (isis->debugs & DEBUG_EVENTS)
429 zlog_debug("isis_circuit_if_add: unsupported media");
430 circuit->circ_type = CIRCUIT_T_UNKNOWN;
431 }
432
433 circuit->ip_addrs = list_new();
434 circuit->ipv6_link = list_new();
435 circuit->ipv6_non_link = list_new();
436
437 for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, conn))
438 isis_circuit_add_addr(circuit, conn);
439 }
440
441 void isis_circuit_if_del(struct isis_circuit *circuit, struct interface *ifp)
442 {
443 struct listnode *node, *nnode;
444 struct connected *conn;
445
446 assert(circuit->interface == ifp);
447
448 /* destroy addresses */
449 for (ALL_LIST_ELEMENTS(ifp->connected, node, nnode, conn))
450 isis_circuit_del_addr(circuit, conn);
451
452 if (circuit->ip_addrs) {
453 assert(listcount(circuit->ip_addrs) == 0);
454 list_delete(&circuit->ip_addrs);
455 }
456
457 if (circuit->ipv6_link) {
458 assert(listcount(circuit->ipv6_link) == 0);
459 list_delete(&circuit->ipv6_link);
460 }
461
462 if (circuit->ipv6_non_link) {
463 assert(listcount(circuit->ipv6_non_link) == 0);
464 list_delete(&circuit->ipv6_non_link);
465 }
466
467 circuit->circ_type = CIRCUIT_T_UNKNOWN;
468 }
469
470 void isis_circuit_if_bind(struct isis_circuit *circuit, struct interface *ifp)
471 {
472 assert(circuit != NULL);
473 assert(ifp != NULL);
474 if (circuit->interface)
475 assert(circuit->interface == ifp);
476 else
477 circuit->interface = ifp;
478 if (ifp->info)
479 assert(ifp->info == circuit);
480 else
481 ifp->info = circuit;
482 isis_link_params_update(circuit, ifp);
483 }
484
485 void isis_circuit_if_unbind(struct isis_circuit *circuit, struct interface *ifp)
486 {
487 assert(circuit != NULL);
488 assert(ifp != NULL);
489 assert(circuit->interface == ifp);
490 assert(ifp->info == circuit);
491 circuit->interface = NULL;
492 ifp->info = NULL;
493 }
494
495 static void isis_circuit_update_all_srmflags(struct isis_circuit *circuit,
496 int is_set)
497 {
498 struct isis_area *area;
499 struct isis_lsp *lsp;
500 dnode_t *dnode;
501 int level;
502
503 assert(circuit);
504 area = circuit->area;
505 assert(area);
506 for (level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++) {
507 if (!(level & circuit->is_type))
508 continue;
509
510 if (!area->lspdb[level - 1]
511 || !dict_count(area->lspdb[level - 1]))
512 continue;
513
514 for (dnode = dict_first(area->lspdb[level - 1]);
515 dnode != NULL;
516 dnode = dict_next(area->lspdb[level - 1], dnode)) {
517 lsp = dnode_get(dnode);
518 if (is_set) {
519 isis_tx_queue_add(circuit->tx_queue, lsp,
520 TX_LSP_NORMAL);
521 } else {
522 isis_tx_queue_del(circuit->tx_queue, lsp);
523 }
524 }
525 }
526 }
527
528 size_t isis_circuit_pdu_size(struct isis_circuit *circuit)
529 {
530 return ISO_MTU(circuit);
531 }
532
533 void isis_circuit_stream(struct isis_circuit *circuit, struct stream **stream)
534 {
535 size_t stream_size = isis_circuit_pdu_size(circuit);
536
537 if (!*stream) {
538 *stream = stream_new(stream_size);
539 } else {
540 if (STREAM_SIZE(*stream) != stream_size)
541 stream_resize_inplace(stream, stream_size);
542 stream_reset(*stream);
543 }
544 }
545
546 void isis_circuit_prepare(struct isis_circuit *circuit)
547 {
548 #if ISIS_METHOD != ISIS_METHOD_DLPI
549 thread_add_read(master, isis_receive, circuit, circuit->fd,
550 &circuit->t_read);
551 #else
552 thread_add_timer_msec(master, isis_receive, circuit,
553 listcount(circuit->area->circuit_list) * 100,
554 &circuit->t_read);
555 #endif
556 }
557
558 int isis_circuit_up(struct isis_circuit *circuit)
559 {
560 int retv;
561
562 /* Set the flags for all the lsps of the circuit. */
563 isis_circuit_update_all_srmflags(circuit, 1);
564
565 if (circuit->state == C_STATE_UP)
566 return ISIS_OK;
567
568 if (circuit->is_passive)
569 return ISIS_OK;
570
571 if (circuit->area->lsp_mtu > isis_circuit_pdu_size(circuit)) {
572 flog_err(
573 EC_ISIS_CONFIG,
574 "Interface MTU %zu on %s is too low to support area lsp mtu %u!",
575 isis_circuit_pdu_size(circuit),
576 circuit->interface->name, circuit->area->lsp_mtu);
577 isis_circuit_update_all_srmflags(circuit, 0);
578 return ISIS_ERROR;
579 }
580
581 if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
582 circuit->circuit_id = isis_circuit_id_gen(isis, circuit->interface);
583 if (!circuit->circuit_id) {
584 flog_err(
585 EC_ISIS_CONFIG,
586 "There are already 255 broadcast circuits active!");
587 return ISIS_ERROR;
588 }
589
590 /*
591 * Get the Hardware Address
592 */
593 if (circuit->interface->hw_addr_len != ETH_ALEN) {
594 zlog_warn("unsupported link layer");
595 } else {
596 memcpy(circuit->u.bc.snpa, circuit->interface->hw_addr,
597 ETH_ALEN);
598 }
599 #ifdef EXTREME_DEGUG
600 zlog_debug("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
601 circuit->interface->ifindex, ISO_MTU(circuit),
602 snpa_print(circuit->u.bc.snpa));
603 #endif /* EXTREME_DEBUG */
604
605 circuit->u.bc.adjdb[0] = list_new();
606 circuit->u.bc.adjdb[1] = list_new();
607
608 /*
609 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
610 */
611
612 /* initilizing the hello sending threads
613 * for a broadcast IF
614 */
615
616 /* 8.4.1 a) commence sending of IIH PDUs */
617
618 for (int level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++) {
619 if (!(circuit->is_type & level))
620 continue;
621
622 send_hello_sched(circuit, level, TRIGGERED_IIH_DELAY);
623 circuit->u.bc.lan_neighs[level - 1] = list_new();
624
625 thread_add_timer(master, isis_run_dr,
626 &circuit->level_arg[level - 1],
627 2 * circuit->hello_interval[level - 1],
628 &circuit->u.bc.t_run_dr[level - 1]);
629 }
630
631 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
632 /* 8.4.1 c) FIXME: listen for ESH PDUs */
633 } else if (circuit->circ_type == CIRCUIT_T_P2P) {
634 /* initializing the hello send threads
635 * for a ptp IF
636 */
637 circuit->u.p2p.neighbor = NULL;
638 send_hello_sched(circuit, 0, TRIGGERED_IIH_DELAY);
639 }
640
641 /* initializing PSNP timers */
642 if (circuit->is_type & IS_LEVEL_1)
643 thread_add_timer(
644 master, send_l1_psnp, circuit,
645 isis_jitter(circuit->psnp_interval[0], PSNP_JITTER),
646 &circuit->t_send_psnp[0]);
647
648 if (circuit->is_type & IS_LEVEL_2)
649 thread_add_timer(
650 master, send_l2_psnp, circuit,
651 isis_jitter(circuit->psnp_interval[1], PSNP_JITTER),
652 &circuit->t_send_psnp[1]);
653
654 /* unified init for circuits; ignore warnings below this level */
655 retv = isis_sock_init(circuit);
656 if (retv != ISIS_OK) {
657 isis_circuit_down(circuit);
658 return retv;
659 }
660
661 /* initialize the circuit streams after opening connection */
662 isis_circuit_stream(circuit, &circuit->rcv_stream);
663 isis_circuit_stream(circuit, &circuit->snd_stream);
664
665 isis_circuit_prepare(circuit);
666
667 circuit->tx_queue = isis_tx_queue_new(circuit, send_lsp);
668
669 return ISIS_OK;
670 }
671
672 void isis_circuit_down(struct isis_circuit *circuit)
673 {
674 /* Clear the flags for all the lsps of the circuit. */
675 isis_circuit_update_all_srmflags(circuit, 0);
676
677 if (circuit->circ_type == CIRCUIT_T_BROADCAST) {
678 /* destroy neighbour lists */
679 if (circuit->u.bc.lan_neighs[0]) {
680 list_delete(&circuit->u.bc.lan_neighs[0]);
681 circuit->u.bc.lan_neighs[0] = NULL;
682 }
683 if (circuit->u.bc.lan_neighs[1]) {
684 list_delete(&circuit->u.bc.lan_neighs[1]);
685 circuit->u.bc.lan_neighs[1] = NULL;
686 }
687 /* destroy adjacency databases */
688 if (circuit->u.bc.adjdb[0]) {
689 circuit->u.bc.adjdb[0]->del = isis_delete_adj;
690 list_delete(&circuit->u.bc.adjdb[0]);
691 circuit->u.bc.adjdb[0] = NULL;
692 }
693 if (circuit->u.bc.adjdb[1]) {
694 circuit->u.bc.adjdb[1]->del = isis_delete_adj;
695 list_delete(&circuit->u.bc.adjdb[1]);
696 circuit->u.bc.adjdb[1] = NULL;
697 }
698 if (circuit->u.bc.is_dr[0]) {
699 isis_dr_resign(circuit, 1);
700 circuit->u.bc.is_dr[0] = 0;
701 }
702 memset(circuit->u.bc.l1_desig_is, 0, ISIS_SYS_ID_LEN + 1);
703 if (circuit->u.bc.is_dr[1]) {
704 isis_dr_resign(circuit, 2);
705 circuit->u.bc.is_dr[1] = 0;
706 }
707 memset(circuit->u.bc.l2_desig_is, 0, ISIS_SYS_ID_LEN + 1);
708 memset(circuit->u.bc.snpa, 0, ETH_ALEN);
709
710 THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[0]);
711 THREAD_TIMER_OFF(circuit->u.bc.t_send_lan_hello[1]);
712 THREAD_TIMER_OFF(circuit->u.bc.t_run_dr[0]);
713 THREAD_TIMER_OFF(circuit->u.bc.t_run_dr[1]);
714 THREAD_TIMER_OFF(circuit->u.bc.t_refresh_pseudo_lsp[0]);
715 THREAD_TIMER_OFF(circuit->u.bc.t_refresh_pseudo_lsp[1]);
716 circuit->lsp_regenerate_pending[0] = 0;
717 circuit->lsp_regenerate_pending[1] = 0;
718
719 _ISIS_CLEAR_FLAG(isis->circuit_ids_used, circuit->circuit_id);
720 circuit->circuit_id = 0;
721 } else if (circuit->circ_type == CIRCUIT_T_P2P) {
722 isis_delete_adj(circuit->u.p2p.neighbor);
723 circuit->u.p2p.neighbor = NULL;
724 THREAD_TIMER_OFF(circuit->u.p2p.t_send_p2p_hello);
725 }
726
727 /* Cancel all active threads */
728 THREAD_TIMER_OFF(circuit->t_send_csnp[0]);
729 THREAD_TIMER_OFF(circuit->t_send_csnp[1]);
730 THREAD_TIMER_OFF(circuit->t_send_psnp[0]);
731 THREAD_TIMER_OFF(circuit->t_send_psnp[1]);
732 THREAD_OFF(circuit->t_send_lsp);
733 THREAD_OFF(circuit->t_read);
734
735 if (circuit->tx_queue) {
736 isis_tx_queue_free(circuit->tx_queue);
737 circuit->tx_queue = NULL;
738 }
739
740 /* send one gratuitous hello to spead up convergence */
741 if (circuit->state == C_STATE_UP) {
742 if (circuit->is_type & IS_LEVEL_1)
743 send_hello(circuit, IS_LEVEL_1);
744 if (circuit->is_type & IS_LEVEL_2)
745 send_hello(circuit, IS_LEVEL_2);
746 }
747
748 circuit->upadjcount[0] = 0;
749 circuit->upadjcount[1] = 0;
750
751 /* close the socket */
752 if (circuit->fd) {
753 close(circuit->fd);
754 circuit->fd = 0;
755 }
756
757 if (circuit->rcv_stream != NULL) {
758 stream_free(circuit->rcv_stream);
759 circuit->rcv_stream = NULL;
760 }
761
762 if (circuit->snd_stream != NULL) {
763 stream_free(circuit->snd_stream);
764 circuit->snd_stream = NULL;
765 }
766
767 thread_cancel_event(master, circuit);
768
769 return;
770 }
771
772 void circuit_update_nlpids(struct isis_circuit *circuit)
773 {
774 circuit->nlpids.count = 0;
775
776 if (circuit->ip_router) {
777 circuit->nlpids.nlpids[0] = NLPID_IP;
778 circuit->nlpids.count++;
779 }
780 if (circuit->ipv6_router) {
781 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
782 circuit->nlpids.count++;
783 }
784 return;
785 }
786
787 void isis_circuit_print_vty(struct isis_circuit *circuit, struct vty *vty,
788 char detail)
789 {
790 if (detail == ISIS_UI_LEVEL_BRIEF) {
791 vty_out(vty, " %-12s", circuit->interface->name);
792 vty_out(vty, "0x%-7x", circuit->circuit_id);
793 vty_out(vty, "%-9s", circuit_state2string(circuit->state));
794 vty_out(vty, "%-9s", circuit_type2string(circuit->circ_type));
795 vty_out(vty, "%-9s", circuit_t2string(circuit->is_type));
796 vty_out(vty, "\n");
797 }
798
799 if (detail == ISIS_UI_LEVEL_DETAIL) {
800 struct listnode *node;
801 struct prefix *ip_addr;
802 char buf[BUFSIZ];
803
804 vty_out(vty, " Interface: %s", circuit->interface->name);
805 vty_out(vty, ", State: %s",
806 circuit_state2string(circuit->state));
807 if (circuit->is_passive)
808 vty_out(vty, ", Passive");
809 else
810 vty_out(vty, ", Active");
811 vty_out(vty, ", Circuit Id: 0x%x", circuit->circuit_id);
812 vty_out(vty, "\n");
813 vty_out(vty, " Type: %s",
814 circuit_type2string(circuit->circ_type));
815 vty_out(vty, ", Level: %s", circuit_t2string(circuit->is_type));
816 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
817 vty_out(vty, ", SNPA: %-10s",
818 snpa_print(circuit->u.bc.snpa));
819 vty_out(vty, "\n");
820 if (circuit->is_type & IS_LEVEL_1) {
821 vty_out(vty, " Level-1 Information:\n");
822 if (circuit->area->newmetric)
823 vty_out(vty, " Metric: %d",
824 circuit->te_metric[0]);
825 else
826 vty_out(vty, " Metric: %d",
827 circuit->metric[0]);
828 if (!circuit->is_passive) {
829 vty_out(vty, ", Active neighbors: %u\n",
830 circuit->upadjcount[0]);
831 vty_out(vty,
832 " Hello interval: %u, "
833 "Holddown count: %u %s\n",
834 circuit->hello_interval[0],
835 circuit->hello_multiplier[0],
836 (circuit->pad_hellos ? "(pad)"
837 : "(no-pad)"));
838 vty_out(vty,
839 " CNSP interval: %u, "
840 "PSNP interval: %u\n",
841 circuit->csnp_interval[0],
842 circuit->psnp_interval[0]);
843 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
844 vty_out(vty,
845 " LAN Priority: %u, %s\n",
846 circuit->priority[0],
847 (circuit->u.bc.is_dr[0]
848 ? "is DIS"
849 : "is not DIS"));
850 } else {
851 vty_out(vty, "\n");
852 }
853 }
854 if (circuit->is_type & IS_LEVEL_2) {
855 vty_out(vty, " Level-2 Information:\n");
856 if (circuit->area->newmetric)
857 vty_out(vty, " Metric: %d",
858 circuit->te_metric[1]);
859 else
860 vty_out(vty, " Metric: %d",
861 circuit->metric[1]);
862 if (!circuit->is_passive) {
863 vty_out(vty, ", Active neighbors: %u\n",
864 circuit->upadjcount[1]);
865 vty_out(vty,
866 " Hello interval: %u, "
867 "Holddown count: %u %s\n",
868 circuit->hello_interval[1],
869 circuit->hello_multiplier[1],
870 (circuit->pad_hellos ? "(pad)"
871 : "(no-pad)"));
872 vty_out(vty,
873 " CNSP interval: %u, "
874 "PSNP interval: %u\n",
875 circuit->csnp_interval[1],
876 circuit->psnp_interval[1]);
877 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
878 vty_out(vty,
879 " LAN Priority: %u, %s\n",
880 circuit->priority[1],
881 (circuit->u.bc.is_dr[1]
882 ? "is DIS"
883 : "is not DIS"));
884 } else {
885 vty_out(vty, "\n");
886 }
887 }
888 if (circuit->ip_addrs && listcount(circuit->ip_addrs) > 0) {
889 vty_out(vty, " IP Prefix(es):\n");
890 for (ALL_LIST_ELEMENTS_RO(circuit->ip_addrs, node,
891 ip_addr)) {
892 prefix2str(ip_addr, buf, sizeof(buf));
893 vty_out(vty, " %s\n", buf);
894 }
895 }
896 if (circuit->ipv6_link && listcount(circuit->ipv6_link) > 0) {
897 vty_out(vty, " IPv6 Link-Locals:\n");
898 for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_link, node,
899 ip_addr)) {
900 prefix2str(ip_addr, (char *)buf, BUFSIZ);
901 vty_out(vty, " %s\n", buf);
902 }
903 }
904 if (circuit->ipv6_non_link
905 && listcount(circuit->ipv6_non_link) > 0) {
906 vty_out(vty, " IPv6 Prefixes:\n");
907 for (ALL_LIST_ELEMENTS_RO(circuit->ipv6_non_link, node,
908 ip_addr)) {
909 prefix2str(ip_addr, (char *)buf, BUFSIZ);
910 vty_out(vty, " %s\n", buf);
911 }
912 }
913
914 vty_out(vty, "\n");
915 }
916 return;
917 }
918
919 DEFINE_HOOK(isis_circuit_config_write,
920 (struct isis_circuit *circuit, struct vty *vty),
921 (circuit, vty))
922
923 int isis_interface_config_write(struct vty *vty)
924 {
925 struct vrf *vrf = vrf_lookup_by_id(VRF_DEFAULT);
926 int write = 0;
927 struct listnode *node;
928 struct interface *ifp;
929 struct isis_area *area;
930 struct isis_circuit *circuit;
931 int i;
932
933 FOR_ALL_INTERFACES (vrf, ifp) {
934 /* IF name */
935 vty_frame(vty, "interface %s\n", ifp->name);
936 write++;
937 /* IF desc */
938 if (ifp->desc) {
939 vty_out(vty, " description %s\n", ifp->desc);
940 write++;
941 }
942 /* ISIS Circuit */
943 for (ALL_LIST_ELEMENTS_RO(isis->area_list, node, area)) {
944 circuit =
945 circuit_lookup_by_ifp(ifp, area->circuit_list);
946 if (circuit == NULL)
947 continue;
948 if (circuit->ip_router) {
949 vty_out(vty, " ip router " PROTO_NAME " %s\n",
950 area->area_tag);
951 write++;
952 }
953 if (circuit->is_passive) {
954 vty_out(vty, " " PROTO_NAME " passive\n");
955 write++;
956 }
957 if (circuit->circ_type_config == CIRCUIT_T_P2P) {
958 vty_out(vty, " " PROTO_NAME " network point-to-point\n");
959 write++;
960 }
961 if (circuit->ipv6_router) {
962 vty_out(vty, " ipv6 router " PROTO_NAME " %s\n",
963 area->area_tag);
964 write++;
965 }
966
967 /* ISIS - circuit type */
968 if (!fabricd) {
969 if (circuit->is_type == IS_LEVEL_1) {
970 vty_out(vty, " " PROTO_NAME " circuit-type level-1\n");
971 write++;
972 } else {
973 if (circuit->is_type == IS_LEVEL_2) {
974 vty_out(vty,
975 " " PROTO_NAME " circuit-type level-2-only\n");
976 write++;
977 }
978 }
979 }
980
981 /* ISIS - CSNP interval */
982 if (circuit->csnp_interval[0]
983 == circuit->csnp_interval[1]) {
984 if (circuit->csnp_interval[0]
985 != DEFAULT_CSNP_INTERVAL) {
986 vty_out(vty, " " PROTO_NAME " csnp-interval %d\n",
987 circuit->csnp_interval[0]);
988 write++;
989 }
990 } else {
991 for (i = 0; i < 2; i++) {
992 if (circuit->csnp_interval[i]
993 != DEFAULT_CSNP_INTERVAL) {
994 vty_out(vty,
995 " " PROTO_NAME " csnp-interval %d level-%d\n",
996 circuit->csnp_interval
997 [i],
998 i + 1);
999 write++;
1000 }
1001 }
1002 }
1003
1004 /* ISIS - PSNP interval */
1005 if (circuit->psnp_interval[0]
1006 == circuit->psnp_interval[1]) {
1007 if (circuit->psnp_interval[0]
1008 != DEFAULT_PSNP_INTERVAL) {
1009 vty_out(vty, " " PROTO_NAME " psnp-interval %d\n",
1010 circuit->psnp_interval[0]);
1011 write++;
1012 }
1013 } else {
1014 for (i = 0; i < 2; i++) {
1015 if (circuit->psnp_interval[i]
1016 != DEFAULT_PSNP_INTERVAL) {
1017 vty_out(vty,
1018 " " PROTO_NAME " psnp-interval %d level-%d\n",
1019 circuit->psnp_interval
1020 [i],
1021 i + 1);
1022 write++;
1023 }
1024 }
1025 }
1026
1027 /* ISIS - Hello padding - Defaults to true so only
1028 * display if false */
1029 if (circuit->pad_hellos == 0) {
1030 vty_out(vty, " no " PROTO_NAME " hello padding\n");
1031 write++;
1032 }
1033
1034 if (circuit->disable_threeway_adj) {
1035 vty_out(vty, " no isis three-way-handshake\n");
1036 write++;
1037 }
1038
1039 /* ISIS - Hello interval */
1040 if (circuit->hello_interval[0]
1041 == circuit->hello_interval[1]) {
1042 if (circuit->hello_interval[0]
1043 != DEFAULT_HELLO_INTERVAL) {
1044 vty_out(vty,
1045 " " PROTO_NAME " hello-interval %d\n",
1046 circuit->hello_interval[0]);
1047 write++;
1048 }
1049 } else {
1050 for (i = 0; i < 2; i++) {
1051 if (circuit->hello_interval[i]
1052 != DEFAULT_HELLO_INTERVAL) {
1053 vty_out(vty,
1054 " " PROTO_NAME " hello-interval %d level-%d\n",
1055 circuit->hello_interval
1056 [i],
1057 i + 1);
1058 write++;
1059 }
1060 }
1061 }
1062
1063 /* ISIS - Hello Multiplier */
1064 if (circuit->hello_multiplier[0]
1065 == circuit->hello_multiplier[1]) {
1066 if (circuit->hello_multiplier[0]
1067 != DEFAULT_HELLO_MULTIPLIER) {
1068 vty_out(vty,
1069 " " PROTO_NAME " hello-multiplier %d\n",
1070 circuit->hello_multiplier[0]);
1071 write++;
1072 }
1073 } else {
1074 for (i = 0; i < 2; i++) {
1075 if (circuit->hello_multiplier[i]
1076 != DEFAULT_HELLO_MULTIPLIER) {
1077 vty_out(vty,
1078 " " PROTO_NAME " hello-multiplier %d level-%d\n",
1079 circuit->hello_multiplier
1080 [i],
1081 i + 1);
1082 write++;
1083 }
1084 }
1085 }
1086
1087 /* ISIS - Priority */
1088 if (circuit->priority[0] == circuit->priority[1]) {
1089 if (circuit->priority[0] != DEFAULT_PRIORITY) {
1090 vty_out(vty, " " PROTO_NAME " priority %d\n",
1091 circuit->priority[0]);
1092 write++;
1093 }
1094 } else {
1095 for (i = 0; i < 2; i++) {
1096 if (circuit->priority[i]
1097 != DEFAULT_PRIORITY) {
1098 vty_out(vty,
1099 " " PROTO_NAME " priority %d level-%d\n",
1100 circuit->priority[i],
1101 i + 1);
1102 write++;
1103 }
1104 }
1105 }
1106
1107 /* ISIS - Metric */
1108 if (circuit->te_metric[0] == circuit->te_metric[1]) {
1109 if (circuit->te_metric[0]
1110 != DEFAULT_CIRCUIT_METRIC) {
1111 vty_out(vty, " " PROTO_NAME " metric %d\n",
1112 circuit->te_metric[0]);
1113 write++;
1114 }
1115 } else {
1116 for (i = 0; i < 2; i++) {
1117 if (circuit->te_metric[i]
1118 != DEFAULT_CIRCUIT_METRIC) {
1119 vty_out(vty,
1120 " " PROTO_NAME " metric %d level-%d\n",
1121 circuit->te_metric[i],
1122 i + 1);
1123 write++;
1124 }
1125 }
1126 }
1127 if (circuit->passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5) {
1128 vty_out(vty, " " PROTO_NAME " password md5 %s\n",
1129 circuit->passwd.passwd);
1130 write++;
1131 } else if (circuit->passwd.type
1132 == ISIS_PASSWD_TYPE_CLEARTXT) {
1133 vty_out(vty, " " PROTO_NAME " password clear %s\n",
1134 circuit->passwd.passwd);
1135 write++;
1136 }
1137 write += hook_call(isis_circuit_config_write,
1138 circuit, vty);
1139 }
1140 vty_endframe(vty, "!\n");
1141 }
1142
1143 return write;
1144 }
1145
1146 struct isis_circuit *isis_circuit_create(struct isis_area *area,
1147 struct interface *ifp)
1148 {
1149 struct isis_circuit *circuit = circuit_scan_by_ifp(ifp);
1150 if (circuit && circuit->area)
1151 return NULL;
1152 circuit = isis_csm_state_change(ISIS_ENABLE, circuit, area);
1153 if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP)
1154 return circuit;
1155 isis_circuit_if_bind(circuit, ifp);
1156 return circuit;
1157 }
1158
1159 void isis_circuit_af_set(struct isis_circuit *circuit, bool ip_router,
1160 bool ipv6_router)
1161 {
1162 struct isis_area *area = circuit->area;
1163 bool change = circuit->ip_router != ip_router
1164 || circuit->ipv6_router != ipv6_router;
1165
1166 area->ip_circuits += ip_router - circuit->ip_router;
1167 area->ipv6_circuits += ipv6_router - circuit->ipv6_router;
1168 circuit->ip_router = ip_router;
1169 circuit->ipv6_router = ipv6_router;
1170
1171 if (!change)
1172 return;
1173
1174 circuit_update_nlpids(circuit);
1175
1176 if (!ip_router && !ipv6_router)
1177 isis_csm_state_change(ISIS_DISABLE, circuit, area);
1178 else
1179 lsp_regenerate_schedule(circuit->area, circuit->is_type, 0);
1180 }
1181
1182 ferr_r isis_circuit_passive_set(struct isis_circuit *circuit, bool passive)
1183 {
1184 if (circuit->is_passive == passive)
1185 return ferr_ok();
1186
1187 if (if_is_loopback(circuit->interface) && !passive)
1188 return ferr_cfg_invalid("loopback is always passive");
1189
1190 if (circuit->state != C_STATE_UP) {
1191 circuit->is_passive = passive;
1192 } else {
1193 struct isis_area *area = circuit->area;
1194 isis_csm_state_change(ISIS_DISABLE, circuit, area);
1195 circuit->is_passive = passive;
1196 isis_csm_state_change(ISIS_ENABLE, circuit, area);
1197 }
1198
1199 return ferr_ok();
1200 }
1201
1202 ferr_r isis_circuit_metric_set(struct isis_circuit *circuit, int level,
1203 int metric)
1204 {
1205 assert(level == IS_LEVEL_1 || level == IS_LEVEL_2);
1206 if (metric > MAX_WIDE_LINK_METRIC)
1207 return ferr_cfg_invalid("metric %d too large for wide metric",
1208 metric);
1209 if (circuit->area && circuit->area->oldmetric
1210 && metric > MAX_NARROW_LINK_METRIC)
1211 return ferr_cfg_invalid("metric %d too large for narrow metric",
1212 metric);
1213
1214 circuit->te_metric[level - 1] = metric;
1215 circuit->metric[level - 1] = metric;
1216
1217 if (circuit->area)
1218 lsp_regenerate_schedule(circuit->area, level, 0);
1219 return ferr_ok();
1220 }
1221
1222 ferr_r isis_circuit_passwd_unset(struct isis_circuit *circuit)
1223 {
1224 memset(&circuit->passwd, 0, sizeof(circuit->passwd));
1225 return ferr_ok();
1226 }
1227
1228 static int isis_circuit_passwd_set(struct isis_circuit *circuit,
1229 uint8_t passwd_type, const char *passwd)
1230 {
1231 int len;
1232
1233 if (!passwd)
1234 return ferr_code_bug("no circuit password given");
1235
1236 len = strlen(passwd);
1237 if (len > 254)
1238 return ferr_code_bug(
1239 "circuit password too long (max 254 chars)");
1240
1241 circuit->passwd.len = len;
1242 strncpy((char *)circuit->passwd.passwd, passwd, 255);
1243 circuit->passwd.type = passwd_type;
1244 return ferr_ok();
1245 }
1246
1247 ferr_r isis_circuit_passwd_cleartext_set(struct isis_circuit *circuit,
1248 const char *passwd)
1249 {
1250 return isis_circuit_passwd_set(circuit, ISIS_PASSWD_TYPE_CLEARTXT,
1251 passwd);
1252 }
1253
1254 ferr_r isis_circuit_passwd_hmac_md5_set(struct isis_circuit *circuit,
1255 const char *passwd)
1256 {
1257 return isis_circuit_passwd_set(circuit, ISIS_PASSWD_TYPE_HMAC_MD5,
1258 passwd);
1259 }
1260
1261 struct cmd_node interface_node = {
1262 INTERFACE_NODE, "%s(config-if)# ", 1,
1263 };
1264
1265 ferr_r isis_circuit_circ_type_set(struct isis_circuit *circuit, int circ_type)
1266 {
1267 if (circuit->circ_type == circ_type)
1268 return ferr_ok();
1269
1270 /* Changing the network type to/of loopback or unknown interfaces
1271 * is not supported. */
1272 if (circ_type == CIRCUIT_T_UNKNOWN || circ_type == CIRCUIT_T_LOOPBACK
1273 || circuit->circ_type == CIRCUIT_T_LOOPBACK) {
1274 return ferr_cfg_invalid(
1275 "cannot change network type on unknown interface");
1276 }
1277
1278 if (circuit->state != C_STATE_UP) {
1279 circuit->circ_type = circ_type;
1280 circuit->circ_type_config = circ_type;
1281 } else {
1282 struct isis_area *area = circuit->area;
1283 if (circ_type == CIRCUIT_T_BROADCAST
1284 && !if_is_broadcast(circuit->interface))
1285 return ferr_cfg_reality(
1286 "cannot configure non-broadcast interface for broadcast operation");
1287
1288 isis_csm_state_change(ISIS_DISABLE, circuit, area);
1289 circuit->circ_type = circ_type;
1290 circuit->circ_type_config = circ_type;
1291 isis_csm_state_change(ISIS_ENABLE, circuit, area);
1292 }
1293 return ferr_ok();
1294 }
1295
1296 int isis_circuit_mt_enabled_set(struct isis_circuit *circuit, uint16_t mtid,
1297 bool enabled)
1298 {
1299 struct isis_circuit_mt_setting *setting;
1300
1301 setting = circuit_get_mt_setting(circuit, mtid);
1302 if (setting->enabled != enabled) {
1303 setting->enabled = enabled;
1304 lsp_regenerate_schedule(circuit->area, IS_LEVEL_1 | IS_LEVEL_2,
1305 0);
1306 }
1307
1308 return CMD_SUCCESS;
1309 }
1310
1311 int isis_if_new_hook(struct interface *ifp)
1312 {
1313 return 0;
1314 }
1315
1316 int isis_if_delete_hook(struct interface *ifp)
1317 {
1318 struct isis_circuit *circuit;
1319 /* Clean up the circuit data */
1320 if (ifp && ifp->info) {
1321 circuit = ifp->info;
1322 isis_csm_state_change(IF_DOWN_FROM_Z, circuit, circuit->area);
1323 isis_csm_state_change(ISIS_DISABLE, circuit, circuit->area);
1324 }
1325
1326 return 0;
1327 }
1328
1329 void isis_circuit_init()
1330 {
1331 /* Initialize Zebra interface data structure */
1332 hook_register_prio(if_add, 0, isis_if_new_hook);
1333 hook_register_prio(if_del, 0, isis_if_delete_hook);
1334
1335 /* Install interface node */
1336 install_node(&interface_node, isis_interface_config_write);
1337 if_cmd_init();
1338 }