]> git.proxmox.com Git - mirror_frr.git/blob - ospf6d/ospf6d.c
*: remove VTYNL, part 3 of 6
[mirror_frr.git] / ospf6d / ospf6d.c
1 /*
2 * Copyright (C) 2003 Yasuhiro Ohara
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 along
17 * with this program; see the file COPYING; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21 #include <zebra.h>
22
23 #include "thread.h"
24 #include "linklist.h"
25 #include "vty.h"
26 #include "command.h"
27
28 #include "ospf6_proto.h"
29 #include "ospf6_network.h"
30 #include "ospf6_lsa.h"
31 #include "ospf6_lsdb.h"
32 #include "ospf6_message.h"
33 #include "ospf6_route.h"
34 #include "ospf6_zebra.h"
35 #include "ospf6_spf.h"
36 #include "ospf6_top.h"
37 #include "ospf6_area.h"
38 #include "ospf6_interface.h"
39 #include "ospf6_neighbor.h"
40 #include "ospf6_intra.h"
41 #include "ospf6_asbr.h"
42 #include "ospf6_abr.h"
43 #include "ospf6_flood.h"
44 #include "ospf6d.h"
45 #include "ospf6_bfd.h"
46
47 char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION;
48
49 struct route_node *
50 route_prev (struct route_node *node)
51 {
52 struct route_node *end;
53 struct route_node *prev = NULL;
54
55 end = node;
56 node = node->parent;
57 if (node)
58 route_lock_node (node);
59 while (node)
60 {
61 prev = node;
62 node = route_next (node);
63 if (node == end)
64 {
65 route_unlock_node (node);
66 node = NULL;
67 }
68 }
69 route_unlock_node (end);
70 if (prev)
71 route_lock_node (prev);
72
73 return prev;
74 }
75
76
77 /* show database functions */
78 DEFUN (show_version_ospf6,
79 show_version_ospf6_cmd,
80 "show version ospf6",
81 SHOW_STR
82 "Display version\n"
83 "Display ospf6d version\n"
84 )
85 {
86 vty_out (vty, "Zebra OSPF6d Version: %s%s",
87 ospf6_daemon_version, VTYNL);
88
89 return CMD_SUCCESS;
90 }
91
92 static struct cmd_node debug_node =
93 {
94 DEBUG_NODE,
95 "",
96 1 /* VTYSH */
97 };
98
99 static int
100 config_write_ospf6_debug (struct vty *vty)
101 {
102 config_write_ospf6_debug_message (vty);
103 config_write_ospf6_debug_lsa (vty);
104 config_write_ospf6_debug_zebra (vty);
105 config_write_ospf6_debug_interface (vty);
106 config_write_ospf6_debug_neighbor (vty);
107 config_write_ospf6_debug_spf (vty);
108 config_write_ospf6_debug_route (vty);
109 config_write_ospf6_debug_brouter (vty);
110 config_write_ospf6_debug_asbr (vty);
111 config_write_ospf6_debug_abr (vty);
112 config_write_ospf6_debug_flood (vty);
113 vty_out (vty, "!\n");
114 return 0;
115 }
116
117 #define AREA_LSDB_TITLE_FORMAT \
118 "%s Area Scoped Link State Database (Area %s)%s%s"
119 #define IF_LSDB_TITLE_FORMAT \
120 "%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s"
121 #define AS_LSDB_TITLE_FORMAT \
122 "%s AS Scoped Link State Database%s%s"
123
124 static int
125 parse_show_level (int idx_level, int argc, struct cmd_token **argv)
126 {
127 int level = OSPF6_LSDB_SHOW_LEVEL_NORMAL;
128
129 if (argc > idx_level)
130 {
131 if (strmatch (argv[idx_level]->text, "detail"))
132 level = OSPF6_LSDB_SHOW_LEVEL_DETAIL;
133 else if (strmatch (argv[idx_level]->text, "dump"))
134 level = OSPF6_LSDB_SHOW_LEVEL_DUMP;
135 else if (strmatch (argv[idx_level]->text, "internal"))
136 level = OSPF6_LSDB_SHOW_LEVEL_INTERNAL;
137 }
138
139 return level;
140 }
141
142 static u_int16_t
143 parse_type_spec (int idx_lsa, int argc, struct cmd_token **argv)
144 {
145 u_int16_t type = 0;
146
147 if (argc > idx_lsa)
148 {
149 if (strmatch (argv[idx_lsa]->text, "router"))
150 type = htons (OSPF6_LSTYPE_ROUTER);
151 else if (strmatch (argv[idx_lsa]->text, "network"))
152 type = htons (OSPF6_LSTYPE_NETWORK);
153 else if (strmatch (argv[idx_lsa]->text, "as-external"))
154 type = htons (OSPF6_LSTYPE_AS_EXTERNAL);
155 else if (strmatch (argv[idx_lsa]->text, "intra-prefix"))
156 type = htons (OSPF6_LSTYPE_INTRA_PREFIX);
157 else if (strmatch (argv[idx_lsa]->text, "inter-router"))
158 type = htons (OSPF6_LSTYPE_INTER_ROUTER);
159 else if (strmatch (argv[idx_lsa]->text, "inter-prefix"))
160 type = htons (OSPF6_LSTYPE_INTER_PREFIX);
161 else if (strmatch (argv[idx_lsa]->text, "link"))
162 type = htons (OSPF6_LSTYPE_LINK);
163 }
164
165 return type;
166 }
167
168 DEFUN (show_ipv6_ospf6_database,
169 show_ipv6_ospf6_database_cmd,
170 "show ipv6 ospf6 database [<detail|dump|internal>]",
171 SHOW_STR
172 IPV6_STR
173 OSPF6_STR
174 "Display Link state database\n"
175 "Display details of LSAs\n"
176 "Dump LSAs\n"
177 "Display LSA's internal information\n")
178 {
179 int idx_level = 4;
180 int level;
181 struct listnode *i, *j;
182 struct ospf6 *o = ospf6;
183 struct ospf6_area *oa;
184 struct ospf6_interface *oi;
185
186 OSPF6_CMD_CHECK_RUNNING ();
187
188 level = parse_show_level (idx_level, argc, argv);
189
190 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
191 {
192 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
193 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
194 }
195
196 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
197 {
198 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
199 {
200 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
201 oi->interface->name, oa->name, VTYNL, VTYNL);
202 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
203 }
204 }
205
206 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
207 ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb);
208
209 vty_out (vty, "\n");
210 return CMD_SUCCESS;
211 }
212
213 DEFUN (show_ipv6_ospf6_database_type,
214 show_ipv6_ospf6_database_type_cmd,
215 "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> [<detail|dump|internal>]",
216 SHOW_STR
217 IPV6_STR
218 OSPF6_STR
219 "Display Link state database\n"
220 "Display Router LSAs\n"
221 "Display Network LSAs\n"
222 "Display Inter-Area-Prefix LSAs\n"
223 "Display Inter-Area-Router LSAs\n"
224 "Display As-External LSAs\n"
225 "Display Group-Membership LSAs\n"
226 "Display Type-7 LSAs\n"
227 "Display Link LSAs\n"
228 "Display Intra-Area-Prefix LSAs\n"
229 "Display details of LSAs\n"
230 "Dump LSAs\n"
231 "Display LSA's internal information\n"
232 )
233 {
234 int idx_lsa = 4;
235 int idx_level = 5;
236 int level;
237 struct listnode *i, *j;
238 struct ospf6 *o = ospf6;
239 struct ospf6_area *oa;
240 struct ospf6_interface *oi;
241 u_int16_t type = 0;
242
243 OSPF6_CMD_CHECK_RUNNING ();
244
245 type = parse_type_spec (idx_lsa, argc, argv);
246 level = parse_show_level (idx_level, argc, argv);
247
248 switch (OSPF6_LSA_SCOPE (type))
249 {
250 case OSPF6_SCOPE_AREA:
251 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
252 {
253 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
254 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
255 }
256 break;
257
258 case OSPF6_SCOPE_LINKLOCAL:
259 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
260 {
261 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
262 {
263 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
264 oi->interface->name, oa->name, VTYNL, VTYNL);
265 ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
266 }
267 }
268 break;
269
270 case OSPF6_SCOPE_AS:
271 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
272 ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb);
273 break;
274
275 default:
276 assert (0);
277 break;
278 }
279
280 vty_out (vty, "\n");
281 return CMD_SUCCESS;
282 }
283
284 DEFUN (show_ipv6_ospf6_database_id,
285 show_ipv6_ospf6_database_id_cmd,
286 "show ipv6 ospf6 database <*|linkstate-id> A.B.C.D [<detail|dump|internal>]",
287 SHOW_STR
288 IPV6_STR
289 OSPF6_STR
290 "Display Link state database\n"
291 "Any Link state Type\n"
292 "Search by Link state ID\n"
293 "Specify Link state ID as IPv4 address notation\n"
294 "Display details of LSAs\n"
295 "Dump LSAs\n"
296 "Display LSA's internal information\n")
297 {
298 int idx_ipv4 = 5;
299 int idx_level = 6;
300 int level;
301 struct listnode *i, *j;
302 struct ospf6 *o = ospf6;
303 struct ospf6_area *oa;
304 struct ospf6_interface *oi;
305 u_int32_t id = 0;
306
307 OSPF6_CMD_CHECK_RUNNING ();
308
309 if (argv[idx_ipv4]->type == IPV4_TKN)
310 inet_pton (AF_INET, argv[idx_ipv4]->arg, &id);
311
312 level = parse_show_level (idx_level, argc, argv);
313
314 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
315 {
316 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
317 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
318 }
319
320 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
321 {
322 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
323 {
324 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
325 oi->interface->name, oa->name, VTYNL, VTYNL);
326 ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
327 }
328 }
329
330 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
331 ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb);
332
333 vty_out (vty, "\n");
334 return CMD_SUCCESS;
335 }
336
337 DEFUN (show_ipv6_ospf6_database_router,
338 show_ipv6_ospf6_database_router_cmd,
339 "show ipv6 ospf6 database <*|adv-router> * A.B.C.D <detail|dump|internal>",
340 SHOW_STR
341 IPV6_STR
342 OSPF6_STR
343 "Display Link state database\n"
344 "Any Link state Type\n"
345 "Search by Advertising Router\n"
346 "Any Link state ID\n"
347 "Specify Advertising Router as IPv4 address notation\n"
348 "Display details of LSAs\n"
349 "Dump LSAs\n"
350 "Display LSA's internal information\n")
351 {
352 int idx_ipv4 = 6;
353 int idx_level = 7;
354 int level;
355 struct listnode *i, *j;
356 struct ospf6 *o = ospf6;
357 struct ospf6_area *oa;
358 struct ospf6_interface *oi;
359 u_int32_t adv_router = 0;
360
361 OSPF6_CMD_CHECK_RUNNING ();
362 inet_pton (AF_INET, argv[idx_ipv4]->arg, &adv_router);
363 level = parse_show_level (idx_level, argc, argv);
364
365 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
366 {
367 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
368 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
369 }
370
371 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
372 {
373 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
374 {
375 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
376 oi->interface->name, oa->name, VTYNL, VTYNL);
377 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
378 }
379 }
380
381 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
382 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
383
384 vty_out (vty, "\n");
385 return CMD_SUCCESS;
386 }
387
388 DEFUN (show_ipv6_ospf6_database_type_id,
389 show_ipv6_ospf6_database_type_id_cmd,
390 "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> linkstate-id A.B.C.D [<detail|dump|internal>]",
391 SHOW_STR
392 IPV6_STR
393 OSPF6_STR
394 "Display Link state database\n"
395 "Display Router LSAs\n"
396 "Display Network LSAs\n"
397 "Display Inter-Area-Prefix LSAs\n"
398 "Display Inter-Area-Router LSAs\n"
399 "Display As-External LSAs\n"
400 "Display Group-Membership LSAs\n"
401 "Display Type-7 LSAs\n"
402 "Display Link LSAs\n"
403 "Display Intra-Area-Prefix LSAs\n"
404 "Search by Link state ID\n"
405 "Specify Link state ID as IPv4 address notation\n"
406 "Display details of LSAs\n"
407 "Dump LSAs\n"
408 "Display LSA's internal information\n"
409 )
410 {
411 int idx_lsa = 4;
412 int idx_ipv4 = 6;
413 int idx_level = 7;
414 int level;
415 struct listnode *i, *j;
416 struct ospf6 *o = ospf6;
417 struct ospf6_area *oa;
418 struct ospf6_interface *oi;
419 u_int16_t type = 0;
420 u_int32_t id = 0;
421
422 OSPF6_CMD_CHECK_RUNNING ();
423
424 type = parse_type_spec (idx_lsa, argc, argv);
425 inet_pton (AF_INET, argv[idx_ipv4]->arg, &id);
426 level = parse_show_level (idx_level, argc, argv);
427
428 switch (OSPF6_LSA_SCOPE (type))
429 {
430 case OSPF6_SCOPE_AREA:
431 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
432 {
433 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
434 ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
435 }
436 break;
437
438 case OSPF6_SCOPE_LINKLOCAL:
439 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
440 {
441 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
442 {
443 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
444 oi->interface->name, oa->name, VTYNL, VTYNL);
445 ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
446 }
447 }
448 break;
449
450 case OSPF6_SCOPE_AS:
451 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
452 ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb);
453 break;
454
455 default:
456 assert (0);
457 break;
458 }
459
460 vty_out (vty, "\n");
461 return CMD_SUCCESS;
462 }
463
464 DEFUN (show_ipv6_ospf6_database_type_router,
465 show_ipv6_ospf6_database_type_router_cmd,
466 "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> <*|adv-router> A.B.C.D [<detail|dump|internal>]",
467 SHOW_STR
468 IPV6_STR
469 OSPF6_STR
470 "Display Link state database\n"
471 "Display Router LSAs\n"
472 "Display Network LSAs\n"
473 "Display Inter-Area-Prefix LSAs\n"
474 "Display Inter-Area-Router LSAs\n"
475 "Display As-External LSAs\n"
476 "Display Group-Membership LSAs\n"
477 "Display Type-7 LSAs\n"
478 "Display Link LSAs\n"
479 "Display Intra-Area-Prefix LSAs\n"
480 "Any Link state ID\n"
481 "Search by Advertising Router\n"
482 "Specify Advertising Router as IPv4 address notation\n"
483 "Display details of LSAs\n"
484 "Dump LSAs\n"
485 "Display LSA's internal information\n"
486 )
487 {
488 int idx_lsa = 4;
489 int idx_ipv4 = 6;
490 int idx_level = 7;
491 int level;
492 struct listnode *i, *j;
493 struct ospf6 *o = ospf6;
494 struct ospf6_area *oa;
495 struct ospf6_interface *oi;
496 u_int16_t type = 0;
497 u_int32_t adv_router = 0;
498
499 OSPF6_CMD_CHECK_RUNNING ();
500
501 type = parse_type_spec (idx_lsa, argc, argv);
502 inet_pton (AF_INET, argv[idx_ipv4]->arg, &adv_router);
503 level = parse_show_level (idx_level, argc, argv);
504
505 switch (OSPF6_LSA_SCOPE (type))
506 {
507 case OSPF6_SCOPE_AREA:
508 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
509 {
510 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
511 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
512 }
513 break;
514
515 case OSPF6_SCOPE_LINKLOCAL:
516 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
517 {
518 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
519 {
520 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
521 oi->interface->name, oa->name, VTYNL, VTYNL);
522 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
523 }
524 }
525 break;
526
527 case OSPF6_SCOPE_AS:
528 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
529 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
530 break;
531
532 default:
533 assert (0);
534 break;
535 }
536
537 vty_out (vty, "\n");
538 return CMD_SUCCESS;
539 }
540
541
542 DEFUN (show_ipv6_ospf6_database_id_router,
543 show_ipv6_ospf6_database_id_router_cmd,
544 "show ipv6 ospf6 database * A.B.C.D A.B.C.D [<detail|dump|internal>]",
545 SHOW_STR
546 IPV6_STR
547 OSPF6_STR
548 "Display Link state database\n"
549 "Any Link state Type\n"
550 "Specify Link state ID as IPv4 address notation\n"
551 "Specify Advertising Router as IPv4 address notation\n"
552 "Display details of LSAs\n"
553 "Dump LSAs\n"
554 "Display LSA's internal information\n"
555 )
556 {
557 int idx_ls_id = 5;
558 int idx_adv_rtr = 6;
559 int idx_level = 7;
560 int level;
561 struct listnode *i, *j;
562 struct ospf6 *o = ospf6;
563 struct ospf6_area *oa;
564 struct ospf6_interface *oi;
565 u_int32_t id = 0;
566 u_int32_t adv_router = 0;
567
568 OSPF6_CMD_CHECK_RUNNING ();
569 inet_pton (AF_INET, argv[idx_ls_id]->arg, &id);
570 inet_pton (AF_INET, argv[idx_adv_rtr]->arg, &adv_router);
571 level = parse_show_level (idx_level, argc, argv);
572
573 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
574 {
575 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
576 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
577 }
578
579 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
580 {
581 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
582 {
583 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
584 oi->interface->name, oa->name, VTYNL, VTYNL);
585 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
586 }
587 }
588
589 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
590 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
591
592 vty_out (vty, "\n");
593 return CMD_SUCCESS;
594 }
595
596
597 DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
598 show_ipv6_ospf6_database_adv_router_linkstate_id_cmd,
599 "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D [<detail|dump|internal>]",
600 SHOW_STR
601 IPV6_STR
602 OSPF6_STR
603 "Display Link state database\n"
604 "Search by Advertising Router\n"
605 "Specify Advertising Router as IPv4 address notation\n"
606 "Search by Link state ID\n"
607 "Specify Link state ID as IPv4 address notation\n"
608 "Display details of LSAs\n"
609 "Dump LSAs\n"
610 "Display LSA's internal information\n")
611 {
612 int idx_adv_rtr = 5;
613 int idx_ls_id = 7;
614 int idx_level = 8;
615 int level;
616 struct listnode *i, *j;
617 struct ospf6 *o = ospf6;
618 struct ospf6_area *oa;
619 struct ospf6_interface *oi;
620 u_int32_t id = 0;
621 u_int32_t adv_router = 0;
622
623 OSPF6_CMD_CHECK_RUNNING ();
624 inet_pton (AF_INET, argv[idx_adv_rtr]->arg, &adv_router);
625 inet_pton (AF_INET, argv[idx_ls_id]->arg, &id);
626 level = parse_show_level (idx_level, argc, argv);
627
628 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
629 {
630 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
631 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
632 }
633
634 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
635 {
636 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
637 {
638 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
639 oi->interface->name, oa->name, VTYNL, VTYNL);
640 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
641 }
642 }
643
644 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
645 ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
646
647 vty_out (vty, "\n");
648 return CMD_SUCCESS;
649 }
650
651 DEFUN (show_ipv6_ospf6_database_type_id_router,
652 show_ipv6_ospf6_database_type_id_router_cmd,
653 "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> A.B.C.D A.B.C.D [<dump|internal>]",
654 SHOW_STR
655 IPV6_STR
656 OSPF6_STR
657 "Display Link state database\n"
658 "Display Router LSAs\n"
659 "Display Network LSAs\n"
660 "Display Inter-Area-Prefix LSAs\n"
661 "Display Inter-Area-Router LSAs\n"
662 "Display As-External LSAs\n"
663 "Display Group-Membership LSAs\n"
664 "Display Type-7 LSAs\n"
665 "Display Link LSAs\n"
666 "Display Intra-Area-Prefix LSAs\n"
667 "Specify Link state ID as IPv4 address notation\n"
668 "Specify Advertising Router as IPv4 address notation\n"
669 "Dump LSAs\n"
670 "Display LSA's internal information\n")
671 {
672 int idx_lsa = 4;
673 int idx_ls_id = 5;
674 int idx_adv_rtr = 6;
675 int idx_level = 7;
676 int level;
677 struct listnode *i, *j;
678 struct ospf6 *o = ospf6;
679 struct ospf6_area *oa;
680 struct ospf6_interface *oi;
681 u_int16_t type = 0;
682 u_int32_t id = 0;
683 u_int32_t adv_router = 0;
684
685 OSPF6_CMD_CHECK_RUNNING ();
686
687 type = parse_type_spec (idx_lsa, argc, argv);
688 inet_pton (AF_INET, argv[idx_ls_id]->arg, &id);
689 inet_pton (AF_INET, argv[idx_adv_rtr]->arg, &adv_router);
690 level = parse_show_level (idx_level, argc, argv);
691
692 switch (OSPF6_LSA_SCOPE (type))
693 {
694 case OSPF6_SCOPE_AREA:
695 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
696 {
697 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
698 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
699 }
700 break;
701
702 case OSPF6_SCOPE_LINKLOCAL:
703 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
704 {
705 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
706 {
707 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
708 oi->interface->name, oa->name, VTYNL, VTYNL);
709 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
710 }
711 }
712 break;
713
714 case OSPF6_SCOPE_AS:
715 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
716 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
717 break;
718
719 default:
720 assert (0);
721 break;
722 }
723
724 vty_out (vty, "\n");
725 return CMD_SUCCESS;
726 }
727
728
729 DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
730 show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd,
731 "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> adv-router A.B.C.D linkstate-id A.B.C.D [<dump|internal>]",
732 SHOW_STR
733 IPV6_STR
734 OSPF6_STR
735 "Display Link state database\n"
736 "Display Router LSAs\n"
737 "Display Network LSAs\n"
738 "Display Inter-Area-Prefix LSAs\n"
739 "Display Inter-Area-Router LSAs\n"
740 "Display As-External LSAs\n"
741 "Display Group-Membership LSAs\n"
742 "Display Type-7 LSAs\n"
743 "Display Link LSAs\n"
744 "Display Intra-Area-Prefix LSAs\n"
745 "Search by Advertising Router\n"
746 "Specify Advertising Router as IPv4 address notation\n"
747 "Search by Link state ID\n"
748 "Specify Link state ID as IPv4 address notation\n"
749 "Dump LSAs\n"
750 "Display LSA's internal information\n")
751 {
752 int idx_lsa = 4;
753 int idx_adv_rtr = 6;
754 int idx_ls_id = 8;
755 int idx_level = 9;
756 int level;
757 struct listnode *i, *j;
758 struct ospf6 *o = ospf6;
759 struct ospf6_area *oa;
760 struct ospf6_interface *oi;
761 u_int16_t type = 0;
762 u_int32_t id = 0;
763 u_int32_t adv_router = 0;
764
765 OSPF6_CMD_CHECK_RUNNING ();
766
767 type = parse_type_spec (idx_lsa, argc, argv);
768 inet_pton (AF_INET, argv[idx_adv_rtr]->arg, &adv_router);
769 inet_pton (AF_INET, argv[idx_ls_id]->arg, &id);
770 level = parse_show_level (idx_level, argc, argv);
771
772 switch (OSPF6_LSA_SCOPE (type))
773 {
774 case OSPF6_SCOPE_AREA:
775 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
776 {
777 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
778 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
779 }
780 break;
781
782 case OSPF6_SCOPE_LINKLOCAL:
783 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
784 {
785 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
786 {
787 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
788 oi->interface->name, oa->name, VTYNL, VTYNL);
789 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
790 }
791 }
792 break;
793
794 case OSPF6_SCOPE_AS:
795 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
796 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
797 break;
798
799 default:
800 assert (0);
801 break;
802 }
803
804 vty_out (vty, "\n");
805 return CMD_SUCCESS;
806 }
807
808 DEFUN (show_ipv6_ospf6_database_self_originated,
809 show_ipv6_ospf6_database_self_originated_cmd,
810 "show ipv6 ospf6 database self-originated [<detail|dump|internal>]",
811 SHOW_STR
812 IPV6_STR
813 OSPF6_STR
814 "Display Link state database\n"
815 "Display Self-originated LSAs\n"
816 "Display details of LSAs\n"
817 "Dump LSAs\n"
818 "Display LSA's internal information\n")
819 {
820 int idx_level = 5;
821 int level;
822 struct listnode *i, *j;
823 struct ospf6 *o = ospf6;
824 struct ospf6_area *oa;
825 struct ospf6_interface *oi;
826 u_int32_t adv_router = 0;
827
828 OSPF6_CMD_CHECK_RUNNING ();
829 level = parse_show_level (idx_level, argc, argv);
830 adv_router = o->router_id;
831
832 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
833 {
834 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
835 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
836 }
837
838 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
839 {
840 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
841 {
842 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
843 oi->interface->name, oa->name, VTYNL, VTYNL);
844 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
845 }
846 }
847
848 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
849 ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
850
851 vty_out (vty, "\n");
852 return CMD_SUCCESS;
853 }
854
855
856 DEFUN (show_ipv6_ospf6_database_type_self_originated,
857 show_ipv6_ospf6_database_type_self_originated_cmd,
858 "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> self-originated [<detail|dump|internal>]",
859 SHOW_STR
860 IPV6_STR
861 OSPF6_STR
862 "Display Link state database\n"
863 "Display Router LSAs\n"
864 "Display Network LSAs\n"
865 "Display Inter-Area-Prefix LSAs\n"
866 "Display Inter-Area-Router LSAs\n"
867 "Display As-External LSAs\n"
868 "Display Group-Membership LSAs\n"
869 "Display Type-7 LSAs\n"
870 "Display Link LSAs\n"
871 "Display Intra-Area-Prefix LSAs\n"
872 "Display Self-originated LSAs\n"
873 "Display details of LSAs\n"
874 "Dump LSAs\n"
875 "Display LSA's internal information\n")
876 {
877 int idx_lsa = 4;
878 int idx_level = 6;
879 int level;
880 struct listnode *i, *j;
881 struct ospf6 *o = ospf6;
882 struct ospf6_area *oa;
883 struct ospf6_interface *oi;
884 u_int16_t type = 0;
885 u_int32_t adv_router = 0;
886
887 OSPF6_CMD_CHECK_RUNNING ();
888
889 type = parse_type_spec (idx_lsa, argc, argv);
890 level = parse_show_level (idx_level, argc, argv);
891
892 adv_router = o->router_id;
893
894 switch (OSPF6_LSA_SCOPE (type))
895 {
896 case OSPF6_SCOPE_AREA:
897 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
898 {
899 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
900 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
901 }
902 break;
903
904 case OSPF6_SCOPE_LINKLOCAL:
905 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
906 {
907 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
908 {
909 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
910 oi->interface->name, oa->name, VTYNL, VTYNL);
911 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
912 }
913 }
914 break;
915
916 case OSPF6_SCOPE_AS:
917 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
918 ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
919 break;
920
921 default:
922 assert (0);
923 break;
924 }
925
926 vty_out (vty, "\n");
927 return CMD_SUCCESS;
928 }
929
930 DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
931 show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd,
932 "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> self-originated linkstate-id A.B.C.D [<detail|dump|internal>]",
933 SHOW_STR
934 IPV6_STR
935 OSPF6_STR
936 "Display Link state database\n"
937 "Display Router LSAs\n"
938 "Display Network LSAs\n"
939 "Display Inter-Area-Prefix LSAs\n"
940 "Display Inter-Area-Router LSAs\n"
941 "Display As-External LSAs\n"
942 "Display Group-Membership LSAs\n"
943 "Display Type-7 LSAs\n"
944 "Display Link LSAs\n"
945 "Display Intra-Area-Prefix LSAs\n"
946 "Display Self-originated LSAs\n"
947 "Search by Link state ID\n"
948 "Specify Link state ID as IPv4 address notation\n"
949 "Display details of LSAs\n"
950 "Dump LSAs\n"
951 "Display LSA's internal information\n")
952 {
953 int idx_lsa = 4;
954 int idx_ls_id = 7;
955 int idx_level = 8;
956 int level;
957 struct listnode *i, *j;
958 struct ospf6 *o = ospf6;
959 struct ospf6_area *oa;
960 struct ospf6_interface *oi;
961 u_int16_t type = 0;
962 u_int32_t adv_router = 0;
963 u_int32_t id = 0;
964
965 OSPF6_CMD_CHECK_RUNNING ();
966
967 type = parse_type_spec (idx_lsa, argc, argv);
968 inet_pton (AF_INET, argv[idx_ls_id]->arg, &id);
969 level = parse_show_level (idx_level, argc, argv);
970 adv_router = o->router_id;
971
972 switch (OSPF6_LSA_SCOPE (type))
973 {
974 case OSPF6_SCOPE_AREA:
975 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
976 {
977 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
978 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
979 }
980 break;
981
982 case OSPF6_SCOPE_LINKLOCAL:
983 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
984 {
985 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
986 {
987 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
988 oi->interface->name, oa->name, VTYNL, VTYNL);
989 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
990 }
991 }
992 break;
993
994 case OSPF6_SCOPE_AS:
995 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
996 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
997 break;
998
999 default:
1000 assert (0);
1001 break;
1002 }
1003
1004 vty_out (vty, "\n");
1005 return CMD_SUCCESS;
1006 }
1007
1008 DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
1009 show_ipv6_ospf6_database_type_id_self_originated_cmd,
1010 "show ipv6 ospf6 database <router|network|inter-prefix|inter-router|as-external|group-membership|type-7|link|intra-prefix> A.B.C.D self-originated [<detail|dump|internal>]",
1011 SHOW_STR
1012 IPV6_STR
1013 OSPF6_STR
1014 "Display Link state database\n"
1015 "Display Router LSAs\n"
1016 "Display Network LSAs\n"
1017 "Display Inter-Area-Prefix LSAs\n"
1018 "Display Inter-Area-Router LSAs\n"
1019 "Display As-External LSAs\n"
1020 "Display Group-Membership LSAs\n"
1021 "Display Type-7 LSAs\n"
1022 "Display Link LSAs\n"
1023 "Display Intra-Area-Prefix LSAs\n"
1024 "Specify Link state ID as IPv4 address notation\n"
1025 "Display Self-originated LSAs\n"
1026 "Display details of LSAs\n"
1027 "Dump LSAs\n"
1028 "Display LSA's internal information\n")
1029 {
1030 int idx_lsa = 4;
1031 int idx_ls_id = 5;
1032 int idx_level = 7;
1033 int level;
1034 struct listnode *i, *j;
1035 struct ospf6 *o = ospf6;
1036 struct ospf6_area *oa;
1037 struct ospf6_interface *oi;
1038 u_int16_t type = 0;
1039 u_int32_t adv_router = 0;
1040 u_int32_t id = 0;
1041
1042 OSPF6_CMD_CHECK_RUNNING ();
1043
1044 type = parse_type_spec (idx_lsa, argc, argv);
1045 inet_pton (AF_INET, argv[idx_ls_id]->arg, &id);
1046 level = parse_show_level (idx_level, argc, argv);
1047 adv_router = o->router_id;
1048
1049 switch (OSPF6_LSA_SCOPE (type))
1050 {
1051 case OSPF6_SCOPE_AREA:
1052 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1053 {
1054 vty_out (vty, AREA_LSDB_TITLE_FORMAT, VTYNL, oa->name, VTYNL, VTYNL);
1055 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
1056 }
1057 break;
1058
1059 case OSPF6_SCOPE_LINKLOCAL:
1060 for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
1061 {
1062 for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
1063 {
1064 vty_out (vty, IF_LSDB_TITLE_FORMAT, VTYNL,
1065 oi->interface->name, oa->name, VTYNL, VTYNL);
1066 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
1067 }
1068 }
1069 break;
1070
1071 case OSPF6_SCOPE_AS:
1072 vty_out (vty, AS_LSDB_TITLE_FORMAT, VTYNL, VTYNL, VTYNL);
1073 ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
1074 break;
1075
1076 default:
1077 assert (0);
1078 break;
1079 }
1080
1081 vty_out (vty, "\n");
1082 return CMD_SUCCESS;
1083 }
1084
1085 DEFUN (show_ipv6_ospf6_border_routers,
1086 show_ipv6_ospf6_border_routers_cmd,
1087 "show ipv6 ospf6 border-routers [<A.B.C.D|detail>]",
1088 SHOW_STR
1089 IP6_STR
1090 OSPF6_STR
1091 "Display routing table for ABR and ASBR\n"
1092 "Router ID\n"
1093 "Show detailed output\n")
1094 {
1095 int idx_ipv4 = 4;
1096 u_int32_t adv_router;
1097 struct ospf6_route *ro;
1098 struct prefix prefix;
1099
1100 OSPF6_CMD_CHECK_RUNNING ();
1101
1102 if (argc == 5)
1103 {
1104 if (strmatch (argv[idx_ipv4]->text, "detail"))
1105 {
1106 for (ro = ospf6_route_head (ospf6->brouter_table); ro;
1107 ro = ospf6_route_next (ro))
1108 ospf6_route_show_detail (vty, ro);
1109 }
1110 else
1111 {
1112 inet_pton (AF_INET, argv[idx_ipv4]->arg, &adv_router);
1113
1114 ospf6_linkstate_prefix (adv_router, 0, &prefix);
1115 ro = ospf6_route_lookup (&prefix, ospf6->brouter_table);
1116 if (!ro)
1117 {
1118 vty_out (vty, "No Route found for Router ID: %s%s", argv[4]->arg, VTYNL);
1119 return CMD_SUCCESS;
1120 }
1121
1122 ospf6_route_show_detail (vty, ro);
1123 return CMD_SUCCESS;
1124 }
1125 }
1126 else
1127 {
1128 ospf6_brouter_show_header (vty);
1129
1130 for (ro = ospf6_route_head (ospf6->brouter_table); ro;
1131 ro = ospf6_route_next (ro))
1132 ospf6_brouter_show (vty, ro);
1133 }
1134
1135 return CMD_SUCCESS;
1136 }
1137
1138
1139 DEFUN (show_ipv6_ospf6_linkstate,
1140 show_ipv6_ospf6_linkstate_cmd,
1141 "show ipv6 ospf6 linkstate <router A.B.C.D|network A.B.C.D A.B.C.D>",
1142 SHOW_STR
1143 IP6_STR
1144 OSPF6_STR
1145 "Display linkstate routing table\n"
1146 "Display Router Entry\n"
1147 "Specify Router ID as IPv4 address notation\n"
1148 "Display Network Entry\n"
1149 "Specify Router ID as IPv4 address notation\n"
1150 "Specify Link state ID as IPv4 address notation\n")
1151 {
1152 int idx_ipv4 = 4;
1153 struct listnode *node;
1154 struct ospf6_area *oa;
1155
1156 OSPF6_CMD_CHECK_RUNNING ();
1157
1158 for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
1159 {
1160 vty_out (vty, "\n SPF Result in Area %s%s%s", oa->name, VTYNL, VTYNL);
1161 ospf6_linkstate_table_show (vty, idx_ipv4, argc, argv, oa->spf_table);
1162 }
1163
1164 vty_out (vty, "\n");
1165 return CMD_SUCCESS;
1166 }
1167
1168
1169
1170 DEFUN (show_ipv6_ospf6_linkstate_detail,
1171 show_ipv6_ospf6_linkstate_detail_cmd,
1172 "show ipv6 ospf6 linkstate detail",
1173 SHOW_STR
1174 IP6_STR
1175 OSPF6_STR
1176 "Display linkstate routing table\n"
1177 "Display detailed information\n")
1178 {
1179 int idx_detail = 4;
1180 struct listnode *node;
1181 struct ospf6_area *oa;
1182
1183 OSPF6_CMD_CHECK_RUNNING ();
1184
1185 for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
1186 {
1187 vty_out (vty, "\n SPF Result in Area %s%s%s", oa->name, VTYNL, VTYNL);
1188 ospf6_linkstate_table_show (vty, idx_detail, argc, argv, oa->spf_table);
1189 }
1190
1191 vty_out (vty, "\n");
1192 return CMD_SUCCESS;
1193 }
1194
1195 /* Install ospf related commands. */
1196 void
1197 ospf6_init (void)
1198 {
1199 ospf6_top_init ();
1200 ospf6_area_init ();
1201 ospf6_interface_init ();
1202 ospf6_neighbor_init ();
1203 ospf6_zebra_init(master);
1204
1205 ospf6_lsa_init ();
1206 ospf6_spf_init ();
1207 ospf6_intra_init ();
1208 ospf6_asbr_init ();
1209 ospf6_abr_init ();
1210
1211 ospf6_bfd_init();
1212 install_node (&debug_node, config_write_ospf6_debug);
1213
1214 install_element_ospf6_debug_message ();
1215 install_element_ospf6_debug_lsa ();
1216 install_element_ospf6_debug_interface ();
1217 install_element_ospf6_debug_neighbor ();
1218 install_element_ospf6_debug_zebra ();
1219 install_element_ospf6_debug_spf ();
1220 install_element_ospf6_debug_route ();
1221 install_element_ospf6_debug_brouter ();
1222 install_element_ospf6_debug_asbr ();
1223 install_element_ospf6_debug_abr ();
1224 install_element_ospf6_debug_flood ();
1225
1226 install_element_ospf6_clear_interface ();
1227
1228 install_element (VIEW_NODE, &show_version_ospf6_cmd);
1229
1230 install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_cmd);
1231
1232 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_cmd);
1233 install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_detail_cmd);
1234
1235 install_element (VIEW_NODE, &show_ipv6_ospf6_database_cmd);
1236 install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_cmd);
1237 install_element (VIEW_NODE, &show_ipv6_ospf6_database_id_cmd);
1238 install_element (VIEW_NODE, &show_ipv6_ospf6_database_router_cmd);
1239 install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_id_cmd);
1240 install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_router_cmd);
1241 install_element (VIEW_NODE, &show_ipv6_ospf6_database_adv_router_linkstate_id_cmd);
1242 install_element (VIEW_NODE, &show_ipv6_ospf6_database_id_router_cmd);
1243 install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_id_router_cmd);
1244 install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd);
1245 install_element (VIEW_NODE, &show_ipv6_ospf6_database_self_originated_cmd);
1246 install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_self_originated_cmd);
1247 install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_id_self_originated_cmd);
1248 install_element (VIEW_NODE, &show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd);
1249
1250 /* Make ospf protocol socket. */
1251 ospf6_serv_sock ();
1252 thread_add_read(master, ospf6_receive, NULL, ospf6_sock, NULL);
1253 }
1254
1255 void
1256 ospf6_clean (void)
1257 {
1258 if (!ospf6)
1259 return;
1260 if (ospf6->route_table)
1261 ospf6_route_remove_all (ospf6->route_table);
1262 if (ospf6->brouter_table)
1263 ospf6_route_remove_all (ospf6->brouter_table);
1264 }