2 * Copyright (C) 2003 Yasuhiro Ohara
4 * This file is part of GNU Zebra.
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
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.
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.
29 #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"
43 #include "ospf6_abr.h"
44 #include "ospf6_flood.h"
48 #include "ospf6_snmp.h"
51 char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION;
54 route_prev (struct route_node *node)
56 struct route_node *end;
57 struct route_node *prev = NULL;
62 route_lock_node (node);
66 node = route_next (node);
69 route_unlock_node (node);
73 route_unlock_node (end);
75 route_lock_node (prev);
81 /* show database functions */
82 DEFUN (show_version_ospf6,
83 show_version_ospf6_cmd,
86 "Displays ospf6d version\n"
89 vty_out (vty, "Zebra OSPF6d Version: %s%s",
90 ospf6_daemon_version, VNL);
95 static struct cmd_node debug_node =
103 config_write_ospf6_debug (struct vty *vty)
105 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_brouter (vty);
113 config_write_ospf6_debug_asbr (vty);
114 config_write_ospf6_debug_abr (vty);
115 config_write_ospf6_debug_flood (vty);
116 vty_out (vty, "!%s", VNL);
120 #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"
128 parse_show_level (int argc, const char *argv[])
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;
141 level = OSPF6_LSDB_SHOW_LEVEL_NORMAL;
146 parse_type_spec (int argc, const char *argv[])
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);
167 DEFUN (show_ipv6_ospf6_database,
168 show_ipv6_ospf6_database_cmd,
169 "show ipv6 ospf6 database",
173 "Display Link state database\n"
177 struct listnode *i, *j;
178 struct ospf6 *o = ospf6;
179 struct ospf6_area *oa;
180 struct ospf6_interface *oi;
182 OSPF6_CMD_CHECK_RUNNING ();
184 level = parse_show_level (argc, argv);
186 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
188 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
189 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
192 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
194 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
196 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
197 oi->interface->name, oa->name, VNL, VNL);
198 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
202 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
203 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb);
205 vty_out (vty, "%s", VNL);
209 ALIAS (show_ipv6_ospf6_database,
210 show_ipv6_ospf6_database_detail_cmd,
211 "show ipv6 ospf6 database (detail|dump|internal)",
215 "Display Link state database\n"
216 "Display details of LSAs\n"
218 "Display LSA's internal information\n"
221 DEFUN (show_ipv6_ospf6_database_type,
222 show_ipv6_ospf6_database_type_cmd,
223 "show ipv6 ospf6 database "
224 "(router|network|inter-prefix|inter-router|as-external|"
225 "group-membership|type-7|link|intra-prefix)",
229 "Display Link state database\n"
230 "Display Router LSAs\n"
231 "Display Network LSAs\n"
232 "Display Inter-Area-Prefix LSAs\n"
233 "Display Inter-Area-Router LSAs\n"
234 "Display As-External LSAs\n"
235 "Display Group-Membership LSAs\n"
236 "Display Type-7 LSAs\n"
237 "Display Link LSAs\n"
238 "Display Intra-Area-Prefix LSAs\n"
242 struct listnode *i, *j;
243 struct ospf6 *o = ospf6;
244 struct ospf6_area *oa;
245 struct ospf6_interface *oi;
248 OSPF6_CMD_CHECK_RUNNING ();
250 type = parse_type_spec (argc, argv);
253 level = parse_show_level (argc, argv);
255 switch (OSPF6_LSA_SCOPE (type))
257 case OSPF6_SCOPE_AREA:
258 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
260 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
261 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
265 case OSPF6_SCOPE_LINKLOCAL:
266 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
268 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
270 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
271 oi->interface->name, oa->name, VNL, VNL);
272 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
278 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
279 ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb);
287 vty_out (vty, "%s", VNL);
291 ALIAS (show_ipv6_ospf6_database_type,
292 show_ipv6_ospf6_database_type_detail_cmd,
293 "show ipv6 ospf6 database "
294 "(router|network|inter-prefix|inter-router|as-external|"
295 "group-membership|type-7|link|intra-prefix) "
296 "(detail|dump|internal)",
300 "Display Link state database\n"
301 "Display Router LSAs\n"
302 "Display Network LSAs\n"
303 "Display Inter-Area-Prefix LSAs\n"
304 "Display Inter-Area-Router LSAs\n"
305 "Display As-External LSAs\n"
306 "Display Group-Membership LSAs\n"
307 "Display Type-7 LSAs\n"
308 "Display Link LSAs\n"
309 "Display Intra-Area-Prefix LSAs\n"
310 "Display details of LSAs\n"
312 "Display LSA's internal information\n"
315 DEFUN (show_ipv6_ospf6_database_id,
316 show_ipv6_ospf6_database_id_cmd,
317 "show ipv6 ospf6 database * A.B.C.D",
321 "Display Link state database\n"
322 "Any Link state Type\n"
323 "Specify Link state ID as IPv4 address notation\n"
327 struct listnode *i, *j;
328 struct ospf6 *o = ospf6;
329 struct ospf6_area *oa;
330 struct ospf6_interface *oi;
333 OSPF6_CMD_CHECK_RUNNING ();
335 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
337 vty_out (vty, "Link State ID is not parsable: %s%s",
344 level = parse_show_level (argc, argv);
346 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
348 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
349 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
352 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
354 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
356 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
357 oi->interface->name, oa->name, VNL, VNL);
358 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
362 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
363 ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb);
365 vty_out (vty, "%s", VNL);
369 ALIAS (show_ipv6_ospf6_database_id,
370 show_ipv6_ospf6_database_id_detail_cmd,
371 "show ipv6 ospf6 database * A.B.C.D "
372 "(detail|dump|internal)",
376 "Display Link state database\n"
377 "Any Link state Type\n"
378 "Specify Link state ID as IPv4 address notation\n"
379 "Display details of LSAs\n"
381 "Display LSA's internal information\n"
384 ALIAS (show_ipv6_ospf6_database_id,
385 show_ipv6_ospf6_database_linkstate_id_cmd,
386 "show ipv6 ospf6 database linkstate-id A.B.C.D",
390 "Display Link state database\n"
391 "Search by Link state ID\n"
392 "Specify Link state ID as IPv4 address notation\n"
395 ALIAS (show_ipv6_ospf6_database_id,
396 show_ipv6_ospf6_database_linkstate_id_detail_cmd,
397 "show ipv6 ospf6 database linkstate-id A.B.C.D "
398 "(detail|dump|internal)",
402 "Display Link state database\n"
403 "Search by Link state ID\n"
404 "Specify Link state ID as IPv4 address notation\n"
405 "Display details of LSAs\n"
407 "Display LSA's internal information\n"
410 DEFUN (show_ipv6_ospf6_database_router,
411 show_ipv6_ospf6_database_router_cmd,
412 "show ipv6 ospf6 database * * A.B.C.D",
416 "Display Link state database\n"
417 "Any Link state Type\n"
418 "Any Link state ID\n"
419 "Specify Advertising Router as IPv4 address notation\n"
423 struct listnode *i, *j;
424 struct ospf6 *o = ospf6;
425 struct ospf6_area *oa;
426 struct ospf6_interface *oi;
427 u_int32_t adv_router = 0;
429 OSPF6_CMD_CHECK_RUNNING ();
431 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
433 vty_out (vty, "Advertising Router is not parsable: %s%s",
440 level = parse_show_level (argc, argv);
442 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
444 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
445 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
448 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
450 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
452 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
453 oi->interface->name, oa->name, VNL, VNL);
454 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
458 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
459 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
461 vty_out (vty, "%s", VNL);
465 ALIAS (show_ipv6_ospf6_database_router,
466 show_ipv6_ospf6_database_router_detail_cmd,
467 "show ipv6 ospf6 database * * A.B.C.D "
468 "(detail|dump|internal)",
472 "Display Link state database\n"
473 "Any Link state Type\n"
474 "Any Link state ID\n"
475 "Specify Advertising Router as IPv4 address notation\n"
476 "Display details of LSAs\n"
478 "Display LSA's internal information\n"
481 ALIAS (show_ipv6_ospf6_database_router,
482 show_ipv6_ospf6_database_adv_router_cmd,
483 "show ipv6 ospf6 database adv-router A.B.C.D",
487 "Display Link state database\n"
488 "Search by Advertising Router\n"
489 "Specify Advertising Router as IPv4 address notation\n"
492 ALIAS (show_ipv6_ospf6_database_router,
493 show_ipv6_ospf6_database_adv_router_detail_cmd,
494 "show ipv6 ospf6 database adv-router A.B.C.D "
495 "(detail|dump|internal)",
499 "Display Link state database\n"
500 "Search by Advertising Router\n"
501 "Specify Advertising Router as IPv4 address notation\n"
502 "Display details of LSAs\n"
504 "Display LSA's internal information\n"
507 DEFUN (show_ipv6_ospf6_database_type_id,
508 show_ipv6_ospf6_database_type_id_cmd,
509 "show ipv6 ospf6 database "
510 "(router|network|inter-prefix|inter-router|as-external|"
511 "group-membership|type-7|link|intra-prefix) A.B.C.D",
515 "Display Link state database\n"
516 "Display Router LSAs\n"
517 "Display Network LSAs\n"
518 "Display Inter-Area-Prefix LSAs\n"
519 "Display Inter-Area-Router LSAs\n"
520 "Display As-External LSAs\n"
521 "Display Group-Membership LSAs\n"
522 "Display Type-7 LSAs\n"
523 "Display Link LSAs\n"
524 "Display Intra-Area-Prefix LSAs\n"
525 "Specify Link state ID as IPv4 address notation\n"
529 struct listnode *i, *j;
530 struct ospf6 *o = ospf6;
531 struct ospf6_area *oa;
532 struct ospf6_interface *oi;
536 OSPF6_CMD_CHECK_RUNNING ();
538 type = parse_type_spec (argc, argv);
542 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
544 vty_out (vty, "Link state ID is not parsable: %s%s",
551 level = parse_show_level (argc, argv);
553 switch (OSPF6_LSA_SCOPE (type))
555 case OSPF6_SCOPE_AREA:
556 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
558 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
559 ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
563 case OSPF6_SCOPE_LINKLOCAL:
564 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
566 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
568 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
569 oi->interface->name, oa->name, VNL, VNL);
570 ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
576 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
577 ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb);
585 vty_out (vty, "%s", VNL);
589 ALIAS (show_ipv6_ospf6_database_type_id,
590 show_ipv6_ospf6_database_type_id_detail_cmd,
591 "show ipv6 ospf6 database "
592 "(router|network|inter-prefix|inter-router|as-external|"
593 "group-membership|type-7|link|intra-prefix) A.B.C.D "
594 "(detail|dump|internal)",
598 "Display Link state database\n"
599 "Display Router LSAs\n"
600 "Display Network LSAs\n"
601 "Display Inter-Area-Prefix LSAs\n"
602 "Display Inter-Area-Router LSAs\n"
603 "Display As-External LSAs\n"
604 "Display Group-Membership LSAs\n"
605 "Display Type-7 LSAs\n"
606 "Display Link LSAs\n"
607 "Display Intra-Area-Prefix LSAs\n"
608 "Specify Link state ID as IPv4 address notation\n"
609 "Display details of LSAs\n"
611 "Display LSA's internal information\n"
614 ALIAS (show_ipv6_ospf6_database_type_id,
615 show_ipv6_ospf6_database_type_linkstate_id_cmd,
616 "show ipv6 ospf6 database "
617 "(router|network|inter-prefix|inter-router|as-external|"
618 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D",
622 "Display Link state database\n"
623 "Display Router LSAs\n"
624 "Display Network LSAs\n"
625 "Display Inter-Area-Prefix LSAs\n"
626 "Display Inter-Area-Router LSAs\n"
627 "Display As-External LSAs\n"
628 "Display Group-Membership LSAs\n"
629 "Display Type-7 LSAs\n"
630 "Display Link LSAs\n"
631 "Display Intra-Area-Prefix LSAs\n"
632 "Search by Link state ID\n"
633 "Specify Link state ID as IPv4 address notation\n"
636 ALIAS (show_ipv6_ospf6_database_type_id,
637 show_ipv6_ospf6_database_type_linkstate_id_detail_cmd,
638 "show ipv6 ospf6 database "
639 "(router|network|inter-prefix|inter-router|as-external|"
640 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D "
641 "(detail|dump|internal)",
645 "Display Link state database\n"
646 "Display Router LSAs\n"
647 "Display Network LSAs\n"
648 "Display Inter-Area-Prefix LSAs\n"
649 "Display Inter-Area-Router LSAs\n"
650 "Display As-External LSAs\n"
651 "Display Group-Membership LSAs\n"
652 "Display Type-7 LSAs\n"
653 "Display Link LSAs\n"
654 "Display Intra-Area-Prefix LSAs\n"
655 "Search by Link state ID\n"
656 "Specify Link state ID as IPv4 address notation\n"
657 "Display details of LSAs\n"
659 "Display LSA's internal information\n"
662 DEFUN (show_ipv6_ospf6_database_type_router,
663 show_ipv6_ospf6_database_type_router_cmd,
664 "show ipv6 ospf6 database "
665 "(router|network|inter-prefix|inter-router|as-external|"
666 "group-membership|type-7|link|intra-prefix) * A.B.C.D",
670 "Display Link state database\n"
671 "Display Router LSAs\n"
672 "Display Network LSAs\n"
673 "Display Inter-Area-Prefix LSAs\n"
674 "Display Inter-Area-Router LSAs\n"
675 "Display As-External LSAs\n"
676 "Display Group-Membership LSAs\n"
677 "Display Type-7 LSAs\n"
678 "Display Link LSAs\n"
679 "Display Intra-Area-Prefix LSAs\n"
680 "Any Link state ID\n"
681 "Specify Advertising Router as IPv4 address notation\n"
685 struct listnode *i, *j;
686 struct ospf6 *o = ospf6;
687 struct ospf6_area *oa;
688 struct ospf6_interface *oi;
690 u_int32_t adv_router = 0;
692 OSPF6_CMD_CHECK_RUNNING ();
694 type = parse_type_spec (argc, argv);
698 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
700 vty_out (vty, "Advertising Router is not parsable: %s%s",
707 level = parse_show_level (argc, argv);
709 switch (OSPF6_LSA_SCOPE (type))
711 case OSPF6_SCOPE_AREA:
712 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
714 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
715 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
719 case OSPF6_SCOPE_LINKLOCAL:
720 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
722 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
724 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
725 oi->interface->name, oa->name, VNL, VNL);
726 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
732 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
733 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
741 vty_out (vty, "%s", VNL);
745 ALIAS (show_ipv6_ospf6_database_type_router,
746 show_ipv6_ospf6_database_type_router_detail_cmd,
747 "show ipv6 ospf6 database "
748 "(router|network|inter-prefix|inter-router|as-external|"
749 "group-membership|type-7|link|intra-prefix) * A.B.C.D "
750 "(detail|dump|internal)",
754 "Display Link state database\n"
755 "Display Router LSAs\n"
756 "Display Network LSAs\n"
757 "Display Inter-Area-Prefix LSAs\n"
758 "Display Inter-Area-Router LSAs\n"
759 "Display As-External LSAs\n"
760 "Display Group-Membership LSAs\n"
761 "Display Type-7 LSAs\n"
762 "Display Link LSAs\n"
763 "Display Intra-Area-Prefix LSAs\n"
764 "Any Link state ID\n"
765 "Specify Advertising Router as IPv4 address notation\n"
766 "Display details of LSAs\n"
768 "Display LSA's internal information\n"
771 ALIAS (show_ipv6_ospf6_database_type_router,
772 show_ipv6_ospf6_database_type_adv_router_cmd,
773 "show ipv6 ospf6 database "
774 "(router|network|inter-prefix|inter-router|as-external|"
775 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D",
779 "Display Link state database\n"
780 "Display Router LSAs\n"
781 "Display Network LSAs\n"
782 "Display Inter-Area-Prefix LSAs\n"
783 "Display Inter-Area-Router LSAs\n"
784 "Display As-External LSAs\n"
785 "Display Group-Membership LSAs\n"
786 "Display Type-7 LSAs\n"
787 "Display Link LSAs\n"
788 "Display Intra-Area-Prefix LSAs\n"
789 "Search by Advertising Router\n"
790 "Specify Advertising Router as IPv4 address notation\n"
793 ALIAS (show_ipv6_ospf6_database_type_router,
794 show_ipv6_ospf6_database_type_adv_router_detail_cmd,
795 "show ipv6 ospf6 database "
796 "(router|network|inter-prefix|inter-router|as-external|"
797 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D "
798 "(detail|dump|internal)",
802 "Display Link state database\n"
803 "Display Router LSAs\n"
804 "Display Network LSAs\n"
805 "Display Inter-Area-Prefix LSAs\n"
806 "Display Inter-Area-Router LSAs\n"
807 "Display As-External LSAs\n"
808 "Display Group-Membership LSAs\n"
809 "Display Type-7 LSAs\n"
810 "Display Link LSAs\n"
811 "Display Intra-Area-Prefix LSAs\n"
812 "Search by Advertising Router\n"
813 "Specify Advertising Router as IPv4 address notation\n"
814 "Display details of LSAs\n"
816 "Display LSA's internal information\n"
819 DEFUN (show_ipv6_ospf6_database_id_router,
820 show_ipv6_ospf6_database_id_router_cmd,
821 "show ipv6 ospf6 database * A.B.C.D A.B.C.D",
825 "Display Link state database\n"
826 "Any Link state Type\n"
827 "Specify Link state ID as IPv4 address notation\n"
828 "Specify Advertising Router as IPv4 address notation\n"
832 struct listnode *i, *j;
833 struct ospf6 *o = ospf6;
834 struct ospf6_area *oa;
835 struct ospf6_interface *oi;
837 u_int32_t adv_router = 0;
839 OSPF6_CMD_CHECK_RUNNING ();
841 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
843 vty_out (vty, "Link state ID is not parsable: %s%s",
851 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
853 vty_out (vty, "Advertising Router is not parsable: %s%s",
860 level = parse_show_level (argc, argv);
862 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
864 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
865 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
868 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
870 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
872 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
873 oi->interface->name, oa->name, VNL, VNL);
874 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
878 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
879 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
881 vty_out (vty, "%s", VNL);
885 ALIAS (show_ipv6_ospf6_database_id_router,
886 show_ipv6_ospf6_database_id_router_detail_cmd,
887 "show ipv6 ospf6 database * A.B.C.D A.B.C.D "
888 "(detail|dump|internal)",
892 "Display Link state database\n"
893 "Any Link state Type\n"
894 "Specify Link state ID as IPv4 address notation\n"
895 "Specify Advertising Router as IPv4 address notation\n"
896 "Display details of LSAs\n"
898 "Display LSA's internal information\n"
901 DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
902 show_ipv6_ospf6_database_adv_router_linkstate_id_cmd,
903 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D",
907 "Display Link state database\n"
908 "Search by Advertising Router\n"
909 "Specify Advertising Router as IPv4 address notation\n"
910 "Search by Link state ID\n"
911 "Specify Link state ID as IPv4 address notation\n"
915 struct listnode *i, *j;
916 struct ospf6 *o = ospf6;
917 struct ospf6_area *oa;
918 struct ospf6_interface *oi;
920 u_int32_t adv_router = 0;
922 OSPF6_CMD_CHECK_RUNNING ();
924 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
926 vty_out (vty, "Advertising Router is not parsable: %s%s",
934 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
936 vty_out (vty, "Link state ID is not parsable: %s%s",
943 level = parse_show_level (argc, argv);
945 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
947 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
948 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
951 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
953 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
955 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
956 oi->interface->name, oa->name, VNL, VNL);
957 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
961 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
962 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
964 vty_out (vty, "%s", VNL);
968 ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id,
969 show_ipv6_ospf6_database_adv_router_linkstate_id_detail_cmd,
970 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D "
971 "(detail|dump|internal)",
975 "Display Link state database\n"
976 "Search by Advertising Router\n"
977 "Specify Advertising Router as IPv4 address notation\n"
978 "Search by Link state ID\n"
979 "Specify Link state ID as IPv4 address notation\n"
980 "Display details of LSAs\n"
982 "Display LSA's internal information\n"
985 DEFUN (show_ipv6_ospf6_database_type_id_router,
986 show_ipv6_ospf6_database_type_id_router_cmd,
987 "show ipv6 ospf6 database "
988 "(router|network|inter-prefix|inter-router|as-external|"
989 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D",
993 "Display Link state database\n"
994 "Display Router LSAs\n"
995 "Display Network LSAs\n"
996 "Display Inter-Area-Prefix LSAs\n"
997 "Display Inter-Area-Router LSAs\n"
998 "Display As-External LSAs\n"
999 "Display Group-Membership LSAs\n"
1000 "Display Type-7 LSAs\n"
1001 "Display Link LSAs\n"
1002 "Display Intra-Area-Prefix LSAs\n"
1003 "Specify Link state ID as IPv4 address notation\n"
1004 "Specify Advertising Router as IPv4 address notation\n"
1008 struct listnode *i, *j;
1009 struct ospf6 *o = ospf6;
1010 struct ospf6_area *oa;
1011 struct ospf6_interface *oi;
1014 u_int32_t adv_router = 0;
1016 OSPF6_CMD_CHECK_RUNNING ();
1018 type = parse_type_spec (argc, argv);
1022 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1024 vty_out (vty, "Link state ID is not parsable: %s%s",
1032 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1034 vty_out (vty, "Advertising Router is not parsable: %s%s",
1041 level = parse_show_level (argc, argv);
1043 switch (OSPF6_LSA_SCOPE (type))
1045 case OSPF6_SCOPE_AREA:
1046 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1048 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1049 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1053 case OSPF6_SCOPE_LINKLOCAL:
1054 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1056 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
1058 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1059 oi->interface->name, oa->name, VNL, VNL);
1060 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1065 case OSPF6_SCOPE_AS:
1066 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1067 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1075 vty_out (vty, "%s", VNL);
1079 ALIAS (show_ipv6_ospf6_database_type_id_router,
1080 show_ipv6_ospf6_database_type_id_router_detail_cmd,
1081 "show ipv6 ospf6 database "
1082 "(router|network|inter-prefix|inter-router|as-external|"
1083 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D "
1088 "Display Link state database\n"
1089 "Display Router LSAs\n"
1090 "Display Network LSAs\n"
1091 "Display Inter-Area-Prefix LSAs\n"
1092 "Display Inter-Area-Router LSAs\n"
1093 "Display As-External LSAs\n"
1094 "Display Group-Membership LSAs\n"
1095 "Display Type-7 LSAs\n"
1096 "Display Link LSAs\n"
1097 "Display Intra-Area-Prefix LSAs\n"
1098 "Specify Link state ID as IPv4 address notation\n"
1099 "Specify Advertising Router as IPv4 address notation\n"
1101 "Display LSA's internal information\n"
1104 DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1105 show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd,
1106 "show ipv6 ospf6 database "
1107 "(router|network|inter-prefix|inter-router|as-external|"
1108 "group-membership|type-7|link|intra-prefix) "
1109 "adv-router A.B.C.D linkstate-id A.B.C.D",
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 "Search by Advertising Router\n"
1124 "Specify Advertising Router as IPv4 address notation\n"
1125 "Search by Link state ID\n"
1126 "Specify Link state ID as IPv4 address notation\n"
1130 struct listnode *i, *j;
1131 struct ospf6 *o = ospf6;
1132 struct ospf6_area *oa;
1133 struct ospf6_interface *oi;
1136 u_int32_t adv_router = 0;
1138 OSPF6_CMD_CHECK_RUNNING ();
1140 type = parse_type_spec (argc, argv);
1144 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1146 vty_out (vty, "Advertising Router is not parsable: %s%s",
1154 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1156 vty_out (vty, "Link state ID is not parsable: %s%s",
1163 level = parse_show_level (argc, argv);
1165 switch (OSPF6_LSA_SCOPE (type))
1167 case OSPF6_SCOPE_AREA:
1168 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1170 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1171 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1175 case OSPF6_SCOPE_LINKLOCAL:
1176 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1178 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
1180 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1181 oi->interface->name, oa->name, VNL, VNL);
1182 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1187 case OSPF6_SCOPE_AS:
1188 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1189 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1197 vty_out (vty, "%s", VNL);
1201 ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1202 show_ipv6_ospf6_database_type_adv_router_linkstate_id_detail_cmd,
1203 "show ipv6 ospf6 database "
1204 "(router|network|inter-prefix|inter-router|as-external|"
1205 "group-membership|type-7|link|intra-prefix) "
1206 "adv-router A.B.C.D linkstate-id A.B.C.D "
1211 "Display Link state database\n"
1212 "Display Router LSAs\n"
1213 "Display Network LSAs\n"
1214 "Display Inter-Area-Prefix LSAs\n"
1215 "Display Inter-Area-Router LSAs\n"
1216 "Display As-External LSAs\n"
1217 "Display Group-Membership LSAs\n"
1218 "Display Type-7 LSAs\n"
1219 "Display Link LSAs\n"
1220 "Display Intra-Area-Prefix LSAs\n"
1221 "Search by Advertising Router\n"
1222 "Specify Advertising Router as IPv4 address notation\n"
1223 "Search by Link state ID\n"
1224 "Specify Link state ID as IPv4 address notation\n"
1226 "Display LSA's internal information\n"
1229 DEFUN (show_ipv6_ospf6_database_self_originated,
1230 show_ipv6_ospf6_database_self_originated_cmd,
1231 "show ipv6 ospf6 database self-originated",
1235 "Display Self-originated LSAs\n"
1239 struct listnode *i, *j;
1240 struct ospf6 *o = ospf6;
1241 struct ospf6_area *oa;
1242 struct ospf6_interface *oi;
1243 u_int32_t adv_router = 0;
1245 OSPF6_CMD_CHECK_RUNNING ();
1247 level = parse_show_level (argc, argv);
1249 adv_router = o->router_id;
1251 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1253 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1254 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
1257 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1259 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
1261 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1262 oi->interface->name, oa->name, VNL, VNL);
1263 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
1267 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1268 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
1270 vty_out (vty, "%s", VNL);
1274 ALIAS (show_ipv6_ospf6_database_self_originated,
1275 show_ipv6_ospf6_database_self_originated_detail_cmd,
1276 "show ipv6 ospf6 database self-originated "
1277 "(detail|dump|internal)",
1281 "Display Self-originated LSAs\n"
1282 "Display details of LSAs\n"
1284 "Display LSA's internal information\n"
1287 DEFUN (show_ipv6_ospf6_database_type_self_originated,
1288 show_ipv6_ospf6_database_type_self_originated_cmd,
1289 "show ipv6 ospf6 database "
1290 "(router|network|inter-prefix|inter-router|as-external|"
1291 "group-membership|type-7|link|intra-prefix) self-originated",
1295 "Display Link state database\n"
1296 "Display Router LSAs\n"
1297 "Display Network LSAs\n"
1298 "Display Inter-Area-Prefix LSAs\n"
1299 "Display Inter-Area-Router LSAs\n"
1300 "Display As-External LSAs\n"
1301 "Display Group-Membership LSAs\n"
1302 "Display Type-7 LSAs\n"
1303 "Display Link LSAs\n"
1304 "Display Intra-Area-Prefix LSAs\n"
1305 "Display Self-originated LSAs\n"
1309 struct listnode *i, *j;
1310 struct ospf6 *o = ospf6;
1311 struct ospf6_area *oa;
1312 struct ospf6_interface *oi;
1314 u_int32_t adv_router = 0;
1316 OSPF6_CMD_CHECK_RUNNING ();
1318 type = parse_type_spec (argc, argv);
1321 level = parse_show_level (argc, argv);
1323 adv_router = o->router_id;
1325 switch (OSPF6_LSA_SCOPE (type))
1327 case OSPF6_SCOPE_AREA:
1328 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1330 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1331 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
1335 case OSPF6_SCOPE_LINKLOCAL:
1336 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1338 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
1340 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1341 oi->interface->name, oa->name, VNL, VNL);
1342 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
1347 case OSPF6_SCOPE_AS:
1348 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1349 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
1357 vty_out (vty, "%s", VNL);
1361 ALIAS (show_ipv6_ospf6_database_type_self_originated,
1362 show_ipv6_ospf6_database_type_self_originated_detail_cmd,
1363 "show ipv6 ospf6 database "
1364 "(router|network|inter-prefix|inter-router|as-external|"
1365 "group-membership|type-7|link|intra-prefix) self-originated "
1366 "(detail|dump|internal)",
1370 "Display Link state database\n"
1371 "Display Router LSAs\n"
1372 "Display Network LSAs\n"
1373 "Display Inter-Area-Prefix LSAs\n"
1374 "Display Inter-Area-Router LSAs\n"
1375 "Display As-External LSAs\n"
1376 "Display Group-Membership LSAs\n"
1377 "Display Type-7 LSAs\n"
1378 "Display Link LSAs\n"
1379 "Display Intra-Area-Prefix LSAs\n"
1380 "Display Self-originated LSAs\n"
1381 "Display details of LSAs\n"
1383 "Display LSA's internal information\n"
1386 DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1387 show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd,
1388 "show ipv6 ospf6 database "
1389 "(router|network|inter-prefix|inter-router|as-external|"
1390 "group-membership|type-7|link|intra-prefix) self-originated "
1391 "linkstate-id A.B.C.D",
1395 "Display Link state database\n"
1396 "Display Router LSAs\n"
1397 "Display Network LSAs\n"
1398 "Display Inter-Area-Prefix LSAs\n"
1399 "Display Inter-Area-Router LSAs\n"
1400 "Display As-External LSAs\n"
1401 "Display Group-Membership LSAs\n"
1402 "Display Type-7 LSAs\n"
1403 "Display Link LSAs\n"
1404 "Display Intra-Area-Prefix LSAs\n"
1405 "Display Self-originated LSAs\n"
1406 "Search by Link state ID\n"
1407 "Specify Link state ID as IPv4 address notation\n"
1411 struct listnode *i, *j;
1412 struct ospf6 *o = ospf6;
1413 struct ospf6_area *oa;
1414 struct ospf6_interface *oi;
1416 u_int32_t adv_router = 0;
1419 OSPF6_CMD_CHECK_RUNNING ();
1421 type = parse_type_spec (argc, argv);
1425 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1427 vty_out (vty, "Link State ID is not parsable: %s%s",
1434 level = parse_show_level (argc, argv);
1436 adv_router = o->router_id;
1438 switch (OSPF6_LSA_SCOPE (type))
1440 case OSPF6_SCOPE_AREA:
1441 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1443 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1444 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1448 case OSPF6_SCOPE_LINKLOCAL:
1449 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1451 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
1453 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1454 oi->interface->name, oa->name, VNL, VNL);
1455 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1460 case OSPF6_SCOPE_AS:
1461 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1462 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1470 vty_out (vty, "%s", VNL);
1474 ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1475 show_ipv6_ospf6_database_type_self_originated_linkstate_id_detail_cmd,
1476 "show ipv6 ospf6 database "
1477 "(router|network|inter-prefix|inter-router|as-external|"
1478 "group-membership|type-7|link|intra-prefix) self-originated "
1479 "linkstate-id A.B.C.D (detail|dump|internal)",
1483 "Display Link state database\n"
1484 "Display Router LSAs\n"
1485 "Display Network LSAs\n"
1486 "Display Inter-Area-Prefix LSAs\n"
1487 "Display Inter-Area-Router LSAs\n"
1488 "Display As-External LSAs\n"
1489 "Display Group-Membership LSAs\n"
1490 "Display Type-7 LSAs\n"
1491 "Display Link LSAs\n"
1492 "Display Intra-Area-Prefix LSAs\n"
1493 "Display Self-originated LSAs\n"
1494 "Search by Link state ID\n"
1495 "Specify Link state ID as IPv4 address notation\n"
1496 "Display details of LSAs\n"
1498 "Display LSA's internal information\n"
1501 DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
1502 show_ipv6_ospf6_database_type_id_self_originated_cmd,
1503 "show ipv6 ospf6 database "
1504 "(router|network|inter-prefix|inter-router|as-external|"
1505 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated",
1509 "Display Link state database\n"
1510 "Display Router LSAs\n"
1511 "Display Network LSAs\n"
1512 "Display Inter-Area-Prefix LSAs\n"
1513 "Display Inter-Area-Router LSAs\n"
1514 "Display As-External LSAs\n"
1515 "Display Group-Membership LSAs\n"
1516 "Display Type-7 LSAs\n"
1517 "Display Link LSAs\n"
1518 "Display Intra-Area-Prefix LSAs\n"
1519 "Specify Link state ID as IPv4 address notation\n"
1520 "Display Self-originated LSAs\n"
1524 struct listnode *i, *j;
1525 struct ospf6 *o = ospf6;
1526 struct ospf6_area *oa;
1527 struct ospf6_interface *oi;
1529 u_int32_t adv_router = 0;
1532 OSPF6_CMD_CHECK_RUNNING ();
1534 type = parse_type_spec (argc, argv);
1538 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1540 vty_out (vty, "Link State ID is not parsable: %s%s",
1547 level = parse_show_level (argc, argv);
1549 adv_router = o->router_id;
1551 switch (OSPF6_LSA_SCOPE (type))
1553 case OSPF6_SCOPE_AREA:
1554 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1556 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1557 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1561 case OSPF6_SCOPE_LINKLOCAL:
1562 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1564 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
1566 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1567 oi->interface->name, oa->name, VNL, VNL);
1568 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1573 case OSPF6_SCOPE_AS:
1574 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1575 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1583 vty_out (vty, "%s", VNL);
1587 ALIAS (show_ipv6_ospf6_database_type_id_self_originated,
1588 show_ipv6_ospf6_database_type_id_self_originated_detail_cmd,
1589 "show ipv6 ospf6 database "
1590 "(router|network|inter-prefix|inter-router|as-external|"
1591 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated "
1592 "(detail|dump|internal)",
1596 "Display Link state database\n"
1597 "Display Router LSAs\n"
1598 "Display Network LSAs\n"
1599 "Display Inter-Area-Prefix LSAs\n"
1600 "Display Inter-Area-Router LSAs\n"
1601 "Display As-External LSAs\n"
1602 "Display Group-Membership LSAs\n"
1603 "Display Type-7 LSAs\n"
1604 "Display Link LSAs\n"
1605 "Display Intra-Area-Prefix LSAs\n"
1606 "Display Self-originated LSAs\n"
1607 "Search by Link state ID\n"
1608 "Specify Link state ID as IPv4 address notation\n"
1609 "Display details of LSAs\n"
1611 "Display LSA's internal information\n"
1615 DEFUN (show_ipv6_ospf6_border_routers,
1616 show_ipv6_ospf6_border_routers_cmd,
1617 "show ipv6 ospf6 border-routers",
1621 "Display routing table for ABR and ASBR\n"
1624 u_int32_t adv_router;
1625 void (*showfunc) (struct vty *, struct ospf6_route *);
1626 struct ospf6_route *ro;
1627 struct prefix prefix;
1629 OSPF6_CMD_CHECK_RUNNING ();
1631 if (argc && ! strcmp ("detail", argv[0]))
1633 showfunc = ospf6_route_show_detail;
1638 showfunc = ospf6_brouter_show;
1642 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1644 vty_out (vty, "Router ID is not parsable: %s%s", argv[0], VNL);
1648 ospf6_linkstate_prefix (adv_router, 0, &prefix);
1649 ro = ospf6_route_lookup (&prefix, ospf6->brouter_table);
1652 vty_out (vty, "No Route found for Router ID: %s%s", argv[0], VNL);
1656 ospf6_route_show_detail (vty, ro);
1660 if (showfunc == ospf6_brouter_show)
1661 ospf6_brouter_show_header (vty);
1663 for (ro = ospf6_route_head (ospf6->brouter_table); ro;
1664 ro = ospf6_route_next (ro))
1665 (*showfunc) (vty, ro);
1670 ALIAS (show_ipv6_ospf6_border_routers,
1671 show_ipv6_ospf6_border_routers_detail_cmd,
1672 "show ipv6 ospf6 border-routers (A.B.C.D|detail)",
1676 "Display routing table for ABR and ASBR\n"
1677 "Specify Router-ID\n"
1681 DEFUN (show_ipv6_ospf6_linkstate,
1682 show_ipv6_ospf6_linkstate_cmd,
1683 "show ipv6 ospf6 linkstate",
1687 "Display linkstate routing table\n"
1690 struct listnode *node;
1691 struct ospf6_area *oa;
1693 OSPF6_CMD_CHECK_RUNNING ();
1695 for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
1697 vty_out (vty, "%s SPF Result in Area %s%s%s",
1698 VNL, oa->name, VNL, VNL);
1699 ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table);
1702 vty_out (vty, "%s", VNL);
1706 ALIAS (show_ipv6_ospf6_linkstate,
1707 show_ipv6_ospf6_linkstate_router_cmd,
1708 "show ipv6 ospf6 linkstate router A.B.C.D",
1712 "Display linkstate routing table\n"
1713 "Display Router Entry\n"
1714 "Specify Router ID as IPv4 address notation\n"
1717 ALIAS (show_ipv6_ospf6_linkstate,
1718 show_ipv6_ospf6_linkstate_network_cmd,
1719 "show ipv6 ospf6 linkstate network A.B.C.D A.B.C.D",
1723 "Display linkstate routing table\n"
1724 "Display Network Entry\n"
1725 "Specify Router ID as IPv4 address notation\n"
1726 "Specify Link state ID as IPv4 address notation\n"
1729 DEFUN (show_ipv6_ospf6_linkstate_detail,
1730 show_ipv6_ospf6_linkstate_detail_cmd,
1731 "show ipv6 ospf6 linkstate detail",
1735 "Display linkstate routing table\n"
1738 const char *sargv[CMD_ARGC_MAX];
1740 struct listnode *node;
1741 struct ospf6_area *oa;
1743 OSPF6_CMD_CHECK_RUNNING ();
1745 /* copy argv to sargv and then append "detail" */
1746 for (i = 0; i < argc; i++)
1749 sargv[sargc++] = "detail";
1750 sargv[sargc] = NULL;
1752 for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
1754 vty_out (vty, "%s SPF Result in Area %s%s%s",
1755 VNL, oa->name, VNL, VNL);
1756 ospf6_linkstate_table_show (vty, sargc, sargv, oa->spf_table);
1759 vty_out (vty, "%s", VNL);
1763 /* Install ospf related commands. */
1769 ospf6_interface_init ();
1770 ospf6_neighbor_init ();
1771 ospf6_zebra_init (master);
1775 ospf6_intra_init ();
1780 ospf6_snmp_init (master);
1781 #endif /*HAVE_SNMP*/
1783 install_node (&debug_node, config_write_ospf6_debug);
1785 install_element_ospf6_debug_message ();
1786 install_element_ospf6_debug_lsa ();
1787 install_element_ospf6_debug_interface ();
1788 install_element_ospf6_debug_neighbor ();
1789 install_element_ospf6_debug_zebra ();
1790 install_element_ospf6_debug_spf ();
1791 install_element_ospf6_debug_route ();
1792 install_element_ospf6_debug_brouter ();
1793 install_element_ospf6_debug_asbr ();
1794 install_element_ospf6_debug_abr ();
1795 install_element_ospf6_debug_flood ();
1797 install_element_ospf6_clear_interface ();
1799 install_element (VIEW_NODE, &show_version_ospf6_cmd);
1801 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_cmd);
1802 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_detail_cmd);
1804 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_cmd);
1805 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_router_cmd);
1806 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_network_cmd);
1807 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_detail_cmd);
1809 #define INSTALL(n,c) \
1810 install_element (n ## _NODE, &show_ipv6_ospf6_ ## c)
1812 INSTALL (VIEW, database_cmd);
1813 INSTALL (VIEW, database_detail_cmd);
1814 INSTALL (VIEW, database_type_cmd);
1815 INSTALL (VIEW, database_type_detail_cmd);
1816 INSTALL (VIEW, database_id_cmd);
1817 INSTALL (VIEW, database_id_detail_cmd);
1818 INSTALL (VIEW, database_linkstate_id_cmd);
1819 INSTALL (VIEW, database_linkstate_id_detail_cmd);
1820 INSTALL (VIEW, database_router_cmd);
1821 INSTALL (VIEW, database_router_detail_cmd);
1822 INSTALL (VIEW, database_adv_router_cmd);
1823 INSTALL (VIEW, database_adv_router_detail_cmd);
1824 INSTALL (VIEW, database_type_id_cmd);
1825 INSTALL (VIEW, database_type_id_detail_cmd);
1826 INSTALL (VIEW, database_type_linkstate_id_cmd);
1827 INSTALL (VIEW, database_type_linkstate_id_detail_cmd);
1828 INSTALL (VIEW, database_type_router_cmd);
1829 INSTALL (VIEW, database_type_router_detail_cmd);
1830 INSTALL (VIEW, database_type_adv_router_cmd);
1831 INSTALL (VIEW, database_type_adv_router_detail_cmd);
1832 INSTALL (VIEW, database_adv_router_linkstate_id_cmd);
1833 INSTALL (VIEW, database_adv_router_linkstate_id_detail_cmd);
1834 INSTALL (VIEW, database_id_router_cmd);
1835 INSTALL (VIEW, database_id_router_detail_cmd);
1836 INSTALL (VIEW, database_type_id_router_cmd);
1837 INSTALL (VIEW, database_type_id_router_detail_cmd);
1838 INSTALL (VIEW, database_type_adv_router_linkstate_id_cmd);
1839 INSTALL (VIEW, database_type_adv_router_linkstate_id_detail_cmd);
1840 INSTALL (VIEW, database_self_originated_cmd);
1841 INSTALL (VIEW, database_self_originated_detail_cmd);
1842 INSTALL (VIEW, database_type_self_originated_cmd);
1843 INSTALL (VIEW, database_type_self_originated_detail_cmd);
1844 INSTALL (VIEW, database_type_id_self_originated_cmd);
1845 INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
1846 INSTALL (VIEW, database_type_self_originated_linkstate_id_cmd);
1847 INSTALL (VIEW, database_type_self_originated_linkstate_id_detail_cmd);
1849 /* Make ospf protocol socket. */
1851 thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
1859 if (ospf6->route_table)
1860 ospf6_route_remove_all (ospf6->route_table);
1861 if (ospf6->brouter_table)
1862 ospf6_route_remove_all (ospf6->brouter_table);