tcpreplay_edit_opts.c 66 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009
  1. /* -*- buffer-read-only: t -*- vi: set ro:
  2. *
  3. * DO NOT EDIT THIS FILE (tcpreplay_edit_opts.c)
  4. *
  5. * It has been AutoGen-ed Monday June 9, 2008 at 11:05:43 AM PDT
  6. * From the definitions tcpreplay_opts.def
  7. * and the template file options
  8. *
  9. * Generated from AutoOpts 30:0:5 templates.
  10. */
  11. /*
  12. * This file was produced by an AutoOpts template. AutoOpts is a
  13. * copyrighted work. This source file is not encumbered by AutoOpts
  14. * licensing, but is provided under the licensing terms chosen by the
  15. * tcpreplay author or copyright holder. AutoOpts is licensed under
  16. * the terms of the LGPL. The redistributable library (``libopts'') is
  17. * licensed under the terms of either the LGPL or, at the users discretion,
  18. * the BSD license. See the AutoOpts and/or libopts sources for details.
  19. *
  20. * This source file is copyrighted and licensed under the following terms:
  21. *
  22. * tcpreplay copyright 2000-2008 Aaron Turner - all rights reserved
  23. *
  24. * tcpreplay is free software copyrighted by Aaron Turner.
  25. *
  26. * Redistribution and use in source and binary forms, with or without
  27. * modification, are permitted provided that the following conditions
  28. * are met:
  29. * 1. Redistributions of source code must retain the above copyright
  30. * notice, this list of conditions and the following disclaimer.
  31. * 2. Redistributions in binary form must reproduce the above copyright
  32. * notice, this list of conditions and the following disclaimer in the
  33. * documentation and/or other materials provided with the distribution.
  34. * 3. Neither the name ``Aaron Turner'' nor the name of any other
  35. * contributor may be used to endorse or promote products derived
  36. * from this software without specific prior written permission.
  37. *
  38. * tcpreplay IS PROVIDED BY Aaron Turner ``AS IS'' AND ANY EXPRESS
  39. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  40. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  41. * ARE DISCLAIMED. IN NO EVENT SHALL Aaron Turner OR ANY OTHER CONTRIBUTORS
  42. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  43. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  44. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  45. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  46. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  47. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  48. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  49. */
  50. #include <limits.h>
  51. #include <stdio.h>
  52. #define OPTION_CODE_COMPILE 1
  53. #include "tcpreplay_edit_opts.h"
  54. #ifdef __cplusplus
  55. extern "C" {
  56. #endif
  57. tSCC zCopyright[] =
  58. "tcpreplay copyright (c) 2000-2008 Aaron Turner, all rights reserved";
  59. tSCC zCopyrightNotice[] =
  60. "tcpreplay is free software copyrighted by Aaron Turner.\n\n\
  61. Redistribution and use in source and binary forms, with or without\n\
  62. modification, are permitted provided that the following conditions\n\
  63. are met:\n\
  64. 1. Redistributions of source code must retain the above copyright\n\
  65. notice, this list of conditions and the following disclaimer.\n\
  66. 2. Redistributions in binary form must reproduce the above copyright\n\
  67. notice, this list of conditions and the following disclaimer in the\n\
  68. documentation and/or other materials provided with the distribution.\n\
  69. 3. Neither the name ``Aaron Turner'' nor the name of any other\n\
  70. contributor may be used to endorse or promote products derived\n\
  71. from this software without specific prior written permission.\n\n\
  72. tcpreplay IS PROVIDED BY Aaron Turner ``AS IS'' AND ANY EXPRESS\n\
  73. OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\n\
  74. WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE\n\
  75. ARE DISCLAIMED. IN NO EVENT SHALL Aaron Turner OR ANY OTHER CONTRIBUTORS\n\
  76. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR\n\
  77. CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF\n\
  78. SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR\n\
  79. BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,\n\
  80. WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR\n\
  81. OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF\n\
  82. ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.";
  83. extern tUsageProc optionUsage;
  84. /*
  85. * global included definitions
  86. */
  87. #include "defines.h"
  88. #include "tcpreplay.h"
  89. #include "common.h"
  90. #include "config.h"
  91. #include <stdlib.h>
  92. #include <sys/types.h>
  93. #include <unistd.h>
  94. extern tcpreplay_opt_t options;
  95. #ifndef NULL
  96. # define NULL 0
  97. #endif
  98. #ifndef EXIT_SUCCESS
  99. # define EXIT_SUCCESS 0
  100. #endif
  101. #ifndef EXIT_FAILURE
  102. # define EXIT_FAILURE 1
  103. #endif
  104. /*
  105. * Tcpedit option description:
  106. */
  107. tSCC zTcpeditText[] =
  108. "";
  109. #define TCPEDIT_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT)
  110. /*
  111. * Portmap option description:
  112. */
  113. tSCC zPortmapText[] =
  114. "Rewrite TCP/UDP ports";
  115. tSCC zPortmap_NAME[] = "PORTMAP";
  116. tSCC zPortmap_Name[] = "portmap";
  117. #define PORTMAP_FLAGS (OPTST_DISABLED \
  118. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  119. /*
  120. * Seed option description:
  121. */
  122. tSCC zSeedText[] =
  123. "Randomize src/dst IP addresses w/ given seed";
  124. tSCC zSeed_NAME[] = "SEED";
  125. tSCC zSeed_Name[] = "seed";
  126. #define SEED_FLAGS (OPTST_DISABLED \
  127. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  128. /*
  129. * Pnat option description with
  130. * "Must also have options" and "Incompatible options":
  131. */
  132. tSCC zPnatText[] =
  133. "Rewrite IP addresses using pseudo-NAT";
  134. tSCC zPnat_NAME[] = "PNAT";
  135. tSCC zPnat_Name[] = "pnat";
  136. static const int
  137. aPnatCantList[] = {
  138. INDEX_OPT_SRCIPMAP, NO_EQUIVALENT };
  139. #define PNAT_FLAGS (OPTST_DISABLED | OPTST_STACKED \
  140. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  141. /*
  142. * Srcipmap option description with
  143. * "Must also have options" and "Incompatible options":
  144. */
  145. tSCC zSrcipmapText[] =
  146. "Rewrite source IP addresses using pseudo-NAT";
  147. tSCC zSrcipmap_NAME[] = "SRCIPMAP";
  148. tSCC zSrcipmap_Name[] = "srcipmap";
  149. static const int
  150. aSrcipmapCantList[] = {
  151. INDEX_OPT_PNAT, NO_EQUIVALENT };
  152. #define SRCIPMAP_FLAGS (OPTST_DISABLED \
  153. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  154. /*
  155. * Dstipmap option description with
  156. * "Must also have options" and "Incompatible options":
  157. */
  158. tSCC zDstipmapText[] =
  159. "Rewrite destination IP addresses using pseudo-NAT";
  160. tSCC zDstipmap_NAME[] = "DSTIPMAP";
  161. tSCC zDstipmap_Name[] = "dstipmap";
  162. static const int
  163. aDstipmapCantList[] = {
  164. INDEX_OPT_PNAT, NO_EQUIVALENT };
  165. #define DSTIPMAP_FLAGS (OPTST_DISABLED \
  166. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  167. /*
  168. * Endpoints option description with
  169. * "Must also have options" and "Incompatible options":
  170. */
  171. #ifdef HAVE_CACHEFILE_SUPPORT
  172. tSCC zEndpointsText[] =
  173. "Rewrite IP addresses to be between two endpoints";
  174. tSCC zEndpoints_NAME[] = "ENDPOINTS";
  175. tSCC zEndpoints_Name[] = "endpoints";
  176. static const int
  177. aEndpointsMustList[] = {
  178. INDEX_OPT_CACHEFILE, NO_EQUIVALENT };
  179. #define ENDPOINTS_FLAGS (OPTST_DISABLED \
  180. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  181. #else /* disable Endpoints */
  182. #define VALUE_OPT_ENDPOINTS NO_EQUIVALENT
  183. #define ENDPOINTS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  184. #define aEndpointsMustList NULL
  185. #define zEndpointsText NULL
  186. #define zEndpoints_NAME NULL
  187. #define zEndpoints_Name NULL
  188. #endif /* HAVE_CACHEFILE_SUPPORT */
  189. /*
  190. * Skipbroadcast option description:
  191. */
  192. tSCC zSkipbroadcastText[] =
  193. "Skip rewriting broadcast/multicast IP's";
  194. tSCC zSkipbroadcast_NAME[] = "SKIPBROADCAST";
  195. tSCC zSkipbroadcast_Name[] = "skipbroadcast";
  196. #define SKIPBROADCAST_FLAGS (OPTST_DISABLED)
  197. /*
  198. * Fixcsum option description:
  199. */
  200. tSCC zFixcsumText[] =
  201. "Force recalculation of IP/TCP/UDP checksums";
  202. tSCC zFixcsum_NAME[] = "FIXCSUM";
  203. tSCC zFixcsum_Name[] = "fixcsum";
  204. #define FIXCSUM_FLAGS (OPTST_DISABLED)
  205. /*
  206. * Mtu option description:
  207. */
  208. tSCC zMtuText[] =
  209. "Override default MTU length (1500 bytes)";
  210. tSCC zMtu_NAME[] = "MTU";
  211. tSCC zMtu_Name[] = "mtu";
  212. #define MTU_FLAGS (OPTST_DISABLED \
  213. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  214. /*
  215. * Efcs option description:
  216. */
  217. tSCC zEfcsText[] =
  218. "Remove Ethernet checksums (FCS) from end of frames";
  219. tSCC zEfcs_NAME[] = "EFCS";
  220. tSCC zEfcs_Name[] = "efcs";
  221. #define EFCS_FLAGS (OPTST_DISABLED)
  222. /*
  223. * Ttl option description:
  224. */
  225. tSCC zTtlText[] =
  226. "Modify the IPv4 TTL";
  227. tSCC zTtl_NAME[] = "TTL";
  228. tSCC zTtl_Name[] = "ttl";
  229. #define TTL_FLAGS (OPTST_DISABLED \
  230. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  231. /*
  232. * Fixlen option description:
  233. */
  234. tSCC zFixlenText[] =
  235. "Pad or truncate packet data to match header length";
  236. tSCC zFixlen_NAME[] = "FIXLEN";
  237. tSCC zFixlen_Name[] = "fixlen";
  238. #define FIXLEN_FLAGS (OPTST_DISABLED \
  239. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  240. /*
  241. * Skipl2broadcast option description:
  242. */
  243. tSCC zSkipl2broadcastText[] =
  244. "Skip rewriting broadcast/multicast Layer 2 addresses";
  245. tSCC zSkipl2broadcast_NAME[] = "SKIPL2BROADCAST";
  246. tSCC zSkipl2broadcast_Name[] = "skipl2broadcast";
  247. #define SKIPL2BROADCAST_FLAGS (OPTST_DISABLED)
  248. /*
  249. * Dlt option description:
  250. */
  251. tSCC zDltText[] =
  252. "Override output DLT encapsulation";
  253. tSCC zDlt_NAME[] = "DLT";
  254. tSCC zDlt_Name[] = "dlt";
  255. #define DLT_FLAGS (OPTST_DISABLED \
  256. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  257. /*
  258. * Enet_Dmac option description:
  259. */
  260. tSCC zEnet_DmacText[] =
  261. "Override destination ethernet MAC addresses";
  262. tSCC zEnet_Dmac_NAME[] = "ENET_DMAC";
  263. tSCC zEnet_Dmac_Name[] = "enet-dmac";
  264. #define ENET_DMAC_FLAGS (OPTST_DISABLED \
  265. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  266. /*
  267. * Enet_Smac option description:
  268. */
  269. tSCC zEnet_SmacText[] =
  270. "Override source ethernet MAC addresses";
  271. tSCC zEnet_Smac_NAME[] = "ENET_SMAC";
  272. tSCC zEnet_Smac_Name[] = "enet-smac";
  273. #define ENET_SMAC_FLAGS (OPTST_DISABLED \
  274. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  275. /*
  276. * Enet_Vlan option description:
  277. */
  278. tSCC zEnet_VlanText[] =
  279. "Specify ethernet 802.1q VLAN tag mode";
  280. tSCC zEnet_Vlan_NAME[] = "ENET_VLAN";
  281. tSCC zEnet_Vlan_Name[] = "enet-vlan";
  282. #define ENET_VLAN_FLAGS (OPTST_DISABLED \
  283. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  284. /*
  285. * Enet_Vlan_Tag option description with
  286. * "Must also have options" and "Incompatible options":
  287. */
  288. tSCC zEnet_Vlan_TagText[] =
  289. "Specify the new ethernet 802.1q VLAN tag value";
  290. tSCC zEnet_Vlan_Tag_NAME[] = "ENET_VLAN_TAG";
  291. tSCC zEnet_Vlan_Tag_Name[] = "enet-vlan-tag";
  292. static const int
  293. aEnet_Vlan_TagMustList[] = {
  294. INDEX_OPT_ENET_VLAN, NO_EQUIVALENT };
  295. #define ENET_VLAN_TAG_FLAGS (OPTST_DISABLED \
  296. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  297. /*
  298. * Enet_Vlan_Cfi option description with
  299. * "Must also have options" and "Incompatible options":
  300. */
  301. tSCC zEnet_Vlan_CfiText[] =
  302. "Specify the ethernet 802.1q VLAN CFI value";
  303. tSCC zEnet_Vlan_Cfi_NAME[] = "ENET_VLAN_CFI";
  304. tSCC zEnet_Vlan_Cfi_Name[] = "enet-vlan-cfi";
  305. static const int
  306. aEnet_Vlan_CfiMustList[] = {
  307. INDEX_OPT_ENET_VLAN, NO_EQUIVALENT };
  308. #define ENET_VLAN_CFI_FLAGS (OPTST_DISABLED \
  309. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  310. /*
  311. * Enet_Vlan_Pri option description with
  312. * "Must also have options" and "Incompatible options":
  313. */
  314. tSCC zEnet_Vlan_PriText[] =
  315. "Specify the ethernet 802.1q VLAN priority";
  316. tSCC zEnet_Vlan_Pri_NAME[] = "ENET_VLAN_PRI";
  317. tSCC zEnet_Vlan_Pri_Name[] = "enet-vlan-pri";
  318. static const int
  319. aEnet_Vlan_PriMustList[] = {
  320. INDEX_OPT_ENET_VLAN, NO_EQUIVALENT };
  321. #define ENET_VLAN_PRI_FLAGS (OPTST_DISABLED \
  322. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  323. /*
  324. * Hdlc_Control option description:
  325. */
  326. tSCC zHdlc_ControlText[] =
  327. "Specify HDLC control value";
  328. tSCC zHdlc_Control_NAME[] = "HDLC_CONTROL";
  329. tSCC zHdlc_Control_Name[] = "hdlc-control";
  330. #define HDLC_CONTROL_FLAGS (OPTST_DISABLED \
  331. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  332. /*
  333. * Hdlc_Address option description:
  334. */
  335. tSCC zHdlc_AddressText[] =
  336. "Specify HDLC address";
  337. tSCC zHdlc_Address_NAME[] = "HDLC_ADDRESS";
  338. tSCC zHdlc_Address_Name[] = "hdlc-address";
  339. #define HDLC_ADDRESS_FLAGS (OPTST_DISABLED \
  340. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  341. /*
  342. * User_Dlt option description:
  343. */
  344. tSCC zUser_DltText[] =
  345. "Set output file DLT type";
  346. tSCC zUser_Dlt_NAME[] = "USER_DLT";
  347. tSCC zUser_Dlt_Name[] = "user-dlt";
  348. #define USER_DLT_FLAGS (OPTST_DISABLED \
  349. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  350. /*
  351. * User_Dlink option description:
  352. */
  353. tSCC zUser_DlinkText[] =
  354. "Rewrite Data-Link layer with user specified data";
  355. tSCC zUser_Dlink_NAME[] = "USER_DLINK";
  356. tSCC zUser_Dlink_Name[] = "user-dlink";
  357. #define USER_DLINK_FLAGS (OPTST_DISABLED | OPTST_STACKED \
  358. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  359. /*
  360. * Dbug option description:
  361. */
  362. #ifdef DEBUG
  363. tSCC zDbugText[] =
  364. "Enable debugging output";
  365. tSCC zDbug_NAME[] = "DBUG";
  366. tSCC zDbug_Name[] = "dbug";
  367. #define zDbugDefaultArg ((char const*)0)
  368. #define DBUG_FLAGS (OPTST_DISABLED | OPTST_IMM \
  369. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  370. #else /* disable Dbug */
  371. #define VALUE_OPT_DBUG NO_EQUIVALENT
  372. #define DBUG_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  373. #define zDbugDefaultArg NULL
  374. #define zDbugText NULL
  375. #define zDbug_NAME NULL
  376. #define zDbug_Name NULL
  377. #endif /* DEBUG */
  378. /*
  379. * Quiet option description:
  380. */
  381. tSCC zQuietText[] =
  382. "Quiet mode";
  383. tSCC zQuiet_NAME[] = "QUIET";
  384. tSCC zQuiet_Name[] = "quiet";
  385. #define QUIET_FLAGS (OPTST_DISABLED)
  386. /*
  387. * Timer option description:
  388. */
  389. tSCC zTimerText[] =
  390. "Select packet timing mode: select, ioport, rdtsc, gtod, nano, abstime";
  391. tSCC zTimer_NAME[] = "TIMER";
  392. tSCC zTimer_Name[] = "timer";
  393. tSCC zTimerDefaultArg[] = "gtod";
  394. #define TIMER_FLAGS (OPTST_DISABLED \
  395. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  396. /*
  397. * Sleep_Accel option description:
  398. */
  399. tSCC zSleep_AccelText[] =
  400. "Reduce the amount of time to sleep by specified usec";
  401. tSCC zSleep_Accel_NAME[] = "SLEEP_ACCEL";
  402. tSCC zSleep_Accel_Name[] = "sleep-accel";
  403. #define zSleep_AccelDefaultArg ((char const*)0)
  404. #define SLEEP_ACCEL_FLAGS (OPTST_DISABLED \
  405. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  406. /*
  407. * Rdtsc_Clicks option description:
  408. */
  409. tSCC zRdtsc_ClicksText[] =
  410. "Specify the RDTSC clicks/usec";
  411. tSCC zRdtsc_Clicks_NAME[] = "RDTSC_CLICKS";
  412. tSCC zRdtsc_Clicks_Name[] = "rdtsc-clicks";
  413. #define zRdtsc_ClicksDefaultArg ((char const*)0)
  414. #define RDTSC_CLICKS_FLAGS (OPTST_DISABLED \
  415. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  416. /*
  417. * Verbose option description:
  418. */
  419. #ifdef ENABLE_VERBOSE
  420. tSCC zVerboseText[] =
  421. "Print decoded packets via tcpdump to STDOUT";
  422. tSCC zVerbose_NAME[] = "VERBOSE";
  423. tSCC zVerbose_Name[] = "verbose";
  424. #define VERBOSE_FLAGS (OPTST_DISABLED | OPTST_IMM)
  425. #else /* disable Verbose */
  426. #define VALUE_OPT_VERBOSE NO_EQUIVALENT
  427. #define VERBOSE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  428. #define zVerboseText NULL
  429. #define zVerbose_NAME NULL
  430. #define zVerbose_Name NULL
  431. #endif /* ENABLE_VERBOSE */
  432. /*
  433. * Decode option description with
  434. * "Must also have options" and "Incompatible options":
  435. */
  436. #ifdef ENABLE_VERBOSE
  437. tSCC zDecodeText[] =
  438. "Arguments passed to tcpdump decoder";
  439. tSCC zDecode_NAME[] = "DECODE";
  440. tSCC zDecode_Name[] = "decode";
  441. static const int
  442. aDecodeMustList[] = {
  443. INDEX_OPT_VERBOSE, NO_EQUIVALENT };
  444. #define DECODE_FLAGS (OPTST_DISABLED \
  445. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  446. #else /* disable Decode */
  447. #define VALUE_OPT_DECODE NO_EQUIVALENT
  448. #define DECODE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  449. #define aDecodeMustList NULL
  450. #define zDecodeText NULL
  451. #define zDecode_NAME NULL
  452. #define zDecode_Name NULL
  453. #endif /* ENABLE_VERBOSE */
  454. /*
  455. * Enable_File_Cache option description with
  456. * "Must also have options" and "Incompatible options":
  457. */
  458. tSCC zEnable_File_CacheText[] =
  459. "Enable caching of packets to internal memory";
  460. tSCC zEnable_File_Cache_NAME[] = "ENABLE_FILE_CACHE";
  461. tSCC zEnable_File_Cache_Name[] = "enable-file-cache";
  462. static const int
  463. aEnable_File_CacheMustList[] = {
  464. INDEX_OPT_LOOP, NO_EQUIVALENT };
  465. #define ENABLE_FILE_CACHE_FLAGS (OPTST_DISABLED)
  466. /*
  467. * Cachefile option description:
  468. */
  469. tSCC zCachefileText[] =
  470. "Split traffic via a tcpprep cache file";
  471. tSCC zCachefile_NAME[] = "CACHEFILE";
  472. tSCC zCachefile_Name[] = "cachefile";
  473. #define CACHEFILE_FLAGS (OPTST_DISABLED \
  474. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  475. /*
  476. * Intf1 option description:
  477. */
  478. tSCC zIntf1Text[] =
  479. "Server/primary traffic output interface";
  480. tSCC zIntf1_NAME[] = "INTF1";
  481. tSCC zIntf1_Name[] = "intf1";
  482. #define INTF1_FLAGS (OPTST_DISABLED | OPTST_MUST_SET \
  483. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  484. /*
  485. * Intf2 option description with
  486. * "Must also have options" and "Incompatible options":
  487. */
  488. tSCC zIntf2Text[] =
  489. "Client/secondary traffic output interface";
  490. tSCC zIntf2_NAME[] = "INTF2";
  491. tSCC zIntf2_Name[] = "intf2";
  492. static const int
  493. aIntf2MustList[] = {
  494. INDEX_OPT_CACHEFILE, NO_EQUIVALENT };
  495. #define INTF2_FLAGS (OPTST_DISABLED \
  496. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  497. /*
  498. * Listnics option description:
  499. */
  500. #ifdef ENABLE_PCAP_FINDALLDEVS
  501. tSCC zListnicsText[] =
  502. "List available network interfaces and exit";
  503. tSCC zListnics_NAME[] = "LISTNICS";
  504. tSCC zListnics_Name[] = "listnics";
  505. #define LISTNICS_FLAGS (OPTST_DISABLED | OPTST_IMM)
  506. #else /* disable Listnics */
  507. #define VALUE_OPT_LISTNICS NO_EQUIVALENT
  508. #define LISTNICS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  509. #define zListnicsText NULL
  510. #define zListnics_NAME NULL
  511. #define zListnics_Name NULL
  512. #endif /* ENABLE_PCAP_FINDALLDEVS */
  513. /*
  514. * Loop option description:
  515. */
  516. tSCC zLoopText[] =
  517. "Loop through the capture file X times";
  518. tSCC zLoop_NAME[] = "LOOP";
  519. tSCC zLoop_Name[] = "loop";
  520. #define zLoopDefaultArg ((char const*)1)
  521. #define LOOP_FLAGS (OPTST_DISABLED \
  522. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  523. /*
  524. * Pktlen option description:
  525. */
  526. tSCC zPktlenText[] =
  527. "Override the snaplen and use the actual packet len";
  528. tSCC zPktlen_NAME[] = "PKTLEN";
  529. tSCC zPktlen_Name[] = "pktlen";
  530. #define PKTLEN_FLAGS (OPTST_DISABLED)
  531. /*
  532. * Limit option description:
  533. */
  534. tSCC zLimitText[] =
  535. "Limit the number of packets to send";
  536. tSCC zLimit_NAME[] = "LIMIT";
  537. tSCC zLimit_Name[] = "limit";
  538. #define zLimitDefaultArg ((char const*)-1)
  539. #define LIMIT_FLAGS (OPTST_DISABLED \
  540. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  541. /*
  542. * Multiplier option description with
  543. * "Must also have options" and "Incompatible options":
  544. */
  545. tSCC zMultiplierText[] =
  546. "Modify replay speed to a given multiple";
  547. tSCC zMultiplier_NAME[] = "MULTIPLIER";
  548. tSCC zMultiplier_Name[] = "multiplier";
  549. static const int
  550. aMultiplierCantList[] = {
  551. INDEX_OPT_PPS,
  552. INDEX_OPT_MBPS,
  553. INDEX_OPT_ONEATATIME,
  554. INDEX_OPT_TOPSPEED, NO_EQUIVALENT };
  555. #define MULTIPLIER_FLAGS (OPTST_DISABLED \
  556. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  557. /*
  558. * Pps option description with
  559. * "Must also have options" and "Incompatible options":
  560. */
  561. tSCC zPpsText[] =
  562. "Replay packets at a given packets/sec";
  563. tSCC zPps_NAME[] = "PPS";
  564. tSCC zPps_Name[] = "pps";
  565. static const int
  566. aPpsCantList[] = {
  567. INDEX_OPT_MULTIPLIER,
  568. INDEX_OPT_MBPS,
  569. INDEX_OPT_ONEATATIME,
  570. INDEX_OPT_TOPSPEED, NO_EQUIVALENT };
  571. #define PPS_FLAGS (OPTST_DISABLED \
  572. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  573. /*
  574. * Mbps option description with
  575. * "Must also have options" and "Incompatible options":
  576. */
  577. tSCC zMbpsText[] =
  578. "Replay packets at a given Mbps";
  579. tSCC zMbps_NAME[] = "MBPS";
  580. tSCC zMbps_Name[] = "mbps";
  581. static const int
  582. aMbpsCantList[] = {
  583. INDEX_OPT_MULTIPLIER,
  584. INDEX_OPT_PPS,
  585. INDEX_OPT_ONEATATIME,
  586. INDEX_OPT_TOPSPEED, NO_EQUIVALENT };
  587. #define MBPS_FLAGS (OPTST_DISABLED \
  588. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  589. /*
  590. * Topspeed option description with
  591. * "Must also have options" and "Incompatible options":
  592. */
  593. tSCC zTopspeedText[] =
  594. "Replay packets as fast as possible";
  595. tSCC zTopspeed_NAME[] = "TOPSPEED";
  596. tSCC zTopspeed_Name[] = "topspeed";
  597. static const int
  598. aTopspeedCantList[] = {
  599. INDEX_OPT_MBPS,
  600. INDEX_OPT_MULTIPLIER,
  601. INDEX_OPT_PPS,
  602. INDEX_OPT_ONEATATIME, NO_EQUIVALENT };
  603. #define TOPSPEED_FLAGS (OPTST_DISABLED)
  604. /*
  605. * Oneatatime option description with
  606. * "Must also have options" and "Incompatible options":
  607. */
  608. tSCC zOneatatimeText[] =
  609. "Replay one packet at a time for each user input";
  610. tSCC zOneatatime_NAME[] = "ONEATATIME";
  611. tSCC zOneatatime_Name[] = "oneatatime";
  612. static const int
  613. aOneatatimeCantList[] = {
  614. INDEX_OPT_MBPS,
  615. INDEX_OPT_PPS,
  616. INDEX_OPT_MULTIPLIER,
  617. INDEX_OPT_TOPSPEED, NO_EQUIVALENT };
  618. #define ONEATATIME_FLAGS (OPTST_DISABLED)
  619. /*
  620. * Pid option description:
  621. */
  622. tSCC zPidText[] =
  623. "Print the PID of tcpreplay at startup";
  624. tSCC zPid_NAME[] = "PID";
  625. tSCC zPid_Name[] = "pid";
  626. #define PID_FLAGS (OPTST_DISABLED)
  627. /*
  628. * Version option description:
  629. */
  630. tSCC zVersionText[] =
  631. "Print version information";
  632. tSCC zVersion_NAME[] = "VERSION";
  633. tSCC zVersion_Name[] = "version";
  634. #define VERSION_FLAGS (OPTST_DISABLED)
  635. /*
  636. * Less_Help option description:
  637. */
  638. tSCC zLess_HelpText[] =
  639. "Display less usage information and exit";
  640. tSCC zLess_Help_NAME[] = "LESS_HELP";
  641. tSCC zLess_Help_Name[] = "less-help";
  642. #define LESS_HELP_FLAGS (OPTST_DISABLED | OPTST_IMM)
  643. /*
  644. * Help/More_Help option descriptions:
  645. */
  646. tSCC zHelpText[] = "Display usage information and exit";
  647. tSCC zHelp_Name[] = "help";
  648. tSCC zMore_HelpText[] = "Extended usage information passed thru pager";
  649. tSCC zMore_Help_Name[] = "more-help";
  650. /*
  651. * Save/Load_Opts option description:
  652. */
  653. tSCC zSave_OptsText[] = "Save the option state to a config file";
  654. tSCC zSave_Opts_Name[] = "save-opts";
  655. tSCC zLoad_OptsText[] = "Load options from a config file";
  656. tSCC zLoad_Opts_NAME[] = "LOAD_OPTS";
  657. tSCC zNotLoad_Opts_Name[] = "no-load-opts";
  658. tSCC zNotLoad_Opts_Pfx[] = "no";
  659. #define zLoad_Opts_Name (zNotLoad_Opts_Name + 3)
  660. /*
  661. * Declare option callback procedures
  662. */
  663. #ifdef DEBUG
  664. static tOptProc doOptDbug;
  665. #else /* not DEBUG */
  666. # define doOptDbug NULL
  667. #endif /* def/not DEBUG */
  668. #ifdef ENABLE_PCAP_FINDALLDEVS
  669. static tOptProc doOptListnics;
  670. #else /* not ENABLE_PCAP_FINDALLDEVS */
  671. # define doOptListnics NULL
  672. #endif /* def/not ENABLE_PCAP_FINDALLDEVS */
  673. extern tOptProc
  674. optionNumericVal, optionPagedUsage, optionStackArg;
  675. static tOptProc
  676. doOptEnet_Vlan_Cfi, doOptEnet_Vlan_Pri, doOptEnet_Vlan_Tag,
  677. doOptLess_Help, doOptLimit, doOptLoop,
  678. doOptMtu, doOptPid, doOptVersion,
  679. doUsageOpt;
  680. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  681. *
  682. * Define the Tcpreplay Option Descriptions.
  683. */
  684. static tOptDesc optDesc[ OPTION_CT ] = {
  685. { /* entry idx, value */ 0, 0,
  686. /* equiv idx, value */ 0, 0,
  687. /* equivalenced to */ NO_EQUIVALENT,
  688. /* min, max, act ct */ 0, 0, 0,
  689. /* opt state flags */ TCPEDIT_FLAGS, 0,
  690. /* last opt argumnt */ { NULL },
  691. /* arg list/cookie */ NULL,
  692. /* must/cannot opts */ NULL, NULL,
  693. /* option proc */ NULL,
  694. /* desc, NAME, name */ zTcpeditText, NULL, NULL,
  695. /* disablement strs */ NULL, NULL },
  696. { /* entry idx, value */ 1, VALUE_OPT_PORTMAP,
  697. /* equiv idx, value */ 1, VALUE_OPT_PORTMAP,
  698. /* equivalenced to */ NO_EQUIVALENT,
  699. /* min, max, act ct */ 0, 1, 0,
  700. /* opt state flags */ PORTMAP_FLAGS, 0,
  701. /* last opt argumnt */ { NULL },
  702. /* arg list/cookie */ NULL,
  703. /* must/cannot opts */ NULL, NULL,
  704. /* option proc */ NULL,
  705. /* desc, NAME, name */ zPortmapText, zPortmap_NAME, zPortmap_Name,
  706. /* disablement strs */ NULL, NULL },
  707. { /* entry idx, value */ 2, VALUE_OPT_SEED,
  708. /* equiv idx, value */ 2, VALUE_OPT_SEED,
  709. /* equivalenced to */ NO_EQUIVALENT,
  710. /* min, max, act ct */ 0, 1, 0,
  711. /* opt state flags */ SEED_FLAGS, 0,
  712. /* last opt argumnt */ { NULL },
  713. /* arg list/cookie */ NULL,
  714. /* must/cannot opts */ NULL, NULL,
  715. /* option proc */ optionNumericVal,
  716. /* desc, NAME, name */ zSeedText, zSeed_NAME, zSeed_Name,
  717. /* disablement strs */ NULL, NULL },
  718. { /* entry idx, value */ 3, VALUE_OPT_PNAT,
  719. /* equiv idx, value */ 3, VALUE_OPT_PNAT,
  720. /* equivalenced to */ NO_EQUIVALENT,
  721. /* min, max, act ct */ 0, 2, 0,
  722. /* opt state flags */ PNAT_FLAGS, 0,
  723. /* last opt argumnt */ { NULL },
  724. /* arg list/cookie */ NULL,
  725. /* must/cannot opts */ NULL, aPnatCantList,
  726. /* option proc */ optionStackArg,
  727. /* desc, NAME, name */ zPnatText, zPnat_NAME, zPnat_Name,
  728. /* disablement strs */ NULL, NULL },
  729. { /* entry idx, value */ 4, VALUE_OPT_SRCIPMAP,
  730. /* equiv idx, value */ 4, VALUE_OPT_SRCIPMAP,
  731. /* equivalenced to */ NO_EQUIVALENT,
  732. /* min, max, act ct */ 0, 1, 0,
  733. /* opt state flags */ SRCIPMAP_FLAGS, 0,
  734. /* last opt argumnt */ { NULL },
  735. /* arg list/cookie */ NULL,
  736. /* must/cannot opts */ NULL, aSrcipmapCantList,
  737. /* option proc */ NULL,
  738. /* desc, NAME, name */ zSrcipmapText, zSrcipmap_NAME, zSrcipmap_Name,
  739. /* disablement strs */ NULL, NULL },
  740. { /* entry idx, value */ 5, VALUE_OPT_DSTIPMAP,
  741. /* equiv idx, value */ 5, VALUE_OPT_DSTIPMAP,
  742. /* equivalenced to */ NO_EQUIVALENT,
  743. /* min, max, act ct */ 0, 1, 0,
  744. /* opt state flags */ DSTIPMAP_FLAGS, 0,
  745. /* last opt argumnt */ { NULL },
  746. /* arg list/cookie */ NULL,
  747. /* must/cannot opts */ NULL, aDstipmapCantList,
  748. /* option proc */ NULL,
  749. /* desc, NAME, name */ zDstipmapText, zDstipmap_NAME, zDstipmap_Name,
  750. /* disablement strs */ NULL, NULL },
  751. { /* entry idx, value */ 6, VALUE_OPT_ENDPOINTS,
  752. /* equiv idx, value */ 6, VALUE_OPT_ENDPOINTS,
  753. /* equivalenced to */ NO_EQUIVALENT,
  754. /* min, max, act ct */ 0, 1, 0,
  755. /* opt state flags */ ENDPOINTS_FLAGS, 0,
  756. /* last opt argumnt */ { NULL },
  757. /* arg list/cookie */ NULL,
  758. /* must/cannot opts */ aEndpointsMustList, NULL,
  759. /* option proc */ NULL,
  760. /* desc, NAME, name */ zEndpointsText, zEndpoints_NAME, zEndpoints_Name,
  761. /* disablement strs */ NULL, NULL },
  762. { /* entry idx, value */ 7, VALUE_OPT_SKIPBROADCAST,
  763. /* equiv idx, value */ 7, VALUE_OPT_SKIPBROADCAST,
  764. /* equivalenced to */ NO_EQUIVALENT,
  765. /* min, max, act ct */ 0, 1, 0,
  766. /* opt state flags */ SKIPBROADCAST_FLAGS, 0,
  767. /* last opt argumnt */ { NULL },
  768. /* arg list/cookie */ NULL,
  769. /* must/cannot opts */ NULL, NULL,
  770. /* option proc */ NULL,
  771. /* desc, NAME, name */ zSkipbroadcastText, zSkipbroadcast_NAME, zSkipbroadcast_Name,
  772. /* disablement strs */ NULL, NULL },
  773. { /* entry idx, value */ 8, VALUE_OPT_FIXCSUM,
  774. /* equiv idx, value */ 8, VALUE_OPT_FIXCSUM,
  775. /* equivalenced to */ NO_EQUIVALENT,
  776. /* min, max, act ct */ 0, 1, 0,
  777. /* opt state flags */ FIXCSUM_FLAGS, 0,
  778. /* last opt argumnt */ { NULL },
  779. /* arg list/cookie */ NULL,
  780. /* must/cannot opts */ NULL, NULL,
  781. /* option proc */ NULL,
  782. /* desc, NAME, name */ zFixcsumText, zFixcsum_NAME, zFixcsum_Name,
  783. /* disablement strs */ NULL, NULL },
  784. { /* entry idx, value */ 9, VALUE_OPT_MTU,
  785. /* equiv idx, value */ 9, VALUE_OPT_MTU,
  786. /* equivalenced to */ NO_EQUIVALENT,
  787. /* min, max, act ct */ 0, 1, 0,
  788. /* opt state flags */ MTU_FLAGS, 0,
  789. /* last opt argumnt */ { NULL },
  790. /* arg list/cookie */ NULL,
  791. /* must/cannot opts */ NULL, NULL,
  792. /* option proc */ doOptMtu,
  793. /* desc, NAME, name */ zMtuText, zMtu_NAME, zMtu_Name,
  794. /* disablement strs */ NULL, NULL },
  795. { /* entry idx, value */ 10, VALUE_OPT_EFCS,
  796. /* equiv idx, value */ 10, VALUE_OPT_EFCS,
  797. /* equivalenced to */ NO_EQUIVALENT,
  798. /* min, max, act ct */ 0, 1, 0,
  799. /* opt state flags */ EFCS_FLAGS, 0,
  800. /* last opt argumnt */ { NULL },
  801. /* arg list/cookie */ NULL,
  802. /* must/cannot opts */ NULL, NULL,
  803. /* option proc */ NULL,
  804. /* desc, NAME, name */ zEfcsText, zEfcs_NAME, zEfcs_Name,
  805. /* disablement strs */ NULL, NULL },
  806. { /* entry idx, value */ 11, VALUE_OPT_TTL,
  807. /* equiv idx, value */ 11, VALUE_OPT_TTL,
  808. /* equivalenced to */ NO_EQUIVALENT,
  809. /* min, max, act ct */ 0, 1, 0,
  810. /* opt state flags */ TTL_FLAGS, 0,
  811. /* last opt argumnt */ { NULL },
  812. /* arg list/cookie */ NULL,
  813. /* must/cannot opts */ NULL, NULL,
  814. /* option proc */ NULL,
  815. /* desc, NAME, name */ zTtlText, zTtl_NAME, zTtl_Name,
  816. /* disablement strs */ NULL, NULL },
  817. { /* entry idx, value */ 12, VALUE_OPT_FIXLEN,
  818. /* equiv idx, value */ 12, VALUE_OPT_FIXLEN,
  819. /* equivalenced to */ NO_EQUIVALENT,
  820. /* min, max, act ct */ 0, 1, 0,
  821. /* opt state flags */ FIXLEN_FLAGS, 0,
  822. /* last opt argumnt */ { NULL },
  823. /* arg list/cookie */ NULL,
  824. /* must/cannot opts */ NULL, NULL,
  825. /* option proc */ NULL,
  826. /* desc, NAME, name */ zFixlenText, zFixlen_NAME, zFixlen_Name,
  827. /* disablement strs */ NULL, NULL },
  828. { /* entry idx, value */ 13, VALUE_OPT_SKIPL2BROADCAST,
  829. /* equiv idx, value */ 13, VALUE_OPT_SKIPL2BROADCAST,
  830. /* equivalenced to */ NO_EQUIVALENT,
  831. /* min, max, act ct */ 0, 1, 0,
  832. /* opt state flags */ SKIPL2BROADCAST_FLAGS, 0,
  833. /* last opt argumnt */ { NULL },
  834. /* arg list/cookie */ NULL,
  835. /* must/cannot opts */ NULL, NULL,
  836. /* option proc */ NULL,
  837. /* desc, NAME, name */ zSkipl2broadcastText, zSkipl2broadcast_NAME, zSkipl2broadcast_Name,
  838. /* disablement strs */ NULL, NULL },
  839. { /* entry idx, value */ 14, VALUE_OPT_DLT,
  840. /* equiv idx, value */ 14, VALUE_OPT_DLT,
  841. /* equivalenced to */ NO_EQUIVALENT,
  842. /* min, max, act ct */ 0, 1, 0,
  843. /* opt state flags */ DLT_FLAGS, 0,
  844. /* last opt argumnt */ { NULL },
  845. /* arg list/cookie */ NULL,
  846. /* must/cannot opts */ NULL, NULL,
  847. /* option proc */ NULL,
  848. /* desc, NAME, name */ zDltText, zDlt_NAME, zDlt_Name,
  849. /* disablement strs */ NULL, NULL },
  850. { /* entry idx, value */ 15, VALUE_OPT_ENET_DMAC,
  851. /* equiv idx, value */ 15, VALUE_OPT_ENET_DMAC,
  852. /* equivalenced to */ NO_EQUIVALENT,
  853. /* min, max, act ct */ 0, 1, 0,
  854. /* opt state flags */ ENET_DMAC_FLAGS, 0,
  855. /* last opt argumnt */ { NULL },
  856. /* arg list/cookie */ NULL,
  857. /* must/cannot opts */ NULL, NULL,
  858. /* option proc */ NULL,
  859. /* desc, NAME, name */ zEnet_DmacText, zEnet_Dmac_NAME, zEnet_Dmac_Name,
  860. /* disablement strs */ NULL, NULL },
  861. { /* entry idx, value */ 16, VALUE_OPT_ENET_SMAC,
  862. /* equiv idx, value */ 16, VALUE_OPT_ENET_SMAC,
  863. /* equivalenced to */ NO_EQUIVALENT,
  864. /* min, max, act ct */ 0, 1, 0,
  865. /* opt state flags */ ENET_SMAC_FLAGS, 0,
  866. /* last opt argumnt */ { NULL },
  867. /* arg list/cookie */ NULL,
  868. /* must/cannot opts */ NULL, NULL,
  869. /* option proc */ NULL,
  870. /* desc, NAME, name */ zEnet_SmacText, zEnet_Smac_NAME, zEnet_Smac_Name,
  871. /* disablement strs */ NULL, NULL },
  872. { /* entry idx, value */ 17, VALUE_OPT_ENET_VLAN,
  873. /* equiv idx, value */ 17, VALUE_OPT_ENET_VLAN,
  874. /* equivalenced to */ NO_EQUIVALENT,
  875. /* min, max, act ct */ 0, 1, 0,
  876. /* opt state flags */ ENET_VLAN_FLAGS, 0,
  877. /* last opt argumnt */ { NULL },
  878. /* arg list/cookie */ NULL,
  879. /* must/cannot opts */ NULL, NULL,
  880. /* option proc */ NULL,
  881. /* desc, NAME, name */ zEnet_VlanText, zEnet_Vlan_NAME, zEnet_Vlan_Name,
  882. /* disablement strs */ NULL, NULL },
  883. { /* entry idx, value */ 18, VALUE_OPT_ENET_VLAN_TAG,
  884. /* equiv idx, value */ 18, VALUE_OPT_ENET_VLAN_TAG,
  885. /* equivalenced to */ NO_EQUIVALENT,
  886. /* min, max, act ct */ 0, 1, 0,
  887. /* opt state flags */ ENET_VLAN_TAG_FLAGS, 0,
  888. /* last opt argumnt */ { NULL },
  889. /* arg list/cookie */ NULL,
  890. /* must/cannot opts */ aEnet_Vlan_TagMustList, NULL,
  891. /* option proc */ doOptEnet_Vlan_Tag,
  892. /* desc, NAME, name */ zEnet_Vlan_TagText, zEnet_Vlan_Tag_NAME, zEnet_Vlan_Tag_Name,
  893. /* disablement strs */ NULL, NULL },
  894. { /* entry idx, value */ 19, VALUE_OPT_ENET_VLAN_CFI,
  895. /* equiv idx, value */ 19, VALUE_OPT_ENET_VLAN_CFI,
  896. /* equivalenced to */ NO_EQUIVALENT,
  897. /* min, max, act ct */ 0, 1, 0,
  898. /* opt state flags */ ENET_VLAN_CFI_FLAGS, 0,
  899. /* last opt argumnt */ { NULL },
  900. /* arg list/cookie */ NULL,
  901. /* must/cannot opts */ aEnet_Vlan_CfiMustList, NULL,
  902. /* option proc */ doOptEnet_Vlan_Cfi,
  903. /* desc, NAME, name */ zEnet_Vlan_CfiText, zEnet_Vlan_Cfi_NAME, zEnet_Vlan_Cfi_Name,
  904. /* disablement strs */ NULL, NULL },
  905. { /* entry idx, value */ 20, VALUE_OPT_ENET_VLAN_PRI,
  906. /* equiv idx, value */ 20, VALUE_OPT_ENET_VLAN_PRI,
  907. /* equivalenced to */ NO_EQUIVALENT,
  908. /* min, max, act ct */ 0, 1, 0,
  909. /* opt state flags */ ENET_VLAN_PRI_FLAGS, 0,
  910. /* last opt argumnt */ { NULL },
  911. /* arg list/cookie */ NULL,
  912. /* must/cannot opts */ aEnet_Vlan_PriMustList, NULL,
  913. /* option proc */ doOptEnet_Vlan_Pri,
  914. /* desc, NAME, name */ zEnet_Vlan_PriText, zEnet_Vlan_Pri_NAME, zEnet_Vlan_Pri_Name,
  915. /* disablement strs */ NULL, NULL },
  916. { /* entry idx, value */ 21, VALUE_OPT_HDLC_CONTROL,
  917. /* equiv idx, value */ 21, VALUE_OPT_HDLC_CONTROL,
  918. /* equivalenced to */ NO_EQUIVALENT,
  919. /* min, max, act ct */ 0, 1, 0,
  920. /* opt state flags */ HDLC_CONTROL_FLAGS, 0,
  921. /* last opt argumnt */ { NULL },
  922. /* arg list/cookie */ NULL,
  923. /* must/cannot opts */ NULL, NULL,
  924. /* option proc */ optionNumericVal,
  925. /* desc, NAME, name */ zHdlc_ControlText, zHdlc_Control_NAME, zHdlc_Control_Name,
  926. /* disablement strs */ NULL, NULL },
  927. { /* entry idx, value */ 22, VALUE_OPT_HDLC_ADDRESS,
  928. /* equiv idx, value */ 22, VALUE_OPT_HDLC_ADDRESS,
  929. /* equivalenced to */ NO_EQUIVALENT,
  930. /* min, max, act ct */ 0, 1, 0,
  931. /* opt state flags */ HDLC_ADDRESS_FLAGS, 0,
  932. /* last opt argumnt */ { NULL },
  933. /* arg list/cookie */ NULL,
  934. /* must/cannot opts */ NULL, NULL,
  935. /* option proc */ optionNumericVal,
  936. /* desc, NAME, name */ zHdlc_AddressText, zHdlc_Address_NAME, zHdlc_Address_Name,
  937. /* disablement strs */ NULL, NULL },
  938. { /* entry idx, value */ 23, VALUE_OPT_USER_DLT,
  939. /* equiv idx, value */ 23, VALUE_OPT_USER_DLT,
  940. /* equivalenced to */ NO_EQUIVALENT,
  941. /* min, max, act ct */ 0, 1, 0,
  942. /* opt state flags */ USER_DLT_FLAGS, 0,
  943. /* last opt argumnt */ { NULL },
  944. /* arg list/cookie */ NULL,
  945. /* must/cannot opts */ NULL, NULL,
  946. /* option proc */ optionNumericVal,
  947. /* desc, NAME, name */ zUser_DltText, zUser_Dlt_NAME, zUser_Dlt_Name,
  948. /* disablement strs */ NULL, NULL },
  949. { /* entry idx, value */ 24, VALUE_OPT_USER_DLINK,
  950. /* equiv idx, value */ 24, VALUE_OPT_USER_DLINK,
  951. /* equivalenced to */ NO_EQUIVALENT,
  952. /* min, max, act ct */ 0, 2, 0,
  953. /* opt state flags */ USER_DLINK_FLAGS, 0,
  954. /* last opt argumnt */ { NULL },
  955. /* arg list/cookie */ NULL,
  956. /* must/cannot opts */ NULL, NULL,
  957. /* option proc */ optionStackArg,
  958. /* desc, NAME, name */ zUser_DlinkText, zUser_Dlink_NAME, zUser_Dlink_Name,
  959. /* disablement strs */ NULL, NULL },
  960. { /* entry idx, value */ 25, VALUE_OPT_DBUG,
  961. /* equiv idx, value */ 25, VALUE_OPT_DBUG,
  962. /* equivalenced to */ NO_EQUIVALENT,
  963. /* min, max, act ct */ 0, 1, 0,
  964. /* opt state flags */ DBUG_FLAGS, 0,
  965. /* last opt argumnt */ { zDbugDefaultArg },
  966. /* arg list/cookie */ NULL,
  967. /* must/cannot opts */ NULL, NULL,
  968. /* option proc */ doOptDbug,
  969. /* desc, NAME, name */ zDbugText, zDbug_NAME, zDbug_Name,
  970. /* disablement strs */ NULL, NULL },
  971. { /* entry idx, value */ 26, VALUE_OPT_QUIET,
  972. /* equiv idx, value */ 26, VALUE_OPT_QUIET,
  973. /* equivalenced to */ NO_EQUIVALENT,
  974. /* min, max, act ct */ 0, 1, 0,
  975. /* opt state flags */ QUIET_FLAGS, 0,
  976. /* last opt argumnt */ { NULL },
  977. /* arg list/cookie */ NULL,
  978. /* must/cannot opts */ NULL, NULL,
  979. /* option proc */ NULL,
  980. /* desc, NAME, name */ zQuietText, zQuiet_NAME, zQuiet_Name,
  981. /* disablement strs */ NULL, NULL },
  982. { /* entry idx, value */ 27, VALUE_OPT_TIMER,
  983. /* equiv idx, value */ 27, VALUE_OPT_TIMER,
  984. /* equivalenced to */ NO_EQUIVALENT,
  985. /* min, max, act ct */ 0, 1, 0,
  986. /* opt state flags */ TIMER_FLAGS, 0,
  987. /* last opt argumnt */ { zTimerDefaultArg },
  988. /* arg list/cookie */ NULL,
  989. /* must/cannot opts */ NULL, NULL,
  990. /* option proc */ NULL,
  991. /* desc, NAME, name */ zTimerText, zTimer_NAME, zTimer_Name,
  992. /* disablement strs */ NULL, NULL },
  993. { /* entry idx, value */ 28, VALUE_OPT_SLEEP_ACCEL,
  994. /* equiv idx, value */ 28, VALUE_OPT_SLEEP_ACCEL,
  995. /* equivalenced to */ NO_EQUIVALENT,
  996. /* min, max, act ct */ 0, 1, 0,
  997. /* opt state flags */ SLEEP_ACCEL_FLAGS, 0,
  998. /* last opt argumnt */ { zSleep_AccelDefaultArg },
  999. /* arg list/cookie */ NULL,
  1000. /* must/cannot opts */ NULL, NULL,
  1001. /* option proc */ optionNumericVal,
  1002. /* desc, NAME, name */ zSleep_AccelText, zSleep_Accel_NAME, zSleep_Accel_Name,
  1003. /* disablement strs */ NULL, NULL },
  1004. { /* entry idx, value */ 29, VALUE_OPT_RDTSC_CLICKS,
  1005. /* equiv idx, value */ 29, VALUE_OPT_RDTSC_CLICKS,
  1006. /* equivalenced to */ NO_EQUIVALENT,
  1007. /* min, max, act ct */ 0, 1, 0,
  1008. /* opt state flags */ RDTSC_CLICKS_FLAGS, 0,
  1009. /* last opt argumnt */ { zRdtsc_ClicksDefaultArg },
  1010. /* arg list/cookie */ NULL,
  1011. /* must/cannot opts */ NULL, NULL,
  1012. /* option proc */ optionNumericVal,
  1013. /* desc, NAME, name */ zRdtsc_ClicksText, zRdtsc_Clicks_NAME, zRdtsc_Clicks_Name,
  1014. /* disablement strs */ NULL, NULL },
  1015. { /* entry idx, value */ 30, VALUE_OPT_VERBOSE,
  1016. /* equiv idx, value */ 30, VALUE_OPT_VERBOSE,
  1017. /* equivalenced to */ NO_EQUIVALENT,
  1018. /* min, max, act ct */ 0, 1, 0,
  1019. /* opt state flags */ VERBOSE_FLAGS, 0,
  1020. /* last opt argumnt */ { NULL },
  1021. /* arg list/cookie */ NULL,
  1022. /* must/cannot opts */ NULL, NULL,
  1023. /* option proc */ NULL,
  1024. /* desc, NAME, name */ zVerboseText, zVerbose_NAME, zVerbose_Name,
  1025. /* disablement strs */ NULL, NULL },
  1026. { /* entry idx, value */ 31, VALUE_OPT_DECODE,
  1027. /* equiv idx, value */ 31, VALUE_OPT_DECODE,
  1028. /* equivalenced to */ NO_EQUIVALENT,
  1029. /* min, max, act ct */ 0, 1, 0,
  1030. /* opt state flags */ DECODE_FLAGS, 0,
  1031. /* last opt argumnt */ { NULL },
  1032. /* arg list/cookie */ NULL,
  1033. /* must/cannot opts */ aDecodeMustList, NULL,
  1034. /* option proc */ NULL,
  1035. /* desc, NAME, name */ zDecodeText, zDecode_NAME, zDecode_Name,
  1036. /* disablement strs */ NULL, NULL },
  1037. { /* entry idx, value */ 32, VALUE_OPT_ENABLE_FILE_CACHE,
  1038. /* equiv idx, value */ 32, VALUE_OPT_ENABLE_FILE_CACHE,
  1039. /* equivalenced to */ NO_EQUIVALENT,
  1040. /* min, max, act ct */ 0, 1, 0,
  1041. /* opt state flags */ ENABLE_FILE_CACHE_FLAGS, 0,
  1042. /* last opt argumnt */ { NULL },
  1043. /* arg list/cookie */ NULL,
  1044. /* must/cannot opts */ aEnable_File_CacheMustList, NULL,
  1045. /* option proc */ NULL,
  1046. /* desc, NAME, name */ zEnable_File_CacheText, zEnable_File_Cache_NAME, zEnable_File_Cache_Name,
  1047. /* disablement strs */ NULL, NULL },
  1048. { /* entry idx, value */ 33, VALUE_OPT_CACHEFILE,
  1049. /* equiv idx, value */ 33, VALUE_OPT_CACHEFILE,
  1050. /* equivalenced to */ NO_EQUIVALENT,
  1051. /* min, max, act ct */ 0, 1, 0,
  1052. /* opt state flags */ CACHEFILE_FLAGS, 0,
  1053. /* last opt argumnt */ { NULL },
  1054. /* arg list/cookie */ NULL,
  1055. /* must/cannot opts */ NULL, NULL,
  1056. /* option proc */ NULL,
  1057. /* desc, NAME, name */ zCachefileText, zCachefile_NAME, zCachefile_Name,
  1058. /* disablement strs */ NULL, NULL },
  1059. { /* entry idx, value */ 34, VALUE_OPT_INTF1,
  1060. /* equiv idx, value */ 34, VALUE_OPT_INTF1,
  1061. /* equivalenced to */ NO_EQUIVALENT,
  1062. /* min, max, act ct */ 1, 1, 0,
  1063. /* opt state flags */ INTF1_FLAGS, 0,
  1064. /* last opt argumnt */ { NULL },
  1065. /* arg list/cookie */ NULL,
  1066. /* must/cannot opts */ NULL, NULL,
  1067. /* option proc */ NULL,
  1068. /* desc, NAME, name */ zIntf1Text, zIntf1_NAME, zIntf1_Name,
  1069. /* disablement strs */ NULL, NULL },
  1070. { /* entry idx, value */ 35, VALUE_OPT_INTF2,
  1071. /* equiv idx, value */ 35, VALUE_OPT_INTF2,
  1072. /* equivalenced to */ NO_EQUIVALENT,
  1073. /* min, max, act ct */ 0, 1, 0,
  1074. /* opt state flags */ INTF2_FLAGS, 0,
  1075. /* last opt argumnt */ { NULL },
  1076. /* arg list/cookie */ NULL,
  1077. /* must/cannot opts */ aIntf2MustList, NULL,
  1078. /* option proc */ NULL,
  1079. /* desc, NAME, name */ zIntf2Text, zIntf2_NAME, zIntf2_Name,
  1080. /* disablement strs */ NULL, NULL },
  1081. { /* entry idx, value */ 36, VALUE_OPT_LISTNICS,
  1082. /* equiv idx, value */ 36, VALUE_OPT_LISTNICS,
  1083. /* equivalenced to */ NO_EQUIVALENT,
  1084. /* min, max, act ct */ 0, 1, 0,
  1085. /* opt state flags */ LISTNICS_FLAGS, 0,
  1086. /* last opt argumnt */ { NULL },
  1087. /* arg list/cookie */ NULL,
  1088. /* must/cannot opts */ NULL, NULL,
  1089. /* option proc */ doOptListnics,
  1090. /* desc, NAME, name */ zListnicsText, zListnics_NAME, zListnics_Name,
  1091. /* disablement strs */ NULL, NULL },
  1092. { /* entry idx, value */ 37, VALUE_OPT_LOOP,
  1093. /* equiv idx, value */ 37, VALUE_OPT_LOOP,
  1094. /* equivalenced to */ NO_EQUIVALENT,
  1095. /* min, max, act ct */ 0, 1, 0,
  1096. /* opt state flags */ LOOP_FLAGS, 0,
  1097. /* last opt argumnt */ { zLoopDefaultArg },
  1098. /* arg list/cookie */ NULL,
  1099. /* must/cannot opts */ NULL, NULL,
  1100. /* option proc */ doOptLoop,
  1101. /* desc, NAME, name */ zLoopText, zLoop_NAME, zLoop_Name,
  1102. /* disablement strs */ NULL, NULL },
  1103. { /* entry idx, value */ 38, VALUE_OPT_PKTLEN,
  1104. /* equiv idx, value */ 38, VALUE_OPT_PKTLEN,
  1105. /* equivalenced to */ NO_EQUIVALENT,
  1106. /* min, max, act ct */ 0, 1, 0,
  1107. /* opt state flags */ PKTLEN_FLAGS, 0,
  1108. /* last opt argumnt */ { NULL },
  1109. /* arg list/cookie */ NULL,
  1110. /* must/cannot opts */ NULL, NULL,
  1111. /* option proc */ NULL,
  1112. /* desc, NAME, name */ zPktlenText, zPktlen_NAME, zPktlen_Name,
  1113. /* disablement strs */ NULL, NULL },
  1114. { /* entry idx, value */ 39, VALUE_OPT_LIMIT,
  1115. /* equiv idx, value */ 39, VALUE_OPT_LIMIT,
  1116. /* equivalenced to */ NO_EQUIVALENT,
  1117. /* min, max, act ct */ 0, 1, 0,
  1118. /* opt state flags */ LIMIT_FLAGS, 0,
  1119. /* last opt argumnt */ { zLimitDefaultArg },
  1120. /* arg list/cookie */ NULL,
  1121. /* must/cannot opts */ NULL, NULL,
  1122. /* option proc */ doOptLimit,
  1123. /* desc, NAME, name */ zLimitText, zLimit_NAME, zLimit_Name,
  1124. /* disablement strs */ NULL, NULL },
  1125. { /* entry idx, value */ 40, VALUE_OPT_MULTIPLIER,
  1126. /* equiv idx, value */ 40, VALUE_OPT_MULTIPLIER,
  1127. /* equivalenced to */ NO_EQUIVALENT,
  1128. /* min, max, act ct */ 0, 1, 0,
  1129. /* opt state flags */ MULTIPLIER_FLAGS, 0,
  1130. /* last opt argumnt */ { NULL },
  1131. /* arg list/cookie */ NULL,
  1132. /* must/cannot opts */ NULL, aMultiplierCantList,
  1133. /* option proc */ NULL,
  1134. /* desc, NAME, name */ zMultiplierText, zMultiplier_NAME, zMultiplier_Name,
  1135. /* disablement strs */ NULL, NULL },
  1136. { /* entry idx, value */ 41, VALUE_OPT_PPS,
  1137. /* equiv idx, value */ 41, VALUE_OPT_PPS,
  1138. /* equivalenced to */ NO_EQUIVALENT,
  1139. /* min, max, act ct */ 0, 1, 0,
  1140. /* opt state flags */ PPS_FLAGS, 0,
  1141. /* last opt argumnt */ { NULL },
  1142. /* arg list/cookie */ NULL,
  1143. /* must/cannot opts */ NULL, aPpsCantList,
  1144. /* option proc */ optionNumericVal,
  1145. /* desc, NAME, name */ zPpsText, zPps_NAME, zPps_Name,
  1146. /* disablement strs */ NULL, NULL },
  1147. { /* entry idx, value */ 42, VALUE_OPT_MBPS,
  1148. /* equiv idx, value */ 42, VALUE_OPT_MBPS,
  1149. /* equivalenced to */ NO_EQUIVALENT,
  1150. /* min, max, act ct */ 0, 1, 0,
  1151. /* opt state flags */ MBPS_FLAGS, 0,
  1152. /* last opt argumnt */ { NULL },
  1153. /* arg list/cookie */ NULL,
  1154. /* must/cannot opts */ NULL, aMbpsCantList,
  1155. /* option proc */ NULL,
  1156. /* desc, NAME, name */ zMbpsText, zMbps_NAME, zMbps_Name,
  1157. /* disablement strs */ NULL, NULL },
  1158. { /* entry idx, value */ 43, VALUE_OPT_TOPSPEED,
  1159. /* equiv idx, value */ 43, VALUE_OPT_TOPSPEED,
  1160. /* equivalenced to */ NO_EQUIVALENT,
  1161. /* min, max, act ct */ 0, 1, 0,
  1162. /* opt state flags */ TOPSPEED_FLAGS, 0,
  1163. /* last opt argumnt */ { NULL },
  1164. /* arg list/cookie */ NULL,
  1165. /* must/cannot opts */ NULL, aTopspeedCantList,
  1166. /* option proc */ NULL,
  1167. /* desc, NAME, name */ zTopspeedText, zTopspeed_NAME, zTopspeed_Name,
  1168. /* disablement strs */ NULL, NULL },
  1169. { /* entry idx, value */ 44, VALUE_OPT_ONEATATIME,
  1170. /* equiv idx, value */ 44, VALUE_OPT_ONEATATIME,
  1171. /* equivalenced to */ NO_EQUIVALENT,
  1172. /* min, max, act ct */ 0, 1, 0,
  1173. /* opt state flags */ ONEATATIME_FLAGS, 0,
  1174. /* last opt argumnt */ { NULL },
  1175. /* arg list/cookie */ NULL,
  1176. /* must/cannot opts */ NULL, aOneatatimeCantList,
  1177. /* option proc */ NULL,
  1178. /* desc, NAME, name */ zOneatatimeText, zOneatatime_NAME, zOneatatime_Name,
  1179. /* disablement strs */ NULL, NULL },
  1180. { /* entry idx, value */ 45, VALUE_OPT_PID,
  1181. /* equiv idx, value */ 45, VALUE_OPT_PID,
  1182. /* equivalenced to */ NO_EQUIVALENT,
  1183. /* min, max, act ct */ 0, 1, 0,
  1184. /* opt state flags */ PID_FLAGS, 0,
  1185. /* last opt argumnt */ { NULL },
  1186. /* arg list/cookie */ NULL,
  1187. /* must/cannot opts */ NULL, NULL,
  1188. /* option proc */ doOptPid,
  1189. /* desc, NAME, name */ zPidText, zPid_NAME, zPid_Name,
  1190. /* disablement strs */ NULL, NULL },
  1191. { /* entry idx, value */ 46, VALUE_OPT_VERSION,
  1192. /* equiv idx, value */ 46, VALUE_OPT_VERSION,
  1193. /* equivalenced to */ NO_EQUIVALENT,
  1194. /* min, max, act ct */ 0, 1, 0,
  1195. /* opt state flags */ VERSION_FLAGS, 0,
  1196. /* last opt argumnt */ { NULL },
  1197. /* arg list/cookie */ NULL,
  1198. /* must/cannot opts */ NULL, NULL,
  1199. /* option proc */ doOptVersion,
  1200. /* desc, NAME, name */ zVersionText, zVersion_NAME, zVersion_Name,
  1201. /* disablement strs */ NULL, NULL },
  1202. { /* entry idx, value */ 47, VALUE_OPT_LESS_HELP,
  1203. /* equiv idx, value */ 47, VALUE_OPT_LESS_HELP,
  1204. /* equivalenced to */ NO_EQUIVALENT,
  1205. /* min, max, act ct */ 0, 1, 0,
  1206. /* opt state flags */ LESS_HELP_FLAGS, 0,
  1207. /* last opt argumnt */ { NULL },
  1208. /* arg list/cookie */ NULL,
  1209. /* must/cannot opts */ NULL, NULL,
  1210. /* option proc */ doOptLess_Help,
  1211. /* desc, NAME, name */ zLess_HelpText, zLess_Help_NAME, zLess_Help_Name,
  1212. /* disablement strs */ NULL, NULL },
  1213. { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
  1214. /* equiv idx value */ NO_EQUIVALENT, 0,
  1215. /* equivalenced to */ NO_EQUIVALENT,
  1216. /* min, max, act ct */ 0, 1, 0,
  1217. /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
  1218. /* last opt argumnt */ { NULL },
  1219. /* arg list/cookie */ NULL,
  1220. /* must/cannot opts */ NULL, NULL,
  1221. /* option proc */ doUsageOpt,
  1222. /* desc, NAME, name */ zHelpText, NULL, zHelp_Name,
  1223. /* disablement strs */ NULL, NULL },
  1224. { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
  1225. /* equiv idx value */ NO_EQUIVALENT, 0,
  1226. /* equivalenced to */ NO_EQUIVALENT,
  1227. /* min, max, act ct */ 0, 1, 0,
  1228. /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, 0,
  1229. /* last opt argumnt */ { NULL },
  1230. /* arg list/cookie */ NULL,
  1231. /* must/cannot opts */ NULL, NULL,
  1232. /* option proc */ optionPagedUsage,
  1233. /* desc, NAME, name */ zMore_HelpText, NULL, zMore_Help_Name,
  1234. /* disablement strs */ NULL, NULL },
  1235. { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
  1236. /* equiv idx value */ NO_EQUIVALENT, 0,
  1237. /* equivalenced to */ NO_EQUIVALENT,
  1238. /* min, max, act ct */ 0, 1, 0,
  1239. /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
  1240. | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, 0,
  1241. /* last opt argumnt */ { NULL },
  1242. /* arg list/cookie */ NULL,
  1243. /* must/cannot opts */ NULL, NULL,
  1244. /* option proc */ NULL,
  1245. /* desc, NAME, name */ zSave_OptsText, NULL, zSave_Opts_Name,
  1246. /* disablement strs */ NULL, NULL },
  1247. { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
  1248. /* equiv idx value */ NO_EQUIVALENT, 0,
  1249. /* equivalenced to */ NO_EQUIVALENT,
  1250. /* min, max, act ct */ 0, NOLIMIT, 0,
  1251. /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING) \
  1252. | OPTST_DISABLE_IMM, 0,
  1253. /* last opt argumnt */ { NULL },
  1254. /* arg list/cookie */ NULL,
  1255. /* must/cannot opts */ NULL, NULL,
  1256. /* option proc */ optionLoadOpt,
  1257. /* desc, NAME, name */ zLoad_OptsText, zLoad_Opts_NAME, zLoad_Opts_Name,
  1258. /* disablement strs */ zNotLoad_Opts_Name, zNotLoad_Opts_Pfx }
  1259. };
  1260. tOptDesc * const tcpedit_tcpedit_optDesc_p = optDesc + 0;
  1261. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
  1262. *
  1263. * Define the Tcpreplay Option Environment
  1264. */
  1265. tSCC zPROGNAME[] = "TCPREPLAY";
  1266. tSCC zUsageTitle[] =
  1267. "tcpreplay (tcpreplay) - Replay network traffic stored in pcap files\n\
  1268. USAGE: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <pcap_file(s)>\n";
  1269. tSCC zRcName[] = ".tcpreplayrc";
  1270. tSCC* apzHomeList[] = {
  1271. "$$/",
  1272. NULL };
  1273. #define zBugsAddr NULL
  1274. tSCC zExplain[] = "\n\
  1275. tcpreplay is a tool for replaying network traffic from files saved with\n\
  1276. tcpdump or other tools which write pcap(3) files.\n";
  1277. tSCC zDetail[] = "\n\
  1278. The basic operation of tcpreplay is to resend all packets from the\n\
  1279. input file(s) at the speed at which they were recorded, or a specified \n\
  1280. data rate, up to as fast as the hardware is capable.\n\n\
  1281. Optionally, the traffic can be split between two interfaces, written to\n\
  1282. files, filtered and edited in various ways, providing the means to test\n\
  1283. firewalls, NIDS and other network devices.\n\n\
  1284. For more details, please see the Tcpreplay Manual at:\n\
  1285. http://tcpreplay.synfin.net/trac/wiki/manual\n";
  1286. #define zFullVersion NULL
  1287. /* extracted from /opt/local/share/autogen/optcode.tpl near line 428 */
  1288. #if defined(ENABLE_NLS)
  1289. # define OPTPROC_BASE OPTPROC_TRANSLATE
  1290. static tOptionXlateProc translate_option_strings;
  1291. #else
  1292. # define OPTPROC_BASE OPTPROC_NONE
  1293. # define translate_option_strings NULL
  1294. #endif /* ENABLE_NLS */
  1295. #define tcpreplay_full_usage NULL
  1296. #define tcpreplay_short_usage NULL
  1297. tOptions tcpreplayOptions = {
  1298. OPTIONS_STRUCT_VERSION,
  1299. 0, NULL, /* original argc + argv */
  1300. ( OPTPROC_BASE
  1301. + OPTPROC_ERRSTOP
  1302. + OPTPROC_SHORTOPT
  1303. + OPTPROC_LONGOPT
  1304. + OPTPROC_NO_REQ_OPT
  1305. + OPTPROC_ARGS_REQ
  1306. + OPTPROC_GNUUSAGE
  1307. + OPTPROC_HAS_IMMED ),
  1308. 0, NULL, /* current option index, current option */
  1309. NULL, NULL, zPROGNAME,
  1310. zRcName, zCopyright, zCopyrightNotice,
  1311. zFullVersion, apzHomeList, zUsageTitle,
  1312. zExplain, zDetail, optDesc,
  1313. zBugsAddr, /* address to send bugs to */
  1314. NULL, NULL, /* extensions/saved state */
  1315. optionUsage, /* usage procedure */
  1316. translate_option_strings, /* translation procedure */
  1317. /*
  1318. * Indexes to special options
  1319. */
  1320. { INDEX_OPT_MORE_HELP,
  1321. INDEX_OPT_SAVE_OPTS,
  1322. NO_EQUIVALENT /* index of '-#' option */,
  1323. 9 /* index of default opt */
  1324. },
  1325. 52 /* full option count */, 48 /* user option count */,
  1326. tcpreplay_full_usage, tcpreplay_short_usage
  1327. };
  1328. /*
  1329. * Create the static procedure(s) declared above.
  1330. */
  1331. static void
  1332. doUsageOpt(
  1333. tOptions* pOptions,
  1334. tOptDesc* pOptDesc )
  1335. {
  1336. USAGE( EXIT_SUCCESS );
  1337. }
  1338. /* * * * * * *
  1339. *
  1340. * For the mtu option.
  1341. */
  1342. static void
  1343. doOptMtu(
  1344. tOptions* pOptions,
  1345. tOptDesc* pOptDesc )
  1346. {
  1347. static const struct {const int rmin, rmax;} rng[ 1 ] = {
  1348. { 1, MAXPACKET } };
  1349. int val;
  1350. int ix;
  1351. char const* pzIndent = "\t\t\t\t ";
  1352. extern FILE* option_usage_fp;
  1353. if (pOptDesc == NULL) /* usage is requesting range list
  1354. option_usage_fp has already been set */
  1355. goto emit_ranges;
  1356. val = atoi( pOptDesc->optArg.argString );
  1357. for (ix = 0; ix < 1; ix++) {
  1358. if (val < rng[ix].rmin)
  1359. continue; /* ranges need not be ordered. */
  1360. if (val == rng[ix].rmin)
  1361. goto valid_return;
  1362. if (rng[ix].rmax == INT_MIN)
  1363. continue;
  1364. if (val <= rng[ix].rmax)
  1365. goto valid_return;
  1366. }
  1367. option_usage_fp = stderr;
  1368. fprintf(stderr, _("%s error: %s option value ``%s''is out of range.\n"),
  1369. pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
  1370. pzIndent = "\t";
  1371. emit_ranges:
  1372. fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
  1373. pzIndent, rng[0].rmin, rng[0].rmax );
  1374. if (pOptDesc == NULL)
  1375. return;
  1376. USAGE( EXIT_FAILURE );
  1377. /* NOTREACHED */
  1378. return;
  1379. valid_return:
  1380. pOptDesc->optArg.argInt = val;
  1381. }
  1382. /* * * * * * *
  1383. *
  1384. * For the enet-vlan-tag option.
  1385. */
  1386. static void
  1387. doOptEnet_Vlan_Tag(
  1388. tOptions* pOptions,
  1389. tOptDesc* pOptDesc )
  1390. {
  1391. static const struct {const int rmin, rmax;} rng[ 1 ] = {
  1392. { 0, 4095 } };
  1393. int val;
  1394. int ix;
  1395. char const* pzIndent = "\t\t\t\t ";
  1396. extern FILE* option_usage_fp;
  1397. if (pOptDesc == NULL) /* usage is requesting range list
  1398. option_usage_fp has already been set */
  1399. goto emit_ranges;
  1400. val = atoi( pOptDesc->optArg.argString );
  1401. for (ix = 0; ix < 1; ix++) {
  1402. if (val < rng[ix].rmin)
  1403. continue; /* ranges need not be ordered. */
  1404. if (val == rng[ix].rmin)
  1405. goto valid_return;
  1406. if (rng[ix].rmax == INT_MIN)
  1407. continue;
  1408. if (val <= rng[ix].rmax)
  1409. goto valid_return;
  1410. }
  1411. option_usage_fp = stderr;
  1412. fprintf(stderr, _("%s error: %s option value ``%s''is out of range.\n"),
  1413. pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
  1414. pzIndent = "\t";
  1415. emit_ranges:
  1416. fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
  1417. pzIndent, rng[0].rmin, rng[0].rmax );
  1418. if (pOptDesc == NULL)
  1419. return;
  1420. USAGE( EXIT_FAILURE );
  1421. /* NOTREACHED */
  1422. return;
  1423. valid_return:
  1424. pOptDesc->optArg.argInt = val;
  1425. }
  1426. /* * * * * * *
  1427. *
  1428. * For the enet-vlan-cfi option.
  1429. */
  1430. static void
  1431. doOptEnet_Vlan_Cfi(
  1432. tOptions* pOptions,
  1433. tOptDesc* pOptDesc )
  1434. {
  1435. static const struct {const int rmin, rmax;} rng[ 1 ] = {
  1436. { 0, 1 } };
  1437. int val;
  1438. int ix;
  1439. char const* pzIndent = "\t\t\t\t ";
  1440. extern FILE* option_usage_fp;
  1441. if (pOptDesc == NULL) /* usage is requesting range list
  1442. option_usage_fp has already been set */
  1443. goto emit_ranges;
  1444. val = atoi( pOptDesc->optArg.argString );
  1445. for (ix = 0; ix < 1; ix++) {
  1446. if (val < rng[ix].rmin)
  1447. continue; /* ranges need not be ordered. */
  1448. if (val == rng[ix].rmin)
  1449. goto valid_return;
  1450. if (rng[ix].rmax == INT_MIN)
  1451. continue;
  1452. if (val <= rng[ix].rmax)
  1453. goto valid_return;
  1454. }
  1455. option_usage_fp = stderr;
  1456. fprintf(stderr, _("%s error: %s option value ``%s''is out of range.\n"),
  1457. pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
  1458. pzIndent = "\t";
  1459. emit_ranges:
  1460. fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
  1461. pzIndent, rng[0].rmin, rng[0].rmax );
  1462. if (pOptDesc == NULL)
  1463. return;
  1464. USAGE( EXIT_FAILURE );
  1465. /* NOTREACHED */
  1466. return;
  1467. valid_return:
  1468. pOptDesc->optArg.argInt = val;
  1469. }
  1470. /* * * * * * *
  1471. *
  1472. * For the enet-vlan-pri option.
  1473. */
  1474. static void
  1475. doOptEnet_Vlan_Pri(
  1476. tOptions* pOptions,
  1477. tOptDesc* pOptDesc )
  1478. {
  1479. static const struct {const int rmin, rmax;} rng[ 1 ] = {
  1480. { 0, 7 } };
  1481. int val;
  1482. int ix;
  1483. char const* pzIndent = "\t\t\t\t ";
  1484. extern FILE* option_usage_fp;
  1485. if (pOptDesc == NULL) /* usage is requesting range list
  1486. option_usage_fp has already been set */
  1487. goto emit_ranges;
  1488. val = atoi( pOptDesc->optArg.argString );
  1489. for (ix = 0; ix < 1; ix++) {
  1490. if (val < rng[ix].rmin)
  1491. continue; /* ranges need not be ordered. */
  1492. if (val == rng[ix].rmin)
  1493. goto valid_return;
  1494. if (rng[ix].rmax == INT_MIN)
  1495. continue;
  1496. if (val <= rng[ix].rmax)
  1497. goto valid_return;
  1498. }
  1499. option_usage_fp = stderr;
  1500. fprintf(stderr, _("%s error: %s option value ``%s''is out of range.\n"),
  1501. pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
  1502. pzIndent = "\t";
  1503. emit_ranges:
  1504. fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
  1505. pzIndent, rng[0].rmin, rng[0].rmax );
  1506. if (pOptDesc == NULL)
  1507. return;
  1508. USAGE( EXIT_FAILURE );
  1509. /* NOTREACHED */
  1510. return;
  1511. valid_return:
  1512. pOptDesc->optArg.argInt = val;
  1513. }
  1514. /* * * * * * *
  1515. *
  1516. * For the dbug option, when DEBUG is #define-d.
  1517. */
  1518. #ifdef DEBUG
  1519. static void
  1520. doOptDbug(
  1521. tOptions* pOptions,
  1522. tOptDesc* pOptDesc )
  1523. {
  1524. static const struct {const int rmin, rmax;} rng[ 1 ] = {
  1525. { 0, 5 } };
  1526. int val;
  1527. int ix;
  1528. char const* pzIndent = "\t\t\t\t ";
  1529. extern FILE* option_usage_fp;
  1530. if (pOptDesc == NULL) /* usage is requesting range list
  1531. option_usage_fp has already been set */
  1532. goto emit_ranges;
  1533. val = atoi( pOptDesc->optArg.argString );
  1534. for (ix = 0; ix < 1; ix++) {
  1535. if (val < rng[ix].rmin)
  1536. continue; /* ranges need not be ordered. */
  1537. if (val == rng[ix].rmin)
  1538. goto valid_return;
  1539. if (rng[ix].rmax == INT_MIN)
  1540. continue;
  1541. if (val <= rng[ix].rmax)
  1542. goto valid_return;
  1543. }
  1544. option_usage_fp = stderr;
  1545. fprintf(stderr, _("%s error: %s option value ``%s''is out of range.\n"),
  1546. pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
  1547. pzIndent = "\t";
  1548. emit_ranges:
  1549. fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
  1550. pzIndent, rng[0].rmin, rng[0].rmax );
  1551. if (pOptDesc == NULL)
  1552. return;
  1553. USAGE( EXIT_FAILURE );
  1554. /* NOTREACHED */
  1555. return;
  1556. valid_return:
  1557. pOptDesc->optArg.argInt = val;
  1558. }
  1559. #endif /* defined DEBUG */
  1560. /* * * * * * *
  1561. *
  1562. * For the listnics option, when ENABLE_PCAP_FINDALLDEVS is #define-d.
  1563. */
  1564. #ifdef ENABLE_PCAP_FINDALLDEVS
  1565. static void
  1566. doOptListnics(
  1567. tOptions* pOptions,
  1568. tOptDesc* pOptDesc )
  1569. {
  1570. /* extracted from tcpreplay_opts.def, line 256 */
  1571. interface_list_t *list = get_interface_list();
  1572. list_interfaces(list);
  1573. free(list);
  1574. exit(0);
  1575. }
  1576. #endif /* defined ENABLE_PCAP_FINDALLDEVS */
  1577. /* * * * * * *
  1578. *
  1579. * For the loop option.
  1580. */
  1581. static void
  1582. doOptLoop(
  1583. tOptions* pOptions,
  1584. tOptDesc* pOptDesc )
  1585. {
  1586. static const struct {const int rmin, rmax;} rng[ 1 ] = {
  1587. { 0, INT_MAX } };
  1588. int val;
  1589. int ix;
  1590. char const* pzIndent = "\t\t\t\t ";
  1591. extern FILE* option_usage_fp;
  1592. if (pOptDesc == NULL) /* usage is requesting range list
  1593. option_usage_fp has already been set */
  1594. goto emit_ranges;
  1595. val = atoi( pOptDesc->optArg.argString );
  1596. for (ix = 0; ix < 1; ix++) {
  1597. if (val < rng[ix].rmin)
  1598. continue; /* ranges need not be ordered. */
  1599. if (val == rng[ix].rmin)
  1600. goto valid_return;
  1601. if (rng[ix].rmax == INT_MIN)
  1602. continue;
  1603. if (val <= rng[ix].rmax)
  1604. goto valid_return;
  1605. }
  1606. option_usage_fp = stderr;
  1607. fprintf(stderr, _("%s error: %s option value ``%s''is out of range.\n"),
  1608. pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
  1609. pzIndent = "\t";
  1610. emit_ranges:
  1611. fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
  1612. pzIndent, rng[0].rmin, rng[0].rmax );
  1613. if (pOptDesc == NULL)
  1614. return;
  1615. USAGE( EXIT_FAILURE );
  1616. /* NOTREACHED */
  1617. return;
  1618. valid_return:
  1619. pOptDesc->optArg.argInt = val;
  1620. }
  1621. /* * * * * * *
  1622. *
  1623. * For the limit option.
  1624. */
  1625. static void
  1626. doOptLimit(
  1627. tOptions* pOptions,
  1628. tOptDesc* pOptDesc )
  1629. {
  1630. static const struct {const int rmin, rmax;} rng[ 1 ] = {
  1631. { 1, INT_MAX } };
  1632. int val;
  1633. int ix;
  1634. char const* pzIndent = "\t\t\t\t ";
  1635. extern FILE* option_usage_fp;
  1636. if (pOptDesc == NULL) /* usage is requesting range list
  1637. option_usage_fp has already been set */
  1638. goto emit_ranges;
  1639. val = atoi( pOptDesc->optArg.argString );
  1640. for (ix = 0; ix < 1; ix++) {
  1641. if (val < rng[ix].rmin)
  1642. continue; /* ranges need not be ordered. */
  1643. if (val == rng[ix].rmin)
  1644. goto valid_return;
  1645. if (rng[ix].rmax == INT_MIN)
  1646. continue;
  1647. if (val <= rng[ix].rmax)
  1648. goto valid_return;
  1649. }
  1650. option_usage_fp = stderr;
  1651. fprintf(stderr, _("%s error: %s option value ``%s''is out of range.\n"),
  1652. pOptions->pzProgName, pOptDesc->pz_Name, pOptDesc->optArg.argString);
  1653. pzIndent = "\t";
  1654. emit_ranges:
  1655. fprintf( option_usage_fp, _("%sit must lie in the range: %d to %d\n"),
  1656. pzIndent, rng[0].rmin, rng[0].rmax );
  1657. if (pOptDesc == NULL)
  1658. return;
  1659. USAGE( EXIT_FAILURE );
  1660. /* NOTREACHED */
  1661. return;
  1662. valid_return:
  1663. pOptDesc->optArg.argInt = val;
  1664. }
  1665. /* * * * * * *
  1666. *
  1667. * For the pid option.
  1668. */
  1669. static void
  1670. doOptPid(
  1671. tOptions* pOptions,
  1672. tOptDesc* pOptDesc )
  1673. {
  1674. /* extracted from tcpreplay_opts.def, line 391 */
  1675. fprintf(stderr, "PID: %hu\n", getpid());
  1676. }
  1677. /* * * * * * *
  1678. *
  1679. * For the version option.
  1680. */
  1681. static void
  1682. doOptVersion(
  1683. tOptions* pOptions,
  1684. tOptDesc* pOptDesc )
  1685. {
  1686. /* extracted from tcpreplay_opts.def, line 403 */
  1687. fprintf(stderr, "tcpreplay version: %s (build %s)", VERSION, svn_version());
  1688. #ifdef DEBUG
  1689. fprintf(stderr, " (debug)");
  1690. #endif
  1691. fprintf(stderr, "\n");
  1692. fprintf(stderr, "Copyright 2001-2008 by Aaron Turner <aturner at synfin dot net>\n");
  1693. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  1694. #ifdef HAVE_LIBNET
  1695. fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
  1696. #else
  1697. fprintf(stderr, "Not compiled with libnet.\n");
  1698. #endif
  1699. #ifdef HAVE_WINPCAP
  1700. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  1701. #else
  1702. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  1703. #endif
  1704. #ifdef ENABLE_64BITS
  1705. fprintf(stderr, "64 bit packet counters: enabled\n");
  1706. #else
  1707. fprintf(stderr, "64 bit packet counters: disabled\n");
  1708. #endif
  1709. #ifdef ENABLE_VERBOSE
  1710. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  1711. #else
  1712. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  1713. #endif
  1714. #ifdef TCPREPLAY_EDIT
  1715. fprintf(stderr, "Packet editing: enabled\n");
  1716. #else
  1717. fprintf(stderr, "Packet editing: disabled\n");
  1718. #endif
  1719. #ifdef ENABLE_FRAGROUTE
  1720. fprintf(stderr, "Fragroute engine: enabled\n");
  1721. #else
  1722. fprintf(stderr, "Fragroute engine: disabled\n");
  1723. #endif
  1724. exit(0);
  1725. }
  1726. /* * * * * * *
  1727. *
  1728. * For the less-help option.
  1729. */
  1730. static void
  1731. doOptLess_Help(
  1732. tOptions* pOptions,
  1733. tOptDesc* pOptDesc )
  1734. {
  1735. /* extracted from tcpreplay_opts.def, line 453 */
  1736. USAGE(EXIT_FAILURE);
  1737. }
  1738. /* extracted from /opt/local/share/autogen/optcode.tpl near line 537 */
  1739. #if ENABLE_NLS
  1740. #include <stdio.h>
  1741. #include <stdlib.h>
  1742. #include <string.h>
  1743. #include <unistd.h>
  1744. #include <autoopts/usage-txt.h>
  1745. static char* AO_gettext( char const* pz );
  1746. static void coerce_it(void** s);
  1747. static char*
  1748. AO_gettext( char const* pz )
  1749. {
  1750. char* pzRes;
  1751. if (pz == NULL)
  1752. return NULL;
  1753. pzRes = _(pz);
  1754. if (pzRes == pz)
  1755. return pzRes;
  1756. pzRes = strdup( pzRes );
  1757. if (pzRes == NULL) {
  1758. fputs( _("No memory for duping translated strings\n"), stderr );
  1759. exit( EXIT_FAILURE );
  1760. }
  1761. return pzRes;
  1762. }
  1763. static void coerce_it(void** s) { *s = AO_gettext(*s); }
  1764. #define COERSION(_f) \
  1765. coerce_it((void*)&(tcpreplayOptions._f))
  1766. /*
  1767. * This invokes the translation code (e.g. gettext(3)).
  1768. */
  1769. static void
  1770. translate_option_strings( void )
  1771. {
  1772. /*
  1773. * Guard against re-translation. It won't work. The strings will have
  1774. * been changed by the first pass through this code. One shot only.
  1775. */
  1776. if (option_usage_text.field_ct == 0)
  1777. return;
  1778. /*
  1779. * Do the translations. The first pointer follows the field count field.
  1780. * The field count field is the size of a pointer.
  1781. */
  1782. {
  1783. char** ppz = (char**)(void*)&(option_usage_text);
  1784. int ix = option_usage_text.field_ct;
  1785. do {
  1786. ppz++;
  1787. *ppz = AO_gettext(*ppz);
  1788. } while (--ix > 0);
  1789. }
  1790. option_usage_text.field_ct = 0;
  1791. {
  1792. tOptDesc* pOD = tcpreplayOptions.pOptDesc;
  1793. int ix = tcpreplayOptions.optCt;
  1794. for (;;) {
  1795. pOD->pzText = AO_gettext(pOD->pzText);
  1796. pOD->pz_NAME = AO_gettext(pOD->pz_NAME);
  1797. pOD->pz_Name = AO_gettext(pOD->pz_Name);
  1798. pOD->pz_DisableName = AO_gettext(pOD->pz_DisableName);
  1799. pOD->pz_DisablePfx = AO_gettext(pOD->pz_DisablePfx);
  1800. if (--ix <= 0)
  1801. break;
  1802. pOD++;
  1803. }
  1804. }
  1805. COERSION(pzCopyright);
  1806. COERSION(pzCopyNotice);
  1807. COERSION(pzFullVersion);
  1808. COERSION(pzUsageTitle);
  1809. COERSION(pzExplain);
  1810. COERSION(pzDetail);
  1811. }
  1812. #endif /* ENABLE_NLS */
  1813. #ifdef __cplusplus
  1814. }
  1815. #endif
  1816. /* tcpreplay_edit_opts.c ends here */