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