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