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