blob: 4eba8a422a1ea05e1be9d6aac525c0d7310cff3b [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
hasso508e53e2004-05-18 18:57:06 +00002 * Copyright (C) 2003 Yasuhiro Ohara
paul718e3742002-12-13 20:15:29 +00003 *
4 * This file is part of GNU Zebra.
5 *
6 * GNU Zebra is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2, or (at your option) any
9 * later version.
10 *
11 * GNU Zebra is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GNU Zebra; see the file COPYING. If not, write to the
18 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
hasso508e53e2004-05-18 18:57:06 +000022#include <zebra.h>
23
24#include "thread.h"
25#include "linklist.h"
26#include "vty.h"
27#include "command.h"
28
hasso508e53e2004-05-18 18:57:06 +000029#include "ospf6_proto.h"
30#include "ospf6_network.h"
31#include "ospf6_lsa.h"
32#include "ospf6_lsdb.h"
33#include "ospf6_message.h"
34#include "ospf6_route.h"
35#include "ospf6_zebra.h"
36#include "ospf6_spf.h"
37#include "ospf6_top.h"
38#include "ospf6_area.h"
39#include "ospf6_interface.h"
40#include "ospf6_neighbor.h"
41#include "ospf6_intra.h"
42#include "ospf6_asbr.h"
hasso049207c2004-08-04 20:02:13 +000043#include "ospf6_abr.h"
44#include "ospf6d.h"
paul718e3742002-12-13 20:15:29 +000045
46char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION;
47
paul718e3742002-12-13 20:15:29 +000048void
hasso508e53e2004-05-18 18:57:06 +000049ospf6_debug ()
paul718e3742002-12-13 20:15:29 +000050{
hasso508e53e2004-05-18 18:57:06 +000051}
paul718e3742002-12-13 20:15:29 +000052
hasso508e53e2004-05-18 18:57:06 +000053static struct route_node *
54_route_next_until (struct route_node *node, struct route_node *limit)
55{
56 struct route_node *next;
57 struct route_node *start;
58
59 /* Node may be deleted from route_unlock_node so we have to preserve
60 next node's pointer. */
61
62 if (node->l_left)
paul718e3742002-12-13 20:15:29 +000063 {
hasso508e53e2004-05-18 18:57:06 +000064 next = node->l_left;
65 if (next == limit)
66 {
67 route_unlock_node (node);
68 return NULL;
69 }
70 route_lock_node (next);
71 route_unlock_node (node);
72 return next;
73 }
74 if (node->l_right)
75 {
76 next = node->l_right;
77 if (next == limit)
78 {
79 route_unlock_node (node);
80 return NULL;
81 }
82 route_lock_node (next);
83 route_unlock_node (node);
84 return next;
paul718e3742002-12-13 20:15:29 +000085 }
86
hasso508e53e2004-05-18 18:57:06 +000087 start = node;
88 while (node->parent)
paul718e3742002-12-13 20:15:29 +000089 {
hasso508e53e2004-05-18 18:57:06 +000090 if (node->parent->l_left == node && node->parent->l_right)
91 {
92 next = node->parent->l_right;
93 if (next == limit)
94 {
95 route_unlock_node (start);
96 return NULL;
97 }
98 route_lock_node (next);
99 route_unlock_node (start);
100 return next;
101 }
102 node = node->parent;
paul718e3742002-12-13 20:15:29 +0000103 }
104
hasso508e53e2004-05-18 18:57:06 +0000105 route_unlock_node (start);
106 return NULL;
paul718e3742002-12-13 20:15:29 +0000107}
108
hasso508e53e2004-05-18 18:57:06 +0000109struct route_node *
110route_prev (struct route_node *node)
paul718e3742002-12-13 20:15:29 +0000111{
hasso508e53e2004-05-18 18:57:06 +0000112 struct route_node *end;
113 struct route_node *prev = NULL;
paul718e3742002-12-13 20:15:29 +0000114
hasso508e53e2004-05-18 18:57:06 +0000115 if (node->parent == NULL)
116 {
117 route_unlock_node (node);
118 return NULL;
119 }
paul718e3742002-12-13 20:15:29 +0000120
hasso508e53e2004-05-18 18:57:06 +0000121 if (node->parent->l_left == node)
122 {
123 prev = node->parent;
124 route_lock_node (prev);
125 route_unlock_node (node);
126 return prev;
127 }
128
129 end = node;
130 node = node->parent;
131 route_lock_node (node);
132 while (node)
133 {
134 prev = node;
135 node = _route_next_until (node, end);
136 }
137 route_unlock_node (end);
138 route_lock_node (prev);
139
140 return prev;
paul718e3742002-12-13 20:15:29 +0000141}
142
hasso049207c2004-08-04 20:02:13 +0000143
paul718e3742002-12-13 20:15:29 +0000144DEFUN (show_version_ospf6,
145 show_version_ospf6_cmd,
146 "show version ospf6",
147 SHOW_STR
hasso508e53e2004-05-18 18:57:06 +0000148 "Displays ospf6d version\n"
149 )
paul718e3742002-12-13 20:15:29 +0000150{
151 vty_out (vty, "Zebra OSPF6d Version: %s%s",
hasso049207c2004-08-04 20:02:13 +0000152 ospf6_daemon_version, VNL);
paul718e3742002-12-13 20:15:29 +0000153
154 return CMD_SUCCESS;
155}
156
hasso508e53e2004-05-18 18:57:06 +0000157struct cmd_node debug_node =
paul718e3742002-12-13 20:15:29 +0000158{
hasso508e53e2004-05-18 18:57:06 +0000159 DEBUG_NODE,
160 ""
161};
paul718e3742002-12-13 20:15:29 +0000162
163int
hasso508e53e2004-05-18 18:57:06 +0000164config_write_ospf6_debug (struct vty *vty)
paul718e3742002-12-13 20:15:29 +0000165{
hasso508e53e2004-05-18 18:57:06 +0000166 config_write_ospf6_debug_message (vty);
167 config_write_ospf6_debug_lsa (vty);
168 config_write_ospf6_debug_zebra (vty);
169 config_write_ospf6_debug_interface (vty);
170 config_write_ospf6_debug_neighbor (vty);
171 config_write_ospf6_debug_spf (vty);
172 config_write_ospf6_debug_route (vty);
173 config_write_ospf6_debug_asbr (vty);
hasso049207c2004-08-04 20:02:13 +0000174 config_write_ospf6_debug_abr (vty);
175 vty_out (vty, "!%s", VNL);
paul718e3742002-12-13 20:15:29 +0000176 return 0;
177}
178
hasso049207c2004-08-04 20:02:13 +0000179#define AREA_LSDB_TITLE_FORMAT \
180 "%s Area Scoped Link State Database (Area %s)%s%s"
181#define IF_LSDB_TITLE_FORMAT \
182 "%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s"
183#define AS_LSDB_TITLE_FORMAT \
184 "%s AS Scoped Link State Database%s%s"
185
186static int
187parse_show_level (int argc, char **argv)
188{
189 int level;
190 if (argc)
191 {
192 if (! strncmp (argv[0], "de", 2))
193 level = OSPF6_LSDB_SHOW_LEVEL_DETAIL;
194 else if (! strncmp (argv[0], "du", 2))
195 level = OSPF6_LSDB_SHOW_LEVEL_DUMP;
196 else if (! strncmp (argv[0], "in", 2))
197 level = OSPF6_LSDB_SHOW_LEVEL_INTERNAL;
198 }
199 else
200 level = OSPF6_LSDB_SHOW_LEVEL_NORMAL;
201 return level;
202}
203
204static u_int16_t
205parse_type_spec (int argc, char **argv)
206{
207 u_int16_t type;
208 assert (argc);
209 if (! strcmp (argv[0], "router"))
210 type = htons (OSPF6_LSTYPE_ROUTER);
211 else if (! strcmp (argv[0], "network"))
212 type = htons (OSPF6_LSTYPE_NETWORK);
213 else if (! strcmp (argv[0], "as-external"))
214 type = htons (OSPF6_LSTYPE_AS_EXTERNAL);
215 else if (! strcmp (argv[0], "intra-prefix"))
216 type = htons (OSPF6_LSTYPE_INTRA_PREFIX);
217 else if (! strcmp (argv[0], "inter-router"))
218 type = htons (OSPF6_LSTYPE_INTER_ROUTER);
219 else if (! strcmp (argv[0], "inter-prefix"))
220 type = htons (OSPF6_LSTYPE_INTER_PREFIX);
221 else if (! strcmp (argv[0], "link"))
222 type = htons (OSPF6_LSTYPE_LINK);
223 return type;
224}
225
hasso508e53e2004-05-18 18:57:06 +0000226DEFUN (show_ipv6_ospf6_database,
227 show_ipv6_ospf6_database_cmd,
228 "show ipv6 ospf6 database",
229 SHOW_STR
230 IPV6_STR
231 OSPF6_STR
232 "Display Link state database\n"
233 )
paul718e3742002-12-13 20:15:29 +0000234{
hasso049207c2004-08-04 20:02:13 +0000235 int level;
hasso508e53e2004-05-18 18:57:06 +0000236 listnode i, j;
237 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000238 struct ospf6_area *oa;
239 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000240
241 OSPF6_CMD_CHECK_RUNNING ();
242
hasso049207c2004-08-04 20:02:13 +0000243 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +0000244
hasso508e53e2004-05-18 18:57:06 +0000245 for (i = listhead (o->area_list); i; nextnode (i))
246 {
hasso049207c2004-08-04 20:02:13 +0000247 oa = (struct ospf6_area *) getdata (i);
248 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
249 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000250 }
hasso049207c2004-08-04 20:02:13 +0000251
hasso508e53e2004-05-18 18:57:06 +0000252 for (i = listhead (o->area_list); i; nextnode (i))
253 {
hasso049207c2004-08-04 20:02:13 +0000254 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000255 for (j = listhead (oa->if_list); j; nextnode (j))
256 {
hasso049207c2004-08-04 20:02:13 +0000257 oi = (struct ospf6_interface *) getdata (j);
258 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
259 oi->interface->name, oa->name, VNL, VNL);
260 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000261 }
262 }
263
hasso049207c2004-08-04 20:02:13 +0000264 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
265 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb);
266
267 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000268 return CMD_SUCCESS;
269}
270
271ALIAS (show_ipv6_ospf6_database,
272 show_ipv6_ospf6_database_detail_cmd,
273 "show ipv6 ospf6 database (detail|dump|internal)",
274 SHOW_STR
275 IPV6_STR
276 OSPF6_STR
277 "Display Link state database\n"
278 "Display details of LSAs\n"
279 "Dump LSAs\n"
280 "Display LSA's internal information\n"
281 );
282
283DEFUN (show_ipv6_ospf6_database_type,
284 show_ipv6_ospf6_database_type_cmd,
285 "show ipv6 ospf6 database "
286 "(router|network|inter-prefix|inter-router|as-external|"
287 "group-membership|type-7|link|intra-prefix)",
288 SHOW_STR
289 IPV6_STR
290 OSPF6_STR
291 "Display Link state database\n"
292 "Display Router LSAs\n"
293 "Display Network LSAs\n"
294 "Display Inter-Area-Prefix LSAs\n"
295 "Display Inter-Area-Router LSAs\n"
296 "Display As-External LSAs\n"
297 "Display Group-Membership LSAs\n"
298 "Display Type-7 LSAs\n"
299 "Display Link LSAs\n"
300 "Display Intra-Area-Prefix LSAs\n"
301 )
302{
hasso049207c2004-08-04 20:02:13 +0000303 int level;
hasso508e53e2004-05-18 18:57:06 +0000304 listnode i, j;
305 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000306 struct ospf6_area *oa;
307 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000308 u_int16_t type = 0;
309
310 OSPF6_CMD_CHECK_RUNNING ();
311
hasso049207c2004-08-04 20:02:13 +0000312 type = parse_type_spec (argc, argv);
313 argc--;
314 argv++;
315 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +0000316
hasso049207c2004-08-04 20:02:13 +0000317 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000318 {
hasso049207c2004-08-04 20:02:13 +0000319 case OSPF6_LSA_SCOPE_AREA:
320 for (i = listhead (o->area_list); i; nextnode (i))
321 {
322 oa = (struct ospf6_area *) getdata (i);
323 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
324 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
325 }
326 break;
327
328 case OSPF6_LSA_SCOPE_LINKLOCAL:
329 for (i = listhead (o->area_list); i; nextnode (i))
330 {
331 oa = (struct ospf6_area *) getdata (i);
332 for (j = listhead (oa->if_list); j; nextnode (j))
333 {
334 oi = (struct ospf6_interface *) getdata (j);
335 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
336 oi->interface->name, oa->name, VNL, VNL);
337 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
338 }
339 }
340 break;
341
342 case OSPF6_LSA_SCOPE_AS:
343 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
344 ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb);
345 break;
346
347 default:
348 assert (0);
349 break;
hasso508e53e2004-05-18 18:57:06 +0000350 }
351
hasso049207c2004-08-04 20:02:13 +0000352 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000353 return CMD_SUCCESS;
354}
355
356ALIAS (show_ipv6_ospf6_database_type,
357 show_ipv6_ospf6_database_type_detail_cmd,
358 "show ipv6 ospf6 database "
359 "(router|network|inter-prefix|inter-router|as-external|"
360 "group-membership|type-7|link|intra-prefix) "
361 "(detail|dump|internal)",
362 SHOW_STR
363 IPV6_STR
364 OSPF6_STR
365 "Display Link state database\n"
366 "Display Router LSAs\n"
367 "Display Network LSAs\n"
368 "Display Inter-Area-Prefix LSAs\n"
369 "Display Inter-Area-Router LSAs\n"
370 "Display As-External LSAs\n"
371 "Display Group-Membership LSAs\n"
372 "Display Type-7 LSAs\n"
373 "Display Link LSAs\n"
374 "Display Intra-Area-Prefix LSAs\n"
375 "Display details of LSAs\n"
376 "Dump LSAs\n"
377 "Display LSA's internal information\n"
378 );
379
380DEFUN (show_ipv6_ospf6_database_id,
381 show_ipv6_ospf6_database_id_cmd,
382 "show ipv6 ospf6 database * A.B.C.D",
383 SHOW_STR
384 IPV6_STR
385 OSPF6_STR
386 "Display Link state database\n"
387 "Any Link state Type\n"
388 "Specify Link state ID as IPv4 address notation\n"
389 )
390{
hasso049207c2004-08-04 20:02:13 +0000391 int level;
hasso508e53e2004-05-18 18:57:06 +0000392 listnode i, j;
393 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000394 struct ospf6_area *oa;
395 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000396 u_int32_t id = 0;
397
398 OSPF6_CMD_CHECK_RUNNING ();
399
hasso508e53e2004-05-18 18:57:06 +0000400 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
401 {
402 vty_out (vty, "Link State ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000403 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000404 return CMD_SUCCESS;
405 }
406
hasso049207c2004-08-04 20:02:13 +0000407 argc--;
408 argv++;
409 level = parse_show_level (argc, argv);
410
hasso508e53e2004-05-18 18:57:06 +0000411 for (i = listhead (o->area_list); i; nextnode (i))
412 {
hasso049207c2004-08-04 20:02:13 +0000413 oa = (struct ospf6_area *) getdata (i);
414 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
415 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000416 }
hasso049207c2004-08-04 20:02:13 +0000417
hasso508e53e2004-05-18 18:57:06 +0000418 for (i = listhead (o->area_list); i; nextnode (i))
419 {
hasso049207c2004-08-04 20:02:13 +0000420 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000421 for (j = listhead (oa->if_list); j; nextnode (j))
422 {
hasso049207c2004-08-04 20:02:13 +0000423 oi = (struct ospf6_interface *) getdata (j);
424 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
425 oi->interface->name, oa->name, VNL, VNL);
426 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000427 }
428 }
429
hasso049207c2004-08-04 20:02:13 +0000430 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
431 ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb);
432
433 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000434 return CMD_SUCCESS;
435}
436
437ALIAS (show_ipv6_ospf6_database_id,
438 show_ipv6_ospf6_database_id_detail_cmd,
439 "show ipv6 ospf6 database * A.B.C.D "
440 "(detail|dump|internal)",
441 SHOW_STR
442 IPV6_STR
443 OSPF6_STR
444 "Display Link state database\n"
445 "Any Link state Type\n"
hasso049207c2004-08-04 20:02:13 +0000446 "Specify Link state ID as IPv4 address notation\n"
447 "Display details of LSAs\n"
448 "Dump LSAs\n"
449 "Display LSA's internal information\n"
450 );
451
452ALIAS (show_ipv6_ospf6_database_id,
453 show_ipv6_ospf6_database_linkstate_id_cmd,
454 "show ipv6 ospf6 database linkstate-id A.B.C.D",
455 SHOW_STR
456 IPV6_STR
457 OSPF6_STR
458 "Display Link state database\n"
459 "Search by Link state ID\n"
460 "Specify Link state ID as IPv4 address notation\n"
461 );
462
463ALIAS (show_ipv6_ospf6_database_id,
464 show_ipv6_ospf6_database_linkstate_id_detail_cmd,
465 "show ipv6 ospf6 database linkstate-id A.B.C.D "
466 "(detail|dump|internal)",
467 SHOW_STR
468 IPV6_STR
469 OSPF6_STR
470 "Display Link state database\n"
471 "Search by Link state ID\n"
hasso508e53e2004-05-18 18:57:06 +0000472 "Specify Link state ID as IPv4 address notation\n"
473 "Display details of LSAs\n"
474 "Dump LSAs\n"
475 "Display LSA's internal information\n"
476 );
477
478DEFUN (show_ipv6_ospf6_database_router,
479 show_ipv6_ospf6_database_router_cmd,
480 "show ipv6 ospf6 database * * A.B.C.D",
481 SHOW_STR
482 IPV6_STR
483 OSPF6_STR
484 "Display Link state database\n"
485 "Any Link state Type\n"
486 "Any Link state ID\n"
487 "Specify Advertising Router as IPv4 address notation\n"
488 )
489{
hasso049207c2004-08-04 20:02:13 +0000490 int level;
hasso508e53e2004-05-18 18:57:06 +0000491 listnode i, j;
492 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000493 struct ospf6_area *oa;
494 struct ospf6_interface *oi;
495 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000496
497 OSPF6_CMD_CHECK_RUNNING ();
498
hasso049207c2004-08-04 20:02:13 +0000499 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000500 {
501 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000502 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000503 return CMD_SUCCESS;
504 }
505
hasso049207c2004-08-04 20:02:13 +0000506 argc--;
507 argv++;
508 level = parse_show_level (argc, argv);
509
hasso508e53e2004-05-18 18:57:06 +0000510 for (i = listhead (o->area_list); i; nextnode (i))
511 {
hasso049207c2004-08-04 20:02:13 +0000512 oa = (struct ospf6_area *) getdata (i);
513 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
514 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000515 }
hasso049207c2004-08-04 20:02:13 +0000516
hasso508e53e2004-05-18 18:57:06 +0000517 for (i = listhead (o->area_list); i; nextnode (i))
518 {
hasso049207c2004-08-04 20:02:13 +0000519 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000520 for (j = listhead (oa->if_list); j; nextnode (j))
521 {
hasso049207c2004-08-04 20:02:13 +0000522 oi = (struct ospf6_interface *) getdata (j);
523 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
524 oi->interface->name, oa->name, VNL, VNL);
525 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000526 }
527 }
528
hasso049207c2004-08-04 20:02:13 +0000529 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
530 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
531
532 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000533 return CMD_SUCCESS;
534}
535
536ALIAS (show_ipv6_ospf6_database_router,
537 show_ipv6_ospf6_database_router_detail_cmd,
538 "show ipv6 ospf6 database * * A.B.C.D "
539 "(detail|dump|internal)",
540 SHOW_STR
541 IPV6_STR
542 OSPF6_STR
543 "Display Link state database\n"
544 "Any Link state Type\n"
545 "Any Link state ID\n"
546 "Specify Advertising Router as IPv4 address notation\n"
547 "Display details of LSAs\n"
548 "Dump LSAs\n"
549 "Display LSA's internal information\n"
550 );
551
hasso049207c2004-08-04 20:02:13 +0000552ALIAS (show_ipv6_ospf6_database_router,
553 show_ipv6_ospf6_database_adv_router_cmd,
554 "show ipv6 ospf6 database adv-router A.B.C.D",
555 SHOW_STR
556 IPV6_STR
557 OSPF6_STR
558 "Display Link state database\n"
559 "Search by Advertising Router\n"
560 "Specify Advertising Router as IPv4 address notation\n"
561 );
562
563ALIAS (show_ipv6_ospf6_database_router,
564 show_ipv6_ospf6_database_adv_router_detail_cmd,
565 "show ipv6 ospf6 database adv-router A.B.C.D "
566 "(detail|dump|internal)",
567 SHOW_STR
568 IPV6_STR
569 OSPF6_STR
570 "Display Link state database\n"
571 "Search by Advertising Router\n"
572 "Specify Advertising Router as IPv4 address notation\n"
573 "Display details of LSAs\n"
574 "Dump LSAs\n"
575 "Display LSA's internal information\n"
576 );
577
hasso508e53e2004-05-18 18:57:06 +0000578DEFUN (show_ipv6_ospf6_database_type_id,
579 show_ipv6_ospf6_database_type_id_cmd,
580 "show ipv6 ospf6 database "
581 "(router|network|inter-prefix|inter-router|as-external|"
582 "group-membership|type-7|link|intra-prefix) A.B.C.D",
583 SHOW_STR
584 IPV6_STR
585 OSPF6_STR
586 "Display Link state database\n"
587 "Display Router LSAs\n"
588 "Display Network LSAs\n"
589 "Display Inter-Area-Prefix LSAs\n"
590 "Display Inter-Area-Router LSAs\n"
591 "Display As-External LSAs\n"
592 "Display Group-Membership LSAs\n"
593 "Display Type-7 LSAs\n"
594 "Display Link LSAs\n"
595 "Display Intra-Area-Prefix LSAs\n"
596 "Specify Link state ID as IPv4 address notation\n"
597 )
598{
hasso049207c2004-08-04 20:02:13 +0000599 int level;
hasso508e53e2004-05-18 18:57:06 +0000600 listnode i, j;
601 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000602 struct ospf6_area *oa;
603 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000604 u_int16_t type = 0;
605 u_int32_t id = 0;
606
607 OSPF6_CMD_CHECK_RUNNING ();
608
hasso049207c2004-08-04 20:02:13 +0000609 type = parse_type_spec (argc, argv);
610 argc--;
611 argv++;
hasso508e53e2004-05-18 18:57:06 +0000612
hasso049207c2004-08-04 20:02:13 +0000613 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000614 {
615 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000616 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000617 return CMD_SUCCESS;
618 }
619
hasso049207c2004-08-04 20:02:13 +0000620 argc--;
621 argv++;
622 level = parse_show_level (argc, argv);
623
624 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000625 {
hasso049207c2004-08-04 20:02:13 +0000626 case OSPF6_LSA_SCOPE_AREA:
627 for (i = listhead (o->area_list); i; nextnode (i))
628 {
629 oa = (struct ospf6_area *) getdata (i);
630 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
631 ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
632 }
633 break;
634
635 case OSPF6_LSA_SCOPE_LINKLOCAL:
636 for (i = listhead (o->area_list); i; nextnode (i))
637 {
638 oa = (struct ospf6_area *) getdata (i);
639 for (j = listhead (oa->if_list); j; nextnode (j))
640 {
641 oi = (struct ospf6_interface *) getdata (j);
642 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
643 oi->interface->name, oa->name, VNL, VNL);
644 ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
645 }
646 }
647 break;
648
649 case OSPF6_LSA_SCOPE_AS:
650 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
651 ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb);
652 break;
653
654 default:
655 assert (0);
656 break;
hasso508e53e2004-05-18 18:57:06 +0000657 }
658
hasso049207c2004-08-04 20:02:13 +0000659 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000660 return CMD_SUCCESS;
661}
662
663ALIAS (show_ipv6_ospf6_database_type_id,
664 show_ipv6_ospf6_database_type_id_detail_cmd,
665 "show ipv6 ospf6 database "
666 "(router|network|inter-prefix|inter-router|as-external|"
667 "group-membership|type-7|link|intra-prefix) A.B.C.D "
668 "(detail|dump|internal)",
669 SHOW_STR
670 IPV6_STR
671 OSPF6_STR
672 "Display Link state database\n"
673 "Display Router LSAs\n"
674 "Display Network LSAs\n"
675 "Display Inter-Area-Prefix LSAs\n"
676 "Display Inter-Area-Router LSAs\n"
677 "Display As-External LSAs\n"
678 "Display Group-Membership LSAs\n"
679 "Display Type-7 LSAs\n"
680 "Display Link LSAs\n"
681 "Display Intra-Area-Prefix LSAs\n"
682 "Specify Link state ID as IPv4 address notation\n"
683 "Display details of LSAs\n"
684 "Dump LSAs\n"
685 "Display LSA's internal information\n"
686 );
687
hasso049207c2004-08-04 20:02:13 +0000688ALIAS (show_ipv6_ospf6_database_type_id,
689 show_ipv6_ospf6_database_type_linkstate_id_cmd,
690 "show ipv6 ospf6 database "
691 "(router|network|inter-prefix|inter-router|as-external|"
692 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D",
693 SHOW_STR
694 IPV6_STR
695 OSPF6_STR
696 "Display Link state database\n"
697 "Display Router LSAs\n"
698 "Display Network LSAs\n"
699 "Display Inter-Area-Prefix LSAs\n"
700 "Display Inter-Area-Router LSAs\n"
701 "Display As-External LSAs\n"
702 "Display Group-Membership LSAs\n"
703 "Display Type-7 LSAs\n"
704 "Display Link LSAs\n"
705 "Display Intra-Area-Prefix LSAs\n"
706 "Search by Link state ID\n"
707 "Specify Link state ID as IPv4 address notation\n"
708 );
709
710ALIAS (show_ipv6_ospf6_database_type_id,
711 show_ipv6_ospf6_database_type_linkstate_id_detail_cmd,
712 "show ipv6 ospf6 database "
713 "(router|network|inter-prefix|inter-router|as-external|"
714 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D "
715 "(detail|dump|internal)",
716 SHOW_STR
717 IPV6_STR
718 OSPF6_STR
719 "Display Link state database\n"
720 "Display Router LSAs\n"
721 "Display Network LSAs\n"
722 "Display Inter-Area-Prefix LSAs\n"
723 "Display Inter-Area-Router LSAs\n"
724 "Display As-External LSAs\n"
725 "Display Group-Membership LSAs\n"
726 "Display Type-7 LSAs\n"
727 "Display Link LSAs\n"
728 "Display Intra-Area-Prefix LSAs\n"
729 "Search by Link state ID\n"
730 "Specify Link state ID as IPv4 address notation\n"
731 "Display details of LSAs\n"
732 "Dump LSAs\n"
733 "Display LSA's internal information\n"
734 );
735
hasso508e53e2004-05-18 18:57:06 +0000736DEFUN (show_ipv6_ospf6_database_type_router,
737 show_ipv6_ospf6_database_type_router_cmd,
738 "show ipv6 ospf6 database "
739 "(router|network|inter-prefix|inter-router|as-external|"
740 "group-membership|type-7|link|intra-prefix) * A.B.C.D",
741 SHOW_STR
742 IPV6_STR
743 OSPF6_STR
744 "Display Link state database\n"
745 "Display Router LSAs\n"
746 "Display Network LSAs\n"
747 "Display Inter-Area-Prefix LSAs\n"
748 "Display Inter-Area-Router LSAs\n"
749 "Display As-External LSAs\n"
750 "Display Group-Membership LSAs\n"
751 "Display Type-7 LSAs\n"
752 "Display Link LSAs\n"
753 "Display Intra-Area-Prefix LSAs\n"
754 "Any Link state ID\n"
755 "Specify Advertising Router as IPv4 address notation\n"
756 )
757{
hasso049207c2004-08-04 20:02:13 +0000758 int level;
hasso508e53e2004-05-18 18:57:06 +0000759 listnode i, j;
760 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000761 struct ospf6_area *oa;
762 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000763 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +0000764 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000765
766 OSPF6_CMD_CHECK_RUNNING ();
767
hasso049207c2004-08-04 20:02:13 +0000768 type = parse_type_spec (argc, argv);
769 argc--;
770 argv++;
hasso508e53e2004-05-18 18:57:06 +0000771
hasso049207c2004-08-04 20:02:13 +0000772 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000773 {
774 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000775 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000776 return CMD_SUCCESS;
777 }
778
hasso049207c2004-08-04 20:02:13 +0000779 argc--;
780 argv++;
781 level = parse_show_level (argc, argv);
782
783 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000784 {
hasso049207c2004-08-04 20:02:13 +0000785 case OSPF6_LSA_SCOPE_AREA:
786 for (i = listhead (o->area_list); i; nextnode (i))
787 {
788 oa = (struct ospf6_area *) getdata (i);
789 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
790 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
791 }
792 break;
793
794 case OSPF6_LSA_SCOPE_LINKLOCAL:
795 for (i = listhead (o->area_list); i; nextnode (i))
796 {
797 oa = (struct ospf6_area *) getdata (i);
798 for (j = listhead (oa->if_list); j; nextnode (j))
799 {
800 oi = (struct ospf6_interface *) getdata (j);
801 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
802 oi->interface->name, oa->name, VNL, VNL);
803 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
804 }
805 }
806 break;
807
808 case OSPF6_LSA_SCOPE_AS:
809 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
810 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
811 break;
812
813 default:
814 assert (0);
815 break;
hasso508e53e2004-05-18 18:57:06 +0000816 }
817
hasso049207c2004-08-04 20:02:13 +0000818 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000819 return CMD_SUCCESS;
820}
821
822ALIAS (show_ipv6_ospf6_database_type_router,
823 show_ipv6_ospf6_database_type_router_detail_cmd,
824 "show ipv6 ospf6 database "
825 "(router|network|inter-prefix|inter-router|as-external|"
826 "group-membership|type-7|link|intra-prefix) * A.B.C.D "
827 "(detail|dump|internal)",
828 SHOW_STR
829 IPV6_STR
830 OSPF6_STR
831 "Display Link state database\n"
832 "Display Router LSAs\n"
833 "Display Network LSAs\n"
834 "Display Inter-Area-Prefix LSAs\n"
835 "Display Inter-Area-Router LSAs\n"
836 "Display As-External LSAs\n"
837 "Display Group-Membership LSAs\n"
838 "Display Type-7 LSAs\n"
839 "Display Link LSAs\n"
840 "Display Intra-Area-Prefix LSAs\n"
841 "Any Link state ID\n"
842 "Specify Advertising Router as IPv4 address notation\n"
843 "Display details of LSAs\n"
844 "Dump LSAs\n"
845 "Display LSA's internal information\n"
846 );
847
hasso049207c2004-08-04 20:02:13 +0000848ALIAS (show_ipv6_ospf6_database_type_router,
849 show_ipv6_ospf6_database_type_adv_router_cmd,
850 "show ipv6 ospf6 database "
851 "(router|network|inter-prefix|inter-router|as-external|"
852 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D",
853 SHOW_STR
854 IPV6_STR
855 OSPF6_STR
856 "Display Link state database\n"
857 "Display Router LSAs\n"
858 "Display Network LSAs\n"
859 "Display Inter-Area-Prefix LSAs\n"
860 "Display Inter-Area-Router LSAs\n"
861 "Display As-External LSAs\n"
862 "Display Group-Membership LSAs\n"
863 "Display Type-7 LSAs\n"
864 "Display Link LSAs\n"
865 "Display Intra-Area-Prefix LSAs\n"
866 "Search by Advertising Router\n"
867 "Specify Advertising Router as IPv4 address notation\n"
868 );
869
870ALIAS (show_ipv6_ospf6_database_type_router,
871 show_ipv6_ospf6_database_type_adv_router_detail_cmd,
872 "show ipv6 ospf6 database "
873 "(router|network|inter-prefix|inter-router|as-external|"
874 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D "
875 "(detail|dump|internal)",
876 SHOW_STR
877 IPV6_STR
878 OSPF6_STR
879 "Display Link state database\n"
880 "Display Router LSAs\n"
881 "Display Network LSAs\n"
882 "Display Inter-Area-Prefix LSAs\n"
883 "Display Inter-Area-Router LSAs\n"
884 "Display As-External LSAs\n"
885 "Display Group-Membership LSAs\n"
886 "Display Type-7 LSAs\n"
887 "Display Link LSAs\n"
888 "Display Intra-Area-Prefix LSAs\n"
889 "Search by Advertising Router\n"
890 "Specify Advertising Router as IPv4 address notation\n"
891 "Display details of LSAs\n"
892 "Dump LSAs\n"
893 "Display LSA's internal information\n"
894 );
895
hasso508e53e2004-05-18 18:57:06 +0000896DEFUN (show_ipv6_ospf6_database_id_router,
897 show_ipv6_ospf6_database_id_router_cmd,
898 "show ipv6 ospf6 database * A.B.C.D A.B.C.D",
899 SHOW_STR
900 IPV6_STR
901 OSPF6_STR
902 "Display Link state database\n"
903 "Any Link state Type\n"
904 "Specify Link state ID as IPv4 address notation\n"
905 "Specify Advertising Router as IPv4 address notation\n"
906 )
907{
hasso049207c2004-08-04 20:02:13 +0000908 int level;
hasso508e53e2004-05-18 18:57:06 +0000909 listnode i, j;
910 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000911 struct ospf6_area *oa;
912 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000913 u_int32_t id = 0;
hasso049207c2004-08-04 20:02:13 +0000914 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000915
916 OSPF6_CMD_CHECK_RUNNING ();
917
hasso508e53e2004-05-18 18:57:06 +0000918 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
919 {
920 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000921 argv[1], VNL);
hasso508e53e2004-05-18 18:57:06 +0000922 return CMD_SUCCESS;
923 }
924
hasso049207c2004-08-04 20:02:13 +0000925 argc--;
926 argv++;
927
928 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000929 {
930 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000931 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000932 return CMD_SUCCESS;
933 }
934
hasso049207c2004-08-04 20:02:13 +0000935 argc--;
936 argv++;
937 level = parse_show_level (argc, argv);
938
hasso508e53e2004-05-18 18:57:06 +0000939 for (i = listhead (o->area_list); i; nextnode (i))
940 {
hasso049207c2004-08-04 20:02:13 +0000941 oa = (struct ospf6_area *) getdata (i);
942 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
943 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000944 }
hasso049207c2004-08-04 20:02:13 +0000945
hasso508e53e2004-05-18 18:57:06 +0000946 for (i = listhead (o->area_list); i; nextnode (i))
947 {
hasso049207c2004-08-04 20:02:13 +0000948 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000949 for (j = listhead (oa->if_list); j; nextnode (j))
950 {
hasso049207c2004-08-04 20:02:13 +0000951 oi = (struct ospf6_interface *) getdata (j);
952 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
953 oi->interface->name, oa->name, VNL, VNL);
954 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000955 }
956 }
957
hasso049207c2004-08-04 20:02:13 +0000958 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
959 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
960
961 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000962 return CMD_SUCCESS;
963}
964
965ALIAS (show_ipv6_ospf6_database_id_router,
966 show_ipv6_ospf6_database_id_router_detail_cmd,
967 "show ipv6 ospf6 database * A.B.C.D A.B.C.D "
968 "(detail|dump|internal)",
969 SHOW_STR
970 IPV6_STR
971 OSPF6_STR
972 "Display Link state database\n"
973 "Any Link state Type\n"
974 "Specify Link state ID as IPv4 address notation\n"
975 "Specify Advertising Router as IPv4 address notation\n"
976 "Display details of LSAs\n"
977 "Dump LSAs\n"
978 "Display LSA's internal information\n"
979 );
980
hasso049207c2004-08-04 20:02:13 +0000981DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
982 show_ipv6_ospf6_database_adv_router_linkstate_id_cmd,
983 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D",
984 SHOW_STR
985 IPV6_STR
986 OSPF6_STR
987 "Display Link state database\n"
988 "Search by Advertising Router\n"
989 "Specify Advertising Router as IPv4 address notation\n"
990 "Search by Link state ID\n"
991 "Specify Link state ID as IPv4 address notation\n"
992 )
993{
994 int level;
995 listnode i, j;
996 struct ospf6 *o = ospf6;
997 struct ospf6_area *oa;
998 struct ospf6_interface *oi;
999 u_int32_t id = 0;
1000 u_int32_t adv_router = 0;
1001
1002 OSPF6_CMD_CHECK_RUNNING ();
1003
1004 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1005 {
1006 vty_out (vty, "Advertising Router is not parsable: %s%s",
1007 argv[0], VNL);
1008 return CMD_SUCCESS;
1009 }
1010
1011 argc--;
1012 argv++;
1013
1014 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1015 {
1016 vty_out (vty, "Link state ID is not parsable: %s%s",
1017 argv[1], VNL);
1018 return CMD_SUCCESS;
1019 }
1020
1021 argc--;
1022 argv++;
1023 level = parse_show_level (argc, argv);
1024
1025 for (i = listhead (o->area_list); i; nextnode (i))
1026 {
1027 oa = (struct ospf6_area *) getdata (i);
1028 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1029 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
1030 }
1031
1032 for (i = listhead (o->area_list); i; nextnode (i))
1033 {
1034 oa = (struct ospf6_area *) getdata (i);
1035 for (j = listhead (oa->if_list); j; nextnode (j))
1036 {
1037 oi = (struct ospf6_interface *) getdata (j);
1038 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1039 oi->interface->name, oa->name, VNL, VNL);
1040 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
1041 }
1042 }
1043
1044 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1045 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
1046
1047 vty_out (vty, "%s", VNL);
1048 return CMD_SUCCESS;
1049}
1050
1051ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id,
1052 show_ipv6_ospf6_database_adv_router_linkstate_id_detail_cmd,
1053 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D "
1054 "(detail|dump|internal)",
1055 SHOW_STR
1056 IPV6_STR
1057 OSPF6_STR
1058 "Display Link state database\n"
1059 "Search by Advertising Router\n"
1060 "Specify Advertising Router as IPv4 address notation\n"
1061 "Search by Link state ID\n"
1062 "Specify Link state ID as IPv4 address notation\n"
1063 "Display details of LSAs\n"
1064 "Dump LSAs\n"
1065 "Display LSA's internal information\n"
1066 );
1067
hasso508e53e2004-05-18 18:57:06 +00001068DEFUN (show_ipv6_ospf6_database_type_id_router,
1069 show_ipv6_ospf6_database_type_id_router_cmd,
1070 "show ipv6 ospf6 database "
1071 "(router|network|inter-prefix|inter-router|as-external|"
1072 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D",
1073 SHOW_STR
1074 IPV6_STR
1075 OSPF6_STR
1076 "Display Link state database\n"
1077 "Display Router LSAs\n"
1078 "Display Network LSAs\n"
1079 "Display Inter-Area-Prefix LSAs\n"
1080 "Display Inter-Area-Router LSAs\n"
1081 "Display As-External LSAs\n"
1082 "Display Group-Membership LSAs\n"
1083 "Display Type-7 LSAs\n"
1084 "Display Link LSAs\n"
1085 "Display Intra-Area-Prefix LSAs\n"
1086 "Specify Link state ID as IPv4 address notation\n"
1087 "Specify Advertising Router as IPv4 address notation\n"
1088 )
1089{
hasso049207c2004-08-04 20:02:13 +00001090 int level;
hasso508e53e2004-05-18 18:57:06 +00001091 listnode i, j;
1092 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001093 struct ospf6_area *oa;
1094 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001095 u_int16_t type = 0;
1096 u_int32_t id = 0;
hasso049207c2004-08-04 20:02:13 +00001097 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001098
1099 OSPF6_CMD_CHECK_RUNNING ();
1100
hasso049207c2004-08-04 20:02:13 +00001101 type = parse_type_spec (argc, argv);
1102 argc--;
1103 argv++;
hasso508e53e2004-05-18 18:57:06 +00001104
hasso049207c2004-08-04 20:02:13 +00001105 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001106 {
1107 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001108 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001109 return CMD_SUCCESS;
1110 }
1111
hasso049207c2004-08-04 20:02:13 +00001112 argc--;
1113 argv++;
1114
1115 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001116 {
1117 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001118 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001119 return CMD_SUCCESS;
1120 }
1121
hasso049207c2004-08-04 20:02:13 +00001122 argc--;
1123 argv++;
1124 level = parse_show_level (argc, argv);
1125
1126 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +00001127 {
hasso049207c2004-08-04 20:02:13 +00001128 case OSPF6_LSA_SCOPE_AREA:
1129 for (i = listhead (o->area_list); i; nextnode (i))
1130 {
1131 oa = (struct ospf6_area *) getdata (i);
1132 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1133 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1134 }
1135 break;
1136
1137 case OSPF6_LSA_SCOPE_LINKLOCAL:
1138 for (i = listhead (o->area_list); i; nextnode (i))
1139 {
1140 oa = (struct ospf6_area *) getdata (i);
1141 for (j = listhead (oa->if_list); j; nextnode (j))
1142 {
1143 oi = (struct ospf6_interface *) getdata (j);
1144 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1145 oi->interface->name, oa->name, VNL, VNL);
1146 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1147 }
1148 }
1149 break;
1150
1151 case OSPF6_LSA_SCOPE_AS:
1152 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1153 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1154 break;
1155
1156 default:
1157 assert (0);
1158 break;
hasso508e53e2004-05-18 18:57:06 +00001159 }
1160
hasso049207c2004-08-04 20:02:13 +00001161 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001162 return CMD_SUCCESS;
1163}
1164
1165ALIAS (show_ipv6_ospf6_database_type_id_router,
1166 show_ipv6_ospf6_database_type_id_router_detail_cmd,
1167 "show ipv6 ospf6 database "
1168 "(router|network|inter-prefix|inter-router|as-external|"
1169 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D "
1170 "(dump|internal)",
1171 SHOW_STR
1172 IPV6_STR
1173 OSPF6_STR
1174 "Display Link state database\n"
1175 "Display Router LSAs\n"
1176 "Display Network LSAs\n"
1177 "Display Inter-Area-Prefix LSAs\n"
1178 "Display Inter-Area-Router LSAs\n"
1179 "Display As-External LSAs\n"
1180 "Display Group-Membership LSAs\n"
1181 "Display Type-7 LSAs\n"
1182 "Display Link LSAs\n"
1183 "Display Intra-Area-Prefix LSAs\n"
1184 "Specify Link state ID as IPv4 address notation\n"
1185 "Specify Advertising Router as IPv4 address notation\n"
hasso049207c2004-08-04 20:02:13 +00001186 "Dump LSAs\n"
1187 "Display LSA's internal information\n"
1188 );
1189
1190DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1191 show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd,
1192 "show ipv6 ospf6 database "
1193 "(router|network|inter-prefix|inter-router|as-external|"
1194 "group-membership|type-7|link|intra-prefix) "
1195 "adv-router A.B.C.D linkstate-id A.B.C.D",
1196 SHOW_STR
1197 IPV6_STR
1198 OSPF6_STR
1199 "Display Link state database\n"
1200 "Display Router LSAs\n"
1201 "Display Network LSAs\n"
1202 "Display Inter-Area-Prefix LSAs\n"
1203 "Display Inter-Area-Router LSAs\n"
1204 "Display As-External LSAs\n"
1205 "Display Group-Membership LSAs\n"
1206 "Display Type-7 LSAs\n"
1207 "Display Link LSAs\n"
1208 "Display Intra-Area-Prefix LSAs\n"
1209 "Search by Advertising Router\n"
1210 "Specify Advertising Router as IPv4 address notation\n"
1211 "Search by Link state ID\n"
1212 "Specify Link state ID as IPv4 address notation\n"
1213 )
1214{
1215 int level;
1216 listnode i, j;
1217 struct ospf6 *o = ospf6;
1218 struct ospf6_area *oa;
1219 struct ospf6_interface *oi;
1220 u_int16_t type = 0;
1221 u_int32_t id = 0;
1222 u_int32_t adv_router = 0;
1223
1224 OSPF6_CMD_CHECK_RUNNING ();
1225
1226 type = parse_type_spec (argc, argv);
1227 argc--;
1228 argv++;
1229
1230 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1231 {
1232 vty_out (vty, "Advertising Router is not parsable: %s%s",
1233 argv[0], VNL);
1234 return CMD_SUCCESS;
1235 }
1236
1237 argc--;
1238 argv++;
1239
1240 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1241 {
1242 vty_out (vty, "Link state ID is not parsable: %s%s",
1243 argv[0], VNL);
1244 return CMD_SUCCESS;
1245 }
1246
1247 argc--;
1248 argv++;
1249 level = parse_show_level (argc, argv);
1250
1251 switch (OSPF6_LSA_SCOPE (type))
1252 {
1253 case OSPF6_LSA_SCOPE_AREA:
1254 for (i = listhead (o->area_list); i; nextnode (i))
1255 {
1256 oa = (struct ospf6_area *) getdata (i);
1257 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1258 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1259 }
1260 break;
1261
1262 case OSPF6_LSA_SCOPE_LINKLOCAL:
1263 for (i = listhead (o->area_list); i; nextnode (i))
1264 {
1265 oa = (struct ospf6_area *) getdata (i);
1266 for (j = listhead (oa->if_list); j; nextnode (j))
1267 {
1268 oi = (struct ospf6_interface *) getdata (j);
1269 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1270 oi->interface->name, oa->name, VNL, VNL);
1271 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1272 }
1273 }
1274 break;
1275
1276 case OSPF6_LSA_SCOPE_AS:
1277 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1278 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1279 break;
1280
1281 default:
1282 assert (0);
1283 break;
1284 }
1285
1286 vty_out (vty, "%s", VNL);
1287 return CMD_SUCCESS;
1288}
1289
1290ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1291 show_ipv6_ospf6_database_type_adv_router_linkstate_id_detail_cmd,
1292 "show ipv6 ospf6 database "
1293 "(router|network|inter-prefix|inter-router|as-external|"
1294 "group-membership|type-7|link|intra-prefix) "
1295 "adv-router A.B.C.D linkstate-id A.B.C.D "
1296 "(dump|internal)",
1297 SHOW_STR
1298 IPV6_STR
1299 OSPF6_STR
1300 "Display Link state database\n"
1301 "Display Router LSAs\n"
1302 "Display Network LSAs\n"
1303 "Display Inter-Area-Prefix LSAs\n"
1304 "Display Inter-Area-Router LSAs\n"
1305 "Display As-External LSAs\n"
1306 "Display Group-Membership LSAs\n"
1307 "Display Type-7 LSAs\n"
1308 "Display Link LSAs\n"
1309 "Display Intra-Area-Prefix LSAs\n"
1310 "Search by Advertising Router\n"
1311 "Specify Advertising Router as IPv4 address notation\n"
1312 "Search by Link state ID\n"
1313 "Specify Link state ID as IPv4 address notation\n"
hasso508e53e2004-05-18 18:57:06 +00001314 "Dump LSAs\n"
1315 "Display LSA's internal information\n"
1316 );
1317
1318DEFUN (show_ipv6_ospf6_database_self_originated,
1319 show_ipv6_ospf6_database_self_originated_cmd,
1320 "show ipv6 ospf6 database self-originated",
1321 SHOW_STR
1322 IPV6_STR
1323 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001324 "Display Self-originated LSAs\n"
1325 )
1326{
hasso049207c2004-08-04 20:02:13 +00001327 int level;
hasso508e53e2004-05-18 18:57:06 +00001328 listnode i, j;
1329 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001330 struct ospf6_area *oa;
1331 struct ospf6_interface *oi;
1332 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001333
1334 OSPF6_CMD_CHECK_RUNNING ();
1335
hasso049207c2004-08-04 20:02:13 +00001336 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +00001337
hasso049207c2004-08-04 20:02:13 +00001338 adv_router = o->router_id;
hasso508e53e2004-05-18 18:57:06 +00001339
hasso508e53e2004-05-18 18:57:06 +00001340 for (i = listhead (o->area_list); i; nextnode (i))
1341 {
hasso049207c2004-08-04 20:02:13 +00001342 oa = (struct ospf6_area *) getdata (i);
1343 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1344 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +00001345 }
hasso049207c2004-08-04 20:02:13 +00001346
hasso508e53e2004-05-18 18:57:06 +00001347 for (i = listhead (o->area_list); i; nextnode (i))
1348 {
hasso049207c2004-08-04 20:02:13 +00001349 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +00001350 for (j = listhead (oa->if_list); j; nextnode (j))
1351 {
hasso049207c2004-08-04 20:02:13 +00001352 oi = (struct ospf6_interface *) getdata (j);
1353 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1354 oi->interface->name, oa->name, VNL, VNL);
1355 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +00001356 }
1357 }
1358
hasso049207c2004-08-04 20:02:13 +00001359 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1360 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
1361
1362 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001363 return CMD_SUCCESS;
1364}
1365
1366ALIAS (show_ipv6_ospf6_database_self_originated,
1367 show_ipv6_ospf6_database_self_originated_detail_cmd,
1368 "show ipv6 ospf6 database self-originated "
1369 "(detail|dump|internal)",
1370 SHOW_STR
1371 IPV6_STR
1372 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001373 "Display Self-originated LSAs\n"
1374 "Display details of LSAs\n"
1375 "Dump LSAs\n"
1376 "Display LSA's internal information\n"
hasso049207c2004-08-04 20:02:13 +00001377 )
hasso508e53e2004-05-18 18:57:06 +00001378
1379DEFUN (show_ipv6_ospf6_database_type_self_originated,
1380 show_ipv6_ospf6_database_type_self_originated_cmd,
1381 "show ipv6 ospf6 database "
1382 "(router|network|inter-prefix|inter-router|as-external|"
1383 "group-membership|type-7|link|intra-prefix) self-originated",
1384 SHOW_STR
1385 IPV6_STR
1386 OSPF6_STR
1387 "Display Link state database\n"
1388 "Display Router LSAs\n"
1389 "Display Network LSAs\n"
1390 "Display Inter-Area-Prefix LSAs\n"
1391 "Display Inter-Area-Router LSAs\n"
1392 "Display As-External LSAs\n"
1393 "Display Group-Membership LSAs\n"
1394 "Display Type-7 LSAs\n"
1395 "Display Link LSAs\n"
1396 "Display Intra-Area-Prefix LSAs\n"
1397 "Display Self-originated LSAs\n"
1398 )
1399{
hasso049207c2004-08-04 20:02:13 +00001400 int level;
hasso508e53e2004-05-18 18:57:06 +00001401 listnode i, j;
1402 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001403 struct ospf6_area *oa;
1404 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001405 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +00001406 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001407
1408 OSPF6_CMD_CHECK_RUNNING ();
1409
hasso049207c2004-08-04 20:02:13 +00001410 type = parse_type_spec (argc, argv);
1411 argc--;
1412 argv++;
1413 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +00001414
hasso049207c2004-08-04 20:02:13 +00001415 adv_router = o->router_id;
hasso508e53e2004-05-18 18:57:06 +00001416
hasso049207c2004-08-04 20:02:13 +00001417 switch (OSPF6_LSA_SCOPE (type))
1418 {
1419 case OSPF6_LSA_SCOPE_AREA:
1420 for (i = listhead (o->area_list); i; nextnode (i))
1421 {
1422 oa = (struct ospf6_area *) getdata (i);
1423 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1424 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
1425 }
1426 break;
hasso508e53e2004-05-18 18:57:06 +00001427
hasso049207c2004-08-04 20:02:13 +00001428 case OSPF6_LSA_SCOPE_LINKLOCAL:
1429 for (i = listhead (o->area_list); i; nextnode (i))
1430 {
1431 oa = (struct ospf6_area *) getdata (i);
1432 for (j = listhead (oa->if_list); j; nextnode (j))
1433 {
1434 oi = (struct ospf6_interface *) getdata (j);
1435 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1436 oi->interface->name, oa->name, VNL, VNL);
1437 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
1438 }
1439 }
1440 break;
1441
1442 case OSPF6_LSA_SCOPE_AS:
1443 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1444 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
1445 break;
1446
1447 default:
1448 assert (0);
1449 break;
hasso508e53e2004-05-18 18:57:06 +00001450 }
1451
hasso049207c2004-08-04 20:02:13 +00001452 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001453 return CMD_SUCCESS;
1454}
1455
1456ALIAS (show_ipv6_ospf6_database_type_self_originated,
1457 show_ipv6_ospf6_database_type_self_originated_detail_cmd,
1458 "show ipv6 ospf6 database "
1459 "(router|network|inter-prefix|inter-router|as-external|"
1460 "group-membership|type-7|link|intra-prefix) self-originated "
1461 "(detail|dump|internal)",
1462 SHOW_STR
1463 IPV6_STR
1464 OSPF6_STR
1465 "Display Link state database\n"
1466 "Display Router LSAs\n"
1467 "Display Network LSAs\n"
1468 "Display Inter-Area-Prefix LSAs\n"
1469 "Display Inter-Area-Router LSAs\n"
1470 "Display As-External LSAs\n"
1471 "Display Group-Membership LSAs\n"
1472 "Display Type-7 LSAs\n"
1473 "Display Link LSAs\n"
1474 "Display Intra-Area-Prefix LSAs\n"
1475 "Display Self-originated LSAs\n"
1476 "Display details of LSAs\n"
1477 "Dump LSAs\n"
1478 "Display LSA's internal information\n"
1479 );
1480
hasso049207c2004-08-04 20:02:13 +00001481DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1482 show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd,
1483 "show ipv6 ospf6 database "
1484 "(router|network|inter-prefix|inter-router|as-external|"
1485 "group-membership|type-7|link|intra-prefix) self-originated "
1486 "linkstate-id A.B.C.D",
1487 SHOW_STR
1488 IPV6_STR
1489 OSPF6_STR
1490 "Display Link state database\n"
1491 "Display Router LSAs\n"
1492 "Display Network LSAs\n"
1493 "Display Inter-Area-Prefix LSAs\n"
1494 "Display Inter-Area-Router LSAs\n"
1495 "Display As-External LSAs\n"
1496 "Display Group-Membership LSAs\n"
1497 "Display Type-7 LSAs\n"
1498 "Display Link LSAs\n"
1499 "Display Intra-Area-Prefix LSAs\n"
1500 "Display Self-originated LSAs\n"
1501 "Search by Link state ID\n"
1502 "Specify Link state ID as IPv4 address notation\n"
1503 )
1504{
1505 int level;
1506 listnode i, j;
1507 struct ospf6 *o = ospf6;
1508 struct ospf6_area *oa;
1509 struct ospf6_interface *oi;
1510 u_int16_t type = 0;
1511 u_int32_t adv_router = 0;
1512 u_int32_t id = 0;
1513
1514 OSPF6_CMD_CHECK_RUNNING ();
1515
1516 type = parse_type_spec (argc, argv);
1517 argc--;
1518 argv++;
1519
1520 if ((inet_pton (AF_INET, argv[1], &id)) != 1)
1521 {
1522 vty_out (vty, "Link State ID is not parsable: %s%s",
1523 argv[0], VNL);
1524 return CMD_SUCCESS;
1525 }
1526
1527 argc--;
1528 argv++;
1529 level = parse_show_level (argc, argv);
1530
1531 adv_router = o->router_id;
1532
1533 switch (OSPF6_LSA_SCOPE (type))
1534 {
1535 case OSPF6_LSA_SCOPE_AREA:
1536 for (i = listhead (o->area_list); i; nextnode (i))
1537 {
1538 oa = (struct ospf6_area *) getdata (i);
1539 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1540 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1541 }
1542 break;
1543
1544 case OSPF6_LSA_SCOPE_LINKLOCAL:
1545 for (i = listhead (o->area_list); i; nextnode (i))
1546 {
1547 oa = (struct ospf6_area *) getdata (i);
1548 for (j = listhead (oa->if_list); j; nextnode (j))
1549 {
1550 oi = (struct ospf6_interface *) getdata (j);
1551 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1552 oi->interface->name, oa->name, VNL, VNL);
1553 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1554 }
1555 }
1556 break;
1557
1558 case OSPF6_LSA_SCOPE_AS:
1559 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1560 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1561 break;
1562
1563 default:
1564 assert (0);
1565 break;
1566 }
1567
1568 vty_out (vty, "%s", VNL);
1569 return CMD_SUCCESS;
1570}
1571
1572ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1573 show_ipv6_ospf6_database_type_self_originated_linkstate_id_detail_cmd,
1574 "show ipv6 ospf6 database "
1575 "(router|network|inter-prefix|inter-router|as-external|"
1576 "group-membership|type-7|link|intra-prefix) self-originated "
1577 "linkstate-id A.B.C.D (detail|dump|internal)",
1578 SHOW_STR
1579 IPV6_STR
1580 OSPF6_STR
1581 "Display Link state database\n"
1582 "Display Router LSAs\n"
1583 "Display Network LSAs\n"
1584 "Display Inter-Area-Prefix LSAs\n"
1585 "Display Inter-Area-Router LSAs\n"
1586 "Display As-External LSAs\n"
1587 "Display Group-Membership LSAs\n"
1588 "Display Type-7 LSAs\n"
1589 "Display Link LSAs\n"
1590 "Display Intra-Area-Prefix LSAs\n"
1591 "Display Self-originated LSAs\n"
1592 "Search by Link state ID\n"
1593 "Specify Link state ID as IPv4 address notation\n"
1594 "Display details of LSAs\n"
1595 "Dump LSAs\n"
1596 "Display LSA's internal information\n"
1597 );
1598
hasso508e53e2004-05-18 18:57:06 +00001599DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
1600 show_ipv6_ospf6_database_type_id_self_originated_cmd,
1601 "show ipv6 ospf6 database "
1602 "(router|network|inter-prefix|inter-router|as-external|"
1603 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated",
1604 SHOW_STR
1605 IPV6_STR
1606 OSPF6_STR
1607 "Display Link state database\n"
1608 "Display Router LSAs\n"
1609 "Display Network LSAs\n"
1610 "Display Inter-Area-Prefix LSAs\n"
1611 "Display Inter-Area-Router LSAs\n"
1612 "Display As-External LSAs\n"
1613 "Display Group-Membership LSAs\n"
1614 "Display Type-7 LSAs\n"
1615 "Display Link LSAs\n"
1616 "Display Intra-Area-Prefix LSAs\n"
1617 "Specify Link state ID as IPv4 address notation\n"
1618 "Display Self-originated LSAs\n"
1619 )
1620{
hasso049207c2004-08-04 20:02:13 +00001621 int level;
hasso508e53e2004-05-18 18:57:06 +00001622 listnode i, j;
1623 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001624 struct ospf6_area *oa;
1625 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001626 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +00001627 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001628 u_int32_t id = 0;
1629
1630 OSPF6_CMD_CHECK_RUNNING ();
1631
hasso049207c2004-08-04 20:02:13 +00001632 type = parse_type_spec (argc, argv);
1633 argc--;
1634 argv++;
hasso508e53e2004-05-18 18:57:06 +00001635
1636 if ((inet_pton (AF_INET, argv[1], &id)) != 1)
1637 {
1638 vty_out (vty, "Link State ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001639 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001640 return CMD_SUCCESS;
1641 }
1642
hasso049207c2004-08-04 20:02:13 +00001643 argc--;
1644 argv++;
1645 level = parse_show_level (argc, argv);
1646
1647 adv_router = o->router_id;
1648
1649 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +00001650 {
hasso049207c2004-08-04 20:02:13 +00001651 case OSPF6_LSA_SCOPE_AREA:
1652 for (i = listhead (o->area_list); i; nextnode (i))
1653 {
1654 oa = (struct ospf6_area *) getdata (i);
1655 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1656 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1657 }
1658 break;
1659
1660 case OSPF6_LSA_SCOPE_LINKLOCAL:
1661 for (i = listhead (o->area_list); i; nextnode (i))
1662 {
1663 oa = (struct ospf6_area *) getdata (i);
1664 for (j = listhead (oa->if_list); j; nextnode (j))
1665 {
1666 oi = (struct ospf6_interface *) getdata (j);
1667 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1668 oi->interface->name, oa->name, VNL, VNL);
1669 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1670 }
1671 }
1672 break;
1673
1674 case OSPF6_LSA_SCOPE_AS:
1675 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1676 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1677 break;
1678
1679 default:
1680 assert (0);
1681 break;
hasso508e53e2004-05-18 18:57:06 +00001682 }
1683
hasso049207c2004-08-04 20:02:13 +00001684 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001685 return CMD_SUCCESS;
1686}
1687
1688ALIAS (show_ipv6_ospf6_database_type_id_self_originated,
1689 show_ipv6_ospf6_database_type_id_self_originated_detail_cmd,
1690 "show ipv6 ospf6 database "
1691 "(router|network|inter-prefix|inter-router|as-external|"
1692 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated "
hasso049207c2004-08-04 20:02:13 +00001693 "(detail|dump|internal)",
hasso508e53e2004-05-18 18:57:06 +00001694 SHOW_STR
1695 IPV6_STR
1696 OSPF6_STR
1697 "Display Link state database\n"
1698 "Display Router LSAs\n"
1699 "Display Network LSAs\n"
1700 "Display Inter-Area-Prefix LSAs\n"
1701 "Display Inter-Area-Router LSAs\n"
1702 "Display As-External LSAs\n"
1703 "Display Group-Membership LSAs\n"
1704 "Display Type-7 LSAs\n"
1705 "Display Link LSAs\n"
1706 "Display Intra-Area-Prefix LSAs\n"
hasso508e53e2004-05-18 18:57:06 +00001707 "Display Self-originated LSAs\n"
hasso049207c2004-08-04 20:02:13 +00001708 "Search by Link state ID\n"
1709 "Specify Link state ID as IPv4 address notation\n"
hasso508e53e2004-05-18 18:57:06 +00001710 "Display details of LSAs\n"
1711 "Dump LSAs\n"
1712 "Display LSA's internal information\n"
1713 );
1714
paul718e3742002-12-13 20:15:29 +00001715/* Install ospf related commands. */
1716void
1717ospf6_init ()
1718{
hasso508e53e2004-05-18 18:57:06 +00001719 install_node (&debug_node, config_write_ospf6_debug);
paul718e3742002-12-13 20:15:29 +00001720
hasso508e53e2004-05-18 18:57:06 +00001721 install_element_ospf6_debug_message ();
1722 install_element_ospf6_debug_lsa ();
1723 install_element_ospf6_debug_interface ();
1724 install_element_ospf6_debug_neighbor ();
1725 install_element_ospf6_debug_zebra ();
1726 install_element_ospf6_debug_spf ();
1727 install_element_ospf6_debug_route ();
1728 install_element_ospf6_debug_asbr ();
1729
paul718e3742002-12-13 20:15:29 +00001730 install_element (VIEW_NODE, &show_version_ospf6_cmd);
paul718e3742002-12-13 20:15:29 +00001731 install_element (ENABLE_NODE, &show_version_ospf6_cmd);
hasso049207c2004-08-04 20:02:13 +00001732
1733#define INSTALL(n,c) \
1734 install_element (n ## _NODE, &show_ipv6_ospf6_ ## c);
1735
1736 INSTALL (VIEW, database_cmd);
1737 INSTALL (VIEW, database_detail_cmd);
1738 INSTALL (VIEW, database_type_cmd);
1739 INSTALL (VIEW, database_type_detail_cmd);
1740 INSTALL (VIEW, database_id_cmd);
1741 INSTALL (VIEW, database_id_detail_cmd);
1742 INSTALL (VIEW, database_linkstate_id_cmd);
1743 INSTALL (VIEW, database_linkstate_id_detail_cmd);
1744 INSTALL (VIEW, database_router_cmd);
1745 INSTALL (VIEW, database_router_detail_cmd);
1746 INSTALL (VIEW, database_adv_router_cmd);
1747 INSTALL (VIEW, database_adv_router_detail_cmd);
1748 INSTALL (VIEW, database_type_id_cmd);
1749 INSTALL (VIEW, database_type_id_detail_cmd);
1750 INSTALL (VIEW, database_type_linkstate_id_cmd);
1751 INSTALL (VIEW, database_type_linkstate_id_detail_cmd);
1752 INSTALL (VIEW, database_type_router_cmd);
1753 INSTALL (VIEW, database_type_router_detail_cmd);
1754 INSTALL (VIEW, database_type_adv_router_cmd);
1755 INSTALL (VIEW, database_type_adv_router_detail_cmd);
1756 INSTALL (VIEW, database_adv_router_linkstate_id_cmd);
1757 INSTALL (VIEW, database_adv_router_linkstate_id_detail_cmd);
1758 INSTALL (VIEW, database_id_router_cmd);
1759 INSTALL (VIEW, database_id_router_detail_cmd);
1760 INSTALL (VIEW, database_type_id_router_cmd);
1761 INSTALL (VIEW, database_type_id_router_detail_cmd);
1762 INSTALL (VIEW, database_type_adv_router_linkstate_id_cmd);
1763 INSTALL (VIEW, database_type_adv_router_linkstate_id_detail_cmd);
1764 INSTALL (VIEW, database_self_originated_cmd);
1765 INSTALL (VIEW, database_self_originated_detail_cmd);
1766 INSTALL (VIEW, database_type_self_originated_cmd);
1767 INSTALL (VIEW, database_type_self_originated_detail_cmd);
1768 INSTALL (VIEW, database_type_id_self_originated_cmd);
1769 INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
1770 INSTALL (VIEW, database_type_self_originated_linkstate_id_cmd);
1771 INSTALL (VIEW, database_type_self_originated_linkstate_id_detail_cmd);
1772 INSTALL (VIEW, database_type_id_self_originated_cmd);
1773 INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
1774
1775 INSTALL (ENABLE, database_cmd);
1776 INSTALL (ENABLE, database_detail_cmd);
1777 INSTALL (ENABLE, database_type_cmd);
1778 INSTALL (ENABLE, database_type_detail_cmd);
1779 INSTALL (ENABLE, database_id_cmd);
1780 INSTALL (ENABLE, database_id_detail_cmd);
1781 INSTALL (ENABLE, database_linkstate_id_cmd);
1782 INSTALL (ENABLE, database_linkstate_id_detail_cmd);
1783 INSTALL (ENABLE, database_router_cmd);
1784 INSTALL (ENABLE, database_router_detail_cmd);
1785 INSTALL (ENABLE, database_adv_router_cmd);
1786 INSTALL (ENABLE, database_adv_router_detail_cmd);
1787 INSTALL (ENABLE, database_type_id_cmd);
1788 INSTALL (ENABLE, database_type_id_detail_cmd);
1789 INSTALL (ENABLE, database_type_linkstate_id_cmd);
1790 INSTALL (ENABLE, database_type_linkstate_id_detail_cmd);
1791 INSTALL (ENABLE, database_type_router_cmd);
1792 INSTALL (ENABLE, database_type_router_detail_cmd);
1793 INSTALL (ENABLE, database_type_adv_router_cmd);
1794 INSTALL (ENABLE, database_type_adv_router_detail_cmd);
1795 INSTALL (ENABLE, database_adv_router_linkstate_id_cmd);
1796 INSTALL (ENABLE, database_adv_router_linkstate_id_detail_cmd);
1797 INSTALL (ENABLE, database_id_router_cmd);
1798 INSTALL (ENABLE, database_id_router_detail_cmd);
1799 INSTALL (ENABLE, database_type_id_router_cmd);
1800 INSTALL (ENABLE, database_type_id_router_detail_cmd);
1801 INSTALL (ENABLE, database_type_adv_router_linkstate_id_cmd);
1802 INSTALL (ENABLE, database_type_adv_router_linkstate_id_detail_cmd);
1803 INSTALL (ENABLE, database_self_originated_cmd);
1804 INSTALL (ENABLE, database_self_originated_detail_cmd);
1805 INSTALL (ENABLE, database_type_self_originated_cmd);
1806 INSTALL (ENABLE, database_type_self_originated_detail_cmd);
1807 INSTALL (ENABLE, database_type_id_self_originated_cmd);
1808 INSTALL (ENABLE, database_type_id_self_originated_detail_cmd);
1809 INSTALL (ENABLE, database_type_self_originated_linkstate_id_cmd);
1810 INSTALL (ENABLE, database_type_self_originated_linkstate_id_detail_cmd);
1811 INSTALL (ENABLE, database_type_id_self_originated_cmd);
1812 INSTALL (ENABLE, database_type_id_self_originated_detail_cmd);
paul718e3742002-12-13 20:15:29 +00001813
1814 ospf6_top_init ();
1815 ospf6_area_init ();
1816 ospf6_interface_init ();
1817 ospf6_neighbor_init ();
1818 ospf6_zebra_init ();
1819
hasso508e53e2004-05-18 18:57:06 +00001820 ospf6_lsa_init ();
paul718e3742002-12-13 20:15:29 +00001821 ospf6_spf_init ();
paul718e3742002-12-13 20:15:29 +00001822 ospf6_intra_init ();
paul718e3742002-12-13 20:15:29 +00001823 ospf6_asbr_init ();
hasso049207c2004-08-04 20:02:13 +00001824 ospf6_abr_init ();
hasso508e53e2004-05-18 18:57:06 +00001825
1826 /* Make ospf protocol socket. */
1827 ospf6_serv_sock ();
1828 thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
paul718e3742002-12-13 20:15:29 +00001829}
1830
paul718e3742002-12-13 20:15:29 +00001831