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