ospf6_top.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695
  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
  17. * along with GNU Zebra; see the file COPYING. If not, write to the
  18. * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
  19. * Boston, MA 02111-1307, USA.
  20. */
  21. #include <zebra.h>
  22. #include "log.h"
  23. #include "memory.h"
  24. #include "vty.h"
  25. #include "linklist.h"
  26. #include "prefix.h"
  27. #include "table.h"
  28. #include "thread.h"
  29. #include "command.h"
  30. #include "ospf6_proto.h"
  31. #include "ospf6_message.h"
  32. #include "ospf6_lsa.h"
  33. #include "ospf6_lsdb.h"
  34. #include "ospf6_route.h"
  35. #include "ospf6_zebra.h"
  36. #include "ospf6_top.h"
  37. #include "ospf6_area.h"
  38. #include "ospf6_interface.h"
  39. #include "ospf6_neighbor.h"
  40. #include "ospf6_flood.h"
  41. #include "ospf6_asbr.h"
  42. #include "ospf6_abr.h"
  43. #include "ospf6_intra.h"
  44. #include "ospf6d.h"
  45. /* global ospf6d variable */
  46. struct ospf6 *ospf6;
  47. static void
  48. ospf6_top_lsdb_hook_add (struct ospf6_lsa *lsa)
  49. {
  50. switch (ntohs (lsa->header->type))
  51. {
  52. case OSPF6_LSTYPE_AS_EXTERNAL:
  53. ospf6_asbr_lsa_add (lsa);
  54. break;
  55. default:
  56. break;
  57. }
  58. }
  59. static void
  60. ospf6_top_lsdb_hook_remove (struct ospf6_lsa *lsa)
  61. {
  62. switch (ntohs (lsa->header->type))
  63. {
  64. case OSPF6_LSTYPE_AS_EXTERNAL:
  65. ospf6_asbr_lsa_remove (lsa);
  66. break;
  67. default:
  68. break;
  69. }
  70. }
  71. static void
  72. ospf6_top_route_hook_add (struct ospf6_route *route)
  73. {
  74. ospf6_abr_originate_summary (route);
  75. ospf6_zebra_route_update_add (route);
  76. }
  77. static void
  78. ospf6_top_route_hook_remove (struct ospf6_route *route)
  79. {
  80. ospf6_abr_originate_summary (route);
  81. ospf6_zebra_route_update_remove (route);
  82. }
  83. static void
  84. ospf6_top_brouter_hook_add (struct ospf6_route *route)
  85. {
  86. ospf6_abr_examin_brouter (ADV_ROUTER_IN_PREFIX (&route->prefix));
  87. ospf6_asbr_lsentry_add (route);
  88. ospf6_abr_originate_summary (route);
  89. }
  90. static void
  91. ospf6_top_brouter_hook_remove (struct ospf6_route *route)
  92. {
  93. ospf6_abr_examin_brouter (ADV_ROUTER_IN_PREFIX (&route->prefix));
  94. ospf6_asbr_lsentry_remove (route);
  95. ospf6_abr_originate_summary (route);
  96. }
  97. static struct ospf6 *
  98. ospf6_create (void)
  99. {
  100. struct ospf6 *o;
  101. o = XCALLOC (MTYPE_OSPF6_TOP, sizeof (struct ospf6));
  102. /* initialize */
  103. gettimeofday (&o->starttime, (struct timezone *) NULL);
  104. o->area_list = list_new ();
  105. o->area_list->cmp = ospf6_area_cmp;
  106. o->lsdb = ospf6_lsdb_create (o);
  107. o->lsdb_self = ospf6_lsdb_create (o);
  108. o->lsdb->hook_add = ospf6_top_lsdb_hook_add;
  109. o->lsdb->hook_remove = ospf6_top_lsdb_hook_remove;
  110. o->route_table = OSPF6_ROUTE_TABLE_CREATE (GLOBAL, ROUTES);
  111. o->route_table->scope = o;
  112. o->route_table->hook_add = ospf6_top_route_hook_add;
  113. o->route_table->hook_remove = ospf6_top_route_hook_remove;
  114. o->brouter_table = OSPF6_ROUTE_TABLE_CREATE (GLOBAL, BORDER_ROUTERS);
  115. o->brouter_table->scope = o;
  116. o->brouter_table->hook_add = ospf6_top_brouter_hook_add;
  117. o->brouter_table->hook_remove = ospf6_top_brouter_hook_remove;
  118. o->external_table = OSPF6_ROUTE_TABLE_CREATE (GLOBAL, EXTERNAL_ROUTES);
  119. o->external_table->scope = o;
  120. o->external_id_table = route_table_init ();
  121. return o;
  122. }
  123. static void
  124. ospf6_delete (struct ospf6 *o)
  125. {
  126. struct listnode *node, *nnode;
  127. struct ospf6_area *oa;
  128. for (ALL_LIST_ELEMENTS (o->area_list, node, nnode, oa))
  129. ospf6_area_delete (oa);
  130. ospf6_lsdb_delete (o->lsdb);
  131. ospf6_lsdb_delete (o->lsdb_self);
  132. ospf6_route_table_delete (o->route_table);
  133. ospf6_route_table_delete (o->brouter_table);
  134. ospf6_route_table_delete (o->external_table);
  135. route_table_finish (o->external_id_table);
  136. XFREE (MTYPE_OSPF6_TOP, o);
  137. }
  138. static void
  139. ospf6_enable (struct ospf6 *o)
  140. {
  141. struct listnode *node, *nnode;
  142. struct ospf6_area *oa;
  143. if (CHECK_FLAG (o->flag, OSPF6_DISABLED))
  144. {
  145. UNSET_FLAG (o->flag, OSPF6_DISABLED);
  146. for (ALL_LIST_ELEMENTS (o->area_list, node, nnode, oa))
  147. ospf6_area_enable (oa);
  148. }
  149. }
  150. static void
  151. ospf6_disable (struct ospf6 *o)
  152. {
  153. struct listnode *node, *nnode;
  154. struct ospf6_area *oa;
  155. if (! CHECK_FLAG (o->flag, OSPF6_DISABLED))
  156. {
  157. SET_FLAG (o->flag, OSPF6_DISABLED);
  158. for (ALL_LIST_ELEMENTS (o->area_list, node, nnode, oa))
  159. ospf6_area_disable (oa);
  160. ospf6_lsdb_remove_all (o->lsdb);
  161. ospf6_route_remove_all (o->route_table);
  162. ospf6_route_remove_all (o->brouter_table);
  163. }
  164. }
  165. static int
  166. ospf6_maxage_remover (struct thread *thread)
  167. {
  168. struct ospf6 *o = (struct ospf6 *) THREAD_ARG (thread);
  169. struct ospf6_area *oa;
  170. struct ospf6_interface *oi;
  171. struct ospf6_neighbor *on;
  172. struct listnode *i, *j, *k;
  173. o->maxage_remover = (struct thread *) NULL;
  174. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  175. {
  176. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  177. {
  178. for (ALL_LIST_ELEMENTS_RO (oi->neighbor_list, k, on))
  179. {
  180. if (on->state != OSPF6_NEIGHBOR_EXCHANGE &&
  181. on->state != OSPF6_NEIGHBOR_LOADING)
  182. continue;
  183. return 0;
  184. }
  185. }
  186. }
  187. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  188. {
  189. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  190. OSPF6_LSDB_MAXAGE_REMOVER (oi->lsdb);
  191. OSPF6_LSDB_MAXAGE_REMOVER (oa->lsdb);
  192. }
  193. OSPF6_LSDB_MAXAGE_REMOVER (o->lsdb);
  194. return 0;
  195. }
  196. void
  197. ospf6_maxage_remove (struct ospf6 *o)
  198. {
  199. if (o && ! o->maxage_remover)
  200. o->maxage_remover = thread_add_event (master, ospf6_maxage_remover, o, 0);
  201. }
  202. /* start ospf6 */
  203. DEFUN (router_ospf6,
  204. router_ospf6_cmd,
  205. "router ospf6",
  206. ROUTER_STR
  207. OSPF6_STR)
  208. {
  209. if (ospf6 == NULL)
  210. ospf6 = ospf6_create ();
  211. if (CHECK_FLAG (ospf6->flag, OSPF6_DISABLED))
  212. ospf6_enable (ospf6);
  213. /* set current ospf point. */
  214. vty->node = OSPF6_NODE;
  215. vty->index = ospf6;
  216. return CMD_SUCCESS;
  217. }
  218. /* stop ospf6 */
  219. DEFUN (no_router_ospf6,
  220. no_router_ospf6_cmd,
  221. "no router ospf6",
  222. NO_STR
  223. OSPF6_ROUTER_STR)
  224. {
  225. if (ospf6 == NULL || CHECK_FLAG (ospf6->flag, OSPF6_DISABLED))
  226. vty_out (vty, "OSPFv3 is not running%s", VNL);
  227. else
  228. ospf6_disable (ospf6);
  229. /* return to config node . */
  230. vty->node = CONFIG_NODE;
  231. vty->index = NULL;
  232. return CMD_SUCCESS;
  233. }
  234. /* change Router_ID commands. */
  235. DEFUN (ospf6_router_id,
  236. ospf6_router_id_cmd,
  237. "router-id A.B.C.D",
  238. "Configure OSPF Router-ID\n"
  239. V4NOTATION_STR)
  240. {
  241. int ret;
  242. u_int32_t router_id;
  243. struct ospf6 *o;
  244. o = (struct ospf6 *) vty->index;
  245. ret = inet_pton (AF_INET, argv[0], &router_id);
  246. if (ret == 0)
  247. {
  248. vty_out (vty, "malformed OSPF Router-ID: %s%s", argv[0], VNL);
  249. return CMD_SUCCESS;
  250. }
  251. o->router_id_static = router_id;
  252. if (o->router_id == 0)
  253. o->router_id = router_id;
  254. return CMD_SUCCESS;
  255. }
  256. DEFUN (ospf6_interface_area,
  257. ospf6_interface_area_cmd,
  258. "interface IFNAME area A.B.C.D",
  259. "Enable routing on an IPv6 interface\n"
  260. IFNAME_STR
  261. "Specify the OSPF6 area ID\n"
  262. "OSPF6 area ID in IPv4 address notation\n"
  263. )
  264. {
  265. struct ospf6 *o;
  266. struct ospf6_area *oa;
  267. struct ospf6_interface *oi;
  268. struct interface *ifp;
  269. u_int32_t area_id;
  270. o = (struct ospf6 *) vty->index;
  271. /* find/create ospf6 interface */
  272. ifp = if_get_by_name (argv[0]);
  273. oi = (struct ospf6_interface *) ifp->info;
  274. if (oi == NULL)
  275. oi = ospf6_interface_create (ifp);
  276. if (oi->area)
  277. {
  278. vty_out (vty, "%s already attached to Area %s%s",
  279. oi->interface->name, oi->area->name, VNL);
  280. return CMD_SUCCESS;
  281. }
  282. /* parse Area-ID */
  283. if (inet_pton (AF_INET, argv[1], &area_id) != 1)
  284. {
  285. vty_out (vty, "Invalid Area-ID: %s%s", argv[1], VNL);
  286. return CMD_SUCCESS;
  287. }
  288. /* find/create ospf6 area */
  289. oa = ospf6_area_lookup (area_id, o);
  290. if (oa == NULL)
  291. oa = ospf6_area_create (area_id, o);
  292. /* attach interface to area */
  293. listnode_add (oa->if_list, oi); /* sort ?? */
  294. oi->area = oa;
  295. SET_FLAG (oa->flag, OSPF6_AREA_ENABLE);
  296. /* start up */
  297. thread_add_event (master, interface_up, oi, 0);
  298. /* If the router is ABR, originate summary routes */
  299. if (ospf6_is_router_abr (o))
  300. ospf6_abr_enable_area (oa);
  301. return CMD_SUCCESS;
  302. }
  303. DEFUN (no_ospf6_interface_area,
  304. no_ospf6_interface_area_cmd,
  305. "no interface IFNAME area A.B.C.D",
  306. NO_STR
  307. "Disable routing on an IPv6 interface\n"
  308. IFNAME_STR
  309. "Specify the OSPF6 area ID\n"
  310. "OSPF6 area ID in IPv4 address notation\n"
  311. )
  312. {
  313. struct ospf6 *o;
  314. struct ospf6_interface *oi;
  315. struct ospf6_area *oa;
  316. struct interface *ifp;
  317. u_int32_t area_id;
  318. o = (struct ospf6 *) vty->index;
  319. ifp = if_lookup_by_name (argv[0]);
  320. if (ifp == NULL)
  321. {
  322. vty_out (vty, "No such interface %s%s", argv[0], VNL);
  323. return CMD_SUCCESS;
  324. }
  325. oi = (struct ospf6_interface *) ifp->info;
  326. if (oi == NULL)
  327. {
  328. vty_out (vty, "Interface %s not enabled%s", ifp->name, VNL);
  329. return CMD_SUCCESS;
  330. }
  331. /* parse Area-ID */
  332. if (inet_pton (AF_INET, argv[1], &area_id) != 1)
  333. {
  334. vty_out (vty, "Invalid Area-ID: %s%s", argv[1], VNL);
  335. return CMD_SUCCESS;
  336. }
  337. if (oi->area->area_id != area_id)
  338. {
  339. vty_out (vty, "Wrong Area-ID: %s is attached to area %s%s",
  340. oi->interface->name, oi->area->name, VNL);
  341. return CMD_SUCCESS;
  342. }
  343. thread_execute (master, interface_down, oi, 0);
  344. oa = oi->area;
  345. listnode_delete (oi->area->if_list, oi);
  346. oi->area = (struct ospf6_area *) NULL;
  347. /* Withdraw inter-area routes from this area, if necessary */
  348. if (oa->if_list->count == 0)
  349. {
  350. UNSET_FLAG (oa->flag, OSPF6_AREA_ENABLE);
  351. ospf6_abr_disable_area (oa);
  352. }
  353. return CMD_SUCCESS;
  354. }
  355. static void
  356. ospf6_show (struct vty *vty, struct ospf6 *o)
  357. {
  358. struct listnode *n;
  359. struct ospf6_area *oa;
  360. char router_id[16], duration[32];
  361. struct timeval now, running;
  362. /* process id, router id */
  363. inet_ntop (AF_INET, &o->router_id, router_id, sizeof (router_id));
  364. vty_out (vty, " OSPFv3 Routing Process (0) with Router-ID %s%s",
  365. router_id, VNL);
  366. /* running time */
  367. gettimeofday (&now, (struct timezone *)NULL);
  368. timersub (&now, &o->starttime, &running);
  369. timerstring (&running, duration, sizeof (duration));
  370. vty_out (vty, " Running %s%s", duration, VNL);
  371. /* Redistribute configuration */
  372. /* XXX */
  373. /* LSAs */
  374. vty_out (vty, " Number of AS scoped LSAs is %u%s",
  375. o->lsdb->count, VNL);
  376. /* Areas */
  377. vty_out (vty, " Number of areas in this router is %u%s",
  378. listcount (o->area_list), VNL);
  379. for (ALL_LIST_ELEMENTS_RO (o->area_list, n, oa))
  380. ospf6_area_show (vty, oa);
  381. }
  382. /* show top level structures */
  383. DEFUN (show_ipv6_ospf6,
  384. show_ipv6_ospf6_cmd,
  385. "show ipv6 ospf6",
  386. SHOW_STR
  387. IP6_STR
  388. OSPF6_STR)
  389. {
  390. OSPF6_CMD_CHECK_RUNNING ();
  391. ospf6_show (vty, ospf6);
  392. return CMD_SUCCESS;
  393. }
  394. DEFUN (show_ipv6_ospf6_route,
  395. show_ipv6_ospf6_route_cmd,
  396. "show ipv6 ospf6 route",
  397. SHOW_STR
  398. IP6_STR
  399. OSPF6_STR
  400. ROUTE_STR
  401. )
  402. {
  403. ospf6_route_table_show (vty, argc, argv, ospf6->route_table);
  404. return CMD_SUCCESS;
  405. }
  406. ALIAS (show_ipv6_ospf6_route,
  407. show_ipv6_ospf6_route_detail_cmd,
  408. "show ipv6 ospf6 route (X:X::X:X|X:X::X:X/M|detail|summary)",
  409. SHOW_STR
  410. IP6_STR
  411. OSPF6_STR
  412. ROUTE_STR
  413. "Specify IPv6 address\n"
  414. "Specify IPv6 prefix\n"
  415. "Detailed information\n"
  416. "Summary of route table\n"
  417. )
  418. DEFUN (show_ipv6_ospf6_route_match,
  419. show_ipv6_ospf6_route_match_cmd,
  420. "show ipv6 ospf6 route X:X::X:X/M match",
  421. SHOW_STR
  422. IP6_STR
  423. OSPF6_STR
  424. ROUTE_STR
  425. "Specify IPv6 prefix\n"
  426. "Display routes which match the specified route\n"
  427. )
  428. {
  429. const char *sargv[CMD_ARGC_MAX];
  430. int i, sargc;
  431. /* copy argv to sargv and then append "match" */
  432. for (i = 0; i < argc; i++)
  433. sargv[i] = argv[i];
  434. sargc = argc;
  435. sargv[sargc++] = "match";
  436. sargv[sargc] = NULL;
  437. ospf6_route_table_show (vty, sargc, sargv, ospf6->route_table);
  438. return CMD_SUCCESS;
  439. }
  440. DEFUN (show_ipv6_ospf6_route_match_detail,
  441. show_ipv6_ospf6_route_match_detail_cmd,
  442. "show ipv6 ospf6 route X:X::X:X/M match detail",
  443. SHOW_STR
  444. IP6_STR
  445. OSPF6_STR
  446. ROUTE_STR
  447. "Specify IPv6 prefix\n"
  448. "Display routes which match the specified route\n"
  449. "Detailed information\n"
  450. )
  451. {
  452. const char *sargv[CMD_ARGC_MAX];
  453. int i, sargc;
  454. /* copy argv to sargv and then append "match" and "detail" */
  455. for (i = 0; i < argc; i++)
  456. sargv[i] = argv[i];
  457. sargc = argc;
  458. sargv[sargc++] = "match";
  459. sargv[sargc++] = "detail";
  460. sargv[sargc] = NULL;
  461. ospf6_route_table_show (vty, sargc, sargv, ospf6->route_table);
  462. return CMD_SUCCESS;
  463. }
  464. ALIAS (show_ipv6_ospf6_route_match,
  465. show_ipv6_ospf6_route_longer_cmd,
  466. "show ipv6 ospf6 route X:X::X:X/M longer",
  467. SHOW_STR
  468. IP6_STR
  469. OSPF6_STR
  470. ROUTE_STR
  471. "Specify IPv6 prefix\n"
  472. "Display routes longer than the specified route\n"
  473. )
  474. DEFUN (show_ipv6_ospf6_route_match_detail,
  475. show_ipv6_ospf6_route_longer_detail_cmd,
  476. "show ipv6 ospf6 route X:X::X:X/M longer detail",
  477. SHOW_STR
  478. IP6_STR
  479. OSPF6_STR
  480. ROUTE_STR
  481. "Specify IPv6 prefix\n"
  482. "Display routes longer than the specified route\n"
  483. "Detailed information\n"
  484. );
  485. ALIAS (show_ipv6_ospf6_route,
  486. show_ipv6_ospf6_route_type_cmd,
  487. "show ipv6 ospf6 route (intra-area|inter-area|external-1|external-2)",
  488. SHOW_STR
  489. IP6_STR
  490. OSPF6_STR
  491. ROUTE_STR
  492. "Dispaly Intra-Area routes\n"
  493. "Dispaly Inter-Area routes\n"
  494. "Dispaly Type-1 External routes\n"
  495. "Dispaly Type-2 External routes\n"
  496. )
  497. DEFUN (show_ipv6_ospf6_route_type_detail,
  498. show_ipv6_ospf6_route_type_detail_cmd,
  499. "show ipv6 ospf6 route (intra-area|inter-area|external-1|external-2) detail",
  500. SHOW_STR
  501. IP6_STR
  502. OSPF6_STR
  503. ROUTE_STR
  504. "Dispaly Intra-Area routes\n"
  505. "Dispaly Inter-Area routes\n"
  506. "Dispaly Type-1 External routes\n"
  507. "Dispaly Type-2 External routes\n"
  508. "Detailed information\n"
  509. )
  510. {
  511. const char *sargv[CMD_ARGC_MAX];
  512. int i, sargc;
  513. /* copy argv to sargv and then append "detail" */
  514. for (i = 0; i < argc; i++)
  515. sargv[i] = argv[i];
  516. sargc = argc;
  517. sargv[sargc++] = "detail";
  518. sargv[sargc] = NULL;
  519. ospf6_route_table_show (vty, sargc, sargv, ospf6->route_table);
  520. return CMD_SUCCESS;
  521. }
  522. /* OSPF configuration write function. */
  523. static int
  524. config_write_ospf6 (struct vty *vty)
  525. {
  526. char router_id[16];
  527. struct listnode *j, *k;
  528. struct ospf6_area *oa;
  529. struct ospf6_interface *oi;
  530. /* OSPFv6 configuration. */
  531. if (ospf6 == NULL)
  532. return CMD_SUCCESS;
  533. if (CHECK_FLAG (ospf6->flag, OSPF6_DISABLED))
  534. return CMD_SUCCESS;
  535. inet_ntop (AF_INET, &ospf6->router_id_static, router_id, sizeof (router_id));
  536. vty_out (vty, "router ospf6%s", VNL);
  537. if (ospf6->router_id_static != 0)
  538. vty_out (vty, " router-id %s%s", router_id, VNL);
  539. ospf6_redistribute_config_write (vty);
  540. ospf6_area_config_write (vty);
  541. for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, j, oa))
  542. {
  543. for (ALL_LIST_ELEMENTS_RO (oa->if_list, k, oi))
  544. vty_out (vty, " interface %s area %s%s",
  545. oi->interface->name, oa->name, VNL);
  546. }
  547. vty_out (vty, "!%s", VNL);
  548. return 0;
  549. }
  550. /* OSPF6 node structure. */
  551. struct cmd_node ospf6_node =
  552. {
  553. OSPF6_NODE,
  554. "%s(config-ospf6)# ",
  555. 1 /* VTYSH */
  556. };
  557. /* Install ospf related commands. */
  558. void
  559. ospf6_top_init (void)
  560. {
  561. /* Install ospf6 top node. */
  562. install_node (&ospf6_node, config_write_ospf6);
  563. install_element (VIEW_NODE, &show_ipv6_ospf6_cmd);
  564. install_element (ENABLE_NODE, &show_ipv6_ospf6_cmd);
  565. install_element (CONFIG_NODE, &router_ospf6_cmd);
  566. install_element (VIEW_NODE, &show_ipv6_ospf6_route_cmd);
  567. install_element (VIEW_NODE, &show_ipv6_ospf6_route_detail_cmd);
  568. install_element (VIEW_NODE, &show_ipv6_ospf6_route_match_cmd);
  569. install_element (VIEW_NODE, &show_ipv6_ospf6_route_match_detail_cmd);
  570. install_element (VIEW_NODE, &show_ipv6_ospf6_route_longer_cmd);
  571. install_element (VIEW_NODE, &show_ipv6_ospf6_route_longer_detail_cmd);
  572. install_element (VIEW_NODE, &show_ipv6_ospf6_route_type_cmd);
  573. install_element (VIEW_NODE, &show_ipv6_ospf6_route_type_detail_cmd);
  574. install_element (ENABLE_NODE, &show_ipv6_ospf6_route_cmd);
  575. install_element (ENABLE_NODE, &show_ipv6_ospf6_route_detail_cmd);
  576. install_element (ENABLE_NODE, &show_ipv6_ospf6_route_match_cmd);
  577. install_element (ENABLE_NODE, &show_ipv6_ospf6_route_match_detail_cmd);
  578. install_element (ENABLE_NODE, &show_ipv6_ospf6_route_longer_cmd);
  579. install_element (ENABLE_NODE, &show_ipv6_ospf6_route_longer_detail_cmd);
  580. install_element (ENABLE_NODE, &show_ipv6_ospf6_route_type_cmd);
  581. install_element (ENABLE_NODE, &show_ipv6_ospf6_route_type_detail_cmd);
  582. install_default (OSPF6_NODE);
  583. install_element (OSPF6_NODE, &ospf6_router_id_cmd);
  584. install_element (OSPF6_NODE, &ospf6_interface_area_cmd);
  585. install_element (OSPF6_NODE, &no_ospf6_interface_area_cmd);
  586. install_element (OSPF6_NODE, &no_router_ospf6_cmd);
  587. }