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
;
59 route_prev (struct route_node
*node
)
61 struct route_node
*end
;
62 struct route_node
*prev
= NULL
;
67 route_lock_node (node
);
71 node
= route_next (node
);
74 route_unlock_node (node
);
78 route_unlock_node (end
);
80 route_lock_node (prev
);
86 /* show database functions */
87 DEFUN (show_version_ospf6
,
88 show_version_ospf6_cmd
,
91 "Displays ospf6d version\n"
94 vty_out (vty
, "Zebra OSPF6d Version: %s%s",
95 ospf6_daemon_version
, VNL
);
100 struct cmd_node debug_node
=
108 config_write_ospf6_debug (struct vty
*vty
)
110 config_write_ospf6_debug_message (vty
);
111 config_write_ospf6_debug_lsa (vty
);
112 config_write_ospf6_debug_zebra (vty
);
113 config_write_ospf6_debug_interface (vty
);
114 config_write_ospf6_debug_neighbor (vty
);
115 config_write_ospf6_debug_spf (vty
);
116 config_write_ospf6_debug_route (vty
);
117 config_write_ospf6_debug_asbr (vty
);
118 config_write_ospf6_debug_abr (vty
);
119 config_write_ospf6_debug_flood (vty
);
120 vty_out (vty
, "!%s", VNL
);
124 #define AREA_LSDB_TITLE_FORMAT \
125 "%s Area Scoped Link State Database (Area %s)%s%s"
126 #define IF_LSDB_TITLE_FORMAT \
127 "%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s"
128 #define AS_LSDB_TITLE_FORMAT \
129 "%s AS Scoped Link State Database%s%s"
132 parse_show_level (int argc
, char **argv
)
137 if (! strncmp (argv
[0], "de", 2))
138 level
= OSPF6_LSDB_SHOW_LEVEL_DETAIL
;
139 else if (! strncmp (argv
[0], "du", 2))
140 level
= OSPF6_LSDB_SHOW_LEVEL_DUMP
;
141 else if (! strncmp (argv
[0], "in", 2))
142 level
= OSPF6_LSDB_SHOW_LEVEL_INTERNAL
;
145 level
= OSPF6_LSDB_SHOW_LEVEL_NORMAL
;
150 parse_type_spec (int argc
, char **argv
)
154 if (! strcmp (argv
[0], "router"))
155 type
= htons (OSPF6_LSTYPE_ROUTER
);
156 else if (! strcmp (argv
[0], "network"))
157 type
= htons (OSPF6_LSTYPE_NETWORK
);
158 else if (! strcmp (argv
[0], "as-external"))
159 type
= htons (OSPF6_LSTYPE_AS_EXTERNAL
);
160 else if (! strcmp (argv
[0], "intra-prefix"))
161 type
= htons (OSPF6_LSTYPE_INTRA_PREFIX
);
162 else if (! strcmp (argv
[0], "inter-router"))
163 type
= htons (OSPF6_LSTYPE_INTER_ROUTER
);
164 else if (! strcmp (argv
[0], "inter-prefix"))
165 type
= htons (OSPF6_LSTYPE_INTER_PREFIX
);
166 else if (! strcmp (argv
[0], "link"))
167 type
= htons (OSPF6_LSTYPE_LINK
);
171 DEFUN (show_ipv6_ospf6_database
,
172 show_ipv6_ospf6_database_cmd
,
173 "show ipv6 ospf6 database",
177 "Display Link state database\n"
182 struct ospf6
*o
= ospf6
;
183 struct ospf6_area
*oa
;
184 struct ospf6_interface
*oi
;
186 OSPF6_CMD_CHECK_RUNNING ();
188 level
= parse_show_level (argc
, argv
);
190 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
192 oa
= (struct ospf6_area
*) getdata (i
);
193 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
194 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, NULL
, oa
->lsdb
);
197 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
199 oa
= (struct ospf6_area
*) getdata (i
);
200 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
202 oi
= (struct ospf6_interface
*) getdata (j
);
203 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
204 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
205 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, NULL
, oi
->lsdb
);
209 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
210 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, NULL
, o
->lsdb
);
212 vty_out (vty
, "%s", VNL
);
216 ALIAS (show_ipv6_ospf6_database
,
217 show_ipv6_ospf6_database_detail_cmd
,
218 "show ipv6 ospf6 database (detail|dump|internal)",
222 "Display Link state database\n"
223 "Display details of LSAs\n"
225 "Display LSA's internal information\n"
228 DEFUN (show_ipv6_ospf6_database_type
,
229 show_ipv6_ospf6_database_type_cmd
,
230 "show ipv6 ospf6 database "
231 "(router|network|inter-prefix|inter-router|as-external|"
232 "group-membership|type-7|link|intra-prefix)",
236 "Display Link state database\n"
237 "Display Router LSAs\n"
238 "Display Network LSAs\n"
239 "Display Inter-Area-Prefix LSAs\n"
240 "Display Inter-Area-Router LSAs\n"
241 "Display As-External LSAs\n"
242 "Display Group-Membership LSAs\n"
243 "Display Type-7 LSAs\n"
244 "Display Link LSAs\n"
245 "Display Intra-Area-Prefix LSAs\n"
250 struct ospf6
*o
= ospf6
;
251 struct ospf6_area
*oa
;
252 struct ospf6_interface
*oi
;
255 OSPF6_CMD_CHECK_RUNNING ();
257 type
= parse_type_spec (argc
, argv
);
260 level
= parse_show_level (argc
, argv
);
262 switch (OSPF6_LSA_SCOPE (type
))
264 case OSPF6_SCOPE_AREA
:
265 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
267 oa
= (struct ospf6_area
*) getdata (i
);
268 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
269 ospf6_lsdb_show (vty
, level
, &type
, NULL
, NULL
, oa
->lsdb
);
273 case OSPF6_SCOPE_LINKLOCAL
:
274 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
276 oa
= (struct ospf6_area
*) getdata (i
);
277 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
279 oi
= (struct ospf6_interface
*) getdata (j
);
280 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
281 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
282 ospf6_lsdb_show (vty
, level
, &type
, NULL
, NULL
, oi
->lsdb
);
288 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
289 ospf6_lsdb_show (vty
, level
, &type
, NULL
, NULL
, o
->lsdb
);
297 vty_out (vty
, "%s", VNL
);
301 ALIAS (show_ipv6_ospf6_database_type
,
302 show_ipv6_ospf6_database_type_detail_cmd
,
303 "show ipv6 ospf6 database "
304 "(router|network|inter-prefix|inter-router|as-external|"
305 "group-membership|type-7|link|intra-prefix) "
306 "(detail|dump|internal)",
310 "Display Link state database\n"
311 "Display Router LSAs\n"
312 "Display Network LSAs\n"
313 "Display Inter-Area-Prefix LSAs\n"
314 "Display Inter-Area-Router LSAs\n"
315 "Display As-External LSAs\n"
316 "Display Group-Membership LSAs\n"
317 "Display Type-7 LSAs\n"
318 "Display Link LSAs\n"
319 "Display Intra-Area-Prefix LSAs\n"
320 "Display details of LSAs\n"
322 "Display LSA's internal information\n"
325 DEFUN (show_ipv6_ospf6_database_id
,
326 show_ipv6_ospf6_database_id_cmd
,
327 "show ipv6 ospf6 database * A.B.C.D",
331 "Display Link state database\n"
332 "Any Link state Type\n"
333 "Specify Link state ID as IPv4 address notation\n"
338 struct ospf6
*o
= ospf6
;
339 struct ospf6_area
*oa
;
340 struct ospf6_interface
*oi
;
343 OSPF6_CMD_CHECK_RUNNING ();
345 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
347 vty_out (vty
, "Link State ID is not parsable: %s%s",
354 level
= parse_show_level (argc
, argv
);
356 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
358 oa
= (struct ospf6_area
*) getdata (i
);
359 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
360 ospf6_lsdb_show (vty
, level
, NULL
, &id
, NULL
, oa
->lsdb
);
363 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
365 oa
= (struct ospf6_area
*) getdata (i
);
366 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
368 oi
= (struct ospf6_interface
*) getdata (j
);
369 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
370 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
371 ospf6_lsdb_show (vty
, level
, NULL
, &id
, NULL
, oi
->lsdb
);
375 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
376 ospf6_lsdb_show (vty
, level
, NULL
, &id
, NULL
, o
->lsdb
);
378 vty_out (vty
, "%s", VNL
);
382 ALIAS (show_ipv6_ospf6_database_id
,
383 show_ipv6_ospf6_database_id_detail_cmd
,
384 "show ipv6 ospf6 database * A.B.C.D "
385 "(detail|dump|internal)",
389 "Display Link state database\n"
390 "Any Link state Type\n"
391 "Specify Link state ID as IPv4 address notation\n"
392 "Display details of LSAs\n"
394 "Display LSA's internal information\n"
397 ALIAS (show_ipv6_ospf6_database_id
,
398 show_ipv6_ospf6_database_linkstate_id_cmd
,
399 "show ipv6 ospf6 database linkstate-id A.B.C.D",
403 "Display Link state database\n"
404 "Search by Link state ID\n"
405 "Specify Link state ID as IPv4 address notation\n"
408 ALIAS (show_ipv6_ospf6_database_id
,
409 show_ipv6_ospf6_database_linkstate_id_detail_cmd
,
410 "show ipv6 ospf6 database linkstate-id A.B.C.D "
411 "(detail|dump|internal)",
415 "Display Link state database\n"
416 "Search by Link state ID\n"
417 "Specify Link state ID as IPv4 address notation\n"
418 "Display details of LSAs\n"
420 "Display LSA's internal information\n"
423 DEFUN (show_ipv6_ospf6_database_router
,
424 show_ipv6_ospf6_database_router_cmd
,
425 "show ipv6 ospf6 database * * A.B.C.D",
429 "Display Link state database\n"
430 "Any Link state Type\n"
431 "Any Link state ID\n"
432 "Specify Advertising Router as IPv4 address notation\n"
437 struct ospf6
*o
= ospf6
;
438 struct ospf6_area
*oa
;
439 struct ospf6_interface
*oi
;
440 u_int32_t adv_router
= 0;
442 OSPF6_CMD_CHECK_RUNNING ();
444 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
446 vty_out (vty
, "Advertising Router is not parsable: %s%s",
453 level
= parse_show_level (argc
, argv
);
455 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
457 oa
= (struct ospf6_area
*) getdata (i
);
458 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
459 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, &adv_router
, oa
->lsdb
);
462 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
464 oa
= (struct ospf6_area
*) getdata (i
);
465 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
467 oi
= (struct ospf6_interface
*) getdata (j
);
468 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
469 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
470 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, &adv_router
, oi
->lsdb
);
474 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
475 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, &adv_router
, o
->lsdb
);
477 vty_out (vty
, "%s", VNL
);
481 ALIAS (show_ipv6_ospf6_database_router
,
482 show_ipv6_ospf6_database_router_detail_cmd
,
483 "show ipv6 ospf6 database * * A.B.C.D "
484 "(detail|dump|internal)",
488 "Display Link state database\n"
489 "Any Link state Type\n"
490 "Any Link state ID\n"
491 "Specify Advertising Router as IPv4 address notation\n"
492 "Display details of LSAs\n"
494 "Display LSA's internal information\n"
497 ALIAS (show_ipv6_ospf6_database_router
,
498 show_ipv6_ospf6_database_adv_router_cmd
,
499 "show ipv6 ospf6 database adv-router A.B.C.D",
503 "Display Link state database\n"
504 "Search by Advertising Router\n"
505 "Specify Advertising Router as IPv4 address notation\n"
508 ALIAS (show_ipv6_ospf6_database_router
,
509 show_ipv6_ospf6_database_adv_router_detail_cmd
,
510 "show ipv6 ospf6 database adv-router A.B.C.D "
511 "(detail|dump|internal)",
515 "Display Link state database\n"
516 "Search by Advertising Router\n"
517 "Specify Advertising Router as IPv4 address notation\n"
518 "Display details of LSAs\n"
520 "Display LSA's internal information\n"
523 DEFUN (show_ipv6_ospf6_database_type_id
,
524 show_ipv6_ospf6_database_type_id_cmd
,
525 "show ipv6 ospf6 database "
526 "(router|network|inter-prefix|inter-router|as-external|"
527 "group-membership|type-7|link|intra-prefix) A.B.C.D",
531 "Display Link state database\n"
532 "Display Router LSAs\n"
533 "Display Network LSAs\n"
534 "Display Inter-Area-Prefix LSAs\n"
535 "Display Inter-Area-Router LSAs\n"
536 "Display As-External LSAs\n"
537 "Display Group-Membership LSAs\n"
538 "Display Type-7 LSAs\n"
539 "Display Link LSAs\n"
540 "Display Intra-Area-Prefix LSAs\n"
541 "Specify Link state ID as IPv4 address notation\n"
546 struct ospf6
*o
= ospf6
;
547 struct ospf6_area
*oa
;
548 struct ospf6_interface
*oi
;
552 OSPF6_CMD_CHECK_RUNNING ();
554 type
= parse_type_spec (argc
, argv
);
558 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
560 vty_out (vty
, "Link state ID is not parsable: %s%s",
567 level
= parse_show_level (argc
, argv
);
569 switch (OSPF6_LSA_SCOPE (type
))
571 case OSPF6_SCOPE_AREA
:
572 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
574 oa
= (struct ospf6_area
*) getdata (i
);
575 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
576 ospf6_lsdb_show (vty
, level
, &type
, &id
, NULL
, oa
->lsdb
);
580 case OSPF6_SCOPE_LINKLOCAL
:
581 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
583 oa
= (struct ospf6_area
*) getdata (i
);
584 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
586 oi
= (struct ospf6_interface
*) getdata (j
);
587 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
588 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
589 ospf6_lsdb_show (vty
, level
, &type
, &id
, NULL
, oi
->lsdb
);
595 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
596 ospf6_lsdb_show (vty
, level
, &type
, &id
, NULL
, o
->lsdb
);
604 vty_out (vty
, "%s", VNL
);
608 ALIAS (show_ipv6_ospf6_database_type_id
,
609 show_ipv6_ospf6_database_type_id_detail_cmd
,
610 "show ipv6 ospf6 database "
611 "(router|network|inter-prefix|inter-router|as-external|"
612 "group-membership|type-7|link|intra-prefix) A.B.C.D "
613 "(detail|dump|internal)",
617 "Display Link state database\n"
618 "Display Router LSAs\n"
619 "Display Network LSAs\n"
620 "Display Inter-Area-Prefix LSAs\n"
621 "Display Inter-Area-Router LSAs\n"
622 "Display As-External LSAs\n"
623 "Display Group-Membership LSAs\n"
624 "Display Type-7 LSAs\n"
625 "Display Link LSAs\n"
626 "Display Intra-Area-Prefix LSAs\n"
627 "Specify Link state ID as IPv4 address notation\n"
628 "Display details of LSAs\n"
630 "Display LSA's internal information\n"
633 ALIAS (show_ipv6_ospf6_database_type_id
,
634 show_ipv6_ospf6_database_type_linkstate_id_cmd
,
635 "show ipv6 ospf6 database "
636 "(router|network|inter-prefix|inter-router|as-external|"
637 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D",
641 "Display Link state database\n"
642 "Display Router LSAs\n"
643 "Display Network LSAs\n"
644 "Display Inter-Area-Prefix LSAs\n"
645 "Display Inter-Area-Router LSAs\n"
646 "Display As-External LSAs\n"
647 "Display Group-Membership LSAs\n"
648 "Display Type-7 LSAs\n"
649 "Display Link LSAs\n"
650 "Display Intra-Area-Prefix LSAs\n"
651 "Search by Link state ID\n"
652 "Specify Link state ID as IPv4 address notation\n"
655 ALIAS (show_ipv6_ospf6_database_type_id
,
656 show_ipv6_ospf6_database_type_linkstate_id_detail_cmd
,
657 "show ipv6 ospf6 database "
658 "(router|network|inter-prefix|inter-router|as-external|"
659 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D "
660 "(detail|dump|internal)",
664 "Display Link state database\n"
665 "Display Router LSAs\n"
666 "Display Network LSAs\n"
667 "Display Inter-Area-Prefix LSAs\n"
668 "Display Inter-Area-Router LSAs\n"
669 "Display As-External LSAs\n"
670 "Display Group-Membership LSAs\n"
671 "Display Type-7 LSAs\n"
672 "Display Link LSAs\n"
673 "Display Intra-Area-Prefix LSAs\n"
674 "Search by Link state ID\n"
675 "Specify Link state ID as IPv4 address notation\n"
676 "Display details of LSAs\n"
678 "Display LSA's internal information\n"
681 DEFUN (show_ipv6_ospf6_database_type_router
,
682 show_ipv6_ospf6_database_type_router_cmd
,
683 "show ipv6 ospf6 database "
684 "(router|network|inter-prefix|inter-router|as-external|"
685 "group-membership|type-7|link|intra-prefix) * A.B.C.D",
689 "Display Link state database\n"
690 "Display Router LSAs\n"
691 "Display Network LSAs\n"
692 "Display Inter-Area-Prefix LSAs\n"
693 "Display Inter-Area-Router LSAs\n"
694 "Display As-External LSAs\n"
695 "Display Group-Membership LSAs\n"
696 "Display Type-7 LSAs\n"
697 "Display Link LSAs\n"
698 "Display Intra-Area-Prefix LSAs\n"
699 "Any Link state ID\n"
700 "Specify Advertising Router as IPv4 address notation\n"
705 struct ospf6
*o
= ospf6
;
706 struct ospf6_area
*oa
;
707 struct ospf6_interface
*oi
;
709 u_int32_t adv_router
= 0;
711 OSPF6_CMD_CHECK_RUNNING ();
713 type
= parse_type_spec (argc
, argv
);
717 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
719 vty_out (vty
, "Advertising Router is not parsable: %s%s",
726 level
= parse_show_level (argc
, argv
);
728 switch (OSPF6_LSA_SCOPE (type
))
730 case OSPF6_SCOPE_AREA
:
731 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
733 oa
= (struct ospf6_area
*) getdata (i
);
734 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
735 ospf6_lsdb_show (vty
, level
, &type
, NULL
, &adv_router
, oa
->lsdb
);
739 case OSPF6_SCOPE_LINKLOCAL
:
740 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
742 oa
= (struct ospf6_area
*) getdata (i
);
743 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
745 oi
= (struct ospf6_interface
*) getdata (j
);
746 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
747 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
748 ospf6_lsdb_show (vty
, level
, &type
, NULL
, &adv_router
, oi
->lsdb
);
754 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
755 ospf6_lsdb_show (vty
, level
, &type
, NULL
, &adv_router
, o
->lsdb
);
763 vty_out (vty
, "%s", VNL
);
767 ALIAS (show_ipv6_ospf6_database_type_router
,
768 show_ipv6_ospf6_database_type_router_detail_cmd
,
769 "show ipv6 ospf6 database "
770 "(router|network|inter-prefix|inter-router|as-external|"
771 "group-membership|type-7|link|intra-prefix) * A.B.C.D "
772 "(detail|dump|internal)",
776 "Display Link state database\n"
777 "Display Router LSAs\n"
778 "Display Network LSAs\n"
779 "Display Inter-Area-Prefix LSAs\n"
780 "Display Inter-Area-Router LSAs\n"
781 "Display As-External LSAs\n"
782 "Display Group-Membership LSAs\n"
783 "Display Type-7 LSAs\n"
784 "Display Link LSAs\n"
785 "Display Intra-Area-Prefix LSAs\n"
786 "Any Link state ID\n"
787 "Specify Advertising Router as IPv4 address notation\n"
788 "Display details of LSAs\n"
790 "Display LSA's internal information\n"
793 ALIAS (show_ipv6_ospf6_database_type_router
,
794 show_ipv6_ospf6_database_type_adv_router_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",
801 "Display Link state database\n"
802 "Display Router LSAs\n"
803 "Display Network LSAs\n"
804 "Display Inter-Area-Prefix LSAs\n"
805 "Display Inter-Area-Router LSAs\n"
806 "Display As-External LSAs\n"
807 "Display Group-Membership LSAs\n"
808 "Display Type-7 LSAs\n"
809 "Display Link LSAs\n"
810 "Display Intra-Area-Prefix LSAs\n"
811 "Search by Advertising Router\n"
812 "Specify Advertising Router as IPv4 address notation\n"
815 ALIAS (show_ipv6_ospf6_database_type_router
,
816 show_ipv6_ospf6_database_type_adv_router_detail_cmd
,
817 "show ipv6 ospf6 database "
818 "(router|network|inter-prefix|inter-router|as-external|"
819 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D "
820 "(detail|dump|internal)",
824 "Display Link state database\n"
825 "Display Router LSAs\n"
826 "Display Network LSAs\n"
827 "Display Inter-Area-Prefix LSAs\n"
828 "Display Inter-Area-Router LSAs\n"
829 "Display As-External LSAs\n"
830 "Display Group-Membership LSAs\n"
831 "Display Type-7 LSAs\n"
832 "Display Link LSAs\n"
833 "Display Intra-Area-Prefix LSAs\n"
834 "Search by Advertising Router\n"
835 "Specify Advertising Router as IPv4 address notation\n"
836 "Display details of LSAs\n"
838 "Display LSA's internal information\n"
841 DEFUN (show_ipv6_ospf6_database_id_router
,
842 show_ipv6_ospf6_database_id_router_cmd
,
843 "show ipv6 ospf6 database * A.B.C.D A.B.C.D",
847 "Display Link state database\n"
848 "Any Link state Type\n"
849 "Specify Link state ID as IPv4 address notation\n"
850 "Specify Advertising Router as IPv4 address notation\n"
855 struct ospf6
*o
= ospf6
;
856 struct ospf6_area
*oa
;
857 struct ospf6_interface
*oi
;
859 u_int32_t adv_router
= 0;
861 OSPF6_CMD_CHECK_RUNNING ();
863 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
865 vty_out (vty
, "Link state ID is not parsable: %s%s",
873 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
875 vty_out (vty
, "Advertising Router is not parsable: %s%s",
882 level
= parse_show_level (argc
, argv
);
884 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
886 oa
= (struct ospf6_area
*) getdata (i
);
887 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
888 ospf6_lsdb_show (vty
, level
, NULL
, &id
, &adv_router
, oa
->lsdb
);
891 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
893 oa
= (struct ospf6_area
*) getdata (i
);
894 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
896 oi
= (struct ospf6_interface
*) getdata (j
);
897 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
898 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
899 ospf6_lsdb_show (vty
, level
, NULL
, &id
, &adv_router
, oi
->lsdb
);
903 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
904 ospf6_lsdb_show (vty
, level
, NULL
, &id
, &adv_router
, o
->lsdb
);
906 vty_out (vty
, "%s", VNL
);
910 ALIAS (show_ipv6_ospf6_database_id_router
,
911 show_ipv6_ospf6_database_id_router_detail_cmd
,
912 "show ipv6 ospf6 database * A.B.C.D A.B.C.D "
913 "(detail|dump|internal)",
917 "Display Link state database\n"
918 "Any Link state Type\n"
919 "Specify Link state ID as IPv4 address notation\n"
920 "Specify Advertising Router as IPv4 address notation\n"
921 "Display details of LSAs\n"
923 "Display LSA's internal information\n"
926 DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id
,
927 show_ipv6_ospf6_database_adv_router_linkstate_id_cmd
,
928 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D",
932 "Display Link state database\n"
933 "Search by Advertising Router\n"
934 "Specify Advertising Router as IPv4 address notation\n"
935 "Search by Link state ID\n"
936 "Specify Link state ID as IPv4 address notation\n"
941 struct ospf6
*o
= ospf6
;
942 struct ospf6_area
*oa
;
943 struct ospf6_interface
*oi
;
945 u_int32_t adv_router
= 0;
947 OSPF6_CMD_CHECK_RUNNING ();
949 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
951 vty_out (vty
, "Advertising Router is not parsable: %s%s",
959 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
961 vty_out (vty
, "Link state ID is not parsable: %s%s",
968 level
= parse_show_level (argc
, argv
);
970 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
972 oa
= (struct ospf6_area
*) getdata (i
);
973 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
974 ospf6_lsdb_show (vty
, level
, NULL
, &id
, &adv_router
, oa
->lsdb
);
977 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
979 oa
= (struct ospf6_area
*) getdata (i
);
980 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
982 oi
= (struct ospf6_interface
*) getdata (j
);
983 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
984 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
985 ospf6_lsdb_show (vty
, level
, NULL
, &id
, &adv_router
, oi
->lsdb
);
989 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
990 ospf6_lsdb_show (vty
, level
, NULL
, &id
, &adv_router
, o
->lsdb
);
992 vty_out (vty
, "%s", VNL
);
996 ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id
,
997 show_ipv6_ospf6_database_adv_router_linkstate_id_detail_cmd
,
998 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D "
999 "(detail|dump|internal)",
1003 "Display Link state database\n"
1004 "Search by Advertising Router\n"
1005 "Specify Advertising Router as IPv4 address notation\n"
1006 "Search by Link state ID\n"
1007 "Specify Link state ID as IPv4 address notation\n"
1008 "Display details of LSAs\n"
1010 "Display LSA's internal information\n"
1013 DEFUN (show_ipv6_ospf6_database_type_id_router
,
1014 show_ipv6_ospf6_database_type_id_router_cmd
,
1015 "show ipv6 ospf6 database "
1016 "(router|network|inter-prefix|inter-router|as-external|"
1017 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D",
1021 "Display Link state database\n"
1022 "Display Router LSAs\n"
1023 "Display Network LSAs\n"
1024 "Display Inter-Area-Prefix LSAs\n"
1025 "Display Inter-Area-Router LSAs\n"
1026 "Display As-External LSAs\n"
1027 "Display Group-Membership LSAs\n"
1028 "Display Type-7 LSAs\n"
1029 "Display Link LSAs\n"
1030 "Display Intra-Area-Prefix LSAs\n"
1031 "Specify Link state ID as IPv4 address notation\n"
1032 "Specify Advertising Router as IPv4 address notation\n"
1037 struct ospf6
*o
= ospf6
;
1038 struct ospf6_area
*oa
;
1039 struct ospf6_interface
*oi
;
1042 u_int32_t adv_router
= 0;
1044 OSPF6_CMD_CHECK_RUNNING ();
1046 type
= parse_type_spec (argc
, argv
);
1050 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
1052 vty_out (vty
, "Link state ID is not parsable: %s%s",
1060 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
1062 vty_out (vty
, "Advertising Router is not parsable: %s%s",
1069 level
= parse_show_level (argc
, argv
);
1071 switch (OSPF6_LSA_SCOPE (type
))
1073 case OSPF6_SCOPE_AREA
:
1074 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1076 oa
= (struct ospf6_area
*) getdata (i
);
1077 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
1078 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, oa
->lsdb
);
1082 case OSPF6_SCOPE_LINKLOCAL
:
1083 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1085 oa
= (struct ospf6_area
*) getdata (i
);
1086 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
1088 oi
= (struct ospf6_interface
*) getdata (j
);
1089 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
1090 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
1091 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, oi
->lsdb
);
1096 case OSPF6_SCOPE_AS
:
1097 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1098 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, o
->lsdb
);
1106 vty_out (vty
, "%s", VNL
);
1110 ALIAS (show_ipv6_ospf6_database_type_id_router
,
1111 show_ipv6_ospf6_database_type_id_router_detail_cmd
,
1112 "show ipv6 ospf6 database "
1113 "(router|network|inter-prefix|inter-router|as-external|"
1114 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D "
1119 "Display Link state database\n"
1120 "Display Router LSAs\n"
1121 "Display Network LSAs\n"
1122 "Display Inter-Area-Prefix LSAs\n"
1123 "Display Inter-Area-Router LSAs\n"
1124 "Display As-External LSAs\n"
1125 "Display Group-Membership LSAs\n"
1126 "Display Type-7 LSAs\n"
1127 "Display Link LSAs\n"
1128 "Display Intra-Area-Prefix LSAs\n"
1129 "Specify Link state ID as IPv4 address notation\n"
1130 "Specify Advertising Router as IPv4 address notation\n"
1132 "Display LSA's internal information\n"
1135 DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id
,
1136 show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd
,
1137 "show ipv6 ospf6 database "
1138 "(router|network|inter-prefix|inter-router|as-external|"
1139 "group-membership|type-7|link|intra-prefix) "
1140 "adv-router A.B.C.D linkstate-id A.B.C.D",
1144 "Display Link state database\n"
1145 "Display Router LSAs\n"
1146 "Display Network LSAs\n"
1147 "Display Inter-Area-Prefix LSAs\n"
1148 "Display Inter-Area-Router LSAs\n"
1149 "Display As-External LSAs\n"
1150 "Display Group-Membership LSAs\n"
1151 "Display Type-7 LSAs\n"
1152 "Display Link LSAs\n"
1153 "Display Intra-Area-Prefix LSAs\n"
1154 "Search by Advertising Router\n"
1155 "Specify Advertising Router as IPv4 address notation\n"
1156 "Search by Link state ID\n"
1157 "Specify Link state ID as IPv4 address notation\n"
1162 struct ospf6
*o
= ospf6
;
1163 struct ospf6_area
*oa
;
1164 struct ospf6_interface
*oi
;
1167 u_int32_t adv_router
= 0;
1169 OSPF6_CMD_CHECK_RUNNING ();
1171 type
= parse_type_spec (argc
, argv
);
1175 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
1177 vty_out (vty
, "Advertising Router is not parsable: %s%s",
1185 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
1187 vty_out (vty
, "Link state ID is not parsable: %s%s",
1194 level
= parse_show_level (argc
, argv
);
1196 switch (OSPF6_LSA_SCOPE (type
))
1198 case OSPF6_SCOPE_AREA
:
1199 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1201 oa
= (struct ospf6_area
*) getdata (i
);
1202 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
1203 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, oa
->lsdb
);
1207 case OSPF6_SCOPE_LINKLOCAL
:
1208 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1210 oa
= (struct ospf6_area
*) getdata (i
);
1211 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
1213 oi
= (struct ospf6_interface
*) getdata (j
);
1214 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
1215 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
1216 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, oi
->lsdb
);
1221 case OSPF6_SCOPE_AS
:
1222 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1223 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, o
->lsdb
);
1231 vty_out (vty
, "%s", VNL
);
1235 ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id
,
1236 show_ipv6_ospf6_database_type_adv_router_linkstate_id_detail_cmd
,
1237 "show ipv6 ospf6 database "
1238 "(router|network|inter-prefix|inter-router|as-external|"
1239 "group-membership|type-7|link|intra-prefix) "
1240 "adv-router A.B.C.D linkstate-id A.B.C.D "
1245 "Display Link state database\n"
1246 "Display Router LSAs\n"
1247 "Display Network LSAs\n"
1248 "Display Inter-Area-Prefix LSAs\n"
1249 "Display Inter-Area-Router LSAs\n"
1250 "Display As-External LSAs\n"
1251 "Display Group-Membership LSAs\n"
1252 "Display Type-7 LSAs\n"
1253 "Display Link LSAs\n"
1254 "Display Intra-Area-Prefix LSAs\n"
1255 "Search by Advertising Router\n"
1256 "Specify Advertising Router as IPv4 address notation\n"
1257 "Search by Link state ID\n"
1258 "Specify Link state ID as IPv4 address notation\n"
1260 "Display LSA's internal information\n"
1263 DEFUN (show_ipv6_ospf6_database_self_originated
,
1264 show_ipv6_ospf6_database_self_originated_cmd
,
1265 "show ipv6 ospf6 database self-originated",
1269 "Display Self-originated LSAs\n"
1274 struct ospf6
*o
= ospf6
;
1275 struct ospf6_area
*oa
;
1276 struct ospf6_interface
*oi
;
1277 u_int32_t adv_router
= 0;
1279 OSPF6_CMD_CHECK_RUNNING ();
1281 level
= parse_show_level (argc
, argv
);
1283 adv_router
= o
->router_id
;
1285 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1287 oa
= (struct ospf6_area
*) getdata (i
);
1288 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
1289 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, &adv_router
, oa
->lsdb
);
1292 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1294 oa
= (struct ospf6_area
*) getdata (i
);
1295 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
1297 oi
= (struct ospf6_interface
*) getdata (j
);
1298 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
1299 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
1300 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, &adv_router
, oi
->lsdb
);
1304 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1305 ospf6_lsdb_show (vty
, level
, NULL
, NULL
, &adv_router
, o
->lsdb
);
1307 vty_out (vty
, "%s", VNL
);
1311 ALIAS (show_ipv6_ospf6_database_self_originated
,
1312 show_ipv6_ospf6_database_self_originated_detail_cmd
,
1313 "show ipv6 ospf6 database self-originated "
1314 "(detail|dump|internal)",
1318 "Display Self-originated LSAs\n"
1319 "Display details of LSAs\n"
1321 "Display LSA's internal information\n"
1324 DEFUN (show_ipv6_ospf6_database_type_self_originated
,
1325 show_ipv6_ospf6_database_type_self_originated_cmd
,
1326 "show ipv6 ospf6 database "
1327 "(router|network|inter-prefix|inter-router|as-external|"
1328 "group-membership|type-7|link|intra-prefix) self-originated",
1332 "Display Link state database\n"
1333 "Display Router LSAs\n"
1334 "Display Network LSAs\n"
1335 "Display Inter-Area-Prefix LSAs\n"
1336 "Display Inter-Area-Router LSAs\n"
1337 "Display As-External LSAs\n"
1338 "Display Group-Membership LSAs\n"
1339 "Display Type-7 LSAs\n"
1340 "Display Link LSAs\n"
1341 "Display Intra-Area-Prefix LSAs\n"
1342 "Display Self-originated LSAs\n"
1347 struct ospf6
*o
= ospf6
;
1348 struct ospf6_area
*oa
;
1349 struct ospf6_interface
*oi
;
1351 u_int32_t adv_router
= 0;
1353 OSPF6_CMD_CHECK_RUNNING ();
1355 type
= parse_type_spec (argc
, argv
);
1358 level
= parse_show_level (argc
, argv
);
1360 adv_router
= o
->router_id
;
1362 switch (OSPF6_LSA_SCOPE (type
))
1364 case OSPF6_SCOPE_AREA
:
1365 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1367 oa
= (struct ospf6_area
*) getdata (i
);
1368 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
1369 ospf6_lsdb_show (vty
, level
, &type
, NULL
, &adv_router
, oa
->lsdb
);
1373 case OSPF6_SCOPE_LINKLOCAL
:
1374 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1376 oa
= (struct ospf6_area
*) getdata (i
);
1377 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
1379 oi
= (struct ospf6_interface
*) getdata (j
);
1380 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
1381 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
1382 ospf6_lsdb_show (vty
, level
, &type
, NULL
, &adv_router
, oi
->lsdb
);
1387 case OSPF6_SCOPE_AS
:
1388 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1389 ospf6_lsdb_show (vty
, level
, &type
, NULL
, &adv_router
, o
->lsdb
);
1397 vty_out (vty
, "%s", VNL
);
1401 ALIAS (show_ipv6_ospf6_database_type_self_originated
,
1402 show_ipv6_ospf6_database_type_self_originated_detail_cmd
,
1403 "show ipv6 ospf6 database "
1404 "(router|network|inter-prefix|inter-router|as-external|"
1405 "group-membership|type-7|link|intra-prefix) self-originated "
1406 "(detail|dump|internal)",
1410 "Display Link state database\n"
1411 "Display Router LSAs\n"
1412 "Display Network LSAs\n"
1413 "Display Inter-Area-Prefix LSAs\n"
1414 "Display Inter-Area-Router LSAs\n"
1415 "Display As-External LSAs\n"
1416 "Display Group-Membership LSAs\n"
1417 "Display Type-7 LSAs\n"
1418 "Display Link LSAs\n"
1419 "Display Intra-Area-Prefix LSAs\n"
1420 "Display Self-originated LSAs\n"
1421 "Display details of LSAs\n"
1423 "Display LSA's internal information\n"
1426 DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id
,
1427 show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd
,
1428 "show ipv6 ospf6 database "
1429 "(router|network|inter-prefix|inter-router|as-external|"
1430 "group-membership|type-7|link|intra-prefix) self-originated "
1431 "linkstate-id A.B.C.D",
1435 "Display Link state database\n"
1436 "Display Router LSAs\n"
1437 "Display Network LSAs\n"
1438 "Display Inter-Area-Prefix LSAs\n"
1439 "Display Inter-Area-Router LSAs\n"
1440 "Display As-External LSAs\n"
1441 "Display Group-Membership LSAs\n"
1442 "Display Type-7 LSAs\n"
1443 "Display Link LSAs\n"
1444 "Display Intra-Area-Prefix LSAs\n"
1445 "Display Self-originated LSAs\n"
1446 "Search by Link state ID\n"
1447 "Specify Link state ID as IPv4 address notation\n"
1452 struct ospf6
*o
= ospf6
;
1453 struct ospf6_area
*oa
;
1454 struct ospf6_interface
*oi
;
1456 u_int32_t adv_router
= 0;
1459 OSPF6_CMD_CHECK_RUNNING ();
1461 type
= parse_type_spec (argc
, argv
);
1465 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
1467 vty_out (vty
, "Link State ID is not parsable: %s%s",
1474 level
= parse_show_level (argc
, argv
);
1476 adv_router
= o
->router_id
;
1478 switch (OSPF6_LSA_SCOPE (type
))
1480 case OSPF6_SCOPE_AREA
:
1481 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1483 oa
= (struct ospf6_area
*) getdata (i
);
1484 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
1485 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, oa
->lsdb
);
1489 case OSPF6_SCOPE_LINKLOCAL
:
1490 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1492 oa
= (struct ospf6_area
*) getdata (i
);
1493 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
1495 oi
= (struct ospf6_interface
*) getdata (j
);
1496 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
1497 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
1498 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, oi
->lsdb
);
1503 case OSPF6_SCOPE_AS
:
1504 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1505 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, o
->lsdb
);
1513 vty_out (vty
, "%s", VNL
);
1517 ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id
,
1518 show_ipv6_ospf6_database_type_self_originated_linkstate_id_detail_cmd
,
1519 "show ipv6 ospf6 database "
1520 "(router|network|inter-prefix|inter-router|as-external|"
1521 "group-membership|type-7|link|intra-prefix) self-originated "
1522 "linkstate-id A.B.C.D (detail|dump|internal)",
1526 "Display Link state database\n"
1527 "Display Router LSAs\n"
1528 "Display Network LSAs\n"
1529 "Display Inter-Area-Prefix LSAs\n"
1530 "Display Inter-Area-Router LSAs\n"
1531 "Display As-External LSAs\n"
1532 "Display Group-Membership LSAs\n"
1533 "Display Type-7 LSAs\n"
1534 "Display Link LSAs\n"
1535 "Display Intra-Area-Prefix LSAs\n"
1536 "Display Self-originated LSAs\n"
1537 "Search by Link state ID\n"
1538 "Specify Link state ID as IPv4 address notation\n"
1539 "Display details of LSAs\n"
1541 "Display LSA's internal information\n"
1544 DEFUN (show_ipv6_ospf6_database_type_id_self_originated
,
1545 show_ipv6_ospf6_database_type_id_self_originated_cmd
,
1546 "show ipv6 ospf6 database "
1547 "(router|network|inter-prefix|inter-router|as-external|"
1548 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated",
1552 "Display Link state database\n"
1553 "Display Router LSAs\n"
1554 "Display Network LSAs\n"
1555 "Display Inter-Area-Prefix LSAs\n"
1556 "Display Inter-Area-Router LSAs\n"
1557 "Display As-External LSAs\n"
1558 "Display Group-Membership LSAs\n"
1559 "Display Type-7 LSAs\n"
1560 "Display Link LSAs\n"
1561 "Display Intra-Area-Prefix LSAs\n"
1562 "Specify Link state ID as IPv4 address notation\n"
1563 "Display Self-originated LSAs\n"
1568 struct ospf6
*o
= ospf6
;
1569 struct ospf6_area
*oa
;
1570 struct ospf6_interface
*oi
;
1572 u_int32_t adv_router
= 0;
1575 OSPF6_CMD_CHECK_RUNNING ();
1577 type
= parse_type_spec (argc
, argv
);
1581 if ((inet_pton (AF_INET
, argv
[0], &id
)) != 1)
1583 vty_out (vty
, "Link State ID is not parsable: %s%s",
1590 level
= parse_show_level (argc
, argv
);
1592 adv_router
= o
->router_id
;
1594 switch (OSPF6_LSA_SCOPE (type
))
1596 case OSPF6_SCOPE_AREA
:
1597 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1599 oa
= (struct ospf6_area
*) getdata (i
);
1600 vty_out (vty
, AREA_LSDB_TITLE_FORMAT
, VNL
, oa
->name
, VNL
, VNL
);
1601 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, oa
->lsdb
);
1605 case OSPF6_SCOPE_LINKLOCAL
:
1606 for (i
= listhead (o
->area_list
); i
; nextnode (i
))
1608 oa
= (struct ospf6_area
*) getdata (i
);
1609 for (j
= listhead (oa
->if_list
); j
; nextnode (j
))
1611 oi
= (struct ospf6_interface
*) getdata (j
);
1612 vty_out (vty
, IF_LSDB_TITLE_FORMAT
, VNL
,
1613 oi
->interface
->name
, oa
->name
, VNL
, VNL
);
1614 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, oi
->lsdb
);
1619 case OSPF6_SCOPE_AS
:
1620 vty_out (vty
, AS_LSDB_TITLE_FORMAT
, VNL
, VNL
, VNL
);
1621 ospf6_lsdb_show (vty
, level
, &type
, &id
, &adv_router
, o
->lsdb
);
1629 vty_out (vty
, "%s", VNL
);
1633 ALIAS (show_ipv6_ospf6_database_type_id_self_originated
,
1634 show_ipv6_ospf6_database_type_id_self_originated_detail_cmd
,
1635 "show ipv6 ospf6 database "
1636 "(router|network|inter-prefix|inter-router|as-external|"
1637 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated "
1638 "(detail|dump|internal)",
1642 "Display Link state database\n"
1643 "Display Router LSAs\n"
1644 "Display Network LSAs\n"
1645 "Display Inter-Area-Prefix LSAs\n"
1646 "Display Inter-Area-Router LSAs\n"
1647 "Display As-External LSAs\n"
1648 "Display Group-Membership LSAs\n"
1649 "Display Type-7 LSAs\n"
1650 "Display Link LSAs\n"
1651 "Display Intra-Area-Prefix LSAs\n"
1652 "Display Self-originated LSAs\n"
1653 "Search by Link state ID\n"
1654 "Specify Link state ID as IPv4 address notation\n"
1655 "Display details of LSAs\n"
1657 "Display LSA's internal information\n"
1661 DEFUN (show_ipv6_ospf6_border_routers
,
1662 show_ipv6_ospf6_border_routers_cmd
,
1663 "show ipv6 ospf6 border-routers",
1667 "Display routing table for ABR and ASBR\n"
1670 u_int32_t adv_router
;
1671 void (*showfunc
) (struct vty
*, struct ospf6_route
*);
1672 struct ospf6_route
*ro
;
1673 struct prefix prefix
;
1675 OSPF6_CMD_CHECK_RUNNING ();
1677 if (argc
&& ! strcmp ("detail", argv
[0]))
1679 showfunc
= ospf6_route_show_detail
;
1684 showfunc
= ospf6_brouter_show
;
1688 if ((inet_pton (AF_INET
, argv
[0], &adv_router
)) != 1)
1690 vty_out (vty
, "Router ID is not parsable: %s%s", argv
[0], VNL
);
1694 ospf6_linkstate_prefix (adv_router
, 0, &prefix
);
1695 ro
= ospf6_route_lookup (&prefix
, ospf6
->brouter_table
);
1696 ospf6_route_show_detail (vty
, ro
);
1700 if (showfunc
== ospf6_brouter_show
)
1701 ospf6_brouter_show_header (vty
);
1703 for (ro
= ospf6_route_head (ospf6
->brouter_table
); ro
;
1704 ro
= ospf6_route_next (ro
))
1705 (*showfunc
) (vty
, ro
);
1710 ALIAS (show_ipv6_ospf6_border_routers
,
1711 show_ipv6_ospf6_border_routers_detail_cmd
,
1712 "show ipv6 ospf6 border-routers (A.B.C.D|detail)",
1716 "Display routing table for ABR and ASBR\n"
1717 "Specify Router-ID\n"
1721 DEFUN (show_ipv6_ospf6_linkstate
,
1722 show_ipv6_ospf6_linkstate_cmd
,
1723 "show ipv6 ospf6 linkstate",
1727 "Display linkstate routing table\n"
1731 struct ospf6_area
*oa
;
1733 for (node
= listhead (ospf6
->area_list
); node
; nextnode (node
))
1735 oa
= OSPF6_AREA (getdata (node
));
1737 vty_out (vty
, "%s SPF Result in Area %s%s%s",
1738 VNL
, oa
->name
, VNL
, VNL
);
1739 ospf6_linkstate_table_show (vty
, argc
, argv
, oa
->spf_table
);
1742 vty_out (vty
, "%s", VNL
);
1746 ALIAS (show_ipv6_ospf6_linkstate
,
1747 show_ipv6_ospf6_linkstate_router_cmd
,
1748 "show ipv6 ospf6 linkstate router A.B.C.D",
1752 "Display linkstate routing table\n"
1753 "Display Router Entry\n"
1754 "Specify Router ID as IPv4 address notation\n"
1757 ALIAS (show_ipv6_ospf6_linkstate
,
1758 show_ipv6_ospf6_linkstate_network_cmd
,
1759 "show ipv6 ospf6 linkstate network A.B.C.D A.B.C.D",
1763 "Display linkstate routing table\n"
1764 "Display Network Entry\n"
1765 "Specify Router ID as IPv4 address notation\n"
1766 "Specify Link state ID as IPv4 address notation\n"
1769 DEFUN (show_ipv6_ospf6_linkstate_detail
,
1770 show_ipv6_ospf6_linkstate_detail_cmd
,
1771 "show ipv6 ospf6 linkstate detail",
1775 "Display linkstate routing table\n"
1778 char *sargv
[CMD_ARGC_MAX
];
1781 struct ospf6_area
*oa
;
1783 /* copy argv to sargv and then append "detail" */
1784 for (i
= 0; i
< argc
; i
++)
1787 sargv
[sargc
++] = "detail";
1788 sargv
[sargc
] = NULL
;
1790 for (node
= listhead (ospf6
->area_list
); node
; nextnode (node
))
1792 oa
= OSPF6_AREA (getdata (node
));
1794 vty_out (vty
, "%s SPF Result in Area %s%s%s",
1795 VNL
, oa
->name
, VNL
, VNL
);
1796 ospf6_linkstate_table_show (vty
, sargc
, sargv
, oa
->spf_table
);
1799 vty_out (vty
, "%s", VNL
);
1803 /* Install ospf related commands. */
1809 ospf6_interface_init ();
1810 ospf6_neighbor_init ();
1811 ospf6_zebra_init ();
1815 ospf6_intra_init ();
1821 #endif /*HAVE_SNMP*/
1823 install_node (&debug_node
, config_write_ospf6_debug
);
1825 install_element_ospf6_debug_message ();
1826 install_element_ospf6_debug_lsa ();
1827 install_element_ospf6_debug_interface ();
1828 install_element_ospf6_debug_neighbor ();
1829 install_element_ospf6_debug_zebra ();
1830 install_element_ospf6_debug_spf ();
1831 install_element_ospf6_debug_route ();
1832 install_element_ospf6_debug_asbr ();
1833 install_element_ospf6_debug_abr ();
1834 install_element_ospf6_debug_flood ();
1836 install_element (VIEW_NODE
, &show_version_ospf6_cmd
);
1837 install_element (ENABLE_NODE
, &show_version_ospf6_cmd
);
1839 install_element (VIEW_NODE
, &show_ipv6_ospf6_border_routers_cmd
);
1840 install_element (VIEW_NODE
, &show_ipv6_ospf6_border_routers_detail_cmd
);
1841 install_element (ENABLE_NODE
, &show_ipv6_ospf6_border_routers_cmd
);
1842 install_element (ENABLE_NODE
, &show_ipv6_ospf6_border_routers_detail_cmd
);
1844 install_element (VIEW_NODE
, &show_ipv6_ospf6_linkstate_cmd
);
1845 install_element (VIEW_NODE
, &show_ipv6_ospf6_linkstate_router_cmd
);
1846 install_element (VIEW_NODE
, &show_ipv6_ospf6_linkstate_network_cmd
);
1847 install_element (VIEW_NODE
, &show_ipv6_ospf6_linkstate_detail_cmd
);
1848 install_element (ENABLE_NODE
, &show_ipv6_ospf6_linkstate_cmd
);
1849 install_element (ENABLE_NODE
, &show_ipv6_ospf6_linkstate_router_cmd
);
1850 install_element (ENABLE_NODE
, &show_ipv6_ospf6_linkstate_network_cmd
);
1851 install_element (ENABLE_NODE
, &show_ipv6_ospf6_linkstate_detail_cmd
);
1853 #define INSTALL(n,c) \
1854 install_element (n ## _NODE, &show_ipv6_ospf6_ ## c);
1856 INSTALL (VIEW
, database_cmd
);
1857 INSTALL (VIEW
, database_detail_cmd
);
1858 INSTALL (VIEW
, database_type_cmd
);
1859 INSTALL (VIEW
, database_type_detail_cmd
);
1860 INSTALL (VIEW
, database_id_cmd
);
1861 INSTALL (VIEW
, database_id_detail_cmd
);
1862 INSTALL (VIEW
, database_linkstate_id_cmd
);
1863 INSTALL (VIEW
, database_linkstate_id_detail_cmd
);
1864 INSTALL (VIEW
, database_router_cmd
);
1865 INSTALL (VIEW
, database_router_detail_cmd
);
1866 INSTALL (VIEW
, database_adv_router_cmd
);
1867 INSTALL (VIEW
, database_adv_router_detail_cmd
);
1868 INSTALL (VIEW
, database_type_id_cmd
);
1869 INSTALL (VIEW
, database_type_id_detail_cmd
);
1870 INSTALL (VIEW
, database_type_linkstate_id_cmd
);
1871 INSTALL (VIEW
, database_type_linkstate_id_detail_cmd
);
1872 INSTALL (VIEW
, database_type_router_cmd
);
1873 INSTALL (VIEW
, database_type_router_detail_cmd
);
1874 INSTALL (VIEW
, database_type_adv_router_cmd
);
1875 INSTALL (VIEW
, database_type_adv_router_detail_cmd
);
1876 INSTALL (VIEW
, database_adv_router_linkstate_id_cmd
);
1877 INSTALL (VIEW
, database_adv_router_linkstate_id_detail_cmd
);
1878 INSTALL (VIEW
, database_id_router_cmd
);
1879 INSTALL (VIEW
, database_id_router_detail_cmd
);
1880 INSTALL (VIEW
, database_type_id_router_cmd
);
1881 INSTALL (VIEW
, database_type_id_router_detail_cmd
);
1882 INSTALL (VIEW
, database_type_adv_router_linkstate_id_cmd
);
1883 INSTALL (VIEW
, database_type_adv_router_linkstate_id_detail_cmd
);
1884 INSTALL (VIEW
, database_self_originated_cmd
);
1885 INSTALL (VIEW
, database_self_originated_detail_cmd
);
1886 INSTALL (VIEW
, database_type_self_originated_cmd
);
1887 INSTALL (VIEW
, database_type_self_originated_detail_cmd
);
1888 INSTALL (VIEW
, database_type_id_self_originated_cmd
);
1889 INSTALL (VIEW
, database_type_id_self_originated_detail_cmd
);
1890 INSTALL (VIEW
, database_type_self_originated_linkstate_id_cmd
);
1891 INSTALL (VIEW
, database_type_self_originated_linkstate_id_detail_cmd
);
1892 INSTALL (VIEW
, database_type_id_self_originated_cmd
);
1893 INSTALL (VIEW
, database_type_id_self_originated_detail_cmd
);
1895 INSTALL (ENABLE
, database_cmd
);
1896 INSTALL (ENABLE
, database_detail_cmd
);
1897 INSTALL (ENABLE
, database_type_cmd
);
1898 INSTALL (ENABLE
, database_type_detail_cmd
);
1899 INSTALL (ENABLE
, database_id_cmd
);
1900 INSTALL (ENABLE
, database_id_detail_cmd
);
1901 INSTALL (ENABLE
, database_linkstate_id_cmd
);
1902 INSTALL (ENABLE
, database_linkstate_id_detail_cmd
);
1903 INSTALL (ENABLE
, database_router_cmd
);
1904 INSTALL (ENABLE
, database_router_detail_cmd
);
1905 INSTALL (ENABLE
, database_adv_router_cmd
);
1906 INSTALL (ENABLE
, database_adv_router_detail_cmd
);
1907 INSTALL (ENABLE
, database_type_id_cmd
);
1908 INSTALL (ENABLE
, database_type_id_detail_cmd
);
1909 INSTALL (ENABLE
, database_type_linkstate_id_cmd
);
1910 INSTALL (ENABLE
, database_type_linkstate_id_detail_cmd
);
1911 INSTALL (ENABLE
, database_type_router_cmd
);
1912 INSTALL (ENABLE
, database_type_router_detail_cmd
);
1913 INSTALL (ENABLE
, database_type_adv_router_cmd
);
1914 INSTALL (ENABLE
, database_type_adv_router_detail_cmd
);
1915 INSTALL (ENABLE
, database_adv_router_linkstate_id_cmd
);
1916 INSTALL (ENABLE
, database_adv_router_linkstate_id_detail_cmd
);
1917 INSTALL (ENABLE
, database_id_router_cmd
);
1918 INSTALL (ENABLE
, database_id_router_detail_cmd
);
1919 INSTALL (ENABLE
, database_type_id_router_cmd
);
1920 INSTALL (ENABLE
, database_type_id_router_detail_cmd
);
1921 INSTALL (ENABLE
, database_type_adv_router_linkstate_id_cmd
);
1922 INSTALL (ENABLE
, database_type_adv_router_linkstate_id_detail_cmd
);
1923 INSTALL (ENABLE
, database_self_originated_cmd
);
1924 INSTALL (ENABLE
, database_self_originated_detail_cmd
);
1925 INSTALL (ENABLE
, database_type_self_originated_cmd
);
1926 INSTALL (ENABLE
, database_type_self_originated_detail_cmd
);
1927 INSTALL (ENABLE
, database_type_id_self_originated_cmd
);
1928 INSTALL (ENABLE
, database_type_id_self_originated_detail_cmd
);
1929 INSTALL (ENABLE
, database_type_self_originated_linkstate_id_cmd
);
1930 INSTALL (ENABLE
, database_type_self_originated_linkstate_id_detail_cmd
);
1931 INSTALL (ENABLE
, database_type_id_self_originated_cmd
);
1932 INSTALL (ENABLE
, database_type_id_self_originated_detail_cmd
);
1934 /* Make ospf protocol socket. */
1936 thread_add_read (master
, ospf6_receive
, NULL
, ospf6_sock
);