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