blob: e885a658812e162efd02f57fc7bb320dc532c40b [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 {
hassoc89c05d2005-09-04 21:36:36 +0000407 /* It's normal in case of loopback etc. */
408 if (isis->debugs & DEBUG_EVENTS)
409 zlog_debug ("isis_circuit_if_add: unsupported media");
hassof390d2c2004-09-10 20:48:21 +0000410 }
411
paul1eb8ef22005-04-07 07:30:20 +0000412 for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, conn))
413 isis_circuit_add_addr (circuit, conn);
jardineb5d44e2003-12-23 08:09:43 +0000414
415 return;
416}
417
418void
hassof390d2c2004-09-10 20:48:21 +0000419isis_circuit_update_params (struct isis_circuit *circuit,
420 struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000421{
hassob30c5e62004-12-29 20:06:41 +0000422 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +0000423
424 if (circuit->circuit_id != ifp->ifindex)
425 {
426 zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
427 ifp->ifindex);
428 circuit->circuit_id = ifp->ifindex % 255;
429 }
jardineb5d44e2003-12-23 08:09:43 +0000430
431 /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
432 /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig)
433 The areas MTU is the minimum of mtu's of circuits in the area
434 now we can't catch the change
435 if (circuit->mtu != ifp->mtu) {
436 zlog_warn ("changing circuit mtu %d->%d", circuit->mtu,
437 ifp->mtu);
438 circuit->mtu = ifp->mtu;
439 }
hassof390d2c2004-09-10 20:48:21 +0000440 */
jardineb5d44e2003-12-23 08:09:43 +0000441 /*
442 * Get the Hardware Address
443 */
444#ifdef HAVE_SOCKADDR_DL
445 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
jardineb5d44e2003-12-23 08:09:43 +0000446 zlog_warn ("unsupported link layer");
hassof390d2c2004-09-10 20:48:21 +0000447 else
448 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), ETH_ALEN);
449#else
450 if (circuit->interface->hw_addr_len != ETH_ALEN)
451 {
452 zlog_warn ("unsupported link layer");
jardineb5d44e2003-12-23 08:09:43 +0000453 }
hassof390d2c2004-09-10 20:48:21 +0000454 else
455 {
456 if (memcmp (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN))
457 {
458 zlog_warn ("changing circuit snpa %s->%s",
459 snpa_print (circuit->u.bc.snpa),
460 snpa_print (circuit->interface->hw_addr));
461 }
462 }
463#endif
jardineb5d44e2003-12-23 08:09:43 +0000464
hassof390d2c2004-09-10 20:48:21 +0000465 if (if_is_broadcast (ifp))
466 {
467 circuit->circ_type = CIRCUIT_T_BROADCAST;
468 }
469 else if (if_is_pointopoint (ifp))
470 {
471 circuit->circ_type = CIRCUIT_T_P2P;
472 }
473 else
474 {
475 zlog_warn ("isis_circuit_update_params: unsupported media");
476 }
jardineb5d44e2003-12-23 08:09:43 +0000477
jardineb5d44e2003-12-23 08:09:43 +0000478 return;
479}
480
481void
hassof390d2c2004-09-10 20:48:21 +0000482isis_circuit_if_del (struct isis_circuit *circuit)
jardineb5d44e2003-12-23 08:09:43 +0000483{
484 circuit->interface->info = NULL;
485 circuit->interface = NULL;
hassof390d2c2004-09-10 20:48:21 +0000486
jardineb5d44e2003-12-23 08:09:43 +0000487 return;
488}
489
490void
491isis_circuit_up (struct isis_circuit *circuit)
492{
jardineb5d44e2003-12-23 08:09:43 +0000493
hassof390d2c2004-09-10 20:48:21 +0000494 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
495 {
496 if (circuit->area->min_bcast_mtu == 0 ||
497 ISO_MTU (circuit) < circuit->area->min_bcast_mtu)
498 circuit->area->min_bcast_mtu = ISO_MTU (circuit);
499 /*
500 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
501 */
jardineb5d44e2003-12-23 08:09:43 +0000502
hassof390d2c2004-09-10 20:48:21 +0000503 /* initilizing the hello sending threads
504 * for a broadcast IF
505 */
jardineb5d44e2003-12-23 08:09:43 +0000506
hassof390d2c2004-09-10 20:48:21 +0000507 /* 8.4.1 a) commence sending of IIH PDUs */
508
509 if (circuit->circuit_is_type & IS_LEVEL_1)
510 {
511 thread_add_event (master, send_lan_l1_hello, circuit, 0);
512 circuit->u.bc.lan_neighs[0] = list_new ();
513 }
514
515 if (circuit->circuit_is_type & IS_LEVEL_2)
516 {
517 thread_add_event (master, send_lan_l2_hello, circuit, 0);
518 circuit->u.bc.lan_neighs[1] = list_new ();
519 }
520
521 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
522 /* 8.4.1 c) FIXME: listen for ESH PDUs */
523
524 /* 8.4.1 d) */
525 /* dr election will commence in... */
526 if (circuit->circuit_is_type & IS_LEVEL_1)
527 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
hassobf731012004-09-17 07:59:57 +0000528 circuit, 2 * circuit->hello_interval[0]);
hassof390d2c2004-09-10 20:48:21 +0000529 if (circuit->circuit_is_type & IS_LEVEL_2)
530 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
hassobf731012004-09-17 07:59:57 +0000531 circuit, 2 * circuit->hello_interval[1]);
jardineb5d44e2003-12-23 08:09:43 +0000532 }
hassof390d2c2004-09-10 20:48:21 +0000533 else
534 {
535 /* initializing the hello send threads
536 * for a ptp IF
537 */
538 thread_add_event (master, send_p2p_hello, circuit, 0);
jardineb5d44e2003-12-23 08:09:43 +0000539
jardineb5d44e2003-12-23 08:09:43 +0000540 }
541
jardineb5d44e2003-12-23 08:09:43 +0000542 /* initializing PSNP timers */
hassof390d2c2004-09-10 20:48:21 +0000543 if (circuit->circuit_is_type & IS_LEVEL_1)
544 {
545 THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
546 isis_jitter (circuit->psnp_interval[0], PSNP_JITTER));
547 }
548
549 if (circuit->circuit_is_type & IS_LEVEL_2)
550 {
551 THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
552 isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
553 }
554
jardineb5d44e2003-12-23 08:09:43 +0000555 /* initialize the circuit streams */
556 if (circuit->rcv_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000557 circuit->rcv_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000558
559 if (circuit->snd_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000560 circuit->snd_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000561
562 /* unified init for circuits */
563 isis_sock_init (circuit);
564
565#ifdef GNU_LINUX
hassof390d2c2004-09-10 20:48:21 +0000566 THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
567 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000568#else
hassof390d2c2004-09-10 20:48:21 +0000569 THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
570 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000571#endif
572 return;
573}
574
575void
576isis_circuit_down (struct isis_circuit *circuit)
577{
hassof390d2c2004-09-10 20:48:21 +0000578 /* Cancel all active threads -- FIXME: wrong place */
hassod70f99e2004-02-11 20:26:31 +0000579 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
hassof390d2c2004-09-10 20:48:21 +0000580 THREAD_OFF (circuit->t_read);
581 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
582 {
583 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
584 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
hassof891f442004-09-14 13:54:30 +0000585 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
586 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
hassof390d2c2004-09-10 20:48:21 +0000587 }
588 else if (circuit->circ_type == CIRCUIT_T_P2P)
589 {
590 THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
591 }
jardineb5d44e2003-12-23 08:09:43 +0000592 /* close the socket */
593 close (circuit->fd);
594
595 return;
596}
597
598void
599circuit_update_nlpids (struct isis_circuit *circuit)
600{
601 circuit->nlpids.count = 0;
hassof390d2c2004-09-10 20:48:21 +0000602
603 if (circuit->ip_router)
604 {
605 circuit->nlpids.nlpids[0] = NLPID_IP;
606 circuit->nlpids.count++;
607 }
jardineb5d44e2003-12-23 08:09:43 +0000608#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000609 if (circuit->ipv6_router)
610 {
611 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
612 circuit->nlpids.count++;
613 }
jardineb5d44e2003-12-23 08:09:43 +0000614#endif /* HAVE_IPV6 */
615 return;
616}
617
618int
hassof390d2c2004-09-10 20:48:21 +0000619isis_interface_config_write (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000620{
621
622 int write = 0;
paul1eb8ef22005-04-07 07:30:20 +0000623 struct listnode *node, *nnode;
624 struct listnode *node2, *nnode2;
jardineb5d44e2003-12-23 08:09:43 +0000625 struct interface *ifp;
626 struct isis_area *area;
627 struct isis_circuit *c;
jardineb5d44e2003-12-23 08:09:43 +0000628 int i;
jardineb5d44e2003-12-23 08:09:43 +0000629
paul1eb8ef22005-04-07 07:30:20 +0000630 for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
jardineb5d44e2003-12-23 08:09:43 +0000631 {
632 /* IF name */
hassof390d2c2004-09-10 20:48:21 +0000633 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000634 write++;
635 /* IF desc */
hassof390d2c2004-09-10 20:48:21 +0000636 if (ifp->desc)
637 {
638 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
639 write++;
640 }
jardineb5d44e2003-12-23 08:09:43 +0000641 /* ISIS Circuit */
paul1eb8ef22005-04-07 07:30:20 +0000642 for (ALL_LIST_ELEMENTS (isis->area_list, node2, nnode2, area))
jardineb5d44e2003-12-23 08:09:43 +0000643 {
644 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000645 if (c)
646 {
647 if (c->ip_router)
648 {
649 vty_out (vty, " ip router isis %s%s", area->area_tag,
650 VTY_NEWLINE);
651 write++;
652 }
jardineb5d44e2003-12-23 08:09:43 +0000653#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000654 if (c->ipv6_router)
655 {
656 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
657 VTY_NEWLINE);
658 write++;
659 }
jardineb5d44e2003-12-23 08:09:43 +0000660#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000661
hassof390d2c2004-09-10 20:48:21 +0000662 /* ISIS - circuit type */
663 if (c->circuit_is_type == IS_LEVEL_1)
664 {
665 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
666 write++;
667 }
668 else
669 {
670 if (c->circuit_is_type == IS_LEVEL_2)
671 {
672 vty_out (vty, " isis circuit-type level-2-only%s",
673 VTY_NEWLINE);
674 write++;
675 }
676 }
jardineb5d44e2003-12-23 08:09:43 +0000677
hassof390d2c2004-09-10 20:48:21 +0000678 /* ISIS - CSNP interval - FIXME: compare to cisco */
679 if (c->csnp_interval[0] == c->csnp_interval[1])
680 {
681 if (c->csnp_interval[0] != CSNP_INTERVAL)
682 {
683 vty_out (vty, " isis csnp-interval %d%s",
684 c->csnp_interval[0], VTY_NEWLINE);
685 write++;
686 }
687 }
688 else
689 {
690 for (i = 0; i < 2; i++)
691 {
692 if (c->csnp_interval[1] != CSNP_INTERVAL)
693 {
694 vty_out (vty, " isis csnp-interval %d level-%d%s",
695 c->csnp_interval[1], i + 1, VTY_NEWLINE);
696 write++;
697 }
698 }
699 }
jardineb5d44e2003-12-23 08:09:43 +0000700
hassof390d2c2004-09-10 20:48:21 +0000701 /* ISIS - Hello padding - Defaults to true so only display if false */
702 if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos)
703 {
704 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
705 write++;
706 }
jardineb5d44e2003-12-23 08:09:43 +0000707
hassof390d2c2004-09-10 20:48:21 +0000708 /* ISIS - Hello interval - FIXME: compare to cisco */
709 if (c->hello_interval[0] == c->hello_interval[1])
710 {
711 if (c->hello_interval[0] != HELLO_INTERVAL)
712 {
713 vty_out (vty, " isis hello-interval %d%s",
714 c->hello_interval[0], VTY_NEWLINE);
715 write++;
716 }
717 }
718 else
719 {
720 for (i = 0; i < 2; i++)
721 {
722 if (c->hello_interval[i] != HELLO_INTERVAL)
723 {
724 if (c->hello_interval[i] == HELLO_MINIMAL)
725 {
726 vty_out (vty,
727 " isis hello-interval minimal level-%d%s",
728 i + 1, VTY_NEWLINE);
729 }
730 else
731 {
732 vty_out (vty, " isis hello-interval %d level-%d%s",
733 c->hello_interval[i], i + 1, VTY_NEWLINE);
734 }
735 write++;
736 }
737 }
738 }
jardineb5d44e2003-12-23 08:09:43 +0000739
hassof390d2c2004-09-10 20:48:21 +0000740 /* ISIS - Hello Multiplier */
741 if (c->hello_multiplier[0] == c->hello_multiplier[1])
742 {
743 if (c->hello_multiplier[0] != HELLO_MULTIPLIER)
744 {
745 vty_out (vty, " isis hello-multiplier %d%s",
746 c->hello_multiplier[0], VTY_NEWLINE);
747 write++;
748 }
749 }
750 else
751 {
752 for (i = 0; i < 2; i++)
753 {
754 if (c->hello_multiplier[i] != HELLO_MULTIPLIER)
755 {
756 vty_out (vty, " isis hello-multiplier %d level-%d%s",
757 c->hello_multiplier[i], i + 1, VTY_NEWLINE);
758 write++;
759 }
760 }
761 }
762 /* ISIS - Priority */
763 if (c->circ_type == CIRCUIT_T_BROADCAST)
764 {
765 if (c->u.bc.priority[0] == c->u.bc.priority[1])
766 {
767 if (c->u.bc.priority[0] != DEFAULT_PRIORITY)
768 {
769 vty_out (vty, " isis priority %d%s",
770 c->u.bc.priority[0], VTY_NEWLINE);
771 write++;
772 }
773 }
774 else
775 {
776 for (i = 0; i < 2; i++)
777 {
778 if (c->u.bc.priority[i] != DEFAULT_PRIORITY)
779 {
780 vty_out (vty, " isis priority %d level-%d%s",
781 c->u.bc.priority[i], i + 1, VTY_NEWLINE);
782 write++;
783 }
784 }
785 }
786 }
787 /* ISIS - Metric */
788 if (c->metrics[0].metric_default == c->metrics[1].metric_default)
789 {
790 if (c->metrics[0].metric_default != DEFAULT_CIRCUIT_METRICS)
791 {
792 vty_out (vty, " isis metric %d%s",
793 c->metrics[0].metric_default, VTY_NEWLINE);
794 write++;
795 }
796 }
797 else
798 {
799 for (i = 0; i < 2; i++)
800 {
801 if (c->metrics[i].metric_default != DEFAULT_CIRCUIT_METRICS)
802 {
803 vty_out (vty, " isis metric %d level-%d%s",
804 c->metrics[i].metric_default, i + 1,
805 VTY_NEWLINE);
806 write++;
807 }
808 }
809 }
jardineb5d44e2003-12-23 08:09:43 +0000810
hassof390d2c2004-09-10 20:48:21 +0000811 }
jardineb5d44e2003-12-23 08:09:43 +0000812 }
hassof390d2c2004-09-10 20:48:21 +0000813 vty_out (vty, "!%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000814 }
hassof390d2c2004-09-10 20:48:21 +0000815
jardineb5d44e2003-12-23 08:09:43 +0000816 return write;
817}
jardineb5d44e2003-12-23 08:09:43 +0000818
819DEFUN (ip_router_isis,
820 ip_router_isis_cmd,
821 "ip router isis WORD",
822 "Interface Internet Protocol config commands\n"
823 "IP router interface commands\n"
824 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000825 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000826{
827 struct isis_circuit *c;
828 struct interface *ifp;
829 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000830
831 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000832 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000833
jardineb5d44e2003-12-23 08:09:43 +0000834 area = isis_area_lookup (argv[0]);
835
836 /* Prevent more than one circuit per interface */
837 if (area)
838 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000839 else
840 c = NULL;
841 if (c && (ifp->info != NULL))
842 {
jardineb5d44e2003-12-23 08:09:43 +0000843#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000844 if (c->ipv6_router == 0)
845 {
jardineb5d44e2003-12-23 08:09:43 +0000846#endif /* HAVE_IPV6 */
hassoc89c05d2005-09-04 21:36:36 +0000847 /* FIXME: Find the way to warn only vty users. */
848 /* vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE); */
hassof390d2c2004-09-10 20:48:21 +0000849 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000850#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000851 }
852#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000853 }
hassof390d2c2004-09-10 20:48:21 +0000854
jardineb5d44e2003-12-23 08:09:43 +0000855 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +0000856 if (!area)
857 {
hassoc89c05d2005-09-04 21:36:36 +0000858 /* FIXME: Find the way to warn only vty users. */
859 /* vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); */
hassof390d2c2004-09-10 20:48:21 +0000860 return CMD_WARNING;
861 }
jardineb5d44e2003-12-23 08:09:43 +0000862
hassof390d2c2004-09-10 20:48:21 +0000863 if (!c)
864 {
865 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
866 c = isis_csm_state_change (ISIS_ENABLE, c, area);
867 c->interface = ifp; /* this is automatic */
868 ifp->info = c; /* hardly related to the FSM */
869 }
jardineb5d44e2003-12-23 08:09:43 +0000870
hassof390d2c2004-09-10 20:48:21 +0000871 if (!c)
jardineb5d44e2003-12-23 08:09:43 +0000872 return CMD_WARNING;
873
874 c->ip_router = 1;
875 area->ip_circuits++;
876 circuit_update_nlpids (c);
877
878 vty->node = INTERFACE_NODE;
hassof390d2c2004-09-10 20:48:21 +0000879
jardineb5d44e2003-12-23 08:09:43 +0000880 return CMD_SUCCESS;
881}
882
883DEFUN (no_ip_router_isis,
884 no_ip_router_isis_cmd,
885 "no ip router isis WORD",
886 NO_STR
887 "Interface Internet Protocol config commands\n"
888 "IP router interface commands\n"
889 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000890 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000891{
892 struct isis_circuit *circuit = NULL;
893 struct interface *ifp;
894 struct isis_area *area;
paul1eb8ef22005-04-07 07:30:20 +0000895 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000896
hassof390d2c2004-09-10 20:48:21 +0000897 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000898 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000899
jardineb5d44e2003-12-23 08:09:43 +0000900 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +0000901 if (!area)
902 {
903 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
904 return CMD_WARNING;
905 }
paul1eb8ef22005-04-07 07:30:20 +0000906 for (ALL_LIST_ELEMENTS (area->circuit_list, node, nnode, circuit))
jardineb5d44e2003-12-23 08:09:43 +0000907 if (circuit->interface == ifp)
908 break;
hassof390d2c2004-09-10 20:48:21 +0000909 if (!circuit)
910 {
911 vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE);
912 return CMD_WARNING;
913 }
jardineb5d44e2003-12-23 08:09:43 +0000914 circuit->ip_router = 0;
915 area->ip_circuits--;
916#ifdef HAVE_IPV6
917 if (circuit->ipv6_router == 0)
918#endif
919 isis_csm_state_change (ISIS_DISABLE, circuit, area);
hassof390d2c2004-09-10 20:48:21 +0000920
jardineb5d44e2003-12-23 08:09:43 +0000921 return CMD_SUCCESS;
922}
923
924DEFUN (isis_circuit_type,
925 isis_circuit_type_cmd,
926 "isis circuit-type (level-1|level-1-2|level-2-only)",
927 "IS-IS commands\n"
928 "Configure circuit type for interface\n"
929 "Level-1 only adjacencies are formed\n"
930 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000931 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000932{
933 struct isis_circuit *circuit;
934 struct interface *ifp;
935 int circuit_t;
936 int is_type;
hassof390d2c2004-09-10 20:48:21 +0000937
938 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000939 circuit = ifp->info;
940 /* UGLY - will remove l8r */
hassof390d2c2004-09-10 20:48:21 +0000941 if (circuit == NULL)
942 {
943 return CMD_WARNING;
944 }
jardineb5d44e2003-12-23 08:09:43 +0000945
hasso13c48f72004-09-10 21:19:13 +0000946 /* XXX what to do when ip_router_isis is not executed */
947 if (circuit->area == NULL)
948 return CMD_WARNING;
949
jardineb5d44e2003-12-23 08:09:43 +0000950 assert (circuit);
951
hassof7c43dc2004-09-26 16:24:14 +0000952 circuit_t = string2circuit_t ((u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000953
hassof390d2c2004-09-10 20:48:21 +0000954 if (!circuit_t)
955 {
956 vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
957 return CMD_SUCCESS;
958 }
959
jardineb5d44e2003-12-23 08:09:43 +0000960 is_type = circuit->area->is_type;
961 if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t)
hassof390d2c2004-09-10 20:48:21 +0000962 isis_event_circuit_type_change (circuit, circuit_t);
963 else
964 {
965 vty_out (vty, "invalid circuit level for area %s.%s",
966 circuit->area->area_tag, VTY_NEWLINE);
967 }
968
jardineb5d44e2003-12-23 08:09:43 +0000969 return CMD_SUCCESS;
970}
971
972DEFUN (no_isis_circuit_type,
973 no_isis_circuit_type_cmd,
974 "no isis circuit-type (level-1|level-1-2|level-2-only)",
975 NO_STR
976 "IS-IS commands\n"
977 "Configure circuit type for interface\n"
978 "Level-1 only adjacencies are formed\n"
979 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000980 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000981{
982 struct isis_circuit *circuit;
983 struct interface *ifp;
jardineb5d44e2003-12-23 08:09:43 +0000984
hassof390d2c2004-09-10 20:48:21 +0000985 ifp = vty->index;
986 circuit = ifp->info;
987 if (circuit == NULL)
988 {
989 return CMD_WARNING;
990 }
991
992 assert (circuit);
993
jardineb5d44e2003-12-23 08:09:43 +0000994 /*
995 * Set the circuits level to its default value which is that of the area
996 */
997 isis_event_circuit_type_change (circuit, circuit->area->is_type);
hassof390d2c2004-09-10 20:48:21 +0000998
jardineb5d44e2003-12-23 08:09:43 +0000999 return CMD_SUCCESS;
1000}
1001
1002DEFUN (isis_passwd,
1003 isis_passwd_cmd,
1004 "isis password WORD",
1005 "IS-IS commands\n"
1006 "Configure the authentication password for interface\n"
1007 "Password\n")
1008{
1009 struct isis_circuit *circuit;
1010 struct interface *ifp;
1011 int len;
hassof390d2c2004-09-10 20:48:21 +00001012
1013 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001014 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001015 if (circuit == NULL)
1016 {
1017 return CMD_WARNING;
1018 }
1019
jardineb5d44e2003-12-23 08:09:43 +00001020 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001021 if (len > 254)
1022 {
1023 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
1024 return CMD_WARNING;
1025 }
jardineb5d44e2003-12-23 08:09:43 +00001026 circuit->passwd.len = len;
1027 circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001028 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001029
jardineb5d44e2003-12-23 08:09:43 +00001030 return CMD_SUCCESS;
1031}
1032
1033DEFUN (no_isis_passwd,
1034 no_isis_passwd_cmd,
1035 "no isis password",
1036 NO_STR
1037 "IS-IS commands\n"
1038 "Configure the authentication password for interface\n")
1039{
1040 struct isis_circuit *circuit;
1041 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001042
1043 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001044 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001045 if (circuit == NULL)
1046 {
1047 return CMD_WARNING;
1048 }
1049
jardineb5d44e2003-12-23 08:09:43 +00001050 memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001051
jardineb5d44e2003-12-23 08:09:43 +00001052 return CMD_SUCCESS;
1053}
1054
1055
1056DEFUN (isis_priority,
1057 isis_priority_cmd,
1058 "isis priority <0-127>",
1059 "IS-IS commands\n"
1060 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001061 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001062{
1063 struct isis_circuit *circuit;
1064 struct interface *ifp;
1065 int prio;
hassof390d2c2004-09-10 20:48:21 +00001066
1067 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001068 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001069 if (circuit == NULL)
1070 {
1071 return CMD_WARNING;
1072 }
jardineb5d44e2003-12-23 08:09:43 +00001073 assert (circuit);
1074
1075 prio = atoi (argv[0]);
1076
1077 circuit->u.bc.priority[0] = prio;
1078 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001079
jardineb5d44e2003-12-23 08:09:43 +00001080 return CMD_SUCCESS;
1081}
1082
1083DEFUN (no_isis_priority,
1084 no_isis_priority_cmd,
1085 "no isis priority",
1086 NO_STR
1087 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001088 "Set priority for Designated Router election\n")
jardineb5d44e2003-12-23 08:09:43 +00001089{
1090 struct isis_circuit *circuit;
1091 struct interface *ifp;
1092
hassof390d2c2004-09-10 20:48:21 +00001093 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001094 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001095 if (circuit == NULL)
1096 {
1097 return CMD_WARNING;
1098 }
jardineb5d44e2003-12-23 08:09:43 +00001099 assert (circuit);
1100
1101 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
1102 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001103
jardineb5d44e2003-12-23 08:09:43 +00001104 return CMD_SUCCESS;
1105}
1106
1107ALIAS (no_isis_priority,
1108 no_isis_priority_arg_cmd,
1109 "no isis priority <0-127>",
1110 NO_STR
1111 "IS-IS commands\n"
1112 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001113 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001114
1115DEFUN (isis_priority_l1,
1116 isis_priority_l1_cmd,
hassof390d2c2004-09-10 20:48:21 +00001117 "isis priority <0-127> level-1",
jardineb5d44e2003-12-23 08:09:43 +00001118 "IS-IS commands\n"
1119 "Set priority for Designated Router election\n"
1120 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001121 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001122{
1123 struct isis_circuit *circuit;
1124 struct interface *ifp;
1125 int prio;
hassof390d2c2004-09-10 20:48:21 +00001126
1127 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001128 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001129 if (circuit == NULL)
1130 {
1131 return CMD_WARNING;
1132 }
jardineb5d44e2003-12-23 08:09:43 +00001133 assert (circuit);
1134
1135 prio = atoi (argv[0]);
1136
1137 circuit->u.bc.priority[0] = prio;
hassof390d2c2004-09-10 20:48:21 +00001138
jardineb5d44e2003-12-23 08:09:43 +00001139 return CMD_SUCCESS;
1140}
1141
1142DEFUN (no_isis_priority_l1,
1143 no_isis_priority_l1_cmd,
1144 "no isis priority level-1",
1145 NO_STR
1146 "IS-IS commands\n"
1147 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001148 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001149{
1150 struct isis_circuit *circuit;
1151 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001152
1153 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001154 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001155 if (circuit == NULL)
1156 {
1157 return CMD_WARNING;
1158 }
jardineb5d44e2003-12-23 08:09:43 +00001159 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001160
jardineb5d44e2003-12-23 08:09:43 +00001161 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001162
jardineb5d44e2003-12-23 08:09:43 +00001163 return CMD_SUCCESS;
1164}
1165
1166ALIAS (no_isis_priority_l1,
1167 no_isis_priority_l1_arg_cmd,
1168 "no isis priority <0-127> level-1",
1169 NO_STR
1170 "IS-IS commands\n"
1171 "Set priority for Designated Router election\n"
1172 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001173 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001174
1175DEFUN (isis_priority_l2,
1176 isis_priority_l2_cmd,
hassof390d2c2004-09-10 20:48:21 +00001177 "isis priority <0-127> level-2",
jardineb5d44e2003-12-23 08:09:43 +00001178 "IS-IS commands\n"
1179 "Set priority for Designated Router election\n"
1180 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001181 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001182{
1183 struct isis_circuit *circuit;
1184 struct interface *ifp;
1185 int prio;
hassof390d2c2004-09-10 20:48:21 +00001186
1187 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001188 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001189 if (circuit == NULL)
1190 {
1191 return CMD_WARNING;
1192 }
jardineb5d44e2003-12-23 08:09:43 +00001193 assert (circuit);
1194
1195 prio = atoi (argv[0]);
1196
1197 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001198
jardineb5d44e2003-12-23 08:09:43 +00001199 return CMD_SUCCESS;
1200}
1201
1202DEFUN (no_isis_priority_l2,
1203 no_isis_priority_l2_cmd,
1204 "no isis priority level-2",
1205 NO_STR
1206 "IS-IS commands\n"
1207 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001208 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001209{
1210 struct isis_circuit *circuit;
1211 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001212
1213 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001214 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001215 if (circuit == NULL)
1216 {
1217 return CMD_WARNING;
1218 }
jardineb5d44e2003-12-23 08:09:43 +00001219 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001220
jardineb5d44e2003-12-23 08:09:43 +00001221 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001222
jardineb5d44e2003-12-23 08:09:43 +00001223 return CMD_SUCCESS;
1224}
1225
1226ALIAS (no_isis_priority_l2,
1227 no_isis_priority_l2_arg_cmd,
1228 "no isis priority <0-127> level-2",
1229 NO_STR
1230 "IS-IS commands\n"
1231 "Set priority for Designated Router election\n"
1232 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001233 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001234
1235/* Metric command */
hassof390d2c2004-09-10 20:48:21 +00001236 DEFUN (isis_metric,
jardineb5d44e2003-12-23 08:09:43 +00001237 isis_metric_cmd,
1238 "isis metric <0-63>",
1239 "IS-IS commands\n"
1240 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001241 "Default metric value\n")
jardineb5d44e2003-12-23 08:09:43 +00001242{
1243 struct isis_circuit *circuit;
1244 struct interface *ifp;
1245 int met;
1246
hassof390d2c2004-09-10 20:48:21 +00001247 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001248 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001249 if (circuit == NULL)
1250 {
1251 return CMD_WARNING;
1252 }
jardineb5d44e2003-12-23 08:09:43 +00001253 assert (circuit);
1254
1255 met = atoi (argv[0]);
1256
1257 circuit->metrics[0].metric_default = met;
1258 circuit->metrics[1].metric_default = met;
1259
1260 return CMD_SUCCESS;
1261}
1262
1263DEFUN (no_isis_metric,
1264 no_isis_metric_cmd,
1265 "no isis metric",
1266 NO_STR
1267 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001268 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001269{
1270 struct isis_circuit *circuit;
1271 struct interface *ifp;
1272
hassof390d2c2004-09-10 20:48:21 +00001273 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001274 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001275 if (circuit == NULL)
1276 {
1277 return CMD_WARNING;
1278 }
jardineb5d44e2003-12-23 08:09:43 +00001279 assert (circuit);
1280
1281 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1282 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1283
1284 return CMD_SUCCESS;
1285}
1286
1287ALIAS (no_isis_metric,
1288 no_isis_metric_arg_cmd,
1289 "no isis metric <0-127>",
1290 NO_STR
1291 "IS-IS commands\n"
1292 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001293 "Default metric value\n")
1294
jardineb5d44e2003-12-23 08:09:43 +00001295/* end of metrics */
hassof390d2c2004-09-10 20:48:21 +00001296 DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00001297 isis_hello_interval_cmd,
1298 "isis hello-interval (<1-65535>|minimal)",
1299 "IS-IS commands\n"
1300 "Set Hello interval\n"
1301 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001302 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001303{
1304 struct isis_circuit *circuit;
1305 struct interface *ifp;
1306 int interval;
1307 char c;
1308
hassof390d2c2004-09-10 20:48:21 +00001309 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001310 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001311 if (circuit == NULL)
1312 {
1313 return CMD_WARNING;
1314 }
1315 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001316 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001317 if (isdigit ((int) c))
1318 {
1319 interval = atoi (argv[0]);
1320 }
1321 else
1322 interval = HELLO_MINIMAL; /* FIXME: should be calculated */
jardineb5d44e2003-12-23 08:09:43 +00001323
hassof390d2c2004-09-10 20:48:21 +00001324 circuit->hello_interval[0] = (u_int16_t) interval;
1325 circuit->hello_interval[1] = (u_int16_t) interval;
1326
jardineb5d44e2003-12-23 08:09:43 +00001327 return CMD_SUCCESS;
1328}
1329
1330DEFUN (no_isis_hello_interval,
1331 no_isis_hello_interval_cmd,
1332 "no isis hello-interval",
1333 NO_STR
1334 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001335 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00001336{
1337 struct isis_circuit *circuit;
1338 struct interface *ifp;
1339
hassof390d2c2004-09-10 20:48:21 +00001340 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001341 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001342 if (circuit == NULL)
1343 {
1344 return CMD_WARNING;
1345 }
jardineb5d44e2003-12-23 08:09:43 +00001346 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001347
hassof390d2c2004-09-10 20:48:21 +00001348
1349 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
jardineb5d44e2003-12-23 08:09:43 +00001350 circuit->hello_interval[1] = HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001351
jardineb5d44e2003-12-23 08:09:43 +00001352 return CMD_SUCCESS;
1353}
1354
1355ALIAS (no_isis_hello_interval,
1356 no_isis_hello_interval_arg_cmd,
1357 "no isis hello-interval (<1-65535>|minimal)",
1358 NO_STR
1359 "IS-IS commands\n"
1360 "Set Hello interval\n"
1361 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001362 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001363
1364DEFUN (isis_hello_interval_l1,
1365 isis_hello_interval_l1_cmd,
1366 "isis hello-interval (<1-65535>|minimal) level-1",
1367 "IS-IS commands\n"
1368 "Set Hello interval\n"
1369 "Hello interval value\n"
1370 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001371 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001372{
1373 struct isis_circuit *circuit;
1374 struct interface *ifp;
1375 long interval;
1376 char c;
1377
hassof390d2c2004-09-10 20:48:21 +00001378 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001379 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001380 if (circuit == NULL)
1381 {
1382 return CMD_WARNING;
1383 }
jardineb5d44e2003-12-23 08:09:43 +00001384 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001385
jardineb5d44e2003-12-23 08:09:43 +00001386 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001387 if (isdigit ((int) c))
1388 {
1389 interval = atoi (argv[0]);
1390 }
1391 else
jardineb5d44e2003-12-23 08:09:43 +00001392 interval = HELLO_MINIMAL;
1393
hassof390d2c2004-09-10 20:48:21 +00001394 circuit->hello_interval[0] = (u_int16_t) interval;
1395
jardineb5d44e2003-12-23 08:09:43 +00001396 return CMD_SUCCESS;
1397}
1398
1399DEFUN (no_isis_hello_interval_l1,
1400 no_isis_hello_interval_l1_cmd,
1401 "no isis hello-interval level-1",
1402 NO_STR
1403 "IS-IS commands\n"
1404 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001405 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001406{
1407 struct isis_circuit *circuit;
1408 struct interface *ifp;
1409
hassof390d2c2004-09-10 20:48:21 +00001410 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001411 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001412 if (circuit == NULL)
1413 {
1414 return CMD_WARNING;
1415 }
jardineb5d44e2003-12-23 08:09:43 +00001416 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001417
hassof390d2c2004-09-10 20:48:21 +00001418
1419 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1420
jardineb5d44e2003-12-23 08:09:43 +00001421 return CMD_SUCCESS;
1422}
1423
1424ALIAS (no_isis_hello_interval_l1,
1425 no_isis_hello_interval_l1_arg_cmd,
1426 "no isis hello-interval (<1-65535>|minimal) level-1",
1427 NO_STR
1428 "IS-IS commands\n"
1429 "Set Hello interval\n"
1430 "Hello interval value\n"
1431 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001432 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001433
1434DEFUN (isis_hello_interval_l2,
1435 isis_hello_interval_l2_cmd,
1436 "isis hello-interval (<1-65535>|minimal) level-2",
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-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001442{
1443 struct isis_circuit *circuit;
1444 struct interface *ifp;
1445 long interval;
1446 char c;
1447
hassof390d2c2004-09-10 20:48:21 +00001448 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001449 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001450 if (circuit == NULL)
1451 {
1452 return CMD_WARNING;
1453 }
jardineb5d44e2003-12-23 08:09:43 +00001454 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001455
jardineb5d44e2003-12-23 08:09:43 +00001456 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001457 if (isdigit ((int) c))
1458 {
1459 interval = atoi (argv[0]);
1460 }
1461 else
jardineb5d44e2003-12-23 08:09:43 +00001462 interval = HELLO_MINIMAL;
1463
hassof390d2c2004-09-10 20:48:21 +00001464 circuit->hello_interval[1] = (u_int16_t) interval;
1465
jardineb5d44e2003-12-23 08:09:43 +00001466 return CMD_SUCCESS;
1467}
1468
1469DEFUN (no_isis_hello_interval_l2,
1470 no_isis_hello_interval_l2_cmd,
1471 "no isis hello-interval level-2",
1472 NO_STR
1473 "IS-IS commands\n"
1474 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001475 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001476{
1477 struct isis_circuit *circuit;
1478 struct interface *ifp;
1479
hassof390d2c2004-09-10 20:48:21 +00001480 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001481 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001482 if (circuit == NULL)
1483 {
1484 return CMD_WARNING;
1485 }
jardineb5d44e2003-12-23 08:09:43 +00001486 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001487
hassof390d2c2004-09-10 20:48:21 +00001488
1489 circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1490
jardineb5d44e2003-12-23 08:09:43 +00001491 return CMD_SUCCESS;
1492}
1493
1494ALIAS (no_isis_hello_interval_l2,
1495 no_isis_hello_interval_l2_arg_cmd,
1496 "no isis hello-interval (<1-65535>|minimal) level-2",
1497 NO_STR
1498 "IS-IS commands\n"
1499 "Set Hello interval\n"
1500 "Hello interval value\n"
1501 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001502 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001503
1504DEFUN (isis_hello_multiplier,
1505 isis_hello_multiplier_cmd,
1506 "isis hello-multiplier <3-1000>",
1507 "IS-IS commands\n"
1508 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001509 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001510{
1511 struct isis_circuit *circuit;
1512 struct interface *ifp;
1513 int mult;
hassof390d2c2004-09-10 20:48:21 +00001514
1515 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001516 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001517 if (circuit == NULL)
1518 {
1519 return CMD_WARNING;
1520 }
jardineb5d44e2003-12-23 08:09:43 +00001521 assert (circuit);
1522
1523 mult = atoi (argv[0]);
1524
hassof390d2c2004-09-10 20:48:21 +00001525 circuit->hello_multiplier[0] = (u_int16_t) mult;
1526 circuit->hello_multiplier[1] = (u_int16_t) mult;
1527
jardineb5d44e2003-12-23 08:09:43 +00001528 return CMD_SUCCESS;
1529}
1530
1531DEFUN (no_isis_hello_multiplier,
1532 no_isis_hello_multiplier_cmd,
1533 "no isis hello-multiplier",
1534 NO_STR
1535 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001536 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00001537{
1538 struct isis_circuit *circuit;
1539 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001540
1541 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001542 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001543 if (circuit == NULL)
1544 {
1545 return CMD_WARNING;
1546 }
jardineb5d44e2003-12-23 08:09:43 +00001547 assert (circuit);
1548
1549 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1550 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1551
1552 return CMD_SUCCESS;
1553}
1554
1555ALIAS (no_isis_hello_multiplier,
1556 no_isis_hello_multiplier_arg_cmd,
1557 "no isis hello-multiplier <3-1000>",
1558 NO_STR
1559 "IS-IS commands\n"
1560 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001561 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001562
1563DEFUN (isis_hello_multiplier_l1,
1564 isis_hello_multiplier_l1_cmd,
1565 "isis hello-multiplier <3-1000> level-1",
1566 "IS-IS commands\n"
1567 "Set multiplier for Hello holding time\n"
1568 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001569 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001570{
1571 struct isis_circuit *circuit;
1572 struct interface *ifp;
1573 int mult;
hassof390d2c2004-09-10 20:48:21 +00001574
1575 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001576 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001577 if (circuit == NULL)
1578 {
1579 return CMD_WARNING;
1580 }
jardineb5d44e2003-12-23 08:09:43 +00001581 assert (circuit);
1582
1583 mult = atoi (argv[0]);
1584
hassof390d2c2004-09-10 20:48:21 +00001585 circuit->hello_multiplier[0] = (u_int16_t) mult;
1586
jardineb5d44e2003-12-23 08:09:43 +00001587 return CMD_SUCCESS;
1588}
1589
1590DEFUN (no_isis_hello_multiplier_l1,
1591 no_isis_hello_multiplier_l1_cmd,
1592 "no isis hello-multiplier level-1",
1593 NO_STR
1594 "IS-IS commands\n"
1595 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001596 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001597{
1598 struct isis_circuit *circuit;
1599 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001600
1601 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001602 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001603 if (circuit == NULL)
1604 {
1605 return CMD_WARNING;
1606 }
jardineb5d44e2003-12-23 08:09:43 +00001607 assert (circuit);
1608
1609 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1610
1611 return CMD_SUCCESS;
1612}
1613
1614ALIAS (no_isis_hello_multiplier_l1,
1615 no_isis_hello_multiplier_l1_arg_cmd,
1616 "no isis hello-multiplier <3-1000> level-1",
1617 NO_STR
1618 "IS-IS commands\n"
1619 "Set multiplier for Hello holding time\n"
1620 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001621 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001622
1623DEFUN (isis_hello_multiplier_l2,
1624 isis_hello_multiplier_l2_cmd,
1625 "isis hello-multiplier <3-1000> level-2",
1626 "IS-IS commands\n"
1627 "Set multiplier for Hello holding time\n"
1628 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001629 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001630{
1631 struct isis_circuit *circuit;
1632 struct interface *ifp;
1633 int mult;
hassof390d2c2004-09-10 20:48:21 +00001634
1635 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001636 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001637 if (circuit == NULL)
1638 {
1639 return CMD_WARNING;
1640 }
jardineb5d44e2003-12-23 08:09:43 +00001641 assert (circuit);
1642
1643 mult = atoi (argv[0]);
1644
hassof390d2c2004-09-10 20:48:21 +00001645 circuit->hello_multiplier[1] = (u_int16_t) mult;
1646
jardineb5d44e2003-12-23 08:09:43 +00001647 return CMD_SUCCESS;
1648}
1649
1650DEFUN (no_isis_hello_multiplier_l2,
1651 no_isis_hello_multiplier_l2_cmd,
1652 "no isis hello-multiplier level-2",
1653 NO_STR
1654 "IS-IS commands\n"
1655 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001656 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001657{
1658 struct isis_circuit *circuit;
1659 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001660
1661 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001662 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001663 if (circuit == NULL)
1664 {
1665 return CMD_WARNING;
1666 }
jardineb5d44e2003-12-23 08:09:43 +00001667 assert (circuit);
1668
1669 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1670
1671 return CMD_SUCCESS;
1672}
1673
1674ALIAS (no_isis_hello_multiplier_l2,
1675 no_isis_hello_multiplier_l2_arg_cmd,
1676 "no isis hello-multiplier <3-1000> level-2",
1677 NO_STR
1678 "IS-IS commands\n"
1679 "Set multiplier for Hello holding time\n"
1680 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001681 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001682
1683DEFUN (isis_hello,
1684 isis_hello_cmd,
1685 "isis hello padding",
1686 "IS-IS commands\n"
1687 "Add padding to IS-IS hello packets\n"
1688 "Pad hello packets\n"
1689 "<cr>\n")
1690{
1691 struct interface *ifp;
1692 struct isis_circuit *circuit;
hassof390d2c2004-09-10 20:48:21 +00001693
1694 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001695 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001696 if (circuit == NULL)
1697 {
1698 return CMD_WARNING;
1699 }
jardineb5d44e2003-12-23 08:09:43 +00001700 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001701
jardineb5d44e2003-12-23 08:09:43 +00001702 circuit->u.bc.pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00001703
jardineb5d44e2003-12-23 08:09:43 +00001704 return CMD_SUCCESS;
1705}
1706
jardineb5d44e2003-12-23 08:09:43 +00001707DEFUN (no_isis_hello,
1708 no_isis_hello_cmd,
1709 "no isis hello padding",
1710 NO_STR
1711 "IS-IS commands\n"
1712 "Add padding to IS-IS hello packets\n"
1713 "Pad hello packets\n"
1714 "<cr>\n")
1715{
1716 struct isis_circuit *circuit;
1717 struct interface *ifp;
1718
hassof390d2c2004-09-10 20:48:21 +00001719 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001720 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001721 if (circuit == NULL)
1722 {
1723 return CMD_WARNING;
1724 }
jardineb5d44e2003-12-23 08:09:43 +00001725 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001726
jardineb5d44e2003-12-23 08:09:43 +00001727 circuit->u.bc.pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00001728
jardineb5d44e2003-12-23 08:09:43 +00001729 return CMD_SUCCESS;
1730}
1731
1732DEFUN (csnp_interval,
1733 csnp_interval_cmd,
1734 "isis csnp-interval <0-65535>",
1735 "IS-IS commands\n"
1736 "Set CSNP interval in seconds\n"
1737 "CSNP interval value\n")
1738{
1739 struct isis_circuit *circuit;
1740 struct interface *ifp;
1741 unsigned long interval;
1742
hassof390d2c2004-09-10 20:48:21 +00001743 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001744 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001745 if (circuit == NULL)
1746 {
1747 return CMD_WARNING;
1748 }
jardineb5d44e2003-12-23 08:09:43 +00001749 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001750
jardineb5d44e2003-12-23 08:09:43 +00001751 interval = atol (argv[0]);
1752
hassof390d2c2004-09-10 20:48:21 +00001753 circuit->csnp_interval[0] = (u_int16_t) interval;
1754 circuit->csnp_interval[1] = (u_int16_t) interval;
1755
jardineb5d44e2003-12-23 08:09:43 +00001756 return CMD_SUCCESS;
1757}
1758
1759DEFUN (no_csnp_interval,
1760 no_csnp_interval_cmd,
1761 "no isis csnp-interval",
1762 NO_STR
1763 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001764 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001765{
1766 struct isis_circuit *circuit;
1767 struct interface *ifp;
1768
hassof390d2c2004-09-10 20:48:21 +00001769 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001770 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001771 if (circuit == NULL)
1772 {
1773 return CMD_WARNING;
1774 }
jardineb5d44e2003-12-23 08:09:43 +00001775 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001776
jardineb5d44e2003-12-23 08:09:43 +00001777 circuit->csnp_interval[0] = CSNP_INTERVAL;
1778 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001779
jardineb5d44e2003-12-23 08:09:43 +00001780 return CMD_SUCCESS;
1781}
1782
1783ALIAS (no_csnp_interval,
1784 no_csnp_interval_arg_cmd,
1785 "no isis csnp-interval <0-65535>",
1786 NO_STR
1787 "IS-IS commands\n"
1788 "Set CSNP interval in seconds\n"
1789 "CSNP interval value\n")
1790
jardineb5d44e2003-12-23 08:09:43 +00001791DEFUN (csnp_interval_l1,
1792 csnp_interval_l1_cmd,
1793 "isis csnp-interval <0-65535> level-1",
1794 "IS-IS commands\n"
1795 "Set CSNP interval in seconds\n"
1796 "CSNP interval value\n"
1797 "Specify interval for level-1 CSNPs\n")
1798{
1799 struct isis_circuit *circuit;
1800 struct interface *ifp;
1801 unsigned long interval;
1802
hassof390d2c2004-09-10 20:48:21 +00001803 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001804 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001805 if (circuit == NULL)
1806 {
1807 return CMD_WARNING;
1808 }
jardineb5d44e2003-12-23 08:09:43 +00001809 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001810
jardineb5d44e2003-12-23 08:09:43 +00001811 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001812
1813 circuit->csnp_interval[0] = (u_int16_t) interval;
1814
jardineb5d44e2003-12-23 08:09:43 +00001815 return CMD_SUCCESS;
1816}
1817
1818DEFUN (no_csnp_interval_l1,
1819 no_csnp_interval_l1_cmd,
1820 "no isis csnp-interval level-1",
1821 NO_STR
1822 "IS-IS commands\n"
1823 "Set CSNP interval in seconds\n"
1824 "Specify interval for level-1 CSNPs\n")
1825{
1826 struct isis_circuit *circuit;
1827 struct interface *ifp;
1828
hassof390d2c2004-09-10 20:48:21 +00001829 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001830 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001831 if (circuit == NULL)
1832 {
1833 return CMD_WARNING;
1834 }
jardineb5d44e2003-12-23 08:09:43 +00001835 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001836
jardineb5d44e2003-12-23 08:09:43 +00001837 circuit->csnp_interval[0] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001838
jardineb5d44e2003-12-23 08:09:43 +00001839 return CMD_SUCCESS;
1840}
1841
1842ALIAS (no_csnp_interval_l1,
1843 no_csnp_interval_l1_arg_cmd,
1844 "no isis csnp-interval <0-65535> level-1",
1845 NO_STR
1846 "IS-IS commands\n"
1847 "Set CSNP interval in seconds\n"
1848 "CSNP interval value\n"
1849 "Specify interval for level-1 CSNPs\n")
1850
jardineb5d44e2003-12-23 08:09:43 +00001851DEFUN (csnp_interval_l2,
1852 csnp_interval_l2_cmd,
1853 "isis csnp-interval <0-65535> level-2",
1854 "IS-IS commands\n"
1855 "Set CSNP interval in seconds\n"
1856 "CSNP interval value\n"
1857 "Specify interval for level-2 CSNPs\n")
1858{
1859 struct isis_circuit *circuit;
1860 struct interface *ifp;
1861 unsigned long interval;
1862
hassof390d2c2004-09-10 20:48:21 +00001863 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001864 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001865 if (circuit == NULL)
1866 {
1867 return CMD_WARNING;
1868 }
jardineb5d44e2003-12-23 08:09:43 +00001869 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001870
jardineb5d44e2003-12-23 08:09:43 +00001871 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001872
1873 circuit->csnp_interval[1] = (u_int16_t) interval;
1874
jardineb5d44e2003-12-23 08:09:43 +00001875 return CMD_SUCCESS;
1876}
1877
1878DEFUN (no_csnp_interval_l2,
1879 no_csnp_interval_l2_cmd,
1880 "no isis csnp-interval level-2",
1881 NO_STR
1882 "IS-IS commands\n"
1883 "Set CSNP interval in seconds\n"
1884 "Specify interval for level-2 CSNPs\n")
1885{
1886 struct isis_circuit *circuit;
1887 struct interface *ifp;
1888
hassof390d2c2004-09-10 20:48:21 +00001889 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001890 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001891 if (circuit == NULL)
1892 {
1893 return CMD_WARNING;
1894 }
jardineb5d44e2003-12-23 08:09:43 +00001895 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001896
jardineb5d44e2003-12-23 08:09:43 +00001897 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001898
jardineb5d44e2003-12-23 08:09:43 +00001899 return CMD_SUCCESS;
1900}
1901
1902ALIAS (no_csnp_interval_l2,
1903 no_csnp_interval_l2_arg_cmd,
1904 "no isis csnp-interval <0-65535> level-2",
1905 NO_STR
1906 "IS-IS commands\n"
1907 "Set CSNP interval in seconds\n"
1908 "CSNP interval value\n"
1909 "Specify interval for level-2 CSNPs\n")
1910
jardineb5d44e2003-12-23 08:09:43 +00001911#ifdef HAVE_IPV6
1912DEFUN (ipv6_router_isis,
1913 ipv6_router_isis_cmd,
1914 "ipv6 router isis WORD",
1915 "IPv6 interface subcommands\n"
1916 "IPv6 Router interface commands\n"
1917 "IS-IS Routing for IPv6\n"
1918 "Routing process tag\n")
1919{
1920 struct isis_circuit *c;
1921 struct interface *ifp;
1922 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001923
1924 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001925 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001926
jardineb5d44e2003-12-23 08:09:43 +00001927 area = isis_area_lookup (argv[0]);
1928
1929 /* Prevent more than one circuit per interface */
1930 if (area)
1931 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001932 else
1933 c = NULL;
1934
1935 if (c && (ifp->info != NULL))
1936 {
1937 if (c->ipv6_router == 1)
1938 {
1939 vty_out (vty, "ISIS circuit is already defined for IPv6%s",
1940 VTY_NEWLINE);
1941 return CMD_WARNING;
1942 }
jardineb5d44e2003-12-23 08:09:43 +00001943 }
jardineb5d44e2003-12-23 08:09:43 +00001944
1945 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +00001946 if (!area)
1947 {
1948 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1949 return CMD_WARNING;
1950 }
jardineb5d44e2003-12-23 08:09:43 +00001951
hassof390d2c2004-09-10 20:48:21 +00001952 if (!c)
1953 {
1954 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1955 c = isis_csm_state_change (ISIS_ENABLE, c, area);
1956 c->interface = ifp;
1957 ifp->info = c;
1958 }
jardineb5d44e2003-12-23 08:09:43 +00001959
hassof390d2c2004-09-10 20:48:21 +00001960 if (!c)
jardineb5d44e2003-12-23 08:09:43 +00001961 return CMD_WARNING;
1962
1963 c->ipv6_router = 1;
1964 area->ipv6_circuits++;
1965 circuit_update_nlpids (c);
1966
1967 vty->node = INTERFACE_NODE;
1968
1969 return CMD_SUCCESS;
1970}
1971
1972DEFUN (no_ipv6_router_isis,
1973 no_ipv6_router_isis_cmd,
1974 "no ipv6 router isis WORD",
1975 NO_STR
1976 "IPv6 interface subcommands\n"
1977 "IPv6 Router interface commands\n"
1978 "IS-IS Routing for IPv6\n"
1979 "Routing process tag\n")
1980{
1981 struct isis_circuit *c;
1982 struct interface *ifp;
1983 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001984
1985 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001986 /* UGLY - will remove l8r
1987 if (circuit == NULL) {
hassof390d2c2004-09-10 20:48:21 +00001988 return CMD_WARNING;
1989 } */
jardineb5d44e2003-12-23 08:09:43 +00001990 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001991
jardineb5d44e2003-12-23 08:09:43 +00001992 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001993 if (!area)
1994 {
1995 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1996 return CMD_WARNING;
1997 }
1998
jardineb5d44e2003-12-23 08:09:43 +00001999 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
2000 if (!c)
2001 return CMD_WARNING;
2002
2003 c->ipv6_router = 0;
2004 area->ipv6_circuits--;
2005 if (c->ip_router == 0)
2006 isis_csm_state_change (ISIS_DISABLE, c, area);
2007
2008 return CMD_SUCCESS;
2009}
hassof390d2c2004-09-10 20:48:21 +00002010#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00002011
hassof390d2c2004-09-10 20:48:21 +00002012struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002013 INTERFACE_NODE,
2014 "%s(config-if)# ",
2015 1,
2016};
2017
jardineb5d44e2003-12-23 08:09:43 +00002018int
2019isis_if_new_hook (struct interface *ifp)
2020{
2021/* FIXME: Discuss if the circuit should be created here
2022 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2023 ifp->info = NULL;
2024 return 0;
2025}
2026
2027int
2028isis_if_delete_hook (struct interface *ifp)
2029{
2030/* FIXME: Discuss if the circuit should be created here
2031 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2032 ifp->info = NULL;
2033 return 0;
2034}
2035
jardineb5d44e2003-12-23 08:09:43 +00002036void
2037isis_circuit_init ()
2038{
jardineb5d44e2003-12-23 08:09:43 +00002039 /* Initialize Zebra interface data structure */
2040 if_init ();
2041 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2042 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2043
2044 /* Install interface node */
2045 install_node (&interface_node, isis_interface_config_write);
2046 install_element (CONFIG_NODE, &interface_cmd);
2047
2048 install_default (INTERFACE_NODE);
2049 install_element (INTERFACE_NODE, &interface_desc_cmd);
2050 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2051
2052 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2053 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2054
2055 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2056 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2057
2058 install_element (INTERFACE_NODE, &isis_passwd_cmd);
2059 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2060
2061 install_element (INTERFACE_NODE, &isis_priority_cmd);
2062 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2063 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2064 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2065 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2066 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2067 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2068 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2069 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2070
2071 install_element (INTERFACE_NODE, &isis_metric_cmd);
2072 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2073 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2074
2075 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2076 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2077 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2078 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2079 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2080 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2081 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2082 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2083 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2084
2085 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2086 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2087 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2088 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2089 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2090 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2091 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2092 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2093 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2094
2095 install_element (INTERFACE_NODE, &isis_hello_cmd);
2096 install_element (INTERFACE_NODE, &no_isis_hello_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002097 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2098 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2099 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2100 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2101 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2102 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2103 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2104 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2105 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2106
2107#ifdef HAVE_IPV6
2108 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2109 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002110#endif
jardineb5d44e2003-12-23 08:09:43 +00002111}