blob: ee73dc44358af17a96a60ba2e5d5902a8278c702 [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
hasso3fdb2dd2005-09-28 18:45:54 +000069 circuit = XCALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit));
hassof390d2c2004-09-10 20:48:21 +000070 if (circuit)
71 {
hassof390d2c2004-09-10 20:48:21 +000072 /* set default metrics for circuit */
73 for (i = 0; i < 2; i++)
74 {
75 circuit->metrics[i].metric_default = DEFAULT_CIRCUIT_METRICS;
76 circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED;
77 circuit->metrics[i].metric_error = METRICS_UNSUPPORTED;
78 circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED;
hassof21fb272005-09-26 17:05:55 +000079 circuit->te_metric[i] = DEFAULT_CIRCUIT_METRICS;
hassof390d2c2004-09-10 20:48:21 +000080 }
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;
hasso3fdb2dd2005-09-28 18:45:54 +0000623 struct listnode *node, *node2;
jardineb5d44e2003-12-23 08:09:43 +0000624 struct interface *ifp;
625 struct isis_area *area;
626 struct isis_circuit *c;
jardineb5d44e2003-12-23 08:09:43 +0000627 int i;
jardineb5d44e2003-12-23 08:09:43 +0000628
hasso3fdb2dd2005-09-28 18:45:54 +0000629 for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
jardineb5d44e2003-12-23 08:09:43 +0000630 {
631 /* IF name */
hassof390d2c2004-09-10 20:48:21 +0000632 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000633 write++;
634 /* IF desc */
hassof390d2c2004-09-10 20:48:21 +0000635 if (ifp->desc)
636 {
637 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
638 write++;
639 }
jardineb5d44e2003-12-23 08:09:43 +0000640 /* ISIS Circuit */
hasso3fdb2dd2005-09-28 18:45:54 +0000641 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node2, area))
jardineb5d44e2003-12-23 08:09:43 +0000642 {
643 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000644 if (c)
645 {
646 if (c->ip_router)
647 {
648 vty_out (vty, " ip router isis %s%s", area->area_tag,
649 VTY_NEWLINE);
650 write++;
651 }
jardineb5d44e2003-12-23 08:09:43 +0000652#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000653 if (c->ipv6_router)
654 {
655 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
656 VTY_NEWLINE);
657 write++;
658 }
jardineb5d44e2003-12-23 08:09:43 +0000659#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000660
hassof390d2c2004-09-10 20:48:21 +0000661 /* ISIS - circuit type */
662 if (c->circuit_is_type == IS_LEVEL_1)
663 {
664 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
665 write++;
666 }
667 else
668 {
669 if (c->circuit_is_type == IS_LEVEL_2)
670 {
671 vty_out (vty, " isis circuit-type level-2-only%s",
672 VTY_NEWLINE);
673 write++;
674 }
675 }
jardineb5d44e2003-12-23 08:09:43 +0000676
hassof390d2c2004-09-10 20:48:21 +0000677 /* ISIS - CSNP interval - FIXME: compare to cisco */
678 if (c->csnp_interval[0] == c->csnp_interval[1])
679 {
680 if (c->csnp_interval[0] != CSNP_INTERVAL)
681 {
682 vty_out (vty, " isis csnp-interval %d%s",
683 c->csnp_interval[0], VTY_NEWLINE);
684 write++;
685 }
686 }
687 else
688 {
689 for (i = 0; i < 2; i++)
690 {
691 if (c->csnp_interval[1] != CSNP_INTERVAL)
692 {
693 vty_out (vty, " isis csnp-interval %d level-%d%s",
694 c->csnp_interval[1], i + 1, VTY_NEWLINE);
695 write++;
696 }
697 }
698 }
jardineb5d44e2003-12-23 08:09:43 +0000699
hassof390d2c2004-09-10 20:48:21 +0000700 /* ISIS - Hello padding - Defaults to true so only display if false */
701 if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos)
702 {
703 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
704 write++;
705 }
jardineb5d44e2003-12-23 08:09:43 +0000706
hassof390d2c2004-09-10 20:48:21 +0000707 /* ISIS - Hello interval - FIXME: compare to cisco */
708 if (c->hello_interval[0] == c->hello_interval[1])
709 {
710 if (c->hello_interval[0] != HELLO_INTERVAL)
711 {
712 vty_out (vty, " isis hello-interval %d%s",
713 c->hello_interval[0], VTY_NEWLINE);
714 write++;
715 }
716 }
717 else
718 {
719 for (i = 0; i < 2; i++)
720 {
721 if (c->hello_interval[i] != HELLO_INTERVAL)
722 {
723 if (c->hello_interval[i] == HELLO_MINIMAL)
724 {
725 vty_out (vty,
726 " isis hello-interval minimal level-%d%s",
727 i + 1, VTY_NEWLINE);
728 }
729 else
730 {
731 vty_out (vty, " isis hello-interval %d level-%d%s",
732 c->hello_interval[i], i + 1, VTY_NEWLINE);
733 }
734 write++;
735 }
736 }
737 }
jardineb5d44e2003-12-23 08:09:43 +0000738
hassof390d2c2004-09-10 20:48:21 +0000739 /* ISIS - Hello Multiplier */
740 if (c->hello_multiplier[0] == c->hello_multiplier[1])
741 {
742 if (c->hello_multiplier[0] != HELLO_MULTIPLIER)
743 {
744 vty_out (vty, " isis hello-multiplier %d%s",
745 c->hello_multiplier[0], VTY_NEWLINE);
746 write++;
747 }
748 }
749 else
750 {
751 for (i = 0; i < 2; i++)
752 {
753 if (c->hello_multiplier[i] != HELLO_MULTIPLIER)
754 {
755 vty_out (vty, " isis hello-multiplier %d level-%d%s",
756 c->hello_multiplier[i], i + 1, VTY_NEWLINE);
757 write++;
758 }
759 }
760 }
761 /* ISIS - Priority */
762 if (c->circ_type == CIRCUIT_T_BROADCAST)
763 {
764 if (c->u.bc.priority[0] == c->u.bc.priority[1])
765 {
766 if (c->u.bc.priority[0] != DEFAULT_PRIORITY)
767 {
768 vty_out (vty, " isis priority %d%s",
769 c->u.bc.priority[0], VTY_NEWLINE);
770 write++;
771 }
772 }
773 else
774 {
775 for (i = 0; i < 2; i++)
776 {
777 if (c->u.bc.priority[i] != DEFAULT_PRIORITY)
778 {
779 vty_out (vty, " isis priority %d level-%d%s",
780 c->u.bc.priority[i], i + 1, VTY_NEWLINE);
781 write++;
782 }
783 }
784 }
785 }
786 /* ISIS - Metric */
hassof21fb272005-09-26 17:05:55 +0000787 if (c->te_metric[0] == c->te_metric[1])
hassof390d2c2004-09-10 20:48:21 +0000788 {
hassof21fb272005-09-26 17:05:55 +0000789 if (c->te_metric[0] != DEFAULT_CIRCUIT_METRICS)
hassof390d2c2004-09-10 20:48:21 +0000790 {
hassof21fb272005-09-26 17:05:55 +0000791 vty_out (vty, " isis metric %d%s", c->te_metric[0],
792 VTY_NEWLINE);
hassof390d2c2004-09-10 20:48:21 +0000793 write++;
794 }
795 }
796 else
797 {
798 for (i = 0; i < 2; i++)
799 {
hassof21fb272005-09-26 17:05:55 +0000800 if (c->te_metric[i] != DEFAULT_CIRCUIT_METRICS)
hassof390d2c2004-09-10 20:48:21 +0000801 {
802 vty_out (vty, " isis metric %d level-%d%s",
hassof21fb272005-09-26 17:05:55 +0000803 c->te_metric[i], i + 1, VTY_NEWLINE);
hassof390d2c2004-09-10 20:48:21 +0000804 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 */
hassoc89c05d2005-09-04 21:36:36 +0000845 /* FIXME: Find the way to warn only vty users. */
846 /* vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE); */
hassof390d2c2004-09-10 20:48:21 +0000847 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000848#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000849 }
850#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000851 }
hassof390d2c2004-09-10 20:48:21 +0000852
jardineb5d44e2003-12-23 08:09:43 +0000853 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +0000854 if (!area)
855 {
hassoc89c05d2005-09-04 21:36:36 +0000856 /* FIXME: Find the way to warn only vty users. */
857 /* vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); */
hassof390d2c2004-09-10 20:48:21 +0000858 return CMD_WARNING;
859 }
jardineb5d44e2003-12-23 08:09:43 +0000860
hassof390d2c2004-09-10 20:48:21 +0000861 if (!c)
862 {
863 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
864 c = isis_csm_state_change (ISIS_ENABLE, c, area);
865 c->interface = ifp; /* this is automatic */
866 ifp->info = c; /* hardly related to the FSM */
867 }
jardineb5d44e2003-12-23 08:09:43 +0000868
hassof390d2c2004-09-10 20:48:21 +0000869 if (!c)
jardineb5d44e2003-12-23 08:09:43 +0000870 return CMD_WARNING;
871
872 c->ip_router = 1;
873 area->ip_circuits++;
874 circuit_update_nlpids (c);
875
876 vty->node = INTERFACE_NODE;
hassof390d2c2004-09-10 20:48:21 +0000877
jardineb5d44e2003-12-23 08:09:43 +0000878 return CMD_SUCCESS;
879}
880
881DEFUN (no_ip_router_isis,
882 no_ip_router_isis_cmd,
883 "no ip router isis WORD",
884 NO_STR
885 "Interface Internet Protocol config commands\n"
886 "IP router interface commands\n"
887 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000888 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000889{
890 struct isis_circuit *circuit = NULL;
891 struct interface *ifp;
892 struct isis_area *area;
hasso3fdb2dd2005-09-28 18:45:54 +0000893 struct listnode *node;
jardineb5d44e2003-12-23 08:09:43 +0000894
hassof390d2c2004-09-10 20:48:21 +0000895 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000896 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000897
jardineb5d44e2003-12-23 08:09:43 +0000898 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +0000899 if (!area)
900 {
901 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
902 return CMD_WARNING;
903 }
hasso3fdb2dd2005-09-28 18:45:54 +0000904 for (ALL_LIST_ELEMENTS_RO (area->circuit_list, node, circuit))
jardineb5d44e2003-12-23 08:09:43 +0000905 if (circuit->interface == ifp)
906 break;
hassof390d2c2004-09-10 20:48:21 +0000907 if (!circuit)
908 {
909 vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE);
910 return CMD_WARNING;
911 }
jardineb5d44e2003-12-23 08:09:43 +0000912 circuit->ip_router = 0;
913 area->ip_circuits--;
914#ifdef HAVE_IPV6
915 if (circuit->ipv6_router == 0)
916#endif
917 isis_csm_state_change (ISIS_DISABLE, circuit, area);
hassof390d2c2004-09-10 20:48:21 +0000918
jardineb5d44e2003-12-23 08:09:43 +0000919 return CMD_SUCCESS;
920}
921
922DEFUN (isis_circuit_type,
923 isis_circuit_type_cmd,
924 "isis circuit-type (level-1|level-1-2|level-2-only)",
925 "IS-IS commands\n"
926 "Configure circuit type for interface\n"
927 "Level-1 only adjacencies are formed\n"
928 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000929 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000930{
931 struct isis_circuit *circuit;
932 struct interface *ifp;
933 int circuit_t;
934 int is_type;
hassof390d2c2004-09-10 20:48:21 +0000935
936 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000937 circuit = ifp->info;
938 /* UGLY - will remove l8r */
hassof390d2c2004-09-10 20:48:21 +0000939 if (circuit == NULL)
940 {
941 return CMD_WARNING;
942 }
jardineb5d44e2003-12-23 08:09:43 +0000943
hasso13c48f72004-09-10 21:19:13 +0000944 /* XXX what to do when ip_router_isis is not executed */
945 if (circuit->area == NULL)
946 return CMD_WARNING;
947
jardineb5d44e2003-12-23 08:09:43 +0000948 assert (circuit);
949
hassof7c43dc2004-09-26 16:24:14 +0000950 circuit_t = string2circuit_t ((u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000951
hassof390d2c2004-09-10 20:48:21 +0000952 if (!circuit_t)
953 {
954 vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
955 return CMD_SUCCESS;
956 }
957
jardineb5d44e2003-12-23 08:09:43 +0000958 is_type = circuit->area->is_type;
959 if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t)
hassof390d2c2004-09-10 20:48:21 +0000960 isis_event_circuit_type_change (circuit, circuit_t);
961 else
962 {
963 vty_out (vty, "invalid circuit level for area %s.%s",
964 circuit->area->area_tag, VTY_NEWLINE);
965 }
966
jardineb5d44e2003-12-23 08:09:43 +0000967 return CMD_SUCCESS;
968}
969
970DEFUN (no_isis_circuit_type,
971 no_isis_circuit_type_cmd,
972 "no isis circuit-type (level-1|level-1-2|level-2-only)",
973 NO_STR
974 "IS-IS commands\n"
975 "Configure circuit type for interface\n"
976 "Level-1 only adjacencies are formed\n"
977 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000978 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000979{
980 struct isis_circuit *circuit;
981 struct interface *ifp;
jardineb5d44e2003-12-23 08:09:43 +0000982
hassof390d2c2004-09-10 20:48:21 +0000983 ifp = vty->index;
984 circuit = ifp->info;
985 if (circuit == NULL)
986 {
987 return CMD_WARNING;
988 }
989
990 assert (circuit);
991
jardineb5d44e2003-12-23 08:09:43 +0000992 /*
993 * Set the circuits level to its default value which is that of the area
994 */
995 isis_event_circuit_type_change (circuit, circuit->area->is_type);
hassof390d2c2004-09-10 20:48:21 +0000996
jardineb5d44e2003-12-23 08:09:43 +0000997 return CMD_SUCCESS;
998}
999
1000DEFUN (isis_passwd,
1001 isis_passwd_cmd,
1002 "isis password WORD",
1003 "IS-IS commands\n"
1004 "Configure the authentication password for interface\n"
1005 "Password\n")
1006{
1007 struct isis_circuit *circuit;
1008 struct interface *ifp;
1009 int len;
hassof390d2c2004-09-10 20:48:21 +00001010
1011 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001012 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001013 if (circuit == NULL)
1014 {
1015 return CMD_WARNING;
1016 }
1017
jardineb5d44e2003-12-23 08:09:43 +00001018 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001019 if (len > 254)
1020 {
1021 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
1022 return CMD_WARNING;
1023 }
jardineb5d44e2003-12-23 08:09:43 +00001024 circuit->passwd.len = len;
1025 circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001026 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001027
jardineb5d44e2003-12-23 08:09:43 +00001028 return CMD_SUCCESS;
1029}
1030
1031DEFUN (no_isis_passwd,
1032 no_isis_passwd_cmd,
1033 "no isis password",
1034 NO_STR
1035 "IS-IS commands\n"
1036 "Configure the authentication password for interface\n")
1037{
1038 struct isis_circuit *circuit;
1039 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001040
1041 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001042 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001043 if (circuit == NULL)
1044 {
1045 return CMD_WARNING;
1046 }
1047
jardineb5d44e2003-12-23 08:09:43 +00001048 memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001049
jardineb5d44e2003-12-23 08:09:43 +00001050 return CMD_SUCCESS;
1051}
1052
1053
1054DEFUN (isis_priority,
1055 isis_priority_cmd,
1056 "isis priority <0-127>",
1057 "IS-IS commands\n"
1058 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001059 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001060{
1061 struct isis_circuit *circuit;
1062 struct interface *ifp;
1063 int prio;
hassof390d2c2004-09-10 20:48:21 +00001064
1065 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001066 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001067 if (circuit == NULL)
1068 {
1069 return CMD_WARNING;
1070 }
jardineb5d44e2003-12-23 08:09:43 +00001071 assert (circuit);
1072
1073 prio = atoi (argv[0]);
1074
1075 circuit->u.bc.priority[0] = prio;
1076 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001077
jardineb5d44e2003-12-23 08:09:43 +00001078 return CMD_SUCCESS;
1079}
1080
1081DEFUN (no_isis_priority,
1082 no_isis_priority_cmd,
1083 "no isis priority",
1084 NO_STR
1085 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001086 "Set priority for Designated Router election\n")
jardineb5d44e2003-12-23 08:09:43 +00001087{
1088 struct isis_circuit *circuit;
1089 struct interface *ifp;
1090
hassof390d2c2004-09-10 20:48:21 +00001091 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001092 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001093 if (circuit == NULL)
1094 {
1095 return CMD_WARNING;
1096 }
jardineb5d44e2003-12-23 08:09:43 +00001097 assert (circuit);
1098
1099 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
1100 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001101
jardineb5d44e2003-12-23 08:09:43 +00001102 return CMD_SUCCESS;
1103}
1104
1105ALIAS (no_isis_priority,
1106 no_isis_priority_arg_cmd,
1107 "no isis priority <0-127>",
1108 NO_STR
1109 "IS-IS commands\n"
1110 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001111 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001112
1113DEFUN (isis_priority_l1,
1114 isis_priority_l1_cmd,
hassof390d2c2004-09-10 20:48:21 +00001115 "isis priority <0-127> level-1",
jardineb5d44e2003-12-23 08:09:43 +00001116 "IS-IS commands\n"
1117 "Set priority for Designated Router election\n"
1118 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001119 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001120{
1121 struct isis_circuit *circuit;
1122 struct interface *ifp;
1123 int prio;
hassof390d2c2004-09-10 20:48:21 +00001124
1125 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001126 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001127 if (circuit == NULL)
1128 {
1129 return CMD_WARNING;
1130 }
jardineb5d44e2003-12-23 08:09:43 +00001131 assert (circuit);
1132
1133 prio = atoi (argv[0]);
1134
1135 circuit->u.bc.priority[0] = prio;
hassof390d2c2004-09-10 20:48:21 +00001136
jardineb5d44e2003-12-23 08:09:43 +00001137 return CMD_SUCCESS;
1138}
1139
1140DEFUN (no_isis_priority_l1,
1141 no_isis_priority_l1_cmd,
1142 "no isis priority level-1",
1143 NO_STR
1144 "IS-IS commands\n"
1145 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001146 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001147{
1148 struct isis_circuit *circuit;
1149 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001150
1151 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001152 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001153 if (circuit == NULL)
1154 {
1155 return CMD_WARNING;
1156 }
jardineb5d44e2003-12-23 08:09:43 +00001157 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001158
jardineb5d44e2003-12-23 08:09:43 +00001159 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001160
jardineb5d44e2003-12-23 08:09:43 +00001161 return CMD_SUCCESS;
1162}
1163
1164ALIAS (no_isis_priority_l1,
1165 no_isis_priority_l1_arg_cmd,
1166 "no isis priority <0-127> level-1",
1167 NO_STR
1168 "IS-IS commands\n"
1169 "Set priority for Designated Router election\n"
1170 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001171 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001172
1173DEFUN (isis_priority_l2,
1174 isis_priority_l2_cmd,
hassof390d2c2004-09-10 20:48:21 +00001175 "isis priority <0-127> level-2",
jardineb5d44e2003-12-23 08:09:43 +00001176 "IS-IS commands\n"
1177 "Set priority for Designated Router election\n"
1178 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001179 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001180{
1181 struct isis_circuit *circuit;
1182 struct interface *ifp;
1183 int prio;
hassof390d2c2004-09-10 20:48:21 +00001184
1185 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001186 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001187 if (circuit == NULL)
1188 {
1189 return CMD_WARNING;
1190 }
jardineb5d44e2003-12-23 08:09:43 +00001191 assert (circuit);
1192
1193 prio = atoi (argv[0]);
1194
1195 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001196
jardineb5d44e2003-12-23 08:09:43 +00001197 return CMD_SUCCESS;
1198}
1199
1200DEFUN (no_isis_priority_l2,
1201 no_isis_priority_l2_cmd,
1202 "no isis priority level-2",
1203 NO_STR
1204 "IS-IS commands\n"
1205 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001206 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001207{
1208 struct isis_circuit *circuit;
1209 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001210
1211 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001212 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001213 if (circuit == NULL)
1214 {
1215 return CMD_WARNING;
1216 }
jardineb5d44e2003-12-23 08:09:43 +00001217 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001218
jardineb5d44e2003-12-23 08:09:43 +00001219 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001220
jardineb5d44e2003-12-23 08:09:43 +00001221 return CMD_SUCCESS;
1222}
1223
1224ALIAS (no_isis_priority_l2,
1225 no_isis_priority_l2_arg_cmd,
1226 "no isis priority <0-127> level-2",
1227 NO_STR
1228 "IS-IS commands\n"
1229 "Set priority for Designated Router election\n"
1230 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001231 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001232
1233/* Metric command */
hassof390d2c2004-09-10 20:48:21 +00001234 DEFUN (isis_metric,
jardineb5d44e2003-12-23 08:09:43 +00001235 isis_metric_cmd,
hassof21fb272005-09-26 17:05:55 +00001236 "isis metric <0-16777215>",
jardineb5d44e2003-12-23 08:09:43 +00001237 "IS-IS commands\n"
1238 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001239 "Default metric value\n")
jardineb5d44e2003-12-23 08:09:43 +00001240{
1241 struct isis_circuit *circuit;
1242 struct interface *ifp;
1243 int met;
1244
hassof390d2c2004-09-10 20:48:21 +00001245 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001246 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001247 if (circuit == NULL)
1248 {
1249 return CMD_WARNING;
1250 }
jardineb5d44e2003-12-23 08:09:43 +00001251 assert (circuit);
1252
1253 met = atoi (argv[0]);
1254
hassof21fb272005-09-26 17:05:55 +00001255 circuit->te_metric[0] = met;
1256 circuit->te_metric[1] = met;
1257
1258 if (met > 63)
1259 met = 63;
1260
jardineb5d44e2003-12-23 08:09:43 +00001261 circuit->metrics[0].metric_default = met;
1262 circuit->metrics[1].metric_default = met;
1263
1264 return CMD_SUCCESS;
1265}
1266
1267DEFUN (no_isis_metric,
1268 no_isis_metric_cmd,
1269 "no isis metric",
1270 NO_STR
1271 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001272 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001273{
1274 struct isis_circuit *circuit;
1275 struct interface *ifp;
1276
hassof390d2c2004-09-10 20:48:21 +00001277 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001278 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001279 if (circuit == NULL)
1280 {
1281 return CMD_WARNING;
1282 }
jardineb5d44e2003-12-23 08:09:43 +00001283 assert (circuit);
1284
hassof21fb272005-09-26 17:05:55 +00001285 circuit->te_metric[0] = DEFAULT_CIRCUIT_METRICS;
1286 circuit->te_metric[1] = DEFAULT_CIRCUIT_METRICS;
jardineb5d44e2003-12-23 08:09:43 +00001287 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1288 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1289
1290 return CMD_SUCCESS;
1291}
1292
1293ALIAS (no_isis_metric,
1294 no_isis_metric_arg_cmd,
hassof21fb272005-09-26 17:05:55 +00001295 "no isis metric <0-16777215>",
jardineb5d44e2003-12-23 08:09:43 +00001296 NO_STR
1297 "IS-IS commands\n"
1298 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001299 "Default metric value\n")
1300
jardineb5d44e2003-12-23 08:09:43 +00001301/* end of metrics */
hassof21fb272005-09-26 17:05:55 +00001302DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00001303 isis_hello_interval_cmd,
1304 "isis hello-interval (<1-65535>|minimal)",
1305 "IS-IS commands\n"
1306 "Set Hello interval\n"
1307 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001308 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001309{
1310 struct isis_circuit *circuit;
1311 struct interface *ifp;
1312 int interval;
1313 char c;
1314
hassof390d2c2004-09-10 20:48:21 +00001315 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001316 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001317 if (circuit == NULL)
1318 {
1319 return CMD_WARNING;
1320 }
1321 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001322 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001323 if (isdigit ((int) c))
1324 {
1325 interval = atoi (argv[0]);
1326 }
1327 else
1328 interval = HELLO_MINIMAL; /* FIXME: should be calculated */
jardineb5d44e2003-12-23 08:09:43 +00001329
hassof390d2c2004-09-10 20:48:21 +00001330 circuit->hello_interval[0] = (u_int16_t) interval;
1331 circuit->hello_interval[1] = (u_int16_t) interval;
1332
jardineb5d44e2003-12-23 08:09:43 +00001333 return CMD_SUCCESS;
1334}
1335
1336DEFUN (no_isis_hello_interval,
1337 no_isis_hello_interval_cmd,
1338 "no isis hello-interval",
1339 NO_STR
1340 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001341 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00001342{
1343 struct isis_circuit *circuit;
1344 struct interface *ifp;
1345
hassof390d2c2004-09-10 20:48:21 +00001346 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001347 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001348 if (circuit == NULL)
1349 {
1350 return CMD_WARNING;
1351 }
jardineb5d44e2003-12-23 08:09:43 +00001352 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001353
hassof390d2c2004-09-10 20:48:21 +00001354
1355 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
jardineb5d44e2003-12-23 08:09:43 +00001356 circuit->hello_interval[1] = HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001357
jardineb5d44e2003-12-23 08:09:43 +00001358 return CMD_SUCCESS;
1359}
1360
1361ALIAS (no_isis_hello_interval,
1362 no_isis_hello_interval_arg_cmd,
1363 "no isis hello-interval (<1-65535>|minimal)",
1364 NO_STR
1365 "IS-IS commands\n"
1366 "Set Hello interval\n"
1367 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001368 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001369
1370DEFUN (isis_hello_interval_l1,
1371 isis_hello_interval_l1_cmd,
1372 "isis hello-interval (<1-65535>|minimal) level-1",
1373 "IS-IS commands\n"
1374 "Set Hello interval\n"
1375 "Hello interval value\n"
1376 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001377 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001378{
1379 struct isis_circuit *circuit;
1380 struct interface *ifp;
1381 long interval;
1382 char c;
1383
hassof390d2c2004-09-10 20:48:21 +00001384 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001385 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001386 if (circuit == NULL)
1387 {
1388 return CMD_WARNING;
1389 }
jardineb5d44e2003-12-23 08:09:43 +00001390 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001391
jardineb5d44e2003-12-23 08:09:43 +00001392 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001393 if (isdigit ((int) c))
1394 {
1395 interval = atoi (argv[0]);
1396 }
1397 else
jardineb5d44e2003-12-23 08:09:43 +00001398 interval = HELLO_MINIMAL;
1399
hassof390d2c2004-09-10 20:48:21 +00001400 circuit->hello_interval[0] = (u_int16_t) interval;
1401
jardineb5d44e2003-12-23 08:09:43 +00001402 return CMD_SUCCESS;
1403}
1404
1405DEFUN (no_isis_hello_interval_l1,
1406 no_isis_hello_interval_l1_cmd,
1407 "no isis hello-interval level-1",
1408 NO_STR
1409 "IS-IS commands\n"
1410 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001411 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001412{
1413 struct isis_circuit *circuit;
1414 struct interface *ifp;
1415
hassof390d2c2004-09-10 20:48:21 +00001416 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001417 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001418 if (circuit == NULL)
1419 {
1420 return CMD_WARNING;
1421 }
jardineb5d44e2003-12-23 08:09:43 +00001422 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001423
hassof390d2c2004-09-10 20:48:21 +00001424
1425 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1426
jardineb5d44e2003-12-23 08:09:43 +00001427 return CMD_SUCCESS;
1428}
1429
1430ALIAS (no_isis_hello_interval_l1,
1431 no_isis_hello_interval_l1_arg_cmd,
1432 "no isis hello-interval (<1-65535>|minimal) level-1",
1433 NO_STR
1434 "IS-IS commands\n"
1435 "Set Hello interval\n"
1436 "Hello interval value\n"
1437 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001438 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001439
1440DEFUN (isis_hello_interval_l2,
1441 isis_hello_interval_l2_cmd,
1442 "isis hello-interval (<1-65535>|minimal) level-2",
1443 "IS-IS commands\n"
1444 "Set Hello interval\n"
1445 "Hello interval value\n"
1446 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001447 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001448{
1449 struct isis_circuit *circuit;
1450 struct interface *ifp;
1451 long interval;
1452 char c;
1453
hassof390d2c2004-09-10 20:48:21 +00001454 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001455 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001456 if (circuit == NULL)
1457 {
1458 return CMD_WARNING;
1459 }
jardineb5d44e2003-12-23 08:09:43 +00001460 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001461
jardineb5d44e2003-12-23 08:09:43 +00001462 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001463 if (isdigit ((int) c))
1464 {
1465 interval = atoi (argv[0]);
1466 }
1467 else
jardineb5d44e2003-12-23 08:09:43 +00001468 interval = HELLO_MINIMAL;
1469
hassof390d2c2004-09-10 20:48:21 +00001470 circuit->hello_interval[1] = (u_int16_t) interval;
1471
jardineb5d44e2003-12-23 08:09:43 +00001472 return CMD_SUCCESS;
1473}
1474
1475DEFUN (no_isis_hello_interval_l2,
1476 no_isis_hello_interval_l2_cmd,
1477 "no isis hello-interval level-2",
1478 NO_STR
1479 "IS-IS commands\n"
1480 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001481 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001482{
1483 struct isis_circuit *circuit;
1484 struct interface *ifp;
1485
hassof390d2c2004-09-10 20:48:21 +00001486 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001487 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001488 if (circuit == NULL)
1489 {
1490 return CMD_WARNING;
1491 }
jardineb5d44e2003-12-23 08:09:43 +00001492 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001493
hassof390d2c2004-09-10 20:48:21 +00001494
1495 circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1496
jardineb5d44e2003-12-23 08:09:43 +00001497 return CMD_SUCCESS;
1498}
1499
1500ALIAS (no_isis_hello_interval_l2,
1501 no_isis_hello_interval_l2_arg_cmd,
1502 "no isis hello-interval (<1-65535>|minimal) level-2",
1503 NO_STR
1504 "IS-IS commands\n"
1505 "Set Hello interval\n"
1506 "Hello interval value\n"
1507 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001508 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001509
1510DEFUN (isis_hello_multiplier,
1511 isis_hello_multiplier_cmd,
1512 "isis hello-multiplier <3-1000>",
1513 "IS-IS commands\n"
1514 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001515 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001516{
1517 struct isis_circuit *circuit;
1518 struct interface *ifp;
1519 int mult;
hassof390d2c2004-09-10 20:48:21 +00001520
1521 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001522 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001523 if (circuit == NULL)
1524 {
1525 return CMD_WARNING;
1526 }
jardineb5d44e2003-12-23 08:09:43 +00001527 assert (circuit);
1528
1529 mult = atoi (argv[0]);
1530
hassof390d2c2004-09-10 20:48:21 +00001531 circuit->hello_multiplier[0] = (u_int16_t) mult;
1532 circuit->hello_multiplier[1] = (u_int16_t) mult;
1533
jardineb5d44e2003-12-23 08:09:43 +00001534 return CMD_SUCCESS;
1535}
1536
1537DEFUN (no_isis_hello_multiplier,
1538 no_isis_hello_multiplier_cmd,
1539 "no isis hello-multiplier",
1540 NO_STR
1541 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001542 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00001543{
1544 struct isis_circuit *circuit;
1545 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001546
1547 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001548 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001549 if (circuit == NULL)
1550 {
1551 return CMD_WARNING;
1552 }
jardineb5d44e2003-12-23 08:09:43 +00001553 assert (circuit);
1554
1555 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1556 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1557
1558 return CMD_SUCCESS;
1559}
1560
1561ALIAS (no_isis_hello_multiplier,
1562 no_isis_hello_multiplier_arg_cmd,
1563 "no isis hello-multiplier <3-1000>",
1564 NO_STR
1565 "IS-IS commands\n"
1566 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001567 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001568
1569DEFUN (isis_hello_multiplier_l1,
1570 isis_hello_multiplier_l1_cmd,
1571 "isis hello-multiplier <3-1000> level-1",
1572 "IS-IS commands\n"
1573 "Set multiplier for Hello holding time\n"
1574 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001575 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001576{
1577 struct isis_circuit *circuit;
1578 struct interface *ifp;
1579 int mult;
hassof390d2c2004-09-10 20:48:21 +00001580
1581 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001582 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001583 if (circuit == NULL)
1584 {
1585 return CMD_WARNING;
1586 }
jardineb5d44e2003-12-23 08:09:43 +00001587 assert (circuit);
1588
1589 mult = atoi (argv[0]);
1590
hassof390d2c2004-09-10 20:48:21 +00001591 circuit->hello_multiplier[0] = (u_int16_t) mult;
1592
jardineb5d44e2003-12-23 08:09:43 +00001593 return CMD_SUCCESS;
1594}
1595
1596DEFUN (no_isis_hello_multiplier_l1,
1597 no_isis_hello_multiplier_l1_cmd,
1598 "no isis hello-multiplier level-1",
1599 NO_STR
1600 "IS-IS commands\n"
1601 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001602 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001603{
1604 struct isis_circuit *circuit;
1605 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001606
1607 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001608 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001609 if (circuit == NULL)
1610 {
1611 return CMD_WARNING;
1612 }
jardineb5d44e2003-12-23 08:09:43 +00001613 assert (circuit);
1614
1615 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1616
1617 return CMD_SUCCESS;
1618}
1619
1620ALIAS (no_isis_hello_multiplier_l1,
1621 no_isis_hello_multiplier_l1_arg_cmd,
1622 "no isis hello-multiplier <3-1000> level-1",
1623 NO_STR
1624 "IS-IS commands\n"
1625 "Set multiplier for Hello holding time\n"
1626 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001627 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001628
1629DEFUN (isis_hello_multiplier_l2,
1630 isis_hello_multiplier_l2_cmd,
1631 "isis hello-multiplier <3-1000> level-2",
1632 "IS-IS commands\n"
1633 "Set multiplier for Hello holding time\n"
1634 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001635 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001636{
1637 struct isis_circuit *circuit;
1638 struct interface *ifp;
1639 int mult;
hassof390d2c2004-09-10 20:48:21 +00001640
1641 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001642 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001643 if (circuit == NULL)
1644 {
1645 return CMD_WARNING;
1646 }
jardineb5d44e2003-12-23 08:09:43 +00001647 assert (circuit);
1648
1649 mult = atoi (argv[0]);
1650
hassof390d2c2004-09-10 20:48:21 +00001651 circuit->hello_multiplier[1] = (u_int16_t) mult;
1652
jardineb5d44e2003-12-23 08:09:43 +00001653 return CMD_SUCCESS;
1654}
1655
1656DEFUN (no_isis_hello_multiplier_l2,
1657 no_isis_hello_multiplier_l2_cmd,
1658 "no isis hello-multiplier level-2",
1659 NO_STR
1660 "IS-IS commands\n"
1661 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001662 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001663{
1664 struct isis_circuit *circuit;
1665 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001666
1667 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001668 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001669 if (circuit == NULL)
1670 {
1671 return CMD_WARNING;
1672 }
jardineb5d44e2003-12-23 08:09:43 +00001673 assert (circuit);
1674
1675 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1676
1677 return CMD_SUCCESS;
1678}
1679
1680ALIAS (no_isis_hello_multiplier_l2,
1681 no_isis_hello_multiplier_l2_arg_cmd,
1682 "no isis hello-multiplier <3-1000> level-2",
1683 NO_STR
1684 "IS-IS commands\n"
1685 "Set multiplier for Hello holding time\n"
1686 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001687 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001688
1689DEFUN (isis_hello,
1690 isis_hello_cmd,
1691 "isis hello padding",
1692 "IS-IS commands\n"
1693 "Add padding to IS-IS hello packets\n"
1694 "Pad hello packets\n"
1695 "<cr>\n")
1696{
1697 struct interface *ifp;
1698 struct isis_circuit *circuit;
hassof390d2c2004-09-10 20:48:21 +00001699
1700 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001701 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001702 if (circuit == NULL)
1703 {
1704 return CMD_WARNING;
1705 }
jardineb5d44e2003-12-23 08:09:43 +00001706 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001707
jardineb5d44e2003-12-23 08:09:43 +00001708 circuit->u.bc.pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00001709
jardineb5d44e2003-12-23 08:09:43 +00001710 return CMD_SUCCESS;
1711}
1712
jardineb5d44e2003-12-23 08:09:43 +00001713DEFUN (no_isis_hello,
1714 no_isis_hello_cmd,
1715 "no isis hello padding",
1716 NO_STR
1717 "IS-IS commands\n"
1718 "Add padding to IS-IS hello packets\n"
1719 "Pad hello packets\n"
1720 "<cr>\n")
1721{
1722 struct isis_circuit *circuit;
1723 struct interface *ifp;
1724
hassof390d2c2004-09-10 20:48:21 +00001725 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001726 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001727 if (circuit == NULL)
1728 {
1729 return CMD_WARNING;
1730 }
jardineb5d44e2003-12-23 08:09:43 +00001731 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001732
jardineb5d44e2003-12-23 08:09:43 +00001733 circuit->u.bc.pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00001734
jardineb5d44e2003-12-23 08:09:43 +00001735 return CMD_SUCCESS;
1736}
1737
1738DEFUN (csnp_interval,
1739 csnp_interval_cmd,
1740 "isis csnp-interval <0-65535>",
1741 "IS-IS commands\n"
1742 "Set CSNP interval in seconds\n"
1743 "CSNP interval value\n")
1744{
1745 struct isis_circuit *circuit;
1746 struct interface *ifp;
1747 unsigned long interval;
1748
hassof390d2c2004-09-10 20:48:21 +00001749 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001750 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001751 if (circuit == NULL)
1752 {
1753 return CMD_WARNING;
1754 }
jardineb5d44e2003-12-23 08:09:43 +00001755 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001756
jardineb5d44e2003-12-23 08:09:43 +00001757 interval = atol (argv[0]);
1758
hassof390d2c2004-09-10 20:48:21 +00001759 circuit->csnp_interval[0] = (u_int16_t) interval;
1760 circuit->csnp_interval[1] = (u_int16_t) interval;
1761
jardineb5d44e2003-12-23 08:09:43 +00001762 return CMD_SUCCESS;
1763}
1764
1765DEFUN (no_csnp_interval,
1766 no_csnp_interval_cmd,
1767 "no isis csnp-interval",
1768 NO_STR
1769 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001770 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001771{
1772 struct isis_circuit *circuit;
1773 struct interface *ifp;
1774
hassof390d2c2004-09-10 20:48:21 +00001775 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001776 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001777 if (circuit == NULL)
1778 {
1779 return CMD_WARNING;
1780 }
jardineb5d44e2003-12-23 08:09:43 +00001781 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001782
jardineb5d44e2003-12-23 08:09:43 +00001783 circuit->csnp_interval[0] = CSNP_INTERVAL;
1784 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001785
jardineb5d44e2003-12-23 08:09:43 +00001786 return CMD_SUCCESS;
1787}
1788
1789ALIAS (no_csnp_interval,
1790 no_csnp_interval_arg_cmd,
1791 "no isis csnp-interval <0-65535>",
1792 NO_STR
1793 "IS-IS commands\n"
1794 "Set CSNP interval in seconds\n"
1795 "CSNP interval value\n")
1796
jardineb5d44e2003-12-23 08:09:43 +00001797DEFUN (csnp_interval_l1,
1798 csnp_interval_l1_cmd,
1799 "isis csnp-interval <0-65535> level-1",
1800 "IS-IS commands\n"
1801 "Set CSNP interval in seconds\n"
1802 "CSNP interval value\n"
1803 "Specify interval for level-1 CSNPs\n")
1804{
1805 struct isis_circuit *circuit;
1806 struct interface *ifp;
1807 unsigned long interval;
1808
hassof390d2c2004-09-10 20:48:21 +00001809 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001810 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001811 if (circuit == NULL)
1812 {
1813 return CMD_WARNING;
1814 }
jardineb5d44e2003-12-23 08:09:43 +00001815 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001816
jardineb5d44e2003-12-23 08:09:43 +00001817 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001818
1819 circuit->csnp_interval[0] = (u_int16_t) interval;
1820
jardineb5d44e2003-12-23 08:09:43 +00001821 return CMD_SUCCESS;
1822}
1823
1824DEFUN (no_csnp_interval_l1,
1825 no_csnp_interval_l1_cmd,
1826 "no isis csnp-interval level-1",
1827 NO_STR
1828 "IS-IS commands\n"
1829 "Set CSNP interval in seconds\n"
1830 "Specify interval for level-1 CSNPs\n")
1831{
1832 struct isis_circuit *circuit;
1833 struct interface *ifp;
1834
hassof390d2c2004-09-10 20:48:21 +00001835 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001836 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001837 if (circuit == NULL)
1838 {
1839 return CMD_WARNING;
1840 }
jardineb5d44e2003-12-23 08:09:43 +00001841 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001842
jardineb5d44e2003-12-23 08:09:43 +00001843 circuit->csnp_interval[0] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001844
jardineb5d44e2003-12-23 08:09:43 +00001845 return CMD_SUCCESS;
1846}
1847
1848ALIAS (no_csnp_interval_l1,
1849 no_csnp_interval_l1_arg_cmd,
1850 "no isis csnp-interval <0-65535> level-1",
1851 NO_STR
1852 "IS-IS commands\n"
1853 "Set CSNP interval in seconds\n"
1854 "CSNP interval value\n"
1855 "Specify interval for level-1 CSNPs\n")
1856
jardineb5d44e2003-12-23 08:09:43 +00001857DEFUN (csnp_interval_l2,
1858 csnp_interval_l2_cmd,
1859 "isis csnp-interval <0-65535> level-2",
1860 "IS-IS commands\n"
1861 "Set CSNP interval in seconds\n"
1862 "CSNP interval value\n"
1863 "Specify interval for level-2 CSNPs\n")
1864{
1865 struct isis_circuit *circuit;
1866 struct interface *ifp;
1867 unsigned long interval;
1868
hassof390d2c2004-09-10 20:48:21 +00001869 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001870 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001871 if (circuit == NULL)
1872 {
1873 return CMD_WARNING;
1874 }
jardineb5d44e2003-12-23 08:09:43 +00001875 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001876
jardineb5d44e2003-12-23 08:09:43 +00001877 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001878
1879 circuit->csnp_interval[1] = (u_int16_t) interval;
1880
jardineb5d44e2003-12-23 08:09:43 +00001881 return CMD_SUCCESS;
1882}
1883
1884DEFUN (no_csnp_interval_l2,
1885 no_csnp_interval_l2_cmd,
1886 "no isis csnp-interval level-2",
1887 NO_STR
1888 "IS-IS commands\n"
1889 "Set CSNP interval in seconds\n"
1890 "Specify interval for level-2 CSNPs\n")
1891{
1892 struct isis_circuit *circuit;
1893 struct interface *ifp;
1894
hassof390d2c2004-09-10 20:48:21 +00001895 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001896 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001897 if (circuit == NULL)
1898 {
1899 return CMD_WARNING;
1900 }
jardineb5d44e2003-12-23 08:09:43 +00001901 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001902
jardineb5d44e2003-12-23 08:09:43 +00001903 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001904
jardineb5d44e2003-12-23 08:09:43 +00001905 return CMD_SUCCESS;
1906}
1907
1908ALIAS (no_csnp_interval_l2,
1909 no_csnp_interval_l2_arg_cmd,
1910 "no isis csnp-interval <0-65535> level-2",
1911 NO_STR
1912 "IS-IS commands\n"
1913 "Set CSNP interval in seconds\n"
1914 "CSNP interval value\n"
1915 "Specify interval for level-2 CSNPs\n")
1916
jardineb5d44e2003-12-23 08:09:43 +00001917#ifdef HAVE_IPV6
1918DEFUN (ipv6_router_isis,
1919 ipv6_router_isis_cmd,
1920 "ipv6 router isis WORD",
1921 "IPv6 interface subcommands\n"
1922 "IPv6 Router interface commands\n"
1923 "IS-IS Routing for IPv6\n"
1924 "Routing process tag\n")
1925{
1926 struct isis_circuit *c;
1927 struct interface *ifp;
1928 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001929
1930 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001931 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001932
jardineb5d44e2003-12-23 08:09:43 +00001933 area = isis_area_lookup (argv[0]);
1934
1935 /* Prevent more than one circuit per interface */
1936 if (area)
1937 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001938 else
1939 c = NULL;
1940
1941 if (c && (ifp->info != NULL))
1942 {
1943 if (c->ipv6_router == 1)
1944 {
1945 vty_out (vty, "ISIS circuit is already defined for IPv6%s",
1946 VTY_NEWLINE);
1947 return CMD_WARNING;
1948 }
jardineb5d44e2003-12-23 08:09:43 +00001949 }
jardineb5d44e2003-12-23 08:09:43 +00001950
1951 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +00001952 if (!area)
1953 {
1954 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1955 return CMD_WARNING;
1956 }
jardineb5d44e2003-12-23 08:09:43 +00001957
hassof390d2c2004-09-10 20:48:21 +00001958 if (!c)
1959 {
1960 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1961 c = isis_csm_state_change (ISIS_ENABLE, c, area);
1962 c->interface = ifp;
1963 ifp->info = c;
1964 }
jardineb5d44e2003-12-23 08:09:43 +00001965
hassof390d2c2004-09-10 20:48:21 +00001966 if (!c)
jardineb5d44e2003-12-23 08:09:43 +00001967 return CMD_WARNING;
1968
1969 c->ipv6_router = 1;
1970 area->ipv6_circuits++;
1971 circuit_update_nlpids (c);
1972
1973 vty->node = INTERFACE_NODE;
1974
1975 return CMD_SUCCESS;
1976}
1977
1978DEFUN (no_ipv6_router_isis,
1979 no_ipv6_router_isis_cmd,
1980 "no ipv6 router isis WORD",
1981 NO_STR
1982 "IPv6 interface subcommands\n"
1983 "IPv6 Router interface commands\n"
1984 "IS-IS Routing for IPv6\n"
1985 "Routing process tag\n")
1986{
1987 struct isis_circuit *c;
1988 struct interface *ifp;
1989 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001990
1991 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001992 /* UGLY - will remove l8r
1993 if (circuit == NULL) {
hassof390d2c2004-09-10 20:48:21 +00001994 return CMD_WARNING;
1995 } */
jardineb5d44e2003-12-23 08:09:43 +00001996 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001997
jardineb5d44e2003-12-23 08:09:43 +00001998 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001999 if (!area)
2000 {
2001 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
2002 return CMD_WARNING;
2003 }
2004
jardineb5d44e2003-12-23 08:09:43 +00002005 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
2006 if (!c)
2007 return CMD_WARNING;
2008
2009 c->ipv6_router = 0;
2010 area->ipv6_circuits--;
2011 if (c->ip_router == 0)
2012 isis_csm_state_change (ISIS_DISABLE, c, area);
2013
2014 return CMD_SUCCESS;
2015}
hassof390d2c2004-09-10 20:48:21 +00002016#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00002017
hassof390d2c2004-09-10 20:48:21 +00002018struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002019 INTERFACE_NODE,
2020 "%s(config-if)# ",
2021 1,
2022};
2023
jardineb5d44e2003-12-23 08:09:43 +00002024int
2025isis_if_new_hook (struct interface *ifp)
2026{
2027/* FIXME: Discuss if the circuit should be created here
2028 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2029 ifp->info = NULL;
2030 return 0;
2031}
2032
2033int
2034isis_if_delete_hook (struct interface *ifp)
2035{
2036/* FIXME: Discuss if the circuit should be created here
2037 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2038 ifp->info = NULL;
2039 return 0;
2040}
2041
jardineb5d44e2003-12-23 08:09:43 +00002042void
2043isis_circuit_init ()
2044{
jardineb5d44e2003-12-23 08:09:43 +00002045 /* Initialize Zebra interface data structure */
2046 if_init ();
2047 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2048 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2049
2050 /* Install interface node */
2051 install_node (&interface_node, isis_interface_config_write);
2052 install_element (CONFIG_NODE, &interface_cmd);
2053
2054 install_default (INTERFACE_NODE);
2055 install_element (INTERFACE_NODE, &interface_desc_cmd);
2056 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2057
2058 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2059 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2060
2061 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2062 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2063
2064 install_element (INTERFACE_NODE, &isis_passwd_cmd);
2065 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2066
2067 install_element (INTERFACE_NODE, &isis_priority_cmd);
2068 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2069 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2070 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2071 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2072 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2073 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2074 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2075 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2076
2077 install_element (INTERFACE_NODE, &isis_metric_cmd);
2078 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2079 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2080
2081 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2082 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2083 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2084 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2085 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2086 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2087 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2088 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2089 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2090
2091 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2092 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2093 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2094 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2095 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2096 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2097 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2098 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2099 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2100
2101 install_element (INTERFACE_NODE, &isis_hello_cmd);
2102 install_element (INTERFACE_NODE, &no_isis_hello_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002103 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2104 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2105 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2106 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2107 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2108 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2109 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2110 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2111 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2112
2113#ifdef HAVE_IPV6
2114 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2115 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002116#endif
jardineb5d44e2003-12-23 08:09:43 +00002117}