blob: b99fa5daf0af51c5ee03691607fdf3cad0563132 [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
paul1eb8ef22005-04-07 07:30:20 +0000153 for (ALL_LIST_ELEMENTS_RO (list, node, circuit))
154 if (circuit->interface == ifp)
155 return circuit;
156
jardineb5d44e2003-12-23 08:09:43 +0000157 return NULL;
158}
159
160struct isis_circuit *
161circuit_scan_by_ifp (struct interface *ifp)
162{
163 struct isis_area *area;
164 struct listnode *node;
165 struct isis_circuit *circuit;
166
167 if (!isis->area_list)
168 return NULL;
169
paul1eb8ef22005-04-07 07:30:20 +0000170 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
hassof390d2c2004-09-10 20:48:21 +0000171 {
hassof390d2c2004-09-10 20:48:21 +0000172 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
173 if (circuit)
174 return circuit;
175 }
176
jardineb5d44e2003-12-23 08:09:43 +0000177 return circuit_lookup_by_ifp (ifp, isis->init_circ_list);
178}
179
180void
181isis_circuit_del (struct isis_circuit *circuit)
182{
183
184 if (!circuit)
185 return;
186
hassof390d2c2004-09-10 20:48:21 +0000187 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
188 {
189 /* destroy adjacency databases */
hasso46606872004-12-29 19:34:22 +0000190 if (circuit->u.bc.adjdb[0])
191 list_delete (circuit->u.bc.adjdb[0]);
192 if (circuit->u.bc.adjdb[1])
193 list_delete (circuit->u.bc.adjdb[1]);
hassof390d2c2004-09-10 20:48:21 +0000194 /* destroy neighbour lists */
195 if (circuit->u.bc.lan_neighs[0])
196 list_delete (circuit->u.bc.lan_neighs[0]);
197 if (circuit->u.bc.lan_neighs[1])
198 list_delete (circuit->u.bc.lan_neighs[1]);
199 /* destroy addresses */
200 }
jardineb5d44e2003-12-23 08:09:43 +0000201 if (circuit->ip_addrs)
202 list_delete (circuit->ip_addrs);
203#ifdef HAVE_IPV6
204 if (circuit->ipv6_link)
205 list_delete (circuit->ipv6_link);
206 if (circuit->ipv6_non_link)
207 list_delete (circuit->ipv6_non_link);
208#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000209
jardineb5d44e2003-12-23 08:09:43 +0000210 /* and lastly the circuit itself */
211 XFREE (MTYPE_ISIS_CIRCUIT, circuit);
212
213 return;
214}
215
216void
hassof891f442004-09-14 13:54:30 +0000217isis_circuit_add_addr (struct isis_circuit *circuit,
218 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000219{
220 struct prefix_ipv4 *ipv4;
hassof390d2c2004-09-10 20:48:21 +0000221 u_char buf[BUFSIZ];
jardineb5d44e2003-12-23 08:09:43 +0000222#ifdef HAVE_IPV6
223 struct prefix_ipv6 *ipv6;
224#endif /* HAVE_IPV6 */
hassof891f442004-09-14 13:54:30 +0000225
hassof390d2c2004-09-10 20:48:21 +0000226 if (!circuit->ip_addrs)
hassof891f442004-09-14 13:54:30 +0000227 circuit->ip_addrs = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000228#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000229 if (!circuit->ipv6_link)
hassof891f442004-09-14 13:54:30 +0000230 circuit->ipv6_link = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000231 if (!circuit->ipv6_non_link)
hassof891f442004-09-14 13:54:30 +0000232 circuit->ipv6_non_link = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000233#endif /* HAVE_IPV6 */
234
235 memset (&buf, 0, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000236 if (connected->address->family == AF_INET)
hassof390d2c2004-09-10 20:48:21 +0000237 {
238 ipv4 = prefix_ipv4_new ();
hassof891f442004-09-14 13:54:30 +0000239 ipv4->prefixlen = connected->address->prefixlen;
240 ipv4->prefix = connected->address->u.prefix4;
hassof390d2c2004-09-10 20:48:21 +0000241 listnode_add (circuit->ip_addrs, ipv4);
hasso0dae85e2004-09-26 19:53:47 +0000242 if (circuit->area)
243 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000244
jardineb5d44e2003-12-23 08:09:43 +0000245#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000246 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000247 zlog_debug ("Added IP address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000248 circuit->circuit_id);
249#endif /* EXTREME_DEBUG */
jardineb5d44e2003-12-23 08:09:43 +0000250 }
hassof390d2c2004-09-10 20:48:21 +0000251#ifdef HAVE_IPV6
hassof891f442004-09-14 13:54:30 +0000252 if (connected->address->family == AF_INET6)
hassof390d2c2004-09-10 20:48:21 +0000253 {
254 ipv6 = prefix_ipv6_new ();
hassof891f442004-09-14 13:54:30 +0000255 ipv6->prefixlen = connected->address->prefixlen;
256 ipv6->prefix = connected->address->u.prefix6;
257
hassof390d2c2004-09-10 20:48:21 +0000258 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
hassof891f442004-09-14 13:54:30 +0000259 listnode_add (circuit->ipv6_link, ipv6);
hassof390d2c2004-09-10 20:48:21 +0000260 else
hassof891f442004-09-14 13:54:30 +0000261 listnode_add (circuit->ipv6_non_link, ipv6);
hasso0dae85e2004-09-26 19:53:47 +0000262 if (circuit->area)
263 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000264
jardineb5d44e2003-12-23 08:09:43 +0000265#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000266 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000267 zlog_debug ("Added IPv6 address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000268 circuit->circuit_id);
269#endif /* EXTREME_DEBUG */
270 }
jardineb5d44e2003-12-23 08:09:43 +0000271#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000272 return;
273}
274
275void
276isis_circuit_del_addr (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000277 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000278{
hassof891f442004-09-14 13:54:30 +0000279 struct prefix_ipv4 *ipv4, *ip = NULL;
280 struct listnode *node;
281 int found = 0;
282 u_char buf[BUFSIZ];
283#ifdef HAVE_IPV6
284 struct prefix_ipv6 *ipv6, *ip6 = NULL;
285#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000286
hassof891f442004-09-14 13:54:30 +0000287 memset (&buf, 0, BUFSIZ);
288 if (connected->address->family == AF_INET)
289 {
290 ipv4 = prefix_ipv4_new ();
291 ipv4->prefixlen = connected->address->prefixlen;
292 ipv4->prefix = connected->address->u.prefix4;
293
paul1eb8ef22005-04-07 07:30:20 +0000294 for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip))
295 if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4))
296 break;
hassof891f442004-09-14 13:54:30 +0000297
298 if (ip)
299 {
300 listnode_delete (circuit->ip_addrs, ip);
hasso0dae85e2004-09-26 19:53:47 +0000301 if (circuit->area)
302 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000303 }
304 else
305 {
hassof7c43dc2004-09-26 16:24:14 +0000306 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000307 zlog_warn("Nonexitant ip address %s removal attempt from circuit \
308 %d", buf, circuit->circuit_id);
309 }
310 }
311#ifdef HAVE_IPV6
312 if (connected->address->family == AF_INET6)
313 {
314 ipv6 = prefix_ipv6_new ();
315 ipv6->prefixlen = connected->address->prefixlen;
316 ipv6->prefix = connected->address->u.prefix6;
317
318 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
319 {
paul1eb8ef22005-04-07 07:30:20 +0000320 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_link, node, ip6))
hassof891f442004-09-14 13:54:30 +0000321 {
hassof891f442004-09-14 13:54:30 +0000322 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
323 break;
324 }
325 if (ip6)
326 {
327 listnode_delete (circuit->ipv6_link, ip6);
328 found = 1;
329 }
330 }
331 else
332 {
paul1eb8ef22005-04-07 07:30:20 +0000333 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_non_link, node, ip6))
hassof891f442004-09-14 13:54:30 +0000334 {
hassof891f442004-09-14 13:54:30 +0000335 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
336 break;
337 }
338 if (ip6)
339 {
340 listnode_delete (circuit->ipv6_non_link, ip6);
341 found = 1;
342 }
343 }
344
345 if (!found)
346 {
hassof7c43dc2004-09-26 16:24:14 +0000347 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000348 zlog_warn("Nonexitant ip address %s removal attempt from \
349 circuit %d", buf, circuit->circuit_id);
350 }
351 else
hasso0dae85e2004-09-26 19:53:47 +0000352 if (circuit->area)
353 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000354 }
355#endif /* HAVE_IPV6 */
356 return;
jardineb5d44e2003-12-23 08:09:43 +0000357}
358
359void
360isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
361{
paul1eb8ef22005-04-07 07:30:20 +0000362 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000363 struct connected *conn;
364
365 circuit->interface = ifp;
366 ifp->info = circuit;
hassof390d2c2004-09-10 20:48:21 +0000367
368 circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */
jardineb5d44e2003-12-23 08:09:43 +0000369
370 /* isis_circuit_update_addrs (circuit, ifp); */
371
hassof390d2c2004-09-10 20:48:21 +0000372 if (if_is_broadcast (ifp))
373 {
374 circuit->circ_type = CIRCUIT_T_BROADCAST;
375 /*
376 * Get the Hardware Address
377 */
jardineb5d44e2003-12-23 08:09:43 +0000378#ifdef HAVE_SOCKADDR_DL
hassof390d2c2004-09-10 20:48:21 +0000379 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
380 zlog_warn ("unsupported link layer");
381 else
382 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl),
383 ETH_ALEN);
jardineb5d44e2003-12-23 08:09:43 +0000384#else
hassof390d2c2004-09-10 20:48:21 +0000385 if (circuit->interface->hw_addr_len != ETH_ALEN)
386 {
387 zlog_warn ("unsupported link layer");
388 }
389 else
390 {
391 memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN);
392 }
jardineb5d44e2003-12-23 08:09:43 +0000393#ifdef EXTREME_DEGUG
hasso529d65b2004-12-24 00:14:50 +0000394 zlog_debug ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
hassof390d2c2004-09-10 20:48:21 +0000395 circuit->interface->ifindex, ISO_MTU (circuit),
396 snpa_print (circuit->u.bc.snpa));
jardineb5d44e2003-12-23 08:09:43 +0000397
398#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000399#endif /* HAVE_SOCKADDR_DL */
400 }
401 else if (if_is_pointopoint (ifp))
402 {
403 circuit->circ_type = CIRCUIT_T_P2P;
404 }
405 else
406 {
407 zlog_warn ("isis_circuit_if_add: unsupported media");
408 }
409
paul1eb8ef22005-04-07 07:30:20 +0000410 for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, conn))
411 isis_circuit_add_addr (circuit, conn);
jardineb5d44e2003-12-23 08:09:43 +0000412
413 return;
414}
415
416void
hassof390d2c2004-09-10 20:48:21 +0000417isis_circuit_update_params (struct isis_circuit *circuit,
418 struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000419{
hassob30c5e62004-12-29 20:06:41 +0000420 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +0000421
422 if (circuit->circuit_id != ifp->ifindex)
423 {
424 zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
425 ifp->ifindex);
426 circuit->circuit_id = ifp->ifindex % 255;
427 }
jardineb5d44e2003-12-23 08:09:43 +0000428
429 /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
430 /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig)
431 The areas MTU is the minimum of mtu's of circuits in the area
432 now we can't catch the change
433 if (circuit->mtu != ifp->mtu) {
434 zlog_warn ("changing circuit mtu %d->%d", circuit->mtu,
435 ifp->mtu);
436 circuit->mtu = ifp->mtu;
437 }
hassof390d2c2004-09-10 20:48:21 +0000438 */
jardineb5d44e2003-12-23 08:09:43 +0000439 /*
440 * Get the Hardware Address
441 */
442#ifdef HAVE_SOCKADDR_DL
443 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
jardineb5d44e2003-12-23 08:09:43 +0000444 zlog_warn ("unsupported link layer");
hassof390d2c2004-09-10 20:48:21 +0000445 else
446 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), ETH_ALEN);
447#else
448 if (circuit->interface->hw_addr_len != ETH_ALEN)
449 {
450 zlog_warn ("unsupported link layer");
jardineb5d44e2003-12-23 08:09:43 +0000451 }
hassof390d2c2004-09-10 20:48:21 +0000452 else
453 {
454 if (memcmp (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN))
455 {
456 zlog_warn ("changing circuit snpa %s->%s",
457 snpa_print (circuit->u.bc.snpa),
458 snpa_print (circuit->interface->hw_addr));
459 }
460 }
461#endif
jardineb5d44e2003-12-23 08:09:43 +0000462
hassof390d2c2004-09-10 20:48:21 +0000463 if (if_is_broadcast (ifp))
464 {
465 circuit->circ_type = CIRCUIT_T_BROADCAST;
466 }
467 else if (if_is_pointopoint (ifp))
468 {
469 circuit->circ_type = CIRCUIT_T_P2P;
470 }
471 else
472 {
473 zlog_warn ("isis_circuit_update_params: unsupported media");
474 }
jardineb5d44e2003-12-23 08:09:43 +0000475
jardineb5d44e2003-12-23 08:09:43 +0000476 return;
477}
478
479void
hassof390d2c2004-09-10 20:48:21 +0000480isis_circuit_if_del (struct isis_circuit *circuit)
jardineb5d44e2003-12-23 08:09:43 +0000481{
482 circuit->interface->info = NULL;
483 circuit->interface = NULL;
hassof390d2c2004-09-10 20:48:21 +0000484
jardineb5d44e2003-12-23 08:09:43 +0000485 return;
486}
487
488void
489isis_circuit_up (struct isis_circuit *circuit)
490{
jardineb5d44e2003-12-23 08:09:43 +0000491
hassof390d2c2004-09-10 20:48:21 +0000492 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
493 {
494 if (circuit->area->min_bcast_mtu == 0 ||
495 ISO_MTU (circuit) < circuit->area->min_bcast_mtu)
496 circuit->area->min_bcast_mtu = ISO_MTU (circuit);
497 /*
498 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
499 */
jardineb5d44e2003-12-23 08:09:43 +0000500
hassof390d2c2004-09-10 20:48:21 +0000501 /* initilizing the hello sending threads
502 * for a broadcast IF
503 */
jardineb5d44e2003-12-23 08:09:43 +0000504
hassof390d2c2004-09-10 20:48:21 +0000505 /* 8.4.1 a) commence sending of IIH PDUs */
506
507 if (circuit->circuit_is_type & IS_LEVEL_1)
508 {
509 thread_add_event (master, send_lan_l1_hello, circuit, 0);
510 circuit->u.bc.lan_neighs[0] = list_new ();
511 }
512
513 if (circuit->circuit_is_type & IS_LEVEL_2)
514 {
515 thread_add_event (master, send_lan_l2_hello, circuit, 0);
516 circuit->u.bc.lan_neighs[1] = list_new ();
517 }
518
519 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
520 /* 8.4.1 c) FIXME: listen for ESH PDUs */
521
522 /* 8.4.1 d) */
523 /* dr election will commence in... */
524 if (circuit->circuit_is_type & IS_LEVEL_1)
525 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
hassobf731012004-09-17 07:59:57 +0000526 circuit, 2 * circuit->hello_interval[0]);
hassof390d2c2004-09-10 20:48:21 +0000527 if (circuit->circuit_is_type & IS_LEVEL_2)
528 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
hassobf731012004-09-17 07:59:57 +0000529 circuit, 2 * circuit->hello_interval[1]);
jardineb5d44e2003-12-23 08:09:43 +0000530 }
hassof390d2c2004-09-10 20:48:21 +0000531 else
532 {
533 /* initializing the hello send threads
534 * for a ptp IF
535 */
536 thread_add_event (master, send_p2p_hello, circuit, 0);
jardineb5d44e2003-12-23 08:09:43 +0000537
jardineb5d44e2003-12-23 08:09:43 +0000538 }
539
jardineb5d44e2003-12-23 08:09:43 +0000540 /* initializing PSNP timers */
hassof390d2c2004-09-10 20:48:21 +0000541 if (circuit->circuit_is_type & IS_LEVEL_1)
542 {
543 THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
544 isis_jitter (circuit->psnp_interval[0], PSNP_JITTER));
545 }
546
547 if (circuit->circuit_is_type & IS_LEVEL_2)
548 {
549 THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
550 isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
551 }
552
jardineb5d44e2003-12-23 08:09:43 +0000553 /* initialize the circuit streams */
554 if (circuit->rcv_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000555 circuit->rcv_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000556
557 if (circuit->snd_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000558 circuit->snd_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000559
560 /* unified init for circuits */
561 isis_sock_init (circuit);
562
563#ifdef GNU_LINUX
hassof390d2c2004-09-10 20:48:21 +0000564 THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
565 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000566#else
hassof390d2c2004-09-10 20:48:21 +0000567 THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
568 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000569#endif
570 return;
571}
572
573void
574isis_circuit_down (struct isis_circuit *circuit)
575{
hassof390d2c2004-09-10 20:48:21 +0000576 /* Cancel all active threads -- FIXME: wrong place */
hassod70f99e2004-02-11 20:26:31 +0000577 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
hassof390d2c2004-09-10 20:48:21 +0000578 THREAD_OFF (circuit->t_read);
579 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
580 {
581 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
582 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
hassof891f442004-09-14 13:54:30 +0000583 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
584 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
hassof390d2c2004-09-10 20:48:21 +0000585 }
586 else if (circuit->circ_type == CIRCUIT_T_P2P)
587 {
588 THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
589 }
jardineb5d44e2003-12-23 08:09:43 +0000590 /* close the socket */
591 close (circuit->fd);
592
593 return;
594}
595
596void
597circuit_update_nlpids (struct isis_circuit *circuit)
598{
599 circuit->nlpids.count = 0;
hassof390d2c2004-09-10 20:48:21 +0000600
601 if (circuit->ip_router)
602 {
603 circuit->nlpids.nlpids[0] = NLPID_IP;
604 circuit->nlpids.count++;
605 }
jardineb5d44e2003-12-23 08:09:43 +0000606#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000607 if (circuit->ipv6_router)
608 {
609 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
610 circuit->nlpids.count++;
611 }
jardineb5d44e2003-12-23 08:09:43 +0000612#endif /* HAVE_IPV6 */
613 return;
614}
615
616int
hassof390d2c2004-09-10 20:48:21 +0000617isis_interface_config_write (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000618{
619
620 int write = 0;
paul1eb8ef22005-04-07 07:30:20 +0000621 struct listnode *node, *nnode;
622 struct listnode *node2, *nnode2;
jardineb5d44e2003-12-23 08:09:43 +0000623 struct interface *ifp;
624 struct isis_area *area;
625 struct isis_circuit *c;
jardineb5d44e2003-12-23 08:09:43 +0000626 int i;
jardineb5d44e2003-12-23 08:09:43 +0000627
paul1eb8ef22005-04-07 07:30:20 +0000628 for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
jardineb5d44e2003-12-23 08:09:43 +0000629 {
630 /* IF name */
hassof390d2c2004-09-10 20:48:21 +0000631 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000632 write++;
633 /* IF desc */
hassof390d2c2004-09-10 20:48:21 +0000634 if (ifp->desc)
635 {
636 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
637 write++;
638 }
jardineb5d44e2003-12-23 08:09:43 +0000639 /* ISIS Circuit */
paul1eb8ef22005-04-07 07:30:20 +0000640 for (ALL_LIST_ELEMENTS (isis->area_list, node2, nnode2, area))
jardineb5d44e2003-12-23 08:09:43 +0000641 {
642 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000643 if (c)
644 {
645 if (c->ip_router)
646 {
647 vty_out (vty, " ip router isis %s%s", area->area_tag,
648 VTY_NEWLINE);
649 write++;
650 }
jardineb5d44e2003-12-23 08:09:43 +0000651#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000652 if (c->ipv6_router)
653 {
654 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
655 VTY_NEWLINE);
656 write++;
657 }
jardineb5d44e2003-12-23 08:09:43 +0000658#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000659
hassof390d2c2004-09-10 20:48:21 +0000660 /* ISIS - circuit type */
661 if (c->circuit_is_type == IS_LEVEL_1)
662 {
663 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
664 write++;
665 }
666 else
667 {
668 if (c->circuit_is_type == IS_LEVEL_2)
669 {
670 vty_out (vty, " isis circuit-type level-2-only%s",
671 VTY_NEWLINE);
672 write++;
673 }
674 }
jardineb5d44e2003-12-23 08:09:43 +0000675
hassof390d2c2004-09-10 20:48:21 +0000676 /* ISIS - CSNP interval - FIXME: compare to cisco */
677 if (c->csnp_interval[0] == c->csnp_interval[1])
678 {
679 if (c->csnp_interval[0] != CSNP_INTERVAL)
680 {
681 vty_out (vty, " isis csnp-interval %d%s",
682 c->csnp_interval[0], VTY_NEWLINE);
683 write++;
684 }
685 }
686 else
687 {
688 for (i = 0; i < 2; i++)
689 {
690 if (c->csnp_interval[1] != CSNP_INTERVAL)
691 {
692 vty_out (vty, " isis csnp-interval %d level-%d%s",
693 c->csnp_interval[1], i + 1, VTY_NEWLINE);
694 write++;
695 }
696 }
697 }
jardineb5d44e2003-12-23 08:09:43 +0000698
hassof390d2c2004-09-10 20:48:21 +0000699 /* ISIS - Hello padding - Defaults to true so only display if false */
700 if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos)
701 {
702 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
703 write++;
704 }
jardineb5d44e2003-12-23 08:09:43 +0000705
hassof390d2c2004-09-10 20:48:21 +0000706 /* ISIS - Hello interval - FIXME: compare to cisco */
707 if (c->hello_interval[0] == c->hello_interval[1])
708 {
709 if (c->hello_interval[0] != HELLO_INTERVAL)
710 {
711 vty_out (vty, " isis hello-interval %d%s",
712 c->hello_interval[0], VTY_NEWLINE);
713 write++;
714 }
715 }
716 else
717 {
718 for (i = 0; i < 2; i++)
719 {
720 if (c->hello_interval[i] != HELLO_INTERVAL)
721 {
722 if (c->hello_interval[i] == HELLO_MINIMAL)
723 {
724 vty_out (vty,
725 " isis hello-interval minimal level-%d%s",
726 i + 1, VTY_NEWLINE);
727 }
728 else
729 {
730 vty_out (vty, " isis hello-interval %d level-%d%s",
731 c->hello_interval[i], i + 1, VTY_NEWLINE);
732 }
733 write++;
734 }
735 }
736 }
jardineb5d44e2003-12-23 08:09:43 +0000737
hassof390d2c2004-09-10 20:48:21 +0000738 /* ISIS - Hello Multiplier */
739 if (c->hello_multiplier[0] == c->hello_multiplier[1])
740 {
741 if (c->hello_multiplier[0] != HELLO_MULTIPLIER)
742 {
743 vty_out (vty, " isis hello-multiplier %d%s",
744 c->hello_multiplier[0], VTY_NEWLINE);
745 write++;
746 }
747 }
748 else
749 {
750 for (i = 0; i < 2; i++)
751 {
752 if (c->hello_multiplier[i] != HELLO_MULTIPLIER)
753 {
754 vty_out (vty, " isis hello-multiplier %d level-%d%s",
755 c->hello_multiplier[i], i + 1, VTY_NEWLINE);
756 write++;
757 }
758 }
759 }
760 /* ISIS - Priority */
761 if (c->circ_type == CIRCUIT_T_BROADCAST)
762 {
763 if (c->u.bc.priority[0] == c->u.bc.priority[1])
764 {
765 if (c->u.bc.priority[0] != DEFAULT_PRIORITY)
766 {
767 vty_out (vty, " isis priority %d%s",
768 c->u.bc.priority[0], VTY_NEWLINE);
769 write++;
770 }
771 }
772 else
773 {
774 for (i = 0; i < 2; i++)
775 {
776 if (c->u.bc.priority[i] != DEFAULT_PRIORITY)
777 {
778 vty_out (vty, " isis priority %d level-%d%s",
779 c->u.bc.priority[i], i + 1, VTY_NEWLINE);
780 write++;
781 }
782 }
783 }
784 }
785 /* ISIS - Metric */
786 if (c->metrics[0].metric_default == c->metrics[1].metric_default)
787 {
788 if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS)
789 {
790 vty_out (vty, " isis metric %d%s",
791 c->metrics[0].metric_default, VTY_NEWLINE);
792 write++;
793 }
794 }
795 else
796 {
797 for (i = 0; i < 2; i++)
798 {
799 if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS)
800 {
801 vty_out (vty, " isis metric %d level-%d%s",
802 c->metrics[i].metric_default, i + 1,
803 VTY_NEWLINE);
804 write++;
805 }
806 }
807 }
jardineb5d44e2003-12-23 08:09:43 +0000808
hassof390d2c2004-09-10 20:48:21 +0000809 }
jardineb5d44e2003-12-23 08:09:43 +0000810 }
hassof390d2c2004-09-10 20:48:21 +0000811 vty_out (vty, "!%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000812 }
hassof390d2c2004-09-10 20:48:21 +0000813
jardineb5d44e2003-12-23 08:09:43 +0000814 return write;
815}
jardineb5d44e2003-12-23 08:09:43 +0000816
817DEFUN (ip_router_isis,
818 ip_router_isis_cmd,
819 "ip router isis WORD",
820 "Interface Internet Protocol config commands\n"
821 "IP router interface commands\n"
822 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000823 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000824{
825 struct isis_circuit *c;
826 struct interface *ifp;
827 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000828
829 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000830 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000831
jardineb5d44e2003-12-23 08:09:43 +0000832 area = isis_area_lookup (argv[0]);
833
834 /* Prevent more than one circuit per interface */
835 if (area)
836 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000837 else
838 c = NULL;
839 if (c && (ifp->info != NULL))
840 {
jardineb5d44e2003-12-23 08:09:43 +0000841#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000842 if (c->ipv6_router == 0)
843 {
jardineb5d44e2003-12-23 08:09:43 +0000844#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000845 vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE);
846 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000847#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000848 }
849#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000850 }
hassof390d2c2004-09-10 20:48:21 +0000851
jardineb5d44e2003-12-23 08:09:43 +0000852 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +0000853 if (!area)
854 {
855 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
856 return CMD_WARNING;
857 }
jardineb5d44e2003-12-23 08:09:43 +0000858
hassof390d2c2004-09-10 20:48:21 +0000859 if (!c)
860 {
861 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
862 c = isis_csm_state_change (ISIS_ENABLE, c, area);
863 c->interface = ifp; /* this is automatic */
864 ifp->info = c; /* hardly related to the FSM */
865 }
jardineb5d44e2003-12-23 08:09:43 +0000866
hassof390d2c2004-09-10 20:48:21 +0000867 if (!c)
jardineb5d44e2003-12-23 08:09:43 +0000868 return CMD_WARNING;
869
870 c->ip_router = 1;
871 area->ip_circuits++;
872 circuit_update_nlpids (c);
873
874 vty->node = INTERFACE_NODE;
hassof390d2c2004-09-10 20:48:21 +0000875
jardineb5d44e2003-12-23 08:09:43 +0000876 return CMD_SUCCESS;
877}
878
879DEFUN (no_ip_router_isis,
880 no_ip_router_isis_cmd,
881 "no ip router isis WORD",
882 NO_STR
883 "Interface Internet Protocol config commands\n"
884 "IP router interface commands\n"
885 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000886 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000887{
888 struct isis_circuit *circuit = NULL;
889 struct interface *ifp;
890 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000891 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000892
hassof390d2c2004-09-10 20:48:21 +0000893 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000894 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000895
jardineb5d44e2003-12-23 08:09:43 +0000896 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +0000897 if (!area)
898 {
899 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
900 return CMD_WARNING;
901 }
paul1eb8ef22005-04-07 07:30:20 +0000902 for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
jardineb5d44e2003-12-23 08:09:43 +0000903 if (circuit->interface == ifp)
904 break;
hassof390d2c2004-09-10 20:48:21 +0000905 if (!circuit)
906 {
907 vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE);
908 return CMD_WARNING;
909 }
jardineb5d44e2003-12-23 08:09:43 +0000910 circuit->ip_router = 0;
911 area->ip_circuits--;
912#ifdef HAVE_IPV6
913 if (circuit->ipv6_router == 0)
914#endif
915 isis_csm_state_change (ISIS_DISABLE, circuit, area);
hassof390d2c2004-09-10 20:48:21 +0000916
jardineb5d44e2003-12-23 08:09:43 +0000917 return CMD_SUCCESS;
918}
919
920DEFUN (isis_circuit_type,
921 isis_circuit_type_cmd,
922 "isis circuit-type (level-1|level-1-2|level-2-only)",
923 "IS-IS commands\n"
924 "Configure circuit type for interface\n"
925 "Level-1 only adjacencies are formed\n"
926 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000927 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000928{
929 struct isis_circuit *circuit;
930 struct interface *ifp;
931 int circuit_t;
932 int is_type;
hassof390d2c2004-09-10 20:48:21 +0000933
934 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000935 circuit = ifp->info;
936 /* UGLY - will remove l8r */
hassof390d2c2004-09-10 20:48:21 +0000937 if (circuit == NULL)
938 {
939 return CMD_WARNING;
940 }
jardineb5d44e2003-12-23 08:09:43 +0000941
hasso13c48f72004-09-10 21:19:13 +0000942 /* XXX what to do when ip_router_isis is not executed */
943 if (circuit->area == NULL)
944 return CMD_WARNING;
945
jardineb5d44e2003-12-23 08:09:43 +0000946 assert (circuit);
947
hassof7c43dc2004-09-26 16:24:14 +0000948 circuit_t = string2circuit_t ((u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000949
hassof390d2c2004-09-10 20:48:21 +0000950 if (!circuit_t)
951 {
952 vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
953 return CMD_SUCCESS;
954 }
955
jardineb5d44e2003-12-23 08:09:43 +0000956 is_type = circuit->area->is_type;
957 if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t)
hassof390d2c2004-09-10 20:48:21 +0000958 isis_event_circuit_type_change (circuit, circuit_t);
959 else
960 {
961 vty_out (vty, "invalid circuit level for area %s.%s",
962 circuit->area->area_tag, VTY_NEWLINE);
963 }
964
jardineb5d44e2003-12-23 08:09:43 +0000965 return CMD_SUCCESS;
966}
967
968DEFUN (no_isis_circuit_type,
969 no_isis_circuit_type_cmd,
970 "no isis circuit-type (level-1|level-1-2|level-2-only)",
971 NO_STR
972 "IS-IS commands\n"
973 "Configure circuit type for interface\n"
974 "Level-1 only adjacencies are formed\n"
975 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000976 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000977{
978 struct isis_circuit *circuit;
979 struct interface *ifp;
jardineb5d44e2003-12-23 08:09:43 +0000980
hassof390d2c2004-09-10 20:48:21 +0000981 ifp = vty->index;
982 circuit = ifp->info;
983 if (circuit == NULL)
984 {
985 return CMD_WARNING;
986 }
987
988 assert (circuit);
989
jardineb5d44e2003-12-23 08:09:43 +0000990 /*
991 * Set the circuits level to its default value which is that of the area
992 */
993 isis_event_circuit_type_change (circuit, circuit->area->is_type);
hassof390d2c2004-09-10 20:48:21 +0000994
jardineb5d44e2003-12-23 08:09:43 +0000995 return CMD_SUCCESS;
996}
997
998DEFUN (isis_passwd,
999 isis_passwd_cmd,
1000 "isis password WORD",
1001 "IS-IS commands\n"
1002 "Configure the authentication password for interface\n"
1003 "Password\n")
1004{
1005 struct isis_circuit *circuit;
1006 struct interface *ifp;
1007 int len;
hassof390d2c2004-09-10 20:48:21 +00001008
1009 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001010 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001011 if (circuit == NULL)
1012 {
1013 return CMD_WARNING;
1014 }
1015
jardineb5d44e2003-12-23 08:09:43 +00001016 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001017 if (len > 254)
1018 {
1019 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
1020 return CMD_WARNING;
1021 }
jardineb5d44e2003-12-23 08:09:43 +00001022 circuit->passwd.len = len;
1023 circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001024 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001025
jardineb5d44e2003-12-23 08:09:43 +00001026 return CMD_SUCCESS;
1027}
1028
1029DEFUN (no_isis_passwd,
1030 no_isis_passwd_cmd,
1031 "no isis password",
1032 NO_STR
1033 "IS-IS commands\n"
1034 "Configure the authentication password for interface\n")
1035{
1036 struct isis_circuit *circuit;
1037 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001038
1039 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001040 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001041 if (circuit == NULL)
1042 {
1043 return CMD_WARNING;
1044 }
1045
jardineb5d44e2003-12-23 08:09:43 +00001046 memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001047
jardineb5d44e2003-12-23 08:09:43 +00001048 return CMD_SUCCESS;
1049}
1050
1051
1052DEFUN (isis_priority,
1053 isis_priority_cmd,
1054 "isis priority <0-127>",
1055 "IS-IS commands\n"
1056 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001057 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001058{
1059 struct isis_circuit *circuit;
1060 struct interface *ifp;
1061 int prio;
hassof390d2c2004-09-10 20:48:21 +00001062
1063 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001064 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001065 if (circuit == NULL)
1066 {
1067 return CMD_WARNING;
1068 }
jardineb5d44e2003-12-23 08:09:43 +00001069 assert (circuit);
1070
1071 prio = atoi (argv[0]);
1072
1073 circuit->u.bc.priority[0] = prio;
1074 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001075
jardineb5d44e2003-12-23 08:09:43 +00001076 return CMD_SUCCESS;
1077}
1078
1079DEFUN (no_isis_priority,
1080 no_isis_priority_cmd,
1081 "no isis priority",
1082 NO_STR
1083 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001084 "Set priority for Designated Router election\n")
jardineb5d44e2003-12-23 08:09:43 +00001085{
1086 struct isis_circuit *circuit;
1087 struct interface *ifp;
1088
hassof390d2c2004-09-10 20:48:21 +00001089 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001090 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001091 if (circuit == NULL)
1092 {
1093 return CMD_WARNING;
1094 }
jardineb5d44e2003-12-23 08:09:43 +00001095 assert (circuit);
1096
1097 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
1098 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001099
jardineb5d44e2003-12-23 08:09:43 +00001100 return CMD_SUCCESS;
1101}
1102
1103ALIAS (no_isis_priority,
1104 no_isis_priority_arg_cmd,
1105 "no isis priority <0-127>",
1106 NO_STR
1107 "IS-IS commands\n"
1108 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001109 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001110
1111DEFUN (isis_priority_l1,
1112 isis_priority_l1_cmd,
hassof390d2c2004-09-10 20:48:21 +00001113 "isis priority <0-127> level-1",
jardineb5d44e2003-12-23 08:09:43 +00001114 "IS-IS commands\n"
1115 "Set priority for Designated Router election\n"
1116 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001117 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001118{
1119 struct isis_circuit *circuit;
1120 struct interface *ifp;
1121 int prio;
hassof390d2c2004-09-10 20:48:21 +00001122
1123 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001124 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001125 if (circuit == NULL)
1126 {
1127 return CMD_WARNING;
1128 }
jardineb5d44e2003-12-23 08:09:43 +00001129 assert (circuit);
1130
1131 prio = atoi (argv[0]);
1132
1133 circuit->u.bc.priority[0] = prio;
hassof390d2c2004-09-10 20:48:21 +00001134
jardineb5d44e2003-12-23 08:09:43 +00001135 return CMD_SUCCESS;
1136}
1137
1138DEFUN (no_isis_priority_l1,
1139 no_isis_priority_l1_cmd,
1140 "no isis priority level-1",
1141 NO_STR
1142 "IS-IS commands\n"
1143 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001144 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001145{
1146 struct isis_circuit *circuit;
1147 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001148
1149 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001150 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001151 if (circuit == NULL)
1152 {
1153 return CMD_WARNING;
1154 }
jardineb5d44e2003-12-23 08:09:43 +00001155 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001156
jardineb5d44e2003-12-23 08:09:43 +00001157 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001158
jardineb5d44e2003-12-23 08:09:43 +00001159 return CMD_SUCCESS;
1160}
1161
1162ALIAS (no_isis_priority_l1,
1163 no_isis_priority_l1_arg_cmd,
1164 "no isis priority <0-127> level-1",
1165 NO_STR
1166 "IS-IS commands\n"
1167 "Set priority for Designated Router election\n"
1168 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001169 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001170
1171DEFUN (isis_priority_l2,
1172 isis_priority_l2_cmd,
hassof390d2c2004-09-10 20:48:21 +00001173 "isis priority <0-127> level-2",
jardineb5d44e2003-12-23 08:09:43 +00001174 "IS-IS commands\n"
1175 "Set priority for Designated Router election\n"
1176 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001177 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001178{
1179 struct isis_circuit *circuit;
1180 struct interface *ifp;
1181 int prio;
hassof390d2c2004-09-10 20:48:21 +00001182
1183 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001184 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001185 if (circuit == NULL)
1186 {
1187 return CMD_WARNING;
1188 }
jardineb5d44e2003-12-23 08:09:43 +00001189 assert (circuit);
1190
1191 prio = atoi (argv[0]);
1192
1193 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001194
jardineb5d44e2003-12-23 08:09:43 +00001195 return CMD_SUCCESS;
1196}
1197
1198DEFUN (no_isis_priority_l2,
1199 no_isis_priority_l2_cmd,
1200 "no isis priority level-2",
1201 NO_STR
1202 "IS-IS commands\n"
1203 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001204 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001205{
1206 struct isis_circuit *circuit;
1207 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001208
1209 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001210 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001211 if (circuit == NULL)
1212 {
1213 return CMD_WARNING;
1214 }
jardineb5d44e2003-12-23 08:09:43 +00001215 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001216
jardineb5d44e2003-12-23 08:09:43 +00001217 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001218
jardineb5d44e2003-12-23 08:09:43 +00001219 return CMD_SUCCESS;
1220}
1221
1222ALIAS (no_isis_priority_l2,
1223 no_isis_priority_l2_arg_cmd,
1224 "no isis priority <0-127> level-2",
1225 NO_STR
1226 "IS-IS commands\n"
1227 "Set priority for Designated Router election\n"
1228 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001229 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001230
1231/* Metric command */
hassof390d2c2004-09-10 20:48:21 +00001232 DEFUN (isis_metric,
jardineb5d44e2003-12-23 08:09:43 +00001233 isis_metric_cmd,
1234 "isis metric <0-63>",
1235 "IS-IS commands\n"
1236 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001237 "Default metric value\n")
jardineb5d44e2003-12-23 08:09:43 +00001238{
1239 struct isis_circuit *circuit;
1240 struct interface *ifp;
1241 int met;
1242
hassof390d2c2004-09-10 20:48:21 +00001243 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001244 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001245 if (circuit == NULL)
1246 {
1247 return CMD_WARNING;
1248 }
jardineb5d44e2003-12-23 08:09:43 +00001249 assert (circuit);
1250
1251 met = atoi (argv[0]);
1252
1253 circuit->metrics[0].metric_default = met;
1254 circuit->metrics[1].metric_default = met;
1255
1256 return CMD_SUCCESS;
1257}
1258
1259DEFUN (no_isis_metric,
1260 no_isis_metric_cmd,
1261 "no isis metric",
1262 NO_STR
1263 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001264 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001265{
1266 struct isis_circuit *circuit;
1267 struct interface *ifp;
1268
hassof390d2c2004-09-10 20:48:21 +00001269 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001270 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001271 if (circuit == NULL)
1272 {
1273 return CMD_WARNING;
1274 }
jardineb5d44e2003-12-23 08:09:43 +00001275 assert (circuit);
1276
1277 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1278 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1279
1280 return CMD_SUCCESS;
1281}
1282
1283ALIAS (no_isis_metric,
1284 no_isis_metric_arg_cmd,
1285 "no isis metric <0-127>",
1286 NO_STR
1287 "IS-IS commands\n"
1288 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001289 "Default metric value\n")
1290
jardineb5d44e2003-12-23 08:09:43 +00001291/* end of metrics */
hassof390d2c2004-09-10 20:48:21 +00001292 DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00001293 isis_hello_interval_cmd,
1294 "isis hello-interval (<1-65535>|minimal)",
1295 "IS-IS commands\n"
1296 "Set Hello interval\n"
1297 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001298 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001299{
1300 struct isis_circuit *circuit;
1301 struct interface *ifp;
1302 int interval;
1303 char c;
1304
hassof390d2c2004-09-10 20:48:21 +00001305 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001306 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001307 if (circuit == NULL)
1308 {
1309 return CMD_WARNING;
1310 }
1311 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001312 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001313 if (isdigit ((int) c))
1314 {
1315 interval = atoi (argv[0]);
1316 }
1317 else
1318 interval = HELLO_MINIMAL; /* FIXME: should be calculated */
jardineb5d44e2003-12-23 08:09:43 +00001319
hassof390d2c2004-09-10 20:48:21 +00001320 circuit->hello_interval[0] = (u_int16_t) interval;
1321 circuit->hello_interval[1] = (u_int16_t) interval;
1322
jardineb5d44e2003-12-23 08:09:43 +00001323 return CMD_SUCCESS;
1324}
1325
1326DEFUN (no_isis_hello_interval,
1327 no_isis_hello_interval_cmd,
1328 "no isis hello-interval",
1329 NO_STR
1330 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001331 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00001332{
1333 struct isis_circuit *circuit;
1334 struct interface *ifp;
1335
hassof390d2c2004-09-10 20:48:21 +00001336 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001337 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001338 if (circuit == NULL)
1339 {
1340 return CMD_WARNING;
1341 }
jardineb5d44e2003-12-23 08:09:43 +00001342 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001343
hassof390d2c2004-09-10 20:48:21 +00001344
1345 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
jardineb5d44e2003-12-23 08:09:43 +00001346 circuit->hello_interval[1] = HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001347
jardineb5d44e2003-12-23 08:09:43 +00001348 return CMD_SUCCESS;
1349}
1350
1351ALIAS (no_isis_hello_interval,
1352 no_isis_hello_interval_arg_cmd,
1353 "no isis hello-interval (<1-65535>|minimal)",
1354 NO_STR
1355 "IS-IS commands\n"
1356 "Set Hello interval\n"
1357 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001358 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001359
1360DEFUN (isis_hello_interval_l1,
1361 isis_hello_interval_l1_cmd,
1362 "isis hello-interval (<1-65535>|minimal) level-1",
1363 "IS-IS commands\n"
1364 "Set Hello interval\n"
1365 "Hello interval value\n"
1366 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001367 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001368{
1369 struct isis_circuit *circuit;
1370 struct interface *ifp;
1371 long interval;
1372 char c;
1373
hassof390d2c2004-09-10 20:48:21 +00001374 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001375 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001376 if (circuit == NULL)
1377 {
1378 return CMD_WARNING;
1379 }
jardineb5d44e2003-12-23 08:09:43 +00001380 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001381
jardineb5d44e2003-12-23 08:09:43 +00001382 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001383 if (isdigit ((int) c))
1384 {
1385 interval = atoi (argv[0]);
1386 }
1387 else
jardineb5d44e2003-12-23 08:09:43 +00001388 interval = HELLO_MINIMAL;
1389
hassof390d2c2004-09-10 20:48:21 +00001390 circuit->hello_interval[0] = (u_int16_t) interval;
1391
jardineb5d44e2003-12-23 08:09:43 +00001392 return CMD_SUCCESS;
1393}
1394
1395DEFUN (no_isis_hello_interval_l1,
1396 no_isis_hello_interval_l1_cmd,
1397 "no isis hello-interval level-1",
1398 NO_STR
1399 "IS-IS commands\n"
1400 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001401 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001402{
1403 struct isis_circuit *circuit;
1404 struct interface *ifp;
1405
hassof390d2c2004-09-10 20:48:21 +00001406 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001407 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001408 if (circuit == NULL)
1409 {
1410 return CMD_WARNING;
1411 }
jardineb5d44e2003-12-23 08:09:43 +00001412 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001413
hassof390d2c2004-09-10 20:48:21 +00001414
1415 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1416
jardineb5d44e2003-12-23 08:09:43 +00001417 return CMD_SUCCESS;
1418}
1419
1420ALIAS (no_isis_hello_interval_l1,
1421 no_isis_hello_interval_l1_arg_cmd,
1422 "no isis hello-interval (<1-65535>|minimal) level-1",
1423 NO_STR
1424 "IS-IS commands\n"
1425 "Set Hello interval\n"
1426 "Hello interval value\n"
1427 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001428 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001429
1430DEFUN (isis_hello_interval_l2,
1431 isis_hello_interval_l2_cmd,
1432 "isis hello-interval (<1-65535>|minimal) level-2",
1433 "IS-IS commands\n"
1434 "Set Hello interval\n"
1435 "Hello interval value\n"
1436 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001437 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001438{
1439 struct isis_circuit *circuit;
1440 struct interface *ifp;
1441 long interval;
1442 char c;
1443
hassof390d2c2004-09-10 20:48:21 +00001444 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001445 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001446 if (circuit == NULL)
1447 {
1448 return CMD_WARNING;
1449 }
jardineb5d44e2003-12-23 08:09:43 +00001450 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001451
jardineb5d44e2003-12-23 08:09:43 +00001452 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001453 if (isdigit ((int) c))
1454 {
1455 interval = atoi (argv[0]);
1456 }
1457 else
jardineb5d44e2003-12-23 08:09:43 +00001458 interval = HELLO_MINIMAL;
1459
hassof390d2c2004-09-10 20:48:21 +00001460 circuit->hello_interval[1] = (u_int16_t) interval;
1461
jardineb5d44e2003-12-23 08:09:43 +00001462 return CMD_SUCCESS;
1463}
1464
1465DEFUN (no_isis_hello_interval_l2,
1466 no_isis_hello_interval_l2_cmd,
1467 "no isis hello-interval level-2",
1468 NO_STR
1469 "IS-IS commands\n"
1470 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001471 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001472{
1473 struct isis_circuit *circuit;
1474 struct interface *ifp;
1475
hassof390d2c2004-09-10 20:48:21 +00001476 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001477 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001478 if (circuit == NULL)
1479 {
1480 return CMD_WARNING;
1481 }
jardineb5d44e2003-12-23 08:09:43 +00001482 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001483
hassof390d2c2004-09-10 20:48:21 +00001484
1485 circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1486
jardineb5d44e2003-12-23 08:09:43 +00001487 return CMD_SUCCESS;
1488}
1489
1490ALIAS (no_isis_hello_interval_l2,
1491 no_isis_hello_interval_l2_arg_cmd,
1492 "no isis hello-interval (<1-65535>|minimal) level-2",
1493 NO_STR
1494 "IS-IS commands\n"
1495 "Set Hello interval\n"
1496 "Hello interval value\n"
1497 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001498 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001499
1500DEFUN (isis_hello_multiplier,
1501 isis_hello_multiplier_cmd,
1502 "isis hello-multiplier <3-1000>",
1503 "IS-IS commands\n"
1504 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001505 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001506{
1507 struct isis_circuit *circuit;
1508 struct interface *ifp;
1509 int mult;
hassof390d2c2004-09-10 20:48:21 +00001510
1511 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001512 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001513 if (circuit == NULL)
1514 {
1515 return CMD_WARNING;
1516 }
jardineb5d44e2003-12-23 08:09:43 +00001517 assert (circuit);
1518
1519 mult = atoi (argv[0]);
1520
hassof390d2c2004-09-10 20:48:21 +00001521 circuit->hello_multiplier[0] = (u_int16_t) mult;
1522 circuit->hello_multiplier[1] = (u_int16_t) mult;
1523
jardineb5d44e2003-12-23 08:09:43 +00001524 return CMD_SUCCESS;
1525}
1526
1527DEFUN (no_isis_hello_multiplier,
1528 no_isis_hello_multiplier_cmd,
1529 "no isis hello-multiplier",
1530 NO_STR
1531 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001532 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00001533{
1534 struct isis_circuit *circuit;
1535 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001536
1537 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001538 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001539 if (circuit == NULL)
1540 {
1541 return CMD_WARNING;
1542 }
jardineb5d44e2003-12-23 08:09:43 +00001543 assert (circuit);
1544
1545 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1546 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1547
1548 return CMD_SUCCESS;
1549}
1550
1551ALIAS (no_isis_hello_multiplier,
1552 no_isis_hello_multiplier_arg_cmd,
1553 "no isis hello-multiplier <3-1000>",
1554 NO_STR
1555 "IS-IS commands\n"
1556 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001557 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001558
1559DEFUN (isis_hello_multiplier_l1,
1560 isis_hello_multiplier_l1_cmd,
1561 "isis hello-multiplier <3-1000> level-1",
1562 "IS-IS commands\n"
1563 "Set multiplier for Hello holding time\n"
1564 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001565 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001566{
1567 struct isis_circuit *circuit;
1568 struct interface *ifp;
1569 int mult;
hassof390d2c2004-09-10 20:48:21 +00001570
1571 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001572 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001573 if (circuit == NULL)
1574 {
1575 return CMD_WARNING;
1576 }
jardineb5d44e2003-12-23 08:09:43 +00001577 assert (circuit);
1578
1579 mult = atoi (argv[0]);
1580
hassof390d2c2004-09-10 20:48:21 +00001581 circuit->hello_multiplier[0] = (u_int16_t) mult;
1582
jardineb5d44e2003-12-23 08:09:43 +00001583 return CMD_SUCCESS;
1584}
1585
1586DEFUN (no_isis_hello_multiplier_l1,
1587 no_isis_hello_multiplier_l1_cmd,
1588 "no isis hello-multiplier level-1",
1589 NO_STR
1590 "IS-IS commands\n"
1591 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001592 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001593{
1594 struct isis_circuit *circuit;
1595 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001596
1597 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001598 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001599 if (circuit == NULL)
1600 {
1601 return CMD_WARNING;
1602 }
jardineb5d44e2003-12-23 08:09:43 +00001603 assert (circuit);
1604
1605 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1606
1607 return CMD_SUCCESS;
1608}
1609
1610ALIAS (no_isis_hello_multiplier_l1,
1611 no_isis_hello_multiplier_l1_arg_cmd,
1612 "no isis hello-multiplier <3-1000> level-1",
1613 NO_STR
1614 "IS-IS commands\n"
1615 "Set multiplier for Hello holding time\n"
1616 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001617 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001618
1619DEFUN (isis_hello_multiplier_l2,
1620 isis_hello_multiplier_l2_cmd,
1621 "isis hello-multiplier <3-1000> level-2",
1622 "IS-IS commands\n"
1623 "Set multiplier for Hello holding time\n"
1624 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001625 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001626{
1627 struct isis_circuit *circuit;
1628 struct interface *ifp;
1629 int mult;
hassof390d2c2004-09-10 20:48:21 +00001630
1631 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001632 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001633 if (circuit == NULL)
1634 {
1635 return CMD_WARNING;
1636 }
jardineb5d44e2003-12-23 08:09:43 +00001637 assert (circuit);
1638
1639 mult = atoi (argv[0]);
1640
hassof390d2c2004-09-10 20:48:21 +00001641 circuit->hello_multiplier[1] = (u_int16_t) mult;
1642
jardineb5d44e2003-12-23 08:09:43 +00001643 return CMD_SUCCESS;
1644}
1645
1646DEFUN (no_isis_hello_multiplier_l2,
1647 no_isis_hello_multiplier_l2_cmd,
1648 "no isis hello-multiplier level-2",
1649 NO_STR
1650 "IS-IS commands\n"
1651 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001652 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001653{
1654 struct isis_circuit *circuit;
1655 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001656
1657 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001658 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001659 if (circuit == NULL)
1660 {
1661 return CMD_WARNING;
1662 }
jardineb5d44e2003-12-23 08:09:43 +00001663 assert (circuit);
1664
1665 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1666
1667 return CMD_SUCCESS;
1668}
1669
1670ALIAS (no_isis_hello_multiplier_l2,
1671 no_isis_hello_multiplier_l2_arg_cmd,
1672 "no isis hello-multiplier <3-1000> level-2",
1673 NO_STR
1674 "IS-IS commands\n"
1675 "Set multiplier for Hello holding time\n"
1676 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001677 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001678
1679DEFUN (isis_hello,
1680 isis_hello_cmd,
1681 "isis hello padding",
1682 "IS-IS commands\n"
1683 "Add padding to IS-IS hello packets\n"
1684 "Pad hello packets\n"
1685 "<cr>\n")
1686{
1687 struct interface *ifp;
1688 struct isis_circuit *circuit;
hassof390d2c2004-09-10 20:48:21 +00001689
1690 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001691 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001692 if (circuit == NULL)
1693 {
1694 return CMD_WARNING;
1695 }
jardineb5d44e2003-12-23 08:09:43 +00001696 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001697
jardineb5d44e2003-12-23 08:09:43 +00001698 circuit->u.bc.pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00001699
jardineb5d44e2003-12-23 08:09:43 +00001700 return CMD_SUCCESS;
1701}
1702
jardineb5d44e2003-12-23 08:09:43 +00001703DEFUN (no_isis_hello,
1704 no_isis_hello_cmd,
1705 "no isis hello padding",
1706 NO_STR
1707 "IS-IS commands\n"
1708 "Add padding to IS-IS hello packets\n"
1709 "Pad hello packets\n"
1710 "<cr>\n")
1711{
1712 struct isis_circuit *circuit;
1713 struct interface *ifp;
1714
hassof390d2c2004-09-10 20:48:21 +00001715 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001716 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001717 if (circuit == NULL)
1718 {
1719 return CMD_WARNING;
1720 }
jardineb5d44e2003-12-23 08:09:43 +00001721 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001722
jardineb5d44e2003-12-23 08:09:43 +00001723 circuit->u.bc.pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00001724
jardineb5d44e2003-12-23 08:09:43 +00001725 return CMD_SUCCESS;
1726}
1727
1728DEFUN (csnp_interval,
1729 csnp_interval_cmd,
1730 "isis csnp-interval <0-65535>",
1731 "IS-IS commands\n"
1732 "Set CSNP interval in seconds\n"
1733 "CSNP interval value\n")
1734{
1735 struct isis_circuit *circuit;
1736 struct interface *ifp;
1737 unsigned long interval;
1738
hassof390d2c2004-09-10 20:48:21 +00001739 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001740 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001741 if (circuit == NULL)
1742 {
1743 return CMD_WARNING;
1744 }
jardineb5d44e2003-12-23 08:09:43 +00001745 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001746
jardineb5d44e2003-12-23 08:09:43 +00001747 interval = atol (argv[0]);
1748
hassof390d2c2004-09-10 20:48:21 +00001749 circuit->csnp_interval[0] = (u_int16_t) interval;
1750 circuit->csnp_interval[1] = (u_int16_t) interval;
1751
jardineb5d44e2003-12-23 08:09:43 +00001752 return CMD_SUCCESS;
1753}
1754
1755DEFUN (no_csnp_interval,
1756 no_csnp_interval_cmd,
1757 "no isis csnp-interval",
1758 NO_STR
1759 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001760 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001761{
1762 struct isis_circuit *circuit;
1763 struct interface *ifp;
1764
hassof390d2c2004-09-10 20:48:21 +00001765 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001766 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001767 if (circuit == NULL)
1768 {
1769 return CMD_WARNING;
1770 }
jardineb5d44e2003-12-23 08:09:43 +00001771 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001772
jardineb5d44e2003-12-23 08:09:43 +00001773 circuit->csnp_interval[0] = CSNP_INTERVAL;
1774 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001775
jardineb5d44e2003-12-23 08:09:43 +00001776 return CMD_SUCCESS;
1777}
1778
1779ALIAS (no_csnp_interval,
1780 no_csnp_interval_arg_cmd,
1781 "no isis csnp-interval <0-65535>",
1782 NO_STR
1783 "IS-IS commands\n"
1784 "Set CSNP interval in seconds\n"
1785 "CSNP interval value\n")
1786
jardineb5d44e2003-12-23 08:09:43 +00001787DEFUN (csnp_interval_l1,
1788 csnp_interval_l1_cmd,
1789 "isis csnp-interval <0-65535> level-1",
1790 "IS-IS commands\n"
1791 "Set CSNP interval in seconds\n"
1792 "CSNP interval value\n"
1793 "Specify interval for level-1 CSNPs\n")
1794{
1795 struct isis_circuit *circuit;
1796 struct interface *ifp;
1797 unsigned long interval;
1798
hassof390d2c2004-09-10 20:48:21 +00001799 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001800 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001801 if (circuit == NULL)
1802 {
1803 return CMD_WARNING;
1804 }
jardineb5d44e2003-12-23 08:09:43 +00001805 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001806
jardineb5d44e2003-12-23 08:09:43 +00001807 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001808
1809 circuit->csnp_interval[0] = (u_int16_t) interval;
1810
jardineb5d44e2003-12-23 08:09:43 +00001811 return CMD_SUCCESS;
1812}
1813
1814DEFUN (no_csnp_interval_l1,
1815 no_csnp_interval_l1_cmd,
1816 "no isis csnp-interval level-1",
1817 NO_STR
1818 "IS-IS commands\n"
1819 "Set CSNP interval in seconds\n"
1820 "Specify interval for level-1 CSNPs\n")
1821{
1822 struct isis_circuit *circuit;
1823 struct interface *ifp;
1824
hassof390d2c2004-09-10 20:48:21 +00001825 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001826 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001827 if (circuit == NULL)
1828 {
1829 return CMD_WARNING;
1830 }
jardineb5d44e2003-12-23 08:09:43 +00001831 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001832
jardineb5d44e2003-12-23 08:09:43 +00001833 circuit->csnp_interval[0] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001834
jardineb5d44e2003-12-23 08:09:43 +00001835 return CMD_SUCCESS;
1836}
1837
1838ALIAS (no_csnp_interval_l1,
1839 no_csnp_interval_l1_arg_cmd,
1840 "no isis csnp-interval <0-65535> level-1",
1841 NO_STR
1842 "IS-IS commands\n"
1843 "Set CSNP interval in seconds\n"
1844 "CSNP interval value\n"
1845 "Specify interval for level-1 CSNPs\n")
1846
jardineb5d44e2003-12-23 08:09:43 +00001847DEFUN (csnp_interval_l2,
1848 csnp_interval_l2_cmd,
1849 "isis csnp-interval <0-65535> level-2",
1850 "IS-IS commands\n"
1851 "Set CSNP interval in seconds\n"
1852 "CSNP interval value\n"
1853 "Specify interval for level-2 CSNPs\n")
1854{
1855 struct isis_circuit *circuit;
1856 struct interface *ifp;
1857 unsigned long interval;
1858
hassof390d2c2004-09-10 20:48:21 +00001859 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001860 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001861 if (circuit == NULL)
1862 {
1863 return CMD_WARNING;
1864 }
jardineb5d44e2003-12-23 08:09:43 +00001865 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001866
jardineb5d44e2003-12-23 08:09:43 +00001867 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001868
1869 circuit->csnp_interval[1] = (u_int16_t) interval;
1870
jardineb5d44e2003-12-23 08:09:43 +00001871 return CMD_SUCCESS;
1872}
1873
1874DEFUN (no_csnp_interval_l2,
1875 no_csnp_interval_l2_cmd,
1876 "no isis csnp-interval level-2",
1877 NO_STR
1878 "IS-IS commands\n"
1879 "Set CSNP interval in seconds\n"
1880 "Specify interval for level-2 CSNPs\n")
1881{
1882 struct isis_circuit *circuit;
1883 struct interface *ifp;
1884
hassof390d2c2004-09-10 20:48:21 +00001885 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001886 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001887 if (circuit == NULL)
1888 {
1889 return CMD_WARNING;
1890 }
jardineb5d44e2003-12-23 08:09:43 +00001891 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001892
jardineb5d44e2003-12-23 08:09:43 +00001893 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001894
jardineb5d44e2003-12-23 08:09:43 +00001895 return CMD_SUCCESS;
1896}
1897
1898ALIAS (no_csnp_interval_l2,
1899 no_csnp_interval_l2_arg_cmd,
1900 "no isis csnp-interval <0-65535> level-2",
1901 NO_STR
1902 "IS-IS commands\n"
1903 "Set CSNP interval in seconds\n"
1904 "CSNP interval value\n"
1905 "Specify interval for level-2 CSNPs\n")
1906
jardineb5d44e2003-12-23 08:09:43 +00001907#ifdef HAVE_IPV6
1908DEFUN (ipv6_router_isis,
1909 ipv6_router_isis_cmd,
1910 "ipv6 router isis WORD",
1911 "IPv6 interface subcommands\n"
1912 "IPv6 Router interface commands\n"
1913 "IS-IS Routing for IPv6\n"
1914 "Routing process tag\n")
1915{
1916 struct isis_circuit *c;
1917 struct interface *ifp;
1918 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001919
1920 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001921 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001922
jardineb5d44e2003-12-23 08:09:43 +00001923 area = isis_area_lookup (argv[0]);
1924
1925 /* Prevent more than one circuit per interface */
1926 if (area)
1927 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001928 else
1929 c = NULL;
1930
1931 if (c && (ifp->info != NULL))
1932 {
1933 if (c->ipv6_router == 1)
1934 {
1935 vty_out (vty, "ISIS circuit is already defined for IPv6%s",
1936 VTY_NEWLINE);
1937 return CMD_WARNING;
1938 }
jardineb5d44e2003-12-23 08:09:43 +00001939 }
jardineb5d44e2003-12-23 08:09:43 +00001940
1941 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +00001942 if (!area)
1943 {
1944 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1945 return CMD_WARNING;
1946 }
jardineb5d44e2003-12-23 08:09:43 +00001947
hassof390d2c2004-09-10 20:48:21 +00001948 if (!c)
1949 {
1950 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1951 c = isis_csm_state_change (ISIS_ENABLE, c, area);
1952 c->interface = ifp;
1953 ifp->info = c;
1954 }
jardineb5d44e2003-12-23 08:09:43 +00001955
hassof390d2c2004-09-10 20:48:21 +00001956 if (!c)
jardineb5d44e2003-12-23 08:09:43 +00001957 return CMD_WARNING;
1958
1959 c->ipv6_router = 1;
1960 area->ipv6_circuits++;
1961 circuit_update_nlpids (c);
1962
1963 vty->node = INTERFACE_NODE;
1964
1965 return CMD_SUCCESS;
1966}
1967
1968DEFUN (no_ipv6_router_isis,
1969 no_ipv6_router_isis_cmd,
1970 "no ipv6 router isis WORD",
1971 NO_STR
1972 "IPv6 interface subcommands\n"
1973 "IPv6 Router interface commands\n"
1974 "IS-IS Routing for IPv6\n"
1975 "Routing process tag\n")
1976{
1977 struct isis_circuit *c;
1978 struct interface *ifp;
1979 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001980
1981 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001982 /* UGLY - will remove l8r
1983 if (circuit == NULL) {
hassof390d2c2004-09-10 20:48:21 +00001984 return CMD_WARNING;
1985 } */
jardineb5d44e2003-12-23 08:09:43 +00001986 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001987
jardineb5d44e2003-12-23 08:09:43 +00001988 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001989 if (!area)
1990 {
1991 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1992 return CMD_WARNING;
1993 }
1994
jardineb5d44e2003-12-23 08:09:43 +00001995 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
1996 if (!c)
1997 return CMD_WARNING;
1998
1999 c->ipv6_router = 0;
2000 area->ipv6_circuits--;
2001 if (c->ip_router == 0)
2002 isis_csm_state_change (ISIS_DISABLE, c, area);
2003
2004 return CMD_SUCCESS;
2005}
hassof390d2c2004-09-10 20:48:21 +00002006#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00002007
hassof390d2c2004-09-10 20:48:21 +00002008struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002009 INTERFACE_NODE,
2010 "%s(config-if)# ",
2011 1,
2012};
2013
jardineb5d44e2003-12-23 08:09:43 +00002014int
2015isis_if_new_hook (struct interface *ifp)
2016{
2017/* FIXME: Discuss if the circuit should be created here
2018 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2019 ifp->info = NULL;
2020 return 0;
2021}
2022
2023int
2024isis_if_delete_hook (struct interface *ifp)
2025{
2026/* FIXME: Discuss if the circuit should be created here
2027 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2028 ifp->info = NULL;
2029 return 0;
2030}
2031
jardineb5d44e2003-12-23 08:09:43 +00002032void
2033isis_circuit_init ()
2034{
jardineb5d44e2003-12-23 08:09:43 +00002035 /* Initialize Zebra interface data structure */
2036 if_init ();
2037 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2038 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2039
2040 /* Install interface node */
2041 install_node (&interface_node, isis_interface_config_write);
2042 install_element (CONFIG_NODE, &interface_cmd);
2043
2044 install_default (INTERFACE_NODE);
2045 install_element (INTERFACE_NODE, &interface_desc_cmd);
2046 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2047
2048 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2049 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2050
2051 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2052 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2053
2054 install_element (INTERFACE_NODE, &isis_passwd_cmd);
2055 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2056
2057 install_element (INTERFACE_NODE, &isis_priority_cmd);
2058 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2059 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2060 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2061 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2062 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2063 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2064 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2065 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2066
2067 install_element (INTERFACE_NODE, &isis_metric_cmd);
2068 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2069 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2070
2071 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2072 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2073 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2074 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2075 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2076 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2077 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2078 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2079 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2080
2081 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2082 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2083 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2084 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2085 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2086 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2087 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2088 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2089 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2090
2091 install_element (INTERFACE_NODE, &isis_hello_cmd);
2092 install_element (INTERFACE_NODE, &no_isis_hello_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002093 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2094 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2095 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2096 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2097 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2098 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2099 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2100 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2101 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2102
2103#ifdef HAVE_IPV6
2104 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2105 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002106#endif
jardineb5d44e2003-12-23 08:09:43 +00002107}