blob: a67600a021555ef736040d8ea69d40f71271b429 [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 +000053struct route_node *
54route_prev (struct route_node *node)
paul718e3742002-12-13 20:15:29 +000055{
hasso508e53e2004-05-18 18:57:06 +000056 struct route_node *end;
57 struct route_node *prev = NULL;
paul718e3742002-12-13 20:15:29 +000058
hasso508e53e2004-05-18 18:57:06 +000059 end = node;
60 node = node->parent;
hasso3b687352004-08-19 06:56:53 +000061 if (node)
62 route_lock_node (node);
hasso508e53e2004-05-18 18:57:06 +000063 while (node)
64 {
65 prev = node;
hasso3b687352004-08-19 06:56:53 +000066 node = route_next (node);
67 if (node == end)
68 {
69 route_unlock_node (node);
70 node = NULL;
71 }
hasso508e53e2004-05-18 18:57:06 +000072 }
73 route_unlock_node (end);
hasso3b687352004-08-19 06:56:53 +000074 if (prev)
75 route_lock_node (prev);
hasso508e53e2004-05-18 18:57:06 +000076
77 return prev;
paul718e3742002-12-13 20:15:29 +000078}
79
hasso6452df02004-08-15 05:52:07 +000080
81/* show database functions */
paul718e3742002-12-13 20:15:29 +000082DEFUN (show_version_ospf6,
83 show_version_ospf6_cmd,
84 "show version ospf6",
85 SHOW_STR
hasso508e53e2004-05-18 18:57:06 +000086 "Displays ospf6d version\n"
87 )
paul718e3742002-12-13 20:15:29 +000088{
89 vty_out (vty, "Zebra OSPF6d Version: %s%s",
hasso049207c2004-08-04 20:02:13 +000090 ospf6_daemon_version, VNL);
paul718e3742002-12-13 20:15:29 +000091
92 return CMD_SUCCESS;
93}
94
hasso508e53e2004-05-18 18:57:06 +000095struct cmd_node debug_node =
paul718e3742002-12-13 20:15:29 +000096{
hasso508e53e2004-05-18 18:57:06 +000097 DEBUG_NODE,
hasso69b4a812004-08-26 18:10:36 +000098 "",
99 1 /* VTYSH */
hasso508e53e2004-05-18 18:57:06 +0000100};
paul718e3742002-12-13 20:15:29 +0000101
102int
hasso508e53e2004-05-18 18:57:06 +0000103config_write_ospf6_debug (struct vty *vty)
paul718e3742002-12-13 20:15:29 +0000104{
hasso508e53e2004-05-18 18:57:06 +0000105 config_write_ospf6_debug_message (vty);
106 config_write_ospf6_debug_lsa (vty);
107 config_write_ospf6_debug_zebra (vty);
108 config_write_ospf6_debug_interface (vty);
109 config_write_ospf6_debug_neighbor (vty);
110 config_write_ospf6_debug_spf (vty);
111 config_write_ospf6_debug_route (vty);
112 config_write_ospf6_debug_asbr (vty);
hasso049207c2004-08-04 20:02:13 +0000113 config_write_ospf6_debug_abr (vty);
114 vty_out (vty, "!%s", VNL);
paul718e3742002-12-13 20:15:29 +0000115 return 0;
116}
117
hasso049207c2004-08-04 20:02:13 +0000118#define AREA_LSDB_TITLE_FORMAT \
119 "%s Area Scoped Link State Database (Area %s)%s%s"
120#define IF_LSDB_TITLE_FORMAT \
121 "%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s"
122#define AS_LSDB_TITLE_FORMAT \
123 "%s AS Scoped Link State Database%s%s"
124
125static int
126parse_show_level (int argc, char **argv)
127{
hasso6452df02004-08-15 05:52:07 +0000128 int level = 0;
hasso049207c2004-08-04 20:02:13 +0000129 if (argc)
130 {
131 if (! strncmp (argv[0], "de", 2))
132 level = OSPF6_LSDB_SHOW_LEVEL_DETAIL;
133 else if (! strncmp (argv[0], "du", 2))
134 level = OSPF6_LSDB_SHOW_LEVEL_DUMP;
135 else if (! strncmp (argv[0], "in", 2))
136 level = OSPF6_LSDB_SHOW_LEVEL_INTERNAL;
137 }
138 else
139 level = OSPF6_LSDB_SHOW_LEVEL_NORMAL;
140 return level;
141}
142
143static u_int16_t
144parse_type_spec (int argc, char **argv)
145{
hasso6452df02004-08-15 05:52:07 +0000146 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +0000147 assert (argc);
148 if (! strcmp (argv[0], "router"))
149 type = htons (OSPF6_LSTYPE_ROUTER);
150 else if (! strcmp (argv[0], "network"))
151 type = htons (OSPF6_LSTYPE_NETWORK);
152 else if (! strcmp (argv[0], "as-external"))
153 type = htons (OSPF6_LSTYPE_AS_EXTERNAL);
154 else if (! strcmp (argv[0], "intra-prefix"))
155 type = htons (OSPF6_LSTYPE_INTRA_PREFIX);
156 else if (! strcmp (argv[0], "inter-router"))
157 type = htons (OSPF6_LSTYPE_INTER_ROUTER);
158 else if (! strcmp (argv[0], "inter-prefix"))
159 type = htons (OSPF6_LSTYPE_INTER_PREFIX);
160 else if (! strcmp (argv[0], "link"))
161 type = htons (OSPF6_LSTYPE_LINK);
162 return type;
163}
164
hasso508e53e2004-05-18 18:57:06 +0000165DEFUN (show_ipv6_ospf6_database,
166 show_ipv6_ospf6_database_cmd,
167 "show ipv6 ospf6 database",
168 SHOW_STR
169 IPV6_STR
170 OSPF6_STR
171 "Display Link state database\n"
172 )
paul718e3742002-12-13 20:15:29 +0000173{
hasso049207c2004-08-04 20:02:13 +0000174 int level;
hasso508e53e2004-05-18 18:57:06 +0000175 listnode i, j;
176 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000177 struct ospf6_area *oa;
178 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000179
180 OSPF6_CMD_CHECK_RUNNING ();
181
hasso049207c2004-08-04 20:02:13 +0000182 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +0000183
hasso508e53e2004-05-18 18:57:06 +0000184 for (i = listhead (o->area_list); i; nextnode (i))
185 {
hasso049207c2004-08-04 20:02:13 +0000186 oa = (struct ospf6_area *) getdata (i);
187 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
188 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000189 }
hasso049207c2004-08-04 20:02:13 +0000190
hasso508e53e2004-05-18 18:57:06 +0000191 for (i = listhead (o->area_list); i; nextnode (i))
192 {
hasso049207c2004-08-04 20:02:13 +0000193 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000194 for (j = listhead (oa->if_list); j; nextnode (j))
195 {
hasso049207c2004-08-04 20:02:13 +0000196 oi = (struct ospf6_interface *) getdata (j);
197 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
198 oi->interface->name, oa->name, VNL, VNL);
199 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000200 }
201 }
202
hasso049207c2004-08-04 20:02:13 +0000203 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
204 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb);
205
206 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000207 return CMD_SUCCESS;
208}
209
210ALIAS (show_ipv6_ospf6_database,
211 show_ipv6_ospf6_database_detail_cmd,
212 "show ipv6 ospf6 database (detail|dump|internal)",
213 SHOW_STR
214 IPV6_STR
215 OSPF6_STR
216 "Display Link state database\n"
217 "Display details of LSAs\n"
218 "Dump LSAs\n"
219 "Display LSA's internal information\n"
220 );
221
222DEFUN (show_ipv6_ospf6_database_type,
223 show_ipv6_ospf6_database_type_cmd,
224 "show ipv6 ospf6 database "
225 "(router|network|inter-prefix|inter-router|as-external|"
226 "group-membership|type-7|link|intra-prefix)",
227 SHOW_STR
228 IPV6_STR
229 OSPF6_STR
230 "Display Link state database\n"
231 "Display Router LSAs\n"
232 "Display Network LSAs\n"
233 "Display Inter-Area-Prefix LSAs\n"
234 "Display Inter-Area-Router LSAs\n"
235 "Display As-External LSAs\n"
236 "Display Group-Membership LSAs\n"
237 "Display Type-7 LSAs\n"
238 "Display Link LSAs\n"
239 "Display Intra-Area-Prefix LSAs\n"
240 )
241{
hasso049207c2004-08-04 20:02:13 +0000242 int level;
hasso508e53e2004-05-18 18:57:06 +0000243 listnode i, j;
244 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000245 struct ospf6_area *oa;
246 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000247 u_int16_t type = 0;
248
249 OSPF6_CMD_CHECK_RUNNING ();
250
hasso049207c2004-08-04 20:02:13 +0000251 type = parse_type_spec (argc, argv);
252 argc--;
253 argv++;
254 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +0000255
hasso049207c2004-08-04 20:02:13 +0000256 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000257 {
hasso6452df02004-08-15 05:52:07 +0000258 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +0000259 for (i = listhead (o->area_list); i; nextnode (i))
260 {
261 oa = (struct ospf6_area *) getdata (i);
262 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
263 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
264 }
265 break;
266
hasso6452df02004-08-15 05:52:07 +0000267 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +0000268 for (i = listhead (o->area_list); i; nextnode (i))
269 {
270 oa = (struct ospf6_area *) getdata (i);
271 for (j = listhead (oa->if_list); j; nextnode (j))
272 {
273 oi = (struct ospf6_interface *) getdata (j);
274 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
275 oi->interface->name, oa->name, VNL, VNL);
276 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
277 }
278 }
279 break;
280
hasso6452df02004-08-15 05:52:07 +0000281 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000282 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
283 ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb);
284 break;
285
286 default:
287 assert (0);
288 break;
hasso508e53e2004-05-18 18:57:06 +0000289 }
290
hasso049207c2004-08-04 20:02:13 +0000291 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000292 return CMD_SUCCESS;
293}
294
295ALIAS (show_ipv6_ospf6_database_type,
296 show_ipv6_ospf6_database_type_detail_cmd,
297 "show ipv6 ospf6 database "
298 "(router|network|inter-prefix|inter-router|as-external|"
299 "group-membership|type-7|link|intra-prefix) "
300 "(detail|dump|internal)",
301 SHOW_STR
302 IPV6_STR
303 OSPF6_STR
304 "Display Link state database\n"
305 "Display Router LSAs\n"
306 "Display Network LSAs\n"
307 "Display Inter-Area-Prefix LSAs\n"
308 "Display Inter-Area-Router LSAs\n"
309 "Display As-External LSAs\n"
310 "Display Group-Membership LSAs\n"
311 "Display Type-7 LSAs\n"
312 "Display Link LSAs\n"
313 "Display Intra-Area-Prefix LSAs\n"
314 "Display details of LSAs\n"
315 "Dump LSAs\n"
316 "Display LSA's internal information\n"
317 );
318
319DEFUN (show_ipv6_ospf6_database_id,
320 show_ipv6_ospf6_database_id_cmd,
321 "show ipv6 ospf6 database * A.B.C.D",
322 SHOW_STR
323 IPV6_STR
324 OSPF6_STR
325 "Display Link state database\n"
326 "Any Link state Type\n"
327 "Specify Link state ID as IPv4 address notation\n"
328 )
329{
hasso049207c2004-08-04 20:02:13 +0000330 int level;
hasso508e53e2004-05-18 18:57:06 +0000331 listnode i, j;
332 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000333 struct ospf6_area *oa;
334 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000335 u_int32_t id = 0;
336
337 OSPF6_CMD_CHECK_RUNNING ();
338
hasso508e53e2004-05-18 18:57:06 +0000339 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
340 {
341 vty_out (vty, "Link State ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000342 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000343 return CMD_SUCCESS;
344 }
345
hasso049207c2004-08-04 20:02:13 +0000346 argc--;
347 argv++;
348 level = parse_show_level (argc, argv);
349
hasso508e53e2004-05-18 18:57:06 +0000350 for (i = listhead (o->area_list); i; nextnode (i))
351 {
hasso049207c2004-08-04 20:02:13 +0000352 oa = (struct ospf6_area *) getdata (i);
353 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
354 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000355 }
hasso049207c2004-08-04 20:02:13 +0000356
hasso508e53e2004-05-18 18:57:06 +0000357 for (i = listhead (o->area_list); i; nextnode (i))
358 {
hasso049207c2004-08-04 20:02:13 +0000359 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000360 for (j = listhead (oa->if_list); j; nextnode (j))
361 {
hasso049207c2004-08-04 20:02:13 +0000362 oi = (struct ospf6_interface *) getdata (j);
363 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
364 oi->interface->name, oa->name, VNL, VNL);
365 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000366 }
367 }
368
hasso049207c2004-08-04 20:02:13 +0000369 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
370 ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb);
371
372 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000373 return CMD_SUCCESS;
374}
375
376ALIAS (show_ipv6_ospf6_database_id,
377 show_ipv6_ospf6_database_id_detail_cmd,
378 "show ipv6 ospf6 database * A.B.C.D "
379 "(detail|dump|internal)",
380 SHOW_STR
381 IPV6_STR
382 OSPF6_STR
383 "Display Link state database\n"
384 "Any Link state Type\n"
hasso049207c2004-08-04 20:02:13 +0000385 "Specify Link state ID as IPv4 address notation\n"
386 "Display details of LSAs\n"
387 "Dump LSAs\n"
388 "Display LSA's internal information\n"
389 );
390
391ALIAS (show_ipv6_ospf6_database_id,
392 show_ipv6_ospf6_database_linkstate_id_cmd,
393 "show ipv6 ospf6 database linkstate-id A.B.C.D",
394 SHOW_STR
395 IPV6_STR
396 OSPF6_STR
397 "Display Link state database\n"
398 "Search by Link state ID\n"
399 "Specify Link state ID as IPv4 address notation\n"
400 );
401
402ALIAS (show_ipv6_ospf6_database_id,
403 show_ipv6_ospf6_database_linkstate_id_detail_cmd,
404 "show ipv6 ospf6 database linkstate-id A.B.C.D "
405 "(detail|dump|internal)",
406 SHOW_STR
407 IPV6_STR
408 OSPF6_STR
409 "Display Link state database\n"
410 "Search by Link state ID\n"
hasso508e53e2004-05-18 18:57:06 +0000411 "Specify Link state ID as IPv4 address notation\n"
412 "Display details of LSAs\n"
413 "Dump LSAs\n"
414 "Display LSA's internal information\n"
415 );
416
417DEFUN (show_ipv6_ospf6_database_router,
418 show_ipv6_ospf6_database_router_cmd,
419 "show ipv6 ospf6 database * * A.B.C.D",
420 SHOW_STR
421 IPV6_STR
422 OSPF6_STR
423 "Display Link state database\n"
424 "Any Link state Type\n"
425 "Any Link state ID\n"
426 "Specify Advertising Router as IPv4 address notation\n"
427 )
428{
hasso049207c2004-08-04 20:02:13 +0000429 int level;
hasso508e53e2004-05-18 18:57:06 +0000430 listnode i, j;
431 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000432 struct ospf6_area *oa;
433 struct ospf6_interface *oi;
434 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000435
436 OSPF6_CMD_CHECK_RUNNING ();
437
hasso049207c2004-08-04 20:02:13 +0000438 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000439 {
440 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000441 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000442 return CMD_SUCCESS;
443 }
444
hasso049207c2004-08-04 20:02:13 +0000445 argc--;
446 argv++;
447 level = parse_show_level (argc, argv);
448
hasso508e53e2004-05-18 18:57:06 +0000449 for (i = listhead (o->area_list); i; nextnode (i))
450 {
hasso049207c2004-08-04 20:02:13 +0000451 oa = (struct ospf6_area *) getdata (i);
452 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
453 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000454 }
hasso049207c2004-08-04 20:02:13 +0000455
hasso508e53e2004-05-18 18:57:06 +0000456 for (i = listhead (o->area_list); i; nextnode (i))
457 {
hasso049207c2004-08-04 20:02:13 +0000458 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000459 for (j = listhead (oa->if_list); j; nextnode (j))
460 {
hasso049207c2004-08-04 20:02:13 +0000461 oi = (struct ospf6_interface *) getdata (j);
462 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
463 oi->interface->name, oa->name, VNL, VNL);
464 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000465 }
466 }
467
hasso049207c2004-08-04 20:02:13 +0000468 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
469 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
470
471 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000472 return CMD_SUCCESS;
473}
474
475ALIAS (show_ipv6_ospf6_database_router,
476 show_ipv6_ospf6_database_router_detail_cmd,
477 "show ipv6 ospf6 database * * A.B.C.D "
478 "(detail|dump|internal)",
479 SHOW_STR
480 IPV6_STR
481 OSPF6_STR
482 "Display Link state database\n"
483 "Any Link state Type\n"
484 "Any Link state ID\n"
485 "Specify Advertising Router as IPv4 address notation\n"
486 "Display details of LSAs\n"
487 "Dump LSAs\n"
488 "Display LSA's internal information\n"
489 );
490
hasso049207c2004-08-04 20:02:13 +0000491ALIAS (show_ipv6_ospf6_database_router,
492 show_ipv6_ospf6_database_adv_router_cmd,
493 "show ipv6 ospf6 database adv-router A.B.C.D",
494 SHOW_STR
495 IPV6_STR
496 OSPF6_STR
497 "Display Link state database\n"
498 "Search by Advertising Router\n"
499 "Specify Advertising Router as IPv4 address notation\n"
500 );
501
502ALIAS (show_ipv6_ospf6_database_router,
503 show_ipv6_ospf6_database_adv_router_detail_cmd,
504 "show ipv6 ospf6 database adv-router A.B.C.D "
505 "(detail|dump|internal)",
506 SHOW_STR
507 IPV6_STR
508 OSPF6_STR
509 "Display Link state database\n"
510 "Search by Advertising Router\n"
511 "Specify Advertising Router as IPv4 address notation\n"
512 "Display details of LSAs\n"
513 "Dump LSAs\n"
514 "Display LSA's internal information\n"
515 );
516
hasso508e53e2004-05-18 18:57:06 +0000517DEFUN (show_ipv6_ospf6_database_type_id,
518 show_ipv6_ospf6_database_type_id_cmd,
519 "show ipv6 ospf6 database "
520 "(router|network|inter-prefix|inter-router|as-external|"
521 "group-membership|type-7|link|intra-prefix) A.B.C.D",
522 SHOW_STR
523 IPV6_STR
524 OSPF6_STR
525 "Display Link state database\n"
526 "Display Router LSAs\n"
527 "Display Network LSAs\n"
528 "Display Inter-Area-Prefix LSAs\n"
529 "Display Inter-Area-Router LSAs\n"
530 "Display As-External LSAs\n"
531 "Display Group-Membership LSAs\n"
532 "Display Type-7 LSAs\n"
533 "Display Link LSAs\n"
534 "Display Intra-Area-Prefix LSAs\n"
535 "Specify Link state ID as IPv4 address notation\n"
536 )
537{
hasso049207c2004-08-04 20:02:13 +0000538 int level;
hasso508e53e2004-05-18 18:57:06 +0000539 listnode i, j;
540 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000541 struct ospf6_area *oa;
542 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000543 u_int16_t type = 0;
544 u_int32_t id = 0;
545
546 OSPF6_CMD_CHECK_RUNNING ();
547
hasso049207c2004-08-04 20:02:13 +0000548 type = parse_type_spec (argc, argv);
549 argc--;
550 argv++;
hasso508e53e2004-05-18 18:57:06 +0000551
hasso049207c2004-08-04 20:02:13 +0000552 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000553 {
554 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000555 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000556 return CMD_SUCCESS;
557 }
558
hasso049207c2004-08-04 20:02:13 +0000559 argc--;
560 argv++;
561 level = parse_show_level (argc, argv);
562
563 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000564 {
hasso6452df02004-08-15 05:52:07 +0000565 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +0000566 for (i = listhead (o->area_list); i; nextnode (i))
567 {
568 oa = (struct ospf6_area *) getdata (i);
569 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
570 ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
571 }
572 break;
573
hasso6452df02004-08-15 05:52:07 +0000574 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +0000575 for (i = listhead (o->area_list); i; nextnode (i))
576 {
577 oa = (struct ospf6_area *) getdata (i);
578 for (j = listhead (oa->if_list); j; nextnode (j))
579 {
580 oi = (struct ospf6_interface *) getdata (j);
581 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
582 oi->interface->name, oa->name, VNL, VNL);
583 ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
584 }
585 }
586 break;
587
hasso6452df02004-08-15 05:52:07 +0000588 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000589 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
590 ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb);
591 break;
592
593 default:
594 assert (0);
595 break;
hasso508e53e2004-05-18 18:57:06 +0000596 }
597
hasso049207c2004-08-04 20:02:13 +0000598 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000599 return CMD_SUCCESS;
600}
601
602ALIAS (show_ipv6_ospf6_database_type_id,
603 show_ipv6_ospf6_database_type_id_detail_cmd,
604 "show ipv6 ospf6 database "
605 "(router|network|inter-prefix|inter-router|as-external|"
606 "group-membership|type-7|link|intra-prefix) A.B.C.D "
607 "(detail|dump|internal)",
608 SHOW_STR
609 IPV6_STR
610 OSPF6_STR
611 "Display Link state database\n"
612 "Display Router LSAs\n"
613 "Display Network LSAs\n"
614 "Display Inter-Area-Prefix LSAs\n"
615 "Display Inter-Area-Router LSAs\n"
616 "Display As-External LSAs\n"
617 "Display Group-Membership LSAs\n"
618 "Display Type-7 LSAs\n"
619 "Display Link LSAs\n"
620 "Display Intra-Area-Prefix LSAs\n"
621 "Specify Link state ID as IPv4 address notation\n"
622 "Display details of LSAs\n"
623 "Dump LSAs\n"
624 "Display LSA's internal information\n"
625 );
626
hasso049207c2004-08-04 20:02:13 +0000627ALIAS (show_ipv6_ospf6_database_type_id,
628 show_ipv6_ospf6_database_type_linkstate_id_cmd,
629 "show ipv6 ospf6 database "
630 "(router|network|inter-prefix|inter-router|as-external|"
631 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D",
632 SHOW_STR
633 IPV6_STR
634 OSPF6_STR
635 "Display Link state database\n"
636 "Display Router LSAs\n"
637 "Display Network LSAs\n"
638 "Display Inter-Area-Prefix LSAs\n"
639 "Display Inter-Area-Router LSAs\n"
640 "Display As-External LSAs\n"
641 "Display Group-Membership LSAs\n"
642 "Display Type-7 LSAs\n"
643 "Display Link LSAs\n"
644 "Display Intra-Area-Prefix LSAs\n"
645 "Search by Link state ID\n"
646 "Specify Link state ID as IPv4 address notation\n"
647 );
648
649ALIAS (show_ipv6_ospf6_database_type_id,
650 show_ipv6_ospf6_database_type_linkstate_id_detail_cmd,
651 "show ipv6 ospf6 database "
652 "(router|network|inter-prefix|inter-router|as-external|"
653 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D "
654 "(detail|dump|internal)",
655 SHOW_STR
656 IPV6_STR
657 OSPF6_STR
658 "Display Link state database\n"
659 "Display Router LSAs\n"
660 "Display Network LSAs\n"
661 "Display Inter-Area-Prefix LSAs\n"
662 "Display Inter-Area-Router LSAs\n"
663 "Display As-External LSAs\n"
664 "Display Group-Membership LSAs\n"
665 "Display Type-7 LSAs\n"
666 "Display Link LSAs\n"
667 "Display Intra-Area-Prefix LSAs\n"
668 "Search by Link state ID\n"
669 "Specify Link state ID as IPv4 address notation\n"
670 "Display details of LSAs\n"
671 "Dump LSAs\n"
672 "Display LSA's internal information\n"
673 );
674
hasso508e53e2004-05-18 18:57:06 +0000675DEFUN (show_ipv6_ospf6_database_type_router,
676 show_ipv6_ospf6_database_type_router_cmd,
677 "show ipv6 ospf6 database "
678 "(router|network|inter-prefix|inter-router|as-external|"
679 "group-membership|type-7|link|intra-prefix) * A.B.C.D",
680 SHOW_STR
681 IPV6_STR
682 OSPF6_STR
683 "Display Link state database\n"
684 "Display Router LSAs\n"
685 "Display Network LSAs\n"
686 "Display Inter-Area-Prefix LSAs\n"
687 "Display Inter-Area-Router LSAs\n"
688 "Display As-External LSAs\n"
689 "Display Group-Membership LSAs\n"
690 "Display Type-7 LSAs\n"
691 "Display Link LSAs\n"
692 "Display Intra-Area-Prefix LSAs\n"
693 "Any Link state ID\n"
694 "Specify Advertising Router as IPv4 address notation\n"
695 )
696{
hasso049207c2004-08-04 20:02:13 +0000697 int level;
hasso508e53e2004-05-18 18:57:06 +0000698 listnode i, j;
699 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000700 struct ospf6_area *oa;
701 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000702 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +0000703 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000704
705 OSPF6_CMD_CHECK_RUNNING ();
706
hasso049207c2004-08-04 20:02:13 +0000707 type = parse_type_spec (argc, argv);
708 argc--;
709 argv++;
hasso508e53e2004-05-18 18:57:06 +0000710
hasso049207c2004-08-04 20:02:13 +0000711 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000712 {
713 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000714 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000715 return CMD_SUCCESS;
716 }
717
hasso049207c2004-08-04 20:02:13 +0000718 argc--;
719 argv++;
720 level = parse_show_level (argc, argv);
721
722 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000723 {
hasso6452df02004-08-15 05:52:07 +0000724 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +0000725 for (i = listhead (o->area_list); i; nextnode (i))
726 {
727 oa = (struct ospf6_area *) getdata (i);
728 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
729 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
730 }
731 break;
732
hasso6452df02004-08-15 05:52:07 +0000733 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +0000734 for (i = listhead (o->area_list); i; nextnode (i))
735 {
736 oa = (struct ospf6_area *) getdata (i);
737 for (j = listhead (oa->if_list); j; nextnode (j))
738 {
739 oi = (struct ospf6_interface *) getdata (j);
740 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
741 oi->interface->name, oa->name, VNL, VNL);
742 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
743 }
744 }
745 break;
746
hasso6452df02004-08-15 05:52:07 +0000747 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000748 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
749 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
750 break;
751
752 default:
753 assert (0);
754 break;
hasso508e53e2004-05-18 18:57:06 +0000755 }
756
hasso049207c2004-08-04 20:02:13 +0000757 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000758 return CMD_SUCCESS;
759}
760
761ALIAS (show_ipv6_ospf6_database_type_router,
762 show_ipv6_ospf6_database_type_router_detail_cmd,
763 "show ipv6 ospf6 database "
764 "(router|network|inter-prefix|inter-router|as-external|"
765 "group-membership|type-7|link|intra-prefix) * A.B.C.D "
766 "(detail|dump|internal)",
767 SHOW_STR
768 IPV6_STR
769 OSPF6_STR
770 "Display Link state database\n"
771 "Display Router LSAs\n"
772 "Display Network LSAs\n"
773 "Display Inter-Area-Prefix LSAs\n"
774 "Display Inter-Area-Router LSAs\n"
775 "Display As-External LSAs\n"
776 "Display Group-Membership LSAs\n"
777 "Display Type-7 LSAs\n"
778 "Display Link LSAs\n"
779 "Display Intra-Area-Prefix LSAs\n"
780 "Any Link state ID\n"
781 "Specify Advertising Router as IPv4 address notation\n"
782 "Display details of LSAs\n"
783 "Dump LSAs\n"
784 "Display LSA's internal information\n"
785 );
786
hasso049207c2004-08-04 20:02:13 +0000787ALIAS (show_ipv6_ospf6_database_type_router,
788 show_ipv6_ospf6_database_type_adv_router_cmd,
789 "show ipv6 ospf6 database "
790 "(router|network|inter-prefix|inter-router|as-external|"
791 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D",
792 SHOW_STR
793 IPV6_STR
794 OSPF6_STR
795 "Display Link state database\n"
796 "Display Router LSAs\n"
797 "Display Network LSAs\n"
798 "Display Inter-Area-Prefix LSAs\n"
799 "Display Inter-Area-Router LSAs\n"
800 "Display As-External LSAs\n"
801 "Display Group-Membership LSAs\n"
802 "Display Type-7 LSAs\n"
803 "Display Link LSAs\n"
804 "Display Intra-Area-Prefix LSAs\n"
805 "Search by Advertising Router\n"
806 "Specify Advertising Router as IPv4 address notation\n"
807 );
808
809ALIAS (show_ipv6_ospf6_database_type_router,
810 show_ipv6_ospf6_database_type_adv_router_detail_cmd,
811 "show ipv6 ospf6 database "
812 "(router|network|inter-prefix|inter-router|as-external|"
813 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D "
814 "(detail|dump|internal)",
815 SHOW_STR
816 IPV6_STR
817 OSPF6_STR
818 "Display Link state database\n"
819 "Display Router LSAs\n"
820 "Display Network LSAs\n"
821 "Display Inter-Area-Prefix LSAs\n"
822 "Display Inter-Area-Router LSAs\n"
823 "Display As-External LSAs\n"
824 "Display Group-Membership LSAs\n"
825 "Display Type-7 LSAs\n"
826 "Display Link LSAs\n"
827 "Display Intra-Area-Prefix LSAs\n"
828 "Search by Advertising Router\n"
829 "Specify Advertising Router as IPv4 address notation\n"
830 "Display details of LSAs\n"
831 "Dump LSAs\n"
832 "Display LSA's internal information\n"
833 );
834
hasso508e53e2004-05-18 18:57:06 +0000835DEFUN (show_ipv6_ospf6_database_id_router,
836 show_ipv6_ospf6_database_id_router_cmd,
837 "show ipv6 ospf6 database * A.B.C.D A.B.C.D",
838 SHOW_STR
839 IPV6_STR
840 OSPF6_STR
841 "Display Link state database\n"
842 "Any Link state Type\n"
843 "Specify Link state ID as IPv4 address notation\n"
844 "Specify Advertising Router as IPv4 address notation\n"
845 )
846{
hasso049207c2004-08-04 20:02:13 +0000847 int level;
hasso508e53e2004-05-18 18:57:06 +0000848 listnode i, j;
849 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000850 struct ospf6_area *oa;
851 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000852 u_int32_t id = 0;
hasso049207c2004-08-04 20:02:13 +0000853 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000854
855 OSPF6_CMD_CHECK_RUNNING ();
856
hasso508e53e2004-05-18 18:57:06 +0000857 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
858 {
859 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso6452df02004-08-15 05:52:07 +0000860 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000861 return CMD_SUCCESS;
862 }
863
hasso049207c2004-08-04 20:02:13 +0000864 argc--;
865 argv++;
866
867 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000868 {
869 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000870 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000871 return CMD_SUCCESS;
872 }
873
hasso049207c2004-08-04 20:02:13 +0000874 argc--;
875 argv++;
876 level = parse_show_level (argc, argv);
877
hasso508e53e2004-05-18 18:57:06 +0000878 for (i = listhead (o->area_list); i; nextnode (i))
879 {
hasso049207c2004-08-04 20:02:13 +0000880 oa = (struct ospf6_area *) getdata (i);
881 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
882 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000883 }
hasso049207c2004-08-04 20:02:13 +0000884
hasso508e53e2004-05-18 18:57:06 +0000885 for (i = listhead (o->area_list); i; nextnode (i))
886 {
hasso049207c2004-08-04 20:02:13 +0000887 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000888 for (j = listhead (oa->if_list); j; nextnode (j))
889 {
hasso049207c2004-08-04 20:02:13 +0000890 oi = (struct ospf6_interface *) getdata (j);
891 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
892 oi->interface->name, oa->name, VNL, VNL);
893 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000894 }
895 }
896
hasso049207c2004-08-04 20:02:13 +0000897 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
898 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
899
900 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000901 return CMD_SUCCESS;
902}
903
904ALIAS (show_ipv6_ospf6_database_id_router,
905 show_ipv6_ospf6_database_id_router_detail_cmd,
906 "show ipv6 ospf6 database * A.B.C.D A.B.C.D "
907 "(detail|dump|internal)",
908 SHOW_STR
909 IPV6_STR
910 OSPF6_STR
911 "Display Link state database\n"
912 "Any Link state Type\n"
913 "Specify Link state ID as IPv4 address notation\n"
914 "Specify Advertising Router as IPv4 address notation\n"
915 "Display details of LSAs\n"
916 "Dump LSAs\n"
917 "Display LSA's internal information\n"
918 );
919
hasso049207c2004-08-04 20:02:13 +0000920DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
921 show_ipv6_ospf6_database_adv_router_linkstate_id_cmd,
922 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D",
923 SHOW_STR
924 IPV6_STR
925 OSPF6_STR
926 "Display Link state database\n"
927 "Search by Advertising Router\n"
928 "Specify Advertising Router as IPv4 address notation\n"
929 "Search by Link state ID\n"
930 "Specify Link state ID as IPv4 address notation\n"
931 )
932{
933 int level;
934 listnode i, j;
935 struct ospf6 *o = ospf6;
936 struct ospf6_area *oa;
937 struct ospf6_interface *oi;
938 u_int32_t id = 0;
939 u_int32_t adv_router = 0;
940
941 OSPF6_CMD_CHECK_RUNNING ();
942
943 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
944 {
945 vty_out (vty, "Advertising Router is not parsable: %s%s",
946 argv[0], VNL);
947 return CMD_SUCCESS;
948 }
949
950 argc--;
951 argv++;
952
953 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
954 {
955 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso6452df02004-08-15 05:52:07 +0000956 argv[0], VNL);
hasso049207c2004-08-04 20:02:13 +0000957 return CMD_SUCCESS;
958 }
959
960 argc--;
961 argv++;
962 level = parse_show_level (argc, argv);
963
964 for (i = listhead (o->area_list); i; nextnode (i))
965 {
966 oa = (struct ospf6_area *) getdata (i);
967 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
968 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
969 }
970
971 for (i = listhead (o->area_list); i; nextnode (i))
972 {
973 oa = (struct ospf6_area *) getdata (i);
974 for (j = listhead (oa->if_list); j; nextnode (j))
975 {
976 oi = (struct ospf6_interface *) getdata (j);
977 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
978 oi->interface->name, oa->name, VNL, VNL);
979 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
980 }
981 }
982
983 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
984 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
985
986 vty_out (vty, "%s", VNL);
987 return CMD_SUCCESS;
988}
989
990ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id,
991 show_ipv6_ospf6_database_adv_router_linkstate_id_detail_cmd,
992 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D "
993 "(detail|dump|internal)",
994 SHOW_STR
995 IPV6_STR
996 OSPF6_STR
997 "Display Link state database\n"
998 "Search by Advertising Router\n"
999 "Specify Advertising Router as IPv4 address notation\n"
1000 "Search by Link state ID\n"
1001 "Specify Link state ID as IPv4 address notation\n"
1002 "Display details of LSAs\n"
1003 "Dump LSAs\n"
1004 "Display LSA's internal information\n"
1005 );
1006
hasso508e53e2004-05-18 18:57:06 +00001007DEFUN (show_ipv6_ospf6_database_type_id_router,
1008 show_ipv6_ospf6_database_type_id_router_cmd,
1009 "show ipv6 ospf6 database "
1010 "(router|network|inter-prefix|inter-router|as-external|"
1011 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D",
1012 SHOW_STR
1013 IPV6_STR
1014 OSPF6_STR
1015 "Display Link state database\n"
1016 "Display Router LSAs\n"
1017 "Display Network LSAs\n"
1018 "Display Inter-Area-Prefix LSAs\n"
1019 "Display Inter-Area-Router LSAs\n"
1020 "Display As-External LSAs\n"
1021 "Display Group-Membership LSAs\n"
1022 "Display Type-7 LSAs\n"
1023 "Display Link LSAs\n"
1024 "Display Intra-Area-Prefix LSAs\n"
1025 "Specify Link state ID as IPv4 address notation\n"
1026 "Specify Advertising Router as IPv4 address notation\n"
1027 )
1028{
hasso049207c2004-08-04 20:02:13 +00001029 int level;
hasso508e53e2004-05-18 18:57:06 +00001030 listnode i, j;
1031 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001032 struct ospf6_area *oa;
1033 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001034 u_int16_t type = 0;
1035 u_int32_t id = 0;
hasso049207c2004-08-04 20:02:13 +00001036 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001037
1038 OSPF6_CMD_CHECK_RUNNING ();
1039
hasso049207c2004-08-04 20:02:13 +00001040 type = parse_type_spec (argc, argv);
1041 argc--;
1042 argv++;
hasso508e53e2004-05-18 18:57:06 +00001043
hasso049207c2004-08-04 20:02:13 +00001044 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001045 {
1046 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001047 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001048 return CMD_SUCCESS;
1049 }
1050
hasso049207c2004-08-04 20:02:13 +00001051 argc--;
1052 argv++;
1053
1054 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001055 {
1056 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001057 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001058 return CMD_SUCCESS;
1059 }
1060
hasso049207c2004-08-04 20:02:13 +00001061 argc--;
1062 argv++;
1063 level = parse_show_level (argc, argv);
1064
1065 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +00001066 {
hasso6452df02004-08-15 05:52:07 +00001067 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001068 for (i = listhead (o->area_list); i; nextnode (i))
1069 {
1070 oa = (struct ospf6_area *) getdata (i);
1071 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1072 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1073 }
1074 break;
1075
hasso6452df02004-08-15 05:52:07 +00001076 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001077 for (i = listhead (o->area_list); i; nextnode (i))
1078 {
1079 oa = (struct ospf6_area *) getdata (i);
1080 for (j = listhead (oa->if_list); j; nextnode (j))
1081 {
1082 oi = (struct ospf6_interface *) getdata (j);
1083 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1084 oi->interface->name, oa->name, VNL, VNL);
1085 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1086 }
1087 }
1088 break;
1089
hasso6452df02004-08-15 05:52:07 +00001090 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001091 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1092 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1093 break;
1094
1095 default:
1096 assert (0);
1097 break;
hasso508e53e2004-05-18 18:57:06 +00001098 }
1099
hasso049207c2004-08-04 20:02:13 +00001100 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001101 return CMD_SUCCESS;
1102}
1103
1104ALIAS (show_ipv6_ospf6_database_type_id_router,
1105 show_ipv6_ospf6_database_type_id_router_detail_cmd,
1106 "show ipv6 ospf6 database "
1107 "(router|network|inter-prefix|inter-router|as-external|"
1108 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D "
1109 "(dump|internal)",
1110 SHOW_STR
1111 IPV6_STR
1112 OSPF6_STR
1113 "Display Link state database\n"
1114 "Display Router LSAs\n"
1115 "Display Network LSAs\n"
1116 "Display Inter-Area-Prefix LSAs\n"
1117 "Display Inter-Area-Router LSAs\n"
1118 "Display As-External LSAs\n"
1119 "Display Group-Membership LSAs\n"
1120 "Display Type-7 LSAs\n"
1121 "Display Link LSAs\n"
1122 "Display Intra-Area-Prefix LSAs\n"
1123 "Specify Link state ID as IPv4 address notation\n"
1124 "Specify Advertising Router as IPv4 address notation\n"
hasso049207c2004-08-04 20:02:13 +00001125 "Dump LSAs\n"
1126 "Display LSA's internal information\n"
1127 );
1128
1129DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1130 show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd,
1131 "show ipv6 ospf6 database "
1132 "(router|network|inter-prefix|inter-router|as-external|"
1133 "group-membership|type-7|link|intra-prefix) "
1134 "adv-router A.B.C.D linkstate-id A.B.C.D",
1135 SHOW_STR
1136 IPV6_STR
1137 OSPF6_STR
1138 "Display Link state database\n"
1139 "Display Router LSAs\n"
1140 "Display Network LSAs\n"
1141 "Display Inter-Area-Prefix LSAs\n"
1142 "Display Inter-Area-Router LSAs\n"
1143 "Display As-External LSAs\n"
1144 "Display Group-Membership LSAs\n"
1145 "Display Type-7 LSAs\n"
1146 "Display Link LSAs\n"
1147 "Display Intra-Area-Prefix LSAs\n"
1148 "Search by Advertising Router\n"
1149 "Specify Advertising Router as IPv4 address notation\n"
1150 "Search by Link state ID\n"
1151 "Specify Link state ID as IPv4 address notation\n"
1152 )
1153{
1154 int level;
1155 listnode i, j;
1156 struct ospf6 *o = ospf6;
1157 struct ospf6_area *oa;
1158 struct ospf6_interface *oi;
1159 u_int16_t type = 0;
1160 u_int32_t id = 0;
1161 u_int32_t adv_router = 0;
1162
1163 OSPF6_CMD_CHECK_RUNNING ();
1164
1165 type = parse_type_spec (argc, argv);
1166 argc--;
1167 argv++;
1168
1169 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1170 {
1171 vty_out (vty, "Advertising Router is not parsable: %s%s",
1172 argv[0], VNL);
1173 return CMD_SUCCESS;
1174 }
1175
1176 argc--;
1177 argv++;
1178
1179 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1180 {
1181 vty_out (vty, "Link state ID is not parsable: %s%s",
1182 argv[0], VNL);
1183 return CMD_SUCCESS;
1184 }
1185
1186 argc--;
1187 argv++;
1188 level = parse_show_level (argc, argv);
1189
1190 switch (OSPF6_LSA_SCOPE (type))
1191 {
hasso6452df02004-08-15 05:52:07 +00001192 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001193 for (i = listhead (o->area_list); i; nextnode (i))
1194 {
1195 oa = (struct ospf6_area *) getdata (i);
1196 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1197 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1198 }
1199 break;
1200
hasso6452df02004-08-15 05:52:07 +00001201 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001202 for (i = listhead (o->area_list); i; nextnode (i))
1203 {
1204 oa = (struct ospf6_area *) getdata (i);
1205 for (j = listhead (oa->if_list); j; nextnode (j))
1206 {
1207 oi = (struct ospf6_interface *) getdata (j);
1208 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1209 oi->interface->name, oa->name, VNL, VNL);
1210 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1211 }
1212 }
1213 break;
1214
hasso6452df02004-08-15 05:52:07 +00001215 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001216 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1217 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1218 break;
1219
1220 default:
1221 assert (0);
1222 break;
1223 }
1224
1225 vty_out (vty, "%s", VNL);
1226 return CMD_SUCCESS;
1227}
1228
1229ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1230 show_ipv6_ospf6_database_type_adv_router_linkstate_id_detail_cmd,
1231 "show ipv6 ospf6 database "
1232 "(router|network|inter-prefix|inter-router|as-external|"
1233 "group-membership|type-7|link|intra-prefix) "
1234 "adv-router A.B.C.D linkstate-id A.B.C.D "
1235 "(dump|internal)",
1236 SHOW_STR
1237 IPV6_STR
1238 OSPF6_STR
1239 "Display Link state database\n"
1240 "Display Router LSAs\n"
1241 "Display Network LSAs\n"
1242 "Display Inter-Area-Prefix LSAs\n"
1243 "Display Inter-Area-Router LSAs\n"
1244 "Display As-External LSAs\n"
1245 "Display Group-Membership LSAs\n"
1246 "Display Type-7 LSAs\n"
1247 "Display Link LSAs\n"
1248 "Display Intra-Area-Prefix LSAs\n"
1249 "Search by Advertising Router\n"
1250 "Specify Advertising Router as IPv4 address notation\n"
1251 "Search by Link state ID\n"
1252 "Specify Link state ID as IPv4 address notation\n"
hasso508e53e2004-05-18 18:57:06 +00001253 "Dump LSAs\n"
1254 "Display LSA's internal information\n"
1255 );
1256
1257DEFUN (show_ipv6_ospf6_database_self_originated,
1258 show_ipv6_ospf6_database_self_originated_cmd,
1259 "show ipv6 ospf6 database self-originated",
1260 SHOW_STR
1261 IPV6_STR
1262 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001263 "Display Self-originated LSAs\n"
1264 )
1265{
hasso049207c2004-08-04 20:02:13 +00001266 int level;
hasso508e53e2004-05-18 18:57:06 +00001267 listnode i, j;
1268 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001269 struct ospf6_area *oa;
1270 struct ospf6_interface *oi;
1271 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001272
1273 OSPF6_CMD_CHECK_RUNNING ();
1274
hasso049207c2004-08-04 20:02:13 +00001275 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +00001276
hasso049207c2004-08-04 20:02:13 +00001277 adv_router = o->router_id;
hasso508e53e2004-05-18 18:57:06 +00001278
hasso508e53e2004-05-18 18:57:06 +00001279 for (i = listhead (o->area_list); i; nextnode (i))
1280 {
hasso049207c2004-08-04 20:02:13 +00001281 oa = (struct ospf6_area *) getdata (i);
1282 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1283 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +00001284 }
hasso049207c2004-08-04 20:02:13 +00001285
hasso508e53e2004-05-18 18:57:06 +00001286 for (i = listhead (o->area_list); i; nextnode (i))
1287 {
hasso049207c2004-08-04 20:02:13 +00001288 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +00001289 for (j = listhead (oa->if_list); j; nextnode (j))
1290 {
hasso049207c2004-08-04 20:02:13 +00001291 oi = (struct ospf6_interface *) getdata (j);
1292 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1293 oi->interface->name, oa->name, VNL, VNL);
1294 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +00001295 }
1296 }
1297
hasso049207c2004-08-04 20:02:13 +00001298 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1299 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
1300
1301 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001302 return CMD_SUCCESS;
1303}
1304
1305ALIAS (show_ipv6_ospf6_database_self_originated,
1306 show_ipv6_ospf6_database_self_originated_detail_cmd,
1307 "show ipv6 ospf6 database self-originated "
1308 "(detail|dump|internal)",
1309 SHOW_STR
1310 IPV6_STR
1311 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001312 "Display Self-originated LSAs\n"
1313 "Display details of LSAs\n"
1314 "Dump LSAs\n"
1315 "Display LSA's internal information\n"
hasso049207c2004-08-04 20:02:13 +00001316 )
hasso508e53e2004-05-18 18:57:06 +00001317
1318DEFUN (show_ipv6_ospf6_database_type_self_originated,
1319 show_ipv6_ospf6_database_type_self_originated_cmd,
1320 "show ipv6 ospf6 database "
1321 "(router|network|inter-prefix|inter-router|as-external|"
1322 "group-membership|type-7|link|intra-prefix) self-originated",
1323 SHOW_STR
1324 IPV6_STR
1325 OSPF6_STR
1326 "Display Link state database\n"
1327 "Display Router LSAs\n"
1328 "Display Network LSAs\n"
1329 "Display Inter-Area-Prefix LSAs\n"
1330 "Display Inter-Area-Router LSAs\n"
1331 "Display As-External LSAs\n"
1332 "Display Group-Membership LSAs\n"
1333 "Display Type-7 LSAs\n"
1334 "Display Link LSAs\n"
1335 "Display Intra-Area-Prefix LSAs\n"
1336 "Display Self-originated LSAs\n"
1337 )
1338{
hasso049207c2004-08-04 20:02:13 +00001339 int level;
hasso508e53e2004-05-18 18:57:06 +00001340 listnode i, j;
1341 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001342 struct ospf6_area *oa;
1343 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001344 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +00001345 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001346
1347 OSPF6_CMD_CHECK_RUNNING ();
1348
hasso049207c2004-08-04 20:02:13 +00001349 type = parse_type_spec (argc, argv);
1350 argc--;
1351 argv++;
1352 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +00001353
hasso049207c2004-08-04 20:02:13 +00001354 adv_router = o->router_id;
hasso508e53e2004-05-18 18:57:06 +00001355
hasso049207c2004-08-04 20:02:13 +00001356 switch (OSPF6_LSA_SCOPE (type))
1357 {
hasso6452df02004-08-15 05:52:07 +00001358 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001359 for (i = listhead (o->area_list); i; nextnode (i))
1360 {
1361 oa = (struct ospf6_area *) getdata (i);
1362 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1363 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
1364 }
1365 break;
hasso508e53e2004-05-18 18:57:06 +00001366
hasso6452df02004-08-15 05:52:07 +00001367 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001368 for (i = listhead (o->area_list); i; nextnode (i))
1369 {
1370 oa = (struct ospf6_area *) getdata (i);
1371 for (j = listhead (oa->if_list); j; nextnode (j))
1372 {
1373 oi = (struct ospf6_interface *) getdata (j);
1374 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1375 oi->interface->name, oa->name, VNL, VNL);
1376 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
1377 }
1378 }
1379 break;
1380
hasso6452df02004-08-15 05:52:07 +00001381 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001382 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1383 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
1384 break;
1385
1386 default:
1387 assert (0);
1388 break;
hasso508e53e2004-05-18 18:57:06 +00001389 }
1390
hasso049207c2004-08-04 20:02:13 +00001391 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001392 return CMD_SUCCESS;
1393}
1394
1395ALIAS (show_ipv6_ospf6_database_type_self_originated,
1396 show_ipv6_ospf6_database_type_self_originated_detail_cmd,
1397 "show ipv6 ospf6 database "
1398 "(router|network|inter-prefix|inter-router|as-external|"
1399 "group-membership|type-7|link|intra-prefix) self-originated "
1400 "(detail|dump|internal)",
1401 SHOW_STR
1402 IPV6_STR
1403 OSPF6_STR
1404 "Display Link state database\n"
1405 "Display Router LSAs\n"
1406 "Display Network LSAs\n"
1407 "Display Inter-Area-Prefix LSAs\n"
1408 "Display Inter-Area-Router LSAs\n"
1409 "Display As-External LSAs\n"
1410 "Display Group-Membership LSAs\n"
1411 "Display Type-7 LSAs\n"
1412 "Display Link LSAs\n"
1413 "Display Intra-Area-Prefix LSAs\n"
1414 "Display Self-originated LSAs\n"
1415 "Display details of LSAs\n"
1416 "Dump LSAs\n"
1417 "Display LSA's internal information\n"
1418 );
1419
hasso049207c2004-08-04 20:02:13 +00001420DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1421 show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd,
1422 "show ipv6 ospf6 database "
1423 "(router|network|inter-prefix|inter-router|as-external|"
1424 "group-membership|type-7|link|intra-prefix) self-originated "
1425 "linkstate-id A.B.C.D",
1426 SHOW_STR
1427 IPV6_STR
1428 OSPF6_STR
1429 "Display Link state database\n"
1430 "Display Router LSAs\n"
1431 "Display Network LSAs\n"
1432 "Display Inter-Area-Prefix LSAs\n"
1433 "Display Inter-Area-Router LSAs\n"
1434 "Display As-External LSAs\n"
1435 "Display Group-Membership LSAs\n"
1436 "Display Type-7 LSAs\n"
1437 "Display Link LSAs\n"
1438 "Display Intra-Area-Prefix LSAs\n"
1439 "Display Self-originated LSAs\n"
1440 "Search by Link state ID\n"
1441 "Specify Link state ID as IPv4 address notation\n"
1442 )
1443{
1444 int level;
1445 listnode i, j;
1446 struct ospf6 *o = ospf6;
1447 struct ospf6_area *oa;
1448 struct ospf6_interface *oi;
1449 u_int16_t type = 0;
1450 u_int32_t adv_router = 0;
1451 u_int32_t id = 0;
1452
1453 OSPF6_CMD_CHECK_RUNNING ();
1454
1455 type = parse_type_spec (argc, argv);
1456 argc--;
1457 argv++;
1458
hasso6452df02004-08-15 05:52:07 +00001459 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso049207c2004-08-04 20:02:13 +00001460 {
1461 vty_out (vty, "Link State ID is not parsable: %s%s",
1462 argv[0], VNL);
1463 return CMD_SUCCESS;
1464 }
1465
1466 argc--;
1467 argv++;
1468 level = parse_show_level (argc, argv);
1469
1470 adv_router = o->router_id;
1471
1472 switch (OSPF6_LSA_SCOPE (type))
1473 {
hasso6452df02004-08-15 05:52:07 +00001474 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001475 for (i = listhead (o->area_list); i; nextnode (i))
1476 {
1477 oa = (struct ospf6_area *) getdata (i);
1478 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1479 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1480 }
1481 break;
1482
hasso6452df02004-08-15 05:52:07 +00001483 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001484 for (i = listhead (o->area_list); i; nextnode (i))
1485 {
1486 oa = (struct ospf6_area *) getdata (i);
1487 for (j = listhead (oa->if_list); j; nextnode (j))
1488 {
1489 oi = (struct ospf6_interface *) getdata (j);
1490 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1491 oi->interface->name, oa->name, VNL, VNL);
1492 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1493 }
1494 }
1495 break;
1496
hasso6452df02004-08-15 05:52:07 +00001497 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001498 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1499 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1500 break;
1501
1502 default:
1503 assert (0);
1504 break;
1505 }
1506
1507 vty_out (vty, "%s", VNL);
1508 return CMD_SUCCESS;
1509}
1510
1511ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1512 show_ipv6_ospf6_database_type_self_originated_linkstate_id_detail_cmd,
1513 "show ipv6 ospf6 database "
1514 "(router|network|inter-prefix|inter-router|as-external|"
1515 "group-membership|type-7|link|intra-prefix) self-originated "
1516 "linkstate-id A.B.C.D (detail|dump|internal)",
1517 SHOW_STR
1518 IPV6_STR
1519 OSPF6_STR
1520 "Display Link state database\n"
1521 "Display Router LSAs\n"
1522 "Display Network LSAs\n"
1523 "Display Inter-Area-Prefix LSAs\n"
1524 "Display Inter-Area-Router LSAs\n"
1525 "Display As-External LSAs\n"
1526 "Display Group-Membership LSAs\n"
1527 "Display Type-7 LSAs\n"
1528 "Display Link LSAs\n"
1529 "Display Intra-Area-Prefix LSAs\n"
1530 "Display Self-originated LSAs\n"
1531 "Search by Link state ID\n"
1532 "Specify Link state ID as IPv4 address notation\n"
1533 "Display details of LSAs\n"
1534 "Dump LSAs\n"
1535 "Display LSA's internal information\n"
1536 );
1537
hasso508e53e2004-05-18 18:57:06 +00001538DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
1539 show_ipv6_ospf6_database_type_id_self_originated_cmd,
1540 "show ipv6 ospf6 database "
1541 "(router|network|inter-prefix|inter-router|as-external|"
1542 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated",
1543 SHOW_STR
1544 IPV6_STR
1545 OSPF6_STR
1546 "Display Link state database\n"
1547 "Display Router LSAs\n"
1548 "Display Network LSAs\n"
1549 "Display Inter-Area-Prefix LSAs\n"
1550 "Display Inter-Area-Router LSAs\n"
1551 "Display As-External LSAs\n"
1552 "Display Group-Membership LSAs\n"
1553 "Display Type-7 LSAs\n"
1554 "Display Link LSAs\n"
1555 "Display Intra-Area-Prefix LSAs\n"
1556 "Specify Link state ID as IPv4 address notation\n"
1557 "Display Self-originated LSAs\n"
1558 )
1559{
hasso049207c2004-08-04 20:02:13 +00001560 int level;
hasso508e53e2004-05-18 18:57:06 +00001561 listnode i, j;
1562 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001563 struct ospf6_area *oa;
1564 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001565 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +00001566 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001567 u_int32_t id = 0;
1568
1569 OSPF6_CMD_CHECK_RUNNING ();
1570
hasso049207c2004-08-04 20:02:13 +00001571 type = parse_type_spec (argc, argv);
1572 argc--;
1573 argv++;
hasso508e53e2004-05-18 18:57:06 +00001574
hasso6452df02004-08-15 05:52:07 +00001575 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001576 {
1577 vty_out (vty, "Link State ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001578 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001579 return CMD_SUCCESS;
1580 }
1581
hasso049207c2004-08-04 20:02:13 +00001582 argc--;
1583 argv++;
1584 level = parse_show_level (argc, argv);
1585
1586 adv_router = o->router_id;
1587
1588 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +00001589 {
hasso6452df02004-08-15 05:52:07 +00001590 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001591 for (i = listhead (o->area_list); i; nextnode (i))
1592 {
1593 oa = (struct ospf6_area *) getdata (i);
1594 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1595 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1596 }
1597 break;
1598
hasso6452df02004-08-15 05:52:07 +00001599 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001600 for (i = listhead (o->area_list); i; nextnode (i))
1601 {
1602 oa = (struct ospf6_area *) getdata (i);
1603 for (j = listhead (oa->if_list); j; nextnode (j))
1604 {
1605 oi = (struct ospf6_interface *) getdata (j);
1606 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1607 oi->interface->name, oa->name, VNL, VNL);
1608 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1609 }
1610 }
1611 break;
1612
hasso6452df02004-08-15 05:52:07 +00001613 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001614 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1615 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1616 break;
1617
1618 default:
1619 assert (0);
1620 break;
hasso508e53e2004-05-18 18:57:06 +00001621 }
1622
hasso049207c2004-08-04 20:02:13 +00001623 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001624 return CMD_SUCCESS;
1625}
1626
1627ALIAS (show_ipv6_ospf6_database_type_id_self_originated,
1628 show_ipv6_ospf6_database_type_id_self_originated_detail_cmd,
1629 "show ipv6 ospf6 database "
1630 "(router|network|inter-prefix|inter-router|as-external|"
1631 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated "
hasso049207c2004-08-04 20:02:13 +00001632 "(detail|dump|internal)",
hasso508e53e2004-05-18 18:57:06 +00001633 SHOW_STR
1634 IPV6_STR
1635 OSPF6_STR
1636 "Display Link state database\n"
1637 "Display Router LSAs\n"
1638 "Display Network LSAs\n"
1639 "Display Inter-Area-Prefix LSAs\n"
1640 "Display Inter-Area-Router LSAs\n"
1641 "Display As-External LSAs\n"
1642 "Display Group-Membership LSAs\n"
1643 "Display Type-7 LSAs\n"
1644 "Display Link LSAs\n"
1645 "Display Intra-Area-Prefix LSAs\n"
hasso508e53e2004-05-18 18:57:06 +00001646 "Display Self-originated LSAs\n"
hasso049207c2004-08-04 20:02:13 +00001647 "Search by Link state ID\n"
1648 "Specify Link state ID as IPv4 address notation\n"
hasso508e53e2004-05-18 18:57:06 +00001649 "Display details of LSAs\n"
1650 "Dump LSAs\n"
1651 "Display LSA's internal information\n"
1652 );
1653
hasso6452df02004-08-15 05:52:07 +00001654
1655DEFUN (show_ipv6_ospf6_border_routers,
1656 show_ipv6_ospf6_border_routers_cmd,
1657 "show ipv6 ospf6 border-routers",
1658 SHOW_STR
1659 IP6_STR
1660 OSPF6_STR
1661 "Display routing table for ABR and ASBR\n"
1662 )
1663{
1664 u_int32_t adv_router;
1665 void (*showfunc) (struct vty *, struct ospf6_route *);
1666 struct ospf6_route *ro;
1667 struct prefix prefix;
1668
1669 OSPF6_CMD_CHECK_RUNNING ();
1670
1671 if (argc && ! strcmp ("detail", argv[0]))
1672 {
1673 showfunc = ospf6_route_show_detail;
1674 argc--;
1675 argv++;
1676 }
1677 else
1678 showfunc = ospf6_brouter_show;
1679
1680 if (argc)
1681 {
1682 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1683 {
1684 vty_out (vty, "Router ID is not parsable: %s%s", argv[0], VNL);
1685 return CMD_SUCCESS;
1686 }
1687
1688 ospf6_linkstate_prefix (adv_router, 0, &prefix);
1689 ro = ospf6_route_lookup (&prefix, ospf6->brouter_table);
1690 ospf6_route_show_detail (vty, ro);
1691 return CMD_SUCCESS;
1692 }
1693
1694 if (showfunc == ospf6_brouter_show)
1695 ospf6_brouter_show_header (vty);
1696
1697 for (ro = ospf6_route_head (ospf6->brouter_table); ro;
1698 ro = ospf6_route_next (ro))
1699 (*showfunc) (vty, ro);
1700
1701 return CMD_SUCCESS;
1702}
1703
1704ALIAS (show_ipv6_ospf6_border_routers,
1705 show_ipv6_ospf6_border_routers_detail_cmd,
1706 "show ipv6 ospf6 border-routers (A.B.C.D|detail)",
1707 SHOW_STR
1708 IP6_STR
1709 OSPF6_STR
1710 "Display routing table for ABR and ASBR\n"
1711 "Specify Router-ID\n"
1712 "Display Detail\n"
1713 );
1714
1715
paul718e3742002-12-13 20:15:29 +00001716/* Install ospf related commands. */
1717void
1718ospf6_init ()
1719{
hasso508e53e2004-05-18 18:57:06 +00001720 install_node (&debug_node, config_write_ospf6_debug);
paul718e3742002-12-13 20:15:29 +00001721
hasso508e53e2004-05-18 18:57:06 +00001722 install_element_ospf6_debug_message ();
1723 install_element_ospf6_debug_lsa ();
1724 install_element_ospf6_debug_interface ();
1725 install_element_ospf6_debug_neighbor ();
1726 install_element_ospf6_debug_zebra ();
1727 install_element_ospf6_debug_spf ();
1728 install_element_ospf6_debug_route ();
1729 install_element_ospf6_debug_asbr ();
hasso6452df02004-08-15 05:52:07 +00001730 install_element_ospf6_debug_abr ();
hasso508e53e2004-05-18 18:57:06 +00001731
paul718e3742002-12-13 20:15:29 +00001732 install_element (VIEW_NODE, &show_version_ospf6_cmd);
paul718e3742002-12-13 20:15:29 +00001733 install_element (ENABLE_NODE, &show_version_ospf6_cmd);
hasso049207c2004-08-04 20:02:13 +00001734
hasso6452df02004-08-15 05:52:07 +00001735 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_cmd);
1736 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_detail_cmd);
1737 install_element (ENABLE_NODE, &show_ipv6_ospf6_border_routers_cmd);
1738 install_element (ENABLE_NODE, &show_ipv6_ospf6_border_routers_detail_cmd);
1739
hasso049207c2004-08-04 20:02:13 +00001740#define INSTALL(n,c) \
1741 install_element (n ## _NODE, &show_ipv6_ospf6_ ## c);
1742
1743 INSTALL (VIEW, database_cmd);
1744 INSTALL (VIEW, database_detail_cmd);
1745 INSTALL (VIEW, database_type_cmd);
1746 INSTALL (VIEW, database_type_detail_cmd);
1747 INSTALL (VIEW, database_id_cmd);
1748 INSTALL (VIEW, database_id_detail_cmd);
1749 INSTALL (VIEW, database_linkstate_id_cmd);
1750 INSTALL (VIEW, database_linkstate_id_detail_cmd);
1751 INSTALL (VIEW, database_router_cmd);
1752 INSTALL (VIEW, database_router_detail_cmd);
1753 INSTALL (VIEW, database_adv_router_cmd);
1754 INSTALL (VIEW, database_adv_router_detail_cmd);
1755 INSTALL (VIEW, database_type_id_cmd);
1756 INSTALL (VIEW, database_type_id_detail_cmd);
1757 INSTALL (VIEW, database_type_linkstate_id_cmd);
1758 INSTALL (VIEW, database_type_linkstate_id_detail_cmd);
1759 INSTALL (VIEW, database_type_router_cmd);
1760 INSTALL (VIEW, database_type_router_detail_cmd);
1761 INSTALL (VIEW, database_type_adv_router_cmd);
1762 INSTALL (VIEW, database_type_adv_router_detail_cmd);
1763 INSTALL (VIEW, database_adv_router_linkstate_id_cmd);
1764 INSTALL (VIEW, database_adv_router_linkstate_id_detail_cmd);
1765 INSTALL (VIEW, database_id_router_cmd);
1766 INSTALL (VIEW, database_id_router_detail_cmd);
1767 INSTALL (VIEW, database_type_id_router_cmd);
1768 INSTALL (VIEW, database_type_id_router_detail_cmd);
1769 INSTALL (VIEW, database_type_adv_router_linkstate_id_cmd);
1770 INSTALL (VIEW, database_type_adv_router_linkstate_id_detail_cmd);
1771 INSTALL (VIEW, database_self_originated_cmd);
1772 INSTALL (VIEW, database_self_originated_detail_cmd);
1773 INSTALL (VIEW, database_type_self_originated_cmd);
1774 INSTALL (VIEW, database_type_self_originated_detail_cmd);
1775 INSTALL (VIEW, database_type_id_self_originated_cmd);
1776 INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
1777 INSTALL (VIEW, database_type_self_originated_linkstate_id_cmd);
1778 INSTALL (VIEW, database_type_self_originated_linkstate_id_detail_cmd);
1779 INSTALL (VIEW, database_type_id_self_originated_cmd);
1780 INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
1781
1782 INSTALL (ENABLE, database_cmd);
1783 INSTALL (ENABLE, database_detail_cmd);
1784 INSTALL (ENABLE, database_type_cmd);
1785 INSTALL (ENABLE, database_type_detail_cmd);
1786 INSTALL (ENABLE, database_id_cmd);
1787 INSTALL (ENABLE, database_id_detail_cmd);
1788 INSTALL (ENABLE, database_linkstate_id_cmd);
1789 INSTALL (ENABLE, database_linkstate_id_detail_cmd);
1790 INSTALL (ENABLE, database_router_cmd);
1791 INSTALL (ENABLE, database_router_detail_cmd);
1792 INSTALL (ENABLE, database_adv_router_cmd);
1793 INSTALL (ENABLE, database_adv_router_detail_cmd);
1794 INSTALL (ENABLE, database_type_id_cmd);
1795 INSTALL (ENABLE, database_type_id_detail_cmd);
1796 INSTALL (ENABLE, database_type_linkstate_id_cmd);
1797 INSTALL (ENABLE, database_type_linkstate_id_detail_cmd);
1798 INSTALL (ENABLE, database_type_router_cmd);
1799 INSTALL (ENABLE, database_type_router_detail_cmd);
1800 INSTALL (ENABLE, database_type_adv_router_cmd);
1801 INSTALL (ENABLE, database_type_adv_router_detail_cmd);
1802 INSTALL (ENABLE, database_adv_router_linkstate_id_cmd);
1803 INSTALL (ENABLE, database_adv_router_linkstate_id_detail_cmd);
1804 INSTALL (ENABLE, database_id_router_cmd);
1805 INSTALL (ENABLE, database_id_router_detail_cmd);
1806 INSTALL (ENABLE, database_type_id_router_cmd);
1807 INSTALL (ENABLE, database_type_id_router_detail_cmd);
1808 INSTALL (ENABLE, database_type_adv_router_linkstate_id_cmd);
1809 INSTALL (ENABLE, database_type_adv_router_linkstate_id_detail_cmd);
1810 INSTALL (ENABLE, database_self_originated_cmd);
1811 INSTALL (ENABLE, database_self_originated_detail_cmd);
1812 INSTALL (ENABLE, database_type_self_originated_cmd);
1813 INSTALL (ENABLE, database_type_self_originated_detail_cmd);
1814 INSTALL (ENABLE, database_type_id_self_originated_cmd);
1815 INSTALL (ENABLE, database_type_id_self_originated_detail_cmd);
1816 INSTALL (ENABLE, database_type_self_originated_linkstate_id_cmd);
1817 INSTALL (ENABLE, database_type_self_originated_linkstate_id_detail_cmd);
1818 INSTALL (ENABLE, database_type_id_self_originated_cmd);
1819 INSTALL (ENABLE, database_type_id_self_originated_detail_cmd);
paul718e3742002-12-13 20:15:29 +00001820
1821 ospf6_top_init ();
1822 ospf6_area_init ();
1823 ospf6_interface_init ();
1824 ospf6_neighbor_init ();
1825 ospf6_zebra_init ();
1826
hasso508e53e2004-05-18 18:57:06 +00001827 ospf6_lsa_init ();
paul718e3742002-12-13 20:15:29 +00001828 ospf6_spf_init ();
paul718e3742002-12-13 20:15:29 +00001829 ospf6_intra_init ();
paul718e3742002-12-13 20:15:29 +00001830 ospf6_asbr_init ();
hasso049207c2004-08-04 20:02:13 +00001831 ospf6_abr_init ();
hasso508e53e2004-05-18 18:57:06 +00001832
1833 /* Make ospf protocol socket. */
1834 ospf6_serv_sock ();
1835 thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
paul718e3742002-12-13 20:15:29 +00001836}
1837
paul718e3742002-12-13 20:15:29 +00001838