paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1 | /* |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 2 | * Copyright (C) 2003 Yasuhiro Ohara |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 3 | * |
| 4 | * This file is part of GNU Zebra. |
| 5 | * |
| 6 | * GNU Zebra is free software; you can redistribute it and/or modify it |
| 7 | * under the terms of the GNU General Public License as published by the |
| 8 | * Free Software Foundation; either version 2, or (at your option) any |
| 9 | * later version. |
| 10 | * |
| 11 | * GNU Zebra is distributed in the hope that it will be useful, but |
| 12 | * WITHOUT ANY WARRANTY; without even the implied warranty of |
| 13 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU |
| 14 | * General Public License for more details. |
| 15 | * |
| 16 | * You should have received a copy of the GNU General Public License |
| 17 | * along with GNU Zebra; see the file COPYING. If not, write to the |
| 18 | * Free Software Foundation, Inc., 59 Temple Place - Suite 330, |
| 19 | * Boston, MA 02111-1307, USA. |
| 20 | */ |
| 21 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 22 | #include <zebra.h> |
| 23 | |
| 24 | #include "thread.h" |
| 25 | #include "linklist.h" |
| 26 | #include "vty.h" |
| 27 | #include "command.h" |
| 28 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 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" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 43 | #include "ospf6_abr.h" |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 44 | #include "ospf6_flood.h" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 45 | #include "ospf6d.h" |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 46 | |
hasso | ef1bbf5 | 2004-10-08 12:04:21 +0000 | [diff] [blame] | 47 | #ifdef HAVE_SNMP |
| 48 | #include "ospf6_snmp.h" |
| 49 | #endif /*HAVE_SNMP*/ |
| 50 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 51 | char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION; |
| 52 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 53 | struct route_node * |
| 54 | route_prev (struct route_node *node) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 55 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 56 | struct route_node *end; |
| 57 | struct route_node *prev = NULL; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 58 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 59 | end = node; |
| 60 | node = node->parent; |
hasso | 3b68735 | 2004-08-19 06:56:53 +0000 | [diff] [blame] | 61 | if (node) |
| 62 | route_lock_node (node); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 63 | while (node) |
| 64 | { |
| 65 | prev = node; |
hasso | 3b68735 | 2004-08-19 06:56:53 +0000 | [diff] [blame] | 66 | node = route_next (node); |
| 67 | if (node == end) |
| 68 | { |
| 69 | route_unlock_node (node); |
| 70 | node = NULL; |
| 71 | } |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 72 | } |
| 73 | route_unlock_node (end); |
hasso | 3b68735 | 2004-08-19 06:56:53 +0000 | [diff] [blame] | 74 | if (prev) |
| 75 | route_lock_node (prev); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 76 | |
| 77 | return prev; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 78 | } |
| 79 | |
David Lamparter | 6b0655a | 2014-06-04 06:53:35 +0200 | [diff] [blame] | 80 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 81 | /* show database functions */ |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 82 | DEFUN (show_version_ospf6, |
| 83 | show_version_ospf6_cmd, |
| 84 | "show version ospf6", |
| 85 | SHOW_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 86 | "Displays ospf6d version\n" |
| 87 | ) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 88 | { |
| 89 | vty_out (vty, "Zebra OSPF6d Version: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 90 | ospf6_daemon_version, VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 91 | |
| 92 | return CMD_SUCCESS; |
| 93 | } |
| 94 | |
Stephen Hemminger | 7fc626d | 2008-12-01 11:10:34 -0800 | [diff] [blame] | 95 | static struct cmd_node debug_node = |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 96 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 97 | DEBUG_NODE, |
hasso | 69b4a81 | 2004-08-26 18:10:36 +0000 | [diff] [blame] | 98 | "", |
| 99 | 1 /* VTYSH */ |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 100 | }; |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 101 | |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 102 | static int |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 103 | config_write_ospf6_debug (struct vty *vty) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 104 | { |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 105 | config_write_ospf6_debug_message (vty); |
| 106 | config_write_ospf6_debug_lsa (vty); |
| 107 | config_write_ospf6_debug_zebra (vty); |
| 108 | config_write_ospf6_debug_interface (vty); |
| 109 | config_write_ospf6_debug_neighbor (vty); |
| 110 | config_write_ospf6_debug_spf (vty); |
| 111 | config_write_ospf6_debug_route (vty); |
Paul Jakma | cb4b884 | 2006-05-15 10:39:30 +0000 | [diff] [blame] | 112 | config_write_ospf6_debug_brouter (vty); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 113 | config_write_ospf6_debug_asbr (vty); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 114 | config_write_ospf6_debug_abr (vty); |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 115 | config_write_ospf6_debug_flood (vty); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 116 | vty_out (vty, "!%s", VNL); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 117 | return 0; |
| 118 | } |
| 119 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 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" |
| 126 | |
| 127 | static int |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 128 | parse_show_level (int argc, const char *argv[]) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 129 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 130 | int level = 0; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 131 | if (argc) |
| 132 | { |
| 133 | if (! strncmp (argv[0], "de", 2)) |
| 134 | level = OSPF6_LSDB_SHOW_LEVEL_DETAIL; |
| 135 | else if (! strncmp (argv[0], "du", 2)) |
| 136 | level = OSPF6_LSDB_SHOW_LEVEL_DUMP; |
| 137 | else if (! strncmp (argv[0], "in", 2)) |
| 138 | level = OSPF6_LSDB_SHOW_LEVEL_INTERNAL; |
| 139 | } |
| 140 | else |
| 141 | level = OSPF6_LSDB_SHOW_LEVEL_NORMAL; |
| 142 | return level; |
| 143 | } |
| 144 | |
| 145 | static u_int16_t |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 146 | parse_type_spec (int argc, const char *argv[]) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 147 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 148 | u_int16_t type = 0; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 149 | assert (argc); |
| 150 | if (! strcmp (argv[0], "router")) |
| 151 | type = htons (OSPF6_LSTYPE_ROUTER); |
| 152 | else if (! strcmp (argv[0], "network")) |
| 153 | type = htons (OSPF6_LSTYPE_NETWORK); |
| 154 | else if (! strcmp (argv[0], "as-external")) |
| 155 | type = htons (OSPF6_LSTYPE_AS_EXTERNAL); |
| 156 | else if (! strcmp (argv[0], "intra-prefix")) |
| 157 | type = htons (OSPF6_LSTYPE_INTRA_PREFIX); |
| 158 | else if (! strcmp (argv[0], "inter-router")) |
| 159 | type = htons (OSPF6_LSTYPE_INTER_ROUTER); |
| 160 | else if (! strcmp (argv[0], "inter-prefix")) |
| 161 | type = htons (OSPF6_LSTYPE_INTER_PREFIX); |
| 162 | else if (! strcmp (argv[0], "link")) |
| 163 | type = htons (OSPF6_LSTYPE_LINK); |
| 164 | return type; |
| 165 | } |
| 166 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 167 | DEFUN (show_ipv6_ospf6_database, |
| 168 | show_ipv6_ospf6_database_cmd, |
| 169 | "show ipv6 ospf6 database", |
| 170 | SHOW_STR |
| 171 | IPV6_STR |
| 172 | OSPF6_STR |
| 173 | "Display Link state database\n" |
| 174 | ) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 175 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 176 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 177 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 178 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 179 | struct ospf6_area *oa; |
| 180 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 181 | |
| 182 | OSPF6_CMD_CHECK_RUNNING (); |
| 183 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 184 | level = parse_show_level (argc, argv); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 185 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 186 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 187 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 188 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 189 | ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 190 | } |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 191 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 192 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 193 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 194 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 195 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 196 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 197 | oi->interface->name, oa->name, VNL, VNL); |
| 198 | ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 199 | } |
| 200 | } |
| 201 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 202 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 203 | ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb); |
| 204 | |
| 205 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 206 | return CMD_SUCCESS; |
| 207 | } |
| 208 | |
| 209 | ALIAS (show_ipv6_ospf6_database, |
| 210 | show_ipv6_ospf6_database_detail_cmd, |
| 211 | "show ipv6 ospf6 database (detail|dump|internal)", |
| 212 | SHOW_STR |
| 213 | IPV6_STR |
| 214 | OSPF6_STR |
| 215 | "Display Link state database\n" |
| 216 | "Display details of LSAs\n" |
| 217 | "Dump LSAs\n" |
| 218 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 219 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 220 | |
| 221 | DEFUN (show_ipv6_ospf6_database_type, |
| 222 | show_ipv6_ospf6_database_type_cmd, |
| 223 | "show ipv6 ospf6 database " |
| 224 | "(router|network|inter-prefix|inter-router|as-external|" |
| 225 | "group-membership|type-7|link|intra-prefix)", |
| 226 | SHOW_STR |
| 227 | IPV6_STR |
| 228 | OSPF6_STR |
| 229 | "Display Link state database\n" |
| 230 | "Display Router LSAs\n" |
| 231 | "Display Network LSAs\n" |
| 232 | "Display Inter-Area-Prefix LSAs\n" |
| 233 | "Display Inter-Area-Router LSAs\n" |
| 234 | "Display As-External LSAs\n" |
| 235 | "Display Group-Membership LSAs\n" |
| 236 | "Display Type-7 LSAs\n" |
| 237 | "Display Link LSAs\n" |
| 238 | "Display Intra-Area-Prefix LSAs\n" |
| 239 | ) |
| 240 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 241 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 242 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 243 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 244 | struct ospf6_area *oa; |
| 245 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 246 | u_int16_t type = 0; |
| 247 | |
| 248 | OSPF6_CMD_CHECK_RUNNING (); |
| 249 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 250 | type = parse_type_spec (argc, argv); |
| 251 | argc--; |
| 252 | argv++; |
| 253 | level = parse_show_level (argc, argv); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 254 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 255 | switch (OSPF6_LSA_SCOPE (type)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 256 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 257 | case OSPF6_SCOPE_AREA: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 258 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 259 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 260 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 261 | ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb); |
| 262 | } |
| 263 | break; |
| 264 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 265 | case OSPF6_SCOPE_LINKLOCAL: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 266 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 267 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 268 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 269 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 270 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 271 | oi->interface->name, oa->name, VNL, VNL); |
| 272 | ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb); |
| 273 | } |
| 274 | } |
| 275 | break; |
| 276 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 277 | case OSPF6_SCOPE_AS: |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 278 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 279 | ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb); |
| 280 | break; |
| 281 | |
| 282 | default: |
| 283 | assert (0); |
| 284 | break; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 285 | } |
| 286 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 287 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 288 | return CMD_SUCCESS; |
| 289 | } |
| 290 | |
| 291 | ALIAS (show_ipv6_ospf6_database_type, |
| 292 | show_ipv6_ospf6_database_type_detail_cmd, |
| 293 | "show ipv6 ospf6 database " |
| 294 | "(router|network|inter-prefix|inter-router|as-external|" |
| 295 | "group-membership|type-7|link|intra-prefix) " |
| 296 | "(detail|dump|internal)", |
| 297 | SHOW_STR |
| 298 | IPV6_STR |
| 299 | OSPF6_STR |
| 300 | "Display Link state database\n" |
| 301 | "Display Router LSAs\n" |
| 302 | "Display Network LSAs\n" |
| 303 | "Display Inter-Area-Prefix LSAs\n" |
| 304 | "Display Inter-Area-Router LSAs\n" |
| 305 | "Display As-External LSAs\n" |
| 306 | "Display Group-Membership LSAs\n" |
| 307 | "Display Type-7 LSAs\n" |
| 308 | "Display Link LSAs\n" |
| 309 | "Display Intra-Area-Prefix LSAs\n" |
| 310 | "Display details of LSAs\n" |
| 311 | "Dump LSAs\n" |
| 312 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 313 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 314 | |
| 315 | DEFUN (show_ipv6_ospf6_database_id, |
| 316 | show_ipv6_ospf6_database_id_cmd, |
| 317 | "show ipv6 ospf6 database * A.B.C.D", |
| 318 | SHOW_STR |
| 319 | IPV6_STR |
| 320 | OSPF6_STR |
| 321 | "Display Link state database\n" |
| 322 | "Any Link state Type\n" |
| 323 | "Specify Link state ID as IPv4 address notation\n" |
| 324 | ) |
| 325 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 326 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 327 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 328 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 329 | struct ospf6_area *oa; |
| 330 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 331 | u_int32_t id = 0; |
| 332 | |
| 333 | OSPF6_CMD_CHECK_RUNNING (); |
| 334 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 335 | if ((inet_pton (AF_INET, argv[0], &id)) != 1) |
| 336 | { |
| 337 | vty_out (vty, "Link State ID is not parsable: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 338 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 339 | return CMD_SUCCESS; |
| 340 | } |
| 341 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 342 | argc--; |
| 343 | argv++; |
| 344 | level = parse_show_level (argc, argv); |
| 345 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 346 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 347 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 348 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 349 | ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 350 | } |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 351 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 352 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 353 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 354 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 355 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 356 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 357 | oi->interface->name, oa->name, VNL, VNL); |
| 358 | ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 359 | } |
| 360 | } |
| 361 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 362 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 363 | ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb); |
| 364 | |
| 365 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 366 | return CMD_SUCCESS; |
| 367 | } |
| 368 | |
| 369 | ALIAS (show_ipv6_ospf6_database_id, |
| 370 | show_ipv6_ospf6_database_id_detail_cmd, |
| 371 | "show ipv6 ospf6 database * A.B.C.D " |
| 372 | "(detail|dump|internal)", |
| 373 | SHOW_STR |
| 374 | IPV6_STR |
| 375 | OSPF6_STR |
| 376 | "Display Link state database\n" |
| 377 | "Any Link state Type\n" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 378 | "Specify Link state ID as IPv4 address notation\n" |
| 379 | "Display details of LSAs\n" |
| 380 | "Dump LSAs\n" |
| 381 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 382 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 383 | |
| 384 | ALIAS (show_ipv6_ospf6_database_id, |
| 385 | show_ipv6_ospf6_database_linkstate_id_cmd, |
| 386 | "show ipv6 ospf6 database linkstate-id A.B.C.D", |
| 387 | SHOW_STR |
| 388 | IPV6_STR |
| 389 | OSPF6_STR |
| 390 | "Display Link state database\n" |
| 391 | "Search by Link state ID\n" |
| 392 | "Specify Link state ID as IPv4 address notation\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 393 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 394 | |
| 395 | ALIAS (show_ipv6_ospf6_database_id, |
| 396 | show_ipv6_ospf6_database_linkstate_id_detail_cmd, |
| 397 | "show ipv6 ospf6 database linkstate-id A.B.C.D " |
| 398 | "(detail|dump|internal)", |
| 399 | SHOW_STR |
| 400 | IPV6_STR |
| 401 | OSPF6_STR |
| 402 | "Display Link state database\n" |
| 403 | "Search by Link state ID\n" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 404 | "Specify Link state ID as IPv4 address notation\n" |
| 405 | "Display details of LSAs\n" |
| 406 | "Dump LSAs\n" |
| 407 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 408 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 409 | |
| 410 | DEFUN (show_ipv6_ospf6_database_router, |
| 411 | show_ipv6_ospf6_database_router_cmd, |
| 412 | "show ipv6 ospf6 database * * A.B.C.D", |
| 413 | SHOW_STR |
| 414 | IPV6_STR |
| 415 | OSPF6_STR |
| 416 | "Display Link state database\n" |
| 417 | "Any Link state Type\n" |
| 418 | "Any Link state ID\n" |
| 419 | "Specify Advertising Router as IPv4 address notation\n" |
| 420 | ) |
| 421 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 422 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 423 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 424 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 425 | struct ospf6_area *oa; |
| 426 | struct ospf6_interface *oi; |
| 427 | u_int32_t adv_router = 0; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 428 | |
| 429 | OSPF6_CMD_CHECK_RUNNING (); |
| 430 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 431 | if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 432 | { |
| 433 | vty_out (vty, "Advertising Router is not parsable: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 434 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 435 | return CMD_SUCCESS; |
| 436 | } |
| 437 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 438 | argc--; |
| 439 | argv++; |
| 440 | level = parse_show_level (argc, argv); |
| 441 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 442 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 443 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 444 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 445 | ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 446 | } |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 447 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 448 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 449 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 450 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 451 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 452 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 453 | oi->interface->name, oa->name, VNL, VNL); |
| 454 | ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 455 | } |
| 456 | } |
| 457 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 458 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 459 | ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); |
| 460 | |
| 461 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 462 | return CMD_SUCCESS; |
| 463 | } |
| 464 | |
| 465 | ALIAS (show_ipv6_ospf6_database_router, |
| 466 | show_ipv6_ospf6_database_router_detail_cmd, |
| 467 | "show ipv6 ospf6 database * * A.B.C.D " |
| 468 | "(detail|dump|internal)", |
| 469 | SHOW_STR |
| 470 | IPV6_STR |
| 471 | OSPF6_STR |
| 472 | "Display Link state database\n" |
| 473 | "Any Link state Type\n" |
| 474 | "Any Link state ID\n" |
| 475 | "Specify Advertising Router as IPv4 address notation\n" |
| 476 | "Display details of LSAs\n" |
| 477 | "Dump LSAs\n" |
| 478 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 479 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 480 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 481 | ALIAS (show_ipv6_ospf6_database_router, |
| 482 | show_ipv6_ospf6_database_adv_router_cmd, |
| 483 | "show ipv6 ospf6 database adv-router A.B.C.D", |
| 484 | SHOW_STR |
| 485 | IPV6_STR |
| 486 | OSPF6_STR |
| 487 | "Display Link state database\n" |
| 488 | "Search by Advertising Router\n" |
| 489 | "Specify Advertising Router as IPv4 address notation\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 490 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 491 | |
| 492 | ALIAS (show_ipv6_ospf6_database_router, |
| 493 | show_ipv6_ospf6_database_adv_router_detail_cmd, |
| 494 | "show ipv6 ospf6 database adv-router A.B.C.D " |
| 495 | "(detail|dump|internal)", |
| 496 | SHOW_STR |
| 497 | IPV6_STR |
| 498 | OSPF6_STR |
| 499 | "Display Link state database\n" |
| 500 | "Search by Advertising Router\n" |
| 501 | "Specify Advertising Router as IPv4 address notation\n" |
| 502 | "Display details of LSAs\n" |
| 503 | "Dump LSAs\n" |
| 504 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 505 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 506 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 507 | DEFUN (show_ipv6_ospf6_database_type_id, |
| 508 | show_ipv6_ospf6_database_type_id_cmd, |
| 509 | "show ipv6 ospf6 database " |
| 510 | "(router|network|inter-prefix|inter-router|as-external|" |
| 511 | "group-membership|type-7|link|intra-prefix) A.B.C.D", |
| 512 | SHOW_STR |
| 513 | IPV6_STR |
| 514 | OSPF6_STR |
| 515 | "Display Link state database\n" |
| 516 | "Display Router LSAs\n" |
| 517 | "Display Network LSAs\n" |
| 518 | "Display Inter-Area-Prefix LSAs\n" |
| 519 | "Display Inter-Area-Router LSAs\n" |
| 520 | "Display As-External LSAs\n" |
| 521 | "Display Group-Membership LSAs\n" |
| 522 | "Display Type-7 LSAs\n" |
| 523 | "Display Link LSAs\n" |
| 524 | "Display Intra-Area-Prefix LSAs\n" |
| 525 | "Specify Link state ID as IPv4 address notation\n" |
| 526 | ) |
| 527 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 528 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 529 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 530 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 531 | struct ospf6_area *oa; |
| 532 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 533 | u_int16_t type = 0; |
| 534 | u_int32_t id = 0; |
| 535 | |
| 536 | OSPF6_CMD_CHECK_RUNNING (); |
| 537 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 538 | type = parse_type_spec (argc, argv); |
| 539 | argc--; |
| 540 | argv++; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 541 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 542 | if ((inet_pton (AF_INET, argv[0], &id)) != 1) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 543 | { |
| 544 | vty_out (vty, "Link state ID is not parsable: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 545 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 546 | return CMD_SUCCESS; |
| 547 | } |
| 548 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 549 | argc--; |
| 550 | argv++; |
| 551 | level = parse_show_level (argc, argv); |
| 552 | |
| 553 | switch (OSPF6_LSA_SCOPE (type)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 554 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 555 | case OSPF6_SCOPE_AREA: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 556 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 557 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 558 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 559 | ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb); |
| 560 | } |
| 561 | break; |
| 562 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 563 | case OSPF6_SCOPE_LINKLOCAL: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 564 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 565 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 566 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 567 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 568 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 569 | oi->interface->name, oa->name, VNL, VNL); |
| 570 | ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb); |
| 571 | } |
| 572 | } |
| 573 | break; |
| 574 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 575 | case OSPF6_SCOPE_AS: |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 576 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 577 | ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb); |
| 578 | break; |
| 579 | |
| 580 | default: |
| 581 | assert (0); |
| 582 | break; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 583 | } |
| 584 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 585 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 586 | return CMD_SUCCESS; |
| 587 | } |
| 588 | |
| 589 | ALIAS (show_ipv6_ospf6_database_type_id, |
| 590 | show_ipv6_ospf6_database_type_id_detail_cmd, |
| 591 | "show ipv6 ospf6 database " |
| 592 | "(router|network|inter-prefix|inter-router|as-external|" |
| 593 | "group-membership|type-7|link|intra-prefix) A.B.C.D " |
| 594 | "(detail|dump|internal)", |
| 595 | SHOW_STR |
| 596 | IPV6_STR |
| 597 | OSPF6_STR |
| 598 | "Display Link state database\n" |
| 599 | "Display Router LSAs\n" |
| 600 | "Display Network LSAs\n" |
| 601 | "Display Inter-Area-Prefix LSAs\n" |
| 602 | "Display Inter-Area-Router LSAs\n" |
| 603 | "Display As-External LSAs\n" |
| 604 | "Display Group-Membership LSAs\n" |
| 605 | "Display Type-7 LSAs\n" |
| 606 | "Display Link LSAs\n" |
| 607 | "Display Intra-Area-Prefix LSAs\n" |
| 608 | "Specify Link state ID as IPv4 address notation\n" |
| 609 | "Display details of LSAs\n" |
| 610 | "Dump LSAs\n" |
| 611 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 612 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 613 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 614 | ALIAS (show_ipv6_ospf6_database_type_id, |
| 615 | show_ipv6_ospf6_database_type_linkstate_id_cmd, |
| 616 | "show ipv6 ospf6 database " |
| 617 | "(router|network|inter-prefix|inter-router|as-external|" |
| 618 | "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D", |
| 619 | SHOW_STR |
| 620 | IPV6_STR |
| 621 | OSPF6_STR |
| 622 | "Display Link state database\n" |
| 623 | "Display Router LSAs\n" |
| 624 | "Display Network LSAs\n" |
| 625 | "Display Inter-Area-Prefix LSAs\n" |
| 626 | "Display Inter-Area-Router LSAs\n" |
| 627 | "Display As-External LSAs\n" |
| 628 | "Display Group-Membership LSAs\n" |
| 629 | "Display Type-7 LSAs\n" |
| 630 | "Display Link LSAs\n" |
| 631 | "Display Intra-Area-Prefix LSAs\n" |
| 632 | "Search by Link state ID\n" |
| 633 | "Specify Link state ID as IPv4 address notation\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 634 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 635 | |
| 636 | ALIAS (show_ipv6_ospf6_database_type_id, |
| 637 | show_ipv6_ospf6_database_type_linkstate_id_detail_cmd, |
| 638 | "show ipv6 ospf6 database " |
| 639 | "(router|network|inter-prefix|inter-router|as-external|" |
| 640 | "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D " |
| 641 | "(detail|dump|internal)", |
| 642 | SHOW_STR |
| 643 | IPV6_STR |
| 644 | OSPF6_STR |
| 645 | "Display Link state database\n" |
| 646 | "Display Router LSAs\n" |
| 647 | "Display Network LSAs\n" |
| 648 | "Display Inter-Area-Prefix LSAs\n" |
| 649 | "Display Inter-Area-Router LSAs\n" |
| 650 | "Display As-External LSAs\n" |
| 651 | "Display Group-Membership LSAs\n" |
| 652 | "Display Type-7 LSAs\n" |
| 653 | "Display Link LSAs\n" |
| 654 | "Display Intra-Area-Prefix LSAs\n" |
| 655 | "Search by Link state ID\n" |
| 656 | "Specify Link state ID as IPv4 address notation\n" |
| 657 | "Display details of LSAs\n" |
| 658 | "Dump LSAs\n" |
| 659 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 660 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 661 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 662 | DEFUN (show_ipv6_ospf6_database_type_router, |
| 663 | show_ipv6_ospf6_database_type_router_cmd, |
| 664 | "show ipv6 ospf6 database " |
| 665 | "(router|network|inter-prefix|inter-router|as-external|" |
| 666 | "group-membership|type-7|link|intra-prefix) * A.B.C.D", |
| 667 | SHOW_STR |
| 668 | IPV6_STR |
| 669 | OSPF6_STR |
| 670 | "Display Link state database\n" |
| 671 | "Display Router LSAs\n" |
| 672 | "Display Network LSAs\n" |
| 673 | "Display Inter-Area-Prefix LSAs\n" |
| 674 | "Display Inter-Area-Router LSAs\n" |
| 675 | "Display As-External LSAs\n" |
| 676 | "Display Group-Membership LSAs\n" |
| 677 | "Display Type-7 LSAs\n" |
| 678 | "Display Link LSAs\n" |
| 679 | "Display Intra-Area-Prefix LSAs\n" |
| 680 | "Any Link state ID\n" |
| 681 | "Specify Advertising Router as IPv4 address notation\n" |
| 682 | ) |
| 683 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 684 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 685 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 686 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 687 | struct ospf6_area *oa; |
| 688 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 689 | u_int16_t type = 0; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 690 | u_int32_t adv_router = 0; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 691 | |
| 692 | OSPF6_CMD_CHECK_RUNNING (); |
| 693 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 694 | type = parse_type_spec (argc, argv); |
| 695 | argc--; |
| 696 | argv++; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 697 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 698 | if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 699 | { |
| 700 | vty_out (vty, "Advertising Router is not parsable: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 701 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 702 | return CMD_SUCCESS; |
| 703 | } |
| 704 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 705 | argc--; |
| 706 | argv++; |
| 707 | level = parse_show_level (argc, argv); |
| 708 | |
| 709 | switch (OSPF6_LSA_SCOPE (type)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 710 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 711 | case OSPF6_SCOPE_AREA: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 712 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 713 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 714 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 715 | ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb); |
| 716 | } |
| 717 | break; |
| 718 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 719 | case OSPF6_SCOPE_LINKLOCAL: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 720 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 721 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 722 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 723 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 724 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 725 | oi->interface->name, oa->name, VNL, VNL); |
| 726 | ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb); |
| 727 | } |
| 728 | } |
| 729 | break; |
| 730 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 731 | case OSPF6_SCOPE_AS: |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 732 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 733 | ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb); |
| 734 | break; |
| 735 | |
| 736 | default: |
| 737 | assert (0); |
| 738 | break; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 739 | } |
| 740 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 741 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 742 | return CMD_SUCCESS; |
| 743 | } |
| 744 | |
| 745 | ALIAS (show_ipv6_ospf6_database_type_router, |
| 746 | show_ipv6_ospf6_database_type_router_detail_cmd, |
| 747 | "show ipv6 ospf6 database " |
| 748 | "(router|network|inter-prefix|inter-router|as-external|" |
| 749 | "group-membership|type-7|link|intra-prefix) * A.B.C.D " |
| 750 | "(detail|dump|internal)", |
| 751 | SHOW_STR |
| 752 | IPV6_STR |
| 753 | OSPF6_STR |
| 754 | "Display Link state database\n" |
| 755 | "Display Router LSAs\n" |
| 756 | "Display Network LSAs\n" |
| 757 | "Display Inter-Area-Prefix LSAs\n" |
| 758 | "Display Inter-Area-Router LSAs\n" |
| 759 | "Display As-External LSAs\n" |
| 760 | "Display Group-Membership LSAs\n" |
| 761 | "Display Type-7 LSAs\n" |
| 762 | "Display Link LSAs\n" |
| 763 | "Display Intra-Area-Prefix LSAs\n" |
| 764 | "Any Link state ID\n" |
| 765 | "Specify Advertising Router as IPv4 address notation\n" |
| 766 | "Display details of LSAs\n" |
| 767 | "Dump LSAs\n" |
| 768 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 769 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 770 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 771 | ALIAS (show_ipv6_ospf6_database_type_router, |
| 772 | show_ipv6_ospf6_database_type_adv_router_cmd, |
| 773 | "show ipv6 ospf6 database " |
| 774 | "(router|network|inter-prefix|inter-router|as-external|" |
| 775 | "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D", |
| 776 | SHOW_STR |
| 777 | IPV6_STR |
| 778 | OSPF6_STR |
| 779 | "Display Link state database\n" |
| 780 | "Display Router LSAs\n" |
| 781 | "Display Network LSAs\n" |
| 782 | "Display Inter-Area-Prefix LSAs\n" |
| 783 | "Display Inter-Area-Router LSAs\n" |
| 784 | "Display As-External LSAs\n" |
| 785 | "Display Group-Membership LSAs\n" |
| 786 | "Display Type-7 LSAs\n" |
| 787 | "Display Link LSAs\n" |
| 788 | "Display Intra-Area-Prefix LSAs\n" |
| 789 | "Search by Advertising Router\n" |
| 790 | "Specify Advertising Router as IPv4 address notation\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 791 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 792 | |
| 793 | ALIAS (show_ipv6_ospf6_database_type_router, |
| 794 | show_ipv6_ospf6_database_type_adv_router_detail_cmd, |
| 795 | "show ipv6 ospf6 database " |
| 796 | "(router|network|inter-prefix|inter-router|as-external|" |
| 797 | "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D " |
| 798 | "(detail|dump|internal)", |
| 799 | SHOW_STR |
| 800 | IPV6_STR |
| 801 | OSPF6_STR |
| 802 | "Display Link state database\n" |
| 803 | "Display Router LSAs\n" |
| 804 | "Display Network LSAs\n" |
| 805 | "Display Inter-Area-Prefix LSAs\n" |
| 806 | "Display Inter-Area-Router LSAs\n" |
| 807 | "Display As-External LSAs\n" |
| 808 | "Display Group-Membership LSAs\n" |
| 809 | "Display Type-7 LSAs\n" |
| 810 | "Display Link LSAs\n" |
| 811 | "Display Intra-Area-Prefix LSAs\n" |
| 812 | "Search by Advertising Router\n" |
| 813 | "Specify Advertising Router as IPv4 address notation\n" |
| 814 | "Display details of LSAs\n" |
| 815 | "Dump LSAs\n" |
| 816 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 817 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 818 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 819 | DEFUN (show_ipv6_ospf6_database_id_router, |
| 820 | show_ipv6_ospf6_database_id_router_cmd, |
| 821 | "show ipv6 ospf6 database * A.B.C.D A.B.C.D", |
| 822 | SHOW_STR |
| 823 | IPV6_STR |
| 824 | OSPF6_STR |
| 825 | "Display Link state database\n" |
| 826 | "Any Link state Type\n" |
| 827 | "Specify Link state ID as IPv4 address notation\n" |
| 828 | "Specify Advertising Router as IPv4 address notation\n" |
| 829 | ) |
| 830 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 831 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 832 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 833 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 834 | struct ospf6_area *oa; |
| 835 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 836 | u_int32_t id = 0; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 837 | u_int32_t adv_router = 0; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 838 | |
| 839 | OSPF6_CMD_CHECK_RUNNING (); |
| 840 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 841 | if ((inet_pton (AF_INET, argv[0], &id)) != 1) |
| 842 | { |
| 843 | vty_out (vty, "Link state ID is not parsable: %s%s", |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 844 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 845 | return CMD_SUCCESS; |
| 846 | } |
| 847 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 848 | argc--; |
| 849 | argv++; |
| 850 | |
| 851 | if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 852 | { |
| 853 | vty_out (vty, "Advertising Router is not parsable: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 854 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 855 | return CMD_SUCCESS; |
| 856 | } |
| 857 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 858 | argc--; |
| 859 | argv++; |
| 860 | level = parse_show_level (argc, argv); |
| 861 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 862 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 863 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 864 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 865 | ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 866 | } |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 867 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 868 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 869 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 870 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 871 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 872 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 873 | oi->interface->name, oa->name, VNL, VNL); |
| 874 | ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 875 | } |
| 876 | } |
| 877 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 878 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 879 | ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); |
| 880 | |
| 881 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 882 | return CMD_SUCCESS; |
| 883 | } |
| 884 | |
| 885 | ALIAS (show_ipv6_ospf6_database_id_router, |
| 886 | show_ipv6_ospf6_database_id_router_detail_cmd, |
| 887 | "show ipv6 ospf6 database * A.B.C.D A.B.C.D " |
| 888 | "(detail|dump|internal)", |
| 889 | SHOW_STR |
| 890 | IPV6_STR |
| 891 | OSPF6_STR |
| 892 | "Display Link state database\n" |
| 893 | "Any Link state Type\n" |
| 894 | "Specify Link state ID as IPv4 address notation\n" |
| 895 | "Specify Advertising Router as IPv4 address notation\n" |
| 896 | "Display details of LSAs\n" |
| 897 | "Dump LSAs\n" |
| 898 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 899 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 900 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 901 | DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id, |
| 902 | show_ipv6_ospf6_database_adv_router_linkstate_id_cmd, |
| 903 | "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D", |
| 904 | SHOW_STR |
| 905 | IPV6_STR |
| 906 | OSPF6_STR |
| 907 | "Display Link state database\n" |
| 908 | "Search by Advertising Router\n" |
| 909 | "Specify Advertising Router as IPv4 address notation\n" |
| 910 | "Search by Link state ID\n" |
| 911 | "Specify Link state ID as IPv4 address notation\n" |
| 912 | ) |
| 913 | { |
| 914 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 915 | struct listnode *i, *j; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 916 | struct ospf6 *o = ospf6; |
| 917 | struct ospf6_area *oa; |
| 918 | struct ospf6_interface *oi; |
| 919 | u_int32_t id = 0; |
| 920 | u_int32_t adv_router = 0; |
| 921 | |
| 922 | OSPF6_CMD_CHECK_RUNNING (); |
| 923 | |
| 924 | if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) |
| 925 | { |
| 926 | vty_out (vty, "Advertising Router is not parsable: %s%s", |
| 927 | argv[0], VNL); |
| 928 | return CMD_SUCCESS; |
| 929 | } |
| 930 | |
| 931 | argc--; |
| 932 | argv++; |
| 933 | |
| 934 | if ((inet_pton (AF_INET, argv[0], &id)) != 1) |
| 935 | { |
| 936 | vty_out (vty, "Link state ID is not parsable: %s%s", |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 937 | argv[0], VNL); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 938 | return CMD_SUCCESS; |
| 939 | } |
| 940 | |
| 941 | argc--; |
| 942 | argv++; |
| 943 | level = parse_show_level (argc, argv); |
| 944 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 945 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 946 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 947 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 948 | ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb); |
| 949 | } |
| 950 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 951 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 952 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 953 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 954 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 955 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 956 | oi->interface->name, oa->name, VNL, VNL); |
| 957 | ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb); |
| 958 | } |
| 959 | } |
| 960 | |
| 961 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 962 | ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb); |
| 963 | |
| 964 | vty_out (vty, "%s", VNL); |
| 965 | return CMD_SUCCESS; |
| 966 | } |
| 967 | |
| 968 | ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id, |
| 969 | show_ipv6_ospf6_database_adv_router_linkstate_id_detail_cmd, |
| 970 | "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D " |
| 971 | "(detail|dump|internal)", |
| 972 | SHOW_STR |
| 973 | IPV6_STR |
| 974 | OSPF6_STR |
| 975 | "Display Link state database\n" |
| 976 | "Search by Advertising Router\n" |
| 977 | "Specify Advertising Router as IPv4 address notation\n" |
| 978 | "Search by Link state ID\n" |
| 979 | "Specify Link state ID as IPv4 address notation\n" |
| 980 | "Display details of LSAs\n" |
| 981 | "Dump LSAs\n" |
| 982 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 983 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 984 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 985 | DEFUN (show_ipv6_ospf6_database_type_id_router, |
| 986 | show_ipv6_ospf6_database_type_id_router_cmd, |
| 987 | "show ipv6 ospf6 database " |
| 988 | "(router|network|inter-prefix|inter-router|as-external|" |
| 989 | "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D", |
| 990 | SHOW_STR |
| 991 | IPV6_STR |
| 992 | OSPF6_STR |
| 993 | "Display Link state database\n" |
| 994 | "Display Router LSAs\n" |
| 995 | "Display Network LSAs\n" |
| 996 | "Display Inter-Area-Prefix LSAs\n" |
| 997 | "Display Inter-Area-Router LSAs\n" |
| 998 | "Display As-External LSAs\n" |
| 999 | "Display Group-Membership LSAs\n" |
| 1000 | "Display Type-7 LSAs\n" |
| 1001 | "Display Link LSAs\n" |
| 1002 | "Display Intra-Area-Prefix LSAs\n" |
| 1003 | "Specify Link state ID as IPv4 address notation\n" |
| 1004 | "Specify Advertising Router as IPv4 address notation\n" |
| 1005 | ) |
| 1006 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1007 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1008 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1009 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1010 | struct ospf6_area *oa; |
| 1011 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1012 | u_int16_t type = 0; |
| 1013 | u_int32_t id = 0; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1014 | u_int32_t adv_router = 0; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1015 | |
| 1016 | OSPF6_CMD_CHECK_RUNNING (); |
| 1017 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1018 | type = parse_type_spec (argc, argv); |
| 1019 | argc--; |
| 1020 | argv++; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1021 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1022 | if ((inet_pton (AF_INET, argv[0], &id)) != 1) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1023 | { |
| 1024 | vty_out (vty, "Link state ID is not parsable: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1025 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1026 | return CMD_SUCCESS; |
| 1027 | } |
| 1028 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1029 | argc--; |
| 1030 | argv++; |
| 1031 | |
| 1032 | if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1033 | { |
| 1034 | vty_out (vty, "Advertising Router is not parsable: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1035 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1036 | return CMD_SUCCESS; |
| 1037 | } |
| 1038 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1039 | argc--; |
| 1040 | argv++; |
| 1041 | level = parse_show_level (argc, argv); |
| 1042 | |
| 1043 | switch (OSPF6_LSA_SCOPE (type)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1044 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1045 | case OSPF6_SCOPE_AREA: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1046 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1047 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1048 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 1049 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); |
| 1050 | } |
| 1051 | break; |
| 1052 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1053 | case OSPF6_SCOPE_LINKLOCAL: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1054 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1055 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1056 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1057 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1058 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 1059 | oi->interface->name, oa->name, VNL, VNL); |
| 1060 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); |
| 1061 | } |
| 1062 | } |
| 1063 | break; |
| 1064 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1065 | case OSPF6_SCOPE_AS: |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1066 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 1067 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); |
| 1068 | break; |
| 1069 | |
| 1070 | default: |
| 1071 | assert (0); |
| 1072 | break; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1073 | } |
| 1074 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1075 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1076 | return CMD_SUCCESS; |
| 1077 | } |
| 1078 | |
| 1079 | ALIAS (show_ipv6_ospf6_database_type_id_router, |
| 1080 | show_ipv6_ospf6_database_type_id_router_detail_cmd, |
| 1081 | "show ipv6 ospf6 database " |
| 1082 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1083 | "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D " |
| 1084 | "(dump|internal)", |
| 1085 | SHOW_STR |
| 1086 | IPV6_STR |
| 1087 | OSPF6_STR |
| 1088 | "Display Link state database\n" |
| 1089 | "Display Router LSAs\n" |
| 1090 | "Display Network LSAs\n" |
| 1091 | "Display Inter-Area-Prefix LSAs\n" |
| 1092 | "Display Inter-Area-Router LSAs\n" |
| 1093 | "Display As-External LSAs\n" |
| 1094 | "Display Group-Membership LSAs\n" |
| 1095 | "Display Type-7 LSAs\n" |
| 1096 | "Display Link LSAs\n" |
| 1097 | "Display Intra-Area-Prefix LSAs\n" |
| 1098 | "Specify Link state ID as IPv4 address notation\n" |
| 1099 | "Specify Advertising Router as IPv4 address notation\n" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1100 | "Dump LSAs\n" |
| 1101 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1102 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1103 | |
| 1104 | DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id, |
| 1105 | show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd, |
| 1106 | "show ipv6 ospf6 database " |
| 1107 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1108 | "group-membership|type-7|link|intra-prefix) " |
| 1109 | "adv-router A.B.C.D linkstate-id A.B.C.D", |
| 1110 | SHOW_STR |
| 1111 | IPV6_STR |
| 1112 | OSPF6_STR |
| 1113 | "Display Link state database\n" |
| 1114 | "Display Router LSAs\n" |
| 1115 | "Display Network LSAs\n" |
| 1116 | "Display Inter-Area-Prefix LSAs\n" |
| 1117 | "Display Inter-Area-Router LSAs\n" |
| 1118 | "Display As-External LSAs\n" |
| 1119 | "Display Group-Membership LSAs\n" |
| 1120 | "Display Type-7 LSAs\n" |
| 1121 | "Display Link LSAs\n" |
| 1122 | "Display Intra-Area-Prefix LSAs\n" |
| 1123 | "Search by Advertising Router\n" |
| 1124 | "Specify Advertising Router as IPv4 address notation\n" |
| 1125 | "Search by Link state ID\n" |
| 1126 | "Specify Link state ID as IPv4 address notation\n" |
| 1127 | ) |
| 1128 | { |
| 1129 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1130 | struct listnode *i, *j; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1131 | struct ospf6 *o = ospf6; |
| 1132 | struct ospf6_area *oa; |
| 1133 | struct ospf6_interface *oi; |
| 1134 | u_int16_t type = 0; |
| 1135 | u_int32_t id = 0; |
| 1136 | u_int32_t adv_router = 0; |
| 1137 | |
| 1138 | OSPF6_CMD_CHECK_RUNNING (); |
| 1139 | |
| 1140 | type = parse_type_spec (argc, argv); |
| 1141 | argc--; |
| 1142 | argv++; |
| 1143 | |
| 1144 | if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) |
| 1145 | { |
| 1146 | vty_out (vty, "Advertising Router is not parsable: %s%s", |
| 1147 | argv[0], VNL); |
| 1148 | return CMD_SUCCESS; |
| 1149 | } |
| 1150 | |
| 1151 | argc--; |
| 1152 | argv++; |
| 1153 | |
| 1154 | if ((inet_pton (AF_INET, argv[0], &id)) != 1) |
| 1155 | { |
| 1156 | vty_out (vty, "Link state ID is not parsable: %s%s", |
| 1157 | argv[0], VNL); |
| 1158 | return CMD_SUCCESS; |
| 1159 | } |
| 1160 | |
| 1161 | argc--; |
| 1162 | argv++; |
| 1163 | level = parse_show_level (argc, argv); |
| 1164 | |
| 1165 | switch (OSPF6_LSA_SCOPE (type)) |
| 1166 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1167 | case OSPF6_SCOPE_AREA: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1168 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1169 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1170 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 1171 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); |
| 1172 | } |
| 1173 | break; |
| 1174 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1175 | case OSPF6_SCOPE_LINKLOCAL: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1176 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1177 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1178 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1179 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1180 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 1181 | oi->interface->name, oa->name, VNL, VNL); |
| 1182 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); |
| 1183 | } |
| 1184 | } |
| 1185 | break; |
| 1186 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1187 | case OSPF6_SCOPE_AS: |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1188 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 1189 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); |
| 1190 | break; |
| 1191 | |
| 1192 | default: |
| 1193 | assert (0); |
| 1194 | break; |
| 1195 | } |
| 1196 | |
| 1197 | vty_out (vty, "%s", VNL); |
| 1198 | return CMD_SUCCESS; |
| 1199 | } |
| 1200 | |
| 1201 | ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id, |
| 1202 | show_ipv6_ospf6_database_type_adv_router_linkstate_id_detail_cmd, |
| 1203 | "show ipv6 ospf6 database " |
| 1204 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1205 | "group-membership|type-7|link|intra-prefix) " |
| 1206 | "adv-router A.B.C.D linkstate-id A.B.C.D " |
| 1207 | "(dump|internal)", |
| 1208 | SHOW_STR |
| 1209 | IPV6_STR |
| 1210 | OSPF6_STR |
| 1211 | "Display Link state database\n" |
| 1212 | "Display Router LSAs\n" |
| 1213 | "Display Network LSAs\n" |
| 1214 | "Display Inter-Area-Prefix LSAs\n" |
| 1215 | "Display Inter-Area-Router LSAs\n" |
| 1216 | "Display As-External LSAs\n" |
| 1217 | "Display Group-Membership LSAs\n" |
| 1218 | "Display Type-7 LSAs\n" |
| 1219 | "Display Link LSAs\n" |
| 1220 | "Display Intra-Area-Prefix LSAs\n" |
| 1221 | "Search by Advertising Router\n" |
| 1222 | "Specify Advertising Router as IPv4 address notation\n" |
| 1223 | "Search by Link state ID\n" |
| 1224 | "Specify Link state ID as IPv4 address notation\n" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1225 | "Dump LSAs\n" |
| 1226 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1227 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1228 | |
| 1229 | DEFUN (show_ipv6_ospf6_database_self_originated, |
| 1230 | show_ipv6_ospf6_database_self_originated_cmd, |
| 1231 | "show ipv6 ospf6 database self-originated", |
| 1232 | SHOW_STR |
| 1233 | IPV6_STR |
| 1234 | OSPF6_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1235 | "Display Self-originated LSAs\n" |
| 1236 | ) |
| 1237 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1238 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1239 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1240 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1241 | struct ospf6_area *oa; |
| 1242 | struct ospf6_interface *oi; |
| 1243 | u_int32_t adv_router = 0; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1244 | |
| 1245 | OSPF6_CMD_CHECK_RUNNING (); |
| 1246 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1247 | level = parse_show_level (argc, argv); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1248 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1249 | adv_router = o->router_id; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1250 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1251 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1252 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1253 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 1254 | ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1255 | } |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1256 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1257 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1258 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1259 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1260 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1261 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 1262 | oi->interface->name, oa->name, VNL, VNL); |
| 1263 | ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1264 | } |
| 1265 | } |
| 1266 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1267 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 1268 | ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb); |
| 1269 | |
| 1270 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1271 | return CMD_SUCCESS; |
| 1272 | } |
| 1273 | |
| 1274 | ALIAS (show_ipv6_ospf6_database_self_originated, |
| 1275 | show_ipv6_ospf6_database_self_originated_detail_cmd, |
| 1276 | "show ipv6 ospf6 database self-originated " |
| 1277 | "(detail|dump|internal)", |
| 1278 | SHOW_STR |
| 1279 | IPV6_STR |
| 1280 | OSPF6_STR |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1281 | "Display Self-originated LSAs\n" |
| 1282 | "Display details of LSAs\n" |
| 1283 | "Dump LSAs\n" |
| 1284 | "Display LSA's internal information\n" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1285 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1286 | |
| 1287 | DEFUN (show_ipv6_ospf6_database_type_self_originated, |
| 1288 | show_ipv6_ospf6_database_type_self_originated_cmd, |
| 1289 | "show ipv6 ospf6 database " |
| 1290 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1291 | "group-membership|type-7|link|intra-prefix) self-originated", |
| 1292 | SHOW_STR |
| 1293 | IPV6_STR |
| 1294 | OSPF6_STR |
| 1295 | "Display Link state database\n" |
| 1296 | "Display Router LSAs\n" |
| 1297 | "Display Network LSAs\n" |
| 1298 | "Display Inter-Area-Prefix LSAs\n" |
| 1299 | "Display Inter-Area-Router LSAs\n" |
| 1300 | "Display As-External LSAs\n" |
| 1301 | "Display Group-Membership LSAs\n" |
| 1302 | "Display Type-7 LSAs\n" |
| 1303 | "Display Link LSAs\n" |
| 1304 | "Display Intra-Area-Prefix LSAs\n" |
| 1305 | "Display Self-originated LSAs\n" |
| 1306 | ) |
| 1307 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1308 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1309 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1310 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1311 | struct ospf6_area *oa; |
| 1312 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1313 | u_int16_t type = 0; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1314 | u_int32_t adv_router = 0; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1315 | |
| 1316 | OSPF6_CMD_CHECK_RUNNING (); |
| 1317 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1318 | type = parse_type_spec (argc, argv); |
| 1319 | argc--; |
| 1320 | argv++; |
| 1321 | level = parse_show_level (argc, argv); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1322 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1323 | adv_router = o->router_id; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1324 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1325 | switch (OSPF6_LSA_SCOPE (type)) |
| 1326 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1327 | case OSPF6_SCOPE_AREA: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1328 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1329 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1330 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 1331 | ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb); |
| 1332 | } |
| 1333 | break; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1334 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1335 | case OSPF6_SCOPE_LINKLOCAL: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1336 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1337 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1338 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1339 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1340 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 1341 | oi->interface->name, oa->name, VNL, VNL); |
| 1342 | ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb); |
| 1343 | } |
| 1344 | } |
| 1345 | break; |
| 1346 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1347 | case OSPF6_SCOPE_AS: |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1348 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 1349 | ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb); |
| 1350 | break; |
| 1351 | |
| 1352 | default: |
| 1353 | assert (0); |
| 1354 | break; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1355 | } |
| 1356 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1357 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1358 | return CMD_SUCCESS; |
| 1359 | } |
| 1360 | |
| 1361 | ALIAS (show_ipv6_ospf6_database_type_self_originated, |
| 1362 | show_ipv6_ospf6_database_type_self_originated_detail_cmd, |
| 1363 | "show ipv6 ospf6 database " |
| 1364 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1365 | "group-membership|type-7|link|intra-prefix) self-originated " |
| 1366 | "(detail|dump|internal)", |
| 1367 | SHOW_STR |
| 1368 | IPV6_STR |
| 1369 | OSPF6_STR |
| 1370 | "Display Link state database\n" |
| 1371 | "Display Router LSAs\n" |
| 1372 | "Display Network LSAs\n" |
| 1373 | "Display Inter-Area-Prefix LSAs\n" |
| 1374 | "Display Inter-Area-Router LSAs\n" |
| 1375 | "Display As-External LSAs\n" |
| 1376 | "Display Group-Membership LSAs\n" |
| 1377 | "Display Type-7 LSAs\n" |
| 1378 | "Display Link LSAs\n" |
| 1379 | "Display Intra-Area-Prefix LSAs\n" |
| 1380 | "Display Self-originated LSAs\n" |
| 1381 | "Display details of LSAs\n" |
| 1382 | "Dump LSAs\n" |
| 1383 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1384 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1385 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1386 | DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id, |
| 1387 | show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd, |
| 1388 | "show ipv6 ospf6 database " |
| 1389 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1390 | "group-membership|type-7|link|intra-prefix) self-originated " |
| 1391 | "linkstate-id A.B.C.D", |
| 1392 | SHOW_STR |
| 1393 | IPV6_STR |
| 1394 | OSPF6_STR |
| 1395 | "Display Link state database\n" |
| 1396 | "Display Router LSAs\n" |
| 1397 | "Display Network LSAs\n" |
| 1398 | "Display Inter-Area-Prefix LSAs\n" |
| 1399 | "Display Inter-Area-Router LSAs\n" |
| 1400 | "Display As-External LSAs\n" |
| 1401 | "Display Group-Membership LSAs\n" |
| 1402 | "Display Type-7 LSAs\n" |
| 1403 | "Display Link LSAs\n" |
| 1404 | "Display Intra-Area-Prefix LSAs\n" |
| 1405 | "Display Self-originated LSAs\n" |
| 1406 | "Search by Link state ID\n" |
| 1407 | "Specify Link state ID as IPv4 address notation\n" |
| 1408 | ) |
| 1409 | { |
| 1410 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1411 | struct listnode *i, *j; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1412 | struct ospf6 *o = ospf6; |
| 1413 | struct ospf6_area *oa; |
| 1414 | struct ospf6_interface *oi; |
| 1415 | u_int16_t type = 0; |
| 1416 | u_int32_t adv_router = 0; |
| 1417 | u_int32_t id = 0; |
| 1418 | |
| 1419 | OSPF6_CMD_CHECK_RUNNING (); |
| 1420 | |
| 1421 | type = parse_type_spec (argc, argv); |
| 1422 | argc--; |
| 1423 | argv++; |
| 1424 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1425 | if ((inet_pton (AF_INET, argv[0], &id)) != 1) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1426 | { |
| 1427 | vty_out (vty, "Link State ID is not parsable: %s%s", |
| 1428 | argv[0], VNL); |
| 1429 | return CMD_SUCCESS; |
| 1430 | } |
| 1431 | |
| 1432 | argc--; |
| 1433 | argv++; |
| 1434 | level = parse_show_level (argc, argv); |
| 1435 | |
| 1436 | adv_router = o->router_id; |
| 1437 | |
| 1438 | switch (OSPF6_LSA_SCOPE (type)) |
| 1439 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1440 | case OSPF6_SCOPE_AREA: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1441 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1442 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1443 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 1444 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); |
| 1445 | } |
| 1446 | break; |
| 1447 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1448 | case OSPF6_SCOPE_LINKLOCAL: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1449 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1450 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1451 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1452 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1453 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 1454 | oi->interface->name, oa->name, VNL, VNL); |
| 1455 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); |
| 1456 | } |
| 1457 | } |
| 1458 | break; |
| 1459 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1460 | case OSPF6_SCOPE_AS: |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1461 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 1462 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); |
| 1463 | break; |
| 1464 | |
| 1465 | default: |
| 1466 | assert (0); |
| 1467 | break; |
| 1468 | } |
| 1469 | |
| 1470 | vty_out (vty, "%s", VNL); |
| 1471 | return CMD_SUCCESS; |
| 1472 | } |
| 1473 | |
| 1474 | ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id, |
| 1475 | show_ipv6_ospf6_database_type_self_originated_linkstate_id_detail_cmd, |
| 1476 | "show ipv6 ospf6 database " |
| 1477 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1478 | "group-membership|type-7|link|intra-prefix) self-originated " |
| 1479 | "linkstate-id A.B.C.D (detail|dump|internal)", |
| 1480 | SHOW_STR |
| 1481 | IPV6_STR |
| 1482 | OSPF6_STR |
| 1483 | "Display Link state database\n" |
| 1484 | "Display Router LSAs\n" |
| 1485 | "Display Network LSAs\n" |
| 1486 | "Display Inter-Area-Prefix LSAs\n" |
| 1487 | "Display Inter-Area-Router LSAs\n" |
| 1488 | "Display As-External LSAs\n" |
| 1489 | "Display Group-Membership LSAs\n" |
| 1490 | "Display Type-7 LSAs\n" |
| 1491 | "Display Link LSAs\n" |
| 1492 | "Display Intra-Area-Prefix LSAs\n" |
| 1493 | "Display Self-originated LSAs\n" |
| 1494 | "Search by Link state ID\n" |
| 1495 | "Specify Link state ID as IPv4 address notation\n" |
| 1496 | "Display details of LSAs\n" |
| 1497 | "Dump LSAs\n" |
| 1498 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1499 | ) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1500 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1501 | DEFUN (show_ipv6_ospf6_database_type_id_self_originated, |
| 1502 | show_ipv6_ospf6_database_type_id_self_originated_cmd, |
| 1503 | "show ipv6 ospf6 database " |
| 1504 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1505 | "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated", |
| 1506 | SHOW_STR |
| 1507 | IPV6_STR |
| 1508 | OSPF6_STR |
| 1509 | "Display Link state database\n" |
| 1510 | "Display Router LSAs\n" |
| 1511 | "Display Network LSAs\n" |
| 1512 | "Display Inter-Area-Prefix LSAs\n" |
| 1513 | "Display Inter-Area-Router LSAs\n" |
| 1514 | "Display As-External LSAs\n" |
| 1515 | "Display Group-Membership LSAs\n" |
| 1516 | "Display Type-7 LSAs\n" |
| 1517 | "Display Link LSAs\n" |
| 1518 | "Display Intra-Area-Prefix LSAs\n" |
| 1519 | "Specify Link state ID as IPv4 address notation\n" |
| 1520 | "Display Self-originated LSAs\n" |
| 1521 | ) |
| 1522 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1523 | int level; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1524 | struct listnode *i, *j; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1525 | struct ospf6 *o = ospf6; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1526 | struct ospf6_area *oa; |
| 1527 | struct ospf6_interface *oi; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1528 | u_int16_t type = 0; |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1529 | u_int32_t adv_router = 0; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1530 | u_int32_t id = 0; |
| 1531 | |
| 1532 | OSPF6_CMD_CHECK_RUNNING (); |
| 1533 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1534 | type = parse_type_spec (argc, argv); |
| 1535 | argc--; |
| 1536 | argv++; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1537 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1538 | if ((inet_pton (AF_INET, argv[0], &id)) != 1) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1539 | { |
| 1540 | vty_out (vty, "Link State ID is not parsable: %s%s", |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1541 | argv[0], VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1542 | return CMD_SUCCESS; |
| 1543 | } |
| 1544 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1545 | argc--; |
| 1546 | argv++; |
| 1547 | level = parse_show_level (argc, argv); |
| 1548 | |
| 1549 | adv_router = o->router_id; |
| 1550 | |
| 1551 | switch (OSPF6_LSA_SCOPE (type)) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1552 | { |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1553 | case OSPF6_SCOPE_AREA: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1554 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1555 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1556 | vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL); |
| 1557 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb); |
| 1558 | } |
| 1559 | break; |
| 1560 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1561 | case OSPF6_SCOPE_LINKLOCAL: |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1562 | for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1563 | { |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1564 | for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi)) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1565 | { |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1566 | vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL, |
| 1567 | oi->interface->name, oa->name, VNL, VNL); |
| 1568 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb); |
| 1569 | } |
| 1570 | } |
| 1571 | break; |
| 1572 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1573 | case OSPF6_SCOPE_AS: |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1574 | vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL); |
| 1575 | ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb); |
| 1576 | break; |
| 1577 | |
| 1578 | default: |
| 1579 | assert (0); |
| 1580 | break; |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1581 | } |
| 1582 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1583 | vty_out (vty, "%s", VNL); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1584 | return CMD_SUCCESS; |
| 1585 | } |
| 1586 | |
| 1587 | ALIAS (show_ipv6_ospf6_database_type_id_self_originated, |
| 1588 | show_ipv6_ospf6_database_type_id_self_originated_detail_cmd, |
| 1589 | "show ipv6 ospf6 database " |
| 1590 | "(router|network|inter-prefix|inter-router|as-external|" |
| 1591 | "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated " |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1592 | "(detail|dump|internal)", |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1593 | SHOW_STR |
| 1594 | IPV6_STR |
| 1595 | OSPF6_STR |
| 1596 | "Display Link state database\n" |
| 1597 | "Display Router LSAs\n" |
| 1598 | "Display Network LSAs\n" |
| 1599 | "Display Inter-Area-Prefix LSAs\n" |
| 1600 | "Display Inter-Area-Router LSAs\n" |
| 1601 | "Display As-External LSAs\n" |
| 1602 | "Display Group-Membership LSAs\n" |
| 1603 | "Display Type-7 LSAs\n" |
| 1604 | "Display Link LSAs\n" |
| 1605 | "Display Intra-Area-Prefix LSAs\n" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1606 | "Display Self-originated LSAs\n" |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1607 | "Search by Link state ID\n" |
| 1608 | "Specify Link state ID as IPv4 address notation\n" |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1609 | "Display details of LSAs\n" |
| 1610 | "Dump LSAs\n" |
| 1611 | "Display LSA's internal information\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1612 | ) |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1613 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1614 | |
| 1615 | DEFUN (show_ipv6_ospf6_border_routers, |
| 1616 | show_ipv6_ospf6_border_routers_cmd, |
| 1617 | "show ipv6 ospf6 border-routers", |
| 1618 | SHOW_STR |
| 1619 | IP6_STR |
| 1620 | OSPF6_STR |
| 1621 | "Display routing table for ABR and ASBR\n" |
| 1622 | ) |
| 1623 | { |
| 1624 | u_int32_t adv_router; |
| 1625 | void (*showfunc) (struct vty *, struct ospf6_route *); |
| 1626 | struct ospf6_route *ro; |
| 1627 | struct prefix prefix; |
| 1628 | |
| 1629 | OSPF6_CMD_CHECK_RUNNING (); |
| 1630 | |
| 1631 | if (argc && ! strcmp ("detail", argv[0])) |
| 1632 | { |
| 1633 | showfunc = ospf6_route_show_detail; |
| 1634 | argc--; |
| 1635 | argv++; |
| 1636 | } |
| 1637 | else |
| 1638 | showfunc = ospf6_brouter_show; |
| 1639 | |
| 1640 | if (argc) |
| 1641 | { |
| 1642 | if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1) |
| 1643 | { |
| 1644 | vty_out (vty, "Router ID is not parsable: %s%s", argv[0], VNL); |
| 1645 | return CMD_SUCCESS; |
| 1646 | } |
| 1647 | |
| 1648 | ospf6_linkstate_prefix (adv_router, 0, &prefix); |
| 1649 | ro = ospf6_route_lookup (&prefix, ospf6->brouter_table); |
Jon | 597fa7c | 2009-02-11 17:27:06 -0800 | [diff] [blame] | 1650 | if (!ro) |
| 1651 | { |
| 1652 | vty_out (vty, "No Route found for Router ID: %s%s", argv[0], VNL); |
| 1653 | return CMD_SUCCESS; |
| 1654 | } |
| 1655 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1656 | ospf6_route_show_detail (vty, ro); |
| 1657 | return CMD_SUCCESS; |
| 1658 | } |
| 1659 | |
| 1660 | if (showfunc == ospf6_brouter_show) |
| 1661 | ospf6_brouter_show_header (vty); |
| 1662 | |
| 1663 | for (ro = ospf6_route_head (ospf6->brouter_table); ro; |
| 1664 | ro = ospf6_route_next (ro)) |
| 1665 | (*showfunc) (vty, ro); |
| 1666 | |
| 1667 | return CMD_SUCCESS; |
| 1668 | } |
| 1669 | |
| 1670 | ALIAS (show_ipv6_ospf6_border_routers, |
| 1671 | show_ipv6_ospf6_border_routers_detail_cmd, |
| 1672 | "show ipv6 ospf6 border-routers (A.B.C.D|detail)", |
| 1673 | SHOW_STR |
| 1674 | IP6_STR |
| 1675 | OSPF6_STR |
| 1676 | "Display routing table for ABR and ASBR\n" |
| 1677 | "Specify Router-ID\n" |
| 1678 | "Display Detail\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1679 | ) |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1680 | |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1681 | DEFUN (show_ipv6_ospf6_linkstate, |
| 1682 | show_ipv6_ospf6_linkstate_cmd, |
| 1683 | "show ipv6 ospf6 linkstate", |
| 1684 | SHOW_STR |
| 1685 | IP6_STR |
| 1686 | OSPF6_STR |
| 1687 | "Display linkstate routing table\n" |
| 1688 | ) |
| 1689 | { |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1690 | struct listnode *node; |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1691 | struct ospf6_area *oa; |
| 1692 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1693 | for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1694 | { |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1695 | vty_out (vty, "%s SPF Result in Area %s%s%s", |
| 1696 | VNL, oa->name, VNL, VNL); |
| 1697 | ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table); |
| 1698 | } |
| 1699 | |
| 1700 | vty_out (vty, "%s", VNL); |
| 1701 | return CMD_SUCCESS; |
| 1702 | } |
| 1703 | |
| 1704 | ALIAS (show_ipv6_ospf6_linkstate, |
| 1705 | show_ipv6_ospf6_linkstate_router_cmd, |
| 1706 | "show ipv6 ospf6 linkstate router A.B.C.D", |
| 1707 | SHOW_STR |
| 1708 | IP6_STR |
| 1709 | OSPF6_STR |
| 1710 | "Display linkstate routing table\n" |
| 1711 | "Display Router Entry\n" |
| 1712 | "Specify Router ID as IPv4 address notation\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1713 | ) |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1714 | |
| 1715 | ALIAS (show_ipv6_ospf6_linkstate, |
| 1716 | show_ipv6_ospf6_linkstate_network_cmd, |
| 1717 | "show ipv6 ospf6 linkstate network A.B.C.D A.B.C.D", |
| 1718 | SHOW_STR |
| 1719 | IP6_STR |
| 1720 | OSPF6_STR |
| 1721 | "Display linkstate routing table\n" |
| 1722 | "Display Network Entry\n" |
| 1723 | "Specify Router ID as IPv4 address notation\n" |
| 1724 | "Specify Link state ID as IPv4 address notation\n" |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1725 | ) |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1726 | |
| 1727 | DEFUN (show_ipv6_ospf6_linkstate_detail, |
| 1728 | show_ipv6_ospf6_linkstate_detail_cmd, |
| 1729 | "show ipv6 ospf6 linkstate detail", |
| 1730 | SHOW_STR |
| 1731 | IP6_STR |
| 1732 | OSPF6_STR |
| 1733 | "Display linkstate routing table\n" |
| 1734 | ) |
| 1735 | { |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 1736 | const char *sargv[CMD_ARGC_MAX]; |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1737 | int i, sargc; |
hasso | 52dc7ee | 2004-09-23 19:18:23 +0000 | [diff] [blame] | 1738 | struct listnode *node; |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1739 | struct ospf6_area *oa; |
| 1740 | |
| 1741 | /* copy argv to sargv and then append "detail" */ |
| 1742 | for (i = 0; i < argc; i++) |
| 1743 | sargv[i] = argv[i]; |
| 1744 | sargc = argc; |
| 1745 | sargv[sargc++] = "detail"; |
| 1746 | sargv[sargc] = NULL; |
| 1747 | |
paul | 1eb8ef2 | 2005-04-07 07:30:20 +0000 | [diff] [blame] | 1748 | for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa)) |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1749 | { |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1750 | vty_out (vty, "%s SPF Result in Area %s%s%s", |
| 1751 | VNL, oa->name, VNL, VNL); |
| 1752 | ospf6_linkstate_table_show (vty, sargc, sargv, oa->spf_table); |
| 1753 | } |
| 1754 | |
| 1755 | vty_out (vty, "%s", VNL); |
| 1756 | return CMD_SUCCESS; |
| 1757 | } |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1758 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1759 | /* Install ospf related commands. */ |
| 1760 | void |
Paul Jakma | 6ac29a5 | 2008-08-15 13:45:30 +0100 | [diff] [blame] | 1761 | ospf6_init (void) |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1762 | { |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 1763 | ospf6_top_init (); |
| 1764 | ospf6_area_init (); |
| 1765 | ospf6_interface_init (); |
| 1766 | ospf6_neighbor_init (); |
Donald Sharp | 7125293 | 2015-09-24 09:25:19 -0400 | [diff] [blame] | 1767 | ospf6_zebra_init (master); |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 1768 | |
| 1769 | ospf6_lsa_init (); |
| 1770 | ospf6_spf_init (); |
| 1771 | ospf6_intra_init (); |
| 1772 | ospf6_asbr_init (); |
| 1773 | ospf6_abr_init (); |
| 1774 | |
hasso | ef1bbf5 | 2004-10-08 12:04:21 +0000 | [diff] [blame] | 1775 | #ifdef HAVE_SNMP |
paul | 0c083ee | 2004-10-10 12:54:58 +0000 | [diff] [blame] | 1776 | ospf6_snmp_init (master); |
hasso | ef1bbf5 | 2004-10-08 12:04:21 +0000 | [diff] [blame] | 1777 | #endif /*HAVE_SNMP*/ |
| 1778 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1779 | install_node (&debug_node, config_write_ospf6_debug); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1780 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1781 | install_element_ospf6_debug_message (); |
| 1782 | install_element_ospf6_debug_lsa (); |
| 1783 | install_element_ospf6_debug_interface (); |
| 1784 | install_element_ospf6_debug_neighbor (); |
| 1785 | install_element_ospf6_debug_zebra (); |
| 1786 | install_element_ospf6_debug_spf (); |
| 1787 | install_element_ospf6_debug_route (); |
Paul Jakma | cb4b884 | 2006-05-15 10:39:30 +0000 | [diff] [blame] | 1788 | install_element_ospf6_debug_brouter (); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1789 | install_element_ospf6_debug_asbr (); |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1790 | install_element_ospf6_debug_abr (); |
hasso | 1e05838 | 2004-09-01 21:36:14 +0000 | [diff] [blame] | 1791 | install_element_ospf6_debug_flood (); |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1792 | |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1793 | install_element (VIEW_NODE, &show_version_ospf6_cmd); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1794 | |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1795 | install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_cmd); |
| 1796 | install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_detail_cmd); |
hasso | 6452df0 | 2004-08-15 05:52:07 +0000 | [diff] [blame] | 1797 | |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1798 | install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_cmd); |
| 1799 | install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_router_cmd); |
| 1800 | install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_network_cmd); |
| 1801 | install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_detail_cmd); |
hasso | 4846ef6 | 2004-09-03 06:04:00 +0000 | [diff] [blame] | 1802 | |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1803 | #define INSTALL(n,c) \ |
hasso | b31b813 | 2005-05-31 10:24:28 +0000 | [diff] [blame] | 1804 | install_element (n ## _NODE, &show_ipv6_ospf6_ ## c) |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1805 | |
| 1806 | INSTALL (VIEW, database_cmd); |
| 1807 | INSTALL (VIEW, database_detail_cmd); |
| 1808 | INSTALL (VIEW, database_type_cmd); |
| 1809 | INSTALL (VIEW, database_type_detail_cmd); |
| 1810 | INSTALL (VIEW, database_id_cmd); |
| 1811 | INSTALL (VIEW, database_id_detail_cmd); |
| 1812 | INSTALL (VIEW, database_linkstate_id_cmd); |
| 1813 | INSTALL (VIEW, database_linkstate_id_detail_cmd); |
| 1814 | INSTALL (VIEW, database_router_cmd); |
| 1815 | INSTALL (VIEW, database_router_detail_cmd); |
| 1816 | INSTALL (VIEW, database_adv_router_cmd); |
| 1817 | INSTALL (VIEW, database_adv_router_detail_cmd); |
| 1818 | INSTALL (VIEW, database_type_id_cmd); |
| 1819 | INSTALL (VIEW, database_type_id_detail_cmd); |
| 1820 | INSTALL (VIEW, database_type_linkstate_id_cmd); |
| 1821 | INSTALL (VIEW, database_type_linkstate_id_detail_cmd); |
| 1822 | INSTALL (VIEW, database_type_router_cmd); |
| 1823 | INSTALL (VIEW, database_type_router_detail_cmd); |
| 1824 | INSTALL (VIEW, database_type_adv_router_cmd); |
| 1825 | INSTALL (VIEW, database_type_adv_router_detail_cmd); |
| 1826 | INSTALL (VIEW, database_adv_router_linkstate_id_cmd); |
| 1827 | INSTALL (VIEW, database_adv_router_linkstate_id_detail_cmd); |
| 1828 | INSTALL (VIEW, database_id_router_cmd); |
| 1829 | INSTALL (VIEW, database_id_router_detail_cmd); |
| 1830 | INSTALL (VIEW, database_type_id_router_cmd); |
| 1831 | INSTALL (VIEW, database_type_id_router_detail_cmd); |
| 1832 | INSTALL (VIEW, database_type_adv_router_linkstate_id_cmd); |
| 1833 | INSTALL (VIEW, database_type_adv_router_linkstate_id_detail_cmd); |
| 1834 | INSTALL (VIEW, database_self_originated_cmd); |
| 1835 | INSTALL (VIEW, database_self_originated_detail_cmd); |
| 1836 | INSTALL (VIEW, database_type_self_originated_cmd); |
| 1837 | INSTALL (VIEW, database_type_self_originated_detail_cmd); |
| 1838 | INSTALL (VIEW, database_type_id_self_originated_cmd); |
| 1839 | INSTALL (VIEW, database_type_id_self_originated_detail_cmd); |
| 1840 | INSTALL (VIEW, database_type_self_originated_linkstate_id_cmd); |
| 1841 | INSTALL (VIEW, database_type_self_originated_linkstate_id_detail_cmd); |
hasso | 049207c | 2004-08-04 20:02:13 +0000 | [diff] [blame] | 1842 | |
hasso | 508e53e | 2004-05-18 18:57:06 +0000 | [diff] [blame] | 1843 | /* Make ospf protocol socket. */ |
| 1844 | ospf6_serv_sock (); |
| 1845 | thread_add_read (master, ospf6_receive, NULL, ospf6_sock); |
paul | 718e374 | 2002-12-13 20:15:29 +0000 | [diff] [blame] | 1846 | } |
| 1847 | |
Phil Laverdiere | ef2d5d1 | 2012-01-02 20:04:26 +0400 | [diff] [blame] | 1848 | void |
| 1849 | ospf6_clean (void) |
| 1850 | { |
| 1851 | if (ospf6->route_table) |
| 1852 | ospf6_route_remove_all (ospf6->route_table); |
| 1853 | if (ospf6->brouter_table) |
| 1854 | ospf6_route_remove_all (ospf6->brouter_table); |
| 1855 | } |