]> git.proxmox.com Git - mirror_frr.git/blame - ospf6d/ospf6_top.c
Merge pull request #2178 from pguibert6WIND/issue_2177
[mirror_frr.git] / ospf6d / ospf6_top.c
CommitLineData
718e3744 1/*
508e53e2 2 * Copyright (C) 2003 Yasuhiro Ohara
718e3744 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 *
896014f4
DL
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
718e3744 19 */
20
21#include <zebra.h>
22
23#include "log.h"
24#include "memory.h"
25#include "vty.h"
26#include "linklist.h"
27#include "prefix.h"
28#include "table.h"
29#include "thread.h"
30#include "command.h"
8efe88ea 31#include "defaults.h"
718e3744 32
718e3744 33#include "ospf6_proto.h"
508e53e2 34#include "ospf6_message.h"
718e3744 35#include "ospf6_lsa.h"
36#include "ospf6_lsdb.h"
718e3744 37#include "ospf6_route.h"
38#include "ospf6_zebra.h"
39
508e53e2 40#include "ospf6_top.h"
41#include "ospf6_area.h"
42#include "ospf6_interface.h"
43#include "ospf6_neighbor.h"
718e3744 44
6452df09 45#include "ospf6_flood.h"
508e53e2 46#include "ospf6_asbr.h"
049207c3 47#include "ospf6_abr.h"
6452df09 48#include "ospf6_intra.h"
3810e06e 49#include "ospf6_spf.h"
049207c3 50#include "ospf6d.h"
718e3744 51
ae19c240
DL
52DEFINE_QOBJ_TYPE(ospf6)
53
718e3744 54/* global ospf6d variable */
55struct ospf6 *ospf6;
78c6ba61
CS
56static struct ospf6_master ospf6_master;
57struct ospf6_master *om6;
718e3744 58
d62a17ae 59static void ospf6_disable(struct ospf6 *o);
ae2254aa 60
d62a17ae 61static void ospf6_top_lsdb_hook_add(struct ospf6_lsa *lsa)
718e3744 62{
d62a17ae 63 switch (ntohs(lsa->header->type)) {
64 case OSPF6_LSTYPE_AS_EXTERNAL:
65 ospf6_asbr_lsa_add(lsa);
66 break;
67
68 default:
69 break;
70 }
718e3744 71}
72
d62a17ae 73static void ospf6_top_lsdb_hook_remove(struct ospf6_lsa *lsa)
718e3744 74{
d62a17ae 75 switch (ntohs(lsa->header->type)) {
76 case OSPF6_LSTYPE_AS_EXTERNAL:
07b37f93 77 ospf6_asbr_lsa_remove(lsa, NULL);
d62a17ae 78 break;
79
80 default:
81 break;
82 }
718e3744 83}
84
d62a17ae 85static void ospf6_top_route_hook_add(struct ospf6_route *route)
049207c3 86{
d62a17ae 87 ospf6_abr_originate_summary(route);
88 ospf6_zebra_route_update_add(route);
049207c3 89}
90
d62a17ae 91static void ospf6_top_route_hook_remove(struct ospf6_route *route)
049207c3 92{
d62a17ae 93 route->flag |= OSPF6_ROUTE_REMOVE;
94 ospf6_abr_originate_summary(route);
95 ospf6_zebra_route_update_remove(route);
049207c3 96}
97
d62a17ae 98static void ospf6_top_brouter_hook_add(struct ospf6_route *route)
6452df09 99{
064d4355 100 if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {
07b37f93
CS
101 uint32_t brouter_id;
102 char brouter_name[16];
103
104 brouter_id = ADV_ROUTER_IN_PREFIX(&route->prefix);
105 inet_ntop(AF_INET, &brouter_id, brouter_name,
106 sizeof(brouter_name));
107 zlog_debug("%s: brouter %s add with adv router %x nh count %u",
108 __PRETTY_FUNCTION__, brouter_name,
109 route->path.origin.adv_router,
110 listcount(route->nh_list));
064d4355 111 }
d62a17ae 112 ospf6_abr_examin_brouter(ADV_ROUTER_IN_PREFIX(&route->prefix));
113 ospf6_asbr_lsentry_add(route);
114 ospf6_abr_originate_summary(route);
6452df09 115}
116
d62a17ae 117static void ospf6_top_brouter_hook_remove(struct ospf6_route *route)
6452df09 118{
064d4355 119 if (IS_OSPF6_DEBUG_EXAMIN(AS_EXTERNAL)) {
07b37f93
CS
120 uint32_t brouter_id;
121 char brouter_name[16];
064d4355 122
07b37f93
CS
123 brouter_id = ADV_ROUTER_IN_PREFIX(&route->prefix);
124 inet_ntop(AF_INET, &brouter_id, brouter_name,
125 sizeof(brouter_name));
064d4355 126 zlog_debug("%s: brouter %s del with nh count %u",
07b37f93
CS
127 __PRETTY_FUNCTION__, brouter_name,
128 listcount(route->nh_list));
064d4355 129 }
d62a17ae 130 route->flag |= OSPF6_ROUTE_REMOVE;
131 ospf6_abr_examin_brouter(ADV_ROUTER_IN_PREFIX(&route->prefix));
132 ospf6_asbr_lsentry_remove(route);
133 ospf6_abr_originate_summary(route);
6452df09 134}
135
d62a17ae 136static struct ospf6 *ospf6_create(void)
718e3744 137{
d62a17ae 138 struct ospf6 *o;
718e3744 139
d62a17ae 140 o = XCALLOC(MTYPE_OSPF6_TOP, sizeof(struct ospf6));
718e3744 141
d62a17ae 142 /* initialize */
143 monotime(&o->starttime);
144 o->area_list = list_new();
145 o->area_list->cmp = ospf6_area_cmp;
146 o->lsdb = ospf6_lsdb_create(o);
147 o->lsdb_self = ospf6_lsdb_create(o);
148 o->lsdb->hook_add = ospf6_top_lsdb_hook_add;
149 o->lsdb->hook_remove = ospf6_top_lsdb_hook_remove;
718e3744 150
d62a17ae 151 o->spf_delay = OSPF_SPF_DELAY_DEFAULT;
152 o->spf_holdtime = OSPF_SPF_HOLDTIME_DEFAULT;
153 o->spf_max_holdtime = OSPF_SPF_MAX_HOLDTIME_DEFAULT;
154 o->spf_hold_multiplier = 1;
3810e06e 155
d62a17ae 156 /* LSA timers value init */
157 o->lsa_minarrival = OSPF_MIN_LS_ARRIVAL;
b6927875 158
d62a17ae 159 o->route_table = OSPF6_ROUTE_TABLE_CREATE(GLOBAL, ROUTES);
160 o->route_table->scope = o;
161 o->route_table->hook_add = ospf6_top_route_hook_add;
162 o->route_table->hook_remove = ospf6_top_route_hook_remove;
718e3744 163
d62a17ae 164 o->brouter_table = OSPF6_ROUTE_TABLE_CREATE(GLOBAL, BORDER_ROUTERS);
165 o->brouter_table->scope = o;
166 o->brouter_table->hook_add = ospf6_top_brouter_hook_add;
167 o->brouter_table->hook_remove = ospf6_top_brouter_hook_remove;
049207c3 168
d62a17ae 169 o->external_table = OSPF6_ROUTE_TABLE_CREATE(GLOBAL, EXTERNAL_ROUTES);
170 o->external_table->scope = o;
cf1ce250 171
d62a17ae 172 o->external_id_table = route_table_init();
718e3744 173
d62a17ae 174 o->ref_bandwidth = OSPF6_REFERENCE_BANDWIDTH;
fd500689 175
d62a17ae 176 o->distance_table = route_table_init();
baff583e 177
d62a17ae 178/* Enable "log-adjacency-changes" */
8efe88ea 179#if DFLT_OSPF6_LOG_ADJACENCY_CHANGES
d62a17ae 180 SET_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
8efe88ea 181#endif
692c7954 182
d62a17ae 183 QOBJ_REG(o, ospf6);
692c7954 184
d62a17ae 185 return o;
718e3744 186}
187
d62a17ae 188void ospf6_delete(struct ospf6 *o)
718e3744 189{
d62a17ae 190 struct listnode *node, *nnode;
191 struct ospf6_area *oa;
718e3744 192
d62a17ae 193 QOBJ_UNREG(o);
76249532
CS
194
195 ospf6_flush_self_originated_lsas_now();
d62a17ae 196 ospf6_disable(ospf6);
ae2254aa 197
d62a17ae 198 for (ALL_LIST_ELEMENTS(o->area_list, node, nnode, oa))
199 ospf6_area_delete(oa);
d9628728
CF
200
201
affe9e99 202 list_delete_and_null(&o->area_list);
718e3744 203
d62a17ae 204 ospf6_lsdb_delete(o->lsdb);
205 ospf6_lsdb_delete(o->lsdb_self);
718e3744 206
d62a17ae 207 ospf6_route_table_delete(o->route_table);
208 ospf6_route_table_delete(o->brouter_table);
718e3744 209
d62a17ae 210 ospf6_route_table_delete(o->external_table);
211 route_table_finish(o->external_id_table);
718e3744 212
d62a17ae 213 ospf6_distance_reset(o);
214 route_table_finish(o->distance_table);
baff583e 215
d62a17ae 216 XFREE(MTYPE_OSPF6_TOP, o);
508e53e2 217}
718e3744 218
d62a17ae 219static void ospf6_disable(struct ospf6 *o)
718e3744 220{
d62a17ae 221 struct listnode *node, *nnode;
222 struct ospf6_area *oa;
223
224 if (!CHECK_FLAG(o->flag, OSPF6_DISABLED)) {
225 SET_FLAG(o->flag, OSPF6_DISABLED);
226
227 for (ALL_LIST_ELEMENTS(o->area_list, node, nnode, oa))
228 ospf6_area_disable(oa);
229
230 /* XXX: This also changes persistent settings */
231 ospf6_asbr_redistribute_reset();
232
233 ospf6_lsdb_remove_all(o->lsdb);
234 ospf6_route_remove_all(o->route_table);
235 ospf6_route_remove_all(o->brouter_table);
236
237 THREAD_OFF(o->maxage_remover);
238 THREAD_OFF(o->t_spf_calc);
239 THREAD_OFF(o->t_ase_calc);
856ae1eb 240 THREAD_OFF(o->t_distribute_update);
d62a17ae 241 }
508e53e2 242}
718e3744 243
78c6ba61
CS
244void ospf6_master_init(void)
245{
246 memset(&ospf6_master, 0, sizeof(struct ospf6_master));
247
248 om6 = &ospf6_master;
249}
250
d62a17ae 251static int ospf6_maxage_remover(struct thread *thread)
508e53e2 252{
d62a17ae 253 struct ospf6 *o = (struct ospf6 *)THREAD_ARG(thread);
254 struct ospf6_area *oa;
255 struct ospf6_interface *oi;
256 struct ospf6_neighbor *on;
257 struct listnode *i, *j, *k;
258 int reschedule = 0;
259
260 o->maxage_remover = (struct thread *)NULL;
261
262 for (ALL_LIST_ELEMENTS_RO(o->area_list, i, oa)) {
263 for (ALL_LIST_ELEMENTS_RO(oa->if_list, j, oi)) {
264 for (ALL_LIST_ELEMENTS_RO(oi->neighbor_list, k, on)) {
265 if (on->state != OSPF6_NEIGHBOR_EXCHANGE
266 && on->state != OSPF6_NEIGHBOR_LOADING)
267 continue;
268
269 ospf6_maxage_remove(o);
270 return 0;
271 }
272 }
2449fcd6 273 }
d62a17ae 274
275 for (ALL_LIST_ELEMENTS_RO(o->area_list, i, oa)) {
276 for (ALL_LIST_ELEMENTS_RO(oa->if_list, j, oi)) {
277 if (ospf6_lsdb_maxage_remover(oi->lsdb)) {
278 reschedule = 1;
279 }
280 }
281
282 if (ospf6_lsdb_maxage_remover(oa->lsdb)) {
283 reschedule = 1;
284 }
2449fcd6 285 }
2449fcd6 286
d62a17ae 287 if (ospf6_lsdb_maxage_remover(o->lsdb)) {
288 reschedule = 1;
289 }
2449fcd6 290
d62a17ae 291 if (reschedule) {
292 ospf6_maxage_remove(o);
293 }
508e53e2 294
d62a17ae 295 return 0;
718e3744 296}
297
d62a17ae 298void ospf6_maxage_remove(struct ospf6 *o)
718e3744 299{
d62a17ae 300 if (o)
301 thread_add_timer(master, ospf6_maxage_remover, o,
302 OSPF_LSA_MAXAGE_REMOVE_DELAY_DEFAULT,
303 &o->maxage_remover);
718e3744 304}
305
78c6ba61
CS
306void ospf6_router_id_update(void)
307{
308 if (!ospf6)
309 return;
310
311 if (ospf6->router_id_static != 0)
312 ospf6->router_id = ospf6->router_id_static;
313 else
314 ospf6->router_id = om6->zebra_router_id;
315}
316
508e53e2 317/* start ospf6 */
505e5056 318DEFUN_NOSH (router_ospf6,
508e53e2 319 router_ospf6_cmd,
320 "router ospf6",
321 ROUTER_STR
322 OSPF6_STR)
718e3744 323{
78c6ba61 324 if (ospf6 == NULL) {
d62a17ae 325 ospf6 = ospf6_create();
78c6ba61
CS
326 if (ospf6->router_id == 0)
327 ospf6_router_id_update();
328 }
d62a17ae 329 /* set current ospf point. */
330 VTY_PUSH_CONTEXT(OSPF6_NODE, ospf6);
508e53e2 331
d62a17ae 332 return CMD_SUCCESS;
718e3744 333}
334
508e53e2 335/* stop ospf6 */
336DEFUN (no_router_ospf6,
337 no_router_ospf6_cmd,
338 "no router ospf6",
339 NO_STR
16cedbb0
QY
340 ROUTER_STR
341 OSPF6_STR)
718e3744 342{
d62a17ae 343 if (ospf6 == NULL)
344 vty_out(vty, "OSPFv3 is not configured\n");
345 else {
346 ospf6_delete(ospf6);
347 ospf6 = NULL;
348 }
34288970 349
d62a17ae 350 /* return to config node . */
351 VTY_PUSH_CONTEXT_NULL(CONFIG_NODE);
508e53e2 352
d62a17ae 353 return CMD_SUCCESS;
718e3744 354}
355
508e53e2 356/* change Router_ID commands. */
60466a63
QY
357DEFUN(ospf6_router_id,
358 ospf6_router_id_cmd,
359 "ospf6 router-id A.B.C.D",
360 OSPF6_STR
361 "Configure OSPF6 Router-ID\n"
362 V4NOTATION_STR)
718e3744 363{
d62a17ae 364 VTY_DECLVAR_CONTEXT(ospf6, o);
5d1a2ee8 365 int idx = 0;
d62a17ae 366 int ret;
5d1a2ee8 367 const char *router_id_str;
d7c0a89a 368 uint32_t router_id;
d6927cf3
CS
369 struct ospf6_area *oa;
370 struct listnode *node;
d62a17ae 371
5d1a2ee8
QY
372 argv_find(argv, argc, "A.B.C.D", &idx);
373 router_id_str = argv[idx]->arg;
374
375 ret = inet_pton(AF_INET, router_id_str, &router_id);
d62a17ae 376 if (ret == 0) {
60466a63 377 vty_out(vty, "malformed OSPF Router-ID: %s\n", router_id_str);
d62a17ae 378 return CMD_SUCCESS;
379 }
508e53e2 380
d62a17ae 381 o->router_id_static = router_id;
d6927cf3
CS
382
383 for (ALL_LIST_ELEMENTS_RO(o->area_list, node, oa)) {
384 if (oa->full_nbrs) {
385 vty_out(vty,
386 "For this router-id change to take effect,"
387 " save config and restart ospf6d\n");
388 return CMD_SUCCESS;
389 }
390 }
391
392 o->router_id = router_id;
c8a440ec 393
d62a17ae 394 return CMD_SUCCESS;
718e3744 395}
396
60466a63
QY
397DEFUN(no_ospf6_router_id,
398 no_ospf6_router_id_cmd,
399 "no ospf6 router-id [A.B.C.D]",
400 NO_STR OSPF6_STR
401 "Configure OSPF6 Router-ID\n"
402 V4NOTATION_STR)
5d1a2ee8
QY
403{
404 VTY_DECLVAR_CONTEXT(ospf6, o);
d6927cf3
CS
405 struct ospf6_area *oa;
406 struct listnode *node;
407
5d1a2ee8 408 o->router_id_static = 0;
d6927cf3
CS
409
410 for (ALL_LIST_ELEMENTS_RO(o->area_list, node, oa)) {
411 if (oa->full_nbrs) {
412 vty_out(vty,
413 "For this router-id change to take effect,"
414 " save config and restart ospf6d\n");
415 return CMD_SUCCESS;
416 }
417 }
5d1a2ee8 418 o->router_id = 0;
d6927cf3
CS
419 if (o->router_id_zebra.s_addr)
420 o->router_id = (uint32_t)o->router_id_zebra.s_addr;
5d1a2ee8
QY
421
422 return CMD_SUCCESS;
423}
424
e24be241 425#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180828
5d1a2ee8
QY
426CPP_NOTICE("ospf6: `router-id A.B.C.D` deprecated 2017/08/28")
427#endif
996c9314
LB
428ALIAS_HIDDEN(ospf6_router_id, ospf6_router_id_hdn_cmd, "router-id A.B.C.D",
429 "Configure OSPF6 Router-ID\n" V4NOTATION_STR)
5d1a2ee8 430
e24be241 431#if defined(VERSION_TYPE_DEV) && CONFDATE > 20180828
5d1a2ee8
QY
432CPP_NOTICE("ospf6: `no router-id A.B.C.D` deprecated 2017/08/28")
433#endif
996c9314 434ALIAS_HIDDEN(no_ospf6_router_id, no_ospf6_router_id_hdn_cmd,
5d1a2ee8 435 "no router-id [A.B.C.D]",
996c9314 436 NO_STR "Configure OSPF6 Router-ID\n" V4NOTATION_STR)
5d1a2ee8 437
3d35ca48
DD
438DEFUN (ospf6_log_adjacency_changes,
439 ospf6_log_adjacency_changes_cmd,
440 "log-adjacency-changes",
441 "Log changes in adjacency state\n")
442{
d62a17ae 443 VTY_DECLVAR_CONTEXT(ospf6, ospf6);
3d35ca48 444
d62a17ae 445 SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
446 UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
447 return CMD_SUCCESS;
3d35ca48
DD
448}
449
450DEFUN (ospf6_log_adjacency_changes_detail,
451 ospf6_log_adjacency_changes_detail_cmd,
452 "log-adjacency-changes detail",
692c7954 453 "Log changes in adjacency state\n"
3d35ca48
DD
454 "Log all state changes\n")
455{
d62a17ae 456 VTY_DECLVAR_CONTEXT(ospf6, ospf6);
3d35ca48 457
d62a17ae 458 SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
459 SET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
460 return CMD_SUCCESS;
3d35ca48
DD
461}
462
463DEFUN (no_ospf6_log_adjacency_changes,
464 no_ospf6_log_adjacency_changes_cmd,
465 "no log-adjacency-changes",
692c7954 466 NO_STR
3d35ca48
DD
467 "Log changes in adjacency state\n")
468{
d62a17ae 469 VTY_DECLVAR_CONTEXT(ospf6, ospf6);
3d35ca48 470
d62a17ae 471 UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
472 UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES);
473 return CMD_SUCCESS;
3d35ca48
DD
474}
475
476DEFUN (no_ospf6_log_adjacency_changes_detail,
477 no_ospf6_log_adjacency_changes_detail_cmd,
478 "no log-adjacency-changes detail",
692c7954
DW
479 NO_STR
480 "Log changes in adjacency state\n"
3d35ca48
DD
481 "Log all state changes\n")
482{
d62a17ae 483 VTY_DECLVAR_CONTEXT(ospf6, ospf6);
3d35ca48 484
d62a17ae 485 UNSET_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL);
486 return CMD_SUCCESS;
3d35ca48
DD
487}
488
b6927875
DS
489DEFUN (ospf6_timers_lsa,
490 ospf6_timers_lsa_cmd,
6147e2c6 491 "timers lsa min-arrival (0-600000)",
b6927875
DS
492 "Adjust routing timers\n"
493 "OSPF6 LSA timers\n"
494 "Minimum delay in receiving new version of a LSA\n"
495 "Delay in milliseconds\n")
496{
d62a17ae 497 VTY_DECLVAR_CONTEXT(ospf6, ospf);
498 int idx_number = 3;
499 unsigned int minarrival;
b6927875 500
d62a17ae 501 minarrival = strtoul(argv[idx_number]->arg, NULL, 10);
502 ospf->lsa_minarrival = minarrival;
b6927875 503
d62a17ae 504 return CMD_SUCCESS;
b6927875
DS
505}
506
507DEFUN (no_ospf6_timers_lsa,
508 no_ospf6_timers_lsa_cmd,
1d68dbfe 509 "no timers lsa min-arrival [(0-600000)]",
b6927875
DS
510 NO_STR
511 "Adjust routing timers\n"
512 "OSPF6 LSA timers\n"
3a2d747c
QY
513 "Minimum delay in receiving new version of a LSA\n"
514 "Delay in milliseconds\n")
b6927875 515{
d62a17ae 516 VTY_DECLVAR_CONTEXT(ospf6, ospf);
517 int idx_number = 4;
518 unsigned int minarrival;
b6927875 519
d62a17ae 520 if (argc == 5) {
521 minarrival = strtoul(argv[idx_number]->arg, NULL, 10);
b6927875 522
d62a17ae 523 if (ospf->lsa_minarrival != minarrival
524 || minarrival == OSPF_MIN_LS_ARRIVAL)
525 return CMD_SUCCESS;
526 }
b6927875 527
d62a17ae 528 ospf->lsa_minarrival = OSPF_MIN_LS_ARRIVAL;
b6927875 529
d62a17ae 530 return CMD_SUCCESS;
b6927875
DS
531}
532
b6927875 533
baff583e
MZ
534DEFUN (ospf6_distance,
535 ospf6_distance_cmd,
39e92c06 536 "distance (1-255)",
baff583e
MZ
537 "Administrative distance\n"
538 "OSPF6 Administrative distance\n")
539{
d62a17ae 540 VTY_DECLVAR_CONTEXT(ospf6, o);
baff583e 541
d62a17ae 542 o->distance_all = atoi(argv[1]->arg);
baff583e 543
d62a17ae 544 return CMD_SUCCESS;
baff583e
MZ
545}
546
547DEFUN (no_ospf6_distance,
548 no_ospf6_distance_cmd,
39e92c06 549 "no distance (1-255)",
baff583e
MZ
550 NO_STR
551 "Administrative distance\n"
552 "OSPF6 Administrative distance\n")
553{
d62a17ae 554 VTY_DECLVAR_CONTEXT(ospf6, o);
baff583e 555
d62a17ae 556 o->distance_all = 0;
baff583e 557
d62a17ae 558 return CMD_SUCCESS;
baff583e
MZ
559}
560
561DEFUN (ospf6_distance_ospf6,
562 ospf6_distance_ospf6_cmd,
eaa1ae0d 563 "distance ospf6 {intra-area (1-255)|inter-area (1-255)|external (1-255)}",
baff583e 564 "Administrative distance\n"
eaa1ae0d 565 "OSPF6 administrative distance\n"
39e92c06
QY
566 "Intra-area routes\n"
567 "Distance for intra-area routes\n"
568 "Inter-area routes\n"
569 "Distance for inter-area routes\n"
570 "External routes\n"
baff583e
MZ
571 "Distance for external routes\n")
572{
d62a17ae 573 VTY_DECLVAR_CONTEXT(ospf6, o);
574 int idx = 0;
575
f89a449b
CS
576 o->distance_intra = 0;
577 o->distance_inter = 0;
578 o->distance_external = 0;
579
d62a17ae 580 if (argv_find(argv, argc, "intra-area", &idx))
581 o->distance_intra = atoi(argv[idx + 1]->arg);
582 idx = 0;
583 if (argv_find(argv, argc, "inter-area", &idx))
584 o->distance_inter = atoi(argv[idx + 1]->arg);
585 idx = 0;
586 if (argv_find(argv, argc, "external", &idx))
587 o->distance_external = atoi(argv[idx + 1]->arg);
39e92c06 588
d62a17ae 589 return CMD_SUCCESS;
baff583e
MZ
590}
591
592DEFUN (no_ospf6_distance_ospf6,
593 no_ospf6_distance_ospf6_cmd,
eaa1ae0d 594 "no distance ospf6 [{intra-area [(1-255)]|inter-area [(1-255)]|external [(1-255)]}]",
baff583e
MZ
595 NO_STR
596 "Administrative distance\n"
597 "OSPF6 distance\n"
598 "Intra-area routes\n"
599 "Distance for intra-area routes\n"
600 "Inter-area routes\n"
601 "Distance for inter-area routes\n"
602 "External routes\n"
603 "Distance for external routes\n")
604{
d62a17ae 605 VTY_DECLVAR_CONTEXT(ospf6, o);
606 int idx = 0;
baff583e 607
d62a17ae 608 if (argv_find(argv, argc, "intra-area", &idx) || argc == 3)
609 idx = o->distance_intra = 0;
610 if (argv_find(argv, argc, "inter-area", &idx) || argc == 3)
611 idx = o->distance_inter = 0;
612 if (argv_find(argv, argc, "external", &idx) || argc == 3)
613 o->distance_external = 0;
baff583e 614
d62a17ae 615 return CMD_SUCCESS;
baff583e
MZ
616}
617
d7d73ffc 618#if 0
baff583e
MZ
619DEFUN (ospf6_distance_source,
620 ospf6_distance_source_cmd,
39e92c06 621 "distance (1-255) X:X::X:X/M [WORD]",
baff583e
MZ
622 "Administrative distance\n"
623 "Distance value\n"
624 "IP source prefix\n"
625 "Access list name\n")
626{
cdc2d765 627 VTY_DECLVAR_CONTEXT(ospf6, o);
39e92c06
QY
628 char *alname = (argc == 4) ? argv[3]->arg : NULL;
629 ospf6_distance_set (vty, o, argv[1]->arg, argv[2]->arg, alname);
baff583e
MZ
630
631 return CMD_SUCCESS;
632}
633
634DEFUN (no_ospf6_distance_source,
635 no_ospf6_distance_source_cmd,
39e92c06 636 "no distance (1-255) X:X::X:X/M [WORD]",
baff583e
MZ
637 NO_STR
638 "Administrative distance\n"
639 "Distance value\n"
640 "IP source prefix\n"
641 "Access list name\n")
642{
cdc2d765 643 VTY_DECLVAR_CONTEXT(ospf6, o);
39e92c06
QY
644 char *alname = (argc == 5) ? argv[4]->arg : NULL;
645 ospf6_distance_unset (vty, o, argv[2]->arg, argv[3]->arg, alname);
baff583e
MZ
646
647 return CMD_SUCCESS;
648}
d7d73ffc 649#endif
baff583e 650
508e53e2 651DEFUN (ospf6_interface_area,
652 ospf6_interface_area_cmd,
653 "interface IFNAME area A.B.C.D",
654 "Enable routing on an IPv6 interface\n"
655 IFNAME_STR
656 "Specify the OSPF6 area ID\n"
657 "OSPF6 area ID in IPv4 address notation\n"
658 )
718e3744 659{
d62a17ae 660 VTY_DECLVAR_CONTEXT(ospf6, o);
661 int idx_ifname = 1;
662 int idx_ipv4 = 3;
663 struct ospf6_area *oa;
664 struct ospf6_interface *oi;
665 struct interface *ifp;
d7c0a89a 666 uint32_t area_id;
d62a17ae 667
668 /* find/create ospf6 interface */
bcc24579 669 ifp = if_get_by_name(argv[idx_ifname]->arg, VRF_DEFAULT, 0);
d62a17ae 670 oi = (struct ospf6_interface *)ifp->info;
671 if (oi == NULL)
672 oi = ospf6_interface_create(ifp);
673 if (oi->area) {
674 vty_out(vty, "%s already attached to Area %s\n",
675 oi->interface->name, oi->area->name);
676 return CMD_SUCCESS;
677 }
6452df09 678
d62a17ae 679 /* parse Area-ID */
680 if (inet_pton(AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) {
681 vty_out(vty, "Invalid Area-ID: %s\n", argv[idx_ipv4]->arg);
682 return CMD_SUCCESS;
683 }
684
685 /* find/create ospf6 area */
686 oa = ospf6_area_lookup(area_id, o);
687 if (oa == NULL)
688 oa = ospf6_area_create(area_id, o, OSPF6_AREA_FMT_DOTTEDQUAD);
689
690 /* attach interface to area */
691 listnode_add(oa->if_list, oi); /* sort ?? */
692 oi->area = oa;
693
694 SET_FLAG(oa->flag, OSPF6_AREA_ENABLE);
695
696 /* ospf6 process is currently disabled, not much more to do */
697 if (CHECK_FLAG(o->flag, OSPF6_DISABLED))
698 return CMD_SUCCESS;
699
700 /* start up */
701 ospf6_interface_enable(oi);
702
703 /* If the router is ABR, originate summary routes */
704 if (ospf6_is_router_abr(o))
705 ospf6_abr_enable_area(oa);
706
707 return CMD_SUCCESS;
718e3744 708}
709
508e53e2 710DEFUN (no_ospf6_interface_area,
711 no_ospf6_interface_area_cmd,
712 "no interface IFNAME area A.B.C.D",
713 NO_STR
714 "Disable routing on an IPv6 interface\n"
715 IFNAME_STR
716 "Specify the OSPF6 area ID\n"
717 "OSPF6 area ID in IPv4 address notation\n"
718 )
718e3744 719{
d62a17ae 720 int idx_ifname = 2;
721 int idx_ipv4 = 4;
722 struct ospf6_interface *oi;
723 struct ospf6_area *oa;
724 struct interface *ifp;
d7c0a89a 725 uint32_t area_id;
d62a17ae 726
727 ifp = if_lookup_by_name(argv[idx_ifname]->arg, VRF_DEFAULT);
728 if (ifp == NULL) {
729 vty_out(vty, "No such interface %s\n", argv[idx_ifname]->arg);
730 return CMD_SUCCESS;
731 }
6452df09 732
d62a17ae 733 oi = (struct ospf6_interface *)ifp->info;
734 if (oi == NULL) {
735 vty_out(vty, "Interface %s not enabled\n", ifp->name);
736 return CMD_SUCCESS;
737 }
738
739 /* parse Area-ID */
740 if (inet_pton(AF_INET, argv[idx_ipv4]->arg, &area_id) != 1) {
741 vty_out(vty, "Invalid Area-ID: %s\n", argv[idx_ipv4]->arg);
742 return CMD_SUCCESS;
743 }
744
745 /* Verify Area */
746 if (oi->area == NULL) {
747 vty_out(vty, "No such Area-ID: %s\n", argv[idx_ipv4]->arg);
748 return CMD_SUCCESS;
749 }
750
751 if (oi->area->area_id != area_id) {
752 vty_out(vty, "Wrong Area-ID: %s is attached to area %s\n",
753 oi->interface->name, oi->area->name);
754 return CMD_SUCCESS;
755 }
756
757 thread_execute(master, interface_down, oi, 0);
758
759 oa = oi->area;
760 listnode_delete(oi->area->if_list, oi);
761 oi->area = (struct ospf6_area *)NULL;
762
763 /* Withdraw inter-area routes from this area, if necessary */
764 if (oa->if_list->count == 0) {
765 UNSET_FLAG(oa->flag, OSPF6_AREA_ENABLE);
766 ospf6_abr_disable_area(oa);
767 }
768
769 return CMD_SUCCESS;
718e3744 770}
771
f41b4a02
DD
772DEFUN (ospf6_stub_router_admin,
773 ospf6_stub_router_admin_cmd,
774 "stub-router administrative",
775 "Make router a stub router\n"
f41b4a02
DD
776 "Administratively applied, for an indefinite period\n")
777{
d62a17ae 778 struct listnode *node;
779 struct ospf6_area *oa;
780
781 if (!CHECK_FLAG(ospf6->flag, OSPF6_STUB_ROUTER)) {
782 for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, node, oa)) {
783 OSPF6_OPT_CLEAR(oa->options, OSPF6_OPT_V6);
784 OSPF6_OPT_CLEAR(oa->options, OSPF6_OPT_R);
785 OSPF6_ROUTER_LSA_SCHEDULE(oa);
786 }
787 SET_FLAG(ospf6->flag, OSPF6_STUB_ROUTER);
f41b4a02 788 }
f41b4a02 789
d62a17ae 790 return CMD_SUCCESS;
f41b4a02
DD
791}
792
793DEFUN (no_ospf6_stub_router_admin,
794 no_ospf6_stub_router_admin_cmd,
795 "no stub-router administrative",
796 NO_STR
797 "Make router a stub router\n"
f41b4a02
DD
798 "Administratively applied, for an indefinite period\n")
799{
d62a17ae 800 struct listnode *node;
801 struct ospf6_area *oa;
802
803 if (CHECK_FLAG(ospf6->flag, OSPF6_STUB_ROUTER)) {
804 for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, node, oa)) {
805 OSPF6_OPT_SET(oa->options, OSPF6_OPT_V6);
806 OSPF6_OPT_SET(oa->options, OSPF6_OPT_R);
807 OSPF6_ROUTER_LSA_SCHEDULE(oa);
808 }
809 UNSET_FLAG(ospf6->flag, OSPF6_STUB_ROUTER);
f41b4a02 810 }
f41b4a02 811
d62a17ae 812 return CMD_SUCCESS;
f41b4a02
DD
813}
814
d7d73ffc 815#if 0
f41b4a02
DD
816DEFUN (ospf6_stub_router_startup,
817 ospf6_stub_router_startup_cmd,
6147e2c6 818 "stub-router on-startup (5-86400)",
f41b4a02
DD
819 "Make router a stub router\n"
820 "Advertise inability to be a transit router\n"
821 "Automatically advertise as stub-router on startup of OSPF6\n"
822 "Time (seconds) to advertise self as stub-router\n")
823{
824 return CMD_SUCCESS;
825}
826
827DEFUN (no_ospf6_stub_router_startup,
828 no_ospf6_stub_router_startup_cmd,
829 "no stub-router on-startup",
830 NO_STR
831 "Make router a stub router\n"
832 "Advertise inability to be a transit router\n"
833 "Automatically advertise as stub-router on startup of OSPF6\n"
834 "Time (seconds) to advertise self as stub-router\n")
835{
836 return CMD_SUCCESS;
837}
838
839DEFUN (ospf6_stub_router_shutdown,
840 ospf6_stub_router_shutdown_cmd,
6147e2c6 841 "stub-router on-shutdown (5-86400)",
f41b4a02
DD
842 "Make router a stub router\n"
843 "Advertise inability to be a transit router\n"
844 "Automatically advertise as stub-router before shutdown\n"
845 "Time (seconds) to advertise self as stub-router\n")
846{
847 return CMD_SUCCESS;
848}
849
850DEFUN (no_ospf6_stub_router_shutdown,
851 no_ospf6_stub_router_shutdown_cmd,
852 "no stub-router on-shutdown",
853 NO_STR
854 "Make router a stub router\n"
855 "Advertise inability to be a transit router\n"
856 "Automatically advertise as stub-router before shutdown\n"
857 "Time (seconds) to advertise self as stub-router\n")
858{
859 return CMD_SUCCESS;
860}
d7d73ffc 861#endif
f41b4a02 862
d62a17ae 863static void ospf6_show(struct vty *vty, struct ospf6 *o)
718e3744 864{
d62a17ae 865 struct listnode *n;
866 struct ospf6_area *oa;
867 char router_id[16], duration[32];
868 struct timeval now, running, result;
869 char buf[32], rbuf[32];
870
871 /* process id, router id */
872 inet_ntop(AF_INET, &o->router_id, router_id, sizeof(router_id));
873 vty_out(vty, " OSPFv3 Routing Process (0) with Router-ID %s\n",
874 router_id);
875
876 /* running time */
877 monotime(&now);
878 timersub(&now, &o->starttime, &running);
879 timerstring(&running, duration, sizeof(duration));
880 vty_out(vty, " Running %s\n", duration);
881
882 /* Redistribute configuration */
883 /* XXX */
884
885 vty_out(vty, " LSA minimum arrival %d msecs\n", o->lsa_minarrival);
886
887 /* Show SPF parameters */
888 vty_out(vty,
889 " Initial SPF scheduling delay %d millisec(s)\n"
890 " Minimum hold time between consecutive SPFs %d millsecond(s)\n"
891 " Maximum hold time between consecutive SPFs %d millsecond(s)\n"
892 " Hold time multiplier is currently %d\n",
893 o->spf_delay, o->spf_holdtime, o->spf_max_holdtime,
894 o->spf_hold_multiplier);
895
896 vty_out(vty, " SPF algorithm ");
897 if (o->ts_spf.tv_sec || o->ts_spf.tv_usec) {
898 timersub(&now, &o->ts_spf, &result);
899 timerstring(&result, buf, sizeof(buf));
900 ospf6_spf_reason_string(o->last_spf_reason, rbuf, sizeof(rbuf));
901 vty_out(vty, "last executed %s ago, reason %s\n", buf, rbuf);
902 vty_out(vty, " Last SPF duration %lld sec %lld usec\n",
903 (long long)o->ts_spf_duration.tv_sec,
904 (long long)o->ts_spf_duration.tv_usec);
905 } else
ab0f1135 906 vty_out(vty, "has not been run\n");
d62a17ae 907 threadtimer_string(now, o->t_spf_calc, buf, sizeof(buf));
908 vty_out(vty, " SPF timer %s%s\n", (o->t_spf_calc ? "due in " : "is "),
909 buf);
910
911 if (CHECK_FLAG(o->flag, OSPF6_STUB_ROUTER))
912 vty_out(vty, " Router Is Stub Router\n");
913
914 /* LSAs */
915 vty_out(vty, " Number of AS scoped LSAs is %u\n", o->lsdb->count);
916
917 /* Areas */
918 vty_out(vty, " Number of areas in this router is %u\n",
919 listcount(o->area_list));
920
921 if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) {
922 if (CHECK_FLAG(o->config_flags, OSPF6_LOG_ADJACENCY_DETAIL))
923 vty_out(vty, " All adjacency changes are logged\n");
924 else
925 vty_out(vty, " Adjacency changes are logged\n");
926 }
927
928 vty_out(vty, "\n");
929
930 for (ALL_LIST_ELEMENTS_RO(o->area_list, n, oa))
931 ospf6_area_show(vty, oa);
718e3744 932}
933
508e53e2 934/* show top level structures */
935DEFUN (show_ipv6_ospf6,
936 show_ipv6_ospf6_cmd,
937 "show ipv6 ospf6",
938 SHOW_STR
939 IP6_STR
940 OSPF6_STR)
718e3744 941{
d62a17ae 942 OSPF6_CMD_CHECK_RUNNING();
508e53e2 943
d62a17ae 944 ospf6_show(vty, ospf6);
945 return CMD_SUCCESS;
718e3744 946}
947
948DEFUN (show_ipv6_ospf6_route,
949 show_ipv6_ospf6_route_cmd,
6de69f83 950 "show ipv6 ospf6 route [<intra-area|inter-area|external-1|external-2|X:X::X:X|X:X::X:X/M|detail|summary>]",
718e3744 951 SHOW_STR
952 IP6_STR
953 OSPF6_STR
508e53e2 954 ROUTE_STR
1d68dbfe
DW
955 "Display Intra-Area routes\n"
956 "Display Inter-Area routes\n"
957 "Display Type-1 External routes\n"
958 "Display Type-2 External routes\n"
959 "Specify IPv6 address\n"
960 "Specify IPv6 prefix\n"
961 "Detailed information\n"
962 "Summary of route table\n")
718e3744 963{
d62a17ae 964 OSPF6_CMD_CHECK_RUNNING();
b52a8a52 965
d62a17ae 966 ospf6_route_table_show(vty, 4, argc, argv, ospf6->route_table);
967 return CMD_SUCCESS;
718e3744 968}
969
508e53e2 970DEFUN (show_ipv6_ospf6_route_match,
971 show_ipv6_ospf6_route_match_cmd,
1d68dbfe 972 "show ipv6 ospf6 route X:X::X:X/M <match|longer>",
718e3744 973 SHOW_STR
974 IP6_STR
975 OSPF6_STR
508e53e2 976 ROUTE_STR
977 "Specify IPv6 prefix\n"
978 "Display routes which match the specified route\n"
1d68dbfe 979 "Display routes longer than the specified route\n")
718e3744 980{
d62a17ae 981 OSPF6_CMD_CHECK_RUNNING();
b52a8a52 982
d62a17ae 983 ospf6_route_table_show(vty, 4, argc, argv, ospf6->route_table);
984 return CMD_SUCCESS;
718e3744 985}
986
508e53e2 987DEFUN (show_ipv6_ospf6_route_match_detail,
988 show_ipv6_ospf6_route_match_detail_cmd,
4846ef64 989 "show ipv6 ospf6 route X:X::X:X/M match detail",
718e3744 990 SHOW_STR
991 IP6_STR
992 OSPF6_STR
508e53e2 993 ROUTE_STR
994 "Specify IPv6 prefix\n"
995 "Display routes which match the specified route\n"
718e3744 996 "Detailed information\n"
997 )
508e53e2 998{
d62a17ae 999 OSPF6_CMD_CHECK_RUNNING();
b52a8a52 1000
d62a17ae 1001 ospf6_route_table_show(vty, 4, argc, argv, ospf6->route_table);
1002 return CMD_SUCCESS;
508e53e2 1003}
718e3744 1004
cb4b8845 1005
4846ef64 1006DEFUN (show_ipv6_ospf6_route_type_detail,
1007 show_ipv6_ospf6_route_type_detail_cmd,
6147e2c6 1008 "show ipv6 ospf6 route <intra-area|inter-area|external-1|external-2> detail",
4846ef64 1009 SHOW_STR
1010 IP6_STR
1011 OSPF6_STR
1012 ROUTE_STR
ea402198
DO
1013 "Display Intra-Area routes\n"
1014 "Display Inter-Area routes\n"
1015 "Display Type-1 External routes\n"
1016 "Display Type-2 External routes\n"
4846ef64 1017 "Detailed information\n"
1018 )
1019{
d62a17ae 1020 OSPF6_CMD_CHECK_RUNNING();
b52a8a52 1021
d62a17ae 1022 ospf6_route_table_show(vty, 4, argc, argv, ospf6->route_table);
1023 return CMD_SUCCESS;
4846ef64 1024}
718e3744 1025
d62a17ae 1026static void ospf6_stub_router_config_write(struct vty *vty)
f41b4a02 1027{
d62a17ae 1028 if (CHECK_FLAG(ospf6->flag, OSPF6_STUB_ROUTER)) {
1029 vty_out(vty, " stub-router administrative\n");
1030 }
1031 return;
f41b4a02
DD
1032}
1033
d62a17ae 1034static int ospf6_distance_config_write(struct vty *vty)
baff583e 1035{
d62a17ae 1036 struct route_node *rn;
1037 struct ospf6_distance *odistance;
1038
1039 if (ospf6->distance_all)
1040 vty_out(vty, " distance %u\n", ospf6->distance_all);
1041
1042 if (ospf6->distance_intra || ospf6->distance_inter
1043 || ospf6->distance_external) {
1044 vty_out(vty, " distance ospf6");
1045
1046 if (ospf6->distance_intra)
1047 vty_out(vty, " intra-area %u", ospf6->distance_intra);
1048 if (ospf6->distance_inter)
1049 vty_out(vty, " inter-area %u", ospf6->distance_inter);
1050 if (ospf6->distance_external)
1051 vty_out(vty, " external %u", ospf6->distance_external);
1052
1053 vty_out(vty, "\n");
1054 }
1055
1056 for (rn = route_top(ospf6->distance_table); rn; rn = route_next(rn))
1057 if ((odistance = rn->info) != NULL) {
1058 char buf[PREFIX_STRLEN];
1059
1060 vty_out(vty, " distance %u %s %s\n",
1061 odistance->distance,
1062 prefix2str(&rn->p, buf, sizeof(buf)),
1063 odistance->access_list ? odistance->access_list
1064 : "");
1065 }
1066 return 0;
baff583e
MZ
1067}
1068
508e53e2 1069/* OSPF configuration write function. */
d62a17ae 1070static int config_write_ospf6(struct vty *vty)
508e53e2 1071{
d62a17ae 1072 char router_id[16];
1073 struct listnode *j, *k;
1074 struct ospf6_area *oa;
1075 struct ospf6_interface *oi;
1076
1077 /* OSPFv3 configuration. */
1078 if (ospf6 == NULL)
1079 return CMD_SUCCESS;
1080
1081 inet_ntop(AF_INET, &ospf6->router_id_static, router_id,
1082 sizeof(router_id));
1083 vty_out(vty, "router ospf6\n");
1084 if (ospf6->router_id_static != 0)
5d1a2ee8 1085 vty_out(vty, " ospf6 router-id %s\n", router_id);
d62a17ae 1086
1087 /* log-adjacency-changes flag print. */
1088 if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_CHANGES)) {
1089 if (CHECK_FLAG(ospf6->config_flags, OSPF6_LOG_ADJACENCY_DETAIL))
1090 vty_out(vty, " log-adjacency-changes detail\n");
1091 else if (!DFLT_OSPF6_LOG_ADJACENCY_CHANGES)
1092 vty_out(vty, " log-adjacency-changes\n");
1093 } else if (DFLT_OSPF6_LOG_ADJACENCY_CHANGES) {
1094 vty_out(vty, " no log-adjacency-changes\n");
1095 }
1096
1097 if (ospf6->ref_bandwidth != OSPF6_REFERENCE_BANDWIDTH)
1098 vty_out(vty, " auto-cost reference-bandwidth %d\n",
1099 ospf6->ref_bandwidth);
1100
1101 /* LSA timers print. */
1102 if (ospf6->lsa_minarrival != OSPF_MIN_LS_ARRIVAL)
1103 vty_out(vty, " timers lsa min-arrival %d\n",
1104 ospf6->lsa_minarrival);
1105
1106 ospf6_stub_router_config_write(vty);
1107 ospf6_redistribute_config_write(vty);
1108 ospf6_area_config_write(vty);
1109 ospf6_spf_config_write(vty);
1110 ospf6_distance_config_write(vty);
1111
1112 for (ALL_LIST_ELEMENTS_RO(ospf6->area_list, j, oa)) {
1113 for (ALL_LIST_ELEMENTS_RO(oa->if_list, k, oi))
1114 vty_out(vty, " interface %s area %s\n",
1115 oi->interface->name, oa->name);
1116 }
1117 vty_out(vty, "!\n");
1118 return 0;
508e53e2 1119}
1120
1121/* OSPF6 node structure. */
d62a17ae 1122static struct cmd_node ospf6_node = {
1123 OSPF6_NODE, "%s(config-ospf6)# ", 1 /* VTYSH */
508e53e2 1124};
1125
1126/* Install ospf related commands. */
d62a17ae 1127void ospf6_top_init(void)
718e3744 1128{
d62a17ae 1129 /* Install ospf6 top node. */
1130 install_node(&ospf6_node, config_write_ospf6);
1131
1132 install_element(VIEW_NODE, &show_ipv6_ospf6_cmd);
1133 install_element(CONFIG_NODE, &router_ospf6_cmd);
1134 install_element(CONFIG_NODE, &no_router_ospf6_cmd);
1135
1136 install_element(VIEW_NODE, &show_ipv6_ospf6_route_cmd);
1137 install_element(VIEW_NODE, &show_ipv6_ospf6_route_match_cmd);
1138 install_element(VIEW_NODE, &show_ipv6_ospf6_route_match_detail_cmd);
1139 install_element(VIEW_NODE, &show_ipv6_ospf6_route_type_detail_cmd);
1140
1141 install_default(OSPF6_NODE);
1142 install_element(OSPF6_NODE, &ospf6_router_id_cmd);
5d1a2ee8
QY
1143 install_element(OSPF6_NODE, &no_ospf6_router_id_cmd);
1144 install_element(OSPF6_NODE, &ospf6_router_id_hdn_cmd);
1145 install_element(OSPF6_NODE, &no_ospf6_router_id_hdn_cmd);
d62a17ae 1146 install_element(OSPF6_NODE, &ospf6_log_adjacency_changes_cmd);
1147 install_element(OSPF6_NODE, &ospf6_log_adjacency_changes_detail_cmd);
1148 install_element(OSPF6_NODE, &no_ospf6_log_adjacency_changes_cmd);
1149 install_element(OSPF6_NODE, &no_ospf6_log_adjacency_changes_detail_cmd);
1150
1151 /* LSA timers commands */
1152 install_element(OSPF6_NODE, &ospf6_timers_lsa_cmd);
1153 install_element(OSPF6_NODE, &no_ospf6_timers_lsa_cmd);
1154
1155 install_element(OSPF6_NODE, &ospf6_interface_area_cmd);
1156 install_element(OSPF6_NODE, &no_ospf6_interface_area_cmd);
1157 install_element(OSPF6_NODE, &ospf6_stub_router_admin_cmd);
1158 install_element(OSPF6_NODE, &no_ospf6_stub_router_admin_cmd);
1159/* For a later time */
34d5ef45 1160#if 0
f41b4a02
DD
1161 install_element (OSPF6_NODE, &ospf6_stub_router_startup_cmd);
1162 install_element (OSPF6_NODE, &no_ospf6_stub_router_startup_cmd);
1163 install_element (OSPF6_NODE, &ospf6_stub_router_shutdown_cmd);
1164 install_element (OSPF6_NODE, &no_ospf6_stub_router_shutdown_cmd);
34d5ef45 1165#endif
508e53e2 1166
d62a17ae 1167 install_element(OSPF6_NODE, &ospf6_distance_cmd);
1168 install_element(OSPF6_NODE, &no_ospf6_distance_cmd);
1169 install_element(OSPF6_NODE, &ospf6_distance_ospf6_cmd);
1170 install_element(OSPF6_NODE, &no_ospf6_distance_ospf6_cmd);
baff583e
MZ
1171#if 0
1172 install_element (OSPF6_NODE, &ospf6_distance_source_cmd);
1173 install_element (OSPF6_NODE, &no_ospf6_distance_source_cmd);
1174#endif
718e3744 1175}