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