blob: e94a036b172b2cc892f7eec1018a01e238cd2d30 [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"
hasso1e058382004-09-01 21:36:14 +000044#include "ospf6_flood.h"
hasso049207c2004-08-04 20:02:13 +000045#include "ospf6d.h"
paul718e3742002-12-13 20:15:29 +000046
47char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION;
48
paul718e3742002-12-13 20:15:29 +000049void
hasso508e53e2004-05-18 18:57:06 +000050ospf6_debug ()
paul718e3742002-12-13 20:15:29 +000051{
hasso508e53e2004-05-18 18:57:06 +000052}
paul718e3742002-12-13 20:15:29 +000053
hasso508e53e2004-05-18 18:57:06 +000054struct route_node *
55route_prev (struct route_node *node)
paul718e3742002-12-13 20:15:29 +000056{
hasso508e53e2004-05-18 18:57:06 +000057 struct route_node *end;
58 struct route_node *prev = NULL;
paul718e3742002-12-13 20:15:29 +000059
hasso508e53e2004-05-18 18:57:06 +000060 end = node;
61 node = node->parent;
hasso3b687352004-08-19 06:56:53 +000062 if (node)
63 route_lock_node (node);
hasso508e53e2004-05-18 18:57:06 +000064 while (node)
65 {
66 prev = node;
hasso3b687352004-08-19 06:56:53 +000067 node = route_next (node);
68 if (node == end)
69 {
70 route_unlock_node (node);
71 node = NULL;
72 }
hasso508e53e2004-05-18 18:57:06 +000073 }
74 route_unlock_node (end);
hasso3b687352004-08-19 06:56:53 +000075 if (prev)
76 route_lock_node (prev);
hasso508e53e2004-05-18 18:57:06 +000077
78 return prev;
paul718e3742002-12-13 20:15:29 +000079}
80
hasso6452df02004-08-15 05:52:07 +000081
82/* show database functions */
paul718e3742002-12-13 20:15:29 +000083DEFUN (show_version_ospf6,
84 show_version_ospf6_cmd,
85 "show version ospf6",
86 SHOW_STR
hasso508e53e2004-05-18 18:57:06 +000087 "Displays ospf6d version\n"
88 )
paul718e3742002-12-13 20:15:29 +000089{
90 vty_out (vty, "Zebra OSPF6d Version: %s%s",
hasso049207c2004-08-04 20:02:13 +000091 ospf6_daemon_version, VNL);
paul718e3742002-12-13 20:15:29 +000092
93 return CMD_SUCCESS;
94}
95
hasso508e53e2004-05-18 18:57:06 +000096struct cmd_node debug_node =
paul718e3742002-12-13 20:15:29 +000097{
hasso508e53e2004-05-18 18:57:06 +000098 DEBUG_NODE,
hasso69b4a812004-08-26 18:10:36 +000099 "",
100 1 /* VTYSH */
hasso508e53e2004-05-18 18:57:06 +0000101};
paul718e3742002-12-13 20:15:29 +0000102
103int
hasso508e53e2004-05-18 18:57:06 +0000104config_write_ospf6_debug (struct vty *vty)
paul718e3742002-12-13 20:15:29 +0000105{
hasso508e53e2004-05-18 18:57:06 +0000106 config_write_ospf6_debug_message (vty);
107 config_write_ospf6_debug_lsa (vty);
108 config_write_ospf6_debug_zebra (vty);
109 config_write_ospf6_debug_interface (vty);
110 config_write_ospf6_debug_neighbor (vty);
111 config_write_ospf6_debug_spf (vty);
112 config_write_ospf6_debug_route (vty);
113 config_write_ospf6_debug_asbr (vty);
hasso049207c2004-08-04 20:02:13 +0000114 config_write_ospf6_debug_abr (vty);
hasso1e058382004-09-01 21:36:14 +0000115 config_write_ospf6_debug_flood (vty);
hasso049207c2004-08-04 20:02:13 +0000116 vty_out (vty, "!%s", VNL);
paul718e3742002-12-13 20:15:29 +0000117 return 0;
118}
119
hasso049207c2004-08-04 20:02:13 +0000120#define AREA_LSDB_TITLE_FORMAT \
121 "%s Area Scoped Link State Database (Area %s)%s%s"
122#define IF_LSDB_TITLE_FORMAT \
123 "%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s"
124#define AS_LSDB_TITLE_FORMAT \
125 "%s AS Scoped Link State Database%s%s"
126
127static int
128parse_show_level (int argc, char **argv)
129{
hasso6452df02004-08-15 05:52:07 +0000130 int level = 0;
hasso049207c2004-08-04 20:02:13 +0000131 if (argc)
132 {
133 if (! strncmp (argv[0], "de", 2))
134 level = OSPF6_LSDB_SHOW_LEVEL_DETAIL;
135 else if (! strncmp (argv[0], "du", 2))
136 level = OSPF6_LSDB_SHOW_LEVEL_DUMP;
137 else if (! strncmp (argv[0], "in", 2))
138 level = OSPF6_LSDB_SHOW_LEVEL_INTERNAL;
139 }
140 else
141 level = OSPF6_LSDB_SHOW_LEVEL_NORMAL;
142 return level;
143}
144
145static u_int16_t
146parse_type_spec (int argc, char **argv)
147{
hasso6452df02004-08-15 05:52:07 +0000148 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +0000149 assert (argc);
150 if (! strcmp (argv[0], "router"))
151 type = htons (OSPF6_LSTYPE_ROUTER);
152 else if (! strcmp (argv[0], "network"))
153 type = htons (OSPF6_LSTYPE_NETWORK);
154 else if (! strcmp (argv[0], "as-external"))
155 type = htons (OSPF6_LSTYPE_AS_EXTERNAL);
156 else if (! strcmp (argv[0], "intra-prefix"))
157 type = htons (OSPF6_LSTYPE_INTRA_PREFIX);
158 else if (! strcmp (argv[0], "inter-router"))
159 type = htons (OSPF6_LSTYPE_INTER_ROUTER);
160 else if (! strcmp (argv[0], "inter-prefix"))
161 type = htons (OSPF6_LSTYPE_INTER_PREFIX);
162 else if (! strcmp (argv[0], "link"))
163 type = htons (OSPF6_LSTYPE_LINK);
164 return type;
165}
166
hasso508e53e2004-05-18 18:57:06 +0000167DEFUN (show_ipv6_ospf6_database,
168 show_ipv6_ospf6_database_cmd,
169 "show ipv6 ospf6 database",
170 SHOW_STR
171 IPV6_STR
172 OSPF6_STR
173 "Display Link state database\n"
174 )
paul718e3742002-12-13 20:15:29 +0000175{
hasso049207c2004-08-04 20:02:13 +0000176 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000177 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000178 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000179 struct ospf6_area *oa;
180 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000181
182 OSPF6_CMD_CHECK_RUNNING ();
183
hasso049207c2004-08-04 20:02:13 +0000184 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +0000185
hasso508e53e2004-05-18 18:57:06 +0000186 for (i = listhead (o->area_list); i; nextnode (i))
187 {
hasso049207c2004-08-04 20:02:13 +0000188 oa = (struct ospf6_area *) getdata (i);
189 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
190 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000191 }
hasso049207c2004-08-04 20:02:13 +0000192
hasso508e53e2004-05-18 18:57:06 +0000193 for (i = listhead (o->area_list); i; nextnode (i))
194 {
hasso049207c2004-08-04 20:02:13 +0000195 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000196 for (j = listhead (oa->if_list); j; nextnode (j))
197 {
hasso049207c2004-08-04 20:02:13 +0000198 oi = (struct ospf6_interface *) getdata (j);
199 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
200 oi->interface->name, oa->name, VNL, VNL);
201 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000202 }
203 }
204
hasso049207c2004-08-04 20:02:13 +0000205 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
206 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb);
207
208 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000209 return CMD_SUCCESS;
210}
211
212ALIAS (show_ipv6_ospf6_database,
213 show_ipv6_ospf6_database_detail_cmd,
214 "show ipv6 ospf6 database (detail|dump|internal)",
215 SHOW_STR
216 IPV6_STR
217 OSPF6_STR
218 "Display Link state database\n"
219 "Display details of LSAs\n"
220 "Dump LSAs\n"
221 "Display LSA's internal information\n"
222 );
223
224DEFUN (show_ipv6_ospf6_database_type,
225 show_ipv6_ospf6_database_type_cmd,
226 "show ipv6 ospf6 database "
227 "(router|network|inter-prefix|inter-router|as-external|"
228 "group-membership|type-7|link|intra-prefix)",
229 SHOW_STR
230 IPV6_STR
231 OSPF6_STR
232 "Display Link state database\n"
233 "Display Router LSAs\n"
234 "Display Network LSAs\n"
235 "Display Inter-Area-Prefix LSAs\n"
236 "Display Inter-Area-Router LSAs\n"
237 "Display As-External LSAs\n"
238 "Display Group-Membership LSAs\n"
239 "Display Type-7 LSAs\n"
240 "Display Link LSAs\n"
241 "Display Intra-Area-Prefix LSAs\n"
242 )
243{
hasso049207c2004-08-04 20:02:13 +0000244 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000245 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000246 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000247 struct ospf6_area *oa;
248 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000249 u_int16_t type = 0;
250
251 OSPF6_CMD_CHECK_RUNNING ();
252
hasso049207c2004-08-04 20:02:13 +0000253 type = parse_type_spec (argc, argv);
254 argc--;
255 argv++;
256 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +0000257
hasso049207c2004-08-04 20:02:13 +0000258 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000259 {
hasso6452df02004-08-15 05:52:07 +0000260 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +0000261 for (i = listhead (o->area_list); i; nextnode (i))
262 {
263 oa = (struct ospf6_area *) getdata (i);
264 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
265 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
266 }
267 break;
268
hasso6452df02004-08-15 05:52:07 +0000269 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +0000270 for (i = listhead (o->area_list); i; nextnode (i))
271 {
272 oa = (struct ospf6_area *) getdata (i);
273 for (j = listhead (oa->if_list); j; nextnode (j))
274 {
275 oi = (struct ospf6_interface *) getdata (j);
276 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
277 oi->interface->name, oa->name, VNL, VNL);
278 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
279 }
280 }
281 break;
282
hasso6452df02004-08-15 05:52:07 +0000283 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000284 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
285 ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb);
286 break;
287
288 default:
289 assert (0);
290 break;
hasso508e53e2004-05-18 18:57:06 +0000291 }
292
hasso049207c2004-08-04 20:02:13 +0000293 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000294 return CMD_SUCCESS;
295}
296
297ALIAS (show_ipv6_ospf6_database_type,
298 show_ipv6_ospf6_database_type_detail_cmd,
299 "show ipv6 ospf6 database "
300 "(router|network|inter-prefix|inter-router|as-external|"
301 "group-membership|type-7|link|intra-prefix) "
302 "(detail|dump|internal)",
303 SHOW_STR
304 IPV6_STR
305 OSPF6_STR
306 "Display Link state database\n"
307 "Display Router LSAs\n"
308 "Display Network LSAs\n"
309 "Display Inter-Area-Prefix LSAs\n"
310 "Display Inter-Area-Router LSAs\n"
311 "Display As-External LSAs\n"
312 "Display Group-Membership LSAs\n"
313 "Display Type-7 LSAs\n"
314 "Display Link LSAs\n"
315 "Display Intra-Area-Prefix LSAs\n"
316 "Display details of LSAs\n"
317 "Dump LSAs\n"
318 "Display LSA's internal information\n"
319 );
320
321DEFUN (show_ipv6_ospf6_database_id,
322 show_ipv6_ospf6_database_id_cmd,
323 "show ipv6 ospf6 database * A.B.C.D",
324 SHOW_STR
325 IPV6_STR
326 OSPF6_STR
327 "Display Link state database\n"
328 "Any Link state Type\n"
329 "Specify Link state ID as IPv4 address notation\n"
330 )
331{
hasso049207c2004-08-04 20:02:13 +0000332 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000333 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000334 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000335 struct ospf6_area *oa;
336 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000337 u_int32_t id = 0;
338
339 OSPF6_CMD_CHECK_RUNNING ();
340
hasso508e53e2004-05-18 18:57:06 +0000341 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
342 {
343 vty_out (vty, "Link State ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000344 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000345 return CMD_SUCCESS;
346 }
347
hasso049207c2004-08-04 20:02:13 +0000348 argc--;
349 argv++;
350 level = parse_show_level (argc, argv);
351
hasso508e53e2004-05-18 18:57:06 +0000352 for (i = listhead (o->area_list); i; nextnode (i))
353 {
hasso049207c2004-08-04 20:02:13 +0000354 oa = (struct ospf6_area *) getdata (i);
355 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
356 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000357 }
hasso049207c2004-08-04 20:02:13 +0000358
hasso508e53e2004-05-18 18:57:06 +0000359 for (i = listhead (o->area_list); i; nextnode (i))
360 {
hasso049207c2004-08-04 20:02:13 +0000361 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000362 for (j = listhead (oa->if_list); j; nextnode (j))
363 {
hasso049207c2004-08-04 20:02:13 +0000364 oi = (struct ospf6_interface *) getdata (j);
365 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
366 oi->interface->name, oa->name, VNL, VNL);
367 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000368 }
369 }
370
hasso049207c2004-08-04 20:02:13 +0000371 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
372 ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb);
373
374 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000375 return CMD_SUCCESS;
376}
377
378ALIAS (show_ipv6_ospf6_database_id,
379 show_ipv6_ospf6_database_id_detail_cmd,
380 "show ipv6 ospf6 database * A.B.C.D "
381 "(detail|dump|internal)",
382 SHOW_STR
383 IPV6_STR
384 OSPF6_STR
385 "Display Link state database\n"
386 "Any Link state Type\n"
hasso049207c2004-08-04 20:02:13 +0000387 "Specify Link state ID as IPv4 address notation\n"
388 "Display details of LSAs\n"
389 "Dump LSAs\n"
390 "Display LSA's internal information\n"
391 );
392
393ALIAS (show_ipv6_ospf6_database_id,
394 show_ipv6_ospf6_database_linkstate_id_cmd,
395 "show ipv6 ospf6 database linkstate-id A.B.C.D",
396 SHOW_STR
397 IPV6_STR
398 OSPF6_STR
399 "Display Link state database\n"
400 "Search by Link state ID\n"
401 "Specify Link state ID as IPv4 address notation\n"
402 );
403
404ALIAS (show_ipv6_ospf6_database_id,
405 show_ipv6_ospf6_database_linkstate_id_detail_cmd,
406 "show ipv6 ospf6 database linkstate-id A.B.C.D "
407 "(detail|dump|internal)",
408 SHOW_STR
409 IPV6_STR
410 OSPF6_STR
411 "Display Link state database\n"
412 "Search by Link state ID\n"
hasso508e53e2004-05-18 18:57:06 +0000413 "Specify Link state ID as IPv4 address notation\n"
414 "Display details of LSAs\n"
415 "Dump LSAs\n"
416 "Display LSA's internal information\n"
417 );
418
419DEFUN (show_ipv6_ospf6_database_router,
420 show_ipv6_ospf6_database_router_cmd,
421 "show ipv6 ospf6 database * * A.B.C.D",
422 SHOW_STR
423 IPV6_STR
424 OSPF6_STR
425 "Display Link state database\n"
426 "Any Link state Type\n"
427 "Any Link state ID\n"
428 "Specify Advertising Router as IPv4 address notation\n"
429 )
430{
hasso049207c2004-08-04 20:02:13 +0000431 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000432 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000433 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000434 struct ospf6_area *oa;
435 struct ospf6_interface *oi;
436 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000437
438 OSPF6_CMD_CHECK_RUNNING ();
439
hasso049207c2004-08-04 20:02:13 +0000440 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000441 {
442 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000443 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000444 return CMD_SUCCESS;
445 }
446
hasso049207c2004-08-04 20:02:13 +0000447 argc--;
448 argv++;
449 level = parse_show_level (argc, argv);
450
hasso508e53e2004-05-18 18:57:06 +0000451 for (i = listhead (o->area_list); i; nextnode (i))
452 {
hasso049207c2004-08-04 20:02:13 +0000453 oa = (struct ospf6_area *) getdata (i);
454 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
455 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000456 }
hasso049207c2004-08-04 20:02:13 +0000457
hasso508e53e2004-05-18 18:57:06 +0000458 for (i = listhead (o->area_list); i; nextnode (i))
459 {
hasso049207c2004-08-04 20:02:13 +0000460 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000461 for (j = listhead (oa->if_list); j; nextnode (j))
462 {
hasso049207c2004-08-04 20:02:13 +0000463 oi = (struct ospf6_interface *) getdata (j);
464 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
465 oi->interface->name, oa->name, VNL, VNL);
466 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000467 }
468 }
469
hasso049207c2004-08-04 20:02:13 +0000470 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
471 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
472
473 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000474 return CMD_SUCCESS;
475}
476
477ALIAS (show_ipv6_ospf6_database_router,
478 show_ipv6_ospf6_database_router_detail_cmd,
479 "show ipv6 ospf6 database * * A.B.C.D "
480 "(detail|dump|internal)",
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 "Display details of LSAs\n"
489 "Dump LSAs\n"
490 "Display LSA's internal information\n"
491 );
492
hasso049207c2004-08-04 20:02:13 +0000493ALIAS (show_ipv6_ospf6_database_router,
494 show_ipv6_ospf6_database_adv_router_cmd,
495 "show ipv6 ospf6 database adv-router A.B.C.D",
496 SHOW_STR
497 IPV6_STR
498 OSPF6_STR
499 "Display Link state database\n"
500 "Search by Advertising Router\n"
501 "Specify Advertising Router as IPv4 address notation\n"
502 );
503
504ALIAS (show_ipv6_ospf6_database_router,
505 show_ipv6_ospf6_database_adv_router_detail_cmd,
506 "show ipv6 ospf6 database adv-router A.B.C.D "
507 "(detail|dump|internal)",
508 SHOW_STR
509 IPV6_STR
510 OSPF6_STR
511 "Display Link state database\n"
512 "Search by Advertising Router\n"
513 "Specify Advertising Router as IPv4 address notation\n"
514 "Display details of LSAs\n"
515 "Dump LSAs\n"
516 "Display LSA's internal information\n"
517 );
518
hasso508e53e2004-05-18 18:57:06 +0000519DEFUN (show_ipv6_ospf6_database_type_id,
520 show_ipv6_ospf6_database_type_id_cmd,
521 "show ipv6 ospf6 database "
522 "(router|network|inter-prefix|inter-router|as-external|"
523 "group-membership|type-7|link|intra-prefix) A.B.C.D",
524 SHOW_STR
525 IPV6_STR
526 OSPF6_STR
527 "Display Link state database\n"
528 "Display Router LSAs\n"
529 "Display Network LSAs\n"
530 "Display Inter-Area-Prefix LSAs\n"
531 "Display Inter-Area-Router LSAs\n"
532 "Display As-External LSAs\n"
533 "Display Group-Membership LSAs\n"
534 "Display Type-7 LSAs\n"
535 "Display Link LSAs\n"
536 "Display Intra-Area-Prefix LSAs\n"
537 "Specify Link state ID as IPv4 address notation\n"
538 )
539{
hasso049207c2004-08-04 20:02:13 +0000540 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000541 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000542 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000543 struct ospf6_area *oa;
544 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000545 u_int16_t type = 0;
546 u_int32_t id = 0;
547
548 OSPF6_CMD_CHECK_RUNNING ();
549
hasso049207c2004-08-04 20:02:13 +0000550 type = parse_type_spec (argc, argv);
551 argc--;
552 argv++;
hasso508e53e2004-05-18 18:57:06 +0000553
hasso049207c2004-08-04 20:02:13 +0000554 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000555 {
556 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000557 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000558 return CMD_SUCCESS;
559 }
560
hasso049207c2004-08-04 20:02:13 +0000561 argc--;
562 argv++;
563 level = parse_show_level (argc, argv);
564
565 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000566 {
hasso6452df02004-08-15 05:52:07 +0000567 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +0000568 for (i = listhead (o->area_list); i; nextnode (i))
569 {
570 oa = (struct ospf6_area *) getdata (i);
571 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
572 ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
573 }
574 break;
575
hasso6452df02004-08-15 05:52:07 +0000576 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +0000577 for (i = listhead (o->area_list); i; nextnode (i))
578 {
579 oa = (struct ospf6_area *) getdata (i);
580 for (j = listhead (oa->if_list); j; nextnode (j))
581 {
582 oi = (struct ospf6_interface *) getdata (j);
583 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
584 oi->interface->name, oa->name, VNL, VNL);
585 ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
586 }
587 }
588 break;
589
hasso6452df02004-08-15 05:52:07 +0000590 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000591 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
592 ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb);
593 break;
594
595 default:
596 assert (0);
597 break;
hasso508e53e2004-05-18 18:57:06 +0000598 }
599
hasso049207c2004-08-04 20:02:13 +0000600 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000601 return CMD_SUCCESS;
602}
603
604ALIAS (show_ipv6_ospf6_database_type_id,
605 show_ipv6_ospf6_database_type_id_detail_cmd,
606 "show ipv6 ospf6 database "
607 "(router|network|inter-prefix|inter-router|as-external|"
608 "group-membership|type-7|link|intra-prefix) A.B.C.D "
609 "(detail|dump|internal)",
610 SHOW_STR
611 IPV6_STR
612 OSPF6_STR
613 "Display Link state database\n"
614 "Display Router LSAs\n"
615 "Display Network LSAs\n"
616 "Display Inter-Area-Prefix LSAs\n"
617 "Display Inter-Area-Router LSAs\n"
618 "Display As-External LSAs\n"
619 "Display Group-Membership LSAs\n"
620 "Display Type-7 LSAs\n"
621 "Display Link LSAs\n"
622 "Display Intra-Area-Prefix LSAs\n"
623 "Specify Link state ID as IPv4 address notation\n"
624 "Display details of LSAs\n"
625 "Dump LSAs\n"
626 "Display LSA's internal information\n"
627 );
628
hasso049207c2004-08-04 20:02:13 +0000629ALIAS (show_ipv6_ospf6_database_type_id,
630 show_ipv6_ospf6_database_type_linkstate_id_cmd,
631 "show ipv6 ospf6 database "
632 "(router|network|inter-prefix|inter-router|as-external|"
633 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D",
634 SHOW_STR
635 IPV6_STR
636 OSPF6_STR
637 "Display Link state database\n"
638 "Display Router LSAs\n"
639 "Display Network LSAs\n"
640 "Display Inter-Area-Prefix LSAs\n"
641 "Display Inter-Area-Router LSAs\n"
642 "Display As-External LSAs\n"
643 "Display Group-Membership LSAs\n"
644 "Display Type-7 LSAs\n"
645 "Display Link LSAs\n"
646 "Display Intra-Area-Prefix LSAs\n"
647 "Search by Link state ID\n"
648 "Specify Link state ID as IPv4 address notation\n"
649 );
650
651ALIAS (show_ipv6_ospf6_database_type_id,
652 show_ipv6_ospf6_database_type_linkstate_id_detail_cmd,
653 "show ipv6 ospf6 database "
654 "(router|network|inter-prefix|inter-router|as-external|"
655 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D "
656 "(detail|dump|internal)",
657 SHOW_STR
658 IPV6_STR
659 OSPF6_STR
660 "Display Link state database\n"
661 "Display Router LSAs\n"
662 "Display Network LSAs\n"
663 "Display Inter-Area-Prefix LSAs\n"
664 "Display Inter-Area-Router LSAs\n"
665 "Display As-External LSAs\n"
666 "Display Group-Membership LSAs\n"
667 "Display Type-7 LSAs\n"
668 "Display Link LSAs\n"
669 "Display Intra-Area-Prefix LSAs\n"
670 "Search by Link state ID\n"
671 "Specify Link state ID as IPv4 address notation\n"
672 "Display details of LSAs\n"
673 "Dump LSAs\n"
674 "Display LSA's internal information\n"
675 );
676
hasso508e53e2004-05-18 18:57:06 +0000677DEFUN (show_ipv6_ospf6_database_type_router,
678 show_ipv6_ospf6_database_type_router_cmd,
679 "show ipv6 ospf6 database "
680 "(router|network|inter-prefix|inter-router|as-external|"
681 "group-membership|type-7|link|intra-prefix) * A.B.C.D",
682 SHOW_STR
683 IPV6_STR
684 OSPF6_STR
685 "Display Link state database\n"
686 "Display Router LSAs\n"
687 "Display Network LSAs\n"
688 "Display Inter-Area-Prefix LSAs\n"
689 "Display Inter-Area-Router LSAs\n"
690 "Display As-External LSAs\n"
691 "Display Group-Membership LSAs\n"
692 "Display Type-7 LSAs\n"
693 "Display Link LSAs\n"
694 "Display Intra-Area-Prefix LSAs\n"
695 "Any Link state ID\n"
696 "Specify Advertising Router as IPv4 address notation\n"
697 )
698{
hasso049207c2004-08-04 20:02:13 +0000699 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000700 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000701 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000702 struct ospf6_area *oa;
703 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000704 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +0000705 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000706
707 OSPF6_CMD_CHECK_RUNNING ();
708
hasso049207c2004-08-04 20:02:13 +0000709 type = parse_type_spec (argc, argv);
710 argc--;
711 argv++;
hasso508e53e2004-05-18 18:57:06 +0000712
hasso049207c2004-08-04 20:02:13 +0000713 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000714 {
715 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000716 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000717 return CMD_SUCCESS;
718 }
719
hasso049207c2004-08-04 20:02:13 +0000720 argc--;
721 argv++;
722 level = parse_show_level (argc, argv);
723
724 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000725 {
hasso6452df02004-08-15 05:52:07 +0000726 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +0000727 for (i = listhead (o->area_list); i; nextnode (i))
728 {
729 oa = (struct ospf6_area *) getdata (i);
730 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
731 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
732 }
733 break;
734
hasso6452df02004-08-15 05:52:07 +0000735 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +0000736 for (i = listhead (o->area_list); i; nextnode (i))
737 {
738 oa = (struct ospf6_area *) getdata (i);
739 for (j = listhead (oa->if_list); j; nextnode (j))
740 {
741 oi = (struct ospf6_interface *) getdata (j);
742 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
743 oi->interface->name, oa->name, VNL, VNL);
744 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
745 }
746 }
747 break;
748
hasso6452df02004-08-15 05:52:07 +0000749 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000750 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
751 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
752 break;
753
754 default:
755 assert (0);
756 break;
hasso508e53e2004-05-18 18:57:06 +0000757 }
758
hasso049207c2004-08-04 20:02:13 +0000759 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000760 return CMD_SUCCESS;
761}
762
763ALIAS (show_ipv6_ospf6_database_type_router,
764 show_ipv6_ospf6_database_type_router_detail_cmd,
765 "show ipv6 ospf6 database "
766 "(router|network|inter-prefix|inter-router|as-external|"
767 "group-membership|type-7|link|intra-prefix) * A.B.C.D "
768 "(detail|dump|internal)",
769 SHOW_STR
770 IPV6_STR
771 OSPF6_STR
772 "Display Link state database\n"
773 "Display Router LSAs\n"
774 "Display Network LSAs\n"
775 "Display Inter-Area-Prefix LSAs\n"
776 "Display Inter-Area-Router LSAs\n"
777 "Display As-External LSAs\n"
778 "Display Group-Membership LSAs\n"
779 "Display Type-7 LSAs\n"
780 "Display Link LSAs\n"
781 "Display Intra-Area-Prefix LSAs\n"
782 "Any Link state ID\n"
783 "Specify Advertising Router as IPv4 address notation\n"
784 "Display details of LSAs\n"
785 "Dump LSAs\n"
786 "Display LSA's internal information\n"
787 );
788
hasso049207c2004-08-04 20:02:13 +0000789ALIAS (show_ipv6_ospf6_database_type_router,
790 show_ipv6_ospf6_database_type_adv_router_cmd,
791 "show ipv6 ospf6 database "
792 "(router|network|inter-prefix|inter-router|as-external|"
793 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D",
794 SHOW_STR
795 IPV6_STR
796 OSPF6_STR
797 "Display Link state database\n"
798 "Display Router LSAs\n"
799 "Display Network LSAs\n"
800 "Display Inter-Area-Prefix LSAs\n"
801 "Display Inter-Area-Router LSAs\n"
802 "Display As-External LSAs\n"
803 "Display Group-Membership LSAs\n"
804 "Display Type-7 LSAs\n"
805 "Display Link LSAs\n"
806 "Display Intra-Area-Prefix LSAs\n"
807 "Search by Advertising Router\n"
808 "Specify Advertising Router as IPv4 address notation\n"
809 );
810
811ALIAS (show_ipv6_ospf6_database_type_router,
812 show_ipv6_ospf6_database_type_adv_router_detail_cmd,
813 "show ipv6 ospf6 database "
814 "(router|network|inter-prefix|inter-router|as-external|"
815 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D "
816 "(detail|dump|internal)",
817 SHOW_STR
818 IPV6_STR
819 OSPF6_STR
820 "Display Link state database\n"
821 "Display Router LSAs\n"
822 "Display Network LSAs\n"
823 "Display Inter-Area-Prefix LSAs\n"
824 "Display Inter-Area-Router LSAs\n"
825 "Display As-External LSAs\n"
826 "Display Group-Membership LSAs\n"
827 "Display Type-7 LSAs\n"
828 "Display Link LSAs\n"
829 "Display Intra-Area-Prefix LSAs\n"
830 "Search by Advertising Router\n"
831 "Specify Advertising Router as IPv4 address notation\n"
832 "Display details of LSAs\n"
833 "Dump LSAs\n"
834 "Display LSA's internal information\n"
835 );
836
hasso508e53e2004-05-18 18:57:06 +0000837DEFUN (show_ipv6_ospf6_database_id_router,
838 show_ipv6_ospf6_database_id_router_cmd,
839 "show ipv6 ospf6 database * A.B.C.D A.B.C.D",
840 SHOW_STR
841 IPV6_STR
842 OSPF6_STR
843 "Display Link state database\n"
844 "Any Link state Type\n"
845 "Specify Link state ID as IPv4 address notation\n"
846 "Specify Advertising Router as IPv4 address notation\n"
847 )
848{
hasso049207c2004-08-04 20:02:13 +0000849 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000850 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000851 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000852 struct ospf6_area *oa;
853 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000854 u_int32_t id = 0;
hasso049207c2004-08-04 20:02:13 +0000855 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000856
857 OSPF6_CMD_CHECK_RUNNING ();
858
hasso508e53e2004-05-18 18:57:06 +0000859 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
860 {
861 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso6452df02004-08-15 05:52:07 +0000862 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000863 return CMD_SUCCESS;
864 }
865
hasso049207c2004-08-04 20:02:13 +0000866 argc--;
867 argv++;
868
869 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000870 {
871 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000872 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000873 return CMD_SUCCESS;
874 }
875
hasso049207c2004-08-04 20:02:13 +0000876 argc--;
877 argv++;
878 level = parse_show_level (argc, argv);
879
hasso508e53e2004-05-18 18:57:06 +0000880 for (i = listhead (o->area_list); i; nextnode (i))
881 {
hasso049207c2004-08-04 20:02:13 +0000882 oa = (struct ospf6_area *) getdata (i);
883 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
884 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000885 }
hasso049207c2004-08-04 20:02:13 +0000886
hasso508e53e2004-05-18 18:57:06 +0000887 for (i = listhead (o->area_list); i; nextnode (i))
888 {
hasso049207c2004-08-04 20:02:13 +0000889 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +0000890 for (j = listhead (oa->if_list); j; nextnode (j))
891 {
hasso049207c2004-08-04 20:02:13 +0000892 oi = (struct ospf6_interface *) getdata (j);
893 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
894 oi->interface->name, oa->name, VNL, VNL);
895 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000896 }
897 }
898
hasso049207c2004-08-04 20:02:13 +0000899 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
900 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
901
902 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000903 return CMD_SUCCESS;
904}
905
906ALIAS (show_ipv6_ospf6_database_id_router,
907 show_ipv6_ospf6_database_id_router_detail_cmd,
908 "show ipv6 ospf6 database * A.B.C.D A.B.C.D "
909 "(detail|dump|internal)",
910 SHOW_STR
911 IPV6_STR
912 OSPF6_STR
913 "Display Link state database\n"
914 "Any Link state Type\n"
915 "Specify Link state ID as IPv4 address notation\n"
916 "Specify Advertising Router as IPv4 address notation\n"
917 "Display details of LSAs\n"
918 "Dump LSAs\n"
919 "Display LSA's internal information\n"
920 );
921
hasso049207c2004-08-04 20:02:13 +0000922DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
923 show_ipv6_ospf6_database_adv_router_linkstate_id_cmd,
924 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D",
925 SHOW_STR
926 IPV6_STR
927 OSPF6_STR
928 "Display Link state database\n"
929 "Search by Advertising Router\n"
930 "Specify Advertising Router as IPv4 address notation\n"
931 "Search by Link state ID\n"
932 "Specify Link state ID as IPv4 address notation\n"
933 )
934{
935 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000936 struct listnode *i, *j;
hasso049207c2004-08-04 20:02:13 +0000937 struct ospf6 *o = ospf6;
938 struct ospf6_area *oa;
939 struct ospf6_interface *oi;
940 u_int32_t id = 0;
941 u_int32_t adv_router = 0;
942
943 OSPF6_CMD_CHECK_RUNNING ();
944
945 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
946 {
947 vty_out (vty, "Advertising Router is not parsable: %s%s",
948 argv[0], VNL);
949 return CMD_SUCCESS;
950 }
951
952 argc--;
953 argv++;
954
955 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
956 {
957 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso6452df02004-08-15 05:52:07 +0000958 argv[0], VNL);
hasso049207c2004-08-04 20:02:13 +0000959 return CMD_SUCCESS;
960 }
961
962 argc--;
963 argv++;
964 level = parse_show_level (argc, argv);
965
966 for (i = listhead (o->area_list); i; nextnode (i))
967 {
968 oa = (struct ospf6_area *) getdata (i);
969 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
970 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
971 }
972
973 for (i = listhead (o->area_list); i; nextnode (i))
974 {
975 oa = (struct ospf6_area *) getdata (i);
976 for (j = listhead (oa->if_list); j; nextnode (j))
977 {
978 oi = (struct ospf6_interface *) getdata (j);
979 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
980 oi->interface->name, oa->name, VNL, VNL);
981 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
982 }
983 }
984
985 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
986 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
987
988 vty_out (vty, "%s", VNL);
989 return CMD_SUCCESS;
990}
991
992ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id,
993 show_ipv6_ospf6_database_adv_router_linkstate_id_detail_cmd,
994 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D "
995 "(detail|dump|internal)",
996 SHOW_STR
997 IPV6_STR
998 OSPF6_STR
999 "Display Link state database\n"
1000 "Search by Advertising Router\n"
1001 "Specify Advertising Router as IPv4 address notation\n"
1002 "Search by Link state ID\n"
1003 "Specify Link state ID as IPv4 address notation\n"
1004 "Display details of LSAs\n"
1005 "Dump LSAs\n"
1006 "Display LSA's internal information\n"
1007 );
1008
hasso508e53e2004-05-18 18:57:06 +00001009DEFUN (show_ipv6_ospf6_database_type_id_router,
1010 show_ipv6_ospf6_database_type_id_router_cmd,
1011 "show ipv6 ospf6 database "
1012 "(router|network|inter-prefix|inter-router|as-external|"
1013 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D",
1014 SHOW_STR
1015 IPV6_STR
1016 OSPF6_STR
1017 "Display Link state database\n"
1018 "Display Router LSAs\n"
1019 "Display Network LSAs\n"
1020 "Display Inter-Area-Prefix LSAs\n"
1021 "Display Inter-Area-Router LSAs\n"
1022 "Display As-External LSAs\n"
1023 "Display Group-Membership LSAs\n"
1024 "Display Type-7 LSAs\n"
1025 "Display Link LSAs\n"
1026 "Display Intra-Area-Prefix LSAs\n"
1027 "Specify Link state ID as IPv4 address notation\n"
1028 "Specify Advertising Router as IPv4 address notation\n"
1029 )
1030{
hasso049207c2004-08-04 20:02:13 +00001031 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001032 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +00001033 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001034 struct ospf6_area *oa;
1035 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001036 u_int16_t type = 0;
1037 u_int32_t id = 0;
hasso049207c2004-08-04 20:02:13 +00001038 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001039
1040 OSPF6_CMD_CHECK_RUNNING ();
1041
hasso049207c2004-08-04 20:02:13 +00001042 type = parse_type_spec (argc, argv);
1043 argc--;
1044 argv++;
hasso508e53e2004-05-18 18:57:06 +00001045
hasso049207c2004-08-04 20:02:13 +00001046 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001047 {
1048 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001049 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001050 return CMD_SUCCESS;
1051 }
1052
hasso049207c2004-08-04 20:02:13 +00001053 argc--;
1054 argv++;
1055
1056 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001057 {
1058 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001059 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001060 return CMD_SUCCESS;
1061 }
1062
hasso049207c2004-08-04 20:02:13 +00001063 argc--;
1064 argv++;
1065 level = parse_show_level (argc, argv);
1066
1067 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +00001068 {
hasso6452df02004-08-15 05:52:07 +00001069 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001070 for (i = listhead (o->area_list); i; nextnode (i))
1071 {
1072 oa = (struct ospf6_area *) getdata (i);
1073 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1074 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1075 }
1076 break;
1077
hasso6452df02004-08-15 05:52:07 +00001078 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001079 for (i = listhead (o->area_list); i; nextnode (i))
1080 {
1081 oa = (struct ospf6_area *) getdata (i);
1082 for (j = listhead (oa->if_list); j; nextnode (j))
1083 {
1084 oi = (struct ospf6_interface *) getdata (j);
1085 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1086 oi->interface->name, oa->name, VNL, VNL);
1087 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1088 }
1089 }
1090 break;
1091
hasso6452df02004-08-15 05:52:07 +00001092 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001093 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1094 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1095 break;
1096
1097 default:
1098 assert (0);
1099 break;
hasso508e53e2004-05-18 18:57:06 +00001100 }
1101
hasso049207c2004-08-04 20:02:13 +00001102 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001103 return CMD_SUCCESS;
1104}
1105
1106ALIAS (show_ipv6_ospf6_database_type_id_router,
1107 show_ipv6_ospf6_database_type_id_router_detail_cmd,
1108 "show ipv6 ospf6 database "
1109 "(router|network|inter-prefix|inter-router|as-external|"
1110 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D "
1111 "(dump|internal)",
1112 SHOW_STR
1113 IPV6_STR
1114 OSPF6_STR
1115 "Display Link state database\n"
1116 "Display Router LSAs\n"
1117 "Display Network LSAs\n"
1118 "Display Inter-Area-Prefix LSAs\n"
1119 "Display Inter-Area-Router LSAs\n"
1120 "Display As-External LSAs\n"
1121 "Display Group-Membership LSAs\n"
1122 "Display Type-7 LSAs\n"
1123 "Display Link LSAs\n"
1124 "Display Intra-Area-Prefix LSAs\n"
1125 "Specify Link state ID as IPv4 address notation\n"
1126 "Specify Advertising Router as IPv4 address notation\n"
hasso049207c2004-08-04 20:02:13 +00001127 "Dump LSAs\n"
1128 "Display LSA's internal information\n"
1129 );
1130
1131DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1132 show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd,
1133 "show ipv6 ospf6 database "
1134 "(router|network|inter-prefix|inter-router|as-external|"
1135 "group-membership|type-7|link|intra-prefix) "
1136 "adv-router A.B.C.D linkstate-id A.B.C.D",
1137 SHOW_STR
1138 IPV6_STR
1139 OSPF6_STR
1140 "Display Link state database\n"
1141 "Display Router LSAs\n"
1142 "Display Network LSAs\n"
1143 "Display Inter-Area-Prefix LSAs\n"
1144 "Display Inter-Area-Router LSAs\n"
1145 "Display As-External LSAs\n"
1146 "Display Group-Membership LSAs\n"
1147 "Display Type-7 LSAs\n"
1148 "Display Link LSAs\n"
1149 "Display Intra-Area-Prefix LSAs\n"
1150 "Search by Advertising Router\n"
1151 "Specify Advertising Router as IPv4 address notation\n"
1152 "Search by Link state ID\n"
1153 "Specify Link state ID as IPv4 address notation\n"
1154 )
1155{
1156 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001157 struct listnode *i, *j;
hasso049207c2004-08-04 20:02:13 +00001158 struct ospf6 *o = ospf6;
1159 struct ospf6_area *oa;
1160 struct ospf6_interface *oi;
1161 u_int16_t type = 0;
1162 u_int32_t id = 0;
1163 u_int32_t adv_router = 0;
1164
1165 OSPF6_CMD_CHECK_RUNNING ();
1166
1167 type = parse_type_spec (argc, argv);
1168 argc--;
1169 argv++;
1170
1171 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1172 {
1173 vty_out (vty, "Advertising Router is not parsable: %s%s",
1174 argv[0], VNL);
1175 return CMD_SUCCESS;
1176 }
1177
1178 argc--;
1179 argv++;
1180
1181 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1182 {
1183 vty_out (vty, "Link state ID is not parsable: %s%s",
1184 argv[0], VNL);
1185 return CMD_SUCCESS;
1186 }
1187
1188 argc--;
1189 argv++;
1190 level = parse_show_level (argc, argv);
1191
1192 switch (OSPF6_LSA_SCOPE (type))
1193 {
hasso6452df02004-08-15 05:52:07 +00001194 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001195 for (i = listhead (o->area_list); i; nextnode (i))
1196 {
1197 oa = (struct ospf6_area *) getdata (i);
1198 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1199 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1200 }
1201 break;
1202
hasso6452df02004-08-15 05:52:07 +00001203 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001204 for (i = listhead (o->area_list); i; nextnode (i))
1205 {
1206 oa = (struct ospf6_area *) getdata (i);
1207 for (j = listhead (oa->if_list); j; nextnode (j))
1208 {
1209 oi = (struct ospf6_interface *) getdata (j);
1210 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1211 oi->interface->name, oa->name, VNL, VNL);
1212 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1213 }
1214 }
1215 break;
1216
hasso6452df02004-08-15 05:52:07 +00001217 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001218 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1219 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1220 break;
1221
1222 default:
1223 assert (0);
1224 break;
1225 }
1226
1227 vty_out (vty, "%s", VNL);
1228 return CMD_SUCCESS;
1229}
1230
1231ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1232 show_ipv6_ospf6_database_type_adv_router_linkstate_id_detail_cmd,
1233 "show ipv6 ospf6 database "
1234 "(router|network|inter-prefix|inter-router|as-external|"
1235 "group-membership|type-7|link|intra-prefix) "
1236 "adv-router A.B.C.D linkstate-id A.B.C.D "
1237 "(dump|internal)",
1238 SHOW_STR
1239 IPV6_STR
1240 OSPF6_STR
1241 "Display Link state database\n"
1242 "Display Router LSAs\n"
1243 "Display Network LSAs\n"
1244 "Display Inter-Area-Prefix LSAs\n"
1245 "Display Inter-Area-Router LSAs\n"
1246 "Display As-External LSAs\n"
1247 "Display Group-Membership LSAs\n"
1248 "Display Type-7 LSAs\n"
1249 "Display Link LSAs\n"
1250 "Display Intra-Area-Prefix LSAs\n"
1251 "Search by Advertising Router\n"
1252 "Specify Advertising Router as IPv4 address notation\n"
1253 "Search by Link state ID\n"
1254 "Specify Link state ID as IPv4 address notation\n"
hasso508e53e2004-05-18 18:57:06 +00001255 "Dump LSAs\n"
1256 "Display LSA's internal information\n"
1257 );
1258
1259DEFUN (show_ipv6_ospf6_database_self_originated,
1260 show_ipv6_ospf6_database_self_originated_cmd,
1261 "show ipv6 ospf6 database self-originated",
1262 SHOW_STR
1263 IPV6_STR
1264 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001265 "Display Self-originated LSAs\n"
1266 )
1267{
hasso049207c2004-08-04 20:02:13 +00001268 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001269 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +00001270 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001271 struct ospf6_area *oa;
1272 struct ospf6_interface *oi;
1273 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001274
1275 OSPF6_CMD_CHECK_RUNNING ();
1276
hasso049207c2004-08-04 20:02:13 +00001277 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +00001278
hasso049207c2004-08-04 20:02:13 +00001279 adv_router = o->router_id;
hasso508e53e2004-05-18 18:57:06 +00001280
hasso508e53e2004-05-18 18:57:06 +00001281 for (i = listhead (o->area_list); i; nextnode (i))
1282 {
hasso049207c2004-08-04 20:02:13 +00001283 oa = (struct ospf6_area *) getdata (i);
1284 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1285 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +00001286 }
hasso049207c2004-08-04 20:02:13 +00001287
hasso508e53e2004-05-18 18:57:06 +00001288 for (i = listhead (o->area_list); i; nextnode (i))
1289 {
hasso049207c2004-08-04 20:02:13 +00001290 oa = (struct ospf6_area *) getdata (i);
hasso508e53e2004-05-18 18:57:06 +00001291 for (j = listhead (oa->if_list); j; nextnode (j))
1292 {
hasso049207c2004-08-04 20:02:13 +00001293 oi = (struct ospf6_interface *) getdata (j);
1294 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1295 oi->interface->name, oa->name, VNL, VNL);
1296 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +00001297 }
1298 }
1299
hasso049207c2004-08-04 20:02:13 +00001300 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1301 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
1302
1303 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001304 return CMD_SUCCESS;
1305}
1306
1307ALIAS (show_ipv6_ospf6_database_self_originated,
1308 show_ipv6_ospf6_database_self_originated_detail_cmd,
1309 "show ipv6 ospf6 database self-originated "
1310 "(detail|dump|internal)",
1311 SHOW_STR
1312 IPV6_STR
1313 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001314 "Display Self-originated LSAs\n"
1315 "Display details of LSAs\n"
1316 "Dump LSAs\n"
1317 "Display LSA's internal information\n"
hasso049207c2004-08-04 20:02:13 +00001318 )
hasso508e53e2004-05-18 18:57:06 +00001319
1320DEFUN (show_ipv6_ospf6_database_type_self_originated,
1321 show_ipv6_ospf6_database_type_self_originated_cmd,
1322 "show ipv6 ospf6 database "
1323 "(router|network|inter-prefix|inter-router|as-external|"
1324 "group-membership|type-7|link|intra-prefix) self-originated",
1325 SHOW_STR
1326 IPV6_STR
1327 OSPF6_STR
1328 "Display Link state database\n"
1329 "Display Router LSAs\n"
1330 "Display Network LSAs\n"
1331 "Display Inter-Area-Prefix LSAs\n"
1332 "Display Inter-Area-Router LSAs\n"
1333 "Display As-External LSAs\n"
1334 "Display Group-Membership LSAs\n"
1335 "Display Type-7 LSAs\n"
1336 "Display Link LSAs\n"
1337 "Display Intra-Area-Prefix LSAs\n"
1338 "Display Self-originated LSAs\n"
1339 )
1340{
hasso049207c2004-08-04 20:02:13 +00001341 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001342 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +00001343 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001344 struct ospf6_area *oa;
1345 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001346 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +00001347 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001348
1349 OSPF6_CMD_CHECK_RUNNING ();
1350
hasso049207c2004-08-04 20:02:13 +00001351 type = parse_type_spec (argc, argv);
1352 argc--;
1353 argv++;
1354 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +00001355
hasso049207c2004-08-04 20:02:13 +00001356 adv_router = o->router_id;
hasso508e53e2004-05-18 18:57:06 +00001357
hasso049207c2004-08-04 20:02:13 +00001358 switch (OSPF6_LSA_SCOPE (type))
1359 {
hasso6452df02004-08-15 05:52:07 +00001360 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001361 for (i = listhead (o->area_list); i; nextnode (i))
1362 {
1363 oa = (struct ospf6_area *) getdata (i);
1364 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1365 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
1366 }
1367 break;
hasso508e53e2004-05-18 18:57:06 +00001368
hasso6452df02004-08-15 05:52:07 +00001369 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001370 for (i = listhead (o->area_list); i; nextnode (i))
1371 {
1372 oa = (struct ospf6_area *) getdata (i);
1373 for (j = listhead (oa->if_list); j; nextnode (j))
1374 {
1375 oi = (struct ospf6_interface *) getdata (j);
1376 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1377 oi->interface->name, oa->name, VNL, VNL);
1378 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
1379 }
1380 }
1381 break;
1382
hasso6452df02004-08-15 05:52:07 +00001383 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001384 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1385 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
1386 break;
1387
1388 default:
1389 assert (0);
1390 break;
hasso508e53e2004-05-18 18:57:06 +00001391 }
1392
hasso049207c2004-08-04 20:02:13 +00001393 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001394 return CMD_SUCCESS;
1395}
1396
1397ALIAS (show_ipv6_ospf6_database_type_self_originated,
1398 show_ipv6_ospf6_database_type_self_originated_detail_cmd,
1399 "show ipv6 ospf6 database "
1400 "(router|network|inter-prefix|inter-router|as-external|"
1401 "group-membership|type-7|link|intra-prefix) self-originated "
1402 "(detail|dump|internal)",
1403 SHOW_STR
1404 IPV6_STR
1405 OSPF6_STR
1406 "Display Link state database\n"
1407 "Display Router LSAs\n"
1408 "Display Network LSAs\n"
1409 "Display Inter-Area-Prefix LSAs\n"
1410 "Display Inter-Area-Router LSAs\n"
1411 "Display As-External LSAs\n"
1412 "Display Group-Membership LSAs\n"
1413 "Display Type-7 LSAs\n"
1414 "Display Link LSAs\n"
1415 "Display Intra-Area-Prefix LSAs\n"
1416 "Display Self-originated LSAs\n"
1417 "Display details of LSAs\n"
1418 "Dump LSAs\n"
1419 "Display LSA's internal information\n"
1420 );
1421
hasso049207c2004-08-04 20:02:13 +00001422DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1423 show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd,
1424 "show ipv6 ospf6 database "
1425 "(router|network|inter-prefix|inter-router|as-external|"
1426 "group-membership|type-7|link|intra-prefix) self-originated "
1427 "linkstate-id A.B.C.D",
1428 SHOW_STR
1429 IPV6_STR
1430 OSPF6_STR
1431 "Display Link state database\n"
1432 "Display Router LSAs\n"
1433 "Display Network LSAs\n"
1434 "Display Inter-Area-Prefix LSAs\n"
1435 "Display Inter-Area-Router LSAs\n"
1436 "Display As-External LSAs\n"
1437 "Display Group-Membership LSAs\n"
1438 "Display Type-7 LSAs\n"
1439 "Display Link LSAs\n"
1440 "Display Intra-Area-Prefix LSAs\n"
1441 "Display Self-originated LSAs\n"
1442 "Search by Link state ID\n"
1443 "Specify Link state ID as IPv4 address notation\n"
1444 )
1445{
1446 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001447 struct listnode *i, *j;
hasso049207c2004-08-04 20:02:13 +00001448 struct ospf6 *o = ospf6;
1449 struct ospf6_area *oa;
1450 struct ospf6_interface *oi;
1451 u_int16_t type = 0;
1452 u_int32_t adv_router = 0;
1453 u_int32_t id = 0;
1454
1455 OSPF6_CMD_CHECK_RUNNING ();
1456
1457 type = parse_type_spec (argc, argv);
1458 argc--;
1459 argv++;
1460
hasso6452df02004-08-15 05:52:07 +00001461 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso049207c2004-08-04 20:02:13 +00001462 {
1463 vty_out (vty, "Link State ID is not parsable: %s%s",
1464 argv[0], VNL);
1465 return CMD_SUCCESS;
1466 }
1467
1468 argc--;
1469 argv++;
1470 level = parse_show_level (argc, argv);
1471
1472 adv_router = o->router_id;
1473
1474 switch (OSPF6_LSA_SCOPE (type))
1475 {
hasso6452df02004-08-15 05:52:07 +00001476 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001477 for (i = listhead (o->area_list); i; nextnode (i))
1478 {
1479 oa = (struct ospf6_area *) getdata (i);
1480 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1481 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1482 }
1483 break;
1484
hasso6452df02004-08-15 05:52:07 +00001485 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001486 for (i = listhead (o->area_list); i; nextnode (i))
1487 {
1488 oa = (struct ospf6_area *) getdata (i);
1489 for (j = listhead (oa->if_list); j; nextnode (j))
1490 {
1491 oi = (struct ospf6_interface *) getdata (j);
1492 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1493 oi->interface->name, oa->name, VNL, VNL);
1494 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1495 }
1496 }
1497 break;
1498
hasso6452df02004-08-15 05:52:07 +00001499 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001500 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1501 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1502 break;
1503
1504 default:
1505 assert (0);
1506 break;
1507 }
1508
1509 vty_out (vty, "%s", VNL);
1510 return CMD_SUCCESS;
1511}
1512
1513ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1514 show_ipv6_ospf6_database_type_self_originated_linkstate_id_detail_cmd,
1515 "show ipv6 ospf6 database "
1516 "(router|network|inter-prefix|inter-router|as-external|"
1517 "group-membership|type-7|link|intra-prefix) self-originated "
1518 "linkstate-id A.B.C.D (detail|dump|internal)",
1519 SHOW_STR
1520 IPV6_STR
1521 OSPF6_STR
1522 "Display Link state database\n"
1523 "Display Router LSAs\n"
1524 "Display Network LSAs\n"
1525 "Display Inter-Area-Prefix LSAs\n"
1526 "Display Inter-Area-Router LSAs\n"
1527 "Display As-External LSAs\n"
1528 "Display Group-Membership LSAs\n"
1529 "Display Type-7 LSAs\n"
1530 "Display Link LSAs\n"
1531 "Display Intra-Area-Prefix LSAs\n"
1532 "Display Self-originated LSAs\n"
1533 "Search by Link state ID\n"
1534 "Specify Link state ID as IPv4 address notation\n"
1535 "Display details of LSAs\n"
1536 "Dump LSAs\n"
1537 "Display LSA's internal information\n"
1538 );
1539
hasso508e53e2004-05-18 18:57:06 +00001540DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
1541 show_ipv6_ospf6_database_type_id_self_originated_cmd,
1542 "show ipv6 ospf6 database "
1543 "(router|network|inter-prefix|inter-router|as-external|"
1544 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated",
1545 SHOW_STR
1546 IPV6_STR
1547 OSPF6_STR
1548 "Display Link state database\n"
1549 "Display Router LSAs\n"
1550 "Display Network LSAs\n"
1551 "Display Inter-Area-Prefix LSAs\n"
1552 "Display Inter-Area-Router LSAs\n"
1553 "Display As-External LSAs\n"
1554 "Display Group-Membership LSAs\n"
1555 "Display Type-7 LSAs\n"
1556 "Display Link LSAs\n"
1557 "Display Intra-Area-Prefix LSAs\n"
1558 "Specify Link state ID as IPv4 address notation\n"
1559 "Display Self-originated LSAs\n"
1560 )
1561{
hasso049207c2004-08-04 20:02:13 +00001562 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001563 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +00001564 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001565 struct ospf6_area *oa;
1566 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001567 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +00001568 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001569 u_int32_t id = 0;
1570
1571 OSPF6_CMD_CHECK_RUNNING ();
1572
hasso049207c2004-08-04 20:02:13 +00001573 type = parse_type_spec (argc, argv);
1574 argc--;
1575 argv++;
hasso508e53e2004-05-18 18:57:06 +00001576
hasso6452df02004-08-15 05:52:07 +00001577 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001578 {
1579 vty_out (vty, "Link State ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001580 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001581 return CMD_SUCCESS;
1582 }
1583
hasso049207c2004-08-04 20:02:13 +00001584 argc--;
1585 argv++;
1586 level = parse_show_level (argc, argv);
1587
1588 adv_router = o->router_id;
1589
1590 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +00001591 {
hasso6452df02004-08-15 05:52:07 +00001592 case OSPF6_SCOPE_AREA:
hasso049207c2004-08-04 20:02:13 +00001593 for (i = listhead (o->area_list); i; nextnode (i))
1594 {
1595 oa = (struct ospf6_area *) getdata (i);
1596 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1597 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1598 }
1599 break;
1600
hasso6452df02004-08-15 05:52:07 +00001601 case OSPF6_SCOPE_LINKLOCAL:
hasso049207c2004-08-04 20:02:13 +00001602 for (i = listhead (o->area_list); i; nextnode (i))
1603 {
1604 oa = (struct ospf6_area *) getdata (i);
1605 for (j = listhead (oa->if_list); j; nextnode (j))
1606 {
1607 oi = (struct ospf6_interface *) getdata (j);
1608 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1609 oi->interface->name, oa->name, VNL, VNL);
1610 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1611 }
1612 }
1613 break;
1614
hasso6452df02004-08-15 05:52:07 +00001615 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001616 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1617 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1618 break;
1619
1620 default:
1621 assert (0);
1622 break;
hasso508e53e2004-05-18 18:57:06 +00001623 }
1624
hasso049207c2004-08-04 20:02:13 +00001625 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001626 return CMD_SUCCESS;
1627}
1628
1629ALIAS (show_ipv6_ospf6_database_type_id_self_originated,
1630 show_ipv6_ospf6_database_type_id_self_originated_detail_cmd,
1631 "show ipv6 ospf6 database "
1632 "(router|network|inter-prefix|inter-router|as-external|"
1633 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated "
hasso049207c2004-08-04 20:02:13 +00001634 "(detail|dump|internal)",
hasso508e53e2004-05-18 18:57:06 +00001635 SHOW_STR
1636 IPV6_STR
1637 OSPF6_STR
1638 "Display Link state database\n"
1639 "Display Router LSAs\n"
1640 "Display Network LSAs\n"
1641 "Display Inter-Area-Prefix LSAs\n"
1642 "Display Inter-Area-Router LSAs\n"
1643 "Display As-External LSAs\n"
1644 "Display Group-Membership LSAs\n"
1645 "Display Type-7 LSAs\n"
1646 "Display Link LSAs\n"
1647 "Display Intra-Area-Prefix LSAs\n"
hasso508e53e2004-05-18 18:57:06 +00001648 "Display Self-originated LSAs\n"
hasso049207c2004-08-04 20:02:13 +00001649 "Search by Link state ID\n"
1650 "Specify Link state ID as IPv4 address notation\n"
hasso508e53e2004-05-18 18:57:06 +00001651 "Display details of LSAs\n"
1652 "Dump LSAs\n"
1653 "Display LSA's internal information\n"
1654 );
1655
hasso6452df02004-08-15 05:52:07 +00001656
1657DEFUN (show_ipv6_ospf6_border_routers,
1658 show_ipv6_ospf6_border_routers_cmd,
1659 "show ipv6 ospf6 border-routers",
1660 SHOW_STR
1661 IP6_STR
1662 OSPF6_STR
1663 "Display routing table for ABR and ASBR\n"
1664 )
1665{
1666 u_int32_t adv_router;
1667 void (*showfunc) (struct vty *, struct ospf6_route *);
1668 struct ospf6_route *ro;
1669 struct prefix prefix;
1670
1671 OSPF6_CMD_CHECK_RUNNING ();
1672
1673 if (argc && ! strcmp ("detail", argv[0]))
1674 {
1675 showfunc = ospf6_route_show_detail;
1676 argc--;
1677 argv++;
1678 }
1679 else
1680 showfunc = ospf6_brouter_show;
1681
1682 if (argc)
1683 {
1684 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1685 {
1686 vty_out (vty, "Router ID is not parsable: %s%s", argv[0], VNL);
1687 return CMD_SUCCESS;
1688 }
1689
1690 ospf6_linkstate_prefix (adv_router, 0, &prefix);
1691 ro = ospf6_route_lookup (&prefix, ospf6->brouter_table);
1692 ospf6_route_show_detail (vty, ro);
1693 return CMD_SUCCESS;
1694 }
1695
1696 if (showfunc == ospf6_brouter_show)
1697 ospf6_brouter_show_header (vty);
1698
1699 for (ro = ospf6_route_head (ospf6->brouter_table); ro;
1700 ro = ospf6_route_next (ro))
1701 (*showfunc) (vty, ro);
1702
1703 return CMD_SUCCESS;
1704}
1705
1706ALIAS (show_ipv6_ospf6_border_routers,
1707 show_ipv6_ospf6_border_routers_detail_cmd,
1708 "show ipv6 ospf6 border-routers (A.B.C.D|detail)",
1709 SHOW_STR
1710 IP6_STR
1711 OSPF6_STR
1712 "Display routing table for ABR and ASBR\n"
1713 "Specify Router-ID\n"
1714 "Display Detail\n"
1715 );
1716
hasso4846ef62004-09-03 06:04:00 +00001717DEFUN (show_ipv6_ospf6_linkstate,
1718 show_ipv6_ospf6_linkstate_cmd,
1719 "show ipv6 ospf6 linkstate",
1720 SHOW_STR
1721 IP6_STR
1722 OSPF6_STR
1723 "Display linkstate routing table\n"
1724 )
1725{
hasso52dc7ee2004-09-23 19:18:23 +00001726 struct listnode *node;
hasso4846ef62004-09-03 06:04:00 +00001727 struct ospf6_area *oa;
1728
1729 for (node = listhead (ospf6->area_list); node; nextnode (node))
1730 {
1731 oa = OSPF6_AREA (getdata (node));
1732
1733 vty_out (vty, "%s SPF Result in Area %s%s%s",
1734 VNL, oa->name, VNL, VNL);
1735 ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table);
1736 }
1737
1738 vty_out (vty, "%s", VNL);
1739 return CMD_SUCCESS;
1740}
1741
1742ALIAS (show_ipv6_ospf6_linkstate,
1743 show_ipv6_ospf6_linkstate_router_cmd,
1744 "show ipv6 ospf6 linkstate router A.B.C.D",
1745 SHOW_STR
1746 IP6_STR
1747 OSPF6_STR
1748 "Display linkstate routing table\n"
1749 "Display Router Entry\n"
1750 "Specify Router ID as IPv4 address notation\n"
1751 );
1752
1753ALIAS (show_ipv6_ospf6_linkstate,
1754 show_ipv6_ospf6_linkstate_network_cmd,
1755 "show ipv6 ospf6 linkstate network A.B.C.D A.B.C.D",
1756 SHOW_STR
1757 IP6_STR
1758 OSPF6_STR
1759 "Display linkstate routing table\n"
1760 "Display Network Entry\n"
1761 "Specify Router ID as IPv4 address notation\n"
1762 "Specify Link state ID as IPv4 address notation\n"
1763 );
1764
1765DEFUN (show_ipv6_ospf6_linkstate_detail,
1766 show_ipv6_ospf6_linkstate_detail_cmd,
1767 "show ipv6 ospf6 linkstate detail",
1768 SHOW_STR
1769 IP6_STR
1770 OSPF6_STR
1771 "Display linkstate routing table\n"
1772 )
1773{
1774 char *sargv[CMD_ARGC_MAX];
1775 int i, sargc;
hasso52dc7ee2004-09-23 19:18:23 +00001776 struct listnode *node;
hasso4846ef62004-09-03 06:04:00 +00001777 struct ospf6_area *oa;
1778
1779 /* copy argv to sargv and then append "detail" */
1780 for (i = 0; i < argc; i++)
1781 sargv[i] = argv[i];
1782 sargc = argc;
1783 sargv[sargc++] = "detail";
1784 sargv[sargc] = NULL;
1785
1786 for (node = listhead (ospf6->area_list); node; nextnode (node))
1787 {
1788 oa = OSPF6_AREA (getdata (node));
1789
1790 vty_out (vty, "%s SPF Result in Area %s%s%s",
1791 VNL, oa->name, VNL, VNL);
1792 ospf6_linkstate_table_show (vty, sargc, sargv, oa->spf_table);
1793 }
1794
1795 vty_out (vty, "%s", VNL);
1796 return CMD_SUCCESS;
1797}
hasso6452df02004-08-15 05:52:07 +00001798
paul718e3742002-12-13 20:15:29 +00001799/* Install ospf related commands. */
1800void
1801ospf6_init ()
1802{
hasso1e058382004-09-01 21:36:14 +00001803 ospf6_top_init ();
1804 ospf6_area_init ();
1805 ospf6_interface_init ();
1806 ospf6_neighbor_init ();
1807 ospf6_zebra_init ();
1808
1809 ospf6_lsa_init ();
1810 ospf6_spf_init ();
1811 ospf6_intra_init ();
1812 ospf6_asbr_init ();
1813 ospf6_abr_init ();
1814
hasso508e53e2004-05-18 18:57:06 +00001815 install_node (&debug_node, config_write_ospf6_debug);
paul718e3742002-12-13 20:15:29 +00001816
hasso508e53e2004-05-18 18:57:06 +00001817 install_element_ospf6_debug_message ();
1818 install_element_ospf6_debug_lsa ();
1819 install_element_ospf6_debug_interface ();
1820 install_element_ospf6_debug_neighbor ();
1821 install_element_ospf6_debug_zebra ();
1822 install_element_ospf6_debug_spf ();
1823 install_element_ospf6_debug_route ();
1824 install_element_ospf6_debug_asbr ();
hasso6452df02004-08-15 05:52:07 +00001825 install_element_ospf6_debug_abr ();
hasso1e058382004-09-01 21:36:14 +00001826 install_element_ospf6_debug_flood ();
hasso508e53e2004-05-18 18:57:06 +00001827
paul718e3742002-12-13 20:15:29 +00001828 install_element (VIEW_NODE, &show_version_ospf6_cmd);
paul718e3742002-12-13 20:15:29 +00001829 install_element (ENABLE_NODE, &show_version_ospf6_cmd);
hasso049207c2004-08-04 20:02:13 +00001830
hasso6452df02004-08-15 05:52:07 +00001831 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_cmd);
1832 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_detail_cmd);
1833 install_element (ENABLE_NODE, &show_ipv6_ospf6_border_routers_cmd);
1834 install_element (ENABLE_NODE, &show_ipv6_ospf6_border_routers_detail_cmd);
1835
hasso4846ef62004-09-03 06:04:00 +00001836 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_cmd);
1837 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_router_cmd);
1838 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_network_cmd);
1839 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_detail_cmd);
1840 install_element (ENABLE_NODE, &show_ipv6_ospf6_linkstate_cmd);
1841 install_element (ENABLE_NODE, &show_ipv6_ospf6_linkstate_router_cmd);
1842 install_element (ENABLE_NODE, &show_ipv6_ospf6_linkstate_network_cmd);
1843 install_element (ENABLE_NODE, &show_ipv6_ospf6_linkstate_detail_cmd);
1844
hasso049207c2004-08-04 20:02:13 +00001845#define INSTALL(n,c) \
1846 install_element (n ## _NODE, &show_ipv6_ospf6_ ## c);
1847
1848 INSTALL (VIEW, database_cmd);
1849 INSTALL (VIEW, database_detail_cmd);
1850 INSTALL (VIEW, database_type_cmd);
1851 INSTALL (VIEW, database_type_detail_cmd);
1852 INSTALL (VIEW, database_id_cmd);
1853 INSTALL (VIEW, database_id_detail_cmd);
1854 INSTALL (VIEW, database_linkstate_id_cmd);
1855 INSTALL (VIEW, database_linkstate_id_detail_cmd);
1856 INSTALL (VIEW, database_router_cmd);
1857 INSTALL (VIEW, database_router_detail_cmd);
1858 INSTALL (VIEW, database_adv_router_cmd);
1859 INSTALL (VIEW, database_adv_router_detail_cmd);
1860 INSTALL (VIEW, database_type_id_cmd);
1861 INSTALL (VIEW, database_type_id_detail_cmd);
1862 INSTALL (VIEW, database_type_linkstate_id_cmd);
1863 INSTALL (VIEW, database_type_linkstate_id_detail_cmd);
1864 INSTALL (VIEW, database_type_router_cmd);
1865 INSTALL (VIEW, database_type_router_detail_cmd);
1866 INSTALL (VIEW, database_type_adv_router_cmd);
1867 INSTALL (VIEW, database_type_adv_router_detail_cmd);
1868 INSTALL (VIEW, database_adv_router_linkstate_id_cmd);
1869 INSTALL (VIEW, database_adv_router_linkstate_id_detail_cmd);
1870 INSTALL (VIEW, database_id_router_cmd);
1871 INSTALL (VIEW, database_id_router_detail_cmd);
1872 INSTALL (VIEW, database_type_id_router_cmd);
1873 INSTALL (VIEW, database_type_id_router_detail_cmd);
1874 INSTALL (VIEW, database_type_adv_router_linkstate_id_cmd);
1875 INSTALL (VIEW, database_type_adv_router_linkstate_id_detail_cmd);
1876 INSTALL (VIEW, database_self_originated_cmd);
1877 INSTALL (VIEW, database_self_originated_detail_cmd);
1878 INSTALL (VIEW, database_type_self_originated_cmd);
1879 INSTALL (VIEW, database_type_self_originated_detail_cmd);
1880 INSTALL (VIEW, database_type_id_self_originated_cmd);
1881 INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
1882 INSTALL (VIEW, database_type_self_originated_linkstate_id_cmd);
1883 INSTALL (VIEW, database_type_self_originated_linkstate_id_detail_cmd);
1884 INSTALL (VIEW, database_type_id_self_originated_cmd);
1885 INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
1886
1887 INSTALL (ENABLE, database_cmd);
1888 INSTALL (ENABLE, database_detail_cmd);
1889 INSTALL (ENABLE, database_type_cmd);
1890 INSTALL (ENABLE, database_type_detail_cmd);
1891 INSTALL (ENABLE, database_id_cmd);
1892 INSTALL (ENABLE, database_id_detail_cmd);
1893 INSTALL (ENABLE, database_linkstate_id_cmd);
1894 INSTALL (ENABLE, database_linkstate_id_detail_cmd);
1895 INSTALL (ENABLE, database_router_cmd);
1896 INSTALL (ENABLE, database_router_detail_cmd);
1897 INSTALL (ENABLE, database_adv_router_cmd);
1898 INSTALL (ENABLE, database_adv_router_detail_cmd);
1899 INSTALL (ENABLE, database_type_id_cmd);
1900 INSTALL (ENABLE, database_type_id_detail_cmd);
1901 INSTALL (ENABLE, database_type_linkstate_id_cmd);
1902 INSTALL (ENABLE, database_type_linkstate_id_detail_cmd);
1903 INSTALL (ENABLE, database_type_router_cmd);
1904 INSTALL (ENABLE, database_type_router_detail_cmd);
1905 INSTALL (ENABLE, database_type_adv_router_cmd);
1906 INSTALL (ENABLE, database_type_adv_router_detail_cmd);
1907 INSTALL (ENABLE, database_adv_router_linkstate_id_cmd);
1908 INSTALL (ENABLE, database_adv_router_linkstate_id_detail_cmd);
1909 INSTALL (ENABLE, database_id_router_cmd);
1910 INSTALL (ENABLE, database_id_router_detail_cmd);
1911 INSTALL (ENABLE, database_type_id_router_cmd);
1912 INSTALL (ENABLE, database_type_id_router_detail_cmd);
1913 INSTALL (ENABLE, database_type_adv_router_linkstate_id_cmd);
1914 INSTALL (ENABLE, database_type_adv_router_linkstate_id_detail_cmd);
1915 INSTALL (ENABLE, database_self_originated_cmd);
1916 INSTALL (ENABLE, database_self_originated_detail_cmd);
1917 INSTALL (ENABLE, database_type_self_originated_cmd);
1918 INSTALL (ENABLE, database_type_self_originated_detail_cmd);
1919 INSTALL (ENABLE, database_type_id_self_originated_cmd);
1920 INSTALL (ENABLE, database_type_id_self_originated_detail_cmd);
1921 INSTALL (ENABLE, database_type_self_originated_linkstate_id_cmd);
1922 INSTALL (ENABLE, database_type_self_originated_linkstate_id_detail_cmd);
1923 INSTALL (ENABLE, database_type_id_self_originated_cmd);
1924 INSTALL (ENABLE, database_type_id_self_originated_detail_cmd);
paul718e3742002-12-13 20:15:29 +00001925
hasso508e53e2004-05-18 18:57:06 +00001926 /* Make ospf protocol socket. */
1927 ospf6_serv_sock ();
1928 thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
paul718e3742002-12-13 20:15:29 +00001929}
1930
paul718e3742002-12-13 20:15:29 +00001931