blob: 76145f026b955847f654cb2cc677208a853751bb [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 */
jardineb5d44e2003-12-23 08:09:43 +000022#include <zebra.h>
hasso37da8c02004-05-19 11:38:40 +000023#ifdef GNU_LINUX
jardineb5d44e2003-12-23 08:09:43 +000024#include <net/ethernet.h>
hasso37da8c02004-05-19 11:38:40 +000025#else
26#include <netinet/if_ether.h>
27#endif
jardineb5d44e2003-12-23 08:09:43 +000028
29#include "log.h"
30#include "memory.h"
31#include "if.h"
32#include "linklist.h"
33#include "command.h"
34#include "thread.h"
35#include "hash.h"
36#include "prefix.h"
37#include "stream.h"
38
39#include "isisd/dict.h"
40#include "isisd/include-netbsd/iso.h"
41#include "isisd/isis_constants.h"
42#include "isisd/isis_common.h"
43#include "isisd/isis_circuit.h"
44#include "isisd/isis_tlv.h"
45#include "isisd/isis_lsp.h"
46#include "isisd/isis_pdu.h"
47#include "isisd/isis_network.h"
48#include "isisd/isis_misc.h"
49#include "isisd/isis_constants.h"
50#include "isisd/isis_adjacency.h"
51#include "isisd/isis_dr.h"
52#include "isisd/isis_flags.h"
53#include "isisd/isisd.h"
54#include "isisd/isis_csm.h"
55#include "isisd/isis_events.h"
56
57extern struct thread_master *master;
58extern struct isis *isis;
59
60struct isis_circuit *
61isis_circuit_new ()
62{
63 struct isis_circuit *circuit;
64 int i;
65
hasso3fdb2dd2005-09-28 18:45:54 +000066 circuit = XCALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit));
hassof390d2c2004-09-10 20:48:21 +000067 if (circuit)
68 {
hassof390d2c2004-09-10 20:48:21 +000069 /* set default metrics for circuit */
70 for (i = 0; i < 2; i++)
71 {
72 circuit->metrics[i].metric_default = DEFAULT_CIRCUIT_METRICS;
73 circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED;
74 circuit->metrics[i].metric_error = METRICS_UNSUPPORTED;
75 circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED;
hassof21fb272005-09-26 17:05:55 +000076 circuit->te_metric[i] = DEFAULT_CIRCUIT_METRICS;
hassof390d2c2004-09-10 20:48:21 +000077 }
jardineb5d44e2003-12-23 08:09:43 +000078 }
hassof390d2c2004-09-10 20:48:21 +000079 else
80 {
81 zlog_err ("Can't malloc isis circuit");
82 return NULL;
83 }
84
jardineb5d44e2003-12-23 08:09:43 +000085 return circuit;
86}
87
jardineb5d44e2003-12-23 08:09:43 +000088void
89isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area)
90{
91 int i;
92 circuit->area = area;
93 /*
94 * The level for the circuit is same as for the area, unless configured
95 * otherwise.
96 */
97 circuit->circuit_is_type = area->is_type;
98 /*
99 * Default values
100 */
hassof390d2c2004-09-10 20:48:21 +0000101 for (i = 0; i < 2; i++)
102 {
103 circuit->hello_interval[i] = HELLO_INTERVAL;
104 circuit->hello_multiplier[i] = HELLO_MULTIPLIER;
105 circuit->csnp_interval[i] = CSNP_INTERVAL;
106 circuit->psnp_interval[i] = PSNP_INTERVAL;
107 circuit->u.bc.priority[i] = DEFAULT_PRIORITY;
108 }
109 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
110 {
111 circuit->u.bc.adjdb[0] = list_new ();
112 circuit->u.bc.adjdb[1] = list_new ();
113 circuit->u.bc.pad_hellos = 1;
114 }
jardineb5d44e2003-12-23 08:09:43 +0000115 circuit->lsp_interval = LSP_INTERVAL;
116
117 /*
118 * Add the circuit into area
119 */
120 listnode_add (area->circuit_list, circuit);
121
122 circuit->idx = flags_get_index (&area->flags);
123 circuit->lsp_queue = list_new ();
124
125 return;
126}
127
hassof390d2c2004-09-10 20:48:21 +0000128void
jardineb5d44e2003-12-23 08:09:43 +0000129isis_circuit_deconfigure (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000130 struct isis_area *area)
jardineb5d44e2003-12-23 08:09:43 +0000131{
hassof390d2c2004-09-10 20:48:21 +0000132
jardineb5d44e2003-12-23 08:09:43 +0000133 /* Remove circuit from area */
134 listnode_delete (area->circuit_list, circuit);
135 /* Free the index of SRM and SSN flags */
136 flags_free_index (&area->flags, circuit->idx);
137
138 return;
139}
140
141struct isis_circuit *
142circuit_lookup_by_ifp (struct interface *ifp, struct list *list)
143{
144 struct isis_circuit *circuit = NULL;
145 struct listnode *node;
hassof390d2c2004-09-10 20:48:21 +0000146
jardineb5d44e2003-12-23 08:09:43 +0000147 if (!list)
148 return NULL;
hassof390d2c2004-09-10 20:48:21 +0000149
paul1eb8ef22005-04-07 07:30:20 +0000150 for (ALL_LIST_ELEMENTS_RO (list, node, circuit))
151 if (circuit->interface == ifp)
152 return circuit;
153
jardineb5d44e2003-12-23 08:09:43 +0000154 return NULL;
155}
156
157struct isis_circuit *
158circuit_scan_by_ifp (struct interface *ifp)
159{
160 struct isis_area *area;
161 struct listnode *node;
162 struct isis_circuit *circuit;
163
164 if (!isis->area_list)
165 return NULL;
166
paul1eb8ef22005-04-07 07:30:20 +0000167 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
hassof390d2c2004-09-10 20:48:21 +0000168 {
hassof390d2c2004-09-10 20:48:21 +0000169 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
170 if (circuit)
171 return circuit;
172 }
173
jardineb5d44e2003-12-23 08:09:43 +0000174 return circuit_lookup_by_ifp (ifp, isis->init_circ_list);
175}
176
177void
178isis_circuit_del (struct isis_circuit *circuit)
179{
180
181 if (!circuit)
182 return;
183
hassof390d2c2004-09-10 20:48:21 +0000184 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
185 {
186 /* destroy adjacency databases */
hasso46606872004-12-29 19:34:22 +0000187 if (circuit->u.bc.adjdb[0])
188 list_delete (circuit->u.bc.adjdb[0]);
189 if (circuit->u.bc.adjdb[1])
190 list_delete (circuit->u.bc.adjdb[1]);
hassof390d2c2004-09-10 20:48:21 +0000191 /* destroy neighbour lists */
192 if (circuit->u.bc.lan_neighs[0])
193 list_delete (circuit->u.bc.lan_neighs[0]);
194 if (circuit->u.bc.lan_neighs[1])
195 list_delete (circuit->u.bc.lan_neighs[1]);
196 /* destroy addresses */
197 }
jardineb5d44e2003-12-23 08:09:43 +0000198 if (circuit->ip_addrs)
199 list_delete (circuit->ip_addrs);
200#ifdef HAVE_IPV6
201 if (circuit->ipv6_link)
202 list_delete (circuit->ipv6_link);
203 if (circuit->ipv6_non_link)
204 list_delete (circuit->ipv6_non_link);
205#endif /* HAVE_IPV6 */
hassof390d2c2004-09-10 20:48:21 +0000206
jardineb5d44e2003-12-23 08:09:43 +0000207 /* and lastly the circuit itself */
208 XFREE (MTYPE_ISIS_CIRCUIT, circuit);
209
210 return;
211}
212
213void
hassof891f442004-09-14 13:54:30 +0000214isis_circuit_add_addr (struct isis_circuit *circuit,
215 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000216{
217 struct prefix_ipv4 *ipv4;
hassof390d2c2004-09-10 20:48:21 +0000218 u_char buf[BUFSIZ];
jardineb5d44e2003-12-23 08:09:43 +0000219#ifdef HAVE_IPV6
220 struct prefix_ipv6 *ipv6;
221#endif /* HAVE_IPV6 */
hassof891f442004-09-14 13:54:30 +0000222
hassof390d2c2004-09-10 20:48:21 +0000223 if (!circuit->ip_addrs)
hassof891f442004-09-14 13:54:30 +0000224 circuit->ip_addrs = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000225#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000226 if (!circuit->ipv6_link)
hassof891f442004-09-14 13:54:30 +0000227 circuit->ipv6_link = list_new ();
hassof390d2c2004-09-10 20:48:21 +0000228 if (!circuit->ipv6_non_link)
hassof891f442004-09-14 13:54:30 +0000229 circuit->ipv6_non_link = list_new ();
jardineb5d44e2003-12-23 08:09:43 +0000230#endif /* HAVE_IPV6 */
231
232 memset (&buf, 0, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000233 if (connected->address->family == AF_INET)
hassof390d2c2004-09-10 20:48:21 +0000234 {
235 ipv4 = prefix_ipv4_new ();
hassof891f442004-09-14 13:54:30 +0000236 ipv4->prefixlen = connected->address->prefixlen;
237 ipv4->prefix = connected->address->u.prefix4;
hassof390d2c2004-09-10 20:48:21 +0000238 listnode_add (circuit->ip_addrs, ipv4);
hasso0dae85e2004-09-26 19:53:47 +0000239 if (circuit->area)
240 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000241
jardineb5d44e2003-12-23 08:09:43 +0000242#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000243 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000244 zlog_debug ("Added IP address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000245 circuit->circuit_id);
246#endif /* EXTREME_DEBUG */
jardineb5d44e2003-12-23 08:09:43 +0000247 }
hassof390d2c2004-09-10 20:48:21 +0000248#ifdef HAVE_IPV6
hassof891f442004-09-14 13:54:30 +0000249 if (connected->address->family == AF_INET6)
hassof390d2c2004-09-10 20:48:21 +0000250 {
251 ipv6 = prefix_ipv6_new ();
hassof891f442004-09-14 13:54:30 +0000252 ipv6->prefixlen = connected->address->prefixlen;
253 ipv6->prefix = connected->address->u.prefix6;
254
hassof390d2c2004-09-10 20:48:21 +0000255 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
hassof891f442004-09-14 13:54:30 +0000256 listnode_add (circuit->ipv6_link, ipv6);
hassof390d2c2004-09-10 20:48:21 +0000257 else
hassof891f442004-09-14 13:54:30 +0000258 listnode_add (circuit->ipv6_non_link, ipv6);
hasso0dae85e2004-09-26 19:53:47 +0000259 if (circuit->area)
260 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000261
jardineb5d44e2003-12-23 08:09:43 +0000262#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000263 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000264 zlog_debug ("Added IPv6 address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000265 circuit->circuit_id);
266#endif /* EXTREME_DEBUG */
267 }
jardineb5d44e2003-12-23 08:09:43 +0000268#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000269 return;
270}
271
272void
273isis_circuit_del_addr (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000274 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000275{
hassof891f442004-09-14 13:54:30 +0000276 struct prefix_ipv4 *ipv4, *ip = NULL;
277 struct listnode *node;
278 int found = 0;
279 u_char buf[BUFSIZ];
280#ifdef HAVE_IPV6
281 struct prefix_ipv6 *ipv6, *ip6 = NULL;
282#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000283
hassof891f442004-09-14 13:54:30 +0000284 memset (&buf, 0, BUFSIZ);
285 if (connected->address->family == AF_INET)
286 {
287 ipv4 = prefix_ipv4_new ();
288 ipv4->prefixlen = connected->address->prefixlen;
289 ipv4->prefix = connected->address->u.prefix4;
290
paul1eb8ef22005-04-07 07:30:20 +0000291 for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip))
292 if (prefix_same ((struct prefix *) ip, (struct prefix *) &ipv4))
293 break;
hassof891f442004-09-14 13:54:30 +0000294
295 if (ip)
296 {
297 listnode_delete (circuit->ip_addrs, ip);
hasso0dae85e2004-09-26 19:53:47 +0000298 if (circuit->area)
299 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000300 }
301 else
302 {
hassof7c43dc2004-09-26 16:24:14 +0000303 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000304 zlog_warn("Nonexitant ip address %s removal attempt from circuit \
305 %d", buf, circuit->circuit_id);
306 }
307 }
308#ifdef HAVE_IPV6
309 if (connected->address->family == AF_INET6)
310 {
311 ipv6 = prefix_ipv6_new ();
312 ipv6->prefixlen = connected->address->prefixlen;
313 ipv6->prefix = connected->address->u.prefix6;
314
315 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
316 {
paul1eb8ef22005-04-07 07:30:20 +0000317 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_link, node, ip6))
hassof891f442004-09-14 13:54:30 +0000318 {
hassof891f442004-09-14 13:54:30 +0000319 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
320 break;
321 }
322 if (ip6)
323 {
324 listnode_delete (circuit->ipv6_link, ip6);
325 found = 1;
326 }
327 }
328 else
329 {
paul1eb8ef22005-04-07 07:30:20 +0000330 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_non_link, node, ip6))
hassof891f442004-09-14 13:54:30 +0000331 {
hassof891f442004-09-14 13:54:30 +0000332 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
333 break;
334 }
335 if (ip6)
336 {
337 listnode_delete (circuit->ipv6_non_link, ip6);
338 found = 1;
339 }
340 }
341
342 if (!found)
343 {
hassof7c43dc2004-09-26 16:24:14 +0000344 prefix2str (connected->address, (char *)buf, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000345 zlog_warn("Nonexitant ip address %s removal attempt from \
346 circuit %d", buf, circuit->circuit_id);
347 }
348 else
hasso0dae85e2004-09-26 19:53:47 +0000349 if (circuit->area)
350 lsp_regenerate_schedule (circuit->area);
hassof891f442004-09-14 13:54:30 +0000351 }
352#endif /* HAVE_IPV6 */
353 return;
jardineb5d44e2003-12-23 08:09:43 +0000354}
355
356void
357isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
358{
paul1eb8ef22005-04-07 07:30:20 +0000359 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000360 struct connected *conn;
361
362 circuit->interface = ifp;
363 ifp->info = circuit;
hassof390d2c2004-09-10 20:48:21 +0000364
365 circuit->circuit_id = ifp->ifindex % 255; /* FIXME: Why not ? */
jardineb5d44e2003-12-23 08:09:43 +0000366
367 /* isis_circuit_update_addrs (circuit, ifp); */
368
hassof390d2c2004-09-10 20:48:21 +0000369 if (if_is_broadcast (ifp))
370 {
371 circuit->circ_type = CIRCUIT_T_BROADCAST;
372 /*
373 * Get the Hardware Address
374 */
jardineb5d44e2003-12-23 08:09:43 +0000375#ifdef HAVE_SOCKADDR_DL
hassof390d2c2004-09-10 20:48:21 +0000376 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
377 zlog_warn ("unsupported link layer");
378 else
379 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl),
380 ETH_ALEN);
jardineb5d44e2003-12-23 08:09:43 +0000381#else
hassof390d2c2004-09-10 20:48:21 +0000382 if (circuit->interface->hw_addr_len != ETH_ALEN)
383 {
384 zlog_warn ("unsupported link layer");
385 }
386 else
387 {
388 memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN);
389 }
jardineb5d44e2003-12-23 08:09:43 +0000390#ifdef EXTREME_DEGUG
hasso529d65b2004-12-24 00:14:50 +0000391 zlog_debug ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
hassof390d2c2004-09-10 20:48:21 +0000392 circuit->interface->ifindex, ISO_MTU (circuit),
393 snpa_print (circuit->u.bc.snpa));
jardineb5d44e2003-12-23 08:09:43 +0000394
395#endif /* EXTREME_DEBUG */
hassof390d2c2004-09-10 20:48:21 +0000396#endif /* HAVE_SOCKADDR_DL */
397 }
398 else if (if_is_pointopoint (ifp))
399 {
400 circuit->circ_type = CIRCUIT_T_P2P;
401 }
402 else
403 {
hassoc89c05d2005-09-04 21:36:36 +0000404 /* It's normal in case of loopback etc. */
405 if (isis->debugs & DEBUG_EVENTS)
406 zlog_debug ("isis_circuit_if_add: unsupported media");
hassof390d2c2004-09-10 20:48:21 +0000407 }
408
paul1eb8ef22005-04-07 07:30:20 +0000409 for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, conn))
410 isis_circuit_add_addr (circuit, conn);
jardineb5d44e2003-12-23 08:09:43 +0000411
412 return;
413}
414
415void
hassof390d2c2004-09-10 20:48:21 +0000416isis_circuit_update_params (struct isis_circuit *circuit,
417 struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000418{
hassob30c5e62004-12-29 20:06:41 +0000419 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +0000420
421 if (circuit->circuit_id != ifp->ifindex)
422 {
423 zlog_warn ("changing circuit_id %d->%d", circuit->circuit_id,
424 ifp->ifindex);
425 circuit->circuit_id = ifp->ifindex % 255;
426 }
jardineb5d44e2003-12-23 08:09:43 +0000427
428 /* FIXME: Why is this needed? shouldn't we compare to the area's mtu */
429 /* Ofer, this was here in case someone changes the mtu (e.g. with ifconfig)
430 The areas MTU is the minimum of mtu's of circuits in the area
431 now we can't catch the change
432 if (circuit->mtu != ifp->mtu) {
433 zlog_warn ("changing circuit mtu %d->%d", circuit->mtu,
434 ifp->mtu);
435 circuit->mtu = ifp->mtu;
436 }
hassof390d2c2004-09-10 20:48:21 +0000437 */
jardineb5d44e2003-12-23 08:09:43 +0000438 /*
439 * Get the Hardware Address
440 */
441#ifdef HAVE_SOCKADDR_DL
442 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
jardineb5d44e2003-12-23 08:09:43 +0000443 zlog_warn ("unsupported link layer");
hassof390d2c2004-09-10 20:48:21 +0000444 else
445 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl), ETH_ALEN);
446#else
447 if (circuit->interface->hw_addr_len != ETH_ALEN)
448 {
449 zlog_warn ("unsupported link layer");
jardineb5d44e2003-12-23 08:09:43 +0000450 }
hassof390d2c2004-09-10 20:48:21 +0000451 else
452 {
453 if (memcmp (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN))
454 {
455 zlog_warn ("changing circuit snpa %s->%s",
456 snpa_print (circuit->u.bc.snpa),
457 snpa_print (circuit->interface->hw_addr));
458 }
459 }
460#endif
jardineb5d44e2003-12-23 08:09:43 +0000461
hassof390d2c2004-09-10 20:48:21 +0000462 if (if_is_broadcast (ifp))
463 {
464 circuit->circ_type = CIRCUIT_T_BROADCAST;
465 }
466 else if (if_is_pointopoint (ifp))
467 {
468 circuit->circ_type = CIRCUIT_T_P2P;
469 }
470 else
471 {
472 zlog_warn ("isis_circuit_update_params: unsupported media");
473 }
jardineb5d44e2003-12-23 08:09:43 +0000474
jardineb5d44e2003-12-23 08:09:43 +0000475 return;
476}
477
478void
hassof390d2c2004-09-10 20:48:21 +0000479isis_circuit_if_del (struct isis_circuit *circuit)
jardineb5d44e2003-12-23 08:09:43 +0000480{
481 circuit->interface->info = NULL;
482 circuit->interface = NULL;
hassof390d2c2004-09-10 20:48:21 +0000483
jardineb5d44e2003-12-23 08:09:43 +0000484 return;
485}
486
487void
488isis_circuit_up (struct isis_circuit *circuit)
489{
jardineb5d44e2003-12-23 08:09:43 +0000490
hassof390d2c2004-09-10 20:48:21 +0000491 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
492 {
493 if (circuit->area->min_bcast_mtu == 0 ||
494 ISO_MTU (circuit) < circuit->area->min_bcast_mtu)
495 circuit->area->min_bcast_mtu = ISO_MTU (circuit);
496 /*
497 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
498 */
jardineb5d44e2003-12-23 08:09:43 +0000499
hassof390d2c2004-09-10 20:48:21 +0000500 /* initilizing the hello sending threads
501 * for a broadcast IF
502 */
jardineb5d44e2003-12-23 08:09:43 +0000503
hassof390d2c2004-09-10 20:48:21 +0000504 /* 8.4.1 a) commence sending of IIH PDUs */
505
506 if (circuit->circuit_is_type & IS_LEVEL_1)
507 {
508 thread_add_event (master, send_lan_l1_hello, circuit, 0);
509 circuit->u.bc.lan_neighs[0] = list_new ();
510 }
511
512 if (circuit->circuit_is_type & IS_LEVEL_2)
513 {
514 thread_add_event (master, send_lan_l2_hello, circuit, 0);
515 circuit->u.bc.lan_neighs[1] = list_new ();
516 }
517
518 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
519 /* 8.4.1 c) FIXME: listen for ESH PDUs */
520
521 /* 8.4.1 d) */
522 /* dr election will commence in... */
523 if (circuit->circuit_is_type & IS_LEVEL_1)
524 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
hassobf731012004-09-17 07:59:57 +0000525 circuit, 2 * circuit->hello_interval[0]);
hassof390d2c2004-09-10 20:48:21 +0000526 if (circuit->circuit_is_type & IS_LEVEL_2)
527 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
hassobf731012004-09-17 07:59:57 +0000528 circuit, 2 * circuit->hello_interval[1]);
jardineb5d44e2003-12-23 08:09:43 +0000529 }
hassof390d2c2004-09-10 20:48:21 +0000530 else
531 {
532 /* initializing the hello send threads
533 * for a ptp IF
534 */
535 thread_add_event (master, send_p2p_hello, circuit, 0);
jardineb5d44e2003-12-23 08:09:43 +0000536
jardineb5d44e2003-12-23 08:09:43 +0000537 }
538
jardineb5d44e2003-12-23 08:09:43 +0000539 /* initializing PSNP timers */
hassof390d2c2004-09-10 20:48:21 +0000540 if (circuit->circuit_is_type & IS_LEVEL_1)
541 {
542 THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
543 isis_jitter (circuit->psnp_interval[0], PSNP_JITTER));
544 }
545
546 if (circuit->circuit_is_type & IS_LEVEL_2)
547 {
548 THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
549 isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
550 }
551
jardineb5d44e2003-12-23 08:09:43 +0000552 /* initialize the circuit streams */
553 if (circuit->rcv_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000554 circuit->rcv_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000555
556 if (circuit->snd_stream == NULL)
hassof390d2c2004-09-10 20:48:21 +0000557 circuit->snd_stream = stream_new (ISO_MTU (circuit));
jardineb5d44e2003-12-23 08:09:43 +0000558
559 /* unified init for circuits */
560 isis_sock_init (circuit);
561
562#ifdef GNU_LINUX
hassof390d2c2004-09-10 20:48:21 +0000563 THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
564 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000565#else
hassof390d2c2004-09-10 20:48:21 +0000566 THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
567 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000568#endif
569 return;
570}
571
572void
573isis_circuit_down (struct isis_circuit *circuit)
574{
hassof390d2c2004-09-10 20:48:21 +0000575 /* Cancel all active threads -- FIXME: wrong place */
hassod70f99e2004-02-11 20:26:31 +0000576 /* HT: Read thread if GNU_LINUX, TIMER thread otherwise. */
hassof390d2c2004-09-10 20:48:21 +0000577 THREAD_OFF (circuit->t_read);
578 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
579 {
580 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
581 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
hassof891f442004-09-14 13:54:30 +0000582 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
583 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
hassof390d2c2004-09-10 20:48:21 +0000584 }
585 else if (circuit->circ_type == CIRCUIT_T_P2P)
586 {
587 THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
588 }
jardineb5d44e2003-12-23 08:09:43 +0000589 /* close the socket */
590 close (circuit->fd);
591
592 return;
593}
594
595void
596circuit_update_nlpids (struct isis_circuit *circuit)
597{
598 circuit->nlpids.count = 0;
hassof390d2c2004-09-10 20:48:21 +0000599
600 if (circuit->ip_router)
601 {
602 circuit->nlpids.nlpids[0] = NLPID_IP;
603 circuit->nlpids.count++;
604 }
jardineb5d44e2003-12-23 08:09:43 +0000605#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000606 if (circuit->ipv6_router)
607 {
608 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
609 circuit->nlpids.count++;
610 }
jardineb5d44e2003-12-23 08:09:43 +0000611#endif /* HAVE_IPV6 */
612 return;
613}
614
615int
hassof390d2c2004-09-10 20:48:21 +0000616isis_interface_config_write (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000617{
618
619 int write = 0;
hasso3fdb2dd2005-09-28 18:45:54 +0000620 struct listnode *node, *node2;
jardineb5d44e2003-12-23 08:09:43 +0000621 struct interface *ifp;
622 struct isis_area *area;
623 struct isis_circuit *c;
jardineb5d44e2003-12-23 08:09:43 +0000624 int i;
jardineb5d44e2003-12-23 08:09:43 +0000625
hasso3fdb2dd2005-09-28 18:45:54 +0000626 for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
jardineb5d44e2003-12-23 08:09:43 +0000627 {
628 /* IF name */
hassof390d2c2004-09-10 20:48:21 +0000629 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000630 write++;
631 /* IF desc */
hassof390d2c2004-09-10 20:48:21 +0000632 if (ifp->desc)
633 {
634 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
635 write++;
636 }
jardineb5d44e2003-12-23 08:09:43 +0000637 /* ISIS Circuit */
hasso3fdb2dd2005-09-28 18:45:54 +0000638 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node2, area))
jardineb5d44e2003-12-23 08:09:43 +0000639 {
640 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000641 if (c)
642 {
643 if (c->ip_router)
644 {
645 vty_out (vty, " ip router isis %s%s", area->area_tag,
646 VTY_NEWLINE);
647 write++;
648 }
jardineb5d44e2003-12-23 08:09:43 +0000649#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000650 if (c->ipv6_router)
651 {
652 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
653 VTY_NEWLINE);
654 write++;
655 }
jardineb5d44e2003-12-23 08:09:43 +0000656#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000657
hassof390d2c2004-09-10 20:48:21 +0000658 /* ISIS - circuit type */
659 if (c->circuit_is_type == IS_LEVEL_1)
660 {
661 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
662 write++;
663 }
664 else
665 {
666 if (c->circuit_is_type == IS_LEVEL_2)
667 {
668 vty_out (vty, " isis circuit-type level-2-only%s",
669 VTY_NEWLINE);
670 write++;
671 }
672 }
jardineb5d44e2003-12-23 08:09:43 +0000673
hassof390d2c2004-09-10 20:48:21 +0000674 /* ISIS - CSNP interval - FIXME: compare to cisco */
675 if (c->csnp_interval[0] == c->csnp_interval[1])
676 {
677 if (c->csnp_interval[0] != CSNP_INTERVAL)
678 {
679 vty_out (vty, " isis csnp-interval %d%s",
680 c->csnp_interval[0], VTY_NEWLINE);
681 write++;
682 }
683 }
684 else
685 {
686 for (i = 0; i < 2; i++)
687 {
688 if (c->csnp_interval[1] != CSNP_INTERVAL)
689 {
690 vty_out (vty, " isis csnp-interval %d level-%d%s",
691 c->csnp_interval[1], i + 1, VTY_NEWLINE);
692 write++;
693 }
694 }
695 }
jardineb5d44e2003-12-23 08:09:43 +0000696
hassof390d2c2004-09-10 20:48:21 +0000697 /* ISIS - Hello padding - Defaults to true so only display if false */
698 if (c->circ_type == CIRCUIT_T_BROADCAST && !c->u.bc.pad_hellos)
699 {
700 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
701 write++;
702 }
jardineb5d44e2003-12-23 08:09:43 +0000703
hassof390d2c2004-09-10 20:48:21 +0000704 /* ISIS - Hello interval - FIXME: compare to cisco */
705 if (c->hello_interval[0] == c->hello_interval[1])
706 {
707 if (c->hello_interval[0] != HELLO_INTERVAL)
708 {
709 vty_out (vty, " isis hello-interval %d%s",
710 c->hello_interval[0], VTY_NEWLINE);
711 write++;
712 }
713 }
714 else
715 {
716 for (i = 0; i < 2; i++)
717 {
718 if (c->hello_interval[i] != HELLO_INTERVAL)
719 {
720 if (c->hello_interval[i] == HELLO_MINIMAL)
721 {
722 vty_out (vty,
723 " isis hello-interval minimal level-%d%s",
724 i + 1, VTY_NEWLINE);
725 }
726 else
727 {
728 vty_out (vty, " isis hello-interval %d level-%d%s",
729 c->hello_interval[i], i + 1, VTY_NEWLINE);
730 }
731 write++;
732 }
733 }
734 }
jardineb5d44e2003-12-23 08:09:43 +0000735
hassof390d2c2004-09-10 20:48:21 +0000736 /* ISIS - Hello Multiplier */
737 if (c->hello_multiplier[0] == c->hello_multiplier[1])
738 {
739 if (c->hello_multiplier[0] != HELLO_MULTIPLIER)
740 {
741 vty_out (vty, " isis hello-multiplier %d%s",
742 c->hello_multiplier[0], VTY_NEWLINE);
743 write++;
744 }
745 }
746 else
747 {
748 for (i = 0; i < 2; i++)
749 {
750 if (c->hello_multiplier[i] != HELLO_MULTIPLIER)
751 {
752 vty_out (vty, " isis hello-multiplier %d level-%d%s",
753 c->hello_multiplier[i], i + 1, VTY_NEWLINE);
754 write++;
755 }
756 }
757 }
758 /* ISIS - Priority */
759 if (c->circ_type == CIRCUIT_T_BROADCAST)
760 {
761 if (c->u.bc.priority[0] == c->u.bc.priority[1])
762 {
763 if (c->u.bc.priority[0] != DEFAULT_PRIORITY)
764 {
765 vty_out (vty, " isis priority %d%s",
766 c->u.bc.priority[0], VTY_NEWLINE);
767 write++;
768 }
769 }
770 else
771 {
772 for (i = 0; i < 2; i++)
773 {
774 if (c->u.bc.priority[i] != DEFAULT_PRIORITY)
775 {
776 vty_out (vty, " isis priority %d level-%d%s",
777 c->u.bc.priority[i], i + 1, VTY_NEWLINE);
778 write++;
779 }
780 }
781 }
782 }
783 /* ISIS - Metric */
hassof21fb272005-09-26 17:05:55 +0000784 if (c->te_metric[0] == c->te_metric[1])
hassof390d2c2004-09-10 20:48:21 +0000785 {
hassof21fb272005-09-26 17:05:55 +0000786 if (c->te_metric[0] != DEFAULT_CIRCUIT_METRICS)
hassof390d2c2004-09-10 20:48:21 +0000787 {
hassof21fb272005-09-26 17:05:55 +0000788 vty_out (vty, " isis metric %d%s", c->te_metric[0],
789 VTY_NEWLINE);
hassof390d2c2004-09-10 20:48:21 +0000790 write++;
791 }
792 }
793 else
794 {
795 for (i = 0; i < 2; i++)
796 {
hassof21fb272005-09-26 17:05:55 +0000797 if (c->te_metric[i] != DEFAULT_CIRCUIT_METRICS)
hassof390d2c2004-09-10 20:48:21 +0000798 {
799 vty_out (vty, " isis metric %d level-%d%s",
hassof21fb272005-09-26 17:05:55 +0000800 c->te_metric[i], i + 1, VTY_NEWLINE);
hassof390d2c2004-09-10 20:48:21 +0000801 write++;
802 }
803 }
804 }
jardineb5d44e2003-12-23 08:09:43 +0000805
hassof390d2c2004-09-10 20:48:21 +0000806 }
jardineb5d44e2003-12-23 08:09:43 +0000807 }
hassof390d2c2004-09-10 20:48:21 +0000808 vty_out (vty, "!%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +0000809 }
hassof390d2c2004-09-10 20:48:21 +0000810
jardineb5d44e2003-12-23 08:09:43 +0000811 return write;
812}
jardineb5d44e2003-12-23 08:09:43 +0000813
814DEFUN (ip_router_isis,
815 ip_router_isis_cmd,
816 "ip router isis WORD",
817 "Interface Internet Protocol config commands\n"
818 "IP router interface commands\n"
819 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000820 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000821{
822 struct isis_circuit *c;
823 struct interface *ifp;
824 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +0000825
826 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000827 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000828
jardineb5d44e2003-12-23 08:09:43 +0000829 area = isis_area_lookup (argv[0]);
830
831 /* Prevent more than one circuit per interface */
832 if (area)
833 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +0000834 else
835 c = NULL;
836 if (c && (ifp->info != NULL))
837 {
jardineb5d44e2003-12-23 08:09:43 +0000838#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000839 if (c->ipv6_router == 0)
840 {
jardineb5d44e2003-12-23 08:09:43 +0000841#endif /* HAVE_IPV6 */
hassoc89c05d2005-09-04 21:36:36 +0000842 /* FIXME: Find the way to warn only vty users. */
843 /* vty_out (vty, "ISIS circuit is already defined%s", VTY_NEWLINE); */
hassof390d2c2004-09-10 20:48:21 +0000844 return CMD_WARNING;
jardineb5d44e2003-12-23 08:09:43 +0000845#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000846 }
847#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000848 }
hassof390d2c2004-09-10 20:48:21 +0000849
jardineb5d44e2003-12-23 08:09:43 +0000850 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +0000851 if (!area)
852 {
hassoc89c05d2005-09-04 21:36:36 +0000853 /* FIXME: Find the way to warn only vty users. */
854 /* vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE); */
hassof390d2c2004-09-10 20:48:21 +0000855 return CMD_WARNING;
856 }
jardineb5d44e2003-12-23 08:09:43 +0000857
hassof390d2c2004-09-10 20:48:21 +0000858 if (!c)
859 {
860 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
861 c = isis_csm_state_change (ISIS_ENABLE, c, area);
862 c->interface = ifp; /* this is automatic */
863 ifp->info = c; /* hardly related to the FSM */
864 }
jardineb5d44e2003-12-23 08:09:43 +0000865
hassof390d2c2004-09-10 20:48:21 +0000866 if (!c)
jardineb5d44e2003-12-23 08:09:43 +0000867 return CMD_WARNING;
868
869 c->ip_router = 1;
870 area->ip_circuits++;
871 circuit_update_nlpids (c);
872
873 vty->node = INTERFACE_NODE;
hassof390d2c2004-09-10 20:48:21 +0000874
jardineb5d44e2003-12-23 08:09:43 +0000875 return CMD_SUCCESS;
876}
877
878DEFUN (no_ip_router_isis,
879 no_ip_router_isis_cmd,
880 "no ip router isis WORD",
881 NO_STR
882 "Interface Internet Protocol config commands\n"
883 "IP router interface commands\n"
884 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +0000885 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +0000886{
887 struct isis_circuit *circuit = NULL;
888 struct interface *ifp;
889 struct isis_area *area;
hasso3fdb2dd2005-09-28 18:45:54 +0000890 struct listnode *node;
jardineb5d44e2003-12-23 08:09:43 +0000891
hassof390d2c2004-09-10 20:48:21 +0000892 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000893 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +0000894
jardineb5d44e2003-12-23 08:09:43 +0000895 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +0000896 if (!area)
897 {
898 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
899 return CMD_WARNING;
900 }
hasso3fdb2dd2005-09-28 18:45:54 +0000901 for (ALL_LIST_ELEMENTS_RO (area->circuit_list, node, circuit))
jardineb5d44e2003-12-23 08:09:43 +0000902 if (circuit->interface == ifp)
903 break;
hassof390d2c2004-09-10 20:48:21 +0000904 if (!circuit)
905 {
906 vty_out (vty, "Can't find ISIS interface %s", VTY_NEWLINE);
907 return CMD_WARNING;
908 }
jardineb5d44e2003-12-23 08:09:43 +0000909 circuit->ip_router = 0;
910 area->ip_circuits--;
911#ifdef HAVE_IPV6
912 if (circuit->ipv6_router == 0)
913#endif
914 isis_csm_state_change (ISIS_DISABLE, circuit, area);
hassof390d2c2004-09-10 20:48:21 +0000915
jardineb5d44e2003-12-23 08:09:43 +0000916 return CMD_SUCCESS;
917}
918
919DEFUN (isis_circuit_type,
920 isis_circuit_type_cmd,
921 "isis circuit-type (level-1|level-1-2|level-2-only)",
922 "IS-IS commands\n"
923 "Configure circuit type for interface\n"
924 "Level-1 only adjacencies are formed\n"
925 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000926 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000927{
928 struct isis_circuit *circuit;
929 struct interface *ifp;
930 int circuit_t;
931 int is_type;
hassof390d2c2004-09-10 20:48:21 +0000932
933 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +0000934 circuit = ifp->info;
935 /* UGLY - will remove l8r */
hassof390d2c2004-09-10 20:48:21 +0000936 if (circuit == NULL)
937 {
938 return CMD_WARNING;
939 }
jardineb5d44e2003-12-23 08:09:43 +0000940
hasso13c48f72004-09-10 21:19:13 +0000941 /* XXX what to do when ip_router_isis is not executed */
942 if (circuit->area == NULL)
943 return CMD_WARNING;
944
jardineb5d44e2003-12-23 08:09:43 +0000945 assert (circuit);
946
hassof7c43dc2004-09-26 16:24:14 +0000947 circuit_t = string2circuit_t ((u_char *)argv[0]);
jardineb5d44e2003-12-23 08:09:43 +0000948
hassof390d2c2004-09-10 20:48:21 +0000949 if (!circuit_t)
950 {
951 vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
952 return CMD_SUCCESS;
953 }
954
jardineb5d44e2003-12-23 08:09:43 +0000955 is_type = circuit->area->is_type;
956 if (is_type == IS_LEVEL_1_AND_2 || is_type == circuit_t)
hassof390d2c2004-09-10 20:48:21 +0000957 isis_event_circuit_type_change (circuit, circuit_t);
958 else
959 {
960 vty_out (vty, "invalid circuit level for area %s.%s",
961 circuit->area->area_tag, VTY_NEWLINE);
962 }
963
jardineb5d44e2003-12-23 08:09:43 +0000964 return CMD_SUCCESS;
965}
966
967DEFUN (no_isis_circuit_type,
968 no_isis_circuit_type_cmd,
969 "no isis circuit-type (level-1|level-1-2|level-2-only)",
970 NO_STR
971 "IS-IS commands\n"
972 "Configure circuit type for interface\n"
973 "Level-1 only adjacencies are formed\n"
974 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +0000975 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +0000976{
977 struct isis_circuit *circuit;
978 struct interface *ifp;
jardineb5d44e2003-12-23 08:09:43 +0000979
hassof390d2c2004-09-10 20:48:21 +0000980 ifp = vty->index;
981 circuit = ifp->info;
982 if (circuit == NULL)
983 {
984 return CMD_WARNING;
985 }
986
987 assert (circuit);
988
jardineb5d44e2003-12-23 08:09:43 +0000989 /*
990 * Set the circuits level to its default value which is that of the area
991 */
992 isis_event_circuit_type_change (circuit, circuit->area->is_type);
hassof390d2c2004-09-10 20:48:21 +0000993
jardineb5d44e2003-12-23 08:09:43 +0000994 return CMD_SUCCESS;
995}
996
997DEFUN (isis_passwd,
998 isis_passwd_cmd,
999 "isis password WORD",
1000 "IS-IS commands\n"
1001 "Configure the authentication password for interface\n"
1002 "Password\n")
1003{
1004 struct isis_circuit *circuit;
1005 struct interface *ifp;
1006 int len;
hassof390d2c2004-09-10 20:48:21 +00001007
1008 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001009 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001010 if (circuit == NULL)
1011 {
1012 return CMD_WARNING;
1013 }
1014
jardineb5d44e2003-12-23 08:09:43 +00001015 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001016 if (len > 254)
1017 {
1018 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
1019 return CMD_WARNING;
1020 }
jardineb5d44e2003-12-23 08:09:43 +00001021 circuit->passwd.len = len;
1022 circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001023 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001024
jardineb5d44e2003-12-23 08:09:43 +00001025 return CMD_SUCCESS;
1026}
1027
1028DEFUN (no_isis_passwd,
1029 no_isis_passwd_cmd,
1030 "no isis password",
1031 NO_STR
1032 "IS-IS commands\n"
1033 "Configure the authentication password for interface\n")
1034{
1035 struct isis_circuit *circuit;
1036 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001037
1038 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001039 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001040 if (circuit == NULL)
1041 {
1042 return CMD_WARNING;
1043 }
1044
jardineb5d44e2003-12-23 08:09:43 +00001045 memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001046
jardineb5d44e2003-12-23 08:09:43 +00001047 return CMD_SUCCESS;
1048}
1049
1050
1051DEFUN (isis_priority,
1052 isis_priority_cmd,
1053 "isis priority <0-127>",
1054 "IS-IS commands\n"
1055 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001056 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001057{
1058 struct isis_circuit *circuit;
1059 struct interface *ifp;
1060 int prio;
hassof390d2c2004-09-10 20:48:21 +00001061
1062 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001063 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001064 if (circuit == NULL)
1065 {
1066 return CMD_WARNING;
1067 }
jardineb5d44e2003-12-23 08:09:43 +00001068 assert (circuit);
1069
1070 prio = atoi (argv[0]);
1071
1072 circuit->u.bc.priority[0] = prio;
1073 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001074
jardineb5d44e2003-12-23 08:09:43 +00001075 return CMD_SUCCESS;
1076}
1077
1078DEFUN (no_isis_priority,
1079 no_isis_priority_cmd,
1080 "no isis priority",
1081 NO_STR
1082 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001083 "Set priority for Designated Router election\n")
jardineb5d44e2003-12-23 08:09:43 +00001084{
1085 struct isis_circuit *circuit;
1086 struct interface *ifp;
1087
hassof390d2c2004-09-10 20:48:21 +00001088 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001089 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001090 if (circuit == NULL)
1091 {
1092 return CMD_WARNING;
1093 }
jardineb5d44e2003-12-23 08:09:43 +00001094 assert (circuit);
1095
1096 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
1097 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001098
jardineb5d44e2003-12-23 08:09:43 +00001099 return CMD_SUCCESS;
1100}
1101
1102ALIAS (no_isis_priority,
1103 no_isis_priority_arg_cmd,
1104 "no isis priority <0-127>",
1105 NO_STR
1106 "IS-IS commands\n"
1107 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001108 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001109
1110DEFUN (isis_priority_l1,
1111 isis_priority_l1_cmd,
hassof390d2c2004-09-10 20:48:21 +00001112 "isis priority <0-127> level-1",
jardineb5d44e2003-12-23 08:09:43 +00001113 "IS-IS commands\n"
1114 "Set priority for Designated Router election\n"
1115 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001116 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001117{
1118 struct isis_circuit *circuit;
1119 struct interface *ifp;
1120 int prio;
hassof390d2c2004-09-10 20:48:21 +00001121
1122 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001123 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001124 if (circuit == NULL)
1125 {
1126 return CMD_WARNING;
1127 }
jardineb5d44e2003-12-23 08:09:43 +00001128 assert (circuit);
1129
1130 prio = atoi (argv[0]);
1131
1132 circuit->u.bc.priority[0] = prio;
hassof390d2c2004-09-10 20:48:21 +00001133
jardineb5d44e2003-12-23 08:09:43 +00001134 return CMD_SUCCESS;
1135}
1136
1137DEFUN (no_isis_priority_l1,
1138 no_isis_priority_l1_cmd,
1139 "no isis priority level-1",
1140 NO_STR
1141 "IS-IS commands\n"
1142 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001143 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001144{
1145 struct isis_circuit *circuit;
1146 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001147
1148 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001149 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001150 if (circuit == NULL)
1151 {
1152 return CMD_WARNING;
1153 }
jardineb5d44e2003-12-23 08:09:43 +00001154 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001155
jardineb5d44e2003-12-23 08:09:43 +00001156 circuit->u.bc.priority[0] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001157
jardineb5d44e2003-12-23 08:09:43 +00001158 return CMD_SUCCESS;
1159}
1160
1161ALIAS (no_isis_priority_l1,
1162 no_isis_priority_l1_arg_cmd,
1163 "no isis priority <0-127> level-1",
1164 NO_STR
1165 "IS-IS commands\n"
1166 "Set priority for Designated Router election\n"
1167 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001168 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001169
1170DEFUN (isis_priority_l2,
1171 isis_priority_l2_cmd,
hassof390d2c2004-09-10 20:48:21 +00001172 "isis priority <0-127> level-2",
jardineb5d44e2003-12-23 08:09:43 +00001173 "IS-IS commands\n"
1174 "Set priority for Designated Router election\n"
1175 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001176 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001177{
1178 struct isis_circuit *circuit;
1179 struct interface *ifp;
1180 int prio;
hassof390d2c2004-09-10 20:48:21 +00001181
1182 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001183 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001184 if (circuit == NULL)
1185 {
1186 return CMD_WARNING;
1187 }
jardineb5d44e2003-12-23 08:09:43 +00001188 assert (circuit);
1189
1190 prio = atoi (argv[0]);
1191
1192 circuit->u.bc.priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001193
jardineb5d44e2003-12-23 08:09:43 +00001194 return CMD_SUCCESS;
1195}
1196
1197DEFUN (no_isis_priority_l2,
1198 no_isis_priority_l2_cmd,
1199 "no isis priority level-2",
1200 NO_STR
1201 "IS-IS commands\n"
1202 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001203 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001204{
1205 struct isis_circuit *circuit;
1206 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001207
1208 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001209 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001210 if (circuit == NULL)
1211 {
1212 return CMD_WARNING;
1213 }
jardineb5d44e2003-12-23 08:09:43 +00001214 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001215
jardineb5d44e2003-12-23 08:09:43 +00001216 circuit->u.bc.priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001217
jardineb5d44e2003-12-23 08:09:43 +00001218 return CMD_SUCCESS;
1219}
1220
1221ALIAS (no_isis_priority_l2,
1222 no_isis_priority_l2_arg_cmd,
1223 "no isis priority <0-127> level-2",
1224 NO_STR
1225 "IS-IS commands\n"
1226 "Set priority for Designated Router election\n"
1227 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001228 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001229
1230/* Metric command */
hassof390d2c2004-09-10 20:48:21 +00001231 DEFUN (isis_metric,
jardineb5d44e2003-12-23 08:09:43 +00001232 isis_metric_cmd,
hassof21fb272005-09-26 17:05:55 +00001233 "isis metric <0-16777215>",
jardineb5d44e2003-12-23 08:09:43 +00001234 "IS-IS commands\n"
1235 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001236 "Default metric value\n")
jardineb5d44e2003-12-23 08:09:43 +00001237{
1238 struct isis_circuit *circuit;
1239 struct interface *ifp;
1240 int met;
1241
hassof390d2c2004-09-10 20:48:21 +00001242 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001243 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001244 if (circuit == NULL)
1245 {
1246 return CMD_WARNING;
1247 }
jardineb5d44e2003-12-23 08:09:43 +00001248 assert (circuit);
1249
1250 met = atoi (argv[0]);
1251
hassof21fb272005-09-26 17:05:55 +00001252 circuit->te_metric[0] = met;
1253 circuit->te_metric[1] = met;
1254
1255 if (met > 63)
1256 met = 63;
1257
jardineb5d44e2003-12-23 08:09:43 +00001258 circuit->metrics[0].metric_default = met;
1259 circuit->metrics[1].metric_default = met;
1260
1261 return CMD_SUCCESS;
1262}
1263
1264DEFUN (no_isis_metric,
1265 no_isis_metric_cmd,
1266 "no isis metric",
1267 NO_STR
1268 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001269 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001270{
1271 struct isis_circuit *circuit;
1272 struct interface *ifp;
1273
hassof390d2c2004-09-10 20:48:21 +00001274 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001275 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001276 if (circuit == NULL)
1277 {
1278 return CMD_WARNING;
1279 }
jardineb5d44e2003-12-23 08:09:43 +00001280 assert (circuit);
1281
hassof21fb272005-09-26 17:05:55 +00001282 circuit->te_metric[0] = DEFAULT_CIRCUIT_METRICS;
1283 circuit->te_metric[1] = DEFAULT_CIRCUIT_METRICS;
jardineb5d44e2003-12-23 08:09:43 +00001284 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRICS;
1285 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRICS;
1286
1287 return CMD_SUCCESS;
1288}
1289
1290ALIAS (no_isis_metric,
1291 no_isis_metric_arg_cmd,
hassof21fb272005-09-26 17:05:55 +00001292 "no isis metric <0-16777215>",
jardineb5d44e2003-12-23 08:09:43 +00001293 NO_STR
1294 "IS-IS commands\n"
1295 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001296 "Default metric value\n")
1297
jardineb5d44e2003-12-23 08:09:43 +00001298/* end of metrics */
hassof21fb272005-09-26 17:05:55 +00001299DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00001300 isis_hello_interval_cmd,
1301 "isis hello-interval (<1-65535>|minimal)",
1302 "IS-IS commands\n"
1303 "Set Hello interval\n"
1304 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001305 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001306{
1307 struct isis_circuit *circuit;
1308 struct interface *ifp;
1309 int interval;
1310 char c;
1311
hassof390d2c2004-09-10 20:48:21 +00001312 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001313 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001314 if (circuit == NULL)
1315 {
1316 return CMD_WARNING;
1317 }
1318 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001319 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001320 if (isdigit ((int) c))
1321 {
1322 interval = atoi (argv[0]);
1323 }
1324 else
1325 interval = HELLO_MINIMAL; /* FIXME: should be calculated */
jardineb5d44e2003-12-23 08:09:43 +00001326
hassof390d2c2004-09-10 20:48:21 +00001327 circuit->hello_interval[0] = (u_int16_t) interval;
1328 circuit->hello_interval[1] = (u_int16_t) interval;
1329
jardineb5d44e2003-12-23 08:09:43 +00001330 return CMD_SUCCESS;
1331}
1332
1333DEFUN (no_isis_hello_interval,
1334 no_isis_hello_interval_cmd,
1335 "no isis hello-interval",
1336 NO_STR
1337 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001338 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00001339{
1340 struct isis_circuit *circuit;
1341 struct interface *ifp;
1342
hassof390d2c2004-09-10 20:48:21 +00001343 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001344 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001345 if (circuit == NULL)
1346 {
1347 return CMD_WARNING;
1348 }
jardineb5d44e2003-12-23 08:09:43 +00001349 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001350
hassof390d2c2004-09-10 20:48:21 +00001351
1352 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
jardineb5d44e2003-12-23 08:09:43 +00001353 circuit->hello_interval[1] = HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001354
jardineb5d44e2003-12-23 08:09:43 +00001355 return CMD_SUCCESS;
1356}
1357
1358ALIAS (no_isis_hello_interval,
1359 no_isis_hello_interval_arg_cmd,
1360 "no isis hello-interval (<1-65535>|minimal)",
1361 NO_STR
1362 "IS-IS commands\n"
1363 "Set Hello interval\n"
1364 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00001365 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00001366
1367DEFUN (isis_hello_interval_l1,
1368 isis_hello_interval_l1_cmd,
1369 "isis hello-interval (<1-65535>|minimal) level-1",
1370 "IS-IS commands\n"
1371 "Set Hello interval\n"
1372 "Hello interval value\n"
1373 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001374 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001375{
1376 struct isis_circuit *circuit;
1377 struct interface *ifp;
1378 long interval;
1379 char c;
1380
hassof390d2c2004-09-10 20:48:21 +00001381 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001382 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001383 if (circuit == NULL)
1384 {
1385 return CMD_WARNING;
1386 }
jardineb5d44e2003-12-23 08:09:43 +00001387 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001388
jardineb5d44e2003-12-23 08:09:43 +00001389 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001390 if (isdigit ((int) c))
1391 {
1392 interval = atoi (argv[0]);
1393 }
1394 else
jardineb5d44e2003-12-23 08:09:43 +00001395 interval = HELLO_MINIMAL;
1396
hassof390d2c2004-09-10 20:48:21 +00001397 circuit->hello_interval[0] = (u_int16_t) interval;
1398
jardineb5d44e2003-12-23 08:09:43 +00001399 return CMD_SUCCESS;
1400}
1401
1402DEFUN (no_isis_hello_interval_l1,
1403 no_isis_hello_interval_l1_cmd,
1404 "no isis hello-interval level-1",
1405 NO_STR
1406 "IS-IS commands\n"
1407 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001408 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001409{
1410 struct isis_circuit *circuit;
1411 struct interface *ifp;
1412
hassof390d2c2004-09-10 20:48:21 +00001413 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001414 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001415 if (circuit == NULL)
1416 {
1417 return CMD_WARNING;
1418 }
jardineb5d44e2003-12-23 08:09:43 +00001419 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001420
hassof390d2c2004-09-10 20:48:21 +00001421
1422 circuit->hello_interval[0] = HELLO_INTERVAL; /* Default is 1 sec. */
1423
jardineb5d44e2003-12-23 08:09:43 +00001424 return CMD_SUCCESS;
1425}
1426
1427ALIAS (no_isis_hello_interval_l1,
1428 no_isis_hello_interval_l1_arg_cmd,
1429 "no isis hello-interval (<1-65535>|minimal) level-1",
1430 NO_STR
1431 "IS-IS commands\n"
1432 "Set Hello interval\n"
1433 "Hello interval value\n"
1434 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001435 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001436
1437DEFUN (isis_hello_interval_l2,
1438 isis_hello_interval_l2_cmd,
1439 "isis hello-interval (<1-65535>|minimal) level-2",
1440 "IS-IS commands\n"
1441 "Set Hello interval\n"
1442 "Hello interval value\n"
1443 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001444 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001445{
1446 struct isis_circuit *circuit;
1447 struct interface *ifp;
1448 long interval;
1449 char c;
1450
hassof390d2c2004-09-10 20:48:21 +00001451 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001452 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001453 if (circuit == NULL)
1454 {
1455 return CMD_WARNING;
1456 }
jardineb5d44e2003-12-23 08:09:43 +00001457 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001458
jardineb5d44e2003-12-23 08:09:43 +00001459 c = *argv[0];
hassof390d2c2004-09-10 20:48:21 +00001460 if (isdigit ((int) c))
1461 {
1462 interval = atoi (argv[0]);
1463 }
1464 else
jardineb5d44e2003-12-23 08:09:43 +00001465 interval = HELLO_MINIMAL;
1466
hassof390d2c2004-09-10 20:48:21 +00001467 circuit->hello_interval[1] = (u_int16_t) interval;
1468
jardineb5d44e2003-12-23 08:09:43 +00001469 return CMD_SUCCESS;
1470}
1471
1472DEFUN (no_isis_hello_interval_l2,
1473 no_isis_hello_interval_l2_cmd,
1474 "no isis hello-interval level-2",
1475 NO_STR
1476 "IS-IS commands\n"
1477 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00001478 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001479{
1480 struct isis_circuit *circuit;
1481 struct interface *ifp;
1482
hassof390d2c2004-09-10 20:48:21 +00001483 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001484 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001485 if (circuit == NULL)
1486 {
1487 return CMD_WARNING;
1488 }
jardineb5d44e2003-12-23 08:09:43 +00001489 assert (circuit);
jardineb5d44e2003-12-23 08:09:43 +00001490
hassof390d2c2004-09-10 20:48:21 +00001491
1492 circuit->hello_interval[1] = HELLO_INTERVAL; /* Default is 1 sec. */
1493
jardineb5d44e2003-12-23 08:09:43 +00001494 return CMD_SUCCESS;
1495}
1496
1497ALIAS (no_isis_hello_interval_l2,
1498 no_isis_hello_interval_l2_arg_cmd,
1499 "no isis hello-interval (<1-65535>|minimal) level-2",
1500 NO_STR
1501 "IS-IS commands\n"
1502 "Set Hello interval\n"
1503 "Hello interval value\n"
1504 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00001505 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001506
1507DEFUN (isis_hello_multiplier,
1508 isis_hello_multiplier_cmd,
1509 "isis hello-multiplier <3-1000>",
1510 "IS-IS commands\n"
1511 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001512 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001513{
1514 struct isis_circuit *circuit;
1515 struct interface *ifp;
1516 int mult;
hassof390d2c2004-09-10 20:48:21 +00001517
1518 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001519 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001520 if (circuit == NULL)
1521 {
1522 return CMD_WARNING;
1523 }
jardineb5d44e2003-12-23 08:09:43 +00001524 assert (circuit);
1525
1526 mult = atoi (argv[0]);
1527
hassof390d2c2004-09-10 20:48:21 +00001528 circuit->hello_multiplier[0] = (u_int16_t) mult;
1529 circuit->hello_multiplier[1] = (u_int16_t) mult;
1530
jardineb5d44e2003-12-23 08:09:43 +00001531 return CMD_SUCCESS;
1532}
1533
1534DEFUN (no_isis_hello_multiplier,
1535 no_isis_hello_multiplier_cmd,
1536 "no isis hello-multiplier",
1537 NO_STR
1538 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001539 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00001540{
1541 struct isis_circuit *circuit;
1542 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001543
1544 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001545 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001546 if (circuit == NULL)
1547 {
1548 return CMD_WARNING;
1549 }
jardineb5d44e2003-12-23 08:09:43 +00001550 assert (circuit);
1551
1552 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1553 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1554
1555 return CMD_SUCCESS;
1556}
1557
1558ALIAS (no_isis_hello_multiplier,
1559 no_isis_hello_multiplier_arg_cmd,
1560 "no isis hello-multiplier <3-1000>",
1561 NO_STR
1562 "IS-IS commands\n"
1563 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001564 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00001565
1566DEFUN (isis_hello_multiplier_l1,
1567 isis_hello_multiplier_l1_cmd,
1568 "isis hello-multiplier <3-1000> level-1",
1569 "IS-IS commands\n"
1570 "Set multiplier for Hello holding time\n"
1571 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001572 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001573{
1574 struct isis_circuit *circuit;
1575 struct interface *ifp;
1576 int mult;
hassof390d2c2004-09-10 20:48:21 +00001577
1578 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001579 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001580 if (circuit == NULL)
1581 {
1582 return CMD_WARNING;
1583 }
jardineb5d44e2003-12-23 08:09:43 +00001584 assert (circuit);
1585
1586 mult = atoi (argv[0]);
1587
hassof390d2c2004-09-10 20:48:21 +00001588 circuit->hello_multiplier[0] = (u_int16_t) mult;
1589
jardineb5d44e2003-12-23 08:09:43 +00001590 return CMD_SUCCESS;
1591}
1592
1593DEFUN (no_isis_hello_multiplier_l1,
1594 no_isis_hello_multiplier_l1_cmd,
1595 "no isis hello-multiplier level-1",
1596 NO_STR
1597 "IS-IS commands\n"
1598 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001599 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001600{
1601 struct isis_circuit *circuit;
1602 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001603
1604 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001605 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001606 if (circuit == NULL)
1607 {
1608 return CMD_WARNING;
1609 }
jardineb5d44e2003-12-23 08:09:43 +00001610 assert (circuit);
1611
1612 circuit->hello_multiplier[0] = HELLO_MULTIPLIER;
1613
1614 return CMD_SUCCESS;
1615}
1616
1617ALIAS (no_isis_hello_multiplier_l1,
1618 no_isis_hello_multiplier_l1_arg_cmd,
1619 "no isis hello-multiplier <3-1000> level-1",
1620 NO_STR
1621 "IS-IS commands\n"
1622 "Set multiplier for Hello holding time\n"
1623 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001624 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001625
1626DEFUN (isis_hello_multiplier_l2,
1627 isis_hello_multiplier_l2_cmd,
1628 "isis hello-multiplier <3-1000> level-2",
1629 "IS-IS commands\n"
1630 "Set multiplier for Hello holding time\n"
1631 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001632 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001633{
1634 struct isis_circuit *circuit;
1635 struct interface *ifp;
1636 int mult;
hassof390d2c2004-09-10 20:48:21 +00001637
1638 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001639 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001640 if (circuit == NULL)
1641 {
1642 return CMD_WARNING;
1643 }
jardineb5d44e2003-12-23 08:09:43 +00001644 assert (circuit);
1645
1646 mult = atoi (argv[0]);
1647
hassof390d2c2004-09-10 20:48:21 +00001648 circuit->hello_multiplier[1] = (u_int16_t) mult;
1649
jardineb5d44e2003-12-23 08:09:43 +00001650 return CMD_SUCCESS;
1651}
1652
1653DEFUN (no_isis_hello_multiplier_l2,
1654 no_isis_hello_multiplier_l2_cmd,
1655 "no isis hello-multiplier level-2",
1656 NO_STR
1657 "IS-IS commands\n"
1658 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00001659 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001660{
1661 struct isis_circuit *circuit;
1662 struct interface *ifp;
hassof390d2c2004-09-10 20:48:21 +00001663
1664 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001665 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001666 if (circuit == NULL)
1667 {
1668 return CMD_WARNING;
1669 }
jardineb5d44e2003-12-23 08:09:43 +00001670 assert (circuit);
1671
1672 circuit->hello_multiplier[1] = HELLO_MULTIPLIER;
1673
1674 return CMD_SUCCESS;
1675}
1676
1677ALIAS (no_isis_hello_multiplier_l2,
1678 no_isis_hello_multiplier_l2_arg_cmd,
1679 "no isis hello-multiplier <3-1000> level-2",
1680 NO_STR
1681 "IS-IS commands\n"
1682 "Set multiplier for Hello holding time\n"
1683 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00001684 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00001685
1686DEFUN (isis_hello,
1687 isis_hello_cmd,
1688 "isis hello padding",
1689 "IS-IS commands\n"
1690 "Add padding to IS-IS hello packets\n"
1691 "Pad hello packets\n"
1692 "<cr>\n")
1693{
1694 struct interface *ifp;
1695 struct isis_circuit *circuit;
hassof390d2c2004-09-10 20:48:21 +00001696
1697 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001698 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001699 if (circuit == NULL)
1700 {
1701 return CMD_WARNING;
1702 }
jardineb5d44e2003-12-23 08:09:43 +00001703 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001704
jardineb5d44e2003-12-23 08:09:43 +00001705 circuit->u.bc.pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00001706
jardineb5d44e2003-12-23 08:09:43 +00001707 return CMD_SUCCESS;
1708}
1709
jardineb5d44e2003-12-23 08:09:43 +00001710DEFUN (no_isis_hello,
1711 no_isis_hello_cmd,
1712 "no isis hello padding",
1713 NO_STR
1714 "IS-IS commands\n"
1715 "Add padding to IS-IS hello packets\n"
1716 "Pad hello packets\n"
1717 "<cr>\n")
1718{
1719 struct isis_circuit *circuit;
1720 struct interface *ifp;
1721
hassof390d2c2004-09-10 20:48:21 +00001722 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001723 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001724 if (circuit == NULL)
1725 {
1726 return CMD_WARNING;
1727 }
jardineb5d44e2003-12-23 08:09:43 +00001728 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001729
jardineb5d44e2003-12-23 08:09:43 +00001730 circuit->u.bc.pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00001731
jardineb5d44e2003-12-23 08:09:43 +00001732 return CMD_SUCCESS;
1733}
1734
1735DEFUN (csnp_interval,
1736 csnp_interval_cmd,
1737 "isis csnp-interval <0-65535>",
1738 "IS-IS commands\n"
1739 "Set CSNP interval in seconds\n"
1740 "CSNP interval value\n")
1741{
1742 struct isis_circuit *circuit;
1743 struct interface *ifp;
1744 unsigned long interval;
1745
hassof390d2c2004-09-10 20:48:21 +00001746 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001747 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001748 if (circuit == NULL)
1749 {
1750 return CMD_WARNING;
1751 }
jardineb5d44e2003-12-23 08:09:43 +00001752 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001753
jardineb5d44e2003-12-23 08:09:43 +00001754 interval = atol (argv[0]);
1755
hassof390d2c2004-09-10 20:48:21 +00001756 circuit->csnp_interval[0] = (u_int16_t) interval;
1757 circuit->csnp_interval[1] = (u_int16_t) interval;
1758
jardineb5d44e2003-12-23 08:09:43 +00001759 return CMD_SUCCESS;
1760}
1761
1762DEFUN (no_csnp_interval,
1763 no_csnp_interval_cmd,
1764 "no isis csnp-interval",
1765 NO_STR
1766 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001767 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00001768{
1769 struct isis_circuit *circuit;
1770 struct interface *ifp;
1771
hassof390d2c2004-09-10 20:48:21 +00001772 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001773 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001774 if (circuit == NULL)
1775 {
1776 return CMD_WARNING;
1777 }
jardineb5d44e2003-12-23 08:09:43 +00001778 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001779
jardineb5d44e2003-12-23 08:09:43 +00001780 circuit->csnp_interval[0] = CSNP_INTERVAL;
1781 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001782
jardineb5d44e2003-12-23 08:09:43 +00001783 return CMD_SUCCESS;
1784}
1785
1786ALIAS (no_csnp_interval,
1787 no_csnp_interval_arg_cmd,
1788 "no isis csnp-interval <0-65535>",
1789 NO_STR
1790 "IS-IS commands\n"
1791 "Set CSNP interval in seconds\n"
1792 "CSNP interval value\n")
1793
jardineb5d44e2003-12-23 08:09:43 +00001794DEFUN (csnp_interval_l1,
1795 csnp_interval_l1_cmd,
1796 "isis csnp-interval <0-65535> level-1",
1797 "IS-IS commands\n"
1798 "Set CSNP interval in seconds\n"
1799 "CSNP interval value\n"
1800 "Specify interval for level-1 CSNPs\n")
1801{
1802 struct isis_circuit *circuit;
1803 struct interface *ifp;
1804 unsigned long interval;
1805
hassof390d2c2004-09-10 20:48:21 +00001806 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001807 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001808 if (circuit == NULL)
1809 {
1810 return CMD_WARNING;
1811 }
jardineb5d44e2003-12-23 08:09:43 +00001812 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001813
jardineb5d44e2003-12-23 08:09:43 +00001814 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001815
1816 circuit->csnp_interval[0] = (u_int16_t) interval;
1817
jardineb5d44e2003-12-23 08:09:43 +00001818 return CMD_SUCCESS;
1819}
1820
1821DEFUN (no_csnp_interval_l1,
1822 no_csnp_interval_l1_cmd,
1823 "no isis csnp-interval level-1",
1824 NO_STR
1825 "IS-IS commands\n"
1826 "Set CSNP interval in seconds\n"
1827 "Specify interval for level-1 CSNPs\n")
1828{
1829 struct isis_circuit *circuit;
1830 struct interface *ifp;
1831
hassof390d2c2004-09-10 20:48:21 +00001832 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001833 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001834 if (circuit == NULL)
1835 {
1836 return CMD_WARNING;
1837 }
jardineb5d44e2003-12-23 08:09:43 +00001838 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001839
jardineb5d44e2003-12-23 08:09:43 +00001840 circuit->csnp_interval[0] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001841
jardineb5d44e2003-12-23 08:09:43 +00001842 return CMD_SUCCESS;
1843}
1844
1845ALIAS (no_csnp_interval_l1,
1846 no_csnp_interval_l1_arg_cmd,
1847 "no isis csnp-interval <0-65535> level-1",
1848 NO_STR
1849 "IS-IS commands\n"
1850 "Set CSNP interval in seconds\n"
1851 "CSNP interval value\n"
1852 "Specify interval for level-1 CSNPs\n")
1853
jardineb5d44e2003-12-23 08:09:43 +00001854DEFUN (csnp_interval_l2,
1855 csnp_interval_l2_cmd,
1856 "isis csnp-interval <0-65535> level-2",
1857 "IS-IS commands\n"
1858 "Set CSNP interval in seconds\n"
1859 "CSNP interval value\n"
1860 "Specify interval for level-2 CSNPs\n")
1861{
1862 struct isis_circuit *circuit;
1863 struct interface *ifp;
1864 unsigned long interval;
1865
hassof390d2c2004-09-10 20:48:21 +00001866 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001867 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001868 if (circuit == NULL)
1869 {
1870 return CMD_WARNING;
1871 }
jardineb5d44e2003-12-23 08:09:43 +00001872 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001873
jardineb5d44e2003-12-23 08:09:43 +00001874 interval = atol (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001875
1876 circuit->csnp_interval[1] = (u_int16_t) interval;
1877
jardineb5d44e2003-12-23 08:09:43 +00001878 return CMD_SUCCESS;
1879}
1880
1881DEFUN (no_csnp_interval_l2,
1882 no_csnp_interval_l2_cmd,
1883 "no isis csnp-interval level-2",
1884 NO_STR
1885 "IS-IS commands\n"
1886 "Set CSNP interval in seconds\n"
1887 "Specify interval for level-2 CSNPs\n")
1888{
1889 struct isis_circuit *circuit;
1890 struct interface *ifp;
1891
hassof390d2c2004-09-10 20:48:21 +00001892 ifp = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001893 circuit = ifp->info;
hassof390d2c2004-09-10 20:48:21 +00001894 if (circuit == NULL)
1895 {
1896 return CMD_WARNING;
1897 }
jardineb5d44e2003-12-23 08:09:43 +00001898 assert (circuit);
hassof390d2c2004-09-10 20:48:21 +00001899
jardineb5d44e2003-12-23 08:09:43 +00001900 circuit->csnp_interval[1] = CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00001901
jardineb5d44e2003-12-23 08:09:43 +00001902 return CMD_SUCCESS;
1903}
1904
1905ALIAS (no_csnp_interval_l2,
1906 no_csnp_interval_l2_arg_cmd,
1907 "no isis csnp-interval <0-65535> level-2",
1908 NO_STR
1909 "IS-IS commands\n"
1910 "Set CSNP interval in seconds\n"
1911 "CSNP interval value\n"
1912 "Specify interval for level-2 CSNPs\n")
1913
jardineb5d44e2003-12-23 08:09:43 +00001914#ifdef HAVE_IPV6
1915DEFUN (ipv6_router_isis,
1916 ipv6_router_isis_cmd,
1917 "ipv6 router isis WORD",
1918 "IPv6 interface subcommands\n"
1919 "IPv6 Router interface commands\n"
1920 "IS-IS Routing for IPv6\n"
1921 "Routing process tag\n")
1922{
1923 struct isis_circuit *c;
1924 struct interface *ifp;
1925 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001926
1927 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001928 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001929
jardineb5d44e2003-12-23 08:09:43 +00001930 area = isis_area_lookup (argv[0]);
1931
1932 /* Prevent more than one circuit per interface */
1933 if (area)
1934 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001935 else
1936 c = NULL;
1937
1938 if (c && (ifp->info != NULL))
1939 {
1940 if (c->ipv6_router == 1)
1941 {
1942 vty_out (vty, "ISIS circuit is already defined for IPv6%s",
1943 VTY_NEWLINE);
1944 return CMD_WARNING;
1945 }
jardineb5d44e2003-12-23 08:09:43 +00001946 }
jardineb5d44e2003-12-23 08:09:43 +00001947
1948 /* this is here for ciscopability */
hassof390d2c2004-09-10 20:48:21 +00001949 if (!area)
1950 {
1951 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1952 return CMD_WARNING;
1953 }
jardineb5d44e2003-12-23 08:09:43 +00001954
hassof390d2c2004-09-10 20:48:21 +00001955 if (!c)
1956 {
1957 c = circuit_lookup_by_ifp (ifp, isis->init_circ_list);
1958 c = isis_csm_state_change (ISIS_ENABLE, c, area);
1959 c->interface = ifp;
1960 ifp->info = c;
1961 }
jardineb5d44e2003-12-23 08:09:43 +00001962
hassof390d2c2004-09-10 20:48:21 +00001963 if (!c)
jardineb5d44e2003-12-23 08:09:43 +00001964 return CMD_WARNING;
1965
1966 c->ipv6_router = 1;
1967 area->ipv6_circuits++;
1968 circuit_update_nlpids (c);
1969
1970 vty->node = INTERFACE_NODE;
1971
1972 return CMD_SUCCESS;
1973}
1974
1975DEFUN (no_ipv6_router_isis,
1976 no_ipv6_router_isis_cmd,
1977 "no ipv6 router isis WORD",
1978 NO_STR
1979 "IPv6 interface subcommands\n"
1980 "IPv6 Router interface commands\n"
1981 "IS-IS Routing for IPv6\n"
1982 "Routing process tag\n")
1983{
1984 struct isis_circuit *c;
1985 struct interface *ifp;
1986 struct isis_area *area;
hassof390d2c2004-09-10 20:48:21 +00001987
1988 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001989 /* UGLY - will remove l8r
1990 if (circuit == NULL) {
hassof390d2c2004-09-10 20:48:21 +00001991 return CMD_WARNING;
1992 } */
jardineb5d44e2003-12-23 08:09:43 +00001993 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001994
jardineb5d44e2003-12-23 08:09:43 +00001995 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001996 if (!area)
1997 {
1998 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1999 return CMD_WARNING;
2000 }
2001
jardineb5d44e2003-12-23 08:09:43 +00002002 c = circuit_lookup_by_ifp (ifp, area->circuit_list);
2003 if (!c)
2004 return CMD_WARNING;
2005
2006 c->ipv6_router = 0;
2007 area->ipv6_circuits--;
2008 if (c->ip_router == 0)
2009 isis_csm_state_change (ISIS_DISABLE, c, area);
2010
2011 return CMD_SUCCESS;
2012}
hassof390d2c2004-09-10 20:48:21 +00002013#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00002014
hassof390d2c2004-09-10 20:48:21 +00002015struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002016 INTERFACE_NODE,
2017 "%s(config-if)# ",
2018 1,
2019};
2020
jardineb5d44e2003-12-23 08:09:43 +00002021int
2022isis_if_new_hook (struct interface *ifp)
2023{
2024/* FIXME: Discuss if the circuit should be created here
2025 ifp->info = XMALLOC (MTYPE_ISIS_IF_INFO, sizeof (struct isis_if_info)); */
2026 ifp->info = NULL;
2027 return 0;
2028}
2029
2030int
2031isis_if_delete_hook (struct interface *ifp)
2032{
2033/* FIXME: Discuss if the circuit should be created here
2034 XFREE (MTYPE_ISIS_IF_INFO, ifp->info);*/
2035 ifp->info = NULL;
2036 return 0;
2037}
2038
jardineb5d44e2003-12-23 08:09:43 +00002039void
2040isis_circuit_init ()
2041{
jardineb5d44e2003-12-23 08:09:43 +00002042 /* Initialize Zebra interface data structure */
2043 if_init ();
2044 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2045 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2046
2047 /* Install interface node */
2048 install_node (&interface_node, isis_interface_config_write);
2049 install_element (CONFIG_NODE, &interface_cmd);
2050
2051 install_default (INTERFACE_NODE);
2052 install_element (INTERFACE_NODE, &interface_desc_cmd);
2053 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2054
2055 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2056 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2057
2058 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2059 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2060
2061 install_element (INTERFACE_NODE, &isis_passwd_cmd);
2062 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2063
2064 install_element (INTERFACE_NODE, &isis_priority_cmd);
2065 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2066 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2067 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2068 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2069 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2070 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2071 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2072 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2073
2074 install_element (INTERFACE_NODE, &isis_metric_cmd);
2075 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2076 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
2077
2078 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2079 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2080 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2081 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2082 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2083 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2084 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2085 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2086 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2087
2088 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2089 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2090 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2091 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2092 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2093 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2094 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2095 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2096 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2097
2098 install_element (INTERFACE_NODE, &isis_hello_cmd);
2099 install_element (INTERFACE_NODE, &no_isis_hello_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002100 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2101 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2102 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2103 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2104 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2105 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2106 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2107 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2108 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2109
2110#ifdef HAVE_IPV6
2111 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2112 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002113#endif
jardineb5d44e2003-12-23 08:09:43 +00002114}