ospf6d.c 55 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892
  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 "thread.h"
  23. #include "linklist.h"
  24. #include "vty.h"
  25. #include "command.h"
  26. #include "ospf6_proto.h"
  27. #include "ospf6_network.h"
  28. #include "ospf6_lsa.h"
  29. #include "ospf6_lsdb.h"
  30. #include "ospf6_message.h"
  31. #include "ospf6_route.h"
  32. #include "ospf6_zebra.h"
  33. #include "ospf6_spf.h"
  34. #include "ospf6_top.h"
  35. #include "ospf6_area.h"
  36. #include "ospf6_interface.h"
  37. #include "ospf6_neighbor.h"
  38. #include "ospf6_intra.h"
  39. #include "ospf6_asbr.h"
  40. #include "ospf6_abr.h"
  41. #include "ospf6_flood.h"
  42. #include "ospf6d.h"
  43. #ifdef HAVE_SNMP
  44. #include "ospf6_snmp.h"
  45. #endif /*HAVE_SNMP*/
  46. char ospf6_daemon_version[] = OSPF6_DAEMON_VERSION;
  47. struct route_node *
  48. route_prev (struct route_node *node)
  49. {
  50. struct route_node *end;
  51. struct route_node *prev = NULL;
  52. end = node;
  53. node = node->parent;
  54. if (node)
  55. route_lock_node (node);
  56. while (node)
  57. {
  58. prev = node;
  59. node = route_next (node);
  60. if (node == end)
  61. {
  62. route_unlock_node (node);
  63. node = NULL;
  64. }
  65. }
  66. route_unlock_node (end);
  67. if (prev)
  68. route_lock_node (prev);
  69. return prev;
  70. }
  71. /* show database functions */
  72. DEFUN (show_version_ospf6,
  73. show_version_ospf6_cmd,
  74. "show version ospf6",
  75. SHOW_STR
  76. "Displays ospf6d version\n"
  77. )
  78. {
  79. vty_out (vty, "Zebra OSPF6d Version: %s%s",
  80. ospf6_daemon_version, VNL);
  81. return CMD_SUCCESS;
  82. }
  83. static struct cmd_node debug_node =
  84. {
  85. DEBUG_NODE,
  86. "",
  87. 1 /* VTYSH */
  88. };
  89. static int
  90. config_write_ospf6_debug (struct vty *vty)
  91. {
  92. config_write_ospf6_debug_message (vty);
  93. config_write_ospf6_debug_lsa (vty);
  94. config_write_ospf6_debug_zebra (vty);
  95. config_write_ospf6_debug_interface (vty);
  96. config_write_ospf6_debug_neighbor (vty);
  97. config_write_ospf6_debug_spf (vty);
  98. config_write_ospf6_debug_route (vty);
  99. config_write_ospf6_debug_brouter (vty);
  100. config_write_ospf6_debug_asbr (vty);
  101. config_write_ospf6_debug_abr (vty);
  102. config_write_ospf6_debug_flood (vty);
  103. vty_out (vty, "!%s", VNL);
  104. return 0;
  105. }
  106. #define AREA_LSDB_TITLE_FORMAT \
  107. "%s Area Scoped Link State Database (Area %s)%s%s"
  108. #define IF_LSDB_TITLE_FORMAT \
  109. "%s I/F Scoped Link State Database (I/F %s in Area %s)%s%s"
  110. #define AS_LSDB_TITLE_FORMAT \
  111. "%s AS Scoped Link State Database%s%s"
  112. static int
  113. parse_show_level (int argc, const char *argv[])
  114. {
  115. int level = 0;
  116. if (argc)
  117. {
  118. if (! strncmp (argv[0], "de", 2))
  119. level = OSPF6_LSDB_SHOW_LEVEL_DETAIL;
  120. else if (! strncmp (argv[0], "du", 2))
  121. level = OSPF6_LSDB_SHOW_LEVEL_DUMP;
  122. else if (! strncmp (argv[0], "in", 2))
  123. level = OSPF6_LSDB_SHOW_LEVEL_INTERNAL;
  124. }
  125. else
  126. level = OSPF6_LSDB_SHOW_LEVEL_NORMAL;
  127. return level;
  128. }
  129. static u_int16_t
  130. parse_type_spec (int argc, const char *argv[])
  131. {
  132. u_int16_t type = 0;
  133. assert (argc);
  134. if (! strcmp (argv[0], "router"))
  135. type = htons (OSPF6_LSTYPE_ROUTER);
  136. else if (! strcmp (argv[0], "network"))
  137. type = htons (OSPF6_LSTYPE_NETWORK);
  138. else if (! strcmp (argv[0], "as-external"))
  139. type = htons (OSPF6_LSTYPE_AS_EXTERNAL);
  140. else if (! strcmp (argv[0], "intra-prefix"))
  141. type = htons (OSPF6_LSTYPE_INTRA_PREFIX);
  142. else if (! strcmp (argv[0], "inter-router"))
  143. type = htons (OSPF6_LSTYPE_INTER_ROUTER);
  144. else if (! strcmp (argv[0], "inter-prefix"))
  145. type = htons (OSPF6_LSTYPE_INTER_PREFIX);
  146. else if (! strcmp (argv[0], "link"))
  147. type = htons (OSPF6_LSTYPE_LINK);
  148. return type;
  149. }
  150. DEFUN (show_ipv6_ospf6_database,
  151. show_ipv6_ospf6_database_cmd,
  152. "show ipv6 ospf6 database",
  153. SHOW_STR
  154. IPV6_STR
  155. OSPF6_STR
  156. "Display Link state database\n"
  157. )
  158. {
  159. int level;
  160. struct listnode *i, *j;
  161. struct ospf6 *o = ospf6;
  162. struct ospf6_area *oa;
  163. struct ospf6_interface *oi;
  164. OSPF6_CMD_CHECK_RUNNING ();
  165. level = parse_show_level (argc, argv);
  166. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  167. {
  168. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  169. ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oa->lsdb);
  170. }
  171. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  172. {
  173. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  174. {
  175. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  176. oi->interface->name, oa->name, VNL, VNL);
  177. ospf6_lsdb_show (vty, level, NULL, NULL, NULL, oi->lsdb);
  178. }
  179. }
  180. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  181. ospf6_lsdb_show (vty, level, NULL, NULL, NULL, o->lsdb);
  182. vty_out (vty, "%s", VNL);
  183. return CMD_SUCCESS;
  184. }
  185. ALIAS (show_ipv6_ospf6_database,
  186. show_ipv6_ospf6_database_detail_cmd,
  187. "show ipv6 ospf6 database (detail|dump|internal)",
  188. SHOW_STR
  189. IPV6_STR
  190. OSPF6_STR
  191. "Display Link state database\n"
  192. "Display details of LSAs\n"
  193. "Dump LSAs\n"
  194. "Display LSA's internal information\n"
  195. )
  196. DEFUN (show_ipv6_ospf6_database_type,
  197. show_ipv6_ospf6_database_type_cmd,
  198. "show ipv6 ospf6 database "
  199. "(router|network|inter-prefix|inter-router|as-external|"
  200. "group-membership|type-7|link|intra-prefix)",
  201. SHOW_STR
  202. IPV6_STR
  203. OSPF6_STR
  204. "Display Link state database\n"
  205. "Display Router LSAs\n"
  206. "Display Network LSAs\n"
  207. "Display Inter-Area-Prefix LSAs\n"
  208. "Display Inter-Area-Router LSAs\n"
  209. "Display As-External LSAs\n"
  210. "Display Group-Membership LSAs\n"
  211. "Display Type-7 LSAs\n"
  212. "Display Link LSAs\n"
  213. "Display Intra-Area-Prefix LSAs\n"
  214. )
  215. {
  216. int level;
  217. struct listnode *i, *j;
  218. struct ospf6 *o = ospf6;
  219. struct ospf6_area *oa;
  220. struct ospf6_interface *oi;
  221. u_int16_t type = 0;
  222. OSPF6_CMD_CHECK_RUNNING ();
  223. type = parse_type_spec (argc, argv);
  224. argc--;
  225. argv++;
  226. level = parse_show_level (argc, argv);
  227. switch (OSPF6_LSA_SCOPE (type))
  228. {
  229. case OSPF6_SCOPE_AREA:
  230. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  231. {
  232. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  233. ospf6_lsdb_show (vty, level, &type, NULL, NULL, oa->lsdb);
  234. }
  235. break;
  236. case OSPF6_SCOPE_LINKLOCAL:
  237. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  238. {
  239. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  240. {
  241. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  242. oi->interface->name, oa->name, VNL, VNL);
  243. ospf6_lsdb_show (vty, level, &type, NULL, NULL, oi->lsdb);
  244. }
  245. }
  246. break;
  247. case OSPF6_SCOPE_AS:
  248. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  249. ospf6_lsdb_show (vty, level, &type, NULL, NULL, o->lsdb);
  250. break;
  251. default:
  252. assert (0);
  253. break;
  254. }
  255. vty_out (vty, "%s", VNL);
  256. return CMD_SUCCESS;
  257. }
  258. ALIAS (show_ipv6_ospf6_database_type,
  259. show_ipv6_ospf6_database_type_detail_cmd,
  260. "show ipv6 ospf6 database "
  261. "(router|network|inter-prefix|inter-router|as-external|"
  262. "group-membership|type-7|link|intra-prefix) "
  263. "(detail|dump|internal)",
  264. SHOW_STR
  265. IPV6_STR
  266. OSPF6_STR
  267. "Display Link state database\n"
  268. "Display Router LSAs\n"
  269. "Display Network LSAs\n"
  270. "Display Inter-Area-Prefix LSAs\n"
  271. "Display Inter-Area-Router LSAs\n"
  272. "Display As-External LSAs\n"
  273. "Display Group-Membership LSAs\n"
  274. "Display Type-7 LSAs\n"
  275. "Display Link LSAs\n"
  276. "Display Intra-Area-Prefix LSAs\n"
  277. "Display details of LSAs\n"
  278. "Dump LSAs\n"
  279. "Display LSA's internal information\n"
  280. )
  281. DEFUN (show_ipv6_ospf6_database_id,
  282. show_ipv6_ospf6_database_id_cmd,
  283. "show ipv6 ospf6 database * A.B.C.D",
  284. SHOW_STR
  285. IPV6_STR
  286. OSPF6_STR
  287. "Display Link state database\n"
  288. "Any Link state Type\n"
  289. "Specify Link state ID as IPv4 address notation\n"
  290. )
  291. {
  292. int level;
  293. struct listnode *i, *j;
  294. struct ospf6 *o = ospf6;
  295. struct ospf6_area *oa;
  296. struct ospf6_interface *oi;
  297. u_int32_t id = 0;
  298. OSPF6_CMD_CHECK_RUNNING ();
  299. if ((inet_pton (AF_INET, argv[0], &id)) != 1)
  300. {
  301. vty_out (vty, "Link State ID is not parsable: %s%s",
  302. argv[0], VNL);
  303. return CMD_SUCCESS;
  304. }
  305. argc--;
  306. argv++;
  307. level = parse_show_level (argc, argv);
  308. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  309. {
  310. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  311. ospf6_lsdb_show (vty, level, NULL, &id, NULL, oa->lsdb);
  312. }
  313. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  314. {
  315. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  316. {
  317. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  318. oi->interface->name, oa->name, VNL, VNL);
  319. ospf6_lsdb_show (vty, level, NULL, &id, NULL, oi->lsdb);
  320. }
  321. }
  322. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  323. ospf6_lsdb_show (vty, level, NULL, &id, NULL, o->lsdb);
  324. vty_out (vty, "%s", VNL);
  325. return CMD_SUCCESS;
  326. }
  327. ALIAS (show_ipv6_ospf6_database_id,
  328. show_ipv6_ospf6_database_id_detail_cmd,
  329. "show ipv6 ospf6 database * A.B.C.D "
  330. "(detail|dump|internal)",
  331. SHOW_STR
  332. IPV6_STR
  333. OSPF6_STR
  334. "Display Link state database\n"
  335. "Any Link state Type\n"
  336. "Specify Link state ID as IPv4 address notation\n"
  337. "Display details of LSAs\n"
  338. "Dump LSAs\n"
  339. "Display LSA's internal information\n"
  340. )
  341. ALIAS (show_ipv6_ospf6_database_id,
  342. show_ipv6_ospf6_database_linkstate_id_cmd,
  343. "show ipv6 ospf6 database linkstate-id A.B.C.D",
  344. SHOW_STR
  345. IPV6_STR
  346. OSPF6_STR
  347. "Display Link state database\n"
  348. "Search by Link state ID\n"
  349. "Specify Link state ID as IPv4 address notation\n"
  350. )
  351. ALIAS (show_ipv6_ospf6_database_id,
  352. show_ipv6_ospf6_database_linkstate_id_detail_cmd,
  353. "show ipv6 ospf6 database linkstate-id A.B.C.D "
  354. "(detail|dump|internal)",
  355. SHOW_STR
  356. IPV6_STR
  357. OSPF6_STR
  358. "Display Link state database\n"
  359. "Search by Link state ID\n"
  360. "Specify Link state ID as IPv4 address notation\n"
  361. "Display details of LSAs\n"
  362. "Dump LSAs\n"
  363. "Display LSA's internal information\n"
  364. )
  365. DEFUN (show_ipv6_ospf6_database_router,
  366. show_ipv6_ospf6_database_router_cmd,
  367. "show ipv6 ospf6 database * * A.B.C.D",
  368. SHOW_STR
  369. IPV6_STR
  370. OSPF6_STR
  371. "Display Link state database\n"
  372. "Any Link state Type\n"
  373. "Any Link state ID\n"
  374. "Specify Advertising Router as IPv4 address notation\n"
  375. )
  376. {
  377. int level;
  378. struct listnode *i, *j;
  379. struct ospf6 *o = ospf6;
  380. struct ospf6_area *oa;
  381. struct ospf6_interface *oi;
  382. u_int32_t adv_router = 0;
  383. OSPF6_CMD_CHECK_RUNNING ();
  384. if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
  385. {
  386. vty_out (vty, "Advertising Router is not parsable: %s%s",
  387. argv[0], VNL);
  388. return CMD_SUCCESS;
  389. }
  390. argc--;
  391. argv++;
  392. level = parse_show_level (argc, argv);
  393. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  394. {
  395. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  396. ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
  397. }
  398. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  399. {
  400. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  401. {
  402. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  403. oi->interface->name, oa->name, VNL, VNL);
  404. ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
  405. }
  406. }
  407. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  408. ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
  409. vty_out (vty, "%s", VNL);
  410. return CMD_SUCCESS;
  411. }
  412. ALIAS (show_ipv6_ospf6_database_router,
  413. show_ipv6_ospf6_database_router_detail_cmd,
  414. "show ipv6 ospf6 database * * A.B.C.D "
  415. "(detail|dump|internal)",
  416. SHOW_STR
  417. IPV6_STR
  418. OSPF6_STR
  419. "Display Link state database\n"
  420. "Any Link state Type\n"
  421. "Any Link state ID\n"
  422. "Specify Advertising Router as IPv4 address notation\n"
  423. "Display details of LSAs\n"
  424. "Dump LSAs\n"
  425. "Display LSA's internal information\n"
  426. )
  427. ALIAS (show_ipv6_ospf6_database_router,
  428. show_ipv6_ospf6_database_adv_router_cmd,
  429. "show ipv6 ospf6 database adv-router A.B.C.D",
  430. SHOW_STR
  431. IPV6_STR
  432. OSPF6_STR
  433. "Display Link state database\n"
  434. "Search by Advertising Router\n"
  435. "Specify Advertising Router as IPv4 address notation\n"
  436. )
  437. ALIAS (show_ipv6_ospf6_database_router,
  438. show_ipv6_ospf6_database_adv_router_detail_cmd,
  439. "show ipv6 ospf6 database adv-router A.B.C.D "
  440. "(detail|dump|internal)",
  441. SHOW_STR
  442. IPV6_STR
  443. OSPF6_STR
  444. "Display Link state database\n"
  445. "Search by Advertising Router\n"
  446. "Specify Advertising Router as IPv4 address notation\n"
  447. "Display details of LSAs\n"
  448. "Dump LSAs\n"
  449. "Display LSA's internal information\n"
  450. )
  451. DEFUN (show_ipv6_ospf6_database_type_id,
  452. show_ipv6_ospf6_database_type_id_cmd,
  453. "show ipv6 ospf6 database "
  454. "(router|network|inter-prefix|inter-router|as-external|"
  455. "group-membership|type-7|link|intra-prefix) A.B.C.D",
  456. SHOW_STR
  457. IPV6_STR
  458. OSPF6_STR
  459. "Display Link state database\n"
  460. "Display Router LSAs\n"
  461. "Display Network LSAs\n"
  462. "Display Inter-Area-Prefix LSAs\n"
  463. "Display Inter-Area-Router LSAs\n"
  464. "Display As-External LSAs\n"
  465. "Display Group-Membership LSAs\n"
  466. "Display Type-7 LSAs\n"
  467. "Display Link LSAs\n"
  468. "Display Intra-Area-Prefix LSAs\n"
  469. "Specify Link state ID as IPv4 address notation\n"
  470. )
  471. {
  472. int level;
  473. struct listnode *i, *j;
  474. struct ospf6 *o = ospf6;
  475. struct ospf6_area *oa;
  476. struct ospf6_interface *oi;
  477. u_int16_t type = 0;
  478. u_int32_t id = 0;
  479. OSPF6_CMD_CHECK_RUNNING ();
  480. type = parse_type_spec (argc, argv);
  481. argc--;
  482. argv++;
  483. if ((inet_pton (AF_INET, argv[0], &id)) != 1)
  484. {
  485. vty_out (vty, "Link state ID is not parsable: %s%s",
  486. argv[0], VNL);
  487. return CMD_SUCCESS;
  488. }
  489. argc--;
  490. argv++;
  491. level = parse_show_level (argc, argv);
  492. switch (OSPF6_LSA_SCOPE (type))
  493. {
  494. case OSPF6_SCOPE_AREA:
  495. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  496. {
  497. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  498. ospf6_lsdb_show (vty, level, &type, &id, NULL, oa->lsdb);
  499. }
  500. break;
  501. case OSPF6_SCOPE_LINKLOCAL:
  502. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  503. {
  504. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  505. {
  506. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  507. oi->interface->name, oa->name, VNL, VNL);
  508. ospf6_lsdb_show (vty, level, &type, &id, NULL, oi->lsdb);
  509. }
  510. }
  511. break;
  512. case OSPF6_SCOPE_AS:
  513. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  514. ospf6_lsdb_show (vty, level, &type, &id, NULL, o->lsdb);
  515. break;
  516. default:
  517. assert (0);
  518. break;
  519. }
  520. vty_out (vty, "%s", VNL);
  521. return CMD_SUCCESS;
  522. }
  523. ALIAS (show_ipv6_ospf6_database_type_id,
  524. show_ipv6_ospf6_database_type_id_detail_cmd,
  525. "show ipv6 ospf6 database "
  526. "(router|network|inter-prefix|inter-router|as-external|"
  527. "group-membership|type-7|link|intra-prefix) A.B.C.D "
  528. "(detail|dump|internal)",
  529. SHOW_STR
  530. IPV6_STR
  531. OSPF6_STR
  532. "Display Link state database\n"
  533. "Display Router LSAs\n"
  534. "Display Network LSAs\n"
  535. "Display Inter-Area-Prefix LSAs\n"
  536. "Display Inter-Area-Router LSAs\n"
  537. "Display As-External LSAs\n"
  538. "Display Group-Membership LSAs\n"
  539. "Display Type-7 LSAs\n"
  540. "Display Link LSAs\n"
  541. "Display Intra-Area-Prefix LSAs\n"
  542. "Specify Link state ID as IPv4 address notation\n"
  543. "Display details of LSAs\n"
  544. "Dump LSAs\n"
  545. "Display LSA's internal information\n"
  546. )
  547. ALIAS (show_ipv6_ospf6_database_type_id,
  548. show_ipv6_ospf6_database_type_linkstate_id_cmd,
  549. "show ipv6 ospf6 database "
  550. "(router|network|inter-prefix|inter-router|as-external|"
  551. "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D",
  552. SHOW_STR
  553. IPV6_STR
  554. OSPF6_STR
  555. "Display Link state database\n"
  556. "Display Router LSAs\n"
  557. "Display Network LSAs\n"
  558. "Display Inter-Area-Prefix LSAs\n"
  559. "Display Inter-Area-Router LSAs\n"
  560. "Display As-External LSAs\n"
  561. "Display Group-Membership LSAs\n"
  562. "Display Type-7 LSAs\n"
  563. "Display Link LSAs\n"
  564. "Display Intra-Area-Prefix LSAs\n"
  565. "Search by Link state ID\n"
  566. "Specify Link state ID as IPv4 address notation\n"
  567. )
  568. ALIAS (show_ipv6_ospf6_database_type_id,
  569. show_ipv6_ospf6_database_type_linkstate_id_detail_cmd,
  570. "show ipv6 ospf6 database "
  571. "(router|network|inter-prefix|inter-router|as-external|"
  572. "group-membership|type-7|link|intra-prefix) linkstate-id A.B.C.D "
  573. "(detail|dump|internal)",
  574. SHOW_STR
  575. IPV6_STR
  576. OSPF6_STR
  577. "Display Link state database\n"
  578. "Display Router LSAs\n"
  579. "Display Network LSAs\n"
  580. "Display Inter-Area-Prefix LSAs\n"
  581. "Display Inter-Area-Router LSAs\n"
  582. "Display As-External LSAs\n"
  583. "Display Group-Membership LSAs\n"
  584. "Display Type-7 LSAs\n"
  585. "Display Link LSAs\n"
  586. "Display Intra-Area-Prefix LSAs\n"
  587. "Search by Link state ID\n"
  588. "Specify Link state ID as IPv4 address notation\n"
  589. "Display details of LSAs\n"
  590. "Dump LSAs\n"
  591. "Display LSA's internal information\n"
  592. )
  593. DEFUN (show_ipv6_ospf6_database_type_router,
  594. show_ipv6_ospf6_database_type_router_cmd,
  595. "show ipv6 ospf6 database "
  596. "(router|network|inter-prefix|inter-router|as-external|"
  597. "group-membership|type-7|link|intra-prefix) * A.B.C.D",
  598. SHOW_STR
  599. IPV6_STR
  600. OSPF6_STR
  601. "Display Link state database\n"
  602. "Display Router LSAs\n"
  603. "Display Network LSAs\n"
  604. "Display Inter-Area-Prefix LSAs\n"
  605. "Display Inter-Area-Router LSAs\n"
  606. "Display As-External LSAs\n"
  607. "Display Group-Membership LSAs\n"
  608. "Display Type-7 LSAs\n"
  609. "Display Link LSAs\n"
  610. "Display Intra-Area-Prefix LSAs\n"
  611. "Any Link state ID\n"
  612. "Specify Advertising Router as IPv4 address notation\n"
  613. )
  614. {
  615. int level;
  616. struct listnode *i, *j;
  617. struct ospf6 *o = ospf6;
  618. struct ospf6_area *oa;
  619. struct ospf6_interface *oi;
  620. u_int16_t type = 0;
  621. u_int32_t adv_router = 0;
  622. OSPF6_CMD_CHECK_RUNNING ();
  623. type = parse_type_spec (argc, argv);
  624. argc--;
  625. argv++;
  626. if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
  627. {
  628. vty_out (vty, "Advertising Router is not parsable: %s%s",
  629. argv[0], VNL);
  630. return CMD_SUCCESS;
  631. }
  632. argc--;
  633. argv++;
  634. level = parse_show_level (argc, argv);
  635. switch (OSPF6_LSA_SCOPE (type))
  636. {
  637. case OSPF6_SCOPE_AREA:
  638. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  639. {
  640. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  641. ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
  642. }
  643. break;
  644. case OSPF6_SCOPE_LINKLOCAL:
  645. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  646. {
  647. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  648. {
  649. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  650. oi->interface->name, oa->name, VNL, VNL);
  651. ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
  652. }
  653. }
  654. break;
  655. case OSPF6_SCOPE_AS:
  656. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  657. ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
  658. break;
  659. default:
  660. assert (0);
  661. break;
  662. }
  663. vty_out (vty, "%s", VNL);
  664. return CMD_SUCCESS;
  665. }
  666. ALIAS (show_ipv6_ospf6_database_type_router,
  667. show_ipv6_ospf6_database_type_router_detail_cmd,
  668. "show ipv6 ospf6 database "
  669. "(router|network|inter-prefix|inter-router|as-external|"
  670. "group-membership|type-7|link|intra-prefix) * A.B.C.D "
  671. "(detail|dump|internal)",
  672. SHOW_STR
  673. IPV6_STR
  674. OSPF6_STR
  675. "Display Link state database\n"
  676. "Display Router LSAs\n"
  677. "Display Network LSAs\n"
  678. "Display Inter-Area-Prefix LSAs\n"
  679. "Display Inter-Area-Router LSAs\n"
  680. "Display As-External LSAs\n"
  681. "Display Group-Membership LSAs\n"
  682. "Display Type-7 LSAs\n"
  683. "Display Link LSAs\n"
  684. "Display Intra-Area-Prefix LSAs\n"
  685. "Any Link state ID\n"
  686. "Specify Advertising Router as IPv4 address notation\n"
  687. "Display details of LSAs\n"
  688. "Dump LSAs\n"
  689. "Display LSA's internal information\n"
  690. )
  691. ALIAS (show_ipv6_ospf6_database_type_router,
  692. show_ipv6_ospf6_database_type_adv_router_cmd,
  693. "show ipv6 ospf6 database "
  694. "(router|network|inter-prefix|inter-router|as-external|"
  695. "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D",
  696. SHOW_STR
  697. IPV6_STR
  698. OSPF6_STR
  699. "Display Link state database\n"
  700. "Display Router LSAs\n"
  701. "Display Network LSAs\n"
  702. "Display Inter-Area-Prefix LSAs\n"
  703. "Display Inter-Area-Router LSAs\n"
  704. "Display As-External LSAs\n"
  705. "Display Group-Membership LSAs\n"
  706. "Display Type-7 LSAs\n"
  707. "Display Link LSAs\n"
  708. "Display Intra-Area-Prefix LSAs\n"
  709. "Search by Advertising Router\n"
  710. "Specify Advertising Router as IPv4 address notation\n"
  711. )
  712. ALIAS (show_ipv6_ospf6_database_type_router,
  713. show_ipv6_ospf6_database_type_adv_router_detail_cmd,
  714. "show ipv6 ospf6 database "
  715. "(router|network|inter-prefix|inter-router|as-external|"
  716. "group-membership|type-7|link|intra-prefix) adv-router A.B.C.D "
  717. "(detail|dump|internal)",
  718. SHOW_STR
  719. IPV6_STR
  720. OSPF6_STR
  721. "Display Link state database\n"
  722. "Display Router LSAs\n"
  723. "Display Network LSAs\n"
  724. "Display Inter-Area-Prefix LSAs\n"
  725. "Display Inter-Area-Router LSAs\n"
  726. "Display As-External LSAs\n"
  727. "Display Group-Membership LSAs\n"
  728. "Display Type-7 LSAs\n"
  729. "Display Link LSAs\n"
  730. "Display Intra-Area-Prefix LSAs\n"
  731. "Search by Advertising Router\n"
  732. "Specify Advertising Router as IPv4 address notation\n"
  733. "Display details of LSAs\n"
  734. "Dump LSAs\n"
  735. "Display LSA's internal information\n"
  736. )
  737. DEFUN (show_ipv6_ospf6_database_id_router,
  738. show_ipv6_ospf6_database_id_router_cmd,
  739. "show ipv6 ospf6 database * A.B.C.D A.B.C.D",
  740. SHOW_STR
  741. IPV6_STR
  742. OSPF6_STR
  743. "Display Link state database\n"
  744. "Any Link state Type\n"
  745. "Specify Link state ID as IPv4 address notation\n"
  746. "Specify Advertising Router as IPv4 address notation\n"
  747. )
  748. {
  749. int level;
  750. struct listnode *i, *j;
  751. struct ospf6 *o = ospf6;
  752. struct ospf6_area *oa;
  753. struct ospf6_interface *oi;
  754. u_int32_t id = 0;
  755. u_int32_t adv_router = 0;
  756. OSPF6_CMD_CHECK_RUNNING ();
  757. if ((inet_pton (AF_INET, argv[0], &id)) != 1)
  758. {
  759. vty_out (vty, "Link state ID is not parsable: %s%s",
  760. argv[0], VNL);
  761. return CMD_SUCCESS;
  762. }
  763. argc--;
  764. argv++;
  765. if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
  766. {
  767. vty_out (vty, "Advertising Router is not parsable: %s%s",
  768. argv[0], VNL);
  769. return CMD_SUCCESS;
  770. }
  771. argc--;
  772. argv++;
  773. level = parse_show_level (argc, argv);
  774. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  775. {
  776. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  777. ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
  778. }
  779. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  780. {
  781. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  782. {
  783. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  784. oi->interface->name, oa->name, VNL, VNL);
  785. ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
  786. }
  787. }
  788. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  789. ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
  790. vty_out (vty, "%s", VNL);
  791. return CMD_SUCCESS;
  792. }
  793. ALIAS (show_ipv6_ospf6_database_id_router,
  794. show_ipv6_ospf6_database_id_router_detail_cmd,
  795. "show ipv6 ospf6 database * A.B.C.D A.B.C.D "
  796. "(detail|dump|internal)",
  797. SHOW_STR
  798. IPV6_STR
  799. OSPF6_STR
  800. "Display Link state database\n"
  801. "Any Link state Type\n"
  802. "Specify Link state ID as IPv4 address notation\n"
  803. "Specify Advertising Router as IPv4 address notation\n"
  804. "Display details of LSAs\n"
  805. "Dump LSAs\n"
  806. "Display LSA's internal information\n"
  807. )
  808. DEFUN (show_ipv6_ospf6_database_adv_router_linkstate_id,
  809. show_ipv6_ospf6_database_adv_router_linkstate_id_cmd,
  810. "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D",
  811. SHOW_STR
  812. IPV6_STR
  813. OSPF6_STR
  814. "Display Link state database\n"
  815. "Search by Advertising Router\n"
  816. "Specify Advertising Router as IPv4 address notation\n"
  817. "Search by Link state ID\n"
  818. "Specify Link state ID as IPv4 address notation\n"
  819. )
  820. {
  821. int level;
  822. struct listnode *i, *j;
  823. struct ospf6 *o = ospf6;
  824. struct ospf6_area *oa;
  825. struct ospf6_interface *oi;
  826. u_int32_t id = 0;
  827. u_int32_t adv_router = 0;
  828. OSPF6_CMD_CHECK_RUNNING ();
  829. if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
  830. {
  831. vty_out (vty, "Advertising Router is not parsable: %s%s",
  832. argv[0], VNL);
  833. return CMD_SUCCESS;
  834. }
  835. argc--;
  836. argv++;
  837. if ((inet_pton (AF_INET, argv[0], &id)) != 1)
  838. {
  839. vty_out (vty, "Link state ID is not parsable: %s%s",
  840. argv[0], VNL);
  841. return CMD_SUCCESS;
  842. }
  843. argc--;
  844. argv++;
  845. level = parse_show_level (argc, argv);
  846. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  847. {
  848. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  849. ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oa->lsdb);
  850. }
  851. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  852. {
  853. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  854. {
  855. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  856. oi->interface->name, oa->name, VNL, VNL);
  857. ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, oi->lsdb);
  858. }
  859. }
  860. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  861. ospf6_lsdb_show (vty, level, NULL, &id, &adv_router, o->lsdb);
  862. vty_out (vty, "%s", VNL);
  863. return CMD_SUCCESS;
  864. }
  865. ALIAS (show_ipv6_ospf6_database_adv_router_linkstate_id,
  866. show_ipv6_ospf6_database_adv_router_linkstate_id_detail_cmd,
  867. "show ipv6 ospf6 database adv-router A.B.C.D linkstate-id A.B.C.D "
  868. "(detail|dump|internal)",
  869. SHOW_STR
  870. IPV6_STR
  871. OSPF6_STR
  872. "Display Link state database\n"
  873. "Search by Advertising Router\n"
  874. "Specify Advertising Router as IPv4 address notation\n"
  875. "Search by Link state ID\n"
  876. "Specify Link state ID as IPv4 address notation\n"
  877. "Display details of LSAs\n"
  878. "Dump LSAs\n"
  879. "Display LSA's internal information\n"
  880. )
  881. DEFUN (show_ipv6_ospf6_database_type_id_router,
  882. show_ipv6_ospf6_database_type_id_router_cmd,
  883. "show ipv6 ospf6 database "
  884. "(router|network|inter-prefix|inter-router|as-external|"
  885. "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D",
  886. SHOW_STR
  887. IPV6_STR
  888. OSPF6_STR
  889. "Display Link state database\n"
  890. "Display Router LSAs\n"
  891. "Display Network LSAs\n"
  892. "Display Inter-Area-Prefix LSAs\n"
  893. "Display Inter-Area-Router LSAs\n"
  894. "Display As-External LSAs\n"
  895. "Display Group-Membership LSAs\n"
  896. "Display Type-7 LSAs\n"
  897. "Display Link LSAs\n"
  898. "Display Intra-Area-Prefix LSAs\n"
  899. "Specify Link state ID as IPv4 address notation\n"
  900. "Specify Advertising Router as IPv4 address notation\n"
  901. )
  902. {
  903. int level;
  904. struct listnode *i, *j;
  905. struct ospf6 *o = ospf6;
  906. struct ospf6_area *oa;
  907. struct ospf6_interface *oi;
  908. u_int16_t type = 0;
  909. u_int32_t id = 0;
  910. u_int32_t adv_router = 0;
  911. OSPF6_CMD_CHECK_RUNNING ();
  912. type = parse_type_spec (argc, argv);
  913. argc--;
  914. argv++;
  915. if ((inet_pton (AF_INET, argv[0], &id)) != 1)
  916. {
  917. vty_out (vty, "Link state ID is not parsable: %s%s",
  918. argv[0], VNL);
  919. return CMD_SUCCESS;
  920. }
  921. argc--;
  922. argv++;
  923. if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
  924. {
  925. vty_out (vty, "Advertising Router is not parsable: %s%s",
  926. argv[0], VNL);
  927. return CMD_SUCCESS;
  928. }
  929. argc--;
  930. argv++;
  931. level = parse_show_level (argc, argv);
  932. switch (OSPF6_LSA_SCOPE (type))
  933. {
  934. case OSPF6_SCOPE_AREA:
  935. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  936. {
  937. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  938. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
  939. }
  940. break;
  941. case OSPF6_SCOPE_LINKLOCAL:
  942. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  943. {
  944. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  945. {
  946. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  947. oi->interface->name, oa->name, VNL, VNL);
  948. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
  949. }
  950. }
  951. break;
  952. case OSPF6_SCOPE_AS:
  953. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  954. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
  955. break;
  956. default:
  957. assert (0);
  958. break;
  959. }
  960. vty_out (vty, "%s", VNL);
  961. return CMD_SUCCESS;
  962. }
  963. ALIAS (show_ipv6_ospf6_database_type_id_router,
  964. show_ipv6_ospf6_database_type_id_router_detail_cmd,
  965. "show ipv6 ospf6 database "
  966. "(router|network|inter-prefix|inter-router|as-external|"
  967. "group-membership|type-7|link|intra-prefix) A.B.C.D A.B.C.D "
  968. "(dump|internal)",
  969. SHOW_STR
  970. IPV6_STR
  971. OSPF6_STR
  972. "Display Link state database\n"
  973. "Display Router LSAs\n"
  974. "Display Network LSAs\n"
  975. "Display Inter-Area-Prefix LSAs\n"
  976. "Display Inter-Area-Router LSAs\n"
  977. "Display As-External LSAs\n"
  978. "Display Group-Membership LSAs\n"
  979. "Display Type-7 LSAs\n"
  980. "Display Link LSAs\n"
  981. "Display Intra-Area-Prefix LSAs\n"
  982. "Specify Link state ID as IPv4 address notation\n"
  983. "Specify Advertising Router as IPv4 address notation\n"
  984. "Dump LSAs\n"
  985. "Display LSA's internal information\n"
  986. )
  987. DEFUN (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
  988. show_ipv6_ospf6_database_type_adv_router_linkstate_id_cmd,
  989. "show ipv6 ospf6 database "
  990. "(router|network|inter-prefix|inter-router|as-external|"
  991. "group-membership|type-7|link|intra-prefix) "
  992. "adv-router A.B.C.D linkstate-id A.B.C.D",
  993. SHOW_STR
  994. IPV6_STR
  995. OSPF6_STR
  996. "Display Link state database\n"
  997. "Display Router LSAs\n"
  998. "Display Network LSAs\n"
  999. "Display Inter-Area-Prefix LSAs\n"
  1000. "Display Inter-Area-Router LSAs\n"
  1001. "Display As-External LSAs\n"
  1002. "Display Group-Membership LSAs\n"
  1003. "Display Type-7 LSAs\n"
  1004. "Display Link LSAs\n"
  1005. "Display Intra-Area-Prefix LSAs\n"
  1006. "Search by Advertising Router\n"
  1007. "Specify Advertising Router as IPv4 address notation\n"
  1008. "Search by Link state ID\n"
  1009. "Specify Link state ID as IPv4 address notation\n"
  1010. )
  1011. {
  1012. int level;
  1013. struct listnode *i, *j;
  1014. struct ospf6 *o = ospf6;
  1015. struct ospf6_area *oa;
  1016. struct ospf6_interface *oi;
  1017. u_int16_t type = 0;
  1018. u_int32_t id = 0;
  1019. u_int32_t adv_router = 0;
  1020. OSPF6_CMD_CHECK_RUNNING ();
  1021. type = parse_type_spec (argc, argv);
  1022. argc--;
  1023. argv++;
  1024. if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
  1025. {
  1026. vty_out (vty, "Advertising Router is not parsable: %s%s",
  1027. argv[0], VNL);
  1028. return CMD_SUCCESS;
  1029. }
  1030. argc--;
  1031. argv++;
  1032. if ((inet_pton (AF_INET, argv[0], &id)) != 1)
  1033. {
  1034. vty_out (vty, "Link state ID is not parsable: %s%s",
  1035. argv[0], VNL);
  1036. return CMD_SUCCESS;
  1037. }
  1038. argc--;
  1039. argv++;
  1040. level = parse_show_level (argc, argv);
  1041. switch (OSPF6_LSA_SCOPE (type))
  1042. {
  1043. case OSPF6_SCOPE_AREA:
  1044. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1045. {
  1046. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  1047. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
  1048. }
  1049. break;
  1050. case OSPF6_SCOPE_LINKLOCAL:
  1051. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1052. {
  1053. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  1054. {
  1055. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  1056. oi->interface->name, oa->name, VNL, VNL);
  1057. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
  1058. }
  1059. }
  1060. break;
  1061. case OSPF6_SCOPE_AS:
  1062. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  1063. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
  1064. break;
  1065. default:
  1066. assert (0);
  1067. break;
  1068. }
  1069. vty_out (vty, "%s", VNL);
  1070. return CMD_SUCCESS;
  1071. }
  1072. ALIAS (show_ipv6_ospf6_database_type_adv_router_linkstate_id,
  1073. show_ipv6_ospf6_database_type_adv_router_linkstate_id_detail_cmd,
  1074. "show ipv6 ospf6 database "
  1075. "(router|network|inter-prefix|inter-router|as-external|"
  1076. "group-membership|type-7|link|intra-prefix) "
  1077. "adv-router A.B.C.D linkstate-id A.B.C.D "
  1078. "(dump|internal)",
  1079. SHOW_STR
  1080. IPV6_STR
  1081. OSPF6_STR
  1082. "Display Link state database\n"
  1083. "Display Router LSAs\n"
  1084. "Display Network LSAs\n"
  1085. "Display Inter-Area-Prefix LSAs\n"
  1086. "Display Inter-Area-Router LSAs\n"
  1087. "Display As-External LSAs\n"
  1088. "Display Group-Membership LSAs\n"
  1089. "Display Type-7 LSAs\n"
  1090. "Display Link LSAs\n"
  1091. "Display Intra-Area-Prefix LSAs\n"
  1092. "Search by Advertising Router\n"
  1093. "Specify Advertising Router as IPv4 address notation\n"
  1094. "Search by Link state ID\n"
  1095. "Specify Link state ID as IPv4 address notation\n"
  1096. "Dump LSAs\n"
  1097. "Display LSA's internal information\n"
  1098. )
  1099. DEFUN (show_ipv6_ospf6_database_self_originated,
  1100. show_ipv6_ospf6_database_self_originated_cmd,
  1101. "show ipv6 ospf6 database self-originated",
  1102. SHOW_STR
  1103. IPV6_STR
  1104. OSPF6_STR
  1105. "Display Self-originated LSAs\n"
  1106. )
  1107. {
  1108. int level;
  1109. struct listnode *i, *j;
  1110. struct ospf6 *o = ospf6;
  1111. struct ospf6_area *oa;
  1112. struct ospf6_interface *oi;
  1113. u_int32_t adv_router = 0;
  1114. OSPF6_CMD_CHECK_RUNNING ();
  1115. level = parse_show_level (argc, argv);
  1116. adv_router = o->router_id;
  1117. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1118. {
  1119. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  1120. ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oa->lsdb);
  1121. }
  1122. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1123. {
  1124. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  1125. {
  1126. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  1127. oi->interface->name, oa->name, VNL, VNL);
  1128. ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, oi->lsdb);
  1129. }
  1130. }
  1131. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  1132. ospf6_lsdb_show (vty, level, NULL, NULL, &adv_router, o->lsdb);
  1133. vty_out (vty, "%s", VNL);
  1134. return CMD_SUCCESS;
  1135. }
  1136. ALIAS (show_ipv6_ospf6_database_self_originated,
  1137. show_ipv6_ospf6_database_self_originated_detail_cmd,
  1138. "show ipv6 ospf6 database self-originated "
  1139. "(detail|dump|internal)",
  1140. SHOW_STR
  1141. IPV6_STR
  1142. OSPF6_STR
  1143. "Display Self-originated LSAs\n"
  1144. "Display details of LSAs\n"
  1145. "Dump LSAs\n"
  1146. "Display LSA's internal information\n"
  1147. )
  1148. DEFUN (show_ipv6_ospf6_database_type_self_originated,
  1149. show_ipv6_ospf6_database_type_self_originated_cmd,
  1150. "show ipv6 ospf6 database "
  1151. "(router|network|inter-prefix|inter-router|as-external|"
  1152. "group-membership|type-7|link|intra-prefix) self-originated",
  1153. SHOW_STR
  1154. IPV6_STR
  1155. OSPF6_STR
  1156. "Display Link state database\n"
  1157. "Display Router LSAs\n"
  1158. "Display Network LSAs\n"
  1159. "Display Inter-Area-Prefix LSAs\n"
  1160. "Display Inter-Area-Router LSAs\n"
  1161. "Display As-External LSAs\n"
  1162. "Display Group-Membership LSAs\n"
  1163. "Display Type-7 LSAs\n"
  1164. "Display Link LSAs\n"
  1165. "Display Intra-Area-Prefix LSAs\n"
  1166. "Display Self-originated LSAs\n"
  1167. )
  1168. {
  1169. int level;
  1170. struct listnode *i, *j;
  1171. struct ospf6 *o = ospf6;
  1172. struct ospf6_area *oa;
  1173. struct ospf6_interface *oi;
  1174. u_int16_t type = 0;
  1175. u_int32_t adv_router = 0;
  1176. OSPF6_CMD_CHECK_RUNNING ();
  1177. type = parse_type_spec (argc, argv);
  1178. argc--;
  1179. argv++;
  1180. level = parse_show_level (argc, argv);
  1181. adv_router = o->router_id;
  1182. switch (OSPF6_LSA_SCOPE (type))
  1183. {
  1184. case OSPF6_SCOPE_AREA:
  1185. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1186. {
  1187. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  1188. ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oa->lsdb);
  1189. }
  1190. break;
  1191. case OSPF6_SCOPE_LINKLOCAL:
  1192. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1193. {
  1194. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  1195. {
  1196. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  1197. oi->interface->name, oa->name, VNL, VNL);
  1198. ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, oi->lsdb);
  1199. }
  1200. }
  1201. break;
  1202. case OSPF6_SCOPE_AS:
  1203. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  1204. ospf6_lsdb_show (vty, level, &type, NULL, &adv_router, o->lsdb);
  1205. break;
  1206. default:
  1207. assert (0);
  1208. break;
  1209. }
  1210. vty_out (vty, "%s", VNL);
  1211. return CMD_SUCCESS;
  1212. }
  1213. ALIAS (show_ipv6_ospf6_database_type_self_originated,
  1214. show_ipv6_ospf6_database_type_self_originated_detail_cmd,
  1215. "show ipv6 ospf6 database "
  1216. "(router|network|inter-prefix|inter-router|as-external|"
  1217. "group-membership|type-7|link|intra-prefix) self-originated "
  1218. "(detail|dump|internal)",
  1219. SHOW_STR
  1220. IPV6_STR
  1221. OSPF6_STR
  1222. "Display Link state database\n"
  1223. "Display Router LSAs\n"
  1224. "Display Network LSAs\n"
  1225. "Display Inter-Area-Prefix LSAs\n"
  1226. "Display Inter-Area-Router LSAs\n"
  1227. "Display As-External LSAs\n"
  1228. "Display Group-Membership LSAs\n"
  1229. "Display Type-7 LSAs\n"
  1230. "Display Link LSAs\n"
  1231. "Display Intra-Area-Prefix LSAs\n"
  1232. "Display Self-originated LSAs\n"
  1233. "Display details of LSAs\n"
  1234. "Dump LSAs\n"
  1235. "Display LSA's internal information\n"
  1236. )
  1237. DEFUN (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
  1238. show_ipv6_ospf6_database_type_self_originated_linkstate_id_cmd,
  1239. "show ipv6 ospf6 database "
  1240. "(router|network|inter-prefix|inter-router|as-external|"
  1241. "group-membership|type-7|link|intra-prefix) self-originated "
  1242. "linkstate-id A.B.C.D",
  1243. SHOW_STR
  1244. IPV6_STR
  1245. OSPF6_STR
  1246. "Display Link state database\n"
  1247. "Display Router LSAs\n"
  1248. "Display Network LSAs\n"
  1249. "Display Inter-Area-Prefix LSAs\n"
  1250. "Display Inter-Area-Router LSAs\n"
  1251. "Display As-External LSAs\n"
  1252. "Display Group-Membership LSAs\n"
  1253. "Display Type-7 LSAs\n"
  1254. "Display Link LSAs\n"
  1255. "Display Intra-Area-Prefix LSAs\n"
  1256. "Display Self-originated LSAs\n"
  1257. "Search by Link state ID\n"
  1258. "Specify Link state ID as IPv4 address notation\n"
  1259. )
  1260. {
  1261. int level;
  1262. struct listnode *i, *j;
  1263. struct ospf6 *o = ospf6;
  1264. struct ospf6_area *oa;
  1265. struct ospf6_interface *oi;
  1266. u_int16_t type = 0;
  1267. u_int32_t adv_router = 0;
  1268. u_int32_t id = 0;
  1269. OSPF6_CMD_CHECK_RUNNING ();
  1270. type = parse_type_spec (argc, argv);
  1271. argc--;
  1272. argv++;
  1273. if ((inet_pton (AF_INET, argv[0], &id)) != 1)
  1274. {
  1275. vty_out (vty, "Link State ID is not parsable: %s%s",
  1276. argv[0], VNL);
  1277. return CMD_SUCCESS;
  1278. }
  1279. argc--;
  1280. argv++;
  1281. level = parse_show_level (argc, argv);
  1282. adv_router = o->router_id;
  1283. switch (OSPF6_LSA_SCOPE (type))
  1284. {
  1285. case OSPF6_SCOPE_AREA:
  1286. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1287. {
  1288. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  1289. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
  1290. }
  1291. break;
  1292. case OSPF6_SCOPE_LINKLOCAL:
  1293. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1294. {
  1295. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  1296. {
  1297. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  1298. oi->interface->name, oa->name, VNL, VNL);
  1299. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
  1300. }
  1301. }
  1302. break;
  1303. case OSPF6_SCOPE_AS:
  1304. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  1305. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
  1306. break;
  1307. default:
  1308. assert (0);
  1309. break;
  1310. }
  1311. vty_out (vty, "%s", VNL);
  1312. return CMD_SUCCESS;
  1313. }
  1314. ALIAS (show_ipv6_ospf6_database_type_self_originated_linkstate_id,
  1315. show_ipv6_ospf6_database_type_self_originated_linkstate_id_detail_cmd,
  1316. "show ipv6 ospf6 database "
  1317. "(router|network|inter-prefix|inter-router|as-external|"
  1318. "group-membership|type-7|link|intra-prefix) self-originated "
  1319. "linkstate-id A.B.C.D (detail|dump|internal)",
  1320. SHOW_STR
  1321. IPV6_STR
  1322. OSPF6_STR
  1323. "Display Link state database\n"
  1324. "Display Router LSAs\n"
  1325. "Display Network LSAs\n"
  1326. "Display Inter-Area-Prefix LSAs\n"
  1327. "Display Inter-Area-Router LSAs\n"
  1328. "Display As-External LSAs\n"
  1329. "Display Group-Membership LSAs\n"
  1330. "Display Type-7 LSAs\n"
  1331. "Display Link LSAs\n"
  1332. "Display Intra-Area-Prefix LSAs\n"
  1333. "Display Self-originated LSAs\n"
  1334. "Search by Link state ID\n"
  1335. "Specify Link state ID as IPv4 address notation\n"
  1336. "Display details of LSAs\n"
  1337. "Dump LSAs\n"
  1338. "Display LSA's internal information\n"
  1339. )
  1340. DEFUN (show_ipv6_ospf6_database_type_id_self_originated,
  1341. show_ipv6_ospf6_database_type_id_self_originated_cmd,
  1342. "show ipv6 ospf6 database "
  1343. "(router|network|inter-prefix|inter-router|as-external|"
  1344. "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated",
  1345. SHOW_STR
  1346. IPV6_STR
  1347. OSPF6_STR
  1348. "Display Link state database\n"
  1349. "Display Router LSAs\n"
  1350. "Display Network LSAs\n"
  1351. "Display Inter-Area-Prefix LSAs\n"
  1352. "Display Inter-Area-Router LSAs\n"
  1353. "Display As-External LSAs\n"
  1354. "Display Group-Membership LSAs\n"
  1355. "Display Type-7 LSAs\n"
  1356. "Display Link LSAs\n"
  1357. "Display Intra-Area-Prefix LSAs\n"
  1358. "Specify Link state ID as IPv4 address notation\n"
  1359. "Display Self-originated LSAs\n"
  1360. )
  1361. {
  1362. int level;
  1363. struct listnode *i, *j;
  1364. struct ospf6 *o = ospf6;
  1365. struct ospf6_area *oa;
  1366. struct ospf6_interface *oi;
  1367. u_int16_t type = 0;
  1368. u_int32_t adv_router = 0;
  1369. u_int32_t id = 0;
  1370. OSPF6_CMD_CHECK_RUNNING ();
  1371. type = parse_type_spec (argc, argv);
  1372. argc--;
  1373. argv++;
  1374. if ((inet_pton (AF_INET, argv[0], &id)) != 1)
  1375. {
  1376. vty_out (vty, "Link State ID is not parsable: %s%s",
  1377. argv[0], VNL);
  1378. return CMD_SUCCESS;
  1379. }
  1380. argc--;
  1381. argv++;
  1382. level = parse_show_level (argc, argv);
  1383. adv_router = o->router_id;
  1384. switch (OSPF6_LSA_SCOPE (type))
  1385. {
  1386. case OSPF6_SCOPE_AREA:
  1387. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1388. {
  1389. vty_out (vty, AREA_LSDB_TITLE_FORMAT, VNL, oa->name, VNL, VNL);
  1390. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oa->lsdb);
  1391. }
  1392. break;
  1393. case OSPF6_SCOPE_LINKLOCAL:
  1394. for (ALL_LIST_ELEMENTS_RO (o->area_list, i, oa))
  1395. {
  1396. for (ALL_LIST_ELEMENTS_RO (oa->if_list, j, oi))
  1397. {
  1398. vty_out (vty, IF_LSDB_TITLE_FORMAT, VNL,
  1399. oi->interface->name, oa->name, VNL, VNL);
  1400. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, oi->lsdb);
  1401. }
  1402. }
  1403. break;
  1404. case OSPF6_SCOPE_AS:
  1405. vty_out (vty, AS_LSDB_TITLE_FORMAT, VNL, VNL, VNL);
  1406. ospf6_lsdb_show (vty, level, &type, &id, &adv_router, o->lsdb);
  1407. break;
  1408. default:
  1409. assert (0);
  1410. break;
  1411. }
  1412. vty_out (vty, "%s", VNL);
  1413. return CMD_SUCCESS;
  1414. }
  1415. ALIAS (show_ipv6_ospf6_database_type_id_self_originated,
  1416. show_ipv6_ospf6_database_type_id_self_originated_detail_cmd,
  1417. "show ipv6 ospf6 database "
  1418. "(router|network|inter-prefix|inter-router|as-external|"
  1419. "group-membership|type-7|link|intra-prefix) A.B.C.D self-originated "
  1420. "(detail|dump|internal)",
  1421. SHOW_STR
  1422. IPV6_STR
  1423. OSPF6_STR
  1424. "Display Link state database\n"
  1425. "Display Router LSAs\n"
  1426. "Display Network LSAs\n"
  1427. "Display Inter-Area-Prefix LSAs\n"
  1428. "Display Inter-Area-Router LSAs\n"
  1429. "Display As-External LSAs\n"
  1430. "Display Group-Membership LSAs\n"
  1431. "Display Type-7 LSAs\n"
  1432. "Display Link LSAs\n"
  1433. "Display Intra-Area-Prefix LSAs\n"
  1434. "Display Self-originated LSAs\n"
  1435. "Search by Link state ID\n"
  1436. "Specify Link state ID as IPv4 address notation\n"
  1437. "Display details of LSAs\n"
  1438. "Dump LSAs\n"
  1439. "Display LSA's internal information\n"
  1440. )
  1441. DEFUN (show_ipv6_ospf6_border_routers,
  1442. show_ipv6_ospf6_border_routers_cmd,
  1443. "show ipv6 ospf6 border-routers",
  1444. SHOW_STR
  1445. IP6_STR
  1446. OSPF6_STR
  1447. "Display routing table for ABR and ASBR\n"
  1448. )
  1449. {
  1450. u_int32_t adv_router;
  1451. void (*showfunc) (struct vty *, struct ospf6_route *);
  1452. struct ospf6_route *ro;
  1453. struct prefix prefix;
  1454. OSPF6_CMD_CHECK_RUNNING ();
  1455. if (argc && ! strcmp ("detail", argv[0]))
  1456. {
  1457. showfunc = ospf6_route_show_detail;
  1458. argc--;
  1459. argv++;
  1460. }
  1461. else
  1462. showfunc = ospf6_brouter_show;
  1463. if (argc)
  1464. {
  1465. if ((inet_pton (AF_INET, argv[0], &adv_router)) != 1)
  1466. {
  1467. vty_out (vty, "Router ID is not parsable: %s%s", argv[0], VNL);
  1468. return CMD_SUCCESS;
  1469. }
  1470. ospf6_linkstate_prefix (adv_router, 0, &prefix);
  1471. ro = ospf6_route_lookup (&prefix, ospf6->brouter_table);
  1472. if (!ro)
  1473. {
  1474. vty_out (vty, "No Route found for Router ID: %s%s", argv[0], VNL);
  1475. return CMD_SUCCESS;
  1476. }
  1477. ospf6_route_show_detail (vty, ro);
  1478. return CMD_SUCCESS;
  1479. }
  1480. if (showfunc == ospf6_brouter_show)
  1481. ospf6_brouter_show_header (vty);
  1482. for (ro = ospf6_route_head (ospf6->brouter_table); ro;
  1483. ro = ospf6_route_next (ro))
  1484. (*showfunc) (vty, ro);
  1485. return CMD_SUCCESS;
  1486. }
  1487. ALIAS (show_ipv6_ospf6_border_routers,
  1488. show_ipv6_ospf6_border_routers_detail_cmd,
  1489. "show ipv6 ospf6 border-routers (A.B.C.D|detail)",
  1490. SHOW_STR
  1491. IP6_STR
  1492. OSPF6_STR
  1493. "Display routing table for ABR and ASBR\n"
  1494. "Specify Router-ID\n"
  1495. "Display Detail\n"
  1496. )
  1497. DEFUN (show_ipv6_ospf6_linkstate,
  1498. show_ipv6_ospf6_linkstate_cmd,
  1499. "show ipv6 ospf6 linkstate",
  1500. SHOW_STR
  1501. IP6_STR
  1502. OSPF6_STR
  1503. "Display linkstate routing table\n"
  1504. )
  1505. {
  1506. struct listnode *node;
  1507. struct ospf6_area *oa;
  1508. for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
  1509. {
  1510. vty_out (vty, "%s SPF Result in Area %s%s%s",
  1511. VNL, oa->name, VNL, VNL);
  1512. ospf6_linkstate_table_show (vty, argc, argv, oa->spf_table);
  1513. }
  1514. vty_out (vty, "%s", VNL);
  1515. return CMD_SUCCESS;
  1516. }
  1517. ALIAS (show_ipv6_ospf6_linkstate,
  1518. show_ipv6_ospf6_linkstate_router_cmd,
  1519. "show ipv6 ospf6 linkstate router A.B.C.D",
  1520. SHOW_STR
  1521. IP6_STR
  1522. OSPF6_STR
  1523. "Display linkstate routing table\n"
  1524. "Display Router Entry\n"
  1525. "Specify Router ID as IPv4 address notation\n"
  1526. )
  1527. ALIAS (show_ipv6_ospf6_linkstate,
  1528. show_ipv6_ospf6_linkstate_network_cmd,
  1529. "show ipv6 ospf6 linkstate network A.B.C.D A.B.C.D",
  1530. SHOW_STR
  1531. IP6_STR
  1532. OSPF6_STR
  1533. "Display linkstate routing table\n"
  1534. "Display Network Entry\n"
  1535. "Specify Router ID as IPv4 address notation\n"
  1536. "Specify Link state ID as IPv4 address notation\n"
  1537. )
  1538. DEFUN (show_ipv6_ospf6_linkstate_detail,
  1539. show_ipv6_ospf6_linkstate_detail_cmd,
  1540. "show ipv6 ospf6 linkstate detail",
  1541. SHOW_STR
  1542. IP6_STR
  1543. OSPF6_STR
  1544. "Display linkstate routing table\n"
  1545. )
  1546. {
  1547. const char *sargv[CMD_ARGC_MAX];
  1548. int i, sargc;
  1549. struct listnode *node;
  1550. struct ospf6_area *oa;
  1551. /* copy argv to sargv and then append "detail" */
  1552. for (i = 0; i < argc; i++)
  1553. sargv[i] = argv[i];
  1554. sargc = argc;
  1555. sargv[sargc++] = "detail";
  1556. sargv[sargc] = NULL;
  1557. for (ALL_LIST_ELEMENTS_RO (ospf6->area_list, node, oa))
  1558. {
  1559. vty_out (vty, "%s SPF Result in Area %s%s%s",
  1560. VNL, oa->name, VNL, VNL);
  1561. ospf6_linkstate_table_show (vty, sargc, sargv, oa->spf_table);
  1562. }
  1563. vty_out (vty, "%s", VNL);
  1564. return CMD_SUCCESS;
  1565. }
  1566. /* Install ospf related commands. */
  1567. void
  1568. ospf6_init (void)
  1569. {
  1570. ospf6_top_init ();
  1571. ospf6_area_init ();
  1572. ospf6_interface_init ();
  1573. ospf6_neighbor_init ();
  1574. ospf6_zebra_init ();
  1575. ospf6_lsa_init ();
  1576. ospf6_spf_init ();
  1577. ospf6_intra_init ();
  1578. ospf6_asbr_init ();
  1579. ospf6_abr_init ();
  1580. #ifdef HAVE_SNMP
  1581. ospf6_snmp_init (master);
  1582. #endif /*HAVE_SNMP*/
  1583. install_node (&debug_node, config_write_ospf6_debug);
  1584. install_element_ospf6_debug_message ();
  1585. install_element_ospf6_debug_lsa ();
  1586. install_element_ospf6_debug_interface ();
  1587. install_element_ospf6_debug_neighbor ();
  1588. install_element_ospf6_debug_zebra ();
  1589. install_element_ospf6_debug_spf ();
  1590. install_element_ospf6_debug_route ();
  1591. install_element_ospf6_debug_brouter ();
  1592. install_element_ospf6_debug_asbr ();
  1593. install_element_ospf6_debug_abr ();
  1594. install_element_ospf6_debug_flood ();
  1595. install_element (VIEW_NODE, &show_version_ospf6_cmd);
  1596. install_element (ENABLE_NODE, &show_version_ospf6_cmd);
  1597. install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_cmd);
  1598. install_element (VIEW_NODE, &show_ipv6_ospf6_border_routers_detail_cmd);
  1599. install_element (ENABLE_NODE, &show_ipv6_ospf6_border_routers_cmd);
  1600. install_element (ENABLE_NODE, &show_ipv6_ospf6_border_routers_detail_cmd);
  1601. install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_cmd);
  1602. install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_router_cmd);
  1603. install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_network_cmd);
  1604. install_element (VIEW_NODE, &show_ipv6_ospf6_linkstate_detail_cmd);
  1605. install_element (ENABLE_NODE, &show_ipv6_ospf6_linkstate_cmd);
  1606. install_element (ENABLE_NODE, &show_ipv6_ospf6_linkstate_router_cmd);
  1607. install_element (ENABLE_NODE, &show_ipv6_ospf6_linkstate_network_cmd);
  1608. install_element (ENABLE_NODE, &show_ipv6_ospf6_linkstate_detail_cmd);
  1609. #define INSTALL(n,c) \
  1610. install_element (n ## _NODE, &show_ipv6_ospf6_ ## c)
  1611. INSTALL (VIEW, database_cmd);
  1612. INSTALL (VIEW, database_detail_cmd);
  1613. INSTALL (VIEW, database_type_cmd);
  1614. INSTALL (VIEW, database_type_detail_cmd);
  1615. INSTALL (VIEW, database_id_cmd);
  1616. INSTALL (VIEW, database_id_detail_cmd);
  1617. INSTALL (VIEW, database_linkstate_id_cmd);
  1618. INSTALL (VIEW, database_linkstate_id_detail_cmd);
  1619. INSTALL (VIEW, database_router_cmd);
  1620. INSTALL (VIEW, database_router_detail_cmd);
  1621. INSTALL (VIEW, database_adv_router_cmd);
  1622. INSTALL (VIEW, database_adv_router_detail_cmd);
  1623. INSTALL (VIEW, database_type_id_cmd);
  1624. INSTALL (VIEW, database_type_id_detail_cmd);
  1625. INSTALL (VIEW, database_type_linkstate_id_cmd);
  1626. INSTALL (VIEW, database_type_linkstate_id_detail_cmd);
  1627. INSTALL (VIEW, database_type_router_cmd);
  1628. INSTALL (VIEW, database_type_router_detail_cmd);
  1629. INSTALL (VIEW, database_type_adv_router_cmd);
  1630. INSTALL (VIEW, database_type_adv_router_detail_cmd);
  1631. INSTALL (VIEW, database_adv_router_linkstate_id_cmd);
  1632. INSTALL (VIEW, database_adv_router_linkstate_id_detail_cmd);
  1633. INSTALL (VIEW, database_id_router_cmd);
  1634. INSTALL (VIEW, database_id_router_detail_cmd);
  1635. INSTALL (VIEW, database_type_id_router_cmd);
  1636. INSTALL (VIEW, database_type_id_router_detail_cmd);
  1637. INSTALL (VIEW, database_type_adv_router_linkstate_id_cmd);
  1638. INSTALL (VIEW, database_type_adv_router_linkstate_id_detail_cmd);
  1639. INSTALL (VIEW, database_self_originated_cmd);
  1640. INSTALL (VIEW, database_self_originated_detail_cmd);
  1641. INSTALL (VIEW, database_type_self_originated_cmd);
  1642. INSTALL (VIEW, database_type_self_originated_detail_cmd);
  1643. INSTALL (VIEW, database_type_id_self_originated_cmd);
  1644. INSTALL (VIEW, database_type_id_self_originated_detail_cmd);
  1645. INSTALL (VIEW, database_type_self_originated_linkstate_id_cmd);
  1646. INSTALL (VIEW, database_type_self_originated_linkstate_id_detail_cmd);
  1647. INSTALL (ENABLE, database_cmd);
  1648. INSTALL (ENABLE, database_detail_cmd);
  1649. INSTALL (ENABLE, database_type_cmd);
  1650. INSTALL (ENABLE, database_type_detail_cmd);
  1651. INSTALL (ENABLE, database_id_cmd);
  1652. INSTALL (ENABLE, database_id_detail_cmd);
  1653. INSTALL (ENABLE, database_linkstate_id_cmd);
  1654. INSTALL (ENABLE, database_linkstate_id_detail_cmd);
  1655. INSTALL (ENABLE, database_router_cmd);
  1656. INSTALL (ENABLE, database_router_detail_cmd);
  1657. INSTALL (ENABLE, database_adv_router_cmd);
  1658. INSTALL (ENABLE, database_adv_router_detail_cmd);
  1659. INSTALL (ENABLE, database_type_id_cmd);
  1660. INSTALL (ENABLE, database_type_id_detail_cmd);
  1661. INSTALL (ENABLE, database_type_linkstate_id_cmd);
  1662. INSTALL (ENABLE, database_type_linkstate_id_detail_cmd);
  1663. INSTALL (ENABLE, database_type_router_cmd);
  1664. INSTALL (ENABLE, database_type_router_detail_cmd);
  1665. INSTALL (ENABLE, database_type_adv_router_cmd);
  1666. INSTALL (ENABLE, database_type_adv_router_detail_cmd);
  1667. INSTALL (ENABLE, database_adv_router_linkstate_id_cmd);
  1668. INSTALL (ENABLE, database_adv_router_linkstate_id_detail_cmd);
  1669. INSTALL (ENABLE, database_id_router_cmd);
  1670. INSTALL (ENABLE, database_id_router_detail_cmd);
  1671. INSTALL (ENABLE, database_type_id_router_cmd);
  1672. INSTALL (ENABLE, database_type_id_router_detail_cmd);
  1673. INSTALL (ENABLE, database_type_adv_router_linkstate_id_cmd);
  1674. INSTALL (ENABLE, database_type_adv_router_linkstate_id_detail_cmd);
  1675. INSTALL (ENABLE, database_self_originated_cmd);
  1676. INSTALL (ENABLE, database_self_originated_detail_cmd);
  1677. INSTALL (ENABLE, database_type_self_originated_cmd);
  1678. INSTALL (ENABLE, database_type_self_originated_detail_cmd);
  1679. INSTALL (ENABLE, database_type_id_self_originated_cmd);
  1680. INSTALL (ENABLE, database_type_id_self_originated_detail_cmd);
  1681. INSTALL (ENABLE, database_type_self_originated_linkstate_id_cmd);
  1682. INSTALL (ENABLE, database_type_self_originated_linkstate_id_detail_cmd);
  1683. /* Make ospf protocol socket. */
  1684. ospf6_serv_sock ();
  1685. thread_add_read (master, ospf6_receive, NULL, ospf6_sock);
  1686. }