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"
47 char ospf6_daemon_version
[] = OSPF6_DAEMON_VERSION
;
55 route_prev (struct route_node
*node
)
57 struct route_node
*end
;
58 struct route_node
*prev
= NULL
;
63 route_lock_node (node
);
67 node
= route_next (node
);
70 route_unlock_node (node
);
74 route_unlock_node (end
);
76 route_lock_node (prev
);
82 /* show database functions */
83 DEFUN (show_version_ospf6
,
84 show_version_ospf6_cmd
,
87 "Displays ospf6d version\n"
90 vty_out (vty
, "Zebra OSPF6d Version: %s%s",
91 ospf6_daemon_version
, VNL
);
96 struct cmd_node debug_node
=
104 config_write_ospf6_debug (struct vty
*vty
)
106 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
);
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
, 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
, 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 (i
= listhead (o
->area_list
); i
; nextnode (i
))
188 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
);
193 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
195 oa
= (struct ospf6_area
*) getdata (i
);
196 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
198 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
);
205 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
206 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, NULL
, o
->lsdb
);
208 vty_out (vty
, "%s", VNL
);
212 ALIAS (show_ipv6_ospf6_database
,
213 show_ipv6_ospf6_database_detail_cmd
,
214 "show ipv6 ospf6 database (detail|dump|internal)",
218 "Display Link state database\n"
219 "Display details of LSAs\n"
221 "Display LSA's internal information\n"
224 DEFUN (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)",
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"
245 struct listnode
*i
, *j
;
246 struct ospf6
*o
= ospf6
;
247 struct ospf6_area
*oa
;
248 struct ospf6_interface
*oi
;
251 OSPF6_CMD_CHECK_RUNNING ();
253 type
= parse_type_spec (argc
, argv
);
256 level
= parse_show_level (argc
, argv
);
258 switch (OSPF6_LSA_SCOPE (type
))
260 case OSPF6_SCOPE_AREA
:
261 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
269 case OSPF6_SCOPE_LINKLOCAL
:
270 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
272 oa
= (struct ospf6_area
*) getdata (i
);
273 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
284 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
285 ospf6_lsdb_show (vty
, level
, &type
, NULL
, NULL
, o
->lsdb
);
293 vty_out (vty
, "%s", VNL
);
297 ALIAS (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)",
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"
318 "Display LSA's internal information\n"
321 DEFUN (show_ipv6_ospf6_database_id
,
322 show_ipv6_ospf6_database_id_cmd
,
323 "show ipv6 ospf6 database * A.B.C.D",
327 "Display Link state database\n"
328 "Any Link state Type\n"
329 "Specify Link state ID as IPv4 address notation\n"
333 struct listnode
*i
, *j
;
334 struct ospf6
*o
= ospf6
;
335 struct ospf6_area
*oa
;
336 struct ospf6_interface
*oi
;
339 OSPF6_CMD_CHECK_RUNNING ();
341 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
343 vty_out (vty
, "Link State ID is not parsable: %s%s",
350 level
= parse_show_level (argc
, argv
);
352 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
354 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
);
359 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
361 oa
= (struct ospf6_area
*) getdata (i
);
362 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
364 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
);
371 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
372 ospf6_lsdb_show (vty
, level
, NULL
, &id
, NULL
, o
->lsdb
);
374 vty_out (vty
, "%s", VNL
);
378 ALIAS (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)",
385 "Display Link state database\n"
386 "Any Link state Type\n"
387 "Specify Link state ID as IPv4 address notation\n"
388 "Display details of LSAs\n"
390 "Display LSA's internal information\n"
393 ALIAS (show_ipv6_ospf6_database_id
,
394 show_ipv6_ospf6_database_linkstate_id_cmd
,
395 "show ipv6 ospf6 database linkstate-id A.B.C.D",
399 "Display Link state database\n"
400 "Search by Link state ID\n"
401 "Specify Link state ID as IPv4 address notation\n"
404 ALIAS (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)",
411 "Display Link state database\n"
412 "Search by Link state ID\n"
413 "Specify Link state ID as IPv4 address notation\n"
414 "Display details of LSAs\n"
416 "Display LSA's internal information\n"
419 DEFUN (show_ipv6_ospf6_database_router
,
420 show_ipv6_ospf6_database_router_cmd
,
421 "show ipv6 ospf6 database * * A.B.C.D",
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"
432 struct listnode
*i
, *j
;
433 struct ospf6
*o
= ospf6
;
434 struct ospf6_area
*oa
;
435 struct ospf6_interface
*oi
;
436 u_int32_t adv_router
= 0;
438 OSPF6_CMD_CHECK_RUNNING ();
440 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
442 vty_out (vty
, "Advertising Router is not parsable: %s%s",
449 level
= parse_show_level (argc
, argv
);
451 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
453 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
);
458 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
460 oa
= (struct ospf6_area
*) getdata (i
);
461 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
463 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
);
470 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
471 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, &adv_router
, o
->lsdb
);
473 vty_out (vty
, "%s", VNL
);
477 ALIAS (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)",
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"
490 "Display LSA's internal information\n"
493 ALIAS (show_ipv6_ospf6_database_router
,
494 show_ipv6_ospf6_database_adv_router_cmd
,
495 "show ipv6 ospf6 database adv-router A.B.C.D",
499 "Display Link state database\n"
500 "Search by Advertising Router\n"
501 "Specify Advertising Router as IPv4 address notation\n"
504 ALIAS (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)",
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"
516 "Display LSA's internal information\n"
519 DEFUN (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",
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"
541 struct listnode
*i
, *j
;
542 struct ospf6
*o
= ospf6
;
543 struct ospf6_area
*oa
;
544 struct ospf6_interface
*oi
;
548 OSPF6_CMD_CHECK_RUNNING ();
550 type
= parse_type_spec (argc
, argv
);
554 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
556 vty_out (vty
, "Link state ID is not parsable: %s%s",
563 level
= parse_show_level (argc
, argv
);
565 switch (OSPF6_LSA_SCOPE (type
))
567 case OSPF6_SCOPE_AREA
:
568 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
576 case OSPF6_SCOPE_LINKLOCAL
:
577 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
579 oa
= (struct ospf6_area
*) getdata (i
);
580 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
591 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
592 ospf6_lsdb_show (vty
, level
, &type
, &id
, NULL
, o
->lsdb
);
600 vty_out (vty
, "%s", VNL
);
604 ALIAS (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)",
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"
626 "Display LSA's internal information\n"
629 ALIAS (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",
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"
651 ALIAS (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)",
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"
674 "Display LSA's internal information\n"
677 DEFUN (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",
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"
700 struct listnode
*i
, *j
;
701 struct ospf6
*o
= ospf6
;
702 struct ospf6_area
*oa
;
703 struct ospf6_interface
*oi
;
705 u_int32_t adv_router
= 0;
707 OSPF6_CMD_CHECK_RUNNING ();
709 type
= parse_type_spec (argc
, argv
);
713 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
715 vty_out (vty
, "Advertising Router is not parsable: %s%s",
722 level
= parse_show_level (argc
, argv
);
724 switch (OSPF6_LSA_SCOPE (type
))
726 case OSPF6_SCOPE_AREA
:
727 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
735 case OSPF6_SCOPE_LINKLOCAL
:
736 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
738 oa
= (struct ospf6_area
*) getdata (i
);
739 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
750 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
751 ospf6_lsdb_show (vty
, level
, &type
, NULL
, &adv_router
, o
->lsdb
);
759 vty_out (vty
, "%s", VNL
);
763 ALIAS (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)",
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"
786 "Display LSA's internal information\n"
789 ALIAS (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",
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"
811 ALIAS (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)",
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"
834 "Display LSA's internal information\n"
837 DEFUN (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",
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"
850 struct listnode
*i
, *j
;
851 struct ospf6
*o
= ospf6
;
852 struct ospf6_area
*oa
;
853 struct ospf6_interface
*oi
;
855 u_int32_t adv_router
= 0;
857 OSPF6_CMD_CHECK_RUNNING ();
859 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
861 vty_out (vty
, "Link state ID is not parsable: %s%s",
869 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
871 vty_out (vty
, "Advertising Router is not parsable: %s%s",
878 level
= parse_show_level (argc
, argv
);
880 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
882 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
);
887 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
889 oa
= (struct ospf6_area
*) getdata (i
);
890 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
892 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
);
899 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
900 ospf6_lsdb_show (vty
, level
, NULL
, &id
, &adv_router
, o
->lsdb
);
902 vty_out (vty
, "%s", VNL
);
906 ALIAS (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)",
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"
919 "Display LSA's internal information\n"
922 DEFUN (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",
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"
936 struct listnode
*i
, *j
;
937 struct ospf6
*o
= ospf6
;
938 struct ospf6_area
*oa
;
939 struct ospf6_interface
*oi
;
941 u_int32_t adv_router
= 0;
943 OSPF6_CMD_CHECK_RUNNING ();
945 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
947 vty_out (vty
, "Advertising Router is not parsable: %s%s",
955 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
957 vty_out (vty
, "Link state ID is not parsable: %s%s",
964 level
= parse_show_level (argc
, argv
);
966 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
973 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
975 oa
= (struct ospf6_area
*) getdata (i
);
976 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
985 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
986 ospf6_lsdb_show (vty
, level
, NULL
, &id
, &adv_router
, o
->lsdb
);
988 vty_out (vty
, "%s", VNL
);
992 ALIAS (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)",
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"
1006 "Display LSA's internal information\n"
1009 DEFUN (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",
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"
1032 struct listnode
*i
, *j
;
1033 struct ospf6
*o
= ospf6
;
1034 struct ospf6_area
*oa
;
1035 struct ospf6_interface
*oi
;
1038 u_int32_t adv_router
= 0;
1040 OSPF6_CMD_CHECK_RUNNING ();
1042 type
= parse_type_spec (argc
, argv
);
1046 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
1048 vty_out (vty
, "Link state ID is not parsable: %s%s",
1056 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
1058 vty_out (vty
, "Advertising Router is not parsable: %s%s",
1065 level
= parse_show_level (argc
, argv
);
1067 switch (OSPF6_LSA_SCOPE (type
))
1069 case OSPF6_SCOPE_AREA
:
1070 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
1078 case OSPF6_SCOPE_LINKLOCAL
:
1079 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1081 oa
= (struct ospf6_area
*) getdata (i
);
1082 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
1092 case OSPF6_SCOPE_AS
:
1093 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1094 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, o
->lsdb
);
1102 vty_out (vty
, "%s", VNL
);
1106 ALIAS (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 "
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"
1128 "Display LSA's internal information\n"
1131 DEFUN (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",
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"
1157 struct listnode
*i
, *j
;
1158 struct ospf6
*o
= ospf6
;
1159 struct ospf6_area
*oa
;
1160 struct ospf6_interface
*oi
;
1163 u_int32_t adv_router
= 0;
1165 OSPF6_CMD_CHECK_RUNNING ();
1167 type
= parse_type_spec (argc
, argv
);
1171 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
1173 vty_out (vty
, "Advertising Router is not parsable: %s%s",
1181 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
1183 vty_out (vty
, "Link state ID is not parsable: %s%s",
1190 level
= parse_show_level (argc
, argv
);
1192 switch (OSPF6_LSA_SCOPE (type
))
1194 case OSPF6_SCOPE_AREA
:
1195 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
1203 case OSPF6_SCOPE_LINKLOCAL
:
1204 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1206 oa
= (struct ospf6_area
*) getdata (i
);
1207 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
1217 case OSPF6_SCOPE_AS
:
1218 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1219 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, o
->lsdb
);
1227 vty_out (vty
, "%s", VNL
);
1231 ALIAS (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 "
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"
1256 "Display LSA's internal information\n"
1259 DEFUN (show_ipv6_ospf6_database_self_originated
,
1260 show_ipv6_ospf6_database_self_originated_cmd
,
1261 "show ipv6 ospf6 database self-originated",
1265 "Display Self-originated LSAs\n"
1269 struct listnode
*i
, *j
;
1270 struct ospf6
*o
= ospf6
;
1271 struct ospf6_area
*oa
;
1272 struct ospf6_interface
*oi
;
1273 u_int32_t adv_router
= 0;
1275 OSPF6_CMD_CHECK_RUNNING ();
1277 level
= parse_show_level (argc
, argv
);
1279 adv_router
= o
->router_id
;
1281 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1283 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
);
1288 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1290 oa
= (struct ospf6_area
*) getdata (i
);
1291 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
1293 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
);
1300 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1301 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, &adv_router
, o
->lsdb
);
1303 vty_out (vty
, "%s", VNL
);
1307 ALIAS (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)",
1314 "Display Self-originated LSAs\n"
1315 "Display details of LSAs\n"
1317 "Display LSA's internal information\n"
1320 DEFUN (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",
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"
1342 struct listnode
*i
, *j
;
1343 struct ospf6
*o
= ospf6
;
1344 struct ospf6_area
*oa
;
1345 struct ospf6_interface
*oi
;
1347 u_int32_t adv_router
= 0;
1349 OSPF6_CMD_CHECK_RUNNING ();
1351 type
= parse_type_spec (argc
, argv
);
1354 level
= parse_show_level (argc
, argv
);
1356 adv_router
= o
->router_id
;
1358 switch (OSPF6_LSA_SCOPE (type
))
1360 case OSPF6_SCOPE_AREA
:
1361 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
1369 case OSPF6_SCOPE_LINKLOCAL
:
1370 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1372 oa
= (struct ospf6_area
*) getdata (i
);
1373 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
1383 case OSPF6_SCOPE_AS
:
1384 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1385 ospf6_lsdb_show (vty
, level
, &type
, NULL
, &adv_router
, o
->lsdb
);
1393 vty_out (vty
, "%s", VNL
);
1397 ALIAS (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)",
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"
1419 "Display LSA's internal information\n"
1422 DEFUN (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",
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"
1447 struct listnode
*i
, *j
;
1448 struct ospf6
*o
= ospf6
;
1449 struct ospf6_area
*oa
;
1450 struct ospf6_interface
*oi
;
1452 u_int32_t adv_router
= 0;
1455 OSPF6_CMD_CHECK_RUNNING ();
1457 type
= parse_type_spec (argc
, argv
);
1461 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
1463 vty_out (vty
, "Link State ID is not parsable: %s%s",
1470 level
= parse_show_level (argc
, argv
);
1472 adv_router
= o
->router_id
;
1474 switch (OSPF6_LSA_SCOPE (type
))
1476 case OSPF6_SCOPE_AREA
:
1477 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
1485 case OSPF6_SCOPE_LINKLOCAL
:
1486 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1488 oa
= (struct ospf6_area
*) getdata (i
);
1489 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
1499 case OSPF6_SCOPE_AS
:
1500 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1501 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, o
->lsdb
);
1509 vty_out (vty
, "%s", VNL
);
1513 ALIAS (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)",
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"
1537 "Display LSA's internal information\n"
1540 DEFUN (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",
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"
1563 struct listnode
*i
, *j
;
1564 struct ospf6
*o
= ospf6
;
1565 struct ospf6_area
*oa
;
1566 struct ospf6_interface
*oi
;
1568 u_int32_t adv_router
= 0;
1571 OSPF6_CMD_CHECK_RUNNING ();
1573 type
= parse_type_spec (argc
, argv
);
1577 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
1579 vty_out (vty
, "Link State ID is not parsable: %s%s",
1586 level
= parse_show_level (argc
, argv
);
1588 adv_router
= o
->router_id
;
1590 switch (OSPF6_LSA_SCOPE (type
))
1592 case OSPF6_SCOPE_AREA
:
1593 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
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
);
1601 case OSPF6_SCOPE_LINKLOCAL
:
1602 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1604 oa
= (struct ospf6_area
*) getdata (i
);
1605 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
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
);
1615 case OSPF6_SCOPE_AS
:
1616 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1617 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, o
->lsdb
);
1625 vty_out (vty
, "%s", VNL
);
1629 ALIAS (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 "
1634 "(detail|dump|internal)",
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"
1648 "Display Self-originated LSAs\n"
1649 "Search by Link state ID\n"
1650 "Specify Link state ID as IPv4 address notation\n"
1651 "Display details of LSAs\n"
1653 "Display LSA's internal information\n"
1657 DEFUN (show_ipv6_ospf6_border_routers
,
1658 show_ipv6_ospf6_border_routers_cmd
,
1659 "show ipv6 ospf6 border-routers",
1663 "Display routing table for ABR and ASBR\n"
1666 u_int32_t adv_router
;
1667 void (*showfunc
) (struct vty
*, struct ospf6_route
*);
1668 struct ospf6_route
*ro
;
1669 struct prefix prefix
;
1671 OSPF6_CMD_CHECK_RUNNING ();
1673 if (argc
&& ! strcmp ("detail", argv
[0]))
1675 showfunc
= ospf6_route_show_detail
;
1680 showfunc
= ospf6_brouter_show
;
1684 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
1686 vty_out (vty
, "Router ID is not parsable: %s%s", argv
[0], VNL
);
1690 ospf6_linkstate_prefix (adv_router
, 0, &prefix
);
1691 ro
= ospf6_route_lookup (&prefix
, ospf6
->brouter_table
);
1692 ospf6_route_show_detail (vty
, ro
);
1696 if (showfunc
== ospf6_brouter_show
)
1697 ospf6_brouter_show_header (vty
);
1699 for (ro
= ospf6_route_head (ospf6
->brouter_table
); ro
;
1700 ro
= ospf6_route_next (ro
))
1701 (*showfunc
) (vty
, ro
);
1706 ALIAS (show_ipv6_ospf6_border_routers
,
1707 show_ipv6_ospf6_border_routers_detail_cmd
,
1708 "show ipv6 ospf6 border-routers (A.B.C.D|detail)",
1712 "Display routing table for ABR and ASBR\n"
1713 "Specify Router-ID\n"
1717 DEFUN (show_ipv6_ospf6_linkstate
,
1718 show_ipv6_ospf6_linkstate_cmd
,
1719 "show ipv6 ospf6 linkstate",
1723 "Display linkstate routing table\n"
1726 struct listnode
*node
;
1727 struct ospf6_area
*oa
;
1729 for (node
= listhead (ospf6
->area_list
); node
; nextnode (node
))
1731 oa
= OSPF6_AREA (getdata (node
));
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
);
1738 vty_out (vty
, "%s", VNL
);
1742 ALIAS (show_ipv6_ospf6_linkstate
,
1743 show_ipv6_ospf6_linkstate_router_cmd
,
1744 "show ipv6 ospf6 linkstate router A.B.C.D",
1748 "Display linkstate routing table\n"
1749 "Display Router Entry\n"
1750 "Specify Router ID as IPv4 address notation\n"
1753 ALIAS (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",
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"
1765 DEFUN (show_ipv6_ospf6_linkstate_detail
,
1766 show_ipv6_ospf6_linkstate_detail_cmd
,
1767 "show ipv6 ospf6 linkstate detail",
1771 "Display linkstate routing table\n"
1774 char *sargv
[CMD_ARGC_MAX
];
1776 struct listnode
*node
;
1777 struct ospf6_area
*oa
;
1779 /* copy argv to sargv and then append "detail" */
1780 for (i
= 0; i
< argc
; i
++)
1783 sargv
[sargc
++] = "detail";
1784 sargv
[sargc
] = NULL
;
1786 for (node
= listhead (ospf6
->area_list
); node
; nextnode (node
))
1788 oa
= OSPF6_AREA (getdata (node
));
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
);
1795 vty_out (vty
, "%s", VNL
);
1799 /* Install ospf related commands. */
1805 ospf6_interface_init ();
1806 ospf6_neighbor_init ();
1807 ospf6_zebra_init ();
1811 ospf6_intra_init ();
1815 install_node (&debug_node
, config_write_ospf6_debug
);
1817 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 ();
1825 install_element_ospf6_debug_abr ();
1826 install_element_ospf6_debug_flood ();
1828 install_element (VIEW_NODE
, &show_version_ospf6_cmd
);
1829 install_element (ENABLE_NODE
, &show_version_ospf6_cmd
);
1831 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
);
1836 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
);
1845 #define INSTALL(n,c) \
1846 install_element (n ## _NODE, &show_ipv6_ospf6_ ## c);
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
);
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
);
1926 /* Make ospf protocol socket. */
1928 thread_add_read (master
, ospf6_receive
, NULL
, ospf6_sock
);