blob: fa84d0a5738a2df7bb95c6c54adb4f24cd487ec7 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001/*
hasso508e53e2004-05-18 18:57:06 +00002 * Copyright (C) 2003 Yasuhiro Ohara
paul718e3742002-12-13 20:15:29 +00003 *
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
hasso508e53e2004-05-18 18:57:06 +000022#include <zebra.h>
23
24#include "thread.h"
25#include "linklist.h"
26#include "vty.h"
27#include "command.h"
28
hasso508e53e2004-05-18 18:57:06 +000029#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"
hasso049207c2004-08-04 20:02:13 +000043#include "ospf6_abr.h"
hasso1e058382004-09-01 21:36:14 +000044#include "ospf6_flood.h"
hasso049207c2004-08-04 20:02:13 +000045#include "ospf6d.h"
paul718e3742002-12-13 20:15:29 +000046
hassoef1bbf52004-10-08 12:04:21 +000047#ifdef HAVE_SNMP
48#include "ospf6_snmp.h"
49#endif /*HAVE_SNMP*/
50
paul718e3742002-12-13 20:15:29 +000051char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION;
52
hasso508e53e2004-05-18 18:57:06 +000053struct route_node *
54route_prev (struct route_node *node)
paul718e3742002-12-13 20:15:29 +000055{
hasso508e53e2004-05-18 18:57:06 +000056 struct route_node *end;
57 struct route_node *prev = NULL;
paul718e3742002-12-13 20:15:29 +000058
hasso508e53e2004-05-18 18:57:06 +000059 end = node;
60 node = node->parent;
hasso3b687352004-08-19 06:56:53 +000061 if (node)
62 route_lock_node (node);
hasso508e53e2004-05-18 18:57:06 +000063 while (node)
64 {
65 prev = node;
hasso3b687352004-08-19 06:56:53 +000066 node = route_next (node);
67 if (node == end)
68 {
69 route_unlock_node (node);
70 node = NULL;
71 }
hasso508e53e2004-05-18 18:57:06 +000072 }
73 route_unlock_node (end);
hasso3b687352004-08-19 06:56:53 +000074 if (prev)
75 route_lock_node (prev);
hasso508e53e2004-05-18 18:57:06 +000076
77 return prev;
paul718e3742002-12-13 20:15:29 +000078}
79
David Lamparter6b0655a2014-06-04 06:53:35 +020080
hasso6452df02004-08-15 05:52:07 +000081/* show database functions */
paul718e3742002-12-13 20:15:29 +000082DEFUN (show_version_ospf6,
83 show_version_ospf6_cmd,
84 "show version ospf6",
85 SHOW_STR
hasso508e53e2004-05-18 18:57:06 +000086 "Displays ospf6d version\n"
87 )
paul718e3742002-12-13 20:15:29 +000088{
89 vty_out (vty, "Zebra OSPF6d Version: %s%s",
hasso049207c2004-08-04 20:02:13 +000090 ospf6_daemon_version, VNL);
paul718e3742002-12-13 20:15:29 +000091
92 return CMD_SUCCESS;
93}
94
Stephen Hemminger7fc626d2008-12-01 11:10:34 -080095static struct cmd_node debug_node =
paul718e3742002-12-13 20:15:29 +000096{
hasso508e53e2004-05-18 18:57:06 +000097 DEBUG_NODE,
hasso69b4a812004-08-26 18:10:36 +000098 "",
99 1 /* VTYSH */
hasso508e53e2004-05-18 18:57:06 +0000100};
paul718e3742002-12-13 20:15:29 +0000101
Paul Jakma6ac29a52008-08-15 13:45:30 +0100102static int
hasso508e53e2004-05-18 18:57:06 +0000103config_write_ospf6_debug (struct vty *vty)
paul718e3742002-12-13 20:15:29 +0000104{
hasso508e53e2004-05-18 18:57:06 +0000105 config_write_ospf6_debug_message (vty);
106 config_write_ospf6_debug_lsa (vty);
107 config_write_ospf6_debug_zebra (vty);
108 config_write_ospf6_debug_interface (vty);
109 config_write_ospf6_debug_neighbor (vty);
110 config_write_ospf6_debug_spf (vty);
111 config_write_ospf6_debug_route (vty);
Paul Jakmacb4b8842006-05-15 10:39:30 +0000112 config_write_ospf6_debug_brouter (vty);
hasso508e53e2004-05-18 18:57:06 +0000113 config_write_ospf6_debug_asbr (vty);
hasso049207c2004-08-04 20:02:13 +0000114 config_write_ospf6_debug_abr (vty);
hasso1e058382004-09-01 21:36:14 +0000115 config_write_ospf6_debug_flood (vty);
hasso049207c2004-08-04 20:02:13 +0000116 vty_out (vty, "!%s", VNL);
paul718e3742002-12-13 20:15:29 +0000117 return 0;
118}
119
hasso049207c2004-08-04 20:02:13 +0000120#define AREA_LSDB_TITLE_FORMAT \
121 "%s Area Scoped Link State Database (Area %s)%s%s"
122#define IF_LSDB_TITLE_FORMAT \
123 "%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s"
124#define AS_LSDB_TITLE_FORMAT \
125 "%s AS Scoped Link State Database%s%s"
126
127static int
paul0c083ee2004-10-10 12:54:58 +0000128parse_show_level (int argc, const char *argv[])
hasso049207c2004-08-04 20:02:13 +0000129{
hasso6452df02004-08-15 05:52:07 +0000130 int level = 0;
hasso049207c2004-08-04 20:02:13 +0000131 if (argc)
132 {
133 if (! strncmp (argv[0], "de", 2))
134 level = OSPF6_LSDB_SHOW_LEVEL_DETAIL;
135 else if (! strncmp (argv[0], "du", 2))
136 level = OSPF6_LSDB_SHOW_LEVEL_DUMP;
137 else if (! strncmp (argv[0], "in", 2))
138 level = OSPF6_LSDB_SHOW_LEVEL_INTERNAL;
139 }
140 else
141 level = OSPF6_LSDB_SHOW_LEVEL_NORMAL;
142 return level;
143}
144
145static u_int16_t
paul0c083ee2004-10-10 12:54:58 +0000146parse_type_spec (int argc, const char *argv[])
hasso049207c2004-08-04 20:02:13 +0000147{
hasso6452df02004-08-15 05:52:07 +0000148 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +0000149 assert (argc);
150 if (! strcmp (argv[0], "router"))
151 type = htons (OSPF6_LSTYPE_ROUTER);
152 else if (! strcmp (argv[0], "network"))
153 type = htons (OSPF6_LSTYPE_NETWORK);
154 else if (! strcmp (argv[0], "as-external"))
155 type = htons (OSPF6_LSTYPE_AS_EXTERNAL);
156 else if (! strcmp (argv[0], "intra-prefix"))
157 type = htons (OSPF6_LSTYPE_INTRA_PREFIX);
158 else if (! strcmp (argv[0], "inter-router"))
159 type = htons (OSPF6_LSTYPE_INTER_ROUTER);
160 else if (! strcmp (argv[0], "inter-prefix"))
161 type = htons (OSPF6_LSTYPE_INTER_PREFIX);
162 else if (! strcmp (argv[0], "link"))
163 type = htons (OSPF6_LSTYPE_LINK);
164 return type;
165}
166
hasso508e53e2004-05-18 18:57:06 +0000167DEFUN (show_ipv6_ospf6_database,
168 show_ipv6_ospf6_database_cmd,
169 "show ipv6 ospf6 database",
170 SHOW_STR
171 IPV6_STR
172 OSPF6_STR
173 "Display Link state database\n"
174 )
paul718e3742002-12-13 20:15:29 +0000175{
hasso049207c2004-08-04 20:02:13 +0000176 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000177 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000178 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000179 struct ospf6_area *oa;
180 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000181
182 OSPF6_CMD_CHECK_RUNNING ();
183
hasso049207c2004-08-04 20:02:13 +0000184 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +0000185
paul1eb8ef22005-04-07 07:30:20 +0000186 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +0000187 {
hasso049207c2004-08-04 20:02:13 +0000188 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
189 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000190 }
hasso049207c2004-08-04 20:02:13 +0000191
paul1eb8ef22005-04-07 07:30:20 +0000192 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +0000193 {
paul1eb8ef22005-04-07 07:30:20 +0000194 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso508e53e2004-05-18 18:57:06 +0000195 {
hasso049207c2004-08-04 20:02:13 +0000196 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
197 oi->interface->name, oa->name, VNL, VNL);
198 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000199 }
200 }
201
hasso049207c2004-08-04 20:02:13 +0000202 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
203 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb);
204
205 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000206 return CMD_SUCCESS;
207}
208
209ALIAS (show_ipv6_ospf6_database,
210 show_ipv6_ospf6_database_detail_cmd,
211 "show ipv6 ospf6 database (detail|dump|internal)",
212 SHOW_STR
213 IPV6_STR
214 OSPF6_STR
215 "Display Link state database\n"
216 "Display details of LSAs\n"
217 "Dump LSAs\n"
218 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100219 )
hasso508e53e2004-05-18 18:57:06 +0000220
221DEFUN (show_ipv6_ospf6_database_type,
222 show_ipv6_ospf6_database_type_cmd,
223 "show ipv6 ospf6 database "
224 "(router|network|inter-prefix|inter-router|as-external|"
225 "group-membership|type-7|link|intra-prefix)",
226 SHOW_STR
227 IPV6_STR
228 OSPF6_STR
229 "Display Link state database\n"
230 "Display Router LSAs\n"
231 "Display Network LSAs\n"
232 "Display Inter-Area-Prefix LSAs\n"
233 "Display Inter-Area-Router LSAs\n"
234 "Display As-External LSAs\n"
235 "Display Group-Membership LSAs\n"
236 "Display Type-7 LSAs\n"
237 "Display Link LSAs\n"
238 "Display Intra-Area-Prefix LSAs\n"
239 )
240{
hasso049207c2004-08-04 20:02:13 +0000241 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000242 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000243 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000244 struct ospf6_area *oa;
245 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000246 u_int16_t type = 0;
247
248 OSPF6_CMD_CHECK_RUNNING ();
249
hasso049207c2004-08-04 20:02:13 +0000250 type = parse_type_spec (argc, argv);
251 argc--;
252 argv++;
253 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +0000254
hasso049207c2004-08-04 20:02:13 +0000255 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000256 {
hasso6452df02004-08-15 05:52:07 +0000257 case OSPF6_SCOPE_AREA:
paul1eb8ef22005-04-07 07:30:20 +0000258 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +0000259 {
hasso049207c2004-08-04 20:02:13 +0000260 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
261 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
262 }
263 break;
264
hasso6452df02004-08-15 05:52:07 +0000265 case OSPF6_SCOPE_LINKLOCAL:
paul1eb8ef22005-04-07 07:30:20 +0000266 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +0000267 {
paul1eb8ef22005-04-07 07:30:20 +0000268 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +0000269 {
hasso049207c2004-08-04 20:02:13 +0000270 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
271 oi->interface->name, oa->name, VNL, VNL);
272 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
273 }
274 }
275 break;
276
hasso6452df02004-08-15 05:52:07 +0000277 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000278 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
279 ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb);
280 break;
281
282 default:
283 assert (0);
284 break;
hasso508e53e2004-05-18 18:57:06 +0000285 }
286
hasso049207c2004-08-04 20:02:13 +0000287 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000288 return CMD_SUCCESS;
289}
290
291ALIAS (show_ipv6_ospf6_database_type,
292 show_ipv6_ospf6_database_type_detail_cmd,
293 "show ipv6 ospf6 database "
294 "(router|network|inter-prefix|inter-router|as-external|"
295 "group-membership|type-7|link|intra-prefix) "
296 "(detail|dump|internal)",
297 SHOW_STR
298 IPV6_STR
299 OSPF6_STR
300 "Display Link state database\n"
301 "Display Router LSAs\n"
302 "Display Network LSAs\n"
303 "Display Inter-Area-Prefix LSAs\n"
304 "Display Inter-Area-Router LSAs\n"
305 "Display As-External LSAs\n"
306 "Display Group-Membership LSAs\n"
307 "Display Type-7 LSAs\n"
308 "Display Link LSAs\n"
309 "Display Intra-Area-Prefix LSAs\n"
310 "Display details of LSAs\n"
311 "Dump LSAs\n"
312 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100313 )
hasso508e53e2004-05-18 18:57:06 +0000314
315DEFUN (show_ipv6_ospf6_database_id,
316 show_ipv6_ospf6_database_id_cmd,
317 "show ipv6 ospf6 database * A.B.C.D",
318 SHOW_STR
319 IPV6_STR
320 OSPF6_STR
321 "Display Link state database\n"
322 "Any Link state Type\n"
323 "Specify Link state ID as IPv4 address notation\n"
324 )
325{
hasso049207c2004-08-04 20:02:13 +0000326 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000327 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000328 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000329 struct ospf6_area *oa;
330 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000331 u_int32_t id = 0;
332
333 OSPF6_CMD_CHECK_RUNNING ();
334
hasso508e53e2004-05-18 18:57:06 +0000335 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
336 {
337 vty_out (vty, "Link State ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000338 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000339 return CMD_SUCCESS;
340 }
341
hasso049207c2004-08-04 20:02:13 +0000342 argc--;
343 argv++;
344 level = parse_show_level (argc, argv);
345
paul1eb8ef22005-04-07 07:30:20 +0000346 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +0000347 {
hasso049207c2004-08-04 20:02:13 +0000348 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
349 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000350 }
hasso049207c2004-08-04 20:02:13 +0000351
paul1eb8ef22005-04-07 07:30:20 +0000352 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +0000353 {
paul1eb8ef22005-04-07 07:30:20 +0000354 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso508e53e2004-05-18 18:57:06 +0000355 {
hasso049207c2004-08-04 20:02:13 +0000356 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
357 oi->interface->name, oa->name, VNL, VNL);
358 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000359 }
360 }
361
hasso049207c2004-08-04 20:02:13 +0000362 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
363 ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb);
364
365 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000366 return CMD_SUCCESS;
367}
368
369ALIAS (show_ipv6_ospf6_database_id,
370 show_ipv6_ospf6_database_id_detail_cmd,
371 "show ipv6 ospf6 database * A.B.C.D "
372 "(detail|dump|internal)",
373 SHOW_STR
374 IPV6_STR
375 OSPF6_STR
376 "Display Link state database\n"
377 "Any Link state Type\n"
hasso049207c2004-08-04 20:02:13 +0000378 "Specify Link state ID as IPv4 address notation\n"
379 "Display details of LSAs\n"
380 "Dump LSAs\n"
381 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100382 )
hasso049207c2004-08-04 20:02:13 +0000383
384ALIAS (show_ipv6_ospf6_database_id,
385 show_ipv6_ospf6_database_linkstate_id_cmd,
386 "show ipv6 ospf6 database linkstate-id A.B.C.D",
387 SHOW_STR
388 IPV6_STR
389 OSPF6_STR
390 "Display Link state database\n"
391 "Search by Link state ID\n"
392 "Specify Link state ID as IPv4 address notation\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100393 )
hasso049207c2004-08-04 20:02:13 +0000394
395ALIAS (show_ipv6_ospf6_database_id,
396 show_ipv6_ospf6_database_linkstate_id_detail_cmd,
397 "show ipv6 ospf6 database linkstate-id A.B.C.D "
398 "(detail|dump|internal)",
399 SHOW_STR
400 IPV6_STR
401 OSPF6_STR
402 "Display Link state database\n"
403 "Search by Link state ID\n"
hasso508e53e2004-05-18 18:57:06 +0000404 "Specify Link state ID as IPv4 address notation\n"
405 "Display details of LSAs\n"
406 "Dump LSAs\n"
407 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100408 )
hasso508e53e2004-05-18 18:57:06 +0000409
410DEFUN (show_ipv6_ospf6_database_router,
411 show_ipv6_ospf6_database_router_cmd,
412 "show ipv6 ospf6 database * * A.B.C.D",
413 SHOW_STR
414 IPV6_STR
415 OSPF6_STR
416 "Display Link state database\n"
417 "Any Link state Type\n"
418 "Any Link state ID\n"
419 "Specify Advertising Router as IPv4 address notation\n"
420 )
421{
hasso049207c2004-08-04 20:02:13 +0000422 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000423 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000424 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000425 struct ospf6_area *oa;
426 struct ospf6_interface *oi;
427 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000428
429 OSPF6_CMD_CHECK_RUNNING ();
430
hasso049207c2004-08-04 20:02:13 +0000431 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000432 {
433 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000434 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000435 return CMD_SUCCESS;
436 }
437
hasso049207c2004-08-04 20:02:13 +0000438 argc--;
439 argv++;
440 level = parse_show_level (argc, argv);
441
paul1eb8ef22005-04-07 07:30:20 +0000442 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +0000443 {
hasso049207c2004-08-04 20:02:13 +0000444 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
445 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000446 }
hasso049207c2004-08-04 20:02:13 +0000447
paul1eb8ef22005-04-07 07:30:20 +0000448 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +0000449 {
paul1eb8ef22005-04-07 07:30:20 +0000450 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso508e53e2004-05-18 18:57:06 +0000451 {
hasso049207c2004-08-04 20:02:13 +0000452 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
453 oi->interface->name, oa->name, VNL, VNL);
454 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000455 }
456 }
457
hasso049207c2004-08-04 20:02:13 +0000458 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
459 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
460
461 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000462 return CMD_SUCCESS;
463}
464
465ALIAS (show_ipv6_ospf6_database_router,
466 show_ipv6_ospf6_database_router_detail_cmd,
467 "show ipv6 ospf6 database * * A.B.C.D "
468 "(detail|dump|internal)",
469 SHOW_STR
470 IPV6_STR
471 OSPF6_STR
472 "Display Link state database\n"
473 "Any Link state Type\n"
474 "Any Link state ID\n"
475 "Specify Advertising Router as IPv4 address notation\n"
476 "Display details of LSAs\n"
477 "Dump LSAs\n"
478 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100479 )
hasso508e53e2004-05-18 18:57:06 +0000480
hasso049207c2004-08-04 20:02:13 +0000481ALIAS (show_ipv6_ospf6_database_router,
482 show_ipv6_ospf6_database_adv_router_cmd,
483 "show ipv6 ospf6 database adv-router A.B.C.D",
484 SHOW_STR
485 IPV6_STR
486 OSPF6_STR
487 "Display Link state database\n"
488 "Search by Advertising Router\n"
489 "Specify Advertising Router as IPv4 address notation\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100490 )
hasso049207c2004-08-04 20:02:13 +0000491
492ALIAS (show_ipv6_ospf6_database_router,
493 show_ipv6_ospf6_database_adv_router_detail_cmd,
494 "show ipv6 ospf6 database adv-router A.B.C.D "
495 "(detail|dump|internal)",
496 SHOW_STR
497 IPV6_STR
498 OSPF6_STR
499 "Display Link state database\n"
500 "Search by Advertising Router\n"
501 "Specify Advertising Router as IPv4 address notation\n"
502 "Display details of LSAs\n"
503 "Dump LSAs\n"
504 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100505 )
hasso049207c2004-08-04 20:02:13 +0000506
hasso508e53e2004-05-18 18:57:06 +0000507DEFUN (show_ipv6_ospf6_database_type_id,
508 show_ipv6_ospf6_database_type_id_cmd,
509 "show ipv6 ospf6 database "
510 "(router|network|inter-prefix|inter-router|as-external|"
511 "group-membership|type-7|link|intra-prefix) A.B.C.D",
512 SHOW_STR
513 IPV6_STR
514 OSPF6_STR
515 "Display Link state database\n"
516 "Display Router LSAs\n"
517 "Display Network LSAs\n"
518 "Display Inter-Area-Prefix LSAs\n"
519 "Display Inter-Area-Router LSAs\n"
520 "Display As-External LSAs\n"
521 "Display Group-Membership LSAs\n"
522 "Display Type-7 LSAs\n"
523 "Display Link LSAs\n"
524 "Display Intra-Area-Prefix LSAs\n"
525 "Specify Link state ID as IPv4 address notation\n"
526 )
527{
hasso049207c2004-08-04 20:02:13 +0000528 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000529 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000530 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000531 struct ospf6_area *oa;
532 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000533 u_int16_t type = 0;
534 u_int32_t id = 0;
535
536 OSPF6_CMD_CHECK_RUNNING ();
537
hasso049207c2004-08-04 20:02:13 +0000538 type = parse_type_spec (argc, argv);
539 argc--;
540 argv++;
hasso508e53e2004-05-18 18:57:06 +0000541
hasso049207c2004-08-04 20:02:13 +0000542 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000543 {
544 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000545 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000546 return CMD_SUCCESS;
547 }
548
hasso049207c2004-08-04 20:02:13 +0000549 argc--;
550 argv++;
551 level = parse_show_level (argc, argv);
552
553 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000554 {
hasso6452df02004-08-15 05:52:07 +0000555 case OSPF6_SCOPE_AREA:
paul1eb8ef22005-04-07 07:30:20 +0000556 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +0000557 {
hasso049207c2004-08-04 20:02:13 +0000558 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
559 ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
560 }
561 break;
562
hasso6452df02004-08-15 05:52:07 +0000563 case OSPF6_SCOPE_LINKLOCAL:
paul1eb8ef22005-04-07 07:30:20 +0000564 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +0000565 {
paul1eb8ef22005-04-07 07:30:20 +0000566 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +0000567 {
hasso049207c2004-08-04 20:02:13 +0000568 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
569 oi->interface->name, oa->name, VNL, VNL);
570 ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
571 }
572 }
573 break;
574
hasso6452df02004-08-15 05:52:07 +0000575 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000576 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
577 ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb);
578 break;
579
580 default:
581 assert (0);
582 break;
hasso508e53e2004-05-18 18:57:06 +0000583 }
584
hasso049207c2004-08-04 20:02:13 +0000585 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000586 return CMD_SUCCESS;
587}
588
589ALIAS (show_ipv6_ospf6_database_type_id,
590 show_ipv6_ospf6_database_type_id_detail_cmd,
591 "show ipv6 ospf6 database "
592 "(router|network|inter-prefix|inter-router|as-external|"
593 "group-membership|type-7|link|intra-prefix) A.B.C.D "
594 "(detail|dump|internal)",
595 SHOW_STR
596 IPV6_STR
597 OSPF6_STR
598 "Display Link state database\n"
599 "Display Router LSAs\n"
600 "Display Network LSAs\n"
601 "Display Inter-Area-Prefix LSAs\n"
602 "Display Inter-Area-Router LSAs\n"
603 "Display As-External LSAs\n"
604 "Display Group-Membership LSAs\n"
605 "Display Type-7 LSAs\n"
606 "Display Link LSAs\n"
607 "Display Intra-Area-Prefix LSAs\n"
608 "Specify Link state ID as IPv4 address notation\n"
609 "Display details of LSAs\n"
610 "Dump LSAs\n"
611 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100612 )
hasso508e53e2004-05-18 18:57:06 +0000613
hasso049207c2004-08-04 20:02:13 +0000614ALIAS (show_ipv6_ospf6_database_type_id,
615 show_ipv6_ospf6_database_type_linkstate_id_cmd,
616 "show ipv6 ospf6 database "
617 "(router|network|inter-prefix|inter-router|as-external|"
618 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D",
619 SHOW_STR
620 IPV6_STR
621 OSPF6_STR
622 "Display Link state database\n"
623 "Display Router LSAs\n"
624 "Display Network LSAs\n"
625 "Display Inter-Area-Prefix LSAs\n"
626 "Display Inter-Area-Router LSAs\n"
627 "Display As-External LSAs\n"
628 "Display Group-Membership LSAs\n"
629 "Display Type-7 LSAs\n"
630 "Display Link LSAs\n"
631 "Display Intra-Area-Prefix LSAs\n"
632 "Search by Link state ID\n"
633 "Specify Link state ID as IPv4 address notation\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100634 )
hasso049207c2004-08-04 20:02:13 +0000635
636ALIAS (show_ipv6_ospf6_database_type_id,
637 show_ipv6_ospf6_database_type_linkstate_id_detail_cmd,
638 "show ipv6 ospf6 database "
639 "(router|network|inter-prefix|inter-router|as-external|"
640 "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D "
641 "(detail|dump|internal)",
642 SHOW_STR
643 IPV6_STR
644 OSPF6_STR
645 "Display Link state database\n"
646 "Display Router LSAs\n"
647 "Display Network LSAs\n"
648 "Display Inter-Area-Prefix LSAs\n"
649 "Display Inter-Area-Router LSAs\n"
650 "Display As-External LSAs\n"
651 "Display Group-Membership LSAs\n"
652 "Display Type-7 LSAs\n"
653 "Display Link LSAs\n"
654 "Display Intra-Area-Prefix LSAs\n"
655 "Search by Link state ID\n"
656 "Specify Link state ID as IPv4 address notation\n"
657 "Display details of LSAs\n"
658 "Dump LSAs\n"
659 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100660 )
hasso049207c2004-08-04 20:02:13 +0000661
hasso508e53e2004-05-18 18:57:06 +0000662DEFUN (show_ipv6_ospf6_database_type_router,
663 show_ipv6_ospf6_database_type_router_cmd,
664 "show ipv6 ospf6 database "
665 "(router|network|inter-prefix|inter-router|as-external|"
666 "group-membership|type-7|link|intra-prefix) * A.B.C.D",
667 SHOW_STR
668 IPV6_STR
669 OSPF6_STR
670 "Display Link state database\n"
671 "Display Router LSAs\n"
672 "Display Network LSAs\n"
673 "Display Inter-Area-Prefix LSAs\n"
674 "Display Inter-Area-Router LSAs\n"
675 "Display As-External LSAs\n"
676 "Display Group-Membership LSAs\n"
677 "Display Type-7 LSAs\n"
678 "Display Link LSAs\n"
679 "Display Intra-Area-Prefix LSAs\n"
680 "Any Link state ID\n"
681 "Specify Advertising Router as IPv4 address notation\n"
682 )
683{
hasso049207c2004-08-04 20:02:13 +0000684 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000685 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000686 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000687 struct ospf6_area *oa;
688 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000689 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +0000690 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000691
692 OSPF6_CMD_CHECK_RUNNING ();
693
hasso049207c2004-08-04 20:02:13 +0000694 type = parse_type_spec (argc, argv);
695 argc--;
696 argv++;
hasso508e53e2004-05-18 18:57:06 +0000697
hasso049207c2004-08-04 20:02:13 +0000698 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000699 {
700 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000701 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000702 return CMD_SUCCESS;
703 }
704
hasso049207c2004-08-04 20:02:13 +0000705 argc--;
706 argv++;
707 level = parse_show_level (argc, argv);
708
709 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +0000710 {
hasso6452df02004-08-15 05:52:07 +0000711 case OSPF6_SCOPE_AREA:
paul1eb8ef22005-04-07 07:30:20 +0000712 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +0000713 {
hasso049207c2004-08-04 20:02:13 +0000714 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
715 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
716 }
717 break;
718
hasso6452df02004-08-15 05:52:07 +0000719 case OSPF6_SCOPE_LINKLOCAL:
paul1eb8ef22005-04-07 07:30:20 +0000720 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +0000721 {
paul1eb8ef22005-04-07 07:30:20 +0000722 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +0000723 {
hasso049207c2004-08-04 20:02:13 +0000724 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
725 oi->interface->name, oa->name, VNL, VNL);
726 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
727 }
728 }
729 break;
730
hasso6452df02004-08-15 05:52:07 +0000731 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +0000732 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
733 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
734 break;
735
736 default:
737 assert (0);
738 break;
hasso508e53e2004-05-18 18:57:06 +0000739 }
740
hasso049207c2004-08-04 20:02:13 +0000741 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000742 return CMD_SUCCESS;
743}
744
745ALIAS (show_ipv6_ospf6_database_type_router,
746 show_ipv6_ospf6_database_type_router_detail_cmd,
747 "show ipv6 ospf6 database "
748 "(router|network|inter-prefix|inter-router|as-external|"
749 "group-membership|type-7|link|intra-prefix) * A.B.C.D "
750 "(detail|dump|internal)",
751 SHOW_STR
752 IPV6_STR
753 OSPF6_STR
754 "Display Link state database\n"
755 "Display Router LSAs\n"
756 "Display Network LSAs\n"
757 "Display Inter-Area-Prefix LSAs\n"
758 "Display Inter-Area-Router LSAs\n"
759 "Display As-External LSAs\n"
760 "Display Group-Membership LSAs\n"
761 "Display Type-7 LSAs\n"
762 "Display Link LSAs\n"
763 "Display Intra-Area-Prefix LSAs\n"
764 "Any Link state ID\n"
765 "Specify Advertising Router as IPv4 address notation\n"
766 "Display details of LSAs\n"
767 "Dump LSAs\n"
768 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100769 )
hasso508e53e2004-05-18 18:57:06 +0000770
hasso049207c2004-08-04 20:02:13 +0000771ALIAS (show_ipv6_ospf6_database_type_router,
772 show_ipv6_ospf6_database_type_adv_router_cmd,
773 "show ipv6 ospf6 database "
774 "(router|network|inter-prefix|inter-router|as-external|"
775 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D",
776 SHOW_STR
777 IPV6_STR
778 OSPF6_STR
779 "Display Link state database\n"
780 "Display Router LSAs\n"
781 "Display Network LSAs\n"
782 "Display Inter-Area-Prefix LSAs\n"
783 "Display Inter-Area-Router LSAs\n"
784 "Display As-External LSAs\n"
785 "Display Group-Membership LSAs\n"
786 "Display Type-7 LSAs\n"
787 "Display Link LSAs\n"
788 "Display Intra-Area-Prefix LSAs\n"
789 "Search by Advertising Router\n"
790 "Specify Advertising Router as IPv4 address notation\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100791 )
hasso049207c2004-08-04 20:02:13 +0000792
793ALIAS (show_ipv6_ospf6_database_type_router,
794 show_ipv6_ospf6_database_type_adv_router_detail_cmd,
795 "show ipv6 ospf6 database "
796 "(router|network|inter-prefix|inter-router|as-external|"
797 "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D "
798 "(detail|dump|internal)",
799 SHOW_STR
800 IPV6_STR
801 OSPF6_STR
802 "Display Link state database\n"
803 "Display Router LSAs\n"
804 "Display Network LSAs\n"
805 "Display Inter-Area-Prefix LSAs\n"
806 "Display Inter-Area-Router LSAs\n"
807 "Display As-External LSAs\n"
808 "Display Group-Membership LSAs\n"
809 "Display Type-7 LSAs\n"
810 "Display Link LSAs\n"
811 "Display Intra-Area-Prefix LSAs\n"
812 "Search by Advertising Router\n"
813 "Specify Advertising Router as IPv4 address notation\n"
814 "Display details of LSAs\n"
815 "Dump LSAs\n"
816 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100817 )
hasso049207c2004-08-04 20:02:13 +0000818
hasso508e53e2004-05-18 18:57:06 +0000819DEFUN (show_ipv6_ospf6_database_id_router,
820 show_ipv6_ospf6_database_id_router_cmd,
821 "show ipv6 ospf6 database * A.B.C.D A.B.C.D",
822 SHOW_STR
823 IPV6_STR
824 OSPF6_STR
825 "Display Link state database\n"
826 "Any Link state Type\n"
827 "Specify Link state ID as IPv4 address notation\n"
828 "Specify Advertising Router as IPv4 address notation\n"
829 )
830{
hasso049207c2004-08-04 20:02:13 +0000831 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000832 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +0000833 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +0000834 struct ospf6_area *oa;
835 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +0000836 u_int32_t id = 0;
hasso049207c2004-08-04 20:02:13 +0000837 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +0000838
839 OSPF6_CMD_CHECK_RUNNING ();
840
hasso508e53e2004-05-18 18:57:06 +0000841 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
842 {
843 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso6452df02004-08-15 05:52:07 +0000844 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000845 return CMD_SUCCESS;
846 }
847
hasso049207c2004-08-04 20:02:13 +0000848 argc--;
849 argv++;
850
851 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +0000852 {
853 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +0000854 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +0000855 return CMD_SUCCESS;
856 }
857
hasso049207c2004-08-04 20:02:13 +0000858 argc--;
859 argv++;
860 level = parse_show_level (argc, argv);
861
paul1eb8ef22005-04-07 07:30:20 +0000862 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +0000863 {
hasso049207c2004-08-04 20:02:13 +0000864 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
865 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000866 }
hasso049207c2004-08-04 20:02:13 +0000867
paul1eb8ef22005-04-07 07:30:20 +0000868 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +0000869 {
paul1eb8ef22005-04-07 07:30:20 +0000870 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso508e53e2004-05-18 18:57:06 +0000871 {
hasso049207c2004-08-04 20:02:13 +0000872 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
873 oi->interface->name, oa->name, VNL, VNL);
874 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +0000875 }
876 }
877
hasso049207c2004-08-04 20:02:13 +0000878 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
879 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
880
881 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +0000882 return CMD_SUCCESS;
883}
884
885ALIAS (show_ipv6_ospf6_database_id_router,
886 show_ipv6_ospf6_database_id_router_detail_cmd,
887 "show ipv6 ospf6 database * A.B.C.D A.B.C.D "
888 "(detail|dump|internal)",
889 SHOW_STR
890 IPV6_STR
891 OSPF6_STR
892 "Display Link state database\n"
893 "Any Link state Type\n"
894 "Specify Link state ID as IPv4 address notation\n"
895 "Specify Advertising Router as IPv4 address notation\n"
896 "Display details of LSAs\n"
897 "Dump LSAs\n"
898 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100899 )
hasso508e53e2004-05-18 18:57:06 +0000900
hasso049207c2004-08-04 20:02:13 +0000901DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
902 show_ipv6_ospf6_database_adv_router_linkstate_id_cmd,
903 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D",
904 SHOW_STR
905 IPV6_STR
906 OSPF6_STR
907 "Display Link state database\n"
908 "Search by Advertising Router\n"
909 "Specify Advertising Router as IPv4 address notation\n"
910 "Search by Link state ID\n"
911 "Specify Link state ID as IPv4 address notation\n"
912 )
913{
914 int level;
hasso52dc7ee2004-09-23 19:18:23 +0000915 struct listnode *i, *j;
hasso049207c2004-08-04 20:02:13 +0000916 struct ospf6 *o = ospf6;
917 struct ospf6_area *oa;
918 struct ospf6_interface *oi;
919 u_int32_t id = 0;
920 u_int32_t adv_router = 0;
921
922 OSPF6_CMD_CHECK_RUNNING ();
923
924 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
925 {
926 vty_out (vty, "Advertising Router is not parsable: %s%s",
927 argv[0], VNL);
928 return CMD_SUCCESS;
929 }
930
931 argc--;
932 argv++;
933
934 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
935 {
936 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso6452df02004-08-15 05:52:07 +0000937 argv[0], VNL);
hasso049207c2004-08-04 20:02:13 +0000938 return CMD_SUCCESS;
939 }
940
941 argc--;
942 argv++;
943 level = parse_show_level (argc, argv);
944
paul1eb8ef22005-04-07 07:30:20 +0000945 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +0000946 {
hasso049207c2004-08-04 20:02:13 +0000947 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
948 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
949 }
950
paul1eb8ef22005-04-07 07:30:20 +0000951 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +0000952 {
paul1eb8ef22005-04-07 07:30:20 +0000953 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +0000954 {
hasso049207c2004-08-04 20:02:13 +0000955 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
956 oi->interface->name, oa->name, VNL, VNL);
957 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
958 }
959 }
960
961 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
962 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
963
964 vty_out (vty, "%s", VNL);
965 return CMD_SUCCESS;
966}
967
968ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id,
969 show_ipv6_ospf6_database_adv_router_linkstate_id_detail_cmd,
970 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D "
971 "(detail|dump|internal)",
972 SHOW_STR
973 IPV6_STR
974 OSPF6_STR
975 "Display Link state database\n"
976 "Search by Advertising Router\n"
977 "Specify Advertising Router as IPv4 address notation\n"
978 "Search by Link state ID\n"
979 "Specify Link state ID as IPv4 address notation\n"
980 "Display details of LSAs\n"
981 "Dump LSAs\n"
982 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +0100983 )
hasso049207c2004-08-04 20:02:13 +0000984
hasso508e53e2004-05-18 18:57:06 +0000985DEFUN (show_ipv6_ospf6_database_type_id_router,
986 show_ipv6_ospf6_database_type_id_router_cmd,
987 "show ipv6 ospf6 database "
988 "(router|network|inter-prefix|inter-router|as-external|"
989 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D",
990 SHOW_STR
991 IPV6_STR
992 OSPF6_STR
993 "Display Link state database\n"
994 "Display Router LSAs\n"
995 "Display Network LSAs\n"
996 "Display Inter-Area-Prefix LSAs\n"
997 "Display Inter-Area-Router LSAs\n"
998 "Display As-External LSAs\n"
999 "Display Group-Membership LSAs\n"
1000 "Display Type-7 LSAs\n"
1001 "Display Link LSAs\n"
1002 "Display Intra-Area-Prefix LSAs\n"
1003 "Specify Link state ID as IPv4 address notation\n"
1004 "Specify Advertising Router as IPv4 address notation\n"
1005 )
1006{
hasso049207c2004-08-04 20:02:13 +00001007 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001008 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +00001009 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001010 struct ospf6_area *oa;
1011 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001012 u_int16_t type = 0;
1013 u_int32_t id = 0;
hasso049207c2004-08-04 20:02:13 +00001014 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001015
1016 OSPF6_CMD_CHECK_RUNNING ();
1017
hasso049207c2004-08-04 20:02:13 +00001018 type = parse_type_spec (argc, argv);
1019 argc--;
1020 argv++;
hasso508e53e2004-05-18 18:57:06 +00001021
hasso049207c2004-08-04 20:02:13 +00001022 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001023 {
1024 vty_out (vty, "Link state ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001025 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001026 return CMD_SUCCESS;
1027 }
1028
hasso049207c2004-08-04 20:02:13 +00001029 argc--;
1030 argv++;
1031
1032 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001033 {
1034 vty_out (vty, "Advertising Router is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001035 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001036 return CMD_SUCCESS;
1037 }
1038
hasso049207c2004-08-04 20:02:13 +00001039 argc--;
1040 argv++;
1041 level = parse_show_level (argc, argv);
1042
1043 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +00001044 {
hasso6452df02004-08-15 05:52:07 +00001045 case OSPF6_SCOPE_AREA:
paul1eb8ef22005-04-07 07:30:20 +00001046 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001047 {
hasso049207c2004-08-04 20:02:13 +00001048 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1049 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1050 }
1051 break;
1052
hasso6452df02004-08-15 05:52:07 +00001053 case OSPF6_SCOPE_LINKLOCAL:
paul1eb8ef22005-04-07 07:30:20 +00001054 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001055 {
paul1eb8ef22005-04-07 07:30:20 +00001056 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +00001057 {
hasso049207c2004-08-04 20:02:13 +00001058 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1059 oi->interface->name, oa->name, VNL, VNL);
1060 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1061 }
1062 }
1063 break;
1064
hasso6452df02004-08-15 05:52:07 +00001065 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001066 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1067 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1068 break;
1069
1070 default:
1071 assert (0);
1072 break;
hasso508e53e2004-05-18 18:57:06 +00001073 }
1074
hasso049207c2004-08-04 20:02:13 +00001075 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001076 return CMD_SUCCESS;
1077}
1078
1079ALIAS (show_ipv6_ospf6_database_type_id_router,
1080 show_ipv6_ospf6_database_type_id_router_detail_cmd,
1081 "show ipv6 ospf6 database "
1082 "(router|network|inter-prefix|inter-router|as-external|"
1083 "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D "
1084 "(dump|internal)",
1085 SHOW_STR
1086 IPV6_STR
1087 OSPF6_STR
1088 "Display Link state database\n"
1089 "Display Router LSAs\n"
1090 "Display Network LSAs\n"
1091 "Display Inter-Area-Prefix LSAs\n"
1092 "Display Inter-Area-Router LSAs\n"
1093 "Display As-External LSAs\n"
1094 "Display Group-Membership LSAs\n"
1095 "Display Type-7 LSAs\n"
1096 "Display Link LSAs\n"
1097 "Display Intra-Area-Prefix LSAs\n"
1098 "Specify Link state ID as IPv4 address notation\n"
1099 "Specify Advertising Router as IPv4 address notation\n"
hasso049207c2004-08-04 20:02:13 +00001100 "Dump LSAs\n"
1101 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +01001102 )
hasso049207c2004-08-04 20:02:13 +00001103
1104DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1105 show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd,
1106 "show ipv6 ospf6 database "
1107 "(router|network|inter-prefix|inter-router|as-external|"
1108 "group-membership|type-7|link|intra-prefix) "
1109 "adv-router A.B.C.D linkstate-id A.B.C.D",
1110 SHOW_STR
1111 IPV6_STR
1112 OSPF6_STR
1113 "Display Link state database\n"
1114 "Display Router LSAs\n"
1115 "Display Network LSAs\n"
1116 "Display Inter-Area-Prefix LSAs\n"
1117 "Display Inter-Area-Router LSAs\n"
1118 "Display As-External LSAs\n"
1119 "Display Group-Membership LSAs\n"
1120 "Display Type-7 LSAs\n"
1121 "Display Link LSAs\n"
1122 "Display Intra-Area-Prefix LSAs\n"
1123 "Search by Advertising Router\n"
1124 "Specify Advertising Router as IPv4 address notation\n"
1125 "Search by Link state ID\n"
1126 "Specify Link state ID as IPv4 address notation\n"
1127 )
1128{
1129 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001130 struct listnode *i, *j;
hasso049207c2004-08-04 20:02:13 +00001131 struct ospf6 *o = ospf6;
1132 struct ospf6_area *oa;
1133 struct ospf6_interface *oi;
1134 u_int16_t type = 0;
1135 u_int32_t id = 0;
1136 u_int32_t adv_router = 0;
1137
1138 OSPF6_CMD_CHECK_RUNNING ();
1139
1140 type = parse_type_spec (argc, argv);
1141 argc--;
1142 argv++;
1143
1144 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1145 {
1146 vty_out (vty, "Advertising Router is not parsable: %s%s",
1147 argv[0], VNL);
1148 return CMD_SUCCESS;
1149 }
1150
1151 argc--;
1152 argv++;
1153
1154 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
1155 {
1156 vty_out (vty, "Link state ID is not parsable: %s%s",
1157 argv[0], VNL);
1158 return CMD_SUCCESS;
1159 }
1160
1161 argc--;
1162 argv++;
1163 level = parse_show_level (argc, argv);
1164
1165 switch (OSPF6_LSA_SCOPE (type))
1166 {
hasso6452df02004-08-15 05:52:07 +00001167 case OSPF6_SCOPE_AREA:
paul1eb8ef22005-04-07 07:30:20 +00001168 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001169 {
hasso049207c2004-08-04 20:02:13 +00001170 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1171 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1172 }
1173 break;
1174
hasso6452df02004-08-15 05:52:07 +00001175 case OSPF6_SCOPE_LINKLOCAL:
paul1eb8ef22005-04-07 07:30:20 +00001176 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001177 {
paul1eb8ef22005-04-07 07:30:20 +00001178 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +00001179 {
hasso049207c2004-08-04 20:02:13 +00001180 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1181 oi->interface->name, oa->name, VNL, VNL);
1182 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1183 }
1184 }
1185 break;
1186
hasso6452df02004-08-15 05:52:07 +00001187 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001188 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1189 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1190 break;
1191
1192 default:
1193 assert (0);
1194 break;
1195 }
1196
1197 vty_out (vty, "%s", VNL);
1198 return CMD_SUCCESS;
1199}
1200
1201ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
1202 show_ipv6_ospf6_database_type_adv_router_linkstate_id_detail_cmd,
1203 "show ipv6 ospf6 database "
1204 "(router|network|inter-prefix|inter-router|as-external|"
1205 "group-membership|type-7|link|intra-prefix) "
1206 "adv-router A.B.C.D linkstate-id A.B.C.D "
1207 "(dump|internal)",
1208 SHOW_STR
1209 IPV6_STR
1210 OSPF6_STR
1211 "Display Link state database\n"
1212 "Display Router LSAs\n"
1213 "Display Network LSAs\n"
1214 "Display Inter-Area-Prefix LSAs\n"
1215 "Display Inter-Area-Router LSAs\n"
1216 "Display As-External LSAs\n"
1217 "Display Group-Membership LSAs\n"
1218 "Display Type-7 LSAs\n"
1219 "Display Link LSAs\n"
1220 "Display Intra-Area-Prefix LSAs\n"
1221 "Search by Advertising Router\n"
1222 "Specify Advertising Router as IPv4 address notation\n"
1223 "Search by Link state ID\n"
1224 "Specify Link state ID as IPv4 address notation\n"
hasso508e53e2004-05-18 18:57:06 +00001225 "Dump LSAs\n"
1226 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +01001227 )
hasso508e53e2004-05-18 18:57:06 +00001228
1229DEFUN (show_ipv6_ospf6_database_self_originated,
1230 show_ipv6_ospf6_database_self_originated_cmd,
1231 "show ipv6 ospf6 database self-originated",
1232 SHOW_STR
1233 IPV6_STR
1234 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001235 "Display Self-originated LSAs\n"
1236 )
1237{
hasso049207c2004-08-04 20:02:13 +00001238 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001239 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +00001240 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001241 struct ospf6_area *oa;
1242 struct ospf6_interface *oi;
1243 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001244
1245 OSPF6_CMD_CHECK_RUNNING ();
1246
hasso049207c2004-08-04 20:02:13 +00001247 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +00001248
hasso049207c2004-08-04 20:02:13 +00001249 adv_router = o->router_id;
hasso508e53e2004-05-18 18:57:06 +00001250
paul1eb8ef22005-04-07 07:30:20 +00001251 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +00001252 {
hasso049207c2004-08-04 20:02:13 +00001253 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1254 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
hasso508e53e2004-05-18 18:57:06 +00001255 }
hasso049207c2004-08-04 20:02:13 +00001256
paul1eb8ef22005-04-07 07:30:20 +00001257 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso508e53e2004-05-18 18:57:06 +00001258 {
paul1eb8ef22005-04-07 07:30:20 +00001259 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso508e53e2004-05-18 18:57:06 +00001260 {
hasso049207c2004-08-04 20:02:13 +00001261 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1262 oi->interface->name, oa->name, VNL, VNL);
1263 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
hasso508e53e2004-05-18 18:57:06 +00001264 }
1265 }
1266
hasso049207c2004-08-04 20:02:13 +00001267 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1268 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
1269
1270 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001271 return CMD_SUCCESS;
1272}
1273
1274ALIAS (show_ipv6_ospf6_database_self_originated,
1275 show_ipv6_ospf6_database_self_originated_detail_cmd,
1276 "show ipv6 ospf6 database self-originated "
1277 "(detail|dump|internal)",
1278 SHOW_STR
1279 IPV6_STR
1280 OSPF6_STR
hasso508e53e2004-05-18 18:57:06 +00001281 "Display Self-originated LSAs\n"
1282 "Display details of LSAs\n"
1283 "Dump LSAs\n"
1284 "Display LSA's internal information\n"
hasso049207c2004-08-04 20:02:13 +00001285 )
hasso508e53e2004-05-18 18:57:06 +00001286
1287DEFUN (show_ipv6_ospf6_database_type_self_originated,
1288 show_ipv6_ospf6_database_type_self_originated_cmd,
1289 "show ipv6 ospf6 database "
1290 "(router|network|inter-prefix|inter-router|as-external|"
1291 "group-membership|type-7|link|intra-prefix) self-originated",
1292 SHOW_STR
1293 IPV6_STR
1294 OSPF6_STR
1295 "Display Link state database\n"
1296 "Display Router LSAs\n"
1297 "Display Network LSAs\n"
1298 "Display Inter-Area-Prefix LSAs\n"
1299 "Display Inter-Area-Router LSAs\n"
1300 "Display As-External LSAs\n"
1301 "Display Group-Membership LSAs\n"
1302 "Display Type-7 LSAs\n"
1303 "Display Link LSAs\n"
1304 "Display Intra-Area-Prefix LSAs\n"
1305 "Display Self-originated LSAs\n"
1306 )
1307{
hasso049207c2004-08-04 20:02:13 +00001308 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001309 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +00001310 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001311 struct ospf6_area *oa;
1312 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001313 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +00001314 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001315
1316 OSPF6_CMD_CHECK_RUNNING ();
1317
hasso049207c2004-08-04 20:02:13 +00001318 type = parse_type_spec (argc, argv);
1319 argc--;
1320 argv++;
1321 level = parse_show_level (argc, argv);
hasso508e53e2004-05-18 18:57:06 +00001322
hasso049207c2004-08-04 20:02:13 +00001323 adv_router = o->router_id;
hasso508e53e2004-05-18 18:57:06 +00001324
hasso049207c2004-08-04 20:02:13 +00001325 switch (OSPF6_LSA_SCOPE (type))
1326 {
hasso6452df02004-08-15 05:52:07 +00001327 case OSPF6_SCOPE_AREA:
paul1eb8ef22005-04-07 07:30:20 +00001328 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001329 {
hasso049207c2004-08-04 20:02:13 +00001330 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1331 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
1332 }
1333 break;
hasso508e53e2004-05-18 18:57:06 +00001334
hasso6452df02004-08-15 05:52:07 +00001335 case OSPF6_SCOPE_LINKLOCAL:
paul1eb8ef22005-04-07 07:30:20 +00001336 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001337 {
paul1eb8ef22005-04-07 07:30:20 +00001338 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +00001339 {
hasso049207c2004-08-04 20:02:13 +00001340 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1341 oi->interface->name, oa->name, VNL, VNL);
1342 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
1343 }
1344 }
1345 break;
1346
hasso6452df02004-08-15 05:52:07 +00001347 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001348 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1349 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
1350 break;
1351
1352 default:
1353 assert (0);
1354 break;
hasso508e53e2004-05-18 18:57:06 +00001355 }
1356
hasso049207c2004-08-04 20:02:13 +00001357 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001358 return CMD_SUCCESS;
1359}
1360
1361ALIAS (show_ipv6_ospf6_database_type_self_originated,
1362 show_ipv6_ospf6_database_type_self_originated_detail_cmd,
1363 "show ipv6 ospf6 database "
1364 "(router|network|inter-prefix|inter-router|as-external|"
1365 "group-membership|type-7|link|intra-prefix) self-originated "
1366 "(detail|dump|internal)",
1367 SHOW_STR
1368 IPV6_STR
1369 OSPF6_STR
1370 "Display Link state database\n"
1371 "Display Router LSAs\n"
1372 "Display Network LSAs\n"
1373 "Display Inter-Area-Prefix LSAs\n"
1374 "Display Inter-Area-Router LSAs\n"
1375 "Display As-External LSAs\n"
1376 "Display Group-Membership LSAs\n"
1377 "Display Type-7 LSAs\n"
1378 "Display Link LSAs\n"
1379 "Display Intra-Area-Prefix LSAs\n"
1380 "Display Self-originated LSAs\n"
1381 "Display details of LSAs\n"
1382 "Dump LSAs\n"
1383 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +01001384 )
hasso508e53e2004-05-18 18:57:06 +00001385
hasso049207c2004-08-04 20:02:13 +00001386DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1387 show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd,
1388 "show ipv6 ospf6 database "
1389 "(router|network|inter-prefix|inter-router|as-external|"
1390 "group-membership|type-7|link|intra-prefix) self-originated "
1391 "linkstate-id A.B.C.D",
1392 SHOW_STR
1393 IPV6_STR
1394 OSPF6_STR
1395 "Display Link state database\n"
1396 "Display Router LSAs\n"
1397 "Display Network LSAs\n"
1398 "Display Inter-Area-Prefix LSAs\n"
1399 "Display Inter-Area-Router LSAs\n"
1400 "Display As-External LSAs\n"
1401 "Display Group-Membership LSAs\n"
1402 "Display Type-7 LSAs\n"
1403 "Display Link LSAs\n"
1404 "Display Intra-Area-Prefix LSAs\n"
1405 "Display Self-originated LSAs\n"
1406 "Search by Link state ID\n"
1407 "Specify Link state ID as IPv4 address notation\n"
1408 )
1409{
1410 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001411 struct listnode *i, *j;
hasso049207c2004-08-04 20:02:13 +00001412 struct ospf6 *o = ospf6;
1413 struct ospf6_area *oa;
1414 struct ospf6_interface *oi;
1415 u_int16_t type = 0;
1416 u_int32_t adv_router = 0;
1417 u_int32_t id = 0;
1418
1419 OSPF6_CMD_CHECK_RUNNING ();
1420
1421 type = parse_type_spec (argc, argv);
1422 argc--;
1423 argv++;
1424
hasso6452df02004-08-15 05:52:07 +00001425 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso049207c2004-08-04 20:02:13 +00001426 {
1427 vty_out (vty, "Link State ID is not parsable: %s%s",
1428 argv[0], VNL);
1429 return CMD_SUCCESS;
1430 }
1431
1432 argc--;
1433 argv++;
1434 level = parse_show_level (argc, argv);
1435
1436 adv_router = o->router_id;
1437
1438 switch (OSPF6_LSA_SCOPE (type))
1439 {
hasso6452df02004-08-15 05:52:07 +00001440 case OSPF6_SCOPE_AREA:
paul1eb8ef22005-04-07 07:30:20 +00001441 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001442 {
hasso049207c2004-08-04 20:02:13 +00001443 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1444 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1445 }
1446 break;
1447
hasso6452df02004-08-15 05:52:07 +00001448 case OSPF6_SCOPE_LINKLOCAL:
paul1eb8ef22005-04-07 07:30:20 +00001449 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001450 {
paul1eb8ef22005-04-07 07:30:20 +00001451 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +00001452 {
hasso049207c2004-08-04 20:02:13 +00001453 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1454 oi->interface->name, oa->name, VNL, VNL);
1455 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1456 }
1457 }
1458 break;
1459
hasso6452df02004-08-15 05:52:07 +00001460 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001461 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1462 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1463 break;
1464
1465 default:
1466 assert (0);
1467 break;
1468 }
1469
1470 vty_out (vty, "%s", VNL);
1471 return CMD_SUCCESS;
1472}
1473
1474ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
1475 show_ipv6_ospf6_database_type_self_originated_linkstate_id_detail_cmd,
1476 "show ipv6 ospf6 database "
1477 "(router|network|inter-prefix|inter-router|as-external|"
1478 "group-membership|type-7|link|intra-prefix) self-originated "
1479 "linkstate-id A.B.C.D (detail|dump|internal)",
1480 SHOW_STR
1481 IPV6_STR
1482 OSPF6_STR
1483 "Display Link state database\n"
1484 "Display Router LSAs\n"
1485 "Display Network LSAs\n"
1486 "Display Inter-Area-Prefix LSAs\n"
1487 "Display Inter-Area-Router LSAs\n"
1488 "Display As-External LSAs\n"
1489 "Display Group-Membership LSAs\n"
1490 "Display Type-7 LSAs\n"
1491 "Display Link LSAs\n"
1492 "Display Intra-Area-Prefix LSAs\n"
1493 "Display Self-originated LSAs\n"
1494 "Search by Link state ID\n"
1495 "Specify Link state ID as IPv4 address notation\n"
1496 "Display details of LSAs\n"
1497 "Dump LSAs\n"
1498 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +01001499 )
hasso049207c2004-08-04 20:02:13 +00001500
hasso508e53e2004-05-18 18:57:06 +00001501DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
1502 show_ipv6_ospf6_database_type_id_self_originated_cmd,
1503 "show ipv6 ospf6 database "
1504 "(router|network|inter-prefix|inter-router|as-external|"
1505 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated",
1506 SHOW_STR
1507 IPV6_STR
1508 OSPF6_STR
1509 "Display Link state database\n"
1510 "Display Router LSAs\n"
1511 "Display Network LSAs\n"
1512 "Display Inter-Area-Prefix LSAs\n"
1513 "Display Inter-Area-Router LSAs\n"
1514 "Display As-External LSAs\n"
1515 "Display Group-Membership LSAs\n"
1516 "Display Type-7 LSAs\n"
1517 "Display Link LSAs\n"
1518 "Display Intra-Area-Prefix LSAs\n"
1519 "Specify Link state ID as IPv4 address notation\n"
1520 "Display Self-originated LSAs\n"
1521 )
1522{
hasso049207c2004-08-04 20:02:13 +00001523 int level;
hasso52dc7ee2004-09-23 19:18:23 +00001524 struct listnode *i, *j;
hasso508e53e2004-05-18 18:57:06 +00001525 struct ospf6 *o = ospf6;
hasso049207c2004-08-04 20:02:13 +00001526 struct ospf6_area *oa;
1527 struct ospf6_interface *oi;
hasso508e53e2004-05-18 18:57:06 +00001528 u_int16_t type = 0;
hasso049207c2004-08-04 20:02:13 +00001529 u_int32_t adv_router = 0;
hasso508e53e2004-05-18 18:57:06 +00001530 u_int32_t id = 0;
1531
1532 OSPF6_CMD_CHECK_RUNNING ();
1533
hasso049207c2004-08-04 20:02:13 +00001534 type = parse_type_spec (argc, argv);
1535 argc--;
1536 argv++;
hasso508e53e2004-05-18 18:57:06 +00001537
hasso6452df02004-08-15 05:52:07 +00001538 if ((inet_pton (AF_INET, argv[0], &id)) != 1)
hasso508e53e2004-05-18 18:57:06 +00001539 {
1540 vty_out (vty, "Link State ID is not parsable: %s%s",
hasso049207c2004-08-04 20:02:13 +00001541 argv[0], VNL);
hasso508e53e2004-05-18 18:57:06 +00001542 return CMD_SUCCESS;
1543 }
1544
hasso049207c2004-08-04 20:02:13 +00001545 argc--;
1546 argv++;
1547 level = parse_show_level (argc, argv);
1548
1549 adv_router = o->router_id;
1550
1551 switch (OSPF6_LSA_SCOPE (type))
hasso508e53e2004-05-18 18:57:06 +00001552 {
hasso6452df02004-08-15 05:52:07 +00001553 case OSPF6_SCOPE_AREA:
paul1eb8ef22005-04-07 07:30:20 +00001554 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001555 {
hasso049207c2004-08-04 20:02:13 +00001556 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
1557 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1558 }
1559 break;
1560
hasso6452df02004-08-15 05:52:07 +00001561 case OSPF6_SCOPE_LINKLOCAL:
paul1eb8ef22005-04-07 07:30:20 +00001562 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
hasso049207c2004-08-04 20:02:13 +00001563 {
paul1eb8ef22005-04-07 07:30:20 +00001564 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
hasso049207c2004-08-04 20:02:13 +00001565 {
hasso049207c2004-08-04 20:02:13 +00001566 vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
1567 oi->interface->name, oa->name, VNL, VNL);
1568 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1569 }
1570 }
1571 break;
1572
hasso6452df02004-08-15 05:52:07 +00001573 case OSPF6_SCOPE_AS:
hasso049207c2004-08-04 20:02:13 +00001574 vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
1575 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1576 break;
1577
1578 default:
1579 assert (0);
1580 break;
hasso508e53e2004-05-18 18:57:06 +00001581 }
1582
hasso049207c2004-08-04 20:02:13 +00001583 vty_out (vty, "%s", VNL);
hasso508e53e2004-05-18 18:57:06 +00001584 return CMD_SUCCESS;
1585}
1586
1587ALIAS (show_ipv6_ospf6_database_type_id_self_originated,
1588 show_ipv6_ospf6_database_type_id_self_originated_detail_cmd,
1589 "show ipv6 ospf6 database "
1590 "(router|network|inter-prefix|inter-router|as-external|"
1591 "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated "
hasso049207c2004-08-04 20:02:13 +00001592 "(detail|dump|internal)",
hasso508e53e2004-05-18 18:57:06 +00001593 SHOW_STR
1594 IPV6_STR
1595 OSPF6_STR
1596 "Display Link state database\n"
1597 "Display Router LSAs\n"
1598 "Display Network LSAs\n"
1599 "Display Inter-Area-Prefix LSAs\n"
1600 "Display Inter-Area-Router LSAs\n"
1601 "Display As-External LSAs\n"
1602 "Display Group-Membership LSAs\n"
1603 "Display Type-7 LSAs\n"
1604 "Display Link LSAs\n"
1605 "Display Intra-Area-Prefix LSAs\n"
hasso508e53e2004-05-18 18:57:06 +00001606 "Display Self-originated LSAs\n"
hasso049207c2004-08-04 20:02:13 +00001607 "Search by Link state ID\n"
1608 "Specify Link state ID as IPv4 address notation\n"
hasso508e53e2004-05-18 18:57:06 +00001609 "Display details of LSAs\n"
1610 "Dump LSAs\n"
1611 "Display LSA's internal information\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +01001612 )
hasso508e53e2004-05-18 18:57:06 +00001613
hasso6452df02004-08-15 05:52:07 +00001614
1615DEFUN (show_ipv6_ospf6_border_routers,
1616 show_ipv6_ospf6_border_routers_cmd,
1617 "show ipv6 ospf6 border-routers",
1618 SHOW_STR
1619 IP6_STR
1620 OSPF6_STR
1621 "Display routing table for ABR and ASBR\n"
1622 )
1623{
1624 u_int32_t adv_router;
1625 void (*showfunc) (struct vty *, struct ospf6_route *);
1626 struct ospf6_route *ro;
1627 struct prefix prefix;
1628
1629 OSPF6_CMD_CHECK_RUNNING ();
1630
1631 if (argc && ! strcmp ("detail", argv[0]))
1632 {
1633 showfunc = ospf6_route_show_detail;
1634 argc--;
1635 argv++;
1636 }
1637 else
1638 showfunc = ospf6_brouter_show;
1639
1640 if (argc)
1641 {
1642 if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
1643 {
1644 vty_out (vty, "Router ID is not parsable: %s%s", argv[0], VNL);
1645 return CMD_SUCCESS;
1646 }
1647
1648 ospf6_linkstate_prefix (adv_router, 0, &prefix);
1649 ro = ospf6_route_lookup (&prefix, ospf6->brouter_table);
Jon597fa7c2009-02-11 17:27:06 -08001650 if (!ro)
1651 {
1652 vty_out (vty, "No Route found for Router ID: %s%s", argv[0], VNL);
1653 return CMD_SUCCESS;
1654 }
1655
hasso6452df02004-08-15 05:52:07 +00001656 ospf6_route_show_detail (vty, ro);
1657 return CMD_SUCCESS;
1658 }
1659
1660 if (showfunc == ospf6_brouter_show)
1661 ospf6_brouter_show_header (vty);
1662
1663 for (ro = ospf6_route_head (ospf6->brouter_table); ro;
1664 ro = ospf6_route_next (ro))
1665 (*showfunc) (vty, ro);
1666
1667 return CMD_SUCCESS;
1668}
1669
1670ALIAS (show_ipv6_ospf6_border_routers,
1671 show_ipv6_ospf6_border_routers_detail_cmd,
1672 "show ipv6 ospf6 border-routers (A.B.C.D|detail)",
1673 SHOW_STR
1674 IP6_STR
1675 OSPF6_STR
1676 "Display routing table for ABR and ASBR\n"
1677 "Specify Router-ID\n"
1678 "Display Detail\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +01001679 )
hasso6452df02004-08-15 05:52:07 +00001680
hasso4846ef62004-09-03 06:04:00 +00001681DEFUN (show_ipv6_ospf6_linkstate,
1682 show_ipv6_ospf6_linkstate_cmd,
1683 "show ipv6 ospf6 linkstate",
1684 SHOW_STR
1685 IP6_STR
1686 OSPF6_STR
1687 "Display linkstate routing table\n"
1688 )
1689{
hasso52dc7ee2004-09-23 19:18:23 +00001690 struct listnode *node;
hasso4846ef62004-09-03 06:04:00 +00001691 struct ospf6_area *oa;
1692
paul1eb8ef22005-04-07 07:30:20 +00001693 for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
hasso4846ef62004-09-03 06:04:00 +00001694 {
hasso4846ef62004-09-03 06:04:00 +00001695 vty_out (vty, "%s SPF Result in Area %s%s%s",
1696 VNL, oa->name, VNL, VNL);
1697 ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table);
1698 }
1699
1700 vty_out (vty, "%s", VNL);
1701 return CMD_SUCCESS;
1702}
1703
1704ALIAS (show_ipv6_ospf6_linkstate,
1705 show_ipv6_ospf6_linkstate_router_cmd,
1706 "show ipv6 ospf6 linkstate router A.B.C.D",
1707 SHOW_STR
1708 IP6_STR
1709 OSPF6_STR
1710 "Display linkstate routing table\n"
1711 "Display Router Entry\n"
1712 "Specify Router ID as IPv4 address notation\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +01001713 )
hasso4846ef62004-09-03 06:04:00 +00001714
1715ALIAS (show_ipv6_ospf6_linkstate,
1716 show_ipv6_ospf6_linkstate_network_cmd,
1717 "show ipv6 ospf6 linkstate network A.B.C.D A.B.C.D",
1718 SHOW_STR
1719 IP6_STR
1720 OSPF6_STR
1721 "Display linkstate routing table\n"
1722 "Display Network Entry\n"
1723 "Specify Router ID as IPv4 address notation\n"
1724 "Specify Link state ID as IPv4 address notation\n"
Paul Jakma6ac29a52008-08-15 13:45:30 +01001725 )
hasso4846ef62004-09-03 06:04:00 +00001726
1727DEFUN (show_ipv6_ospf6_linkstate_detail,
1728 show_ipv6_ospf6_linkstate_detail_cmd,
1729 "show ipv6 ospf6 linkstate detail",
1730 SHOW_STR
1731 IP6_STR
1732 OSPF6_STR
1733 "Display linkstate routing table\n"
1734 )
1735{
paul0c083ee2004-10-10 12:54:58 +00001736 const char *sargv[CMD_ARGC_MAX];
hasso4846ef62004-09-03 06:04:00 +00001737 int i, sargc;
hasso52dc7ee2004-09-23 19:18:23 +00001738 struct listnode *node;
hasso4846ef62004-09-03 06:04:00 +00001739 struct ospf6_area *oa;
1740
1741 /* copy argv to sargv and then append "detail" */
1742 for (i = 0; i < argc; i++)
1743 sargv[i] = argv[i];
1744 sargc = argc;
1745 sargv[sargc++] = "detail";
1746 sargv[sargc] = NULL;
1747
paul1eb8ef22005-04-07 07:30:20 +00001748 for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
hasso4846ef62004-09-03 06:04:00 +00001749 {
hasso4846ef62004-09-03 06:04:00 +00001750 vty_out (vty, "%s SPF Result in Area %s%s%s",
1751 VNL, oa->name, VNL, VNL);
1752 ospf6_linkstate_table_show (vty, sargc, sargv, oa->spf_table);
1753 }
1754
1755 vty_out (vty, "%s", VNL);
1756 return CMD_SUCCESS;
1757}
hasso6452df02004-08-15 05:52:07 +00001758
paul718e3742002-12-13 20:15:29 +00001759/* Install ospf related commands. */
1760void
Paul Jakma6ac29a52008-08-15 13:45:30 +01001761ospf6_init (void)
paul718e3742002-12-13 20:15:29 +00001762{
hasso1e058382004-09-01 21:36:14 +00001763 ospf6_top_init ();
1764 ospf6_area_init ();
1765 ospf6_interface_init ();
1766 ospf6_neighbor_init ();
Donald Sharp71252932015-09-24 09:25:19 -04001767 ospf6_zebra_init (master);
hasso1e058382004-09-01 21:36:14 +00001768
1769 ospf6_lsa_init ();
1770 ospf6_spf_init ();
1771 ospf6_intra_init ();
1772 ospf6_asbr_init ();
1773 ospf6_abr_init ();
1774
hassoef1bbf52004-10-08 12:04:21 +00001775#ifdef HAVE_SNMP
paul0c083ee2004-10-10 12:54:58 +00001776 ospf6_snmp_init (master);
hassoef1bbf52004-10-08 12:04:21 +00001777#endif /*HAVE_SNMP*/
1778
hasso508e53e2004-05-18 18:57:06 +00001779 install_node (&debug_node, config_write_ospf6_debug);
paul718e3742002-12-13 20:15:29 +00001780
hasso508e53e2004-05-18 18:57:06 +00001781 install_element_ospf6_debug_message ();
1782 install_element_ospf6_debug_lsa ();
1783 install_element_ospf6_debug_interface ();
1784 install_element_ospf6_debug_neighbor ();
1785 install_element_ospf6_debug_zebra ();
1786 install_element_ospf6_debug_spf ();
1787 install_element_ospf6_debug_route ();
Paul Jakmacb4b8842006-05-15 10:39:30 +00001788 install_element_ospf6_debug_brouter ();
hasso508e53e2004-05-18 18:57:06 +00001789 install_element_ospf6_debug_asbr ();
hasso6452df02004-08-15 05:52:07 +00001790 install_element_ospf6_debug_abr ();
hasso1e058382004-09-01 21:36:14 +00001791 install_element_ospf6_debug_flood ();
hasso508e53e2004-05-18 18:57:06 +00001792
paul718e3742002-12-13 20:15:29 +00001793 install_element (VIEW_NODE, &show_version_ospf6_cmd);
hasso049207c2004-08-04 20:02:13 +00001794
hasso6452df02004-08-15 05:52:07 +00001795 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_cmd);
1796 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_detail_cmd);
hasso6452df02004-08-15 05:52:07 +00001797
hasso4846ef62004-09-03 06:04:00 +00001798 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);
hasso4846ef62004-09-03 06:04:00 +00001802
hasso049207c2004-08-04 20:02:13 +00001803#define INSTALL(n,c) \
hassob31b8132005-05-31 10:24:28 +00001804 install_element (n ## _NODE, &show_ipv6_ospf6_ ## c)
hasso049207c2004-08-04 20:02:13 +00001805
1806 INSTALL (VIEW, database_cmd);
1807 INSTALL (VIEW, database_detail_cmd);
1808 INSTALL (VIEW, database_type_cmd);
1809 INSTALL (VIEW, database_type_detail_cmd);
1810 INSTALL (VIEW, database_id_cmd);
1811 INSTALL (VIEW, database_id_detail_cmd);
1812 INSTALL (VIEW, database_linkstate_id_cmd);
1813 INSTALL (VIEW, database_linkstate_id_detail_cmd);
1814 INSTALL (VIEW, database_router_cmd);
1815 INSTALL (VIEW, database_router_detail_cmd);
1816 INSTALL (VIEW, database_adv_router_cmd);
1817 INSTALL (VIEW, database_adv_router_detail_cmd);
1818 INSTALL (VIEW, database_type_id_cmd);
1819 INSTALL (VIEW, database_type_id_detail_cmd);
1820 INSTALL (VIEW, database_type_linkstate_id_cmd);
1821 INSTALL (VIEW, database_type_linkstate_id_detail_cmd);
1822 INSTALL (VIEW, database_type_router_cmd);
1823 INSTALL (VIEW, database_type_router_detail_cmd);
1824 INSTALL (VIEW, database_type_adv_router_cmd);
1825 INSTALL (VIEW, database_type_adv_router_detail_cmd);
1826 INSTALL (VIEW, database_adv_router_linkstate_id_cmd);
1827 INSTALL (VIEW, database_adv_router_linkstate_id_detail_cmd);
1828 INSTALL (VIEW, database_id_router_cmd);
1829 INSTALL (VIEW, database_id_router_detail_cmd);
1830 INSTALL (VIEW, database_type_id_router_cmd);
1831 INSTALL (VIEW, database_type_id_router_detail_cmd);
1832 INSTALL (VIEW, database_type_adv_router_linkstate_id_cmd);
1833 INSTALL (VIEW, database_type_adv_router_linkstate_id_detail_cmd);
1834 INSTALL (VIEW, database_self_originated_cmd);
1835 INSTALL (VIEW, database_self_originated_detail_cmd);
1836 INSTALL (VIEW, database_type_self_originated_cmd);
1837 INSTALL (VIEW, database_type_self_originated_detail_cmd);
1838 INSTALL (VIEW, database_type_id_self_originated_cmd);
1839 INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
1840 INSTALL (VIEW, database_type_self_originated_linkstate_id_cmd);
1841 INSTALL (VIEW, database_type_self_originated_linkstate_id_detail_cmd);
hasso049207c2004-08-04 20:02:13 +00001842
hasso508e53e2004-05-18 18:57:06 +00001843 /* Make ospf protocol socket. */
1844 ospf6_serv_sock ();
1845 thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
paul718e3742002-12-13 20:15:29 +00001846}
1847
Phil Laverdiereef2d5d12012-01-02 20:04:26 +04001848void
1849ospf6_clean (void)
1850{
1851 if (ospf6->route_table)
1852 ospf6_route_remove_all (ospf6->route_table);
1853 if (ospf6->brouter_table)
1854 ospf6_route_remove_all (ospf6->brouter_table);
1855}