blob: 1a98a6337dc1ed42d0e13e54d027f363cbc39745 [file] [log] [blame]
jardineb5d44e2003-12-23 08:09:43 +00001/*
2 * IS-IS Rout(e)ing protocol - isis_circuit.h
3 *
4 * Copyright (C) 2001,2002 Sampo Saaristo
5 * Tampere University of Technology
6 * Institute of Communications Engineering
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public Licenseas published by the Free
10 * Software Foundation; either version 2 of the License, or (at your option)
11 * any later version.
12 *
13 * This program is distributed in the hope that it will be useful,but WITHOUT
14 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
15 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
16 * more details.
17
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
21 */
22#include <stdlib.h>
23#include <stdio.h>
24#include <ctype.h>
25#include <zebra.h>
hasso37da8c02004-05-19 11:38:40 +000026#ifdef GNU_LINUX
jardineb5d44e2003-12-23 08:09:43 +000027#include <net/ethernet.h>
hasso37da8c02004-05-19 11:38:40 +000028#else
29#include <netinet/if_ether.h>
30#endif
jardineb5d44e2003-12-23 08:09:43 +000031
32#include "log.h"
33#include "memory.h"
34#include "if.h"
35#include "linklist.h"
36#include "command.h"
37#include "thread.h"
38#include "hash.h"
39#include "prefix.h"
40#include "stream.h"
41
42#include "isisd/dict.h"
43#include "isisd/include-netbsd/iso.h"
44#include "isisd/isis_constants.h"
45#include "isisd/isis_common.h"
46#include "isisd/isis_circuit.h"
47#include "isisd/isis_tlv.h"
48#include "isisd/isis_lsp.h"
49#include "isisd/isis_pdu.h"
50#include "isisd/isis_network.h"
51#include "isisd/isis_misc.h"
52#include "isisd/isis_constants.h"
53#include "isisd/isis_adjacency.h"
54#include "isisd/isis_dr.h"
55#include "isisd/isis_flags.h"
56#include "isisd/isisd.h"
57#include "isisd/isis_csm.h"
58#include "isisd/isis_events.h"
59
60extern struct thread_master *master;
61extern struct isis *isis;
62
63struct isis_circuit *
64isis_circuit_new ()
65{
66 struct isis_circuit *circuit;
67 int i;
68
69 circuit = XMALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit));
hassof390d2c2004-09-10 20:48:21 +000070 if (circuit)
71 {
72 memset (circuit, 0, sizeof (struct isis_circuit));
73 /* set default metrics for circuit */
74 for (i = 0; i < 2; i++)
75 {
76 circuit->metrics[i].metric_default = DEFAULT_CIRCUIT_METRICS;
77 circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED;
78 circuit->metrics[i].metric_error = METRICS_UNSUPPORTED;
79 circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED;
80 }
jardineb5d44e2003-12-23 08:09:43 +000081 }
hassof390d2c2004-09-10 20:48:21 +000082 else
83 {
84 zlog_err ("Can't malloc isis circuit");
85 return NULL;
86 }
87
jardineb5d44e2003-12-23 08:09:43 +000088 return circuit;
89}
90
jardineb5d44e2003-12-23 08:09:43 +000091void
92isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area)
93{
94 int i;
95 circuit->area = area;
96 /*
97 * The level for the circuit is same as for the area, unless configured
98 * otherwise.
99 */
100 circuit->circuit_is_type = area->is_type;
101 /*
102 * Default values
103 */
hassof390d2c2004-09-10 20:48:21 +0000104 for (i = 0; i < 2; i++)
105 {
106 circuit->hello_interval[i] = HELLO_INTERVAL;
107 circuit->hello_multiplier[i] = HELLO_MULTIPLIER;
108 circuit->csnp_interval[i] = CSNP_INTERVAL;
109 circuit->psnp_interval[i] = PSNP_INTERVAL;
110 circuit->u.bc.priority[i] = DEFAULT_PRIORITY;
111 }
112 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
113 {
114 circuit->u.bc.adjdb[0] = list_new ();
115 circuit->u.bc.adjdb[1] = list_new ();
116 circuit->u.bc.pad_hellos = 1;
117 }
jardineb5d44e2003-12-23 08:09:43 +0000118 circuit->lsp_interval = LSP_INTERVAL;
119
120 /*
121 * Add the circuit into area
122 */
123 listnode_add (area->circuit_list, circuit);
124
125 circuit->idx = flags_get_index (&area->flags);
126 circuit->lsp_queue = list_new ();
127
128 return;
129}
130
hassof390d2c2004-09-10 20:48:21 +0000131void
jardineb5d44e2003-12-23 08:09:43 +0000132isis_circuit_deconfigure (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000133 struct isis_area *area)
jardineb5d44e2003-12-23 08:09:43 +0000134{
hassof390d2c2004-09-10 20:48:21 +0000135
jardineb5d44e2003-12-23 08:09:43 +0000136 /* Remove circuit from area */
137 listnode_delete (area->circuit_list, circuit);
138 /* Free the index of SRM and SSN flags */
139 flags_free_index (&area->flags, circuit->idx);
140
141 return;
142}
143
144struct isis_circuit *
145circuit_lookup_by_ifp (struct interface *ifp, struct list *list)
146{
147 struct isis_circuit *circuit = NULL;
148 struct listnode *node;
hassof390d2c2004-09-10 20:48:21 +0000149
jardineb5d44e2003-12-23 08:09:43 +0000150 if (!list)
151 return NULL;
hassof390d2c2004-09-10 20:48:21 +0000152
153 for (node = listhead (list); node; nextnode (node))
154 {
155 circuit = getdata (node);
156 if (circuit->interface == ifp)
157 return circuit;
158 }
159
jardineb5d44e2003-12-23 08:09:43 +0000160 return NULL;
161}
162
163struct isis_circuit *
164circuit_scan_by_ifp (struct interface *ifp)
165{
166 struct isis_area *area;
167 struct listnode *node;
168 struct isis_circuit *circuit;
169
170 if (!isis->area_list)
171 return NULL;
172
hassof390d2c2004-09-10 20:48:21 +0000173 for (node = listhead (isis->area_list); node; nextnode (node))
174 {
175 area = getdata (node);
176 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
177 if (circuit)
178 return circuit;
179 }
180
jardineb5d44e2003-12-23 08:09:43 +0000181 return circuit_lookup_by_ifp (ifp, isis->init_circ_list);
182}
183
184void
185isis_circuit_del (struct isis_circuit *circuit)
186{
187
188 if (!circuit)
189 return;
190
hassof390d2c2004-09-10 20:48:21 +0000191 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
192 {
193 /* destroy adjacency databases */
hasso46606872004-12-29 19:34:22 +0000194 if (circuit->u.bc.adjdb[0])
195 list_delete (circuit->u.bc.adjdb[0]);
196 if (circuit->u.bc.adjdb[1])
197 list_delete (circuit->u.bc.adjdb[1]);
hassof390d2c2004-09-10 20:48:21 +0000198 /* destroy neighbour lists */
199 if (circuit->u.bc.lan_neighs[0])
200 list_delete (circuit->u.bc.lan_neighs[0]);
201 if (circuit->u.bc.lan_neighs[1])
202 list_delete (circuit->u.bc.lan_neighs[1]);
203 /* destroy addresses */
204 }
jardineb5d44e2003-12-23 08:09:43 +0000205 if (circuit->ip_addrs)
206 list_delete (circuit->ip_addrs);
207#ifdef HAVE_IPV6
208 if (circuit->ipv6_link)
209 list_delete (circuit->ipv6_link);
210 if (circuit->ipv6_non_link)
211 list_delete (circuit->ipv6_non_link);
212#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000213
jardineb5d44e2003-12-23 08:09:43 +0000214 /* and lastly the circuit itself */
215 XFREE (MTYPE_ISIS_CIRCUIT, circuit);
216
217 return;
218}
219
220void
hassof891f442004-09-14 13:54:30 +0000221isis_circuit_add_addr (struct isis_circuit *circuit,
222 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000223{
224 struct prefix_ipv4 *ipv4;
hassof390d2c2004-09-10 20:48:21 +0000225 u_char buf[BUFSIZ];
jardineb5d44e2003-12-23 08:09:43 +0000226#ifdef HAVE_IPV6
227 struct prefix_ipv6 *ipv6;
228#endif /* HAVE_IPV6 */
hassof891f442004-09-14 13:54:30 +0000229
hassof390d2c2004-09-10 20:48:21 +0000230 if (!circuit->ip_addrs)
hassof891f442004-09-14 13:54:30 +0000231 circuit->ip_addrs = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000232#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000233 if (!circuit->ipv6_link)
hassof891f442004-09-14 13:54:30 +0000234 circuit->ipv6_link = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000235 if (!circuit->ipv6_non_link)
hassof891f442004-09-14 13:54:30 +0000236 circuit->ipv6_non_link = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000237#endif /* HAVE_IPV6 */
238
239 memset (&buf, 0, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000240 if (connected->address->family == AF_INET)
hassof390d2c2004-09-10 20:48:21 +0000241 {
242 ipv4 = prefix_ipv4_new ();
hassof891f442004-09-14 13:54:30 +0000243 ipv4->prefixlen = connected->address->prefixlen;
244 ipv4->prefix = connected->address->u.prefix4;
hassof390d2c2004-09-10 20:48:21 +0000245 listnode_add (circuit->ip_addrs, ipv4);
hasso0dae85e2004-09-26 19:53:47 +0000246 if (circuit->area)
247 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000248
jardineb5d44e2003-12-23 08:09:43 +0000249#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000250 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000251 zlog_debug ("Added IP address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000252 circuit->circuit_id);
253#endif /* EXTREME_DEBUG */
jardineb5d44e2003-12-23 08:09:43 +0000254 }
hassof390d2c2004-09-10 20:48:21 +0000255#ifdef HAVE_IPV6
hassof891f442004-09-14 13:54:30 +0000256 if (connected->address->family == AF_INET6)
hassof390d2c2004-09-10 20:48:21 +0000257 {
258 ipv6 = prefix_ipv6_new ();
hassof891f442004-09-14 13:54:30 +0000259 ipv6->prefixlen = connected->address->prefixlen;
260 ipv6->prefix = connected->address->u.prefix6;
261
hassof390d2c2004-09-10 20:48:21 +0000262 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
hassof891f442004-09-14 13:54:30 +0000263 listnode_add (circuit->ipv6_link, ipv6);
hassof390d2c2004-09-10 20:48:21 +0000264 else
hassof891f442004-09-14 13:54:30 +0000265 listnode_add (circuit->ipv6_non_link, ipv6);
hasso0dae85e2004-09-26 19:53:47 +0000266 if (circuit->area)
267 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000268
jardineb5d44e2003-12-23 08:09:43 +0000269#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000270 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000271 zlog_debug ("Added IPv6 address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000272 circuit->circuit_id);
273#endif /* EXTREME_DEBUG */
274 }
jardineb5d44e2003-12-23 08:09:43 +0000275#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000276 return;
277}
278
279void
280isis_circuit_del_addr (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000281 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000282{
hassof891f442004-09-14 13:54:30 +0000283 struct prefix_ipv4 *ipv4, *ip = NULL;
284 struct listnode *node;
285 int found = 0;
286 u_char buf[BUFSIZ];
287#ifdef HAVE_IPV6
288 struct prefix_ipv6 *ipv6, *ip6 = NULL;
289#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000290
hassof891f442004-09-14 13:54:30 +0000291 memset (&buf, 0, BUFSIZ);
292 if (connected->address->family == AF_INET)
293 {
294 ipv4 = prefix_ipv4_new ();
295 ipv4->prefixlen = connected->address->prefixlen;
296 ipv4->prefix = connected->address->u.prefix4;
297
298 for (node = listhead (circuit->ip_addrs); node; nextnode (node))
299 {
300 ip = getdata (node);
301 if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4))
302 break;
303 }
304
305 if (ip)
306 {
307 listnode_delete (circuit->ip_addrs, ip);
hasso0dae85e2004-09-26 19:53:47 +0000308 if (circuit->area)
309 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000310 }
311 else
312 {
hassof7c43dc2004-09-26 16:24:14 +0000313 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000314 zlog_warn("Nonexitant ip address %s removal attempt from circuit \
315 %d", buf, circuit->circuit_id);
316 }
317 }
318#ifdef HAVE_IPV6
319 if (connected->address->family == AF_INET6)
320 {
321 ipv6 = prefix_ipv6_new ();
322 ipv6->prefixlen = connected->address->prefixlen;
323 ipv6->prefix = connected->address->u.prefix6;
324
325 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
326 {
327 for (node = listhead (circuit->ipv6_link); node; nextnode (node))
328 {
329 ip6 = getdata (node);
330 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
331 break;
332 }
333 if (ip6)
334 {
335 listnode_delete (circuit->ipv6_link, ip6);
336 found = 1;
337 }
338 }
339 else
340 {
341 for (node = listhead (circuit->ipv6_non_link); node; nextnode (node))
342 {
343 ip6 = getdata (node);
344 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
345 break;
346 }
347 if (ip6)
348 {
349 listnode_delete (circuit->ipv6_non_link, ip6);
350 found = 1;
351 }
352 }
353
354 if (!found)
355 {
hassof7c43dc2004-09-26 16:24:14 +0000356 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000357 zlog_warn("Nonexitant ip address %s removal attempt from \
358 circuit %d", buf, circuit->circuit_id);
359 }
360 else
hasso0dae85e2004-09-26 19:53:47 +0000361 if (circuit->area)
362 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000363 }
364#endif /* HAVE_IPV6 */
365 return;
jardineb5d44e2003-12-23 08:09:43 +0000366}
367
368void
369isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
370{
371 struct listnode *node;
372 struct connected *conn;
373
374 circuit->interface = ifp;
375 ifp->info = circuit;
hassof390d2c2004-09-10 20:48:21 +0000376
377 circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */
jardineb5d44e2003-12-23 08:09:43 +0000378
379 /* isis_circuit_update_addrs (circuit, ifp); */
380
hassof390d2c2004-09-10 20:48:21 +0000381 if (if_is_broadcast (ifp))
382 {
383 circuit->circ_type = CIRCUIT_T_BROADCAST;
384 /*
385 * Get the Hardware Address
386 */
jardineb5d44e2003-12-23 08:09:43 +0000387#ifdef HAVE_SOCKADDR_DL
hassof390d2c2004-09-10 20:48:21 +0000388 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
389 zlog_warn ("unsupported link layer");
390 else
391 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl),
392 ETH_ALEN);
jardineb5d44e2003-12-23 08:09:43 +0000393#else
hassof390d2c2004-09-10 20:48:21 +0000394 if (circuit->interface->hw_addr_len != ETH_ALEN)
395 {
396 zlog_warn ("unsupported link layer");
397 }
398 else
399 {
400 memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN);
401 }
jardineb5d44e2003-12-23 08:09:43 +0000402#ifdef EXTREME_DEGUG
hasso529d65b2004-12-24 00:14:50 +0000403 zlog_debug ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
hassof390d2c2004-09-10 20:48:21 +0000404 circuit->interface->ifindex, ISO_MTU (circuit),
405 snpa_print (circuit->u.bc.snpa));
jardineb5d44e2003-12-23 08:09:43 +0000406
407#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000408#endif /* HAVE_SOCKADDR_DL */
409 }
410 else if (if_is_pointopoint (ifp))
411 {
412 circuit->circ_type = CIRCUIT_T_P2P;
413 }
414 else
415 {
416 zlog_warn ("isis_circuit_if_add: unsupported media");
417 }
418
419 for (node = ifp->connected ? listhead (ifp->connected) : NULL; node;
420 nextnode (node))
421 {
422 conn = getdata (node);
423 isis_circuit_add_addr (circuit, conn);
424 }
jardineb5d44e2003-12-23 08:09:43 +0000425
426 return;
427}
428
429void
hassof390d2c2004-09-10 20:48:21 +0000430isis_circuit_update_params (struct isis_circuit *circuit,
431 struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000432{
hassob30c5e62004-12-29 20:06:41 +0000433 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +0000434
435 if (circuit->circuit_id != ifp->ifindex)
436 {
437 zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
438 ifp->ifindex);
439 circuit->circuit_id = ifp->ifindex % 255;
440 }
jardineb5d44e2003-12-23 08:09:43 +0000441
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,
448 ifp->mtu);
449 circuit->mtu = ifp->mtu;
450 }
hassof390d2c2004-09-10 20:48:21 +0000451 */
jardineb5d44e2003-12-23 08:09:43 +0000452 /*
453 * Get the Hardware Address
454 */
455#ifdef HAVE_SOCKADDR_DL
456 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
jardineb5d44e2003-12-23 08:09:43 +0000457 zlog_warn ("unsupported link layer");
hassof390d2c2004-09-10 20:48:21 +0000458 else
459 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), ETH_ALEN);
460#else
461 if (circuit->interface->hw_addr_len != ETH_ALEN)
462 {
463 zlog_warn ("unsupported link layer");
jardineb5d44e2003-12-23 08:09:43 +0000464 }
hassof390d2c2004-09-10 20:48:21 +0000465 else
466 {
467 if (memcmp (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN))
468 {
469 zlog_warn ("changing circuit snpa %s->%s",
470 snpa_print (circuit->u.bc.snpa),
471 snpa_print (circuit->interface->hw_addr));
472 }
473 }
474#endif
jardineb5d44e2003-12-23 08:09:43 +0000475
hassof390d2c2004-09-10 20:48:21 +0000476 if (if_is_broadcast (ifp))
477 {
478 circuit->circ_type = CIRCUIT_T_BROADCAST;
479 }
480 else if (if_is_pointopoint (ifp))
481 {
482 circuit->circ_type = CIRCUIT_T_P2P;
483 }
484 else
485 {
486 zlog_warn ("isis_circuit_update_params: unsupported media");
487 }
jardineb5d44e2003-12-23 08:09:43 +0000488
jardineb5d44e2003-12-23 08:09:43 +0000489 return;
490}
491
492void
hassof390d2c2004-09-10 20:48:21 +0000493isis_circuit_if_del (struct isis_circuit *circuit)
jardineb5d44e2003-12-23 08:09:43 +0000494{
495 circuit->interface->info = NULL;
496 circuit->interface = NULL;
hassof390d2c2004-09-10 20:48:21 +0000497
jardineb5d44e2003-12-23 08:09:43 +0000498 return;
499}
500
501void
502isis_circuit_up (struct isis_circuit *circuit)
503{
jardineb5d44e2003-12-23 08:09:43 +0000504
hassof390d2c2004-09-10 20:48:21 +0000505 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
506 {
507 if (circuit->area->min_bcast_mtu == 0 ||
508 ISO_MTU (circuit) < circuit->area->min_bcast_mtu)
509 circuit->area->min_bcast_mtu = ISO_MTU (circuit);
510 /*
511 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
512 */
jardineb5d44e2003-12-23 08:09:43 +0000513
hassof390d2c2004-09-10 20:48:21 +0000514 /* initilizing the hello sending threads
515 * for a broadcast IF
516 */
jardineb5d44e2003-12-23 08:09:43 +0000517
hassof390d2c2004-09-10 20:48:21 +0000518 /* 8.4.1 a) commence sending of IIH PDUs */
519
520 if (circuit->circuit_is_type & IS_LEVEL_1)
521 {
522 thread_add_event (master, send_lan_l1_hello, circuit, 0);
523 circuit->u.bc.lan_neighs[0] = list_new ();
524 }
525
526 if (circuit->circuit_is_type & IS_LEVEL_2)
527 {
528 thread_add_event (master, send_lan_l2_hello, circuit, 0);
529 circuit->u.bc.lan_neighs[1] = list_new ();
530 }
531
532 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
533 /* 8.4.1 c) FIXME: listen for ESH PDUs */
534
535 /* 8.4.1 d) */
536 /* dr election will commence in... */
537 if (circuit->circuit_is_type & IS_LEVEL_1)
538 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
hassobf731012004-09-17 07:59:57 +0000539 circuit, 2 * circuit->hello_interval[0]);
hassof390d2c2004-09-10 20:48:21 +0000540 if (circuit->circuit_is_type & IS_LEVEL_2)
541 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
hassobf731012004-09-17 07:59:57 +0000542 circuit, 2 * circuit->hello_interval[1]);
jardineb5d44e2003-12-23 08:09:43 +0000543 }
hassof390d2c2004-09-10 20:48:21 +0000544 else
545 {
546 /* initializing the hello send threads
547 * for a ptp IF
548 */
549 thread_add_event (master, send_p2p_hello, circuit, 0);
jardineb5d44e2003-12-23 08:09:43 +0000550
jardineb5d44e2003-12-23 08:09:43 +0000551 }
552
jardineb5d44e2003-12-23 08:09:43 +0000553 /* initializing PSNP timers */
hassof390d2c2004-09-10 20:48:21 +0000554 if (circuit->circuit_is_type & IS_LEVEL_1)
555 {
556 THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
557 isis_jitter (circuit->psnp_interval[0], PSNP_JITTER));
558 }
559
560 if (circuit->circuit_is_type & IS_LEVEL_2)
561 {
562 THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
563 isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
564 }
565
jardineb5d44e2003-12-23 08:09:43 +0000566 /* initialize the circuit streams */
567 if (circuit->rcv_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000568 circuit->rcv_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000569
570 if (circuit->snd_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000571 circuit->snd_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000572
573 /* unified init for circuits */
574 isis_sock_init (circuit);
575
576#ifdef GNU_LINUX
hassof390d2c2004-09-10 20:48:21 +0000577 THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
578 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000579#else
hassof390d2c2004-09-10 20:48:21 +0000580 THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
581 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000582#endif
583 return;
584}
585
586void
587isis_circuit_down (struct isis_circuit *circuit)
588{
hassof390d2c2004-09-10 20:48:21 +0000589 /* Cancel all active threads -- FIXME: wrong place */
hassod70f99e2004-02-11 20:26:31 +0000590 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
hassof390d2c2004-09-10 20:48:21 +0000591 THREAD_OFF (circuit->t_read);
592 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
593 {
594 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
595 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
hassof891f442004-09-14 13:54:30 +0000596 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
597 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
hassof390d2c2004-09-10 20:48:21 +0000598 }
599 else if (circuit->circ_type == CIRCUIT_T_P2P)
600 {
601 THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
602 }
jardineb5d44e2003-12-23 08:09:43 +0000603 /* close the socket */
604 close (circuit->fd);
605
606 return;
607}
608
609void
610circuit_update_nlpids (struct isis_circuit *circuit)
611{
612 circuit->nlpids.count = 0;
hassof390d2c2004-09-10 20:48:21 +0000613
614 if (circuit->ip_router)
615 {
616 circuit->nlpids.nlpids[0] = NLPID_IP;
617 circuit->nlpids.count++;
618 }
jardineb5d44e2003-12-23 08:09:43 +0000619#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000620 if (circuit->ipv6_router)
621 {
622 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
623 circuit->nlpids.count++;
624 }
jardineb5d44e2003-12-23 08:09:43 +0000625#endif /* HAVE_IPV6 */
626 return;
627}
628
629int
hassof390d2c2004-09-10 20:48:21 +0000630isis_interface_config_write (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000631{
632
633 int write = 0;
hasso52dc7ee2004-09-23 19:18:23 +0000634 struct listnode *node;
635 struct listnode *node2;
jardineb5d44e2003-12-23 08:09:43 +0000636 struct interface *ifp;
637 struct isis_area *area;
638 struct isis_circuit *c;
jardineb5d44e2003-12-23 08:09:43 +0000639 int i;
jardineb5d44e2003-12-23 08:09:43 +0000640
jardineb5d44e2003-12-23 08:09:43 +0000641 LIST_LOOP (iflist, ifp, node)
642 {
643 /* IF name */
hassof390d2c2004-09-10 20:48:21 +0000644 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000645 write++;
646 /* IF desc */
hassof390d2c2004-09-10 20:48:21 +0000647 if (ifp->desc)
648 {
649 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
650 write++;
651 }
jardineb5d44e2003-12-23 08:09:43 +0000652 /* ISIS Circuit */
653 LIST_LOOP (isis->area_list, area, node2)
654 {
655 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000656 if (c)
657 {
658 if (c->ip_router)
659 {
660 vty_out (vty, " ip router isis %s%s", area->area_tag,
661 VTY_NEWLINE);
662 write++;
663 }
jardineb5d44e2003-12-23 08:09:43 +0000664#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000665 if (c->ipv6_router)
666 {
667 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
668 VTY_NEWLINE);
669 write++;
670 }
jardineb5d44e2003-12-23 08:09:43 +0000671#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000672
hassof390d2c2004-09-10 20:48:21 +0000673 /* ISIS - circuit type */
674 if (c->circuit_is_type == IS_LEVEL_1)
675 {
676 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
677 write++;
678 }
679 else
680 {
681 if (c->circuit_is_type == IS_LEVEL_2)
682 {
683 vty_out (vty, " isis circuit-type level-2-only%s",
684 VTY_NEWLINE);
685 write++;
686 }
687 }
jardineb5d44e2003-12-23 08:09:43 +0000688
hassof390d2c2004-09-10 20:48:21 +0000689 /* ISIS - CSNP interval - FIXME: compare to cisco */
690 if (c->csnp_interval[0] == c->csnp_interval[1])
691 {
692 if (c->csnp_interval[0] != CSNP_INTERVAL)
693 {
694 vty_out (vty, " isis csnp-interval %d%s",
695 c->csnp_interval[0], VTY_NEWLINE);
696 write++;
697 }
698 }
699 else
700 {
701 for (i = 0; i < 2; i++)
702 {
703 if (c->csnp_interval[1] != CSNP_INTERVAL)
704 {
705 vty_out (vty, " isis csnp-interval %d level-%d%s",
706 c->csnp_interval[1], i + 1, VTY_NEWLINE);
707 write++;
708 }
709 }
710 }
jardineb5d44e2003-12-23 08:09:43 +0000711
hassof390d2c2004-09-10 20:48:21 +0000712 /* ISIS - Hello padding - Defaults to true so only display if false */
713 if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos)
714 {
715 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
716 write++;
717 }
jardineb5d44e2003-12-23 08:09:43 +0000718
hassof390d2c2004-09-10 20:48:21 +0000719 /* ISIS - Hello interval - FIXME: compare to cisco */
720 if (c->hello_interval[0] == c->hello_interval[1])
721 {
722 if (c->hello_interval[0] != HELLO_INTERVAL)
723 {
724 vty_out (vty, " isis hello-interval %d%s",
725 c->hello_interval[0], VTY_NEWLINE);
726 write++;
727 }
728 }
729 else
730 {
731 for (i = 0; i < 2; i++)
732 {
733 if (c->hello_interval[i] != HELLO_INTERVAL)
734 {
735 if (c->hello_interval[i] == HELLO_MINIMAL)
736 {
737 vty_out (vty,
738 " isis hello-interval minimal level-%d%s",
739 i + 1, VTY_NEWLINE);
740 }
741 else
742 {
743 vty_out (vty, " isis hello-interval %d level-%d%s",
744 c->hello_interval[i], i + 1, VTY_NEWLINE);
745 }
746 write++;
747 }
748 }
749 }
jardineb5d44e2003-12-23 08:09:43 +0000750
hassof390d2c2004-09-10 20:48:21 +0000751 /* ISIS - Hello Multiplier */
752 if (c->hello_multiplier[0] == c->hello_multiplier[1])
753 {
754 if (c->hello_multiplier[0] != HELLO_MULTIPLIER)
755 {
756 vty_out (vty, " isis hello-multiplier %d%s",
757 c->hello_multiplier[0], VTY_NEWLINE);
758 write++;
759 }
760 }
761 else
762 {
763 for (i = 0; i < 2; i++)
764 {
765 if (c->hello_multiplier[i] != HELLO_MULTIPLIER)
766 {
767 vty_out (vty, " isis hello-multiplier %d level-%d%s",
768 c->hello_multiplier[i], i + 1, VTY_NEWLINE);
769 write++;
770 }
771 }
772 }
773 /* ISIS - Priority */
774 if (c->circ_type == CIRCUIT_T_BROADCAST)
775 {
776 if (c->u.bc.priority[0] == c->u.bc.priority[1])
777 {
778 if (c->u.bc.priority[0] != DEFAULT_PRIORITY)
779 {
780 vty_out (vty, " isis priority %d%s",
781 c->u.bc.priority[0], VTY_NEWLINE);
782 write++;
783 }
784 }
785 else
786 {
787 for (i = 0; i < 2; i++)
788 {
789 if (c->u.bc.priority[i] != DEFAULT_PRIORITY)
790 {
791 vty_out (vty, " isis priority %d level-%d%s",
792 c->u.bc.priority[i], i + 1, VTY_NEWLINE);
793 write++;
794 }
795 }
796 }
797 }
798 /* ISIS - Metric */
799 if (c->metrics[0].metric_default == c->metrics[1].metric_default)
800 {
801 if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS)
802 {
803 vty_out (vty, " isis metric %d%s",
804 c->metrics[0].metric_default, VTY_NEWLINE);
805 write++;
806 }
807 }
808 else
809 {
810 for (i = 0; i < 2; i++)
811 {
812 if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS)
813 {
814 vty_out (vty, " isis metric %d level-%d%s",
815 c->metrics[i].metric_default, i + 1,
816 VTY_NEWLINE);
817 write++;
818 }
819 }
820 }
jardineb5d44e2003-12-23 08:09:43 +0000821
hassof390d2c2004-09-10 20:48:21 +0000822 }
jardineb5d44e2003-12-23 08:09:43 +0000823 }
hassof390d2c2004-09-10 20:48:21 +0000824 vty_out (vty, "!%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000825 }
hassof390d2c2004-09-10 20:48:21 +0000826
jardineb5d44e2003-12-23 08:09:43 +0000827 return write;
828}
jardineb5d44e2003-12-23 08:09:43 +0000829
830DEFUN (ip_router_isis,
831 ip_router_isis_cmd,
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"
hassof390d2c2004-09-10 20:48:21 +0000836 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000837{
838 struct isis_circuit *c;
839 struct interface *ifp;
840 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000841
842 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000843 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000844
jardineb5d44e2003-12-23 08:09:43 +0000845 area = isis_area_lookup (argv[0]);
846
847 /* Prevent more than one circuit per interface */
848 if (area)
849 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000850 else
851 c = NULL;
852 if (c && (ifp->info != NULL))
853 {
jardineb5d44e2003-12-23 08:09:43 +0000854#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000855 if (c->ipv6_router == 0)
856 {
jardineb5d44e2003-12-23 08:09:43 +0000857#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000858 vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE);
859 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000860#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000861 }
862#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000863 }
hassof390d2c2004-09-10 20:48:21 +0000864
jardineb5d44e2003-12-23 08:09:43 +0000865 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +0000866 if (!area)
867 {
868 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
869 return CMD_WARNING;
870 }
jardineb5d44e2003-12-23 08:09:43 +0000871
hassof390d2c2004-09-10 20:48:21 +0000872 if (!c)
873 {
874 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
875 c = isis_csm_state_change (ISIS_ENABLE, c, area);
876 c->interface = ifp; /* this is automatic */
877 ifp->info = c; /* hardly related to the FSM */
878 }
jardineb5d44e2003-12-23 08:09:43 +0000879
hassof390d2c2004-09-10 20:48:21 +0000880 if (!c)
jardineb5d44e2003-12-23 08:09:43 +0000881 return CMD_WARNING;
882
883 c->ip_router = 1;
884 area->ip_circuits++;
885 circuit_update_nlpids (c);
886
887 vty->node = INTERFACE_NODE;
hassof390d2c2004-09-10 20:48:21 +0000888
jardineb5d44e2003-12-23 08:09:43 +0000889 return CMD_SUCCESS;
890}
891
892DEFUN (no_ip_router_isis,
893 no_ip_router_isis_cmd,
894 "no ip router isis WORD",
895 NO_STR
896 "Interface Internet Protocol config commands\n"
897 "IP router interface commands\n"
898 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000899 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000900{
901 struct isis_circuit *circuit = NULL;
902 struct interface *ifp;
903 struct isis_area *area;
904 struct listnode *node;
905
hassof390d2c2004-09-10 20:48:21 +0000906 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000907 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000908
jardineb5d44e2003-12-23 08:09:43 +0000909 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +0000910 if (!area)
911 {
912 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
913 return CMD_WARNING;
914 }
jardineb5d44e2003-12-23 08:09:43 +0000915 LIST_LOOP (area->circuit_list, circuit, node)
916 if (circuit->interface == ifp)
917 break;
hassof390d2c2004-09-10 20:48:21 +0000918 if (!circuit)
919 {
920 vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE);
921 return CMD_WARNING;
922 }
jardineb5d44e2003-12-23 08:09:43 +0000923 circuit->ip_router = 0;
924 area->ip_circuits--;
925#ifdef HAVE_IPV6
926 if (circuit->ipv6_router == 0)
927#endif
928 isis_csm_state_change (ISIS_DISABLE, circuit, area);
hassof390d2c2004-09-10 20:48:21 +0000929
jardineb5d44e2003-12-23 08:09:43 +0000930 return CMD_SUCCESS;
931}
932
933DEFUN (isis_circuit_type,
934 isis_circuit_type_cmd,
935 "isis circuit-type (level-1|level-1-2|level-2-only)",
936 "IS-IS commands\n"
937 "Configure circuit type for interface\n"
938 "Level-1 only adjacencies are formed\n"
939 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000940 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000941{
942 struct isis_circuit *circuit;
943 struct interface *ifp;
944 int circuit_t;
945 int is_type;
hassof390d2c2004-09-10 20:48:21 +0000946
947 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000948 circuit = ifp->info;
949 /* UGLY - will remove l8r */
hassof390d2c2004-09-10 20:48:21 +0000950 if (circuit == NULL)
951 {
952 return CMD_WARNING;
953 }
jardineb5d44e2003-12-23 08:09:43 +0000954
hasso13c48f72004-09-10 21:19:13 +0000955 /* XXX what to do when ip_router_isis is not executed */
956 if (circuit->area == NULL)
957 return CMD_WARNING;
958
jardineb5d44e2003-12-23 08:09:43 +0000959 assert (circuit);
960
hassof7c43dc2004-09-26 16:24:14 +0000961 circuit_t = string2circuit_t ((u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000962
hassof390d2c2004-09-10 20:48:21 +0000963 if (!circuit_t)
964 {
965 vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
966 return CMD_SUCCESS;
967 }
968
jardineb5d44e2003-12-23 08:09:43 +0000969 is_type = circuit->area->is_type;
970 if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t)
hassof390d2c2004-09-10 20:48:21 +0000971 isis_event_circuit_type_change (circuit, circuit_t);
972 else
973 {
974 vty_out (vty, "invalid circuit level for area %s.%s",
975 circuit->area->area_tag, VTY_NEWLINE);
976 }
977
jardineb5d44e2003-12-23 08:09:43 +0000978 return CMD_SUCCESS;
979}
980
981DEFUN (no_isis_circuit_type,
982 no_isis_circuit_type_cmd,
983 "no isis circuit-type (level-1|level-1-2|level-2-only)",
984 NO_STR
985 "IS-IS commands\n"
986 "Configure circuit type for interface\n"
987 "Level-1 only adjacencies are formed\n"
988 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000989 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000990{
991 struct isis_circuit *circuit;
992 struct interface *ifp;
jardineb5d44e2003-12-23 08:09:43 +0000993
hassof390d2c2004-09-10 20:48:21 +0000994 ifp = vty->index;
995 circuit = ifp->info;
996 if (circuit == NULL)
997 {
998 return CMD_WARNING;
999 }
1000
1001 assert (circuit);
1002
jardineb5d44e2003-12-23 08:09:43 +00001003 /*
1004 * Set the circuits level to its default value which is that of the area
1005 */
1006 isis_event_circuit_type_change (circuit, circuit->area->is_type);
hassof390d2c2004-09-10 20:48:21 +00001007
jardineb5d44e2003-12-23 08:09:43 +00001008 return CMD_SUCCESS;
1009}
1010
1011DEFUN (isis_passwd,
1012 isis_passwd_cmd,
1013 "isis password WORD",
1014 "IS-IS commands\n"
1015 "Configure the authentication password for interface\n"
1016 "Password\n")
1017{
1018 struct isis_circuit *circuit;
1019 struct interface *ifp;
1020 int len;
hassof390d2c2004-09-10 20:48:21 +00001021
1022 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001023 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001024 if (circuit == NULL)
1025 {
1026 return CMD_WARNING;
1027 }
1028
jardineb5d44e2003-12-23 08:09:43 +00001029 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001030 if (len > 254)
1031 {
1032 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
1033 return CMD_WARNING;
1034 }
jardineb5d44e2003-12-23 08:09:43 +00001035 circuit->passwd.len = len;
1036 circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001037 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001038
jardineb5d44e2003-12-23 08:09:43 +00001039 return CMD_SUCCESS;
1040}
1041
1042DEFUN (no_isis_passwd,
1043 no_isis_passwd_cmd,
1044 "no isis password",
1045 NO_STR
1046 "IS-IS commands\n"
1047 "Configure the authentication password for interface\n")
1048{
1049 struct isis_circuit *circuit;
1050 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001051
1052 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001053 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001054 if (circuit == NULL)
1055 {
1056 return CMD_WARNING;
1057 }
1058
jardineb5d44e2003-12-23 08:09:43 +00001059 memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001060
jardineb5d44e2003-12-23 08:09:43 +00001061 return CMD_SUCCESS;
1062}
1063
1064
1065DEFUN (isis_priority,
1066 isis_priority_cmd,
1067 "isis priority <0-127>",
1068 "IS-IS commands\n"
1069 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001070 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001071{
1072 struct isis_circuit *circuit;
1073 struct interface *ifp;
1074 int prio;
hassof390d2c2004-09-10 20:48:21 +00001075
1076 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001077 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001078 if (circuit == NULL)
1079 {
1080 return CMD_WARNING;
1081 }
jardineb5d44e2003-12-23 08:09:43 +00001082 assert (circuit);
1083
1084 prio = atoi (argv[0]);
1085
1086 circuit->u.bc.priority[0] = prio;
1087 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001088
jardineb5d44e2003-12-23 08:09:43 +00001089 return CMD_SUCCESS;
1090}
1091
1092DEFUN (no_isis_priority,
1093 no_isis_priority_cmd,
1094 "no isis priority",
1095 NO_STR
1096 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001097 "Set priority for Designated Router election\n")
jardineb5d44e2003-12-23 08:09:43 +00001098{
1099 struct isis_circuit *circuit;
1100 struct interface *ifp;
1101
hassof390d2c2004-09-10 20:48:21 +00001102 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001103 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001104 if (circuit == NULL)
1105 {
1106 return CMD_WARNING;
1107 }
jardineb5d44e2003-12-23 08:09:43 +00001108 assert (circuit);
1109
1110 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
1111 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001112
jardineb5d44e2003-12-23 08:09:43 +00001113 return CMD_SUCCESS;
1114}
1115
1116ALIAS (no_isis_priority,
1117 no_isis_priority_arg_cmd,
1118 "no isis priority <0-127>",
1119 NO_STR
1120 "IS-IS commands\n"
1121 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001122 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001123
1124DEFUN (isis_priority_l1,
1125 isis_priority_l1_cmd,
hassof390d2c2004-09-10 20:48:21 +00001126 "isis priority <0-127> level-1",
jardineb5d44e2003-12-23 08:09:43 +00001127 "IS-IS commands\n"
1128 "Set priority for Designated Router election\n"
1129 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001130 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001131{
1132 struct isis_circuit *circuit;
1133 struct interface *ifp;
1134 int prio;
hassof390d2c2004-09-10 20:48:21 +00001135
1136 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001137 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001138 if (circuit == NULL)
1139 {
1140 return CMD_WARNING;
1141 }
jardineb5d44e2003-12-23 08:09:43 +00001142 assert (circuit);
1143
1144 prio = atoi (argv[0]);
1145
1146 circuit->u.bc.priority[0] = prio;
hassof390d2c2004-09-10 20:48:21 +00001147
jardineb5d44e2003-12-23 08:09:43 +00001148 return CMD_SUCCESS;
1149}
1150
1151DEFUN (no_isis_priority_l1,
1152 no_isis_priority_l1_cmd,
1153 "no isis priority level-1",
1154 NO_STR
1155 "IS-IS commands\n"
1156 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001157 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001158{
1159 struct isis_circuit *circuit;
1160 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001161
1162 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001163 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001164 if (circuit == NULL)
1165 {
1166 return CMD_WARNING;
1167 }
jardineb5d44e2003-12-23 08:09:43 +00001168 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001169
jardineb5d44e2003-12-23 08:09:43 +00001170 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001171
jardineb5d44e2003-12-23 08:09:43 +00001172 return CMD_SUCCESS;
1173}
1174
1175ALIAS (no_isis_priority_l1,
1176 no_isis_priority_l1_arg_cmd,
1177 "no isis priority <0-127> level-1",
1178 NO_STR
1179 "IS-IS commands\n"
1180 "Set priority for Designated Router election\n"
1181 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001182 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001183
1184DEFUN (isis_priority_l2,
1185 isis_priority_l2_cmd,
hassof390d2c2004-09-10 20:48:21 +00001186 "isis priority <0-127> level-2",
jardineb5d44e2003-12-23 08:09:43 +00001187 "IS-IS commands\n"
1188 "Set priority for Designated Router election\n"
1189 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001190 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001191{
1192 struct isis_circuit *circuit;
1193 struct interface *ifp;
1194 int prio;
hassof390d2c2004-09-10 20:48:21 +00001195
1196 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001197 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001198 if (circuit == NULL)
1199 {
1200 return CMD_WARNING;
1201 }
jardineb5d44e2003-12-23 08:09:43 +00001202 assert (circuit);
1203
1204 prio = atoi (argv[0]);
1205
1206 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001207
jardineb5d44e2003-12-23 08:09:43 +00001208 return CMD_SUCCESS;
1209}
1210
1211DEFUN (no_isis_priority_l2,
1212 no_isis_priority_l2_cmd,
1213 "no isis priority level-2",
1214 NO_STR
1215 "IS-IS commands\n"
1216 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001217 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001218{
1219 struct isis_circuit *circuit;
1220 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001221
1222 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001223 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001224 if (circuit == NULL)
1225 {
1226 return CMD_WARNING;
1227 }
jardineb5d44e2003-12-23 08:09:43 +00001228 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001229
jardineb5d44e2003-12-23 08:09:43 +00001230 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001231
jardineb5d44e2003-12-23 08:09:43 +00001232 return CMD_SUCCESS;
1233}
1234
1235ALIAS (no_isis_priority_l2,
1236 no_isis_priority_l2_arg_cmd,
1237 "no isis priority <0-127> level-2",
1238 NO_STR
1239 "IS-IS commands\n"
1240 "Set priority for Designated Router election\n"
1241 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001242 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001243
1244/* Metric command */
hassof390d2c2004-09-10 20:48:21 +00001245 DEFUN (isis_metric,
jardineb5d44e2003-12-23 08:09:43 +00001246 isis_metric_cmd,
1247 "isis metric <0-63>",
1248 "IS-IS commands\n"
1249 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001250 "Default metric value\n")
jardineb5d44e2003-12-23 08:09:43 +00001251{
1252 struct isis_circuit *circuit;
1253 struct interface *ifp;
1254 int met;
1255
hassof390d2c2004-09-10 20:48:21 +00001256 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001257 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001258 if (circuit == NULL)
1259 {
1260 return CMD_WARNING;
1261 }
jardineb5d44e2003-12-23 08:09:43 +00001262 assert (circuit);
1263
1264 met = atoi (argv[0]);
1265
1266 circuit->metrics[0].metric_default = met;
1267 circuit->metrics[1].metric_default = met;
1268
1269 return CMD_SUCCESS;
1270}
1271
1272DEFUN (no_isis_metric,
1273 no_isis_metric_cmd,
1274 "no isis metric",
1275 NO_STR
1276 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001277 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001278{
1279 struct isis_circuit *circuit;
1280 struct interface *ifp;
1281
hassof390d2c2004-09-10 20:48:21 +00001282 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001283 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001284 if (circuit == NULL)
1285 {
1286 return CMD_WARNING;
1287 }
jardineb5d44e2003-12-23 08:09:43 +00001288 assert (circuit);
1289
1290 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1291 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1292
1293 return CMD_SUCCESS;
1294}
1295
1296ALIAS (no_isis_metric,
1297 no_isis_metric_arg_cmd,
1298 "no isis metric <0-127>",
1299 NO_STR
1300 "IS-IS commands\n"
1301 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001302 "Default metric value\n")
1303
jardineb5d44e2003-12-23 08:09:43 +00001304/* end of metrics */
hassof390d2c2004-09-10 20:48:21 +00001305 DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00001306 isis_hello_interval_cmd,
1307 "isis hello-interval (<1-65535>|minimal)",
1308 "IS-IS commands\n"
1309 "Set Hello interval\n"
1310 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001311 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001312{
1313 struct isis_circuit *circuit;
1314 struct interface *ifp;
1315 int interval;
1316 char c;
1317
hassof390d2c2004-09-10 20:48:21 +00001318 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001319 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001320 if (circuit == NULL)
1321 {
1322 return CMD_WARNING;
1323 }
1324 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001325 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001326 if (isdigit ((int) c))
1327 {
1328 interval = atoi (argv[0]);
1329 }
1330 else
1331 interval = HELLO_MINIMAL; /* FIXME: should be calculated */
jardineb5d44e2003-12-23 08:09:43 +00001332
hassof390d2c2004-09-10 20:48:21 +00001333 circuit->hello_interval[0] = (u_int16_t) interval;
1334 circuit->hello_interval[1] = (u_int16_t) interval;
1335
jardineb5d44e2003-12-23 08:09:43 +00001336 return CMD_SUCCESS;
1337}
1338
1339DEFUN (no_isis_hello_interval,
1340 no_isis_hello_interval_cmd,
1341 "no isis hello-interval",
1342 NO_STR
1343 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001344 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00001345{
1346 struct isis_circuit *circuit;
1347 struct interface *ifp;
1348
hassof390d2c2004-09-10 20:48:21 +00001349 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001350 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001351 if (circuit == NULL)
1352 {
1353 return CMD_WARNING;
1354 }
jardineb5d44e2003-12-23 08:09:43 +00001355 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001356
hassof390d2c2004-09-10 20:48:21 +00001357
1358 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
jardineb5d44e2003-12-23 08:09:43 +00001359 circuit->hello_interval[1] = HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001360
jardineb5d44e2003-12-23 08:09:43 +00001361 return CMD_SUCCESS;
1362}
1363
1364ALIAS (no_isis_hello_interval,
1365 no_isis_hello_interval_arg_cmd,
1366 "no isis hello-interval (<1-65535>|minimal)",
1367 NO_STR
1368 "IS-IS commands\n"
1369 "Set Hello interval\n"
1370 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001371 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001372
1373DEFUN (isis_hello_interval_l1,
1374 isis_hello_interval_l1_cmd,
1375 "isis hello-interval (<1-65535>|minimal) level-1",
1376 "IS-IS commands\n"
1377 "Set Hello interval\n"
1378 "Hello interval value\n"
1379 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001380 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001381{
1382 struct isis_circuit *circuit;
1383 struct interface *ifp;
1384 long interval;
1385 char c;
1386
hassof390d2c2004-09-10 20:48:21 +00001387 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001388 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001389 if (circuit == NULL)
1390 {
1391 return CMD_WARNING;
1392 }
jardineb5d44e2003-12-23 08:09:43 +00001393 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001394
jardineb5d44e2003-12-23 08:09:43 +00001395 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001396 if (isdigit ((int) c))
1397 {
1398 interval = atoi (argv[0]);
1399 }
1400 else
jardineb5d44e2003-12-23 08:09:43 +00001401 interval = HELLO_MINIMAL;
1402
hassof390d2c2004-09-10 20:48:21 +00001403 circuit->hello_interval[0] = (u_int16_t) interval;
1404
jardineb5d44e2003-12-23 08:09:43 +00001405 return CMD_SUCCESS;
1406}
1407
1408DEFUN (no_isis_hello_interval_l1,
1409 no_isis_hello_interval_l1_cmd,
1410 "no isis hello-interval level-1",
1411 NO_STR
1412 "IS-IS commands\n"
1413 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001414 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001415{
1416 struct isis_circuit *circuit;
1417 struct interface *ifp;
1418
hassof390d2c2004-09-10 20:48:21 +00001419 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001420 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001421 if (circuit == NULL)
1422 {
1423 return CMD_WARNING;
1424 }
jardineb5d44e2003-12-23 08:09:43 +00001425 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001426
hassof390d2c2004-09-10 20:48:21 +00001427
1428 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1429
jardineb5d44e2003-12-23 08:09:43 +00001430 return CMD_SUCCESS;
1431}
1432
1433ALIAS (no_isis_hello_interval_l1,
1434 no_isis_hello_interval_l1_arg_cmd,
1435 "no isis hello-interval (<1-65535>|minimal) level-1",
1436 NO_STR
1437 "IS-IS commands\n"
1438 "Set Hello interval\n"
1439 "Hello interval value\n"
1440 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001441 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001442
1443DEFUN (isis_hello_interval_l2,
1444 isis_hello_interval_l2_cmd,
1445 "isis hello-interval (<1-65535>|minimal) level-2",
1446 "IS-IS commands\n"
1447 "Set Hello interval\n"
1448 "Hello interval value\n"
1449 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001450 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001451{
1452 struct isis_circuit *circuit;
1453 struct interface *ifp;
1454 long interval;
1455 char c;
1456
hassof390d2c2004-09-10 20:48:21 +00001457 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001458 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001459 if (circuit == NULL)
1460 {
1461 return CMD_WARNING;
1462 }
jardineb5d44e2003-12-23 08:09:43 +00001463 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001464
jardineb5d44e2003-12-23 08:09:43 +00001465 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001466 if (isdigit ((int) c))
1467 {
1468 interval = atoi (argv[0]);
1469 }
1470 else
jardineb5d44e2003-12-23 08:09:43 +00001471 interval = HELLO_MINIMAL;
1472
hassof390d2c2004-09-10 20:48:21 +00001473 circuit->hello_interval[1] = (u_int16_t) interval;
1474
jardineb5d44e2003-12-23 08:09:43 +00001475 return CMD_SUCCESS;
1476}
1477
1478DEFUN (no_isis_hello_interval_l2,
1479 no_isis_hello_interval_l2_cmd,
1480 "no isis hello-interval level-2",
1481 NO_STR
1482 "IS-IS commands\n"
1483 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001484 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001485{
1486 struct isis_circuit *circuit;
1487 struct interface *ifp;
1488
hassof390d2c2004-09-10 20:48:21 +00001489 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001490 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001491 if (circuit == NULL)
1492 {
1493 return CMD_WARNING;
1494 }
jardineb5d44e2003-12-23 08:09:43 +00001495 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001496
hassof390d2c2004-09-10 20:48:21 +00001497
1498 circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1499
jardineb5d44e2003-12-23 08:09:43 +00001500 return CMD_SUCCESS;
1501}
1502
1503ALIAS (no_isis_hello_interval_l2,
1504 no_isis_hello_interval_l2_arg_cmd,
1505 "no isis hello-interval (<1-65535>|minimal) level-2",
1506 NO_STR
1507 "IS-IS commands\n"
1508 "Set Hello interval\n"
1509 "Hello interval value\n"
1510 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001511 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001512
1513DEFUN (isis_hello_multiplier,
1514 isis_hello_multiplier_cmd,
1515 "isis hello-multiplier <3-1000>",
1516 "IS-IS commands\n"
1517 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001518 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001519{
1520 struct isis_circuit *circuit;
1521 struct interface *ifp;
1522 int mult;
hassof390d2c2004-09-10 20:48:21 +00001523
1524 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001525 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001526 if (circuit == NULL)
1527 {
1528 return CMD_WARNING;
1529 }
jardineb5d44e2003-12-23 08:09:43 +00001530 assert (circuit);
1531
1532 mult = atoi (argv[0]);
1533
hassof390d2c2004-09-10 20:48:21 +00001534 circuit->hello_multiplier[0] = (u_int16_t) mult;
1535 circuit->hello_multiplier[1] = (u_int16_t) mult;
1536
jardineb5d44e2003-12-23 08:09:43 +00001537 return CMD_SUCCESS;
1538}
1539
1540DEFUN (no_isis_hello_multiplier,
1541 no_isis_hello_multiplier_cmd,
1542 "no isis hello-multiplier",
1543 NO_STR
1544 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001545 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00001546{
1547 struct isis_circuit *circuit;
1548 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001549
1550 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001551 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001552 if (circuit == NULL)
1553 {
1554 return CMD_WARNING;
1555 }
jardineb5d44e2003-12-23 08:09:43 +00001556 assert (circuit);
1557
1558 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1559 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1560
1561 return CMD_SUCCESS;
1562}
1563
1564ALIAS (no_isis_hello_multiplier,
1565 no_isis_hello_multiplier_arg_cmd,
1566 "no isis hello-multiplier <3-1000>",
1567 NO_STR
1568 "IS-IS commands\n"
1569 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001570 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001571
1572DEFUN (isis_hello_multiplier_l1,
1573 isis_hello_multiplier_l1_cmd,
1574 "isis hello-multiplier <3-1000> level-1",
1575 "IS-IS commands\n"
1576 "Set multiplier for Hello holding time\n"
1577 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001578 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001579{
1580 struct isis_circuit *circuit;
1581 struct interface *ifp;
1582 int mult;
hassof390d2c2004-09-10 20:48:21 +00001583
1584 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001585 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001586 if (circuit == NULL)
1587 {
1588 return CMD_WARNING;
1589 }
jardineb5d44e2003-12-23 08:09:43 +00001590 assert (circuit);
1591
1592 mult = atoi (argv[0]);
1593
hassof390d2c2004-09-10 20:48:21 +00001594 circuit->hello_multiplier[0] = (u_int16_t) mult;
1595
jardineb5d44e2003-12-23 08:09:43 +00001596 return CMD_SUCCESS;
1597}
1598
1599DEFUN (no_isis_hello_multiplier_l1,
1600 no_isis_hello_multiplier_l1_cmd,
1601 "no isis hello-multiplier level-1",
1602 NO_STR
1603 "IS-IS commands\n"
1604 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001605 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001606{
1607 struct isis_circuit *circuit;
1608 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001609
1610 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001611 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001612 if (circuit == NULL)
1613 {
1614 return CMD_WARNING;
1615 }
jardineb5d44e2003-12-23 08:09:43 +00001616 assert (circuit);
1617
1618 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1619
1620 return CMD_SUCCESS;
1621}
1622
1623ALIAS (no_isis_hello_multiplier_l1,
1624 no_isis_hello_multiplier_l1_arg_cmd,
1625 "no isis hello-multiplier <3-1000> level-1",
1626 NO_STR
1627 "IS-IS commands\n"
1628 "Set multiplier for Hello holding time\n"
1629 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001630 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001631
1632DEFUN (isis_hello_multiplier_l2,
1633 isis_hello_multiplier_l2_cmd,
1634 "isis hello-multiplier <3-1000> level-2",
1635 "IS-IS commands\n"
1636 "Set multiplier for Hello holding time\n"
1637 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001638 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001639{
1640 struct isis_circuit *circuit;
1641 struct interface *ifp;
1642 int mult;
hassof390d2c2004-09-10 20:48:21 +00001643
1644 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001645 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001646 if (circuit == NULL)
1647 {
1648 return CMD_WARNING;
1649 }
jardineb5d44e2003-12-23 08:09:43 +00001650 assert (circuit);
1651
1652 mult = atoi (argv[0]);
1653
hassof390d2c2004-09-10 20:48:21 +00001654 circuit->hello_multiplier[1] = (u_int16_t) mult;
1655
jardineb5d44e2003-12-23 08:09:43 +00001656 return CMD_SUCCESS;
1657}
1658
1659DEFUN (no_isis_hello_multiplier_l2,
1660 no_isis_hello_multiplier_l2_cmd,
1661 "no isis hello-multiplier level-2",
1662 NO_STR
1663 "IS-IS commands\n"
1664 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001665 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001666{
1667 struct isis_circuit *circuit;
1668 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001669
1670 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001671 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001672 if (circuit == NULL)
1673 {
1674 return CMD_WARNING;
1675 }
jardineb5d44e2003-12-23 08:09:43 +00001676 assert (circuit);
1677
1678 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1679
1680 return CMD_SUCCESS;
1681}
1682
1683ALIAS (no_isis_hello_multiplier_l2,
1684 no_isis_hello_multiplier_l2_arg_cmd,
1685 "no isis hello-multiplier <3-1000> level-2",
1686 NO_STR
1687 "IS-IS commands\n"
1688 "Set multiplier for Hello holding time\n"
1689 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001690 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001691
1692DEFUN (isis_hello,
1693 isis_hello_cmd,
1694 "isis hello padding",
1695 "IS-IS commands\n"
1696 "Add padding to IS-IS hello packets\n"
1697 "Pad hello packets\n"
1698 "<cr>\n")
1699{
1700 struct interface *ifp;
1701 struct isis_circuit *circuit;
hassof390d2c2004-09-10 20:48:21 +00001702
1703 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001704 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001705 if (circuit == NULL)
1706 {
1707 return CMD_WARNING;
1708 }
jardineb5d44e2003-12-23 08:09:43 +00001709 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001710
jardineb5d44e2003-12-23 08:09:43 +00001711 circuit->u.bc.pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00001712
jardineb5d44e2003-12-23 08:09:43 +00001713 return CMD_SUCCESS;
1714}
1715
jardineb5d44e2003-12-23 08:09:43 +00001716DEFUN (no_isis_hello,
1717 no_isis_hello_cmd,
1718 "no isis hello padding",
1719 NO_STR
1720 "IS-IS commands\n"
1721 "Add padding to IS-IS hello packets\n"
1722 "Pad hello packets\n"
1723 "<cr>\n")
1724{
1725 struct isis_circuit *circuit;
1726 struct interface *ifp;
1727
hassof390d2c2004-09-10 20:48:21 +00001728 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001729 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001730 if (circuit == NULL)
1731 {
1732 return CMD_WARNING;
1733 }
jardineb5d44e2003-12-23 08:09:43 +00001734 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001735
jardineb5d44e2003-12-23 08:09:43 +00001736 circuit->u.bc.pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00001737
jardineb5d44e2003-12-23 08:09:43 +00001738 return CMD_SUCCESS;
1739}
1740
1741DEFUN (csnp_interval,
1742 csnp_interval_cmd,
1743 "isis csnp-interval <0-65535>",
1744 "IS-IS commands\n"
1745 "Set CSNP interval in seconds\n"
1746 "CSNP interval value\n")
1747{
1748 struct isis_circuit *circuit;
1749 struct interface *ifp;
1750 unsigned long interval;
1751
hassof390d2c2004-09-10 20:48:21 +00001752 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001753 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001754 if (circuit == NULL)
1755 {
1756 return CMD_WARNING;
1757 }
jardineb5d44e2003-12-23 08:09:43 +00001758 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001759
jardineb5d44e2003-12-23 08:09:43 +00001760 interval = atol (argv[0]);
1761
hassof390d2c2004-09-10 20:48:21 +00001762 circuit->csnp_interval[0] = (u_int16_t) interval;
1763 circuit->csnp_interval[1] = (u_int16_t) interval;
1764
jardineb5d44e2003-12-23 08:09:43 +00001765 return CMD_SUCCESS;
1766}
1767
1768DEFUN (no_csnp_interval,
1769 no_csnp_interval_cmd,
1770 "no isis csnp-interval",
1771 NO_STR
1772 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001773 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001774{
1775 struct isis_circuit *circuit;
1776 struct interface *ifp;
1777
hassof390d2c2004-09-10 20:48:21 +00001778 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001779 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001780 if (circuit == NULL)
1781 {
1782 return CMD_WARNING;
1783 }
jardineb5d44e2003-12-23 08:09:43 +00001784 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001785
jardineb5d44e2003-12-23 08:09:43 +00001786 circuit->csnp_interval[0] = CSNP_INTERVAL;
1787 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001788
jardineb5d44e2003-12-23 08:09:43 +00001789 return CMD_SUCCESS;
1790}
1791
1792ALIAS (no_csnp_interval,
1793 no_csnp_interval_arg_cmd,
1794 "no isis csnp-interval <0-65535>",
1795 NO_STR
1796 "IS-IS commands\n"
1797 "Set CSNP interval in seconds\n"
1798 "CSNP interval value\n")
1799
jardineb5d44e2003-12-23 08:09:43 +00001800DEFUN (csnp_interval_l1,
1801 csnp_interval_l1_cmd,
1802 "isis csnp-interval <0-65535> level-1",
1803 "IS-IS commands\n"
1804 "Set CSNP interval in seconds\n"
1805 "CSNP interval value\n"
1806 "Specify interval for level-1 CSNPs\n")
1807{
1808 struct isis_circuit *circuit;
1809 struct interface *ifp;
1810 unsigned long interval;
1811
hassof390d2c2004-09-10 20:48:21 +00001812 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001813 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001814 if (circuit == NULL)
1815 {
1816 return CMD_WARNING;
1817 }
jardineb5d44e2003-12-23 08:09:43 +00001818 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001819
jardineb5d44e2003-12-23 08:09:43 +00001820 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001821
1822 circuit->csnp_interval[0] = (u_int16_t) interval;
1823
jardineb5d44e2003-12-23 08:09:43 +00001824 return CMD_SUCCESS;
1825}
1826
1827DEFUN (no_csnp_interval_l1,
1828 no_csnp_interval_l1_cmd,
1829 "no isis csnp-interval level-1",
1830 NO_STR
1831 "IS-IS commands\n"
1832 "Set CSNP interval in seconds\n"
1833 "Specify interval for level-1 CSNPs\n")
1834{
1835 struct isis_circuit *circuit;
1836 struct interface *ifp;
1837
hassof390d2c2004-09-10 20:48:21 +00001838 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001839 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001840 if (circuit == NULL)
1841 {
1842 return CMD_WARNING;
1843 }
jardineb5d44e2003-12-23 08:09:43 +00001844 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001845
jardineb5d44e2003-12-23 08:09:43 +00001846 circuit->csnp_interval[0] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001847
jardineb5d44e2003-12-23 08:09:43 +00001848 return CMD_SUCCESS;
1849}
1850
1851ALIAS (no_csnp_interval_l1,
1852 no_csnp_interval_l1_arg_cmd,
1853 "no isis csnp-interval <0-65535> level-1",
1854 NO_STR
1855 "IS-IS commands\n"
1856 "Set CSNP interval in seconds\n"
1857 "CSNP interval value\n"
1858 "Specify interval for level-1 CSNPs\n")
1859
jardineb5d44e2003-12-23 08:09:43 +00001860DEFUN (csnp_interval_l2,
1861 csnp_interval_l2_cmd,
1862 "isis csnp-interval <0-65535> level-2",
1863 "IS-IS commands\n"
1864 "Set CSNP interval in seconds\n"
1865 "CSNP interval value\n"
1866 "Specify interval for level-2 CSNPs\n")
1867{
1868 struct isis_circuit *circuit;
1869 struct interface *ifp;
1870 unsigned long interval;
1871
hassof390d2c2004-09-10 20:48:21 +00001872 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001873 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001874 if (circuit == NULL)
1875 {
1876 return CMD_WARNING;
1877 }
jardineb5d44e2003-12-23 08:09:43 +00001878 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001879
jardineb5d44e2003-12-23 08:09:43 +00001880 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001881
1882 circuit->csnp_interval[1] = (u_int16_t) interval;
1883
jardineb5d44e2003-12-23 08:09:43 +00001884 return CMD_SUCCESS;
1885}
1886
1887DEFUN (no_csnp_interval_l2,
1888 no_csnp_interval_l2_cmd,
1889 "no isis csnp-interval level-2",
1890 NO_STR
1891 "IS-IS commands\n"
1892 "Set CSNP interval in seconds\n"
1893 "Specify interval for level-2 CSNPs\n")
1894{
1895 struct isis_circuit *circuit;
1896 struct interface *ifp;
1897
hassof390d2c2004-09-10 20:48:21 +00001898 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001899 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001900 if (circuit == NULL)
1901 {
1902 return CMD_WARNING;
1903 }
jardineb5d44e2003-12-23 08:09:43 +00001904 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001905
jardineb5d44e2003-12-23 08:09:43 +00001906 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001907
jardineb5d44e2003-12-23 08:09:43 +00001908 return CMD_SUCCESS;
1909}
1910
1911ALIAS (no_csnp_interval_l2,
1912 no_csnp_interval_l2_arg_cmd,
1913 "no isis csnp-interval <0-65535> level-2",
1914 NO_STR
1915 "IS-IS commands\n"
1916 "Set CSNP interval in seconds\n"
1917 "CSNP interval value\n"
1918 "Specify interval for level-2 CSNPs\n")
1919
jardineb5d44e2003-12-23 08:09:43 +00001920#ifdef HAVE_IPV6
1921DEFUN (ipv6_router_isis,
1922 ipv6_router_isis_cmd,
1923 "ipv6 router isis WORD",
1924 "IPv6 interface subcommands\n"
1925 "IPv6 Router interface commands\n"
1926 "IS-IS Routing for IPv6\n"
1927 "Routing process tag\n")
1928{
1929 struct isis_circuit *c;
1930 struct interface *ifp;
1931 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001932
1933 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001934 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001935
jardineb5d44e2003-12-23 08:09:43 +00001936 area = isis_area_lookup (argv[0]);
1937
1938 /* Prevent more than one circuit per interface */
1939 if (area)
1940 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001941 else
1942 c = NULL;
1943
1944 if (c && (ifp->info != NULL))
1945 {
1946 if (c->ipv6_router == 1)
1947 {
1948 vty_out (vty, "ISIS circuit is already defined for IPv6%s",
1949 VTY_NEWLINE);
1950 return CMD_WARNING;
1951 }
jardineb5d44e2003-12-23 08:09:43 +00001952 }
jardineb5d44e2003-12-23 08:09:43 +00001953
1954 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +00001955 if (!area)
1956 {
1957 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1958 return CMD_WARNING;
1959 }
jardineb5d44e2003-12-23 08:09:43 +00001960
hassof390d2c2004-09-10 20:48:21 +00001961 if (!c)
1962 {
1963 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1964 c = isis_csm_state_change (ISIS_ENABLE, c, area);
1965 c->interface = ifp;
1966 ifp->info = c;
1967 }
jardineb5d44e2003-12-23 08:09:43 +00001968
hassof390d2c2004-09-10 20:48:21 +00001969 if (!c)
jardineb5d44e2003-12-23 08:09:43 +00001970 return CMD_WARNING;
1971
1972 c->ipv6_router = 1;
1973 area->ipv6_circuits++;
1974 circuit_update_nlpids (c);
1975
1976 vty->node = INTERFACE_NODE;
1977
1978 return CMD_SUCCESS;
1979}
1980
1981DEFUN (no_ipv6_router_isis,
1982 no_ipv6_router_isis_cmd,
1983 "no ipv6 router isis WORD",
1984 NO_STR
1985 "IPv6 interface subcommands\n"
1986 "IPv6 Router interface commands\n"
1987 "IS-IS Routing for IPv6\n"
1988 "Routing process tag\n")
1989{
1990 struct isis_circuit *c;
1991 struct interface *ifp;
1992 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001993
1994 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001995 /* UGLY - will remove l8r
1996 if (circuit == NULL) {
hassof390d2c2004-09-10 20:48:21 +00001997 return CMD_WARNING;
1998 } */
jardineb5d44e2003-12-23 08:09:43 +00001999 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00002000
jardineb5d44e2003-12-23 08:09:43 +00002001 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00002002 if (!area)
2003 {
2004 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
2005 return CMD_WARNING;
2006 }
2007
jardineb5d44e2003-12-23 08:09:43 +00002008 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
2009 if (!c)
2010 return CMD_WARNING;
2011
2012 c->ipv6_router = 0;
2013 area->ipv6_circuits--;
2014 if (c->ip_router == 0)
2015 isis_csm_state_change (ISIS_DISABLE, c, area);
2016
2017 return CMD_SUCCESS;
2018}
hassof390d2c2004-09-10 20:48:21 +00002019#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00002020
hassof390d2c2004-09-10 20:48:21 +00002021struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002022 INTERFACE_NODE,
2023 "%s(config-if)# ",
2024 1,
2025};
2026
jardineb5d44e2003-12-23 08:09:43 +00002027int
2028isis_if_new_hook (struct interface *ifp)
2029{
2030/* FIXME: Discuss if the circuit should be created here
2031 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2032 ifp->info = NULL;
2033 return 0;
2034}
2035
2036int
2037isis_if_delete_hook (struct interface *ifp)
2038{
2039/* FIXME: Discuss if the circuit should be created here
2040 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2041 ifp->info = NULL;
2042 return 0;
2043}
2044
jardineb5d44e2003-12-23 08:09:43 +00002045void
2046isis_circuit_init ()
2047{
jardineb5d44e2003-12-23 08:09:43 +00002048 /* Initialize Zebra interface data structure */
2049 if_init ();
2050 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2051 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2052
2053 /* Install interface node */
2054 install_node (&interface_node, isis_interface_config_write);
2055 install_element (CONFIG_NODE, &interface_cmd);
2056
2057 install_default (INTERFACE_NODE);
2058 install_element (INTERFACE_NODE, &interface_desc_cmd);
2059 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2060
2061 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2062 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2063
2064 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2065 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2066
2067 install_element (INTERFACE_NODE, &isis_passwd_cmd);
2068 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2069
2070 install_element (INTERFACE_NODE, &isis_priority_cmd);
2071 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2072 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2073 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2074 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2075 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2076 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2077 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2078 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2079
2080 install_element (INTERFACE_NODE, &isis_metric_cmd);
2081 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2082 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2083
2084 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2085 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2086 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2087 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2088 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2089 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2090 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2091 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2092 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2093
2094 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2095 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2096 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2097 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2098 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2099 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2100 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2101 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2102 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2103
2104 install_element (INTERFACE_NODE, &isis_hello_cmd);
2105 install_element (INTERFACE_NODE, &no_isis_hello_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002106 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2107 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2108 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2109 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2110 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2111 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2112 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2113 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2114 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2115
2116#ifdef HAVE_IPV6
2117 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2118 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002119#endif
jardineb5d44e2003-12-23 08:09:43 +00002120}