blob: 9fe11c29f896cc4b0a5bd0f75b5188bda3df0c62 [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
Paul Jakma238497f2007-08-07 18:49:18 +000029#ifndef ETHER_ADDR_LEN
30#define ETHER_ADDR_LEN ETHERADDRL
31#endif
32
jardineb5d44e2003-12-23 08:09:43 +000033#include "log.h"
34#include "memory.h"
35#include "if.h"
36#include "linklist.h"
37#include "command.h"
38#include "thread.h"
39#include "hash.h"
40#include "prefix.h"
41#include "stream.h"
42
43#include "isisd/dict.h"
44#include "isisd/include-netbsd/iso.h"
45#include "isisd/isis_constants.h"
46#include "isisd/isis_common.h"
Josh Bailey3f045a02012-03-24 08:35:20 -070047#include "isisd/isis_flags.h"
jardineb5d44e2003-12-23 08:09:43 +000048#include "isisd/isis_circuit.h"
49#include "isisd/isis_tlv.h"
50#include "isisd/isis_lsp.h"
51#include "isisd/isis_pdu.h"
52#include "isisd/isis_network.h"
53#include "isisd/isis_misc.h"
54#include "isisd/isis_constants.h"
55#include "isisd/isis_adjacency.h"
56#include "isisd/isis_dr.h"
jardineb5d44e2003-12-23 08:09:43 +000057#include "isisd/isisd.h"
58#include "isisd/isis_csm.h"
59#include "isisd/isis_events.h"
60
Paul Jakma41b36e92006-12-08 01:09:50 +000061/*
62 * Prototypes.
63 */
Paul Jakma41b36e92006-12-08 01:09:50 +000064int isis_interface_config_write(struct vty *);
65int isis_if_new_hook(struct interface *);
66int isis_if_delete_hook(struct interface *);
67
jardineb5d44e2003-12-23 08:09:43 +000068struct isis_circuit *
69isis_circuit_new ()
70{
71 struct isis_circuit *circuit;
72 int i;
73
hasso3fdb2dd2005-09-28 18:45:54 +000074 circuit = XCALLOC (MTYPE_ISIS_CIRCUIT, sizeof (struct isis_circuit));
Josh Bailey3f045a02012-03-24 08:35:20 -070075 if (circuit == NULL)
hassof390d2c2004-09-10 20:48:21 +000076 {
77 zlog_err ("Can't malloc isis circuit");
78 return NULL;
79 }
80
Josh Bailey3f045a02012-03-24 08:35:20 -070081 /*
82 * Default values
83 */
84 circuit->is_type = IS_LEVEL_1_AND_2;
85 circuit->flags = 0;
86 circuit->pad_hellos = 1;
87 for (i = 0; i < 2; i++)
88 {
89 circuit->hello_interval[i] = DEFAULT_HELLO_INTERVAL;
90 circuit->hello_multiplier[i] = DEFAULT_HELLO_MULTIPLIER;
91 circuit->csnp_interval[i] = DEFAULT_CSNP_INTERVAL;
92 circuit->psnp_interval[i] = DEFAULT_PSNP_INTERVAL;
93 circuit->priority[i] = DEFAULT_PRIORITY;
94 circuit->metrics[i].metric_default = DEFAULT_CIRCUIT_METRIC;
95 circuit->metrics[i].metric_expense = METRICS_UNSUPPORTED;
96 circuit->metrics[i].metric_error = METRICS_UNSUPPORTED;
97 circuit->metrics[i].metric_delay = METRICS_UNSUPPORTED;
98 circuit->te_metric[i] = DEFAULT_CIRCUIT_METRIC;
99 }
100
jardineb5d44e2003-12-23 08:09:43 +0000101 return circuit;
102}
103
jardineb5d44e2003-12-23 08:09:43 +0000104void
Josh Bailey3f045a02012-03-24 08:35:20 -0700105isis_circuit_del (struct isis_circuit *circuit)
106{
107 if (!circuit)
108 return;
109
110 isis_circuit_if_unbind (circuit, circuit->interface);
111
112 /* and lastly the circuit itself */
113 XFREE (MTYPE_ISIS_CIRCUIT, circuit);
114
115 return;
116}
117
118void
jardineb5d44e2003-12-23 08:09:43 +0000119isis_circuit_configure (struct isis_circuit *circuit, struct isis_area *area)
120{
Josh Bailey3f045a02012-03-24 08:35:20 -0700121 assert (area);
jardineb5d44e2003-12-23 08:09:43 +0000122 circuit->area = area;
Josh Bailey3f045a02012-03-24 08:35:20 -0700123
jardineb5d44e2003-12-23 08:09:43 +0000124 /*
Christian Franke7324ae12015-11-10 18:04:48 +0100125 * Whenever the is-type of an area is changed, the is-type of each circuit
126 * in that area is updated to a non-empty subset of the area is-type.
127 * Inversely, when configuring a new circuit, this property should be
128 * ensured as well.
jardineb5d44e2003-12-23 08:09:43 +0000129 */
Christian Franke7324ae12015-11-10 18:04:48 +0100130 if (area->is_type != IS_LEVEL_1_AND_2)
131 circuit->is_type = area->is_type;
jardineb5d44e2003-12-23 08:09:43 +0000132
133 /*
134 * Add the circuit into area
135 */
136 listnode_add (area->circuit_list, circuit);
137
138 circuit->idx = flags_get_index (&area->flags);
jardineb5d44e2003-12-23 08:09:43 +0000139
140 return;
141}
142
hassof390d2c2004-09-10 20:48:21 +0000143void
Josh Bailey3f045a02012-03-24 08:35:20 -0700144isis_circuit_deconfigure (struct isis_circuit *circuit, struct isis_area *area)
jardineb5d44e2003-12-23 08:09:43 +0000145{
jardineb5d44e2003-12-23 08:09:43 +0000146 /* Free the index of SRM and SSN flags */
147 flags_free_index (&area->flags, circuit->idx);
Josh Bailey3f045a02012-03-24 08:35:20 -0700148 circuit->idx = 0;
149 /* Remove circuit from area */
150 assert (circuit->area == area);
151 listnode_delete (area->circuit_list, circuit);
152 circuit->area = NULL;
jardineb5d44e2003-12-23 08:09:43 +0000153
154 return;
155}
156
157struct isis_circuit *
158circuit_lookup_by_ifp (struct interface *ifp, struct list *list)
159{
160 struct isis_circuit *circuit = NULL;
161 struct listnode *node;
hassof390d2c2004-09-10 20:48:21 +0000162
jardineb5d44e2003-12-23 08:09:43 +0000163 if (!list)
164 return NULL;
hassof390d2c2004-09-10 20:48:21 +0000165
paul1eb8ef22005-04-07 07:30:20 +0000166 for (ALL_LIST_ELEMENTS_RO (list, node, circuit))
167 if (circuit->interface == ifp)
Josh Bailey3f045a02012-03-24 08:35:20 -0700168 {
169 assert (ifp->info == circuit);
170 return circuit;
171 }
172
jardineb5d44e2003-12-23 08:09:43 +0000173 return NULL;
174}
175
176struct isis_circuit *
177circuit_scan_by_ifp (struct interface *ifp)
178{
179 struct isis_area *area;
180 struct listnode *node;
181 struct isis_circuit *circuit;
182
Josh Bailey3f045a02012-03-24 08:35:20 -0700183 if (ifp->info)
184 return (struct isis_circuit *)ifp->info;
jardineb5d44e2003-12-23 08:09:43 +0000185
Josh Bailey3f045a02012-03-24 08:35:20 -0700186 if (isis->area_list)
hassof390d2c2004-09-10 20:48:21 +0000187 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700188 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node, area))
189 {
190 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
191 if (circuit)
192 return circuit;
193 }
hassof390d2c2004-09-10 20:48:21 +0000194 }
jardineb5d44e2003-12-23 08:09:43 +0000195 return circuit_lookup_by_ifp (ifp, isis->init_circ_list);
196}
197
Josh Bailey3f045a02012-03-24 08:35:20 -0700198static struct isis_circuit *
199isis_circuit_lookup (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000200{
Josh Bailey3f045a02012-03-24 08:35:20 -0700201 struct interface *ifp;
202 struct isis_circuit *circuit;
jardineb5d44e2003-12-23 08:09:43 +0000203
Josh Bailey3f045a02012-03-24 08:35:20 -0700204 ifp = (struct interface *) vty->index;
205 if (!ifp)
hassof390d2c2004-09-10 20:48:21 +0000206 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700207 vty_out (vty, "Invalid interface %s", VTY_NEWLINE);
208 return NULL;
hassof390d2c2004-09-10 20:48:21 +0000209 }
hassof390d2c2004-09-10 20:48:21 +0000210
Josh Bailey3f045a02012-03-24 08:35:20 -0700211 circuit = circuit_scan_by_ifp (ifp);
212 if (!circuit)
213 {
214 vty_out (vty, "ISIS is not enabled on circuit %s%s",
215 ifp->name, VTY_NEWLINE);
216 return NULL;
217 }
jardineb5d44e2003-12-23 08:09:43 +0000218
Josh Bailey3f045a02012-03-24 08:35:20 -0700219 return circuit;
jardineb5d44e2003-12-23 08:09:43 +0000220}
221
222void
hassof891f442004-09-14 13:54:30 +0000223isis_circuit_add_addr (struct isis_circuit *circuit,
224 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000225{
Josh Bailey3f045a02012-03-24 08:35:20 -0700226 struct listnode *node;
jardineb5d44e2003-12-23 08:09:43 +0000227 struct prefix_ipv4 *ipv4;
hassof390d2c2004-09-10 20:48:21 +0000228 u_char buf[BUFSIZ];
jardineb5d44e2003-12-23 08:09:43 +0000229#ifdef HAVE_IPV6
230 struct prefix_ipv6 *ipv6;
231#endif /* HAVE_IPV6 */
hassof891f442004-09-14 13:54:30 +0000232
jardineb5d44e2003-12-23 08:09:43 +0000233 memset (&buf, 0, BUFSIZ);
hassof891f442004-09-14 13:54:30 +0000234 if (connected->address->family == AF_INET)
hassof390d2c2004-09-10 20:48:21 +0000235 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700236 u_int32_t addr = connected->address->u.prefix4.s_addr;
237 addr = ntohl (addr);
238 if (IPV4_NET0(addr) ||
239 IPV4_NET127(addr) ||
240 IN_CLASSD(addr) ||
241 IPV4_LINKLOCAL(addr))
242 return;
243
244 for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ipv4))
245 if (prefix_same ((struct prefix *) ipv4, connected->address))
246 return;
247
hassof390d2c2004-09-10 20:48:21 +0000248 ipv4 = prefix_ipv4_new ();
hassof891f442004-09-14 13:54:30 +0000249 ipv4->prefixlen = connected->address->prefixlen;
250 ipv4->prefix = connected->address->u.prefix4;
hassof390d2c2004-09-10 20:48:21 +0000251 listnode_add (circuit->ip_addrs, ipv4);
hasso0dae85e2004-09-26 19:53:47 +0000252 if (circuit->area)
Josh Bailey3f045a02012-03-24 08:35:20 -0700253 lsp_regenerate_schedule (circuit->area, circuit->is_type, 0);
hassof891f442004-09-14 13:54:30 +0000254
jardineb5d44e2003-12-23 08:09:43 +0000255#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000256 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000257 zlog_debug ("Added IP address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000258 circuit->circuit_id);
259#endif /* EXTREME_DEBUG */
jardineb5d44e2003-12-23 08:09:43 +0000260 }
hassof390d2c2004-09-10 20:48:21 +0000261#ifdef HAVE_IPV6
hassof891f442004-09-14 13:54:30 +0000262 if (connected->address->family == AF_INET6)
hassof390d2c2004-09-10 20:48:21 +0000263 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700264 if (IN6_IS_ADDR_LOOPBACK(&connected->address->u.prefix6))
265 return;
266
267 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_link, node, ipv6))
268 if (prefix_same ((struct prefix *) ipv6, connected->address))
269 return;
270 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_non_link, node, ipv6))
271 if (prefix_same ((struct prefix *) ipv6, connected->address))
272 return;
273
hassof390d2c2004-09-10 20:48:21 +0000274 ipv6 = prefix_ipv6_new ();
hassof891f442004-09-14 13:54:30 +0000275 ipv6->prefixlen = connected->address->prefixlen;
276 ipv6->prefix = connected->address->u.prefix6;
277
hassof390d2c2004-09-10 20:48:21 +0000278 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
hassof891f442004-09-14 13:54:30 +0000279 listnode_add (circuit->ipv6_link, ipv6);
hassof390d2c2004-09-10 20:48:21 +0000280 else
hassof891f442004-09-14 13:54:30 +0000281 listnode_add (circuit->ipv6_non_link, ipv6);
hasso0dae85e2004-09-26 19:53:47 +0000282 if (circuit->area)
Josh Bailey3f045a02012-03-24 08:35:20 -0700283 lsp_regenerate_schedule (circuit->area, circuit->is_type, 0);
hassof891f442004-09-14 13:54:30 +0000284
jardineb5d44e2003-12-23 08:09:43 +0000285#ifdef EXTREME_DEBUG
hassof891f442004-09-14 13:54:30 +0000286 prefix2str (connected->address, buf, BUFSIZ);
hasso529d65b2004-12-24 00:14:50 +0000287 zlog_debug ("Added IPv6 address %s to circuit %d", buf,
hassof390d2c2004-09-10 20:48:21 +0000288 circuit->circuit_id);
289#endif /* EXTREME_DEBUG */
290 }
jardineb5d44e2003-12-23 08:09:43 +0000291#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000292 return;
293}
294
295void
296isis_circuit_del_addr (struct isis_circuit *circuit,
hassof390d2c2004-09-10 20:48:21 +0000297 struct connected *connected)
jardineb5d44e2003-12-23 08:09:43 +0000298{
hassof891f442004-09-14 13:54:30 +0000299 struct prefix_ipv4 *ipv4, *ip = NULL;
300 struct listnode *node;
hassof891f442004-09-14 13:54:30 +0000301 u_char buf[BUFSIZ];
302#ifdef HAVE_IPV6
303 struct prefix_ipv6 *ipv6, *ip6 = NULL;
Paul Jakma41b36e92006-12-08 01:09:50 +0000304 int found = 0;
hassof891f442004-09-14 13:54:30 +0000305#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +0000306
hassof891f442004-09-14 13:54:30 +0000307 memset (&buf, 0, BUFSIZ);
308 if (connected->address->family == AF_INET)
309 {
310 ipv4 = prefix_ipv4_new ();
311 ipv4->prefixlen = connected->address->prefixlen;
312 ipv4->prefix = connected->address->u.prefix4;
313
paul1eb8ef22005-04-07 07:30:20 +0000314 for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip))
Josh Bailey3f045a02012-03-24 08:35:20 -0700315 if (prefix_same ((struct prefix *) ip, (struct prefix *) ipv4))
paul1eb8ef22005-04-07 07:30:20 +0000316 break;
hassof891f442004-09-14 13:54:30 +0000317
318 if (ip)
319 {
320 listnode_delete (circuit->ip_addrs, ip);
Josh Bailey3f045a02012-03-24 08:35:20 -0700321 if (circuit->area)
322 lsp_regenerate_schedule (circuit->area, circuit->is_type, 0);
hassof891f442004-09-14 13:54:30 +0000323 }
324 else
325 {
hassof7c43dc2004-09-26 16:24:14 +0000326 prefix2str (connected->address, (char *)buf, BUFSIZ);
Josh Bailey3f045a02012-03-24 08:35:20 -0700327 zlog_warn ("Nonexitant ip address %s removal attempt from \
328 circuit %d", buf, circuit->circuit_id);
hassof891f442004-09-14 13:54:30 +0000329 }
David Lampartere8aca322012-11-27 01:10:30 +0000330
331 prefix_ipv4_free (ipv4);
hassof891f442004-09-14 13:54:30 +0000332 }
333#ifdef HAVE_IPV6
334 if (connected->address->family == AF_INET6)
335 {
336 ipv6 = prefix_ipv6_new ();
337 ipv6->prefixlen = connected->address->prefixlen;
338 ipv6->prefix = connected->address->u.prefix6;
339
340 if (IN6_IS_ADDR_LINKLOCAL (&ipv6->prefix))
341 {
paul1eb8ef22005-04-07 07:30:20 +0000342 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_link, node, ip6))
hassof891f442004-09-14 13:54:30 +0000343 {
hassof891f442004-09-14 13:54:30 +0000344 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
345 break;
346 }
347 if (ip6)
348 {
349 listnode_delete (circuit->ipv6_link, ip6);
350 found = 1;
351 }
352 }
353 else
354 {
paul1eb8ef22005-04-07 07:30:20 +0000355 for (ALL_LIST_ELEMENTS_RO (circuit->ipv6_non_link, node, ip6))
hassof891f442004-09-14 13:54:30 +0000356 {
hassof891f442004-09-14 13:54:30 +0000357 if (prefix_same ((struct prefix *) ip6, (struct prefix *) ipv6))
358 break;
359 }
360 if (ip6)
361 {
362 listnode_delete (circuit->ipv6_non_link, ip6);
363 found = 1;
364 }
365 }
366
367 if (!found)
368 {
hassof7c43dc2004-09-26 16:24:14 +0000369 prefix2str (connected->address, (char *)buf, BUFSIZ);
Josh Bailey3f045a02012-03-24 08:35:20 -0700370 zlog_warn ("Nonexitant ip address %s removal attempt from \
371 circuit %d", buf, circuit->circuit_id);
hassof891f442004-09-14 13:54:30 +0000372 }
Josh Bailey3f045a02012-03-24 08:35:20 -0700373 else if (circuit->area)
374 lsp_regenerate_schedule (circuit->area, circuit->is_type, 0);
David Lampartere8aca322012-11-27 01:10:30 +0000375
376 prefix_ipv6_free (ipv6);
hassof891f442004-09-14 13:54:30 +0000377 }
378#endif /* HAVE_IPV6 */
379 return;
jardineb5d44e2003-12-23 08:09:43 +0000380}
381
Josh Bailey3f045a02012-03-24 08:35:20 -0700382static u_char
383isis_circuit_id_gen (struct interface *ifp)
384{
385 u_char id = 0;
386 char ifname[16];
387 unsigned int i;
388 int start = -1, end = -1;
389
390 /*
391 * Get a stable circuit id from ifname. This makes
392 * the ifindex from flapping when netdevs are created
393 * and deleted on the fly. Note that this circuit id
394 * is used in pseudo lsps so it is better to be stable.
395 * The following code works on any reasonanle ifname
396 * like: eth1 or trk-1.1 etc.
397 */
398 for (i = 0; i < strlen (ifp->name); i++)
399 {
David Lamparter52f02b42015-04-10 09:14:30 +0200400 if (isdigit((unsigned char)ifp->name[i]))
Josh Bailey3f045a02012-03-24 08:35:20 -0700401 {
402 if (start < 0)
403 {
404 start = i;
405 end = i + 1;
406 }
407 else
408 {
409 end = i + 1;
410 }
411 }
412 else if (start >= 0)
413 break;
414 }
415
416 if ((start >= 0) && (end >= start) && (end - start) < 16)
417 {
418 memset (ifname, 0, 16);
419 strncpy (ifname, &ifp->name[start], end - start);
420 id = (u_char)atoi(ifname);
421 }
422
423 /* Try to be unique. */
424 if (!id)
425 id = (u_char)((ifp->ifindex & 0xff) | 0x80);
426
427 return id;
428}
429
jardineb5d44e2003-12-23 08:09:43 +0000430void
431isis_circuit_if_add (struct isis_circuit *circuit, struct interface *ifp)
432{
paul1eb8ef22005-04-07 07:30:20 +0000433 struct listnode *node, *nnode;
jardineb5d44e2003-12-23 08:09:43 +0000434 struct connected *conn;
435
Josh Bailey3f045a02012-03-24 08:35:20 -0700436 circuit->circuit_id = isis_circuit_id_gen (ifp);
hassof390d2c2004-09-10 20:48:21 +0000437
Josh Bailey3f045a02012-03-24 08:35:20 -0700438 isis_circuit_if_bind (circuit, ifp);
jardineb5d44e2003-12-23 08:09:43 +0000439 /* isis_circuit_update_addrs (circuit, ifp); */
440
hassof390d2c2004-09-10 20:48:21 +0000441 if (if_is_broadcast (ifp))
442 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700443 if (circuit->circ_type_config == CIRCUIT_T_P2P)
444 circuit->circ_type = CIRCUIT_T_P2P;
hassof390d2c2004-09-10 20:48:21 +0000445 else
Josh Bailey3f045a02012-03-24 08:35:20 -0700446 circuit->circ_type = CIRCUIT_T_BROADCAST;
hassof390d2c2004-09-10 20:48:21 +0000447 }
448 else if (if_is_pointopoint (ifp))
449 {
450 circuit->circ_type = CIRCUIT_T_P2P;
451 }
Josh Bailey3f045a02012-03-24 08:35:20 -0700452 else if (if_is_loopback (ifp))
453 {
454 circuit->circ_type = CIRCUIT_T_LOOPBACK;
455 circuit->is_passive = 1;
456 }
hassof390d2c2004-09-10 20:48:21 +0000457 else
458 {
hassoc89c05d2005-09-04 21:36:36 +0000459 /* It's normal in case of loopback etc. */
460 if (isis->debugs & DEBUG_EVENTS)
Josh Bailey3f045a02012-03-24 08:35:20 -0700461 zlog_debug ("isis_circuit_if_add: unsupported media");
462 circuit->circ_type = CIRCUIT_T_UNKNOWN;
hassof390d2c2004-09-10 20:48:21 +0000463 }
464
Josh Bailey3f045a02012-03-24 08:35:20 -0700465 circuit->ip_addrs = list_new ();
466#ifdef HAVE_IPV6
467 circuit->ipv6_link = list_new ();
468 circuit->ipv6_non_link = list_new ();
469#endif /* HAVE_IPV6 */
470
paul1eb8ef22005-04-07 07:30:20 +0000471 for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, conn))
472 isis_circuit_add_addr (circuit, conn);
jardineb5d44e2003-12-23 08:09:43 +0000473
474 return;
475}
476
477void
Josh Bailey3f045a02012-03-24 08:35:20 -0700478isis_circuit_if_del (struct isis_circuit *circuit, struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000479{
Josh Bailey3f045a02012-03-24 08:35:20 -0700480 struct listnode *node, *nnode;
481 struct connected *conn;
hassof390d2c2004-09-10 20:48:21 +0000482
Josh Bailey3f045a02012-03-24 08:35:20 -0700483 assert (circuit->interface == ifp);
484
485 /* destroy addresses */
486 for (ALL_LIST_ELEMENTS (ifp->connected, node, nnode, conn))
487 isis_circuit_del_addr (circuit, conn);
488
489 if (circuit->ip_addrs)
hassof390d2c2004-09-10 20:48:21 +0000490 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700491 assert (listcount(circuit->ip_addrs) == 0);
492 list_delete (circuit->ip_addrs);
493 circuit->ip_addrs = NULL;
hassof390d2c2004-09-10 20:48:21 +0000494 }
jardineb5d44e2003-12-23 08:09:43 +0000495
Josh Bailey3f045a02012-03-24 08:35:20 -0700496#ifdef HAVE_IPV6
497 if (circuit->ipv6_link)
hassof390d2c2004-09-10 20:48:21 +0000498 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700499 assert (listcount(circuit->ipv6_link) == 0);
500 list_delete (circuit->ipv6_link);
501 circuit->ipv6_link = NULL;
jardineb5d44e2003-12-23 08:09:43 +0000502 }
jardineb5d44e2003-12-23 08:09:43 +0000503
Josh Bailey3f045a02012-03-24 08:35:20 -0700504 if (circuit->ipv6_non_link)
hassof390d2c2004-09-10 20:48:21 +0000505 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700506 assert (listcount(circuit->ipv6_non_link) == 0);
507 list_delete (circuit->ipv6_non_link);
508 circuit->ipv6_non_link = NULL;
hassof390d2c2004-09-10 20:48:21 +0000509 }
Josh Bailey3f045a02012-03-24 08:35:20 -0700510#endif /* HAVE_IPV6 */
511
512 circuit->circ_type = CIRCUIT_T_UNKNOWN;
513 circuit->circuit_id = 0;
jardineb5d44e2003-12-23 08:09:43 +0000514
jardineb5d44e2003-12-23 08:09:43 +0000515 return;
516}
517
518void
Josh Bailey3f045a02012-03-24 08:35:20 -0700519isis_circuit_if_bind (struct isis_circuit *circuit, struct interface *ifp)
jardineb5d44e2003-12-23 08:09:43 +0000520{
Josh Bailey3f045a02012-03-24 08:35:20 -0700521 assert (circuit != NULL);
522 assert (ifp != NULL);
523 if (circuit->interface)
524 assert (circuit->interface == ifp);
525 else
526 circuit->interface = ifp;
527 if (ifp->info)
528 assert (ifp->info == circuit);
529 else
530 ifp->info = circuit;
531}
532
533void
534isis_circuit_if_unbind (struct isis_circuit *circuit, struct interface *ifp)
535{
536 assert (circuit != NULL);
537 assert (ifp != NULL);
538 assert (circuit->interface == ifp);
539 assert (ifp->info == circuit);
jardineb5d44e2003-12-23 08:09:43 +0000540 circuit->interface = NULL;
Josh Bailey3f045a02012-03-24 08:35:20 -0700541 ifp->info = NULL;
jardineb5d44e2003-12-23 08:09:43 +0000542}
543
Josh Bailey3f045a02012-03-24 08:35:20 -0700544static void
545isis_circuit_update_all_srmflags (struct isis_circuit *circuit, int is_set)
546{
547 struct isis_area *area;
548 struct isis_lsp *lsp;
549 dnode_t *dnode, *dnode_next;
550 int level;
551
552 assert (circuit);
553 area = circuit->area;
554 assert (area);
555 for (level = ISIS_LEVEL1; level <= ISIS_LEVEL2; level++)
556 {
557 if (level & circuit->is_type)
558 {
559 if (area->lspdb[level - 1] &&
560 dict_count (area->lspdb[level - 1]) > 0)
561 {
562 for (dnode = dict_first (area->lspdb[level - 1]);
563 dnode != NULL; dnode = dnode_next)
564 {
565 dnode_next = dict_next (area->lspdb[level - 1], dnode);
566 lsp = dnode_get (dnode);
567 if (is_set)
568 {
569 ISIS_SET_FLAG (lsp->SRMflags, circuit);
570 }
571 else
572 {
573 ISIS_CLEAR_FLAG (lsp->SRMflags, circuit);
574 }
575 }
576 }
577 }
578 }
579}
580
Christian Frankef1fc1db2015-11-10 18:43:31 +0100581size_t
582isis_circuit_pdu_size(struct isis_circuit *circuit)
583{
584 return ISO_MTU(circuit);
585}
586
587void
588isis_circuit_stream(struct isis_circuit *circuit, struct stream **stream)
589{
590 size_t stream_size = isis_circuit_pdu_size(circuit);
591
592 if (!*stream)
593 {
594 *stream = stream_new(stream_size);
595 }
596 else
597 {
598 if (STREAM_SIZE(*stream) != stream_size)
599 stream_resize(*stream, stream_size);
600 stream_reset(*stream);
601 }
602}
603
Josh Bailey3f045a02012-03-24 08:35:20 -0700604int
jardineb5d44e2003-12-23 08:09:43 +0000605isis_circuit_up (struct isis_circuit *circuit)
606{
Josh Bailey3f045a02012-03-24 08:35:20 -0700607 int retv;
608
609 /* Set the flags for all the lsps of the circuit. */
610 isis_circuit_update_all_srmflags (circuit, 1);
611
612 if (circuit->state == C_STATE_UP)
613 return ISIS_OK;
614
615 if (circuit->is_passive)
616 return ISIS_OK;
jardineb5d44e2003-12-23 08:09:43 +0000617
Christian Frankef1fc1db2015-11-10 18:43:31 +0100618 if (circuit->area->lsp_mtu > isis_circuit_pdu_size(circuit))
619 {
620 zlog_err("Interface MTU %zu on %s is too low to support area lsp mtu %u!",
621 isis_circuit_pdu_size(circuit), circuit->interface->name,
622 circuit->area->lsp_mtu);
623 isis_circuit_down(circuit);
624 return ISIS_ERROR;
625 }
626
hassof390d2c2004-09-10 20:48:21 +0000627 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
628 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700629 /*
630 * Get the Hardware Address
631 */
632#ifdef HAVE_STRUCT_SOCKADDR_DL
633#ifndef SUNOS_5
634 if (circuit->interface->sdl.sdl_alen != ETHER_ADDR_LEN)
635 zlog_warn ("unsupported link layer");
636 else
637 memcpy (circuit->u.bc.snpa, LLADDR (&circuit->interface->sdl),
638 ETH_ALEN);
639#endif
640#else
641 if (circuit->interface->hw_addr_len != ETH_ALEN)
642 {
643 zlog_warn ("unsupported link layer");
644 }
645 else
646 {
647 memcpy (circuit->u.bc.snpa, circuit->interface->hw_addr, ETH_ALEN);
648 }
649#ifdef EXTREME_DEGUG
650 zlog_debug ("isis_circuit_if_add: if_id %d, isomtu %d snpa %s",
651 circuit->interface->ifindex, ISO_MTU (circuit),
652 snpa_print (circuit->u.bc.snpa));
653#endif /* EXTREME_DEBUG */
654#endif /* HAVE_STRUCT_SOCKADDR_DL */
655
656 circuit->u.bc.adjdb[0] = list_new ();
657 circuit->u.bc.adjdb[1] = list_new ();
658
hassof390d2c2004-09-10 20:48:21 +0000659 /*
660 * ISO 10589 - 8.4.1 Enabling of broadcast circuits
661 */
jardineb5d44e2003-12-23 08:09:43 +0000662
hassof390d2c2004-09-10 20:48:21 +0000663 /* initilizing the hello sending threads
664 * for a broadcast IF
665 */
jardineb5d44e2003-12-23 08:09:43 +0000666
hassof390d2c2004-09-10 20:48:21 +0000667 /* 8.4.1 a) commence sending of IIH PDUs */
668
Josh Bailey3f045a02012-03-24 08:35:20 -0700669 if (circuit->is_type & IS_LEVEL_1)
670 {
671 thread_add_event (master, send_lan_l1_hello, circuit, 0);
672 circuit->u.bc.lan_neighs[0] = list_new ();
673 }
hassof390d2c2004-09-10 20:48:21 +0000674
Josh Bailey3f045a02012-03-24 08:35:20 -0700675 if (circuit->is_type & IS_LEVEL_2)
676 {
677 thread_add_event (master, send_lan_l2_hello, circuit, 0);
678 circuit->u.bc.lan_neighs[1] = list_new ();
679 }
hassof390d2c2004-09-10 20:48:21 +0000680
681 /* 8.4.1 b) FIXME: solicit ES - 8.4.6 */
682 /* 8.4.1 c) FIXME: listen for ESH PDUs */
683
684 /* 8.4.1 d) */
685 /* dr election will commence in... */
Josh Bailey3f045a02012-03-24 08:35:20 -0700686 if (circuit->is_type & IS_LEVEL_1)
687 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[0], isis_run_dr_l1,
688 circuit, 2 * circuit->hello_interval[0]);
689 if (circuit->is_type & IS_LEVEL_2)
690 THREAD_TIMER_ON (master, circuit->u.bc.t_run_dr[1], isis_run_dr_l2,
691 circuit, 2 * circuit->hello_interval[1]);
jardineb5d44e2003-12-23 08:09:43 +0000692 }
hassof390d2c2004-09-10 20:48:21 +0000693 else
694 {
695 /* initializing the hello send threads
696 * for a ptp IF
697 */
Josh Bailey3f045a02012-03-24 08:35:20 -0700698 circuit->u.p2p.neighbor = NULL;
hassof390d2c2004-09-10 20:48:21 +0000699 thread_add_event (master, send_p2p_hello, circuit, 0);
jardineb5d44e2003-12-23 08:09:43 +0000700 }
701
jardineb5d44e2003-12-23 08:09:43 +0000702 /* initializing PSNP timers */
Josh Bailey3f045a02012-03-24 08:35:20 -0700703 if (circuit->is_type & IS_LEVEL_1)
704 THREAD_TIMER_ON (master, circuit->t_send_psnp[0], send_l1_psnp, circuit,
705 isis_jitter (circuit->psnp_interval[0], PSNP_JITTER));
706
707 if (circuit->is_type & IS_LEVEL_2)
708 THREAD_TIMER_ON (master, circuit->t_send_psnp[1], send_l2_psnp, circuit,
709 isis_jitter (circuit->psnp_interval[1], PSNP_JITTER));
710
711 /* unified init for circuits; ignore warnings below this level */
712 retv = isis_sock_init (circuit);
713 if (retv != ISIS_OK)
hassof390d2c2004-09-10 20:48:21 +0000714 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700715 isis_circuit_down (circuit);
716 return retv;
hassof390d2c2004-09-10 20:48:21 +0000717 }
718
Josh Bailey3f045a02012-03-24 08:35:20 -0700719 /* initialize the circuit streams after opening connection */
Christian Frankef1fc1db2015-11-10 18:43:31 +0100720 isis_circuit_stream(circuit, &circuit->rcv_stream);
721 isis_circuit_stream(circuit, &circuit->snd_stream);
jardineb5d44e2003-12-23 08:09:43 +0000722
jardineb5d44e2003-12-23 08:09:43 +0000723#ifdef GNU_LINUX
hassof390d2c2004-09-10 20:48:21 +0000724 THREAD_READ_ON (master, circuit->t_read, isis_receive, circuit,
Josh Bailey3f045a02012-03-24 08:35:20 -0700725 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000726#else
hassof390d2c2004-09-10 20:48:21 +0000727 THREAD_TIMER_ON (master, circuit->t_read, isis_receive, circuit,
Josh Bailey3f045a02012-03-24 08:35:20 -0700728 circuit->fd);
jardineb5d44e2003-12-23 08:09:43 +0000729#endif
Josh Bailey3f045a02012-03-24 08:35:20 -0700730
731 circuit->lsp_queue = list_new ();
732 circuit->lsp_queue_last_cleared = time (NULL);
733
734 return ISIS_OK;
jardineb5d44e2003-12-23 08:09:43 +0000735}
736
737void
738isis_circuit_down (struct isis_circuit *circuit)
739{
Josh Bailey3f045a02012-03-24 08:35:20 -0700740 if (circuit->state != C_STATE_UP)
741 return;
742
743 /* Clear the flags for all the lsps of the circuit. */
744 isis_circuit_update_all_srmflags (circuit, 0);
745
hassof390d2c2004-09-10 20:48:21 +0000746 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
747 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700748 /* destroy neighbour lists */
749 if (circuit->u.bc.lan_neighs[0])
750 {
751 list_delete (circuit->u.bc.lan_neighs[0]);
752 circuit->u.bc.lan_neighs[0] = NULL;
753 }
754 if (circuit->u.bc.lan_neighs[1])
755 {
756 list_delete (circuit->u.bc.lan_neighs[1]);
757 circuit->u.bc.lan_neighs[1] = NULL;
758 }
759 /* destroy adjacency databases */
760 if (circuit->u.bc.adjdb[0])
761 {
762 circuit->u.bc.adjdb[0]->del = isis_delete_adj;
763 list_delete (circuit->u.bc.adjdb[0]);
764 circuit->u.bc.adjdb[0] = NULL;
765 }
766 if (circuit->u.bc.adjdb[1])
767 {
768 circuit->u.bc.adjdb[1]->del = isis_delete_adj;
769 list_delete (circuit->u.bc.adjdb[1]);
770 circuit->u.bc.adjdb[1] = NULL;
771 }
772 if (circuit->u.bc.is_dr[0])
773 {
774 isis_dr_resign (circuit, 1);
775 circuit->u.bc.is_dr[0] = 0;
776 }
777 memset (circuit->u.bc.l1_desig_is, 0, ISIS_SYS_ID_LEN + 1);
778 if (circuit->u.bc.is_dr[1])
779 {
780 isis_dr_resign (circuit, 2);
781 circuit->u.bc.is_dr[1] = 0;
782 }
783 memset (circuit->u.bc.l2_desig_is, 0, ISIS_SYS_ID_LEN + 1);
784 memset (circuit->u.bc.snpa, 0, ETH_ALEN);
785
hassof390d2c2004-09-10 20:48:21 +0000786 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[0]);
787 THREAD_TIMER_OFF (circuit->u.bc.t_send_lan_hello[1]);
hassof891f442004-09-14 13:54:30 +0000788 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[0]);
789 THREAD_TIMER_OFF (circuit->u.bc.t_run_dr[1]);
Josh Bailey3f045a02012-03-24 08:35:20 -0700790 THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[0]);
791 THREAD_TIMER_OFF (circuit->u.bc.t_refresh_pseudo_lsp[1]);
hassof390d2c2004-09-10 20:48:21 +0000792 }
793 else if (circuit->circ_type == CIRCUIT_T_P2P)
794 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700795 isis_delete_adj (circuit->u.p2p.neighbor);
796 circuit->u.p2p.neighbor = NULL;
hassof390d2c2004-09-10 20:48:21 +0000797 THREAD_TIMER_OFF (circuit->u.p2p.t_send_p2p_hello);
798 }
Josh Bailey3f045a02012-03-24 08:35:20 -0700799
800 /* Cancel all active threads */
801 THREAD_TIMER_OFF (circuit->t_send_csnp[0]);
802 THREAD_TIMER_OFF (circuit->t_send_csnp[1]);
803 THREAD_TIMER_OFF (circuit->t_send_psnp[0]);
804 THREAD_TIMER_OFF (circuit->t_send_psnp[1]);
805 THREAD_OFF (circuit->t_read);
806
807 if (circuit->lsp_queue)
808 {
809 circuit->lsp_queue->del = NULL;
810 list_delete (circuit->lsp_queue);
811 circuit->lsp_queue = NULL;
812 }
813
814 /* send one gratuitous hello to spead up convergence */
815 if (circuit->is_type & IS_LEVEL_1)
816 send_hello (circuit, IS_LEVEL_1);
817 if (circuit->is_type & IS_LEVEL_2)
818 send_hello (circuit, IS_LEVEL_2);
819
820 circuit->upadjcount[0] = 0;
821 circuit->upadjcount[1] = 0;
822
jardineb5d44e2003-12-23 08:09:43 +0000823 /* close the socket */
Josh Bailey3f045a02012-03-24 08:35:20 -0700824 if (circuit->fd)
825 {
826 close (circuit->fd);
827 circuit->fd = 0;
828 }
829
830 if (circuit->rcv_stream != NULL)
831 {
832 stream_free (circuit->rcv_stream);
833 circuit->rcv_stream = NULL;
834 }
835
836 if (circuit->snd_stream != NULL)
837 {
838 stream_free (circuit->snd_stream);
839 circuit->snd_stream = NULL;
840 }
841
842 thread_cancel_event (master, circuit);
jardineb5d44e2003-12-23 08:09:43 +0000843
844 return;
845}
846
847void
848circuit_update_nlpids (struct isis_circuit *circuit)
849{
850 circuit->nlpids.count = 0;
hassof390d2c2004-09-10 20:48:21 +0000851
852 if (circuit->ip_router)
853 {
854 circuit->nlpids.nlpids[0] = NLPID_IP;
855 circuit->nlpids.count++;
856 }
jardineb5d44e2003-12-23 08:09:43 +0000857#ifdef HAVE_IPV6
hassof390d2c2004-09-10 20:48:21 +0000858 if (circuit->ipv6_router)
859 {
860 circuit->nlpids.nlpids[circuit->nlpids.count] = NLPID_IPV6;
861 circuit->nlpids.count++;
862 }
jardineb5d44e2003-12-23 08:09:43 +0000863#endif /* HAVE_IPV6 */
864 return;
865}
866
Josh Bailey3f045a02012-03-24 08:35:20 -0700867void
868isis_circuit_print_vty (struct isis_circuit *circuit, struct vty *vty,
869 char detail)
870{
871 if (detail == ISIS_UI_LEVEL_BRIEF)
872 {
873 vty_out (vty, " %-12s", circuit->interface->name);
874 vty_out (vty, "0x%-7x", circuit->circuit_id);
875 vty_out (vty, "%-9s", circuit_state2string (circuit->state));
876 vty_out (vty, "%-9s", circuit_type2string (circuit->circ_type));
877 vty_out (vty, "%-9s", circuit_t2string (circuit->is_type));
878 vty_out (vty, "%s", VTY_NEWLINE);
879 }
880
881 if (detail == ISIS_UI_LEVEL_DETAIL)
882 {
883 vty_out (vty, " Interface: %s", circuit->interface->name);
884 vty_out (vty, ", State: %s", circuit_state2string (circuit->state));
885 if (circuit->is_passive)
886 vty_out (vty, ", Passive");
887 else
888 vty_out (vty, ", Active");
889 vty_out (vty, ", Circuit Id: 0x%x", circuit->circuit_id);
890 vty_out (vty, "%s", VTY_NEWLINE);
891 vty_out (vty, " Type: %s", circuit_type2string (circuit->circ_type));
892 vty_out (vty, ", Level: %s", circuit_t2string (circuit->is_type));
893 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
894 vty_out (vty, ", SNPA: %-10s", snpa_print (circuit->u.bc.snpa));
895 vty_out (vty, "%s", VTY_NEWLINE);
896 if (circuit->is_type & IS_LEVEL_1)
897 {
898 vty_out (vty, " Level-1 Information:%s", VTY_NEWLINE);
899 if (circuit->area->newmetric)
900 vty_out (vty, " Metric: %d", circuit->te_metric[0]);
901 else
902 vty_out (vty, " Metric: %d",
903 circuit->metrics[0].metric_default);
904 if (!circuit->is_passive)
905 {
906 vty_out (vty, ", Active neighbors: %u%s",
907 circuit->upadjcount[0], VTY_NEWLINE);
908 vty_out (vty, " Hello interval: %u, "
909 "Holddown count: %u %s%s",
910 circuit->hello_interval[0],
911 circuit->hello_multiplier[0],
912 (circuit->pad_hellos ? "(pad)" : "(no-pad)"),
913 VTY_NEWLINE);
914 vty_out (vty, " CNSP interval: %u, "
915 "PSNP interval: %u%s",
916 circuit->csnp_interval[0],
917 circuit->psnp_interval[0], VTY_NEWLINE);
918 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
919 vty_out (vty, " LAN Priority: %u, %s%s",
920 circuit->priority[0],
921 (circuit->u.bc.is_dr[0] ? \
922 "is DIS" : "is not DIS"), VTY_NEWLINE);
923 }
924 else
925 {
926 vty_out (vty, "%s", VTY_NEWLINE);
927 }
928 }
929 if (circuit->is_type & IS_LEVEL_2)
930 {
931 vty_out (vty, " Level-2 Information:%s", VTY_NEWLINE);
932 if (circuit->area->newmetric)
933 vty_out (vty, " Metric: %d", circuit->te_metric[1]);
934 else
935 vty_out (vty, " Metric: %d",
936 circuit->metrics[1].metric_default);
937 if (!circuit->is_passive)
938 {
939 vty_out (vty, ", Active neighbors: %u%s",
940 circuit->upadjcount[1], VTY_NEWLINE);
941 vty_out (vty, " Hello interval: %u, "
942 "Holddown count: %u %s%s",
943 circuit->hello_interval[1],
944 circuit->hello_multiplier[1],
945 (circuit->pad_hellos ? "(pad)" : "(no-pad)"),
946 VTY_NEWLINE);
947 vty_out (vty, " CNSP interval: %u, "
948 "PSNP interval: %u%s",
949 circuit->csnp_interval[1],
950 circuit->psnp_interval[1], VTY_NEWLINE);
951 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
952 vty_out (vty, " LAN Priority: %u, %s%s",
953 circuit->priority[1],
954 (circuit->u.bc.is_dr[1] ? \
955 "is DIS" : "is not DIS"), VTY_NEWLINE);
956 }
957 else
958 {
959 vty_out (vty, "%s", VTY_NEWLINE);
960 }
961 }
962 if (circuit->ip_addrs && listcount (circuit->ip_addrs) > 0)
963 {
964 struct listnode *node;
965 struct prefix *ip_addr;
966 u_char buf[BUFSIZ];
967 vty_out (vty, " IP Prefix(es):%s", VTY_NEWLINE);
968 for (ALL_LIST_ELEMENTS_RO (circuit->ip_addrs, node, ip_addr))
969 {
970 prefix2str (ip_addr, (char*)buf, BUFSIZ),
971 vty_out (vty, " %s%s", buf, VTY_NEWLINE);
972 }
973 }
974 vty_out (vty, "%s", VTY_NEWLINE);
975 }
976 return;
977}
978
jardineb5d44e2003-12-23 08:09:43 +0000979int
hassof390d2c2004-09-10 20:48:21 +0000980isis_interface_config_write (struct vty *vty)
jardineb5d44e2003-12-23 08:09:43 +0000981{
jardineb5d44e2003-12-23 08:09:43 +0000982 int write = 0;
hasso3fdb2dd2005-09-28 18:45:54 +0000983 struct listnode *node, *node2;
jardineb5d44e2003-12-23 08:09:43 +0000984 struct interface *ifp;
985 struct isis_area *area;
Josh Bailey3f045a02012-03-24 08:35:20 -0700986 struct isis_circuit *circuit;
jardineb5d44e2003-12-23 08:09:43 +0000987 int i;
jardineb5d44e2003-12-23 08:09:43 +0000988
hasso3fdb2dd2005-09-28 18:45:54 +0000989 for (ALL_LIST_ELEMENTS_RO (iflist, node, ifp))
jardineb5d44e2003-12-23 08:09:43 +0000990 {
Josh Bailey3f045a02012-03-24 08:35:20 -0700991 /* IF name */
992 vty_out (vty, "interface %s%s", ifp->name, VTY_NEWLINE);
993 write++;
994 /* IF desc */
995 if (ifp->desc)
996 {
997 vty_out (vty, " description %s%s", ifp->desc, VTY_NEWLINE);
998 write++;
999 }
1000 /* ISIS Circuit */
1001 for (ALL_LIST_ELEMENTS_RO (isis->area_list, node2, area))
1002 {
1003 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
1004 if (circuit == NULL)
1005 continue;
1006 if (circuit->ip_router)
1007 {
1008 vty_out (vty, " ip router isis %s%s", area->area_tag,
1009 VTY_NEWLINE);
1010 write++;
1011 }
1012 if (circuit->is_passive)
1013 {
1014 vty_out (vty, " isis passive%s", VTY_NEWLINE);
1015 write++;
1016 }
1017 if (circuit->circ_type_config == CIRCUIT_T_P2P)
1018 {
1019 vty_out (vty, " isis network point-to-point%s", VTY_NEWLINE);
1020 write++;
1021 }
jardineb5d44e2003-12-23 08:09:43 +00001022#ifdef HAVE_IPV6
Josh Bailey3f045a02012-03-24 08:35:20 -07001023 if (circuit->ipv6_router)
1024 {
1025 vty_out (vty, " ipv6 router isis %s%s", area->area_tag,
1026 VTY_NEWLINE);
1027 write++;
1028 }
jardineb5d44e2003-12-23 08:09:43 +00001029#endif /* HAVE_IPV6 */
jardineb5d44e2003-12-23 08:09:43 +00001030
Josh Bailey3f045a02012-03-24 08:35:20 -07001031 /* ISIS - circuit type */
1032 if (circuit->is_type == IS_LEVEL_1)
1033 {
1034 vty_out (vty, " isis circuit-type level-1%s", VTY_NEWLINE);
1035 write++;
1036 }
1037 else
1038 {
1039 if (circuit->is_type == IS_LEVEL_2)
1040 {
1041 vty_out (vty, " isis circuit-type level-2-only%s",
1042 VTY_NEWLINE);
1043 write++;
1044 }
1045 }
jardineb5d44e2003-12-23 08:09:43 +00001046
Josh Bailey3f045a02012-03-24 08:35:20 -07001047 /* ISIS - CSNP interval */
1048 if (circuit->csnp_interval[0] == circuit->csnp_interval[1])
1049 {
1050 if (circuit->csnp_interval[0] != DEFAULT_CSNP_INTERVAL)
1051 {
1052 vty_out (vty, " isis csnp-interval %d%s",
1053 circuit->csnp_interval[0], VTY_NEWLINE);
1054 write++;
1055 }
1056 }
1057 else
1058 {
1059 for (i = 0; i < 2; i++)
1060 {
1061 if (circuit->csnp_interval[i] != DEFAULT_CSNP_INTERVAL)
1062 {
1063 vty_out (vty, " isis csnp-interval %d level-%d%s",
1064 circuit->csnp_interval[i], i + 1, VTY_NEWLINE);
1065 write++;
1066 }
1067 }
1068 }
jardineb5d44e2003-12-23 08:09:43 +00001069
Josh Bailey3f045a02012-03-24 08:35:20 -07001070 /* ISIS - PSNP interval */
1071 if (circuit->psnp_interval[0] == circuit->psnp_interval[1])
1072 {
1073 if (circuit->psnp_interval[0] != DEFAULT_PSNP_INTERVAL)
1074 {
1075 vty_out (vty, " isis psnp-interval %d%s",
1076 circuit->psnp_interval[0], VTY_NEWLINE);
1077 write++;
1078 }
1079 }
1080 else
1081 {
1082 for (i = 0; i < 2; i++)
1083 {
1084 if (circuit->psnp_interval[i] != DEFAULT_PSNP_INTERVAL)
1085 {
1086 vty_out (vty, " isis psnp-interval %d level-%d%s",
1087 circuit->psnp_interval[i], i + 1, VTY_NEWLINE);
1088 write++;
1089 }
1090 }
1091 }
jardineb5d44e2003-12-23 08:09:43 +00001092
Josh Bailey3f045a02012-03-24 08:35:20 -07001093 /* ISIS - Hello padding - Defaults to true so only display if false */
1094 if (circuit->pad_hellos == 0)
1095 {
1096 vty_out (vty, " no isis hello padding%s", VTY_NEWLINE);
1097 write++;
1098 }
jardineb5d44e2003-12-23 08:09:43 +00001099
Josh Bailey3f045a02012-03-24 08:35:20 -07001100 /* ISIS - Hello interval */
1101 if (circuit->hello_interval[0] == circuit->hello_interval[1])
1102 {
1103 if (circuit->hello_interval[0] != DEFAULT_HELLO_INTERVAL)
1104 {
1105 vty_out (vty, " isis hello-interval %d%s",
1106 circuit->hello_interval[0], VTY_NEWLINE);
1107 write++;
1108 }
1109 }
1110 else
1111 {
1112 for (i = 0; i < 2; i++)
1113 {
1114 if (circuit->hello_interval[i] != DEFAULT_HELLO_INTERVAL)
1115 {
1116 vty_out (vty, " isis hello-interval %d level-%d%s",
1117 circuit->hello_interval[i], i + 1, VTY_NEWLINE);
1118 write++;
1119 }
1120 }
1121 }
jardineb5d44e2003-12-23 08:09:43 +00001122
Josh Bailey3f045a02012-03-24 08:35:20 -07001123 /* ISIS - Hello Multiplier */
1124 if (circuit->hello_multiplier[0] == circuit->hello_multiplier[1])
1125 {
1126 if (circuit->hello_multiplier[0] != DEFAULT_HELLO_MULTIPLIER)
1127 {
1128 vty_out (vty, " isis hello-multiplier %d%s",
1129 circuit->hello_multiplier[0], VTY_NEWLINE);
1130 write++;
1131 }
1132 }
1133 else
1134 {
1135 for (i = 0; i < 2; i++)
1136 {
1137 if (circuit->hello_multiplier[i] != DEFAULT_HELLO_MULTIPLIER)
1138 {
1139 vty_out (vty, " isis hello-multiplier %d level-%d%s",
1140 circuit->hello_multiplier[i], i + 1,
1141 VTY_NEWLINE);
1142 write++;
1143 }
1144 }
1145 }
1146
1147 /* ISIS - Priority */
1148 if (circuit->priority[0] == circuit->priority[1])
1149 {
1150 if (circuit->priority[0] != DEFAULT_PRIORITY)
1151 {
1152 vty_out (vty, " isis priority %d%s",
1153 circuit->priority[0], VTY_NEWLINE);
1154 write++;
1155 }
1156 }
1157 else
1158 {
1159 for (i = 0; i < 2; i++)
1160 {
1161 if (circuit->priority[i] != DEFAULT_PRIORITY)
1162 {
1163 vty_out (vty, " isis priority %d level-%d%s",
1164 circuit->priority[i], i + 1, VTY_NEWLINE);
1165 write++;
1166 }
1167 }
1168 }
1169
1170 /* ISIS - Metric */
1171 if (circuit->te_metric[0] == circuit->te_metric[1])
1172 {
1173 if (circuit->te_metric[0] != DEFAULT_CIRCUIT_METRIC)
1174 {
1175 vty_out (vty, " isis metric %d%s", circuit->te_metric[0],
1176 VTY_NEWLINE);
1177 write++;
1178 }
1179 }
1180 else
1181 {
1182 for (i = 0; i < 2; i++)
1183 {
1184 if (circuit->te_metric[i] != DEFAULT_CIRCUIT_METRIC)
1185 {
1186 vty_out (vty, " isis metric %d level-%d%s",
1187 circuit->te_metric[i], i + 1, VTY_NEWLINE);
1188 write++;
1189 }
1190 }
1191 }
1192 if (circuit->passwd.type == ISIS_PASSWD_TYPE_HMAC_MD5)
1193 {
1194 vty_out (vty, " isis password md5 %s%s", circuit->passwd.passwd,
1195 VTY_NEWLINE);
1196 write++;
1197 }
1198 else if (circuit->passwd.type == ISIS_PASSWD_TYPE_CLEARTXT)
1199 {
1200 vty_out (vty, " isis password clear %s%s", circuit->passwd.passwd,
1201 VTY_NEWLINE);
1202 write++;
1203 }
1204 }
1205 vty_out (vty, "!%s", VTY_NEWLINE);
jardineb5d44e2003-12-23 08:09:43 +00001206 }
hassof390d2c2004-09-10 20:48:21 +00001207
jardineb5d44e2003-12-23 08:09:43 +00001208 return write;
1209}
jardineb5d44e2003-12-23 08:09:43 +00001210
1211DEFUN (ip_router_isis,
1212 ip_router_isis_cmd,
1213 "ip router isis WORD",
1214 "Interface Internet Protocol config commands\n"
1215 "IP router interface commands\n"
1216 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +00001217 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +00001218{
Josh Bailey3f045a02012-03-24 08:35:20 -07001219 struct isis_circuit *circuit;
jardineb5d44e2003-12-23 08:09:43 +00001220 struct interface *ifp;
1221 struct isis_area *area;
Christian Frankef1fc1db2015-11-10 18:43:31 +01001222 int rv;
hassof390d2c2004-09-10 20:48:21 +00001223
1224 ifp = (struct interface *) vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001225 assert (ifp);
hassof390d2c2004-09-10 20:48:21 +00001226
Josh Bailey3f045a02012-03-24 08:35:20 -07001227 /* Prevent more than one area per circuit */
1228 circuit = circuit_scan_by_ifp (ifp);
1229 if (circuit)
hassof390d2c2004-09-10 20:48:21 +00001230 {
Josh Bailey3f045a02012-03-24 08:35:20 -07001231 if (circuit->ip_router == 1)
1232 {
1233 if (strcmp (circuit->area->area_tag, argv[0]))
1234 {
1235 vty_out (vty, "ISIS circuit is already defined on %s%s",
1236 circuit->area->area_tag, VTY_NEWLINE);
1237 return CMD_ERR_NOTHING_TODO;
1238 }
1239 return CMD_SUCCESS;
1240 }
jardineb5d44e2003-12-23 08:09:43 +00001241 }
hassof390d2c2004-09-10 20:48:21 +00001242
Josh Bailey3f045a02012-03-24 08:35:20 -07001243 if (isis_area_get (vty, argv[0]) != CMD_SUCCESS)
hassof390d2c2004-09-10 20:48:21 +00001244 {
Josh Bailey3f045a02012-03-24 08:35:20 -07001245 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1246 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001247 }
Josh Bailey3f045a02012-03-24 08:35:20 -07001248 area = vty->index;
jardineb5d44e2003-12-23 08:09:43 +00001249
Josh Bailey3f045a02012-03-24 08:35:20 -07001250 circuit = isis_csm_state_change (ISIS_ENABLE, circuit, area);
Christian Frankef1fc1db2015-11-10 18:43:31 +01001251 if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP)
1252 {
1253 vty_out(vty, "Couldn't bring up interface, please check log.%s", VTY_NEWLINE);
1254 rv = CMD_WARNING;
1255 }
1256 else
1257 {
1258 isis_circuit_if_bind (circuit, ifp);
jardineb5d44e2003-12-23 08:09:43 +00001259
Christian Frankef1fc1db2015-11-10 18:43:31 +01001260 circuit->ip_router = 1;
1261 area->ip_circuits++;
1262 circuit_update_nlpids (circuit);
1263 rv = CMD_SUCCESS;
1264 }
jardineb5d44e2003-12-23 08:09:43 +00001265
1266 vty->node = INTERFACE_NODE;
Josh Bailey3f045a02012-03-24 08:35:20 -07001267 vty->index = ifp;
hassof390d2c2004-09-10 20:48:21 +00001268
Christian Frankef1fc1db2015-11-10 18:43:31 +01001269 return rv;
jardineb5d44e2003-12-23 08:09:43 +00001270}
1271
1272DEFUN (no_ip_router_isis,
1273 no_ip_router_isis_cmd,
1274 "no ip router isis WORD",
1275 NO_STR
1276 "Interface Internet Protocol config commands\n"
1277 "IP router interface commands\n"
1278 "IS-IS Routing for IP\n"
hassof390d2c2004-09-10 20:48:21 +00001279 "Routing process tag\n")
jardineb5d44e2003-12-23 08:09:43 +00001280{
jardineb5d44e2003-12-23 08:09:43 +00001281 struct interface *ifp;
1282 struct isis_area *area;
Josh Bailey3f045a02012-03-24 08:35:20 -07001283 struct isis_circuit *circuit;
jardineb5d44e2003-12-23 08:09:43 +00001284
hassof390d2c2004-09-10 20:48:21 +00001285 ifp = (struct interface *) vty->index;
Josh Bailey3f045a02012-03-24 08:35:20 -07001286 if (!ifp)
1287 {
1288 vty_out (vty, "Invalid interface %s", VTY_NEWLINE);
1289 return CMD_ERR_NO_MATCH;
1290 }
hassof390d2c2004-09-10 20:48:21 +00001291
jardineb5d44e2003-12-23 08:09:43 +00001292 area = isis_area_lookup (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001293 if (!area)
1294 {
Josh Bailey3f045a02012-03-24 08:35:20 -07001295 vty_out (vty, "Can't find ISIS instance %s%s",
1296 argv[0], VTY_NEWLINE);
1297 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001298 }
Josh Bailey3f045a02012-03-24 08:35:20 -07001299
1300 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
hassof390d2c2004-09-10 20:48:21 +00001301 if (!circuit)
1302 {
Josh Bailey3f045a02012-03-24 08:35:20 -07001303 vty_out (vty, "ISIS is not enabled on circuit %s%s",
1304 ifp->name, VTY_NEWLINE);
1305 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001306 }
Josh Bailey3f045a02012-03-24 08:35:20 -07001307
jardineb5d44e2003-12-23 08:09:43 +00001308 circuit->ip_router = 0;
1309 area->ip_circuits--;
1310#ifdef HAVE_IPV6
1311 if (circuit->ipv6_router == 0)
1312#endif
1313 isis_csm_state_change (ISIS_DISABLE, circuit, area);
hassof390d2c2004-09-10 20:48:21 +00001314
jardineb5d44e2003-12-23 08:09:43 +00001315 return CMD_SUCCESS;
1316}
1317
Josh Bailey3f045a02012-03-24 08:35:20 -07001318#ifdef HAVE_IPV6
1319DEFUN (ipv6_router_isis,
1320 ipv6_router_isis_cmd,
1321 "ipv6 router isis WORD",
1322 "IPv6 interface subcommands\n"
1323 "IPv6 Router interface commands\n"
1324 "IS-IS Routing for IPv6\n"
1325 "Routing process tag\n")
1326{
1327 struct isis_circuit *circuit;
1328 struct interface *ifp;
1329 struct isis_area *area;
Christian Frankef1fc1db2015-11-10 18:43:31 +01001330 int rv;
Josh Bailey3f045a02012-03-24 08:35:20 -07001331
1332 ifp = (struct interface *) vty->index;
1333 assert (ifp);
1334
1335 /* Prevent more than one area per circuit */
1336 circuit = circuit_scan_by_ifp (ifp);
1337 if (circuit)
1338 {
1339 if (circuit->ipv6_router == 1)
1340 {
1341 if (strcmp (circuit->area->area_tag, argv[0]))
1342 {
1343 vty_out (vty, "ISIS circuit is already defined for IPv6 on %s%s",
1344 circuit->area->area_tag, VTY_NEWLINE);
1345 return CMD_ERR_NOTHING_TODO;
1346 }
1347 return CMD_SUCCESS;
1348 }
1349 }
1350
1351 if (isis_area_get (vty, argv[0]) != CMD_SUCCESS)
1352 {
1353 vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
1354 return CMD_ERR_NO_MATCH;
1355 }
1356 area = vty->index;
1357
1358 circuit = isis_csm_state_change (ISIS_ENABLE, circuit, area);
Christian Frankef1fc1db2015-11-10 18:43:31 +01001359 if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP)
1360 {
1361 vty_out(vty, "Couldn't bring up interface, please check log.%s", VTY_NEWLINE);
1362 rv = CMD_WARNING;
1363 }
1364 else
1365 {
1366 isis_circuit_if_bind (circuit, ifp);
Josh Bailey3f045a02012-03-24 08:35:20 -07001367
Christian Frankef1fc1db2015-11-10 18:43:31 +01001368 circuit->ipv6_router = 1;
1369 area->ipv6_circuits++;
1370 circuit_update_nlpids (circuit);
1371 rv = CMD_SUCCESS;
1372 }
Josh Bailey3f045a02012-03-24 08:35:20 -07001373
1374 vty->node = INTERFACE_NODE;
1375 vty->index = ifp;
1376
Christian Frankef1fc1db2015-11-10 18:43:31 +01001377 return rv;
Josh Bailey3f045a02012-03-24 08:35:20 -07001378}
1379
1380DEFUN (no_ipv6_router_isis,
1381 no_ipv6_router_isis_cmd,
1382 "no ipv6 router isis WORD",
1383 NO_STR
1384 "IPv6 interface subcommands\n"
1385 "IPv6 Router interface commands\n"
1386 "IS-IS Routing for IPv6\n"
1387 "Routing process tag\n")
1388{
1389 struct interface *ifp;
1390 struct isis_area *area;
Josh Bailey3f045a02012-03-24 08:35:20 -07001391 struct isis_circuit *circuit;
1392
1393 ifp = (struct interface *) vty->index;
1394 if (!ifp)
1395 {
1396 vty_out (vty, "Invalid interface %s", VTY_NEWLINE);
1397 return CMD_ERR_NO_MATCH;
1398 }
1399
1400 area = isis_area_lookup (argv[0]);
1401 if (!area)
1402 {
1403 vty_out (vty, "Can't find ISIS instance %s%s",
1404 argv[0], VTY_NEWLINE);
1405 return CMD_ERR_NO_MATCH;
1406 }
1407
1408 circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
1409 if (!circuit)
1410 {
1411 vty_out (vty, "ISIS is not enabled on circuit %s%s",
1412 ifp->name, VTY_NEWLINE);
1413 return CMD_ERR_NO_MATCH;
1414 }
1415
1416 circuit->ipv6_router = 0;
1417 area->ipv6_circuits--;
1418 if (circuit->ip_router == 0)
1419 isis_csm_state_change (ISIS_DISABLE, circuit, area);
1420
1421 return CMD_SUCCESS;
1422}
1423#endif /* HAVE_IPV6 */
1424
1425DEFUN (isis_passive,
1426 isis_passive_cmd,
1427 "isis passive",
1428 "IS-IS commands\n"
1429 "Configure the passive mode for interface\n")
1430{
1431 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1432 if (!circuit)
1433 return CMD_ERR_NO_MATCH;
1434
1435 if (circuit->is_passive == 1)
1436 return CMD_SUCCESS;
1437
1438 if (circuit->state != C_STATE_UP)
1439 {
1440 circuit->is_passive = 1;
1441 }
1442 else
1443 {
1444 struct isis_area *area = circuit->area;
1445 isis_csm_state_change (ISIS_DISABLE, circuit, area);
1446 circuit->is_passive = 1;
1447 isis_csm_state_change (ISIS_ENABLE, circuit, area);
1448 }
1449
1450 return CMD_SUCCESS;
1451}
1452
1453DEFUN (no_isis_passive,
1454 no_isis_passive_cmd,
1455 "no isis passive",
1456 NO_STR
1457 "IS-IS commands\n"
1458 "Configure the passive mode for interface\n")
1459{
1460 struct interface *ifp;
1461 struct isis_circuit *circuit;
1462
1463 ifp = (struct interface *) vty->index;
1464 if (!ifp)
1465 {
1466 vty_out (vty, "Invalid interface %s", VTY_NEWLINE);
1467 return CMD_ERR_NO_MATCH;
1468 }
1469
1470 /* FIXME: what is wrong with circuit = ifp->info ? */
1471 circuit = circuit_scan_by_ifp (ifp);
1472 if (!circuit)
1473 {
1474 vty_out (vty, "ISIS is not enabled on circuit %s%s",
1475 ifp->name, VTY_NEWLINE);
1476 return CMD_ERR_NO_MATCH;
1477 }
1478
1479 if (if_is_loopback(ifp))
1480 {
1481 vty_out (vty, "Can't set no passive for loopback interface%s",
1482 VTY_NEWLINE);
1483 return CMD_ERR_AMBIGUOUS;
1484 }
1485
1486 if (circuit->is_passive == 0)
1487 return CMD_SUCCESS;
1488
1489 if (circuit->state != C_STATE_UP)
1490 {
1491 circuit->is_passive = 0;
1492 }
1493 else
1494 {
1495 struct isis_area *area = circuit->area;
1496 isis_csm_state_change (ISIS_DISABLE, circuit, area);
1497 circuit->is_passive = 0;
1498 isis_csm_state_change (ISIS_ENABLE, circuit, area);
1499 }
1500
1501 return CMD_SUCCESS;
1502}
1503
jardineb5d44e2003-12-23 08:09:43 +00001504DEFUN (isis_circuit_type,
1505 isis_circuit_type_cmd,
1506 "isis circuit-type (level-1|level-1-2|level-2-only)",
1507 "IS-IS commands\n"
1508 "Configure circuit type for interface\n"
1509 "Level-1 only adjacencies are formed\n"
1510 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +00001511 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +00001512{
Josh Bailey3f045a02012-03-24 08:35:20 -07001513 int circuit_type;
1514 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1515 if (!circuit)
1516 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001517
Josh Bailey3f045a02012-03-24 08:35:20 -07001518 circuit_type = string2circuit_t (argv[0]);
1519 if (!circuit_type)
hassof390d2c2004-09-10 20:48:21 +00001520 {
1521 vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
Josh Bailey3f045a02012-03-24 08:35:20 -07001522 return CMD_ERR_AMBIGUOUS;
hassof390d2c2004-09-10 20:48:21 +00001523 }
1524
Josh Bailey3f045a02012-03-24 08:35:20 -07001525 if (circuit->state == C_STATE_UP &&
1526 circuit->area->is_type != IS_LEVEL_1_AND_2 &&
1527 circuit->area->is_type != circuit_type)
hassof390d2c2004-09-10 20:48:21 +00001528 {
Josh Bailey3f045a02012-03-24 08:35:20 -07001529 vty_out (vty, "Invalid circuit level for area %s.%s",
1530 circuit->area->area_tag, VTY_NEWLINE);
1531 return CMD_ERR_AMBIGUOUS;
hassof390d2c2004-09-10 20:48:21 +00001532 }
Josh Bailey3f045a02012-03-24 08:35:20 -07001533 isis_event_circuit_type_change (circuit, circuit_type);
hassof390d2c2004-09-10 20:48:21 +00001534
jardineb5d44e2003-12-23 08:09:43 +00001535 return CMD_SUCCESS;
1536}
1537
1538DEFUN (no_isis_circuit_type,
1539 no_isis_circuit_type_cmd,
1540 "no isis circuit-type (level-1|level-1-2|level-2-only)",
1541 NO_STR
1542 "IS-IS commands\n"
1543 "Configure circuit type for interface\n"
1544 "Level-1 only adjacencies are formed\n"
1545 "Level-1-2 adjacencies are formed\n"
hassof390d2c2004-09-10 20:48:21 +00001546 "Level-2 only adjacencies are formed\n")
jardineb5d44e2003-12-23 08:09:43 +00001547{
Josh Bailey3f045a02012-03-24 08:35:20 -07001548 int circuit_type;
1549 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1550 if (!circuit)
1551 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001552
jardineb5d44e2003-12-23 08:09:43 +00001553 /*
Josh Bailey3f045a02012-03-24 08:35:20 -07001554 * Set the circuits level to its default value
jardineb5d44e2003-12-23 08:09:43 +00001555 */
Josh Bailey3f045a02012-03-24 08:35:20 -07001556 if (circuit->state == C_STATE_UP)
1557 circuit_type = circuit->area->is_type;
1558 else
1559 circuit_type = IS_LEVEL_1_AND_2;
1560 isis_event_circuit_type_change (circuit, circuit_type);
hassof390d2c2004-09-10 20:48:21 +00001561
jardineb5d44e2003-12-23 08:09:43 +00001562 return CMD_SUCCESS;
1563}
1564
Josh Bailey3f045a02012-03-24 08:35:20 -07001565DEFUN (isis_passwd_md5,
1566 isis_passwd_md5_cmd,
1567 "isis password md5 WORD",
jardineb5d44e2003-12-23 08:09:43 +00001568 "IS-IS commands\n"
Josh Bailey3f045a02012-03-24 08:35:20 -07001569 "Configure the authentication password for a circuit\n"
1570 "Authentication type\n"
1571 "Circuit password\n")
jardineb5d44e2003-12-23 08:09:43 +00001572{
jardineb5d44e2003-12-23 08:09:43 +00001573 int len;
Josh Bailey3f045a02012-03-24 08:35:20 -07001574 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1575 if (!circuit)
1576 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001577
jardineb5d44e2003-12-23 08:09:43 +00001578 len = strlen (argv[0]);
hassof390d2c2004-09-10 20:48:21 +00001579 if (len > 254)
1580 {
1581 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
Josh Bailey3f045a02012-03-24 08:35:20 -07001582 return CMD_ERR_AMBIGUOUS;
1583 }
1584 circuit->passwd.len = len;
1585 circuit->passwd.type = ISIS_PASSWD_TYPE_HMAC_MD5;
1586 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
1587
1588 return CMD_SUCCESS;
1589}
1590
1591DEFUN (isis_passwd_clear,
1592 isis_passwd_clear_cmd,
1593 "isis password clear WORD",
1594 "IS-IS commands\n"
1595 "Configure the authentication password for a circuit\n"
1596 "Authentication type\n"
1597 "Circuit password\n")
1598{
1599 int len;
1600 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1601 if (!circuit)
1602 return CMD_ERR_NO_MATCH;
1603
1604 len = strlen (argv[0]);
1605 if (len > 254)
1606 {
1607 vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
1608 return CMD_ERR_AMBIGUOUS;
hassof390d2c2004-09-10 20:48:21 +00001609 }
jardineb5d44e2003-12-23 08:09:43 +00001610 circuit->passwd.len = len;
1611 circuit->passwd.type = ISIS_PASSWD_TYPE_CLEARTXT;
hassof7c43dc2004-09-26 16:24:14 +00001612 strncpy ((char *)circuit->passwd.passwd, argv[0], 255);
hassof390d2c2004-09-10 20:48:21 +00001613
jardineb5d44e2003-12-23 08:09:43 +00001614 return CMD_SUCCESS;
1615}
1616
1617DEFUN (no_isis_passwd,
1618 no_isis_passwd_cmd,
1619 "no isis password",
1620 NO_STR
1621 "IS-IS commands\n"
Josh Bailey3f045a02012-03-24 08:35:20 -07001622 "Configure the authentication password for a circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001623{
Josh Bailey3f045a02012-03-24 08:35:20 -07001624 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1625 if (!circuit)
1626 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001627
jardineb5d44e2003-12-23 08:09:43 +00001628 memset (&circuit->passwd, 0, sizeof (struct isis_passwd));
hassof390d2c2004-09-10 20:48:21 +00001629
jardineb5d44e2003-12-23 08:09:43 +00001630 return CMD_SUCCESS;
1631}
1632
jardineb5d44e2003-12-23 08:09:43 +00001633DEFUN (isis_priority,
1634 isis_priority_cmd,
1635 "isis priority <0-127>",
1636 "IS-IS commands\n"
1637 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001638 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001639{
jardineb5d44e2003-12-23 08:09:43 +00001640 int prio;
Josh Bailey3f045a02012-03-24 08:35:20 -07001641 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1642 if (!circuit)
1643 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00001644
1645 prio = atoi (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07001646 if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
1647 {
1648 vty_out (vty, "Invalid priority %d - should be <0-127>%s",
1649 prio, VTY_NEWLINE);
1650 return CMD_ERR_AMBIGUOUS;
1651 }
jardineb5d44e2003-12-23 08:09:43 +00001652
Josh Bailey3f045a02012-03-24 08:35:20 -07001653 circuit->priority[0] = prio;
1654 circuit->priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001655
jardineb5d44e2003-12-23 08:09:43 +00001656 return CMD_SUCCESS;
1657}
1658
1659DEFUN (no_isis_priority,
1660 no_isis_priority_cmd,
1661 "no isis priority",
1662 NO_STR
1663 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001664 "Set priority for Designated Router election\n")
jardineb5d44e2003-12-23 08:09:43 +00001665{
Josh Bailey3f045a02012-03-24 08:35:20 -07001666 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1667 if (!circuit)
1668 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00001669
Josh Bailey3f045a02012-03-24 08:35:20 -07001670 circuit->priority[0] = DEFAULT_PRIORITY;
1671 circuit->priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001672
jardineb5d44e2003-12-23 08:09:43 +00001673 return CMD_SUCCESS;
1674}
1675
1676ALIAS (no_isis_priority,
1677 no_isis_priority_arg_cmd,
1678 "no isis priority <0-127>",
1679 NO_STR
1680 "IS-IS commands\n"
1681 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001682 "Priority value\n")
jardineb5d44e2003-12-23 08:09:43 +00001683
1684DEFUN (isis_priority_l1,
1685 isis_priority_l1_cmd,
hassof390d2c2004-09-10 20:48:21 +00001686 "isis priority <0-127> level-1",
jardineb5d44e2003-12-23 08:09:43 +00001687 "IS-IS commands\n"
1688 "Set priority for Designated Router election\n"
1689 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001690 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001691{
jardineb5d44e2003-12-23 08:09:43 +00001692 int prio;
Josh Bailey3f045a02012-03-24 08:35:20 -07001693 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1694 if (!circuit)
1695 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00001696
1697 prio = atoi (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07001698 if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
1699 {
1700 vty_out (vty, "Invalid priority %d - should be <0-127>%s",
1701 prio, VTY_NEWLINE);
1702 return CMD_ERR_AMBIGUOUS;
1703 }
jardineb5d44e2003-12-23 08:09:43 +00001704
Josh Bailey3f045a02012-03-24 08:35:20 -07001705 circuit->priority[0] = prio;
hassof390d2c2004-09-10 20:48:21 +00001706
jardineb5d44e2003-12-23 08:09:43 +00001707 return CMD_SUCCESS;
1708}
1709
1710DEFUN (no_isis_priority_l1,
1711 no_isis_priority_l1_cmd,
1712 "no isis priority level-1",
1713 NO_STR
1714 "IS-IS commands\n"
1715 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001716 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001717{
Josh Bailey3f045a02012-03-24 08:35:20 -07001718 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1719 if (!circuit)
1720 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001721
Josh Bailey3f045a02012-03-24 08:35:20 -07001722 circuit->priority[0] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001723
jardineb5d44e2003-12-23 08:09:43 +00001724 return CMD_SUCCESS;
1725}
1726
1727ALIAS (no_isis_priority_l1,
1728 no_isis_priority_l1_arg_cmd,
1729 "no isis priority <0-127> level-1",
1730 NO_STR
1731 "IS-IS commands\n"
1732 "Set priority for Designated Router election\n"
1733 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001734 "Specify priority for level-1 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001735
1736DEFUN (isis_priority_l2,
1737 isis_priority_l2_cmd,
hassof390d2c2004-09-10 20:48:21 +00001738 "isis priority <0-127> level-2",
jardineb5d44e2003-12-23 08:09:43 +00001739 "IS-IS commands\n"
1740 "Set priority for Designated Router election\n"
1741 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001742 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001743{
jardineb5d44e2003-12-23 08:09:43 +00001744 int prio;
Josh Bailey3f045a02012-03-24 08:35:20 -07001745 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1746 if (!circuit)
1747 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00001748
1749 prio = atoi (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07001750 if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
1751 {
1752 vty_out (vty, "Invalid priority %d - should be <0-127>%s",
1753 prio, VTY_NEWLINE);
1754 return CMD_ERR_AMBIGUOUS;
1755 }
jardineb5d44e2003-12-23 08:09:43 +00001756
Josh Bailey3f045a02012-03-24 08:35:20 -07001757 circuit->priority[1] = prio;
hassof390d2c2004-09-10 20:48:21 +00001758
jardineb5d44e2003-12-23 08:09:43 +00001759 return CMD_SUCCESS;
1760}
1761
1762DEFUN (no_isis_priority_l2,
1763 no_isis_priority_l2_cmd,
1764 "no isis priority level-2",
1765 NO_STR
1766 "IS-IS commands\n"
1767 "Set priority for Designated Router election\n"
hassof390d2c2004-09-10 20:48:21 +00001768 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001769{
Josh Bailey3f045a02012-03-24 08:35:20 -07001770 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1771 if (!circuit)
1772 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00001773
Josh Bailey3f045a02012-03-24 08:35:20 -07001774 circuit->priority[1] = DEFAULT_PRIORITY;
hassof390d2c2004-09-10 20:48:21 +00001775
jardineb5d44e2003-12-23 08:09:43 +00001776 return CMD_SUCCESS;
1777}
1778
1779ALIAS (no_isis_priority_l2,
1780 no_isis_priority_l2_arg_cmd,
1781 "no isis priority <0-127> level-2",
1782 NO_STR
1783 "IS-IS commands\n"
1784 "Set priority for Designated Router election\n"
1785 "Priority value\n"
hassof390d2c2004-09-10 20:48:21 +00001786 "Specify priority for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00001787
1788/* Metric command */
Josh Bailey3f045a02012-03-24 08:35:20 -07001789DEFUN (isis_metric,
jardineb5d44e2003-12-23 08:09:43 +00001790 isis_metric_cmd,
hassof21fb272005-09-26 17:05:55 +00001791 "isis metric <0-16777215>",
jardineb5d44e2003-12-23 08:09:43 +00001792 "IS-IS commands\n"
1793 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001794 "Default metric value\n")
jardineb5d44e2003-12-23 08:09:43 +00001795{
jardineb5d44e2003-12-23 08:09:43 +00001796 int met;
Josh Bailey3f045a02012-03-24 08:35:20 -07001797 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1798 if (!circuit)
1799 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00001800
1801 met = atoi (argv[0]);
1802
Josh Bailey3f045a02012-03-24 08:35:20 -07001803 /* RFC3787 section 5.1 */
1804 if (circuit->area && circuit->area->oldmetric == 1 &&
1805 met > MAX_NARROW_LINK_METRIC)
1806 {
1807 vty_out (vty, "Invalid metric %d - should be <0-63> "
1808 "when narrow metric type enabled%s",
1809 met, VTY_NEWLINE);
1810 return CMD_ERR_AMBIGUOUS;
1811 }
1812
1813 /* RFC4444 */
1814 if (circuit->area && circuit->area->newmetric == 1 &&
1815 met > MAX_WIDE_LINK_METRIC)
1816 {
1817 vty_out (vty, "Invalid metric %d - should be <0-16777215> "
1818 "when wide metric type enabled%s",
1819 met, VTY_NEWLINE);
1820 return CMD_ERR_AMBIGUOUS;
1821 }
1822
hassof21fb272005-09-26 17:05:55 +00001823 circuit->te_metric[0] = met;
1824 circuit->te_metric[1] = met;
1825
jardineb5d44e2003-12-23 08:09:43 +00001826 circuit->metrics[0].metric_default = met;
1827 circuit->metrics[1].metric_default = met;
1828
Josh Bailey3f045a02012-03-24 08:35:20 -07001829 if (circuit->area)
1830 lsp_regenerate_schedule (circuit->area, circuit->is_type, 0);
1831
jardineb5d44e2003-12-23 08:09:43 +00001832 return CMD_SUCCESS;
1833}
1834
1835DEFUN (no_isis_metric,
1836 no_isis_metric_cmd,
1837 "no isis metric",
1838 NO_STR
1839 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00001840 "Set default metric for circuit\n")
jardineb5d44e2003-12-23 08:09:43 +00001841{
Josh Bailey3f045a02012-03-24 08:35:20 -07001842 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1843 if (!circuit)
1844 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00001845
Josh Bailey3f045a02012-03-24 08:35:20 -07001846 circuit->te_metric[0] = DEFAULT_CIRCUIT_METRIC;
1847 circuit->te_metric[1] = DEFAULT_CIRCUIT_METRIC;
1848 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRIC;
1849 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRIC;
jardineb5d44e2003-12-23 08:09:43 +00001850
Josh Bailey3f045a02012-03-24 08:35:20 -07001851 if (circuit->area)
1852 lsp_regenerate_schedule (circuit->area, circuit->is_type, 0);
jardineb5d44e2003-12-23 08:09:43 +00001853
1854 return CMD_SUCCESS;
1855}
1856
1857ALIAS (no_isis_metric,
1858 no_isis_metric_arg_cmd,
hassof21fb272005-09-26 17:05:55 +00001859 "no isis metric <0-16777215>",
jardineb5d44e2003-12-23 08:09:43 +00001860 NO_STR
1861 "IS-IS commands\n"
1862 "Set default metric for circuit\n"
hassof390d2c2004-09-10 20:48:21 +00001863 "Default metric value\n")
1864
Josh Bailey3f045a02012-03-24 08:35:20 -07001865DEFUN (isis_metric_l1,
1866 isis_metric_l1_cmd,
1867 "isis metric <0-16777215> level-1",
1868 "IS-IS commands\n"
1869 "Set default metric for circuit\n"
1870 "Default metric value\n"
1871 "Specify metric for level-1 routing\n")
1872{
1873 int met;
1874 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1875 if (!circuit)
1876 return CMD_ERR_NO_MATCH;
1877
1878 met = atoi (argv[0]);
1879
1880 /* RFC3787 section 5.1 */
1881 if (circuit->area && circuit->area->oldmetric == 1 &&
1882 met > MAX_NARROW_LINK_METRIC)
1883 {
1884 vty_out (vty, "Invalid metric %d - should be <0-63> "
1885 "when narrow metric type enabled%s",
1886 met, VTY_NEWLINE);
1887 return CMD_ERR_AMBIGUOUS;
1888 }
1889
1890 /* RFC4444 */
1891 if (circuit->area && circuit->area->newmetric == 1 &&
1892 met > MAX_WIDE_LINK_METRIC)
1893 {
1894 vty_out (vty, "Invalid metric %d - should be <0-16777215> "
1895 "when wide metric type enabled%s",
1896 met, VTY_NEWLINE);
1897 return CMD_ERR_AMBIGUOUS;
1898 }
1899
1900 circuit->te_metric[0] = met;
1901 circuit->metrics[0].metric_default = met;
1902
1903 if (circuit->area)
1904 lsp_regenerate_schedule (circuit->area, IS_LEVEL_1, 0);
1905
1906 return CMD_SUCCESS;
1907}
1908
1909DEFUN (no_isis_metric_l1,
1910 no_isis_metric_l1_cmd,
1911 "no isis metric level-1",
1912 NO_STR
1913 "IS-IS commands\n"
1914 "Set default metric for circuit\n"
1915 "Specify metric for level-1 routing\n")
1916{
1917 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1918 if (!circuit)
1919 return CMD_ERR_NO_MATCH;
1920
1921 circuit->te_metric[0] = DEFAULT_CIRCUIT_METRIC;
1922 circuit->metrics[0].metric_default = DEFAULT_CIRCUIT_METRIC;
1923
1924 if (circuit->area)
1925 lsp_regenerate_schedule (circuit->area, IS_LEVEL_1, 0);
1926
1927 return CMD_SUCCESS;
1928}
1929
1930ALIAS (no_isis_metric_l1,
1931 no_isis_metric_l1_arg_cmd,
1932 "no isis metric <0-16777215> level-1",
1933 NO_STR
1934 "IS-IS commands\n"
1935 "Set default metric for circuit\n"
1936 "Default metric value\n"
1937 "Specify metric for level-1 routing\n")
1938
1939DEFUN (isis_metric_l2,
1940 isis_metric_l2_cmd,
1941 "isis metric <0-16777215> level-2",
1942 "IS-IS commands\n"
1943 "Set default metric for circuit\n"
1944 "Default metric value\n"
1945 "Specify metric for level-2 routing\n")
1946{
1947 int met;
1948 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1949 if (!circuit)
1950 return CMD_ERR_NO_MATCH;
1951
1952 met = atoi (argv[0]);
1953
1954 /* RFC3787 section 5.1 */
1955 if (circuit->area && circuit->area->oldmetric == 1 &&
1956 met > MAX_NARROW_LINK_METRIC)
1957 {
1958 vty_out (vty, "Invalid metric %d - should be <0-63> "
1959 "when narrow metric type enabled%s",
1960 met, VTY_NEWLINE);
1961 return CMD_ERR_AMBIGUOUS;
1962 }
1963
1964 /* RFC4444 */
1965 if (circuit->area && circuit->area->newmetric == 1 &&
1966 met > MAX_WIDE_LINK_METRIC)
1967 {
1968 vty_out (vty, "Invalid metric %d - should be <0-16777215> "
1969 "when wide metric type enabled%s",
1970 met, VTY_NEWLINE);
1971 return CMD_ERR_AMBIGUOUS;
1972 }
1973
1974 circuit->te_metric[1] = met;
1975 circuit->metrics[1].metric_default = met;
1976
1977 if (circuit->area)
1978 lsp_regenerate_schedule (circuit->area, IS_LEVEL_2, 0);
1979
1980 return CMD_SUCCESS;
1981}
1982
1983DEFUN (no_isis_metric_l2,
1984 no_isis_metric_l2_cmd,
1985 "no isis metric level-2",
1986 NO_STR
1987 "IS-IS commands\n"
1988 "Set default metric for circuit\n"
1989 "Specify metric for level-2 routing\n")
1990{
1991 struct isis_circuit *circuit = isis_circuit_lookup (vty);
1992 if (!circuit)
1993 return CMD_ERR_NO_MATCH;
1994
1995 circuit->te_metric[1] = DEFAULT_CIRCUIT_METRIC;
1996 circuit->metrics[1].metric_default = DEFAULT_CIRCUIT_METRIC;
1997
1998 if (circuit->area)
1999 lsp_regenerate_schedule (circuit->area, IS_LEVEL_2, 0);
2000
2001 return CMD_SUCCESS;
2002}
2003
2004ALIAS (no_isis_metric_l2,
2005 no_isis_metric_l2_arg_cmd,
2006 "no isis metric <0-16777215> level-2",
2007 NO_STR
2008 "IS-IS commands\n"
2009 "Set default metric for circuit\n"
2010 "Default metric value\n"
2011 "Specify metric for level-2 routing\n")
jardineb5d44e2003-12-23 08:09:43 +00002012/* end of metrics */
Josh Bailey3f045a02012-03-24 08:35:20 -07002013
hassof21fb272005-09-26 17:05:55 +00002014DEFUN (isis_hello_interval,
jardineb5d44e2003-12-23 08:09:43 +00002015 isis_hello_interval_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002016 "isis hello-interval <1-600>",
jardineb5d44e2003-12-23 08:09:43 +00002017 "IS-IS commands\n"
2018 "Set Hello interval\n"
2019 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00002020 "Holdtime 1 seconds, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00002021{
jardineb5d44e2003-12-23 08:09:43 +00002022 int interval;
Josh Bailey3f045a02012-03-24 08:35:20 -07002023 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2024 if (!circuit)
2025 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002026
Josh Bailey3f045a02012-03-24 08:35:20 -07002027 interval = atoi (argv[0]);
2028 if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
hassof390d2c2004-09-10 20:48:21 +00002029 {
Josh Bailey3f045a02012-03-24 08:35:20 -07002030 vty_out (vty, "Invalid hello-interval %d - should be <1-600>%s",
2031 interval, VTY_NEWLINE);
2032 return CMD_ERR_AMBIGUOUS;
hassof390d2c2004-09-10 20:48:21 +00002033 }
jardineb5d44e2003-12-23 08:09:43 +00002034
hassof390d2c2004-09-10 20:48:21 +00002035 circuit->hello_interval[0] = (u_int16_t) interval;
2036 circuit->hello_interval[1] = (u_int16_t) interval;
2037
jardineb5d44e2003-12-23 08:09:43 +00002038 return CMD_SUCCESS;
2039}
2040
2041DEFUN (no_isis_hello_interval,
2042 no_isis_hello_interval_cmd,
2043 "no isis hello-interval",
2044 NO_STR
2045 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00002046 "Set Hello interval\n")
jardineb5d44e2003-12-23 08:09:43 +00002047{
Josh Bailey3f045a02012-03-24 08:35:20 -07002048 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2049 if (!circuit)
2050 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002051
Josh Bailey3f045a02012-03-24 08:35:20 -07002052 circuit->hello_interval[0] = DEFAULT_HELLO_INTERVAL;
2053 circuit->hello_interval[1] = DEFAULT_HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00002054
jardineb5d44e2003-12-23 08:09:43 +00002055 return CMD_SUCCESS;
2056}
2057
2058ALIAS (no_isis_hello_interval,
2059 no_isis_hello_interval_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002060 "no isis hello-interval <1-600>",
jardineb5d44e2003-12-23 08:09:43 +00002061 NO_STR
2062 "IS-IS commands\n"
2063 "Set Hello interval\n"
2064 "Hello interval value\n"
hassof390d2c2004-09-10 20:48:21 +00002065 "Holdtime 1 second, interval depends on multiplier\n")
jardineb5d44e2003-12-23 08:09:43 +00002066
2067DEFUN (isis_hello_interval_l1,
2068 isis_hello_interval_l1_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002069 "isis hello-interval <1-600> level-1",
jardineb5d44e2003-12-23 08:09:43 +00002070 "IS-IS commands\n"
2071 "Set Hello interval\n"
2072 "Hello interval value\n"
2073 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00002074 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002075{
jardineb5d44e2003-12-23 08:09:43 +00002076 long interval;
Josh Bailey3f045a02012-03-24 08:35:20 -07002077 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2078 if (!circuit)
2079 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002080
Josh Bailey3f045a02012-03-24 08:35:20 -07002081 interval = atoi (argv[0]);
2082 if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
hassof390d2c2004-09-10 20:48:21 +00002083 {
Josh Bailey3f045a02012-03-24 08:35:20 -07002084 vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s",
2085 interval, VTY_NEWLINE);
2086 return CMD_ERR_AMBIGUOUS;
hassof390d2c2004-09-10 20:48:21 +00002087 }
jardineb5d44e2003-12-23 08:09:43 +00002088
hassof390d2c2004-09-10 20:48:21 +00002089 circuit->hello_interval[0] = (u_int16_t) interval;
2090
jardineb5d44e2003-12-23 08:09:43 +00002091 return CMD_SUCCESS;
2092}
2093
2094DEFUN (no_isis_hello_interval_l1,
2095 no_isis_hello_interval_l1_cmd,
2096 "no isis hello-interval level-1",
2097 NO_STR
2098 "IS-IS commands\n"
2099 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00002100 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002101{
Josh Bailey3f045a02012-03-24 08:35:20 -07002102 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2103 if (!circuit)
2104 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002105
Josh Bailey3f045a02012-03-24 08:35:20 -07002106 circuit->hello_interval[0] = DEFAULT_HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00002107
jardineb5d44e2003-12-23 08:09:43 +00002108 return CMD_SUCCESS;
2109}
2110
2111ALIAS (no_isis_hello_interval_l1,
2112 no_isis_hello_interval_l1_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002113 "no isis hello-interval <1-600> level-1",
jardineb5d44e2003-12-23 08:09:43 +00002114 NO_STR
2115 "IS-IS commands\n"
2116 "Set Hello interval\n"
2117 "Hello interval value\n"
2118 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00002119 "Specify hello-interval for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002120
2121DEFUN (isis_hello_interval_l2,
2122 isis_hello_interval_l2_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002123 "isis hello-interval <1-600> level-2",
jardineb5d44e2003-12-23 08:09:43 +00002124 "IS-IS commands\n"
2125 "Set Hello interval\n"
2126 "Hello interval value\n"
2127 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00002128 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002129{
jardineb5d44e2003-12-23 08:09:43 +00002130 long interval;
Josh Bailey3f045a02012-03-24 08:35:20 -07002131 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2132 if (!circuit)
2133 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002134
Josh Bailey3f045a02012-03-24 08:35:20 -07002135 interval = atoi (argv[0]);
2136 if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
hassof390d2c2004-09-10 20:48:21 +00002137 {
Josh Bailey3f045a02012-03-24 08:35:20 -07002138 vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s",
2139 interval, VTY_NEWLINE);
2140 return CMD_ERR_AMBIGUOUS;
hassof390d2c2004-09-10 20:48:21 +00002141 }
jardineb5d44e2003-12-23 08:09:43 +00002142
hassof390d2c2004-09-10 20:48:21 +00002143 circuit->hello_interval[1] = (u_int16_t) interval;
2144
jardineb5d44e2003-12-23 08:09:43 +00002145 return CMD_SUCCESS;
2146}
2147
2148DEFUN (no_isis_hello_interval_l2,
2149 no_isis_hello_interval_l2_cmd,
2150 "no isis hello-interval level-2",
2151 NO_STR
2152 "IS-IS commands\n"
2153 "Set Hello interval\n"
hassof390d2c2004-09-10 20:48:21 +00002154 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002155{
Josh Bailey3f045a02012-03-24 08:35:20 -07002156 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2157 if (!circuit)
2158 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002159
Josh Bailey3f045a02012-03-24 08:35:20 -07002160 circuit->hello_interval[1] = DEFAULT_HELLO_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00002161
jardineb5d44e2003-12-23 08:09:43 +00002162 return CMD_SUCCESS;
2163}
2164
2165ALIAS (no_isis_hello_interval_l2,
2166 no_isis_hello_interval_l2_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002167 "no isis hello-interval <1-600> level-2",
jardineb5d44e2003-12-23 08:09:43 +00002168 NO_STR
2169 "IS-IS commands\n"
2170 "Set Hello interval\n"
2171 "Hello interval value\n"
2172 "Holdtime 1 second, interval depends on multiplier\n"
hassof390d2c2004-09-10 20:48:21 +00002173 "Specify hello-interval for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002174
2175DEFUN (isis_hello_multiplier,
2176 isis_hello_multiplier_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002177 "isis hello-multiplier <2-100>",
jardineb5d44e2003-12-23 08:09:43 +00002178 "IS-IS commands\n"
2179 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00002180 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00002181{
jardineb5d44e2003-12-23 08:09:43 +00002182 int mult;
Josh Bailey3f045a02012-03-24 08:35:20 -07002183 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2184 if (!circuit)
2185 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002186
2187 mult = atoi (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07002188 if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
2189 {
2190 vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
2191 mult, VTY_NEWLINE);
2192 return CMD_ERR_AMBIGUOUS;
2193 }
jardineb5d44e2003-12-23 08:09:43 +00002194
hassof390d2c2004-09-10 20:48:21 +00002195 circuit->hello_multiplier[0] = (u_int16_t) mult;
2196 circuit->hello_multiplier[1] = (u_int16_t) mult;
2197
jardineb5d44e2003-12-23 08:09:43 +00002198 return CMD_SUCCESS;
2199}
2200
2201DEFUN (no_isis_hello_multiplier,
2202 no_isis_hello_multiplier_cmd,
2203 "no isis hello-multiplier",
2204 NO_STR
2205 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00002206 "Set multiplier for Hello holding time\n")
jardineb5d44e2003-12-23 08:09:43 +00002207{
Josh Bailey3f045a02012-03-24 08:35:20 -07002208 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2209 if (!circuit)
2210 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002211
Josh Bailey3f045a02012-03-24 08:35:20 -07002212 circuit->hello_multiplier[0] = DEFAULT_HELLO_MULTIPLIER;
2213 circuit->hello_multiplier[1] = DEFAULT_HELLO_MULTIPLIER;
jardineb5d44e2003-12-23 08:09:43 +00002214
2215 return CMD_SUCCESS;
2216}
2217
2218ALIAS (no_isis_hello_multiplier,
2219 no_isis_hello_multiplier_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002220 "no isis hello-multiplier <2-100>",
jardineb5d44e2003-12-23 08:09:43 +00002221 NO_STR
2222 "IS-IS commands\n"
2223 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00002224 "Hello multiplier value\n")
jardineb5d44e2003-12-23 08:09:43 +00002225
2226DEFUN (isis_hello_multiplier_l1,
2227 isis_hello_multiplier_l1_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002228 "isis hello-multiplier <2-100> level-1",
jardineb5d44e2003-12-23 08:09:43 +00002229 "IS-IS commands\n"
2230 "Set multiplier for Hello holding time\n"
2231 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00002232 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002233{
jardineb5d44e2003-12-23 08:09:43 +00002234 int mult;
Josh Bailey3f045a02012-03-24 08:35:20 -07002235 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2236 if (!circuit)
2237 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002238
2239 mult = atoi (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07002240 if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
2241 {
2242 vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
2243 mult, VTY_NEWLINE);
2244 return CMD_ERR_AMBIGUOUS;
2245 }
jardineb5d44e2003-12-23 08:09:43 +00002246
hassof390d2c2004-09-10 20:48:21 +00002247 circuit->hello_multiplier[0] = (u_int16_t) mult;
2248
jardineb5d44e2003-12-23 08:09:43 +00002249 return CMD_SUCCESS;
2250}
2251
2252DEFUN (no_isis_hello_multiplier_l1,
2253 no_isis_hello_multiplier_l1_cmd,
2254 "no isis hello-multiplier level-1",
2255 NO_STR
2256 "IS-IS commands\n"
2257 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00002258 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002259{
Josh Bailey3f045a02012-03-24 08:35:20 -07002260 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2261 if (!circuit)
2262 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002263
Josh Bailey3f045a02012-03-24 08:35:20 -07002264 circuit->hello_multiplier[0] = DEFAULT_HELLO_MULTIPLIER;
jardineb5d44e2003-12-23 08:09:43 +00002265
2266 return CMD_SUCCESS;
2267}
2268
2269ALIAS (no_isis_hello_multiplier_l1,
2270 no_isis_hello_multiplier_l1_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002271 "no isis hello-multiplier <2-100> level-1",
jardineb5d44e2003-12-23 08:09:43 +00002272 NO_STR
2273 "IS-IS commands\n"
2274 "Set multiplier for Hello holding time\n"
2275 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00002276 "Specify hello multiplier for level-1 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002277
2278DEFUN (isis_hello_multiplier_l2,
2279 isis_hello_multiplier_l2_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002280 "isis hello-multiplier <2-100> level-2",
jardineb5d44e2003-12-23 08:09:43 +00002281 "IS-IS commands\n"
2282 "Set multiplier for Hello holding time\n"
2283 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00002284 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002285{
jardineb5d44e2003-12-23 08:09:43 +00002286 int mult;
Josh Bailey3f045a02012-03-24 08:35:20 -07002287 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2288 if (!circuit)
2289 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002290
2291 mult = atoi (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07002292 if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
2293 {
2294 vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
2295 mult, VTY_NEWLINE);
2296 return CMD_ERR_AMBIGUOUS;
2297 }
jardineb5d44e2003-12-23 08:09:43 +00002298
hassof390d2c2004-09-10 20:48:21 +00002299 circuit->hello_multiplier[1] = (u_int16_t) mult;
2300
jardineb5d44e2003-12-23 08:09:43 +00002301 return CMD_SUCCESS;
2302}
2303
2304DEFUN (no_isis_hello_multiplier_l2,
2305 no_isis_hello_multiplier_l2_cmd,
2306 "no isis hello-multiplier level-2",
2307 NO_STR
2308 "IS-IS commands\n"
2309 "Set multiplier for Hello holding time\n"
hassof390d2c2004-09-10 20:48:21 +00002310 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002311{
Josh Bailey3f045a02012-03-24 08:35:20 -07002312 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2313 if (!circuit)
2314 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002315
Josh Bailey3f045a02012-03-24 08:35:20 -07002316 circuit->hello_multiplier[1] = DEFAULT_HELLO_MULTIPLIER;
jardineb5d44e2003-12-23 08:09:43 +00002317
2318 return CMD_SUCCESS;
2319}
2320
2321ALIAS (no_isis_hello_multiplier_l2,
2322 no_isis_hello_multiplier_l2_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002323 "no isis hello-multiplier <2-100> level-2",
jardineb5d44e2003-12-23 08:09:43 +00002324 NO_STR
2325 "IS-IS commands\n"
2326 "Set multiplier for Hello holding time\n"
2327 "Hello multiplier value\n"
hassof390d2c2004-09-10 20:48:21 +00002328 "Specify hello multiplier for level-2 IIHs\n")
jardineb5d44e2003-12-23 08:09:43 +00002329
Josh Bailey3f045a02012-03-24 08:35:20 -07002330DEFUN (isis_hello_padding,
2331 isis_hello_padding_cmd,
jardineb5d44e2003-12-23 08:09:43 +00002332 "isis hello padding",
2333 "IS-IS commands\n"
2334 "Add padding to IS-IS hello packets\n"
2335 "Pad hello packets\n"
2336 "<cr>\n")
2337{
Josh Bailey3f045a02012-03-24 08:35:20 -07002338 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2339 if (!circuit)
2340 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002341
Josh Bailey3f045a02012-03-24 08:35:20 -07002342 circuit->pad_hellos = 1;
hassof390d2c2004-09-10 20:48:21 +00002343
jardineb5d44e2003-12-23 08:09:43 +00002344 return CMD_SUCCESS;
2345}
2346
Josh Bailey3f045a02012-03-24 08:35:20 -07002347DEFUN (no_isis_hello_padding,
2348 no_isis_hello_padding_cmd,
jardineb5d44e2003-12-23 08:09:43 +00002349 "no isis hello padding",
2350 NO_STR
2351 "IS-IS commands\n"
2352 "Add padding to IS-IS hello packets\n"
2353 "Pad hello packets\n"
2354 "<cr>\n")
2355{
Josh Bailey3f045a02012-03-24 08:35:20 -07002356 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2357 if (!circuit)
2358 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002359
Josh Bailey3f045a02012-03-24 08:35:20 -07002360 circuit->pad_hellos = 0;
hassof390d2c2004-09-10 20:48:21 +00002361
jardineb5d44e2003-12-23 08:09:43 +00002362 return CMD_SUCCESS;
2363}
2364
2365DEFUN (csnp_interval,
2366 csnp_interval_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002367 "isis csnp-interval <1-600>",
jardineb5d44e2003-12-23 08:09:43 +00002368 "IS-IS commands\n"
2369 "Set CSNP interval in seconds\n"
2370 "CSNP interval value\n")
2371{
jardineb5d44e2003-12-23 08:09:43 +00002372 unsigned long interval;
Josh Bailey3f045a02012-03-24 08:35:20 -07002373 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2374 if (!circuit)
2375 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002376
jardineb5d44e2003-12-23 08:09:43 +00002377 interval = atol (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07002378 if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
2379 {
2380 vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
2381 interval, VTY_NEWLINE);
2382 return CMD_ERR_AMBIGUOUS;
2383 }
jardineb5d44e2003-12-23 08:09:43 +00002384
hassof390d2c2004-09-10 20:48:21 +00002385 circuit->csnp_interval[0] = (u_int16_t) interval;
2386 circuit->csnp_interval[1] = (u_int16_t) interval;
2387
jardineb5d44e2003-12-23 08:09:43 +00002388 return CMD_SUCCESS;
2389}
2390
2391DEFUN (no_csnp_interval,
2392 no_csnp_interval_cmd,
2393 "no isis csnp-interval",
2394 NO_STR
2395 "IS-IS commands\n"
hassof390d2c2004-09-10 20:48:21 +00002396 "Set CSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00002397{
Josh Bailey3f045a02012-03-24 08:35:20 -07002398 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2399 if (!circuit)
2400 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002401
Josh Bailey3f045a02012-03-24 08:35:20 -07002402 circuit->csnp_interval[0] = DEFAULT_CSNP_INTERVAL;
2403 circuit->csnp_interval[1] = DEFAULT_CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00002404
jardineb5d44e2003-12-23 08:09:43 +00002405 return CMD_SUCCESS;
2406}
2407
2408ALIAS (no_csnp_interval,
2409 no_csnp_interval_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002410 "no isis csnp-interval <1-600>",
jardineb5d44e2003-12-23 08:09:43 +00002411 NO_STR
2412 "IS-IS commands\n"
2413 "Set CSNP interval in seconds\n"
2414 "CSNP interval value\n")
2415
jardineb5d44e2003-12-23 08:09:43 +00002416DEFUN (csnp_interval_l1,
2417 csnp_interval_l1_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002418 "isis csnp-interval <1-600> level-1",
jardineb5d44e2003-12-23 08:09:43 +00002419 "IS-IS commands\n"
2420 "Set CSNP interval in seconds\n"
2421 "CSNP interval value\n"
2422 "Specify interval for level-1 CSNPs\n")
2423{
jardineb5d44e2003-12-23 08:09:43 +00002424 unsigned long interval;
Josh Bailey3f045a02012-03-24 08:35:20 -07002425 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2426 if (!circuit)
2427 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002428
jardineb5d44e2003-12-23 08:09:43 +00002429 interval = atol (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07002430 if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
2431 {
2432 vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
2433 interval, VTY_NEWLINE);
2434 return CMD_ERR_AMBIGUOUS;
2435 }
hassof390d2c2004-09-10 20:48:21 +00002436
2437 circuit->csnp_interval[0] = (u_int16_t) interval;
2438
jardineb5d44e2003-12-23 08:09:43 +00002439 return CMD_SUCCESS;
2440}
2441
2442DEFUN (no_csnp_interval_l1,
2443 no_csnp_interval_l1_cmd,
2444 "no isis csnp-interval level-1",
2445 NO_STR
2446 "IS-IS commands\n"
2447 "Set CSNP interval in seconds\n"
2448 "Specify interval for level-1 CSNPs\n")
2449{
Josh Bailey3f045a02012-03-24 08:35:20 -07002450 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2451 if (!circuit)
2452 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002453
Josh Bailey3f045a02012-03-24 08:35:20 -07002454 circuit->csnp_interval[0] = DEFAULT_CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00002455
jardineb5d44e2003-12-23 08:09:43 +00002456 return CMD_SUCCESS;
2457}
2458
2459ALIAS (no_csnp_interval_l1,
2460 no_csnp_interval_l1_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002461 "no isis csnp-interval <1-600> level-1",
jardineb5d44e2003-12-23 08:09:43 +00002462 NO_STR
2463 "IS-IS commands\n"
2464 "Set CSNP interval in seconds\n"
2465 "CSNP interval value\n"
2466 "Specify interval for level-1 CSNPs\n")
2467
jardineb5d44e2003-12-23 08:09:43 +00002468DEFUN (csnp_interval_l2,
2469 csnp_interval_l2_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002470 "isis csnp-interval <1-600> level-2",
jardineb5d44e2003-12-23 08:09:43 +00002471 "IS-IS commands\n"
2472 "Set CSNP interval in seconds\n"
2473 "CSNP interval value\n"
2474 "Specify interval for level-2 CSNPs\n")
2475{
jardineb5d44e2003-12-23 08:09:43 +00002476 unsigned long interval;
Josh Bailey3f045a02012-03-24 08:35:20 -07002477 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2478 if (!circuit)
2479 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002480
jardineb5d44e2003-12-23 08:09:43 +00002481 interval = atol (argv[0]);
Josh Bailey3f045a02012-03-24 08:35:20 -07002482 if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
2483 {
2484 vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
2485 interval, VTY_NEWLINE);
2486 return CMD_ERR_AMBIGUOUS;
2487 }
hassof390d2c2004-09-10 20:48:21 +00002488
2489 circuit->csnp_interval[1] = (u_int16_t) interval;
2490
jardineb5d44e2003-12-23 08:09:43 +00002491 return CMD_SUCCESS;
2492}
2493
2494DEFUN (no_csnp_interval_l2,
2495 no_csnp_interval_l2_cmd,
2496 "no isis csnp-interval level-2",
2497 NO_STR
2498 "IS-IS commands\n"
2499 "Set CSNP interval in seconds\n"
2500 "Specify interval for level-2 CSNPs\n")
2501{
Josh Bailey3f045a02012-03-24 08:35:20 -07002502 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2503 if (!circuit)
2504 return CMD_ERR_NO_MATCH;
jardineb5d44e2003-12-23 08:09:43 +00002505
Josh Bailey3f045a02012-03-24 08:35:20 -07002506 circuit->csnp_interval[1] = DEFAULT_CSNP_INTERVAL;
hassof390d2c2004-09-10 20:48:21 +00002507
jardineb5d44e2003-12-23 08:09:43 +00002508 return CMD_SUCCESS;
2509}
2510
2511ALIAS (no_csnp_interval_l2,
2512 no_csnp_interval_l2_arg_cmd,
Josh Bailey3f045a02012-03-24 08:35:20 -07002513 "no isis csnp-interval <1-600> level-2",
jardineb5d44e2003-12-23 08:09:43 +00002514 NO_STR
2515 "IS-IS commands\n"
2516 "Set CSNP interval in seconds\n"
2517 "CSNP interval value\n"
2518 "Specify interval for level-2 CSNPs\n")
2519
Josh Bailey3f045a02012-03-24 08:35:20 -07002520DEFUN (psnp_interval,
2521 psnp_interval_cmd,
2522 "isis psnp-interval <1-120>",
2523 "IS-IS commands\n"
2524 "Set PSNP interval in seconds\n"
2525 "PSNP interval value\n")
jardineb5d44e2003-12-23 08:09:43 +00002526{
Josh Bailey3f045a02012-03-24 08:35:20 -07002527 unsigned long interval;
2528 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2529 if (!circuit)
2530 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002531
Josh Bailey3f045a02012-03-24 08:35:20 -07002532 interval = atol (argv[0]);
2533 if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
hassof390d2c2004-09-10 20:48:21 +00002534 {
Josh Bailey3f045a02012-03-24 08:35:20 -07002535 vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
2536 interval, VTY_NEWLINE);
2537 return CMD_ERR_AMBIGUOUS;
jardineb5d44e2003-12-23 08:09:43 +00002538 }
jardineb5d44e2003-12-23 08:09:43 +00002539
Josh Bailey3f045a02012-03-24 08:35:20 -07002540 circuit->psnp_interval[0] = (u_int16_t) interval;
2541 circuit->psnp_interval[1] = (u_int16_t) interval;
jardineb5d44e2003-12-23 08:09:43 +00002542
2543 return CMD_SUCCESS;
2544}
2545
Josh Bailey3f045a02012-03-24 08:35:20 -07002546DEFUN (no_psnp_interval,
2547 no_psnp_interval_cmd,
2548 "no isis psnp-interval",
jardineb5d44e2003-12-23 08:09:43 +00002549 NO_STR
Josh Bailey3f045a02012-03-24 08:35:20 -07002550 "IS-IS commands\n"
2551 "Set PSNP interval in seconds\n")
jardineb5d44e2003-12-23 08:09:43 +00002552{
Josh Bailey3f045a02012-03-24 08:35:20 -07002553 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2554 if (!circuit)
2555 return CMD_ERR_NO_MATCH;
hassof390d2c2004-09-10 20:48:21 +00002556
Josh Bailey3f045a02012-03-24 08:35:20 -07002557 circuit->psnp_interval[0] = DEFAULT_PSNP_INTERVAL;
2558 circuit->psnp_interval[1] = DEFAULT_PSNP_INTERVAL;
jardineb5d44e2003-12-23 08:09:43 +00002559
2560 return CMD_SUCCESS;
2561}
jardineb5d44e2003-12-23 08:09:43 +00002562
Josh Bailey3f045a02012-03-24 08:35:20 -07002563ALIAS (no_psnp_interval,
2564 no_psnp_interval_arg_cmd,
2565 "no isis psnp-interval <1-120>",
2566 NO_STR
2567 "IS-IS commands\n"
2568 "Set PSNP interval in seconds\n"
2569 "PSNP interval value\n")
2570
2571DEFUN (psnp_interval_l1,
2572 psnp_interval_l1_cmd,
2573 "isis psnp-interval <1-120> level-1",
2574 "IS-IS commands\n"
2575 "Set PSNP interval in seconds\n"
2576 "PSNP interval value\n"
2577 "Specify interval for level-1 PSNPs\n")
2578{
2579 unsigned long interval;
2580 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2581 if (!circuit)
2582 return CMD_ERR_NO_MATCH;
2583
2584 interval = atol (argv[0]);
2585 if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
2586 {
2587 vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
2588 interval, VTY_NEWLINE);
2589 return CMD_ERR_AMBIGUOUS;
2590 }
2591
2592 circuit->psnp_interval[0] = (u_int16_t) interval;
2593
2594 return CMD_SUCCESS;
2595}
2596
2597DEFUN (no_psnp_interval_l1,
2598 no_psnp_interval_l1_cmd,
2599 "no isis psnp-interval level-1",
2600 NO_STR
2601 "IS-IS commands\n"
2602 "Set PSNP interval in seconds\n"
2603 "Specify interval for level-1 PSNPs\n")
2604{
2605 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2606 if (!circuit)
2607 return CMD_ERR_NO_MATCH;
2608
2609 circuit->psnp_interval[0] = DEFAULT_PSNP_INTERVAL;
2610
2611 return CMD_SUCCESS;
2612}
2613
2614ALIAS (no_psnp_interval_l1,
2615 no_psnp_interval_l1_arg_cmd,
2616 "no isis psnp-interval <1-120> level-1",
2617 NO_STR
2618 "IS-IS commands\n"
2619 "Set PSNP interval in seconds\n"
2620 "PSNP interval value\n"
2621 "Specify interval for level-1 PSNPs\n")
2622
2623DEFUN (psnp_interval_l2,
2624 psnp_interval_l2_cmd,
2625 "isis psnp-interval <1-120> level-2",
2626 "IS-IS commands\n"
2627 "Set PSNP interval in seconds\n"
2628 "PSNP interval value\n"
2629 "Specify interval for level-2 PSNPs\n")
2630{
2631 unsigned long interval;
2632 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2633 if (!circuit)
2634 return CMD_ERR_NO_MATCH;
2635
2636 interval = atol (argv[0]);
2637 if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
2638 {
2639 vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
2640 interval, VTY_NEWLINE);
2641 return CMD_ERR_AMBIGUOUS;
2642 }
2643
2644 circuit->psnp_interval[1] = (u_int16_t) interval;
2645
2646 return CMD_SUCCESS;
2647}
2648
2649DEFUN (no_psnp_interval_l2,
2650 no_psnp_interval_l2_cmd,
2651 "no isis psnp-interval level-2",
2652 NO_STR
2653 "IS-IS commands\n"
2654 "Set PSNP interval in seconds\n"
2655 "Specify interval for level-2 PSNPs\n")
2656{
2657 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2658 if (!circuit)
2659 return CMD_ERR_NO_MATCH;
2660
2661 circuit->psnp_interval[1] = DEFAULT_PSNP_INTERVAL;
2662
2663 return CMD_SUCCESS;
2664}
2665
2666ALIAS (no_psnp_interval_l2,
2667 no_psnp_interval_l2_arg_cmd,
2668 "no isis psnp-interval <1-120> level-2",
2669 NO_STR
2670 "IS-IS commands\n"
2671 "Set PSNP interval in seconds\n"
2672 "PSNP interval value\n"
2673 "Specify interval for level-2 PSNPs\n")
2674
2675struct cmd_node interface_node = {
jardineb5d44e2003-12-23 08:09:43 +00002676 INTERFACE_NODE,
2677 "%s(config-if)# ",
2678 1,
2679};
2680
Josh Bailey3f045a02012-03-24 08:35:20 -07002681DEFUN (isis_network,
2682 isis_network_cmd,
2683 "isis network point-to-point",
2684 "IS-IS commands\n"
2685 "Set network type\n"
2686 "point-to-point network type\n")
2687{
2688 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2689 if (!circuit)
2690 return CMD_ERR_NO_MATCH;
2691
2692 /* RFC5309 section 4 */
2693 if (circuit->circ_type == CIRCUIT_T_P2P)
2694 return CMD_SUCCESS;
2695
2696 if (circuit->state != C_STATE_UP)
2697 {
2698 circuit->circ_type = CIRCUIT_T_P2P;
2699 circuit->circ_type_config = CIRCUIT_T_P2P;
2700 }
2701 else
2702 {
2703 struct isis_area *area = circuit->area;
2704 if (!if_is_broadcast (circuit->interface))
2705 {
2706 vty_out (vty, "isis network point-to-point "
2707 "is valid only on broadcast interfaces%s",
2708 VTY_NEWLINE);
2709 return CMD_ERR_AMBIGUOUS;
2710 }
2711
2712 isis_csm_state_change (ISIS_DISABLE, circuit, area);
2713 circuit->circ_type = CIRCUIT_T_P2P;
2714 circuit->circ_type_config = CIRCUIT_T_P2P;
2715 isis_csm_state_change (ISIS_ENABLE, circuit, area);
2716 }
2717
2718 return CMD_SUCCESS;
2719}
2720
2721DEFUN (no_isis_network,
2722 no_isis_network_cmd,
2723 "no isis network point-to-point",
2724 NO_STR
2725 "IS-IS commands\n"
2726 "Set network type for circuit\n"
2727 "point-to-point network type\n")
2728{
2729 struct isis_circuit *circuit = isis_circuit_lookup (vty);
2730 if (!circuit)
2731 return CMD_ERR_NO_MATCH;
2732
2733 /* RFC5309 section 4 */
2734 if (circuit->circ_type == CIRCUIT_T_BROADCAST)
2735 return CMD_SUCCESS;
2736
2737 if (circuit->state != C_STATE_UP)
2738 {
2739 circuit->circ_type = CIRCUIT_T_BROADCAST;
2740 circuit->circ_type_config = CIRCUIT_T_BROADCAST;
2741 }
2742 else
2743 {
2744 struct isis_area *area = circuit->area;
2745 if (circuit->interface &&
2746 !if_is_broadcast (circuit->interface))
2747 {
2748 vty_out (vty, "no isis network point-to-point "
2749 "is valid only on broadcast interfaces%s",
2750 VTY_NEWLINE);
2751 return CMD_ERR_AMBIGUOUS;
2752 }
2753
2754 isis_csm_state_change (ISIS_DISABLE, circuit, area);
2755 circuit->circ_type = CIRCUIT_T_BROADCAST;
2756 circuit->circ_type_config = CIRCUIT_T_BROADCAST;
2757 isis_csm_state_change (ISIS_ENABLE, circuit, area);
2758 }
2759
2760 return CMD_SUCCESS;
2761}
2762
jardineb5d44e2003-12-23 08:09:43 +00002763int
2764isis_if_new_hook (struct interface *ifp)
2765{
jardineb5d44e2003-12-23 08:09:43 +00002766 return 0;
2767}
2768
2769int
2770isis_if_delete_hook (struct interface *ifp)
2771{
Subbaiah Venkatae38e0df2012-03-27 23:48:05 -07002772 struct isis_circuit *circuit;
2773 /* Clean up the circuit data */
2774 if (ifp && ifp->info)
2775 {
2776 circuit = ifp->info;
2777 isis_csm_state_change (IF_DOWN_FROM_Z, circuit, circuit->area);
2778 isis_csm_state_change (ISIS_DISABLE, circuit, circuit->area);
2779 }
2780
jardineb5d44e2003-12-23 08:09:43 +00002781 return 0;
2782}
2783
jardineb5d44e2003-12-23 08:09:43 +00002784void
2785isis_circuit_init ()
2786{
jardineb5d44e2003-12-23 08:09:43 +00002787 /* Initialize Zebra interface data structure */
jardineb5d44e2003-12-23 08:09:43 +00002788 if_add_hook (IF_NEW_HOOK, isis_if_new_hook);
2789 if_add_hook (IF_DELETE_HOOK, isis_if_delete_hook);
2790
2791 /* Install interface node */
2792 install_node (&interface_node, isis_interface_config_write);
2793 install_element (CONFIG_NODE, &interface_cmd);
Subbaiah Venkatae38e0df2012-03-27 23:48:05 -07002794 install_element (CONFIG_NODE, &no_interface_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002795
2796 install_default (INTERFACE_NODE);
2797 install_element (INTERFACE_NODE, &interface_desc_cmd);
2798 install_element (INTERFACE_NODE, &no_interface_desc_cmd);
2799
2800 install_element (INTERFACE_NODE, &ip_router_isis_cmd);
2801 install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
2802
Josh Bailey3f045a02012-03-24 08:35:20 -07002803 install_element (INTERFACE_NODE, &isis_passive_cmd);
2804 install_element (INTERFACE_NODE, &no_isis_passive_cmd);
2805
jardineb5d44e2003-12-23 08:09:43 +00002806 install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
2807 install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
2808
Josh Bailey3f045a02012-03-24 08:35:20 -07002809 install_element (INTERFACE_NODE, &isis_passwd_clear_cmd);
2810 install_element (INTERFACE_NODE, &isis_passwd_md5_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002811 install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
2812
2813 install_element (INTERFACE_NODE, &isis_priority_cmd);
2814 install_element (INTERFACE_NODE, &no_isis_priority_cmd);
2815 install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
2816 install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
2817 install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
2818 install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
2819 install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
2820 install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
2821 install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
2822
2823 install_element (INTERFACE_NODE, &isis_metric_cmd);
2824 install_element (INTERFACE_NODE, &no_isis_metric_cmd);
2825 install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
Josh Bailey3f045a02012-03-24 08:35:20 -07002826 install_element (INTERFACE_NODE, &isis_metric_l1_cmd);
2827 install_element (INTERFACE_NODE, &no_isis_metric_l1_cmd);
2828 install_element (INTERFACE_NODE, &no_isis_metric_l1_arg_cmd);
2829 install_element (INTERFACE_NODE, &isis_metric_l2_cmd);
2830 install_element (INTERFACE_NODE, &no_isis_metric_l2_cmd);
2831 install_element (INTERFACE_NODE, &no_isis_metric_l2_arg_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002832
2833 install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
2834 install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
2835 install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
2836 install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
2837 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
2838 install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
2839 install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
2840 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
2841 install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
2842
2843 install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
2844 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
2845 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
2846 install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
2847 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
2848 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
2849 install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
2850 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
2851 install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
2852
Josh Bailey3f045a02012-03-24 08:35:20 -07002853 install_element (INTERFACE_NODE, &isis_hello_padding_cmd);
2854 install_element (INTERFACE_NODE, &no_isis_hello_padding_cmd);
2855
jardineb5d44e2003-12-23 08:09:43 +00002856 install_element (INTERFACE_NODE, &csnp_interval_cmd);
2857 install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
2858 install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
2859 install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
2860 install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
2861 install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
2862 install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
2863 install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
2864 install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
2865
Josh Bailey3f045a02012-03-24 08:35:20 -07002866 install_element (INTERFACE_NODE, &psnp_interval_cmd);
2867 install_element (INTERFACE_NODE, &no_psnp_interval_cmd);
2868 install_element (INTERFACE_NODE, &no_psnp_interval_arg_cmd);
2869 install_element (INTERFACE_NODE, &psnp_interval_l1_cmd);
2870 install_element (INTERFACE_NODE, &no_psnp_interval_l1_cmd);
2871 install_element (INTERFACE_NODE, &no_psnp_interval_l1_arg_cmd);
2872 install_element (INTERFACE_NODE, &psnp_interval_l2_cmd);
2873 install_element (INTERFACE_NODE, &no_psnp_interval_l2_cmd);
2874 install_element (INTERFACE_NODE, &no_psnp_interval_l2_arg_cmd);
2875
2876 install_element (INTERFACE_NODE, &isis_network_cmd);
2877 install_element (INTERFACE_NODE, &no_isis_network_cmd);
2878
jardineb5d44e2003-12-23 08:09:43 +00002879#ifdef HAVE_IPV6
2880 install_element (INTERFACE_NODE, &ipv6_router_isis_cmd);
2881 install_element (INTERFACE_NODE, &no_ipv6_router_isis_cmd);
jardineb5d44e2003-12-23 08:09:43 +00002882#endif
jardineb5d44e2003-12-23 08:09:43 +00002883}