blob: 23cb0ac73e414055a343db55e1f44c1a96b8cb17 [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;
hassof21fb272005-09-26 17:05:55 +000080 circuit->te_metric[i] = DEFAULT_CIRCUIT_METRICS;
hassof390d2c2004-09-10 20:48:21 +000081 }
jardineb5d44e2003-12-23 08:09:43 +000082 }
hassof390d2c2004-09-10 20:48:21 +000083 else
84 {
85 zlog_err ("Can't malloc isis circuit");
86 return NULL;
87 }
88
jardineb5d44e2003-12-23 08:09:43 +000089 return circuit;
90}
91
jardineb5d44e2003-12-23 08:09:43 +000092void
93isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area)
94{
95 int i;
96 circuit->area = area;
97 /*
98 * The level for the circuit is same as for the area, unless configured
99 * otherwise.
100 */
101 circuit->circuit_is_type = area->is_type;
102 /*
103 * Default values
104 */
hassof390d2c2004-09-10 20:48:21 +0000105 for (i = 0; i < 2; i++)
106 {
107 circuit->hello_interval[i] = HELLO_INTERVAL;
108 circuit->hello_multiplier[i] = HELLO_MULTIPLIER;
109 circuit->csnp_interval[i] = CSNP_INTERVAL;
110 circuit->psnp_interval[i] = PSNP_INTERVAL;
111 circuit->u.bc.priority[i] = DEFAULT_PRIORITY;
112 }
113 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
114 {
115 circuit->u.bc.adjdb[0] = list_new ();
116 circuit->u.bc.adjdb[1] = list_new ();
117 circuit->u.bc.pad_hellos = 1;
118 }
jardineb5d44e2003-12-23 08:09:43 +0000119 circuit->lsp_interval = LSP_INTERVAL;
120
121 /*
122 * Add the circuit into area
123 */
124 listnode_add (area->circuit_list, circuit);
125
126 circuit->idx = flags_get_index (&area->flags);
127 circuit->lsp_queue = list_new ();
128
129 return;
130}
131
hassof390d2c2004-09-10 20:48:21 +0000132void
jardineb5d44e2003-12-23 08:09:43 +0000133isis_circuit_deconfigure (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000134 struct isis_area *area)
jardineb5d44e2003-12-23 08:09:43 +0000135{
hassof390d2c2004-09-10 20:48:21 +0000136
jardineb5d44e2003-12-23 08:09:43 +0000137 /* Remove circuit from area */
138 listnode_delete (area->circuit_list, circuit);
139 /* Free the index of SRM and SSN flags */
140 flags_free_index (&area->flags, circuit->idx);
141
142 return;
143}
144
145struct isis_circuit *
146circuit_lookup_by_ifp (struct interface *ifp, struct list *list)
147{
148 struct isis_circuit *circuit = NULL;
149 struct listnode *node;
hassof390d2c2004-09-10 20:48:21 +0000150
jardineb5d44e2003-12-23 08:09:43 +0000151 if (!list)
152 return NULL;
hassof390d2c2004-09-10 20:48:21 +0000153
paul1eb8ef22005-04-07 07:30:20 +0000154 for (ALL_LIST_ELEMENTS_RO (list, node, circuit))
155 if (circuit->interface == ifp)
156 return circuit;
157
jardineb5d44e2003-12-23 08:09:43 +0000158 return NULL;
159}
160
161struct isis_circuit *
162circuit_scan_by_ifp (struct interface *ifp)
163{
164 struct isis_area *area;
165 struct listnode *node;
166 struct isis_circuit *circuit;
167
168 if (!isis->area_list)
169 return NULL;
170
paul1eb8ef22005-04-07 07:30:20 +0000171 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
hassof390d2c2004-09-10 20:48:21 +0000172 {
hassof390d2c2004-09-10 20:48:21 +0000173 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
174 if (circuit)
175 return circuit;
176 }
177
jardineb5d44e2003-12-23 08:09:43 +0000178 return circuit_lookup_by_ifp (ifp, isis->init_circ_list);
179}
180
181void
182isis_circuit_del (struct isis_circuit *circuit)
183{
184
185 if (!circuit)
186 return;
187
hassof390d2c2004-09-10 20:48:21 +0000188 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
189 {
190 /* destroy adjacency databases */
hasso46606872004-12-29 19:34:22 +0000191 if (circuit->u.bc.adjdb[0])
192 list_delete (circuit->u.bc.adjdb[0]);
193 if (circuit->u.bc.adjdb[1])
194 list_delete (circuit->u.bc.adjdb[1]);
hassof390d2c2004-09-10 20:48:21 +0000195 /* destroy neighbour lists */
196 if (circuit->u.bc.lan_neighs[0])
197 list_delete (circuit->u.bc.lan_neighs[0]);
198 if (circuit->u.bc.lan_neighs[1])
199 list_delete (circuit->u.bc.lan_neighs[1]);
200 /* destroy addresses */
201 }
jardineb5d44e2003-12-23 08:09:43 +0000202 if (circuit->ip_addrs)
203 list_delete (circuit->ip_addrs);
204#ifdef HAVE_IPV6
205 if (circuit->ipv6_link)
206 list_delete (circuit->ipv6_link);
207 if (circuit->ipv6_non_link)
208 list_delete (circuit->ipv6_non_link);
209#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000210
jardineb5d44e2003-12-23 08:09:43 +0000211 /* and lastly the circuit itself */
212 XFREE (MTYPE_ISIS_CIRCUIT, circuit);
213
214 return;
215}
216
217void
hassof891f442004-09-14 13:54:30 +0000218isis_circuit_add_addr (struct isis_circuit *circuit,
219 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000220{
221 struct prefix_ipv4 *ipv4;
hassof390d2c2004-09-10 20:48:21 +0000222 u_char buf[BUFSIZ];
jardineb5d44e2003-12-23 08:09:43 +0000223#ifdef HAVE_IPV6
224 struct prefix_ipv6 *ipv6;
225#endif /* HAVE_IPV6 */
hassof891f442004-09-14 13:54:30 +0000226
hassof390d2c2004-09-10 20:48:21 +0000227 if (!circuit->ip_addrs)
hassof891f442004-09-14 13:54:30 +0000228 circuit->ip_addrs = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000229#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000230 if (!circuit->ipv6_link)
hassof891f442004-09-14 13:54:30 +0000231 circuit->ipv6_link = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000232 if (!circuit->ipv6_non_link)
hassof891f442004-09-14 13:54:30 +0000233 circuit->ipv6_non_link = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000234#endif /* HAVE_IPV6 */
235
236 memset (&buf, 0, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000237 if (connected->address->family == AF_INET)
hassof390d2c2004-09-10 20:48:21 +0000238 {
239 ipv4 = prefix_ipv4_new ();
hassof891f442004-09-14 13:54:30 +0000240 ipv4->prefixlen = connected->address->prefixlen;
241 ipv4->prefix = connected->address->u.prefix4;
hassof390d2c2004-09-10 20:48:21 +0000242 listnode_add (circuit->ip_addrs, ipv4);
hasso0dae85e2004-09-26 19:53:47 +0000243 if (circuit->area)
244 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000245
jardineb5d44e2003-12-23 08:09:43 +0000246#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000247 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000248 zlog_debug ("Added IP address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000249 circuit->circuit_id);
250#endif /* EXTREME_DEBUG */
jardineb5d44e2003-12-23 08:09:43 +0000251 }
hassof390d2c2004-09-10 20:48:21 +0000252#ifdef HAVE_IPV6
hassof891f442004-09-14 13:54:30 +0000253 if (connected->address->family == AF_INET6)
hassof390d2c2004-09-10 20:48:21 +0000254 {
255 ipv6 = prefix_ipv6_new ();
hassof891f442004-09-14 13:54:30 +0000256 ipv6->prefixlen = connected->address->prefixlen;
257 ipv6->prefix = connected->address->u.prefix6;
258
hassof390d2c2004-09-10 20:48:21 +0000259 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
hassof891f442004-09-14 13:54:30 +0000260 listnode_add (circuit->ipv6_link, ipv6);
hassof390d2c2004-09-10 20:48:21 +0000261 else
hassof891f442004-09-14 13:54:30 +0000262 listnode_add (circuit->ipv6_non_link, ipv6);
hasso0dae85e2004-09-26 19:53:47 +0000263 if (circuit->area)
264 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000265
jardineb5d44e2003-12-23 08:09:43 +0000266#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000267 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000268 zlog_debug ("Added IPv6 address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000269 circuit->circuit_id);
270#endif /* EXTREME_DEBUG */
271 }
jardineb5d44e2003-12-23 08:09:43 +0000272#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000273 return;
274}
275
276void
277isis_circuit_del_addr (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000278 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000279{
hassof891f442004-09-14 13:54:30 +0000280 struct prefix_ipv4 *ipv4, *ip = NULL;
281 struct listnode *node;
282 int found = 0;
283 u_char buf[BUFSIZ];
284#ifdef HAVE_IPV6
285 struct prefix_ipv6 *ipv6, *ip6 = NULL;
286#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000287
hassof891f442004-09-14 13:54:30 +0000288 memset (&buf, 0, BUFSIZ);
289 if (connected->address->family == AF_INET)
290 {
291 ipv4 = prefix_ipv4_new ();
292 ipv4->prefixlen = connected->address->prefixlen;
293 ipv4->prefix = connected->address->u.prefix4;
294
paul1eb8ef22005-04-07 07:30:20 +0000295 for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip))
296 if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4))
297 break;
hassof891f442004-09-14 13:54:30 +0000298
299 if (ip)
300 {
301 listnode_delete (circuit->ip_addrs, ip);
hasso0dae85e2004-09-26 19:53:47 +0000302 if (circuit->area)
303 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000304 }
305 else
306 {
hassof7c43dc2004-09-26 16:24:14 +0000307 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000308 zlog_warn("Nonexitant ip address %s removal attempt from circuit \
309 %d", buf, circuit->circuit_id);
310 }
311 }
312#ifdef HAVE_IPV6
313 if (connected->address->family == AF_INET6)
314 {
315 ipv6 = prefix_ipv6_new ();
316 ipv6->prefixlen = connected->address->prefixlen;
317 ipv6->prefix = connected->address->u.prefix6;
318
319 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
320 {
paul1eb8ef22005-04-07 07:30:20 +0000321 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_link, node, ip6))
hassof891f442004-09-14 13:54:30 +0000322 {
hassof891f442004-09-14 13:54:30 +0000323 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
324 break;
325 }
326 if (ip6)
327 {
328 listnode_delete (circuit->ipv6_link, ip6);
329 found = 1;
330 }
331 }
332 else
333 {
paul1eb8ef22005-04-07 07:30:20 +0000334 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_non_link, node, ip6))
hassof891f442004-09-14 13:54:30 +0000335 {
hassof891f442004-09-14 13:54:30 +0000336 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
337 break;
338 }
339 if (ip6)
340 {
341 listnode_delete (circuit->ipv6_non_link, ip6);
342 found = 1;
343 }
344 }
345
346 if (!found)
347 {
hassof7c43dc2004-09-26 16:24:14 +0000348 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000349 zlog_warn("Nonexitant ip address %s removal attempt from \
350 circuit %d", buf, circuit->circuit_id);
351 }
352 else
hasso0dae85e2004-09-26 19:53:47 +0000353 if (circuit->area)
354 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000355 }
356#endif /* HAVE_IPV6 */
357 return;
jardineb5d44e2003-12-23 08:09:43 +0000358}
359
360void
361isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
362{
paul1eb8ef22005-04-07 07:30:20 +0000363 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000364 struct connected *conn;
365
366 circuit->interface = ifp;
367 ifp->info = circuit;
hassof390d2c2004-09-10 20:48:21 +0000368
369 circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */
jardineb5d44e2003-12-23 08:09:43 +0000370
371 /* isis_circuit_update_addrs (circuit, ifp); */
372
hassof390d2c2004-09-10 20:48:21 +0000373 if (if_is_broadcast (ifp))
374 {
375 circuit->circ_type = CIRCUIT_T_BROADCAST;
376 /*
377 * Get the Hardware Address
378 */
jardineb5d44e2003-12-23 08:09:43 +0000379#ifdef HAVE_SOCKADDR_DL
hassof390d2c2004-09-10 20:48:21 +0000380 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
381 zlog_warn ("unsupported link layer");
382 else
383 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl),
384 ETH_ALEN);
jardineb5d44e2003-12-23 08:09:43 +0000385#else
hassof390d2c2004-09-10 20:48:21 +0000386 if (circuit->interface->hw_addr_len != ETH_ALEN)
387 {
388 zlog_warn ("unsupported link layer");
389 }
390 else
391 {
392 memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN);
393 }
jardineb5d44e2003-12-23 08:09:43 +0000394#ifdef EXTREME_DEGUG
hasso529d65b2004-12-24 00:14:50 +0000395 zlog_debug ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
hassof390d2c2004-09-10 20:48:21 +0000396 circuit->interface->ifindex, ISO_MTU (circuit),
397 snpa_print (circuit->u.bc.snpa));
jardineb5d44e2003-12-23 08:09:43 +0000398
399#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000400#endif /* HAVE_SOCKADDR_DL */
401 }
402 else if (if_is_pointopoint (ifp))
403 {
404 circuit->circ_type = CIRCUIT_T_P2P;
405 }
406 else
407 {
hassoc89c05d2005-09-04 21:36:36 +0000408 /* It's normal in case of loopback etc. */
409 if (isis->debugs & DEBUG_EVENTS)
410 zlog_debug ("isis_circuit_if_add: unsupported media");
hassof390d2c2004-09-10 20:48:21 +0000411 }
412
paul1eb8ef22005-04-07 07:30:20 +0000413 for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, conn))
414 isis_circuit_add_addr (circuit, conn);
jardineb5d44e2003-12-23 08:09:43 +0000415
416 return;
417}
418
419void
hassof390d2c2004-09-10 20:48:21 +0000420isis_circuit_update_params (struct isis_circuit *circuit,
421 struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000422{
hassob30c5e62004-12-29 20:06:41 +0000423 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +0000424
425 if (circuit->circuit_id != ifp->ifindex)
426 {
427 zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
428 ifp->ifindex);
429 circuit->circuit_id = ifp->ifindex % 255;
430 }
jardineb5d44e2003-12-23 08:09:43 +0000431
432 /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
433 /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig)
434 The areas MTU is the minimum of mtu's of circuits in the area
435 now we can't catch the change
436 if (circuit->mtu != ifp->mtu) {
437 zlog_warn ("changing circuit mtu %d->%d", circuit->mtu,
438 ifp->mtu);
439 circuit->mtu = ifp->mtu;
440 }
hassof390d2c2004-09-10 20:48:21 +0000441 */
jardineb5d44e2003-12-23 08:09:43 +0000442 /*
443 * Get the Hardware Address
444 */
445#ifdef HAVE_SOCKADDR_DL
446 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
jardineb5d44e2003-12-23 08:09:43 +0000447 zlog_warn ("unsupported link layer");
hassof390d2c2004-09-10 20:48:21 +0000448 else
449 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), ETH_ALEN);
450#else
451 if (circuit->interface->hw_addr_len != ETH_ALEN)
452 {
453 zlog_warn ("unsupported link layer");
jardineb5d44e2003-12-23 08:09:43 +0000454 }
hassof390d2c2004-09-10 20:48:21 +0000455 else
456 {
457 if (memcmp (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN))
458 {
459 zlog_warn ("changing circuit snpa %s->%s",
460 snpa_print (circuit->u.bc.snpa),
461 snpa_print (circuit->interface->hw_addr));
462 }
463 }
464#endif
jardineb5d44e2003-12-23 08:09:43 +0000465
hassof390d2c2004-09-10 20:48:21 +0000466 if (if_is_broadcast (ifp))
467 {
468 circuit->circ_type = CIRCUIT_T_BROADCAST;
469 }
470 else if (if_is_pointopoint (ifp))
471 {
472 circuit->circ_type = CIRCUIT_T_P2P;
473 }
474 else
475 {
476 zlog_warn ("isis_circuit_update_params: unsupported media");
477 }
jardineb5d44e2003-12-23 08:09:43 +0000478
jardineb5d44e2003-12-23 08:09:43 +0000479 return;
480}
481
482void
hassof390d2c2004-09-10 20:48:21 +0000483isis_circuit_if_del (struct isis_circuit *circuit)
jardineb5d44e2003-12-23 08:09:43 +0000484{
485 circuit->interface->info = NULL;
486 circuit->interface = NULL;
hassof390d2c2004-09-10 20:48:21 +0000487
jardineb5d44e2003-12-23 08:09:43 +0000488 return;
489}
490
491void
492isis_circuit_up (struct isis_circuit *circuit)
493{
jardineb5d44e2003-12-23 08:09:43 +0000494
hassof390d2c2004-09-10 20:48:21 +0000495 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
496 {
497 if (circuit->area->min_bcast_mtu == 0 ||
498 ISO_MTU (circuit) < circuit->area->min_bcast_mtu)
499 circuit->area->min_bcast_mtu = ISO_MTU (circuit);
500 /*
501 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
502 */
jardineb5d44e2003-12-23 08:09:43 +0000503
hassof390d2c2004-09-10 20:48:21 +0000504 /* initilizing the hello sending threads
505 * for a broadcast IF
506 */
jardineb5d44e2003-12-23 08:09:43 +0000507
hassof390d2c2004-09-10 20:48:21 +0000508 /* 8.4.1 a) commence sending of IIH PDUs */
509
510 if (circuit->circuit_is_type & IS_LEVEL_1)
511 {
512 thread_add_event (master, send_lan_l1_hello, circuit, 0);
513 circuit->u.bc.lan_neighs[0] = list_new ();
514 }
515
516 if (circuit->circuit_is_type & IS_LEVEL_2)
517 {
518 thread_add_event (master, send_lan_l2_hello, circuit, 0);
519 circuit->u.bc.lan_neighs[1] = list_new ();
520 }
521
522 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
523 /* 8.4.1 c) FIXME: listen for ESH PDUs */
524
525 /* 8.4.1 d) */
526 /* dr election will commence in... */
527 if (circuit->circuit_is_type & IS_LEVEL_1)
528 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
hassobf731012004-09-17 07:59:57 +0000529 circuit, 2 * circuit->hello_interval[0]);
hassof390d2c2004-09-10 20:48:21 +0000530 if (circuit->circuit_is_type & IS_LEVEL_2)
531 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
hassobf731012004-09-17 07:59:57 +0000532 circuit, 2 * circuit->hello_interval[1]);
jardineb5d44e2003-12-23 08:09:43 +0000533 }
hassof390d2c2004-09-10 20:48:21 +0000534 else
535 {
536 /* initializing the hello send threads
537 * for a ptp IF
538 */
539 thread_add_event (master, send_p2p_hello, circuit, 0);
jardineb5d44e2003-12-23 08:09:43 +0000540
jardineb5d44e2003-12-23 08:09:43 +0000541 }
542
jardineb5d44e2003-12-23 08:09:43 +0000543 /* initializing PSNP timers */
hassof390d2c2004-09-10 20:48:21 +0000544 if (circuit->circuit_is_type & IS_LEVEL_1)
545 {
546 THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
547 isis_jitter (circuit->psnp_interval[0], PSNP_JITTER));
548 }
549
550 if (circuit->circuit_is_type & IS_LEVEL_2)
551 {
552 THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
553 isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
554 }
555
jardineb5d44e2003-12-23 08:09:43 +0000556 /* initialize the circuit streams */
557 if (circuit->rcv_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000558 circuit->rcv_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000559
560 if (circuit->snd_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000561 circuit->snd_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000562
563 /* unified init for circuits */
564 isis_sock_init (circuit);
565
566#ifdef GNU_LINUX
hassof390d2c2004-09-10 20:48:21 +0000567 THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
568 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000569#else
hassof390d2c2004-09-10 20:48:21 +0000570 THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
571 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000572#endif
573 return;
574}
575
576void
577isis_circuit_down (struct isis_circuit *circuit)
578{
hassof390d2c2004-09-10 20:48:21 +0000579 /* Cancel all active threads -- FIXME: wrong place */
hassod70f99e2004-02-11 20:26:31 +0000580 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
hassof390d2c2004-09-10 20:48:21 +0000581 THREAD_OFF (circuit->t_read);
582 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
583 {
584 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
585 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
hassof891f442004-09-14 13:54:30 +0000586 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
587 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
hassof390d2c2004-09-10 20:48:21 +0000588 }
589 else if (circuit->circ_type == CIRCUIT_T_P2P)
590 {
591 THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
592 }
jardineb5d44e2003-12-23 08:09:43 +0000593 /* close the socket */
594 close (circuit->fd);
595
596 return;
597}
598
599void
600circuit_update_nlpids (struct isis_circuit *circuit)
601{
602 circuit->nlpids.count = 0;
hassof390d2c2004-09-10 20:48:21 +0000603
604 if (circuit->ip_router)
605 {
606 circuit->nlpids.nlpids[0] = NLPID_IP;
607 circuit->nlpids.count++;
608 }
jardineb5d44e2003-12-23 08:09:43 +0000609#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000610 if (circuit->ipv6_router)
611 {
612 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
613 circuit->nlpids.count++;
614 }
jardineb5d44e2003-12-23 08:09:43 +0000615#endif /* HAVE_IPV6 */
616 return;
617}
618
619int
hassof390d2c2004-09-10 20:48:21 +0000620isis_interface_config_write (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000621{
622
623 int write = 0;
paul1eb8ef22005-04-07 07:30:20 +0000624 struct listnode *node, *nnode;
625 struct listnode *node2, *nnode2;
jardineb5d44e2003-12-23 08:09:43 +0000626 struct interface *ifp;
627 struct isis_area *area;
628 struct isis_circuit *c;
jardineb5d44e2003-12-23 08:09:43 +0000629 int i;
jardineb5d44e2003-12-23 08:09:43 +0000630
paul1eb8ef22005-04-07 07:30:20 +0000631 for (ALL_LIST_ELEMENTS (iflist, node, nnode, ifp))
jardineb5d44e2003-12-23 08:09:43 +0000632 {
633 /* IF name */
hassof390d2c2004-09-10 20:48:21 +0000634 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000635 write++;
636 /* IF desc */
hassof390d2c2004-09-10 20:48:21 +0000637 if (ifp->desc)
638 {
639 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
640 write++;
641 }
jardineb5d44e2003-12-23 08:09:43 +0000642 /* ISIS Circuit */
paul1eb8ef22005-04-07 07:30:20 +0000643 for (ALL_LIST_ELEMENTS (isis->area_list, node2, nnode2, area))
jardineb5d44e2003-12-23 08:09:43 +0000644 {
645 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000646 if (c)
647 {
648 if (c->ip_router)
649 {
650 vty_out (vty, " ip router isis %s%s", area->area_tag,
651 VTY_NEWLINE);
652 write++;
653 }
jardineb5d44e2003-12-23 08:09:43 +0000654#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000655 if (c->ipv6_router)
656 {
657 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
658 VTY_NEWLINE);
659 write++;
660 }
jardineb5d44e2003-12-23 08:09:43 +0000661#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000662
hassof390d2c2004-09-10 20:48:21 +0000663 /* ISIS - circuit type */
664 if (c->circuit_is_type == IS_LEVEL_1)
665 {
666 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
667 write++;
668 }
669 else
670 {
671 if (c->circuit_is_type == IS_LEVEL_2)
672 {
673 vty_out (vty, " isis circuit-type level-2-only%s",
674 VTY_NEWLINE);
675 write++;
676 }
677 }
jardineb5d44e2003-12-23 08:09:43 +0000678
hassof390d2c2004-09-10 20:48:21 +0000679 /* ISIS - CSNP interval - FIXME: compare to cisco */
680 if (c->csnp_interval[0] == c->csnp_interval[1])
681 {
682 if (c->csnp_interval[0] != CSNP_INTERVAL)
683 {
684 vty_out (vty, " isis csnp-interval %d%s",
685 c->csnp_interval[0], VTY_NEWLINE);
686 write++;
687 }
688 }
689 else
690 {
691 for (i = 0; i < 2; i++)
692 {
693 if (c->csnp_interval[1] != CSNP_INTERVAL)
694 {
695 vty_out (vty, " isis csnp-interval %d level-%d%s",
696 c->csnp_interval[1], i + 1, VTY_NEWLINE);
697 write++;
698 }
699 }
700 }
jardineb5d44e2003-12-23 08:09:43 +0000701
hassof390d2c2004-09-10 20:48:21 +0000702 /* ISIS - Hello padding - Defaults to true so only display if false */
703 if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos)
704 {
705 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
706 write++;
707 }
jardineb5d44e2003-12-23 08:09:43 +0000708
hassof390d2c2004-09-10 20:48:21 +0000709 /* ISIS - Hello interval - FIXME: compare to cisco */
710 if (c->hello_interval[0] == c->hello_interval[1])
711 {
712 if (c->hello_interval[0] != HELLO_INTERVAL)
713 {
714 vty_out (vty, " isis hello-interval %d%s",
715 c->hello_interval[0], VTY_NEWLINE);
716 write++;
717 }
718 }
719 else
720 {
721 for (i = 0; i < 2; i++)
722 {
723 if (c->hello_interval[i] != HELLO_INTERVAL)
724 {
725 if (c->hello_interval[i] == HELLO_MINIMAL)
726 {
727 vty_out (vty,
728 " isis hello-interval minimal level-%d%s",
729 i + 1, VTY_NEWLINE);
730 }
731 else
732 {
733 vty_out (vty, " isis hello-interval %d level-%d%s",
734 c->hello_interval[i], i + 1, VTY_NEWLINE);
735 }
736 write++;
737 }
738 }
739 }
jardineb5d44e2003-12-23 08:09:43 +0000740
hassof390d2c2004-09-10 20:48:21 +0000741 /* ISIS - Hello Multiplier */
742 if (c->hello_multiplier[0] == c->hello_multiplier[1])
743 {
744 if (c->hello_multiplier[0] != HELLO_MULTIPLIER)
745 {
746 vty_out (vty, " isis hello-multiplier %d%s",
747 c->hello_multiplier[0], VTY_NEWLINE);
748 write++;
749 }
750 }
751 else
752 {
753 for (i = 0; i < 2; i++)
754 {
755 if (c->hello_multiplier[i] != HELLO_MULTIPLIER)
756 {
757 vty_out (vty, " isis hello-multiplier %d level-%d%s",
758 c->hello_multiplier[i], i + 1, VTY_NEWLINE);
759 write++;
760 }
761 }
762 }
763 /* ISIS - Priority */
764 if (c->circ_type == CIRCUIT_T_BROADCAST)
765 {
766 if (c->u.bc.priority[0] == c->u.bc.priority[1])
767 {
768 if (c->u.bc.priority[0] != DEFAULT_PRIORITY)
769 {
770 vty_out (vty, " isis priority %d%s",
771 c->u.bc.priority[0], VTY_NEWLINE);
772 write++;
773 }
774 }
775 else
776 {
777 for (i = 0; i < 2; i++)
778 {
779 if (c->u.bc.priority[i] != DEFAULT_PRIORITY)
780 {
781 vty_out (vty, " isis priority %d level-%d%s",
782 c->u.bc.priority[i], i + 1, VTY_NEWLINE);
783 write++;
784 }
785 }
786 }
787 }
788 /* ISIS - Metric */
hassof21fb272005-09-26 17:05:55 +0000789 if (c->te_metric[0] == c->te_metric[1])
hassof390d2c2004-09-10 20:48:21 +0000790 {
hassof21fb272005-09-26 17:05:55 +0000791 if (c->te_metric[0] != DEFAULT_CIRCUIT_METRICS)
hassof390d2c2004-09-10 20:48:21 +0000792 {
hassof21fb272005-09-26 17:05:55 +0000793 vty_out (vty, " isis metric %d%s", c->te_metric[0],
794 VTY_NEWLINE);
hassof390d2c2004-09-10 20:48:21 +0000795 write++;
796 }
797 }
798 else
799 {
800 for (i = 0; i < 2; i++)
801 {
hassof21fb272005-09-26 17:05:55 +0000802 if (c->te_metric[i] != DEFAULT_CIRCUIT_METRICS)
hassof390d2c2004-09-10 20:48:21 +0000803 {
804 vty_out (vty, " isis metric %d level-%d%s",
hassof21fb272005-09-26 17:05:55 +0000805 c->te_metric[i], i + 1, VTY_NEWLINE);
hassof390d2c2004-09-10 20:48:21 +0000806 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,
hassof21fb272005-09-26 17:05:55 +00001238 "isis metric <0-16777215>",
jardineb5d44e2003-12-23 08:09:43 +00001239 "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
hassof21fb272005-09-26 17:05:55 +00001257 circuit->te_metric[0] = met;
1258 circuit->te_metric[1] = met;
1259
1260 if (met > 63)
1261 met = 63;
1262
jardineb5d44e2003-12-23 08:09:43 +00001263 circuit->metrics[0].metric_default = met;
1264 circuit->metrics[1].metric_default = met;
1265
1266 return CMD_SUCCESS;
1267}
1268
1269DEFUN (no_isis_metric,
1270 no_isis_metric_cmd,
1271 "no isis metric",
1272 NO_STR
1273 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001274 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001275{
1276 struct isis_circuit *circuit;
1277 struct interface *ifp;
1278
hassof390d2c2004-09-10 20:48:21 +00001279 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001280 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001281 if (circuit == NULL)
1282 {
1283 return CMD_WARNING;
1284 }
jardineb5d44e2003-12-23 08:09:43 +00001285 assert (circuit);
1286
hassof21fb272005-09-26 17:05:55 +00001287 circuit->te_metric[0] = DEFAULT_CIRCUIT_METRICS;
1288 circuit->te_metric[1] = DEFAULT_CIRCUIT_METRICS;
jardineb5d44e2003-12-23 08:09:43 +00001289 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1290 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1291
1292 return CMD_SUCCESS;
1293}
1294
1295ALIAS (no_isis_metric,
1296 no_isis_metric_arg_cmd,
hassof21fb272005-09-26 17:05:55 +00001297 "no isis metric <0-16777215>",
jardineb5d44e2003-12-23 08:09:43 +00001298 NO_STR
1299 "IS-IS commands\n"
1300 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001301 "Default metric value\n")
1302
jardineb5d44e2003-12-23 08:09:43 +00001303/* end of metrics */
hassof21fb272005-09-26 17:05:55 +00001304DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00001305 isis_hello_interval_cmd,
1306 "isis hello-interval (<1-65535>|minimal)",
1307 "IS-IS commands\n"
1308 "Set Hello interval\n"
1309 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001310 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001311{
1312 struct isis_circuit *circuit;
1313 struct interface *ifp;
1314 int interval;
1315 char c;
1316
hassof390d2c2004-09-10 20:48:21 +00001317 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001318 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001319 if (circuit == NULL)
1320 {
1321 return CMD_WARNING;
1322 }
1323 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001324 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001325 if (isdigit ((int) c))
1326 {
1327 interval = atoi (argv[0]);
1328 }
1329 else
1330 interval = HELLO_MINIMAL; /* FIXME: should be calculated */
jardineb5d44e2003-12-23 08:09:43 +00001331
hassof390d2c2004-09-10 20:48:21 +00001332 circuit->hello_interval[0] = (u_int16_t) interval;
1333 circuit->hello_interval[1] = (u_int16_t) interval;
1334
jardineb5d44e2003-12-23 08:09:43 +00001335 return CMD_SUCCESS;
1336}
1337
1338DEFUN (no_isis_hello_interval,
1339 no_isis_hello_interval_cmd,
1340 "no isis hello-interval",
1341 NO_STR
1342 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001343 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00001344{
1345 struct isis_circuit *circuit;
1346 struct interface *ifp;
1347
hassof390d2c2004-09-10 20:48:21 +00001348 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001349 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001350 if (circuit == NULL)
1351 {
1352 return CMD_WARNING;
1353 }
jardineb5d44e2003-12-23 08:09:43 +00001354 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001355
hassof390d2c2004-09-10 20:48:21 +00001356
1357 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
jardineb5d44e2003-12-23 08:09:43 +00001358 circuit->hello_interval[1] = HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001359
jardineb5d44e2003-12-23 08:09:43 +00001360 return CMD_SUCCESS;
1361}
1362
1363ALIAS (no_isis_hello_interval,
1364 no_isis_hello_interval_arg_cmd,
1365 "no isis hello-interval (<1-65535>|minimal)",
1366 NO_STR
1367 "IS-IS commands\n"
1368 "Set Hello interval\n"
1369 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001370 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001371
1372DEFUN (isis_hello_interval_l1,
1373 isis_hello_interval_l1_cmd,
1374 "isis hello-interval (<1-65535>|minimal) level-1",
1375 "IS-IS commands\n"
1376 "Set Hello interval\n"
1377 "Hello interval value\n"
1378 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001379 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001380{
1381 struct isis_circuit *circuit;
1382 struct interface *ifp;
1383 long interval;
1384 char c;
1385
hassof390d2c2004-09-10 20:48:21 +00001386 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001387 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001388 if (circuit == NULL)
1389 {
1390 return CMD_WARNING;
1391 }
jardineb5d44e2003-12-23 08:09:43 +00001392 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001393
jardineb5d44e2003-12-23 08:09:43 +00001394 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001395 if (isdigit ((int) c))
1396 {
1397 interval = atoi (argv[0]);
1398 }
1399 else
jardineb5d44e2003-12-23 08:09:43 +00001400 interval = HELLO_MINIMAL;
1401
hassof390d2c2004-09-10 20:48:21 +00001402 circuit->hello_interval[0] = (u_int16_t) interval;
1403
jardineb5d44e2003-12-23 08:09:43 +00001404 return CMD_SUCCESS;
1405}
1406
1407DEFUN (no_isis_hello_interval_l1,
1408 no_isis_hello_interval_l1_cmd,
1409 "no isis hello-interval level-1",
1410 NO_STR
1411 "IS-IS commands\n"
1412 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001413 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001414{
1415 struct isis_circuit *circuit;
1416 struct interface *ifp;
1417
hassof390d2c2004-09-10 20:48:21 +00001418 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001419 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001420 if (circuit == NULL)
1421 {
1422 return CMD_WARNING;
1423 }
jardineb5d44e2003-12-23 08:09:43 +00001424 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001425
hassof390d2c2004-09-10 20:48:21 +00001426
1427 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1428
jardineb5d44e2003-12-23 08:09:43 +00001429 return CMD_SUCCESS;
1430}
1431
1432ALIAS (no_isis_hello_interval_l1,
1433 no_isis_hello_interval_l1_arg_cmd,
1434 "no isis hello-interval (<1-65535>|minimal) level-1",
1435 NO_STR
1436 "IS-IS commands\n"
1437 "Set Hello interval\n"
1438 "Hello interval value\n"
1439 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001440 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001441
1442DEFUN (isis_hello_interval_l2,
1443 isis_hello_interval_l2_cmd,
1444 "isis hello-interval (<1-65535>|minimal) level-2",
1445 "IS-IS commands\n"
1446 "Set Hello interval\n"
1447 "Hello interval value\n"
1448 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001449 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001450{
1451 struct isis_circuit *circuit;
1452 struct interface *ifp;
1453 long interval;
1454 char c;
1455
hassof390d2c2004-09-10 20:48:21 +00001456 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001457 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001458 if (circuit == NULL)
1459 {
1460 return CMD_WARNING;
1461 }
jardineb5d44e2003-12-23 08:09:43 +00001462 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001463
jardineb5d44e2003-12-23 08:09:43 +00001464 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001465 if (isdigit ((int) c))
1466 {
1467 interval = atoi (argv[0]);
1468 }
1469 else
jardineb5d44e2003-12-23 08:09:43 +00001470 interval = HELLO_MINIMAL;
1471
hassof390d2c2004-09-10 20:48:21 +00001472 circuit->hello_interval[1] = (u_int16_t) interval;
1473
jardineb5d44e2003-12-23 08:09:43 +00001474 return CMD_SUCCESS;
1475}
1476
1477DEFUN (no_isis_hello_interval_l2,
1478 no_isis_hello_interval_l2_cmd,
1479 "no isis hello-interval level-2",
1480 NO_STR
1481 "IS-IS commands\n"
1482 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001483 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001484{
1485 struct isis_circuit *circuit;
1486 struct interface *ifp;
1487
hassof390d2c2004-09-10 20:48:21 +00001488 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001489 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001490 if (circuit == NULL)
1491 {
1492 return CMD_WARNING;
1493 }
jardineb5d44e2003-12-23 08:09:43 +00001494 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001495
hassof390d2c2004-09-10 20:48:21 +00001496
1497 circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1498
jardineb5d44e2003-12-23 08:09:43 +00001499 return CMD_SUCCESS;
1500}
1501
1502ALIAS (no_isis_hello_interval_l2,
1503 no_isis_hello_interval_l2_arg_cmd,
1504 "no isis hello-interval (<1-65535>|minimal) level-2",
1505 NO_STR
1506 "IS-IS commands\n"
1507 "Set Hello interval\n"
1508 "Hello interval value\n"
1509 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001510 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001511
1512DEFUN (isis_hello_multiplier,
1513 isis_hello_multiplier_cmd,
1514 "isis hello-multiplier <3-1000>",
1515 "IS-IS commands\n"
1516 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001517 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001518{
1519 struct isis_circuit *circuit;
1520 struct interface *ifp;
1521 int mult;
hassof390d2c2004-09-10 20:48:21 +00001522
1523 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001524 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001525 if (circuit == NULL)
1526 {
1527 return CMD_WARNING;
1528 }
jardineb5d44e2003-12-23 08:09:43 +00001529 assert (circuit);
1530
1531 mult = atoi (argv[0]);
1532
hassof390d2c2004-09-10 20:48:21 +00001533 circuit->hello_multiplier[0] = (u_int16_t) mult;
1534 circuit->hello_multiplier[1] = (u_int16_t) mult;
1535
jardineb5d44e2003-12-23 08:09:43 +00001536 return CMD_SUCCESS;
1537}
1538
1539DEFUN (no_isis_hello_multiplier,
1540 no_isis_hello_multiplier_cmd,
1541 "no isis hello-multiplier",
1542 NO_STR
1543 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001544 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00001545{
1546 struct isis_circuit *circuit;
1547 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001548
1549 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001550 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001551 if (circuit == NULL)
1552 {
1553 return CMD_WARNING;
1554 }
jardineb5d44e2003-12-23 08:09:43 +00001555 assert (circuit);
1556
1557 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1558 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1559
1560 return CMD_SUCCESS;
1561}
1562
1563ALIAS (no_isis_hello_multiplier,
1564 no_isis_hello_multiplier_arg_cmd,
1565 "no isis hello-multiplier <3-1000>",
1566 NO_STR
1567 "IS-IS commands\n"
1568 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001569 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001570
1571DEFUN (isis_hello_multiplier_l1,
1572 isis_hello_multiplier_l1_cmd,
1573 "isis hello-multiplier <3-1000> level-1",
1574 "IS-IS commands\n"
1575 "Set multiplier for Hello holding time\n"
1576 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001577 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001578{
1579 struct isis_circuit *circuit;
1580 struct interface *ifp;
1581 int mult;
hassof390d2c2004-09-10 20:48:21 +00001582
1583 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001584 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001585 if (circuit == NULL)
1586 {
1587 return CMD_WARNING;
1588 }
jardineb5d44e2003-12-23 08:09:43 +00001589 assert (circuit);
1590
1591 mult = atoi (argv[0]);
1592
hassof390d2c2004-09-10 20:48:21 +00001593 circuit->hello_multiplier[0] = (u_int16_t) mult;
1594
jardineb5d44e2003-12-23 08:09:43 +00001595 return CMD_SUCCESS;
1596}
1597
1598DEFUN (no_isis_hello_multiplier_l1,
1599 no_isis_hello_multiplier_l1_cmd,
1600 "no isis hello-multiplier level-1",
1601 NO_STR
1602 "IS-IS commands\n"
1603 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001604 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001605{
1606 struct isis_circuit *circuit;
1607 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001608
1609 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001610 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001611 if (circuit == NULL)
1612 {
1613 return CMD_WARNING;
1614 }
jardineb5d44e2003-12-23 08:09:43 +00001615 assert (circuit);
1616
1617 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1618
1619 return CMD_SUCCESS;
1620}
1621
1622ALIAS (no_isis_hello_multiplier_l1,
1623 no_isis_hello_multiplier_l1_arg_cmd,
1624 "no isis hello-multiplier <3-1000> level-1",
1625 NO_STR
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-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001630
1631DEFUN (isis_hello_multiplier_l2,
1632 isis_hello_multiplier_l2_cmd,
1633 "isis hello-multiplier <3-1000> level-2",
1634 "IS-IS commands\n"
1635 "Set multiplier for Hello holding time\n"
1636 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001637 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001638{
1639 struct isis_circuit *circuit;
1640 struct interface *ifp;
1641 int mult;
hassof390d2c2004-09-10 20:48:21 +00001642
1643 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001644 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001645 if (circuit == NULL)
1646 {
1647 return CMD_WARNING;
1648 }
jardineb5d44e2003-12-23 08:09:43 +00001649 assert (circuit);
1650
1651 mult = atoi (argv[0]);
1652
hassof390d2c2004-09-10 20:48:21 +00001653 circuit->hello_multiplier[1] = (u_int16_t) mult;
1654
jardineb5d44e2003-12-23 08:09:43 +00001655 return CMD_SUCCESS;
1656}
1657
1658DEFUN (no_isis_hello_multiplier_l2,
1659 no_isis_hello_multiplier_l2_cmd,
1660 "no isis hello-multiplier level-2",
1661 NO_STR
1662 "IS-IS commands\n"
1663 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001664 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001665{
1666 struct isis_circuit *circuit;
1667 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001668
1669 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001670 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001671 if (circuit == NULL)
1672 {
1673 return CMD_WARNING;
1674 }
jardineb5d44e2003-12-23 08:09:43 +00001675 assert (circuit);
1676
1677 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1678
1679 return CMD_SUCCESS;
1680}
1681
1682ALIAS (no_isis_hello_multiplier_l2,
1683 no_isis_hello_multiplier_l2_arg_cmd,
1684 "no isis hello-multiplier <3-1000> level-2",
1685 NO_STR
1686 "IS-IS commands\n"
1687 "Set multiplier for Hello holding time\n"
1688 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001689 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001690
1691DEFUN (isis_hello,
1692 isis_hello_cmd,
1693 "isis hello padding",
1694 "IS-IS commands\n"
1695 "Add padding to IS-IS hello packets\n"
1696 "Pad hello packets\n"
1697 "<cr>\n")
1698{
1699 struct interface *ifp;
1700 struct isis_circuit *circuit;
hassof390d2c2004-09-10 20:48:21 +00001701
1702 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001703 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001704 if (circuit == NULL)
1705 {
1706 return CMD_WARNING;
1707 }
jardineb5d44e2003-12-23 08:09:43 +00001708 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001709
jardineb5d44e2003-12-23 08:09:43 +00001710 circuit->u.bc.pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00001711
jardineb5d44e2003-12-23 08:09:43 +00001712 return CMD_SUCCESS;
1713}
1714
jardineb5d44e2003-12-23 08:09:43 +00001715DEFUN (no_isis_hello,
1716 no_isis_hello_cmd,
1717 "no isis hello padding",
1718 NO_STR
1719 "IS-IS commands\n"
1720 "Add padding to IS-IS hello packets\n"
1721 "Pad hello packets\n"
1722 "<cr>\n")
1723{
1724 struct isis_circuit *circuit;
1725 struct interface *ifp;
1726
hassof390d2c2004-09-10 20:48:21 +00001727 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001728 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001729 if (circuit == NULL)
1730 {
1731 return CMD_WARNING;
1732 }
jardineb5d44e2003-12-23 08:09:43 +00001733 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001734
jardineb5d44e2003-12-23 08:09:43 +00001735 circuit->u.bc.pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00001736
jardineb5d44e2003-12-23 08:09:43 +00001737 return CMD_SUCCESS;
1738}
1739
1740DEFUN (csnp_interval,
1741 csnp_interval_cmd,
1742 "isis csnp-interval <0-65535>",
1743 "IS-IS commands\n"
1744 "Set CSNP interval in seconds\n"
1745 "CSNP interval value\n")
1746{
1747 struct isis_circuit *circuit;
1748 struct interface *ifp;
1749 unsigned long interval;
1750
hassof390d2c2004-09-10 20:48:21 +00001751 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001752 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001753 if (circuit == NULL)
1754 {
1755 return CMD_WARNING;
1756 }
jardineb5d44e2003-12-23 08:09:43 +00001757 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001758
jardineb5d44e2003-12-23 08:09:43 +00001759 interval = atol (argv[0]);
1760
hassof390d2c2004-09-10 20:48:21 +00001761 circuit->csnp_interval[0] = (u_int16_t) interval;
1762 circuit->csnp_interval[1] = (u_int16_t) interval;
1763
jardineb5d44e2003-12-23 08:09:43 +00001764 return CMD_SUCCESS;
1765}
1766
1767DEFUN (no_csnp_interval,
1768 no_csnp_interval_cmd,
1769 "no isis csnp-interval",
1770 NO_STR
1771 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001772 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001773{
1774 struct isis_circuit *circuit;
1775 struct interface *ifp;
1776
hassof390d2c2004-09-10 20:48:21 +00001777 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001778 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001779 if (circuit == NULL)
1780 {
1781 return CMD_WARNING;
1782 }
jardineb5d44e2003-12-23 08:09:43 +00001783 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001784
jardineb5d44e2003-12-23 08:09:43 +00001785 circuit->csnp_interval[0] = CSNP_INTERVAL;
1786 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001787
jardineb5d44e2003-12-23 08:09:43 +00001788 return CMD_SUCCESS;
1789}
1790
1791ALIAS (no_csnp_interval,
1792 no_csnp_interval_arg_cmd,
1793 "no isis csnp-interval <0-65535>",
1794 NO_STR
1795 "IS-IS commands\n"
1796 "Set CSNP interval in seconds\n"
1797 "CSNP interval value\n")
1798
jardineb5d44e2003-12-23 08:09:43 +00001799DEFUN (csnp_interval_l1,
1800 csnp_interval_l1_cmd,
1801 "isis csnp-interval <0-65535> level-1",
1802 "IS-IS commands\n"
1803 "Set CSNP interval in seconds\n"
1804 "CSNP interval value\n"
1805 "Specify interval for level-1 CSNPs\n")
1806{
1807 struct isis_circuit *circuit;
1808 struct interface *ifp;
1809 unsigned long interval;
1810
hassof390d2c2004-09-10 20:48:21 +00001811 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001812 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001813 if (circuit == NULL)
1814 {
1815 return CMD_WARNING;
1816 }
jardineb5d44e2003-12-23 08:09:43 +00001817 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001818
jardineb5d44e2003-12-23 08:09:43 +00001819 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001820
1821 circuit->csnp_interval[0] = (u_int16_t) interval;
1822
jardineb5d44e2003-12-23 08:09:43 +00001823 return CMD_SUCCESS;
1824}
1825
1826DEFUN (no_csnp_interval_l1,
1827 no_csnp_interval_l1_cmd,
1828 "no isis csnp-interval level-1",
1829 NO_STR
1830 "IS-IS commands\n"
1831 "Set CSNP interval in seconds\n"
1832 "Specify interval for level-1 CSNPs\n")
1833{
1834 struct isis_circuit *circuit;
1835 struct interface *ifp;
1836
hassof390d2c2004-09-10 20:48:21 +00001837 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001838 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001839 if (circuit == NULL)
1840 {
1841 return CMD_WARNING;
1842 }
jardineb5d44e2003-12-23 08:09:43 +00001843 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001844
jardineb5d44e2003-12-23 08:09:43 +00001845 circuit->csnp_interval[0] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001846
jardineb5d44e2003-12-23 08:09:43 +00001847 return CMD_SUCCESS;
1848}
1849
1850ALIAS (no_csnp_interval_l1,
1851 no_csnp_interval_l1_arg_cmd,
1852 "no isis csnp-interval <0-65535> level-1",
1853 NO_STR
1854 "IS-IS commands\n"
1855 "Set CSNP interval in seconds\n"
1856 "CSNP interval value\n"
1857 "Specify interval for level-1 CSNPs\n")
1858
jardineb5d44e2003-12-23 08:09:43 +00001859DEFUN (csnp_interval_l2,
1860 csnp_interval_l2_cmd,
1861 "isis csnp-interval <0-65535> level-2",
1862 "IS-IS commands\n"
1863 "Set CSNP interval in seconds\n"
1864 "CSNP interval value\n"
1865 "Specify interval for level-2 CSNPs\n")
1866{
1867 struct isis_circuit *circuit;
1868 struct interface *ifp;
1869 unsigned long interval;
1870
hassof390d2c2004-09-10 20:48:21 +00001871 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001872 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001873 if (circuit == NULL)
1874 {
1875 return CMD_WARNING;
1876 }
jardineb5d44e2003-12-23 08:09:43 +00001877 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001878
jardineb5d44e2003-12-23 08:09:43 +00001879 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001880
1881 circuit->csnp_interval[1] = (u_int16_t) interval;
1882
jardineb5d44e2003-12-23 08:09:43 +00001883 return CMD_SUCCESS;
1884}
1885
1886DEFUN (no_csnp_interval_l2,
1887 no_csnp_interval_l2_cmd,
1888 "no isis csnp-interval level-2",
1889 NO_STR
1890 "IS-IS commands\n"
1891 "Set CSNP interval in seconds\n"
1892 "Specify interval for level-2 CSNPs\n")
1893{
1894 struct isis_circuit *circuit;
1895 struct interface *ifp;
1896
hassof390d2c2004-09-10 20:48:21 +00001897 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001898 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001899 if (circuit == NULL)
1900 {
1901 return CMD_WARNING;
1902 }
jardineb5d44e2003-12-23 08:09:43 +00001903 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001904
jardineb5d44e2003-12-23 08:09:43 +00001905 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001906
jardineb5d44e2003-12-23 08:09:43 +00001907 return CMD_SUCCESS;
1908}
1909
1910ALIAS (no_csnp_interval_l2,
1911 no_csnp_interval_l2_arg_cmd,
1912 "no isis csnp-interval <0-65535> level-2",
1913 NO_STR
1914 "IS-IS commands\n"
1915 "Set CSNP interval in seconds\n"
1916 "CSNP interval value\n"
1917 "Specify interval for level-2 CSNPs\n")
1918
jardineb5d44e2003-12-23 08:09:43 +00001919#ifdef HAVE_IPV6
1920DEFUN (ipv6_router_isis,
1921 ipv6_router_isis_cmd,
1922 "ipv6 router isis WORD",
1923 "IPv6 interface subcommands\n"
1924 "IPv6 Router interface commands\n"
1925 "IS-IS Routing for IPv6\n"
1926 "Routing process tag\n")
1927{
1928 struct isis_circuit *c;
1929 struct interface *ifp;
1930 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001931
1932 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001933 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001934
jardineb5d44e2003-12-23 08:09:43 +00001935 area = isis_area_lookup (argv[0]);
1936
1937 /* Prevent more than one circuit per interface */
1938 if (area)
1939 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001940 else
1941 c = NULL;
1942
1943 if (c && (ifp->info != NULL))
1944 {
1945 if (c->ipv6_router == 1)
1946 {
1947 vty_out (vty, "ISIS circuit is already defined for IPv6%s",
1948 VTY_NEWLINE);
1949 return CMD_WARNING;
1950 }
jardineb5d44e2003-12-23 08:09:43 +00001951 }
jardineb5d44e2003-12-23 08:09:43 +00001952
1953 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +00001954 if (!area)
1955 {
1956 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1957 return CMD_WARNING;
1958 }
jardineb5d44e2003-12-23 08:09:43 +00001959
hassof390d2c2004-09-10 20:48:21 +00001960 if (!c)
1961 {
1962 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1963 c = isis_csm_state_change (ISIS_ENABLE, c, area);
1964 c->interface = ifp;
1965 ifp->info = c;
1966 }
jardineb5d44e2003-12-23 08:09:43 +00001967
hassof390d2c2004-09-10 20:48:21 +00001968 if (!c)
jardineb5d44e2003-12-23 08:09:43 +00001969 return CMD_WARNING;
1970
1971 c->ipv6_router = 1;
1972 area->ipv6_circuits++;
1973 circuit_update_nlpids (c);
1974
1975 vty->node = INTERFACE_NODE;
1976
1977 return CMD_SUCCESS;
1978}
1979
1980DEFUN (no_ipv6_router_isis,
1981 no_ipv6_router_isis_cmd,
1982 "no ipv6 router isis WORD",
1983 NO_STR
1984 "IPv6 interface subcommands\n"
1985 "IPv6 Router interface commands\n"
1986 "IS-IS Routing for IPv6\n"
1987 "Routing process tag\n")
1988{
1989 struct isis_circuit *c;
1990 struct interface *ifp;
1991 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001992
1993 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001994 /* UGLY - will remove l8r
1995 if (circuit == NULL) {
hassof390d2c2004-09-10 20:48:21 +00001996 return CMD_WARNING;
1997 } */
jardineb5d44e2003-12-23 08:09:43 +00001998 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001999
jardineb5d44e2003-12-23 08:09:43 +00002000 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00002001 if (!area)
2002 {
2003 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
2004 return CMD_WARNING;
2005 }
2006
jardineb5d44e2003-12-23 08:09:43 +00002007 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
2008 if (!c)
2009 return CMD_WARNING;
2010
2011 c->ipv6_router = 0;
2012 area->ipv6_circuits--;
2013 if (c->ip_router == 0)
2014 isis_csm_state_change (ISIS_DISABLE, c, area);
2015
2016 return CMD_SUCCESS;
2017}
hassof390d2c2004-09-10 20:48:21 +00002018#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00002019
hassof390d2c2004-09-10 20:48:21 +00002020struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002021 INTERFACE_NODE,
2022 "%s(config-if)# ",
2023 1,
2024};
2025
jardineb5d44e2003-12-23 08:09:43 +00002026int
2027isis_if_new_hook (struct interface *ifp)
2028{
2029/* FIXME: Discuss if the circuit should be created here
2030 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2031 ifp->info = NULL;
2032 return 0;
2033}
2034
2035int
2036isis_if_delete_hook (struct interface *ifp)
2037{
2038/* FIXME: Discuss if the circuit should be created here
2039 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2040 ifp->info = NULL;
2041 return 0;
2042}
2043
jardineb5d44e2003-12-23 08:09:43 +00002044void
2045isis_circuit_init ()
2046{
jardineb5d44e2003-12-23 08:09:43 +00002047 /* Initialize Zebra interface data structure */
2048 if_init ();
2049 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2050 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2051
2052 /* Install interface node */
2053 install_node (&interface_node, isis_interface_config_write);
2054 install_element (CONFIG_NODE, &interface_cmd);
2055
2056 install_default (INTERFACE_NODE);
2057 install_element (INTERFACE_NODE, &interface_desc_cmd);
2058 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2059
2060 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2061 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2062
2063 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2064 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2065
2066 install_element (INTERFACE_NODE, &isis_passwd_cmd);
2067 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2068
2069 install_element (INTERFACE_NODE, &isis_priority_cmd);
2070 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2071 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2072 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2073 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2074 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2075 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2076 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2077 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2078
2079 install_element (INTERFACE_NODE, &isis_metric_cmd);
2080 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2081 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2082
2083 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2084 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2085 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2086 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2087 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2088 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2089 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2090 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2091 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2092
2093 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2094 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2095 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2096 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2097 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2098 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2099 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2100 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2101 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2102
2103 install_element (INTERFACE_NODE, &isis_hello_cmd);
2104 install_element (INTERFACE_NODE, &no_isis_hello_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002105 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2106 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2107 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2108 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2109 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2110 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2111 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2112 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2113 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2114
2115#ifdef HAVE_IPV6
2116 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2117 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002118#endif
jardineb5d44e2003-12-23 08:09:43 +00002119}