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