isis_vty.c 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152215321542155215621572158215921602161216221632164216521662167216821692170217121722173217421752176217721782179218021812182218321842185218621872188218921902191219221932194219521962197219821992200220122022203220422052206220722082209221022112212221322142215221622172218221922202221222222232224222522262227222822292230223122322233223422352236223722382239224022412242224322442245224622472248224922502251225222532254225522562257225822592260226122622263226422652266226722682269227022712272227322742275227622772278227922802281228222832284228522862287228822892290229122922293229422952296229722982299230023012302230323042305230623072308230923102311231223132314231523162317231823192320232123222323232423252326232723282329233023312332233323342335233623372338233923402341234223432344234523462347234823492350235123522353235423552356235723582359236023612362236323642365236623672368236923702371237223732374237523762377237823792380238123822383238423852386238723882389239023912392239323942395239623972398239924002401240224032404240524062407240824092410241124122413241424152416241724182419242024212422242324242425242624272428
  1. /*
  2. * IS-IS Rout(e)ing protocol - isis_circuit.h
  3. *
  4. * Copyright (C) 2001,2002 Sampo Saaristo
  5. * Tampere University of Technology
  6. * Institute of Communications Engineering
  7. * Copyright (C) 2016 David Lamparter, for NetDEF, Inc.
  8. *
  9. * This program is free software; you can redistribute it and/or modify it
  10. * under the terms of the GNU General Public Licenseas published by the Free
  11. * Software Foundation; either version 2 of the License, or (at your option)
  12. * any later version.
  13. *
  14. * This program is distributed in the hope that it will be useful,but WITHOUT
  15. * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  16. * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
  17. * more details.
  18. * You should have received a copy of the GNU General Public License along
  19. * with this program; if not, write to the Free Software Foundation, Inc.,
  20. * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  21. */
  22. #include <zebra.h>
  23. #include <command.h>
  24. #include "isis_circuit.h"
  25. #include "isis_csm.h"
  26. #include "isis_misc.h"
  27. #include "isisd.h"
  28. static struct isis_circuit *
  29. isis_circuit_lookup (struct vty *vty)
  30. {
  31. struct interface *ifp;
  32. struct isis_circuit *circuit;
  33. ifp = (struct interface *) vty->index;
  34. if (!ifp)
  35. {
  36. vty_out (vty, "Invalid interface %s", VTY_NEWLINE);
  37. return NULL;
  38. }
  39. circuit = circuit_scan_by_ifp (ifp);
  40. if (!circuit)
  41. {
  42. vty_out (vty, "ISIS is not enabled on circuit %s%s",
  43. ifp->name, VTY_NEWLINE);
  44. return NULL;
  45. }
  46. return circuit;
  47. }
  48. DEFUN (ip_router_isis,
  49. ip_router_isis_cmd,
  50. "(ip|ipv6) router isis WORD",
  51. "Interface Internet Protocol config commands\n"
  52. "IP router interface commands\n"
  53. "IS-IS Routing for IP\n"
  54. "Routing process tag\n")
  55. {
  56. struct interface *ifp;
  57. struct isis_circuit *circuit;
  58. struct isis_area *area;
  59. const char *af = argv[0];
  60. const char *area_tag = argv[1];
  61. ifp = (struct interface *) vty->index;
  62. assert (ifp);
  63. /* Prevent more than one area per circuit */
  64. circuit = circuit_scan_by_ifp (ifp);
  65. if (circuit && circuit->area)
  66. {
  67. if (strcmp (circuit->area->area_tag, area_tag))
  68. {
  69. vty_out (vty, "ISIS circuit is already defined on %s%s",
  70. circuit->area->area_tag, VTY_NEWLINE);
  71. return CMD_ERR_NOTHING_TODO;
  72. }
  73. }
  74. area = isis_area_lookup (area_tag);
  75. if (!area)
  76. area = isis_area_create (area_tag);
  77. if (!circuit || !circuit->area) {
  78. circuit = isis_circuit_create (area, ifp);
  79. if (circuit->state != C_STATE_CONF && circuit->state != C_STATE_UP)
  80. {
  81. vty_out(vty, "Couldn't bring up interface, please check log.%s", VTY_NEWLINE);
  82. return CMD_WARNING;
  83. }
  84. }
  85. bool ip = circuit->ip_router, ipv6 = circuit->ipv6_router;
  86. if (af[2] != '\0')
  87. ipv6 = true;
  88. else
  89. ip = true;
  90. isis_circuit_af_set (circuit, ip, ipv6);
  91. return CMD_SUCCESS;
  92. }
  93. DEFUN (no_ip_router_isis,
  94. no_ip_router_isis_cmd,
  95. "no (ip|ipv6) router isis WORD",
  96. NO_STR
  97. "Interface Internet Protocol config commands\n"
  98. "IP router interface commands\n"
  99. "IS-IS Routing for IP\n"
  100. "Routing process tag\n")
  101. {
  102. struct interface *ifp;
  103. struct isis_area *area;
  104. struct isis_circuit *circuit;
  105. const char *af = argv[0];
  106. const char *area_tag = argv[1];
  107. ifp = (struct interface *) vty->index;
  108. if (!ifp)
  109. {
  110. vty_out (vty, "Invalid interface %s", VTY_NEWLINE);
  111. return CMD_ERR_NO_MATCH;
  112. }
  113. area = isis_area_lookup (area_tag);
  114. if (!area)
  115. {
  116. vty_out (vty, "Can't find ISIS instance %s%s",
  117. argv[0], VTY_NEWLINE);
  118. return CMD_ERR_NO_MATCH;
  119. }
  120. circuit = circuit_lookup_by_ifp (ifp, area->circuit_list);
  121. if (!circuit)
  122. {
  123. vty_out (vty, "ISIS is not enabled on circuit %s%s",
  124. ifp->name, VTY_NEWLINE);
  125. return CMD_ERR_NO_MATCH;
  126. }
  127. bool ip = circuit->ip_router, ipv6 = circuit->ipv6_router;
  128. if (af[2] != '\0')
  129. ipv6 = false;
  130. else
  131. ip = false;
  132. isis_circuit_af_set (circuit, ip, ipv6);
  133. return CMD_SUCCESS;
  134. }
  135. DEFUN (isis_passive,
  136. isis_passive_cmd,
  137. "isis passive",
  138. "IS-IS commands\n"
  139. "Configure the passive mode for interface\n")
  140. {
  141. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  142. if (!circuit)
  143. return CMD_ERR_NO_MATCH;
  144. isis_circuit_passive_set (circuit, 1);
  145. return CMD_SUCCESS;
  146. }
  147. DEFUN (no_isis_passive,
  148. no_isis_passive_cmd,
  149. "no isis passive",
  150. NO_STR
  151. "IS-IS commands\n"
  152. "Configure the passive mode for interface\n")
  153. {
  154. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  155. if (!circuit)
  156. return CMD_ERR_NO_MATCH;
  157. if (if_is_loopback (circuit->interface))
  158. {
  159. vty_out (vty, "Can't set no passive for loopback interface%s",
  160. VTY_NEWLINE);
  161. return CMD_ERR_AMBIGUOUS;
  162. }
  163. isis_circuit_passive_set (circuit, 0);
  164. return CMD_SUCCESS;
  165. }
  166. DEFUN (isis_circuit_type,
  167. isis_circuit_type_cmd,
  168. "isis circuit-type (level-1|level-1-2|level-2-only)",
  169. "IS-IS commands\n"
  170. "Configure circuit type for interface\n"
  171. "Level-1 only adjacencies are formed\n"
  172. "Level-1-2 adjacencies are formed\n"
  173. "Level-2 only adjacencies are formed\n")
  174. {
  175. int is_type;
  176. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  177. if (!circuit)
  178. return CMD_ERR_NO_MATCH;
  179. is_type = string2circuit_t (argv[0]);
  180. if (!is_type)
  181. {
  182. vty_out (vty, "Unknown circuit-type %s", VTY_NEWLINE);
  183. return CMD_ERR_AMBIGUOUS;
  184. }
  185. if (circuit->state == C_STATE_UP &&
  186. circuit->area->is_type != IS_LEVEL_1_AND_2 &&
  187. circuit->area->is_type != is_type)
  188. {
  189. vty_out (vty, "Invalid circuit level for area %s.%s",
  190. circuit->area->area_tag, VTY_NEWLINE);
  191. return CMD_ERR_AMBIGUOUS;
  192. }
  193. isis_circuit_is_type_set (circuit, is_type);
  194. return CMD_SUCCESS;
  195. }
  196. DEFUN (no_isis_circuit_type,
  197. no_isis_circuit_type_cmd,
  198. "no isis circuit-type (level-1|level-1-2|level-2-only)",
  199. NO_STR
  200. "IS-IS commands\n"
  201. "Configure circuit type for interface\n"
  202. "Level-1 only adjacencies are formed\n"
  203. "Level-1-2 adjacencies are formed\n"
  204. "Level-2 only adjacencies are formed\n")
  205. {
  206. int is_type;
  207. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  208. if (!circuit)
  209. return CMD_ERR_NO_MATCH;
  210. /*
  211. * Set the circuits level to its default value
  212. */
  213. if (circuit->state == C_STATE_UP)
  214. is_type = circuit->area->is_type;
  215. else
  216. is_type = IS_LEVEL_1_AND_2;
  217. isis_circuit_is_type_set (circuit, is_type);
  218. return CMD_SUCCESS;
  219. }
  220. DEFUN (isis_network,
  221. isis_network_cmd,
  222. "isis network point-to-point",
  223. "IS-IS commands\n"
  224. "Set network type\n"
  225. "point-to-point network type\n")
  226. {
  227. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  228. if (!circuit)
  229. return CMD_ERR_NO_MATCH;
  230. if (isis_circuit_circ_type_set(circuit, CIRCUIT_T_P2P))
  231. {
  232. vty_out (vty, "isis network point-to-point "
  233. "is valid only on broadcast interfaces%s",
  234. VTY_NEWLINE);
  235. return CMD_ERR_AMBIGUOUS;
  236. }
  237. return CMD_SUCCESS;
  238. }
  239. DEFUN (no_isis_network,
  240. no_isis_network_cmd,
  241. "no isis network point-to-point",
  242. NO_STR
  243. "IS-IS commands\n"
  244. "Set network type for circuit\n"
  245. "point-to-point network type\n")
  246. {
  247. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  248. if (!circuit)
  249. return CMD_ERR_NO_MATCH;
  250. if (isis_circuit_circ_type_set(circuit, CIRCUIT_T_BROADCAST))
  251. {
  252. vty_out (vty, "isis network point-to-point "
  253. "is valid only on broadcast interfaces%s",
  254. VTY_NEWLINE);
  255. return CMD_ERR_AMBIGUOUS;
  256. }
  257. return CMD_SUCCESS;
  258. }
  259. DEFUN (isis_passwd,
  260. isis_passwd_cmd,
  261. "isis password (md5|clear) WORD",
  262. "IS-IS commands\n"
  263. "Configure the authentication password for a circuit\n"
  264. "HMAC-MD5 authentication\n"
  265. "Cleartext password\n"
  266. "Circuit password\n")
  267. {
  268. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  269. int rv;
  270. if (!circuit)
  271. return CMD_ERR_NO_MATCH;
  272. if (argv[0][0] == 'm')
  273. rv = isis_circuit_passwd_hmac_md5_set(circuit, argv[1]);
  274. else
  275. rv = isis_circuit_passwd_cleartext_set(circuit, argv[1]);
  276. if (rv)
  277. {
  278. vty_out (vty, "Too long circuit password (>254)%s", VTY_NEWLINE);
  279. return CMD_ERR_AMBIGUOUS;
  280. }
  281. return CMD_SUCCESS;
  282. }
  283. DEFUN (no_isis_passwd,
  284. no_isis_passwd_cmd,
  285. "no isis password",
  286. NO_STR
  287. "IS-IS commands\n"
  288. "Configure the authentication password for a circuit\n")
  289. {
  290. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  291. if (!circuit)
  292. return CMD_ERR_NO_MATCH;
  293. isis_circuit_passwd_unset(circuit);
  294. return CMD_SUCCESS;
  295. }
  296. ALIAS (no_isis_passwd,
  297. no_isis_passwd_arg_cmd,
  298. "no isis password (md5|clear) WORD",
  299. NO_STR
  300. "IS-IS commands\n"
  301. "Configure the authentication password for a circuit\n"
  302. "HMAC-MD5 authentication\n"
  303. "Cleartext password\n"
  304. "Circuit password\n")
  305. DEFUN (isis_priority,
  306. isis_priority_cmd,
  307. "isis priority <0-127>",
  308. "IS-IS commands\n"
  309. "Set priority for Designated Router election\n"
  310. "Priority value\n")
  311. {
  312. int prio;
  313. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  314. if (!circuit)
  315. return CMD_ERR_NO_MATCH;
  316. prio = atoi (argv[0]);
  317. if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
  318. {
  319. vty_out (vty, "Invalid priority %d - should be <0-127>%s",
  320. prio, VTY_NEWLINE);
  321. return CMD_ERR_AMBIGUOUS;
  322. }
  323. circuit->priority[0] = prio;
  324. circuit->priority[1] = prio;
  325. return CMD_SUCCESS;
  326. }
  327. DEFUN (no_isis_priority,
  328. no_isis_priority_cmd,
  329. "no isis priority",
  330. NO_STR
  331. "IS-IS commands\n"
  332. "Set priority for Designated Router election\n")
  333. {
  334. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  335. if (!circuit)
  336. return CMD_ERR_NO_MATCH;
  337. circuit->priority[0] = DEFAULT_PRIORITY;
  338. circuit->priority[1] = DEFAULT_PRIORITY;
  339. return CMD_SUCCESS;
  340. }
  341. ALIAS (no_isis_priority,
  342. no_isis_priority_arg_cmd,
  343. "no isis priority <0-127>",
  344. NO_STR
  345. "IS-IS commands\n"
  346. "Set priority for Designated Router election\n"
  347. "Priority value\n")
  348. DEFUN (isis_priority_l1,
  349. isis_priority_l1_cmd,
  350. "isis priority <0-127> level-1",
  351. "IS-IS commands\n"
  352. "Set priority for Designated Router election\n"
  353. "Priority value\n"
  354. "Specify priority for level-1 routing\n")
  355. {
  356. int prio;
  357. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  358. if (!circuit)
  359. return CMD_ERR_NO_MATCH;
  360. prio = atoi (argv[0]);
  361. if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
  362. {
  363. vty_out (vty, "Invalid priority %d - should be <0-127>%s",
  364. prio, VTY_NEWLINE);
  365. return CMD_ERR_AMBIGUOUS;
  366. }
  367. circuit->priority[0] = prio;
  368. return CMD_SUCCESS;
  369. }
  370. DEFUN (no_isis_priority_l1,
  371. no_isis_priority_l1_cmd,
  372. "no isis priority level-1",
  373. NO_STR
  374. "IS-IS commands\n"
  375. "Set priority for Designated Router election\n"
  376. "Specify priority for level-1 routing\n")
  377. {
  378. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  379. if (!circuit)
  380. return CMD_ERR_NO_MATCH;
  381. circuit->priority[0] = DEFAULT_PRIORITY;
  382. return CMD_SUCCESS;
  383. }
  384. ALIAS (no_isis_priority_l1,
  385. no_isis_priority_l1_arg_cmd,
  386. "no isis priority <0-127> level-1",
  387. NO_STR
  388. "IS-IS commands\n"
  389. "Set priority for Designated Router election\n"
  390. "Priority value\n"
  391. "Specify priority for level-1 routing\n")
  392. DEFUN (isis_priority_l2,
  393. isis_priority_l2_cmd,
  394. "isis priority <0-127> level-2",
  395. "IS-IS commands\n"
  396. "Set priority for Designated Router election\n"
  397. "Priority value\n"
  398. "Specify priority for level-2 routing\n")
  399. {
  400. int prio;
  401. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  402. if (!circuit)
  403. return CMD_ERR_NO_MATCH;
  404. prio = atoi (argv[0]);
  405. if (prio < MIN_PRIORITY || prio > MAX_PRIORITY)
  406. {
  407. vty_out (vty, "Invalid priority %d - should be <0-127>%s",
  408. prio, VTY_NEWLINE);
  409. return CMD_ERR_AMBIGUOUS;
  410. }
  411. circuit->priority[1] = prio;
  412. return CMD_SUCCESS;
  413. }
  414. DEFUN (no_isis_priority_l2,
  415. no_isis_priority_l2_cmd,
  416. "no isis priority level-2",
  417. NO_STR
  418. "IS-IS commands\n"
  419. "Set priority for Designated Router election\n"
  420. "Specify priority for level-2 routing\n")
  421. {
  422. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  423. if (!circuit)
  424. return CMD_ERR_NO_MATCH;
  425. circuit->priority[1] = DEFAULT_PRIORITY;
  426. return CMD_SUCCESS;
  427. }
  428. ALIAS (no_isis_priority_l2,
  429. no_isis_priority_l2_arg_cmd,
  430. "no isis priority <0-127> level-2",
  431. NO_STR
  432. "IS-IS commands\n"
  433. "Set priority for Designated Router election\n"
  434. "Priority value\n"
  435. "Specify priority for level-2 routing\n")
  436. /* Metric command */
  437. DEFUN (isis_metric,
  438. isis_metric_cmd,
  439. "isis metric <0-16777215>",
  440. "IS-IS commands\n"
  441. "Set default metric for circuit\n"
  442. "Default metric value\n")
  443. {
  444. int met;
  445. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  446. if (!circuit)
  447. return CMD_ERR_NO_MATCH;
  448. met = atoi (argv[0]);
  449. /* RFC3787 section 5.1 */
  450. if (circuit->area && circuit->area->oldmetric == 1 &&
  451. met > MAX_NARROW_LINK_METRIC)
  452. {
  453. vty_out (vty, "Invalid metric %d - should be <0-63> "
  454. "when narrow metric type enabled%s",
  455. met, VTY_NEWLINE);
  456. return CMD_ERR_AMBIGUOUS;
  457. }
  458. /* RFC4444 */
  459. if (circuit->area && circuit->area->newmetric == 1 &&
  460. met > MAX_WIDE_LINK_METRIC)
  461. {
  462. vty_out (vty, "Invalid metric %d - should be <0-16777215> "
  463. "when wide metric type enabled%s",
  464. met, VTY_NEWLINE);
  465. return CMD_ERR_AMBIGUOUS;
  466. }
  467. isis_circuit_metric_set (circuit, IS_LEVEL_1, met);
  468. isis_circuit_metric_set (circuit, IS_LEVEL_2, met);
  469. return CMD_SUCCESS;
  470. }
  471. DEFUN (no_isis_metric,
  472. no_isis_metric_cmd,
  473. "no isis metric",
  474. NO_STR
  475. "IS-IS commands\n"
  476. "Set default metric for circuit\n")
  477. {
  478. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  479. if (!circuit)
  480. return CMD_ERR_NO_MATCH;
  481. isis_circuit_metric_set (circuit, IS_LEVEL_1, DEFAULT_CIRCUIT_METRIC);
  482. isis_circuit_metric_set (circuit, IS_LEVEL_2, DEFAULT_CIRCUIT_METRIC);
  483. return CMD_SUCCESS;
  484. }
  485. ALIAS (no_isis_metric,
  486. no_isis_metric_arg_cmd,
  487. "no isis metric <0-16777215>",
  488. NO_STR
  489. "IS-IS commands\n"
  490. "Set default metric for circuit\n"
  491. "Default metric value\n")
  492. DEFUN (isis_metric_l1,
  493. isis_metric_l1_cmd,
  494. "isis metric <0-16777215> level-1",
  495. "IS-IS commands\n"
  496. "Set default metric for circuit\n"
  497. "Default metric value\n"
  498. "Specify metric for level-1 routing\n")
  499. {
  500. int met;
  501. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  502. if (!circuit)
  503. return CMD_ERR_NO_MATCH;
  504. met = atoi (argv[0]);
  505. /* RFC3787 section 5.1 */
  506. if (circuit->area && circuit->area->oldmetric == 1 &&
  507. met > MAX_NARROW_LINK_METRIC)
  508. {
  509. vty_out (vty, "Invalid metric %d - should be <0-63> "
  510. "when narrow metric type enabled%s",
  511. met, VTY_NEWLINE);
  512. return CMD_ERR_AMBIGUOUS;
  513. }
  514. /* RFC4444 */
  515. if (circuit->area && circuit->area->newmetric == 1 &&
  516. met > MAX_WIDE_LINK_METRIC)
  517. {
  518. vty_out (vty, "Invalid metric %d - should be <0-16777215> "
  519. "when wide metric type enabled%s",
  520. met, VTY_NEWLINE);
  521. return CMD_ERR_AMBIGUOUS;
  522. }
  523. isis_circuit_metric_set (circuit, IS_LEVEL_1, met);
  524. return CMD_SUCCESS;
  525. }
  526. DEFUN (no_isis_metric_l1,
  527. no_isis_metric_l1_cmd,
  528. "no isis metric level-1",
  529. NO_STR
  530. "IS-IS commands\n"
  531. "Set default metric for circuit\n"
  532. "Specify metric for level-1 routing\n")
  533. {
  534. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  535. if (!circuit)
  536. return CMD_ERR_NO_MATCH;
  537. isis_circuit_metric_set (circuit, IS_LEVEL_1, DEFAULT_CIRCUIT_METRIC);
  538. return CMD_SUCCESS;
  539. }
  540. ALIAS (no_isis_metric_l1,
  541. no_isis_metric_l1_arg_cmd,
  542. "no isis metric <0-16777215> level-1",
  543. NO_STR
  544. "IS-IS commands\n"
  545. "Set default metric for circuit\n"
  546. "Default metric value\n"
  547. "Specify metric for level-1 routing\n")
  548. DEFUN (isis_metric_l2,
  549. isis_metric_l2_cmd,
  550. "isis metric <0-16777215> level-2",
  551. "IS-IS commands\n"
  552. "Set default metric for circuit\n"
  553. "Default metric value\n"
  554. "Specify metric for level-2 routing\n")
  555. {
  556. int met;
  557. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  558. if (!circuit)
  559. return CMD_ERR_NO_MATCH;
  560. met = atoi (argv[0]);
  561. /* RFC3787 section 5.1 */
  562. if (circuit->area && circuit->area->oldmetric == 1 &&
  563. met > MAX_NARROW_LINK_METRIC)
  564. {
  565. vty_out (vty, "Invalid metric %d - should be <0-63> "
  566. "when narrow metric type enabled%s",
  567. met, VTY_NEWLINE);
  568. return CMD_ERR_AMBIGUOUS;
  569. }
  570. /* RFC4444 */
  571. if (circuit->area && circuit->area->newmetric == 1 &&
  572. met > MAX_WIDE_LINK_METRIC)
  573. {
  574. vty_out (vty, "Invalid metric %d - should be <0-16777215> "
  575. "when wide metric type enabled%s",
  576. met, VTY_NEWLINE);
  577. return CMD_ERR_AMBIGUOUS;
  578. }
  579. isis_circuit_metric_set (circuit, IS_LEVEL_2, met);
  580. return CMD_SUCCESS;
  581. }
  582. DEFUN (no_isis_metric_l2,
  583. no_isis_metric_l2_cmd,
  584. "no isis metric level-2",
  585. NO_STR
  586. "IS-IS commands\n"
  587. "Set default metric for circuit\n"
  588. "Specify metric for level-2 routing\n")
  589. {
  590. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  591. if (!circuit)
  592. return CMD_ERR_NO_MATCH;
  593. isis_circuit_metric_set (circuit, IS_LEVEL_2, DEFAULT_CIRCUIT_METRIC);
  594. return CMD_SUCCESS;
  595. }
  596. ALIAS (no_isis_metric_l2,
  597. no_isis_metric_l2_arg_cmd,
  598. "no isis metric <0-16777215> level-2",
  599. NO_STR
  600. "IS-IS commands\n"
  601. "Set default metric for circuit\n"
  602. "Default metric value\n"
  603. "Specify metric for level-2 routing\n")
  604. /* end of metrics */
  605. DEFUN (isis_hello_interval,
  606. isis_hello_interval_cmd,
  607. "isis hello-interval <1-600>",
  608. "IS-IS commands\n"
  609. "Set Hello interval\n"
  610. "Hello interval value\n"
  611. "Holdtime 1 seconds, interval depends on multiplier\n")
  612. {
  613. int interval;
  614. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  615. if (!circuit)
  616. return CMD_ERR_NO_MATCH;
  617. interval = atoi (argv[0]);
  618. if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
  619. {
  620. vty_out (vty, "Invalid hello-interval %d - should be <1-600>%s",
  621. interval, VTY_NEWLINE);
  622. return CMD_ERR_AMBIGUOUS;
  623. }
  624. circuit->hello_interval[0] = (u_int16_t) interval;
  625. circuit->hello_interval[1] = (u_int16_t) interval;
  626. return CMD_SUCCESS;
  627. }
  628. DEFUN (no_isis_hello_interval,
  629. no_isis_hello_interval_cmd,
  630. "no isis hello-interval",
  631. NO_STR
  632. "IS-IS commands\n"
  633. "Set Hello interval\n")
  634. {
  635. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  636. if (!circuit)
  637. return CMD_ERR_NO_MATCH;
  638. circuit->hello_interval[0] = DEFAULT_HELLO_INTERVAL;
  639. circuit->hello_interval[1] = DEFAULT_HELLO_INTERVAL;
  640. return CMD_SUCCESS;
  641. }
  642. ALIAS (no_isis_hello_interval,
  643. no_isis_hello_interval_arg_cmd,
  644. "no isis hello-interval <1-600>",
  645. NO_STR
  646. "IS-IS commands\n"
  647. "Set Hello interval\n"
  648. "Hello interval value\n"
  649. "Holdtime 1 second, interval depends on multiplier\n")
  650. DEFUN (isis_hello_interval_l1,
  651. isis_hello_interval_l1_cmd,
  652. "isis hello-interval <1-600> level-1",
  653. "IS-IS commands\n"
  654. "Set Hello interval\n"
  655. "Hello interval value\n"
  656. "Holdtime 1 second, interval depends on multiplier\n"
  657. "Specify hello-interval for level-1 IIHs\n")
  658. {
  659. long interval;
  660. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  661. if (!circuit)
  662. return CMD_ERR_NO_MATCH;
  663. interval = atoi (argv[0]);
  664. if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
  665. {
  666. vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s",
  667. interval, VTY_NEWLINE);
  668. return CMD_ERR_AMBIGUOUS;
  669. }
  670. circuit->hello_interval[0] = (u_int16_t) interval;
  671. return CMD_SUCCESS;
  672. }
  673. DEFUN (no_isis_hello_interval_l1,
  674. no_isis_hello_interval_l1_cmd,
  675. "no isis hello-interval level-1",
  676. NO_STR
  677. "IS-IS commands\n"
  678. "Set Hello interval\n"
  679. "Specify hello-interval for level-1 IIHs\n")
  680. {
  681. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  682. if (!circuit)
  683. return CMD_ERR_NO_MATCH;
  684. circuit->hello_interval[0] = DEFAULT_HELLO_INTERVAL;
  685. return CMD_SUCCESS;
  686. }
  687. ALIAS (no_isis_hello_interval_l1,
  688. no_isis_hello_interval_l1_arg_cmd,
  689. "no isis hello-interval <1-600> level-1",
  690. NO_STR
  691. "IS-IS commands\n"
  692. "Set Hello interval\n"
  693. "Hello interval value\n"
  694. "Holdtime 1 second, interval depends on multiplier\n"
  695. "Specify hello-interval for level-1 IIHs\n")
  696. DEFUN (isis_hello_interval_l2,
  697. isis_hello_interval_l2_cmd,
  698. "isis hello-interval <1-600> level-2",
  699. "IS-IS commands\n"
  700. "Set Hello interval\n"
  701. "Hello interval value\n"
  702. "Holdtime 1 second, interval depends on multiplier\n"
  703. "Specify hello-interval for level-2 IIHs\n")
  704. {
  705. long interval;
  706. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  707. if (!circuit)
  708. return CMD_ERR_NO_MATCH;
  709. interval = atoi (argv[0]);
  710. if (interval < MIN_HELLO_INTERVAL || interval > MAX_HELLO_INTERVAL)
  711. {
  712. vty_out (vty, "Invalid hello-interval %ld - should be <1-600>%s",
  713. interval, VTY_NEWLINE);
  714. return CMD_ERR_AMBIGUOUS;
  715. }
  716. circuit->hello_interval[1] = (u_int16_t) interval;
  717. return CMD_SUCCESS;
  718. }
  719. DEFUN (no_isis_hello_interval_l2,
  720. no_isis_hello_interval_l2_cmd,
  721. "no isis hello-interval level-2",
  722. NO_STR
  723. "IS-IS commands\n"
  724. "Set Hello interval\n"
  725. "Specify hello-interval for level-2 IIHs\n")
  726. {
  727. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  728. if (!circuit)
  729. return CMD_ERR_NO_MATCH;
  730. circuit->hello_interval[1] = DEFAULT_HELLO_INTERVAL;
  731. return CMD_SUCCESS;
  732. }
  733. ALIAS (no_isis_hello_interval_l2,
  734. no_isis_hello_interval_l2_arg_cmd,
  735. "no isis hello-interval <1-600> level-2",
  736. NO_STR
  737. "IS-IS commands\n"
  738. "Set Hello interval\n"
  739. "Hello interval value\n"
  740. "Holdtime 1 second, interval depends on multiplier\n"
  741. "Specify hello-interval for level-2 IIHs\n")
  742. DEFUN (isis_hello_multiplier,
  743. isis_hello_multiplier_cmd,
  744. "isis hello-multiplier <2-100>",
  745. "IS-IS commands\n"
  746. "Set multiplier for Hello holding time\n"
  747. "Hello multiplier value\n")
  748. {
  749. int mult;
  750. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  751. if (!circuit)
  752. return CMD_ERR_NO_MATCH;
  753. mult = atoi (argv[0]);
  754. if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
  755. {
  756. vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
  757. mult, VTY_NEWLINE);
  758. return CMD_ERR_AMBIGUOUS;
  759. }
  760. circuit->hello_multiplier[0] = (u_int16_t) mult;
  761. circuit->hello_multiplier[1] = (u_int16_t) mult;
  762. return CMD_SUCCESS;
  763. }
  764. DEFUN (no_isis_hello_multiplier,
  765. no_isis_hello_multiplier_cmd,
  766. "no isis hello-multiplier",
  767. NO_STR
  768. "IS-IS commands\n"
  769. "Set multiplier for Hello holding time\n")
  770. {
  771. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  772. if (!circuit)
  773. return CMD_ERR_NO_MATCH;
  774. circuit->hello_multiplier[0] = DEFAULT_HELLO_MULTIPLIER;
  775. circuit->hello_multiplier[1] = DEFAULT_HELLO_MULTIPLIER;
  776. return CMD_SUCCESS;
  777. }
  778. ALIAS (no_isis_hello_multiplier,
  779. no_isis_hello_multiplier_arg_cmd,
  780. "no isis hello-multiplier <2-100>",
  781. NO_STR
  782. "IS-IS commands\n"
  783. "Set multiplier for Hello holding time\n"
  784. "Hello multiplier value\n")
  785. DEFUN (isis_hello_multiplier_l1,
  786. isis_hello_multiplier_l1_cmd,
  787. "isis hello-multiplier <2-100> level-1",
  788. "IS-IS commands\n"
  789. "Set multiplier for Hello holding time\n"
  790. "Hello multiplier value\n"
  791. "Specify hello multiplier for level-1 IIHs\n")
  792. {
  793. int mult;
  794. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  795. if (!circuit)
  796. return CMD_ERR_NO_MATCH;
  797. mult = atoi (argv[0]);
  798. if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
  799. {
  800. vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
  801. mult, VTY_NEWLINE);
  802. return CMD_ERR_AMBIGUOUS;
  803. }
  804. circuit->hello_multiplier[0] = (u_int16_t) mult;
  805. return CMD_SUCCESS;
  806. }
  807. DEFUN (no_isis_hello_multiplier_l1,
  808. no_isis_hello_multiplier_l1_cmd,
  809. "no isis hello-multiplier level-1",
  810. NO_STR
  811. "IS-IS commands\n"
  812. "Set multiplier for Hello holding time\n"
  813. "Specify hello multiplier for level-1 IIHs\n")
  814. {
  815. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  816. if (!circuit)
  817. return CMD_ERR_NO_MATCH;
  818. circuit->hello_multiplier[0] = DEFAULT_HELLO_MULTIPLIER;
  819. return CMD_SUCCESS;
  820. }
  821. ALIAS (no_isis_hello_multiplier_l1,
  822. no_isis_hello_multiplier_l1_arg_cmd,
  823. "no isis hello-multiplier <2-100> level-1",
  824. NO_STR
  825. "IS-IS commands\n"
  826. "Set multiplier for Hello holding time\n"
  827. "Hello multiplier value\n"
  828. "Specify hello multiplier for level-1 IIHs\n")
  829. DEFUN (isis_hello_multiplier_l2,
  830. isis_hello_multiplier_l2_cmd,
  831. "isis hello-multiplier <2-100> level-2",
  832. "IS-IS commands\n"
  833. "Set multiplier for Hello holding time\n"
  834. "Hello multiplier value\n"
  835. "Specify hello multiplier for level-2 IIHs\n")
  836. {
  837. int mult;
  838. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  839. if (!circuit)
  840. return CMD_ERR_NO_MATCH;
  841. mult = atoi (argv[0]);
  842. if (mult < MIN_HELLO_MULTIPLIER || mult > MAX_HELLO_MULTIPLIER)
  843. {
  844. vty_out (vty, "Invalid hello-multiplier %d - should be <2-100>%s",
  845. mult, VTY_NEWLINE);
  846. return CMD_ERR_AMBIGUOUS;
  847. }
  848. circuit->hello_multiplier[1] = (u_int16_t) mult;
  849. return CMD_SUCCESS;
  850. }
  851. DEFUN (no_isis_hello_multiplier_l2,
  852. no_isis_hello_multiplier_l2_cmd,
  853. "no isis hello-multiplier level-2",
  854. NO_STR
  855. "IS-IS commands\n"
  856. "Set multiplier for Hello holding time\n"
  857. "Specify hello multiplier for level-2 IIHs\n")
  858. {
  859. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  860. if (!circuit)
  861. return CMD_ERR_NO_MATCH;
  862. circuit->hello_multiplier[1] = DEFAULT_HELLO_MULTIPLIER;
  863. return CMD_SUCCESS;
  864. }
  865. ALIAS (no_isis_hello_multiplier_l2,
  866. no_isis_hello_multiplier_l2_arg_cmd,
  867. "no isis hello-multiplier <2-100> level-2",
  868. NO_STR
  869. "IS-IS commands\n"
  870. "Set multiplier for Hello holding time\n"
  871. "Hello multiplier value\n"
  872. "Specify hello multiplier for level-2 IIHs\n")
  873. DEFUN (isis_hello_padding,
  874. isis_hello_padding_cmd,
  875. "isis hello padding",
  876. "IS-IS commands\n"
  877. "Add padding to IS-IS hello packets\n"
  878. "Pad hello packets\n"
  879. "<cr>\n")
  880. {
  881. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  882. if (!circuit)
  883. return CMD_ERR_NO_MATCH;
  884. circuit->pad_hellos = 1;
  885. return CMD_SUCCESS;
  886. }
  887. DEFUN (no_isis_hello_padding,
  888. no_isis_hello_padding_cmd,
  889. "no isis hello padding",
  890. NO_STR
  891. "IS-IS commands\n"
  892. "Add padding to IS-IS hello packets\n"
  893. "Pad hello packets\n"
  894. "<cr>\n")
  895. {
  896. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  897. if (!circuit)
  898. return CMD_ERR_NO_MATCH;
  899. circuit->pad_hellos = 0;
  900. return CMD_SUCCESS;
  901. }
  902. DEFUN (csnp_interval,
  903. csnp_interval_cmd,
  904. "isis csnp-interval <1-600>",
  905. "IS-IS commands\n"
  906. "Set CSNP interval in seconds\n"
  907. "CSNP interval value\n")
  908. {
  909. unsigned long interval;
  910. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  911. if (!circuit)
  912. return CMD_ERR_NO_MATCH;
  913. interval = atol (argv[0]);
  914. if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
  915. {
  916. vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
  917. interval, VTY_NEWLINE);
  918. return CMD_ERR_AMBIGUOUS;
  919. }
  920. circuit->csnp_interval[0] = (u_int16_t) interval;
  921. circuit->csnp_interval[1] = (u_int16_t) interval;
  922. return CMD_SUCCESS;
  923. }
  924. DEFUN (no_csnp_interval,
  925. no_csnp_interval_cmd,
  926. "no isis csnp-interval",
  927. NO_STR
  928. "IS-IS commands\n"
  929. "Set CSNP interval in seconds\n")
  930. {
  931. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  932. if (!circuit)
  933. return CMD_ERR_NO_MATCH;
  934. circuit->csnp_interval[0] = DEFAULT_CSNP_INTERVAL;
  935. circuit->csnp_interval[1] = DEFAULT_CSNP_INTERVAL;
  936. return CMD_SUCCESS;
  937. }
  938. ALIAS (no_csnp_interval,
  939. no_csnp_interval_arg_cmd,
  940. "no isis csnp-interval <1-600>",
  941. NO_STR
  942. "IS-IS commands\n"
  943. "Set CSNP interval in seconds\n"
  944. "CSNP interval value\n")
  945. DEFUN (csnp_interval_l1,
  946. csnp_interval_l1_cmd,
  947. "isis csnp-interval <1-600> level-1",
  948. "IS-IS commands\n"
  949. "Set CSNP interval in seconds\n"
  950. "CSNP interval value\n"
  951. "Specify interval for level-1 CSNPs\n")
  952. {
  953. unsigned long interval;
  954. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  955. if (!circuit)
  956. return CMD_ERR_NO_MATCH;
  957. interval = atol (argv[0]);
  958. if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
  959. {
  960. vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
  961. interval, VTY_NEWLINE);
  962. return CMD_ERR_AMBIGUOUS;
  963. }
  964. circuit->csnp_interval[0] = (u_int16_t) interval;
  965. return CMD_SUCCESS;
  966. }
  967. DEFUN (no_csnp_interval_l1,
  968. no_csnp_interval_l1_cmd,
  969. "no isis csnp-interval level-1",
  970. NO_STR
  971. "IS-IS commands\n"
  972. "Set CSNP interval in seconds\n"
  973. "Specify interval for level-1 CSNPs\n")
  974. {
  975. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  976. if (!circuit)
  977. return CMD_ERR_NO_MATCH;
  978. circuit->csnp_interval[0] = DEFAULT_CSNP_INTERVAL;
  979. return CMD_SUCCESS;
  980. }
  981. ALIAS (no_csnp_interval_l1,
  982. no_csnp_interval_l1_arg_cmd,
  983. "no isis csnp-interval <1-600> level-1",
  984. NO_STR
  985. "IS-IS commands\n"
  986. "Set CSNP interval in seconds\n"
  987. "CSNP interval value\n"
  988. "Specify interval for level-1 CSNPs\n")
  989. DEFUN (csnp_interval_l2,
  990. csnp_interval_l2_cmd,
  991. "isis csnp-interval <1-600> level-2",
  992. "IS-IS commands\n"
  993. "Set CSNP interval in seconds\n"
  994. "CSNP interval value\n"
  995. "Specify interval for level-2 CSNPs\n")
  996. {
  997. unsigned long interval;
  998. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  999. if (!circuit)
  1000. return CMD_ERR_NO_MATCH;
  1001. interval = atol (argv[0]);
  1002. if (interval < MIN_CSNP_INTERVAL || interval > MAX_CSNP_INTERVAL)
  1003. {
  1004. vty_out (vty, "Invalid csnp-interval %lu - should be <1-600>%s",
  1005. interval, VTY_NEWLINE);
  1006. return CMD_ERR_AMBIGUOUS;
  1007. }
  1008. circuit->csnp_interval[1] = (u_int16_t) interval;
  1009. return CMD_SUCCESS;
  1010. }
  1011. DEFUN (no_csnp_interval_l2,
  1012. no_csnp_interval_l2_cmd,
  1013. "no isis csnp-interval level-2",
  1014. NO_STR
  1015. "IS-IS commands\n"
  1016. "Set CSNP interval in seconds\n"
  1017. "Specify interval for level-2 CSNPs\n")
  1018. {
  1019. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  1020. if (!circuit)
  1021. return CMD_ERR_NO_MATCH;
  1022. circuit->csnp_interval[1] = DEFAULT_CSNP_INTERVAL;
  1023. return CMD_SUCCESS;
  1024. }
  1025. ALIAS (no_csnp_interval_l2,
  1026. no_csnp_interval_l2_arg_cmd,
  1027. "no isis csnp-interval <1-600> level-2",
  1028. NO_STR
  1029. "IS-IS commands\n"
  1030. "Set CSNP interval in seconds\n"
  1031. "CSNP interval value\n"
  1032. "Specify interval for level-2 CSNPs\n")
  1033. DEFUN (psnp_interval,
  1034. psnp_interval_cmd,
  1035. "isis psnp-interval <1-120>",
  1036. "IS-IS commands\n"
  1037. "Set PSNP interval in seconds\n"
  1038. "PSNP interval value\n")
  1039. {
  1040. unsigned long interval;
  1041. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  1042. if (!circuit)
  1043. return CMD_ERR_NO_MATCH;
  1044. interval = atol (argv[0]);
  1045. if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
  1046. {
  1047. vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
  1048. interval, VTY_NEWLINE);
  1049. return CMD_ERR_AMBIGUOUS;
  1050. }
  1051. circuit->psnp_interval[0] = (u_int16_t) interval;
  1052. circuit->psnp_interval[1] = (u_int16_t) interval;
  1053. return CMD_SUCCESS;
  1054. }
  1055. DEFUN (no_psnp_interval,
  1056. no_psnp_interval_cmd,
  1057. "no isis psnp-interval",
  1058. NO_STR
  1059. "IS-IS commands\n"
  1060. "Set PSNP interval in seconds\n")
  1061. {
  1062. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  1063. if (!circuit)
  1064. return CMD_ERR_NO_MATCH;
  1065. circuit->psnp_interval[0] = DEFAULT_PSNP_INTERVAL;
  1066. circuit->psnp_interval[1] = DEFAULT_PSNP_INTERVAL;
  1067. return CMD_SUCCESS;
  1068. }
  1069. ALIAS (no_psnp_interval,
  1070. no_psnp_interval_arg_cmd,
  1071. "no isis psnp-interval <1-120>",
  1072. NO_STR
  1073. "IS-IS commands\n"
  1074. "Set PSNP interval in seconds\n"
  1075. "PSNP interval value\n")
  1076. DEFUN (psnp_interval_l1,
  1077. psnp_interval_l1_cmd,
  1078. "isis psnp-interval <1-120> level-1",
  1079. "IS-IS commands\n"
  1080. "Set PSNP interval in seconds\n"
  1081. "PSNP interval value\n"
  1082. "Specify interval for level-1 PSNPs\n")
  1083. {
  1084. unsigned long interval;
  1085. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  1086. if (!circuit)
  1087. return CMD_ERR_NO_MATCH;
  1088. interval = atol (argv[0]);
  1089. if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
  1090. {
  1091. vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
  1092. interval, VTY_NEWLINE);
  1093. return CMD_ERR_AMBIGUOUS;
  1094. }
  1095. circuit->psnp_interval[0] = (u_int16_t) interval;
  1096. return CMD_SUCCESS;
  1097. }
  1098. DEFUN (no_psnp_interval_l1,
  1099. no_psnp_interval_l1_cmd,
  1100. "no isis psnp-interval level-1",
  1101. NO_STR
  1102. "IS-IS commands\n"
  1103. "Set PSNP interval in seconds\n"
  1104. "Specify interval for level-1 PSNPs\n")
  1105. {
  1106. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  1107. if (!circuit)
  1108. return CMD_ERR_NO_MATCH;
  1109. circuit->psnp_interval[0] = DEFAULT_PSNP_INTERVAL;
  1110. return CMD_SUCCESS;
  1111. }
  1112. ALIAS (no_psnp_interval_l1,
  1113. no_psnp_interval_l1_arg_cmd,
  1114. "no isis psnp-interval <1-120> level-1",
  1115. NO_STR
  1116. "IS-IS commands\n"
  1117. "Set PSNP interval in seconds\n"
  1118. "PSNP interval value\n"
  1119. "Specify interval for level-1 PSNPs\n")
  1120. DEFUN (psnp_interval_l2,
  1121. psnp_interval_l2_cmd,
  1122. "isis psnp-interval <1-120> level-2",
  1123. "IS-IS commands\n"
  1124. "Set PSNP interval in seconds\n"
  1125. "PSNP interval value\n"
  1126. "Specify interval for level-2 PSNPs\n")
  1127. {
  1128. unsigned long interval;
  1129. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  1130. if (!circuit)
  1131. return CMD_ERR_NO_MATCH;
  1132. interval = atol (argv[0]);
  1133. if (interval < MIN_PSNP_INTERVAL || interval > MAX_PSNP_INTERVAL)
  1134. {
  1135. vty_out (vty, "Invalid psnp-interval %lu - should be <1-120>%s",
  1136. interval, VTY_NEWLINE);
  1137. return CMD_ERR_AMBIGUOUS;
  1138. }
  1139. circuit->psnp_interval[1] = (u_int16_t) interval;
  1140. return CMD_SUCCESS;
  1141. }
  1142. DEFUN (no_psnp_interval_l2,
  1143. no_psnp_interval_l2_cmd,
  1144. "no isis psnp-interval level-2",
  1145. NO_STR
  1146. "IS-IS commands\n"
  1147. "Set PSNP interval in seconds\n"
  1148. "Specify interval for level-2 PSNPs\n")
  1149. {
  1150. struct isis_circuit *circuit = isis_circuit_lookup (vty);
  1151. if (!circuit)
  1152. return CMD_ERR_NO_MATCH;
  1153. circuit->psnp_interval[1] = DEFAULT_PSNP_INTERVAL;
  1154. return CMD_SUCCESS;
  1155. }
  1156. ALIAS (no_psnp_interval_l2,
  1157. no_psnp_interval_l2_arg_cmd,
  1158. "no isis psnp-interval <1-120> level-2",
  1159. NO_STR
  1160. "IS-IS commands\n"
  1161. "Set PSNP interval in seconds\n"
  1162. "PSNP interval value\n"
  1163. "Specify interval for level-2 PSNPs\n")
  1164. static int
  1165. validate_metric_style_narrow (struct vty *vty, struct isis_area *area)
  1166. {
  1167. struct isis_circuit *circuit;
  1168. struct listnode *node;
  1169. if (! vty)
  1170. return CMD_ERR_AMBIGUOUS;
  1171. if (! area)
  1172. {
  1173. vty_out (vty, "ISIS area is invalid%s", VTY_NEWLINE);
  1174. return CMD_ERR_AMBIGUOUS;
  1175. }
  1176. for (ALL_LIST_ELEMENTS_RO (area->circuit_list, node, circuit))
  1177. {
  1178. if ((area->is_type & IS_LEVEL_1) &&
  1179. (circuit->is_type & IS_LEVEL_1) &&
  1180. (circuit->te_metric[0] > MAX_NARROW_LINK_METRIC))
  1181. {
  1182. vty_out (vty, "ISIS circuit %s metric is invalid%s",
  1183. circuit->interface->name, VTY_NEWLINE);
  1184. return CMD_ERR_AMBIGUOUS;
  1185. }
  1186. if ((area->is_type & IS_LEVEL_2) &&
  1187. (circuit->is_type & IS_LEVEL_2) &&
  1188. (circuit->te_metric[1] > MAX_NARROW_LINK_METRIC))
  1189. {
  1190. vty_out (vty, "ISIS circuit %s metric is invalid%s",
  1191. circuit->interface->name, VTY_NEWLINE);
  1192. return CMD_ERR_AMBIGUOUS;
  1193. }
  1194. }
  1195. return CMD_SUCCESS;
  1196. }
  1197. DEFUN (metric_style,
  1198. metric_style_cmd,
  1199. "metric-style (narrow|transition|wide)",
  1200. "Use old-style (ISO 10589) or new-style packet formats\n"
  1201. "Use old style of TLVs with narrow metric\n"
  1202. "Send and accept both styles of TLVs during transition\n"
  1203. "Use new style of TLVs to carry wider metric\n")
  1204. {
  1205. struct isis_area *area = vty->index;
  1206. int ret;
  1207. assert(area);
  1208. if (strncmp (argv[0], "w", 1) == 0)
  1209. {
  1210. isis_area_metricstyle_set(area, false, true);
  1211. return CMD_SUCCESS;
  1212. }
  1213. ret = validate_metric_style_narrow (vty, area);
  1214. if (ret != CMD_SUCCESS)
  1215. return ret;
  1216. if (strncmp (argv[0], "t", 1) == 0)
  1217. isis_area_metricstyle_set(area, true, true);
  1218. else if (strncmp (argv[0], "n", 1) == 0)
  1219. isis_area_metricstyle_set(area, true, false);
  1220. return CMD_SUCCESS;
  1221. return CMD_SUCCESS;
  1222. }
  1223. DEFUN (no_metric_style,
  1224. no_metric_style_cmd,
  1225. "no metric-style",
  1226. NO_STR
  1227. "Use old-style (ISO 10589) or new-style packet formats\n")
  1228. {
  1229. struct isis_area *area = vty->index;
  1230. int ret;
  1231. assert (area);
  1232. ret = validate_metric_style_narrow (vty, area);
  1233. if (ret != CMD_SUCCESS)
  1234. return ret;
  1235. isis_area_metricstyle_set(area, true, false);
  1236. return CMD_SUCCESS;
  1237. }
  1238. DEFUN (set_overload_bit,
  1239. set_overload_bit_cmd,
  1240. "set-overload-bit",
  1241. "Set overload bit to avoid any transit traffic\n"
  1242. "Set overload bit\n")
  1243. {
  1244. struct isis_area *area = vty->index;
  1245. assert (area);
  1246. isis_area_overload_bit_set(area, true);
  1247. return CMD_SUCCESS;
  1248. }
  1249. DEFUN (no_set_overload_bit,
  1250. no_set_overload_bit_cmd,
  1251. "no set-overload-bit",
  1252. "Reset overload bit to accept transit traffic\n"
  1253. "Reset overload bit\n")
  1254. {
  1255. struct isis_area *area = vty->index;
  1256. assert (area);
  1257. isis_area_overload_bit_set(area, false);
  1258. return CMD_SUCCESS;
  1259. }
  1260. DEFUN (set_attached_bit,
  1261. set_attached_bit_cmd,
  1262. "set-attached-bit",
  1263. "Set attached bit to identify as L1/L2 router for inter-area traffic\n"
  1264. "Set attached bit\n")
  1265. {
  1266. struct isis_area *area = vty->index;
  1267. assert (area);
  1268. isis_area_attached_bit_set(area, true);
  1269. return CMD_SUCCESS;
  1270. }
  1271. DEFUN (no_set_attached_bit,
  1272. no_set_attached_bit_cmd,
  1273. "no set-attached-bit",
  1274. "Reset attached bit\n")
  1275. {
  1276. struct isis_area *area = vty->index;
  1277. assert (area);
  1278. isis_area_attached_bit_set(area, false);
  1279. return CMD_SUCCESS;
  1280. }
  1281. DEFUN (dynamic_hostname,
  1282. dynamic_hostname_cmd,
  1283. "hostname dynamic",
  1284. "Dynamic hostname for IS-IS\n"
  1285. "Dynamic hostname\n")
  1286. {
  1287. struct isis_area *area = vty->index;
  1288. assert(area);
  1289. isis_area_dynhostname_set(area, true);
  1290. return CMD_SUCCESS;
  1291. }
  1292. DEFUN (no_dynamic_hostname,
  1293. no_dynamic_hostname_cmd,
  1294. "no hostname dynamic",
  1295. NO_STR
  1296. "Dynamic hostname for IS-IS\n"
  1297. "Dynamic hostname\n")
  1298. {
  1299. struct isis_area *area = vty->index;
  1300. assert(area);
  1301. isis_area_dynhostname_set(area, false);
  1302. return CMD_SUCCESS;
  1303. }
  1304. static int area_lsp_mtu_set(struct vty *vty, unsigned int lsp_mtu)
  1305. {
  1306. struct isis_area *area = vty->index;
  1307. struct listnode *node;
  1308. struct isis_circuit *circuit;
  1309. if (!area)
  1310. {
  1311. vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
  1312. return CMD_ERR_NO_MATCH;
  1313. }
  1314. for (ALL_LIST_ELEMENTS_RO(area->circuit_list, node, circuit))
  1315. {
  1316. if(circuit->state != C_STATE_INIT && circuit->state != C_STATE_UP)
  1317. continue;
  1318. if(lsp_mtu > isis_circuit_pdu_size(circuit))
  1319. {
  1320. vty_out(vty, "ISIS area contains circuit %s, which has a maximum PDU size of %zu.%s",
  1321. circuit->interface->name, isis_circuit_pdu_size(circuit),
  1322. VTY_NEWLINE);
  1323. return CMD_ERR_AMBIGUOUS;
  1324. }
  1325. }
  1326. isis_area_lsp_mtu_set(area, lsp_mtu);
  1327. return CMD_SUCCESS;
  1328. }
  1329. DEFUN (area_lsp_mtu,
  1330. area_lsp_mtu_cmd,
  1331. "lsp-mtu <128-4352>",
  1332. "Configure the maximum size of generated LSPs\n"
  1333. "Maximum size of generated LSPs\n")
  1334. {
  1335. unsigned int lsp_mtu;
  1336. VTY_GET_INTEGER_RANGE("lsp-mtu", lsp_mtu, argv[0], 128, 4352);
  1337. return area_lsp_mtu_set(vty, lsp_mtu);
  1338. }
  1339. DEFUN(no_area_lsp_mtu,
  1340. no_area_lsp_mtu_cmd,
  1341. "no lsp-mtu",
  1342. NO_STR
  1343. "Configure the maximum size of generated LSPs\n")
  1344. {
  1345. return area_lsp_mtu_set(vty, DEFAULT_LSP_MTU);
  1346. }
  1347. ALIAS(no_area_lsp_mtu,
  1348. no_area_lsp_mtu_arg_cmd,
  1349. "no lsp-mtu <128-4352>",
  1350. NO_STR
  1351. "Configure the maximum size of generated LSPs\n"
  1352. "Maximum size of generated LSPs\n");
  1353. DEFUN (is_type,
  1354. is_type_cmd,
  1355. "is-type (level-1|level-1-2|level-2-only)",
  1356. "IS Level for this routing process (OSI only)\n"
  1357. "Act as a station router only\n"
  1358. "Act as both a station router and an area router\n"
  1359. "Act as an area router only\n")
  1360. {
  1361. struct isis_area *area;
  1362. int type;
  1363. area = vty->index;
  1364. if (!area)
  1365. {
  1366. vty_out (vty, "Can't find IS-IS instance%s", VTY_NEWLINE);
  1367. return CMD_ERR_NO_MATCH;
  1368. }
  1369. type = string2circuit_t (argv[0]);
  1370. if (!type)
  1371. {
  1372. vty_out (vty, "Unknown IS level %s", VTY_NEWLINE);
  1373. return CMD_SUCCESS;
  1374. }
  1375. isis_area_is_type_set(area, type);
  1376. return CMD_SUCCESS;
  1377. }
  1378. DEFUN (no_is_type,
  1379. no_is_type_cmd,
  1380. "no is-type (level-1|level-1-2|level-2-only)",
  1381. NO_STR
  1382. "IS Level for this routing process (OSI only)\n"
  1383. "Act as a station router only\n"
  1384. "Act as both a station router and an area router\n"
  1385. "Act as an area router only\n")
  1386. {
  1387. struct isis_area *area;
  1388. int type;
  1389. area = vty->index;
  1390. assert (area);
  1391. /*
  1392. * Put the is-type back to defaults:
  1393. * - level-1-2 on first area
  1394. * - level-1 for the rest
  1395. */
  1396. if (listgetdata (listhead (isis->area_list)) == area)
  1397. type = IS_LEVEL_1_AND_2;
  1398. else
  1399. type = IS_LEVEL_1;
  1400. isis_area_is_type_set(area, type);
  1401. return CMD_SUCCESS;
  1402. }
  1403. static int
  1404. set_lsp_gen_interval (struct vty *vty, struct isis_area *area,
  1405. uint16_t interval, int level)
  1406. {
  1407. int lvl;
  1408. for (lvl = IS_LEVEL_1; lvl <= IS_LEVEL_2; ++lvl)
  1409. {
  1410. if (!(lvl & level))
  1411. continue;
  1412. if (interval >= area->lsp_refresh[lvl-1])
  1413. {
  1414. vty_out (vty, "LSP gen interval %us must be less than "
  1415. "the LSP refresh interval %us%s",
  1416. interval, area->lsp_refresh[lvl-1], VTY_NEWLINE);
  1417. return CMD_ERR_AMBIGUOUS;
  1418. }
  1419. }
  1420. for (lvl = IS_LEVEL_1; lvl <= IS_LEVEL_2; ++lvl)
  1421. {
  1422. if (!(lvl & level))
  1423. continue;
  1424. area->lsp_gen_interval[lvl-1] = interval;
  1425. }
  1426. return CMD_SUCCESS;
  1427. }
  1428. DEFUN (lsp_gen_interval,
  1429. lsp_gen_interval_cmd,
  1430. "lsp-gen-interval <1-120>",
  1431. "Minimum interval between regenerating same LSP\n"
  1432. "Minimum interval in seconds\n")
  1433. {
  1434. struct isis_area *area;
  1435. uint16_t interval;
  1436. int level;
  1437. area = vty->index;
  1438. interval = atoi (argv[0]);
  1439. level = IS_LEVEL_1 | IS_LEVEL_2;
  1440. return set_lsp_gen_interval (vty, area, interval, level);
  1441. }
  1442. DEFUN (no_lsp_gen_interval,
  1443. no_lsp_gen_interval_cmd,
  1444. "no lsp-gen-interval",
  1445. NO_STR
  1446. "Minimum interval between regenerating same LSP\n")
  1447. {
  1448. struct isis_area *area;
  1449. uint16_t interval;
  1450. int level;
  1451. area = vty->index;
  1452. interval = DEFAULT_MIN_LSP_GEN_INTERVAL;
  1453. level = IS_LEVEL_1 | IS_LEVEL_2;
  1454. return set_lsp_gen_interval (vty, area, interval, level);
  1455. }
  1456. ALIAS (no_lsp_gen_interval,
  1457. no_lsp_gen_interval_arg_cmd,
  1458. "no lsp-gen-interval <1-120>",
  1459. NO_STR
  1460. "Minimum interval between regenerating same LSP\n"
  1461. "Minimum interval in seconds\n")
  1462. DEFUN (lsp_gen_interval_l1,
  1463. lsp_gen_interval_l1_cmd,
  1464. "lsp-gen-interval level-1 <1-120>",
  1465. "Minimum interval between regenerating same LSP\n"
  1466. "Set interval for level 1 only\n"
  1467. "Minimum interval in seconds\n")
  1468. {
  1469. struct isis_area *area;
  1470. uint16_t interval;
  1471. int level;
  1472. area = vty->index;
  1473. interval = atoi (argv[0]);
  1474. level = IS_LEVEL_1;
  1475. return set_lsp_gen_interval (vty, area, interval, level);
  1476. }
  1477. DEFUN (no_lsp_gen_interval_l1,
  1478. no_lsp_gen_interval_l1_cmd,
  1479. "no lsp-gen-interval level-1",
  1480. NO_STR
  1481. "Minimum interval between regenerating same LSP\n"
  1482. "Set interval for level 1 only\n")
  1483. {
  1484. struct isis_area *area;
  1485. uint16_t interval;
  1486. int level;
  1487. area = vty->index;
  1488. interval = DEFAULT_MIN_LSP_GEN_INTERVAL;
  1489. level = IS_LEVEL_1;
  1490. return set_lsp_gen_interval (vty, area, interval, level);
  1491. }
  1492. ALIAS (no_lsp_gen_interval_l1,
  1493. no_lsp_gen_interval_l1_arg_cmd,
  1494. "no lsp-gen-interval level-1 <1-120>",
  1495. NO_STR
  1496. "Minimum interval between regenerating same LSP\n"
  1497. "Set interval for level 1 only\n"
  1498. "Minimum interval in seconds\n")
  1499. DEFUN (lsp_gen_interval_l2,
  1500. lsp_gen_interval_l2_cmd,
  1501. "lsp-gen-interval level-2 <1-120>",
  1502. "Minimum interval between regenerating same LSP\n"
  1503. "Set interval for level 2 only\n"
  1504. "Minimum interval in seconds\n")
  1505. {
  1506. struct isis_area *area;
  1507. uint16_t interval;
  1508. int level;
  1509. area = vty->index;
  1510. interval = atoi (argv[0]);
  1511. level = IS_LEVEL_2;
  1512. return set_lsp_gen_interval (vty, area, interval, level);
  1513. }
  1514. DEFUN (no_lsp_gen_interval_l2,
  1515. no_lsp_gen_interval_l2_cmd,
  1516. "no lsp-gen-interval level-2",
  1517. NO_STR
  1518. "Minimum interval between regenerating same LSP\n"
  1519. "Set interval for level 2 only\n")
  1520. {
  1521. struct isis_area *area;
  1522. uint16_t interval;
  1523. int level;
  1524. area = vty->index;
  1525. interval = DEFAULT_MIN_LSP_GEN_INTERVAL;
  1526. level = IS_LEVEL_2;
  1527. return set_lsp_gen_interval (vty, area, interval, level);
  1528. }
  1529. ALIAS (no_lsp_gen_interval_l2,
  1530. no_lsp_gen_interval_l2_arg_cmd,
  1531. "no lsp-gen-interval level-2 <1-120>",
  1532. NO_STR
  1533. "Minimum interval between regenerating same LSP\n"
  1534. "Set interval for level 2 only\n"
  1535. "Minimum interval in seconds\n")
  1536. DEFUN (spf_interval,
  1537. spf_interval_cmd,
  1538. "spf-interval <1-120>",
  1539. "Minimum interval between SPF calculations\n"
  1540. "Minimum interval between consecutive SPFs in seconds\n")
  1541. {
  1542. struct isis_area *area;
  1543. u_int16_t interval;
  1544. area = vty->index;
  1545. interval = atoi (argv[0]);
  1546. area->min_spf_interval[0] = interval;
  1547. area->min_spf_interval[1] = interval;
  1548. return CMD_SUCCESS;
  1549. }
  1550. DEFUN (no_spf_interval,
  1551. no_spf_interval_cmd,
  1552. "no spf-interval",
  1553. NO_STR
  1554. "Minimum interval between SPF calculations\n")
  1555. {
  1556. struct isis_area *area;
  1557. area = vty->index;
  1558. area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
  1559. area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
  1560. return CMD_SUCCESS;
  1561. }
  1562. ALIAS (no_spf_interval,
  1563. no_spf_interval_arg_cmd,
  1564. "no spf-interval <1-120>",
  1565. NO_STR
  1566. "Minimum interval between SPF calculations\n"
  1567. "Minimum interval between consecutive SPFs in seconds\n")
  1568. DEFUN (spf_interval_l1,
  1569. spf_interval_l1_cmd,
  1570. "spf-interval level-1 <1-120>",
  1571. "Minimum interval between SPF calculations\n"
  1572. "Set interval for level 1 only\n"
  1573. "Minimum interval between consecutive SPFs in seconds\n")
  1574. {
  1575. struct isis_area *area;
  1576. u_int16_t interval;
  1577. area = vty->index;
  1578. interval = atoi (argv[0]);
  1579. area->min_spf_interval[0] = interval;
  1580. return CMD_SUCCESS;
  1581. }
  1582. DEFUN (no_spf_interval_l1,
  1583. no_spf_interval_l1_cmd,
  1584. "no spf-interval level-1",
  1585. NO_STR
  1586. "Minimum interval between SPF calculations\n"
  1587. "Set interval for level 1 only\n")
  1588. {
  1589. struct isis_area *area;
  1590. area = vty->index;
  1591. area->min_spf_interval[0] = MINIMUM_SPF_INTERVAL;
  1592. return CMD_SUCCESS;
  1593. }
  1594. ALIAS (no_spf_interval,
  1595. no_spf_interval_l1_arg_cmd,
  1596. "no spf-interval level-1 <1-120>",
  1597. NO_STR
  1598. "Minimum interval between SPF calculations\n"
  1599. "Set interval for level 1 only\n"
  1600. "Minimum interval between consecutive SPFs in seconds\n")
  1601. DEFUN (spf_interval_l2,
  1602. spf_interval_l2_cmd,
  1603. "spf-interval level-2 <1-120>",
  1604. "Minimum interval between SPF calculations\n"
  1605. "Set interval for level 2 only\n"
  1606. "Minimum interval between consecutive SPFs in seconds\n")
  1607. {
  1608. struct isis_area *area;
  1609. u_int16_t interval;
  1610. area = vty->index;
  1611. interval = atoi (argv[0]);
  1612. area->min_spf_interval[1] = interval;
  1613. return CMD_SUCCESS;
  1614. }
  1615. DEFUN (no_spf_interval_l2,
  1616. no_spf_interval_l2_cmd,
  1617. "no spf-interval level-2",
  1618. NO_STR
  1619. "Minimum interval between SPF calculations\n"
  1620. "Set interval for level 2 only\n")
  1621. {
  1622. struct isis_area *area;
  1623. area = vty->index;
  1624. area->min_spf_interval[1] = MINIMUM_SPF_INTERVAL;
  1625. return CMD_SUCCESS;
  1626. }
  1627. ALIAS (no_spf_interval,
  1628. no_spf_interval_l2_arg_cmd,
  1629. "no spf-interval level-2 <1-120>",
  1630. NO_STR
  1631. "Minimum interval between SPF calculations\n"
  1632. "Set interval for level 2 only\n"
  1633. "Minimum interval between consecutive SPFs in seconds\n")
  1634. static int
  1635. area_max_lsp_lifetime_set(struct vty *vty, int level,
  1636. uint16_t interval)
  1637. {
  1638. struct isis_area *area = vty->index;
  1639. int lvl;
  1640. uint16_t refresh_interval = interval - 300;
  1641. int set_refresh_interval[ISIS_LEVELS] = {0, 0};
  1642. if (!area)
  1643. {
  1644. vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
  1645. return CMD_ERR_NO_MATCH;
  1646. }
  1647. for (lvl = IS_LEVEL_1; lvl <= IS_LEVEL_2; lvl++)
  1648. {
  1649. if (!(lvl & level))
  1650. continue;
  1651. if (refresh_interval < area->lsp_refresh[lvl-1])
  1652. {
  1653. vty_out (vty, "Level %d Max LSP lifetime %us must be 300s greater than "
  1654. "the configured LSP refresh interval %us%s",
  1655. lvl, interval, area->lsp_refresh[lvl-1], VTY_NEWLINE);
  1656. vty_out (vty, "Automatically reducing level %d LSP refresh interval "
  1657. "to %us%s", lvl, refresh_interval, VTY_NEWLINE);
  1658. set_refresh_interval[lvl-1] = 1;
  1659. if (refresh_interval <= area->lsp_gen_interval[lvl-1])
  1660. {
  1661. vty_out (vty, "LSP refresh interval %us must be greater than "
  1662. "the configured LSP gen interval %us%s",
  1663. refresh_interval, area->lsp_gen_interval[lvl-1],
  1664. VTY_NEWLINE);
  1665. return CMD_ERR_AMBIGUOUS;
  1666. }
  1667. }
  1668. }
  1669. for (lvl = IS_LEVEL_1; lvl <= IS_LEVEL_2; lvl++)
  1670. {
  1671. if (!(lvl & level))
  1672. continue;
  1673. isis_area_max_lsp_lifetime_set(area, lvl, interval);
  1674. if (set_refresh_interval[lvl-1])
  1675. isis_area_lsp_refresh_set(area, lvl, refresh_interval);
  1676. }
  1677. return CMD_SUCCESS;
  1678. }
  1679. DEFUN (max_lsp_lifetime,
  1680. max_lsp_lifetime_cmd,
  1681. "max-lsp-lifetime <350-65535>",
  1682. "Maximum LSP lifetime\n"
  1683. "LSP lifetime in seconds\n")
  1684. {
  1685. return area_max_lsp_lifetime_set(vty, IS_LEVEL_1_AND_2, atoi(argv[0]));
  1686. }
  1687. DEFUN (no_max_lsp_lifetime,
  1688. no_max_lsp_lifetime_cmd,
  1689. "no max-lsp-lifetime",
  1690. NO_STR
  1691. "LSP lifetime in seconds\n")
  1692. {
  1693. return area_max_lsp_lifetime_set(vty, IS_LEVEL_1_AND_2,
  1694. DEFAULT_LSP_LIFETIME);
  1695. }
  1696. ALIAS (no_max_lsp_lifetime,
  1697. no_max_lsp_lifetime_arg_cmd,
  1698. "no max-lsp-lifetime <350-65535>",
  1699. NO_STR
  1700. "Maximum LSP lifetime\n"
  1701. "LSP lifetime in seconds\n")
  1702. DEFUN (max_lsp_lifetime_l1,
  1703. max_lsp_lifetime_l1_cmd,
  1704. "max-lsp-lifetime level-1 <350-65535>",
  1705. "Maximum LSP lifetime for Level 1 only\n"
  1706. "LSP lifetime for Level 1 only in seconds\n")
  1707. {
  1708. return area_max_lsp_lifetime_set(vty, IS_LEVEL_1, atoi(argv[0]));
  1709. }
  1710. DEFUN (no_max_lsp_lifetime_l1,
  1711. no_max_lsp_lifetime_l1_cmd,
  1712. "no max-lsp-lifetime level-1",
  1713. NO_STR
  1714. "LSP lifetime for Level 1 only in seconds\n")
  1715. {
  1716. return area_max_lsp_lifetime_set(vty, IS_LEVEL_1, DEFAULT_LSP_LIFETIME);
  1717. }
  1718. ALIAS (no_max_lsp_lifetime_l1,
  1719. no_max_lsp_lifetime_l1_arg_cmd,
  1720. "no max-lsp-lifetime level-1 <350-65535>",
  1721. NO_STR
  1722. "Maximum LSP lifetime for Level 1 only\n"
  1723. "LSP lifetime for Level 1 only in seconds\n")
  1724. DEFUN (max_lsp_lifetime_l2,
  1725. max_lsp_lifetime_l2_cmd,
  1726. "max-lsp-lifetime level-2 <350-65535>",
  1727. "Maximum LSP lifetime for Level 2 only\n"
  1728. "LSP lifetime for Level 2 only in seconds\n")
  1729. {
  1730. return area_max_lsp_lifetime_set(vty, IS_LEVEL_2, atoi(argv[0]));
  1731. }
  1732. DEFUN (no_max_lsp_lifetime_l2,
  1733. no_max_lsp_lifetime_l2_cmd,
  1734. "no max-lsp-lifetime level-2",
  1735. NO_STR
  1736. "LSP lifetime for Level 2 only in seconds\n")
  1737. {
  1738. return area_max_lsp_lifetime_set(vty, IS_LEVEL_2, DEFAULT_LSP_LIFETIME);
  1739. }
  1740. ALIAS (no_max_lsp_lifetime_l2,
  1741. no_max_lsp_lifetime_l2_arg_cmd,
  1742. "no max-lsp-lifetime level-2 <350-65535>",
  1743. NO_STR
  1744. "Maximum LSP lifetime for Level 2 only\n"
  1745. "LSP lifetime for Level 2 only in seconds\n")
  1746. static int
  1747. area_lsp_refresh_interval_set(struct vty *vty, int level, uint16_t interval)
  1748. {
  1749. struct isis_area *area = vty->index;
  1750. int lvl;
  1751. if (!area)
  1752. {
  1753. vty_out (vty, "Can't find ISIS instance %s", VTY_NEWLINE);
  1754. return CMD_ERR_NO_MATCH;
  1755. }
  1756. for (lvl = IS_LEVEL_1; lvl <= IS_LEVEL_2; ++lvl)
  1757. {
  1758. if (!(lvl & level))
  1759. continue;
  1760. if (interval <= area->lsp_gen_interval[lvl-1])
  1761. {
  1762. vty_out (vty, "LSP refresh interval %us must be greater than "
  1763. "the configured LSP gen interval %us%s",
  1764. interval, area->lsp_gen_interval[lvl-1],
  1765. VTY_NEWLINE);
  1766. return CMD_ERR_AMBIGUOUS;
  1767. }
  1768. if (interval > (area->max_lsp_lifetime[lvl-1] - 300))
  1769. {
  1770. vty_out (vty, "LSP refresh interval %us must be less than "
  1771. "the configured LSP lifetime %us less 300%s",
  1772. interval, area->max_lsp_lifetime[lvl-1],
  1773. VTY_NEWLINE);
  1774. return CMD_ERR_AMBIGUOUS;
  1775. }
  1776. }
  1777. for (lvl = IS_LEVEL_1; lvl <= IS_LEVEL_2; ++lvl)
  1778. {
  1779. if (!(lvl & level))
  1780. continue;
  1781. isis_area_lsp_refresh_set(area, lvl, interval);
  1782. }
  1783. return CMD_SUCCESS;
  1784. }
  1785. DEFUN (lsp_refresh_interval,
  1786. lsp_refresh_interval_cmd,
  1787. "lsp-refresh-interval <1-65235>",
  1788. "LSP refresh interval\n"
  1789. "LSP refresh interval in seconds\n")
  1790. {
  1791. return area_lsp_refresh_interval_set(vty, IS_LEVEL_1_AND_2, atoi(argv[0]));
  1792. }
  1793. DEFUN (no_lsp_refresh_interval,
  1794. no_lsp_refresh_interval_cmd,
  1795. "no lsp-refresh-interval",
  1796. NO_STR
  1797. "LSP refresh interval in seconds\n")
  1798. {
  1799. return area_lsp_refresh_interval_set(vty, IS_LEVEL_1_AND_2,
  1800. DEFAULT_MAX_LSP_GEN_INTERVAL);
  1801. }
  1802. ALIAS (no_lsp_refresh_interval,
  1803. no_lsp_refresh_interval_arg_cmd,
  1804. "no lsp-refresh-interval <1-65235>",
  1805. NO_STR
  1806. "LSP refresh interval\n"
  1807. "LSP refresh interval in seconds\n")
  1808. DEFUN (lsp_refresh_interval_l1,
  1809. lsp_refresh_interval_l1_cmd,
  1810. "lsp-refresh-interval level-1 <1-65235>",
  1811. "LSP refresh interval for Level 1 only\n"
  1812. "LSP refresh interval for Level 1 only in seconds\n")
  1813. {
  1814. return area_lsp_refresh_interval_set(vty, IS_LEVEL_1, atoi(argv[0]));
  1815. }
  1816. DEFUN (no_lsp_refresh_interval_l1,
  1817. no_lsp_refresh_interval_l1_cmd,
  1818. "no lsp-refresh-interval level-1",
  1819. NO_STR
  1820. "LSP refresh interval for Level 1 only in seconds\n")
  1821. {
  1822. return area_lsp_refresh_interval_set(vty, IS_LEVEL_1,
  1823. DEFAULT_MAX_LSP_GEN_INTERVAL);
  1824. }
  1825. ALIAS (no_lsp_refresh_interval_l1,
  1826. no_lsp_refresh_interval_l1_arg_cmd,
  1827. "no lsp-refresh-interval level-1 <1-65235>",
  1828. NO_STR
  1829. "LSP refresh interval for Level 1 only\n"
  1830. "LSP refresh interval for Level 1 only in seconds\n")
  1831. DEFUN (lsp_refresh_interval_l2,
  1832. lsp_refresh_interval_l2_cmd,
  1833. "lsp-refresh-interval level-2 <1-65235>",
  1834. "LSP refresh interval for Level 2 only\n"
  1835. "LSP refresh interval for Level 2 only in seconds\n")
  1836. {
  1837. return area_lsp_refresh_interval_set(vty, IS_LEVEL_2, atoi(argv[0]));
  1838. }
  1839. DEFUN (no_lsp_refresh_interval_l2,
  1840. no_lsp_refresh_interval_l2_cmd,
  1841. "no lsp-refresh-interval level-2",
  1842. NO_STR
  1843. "LSP refresh interval for Level 2 only in seconds\n")
  1844. {
  1845. return area_lsp_refresh_interval_set(vty, IS_LEVEL_2,
  1846. DEFAULT_MAX_LSP_GEN_INTERVAL);
  1847. }
  1848. ALIAS (no_lsp_refresh_interval_l2,
  1849. no_lsp_refresh_interval_l2_arg_cmd,
  1850. "no lsp-refresh-interval level-2 <1-65235>",
  1851. NO_STR
  1852. "LSP refresh interval for Level 2 only\n"
  1853. "LSP refresh interval for Level 2 only in seconds\n")
  1854. static int
  1855. area_passwd_set(struct vty *vty, int level,
  1856. int (*type_set)(struct isis_area *area, int level,
  1857. const char *passwd, u_char snp_auth),
  1858. const char *passwd, u_char snp_auth)
  1859. {
  1860. struct isis_area *area = vty->index;
  1861. if (!area)
  1862. {
  1863. vty_out (vty, "Can't find IS-IS instance%s", VTY_NEWLINE);
  1864. return CMD_ERR_NO_MATCH;
  1865. }
  1866. if (passwd && strlen(passwd) > 254)
  1867. {
  1868. vty_out (vty, "Too long area password (>254)%s", VTY_NEWLINE);
  1869. return CMD_ERR_AMBIGUOUS;
  1870. }
  1871. type_set(area, level, passwd, snp_auth);
  1872. return CMD_SUCCESS;
  1873. }
  1874. DEFUN (area_passwd_md5,
  1875. area_passwd_md5_cmd,
  1876. "(area-password|domain-password) md5 WORD",
  1877. "Configure the authentication password for an area\n"
  1878. "Set the authentication password for a routing domain\n"
  1879. "Authentication type\n"
  1880. "Level-wide password\n")
  1881. {
  1882. u_char snp_auth = 0;
  1883. int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
  1884. if (argc > 2)
  1885. {
  1886. snp_auth = SNP_AUTH_SEND;
  1887. if (strncmp(argv[2], "v", 1) == 0)
  1888. snp_auth |= SNP_AUTH_RECV;
  1889. }
  1890. return area_passwd_set(vty, level, isis_area_passwd_hmac_md5_set,
  1891. argv[1], snp_auth);
  1892. }
  1893. ALIAS (area_passwd_md5,
  1894. area_passwd_md5_snpauth_cmd,
  1895. "(area-password|domain-password) md5 WORD authenticate snp (send-only|validate)",
  1896. "Configure the authentication password for an area\n"
  1897. "Set the authentication password for a routing domain\n"
  1898. "Authentication type\n"
  1899. "Level-wide password\n"
  1900. "Authentication\n"
  1901. "SNP PDUs\n"
  1902. "Send but do not check PDUs on receiving\n"
  1903. "Send and check PDUs on receiving\n")
  1904. DEFUN (area_passwd_clear,
  1905. area_passwd_clear_cmd,
  1906. "(area-password|domain-password) clear WORD",
  1907. "Configure the authentication password for an area\n"
  1908. "Set the authentication password for a routing domain\n"
  1909. "Authentication type\n"
  1910. "Area password\n")
  1911. {
  1912. u_char snp_auth = 0;
  1913. int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
  1914. if (argc > 2)
  1915. {
  1916. snp_auth = SNP_AUTH_SEND;
  1917. if (strncmp(argv[2], "v", 1) == 0)
  1918. snp_auth |= SNP_AUTH_RECV;
  1919. }
  1920. return area_passwd_set(vty, level, isis_area_passwd_cleartext_set,
  1921. argv[1], snp_auth);
  1922. }
  1923. ALIAS (area_passwd_clear,
  1924. area_passwd_clear_snpauth_cmd,
  1925. "(area-password|domain-password) clear WORD authenticate snp (send-only|validate)",
  1926. "Configure the authentication password for an area\n"
  1927. "Set the authentication password for a routing domain\n"
  1928. "Authentication type\n"
  1929. "Area password\n"
  1930. "Authentication\n"
  1931. "SNP PDUs\n"
  1932. "Send but do not check PDUs on receiving\n"
  1933. "Send and check PDUs on receiving\n")
  1934. DEFUN (no_area_passwd,
  1935. no_area_passwd_cmd,
  1936. "no (area-password|domain-password)",
  1937. NO_STR
  1938. "Configure the authentication password for an area\n"
  1939. "Set the authentication password for a routing domain\n")
  1940. {
  1941. int level = (argv[0][0] == 'd') ? IS_LEVEL_2 : IS_LEVEL_1;
  1942. struct isis_area *area = vty->index;
  1943. if (!area)
  1944. {
  1945. vty_out (vty, "Can't find IS-IS instance%s", VTY_NEWLINE);
  1946. return CMD_ERR_NO_MATCH;
  1947. }
  1948. return isis_area_passwd_unset (area, level);
  1949. }
  1950. void
  1951. isis_vty_init (void)
  1952. {
  1953. install_element (INTERFACE_NODE, &ip_router_isis_cmd);
  1954. install_element (INTERFACE_NODE, &no_ip_router_isis_cmd);
  1955. install_element (INTERFACE_NODE, &isis_passive_cmd);
  1956. install_element (INTERFACE_NODE, &no_isis_passive_cmd);
  1957. install_element (INTERFACE_NODE, &isis_circuit_type_cmd);
  1958. install_element (INTERFACE_NODE, &no_isis_circuit_type_cmd);
  1959. install_element (INTERFACE_NODE, &isis_network_cmd);
  1960. install_element (INTERFACE_NODE, &no_isis_network_cmd);
  1961. install_element (INTERFACE_NODE, &isis_passwd_cmd);
  1962. install_element (INTERFACE_NODE, &no_isis_passwd_cmd);
  1963. install_element (INTERFACE_NODE, &no_isis_passwd_arg_cmd);
  1964. install_element (INTERFACE_NODE, &isis_priority_cmd);
  1965. install_element (INTERFACE_NODE, &no_isis_priority_cmd);
  1966. install_element (INTERFACE_NODE, &no_isis_priority_arg_cmd);
  1967. install_element (INTERFACE_NODE, &isis_priority_l1_cmd);
  1968. install_element (INTERFACE_NODE, &no_isis_priority_l1_cmd);
  1969. install_element (INTERFACE_NODE, &no_isis_priority_l1_arg_cmd);
  1970. install_element (INTERFACE_NODE, &isis_priority_l2_cmd);
  1971. install_element (INTERFACE_NODE, &no_isis_priority_l2_cmd);
  1972. install_element (INTERFACE_NODE, &no_isis_priority_l2_arg_cmd);
  1973. install_element (INTERFACE_NODE, &isis_metric_cmd);
  1974. install_element (INTERFACE_NODE, &no_isis_metric_cmd);
  1975. install_element (INTERFACE_NODE, &no_isis_metric_arg_cmd);
  1976. install_element (INTERFACE_NODE, &isis_metric_l1_cmd);
  1977. install_element (INTERFACE_NODE, &no_isis_metric_l1_cmd);
  1978. install_element (INTERFACE_NODE, &no_isis_metric_l1_arg_cmd);
  1979. install_element (INTERFACE_NODE, &isis_metric_l2_cmd);
  1980. install_element (INTERFACE_NODE, &no_isis_metric_l2_cmd);
  1981. install_element (INTERFACE_NODE, &no_isis_metric_l2_arg_cmd);
  1982. install_element (INTERFACE_NODE, &isis_hello_interval_cmd);
  1983. install_element (INTERFACE_NODE, &no_isis_hello_interval_cmd);
  1984. install_element (INTERFACE_NODE, &no_isis_hello_interval_arg_cmd);
  1985. install_element (INTERFACE_NODE, &isis_hello_interval_l1_cmd);
  1986. install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_cmd);
  1987. install_element (INTERFACE_NODE, &no_isis_hello_interval_l1_arg_cmd);
  1988. install_element (INTERFACE_NODE, &isis_hello_interval_l2_cmd);
  1989. install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_cmd);
  1990. install_element (INTERFACE_NODE, &no_isis_hello_interval_l2_arg_cmd);
  1991. install_element (INTERFACE_NODE, &isis_hello_multiplier_cmd);
  1992. install_element (INTERFACE_NODE, &no_isis_hello_multiplier_cmd);
  1993. install_element (INTERFACE_NODE, &no_isis_hello_multiplier_arg_cmd);
  1994. install_element (INTERFACE_NODE, &isis_hello_multiplier_l1_cmd);
  1995. install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_cmd);
  1996. install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l1_arg_cmd);
  1997. install_element (INTERFACE_NODE, &isis_hello_multiplier_l2_cmd);
  1998. install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_cmd);
  1999. install_element (INTERFACE_NODE, &no_isis_hello_multiplier_l2_arg_cmd);
  2000. install_element (INTERFACE_NODE, &isis_hello_padding_cmd);
  2001. install_element (INTERFACE_NODE, &no_isis_hello_padding_cmd);
  2002. install_element (INTERFACE_NODE, &csnp_interval_cmd);
  2003. install_element (INTERFACE_NODE, &no_csnp_interval_cmd);
  2004. install_element (INTERFACE_NODE, &no_csnp_interval_arg_cmd);
  2005. install_element (INTERFACE_NODE, &csnp_interval_l1_cmd);
  2006. install_element (INTERFACE_NODE, &no_csnp_interval_l1_cmd);
  2007. install_element (INTERFACE_NODE, &no_csnp_interval_l1_arg_cmd);
  2008. install_element (INTERFACE_NODE, &csnp_interval_l2_cmd);
  2009. install_element (INTERFACE_NODE, &no_csnp_interval_l2_cmd);
  2010. install_element (INTERFACE_NODE, &no_csnp_interval_l2_arg_cmd);
  2011. install_element (INTERFACE_NODE, &psnp_interval_cmd);
  2012. install_element (INTERFACE_NODE, &no_psnp_interval_cmd);
  2013. install_element (INTERFACE_NODE, &no_psnp_interval_arg_cmd);
  2014. install_element (INTERFACE_NODE, &psnp_interval_l1_cmd);
  2015. install_element (INTERFACE_NODE, &no_psnp_interval_l1_cmd);
  2016. install_element (INTERFACE_NODE, &no_psnp_interval_l1_arg_cmd);
  2017. install_element (INTERFACE_NODE, &psnp_interval_l2_cmd);
  2018. install_element (INTERFACE_NODE, &no_psnp_interval_l2_cmd);
  2019. install_element (INTERFACE_NODE, &no_psnp_interval_l2_arg_cmd);
  2020. install_element (ISIS_NODE, &metric_style_cmd);
  2021. install_element (ISIS_NODE, &no_metric_style_cmd);
  2022. install_element (ISIS_NODE, &set_overload_bit_cmd);
  2023. install_element (ISIS_NODE, &no_set_overload_bit_cmd);
  2024. install_element (ISIS_NODE, &set_attached_bit_cmd);
  2025. install_element (ISIS_NODE, &no_set_attached_bit_cmd);
  2026. install_element (ISIS_NODE, &dynamic_hostname_cmd);
  2027. install_element (ISIS_NODE, &no_dynamic_hostname_cmd);
  2028. install_element (ISIS_NODE, &area_lsp_mtu_cmd);
  2029. install_element (ISIS_NODE, &no_area_lsp_mtu_cmd);
  2030. install_element (ISIS_NODE, &no_area_lsp_mtu_arg_cmd);
  2031. install_element (ISIS_NODE, &is_type_cmd);
  2032. install_element (ISIS_NODE, &no_is_type_cmd);
  2033. install_element (ISIS_NODE, &lsp_gen_interval_cmd);
  2034. install_element (ISIS_NODE, &no_lsp_gen_interval_cmd);
  2035. install_element (ISIS_NODE, &no_lsp_gen_interval_arg_cmd);
  2036. install_element (ISIS_NODE, &lsp_gen_interval_l1_cmd);
  2037. install_element (ISIS_NODE, &no_lsp_gen_interval_l1_cmd);
  2038. install_element (ISIS_NODE, &no_lsp_gen_interval_l1_arg_cmd);
  2039. install_element (ISIS_NODE, &lsp_gen_interval_l2_cmd);
  2040. install_element (ISIS_NODE, &no_lsp_gen_interval_l2_cmd);
  2041. install_element (ISIS_NODE, &no_lsp_gen_interval_l2_arg_cmd);
  2042. install_element (ISIS_NODE, &spf_interval_cmd);
  2043. install_element (ISIS_NODE, &no_spf_interval_cmd);
  2044. install_element (ISIS_NODE, &no_spf_interval_arg_cmd);
  2045. install_element (ISIS_NODE, &spf_interval_l1_cmd);
  2046. install_element (ISIS_NODE, &no_spf_interval_l1_cmd);
  2047. install_element (ISIS_NODE, &no_spf_interval_l1_arg_cmd);
  2048. install_element (ISIS_NODE, &spf_interval_l2_cmd);
  2049. install_element (ISIS_NODE, &no_spf_interval_l2_cmd);
  2050. install_element (ISIS_NODE, &no_spf_interval_l2_arg_cmd);
  2051. install_element (ISIS_NODE, &max_lsp_lifetime_cmd);
  2052. install_element (ISIS_NODE, &no_max_lsp_lifetime_cmd);
  2053. install_element (ISIS_NODE, &no_max_lsp_lifetime_arg_cmd);
  2054. install_element (ISIS_NODE, &max_lsp_lifetime_l1_cmd);
  2055. install_element (ISIS_NODE, &no_max_lsp_lifetime_l1_cmd);
  2056. install_element (ISIS_NODE, &no_max_lsp_lifetime_l1_arg_cmd);
  2057. install_element (ISIS_NODE, &max_lsp_lifetime_l2_cmd);
  2058. install_element (ISIS_NODE, &no_max_lsp_lifetime_l2_cmd);
  2059. install_element (ISIS_NODE, &no_max_lsp_lifetime_l2_arg_cmd);
  2060. install_element (ISIS_NODE, &lsp_refresh_interval_cmd);
  2061. install_element (ISIS_NODE, &no_lsp_refresh_interval_cmd);
  2062. install_element (ISIS_NODE, &no_lsp_refresh_interval_arg_cmd);
  2063. install_element (ISIS_NODE, &lsp_refresh_interval_l1_cmd);
  2064. install_element (ISIS_NODE, &no_lsp_refresh_interval_l1_cmd);
  2065. install_element (ISIS_NODE, &no_lsp_refresh_interval_l1_arg_cmd);
  2066. install_element (ISIS_NODE, &lsp_refresh_interval_l2_cmd);
  2067. install_element (ISIS_NODE, &no_lsp_refresh_interval_l2_cmd);
  2068. install_element (ISIS_NODE, &no_lsp_refresh_interval_l2_arg_cmd);
  2069. install_element (ISIS_NODE, &area_passwd_md5_cmd);
  2070. install_element (ISIS_NODE, &area_passwd_md5_snpauth_cmd);
  2071. install_element (ISIS_NODE, &area_passwd_clear_cmd);
  2072. install_element (ISIS_NODE, &area_passwd_clear_snpauth_cmd);
  2073. install_element (ISIS_NODE, &no_area_passwd_cmd);
  2074. }