ospf6_top.c 17 KB

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