tcpreplay_opts.c 104 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862
  1. /* -*- buffer-read-only: t -*- vi: set ro:
  2. *
  3. * DO NOT EDIT THIS FILE (tcpreplay_opts.c)
  4. *
  5. * It has been AutoGen-ed
  6. * From the definitions ../../src/tcpreplay_opts.def
  7. * and the template file options
  8. *
  9. * Generated from AutoOpts 42:1:17 templates.
  10. *
  11. * AutoOpts is a copyrighted work. This source file is not encumbered
  12. * by AutoOpts licensing, but is provided under the licensing terms chosen
  13. * by the tcpreplay author or copyright holder. AutoOpts is
  14. * licensed under the terms of the LGPL. The redistributable library
  15. * (``libopts'') is licensed under the terms of either the LGPL or, at the
  16. * users discretion, the BSD license. See the AutoOpts and/or libopts sources
  17. * for details.
  18. *
  19. * The tcpreplay program is copyrighted and licensed
  20. * under the following terms:
  21. *
  22. * Copyright (C) 2000-2024 Aaron Turner and Fred Klassen, all rights reserved.
  23. * This is free software. It is licensed for use, modification and
  24. * redistribution under the terms of the GNU General Public License,
  25. * version 3 or later <http://gnu.org/licenses/gpl.html>
  26. *
  27. * tcpreplay is free software: you can redistribute it and/or modify it
  28. * under the terms of the GNU General Public License as published by the
  29. * Free Software Foundation, either version 3 of the License, or
  30. * (at your option) any later version.
  31. *
  32. * tcpreplay is distributed in the hope that it will be useful, but
  33. * WITHOUT ANY WARRANTY; without even the implied warranty of
  34. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  35. * See the GNU General Public License for more details.
  36. *
  37. * You should have received a copy of the GNU General Public License along
  38. * with this program. If not, see <http://www.gnu.org/licenses/>.
  39. */
  40. #ifndef __doxygen__
  41. #define OPTION_CODE_COMPILE 1
  42. #include "tcpreplay_opts.h"
  43. #include <sys/types.h>
  44. #include <sys/stat.h>
  45. #include <errno.h>
  46. #include <fcntl.h>
  47. #include <limits.h>
  48. #include <stdio.h>
  49. #include <stdlib.h>
  50. #include <string.h>
  51. #include <unistd.h>
  52. #ifdef __cplusplus
  53. extern "C" {
  54. #endif
  55. extern FILE * option_usage_fp;
  56. #define zCopyright (tcpreplay_opt_strs+0)
  57. #define zLicenseDescrip (tcpreplay_opt_strs+283)
  58. /*
  59. * global included definitions
  60. */
  61. #include "defines.h"
  62. #include "tcpreplay.h"
  63. #include "tcpreplay_api.h"
  64. #include "common.h"
  65. #include "config.h"
  66. #include <stdlib.h>
  67. #include <sys/types.h>
  68. #include <unistd.h>
  69. extern tcpreplay_t *ctx;
  70. #ifndef NULL
  71. # define NULL 0
  72. #endif
  73. /**
  74. * static const strings for tcpreplay options
  75. */
  76. static char const tcpreplay_opt_strs[4363] =
  77. /* 0 */ "tcpreplay (tcpreplay)\n"
  78. "Copyright (C) 2000-2024 Aaron Turner and Fred Klassen, all rights reserved.\n"
  79. "This is free software. It is licensed for use, modification and\n"
  80. "redistribution under the terms of the GNU General Public License,\n"
  81. "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0"
  82. /* 283 */ "tcpreplay is free software: you can redistribute it and/or modify it under\n"
  83. "the terms of the GNU General Public License as published by the Free\n"
  84. "Software Foundation, either version 3 of the License, or (at your option)\n"
  85. "any later version.\n\n"
  86. "tcpreplay is distributed in the hope that it will be useful, but WITHOUT\n"
  87. "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
  88. "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n"
  89. "more details.\n\n"
  90. "You should have received a copy of the GNU General Public License along\n"
  91. "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0"
  92. /* 890 */ "Enable debugging output\0"
  93. /* 914 */ "DBUG\0"
  94. /* 919 */ "dbug\0"
  95. /* 924 */ "Quiet mode\0"
  96. /* 935 */ "QUIET\0"
  97. /* 941 */ "quiet\0"
  98. /* 947 */ "Select packet timing mode: select, ioport, gtod, nano\0"
  99. /* 1001 */ "TIMER\0"
  100. /* 1007 */ "timer\0"
  101. /* 1013 */ "gtod\0"
  102. /* 1018 */ "Sleep for no more then X milliseconds between packets\0"
  103. /* 1072 */ "MAXSLEEP\0"
  104. /* 1081 */ "maxsleep\0"
  105. /* 1090 */ "Print decoded packets via tcpdump to STDOUT\0"
  106. /* 1134 */ "VERBOSE\0"
  107. /* 1142 */ "verbose\0"
  108. /* 1150 */ "Arguments passed to tcpdump decoder\0"
  109. /* 1186 */ "DECODE\0"
  110. /* 1193 */ "decode\0"
  111. /* 1200 */ "Preloads packets into RAM before sending\0"
  112. /* 1241 */ "PRELOAD_PCAP\0"
  113. /* 1254 */ "preload-pcap\0"
  114. /* 1267 */ "Split traffic via a tcpprep cache file\0"
  115. /* 1306 */ "CACHEFILE\0"
  116. /* 1316 */ "cachefile\0"
  117. /* 1326 */ "Replay two files at a time from a network tap\0"
  118. /* 1372 */ "DUALFILE\0"
  119. /* 1381 */ "dualfile\0"
  120. /* 1390 */ "Client to server/RX/primary traffic output interface\0"
  121. /* 1443 */ "INTF1\0"
  122. /* 1449 */ "intf1\0"
  123. /* 1455 */ "Server to client/TX/secondary traffic output interface\0"
  124. /* 1510 */ "INTF2\0"
  125. /* 1516 */ "intf2\0"
  126. /* 1522 */ "Pcap file to receive traffic outputs\0"
  127. /* 1559 */ "WRITE\0"
  128. /* 1565 */ "write\0"
  129. /* 1571 */ "Send only selected packet numbers\0"
  130. /* 1605 */ "INCLUDE\0"
  131. /* 1613 */ "include\0"
  132. /* 1621 */ "Send all but selected packet numbers\0"
  133. /* 1658 */ "EXCLUDE\0"
  134. /* 1666 */ "exclude\0"
  135. /* 1674 */ "List available network interfaces and exit\0"
  136. /* 1717 */ "LISTNICS\0"
  137. /* 1726 */ "listnics\0"
  138. /* 1735 */ "Loop through the capture file X times\0"
  139. /* 1773 */ "LOOP\0"
  140. /* 1778 */ "loop\0"
  141. /* 1783 */ "Delay between loops in milliseconds\0"
  142. /* 1819 */ "LOOPDELAY_MS\0"
  143. /* 1832 */ "loopdelay-ms\0"
  144. /* 1845 */ "Delay between loops in nanoseconds\0"
  145. /* 1880 */ "LOOPDELAY_NS\0"
  146. /* 1893 */ "loopdelay-ns\0"
  147. /* 1906 */ "Override the snaplen and use the actual packet len\0"
  148. /* 1957 */ "PKTLEN\0"
  149. /* 1964 */ "pktlen\0"
  150. /* 1971 */ "Limit the number of packets to send\0"
  151. /* 2007 */ "LIMIT\0"
  152. /* 2013 */ "limit\0"
  153. /* 2019 */ "Limit the number of seconds to send\0"
  154. /* 2055 */ "DURATION\0"
  155. /* 2064 */ "duration\0"
  156. /* 2073 */ "Modify replay speed to a given multiple\0"
  157. /* 2113 */ "MULTIPLIER\0"
  158. /* 2124 */ "multiplier\0"
  159. /* 2135 */ "Replay packets at a given packets/sec\0"
  160. /* 2173 */ "PPS\0"
  161. /* 2177 */ "pps\0"
  162. /* 2181 */ "Replay packets at a given Mbps\0"
  163. /* 2212 */ "MBPS\0"
  164. /* 2217 */ "mbps\0"
  165. /* 2222 */ "Replay packets as fast as possible\0"
  166. /* 2257 */ "TOPSPEED\0"
  167. /* 2266 */ "topspeed\0"
  168. /* 2275 */ "Replay one packet at a time for each user input\0"
  169. /* 2323 */ "ONEATATIME\0"
  170. /* 2334 */ "oneatatime\0"
  171. /* 2345 */ "Number of packets to send for each time interval\0"
  172. /* 2394 */ "PPS_MULTI\0"
  173. /* 2404 */ "pps-multi\0"
  174. /* 2414 */ "Modify IP addresses each loop iteration to generate unique flows\0"
  175. /* 2479 */ "UNIQUE_IP\0"
  176. /* 2489 */ "unique-ip\0"
  177. /* 2499 */ "Number of times to loop before assigning new unique ip\0"
  178. /* 2554 */ "UNIQUE_IP_LOOPS\0"
  179. /* 2570 */ "unique-ip-loops\0"
  180. /* 2586 */ "Write packets directly to netmap enabled network adapter\0"
  181. /* 2643 */ "NETMAP\0"
  182. /* 2650 */ "netmap\0"
  183. /* 2657 */ "Netmap startup delay\0"
  184. /* 2678 */ "NM_DELAY\0"
  185. /* 2687 */ "nm-delay\0"
  186. /* 2696 */ "Suppress printing and tracking flow count, rates and expirations\0"
  187. /* 2761 */ "NO_FLOW_STATS\0"
  188. /* 2775 */ "no-flow-stats\0"
  189. /* 2789 */ "Number of inactive seconds before a flow is considered expired\0"
  190. /* 2852 */ "FLOW_EXPIRY\0"
  191. /* 2864 */ "flow-expiry\0"
  192. /* 2876 */ "Print the PID of tcpreplay at startup\0"
  193. /* 2914 */ "PID\0"
  194. /* 2918 */ "pid\0"
  195. /* 2922 */ "Print statistics every X seconds, or every loop if '0'\0"
  196. /* 2977 */ "STATS\0"
  197. /* 2983 */ "stats\0"
  198. /* 2989 */ "suppress printing warning messages\0"
  199. /* 3024 */ "SUPPRESS_WARNINGS\0"
  200. /* 3042 */ "suppress-warnings\0"
  201. /* 3060 */ "Write packets directly to AF_XDP enabled network adapter\0"
  202. /* 3117 */ "XDP\0"
  203. /* 3121 */ "xdp\0"
  204. /* 3125 */ "The maximum number of packets that can be submitted to the AF_XDP TX\n"
  205. "ring at once\0"
  206. /* 3207 */ "XDP_BATCH_SIZE\0"
  207. /* 3222 */ "xdp-batch-size\0"
  208. /* 3237 */ "Print version information\0"
  209. /* 3263 */ "VERSION\0"
  210. /* 3271 */ "version\0"
  211. /* 3279 */ "Display less usage information and exit\0"
  212. /* 3319 */ "LESS_HELP\0"
  213. /* 3329 */ "less-help\0"
  214. /* 3339 */ "display extended usage information and exit\0"
  215. /* 3383 */ "help\0"
  216. /* 3388 */ "extended usage information passed thru pager\0"
  217. /* 3433 */ "more-help\0"
  218. /* 3443 */ "save the option state to a config file\0"
  219. /* 3482 */ "save-opts\0"
  220. /* 3492 */ "load options from a config file\0"
  221. /* 3524 */ "LOAD_OPTS\0"
  222. /* 3534 */ "no-load-opts\0"
  223. /* 3547 */ "no\0"
  224. /* 3550 */ "TCPREPLAY\0"
  225. /* 3560 */ "tcpreplay (tcpreplay) - Replay network traffic stored in pcap files\n"
  226. "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
  227. "\t\t<pcap_file(s)> | <pcap_dir(s)>\n\0"
  228. /* 3721 */ "$$/\0"
  229. /* 3725 */ ".tcpreplayrc\0"
  230. /* 3738 */ "tcpreplay-users@lists.sourceforge.net\0"
  231. /* 3776 */ "tcpreplay is a tool for replaying network traffic from files saved with\n"
  232. "tcpdump or other tools which write pcap(3) files.\n\0"
  233. /* 3899 */ "The basic operation of tcpreplay is to resend all packets from the input\n"
  234. "file(s) at the speed at which they were recorded, or a specified data rate,\n"
  235. "up to as fast as the hardware is capable.\n\n"
  236. "Optionally, the traffic can be split between two interfaces, written to\n"
  237. "files, filtered and edited in various ways, providing the means to test\n"
  238. "firewalls, NIDS and other network devices.\n\n"
  239. "For more details, please see the Tcpreplay Manual at:\n"
  240. "http://tcpreplay.appneta.com\n";
  241. /**
  242. * dbug option description:
  243. */
  244. #ifdef DEBUG
  245. /** Descriptive text for the dbug option */
  246. #define DBUG_DESC (tcpreplay_opt_strs+890)
  247. /** Upper-cased name for the dbug option */
  248. #define DBUG_NAME (tcpreplay_opt_strs+914)
  249. /** Name string for the dbug option */
  250. #define DBUG_name (tcpreplay_opt_strs+919)
  251. /** The compiled in default value for the dbug option argument */
  252. #define DBUG_DFT_ARG ((char const*)0)
  253. /** Compiled in flag settings for the dbug option */
  254. #define DBUG_FLAGS (OPTST_DISABLED | OPTST_IMM \
  255. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  256. #else /* disable dbug */
  257. #define DBUG_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  258. #define DBUG_DFT_ARG NULL
  259. #define DBUG_NAME NULL
  260. #define DBUG_DESC NULL
  261. #define DBUG_name NULL
  262. #endif /* DEBUG */
  263. /**
  264. * quiet option description:
  265. */
  266. /** Descriptive text for the quiet option */
  267. #define QUIET_DESC (tcpreplay_opt_strs+924)
  268. /** Upper-cased name for the quiet option */
  269. #define QUIET_NAME (tcpreplay_opt_strs+935)
  270. /** Name string for the quiet option */
  271. #define QUIET_name (tcpreplay_opt_strs+941)
  272. /** Compiled in flag settings for the quiet option */
  273. #define QUIET_FLAGS (OPTST_DISABLED)
  274. /**
  275. * timer option description:
  276. */
  277. /** Descriptive text for the timer option */
  278. #define TIMER_DESC (tcpreplay_opt_strs+947)
  279. /** Upper-cased name for the timer option */
  280. #define TIMER_NAME (tcpreplay_opt_strs+1001)
  281. /** Name string for the timer option */
  282. #define TIMER_name (tcpreplay_opt_strs+1007)
  283. /** The compiled in default value for the timer option argument */
  284. #define TIMER_DFT_ARG (tcpreplay_opt_strs+1013)
  285. /** Compiled in flag settings for the timer option */
  286. #define TIMER_FLAGS (OPTST_DISABLED \
  287. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  288. /**
  289. * maxsleep option description:
  290. */
  291. /** Descriptive text for the maxsleep option */
  292. #define MAXSLEEP_DESC (tcpreplay_opt_strs+1018)
  293. /** Upper-cased name for the maxsleep option */
  294. #define MAXSLEEP_NAME (tcpreplay_opt_strs+1072)
  295. /** Name string for the maxsleep option */
  296. #define MAXSLEEP_name (tcpreplay_opt_strs+1081)
  297. /** The compiled in default value for the maxsleep option argument */
  298. #define MAXSLEEP_DFT_ARG ((char const*)0)
  299. /** Compiled in flag settings for the maxsleep option */
  300. #define MAXSLEEP_FLAGS (OPTST_DISABLED \
  301. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  302. /**
  303. * verbose option description:
  304. */
  305. #ifdef ENABLE_VERBOSE
  306. /** Descriptive text for the verbose option */
  307. #define VERBOSE_DESC (tcpreplay_opt_strs+1090)
  308. /** Upper-cased name for the verbose option */
  309. #define VERBOSE_NAME (tcpreplay_opt_strs+1134)
  310. /** Name string for the verbose option */
  311. #define VERBOSE_name (tcpreplay_opt_strs+1142)
  312. /** Compiled in flag settings for the verbose option */
  313. #define VERBOSE_FLAGS (OPTST_DISABLED | OPTST_IMM)
  314. #else /* disable verbose */
  315. #define VERBOSE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  316. #define VERBOSE_NAME NULL
  317. #define VERBOSE_DESC NULL
  318. #define VERBOSE_name NULL
  319. #endif /* ENABLE_VERBOSE */
  320. /**
  321. * decode option description with
  322. * "Must also have options" and "Incompatible options":
  323. */
  324. #ifdef ENABLE_VERBOSE
  325. /** Descriptive text for the decode option */
  326. #define DECODE_DESC (tcpreplay_opt_strs+1150)
  327. /** Upper-cased name for the decode option */
  328. #define DECODE_NAME (tcpreplay_opt_strs+1186)
  329. /** Name string for the decode option */
  330. #define DECODE_name (tcpreplay_opt_strs+1193)
  331. /** Other options that are required by the decode option */
  332. static int const aDecodeMustList[] = {
  333. INDEX_OPT_VERBOSE, NO_EQUIVALENT };
  334. /** Compiled in flag settings for the decode option */
  335. #define DECODE_FLAGS (OPTST_DISABLED \
  336. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  337. #else /* disable decode */
  338. #define DECODE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  339. #define aDecodeMustList NULL
  340. #define DECODE_NAME NULL
  341. #define DECODE_DESC NULL
  342. #define DECODE_name NULL
  343. #endif /* ENABLE_VERBOSE */
  344. /**
  345. * preload_pcap option description:
  346. */
  347. /** Descriptive text for the preload_pcap option */
  348. #define PRELOAD_PCAP_DESC (tcpreplay_opt_strs+1200)
  349. /** Upper-cased name for the preload_pcap option */
  350. #define PRELOAD_PCAP_NAME (tcpreplay_opt_strs+1241)
  351. /** Name string for the preload_pcap option */
  352. #define PRELOAD_PCAP_name (tcpreplay_opt_strs+1254)
  353. /** Compiled in flag settings for the preload_pcap option */
  354. #define PRELOAD_PCAP_FLAGS (OPTST_DISABLED)
  355. /**
  356. * cachefile option description with
  357. * "Must also have options" and "Incompatible options":
  358. */
  359. /** Descriptive text for the cachefile option */
  360. #define CACHEFILE_DESC (tcpreplay_opt_strs+1267)
  361. /** Upper-cased name for the cachefile option */
  362. #define CACHEFILE_NAME (tcpreplay_opt_strs+1306)
  363. /** Name string for the cachefile option */
  364. #define CACHEFILE_name (tcpreplay_opt_strs+1316)
  365. /** Other options that are required by the cachefile option */
  366. static int const aCachefileMustList[] = {
  367. INDEX_OPT_INTF2, NO_EQUIVALENT };
  368. /** Other options that appear in conjunction with the cachefile option */
  369. static int const aCachefileCantList[] = {
  370. INDEX_OPT_DUALFILE, NO_EQUIVALENT };
  371. /** Compiled in flag settings for the cachefile option */
  372. #define CACHEFILE_FLAGS (OPTST_DISABLED \
  373. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  374. /**
  375. * dualfile option description with
  376. * "Must also have options" and "Incompatible options":
  377. */
  378. /** Descriptive text for the dualfile option */
  379. #define DUALFILE_DESC (tcpreplay_opt_strs+1326)
  380. /** Upper-cased name for the dualfile option */
  381. #define DUALFILE_NAME (tcpreplay_opt_strs+1372)
  382. /** Name string for the dualfile option */
  383. #define DUALFILE_name (tcpreplay_opt_strs+1381)
  384. /** Other options that are required by the dualfile option */
  385. static int const aDualfileMustList[] = {
  386. INDEX_OPT_INTF2, NO_EQUIVALENT };
  387. /** Other options that appear in conjunction with the dualfile option */
  388. static int const aDualfileCantList[] = {
  389. INDEX_OPT_CACHEFILE, NO_EQUIVALENT };
  390. /** Compiled in flag settings for the dualfile option */
  391. #define DUALFILE_FLAGS (OPTST_DISABLED)
  392. /**
  393. * intf1 option description:
  394. */
  395. /** Descriptive text for the intf1 option */
  396. #define INTF1_DESC (tcpreplay_opt_strs+1390)
  397. /** Upper-cased name for the intf1 option */
  398. #define INTF1_NAME (tcpreplay_opt_strs+1443)
  399. /** Name string for the intf1 option */
  400. #define INTF1_name (tcpreplay_opt_strs+1449)
  401. /** Compiled in flag settings for the intf1 option */
  402. #define INTF1_FLAGS (OPTST_DISABLED | OPTST_MUST_SET \
  403. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  404. /**
  405. * intf2 option description:
  406. */
  407. /** Descriptive text for the intf2 option */
  408. #define INTF2_DESC (tcpreplay_opt_strs+1455)
  409. /** Upper-cased name for the intf2 option */
  410. #define INTF2_NAME (tcpreplay_opt_strs+1510)
  411. /** Name string for the intf2 option */
  412. #define INTF2_name (tcpreplay_opt_strs+1516)
  413. /** Compiled in flag settings for the intf2 option */
  414. #define INTF2_FLAGS (OPTST_DISABLED \
  415. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  416. /**
  417. * write option description with
  418. * "Must also have options" and "Incompatible options":
  419. */
  420. /** Descriptive text for the write option */
  421. #define WRITE_DESC (tcpreplay_opt_strs+1522)
  422. /** Upper-cased name for the write option */
  423. #define WRITE_NAME (tcpreplay_opt_strs+1559)
  424. /** Name string for the write option */
  425. #define WRITE_name (tcpreplay_opt_strs+1565)
  426. /** Other options that appear in conjunction with the write option */
  427. static int const aWriteCantList[] = {
  428. INDEX_OPT_INTF2, NO_EQUIVALENT };
  429. /** Compiled in flag settings for the write option */
  430. #define WRITE_FLAGS (OPTST_DISABLED \
  431. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  432. /**
  433. * include option description with
  434. * "Must also have options" and "Incompatible options":
  435. */
  436. /** Descriptive text for the include option */
  437. #define INCLUDE_DESC (tcpreplay_opt_strs+1571)
  438. /** Upper-cased name for the include option */
  439. #define INCLUDE_NAME (tcpreplay_opt_strs+1605)
  440. /** Name string for the include option */
  441. #define INCLUDE_name (tcpreplay_opt_strs+1613)
  442. /** Other options that appear in conjunction with the include option */
  443. static int const aIncludeCantList[] = {
  444. INDEX_OPT_EXCLUDE, NO_EQUIVALENT };
  445. /** Compiled in flag settings for the include option */
  446. #define INCLUDE_FLAGS (OPTST_DISABLED \
  447. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  448. /**
  449. * exclude option description with
  450. * "Must also have options" and "Incompatible options":
  451. */
  452. /** Descriptive text for the exclude option */
  453. #define EXCLUDE_DESC (tcpreplay_opt_strs+1621)
  454. /** Upper-cased name for the exclude option */
  455. #define EXCLUDE_NAME (tcpreplay_opt_strs+1658)
  456. /** Name string for the exclude option */
  457. #define EXCLUDE_name (tcpreplay_opt_strs+1666)
  458. /** Other options that appear in conjunction with the exclude option */
  459. static int const aExcludeCantList[] = {
  460. INDEX_OPT_INCLUDE, NO_EQUIVALENT };
  461. /** Compiled in flag settings for the exclude option */
  462. #define EXCLUDE_FLAGS (OPTST_DISABLED \
  463. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  464. /**
  465. * listnics option description:
  466. */
  467. #ifdef ENABLE_PCAP_FINDALLDEVS
  468. /** Descriptive text for the listnics option */
  469. #define LISTNICS_DESC (tcpreplay_opt_strs+1674)
  470. /** Upper-cased name for the listnics option */
  471. #define LISTNICS_NAME (tcpreplay_opt_strs+1717)
  472. /** Name string for the listnics option */
  473. #define LISTNICS_name (tcpreplay_opt_strs+1726)
  474. /** Compiled in flag settings for the listnics option */
  475. #define LISTNICS_FLAGS (OPTST_DISABLED | OPTST_IMM)
  476. #else /* disable listnics */
  477. #define LISTNICS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  478. #define LISTNICS_NAME NULL
  479. #define LISTNICS_DESC NULL
  480. #define LISTNICS_name NULL
  481. #endif /* ENABLE_PCAP_FINDALLDEVS */
  482. /**
  483. * loop option description:
  484. */
  485. /** Descriptive text for the loop option */
  486. #define LOOP_DESC (tcpreplay_opt_strs+1735)
  487. /** Upper-cased name for the loop option */
  488. #define LOOP_NAME (tcpreplay_opt_strs+1773)
  489. /** Name string for the loop option */
  490. #define LOOP_name (tcpreplay_opt_strs+1778)
  491. /** The compiled in default value for the loop option argument */
  492. #define LOOP_DFT_ARG ((char const*)1)
  493. /** Compiled in flag settings for the loop option */
  494. #define LOOP_FLAGS (OPTST_DISABLED \
  495. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  496. /**
  497. * loopdelay-ms option description with
  498. * "Must also have options" and "Incompatible options":
  499. */
  500. /** Descriptive text for the loopdelay-ms option */
  501. #define LOOPDELAY_MS_DESC (tcpreplay_opt_strs+1783)
  502. /** Upper-cased name for the loopdelay-ms option */
  503. #define LOOPDELAY_MS_NAME (tcpreplay_opt_strs+1819)
  504. /** Name string for the loopdelay-ms option */
  505. #define LOOPDELAY_MS_name (tcpreplay_opt_strs+1832)
  506. /** The compiled in default value for the loopdelay-ms option argument */
  507. #define LOOPDELAY_MS_DFT_ARG ((char const*)0)
  508. /** Other options that are required by the loopdelay-ms option */
  509. static int const aLoopdelay_MsMustList[] = {
  510. INDEX_OPT_LOOP, NO_EQUIVALENT };
  511. /** Other options that appear in conjunction with the loopdelay-ms option */
  512. static int const aLoopdelay_MsCantList[] = {
  513. INDEX_OPT_LOOPDELAY_NS, NO_EQUIVALENT };
  514. /** Compiled in flag settings for the loopdelay-ms option */
  515. #define LOOPDELAY_MS_FLAGS (OPTST_DISABLED \
  516. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  517. /**
  518. * loopdelay-ns option description with
  519. * "Must also have options" and "Incompatible options":
  520. */
  521. /** Descriptive text for the loopdelay-ns option */
  522. #define LOOPDELAY_NS_DESC (tcpreplay_opt_strs+1845)
  523. /** Upper-cased name for the loopdelay-ns option */
  524. #define LOOPDELAY_NS_NAME (tcpreplay_opt_strs+1880)
  525. /** Name string for the loopdelay-ns option */
  526. #define LOOPDELAY_NS_name (tcpreplay_opt_strs+1893)
  527. /** The compiled in default value for the loopdelay-ns option argument */
  528. #define LOOPDELAY_NS_DFT_ARG ((char const*)0)
  529. /** Other options that are required by the loopdelay-ns option */
  530. static int const aLoopdelay_NsMustList[] = {
  531. INDEX_OPT_LOOP, NO_EQUIVALENT };
  532. /** Other options that appear in conjunction with the loopdelay-ns option */
  533. static int const aLoopdelay_NsCantList[] = {
  534. INDEX_OPT_LOOPDELAY_MS, NO_EQUIVALENT };
  535. /** Compiled in flag settings for the loopdelay-ns option */
  536. #define LOOPDELAY_NS_FLAGS (OPTST_DISABLED \
  537. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  538. /**
  539. * pktlen option description:
  540. */
  541. /** Descriptive text for the pktlen option */
  542. #define PKTLEN_DESC (tcpreplay_opt_strs+1906)
  543. /** Upper-cased name for the pktlen option */
  544. #define PKTLEN_NAME (tcpreplay_opt_strs+1957)
  545. /** Name string for the pktlen option */
  546. #define PKTLEN_name (tcpreplay_opt_strs+1964)
  547. /** Compiled in flag settings for the pktlen option */
  548. #define PKTLEN_FLAGS (OPTST_DISABLED)
  549. /**
  550. * limit option description:
  551. */
  552. /** Descriptive text for the limit option */
  553. #define LIMIT_DESC (tcpreplay_opt_strs+1971)
  554. /** Upper-cased name for the limit option */
  555. #define LIMIT_NAME (tcpreplay_opt_strs+2007)
  556. /** Name string for the limit option */
  557. #define LIMIT_name (tcpreplay_opt_strs+2013)
  558. /** The compiled in default value for the limit option argument */
  559. #define LIMIT_DFT_ARG ((char const*)-1)
  560. /** Compiled in flag settings for the limit option */
  561. #define LIMIT_FLAGS (OPTST_DISABLED \
  562. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  563. /**
  564. * duration option description:
  565. */
  566. /** Descriptive text for the duration option */
  567. #define DURATION_DESC (tcpreplay_opt_strs+2019)
  568. /** Upper-cased name for the duration option */
  569. #define DURATION_NAME (tcpreplay_opt_strs+2055)
  570. /** Name string for the duration option */
  571. #define DURATION_name (tcpreplay_opt_strs+2064)
  572. /** The compiled in default value for the duration option argument */
  573. #define DURATION_DFT_ARG ((char const*)-1)
  574. /** Compiled in flag settings for the duration option */
  575. #define DURATION_FLAGS (OPTST_DISABLED \
  576. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  577. /**
  578. * multiplier option description with
  579. * "Must also have options" and "Incompatible options":
  580. */
  581. /** Descriptive text for the multiplier option */
  582. #define MULTIPLIER_DESC (tcpreplay_opt_strs+2073)
  583. /** Upper-cased name for the multiplier option */
  584. #define MULTIPLIER_NAME (tcpreplay_opt_strs+2113)
  585. /** Name string for the multiplier option */
  586. #define MULTIPLIER_name (tcpreplay_opt_strs+2124)
  587. /** Other options that appear in conjunction with the multiplier option */
  588. static int const aMultiplierCantList[] = {
  589. INDEX_OPT_PPS,
  590. INDEX_OPT_MBPS,
  591. INDEX_OPT_ONEATATIME,
  592. INDEX_OPT_TOPSPEED, NO_EQUIVALENT };
  593. /** Compiled in flag settings for the multiplier option */
  594. #define MULTIPLIER_FLAGS (OPTST_DISABLED \
  595. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  596. /**
  597. * pps option description with
  598. * "Must also have options" and "Incompatible options":
  599. */
  600. /** Descriptive text for the pps option */
  601. #define PPS_DESC (tcpreplay_opt_strs+2135)
  602. /** Upper-cased name for the pps option */
  603. #define PPS_NAME (tcpreplay_opt_strs+2173)
  604. /** Name string for the pps option */
  605. #define PPS_name (tcpreplay_opt_strs+2177)
  606. /** Other options that appear in conjunction with the pps option */
  607. static int const aPpsCantList[] = {
  608. INDEX_OPT_MULTIPLIER,
  609. INDEX_OPT_MBPS,
  610. INDEX_OPT_ONEATATIME,
  611. INDEX_OPT_TOPSPEED, NO_EQUIVALENT };
  612. /** Compiled in flag settings for the pps option */
  613. #define PPS_FLAGS (OPTST_DISABLED \
  614. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  615. /**
  616. * mbps option description with
  617. * "Must also have options" and "Incompatible options":
  618. */
  619. /** Descriptive text for the mbps option */
  620. #define MBPS_DESC (tcpreplay_opt_strs+2181)
  621. /** Upper-cased name for the mbps option */
  622. #define MBPS_NAME (tcpreplay_opt_strs+2212)
  623. /** Name string for the mbps option */
  624. #define MBPS_name (tcpreplay_opt_strs+2217)
  625. /** Other options that appear in conjunction with the mbps option */
  626. static int const aMbpsCantList[] = {
  627. INDEX_OPT_MULTIPLIER,
  628. INDEX_OPT_PPS,
  629. INDEX_OPT_ONEATATIME,
  630. INDEX_OPT_TOPSPEED, NO_EQUIVALENT };
  631. /** Compiled in flag settings for the mbps option */
  632. #define MBPS_FLAGS (OPTST_DISABLED \
  633. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  634. /**
  635. * topspeed option description with
  636. * "Must also have options" and "Incompatible options":
  637. */
  638. /** Descriptive text for the topspeed option */
  639. #define TOPSPEED_DESC (tcpreplay_opt_strs+2222)
  640. /** Upper-cased name for the topspeed option */
  641. #define TOPSPEED_NAME (tcpreplay_opt_strs+2257)
  642. /** Name string for the topspeed option */
  643. #define TOPSPEED_name (tcpreplay_opt_strs+2266)
  644. /** Other options that appear in conjunction with the topspeed option */
  645. static int const aTopspeedCantList[] = {
  646. INDEX_OPT_MBPS,
  647. INDEX_OPT_MULTIPLIER,
  648. INDEX_OPT_PPS,
  649. INDEX_OPT_ONEATATIME, NO_EQUIVALENT };
  650. /** Compiled in flag settings for the topspeed option */
  651. #define TOPSPEED_FLAGS (OPTST_DISABLED)
  652. /**
  653. * oneatatime option description with
  654. * "Must also have options" and "Incompatible options":
  655. */
  656. /** Descriptive text for the oneatatime option */
  657. #define ONEATATIME_DESC (tcpreplay_opt_strs+2275)
  658. /** Upper-cased name for the oneatatime option */
  659. #define ONEATATIME_NAME (tcpreplay_opt_strs+2323)
  660. /** Name string for the oneatatime option */
  661. #define ONEATATIME_name (tcpreplay_opt_strs+2334)
  662. /** Other options that appear in conjunction with the oneatatime option */
  663. static int const aOneatatimeCantList[] = {
  664. INDEX_OPT_MBPS,
  665. INDEX_OPT_PPS,
  666. INDEX_OPT_MULTIPLIER,
  667. INDEX_OPT_TOPSPEED, NO_EQUIVALENT };
  668. /** Compiled in flag settings for the oneatatime option */
  669. #define ONEATATIME_FLAGS (OPTST_DISABLED)
  670. /**
  671. * pps-multi option description with
  672. * "Must also have options" and "Incompatible options":
  673. */
  674. /** Descriptive text for the pps-multi option */
  675. #define PPS_MULTI_DESC (tcpreplay_opt_strs+2345)
  676. /** Upper-cased name for the pps-multi option */
  677. #define PPS_MULTI_NAME (tcpreplay_opt_strs+2394)
  678. /** Name string for the pps-multi option */
  679. #define PPS_MULTI_name (tcpreplay_opt_strs+2404)
  680. /** The compiled in default value for the pps-multi option argument */
  681. #define PPS_MULTI_DFT_ARG ((char const*)1)
  682. /** Other options that are required by the pps-multi option */
  683. static int const aPps_MultiMustList[] = {
  684. INDEX_OPT_PPS, NO_EQUIVALENT };
  685. /** Compiled in flag settings for the pps-multi option */
  686. #define PPS_MULTI_FLAGS (OPTST_DISABLED \
  687. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  688. /**
  689. * unique-ip option description with
  690. * "Must also have options" and "Incompatible options":
  691. */
  692. /** Descriptive text for the unique-ip option */
  693. #define UNIQUE_IP_DESC (tcpreplay_opt_strs+2414)
  694. /** Upper-cased name for the unique-ip option */
  695. #define UNIQUE_IP_NAME (tcpreplay_opt_strs+2479)
  696. /** Name string for the unique-ip option */
  697. #define UNIQUE_IP_name (tcpreplay_opt_strs+2489)
  698. /** Other options that are required by the unique-ip option */
  699. static int const aUnique_IpMustList[] = {
  700. INDEX_OPT_LOOP, NO_EQUIVALENT };
  701. /** Compiled in flag settings for the unique-ip option */
  702. #define UNIQUE_IP_FLAGS (OPTST_DISABLED)
  703. /**
  704. * unique-ip-loops option description with
  705. * "Must also have options" and "Incompatible options":
  706. */
  707. /** Descriptive text for the unique-ip-loops option */
  708. #define UNIQUE_IP_LOOPS_DESC (tcpreplay_opt_strs+2499)
  709. /** Upper-cased name for the unique-ip-loops option */
  710. #define UNIQUE_IP_LOOPS_NAME (tcpreplay_opt_strs+2554)
  711. /** Name string for the unique-ip-loops option */
  712. #define UNIQUE_IP_LOOPS_name (tcpreplay_opt_strs+2570)
  713. /** Other options that are required by the unique-ip-loops option */
  714. static int const aUnique_Ip_LoopsMustList[] = {
  715. INDEX_OPT_UNIQUE_IP, NO_EQUIVALENT };
  716. /** Compiled in flag settings for the unique-ip-loops option */
  717. #define UNIQUE_IP_LOOPS_FLAGS (OPTST_DISABLED \
  718. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  719. /**
  720. * netmap option description:
  721. */
  722. #ifdef HAVE_NETMAP
  723. /** Descriptive text for the netmap option */
  724. #define NETMAP_DESC (tcpreplay_opt_strs+2586)
  725. /** Upper-cased name for the netmap option */
  726. #define NETMAP_NAME (tcpreplay_opt_strs+2643)
  727. /** Name string for the netmap option */
  728. #define NETMAP_name (tcpreplay_opt_strs+2650)
  729. /** Compiled in flag settings for the netmap option */
  730. #define NETMAP_FLAGS (OPTST_DISABLED)
  731. #else /* disable netmap */
  732. #define NETMAP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  733. #define NETMAP_NAME NULL
  734. #define NETMAP_DESC NULL
  735. #define NETMAP_name NULL
  736. #endif /* HAVE_NETMAP */
  737. /**
  738. * nm-delay option description:
  739. */
  740. #ifdef HAVE_NETMAP
  741. /** Descriptive text for the nm-delay option */
  742. #define NM_DELAY_DESC (tcpreplay_opt_strs+2657)
  743. /** Upper-cased name for the nm-delay option */
  744. #define NM_DELAY_NAME (tcpreplay_opt_strs+2678)
  745. /** Name string for the nm-delay option */
  746. #define NM_DELAY_name (tcpreplay_opt_strs+2687)
  747. /** The compiled in default value for the nm-delay option argument */
  748. #define NM_DELAY_DFT_ARG ((char const*)10)
  749. /** Compiled in flag settings for the nm-delay option */
  750. #define NM_DELAY_FLAGS (OPTST_DISABLED \
  751. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  752. #else /* disable nm-delay */
  753. #define NM_DELAY_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  754. #define NM_DELAY_DFT_ARG NULL
  755. #define NM_DELAY_NAME NULL
  756. #define NM_DELAY_DESC NULL
  757. #define NM_DELAY_name NULL
  758. #endif /* HAVE_NETMAP */
  759. /**
  760. * no-flow-stats option description:
  761. */
  762. /** Descriptive text for the no-flow-stats option */
  763. #define NO_FLOW_STATS_DESC (tcpreplay_opt_strs+2696)
  764. /** Upper-cased name for the no-flow-stats option */
  765. #define NO_FLOW_STATS_NAME (tcpreplay_opt_strs+2761)
  766. /** Name string for the no-flow-stats option */
  767. #define NO_FLOW_STATS_name (tcpreplay_opt_strs+2775)
  768. /** Compiled in flag settings for the no-flow-stats option */
  769. #define NO_FLOW_STATS_FLAGS (OPTST_DISABLED)
  770. /**
  771. * flow-expiry option description with
  772. * "Must also have options" and "Incompatible options":
  773. */
  774. /** Descriptive text for the flow-expiry option */
  775. #define FLOW_EXPIRY_DESC (tcpreplay_opt_strs+2789)
  776. /** Upper-cased name for the flow-expiry option */
  777. #define FLOW_EXPIRY_NAME (tcpreplay_opt_strs+2852)
  778. /** Name string for the flow-expiry option */
  779. #define FLOW_EXPIRY_name (tcpreplay_opt_strs+2864)
  780. /** The compiled in default value for the flow-expiry option argument */
  781. #define FLOW_EXPIRY_DFT_ARG ((char const*)0)
  782. /** Other options that appear in conjunction with the flow-expiry option */
  783. static int const aFlow_ExpiryCantList[] = {
  784. INDEX_OPT_NO_FLOW_STATS, NO_EQUIVALENT };
  785. /** Compiled in flag settings for the flow-expiry option */
  786. #define FLOW_EXPIRY_FLAGS (OPTST_DISABLED \
  787. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  788. /**
  789. * pid option description:
  790. */
  791. /** Descriptive text for the pid option */
  792. #define PID_DESC (tcpreplay_opt_strs+2876)
  793. /** Upper-cased name for the pid option */
  794. #define PID_NAME (tcpreplay_opt_strs+2914)
  795. /** Name string for the pid option */
  796. #define PID_name (tcpreplay_opt_strs+2918)
  797. /** Compiled in flag settings for the pid option */
  798. #define PID_FLAGS (OPTST_DISABLED)
  799. /**
  800. * stats option description:
  801. */
  802. /** Descriptive text for the stats option */
  803. #define STATS_DESC (tcpreplay_opt_strs+2922)
  804. /** Upper-cased name for the stats option */
  805. #define STATS_NAME (tcpreplay_opt_strs+2977)
  806. /** Name string for the stats option */
  807. #define STATS_name (tcpreplay_opt_strs+2983)
  808. /** Compiled in flag settings for the stats option */
  809. #define STATS_FLAGS (OPTST_DISABLED \
  810. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  811. /**
  812. * suppress-warnings option description:
  813. */
  814. /** Descriptive text for the suppress-warnings option */
  815. #define SUPPRESS_WARNINGS_DESC (tcpreplay_opt_strs+2989)
  816. /** Upper-cased name for the suppress-warnings option */
  817. #define SUPPRESS_WARNINGS_NAME (tcpreplay_opt_strs+3024)
  818. /** Name string for the suppress-warnings option */
  819. #define SUPPRESS_WARNINGS_name (tcpreplay_opt_strs+3042)
  820. /** Compiled in flag settings for the suppress-warnings option */
  821. #define SUPPRESS_WARNINGS_FLAGS (OPTST_DISABLED | OPTST_IMM)
  822. /**
  823. * xdp option description:
  824. */
  825. #ifdef HAVE_LIBXDP
  826. /** Descriptive text for the xdp option */
  827. #define XDP_DESC (tcpreplay_opt_strs+3060)
  828. /** Upper-cased name for the xdp option */
  829. #define XDP_NAME (tcpreplay_opt_strs+3117)
  830. /** Name string for the xdp option */
  831. #define XDP_name (tcpreplay_opt_strs+3121)
  832. /** Compiled in flag settings for the xdp option */
  833. #define XDP_FLAGS (OPTST_DISABLED)
  834. #else /* disable xdp */
  835. #define XDP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  836. #define XDP_NAME NULL
  837. #define XDP_DESC NULL
  838. #define XDP_name NULL
  839. #endif /* HAVE_LIBXDP */
  840. /**
  841. * xdp-batch-size option description:
  842. */
  843. #ifdef HAVE_LIBXDP
  844. /** Descriptive text for the xdp-batch-size option */
  845. #define XDP_BATCH_SIZE_DESC (tcpreplay_opt_strs+3125)
  846. /** Upper-cased name for the xdp-batch-size option */
  847. #define XDP_BATCH_SIZE_NAME (tcpreplay_opt_strs+3207)
  848. /** Name string for the xdp-batch-size option */
  849. #define XDP_BATCH_SIZE_name (tcpreplay_opt_strs+3222)
  850. /** The compiled in default value for the xdp-batch-size option argument */
  851. #define XDP_BATCH_SIZE_DFT_ARG ((char const*)25)
  852. /** Compiled in flag settings for the xdp-batch-size option */
  853. #define XDP_BATCH_SIZE_FLAGS (OPTST_DISABLED \
  854. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  855. #else /* disable xdp-batch-size */
  856. #define XDP_BATCH_SIZE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  857. #define XDP_BATCH_SIZE_DFT_ARG NULL
  858. #define XDP_BATCH_SIZE_NAME NULL
  859. #define XDP_BATCH_SIZE_DESC NULL
  860. #define XDP_BATCH_SIZE_name NULL
  861. #endif /* HAVE_LIBXDP */
  862. /**
  863. * version option description:
  864. */
  865. /** Descriptive text for the version option */
  866. #define VERSION_DESC (tcpreplay_opt_strs+3237)
  867. /** Upper-cased name for the version option */
  868. #define VERSION_NAME (tcpreplay_opt_strs+3263)
  869. /** Name string for the version option */
  870. #define VERSION_name (tcpreplay_opt_strs+3271)
  871. /** Compiled in flag settings for the version option */
  872. #define VERSION_FLAGS (OPTST_DISABLED)
  873. /**
  874. * less-help option description:
  875. */
  876. /** Descriptive text for the less-help option */
  877. #define LESS_HELP_DESC (tcpreplay_opt_strs+3279)
  878. /** Upper-cased name for the less-help option */
  879. #define LESS_HELP_NAME (tcpreplay_opt_strs+3319)
  880. /** Name string for the less-help option */
  881. #define LESS_HELP_name (tcpreplay_opt_strs+3329)
  882. /** Compiled in flag settings for the less-help option */
  883. #define LESS_HELP_FLAGS (OPTST_DISABLED | OPTST_IMM)
  884. /*
  885. * Help/More_Help option descriptions:
  886. */
  887. #define HELP_DESC (tcpreplay_opt_strs+3339)
  888. #define HELP_name (tcpreplay_opt_strs+3383)
  889. #ifdef HAVE_WORKING_FORK
  890. #define MORE_HELP_DESC (tcpreplay_opt_strs+3388)
  891. #define MORE_HELP_name (tcpreplay_opt_strs+3433)
  892. #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
  893. #else
  894. #define MORE_HELP_DESC HELP_DESC
  895. #define MORE_HELP_name HELP_name
  896. #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  897. #endif
  898. #define SAVE_OPTS_DESC (tcpreplay_opt_strs+3443)
  899. #define SAVE_OPTS_name (tcpreplay_opt_strs+3482)
  900. #define LOAD_OPTS_DESC (tcpreplay_opt_strs+3492)
  901. #define LOAD_OPTS_NAME (tcpreplay_opt_strs+3524)
  902. #define NO_LOAD_OPTS_name (tcpreplay_opt_strs+3534)
  903. #define LOAD_OPTS_pfx (tcpreplay_opt_strs+3547)
  904. #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
  905. /**
  906. * Declare option callback procedures
  907. */
  908. #ifdef DEBUG
  909. static tOptProc doOptDbug;
  910. #else /* not DEBUG */
  911. # define doOptDbug NULL
  912. #endif /* def/not DEBUG */
  913. #ifdef ENABLE_PCAP_FINDALLDEVS
  914. static tOptProc doOptListnics;
  915. #else /* not ENABLE_PCAP_FINDALLDEVS */
  916. # define doOptListnics NULL
  917. #endif /* def/not ENABLE_PCAP_FINDALLDEVS */
  918. #ifdef HAVE_LIBXDP
  919. static tOptProc doOptXdp_Batch_Size;
  920. #else /* not HAVE_LIBXDP */
  921. # define doOptXdp_Batch_Size NULL
  922. #endif /* def/not HAVE_LIBXDP */
  923. extern tOptProc
  924. optionBooleanVal, optionNestedVal, optionNumericVal,
  925. optionPagedUsage, optionPrintVersion, optionResetOpt,
  926. optionStackArg, optionTimeDate, optionTimeVal,
  927. optionUnstackArg, optionVendorOption;
  928. static tOptProc
  929. doOptDuration, doOptExclude, doOptFlow_Expiry,
  930. doOptInclude, doOptLess_Help, doOptLimit,
  931. doOptLoop, doOptLoopdelay_Ms, doOptLoopdelay_Ns,
  932. doOptPid, doOptPps_Multi, doOptStats,
  933. doOptVersion, doUsageOpt;
  934. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  935. /**
  936. * Define the tcpreplay Option Descriptions.
  937. * This is an array of OPTION_CT entries, one for each
  938. * option that the tcpreplay program responds to.
  939. */
  940. static tOptDesc optDesc[OPTION_CT] = {
  941. { /* entry idx, value */ 0, VALUE_OPT_DBUG,
  942. /* equiv idx, value */ 0, VALUE_OPT_DBUG,
  943. /* equivalenced to */ NO_EQUIVALENT,
  944. /* min, max, act ct */ 0, 1, 0,
  945. /* opt state flags */ DBUG_FLAGS, 0,
  946. /* last opt argumnt */ { DBUG_DFT_ARG },
  947. /* arg list/cookie */ NULL,
  948. /* must/cannot opts */ NULL, NULL,
  949. /* option proc */ doOptDbug,
  950. /* desc, NAME, name */ DBUG_DESC, DBUG_NAME, DBUG_name,
  951. /* disablement strs */ NULL, NULL },
  952. { /* entry idx, value */ 1, VALUE_OPT_QUIET,
  953. /* equiv idx, value */ 1, VALUE_OPT_QUIET,
  954. /* equivalenced to */ NO_EQUIVALENT,
  955. /* min, max, act ct */ 0, 1, 0,
  956. /* opt state flags */ QUIET_FLAGS, 0,
  957. /* last opt argumnt */ { NULL }, /* --quiet */
  958. /* arg list/cookie */ NULL,
  959. /* must/cannot opts */ NULL, NULL,
  960. /* option proc */ NULL,
  961. /* desc, NAME, name */ QUIET_DESC, QUIET_NAME, QUIET_name,
  962. /* disablement strs */ NULL, NULL },
  963. { /* entry idx, value */ 2, VALUE_OPT_TIMER,
  964. /* equiv idx, value */ 2, VALUE_OPT_TIMER,
  965. /* equivalenced to */ NO_EQUIVALENT,
  966. /* min, max, act ct */ 0, 1, 0,
  967. /* opt state flags */ TIMER_FLAGS, 0,
  968. /* last opt argumnt */ { TIMER_DFT_ARG },
  969. /* arg list/cookie */ NULL,
  970. /* must/cannot opts */ NULL, NULL,
  971. /* option proc */ NULL,
  972. /* desc, NAME, name */ TIMER_DESC, TIMER_NAME, TIMER_name,
  973. /* disablement strs */ NULL, NULL },
  974. { /* entry idx, value */ 3, VALUE_OPT_MAXSLEEP,
  975. /* equiv idx, value */ 3, VALUE_OPT_MAXSLEEP,
  976. /* equivalenced to */ NO_EQUIVALENT,
  977. /* min, max, act ct */ 0, 1, 0,
  978. /* opt state flags */ MAXSLEEP_FLAGS, 0,
  979. /* last opt argumnt */ { MAXSLEEP_DFT_ARG },
  980. /* arg list/cookie */ NULL,
  981. /* must/cannot opts */ NULL, NULL,
  982. /* option proc */ optionNumericVal,
  983. /* desc, NAME, name */ MAXSLEEP_DESC, MAXSLEEP_NAME, MAXSLEEP_name,
  984. /* disablement strs */ NULL, NULL },
  985. { /* entry idx, value */ 4, VALUE_OPT_VERBOSE,
  986. /* equiv idx, value */ 4, VALUE_OPT_VERBOSE,
  987. /* equivalenced to */ NO_EQUIVALENT,
  988. /* min, max, act ct */ 0, 1, 0,
  989. /* opt state flags */ VERBOSE_FLAGS, 0,
  990. /* last opt argumnt */ { NULL }, /* --verbose */
  991. /* arg list/cookie */ NULL,
  992. /* must/cannot opts */ NULL, NULL,
  993. /* option proc */ NULL,
  994. /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name,
  995. /* disablement strs */ NULL, NULL },
  996. { /* entry idx, value */ 5, VALUE_OPT_DECODE,
  997. /* equiv idx, value */ 5, VALUE_OPT_DECODE,
  998. /* equivalenced to */ NO_EQUIVALENT,
  999. /* min, max, act ct */ 0, 1, 0,
  1000. /* opt state flags */ DECODE_FLAGS, 0,
  1001. /* last opt argumnt */ { NULL }, /* --decode */
  1002. /* arg list/cookie */ NULL,
  1003. /* must/cannot opts */ aDecodeMustList, NULL,
  1004. /* option proc */ NULL,
  1005. /* desc, NAME, name */ DECODE_DESC, DECODE_NAME, DECODE_name,
  1006. /* disablement strs */ NULL, NULL },
  1007. { /* entry idx, value */ 6, VALUE_OPT_PRELOAD_PCAP,
  1008. /* equiv idx, value */ 6, VALUE_OPT_PRELOAD_PCAP,
  1009. /* equivalenced to */ NO_EQUIVALENT,
  1010. /* min, max, act ct */ 0, 1, 0,
  1011. /* opt state flags */ PRELOAD_PCAP_FLAGS, 0,
  1012. /* last opt argumnt */ { NULL }, /* --preload_pcap */
  1013. /* arg list/cookie */ NULL,
  1014. /* must/cannot opts */ NULL, NULL,
  1015. /* option proc */ NULL,
  1016. /* desc, NAME, name */ PRELOAD_PCAP_DESC, PRELOAD_PCAP_NAME, PRELOAD_PCAP_name,
  1017. /* disablement strs */ NULL, NULL },
  1018. { /* entry idx, value */ 7, VALUE_OPT_CACHEFILE,
  1019. /* equiv idx, value */ 7, VALUE_OPT_CACHEFILE,
  1020. /* equivalenced to */ NO_EQUIVALENT,
  1021. /* min, max, act ct */ 0, 1, 0,
  1022. /* opt state flags */ CACHEFILE_FLAGS, 0,
  1023. /* last opt argumnt */ { NULL }, /* --cachefile */
  1024. /* arg list/cookie */ NULL,
  1025. /* must/cannot opts */ aCachefileMustList, aCachefileCantList,
  1026. /* option proc */ NULL,
  1027. /* desc, NAME, name */ CACHEFILE_DESC, CACHEFILE_NAME, CACHEFILE_name,
  1028. /* disablement strs */ NULL, NULL },
  1029. { /* entry idx, value */ 8, VALUE_OPT_DUALFILE,
  1030. /* equiv idx, value */ 8, VALUE_OPT_DUALFILE,
  1031. /* equivalenced to */ NO_EQUIVALENT,
  1032. /* min, max, act ct */ 0, 1, 0,
  1033. /* opt state flags */ DUALFILE_FLAGS, 0,
  1034. /* last opt argumnt */ { NULL }, /* --dualfile */
  1035. /* arg list/cookie */ NULL,
  1036. /* must/cannot opts */ aDualfileMustList, aDualfileCantList,
  1037. /* option proc */ NULL,
  1038. /* desc, NAME, name */ DUALFILE_DESC, DUALFILE_NAME, DUALFILE_name,
  1039. /* disablement strs */ NULL, NULL },
  1040. { /* entry idx, value */ 9, VALUE_OPT_INTF1,
  1041. /* equiv idx, value */ NO_EQUIVALENT, 0,
  1042. /* equivalenced to */ NO_EQUIVALENT,
  1043. /* min, max, act ct */ 1, 1, 0,
  1044. /* opt state flags */ INTF1_FLAGS, 0,
  1045. /* last opt argumnt */ { NULL }, /* --intf1 */
  1046. /* arg list/cookie */ NULL,
  1047. /* must/cannot opts */ NULL, NULL,
  1048. /* option proc */ NULL,
  1049. /* desc, NAME, name */ INTF1_DESC, INTF1_NAME, INTF1_name,
  1050. /* disablement strs */ NULL, NULL },
  1051. { /* entry idx, value */ 10, VALUE_OPT_INTF2,
  1052. /* equiv idx, value */ 10, VALUE_OPT_INTF2,
  1053. /* equivalenced to */ NO_EQUIVALENT,
  1054. /* min, max, act ct */ 0, 1, 0,
  1055. /* opt state flags */ INTF2_FLAGS, 0,
  1056. /* last opt argumnt */ { NULL }, /* --intf2 */
  1057. /* arg list/cookie */ NULL,
  1058. /* must/cannot opts */ NULL, NULL,
  1059. /* option proc */ NULL,
  1060. /* desc, NAME, name */ INTF2_DESC, INTF2_NAME, INTF2_name,
  1061. /* disablement strs */ NULL, NULL },
  1062. { /* entry idx, value */ 11, VALUE_OPT_WRITE,
  1063. /* equiv idx, value */ NOLIMIT, NOLIMIT,
  1064. /* equivalenced to */ INDEX_OPT_INTF1,
  1065. /* min, max, act ct */ 0, 1, 0,
  1066. /* opt state flags */ WRITE_FLAGS, 0,
  1067. /* last opt argumnt */ { NULL }, /* --write */
  1068. /* arg list/cookie */ NULL,
  1069. /* must/cannot opts */ NULL, aWriteCantList,
  1070. /* option proc */ NULL,
  1071. /* desc, NAME, name */ WRITE_DESC, WRITE_NAME, WRITE_name,
  1072. /* disablement strs */ NULL, NULL },
  1073. { /* entry idx, value */ 12, VALUE_OPT_INCLUDE,
  1074. /* equiv idx, value */ 12, VALUE_OPT_INCLUDE,
  1075. /* equivalenced to */ NO_EQUIVALENT,
  1076. /* min, max, act ct */ 0, 1, 0,
  1077. /* opt state flags */ INCLUDE_FLAGS, 0,
  1078. /* last opt argumnt */ { NULL }, /* --include */
  1079. /* arg list/cookie */ NULL,
  1080. /* must/cannot opts */ NULL, aIncludeCantList,
  1081. /* option proc */ doOptInclude,
  1082. /* desc, NAME, name */ INCLUDE_DESC, INCLUDE_NAME, INCLUDE_name,
  1083. /* disablement strs */ NULL, NULL },
  1084. { /* entry idx, value */ 13, VALUE_OPT_EXCLUDE,
  1085. /* equiv idx, value */ 13, VALUE_OPT_EXCLUDE,
  1086. /* equivalenced to */ NO_EQUIVALENT,
  1087. /* min, max, act ct */ 0, 1, 0,
  1088. /* opt state flags */ EXCLUDE_FLAGS, 0,
  1089. /* last opt argumnt */ { NULL }, /* --exclude */
  1090. /* arg list/cookie */ NULL,
  1091. /* must/cannot opts */ NULL, aExcludeCantList,
  1092. /* option proc */ doOptExclude,
  1093. /* desc, NAME, name */ EXCLUDE_DESC, EXCLUDE_NAME, EXCLUDE_name,
  1094. /* disablement strs */ NULL, NULL },
  1095. { /* entry idx, value */ 14, VALUE_OPT_LISTNICS,
  1096. /* equiv idx, value */ 14, VALUE_OPT_LISTNICS,
  1097. /* equivalenced to */ NO_EQUIVALENT,
  1098. /* min, max, act ct */ 0, 1, 0,
  1099. /* opt state flags */ LISTNICS_FLAGS, 0,
  1100. /* last opt argumnt */ { NULL }, /* --listnics */
  1101. /* arg list/cookie */ NULL,
  1102. /* must/cannot opts */ NULL, NULL,
  1103. /* option proc */ doOptListnics,
  1104. /* desc, NAME, name */ LISTNICS_DESC, LISTNICS_NAME, LISTNICS_name,
  1105. /* disablement strs */ NULL, NULL },
  1106. { /* entry idx, value */ 15, VALUE_OPT_LOOP,
  1107. /* equiv idx, value */ 15, VALUE_OPT_LOOP,
  1108. /* equivalenced to */ NO_EQUIVALENT,
  1109. /* min, max, act ct */ 0, 1, 0,
  1110. /* opt state flags */ LOOP_FLAGS, 0,
  1111. /* last opt argumnt */ { LOOP_DFT_ARG },
  1112. /* arg list/cookie */ NULL,
  1113. /* must/cannot opts */ NULL, NULL,
  1114. /* option proc */ doOptLoop,
  1115. /* desc, NAME, name */ LOOP_DESC, LOOP_NAME, LOOP_name,
  1116. /* disablement strs */ NULL, NULL },
  1117. { /* entry idx, value */ 16, VALUE_OPT_LOOPDELAY_MS,
  1118. /* equiv idx, value */ 16, VALUE_OPT_LOOPDELAY_MS,
  1119. /* equivalenced to */ NO_EQUIVALENT,
  1120. /* min, max, act ct */ 0, 1, 0,
  1121. /* opt state flags */ LOOPDELAY_MS_FLAGS, 0,
  1122. /* last opt argumnt */ { LOOPDELAY_MS_DFT_ARG },
  1123. /* arg list/cookie */ NULL,
  1124. /* must/cannot opts */ aLoopdelay_MsMustList, aLoopdelay_MsCantList,
  1125. /* option proc */ doOptLoopdelay_Ms,
  1126. /* desc, NAME, name */ LOOPDELAY_MS_DESC, LOOPDELAY_MS_NAME, LOOPDELAY_MS_name,
  1127. /* disablement strs */ NULL, NULL },
  1128. { /* entry idx, value */ 17, VALUE_OPT_LOOPDELAY_NS,
  1129. /* equiv idx, value */ 17, VALUE_OPT_LOOPDELAY_NS,
  1130. /* equivalenced to */ NO_EQUIVALENT,
  1131. /* min, max, act ct */ 0, 1, 0,
  1132. /* opt state flags */ LOOPDELAY_NS_FLAGS, 0,
  1133. /* last opt argumnt */ { LOOPDELAY_NS_DFT_ARG },
  1134. /* arg list/cookie */ NULL,
  1135. /* must/cannot opts */ aLoopdelay_NsMustList, aLoopdelay_NsCantList,
  1136. /* option proc */ doOptLoopdelay_Ns,
  1137. /* desc, NAME, name */ LOOPDELAY_NS_DESC, LOOPDELAY_NS_NAME, LOOPDELAY_NS_name,
  1138. /* disablement strs */ NULL, NULL },
  1139. { /* entry idx, value */ 18, VALUE_OPT_PKTLEN,
  1140. /* equiv idx, value */ 18, VALUE_OPT_PKTLEN,
  1141. /* equivalenced to */ NO_EQUIVALENT,
  1142. /* min, max, act ct */ 0, 1, 0,
  1143. /* opt state flags */ PKTLEN_FLAGS, 0,
  1144. /* last opt argumnt */ { NULL }, /* --pktlen */
  1145. /* arg list/cookie */ NULL,
  1146. /* must/cannot opts */ NULL, NULL,
  1147. /* option proc */ NULL,
  1148. /* desc, NAME, name */ PKTLEN_DESC, PKTLEN_NAME, PKTLEN_name,
  1149. /* disablement strs */ NULL, NULL },
  1150. { /* entry idx, value */ 19, VALUE_OPT_LIMIT,
  1151. /* equiv idx, value */ 19, VALUE_OPT_LIMIT,
  1152. /* equivalenced to */ NO_EQUIVALENT,
  1153. /* min, max, act ct */ 0, 1, 0,
  1154. /* opt state flags */ LIMIT_FLAGS, 0,
  1155. /* last opt argumnt */ { LIMIT_DFT_ARG },
  1156. /* arg list/cookie */ NULL,
  1157. /* must/cannot opts */ NULL, NULL,
  1158. /* option proc */ doOptLimit,
  1159. /* desc, NAME, name */ LIMIT_DESC, LIMIT_NAME, LIMIT_name,
  1160. /* disablement strs */ NULL, NULL },
  1161. { /* entry idx, value */ 20, VALUE_OPT_DURATION,
  1162. /* equiv idx, value */ 20, VALUE_OPT_DURATION,
  1163. /* equivalenced to */ NO_EQUIVALENT,
  1164. /* min, max, act ct */ 0, 1, 0,
  1165. /* opt state flags */ DURATION_FLAGS, 0,
  1166. /* last opt argumnt */ { DURATION_DFT_ARG },
  1167. /* arg list/cookie */ NULL,
  1168. /* must/cannot opts */ NULL, NULL,
  1169. /* option proc */ doOptDuration,
  1170. /* desc, NAME, name */ DURATION_DESC, DURATION_NAME, DURATION_name,
  1171. /* disablement strs */ NULL, NULL },
  1172. { /* entry idx, value */ 21, VALUE_OPT_MULTIPLIER,
  1173. /* equiv idx, value */ 21, VALUE_OPT_MULTIPLIER,
  1174. /* equivalenced to */ NO_EQUIVALENT,
  1175. /* min, max, act ct */ 0, 1, 0,
  1176. /* opt state flags */ MULTIPLIER_FLAGS, 0,
  1177. /* last opt argumnt */ { NULL }, /* --multiplier */
  1178. /* arg list/cookie */ NULL,
  1179. /* must/cannot opts */ NULL, aMultiplierCantList,
  1180. /* option proc */ NULL,
  1181. /* desc, NAME, name */ MULTIPLIER_DESC, MULTIPLIER_NAME, MULTIPLIER_name,
  1182. /* disablement strs */ NULL, NULL },
  1183. { /* entry idx, value */ 22, VALUE_OPT_PPS,
  1184. /* equiv idx, value */ 22, VALUE_OPT_PPS,
  1185. /* equivalenced to */ NO_EQUIVALENT,
  1186. /* min, max, act ct */ 0, 1, 0,
  1187. /* opt state flags */ PPS_FLAGS, 0,
  1188. /* last opt argumnt */ { NULL }, /* --pps */
  1189. /* arg list/cookie */ NULL,
  1190. /* must/cannot opts */ NULL, aPpsCantList,
  1191. /* option proc */ NULL,
  1192. /* desc, NAME, name */ PPS_DESC, PPS_NAME, PPS_name,
  1193. /* disablement strs */ NULL, NULL },
  1194. { /* entry idx, value */ 23, VALUE_OPT_MBPS,
  1195. /* equiv idx, value */ 23, VALUE_OPT_MBPS,
  1196. /* equivalenced to */ NO_EQUIVALENT,
  1197. /* min, max, act ct */ 0, 1, 0,
  1198. /* opt state flags */ MBPS_FLAGS, 0,
  1199. /* last opt argumnt */ { NULL }, /* --mbps */
  1200. /* arg list/cookie */ NULL,
  1201. /* must/cannot opts */ NULL, aMbpsCantList,
  1202. /* option proc */ NULL,
  1203. /* desc, NAME, name */ MBPS_DESC, MBPS_NAME, MBPS_name,
  1204. /* disablement strs */ NULL, NULL },
  1205. { /* entry idx, value */ 24, VALUE_OPT_TOPSPEED,
  1206. /* equiv idx, value */ 24, VALUE_OPT_TOPSPEED,
  1207. /* equivalenced to */ NO_EQUIVALENT,
  1208. /* min, max, act ct */ 0, 1, 0,
  1209. /* opt state flags */ TOPSPEED_FLAGS, 0,
  1210. /* last opt argumnt */ { NULL }, /* --topspeed */
  1211. /* arg list/cookie */ NULL,
  1212. /* must/cannot opts */ NULL, aTopspeedCantList,
  1213. /* option proc */ NULL,
  1214. /* desc, NAME, name */ TOPSPEED_DESC, TOPSPEED_NAME, TOPSPEED_name,
  1215. /* disablement strs */ NULL, NULL },
  1216. { /* entry idx, value */ 25, VALUE_OPT_ONEATATIME,
  1217. /* equiv idx, value */ 25, VALUE_OPT_ONEATATIME,
  1218. /* equivalenced to */ NO_EQUIVALENT,
  1219. /* min, max, act ct */ 0, 1, 0,
  1220. /* opt state flags */ ONEATATIME_FLAGS, 0,
  1221. /* last opt argumnt */ { NULL }, /* --oneatatime */
  1222. /* arg list/cookie */ NULL,
  1223. /* must/cannot opts */ NULL, aOneatatimeCantList,
  1224. /* option proc */ NULL,
  1225. /* desc, NAME, name */ ONEATATIME_DESC, ONEATATIME_NAME, ONEATATIME_name,
  1226. /* disablement strs */ NULL, NULL },
  1227. { /* entry idx, value */ 26, VALUE_OPT_PPS_MULTI,
  1228. /* equiv idx, value */ 26, VALUE_OPT_PPS_MULTI,
  1229. /* equivalenced to */ NO_EQUIVALENT,
  1230. /* min, max, act ct */ 0, 1, 0,
  1231. /* opt state flags */ PPS_MULTI_FLAGS, 0,
  1232. /* last opt argumnt */ { PPS_MULTI_DFT_ARG },
  1233. /* arg list/cookie */ NULL,
  1234. /* must/cannot opts */ aPps_MultiMustList, NULL,
  1235. /* option proc */ doOptPps_Multi,
  1236. /* desc, NAME, name */ PPS_MULTI_DESC, PPS_MULTI_NAME, PPS_MULTI_name,
  1237. /* disablement strs */ NULL, NULL },
  1238. { /* entry idx, value */ 27, VALUE_OPT_UNIQUE_IP,
  1239. /* equiv idx, value */ 27, VALUE_OPT_UNIQUE_IP,
  1240. /* equivalenced to */ NO_EQUIVALENT,
  1241. /* min, max, act ct */ 0, 1, 0,
  1242. /* opt state flags */ UNIQUE_IP_FLAGS, 0,
  1243. /* last opt argumnt */ { NULL }, /* --unique-ip */
  1244. /* arg list/cookie */ NULL,
  1245. /* must/cannot opts */ aUnique_IpMustList, NULL,
  1246. /* option proc */ NULL,
  1247. /* desc, NAME, name */ UNIQUE_IP_DESC, UNIQUE_IP_NAME, UNIQUE_IP_name,
  1248. /* disablement strs */ NULL, NULL },
  1249. { /* entry idx, value */ 28, VALUE_OPT_UNIQUE_IP_LOOPS,
  1250. /* equiv idx, value */ 28, VALUE_OPT_UNIQUE_IP_LOOPS,
  1251. /* equivalenced to */ NO_EQUIVALENT,
  1252. /* min, max, act ct */ 0, 1, 0,
  1253. /* opt state flags */ UNIQUE_IP_LOOPS_FLAGS, 0,
  1254. /* last opt argumnt */ { NULL }, /* --unique-ip-loops */
  1255. /* arg list/cookie */ NULL,
  1256. /* must/cannot opts */ aUnique_Ip_LoopsMustList, NULL,
  1257. /* option proc */ NULL,
  1258. /* desc, NAME, name */ UNIQUE_IP_LOOPS_DESC, UNIQUE_IP_LOOPS_NAME, UNIQUE_IP_LOOPS_name,
  1259. /* disablement strs */ NULL, NULL },
  1260. { /* entry idx, value */ 29, VALUE_OPT_NETMAP,
  1261. /* equiv idx, value */ 29, VALUE_OPT_NETMAP,
  1262. /* equivalenced to */ NO_EQUIVALENT,
  1263. /* min, max, act ct */ 0, 1, 0,
  1264. /* opt state flags */ NETMAP_FLAGS, 0,
  1265. /* last opt argumnt */ { NULL }, /* --netmap */
  1266. /* arg list/cookie */ NULL,
  1267. /* must/cannot opts */ NULL, NULL,
  1268. /* option proc */ NULL,
  1269. /* desc, NAME, name */ NETMAP_DESC, NETMAP_NAME, NETMAP_name,
  1270. /* disablement strs */ NULL, NULL },
  1271. { /* entry idx, value */ 30, VALUE_OPT_NM_DELAY,
  1272. /* equiv idx, value */ 30, VALUE_OPT_NM_DELAY,
  1273. /* equivalenced to */ NO_EQUIVALENT,
  1274. /* min, max, act ct */ 0, 1, 0,
  1275. /* opt state flags */ NM_DELAY_FLAGS, 0,
  1276. /* last opt argumnt */ { NM_DELAY_DFT_ARG },
  1277. /* arg list/cookie */ NULL,
  1278. /* must/cannot opts */ NULL, NULL,
  1279. /* option proc */ optionNumericVal,
  1280. /* desc, NAME, name */ NM_DELAY_DESC, NM_DELAY_NAME, NM_DELAY_name,
  1281. /* disablement strs */ NULL, NULL },
  1282. { /* entry idx, value */ 31, VALUE_OPT_NO_FLOW_STATS,
  1283. /* equiv idx, value */ 31, VALUE_OPT_NO_FLOW_STATS,
  1284. /* equivalenced to */ NO_EQUIVALENT,
  1285. /* min, max, act ct */ 0, 1, 0,
  1286. /* opt state flags */ NO_FLOW_STATS_FLAGS, 0,
  1287. /* last opt argumnt */ { NULL }, /* --no-flow-stats */
  1288. /* arg list/cookie */ NULL,
  1289. /* must/cannot opts */ NULL, NULL,
  1290. /* option proc */ NULL,
  1291. /* desc, NAME, name */ NO_FLOW_STATS_DESC, NO_FLOW_STATS_NAME, NO_FLOW_STATS_name,
  1292. /* disablement strs */ NULL, NULL },
  1293. { /* entry idx, value */ 32, VALUE_OPT_FLOW_EXPIRY,
  1294. /* equiv idx, value */ 32, VALUE_OPT_FLOW_EXPIRY,
  1295. /* equivalenced to */ NO_EQUIVALENT,
  1296. /* min, max, act ct */ 0, 1, 0,
  1297. /* opt state flags */ FLOW_EXPIRY_FLAGS, 0,
  1298. /* last opt argumnt */ { FLOW_EXPIRY_DFT_ARG },
  1299. /* arg list/cookie */ NULL,
  1300. /* must/cannot opts */ NULL, aFlow_ExpiryCantList,
  1301. /* option proc */ doOptFlow_Expiry,
  1302. /* desc, NAME, name */ FLOW_EXPIRY_DESC, FLOW_EXPIRY_NAME, FLOW_EXPIRY_name,
  1303. /* disablement strs */ NULL, NULL },
  1304. { /* entry idx, value */ 33, VALUE_OPT_PID,
  1305. /* equiv idx, value */ 33, VALUE_OPT_PID,
  1306. /* equivalenced to */ NO_EQUIVALENT,
  1307. /* min, max, act ct */ 0, 1, 0,
  1308. /* opt state flags */ PID_FLAGS, 0,
  1309. /* last opt argumnt */ { NULL }, /* --pid */
  1310. /* arg list/cookie */ NULL,
  1311. /* must/cannot opts */ NULL, NULL,
  1312. /* option proc */ doOptPid,
  1313. /* desc, NAME, name */ PID_DESC, PID_NAME, PID_name,
  1314. /* disablement strs */ NULL, NULL },
  1315. { /* entry idx, value */ 34, VALUE_OPT_STATS,
  1316. /* equiv idx, value */ 34, VALUE_OPT_STATS,
  1317. /* equivalenced to */ NO_EQUIVALENT,
  1318. /* min, max, act ct */ 0, 1, 0,
  1319. /* opt state flags */ STATS_FLAGS, 0,
  1320. /* last opt argumnt */ { NULL }, /* --stats */
  1321. /* arg list/cookie */ NULL,
  1322. /* must/cannot opts */ NULL, NULL,
  1323. /* option proc */ doOptStats,
  1324. /* desc, NAME, name */ STATS_DESC, STATS_NAME, STATS_name,
  1325. /* disablement strs */ NULL, NULL },
  1326. { /* entry idx, value */ 35, VALUE_OPT_SUPPRESS_WARNINGS,
  1327. /* equiv idx, value */ 35, VALUE_OPT_SUPPRESS_WARNINGS,
  1328. /* equivalenced to */ NO_EQUIVALENT,
  1329. /* min, max, act ct */ 0, 1, 0,
  1330. /* opt state flags */ SUPPRESS_WARNINGS_FLAGS, 0,
  1331. /* last opt argumnt */ { NULL }, /* --suppress-warnings */
  1332. /* arg list/cookie */ NULL,
  1333. /* must/cannot opts */ NULL, NULL,
  1334. /* option proc */ NULL,
  1335. /* desc, NAME, name */ SUPPRESS_WARNINGS_DESC, SUPPRESS_WARNINGS_NAME, SUPPRESS_WARNINGS_name,
  1336. /* disablement strs */ NULL, NULL },
  1337. { /* entry idx, value */ 36, VALUE_OPT_XDP,
  1338. /* equiv idx, value */ 36, VALUE_OPT_XDP,
  1339. /* equivalenced to */ NO_EQUIVALENT,
  1340. /* min, max, act ct */ 0, 1, 0,
  1341. /* opt state flags */ XDP_FLAGS, 0,
  1342. /* last opt argumnt */ { NULL }, /* --xdp */
  1343. /* arg list/cookie */ NULL,
  1344. /* must/cannot opts */ NULL, NULL,
  1345. /* option proc */ NULL,
  1346. /* desc, NAME, name */ XDP_DESC, XDP_NAME, XDP_name,
  1347. /* disablement strs */ NULL, NULL },
  1348. { /* entry idx, value */ 37, VALUE_OPT_XDP_BATCH_SIZE,
  1349. /* equiv idx, value */ 37, VALUE_OPT_XDP_BATCH_SIZE,
  1350. /* equivalenced to */ NO_EQUIVALENT,
  1351. /* min, max, act ct */ 0, 1, 0,
  1352. /* opt state flags */ XDP_BATCH_SIZE_FLAGS, 0,
  1353. /* last opt argumnt */ { XDP_BATCH_SIZE_DFT_ARG },
  1354. /* arg list/cookie */ NULL,
  1355. /* must/cannot opts */ NULL, NULL,
  1356. /* option proc */ doOptXdp_Batch_Size,
  1357. /* desc, NAME, name */ XDP_BATCH_SIZE_DESC, XDP_BATCH_SIZE_NAME, XDP_BATCH_SIZE_name,
  1358. /* disablement strs */ NULL, NULL },
  1359. { /* entry idx, value */ 38, VALUE_OPT_VERSION,
  1360. /* equiv idx, value */ 38, VALUE_OPT_VERSION,
  1361. /* equivalenced to */ NO_EQUIVALENT,
  1362. /* min, max, act ct */ 0, 1, 0,
  1363. /* opt state flags */ VERSION_FLAGS, 0,
  1364. /* last opt argumnt */ { NULL }, /* --version */
  1365. /* arg list/cookie */ NULL,
  1366. /* must/cannot opts */ NULL, NULL,
  1367. /* option proc */ doOptVersion,
  1368. /* desc, NAME, name */ VERSION_DESC, VERSION_NAME, VERSION_name,
  1369. /* disablement strs */ NULL, NULL },
  1370. { /* entry idx, value */ 39, VALUE_OPT_LESS_HELP,
  1371. /* equiv idx, value */ 39, VALUE_OPT_LESS_HELP,
  1372. /* equivalenced to */ NO_EQUIVALENT,
  1373. /* min, max, act ct */ 0, 1, 0,
  1374. /* opt state flags */ LESS_HELP_FLAGS, 0,
  1375. /* last opt argumnt */ { NULL }, /* --less-help */
  1376. /* arg list/cookie */ NULL,
  1377. /* must/cannot opts */ NULL, NULL,
  1378. /* option proc */ doOptLess_Help,
  1379. /* desc, NAME, name */ LESS_HELP_DESC, LESS_HELP_NAME, LESS_HELP_name,
  1380. /* disablement strs */ NULL, NULL },
  1381. { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
  1382. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
  1383. /* equivalenced to */ NO_EQUIVALENT,
  1384. /* min, max, act ct */ 0, 1, 0,
  1385. /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
  1386. /* last opt argumnt */ { NULL },
  1387. /* arg list/cookie */ NULL,
  1388. /* must/cannot opts */ NULL, NULL,
  1389. /* option proc */ doUsageOpt,
  1390. /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
  1391. /* disablement strs */ NULL, NULL },
  1392. { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
  1393. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
  1394. /* equivalenced to */ NO_EQUIVALENT,
  1395. /* min, max, act ct */ 0, 1, 0,
  1396. /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
  1397. /* last opt argumnt */ { NULL },
  1398. /* arg list/cookie */ NULL,
  1399. /* must/cannot opts */ NULL, NULL,
  1400. /* option proc */ optionPagedUsage,
  1401. /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
  1402. /* disablement strs */ NULL, NULL },
  1403. { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
  1404. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
  1405. /* equivalenced to */ NO_EQUIVALENT,
  1406. /* min, max, act ct */ 0, 1, 0,
  1407. /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
  1408. | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
  1409. /* last opt argumnt */ { NULL },
  1410. /* arg list/cookie */ NULL,
  1411. /* must/cannot opts */ NULL, NULL,
  1412. /* option proc */ NULL,
  1413. /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
  1414. /* disablement strs */ NULL, NULL },
  1415. { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
  1416. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
  1417. /* equivalenced to */ NO_EQUIVALENT,
  1418. /* min, max, act ct */ 0, NOLIMIT, 0,
  1419. /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
  1420. | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
  1421. /* last opt argumnt */ { NULL },
  1422. /* arg list/cookie */ NULL,
  1423. /* must/cannot opts */ NULL, NULL,
  1424. /* option proc */ optionLoadOpt,
  1425. /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
  1426. /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
  1427. };
  1428. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1429. /** Reference to the upper cased version of tcpreplay. */
  1430. #define zPROGNAME (tcpreplay_opt_strs+3550)
  1431. /** Reference to the title line for tcpreplay usage. */
  1432. #define zUsageTitle (tcpreplay_opt_strs+3560)
  1433. /** tcpreplay configuration file name. */
  1434. #define zRcName (tcpreplay_opt_strs+3725)
  1435. /** Directories to search for tcpreplay config files. */
  1436. static char const * const apzHomeList[2] = {
  1437. tcpreplay_opt_strs+3721,
  1438. NULL };
  1439. /** The tcpreplay program bug email address. */
  1440. #define zBugsAddr (tcpreplay_opt_strs+3738)
  1441. /** Clarification/explanation of what tcpreplay does. */
  1442. #define zExplain (tcpreplay_opt_strs+3776)
  1443. /** Extra detail explaining what tcpreplay does. */
  1444. #define zDetail (tcpreplay_opt_strs+3899)
  1445. /** The full version string for tcpreplay. */
  1446. #define zFullVersion (NULL)
  1447. /* extracted from optcode.tlib near line 342 */
  1448. #if defined(ENABLE_NLS)
  1449. # define OPTPROC_BASE OPTPROC_TRANSLATE
  1450. static tOptionXlateProc translate_option_strings;
  1451. #else
  1452. # define OPTPROC_BASE OPTPROC_NONE
  1453. # define translate_option_strings NULL
  1454. #endif /* ENABLE_NLS */
  1455. #define tcpreplay_full_usage (NULL)
  1456. #define tcpreplay_short_usage (NULL)
  1457. #endif /* not defined __doxygen__ */
  1458. /*
  1459. * Create the static procedure(s) declared above.
  1460. */
  1461. /**
  1462. * The callout function that invokes the optionUsage function.
  1463. *
  1464. * @param[in] opts the AutoOpts option description structure
  1465. * @param[in] od the descriptor for the "help" (usage) option.
  1466. * @noreturn
  1467. */
  1468. static void
  1469. doUsageOpt(tOptions * opts, tOptDesc * od)
  1470. {
  1471. int ex_code;
  1472. ex_code = TCPREPLAY_EXIT_SUCCESS;
  1473. optionUsage(&tcpreplayOptions, ex_code);
  1474. /* NOTREACHED */
  1475. exit(TCPREPLAY_EXIT_FAILURE);
  1476. (void)opts;
  1477. (void)od;
  1478. }
  1479. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1480. /**
  1481. * Code to handle the dbug option, when DEBUG is #define-d.
  1482. * If configured with --enable-debug, then you can specify a verbosity
  1483. * level for debugging output. Higher numbers increase verbosity.
  1484. * @param[in] pOptions the tcpreplay options data structure
  1485. * @param[in,out] pOptDesc the option descriptor for this option.
  1486. */
  1487. #ifdef DEBUG
  1488. static void
  1489. doOptDbug(tOptions* pOptions, tOptDesc* pOptDesc)
  1490. {
  1491. static struct {long rmin, rmax;} const rng[1] = {
  1492. { 0, 5 } };
  1493. int ix;
  1494. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1495. goto emit_ranges;
  1496. optionNumericVal(pOptions, pOptDesc);
  1497. for (ix = 0; ix < 1; ix++) {
  1498. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1499. continue; /* ranges need not be ordered. */
  1500. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1501. return;
  1502. if (rng[ix].rmax == LONG_MIN)
  1503. continue;
  1504. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1505. return;
  1506. }
  1507. option_usage_fp = stderr;
  1508. emit_ranges:
  1509. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1510. }
  1511. #endif /* defined DEBUG */
  1512. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1513. /**
  1514. * Code to handle the include option.
  1515. * Override default of processing all packets stored in the capture file and only
  1516. * send packets that are part of a supplied list of packet numbers.
  1517. *
  1518. * @example
  1519. * -x P:1-5,9,15,72-
  1520. * @end example
  1521. * would skip packets 1 through 5, the 9th and 15th packet, and packets 72 until the
  1522. * end of the file
  1523. * @param[in] pOptions the tcpreplay options data structure
  1524. * @param[in,out] pOptDesc the option descriptor for this option.
  1525. */
  1526. static void
  1527. doOptInclude(tOptions* pOptions, tOptDesc* pOptDesc)
  1528. {
  1529. /*
  1530. * Be sure the flag-code[0] handles special values for the options pointer
  1531. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  1532. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  1533. * reset its state.
  1534. */
  1535. /* extracted from tcpreplay_opts.def, line 312 */
  1536. char *include;
  1537. include = safe_strdup(OPT_ARG(INCLUDE));
  1538. ctx->options->is_exclude = false;
  1539. if (!parse_list(&ctx->options->list, include))
  1540. errx(-1, "Unable to parse include/exclude rule: %s", OPT_ARG(INCLUDE));
  1541. free(include);
  1542. (void)pOptDesc;
  1543. (void)pOptions;
  1544. }
  1545. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1546. /**
  1547. * Code to handle the exclude option.
  1548. * Override default of processing all packets stored in the capture file and only
  1549. * send packets that are NOT part of a supplied list of packet numbers.
  1550. *
  1551. * @example
  1552. * -x P:1-5,9,15,72-
  1553. * @end example
  1554. * would skip packets 1 through 5, the 9th and 15th packet, and packets 72 until the
  1555. * end of the file
  1556. * @param[in] pOptions the tcpreplay options data structure
  1557. * @param[in,out] pOptDesc the option descriptor for this option.
  1558. */
  1559. static void
  1560. doOptExclude(tOptions* pOptions, tOptDesc* pOptDesc)
  1561. {
  1562. /*
  1563. * Be sure the flag-code[0] handles special values for the options pointer
  1564. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  1565. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  1566. * reset its state.
  1567. */
  1568. /* extracted from tcpreplay_opts.def, line 342 */
  1569. char *exclude;
  1570. exclude = safe_strdup(OPT_ARG(EXCLUDE));
  1571. ctx->options->is_exclude = true;
  1572. if (!parse_list(&ctx->options->list, exclude))
  1573. errx(-1, "Unable to parse include/exclude rule: %s", OPT_ARG(EXCLUDE));
  1574. free(exclude);
  1575. (void)pOptDesc;
  1576. (void)pOptions;
  1577. }
  1578. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1579. /**
  1580. * Code to handle the listnics option, when ENABLE_PCAP_FINDALLDEVS is #define-d.
  1581. *
  1582. * @param[in] pOptions the tcpreplay options data structure
  1583. * @param[in,out] pOptDesc the option descriptor for this option.
  1584. */
  1585. #ifdef ENABLE_PCAP_FINDALLDEVS
  1586. static void
  1587. doOptListnics(tOptions* pOptions, tOptDesc* pOptDesc)
  1588. {
  1589. /*
  1590. * Be sure the flag-code[0] handles special values for the options pointer
  1591. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  1592. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  1593. * reset its state.
  1594. */
  1595. /* extracted from tcpreplay_opts.def, line 373 */
  1596. interface_list_t *list = get_interface_list();
  1597. list_interfaces(list);
  1598. free(list);
  1599. exit(0);
  1600. (void)pOptDesc;
  1601. (void)pOptions;
  1602. }
  1603. #endif /* defined ENABLE_PCAP_FINDALLDEVS */
  1604. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1605. /**
  1606. * Code to handle the loop option.
  1607. *
  1608. * @param[in] pOptions the tcpreplay options data structure
  1609. * @param[in,out] pOptDesc the option descriptor for this option.
  1610. */
  1611. static void
  1612. doOptLoop(tOptions* pOptions, tOptDesc* pOptDesc)
  1613. {
  1614. static struct {long rmin, rmax;} const rng[1] = {
  1615. { 0, LONG_MAX } };
  1616. int ix;
  1617. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1618. goto emit_ranges;
  1619. optionNumericVal(pOptions, pOptDesc);
  1620. for (ix = 0; ix < 1; ix++) {
  1621. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1622. continue; /* ranges need not be ordered. */
  1623. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1624. return;
  1625. if (rng[ix].rmax == LONG_MIN)
  1626. continue;
  1627. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1628. return;
  1629. }
  1630. option_usage_fp = stderr;
  1631. emit_ranges:
  1632. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1633. }
  1634. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1635. /**
  1636. * Code to handle the loopdelay-ms option.
  1637. *
  1638. * @param[in] pOptions the tcpreplay options data structure
  1639. * @param[in,out] pOptDesc the option descriptor for this option.
  1640. */
  1641. static void
  1642. doOptLoopdelay_Ms(tOptions* pOptions, tOptDesc* pOptDesc)
  1643. {
  1644. static struct {long rmin, rmax;} const rng[1] = {
  1645. { 0, LONG_MAX } };
  1646. int ix;
  1647. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1648. goto emit_ranges;
  1649. optionNumericVal(pOptions, pOptDesc);
  1650. for (ix = 0; ix < 1; ix++) {
  1651. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1652. continue; /* ranges need not be ordered. */
  1653. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1654. return;
  1655. if (rng[ix].rmax == LONG_MIN)
  1656. continue;
  1657. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1658. return;
  1659. }
  1660. option_usage_fp = stderr;
  1661. emit_ranges:
  1662. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1663. }
  1664. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1665. /**
  1666. * Code to handle the loopdelay-ns option.
  1667. * By default, tcpreplay will use loop delay with microsecond accuracy (loopdelay-ms).
  1668. * In order to use loop delay with nanosecond accuracy you need to use nano packet timing mode.
  1669. * @param[in] pOptions the tcpreplay options data structure
  1670. * @param[in,out] pOptDesc the option descriptor for this option.
  1671. */
  1672. static void
  1673. doOptLoopdelay_Ns(tOptions* pOptions, tOptDesc* pOptDesc)
  1674. {
  1675. static struct {long rmin, rmax;} const rng[1] = {
  1676. { 0, LONG_MAX } };
  1677. int ix;
  1678. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1679. goto emit_ranges;
  1680. optionNumericVal(pOptions, pOptDesc);
  1681. for (ix = 0; ix < 1; ix++) {
  1682. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1683. continue; /* ranges need not be ordered. */
  1684. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1685. return;
  1686. if (rng[ix].rmax == LONG_MIN)
  1687. continue;
  1688. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1689. return;
  1690. }
  1691. option_usage_fp = stderr;
  1692. emit_ranges:
  1693. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1694. }
  1695. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1696. /**
  1697. * Code to handle the limit option.
  1698. * By default, tcpreplay will send all the packets. Alternatively, you can
  1699. * specify a maximum number of packets to send.
  1700. * @param[in] pOptions the tcpreplay options data structure
  1701. * @param[in,out] pOptDesc the option descriptor for this option.
  1702. */
  1703. static void
  1704. doOptLimit(tOptions* pOptions, tOptDesc* pOptDesc)
  1705. {
  1706. static struct {long rmin, rmax;} const rng[1] = {
  1707. { 1, LONG_MAX } };
  1708. int ix;
  1709. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1710. goto emit_ranges;
  1711. optionNumericVal(pOptions, pOptDesc);
  1712. for (ix = 0; ix < 1; ix++) {
  1713. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1714. continue; /* ranges need not be ordered. */
  1715. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1716. return;
  1717. if (rng[ix].rmax == LONG_MIN)
  1718. continue;
  1719. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1720. return;
  1721. }
  1722. option_usage_fp = stderr;
  1723. emit_ranges:
  1724. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1725. }
  1726. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1727. /**
  1728. * Code to handle the duration option.
  1729. * By default, tcpreplay will send all the packets. Alternatively, you can
  1730. * specify a maximum number of seconds to transmit.
  1731. * @param[in] pOptions the tcpreplay options data structure
  1732. * @param[in,out] pOptDesc the option descriptor for this option.
  1733. */
  1734. static void
  1735. doOptDuration(tOptions* pOptions, tOptDesc* pOptDesc)
  1736. {
  1737. static struct {long rmin, rmax;} const rng[1] = {
  1738. { 1, LONG_MAX } };
  1739. int ix;
  1740. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1741. goto emit_ranges;
  1742. optionNumericVal(pOptions, pOptDesc);
  1743. for (ix = 0; ix < 1; ix++) {
  1744. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1745. continue; /* ranges need not be ordered. */
  1746. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1747. return;
  1748. if (rng[ix].rmax == LONG_MIN)
  1749. continue;
  1750. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1751. return;
  1752. }
  1753. option_usage_fp = stderr;
  1754. emit_ranges:
  1755. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1756. }
  1757. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1758. /**
  1759. * Code to handle the pps-multi option.
  1760. * When trying to send packets at very high rates, the time between each packet
  1761. * can be so short that it is impossible to accurately sleep for the required
  1762. * period of time. This option allows you to send multiple packets at a time,
  1763. * thus allowing for longer sleep times which can be more accurately implemented.
  1764. * @param[in] pOptions the tcpreplay options data structure
  1765. * @param[in,out] pOptDesc the option descriptor for this option.
  1766. */
  1767. static void
  1768. doOptPps_Multi(tOptions* pOptions, tOptDesc* pOptDesc)
  1769. {
  1770. static struct {long rmin, rmax;} const rng[1] = {
  1771. { 1, LONG_MAX } };
  1772. int ix;
  1773. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1774. goto emit_ranges;
  1775. optionNumericVal(pOptions, pOptDesc);
  1776. for (ix = 0; ix < 1; ix++) {
  1777. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1778. continue; /* ranges need not be ordered. */
  1779. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1780. return;
  1781. if (rng[ix].rmax == LONG_MIN)
  1782. continue;
  1783. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1784. return;
  1785. }
  1786. option_usage_fp = stderr;
  1787. emit_ranges:
  1788. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1789. }
  1790. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1791. /**
  1792. * Code to handle the flow-expiry option.
  1793. * This option will track and report flow expirations based on the flow idle
  1794. * times. The timestamps within the pcap file are used to determine the expiry,
  1795. * not the actual timestamp of the packets are replayed. For example, a value of
  1796. * 30 suggests that if no traffic is seen on a flow for 30 seconds, any
  1797. * subsequent traffic would be considered a new flow, and thereby will increment
  1798. * the flows and flows per second (fps) statistics.
  1799. *
  1800. * This option can be used to optimize flow timeout settings for flow products.
  1801. * Setting the timeout low may lead to flows being dropped when in fact the flow
  1802. * is simply slow to respond. Configuring your flow timeouts too high may
  1803. * increase resources required by your flow product.
  1804. *
  1805. * Note that using this option while replaying at higher than original speeds
  1806. * can lead to inflated flows and fps counts.
  1807. *
  1808. * Default is 0 (no expiry) and a typical value is 30-120 seconds.
  1809. * @param[in] pOptions the tcpreplay options data structure
  1810. * @param[in,out] pOptDesc the option descriptor for this option.
  1811. */
  1812. static void
  1813. doOptFlow_Expiry(tOptions* pOptions, tOptDesc* pOptDesc)
  1814. {
  1815. static struct {long rmin, rmax;} const rng[1] = {
  1816. { 0, LONG_MAX } };
  1817. int ix;
  1818. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1819. goto emit_ranges;
  1820. optionNumericVal(pOptions, pOptDesc);
  1821. for (ix = 0; ix < 1; ix++) {
  1822. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1823. continue; /* ranges need not be ordered. */
  1824. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1825. return;
  1826. if (rng[ix].rmax == LONG_MIN)
  1827. continue;
  1828. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1829. return;
  1830. }
  1831. option_usage_fp = stderr;
  1832. emit_ranges:
  1833. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1834. }
  1835. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1836. /**
  1837. * Code to handle the pid option.
  1838. *
  1839. * @param[in] pOptions the tcpreplay options data structure
  1840. * @param[in,out] pOptDesc the option descriptor for this option.
  1841. */
  1842. static void
  1843. doOptPid(tOptions* pOptions, tOptDesc* pOptDesc)
  1844. {
  1845. /*
  1846. * Be sure the flag-code[0] handles special values for the options pointer
  1847. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  1848. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  1849. * reset its state.
  1850. */
  1851. /* extracted from tcpreplay_opts.def, line 674 */
  1852. fprintf(stderr, "PID: %d\n", getpid());
  1853. (void)pOptDesc;
  1854. (void)pOptions;
  1855. }
  1856. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1857. /**
  1858. * Code to handle the stats option.
  1859. * Note that timed delays are a "best effort" and long delays between
  1860. * sending packets may cause equally long delays between printing statistics.
  1861. * @param[in] pOptions the tcpreplay options data structure
  1862. * @param[in,out] pOptDesc the option descriptor for this option.
  1863. */
  1864. static void
  1865. doOptStats(tOptions* pOptions, tOptDesc* pOptDesc)
  1866. {
  1867. static struct {long rmin, rmax;} const rng[1] = {
  1868. { 0, LONG_MAX } };
  1869. int ix;
  1870. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1871. goto emit_ranges;
  1872. optionNumericVal(pOptions, pOptDesc);
  1873. for (ix = 0; ix < 1; ix++) {
  1874. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1875. continue; /* ranges need not be ordered. */
  1876. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1877. return;
  1878. if (rng[ix].rmax == LONG_MIN)
  1879. continue;
  1880. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1881. return;
  1882. }
  1883. option_usage_fp = stderr;
  1884. emit_ranges:
  1885. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1886. }
  1887. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1888. /**
  1889. * Code to handle the xdp-batch-size option, when HAVE_LIBXDP is #define-d.
  1890. * Higher values may improve performance at the cost of accuracy
  1891. * @param[in] pOptions the tcpreplay options data structure
  1892. * @param[in,out] pOptDesc the option descriptor for this option.
  1893. */
  1894. #ifdef HAVE_LIBXDP
  1895. static void
  1896. doOptXdp_Batch_Size(tOptions* pOptions, tOptDesc* pOptDesc)
  1897. {
  1898. static struct {long rmin, rmax;} const rng[1] = {
  1899. { 1, 4096 } };
  1900. int ix;
  1901. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1902. goto emit_ranges;
  1903. optionNumericVal(pOptions, pOptDesc);
  1904. for (ix = 0; ix < 1; ix++) {
  1905. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1906. continue; /* ranges need not be ordered. */
  1907. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1908. return;
  1909. if (rng[ix].rmax == LONG_MIN)
  1910. continue;
  1911. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1912. return;
  1913. }
  1914. option_usage_fp = stderr;
  1915. emit_ranges:
  1916. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1917. }
  1918. #endif /* defined HAVE_LIBXDP */
  1919. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1920. /**
  1921. * Code to handle the version option.
  1922. *
  1923. * @param[in] pOptions the tcpreplay options data structure
  1924. * @param[in,out] pOptDesc the option descriptor for this option.
  1925. */
  1926. static void
  1927. doOptVersion(tOptions* pOptions, tOptDesc* pOptDesc)
  1928. {
  1929. /*
  1930. * Be sure the flag-code[0] handles special values for the options pointer
  1931. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  1932. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  1933. * reset its state.
  1934. */
  1935. /* extracted from tcpreplay_opts.def, line 732 */
  1936. fprintf(stderr, "tcpreplay version: %s (build %s)", VERSION, git_version());
  1937. #ifdef DEBUG
  1938. fprintf(stderr, " (debug)");
  1939. #endif
  1940. #ifdef TIMESTAMP_TRACE
  1941. fprintf(stderr, " (timestamp-trace)");
  1942. #endif
  1943. fprintf(stderr, "\n");
  1944. fprintf(stderr, "Copyright 2013-2024 by Fred Klassen <tcpreplay at appneta dot com> - AppNeta\n");
  1945. fprintf(stderr, "Copyright 2000-2012 by Aaron Turner <aturner at synfin dot net>\n");
  1946. fprintf(stderr, "The entire Tcpreplay Suite is licensed under the GPLv3\n");
  1947. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  1948. #ifdef HAVE_LIBDNET
  1949. fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION);
  1950. #else
  1951. fprintf(stderr, "Not compiled with libdnet.\n");
  1952. #endif
  1953. #ifdef HAVE_WINPCAP
  1954. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  1955. #elif defined HAVE_PF_RING_PCAP
  1956. fprintf(stderr, "Compiled against PF_RING libpcap: %s\n", get_pcap_version());
  1957. #else
  1958. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  1959. #endif
  1960. #ifdef ENABLE_64BITS
  1961. fprintf(stderr, "64 bit packet counters: enabled\n");
  1962. #else
  1963. fprintf(stderr, "64 bit packet counters: disabled\n");
  1964. #endif
  1965. #ifdef ENABLE_VERBOSE
  1966. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  1967. #else
  1968. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  1969. #endif
  1970. #ifdef TCPREPLAY_EDIT
  1971. fprintf(stderr, "Packet editing: enabled\n");
  1972. #else
  1973. fprintf(stderr, "Packet editing: disabled\n");
  1974. #endif
  1975. #ifdef ENABLE_FRAGROUTE
  1976. fprintf(stderr, "Fragroute engine: enabled\n");
  1977. #else
  1978. fprintf(stderr, "Fragroute engine: disabled\n");
  1979. #endif
  1980. #if defined HAVE_NETMAP
  1981. fprintf(stderr, "Default injection method: %s\n", sendpacket_get_method(NULL));
  1982. #else
  1983. fprintf(stderr, "Injection method: %s\n", sendpacket_get_method(NULL));
  1984. #endif
  1985. #ifdef HAVE_NETMAP
  1986. fprintf(stderr, "Optional injection method: netmap\n");
  1987. #else
  1988. fprintf(stderr, "Not compiled with netmap\n");
  1989. #endif
  1990. #ifdef HAVE_LIBXDP
  1991. fprintf(stderr, "Optional injection method: AF_XDP\n");
  1992. #else
  1993. fprintf(stderr, "Not compiled with AF_XDP\n");
  1994. #endif
  1995. exit(0);
  1996. (void)pOptDesc;
  1997. (void)pOptions;
  1998. }
  1999. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2000. /**
  2001. * Code to handle the less-help option.
  2002. *
  2003. * @param[in] pOptions the tcpreplay options data structure
  2004. * @param[in,out] pOptDesc the option descriptor for this option.
  2005. */
  2006. static void
  2007. doOptLess_Help(tOptions* pOptions, tOptDesc* pOptDesc)
  2008. {
  2009. /*
  2010. * Be sure the flag-code[0] handles special values for the options pointer
  2011. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  2012. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  2013. * reset its state.
  2014. */
  2015. /* extracted from tcpreplay_opts.def, line 804 */
  2016. USAGE(EXIT_FAILURE);
  2017. (void)pOptDesc;
  2018. (void)pOptions;
  2019. }
  2020. /* extracted from optmain.tlib near line 1250 */
  2021. /**
  2022. * The directory containing the data associated with tcpreplay.
  2023. */
  2024. #ifndef PKGDATADIR
  2025. # define PKGDATADIR ""
  2026. #endif
  2027. /**
  2028. * Information about the person or institution that packaged tcpreplay
  2029. * for the current distribution.
  2030. */
  2031. #ifndef WITH_PACKAGER
  2032. # define tcpreplay_packager_info NULL
  2033. #else
  2034. /** Packager information for tcpreplay. */
  2035. static char const tcpreplay_packager_info[] =
  2036. "Packaged by " WITH_PACKAGER
  2037. # ifdef WITH_PACKAGER_VERSION
  2038. " ("WITH_PACKAGER_VERSION")"
  2039. # endif
  2040. # ifdef WITH_PACKAGER_BUG_REPORTS
  2041. "\nReport tcpreplay bugs to " WITH_PACKAGER_BUG_REPORTS
  2042. # endif
  2043. "\n";
  2044. #endif
  2045. #ifndef __doxygen__
  2046. #endif /* __doxygen__ */
  2047. /**
  2048. * The option definitions for tcpreplay. The one structure that
  2049. * binds them all.
  2050. */
  2051. tOptions tcpreplayOptions = {
  2052. OPTIONS_STRUCT_VERSION,
  2053. 0, NULL, /* original argc + argv */
  2054. ( OPTPROC_BASE
  2055. + OPTPROC_ERRSTOP
  2056. + OPTPROC_SHORTOPT
  2057. + OPTPROC_LONGOPT
  2058. + OPTPROC_NO_REQ_OPT
  2059. + OPTPROC_ARGS_REQ
  2060. + OPTPROC_GNUUSAGE ),
  2061. 0, NULL, /* current option index, current option */
  2062. NULL, NULL, zPROGNAME,
  2063. zRcName, zCopyright, zLicenseDescrip,
  2064. zFullVersion, apzHomeList, zUsageTitle,
  2065. zExplain, zDetail, optDesc,
  2066. zBugsAddr, /* address to send bugs to */
  2067. NULL, NULL, /* extensions/saved state */
  2068. optionUsage, /* usage procedure */
  2069. translate_option_strings, /* translation procedure */
  2070. /*
  2071. * Indexes to special options
  2072. */
  2073. { INDEX_OPT_MORE_HELP, /* more-help option index */
  2074. INDEX_OPT_SAVE_OPTS, /* save option index */
  2075. NO_EQUIVALENT, /* '-#' option index */
  2076. NO_EQUIVALENT /* index of default opt */
  2077. },
  2078. 44 /* full option count */, 40 /* user option count */,
  2079. tcpreplay_full_usage, tcpreplay_short_usage,
  2080. NULL, NULL,
  2081. PKGDATADIR, tcpreplay_packager_info
  2082. };
  2083. #if ENABLE_NLS
  2084. /**
  2085. * This code is designed to translate translatable option text for the
  2086. * tcpreplay program. These translations happen upon entry
  2087. * to optionProcess().
  2088. */
  2089. #include <stdio.h>
  2090. #include <stdlib.h>
  2091. #include <string.h>
  2092. #include <unistd.h>
  2093. #ifdef HAVE_DCGETTEXT
  2094. # include <gettext.h>
  2095. #endif
  2096. #include <autoopts/usage-txt.h>
  2097. static char * AO_gettext(char const * pz);
  2098. static void coerce_it(void ** s);
  2099. /**
  2100. * AutoGen specific wrapper function for gettext. It relies on the macro _()
  2101. * to convert from English to the target language, then strdup-duplicates the
  2102. * result string. It tries the "libopts" domain first, then whatever has been
  2103. * set via the \a textdomain(3) call.
  2104. *
  2105. * @param[in] pz the input text used as a lookup key.
  2106. * @returns the translated text (if there is one),
  2107. * or the original text (if not).
  2108. */
  2109. static char *
  2110. AO_gettext(char const * pz)
  2111. {
  2112. char * res;
  2113. if (pz == NULL)
  2114. return NULL;
  2115. #ifdef HAVE_DCGETTEXT
  2116. /*
  2117. * While processing the option_xlateable_txt data, try to use the
  2118. * "libopts" domain. Once we switch to the option descriptor data,
  2119. * do *not* use that domain.
  2120. */
  2121. if (option_xlateable_txt.field_ct != 0) {
  2122. res = dgettext("libopts", pz);
  2123. if (res == pz)
  2124. res = (char *)VOIDP(_(pz));
  2125. } else
  2126. res = (char *)VOIDP(_(pz));
  2127. #else
  2128. res = (char *)VOIDP(_(pz));
  2129. #endif
  2130. if (res == pz)
  2131. return res;
  2132. res = strdup(res);
  2133. if (res == NULL) {
  2134. fputs(_("No memory for duping translated strings\n"), stderr);
  2135. exit(TCPREPLAY_EXIT_FAILURE);
  2136. }
  2137. return res;
  2138. }
  2139. /**
  2140. * All the pointers we use are marked "* const", but they are stored in
  2141. * writable memory. Coerce the mutability and set the pointer.
  2142. */
  2143. static void coerce_it(void ** s) { *s = AO_gettext(*s);
  2144. }
  2145. /**
  2146. * Translate all the translatable strings in the tcpreplayOptions
  2147. * structure defined above. This is done only once.
  2148. */
  2149. static void
  2150. translate_option_strings(void)
  2151. {
  2152. tOptions * const opts = &tcpreplayOptions;
  2153. /*
  2154. * Guard against re-translation. It won't work. The strings will have
  2155. * been changed by the first pass through this code. One shot only.
  2156. */
  2157. if (option_xlateable_txt.field_ct != 0) {
  2158. /*
  2159. * Do the translations. The first pointer follows the field count
  2160. * field. The field count field is the size of a pointer.
  2161. */
  2162. char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
  2163. int ix = option_xlateable_txt.field_ct;
  2164. do {
  2165. ppz++; /* skip over field_ct */
  2166. *ppz = AO_gettext(*ppz);
  2167. } while (--ix > 0);
  2168. /* prevent re-translation and disable "libopts" domain lookup */
  2169. option_xlateable_txt.field_ct = 0;
  2170. coerce_it(VOIDP(&(opts->pzCopyright)));
  2171. coerce_it(VOIDP(&(opts->pzCopyNotice)));
  2172. coerce_it(VOIDP(&(opts->pzFullVersion)));
  2173. coerce_it(VOIDP(&(opts->pzUsageTitle)));
  2174. coerce_it(VOIDP(&(opts->pzExplain)));
  2175. coerce_it(VOIDP(&(opts->pzDetail)));
  2176. {
  2177. tOptDesc * od = opts->pOptDesc;
  2178. for (ix = opts->optCt; ix > 0; ix--, od++)
  2179. coerce_it(VOIDP(&(od->pzText)));
  2180. }
  2181. }
  2182. }
  2183. #endif /* ENABLE_NLS */
  2184. #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
  2185. /** I18N function strictly for xgettext. Do not compile. */
  2186. static void bogus_function(void) {
  2187. /* TRANSLATORS:
  2188. The following dummy function was crated solely so that xgettext can
  2189. extract the correct strings. These strings are actually referenced
  2190. by a field name in the tcpreplayOptions structure noted in the
  2191. comments below. The literal text is defined in tcpreplay_opt_strs.
  2192. NOTE: the strings below are segmented with respect to the source string
  2193. tcpreplay_opt_strs. The strings above are handed off for translation
  2194. at run time a paragraph at a time. Consequently, they are presented here
  2195. for translation a paragraph at a time.
  2196. ALSO: often the description for an option will reference another option
  2197. by name. These are set off with apostrophe quotes (I hope). Do not
  2198. translate option names.
  2199. */
  2200. /* referenced via tcpreplayOptions.pzCopyright */
  2201. puts(_("tcpreplay (tcpreplay)\n\
  2202. Copyright (C) 2000-2024 Aaron Turner and Fred Klassen, all rights reserved.\n\
  2203. This is free software. It is licensed for use, modification and\n\
  2204. redistribution under the terms of the GNU General Public License,\n\
  2205. version 3 or later <http://gnu.org/licenses/gpl.html>\n"));
  2206. /* referenced via tcpreplayOptions.pzCopyNotice */
  2207. puts(_("tcpreplay is free software: you can redistribute it and/or modify it under\n\
  2208. the terms of the GNU General Public License as published by the Free\n\
  2209. Software Foundation, either version 3 of the License, or (at your option)\n\
  2210. any later version.\n\n"));
  2211. puts(_("tcpreplay is distributed in the hope that it will be useful, but WITHOUT\n\
  2212. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\
  2213. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n\
  2214. more details.\n\n"));
  2215. puts(_("You should have received a copy of the GNU General Public License along\n\
  2216. with this program. If not, see <http://www.gnu.org/licenses/>.\n"));
  2217. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2218. puts(_("Enable debugging output"));
  2219. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2220. puts(_("Quiet mode"));
  2221. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2222. puts(_("Select packet timing mode: select, ioport, gtod, nano"));
  2223. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2224. puts(_("Sleep for no more then X milliseconds between packets"));
  2225. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2226. puts(_("Print decoded packets via tcpdump to STDOUT"));
  2227. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2228. puts(_("Arguments passed to tcpdump decoder"));
  2229. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2230. puts(_("Preloads packets into RAM before sending"));
  2231. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2232. puts(_("Split traffic via a tcpprep cache file"));
  2233. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2234. puts(_("Replay two files at a time from a network tap"));
  2235. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2236. puts(_("Client to server/RX/primary traffic output interface"));
  2237. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2238. puts(_("Server to client/TX/secondary traffic output interface"));
  2239. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2240. puts(_("Pcap file to receive traffic outputs"));
  2241. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2242. puts(_("Send only selected packet numbers"));
  2243. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2244. puts(_("Send all but selected packet numbers"));
  2245. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2246. puts(_("List available network interfaces and exit"));
  2247. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2248. puts(_("Loop through the capture file X times"));
  2249. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2250. puts(_("Delay between loops in milliseconds"));
  2251. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2252. puts(_("Delay between loops in nanoseconds"));
  2253. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2254. puts(_("Override the snaplen and use the actual packet len"));
  2255. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2256. puts(_("Limit the number of packets to send"));
  2257. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2258. puts(_("Limit the number of seconds to send"));
  2259. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2260. puts(_("Modify replay speed to a given multiple"));
  2261. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2262. puts(_("Replay packets at a given packets/sec"));
  2263. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2264. puts(_("Replay packets at a given Mbps"));
  2265. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2266. puts(_("Replay packets as fast as possible"));
  2267. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2268. puts(_("Replay one packet at a time for each user input"));
  2269. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2270. puts(_("Number of packets to send for each time interval"));
  2271. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2272. puts(_("Modify IP addresses each loop iteration to generate unique flows"));
  2273. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2274. puts(_("Number of times to loop before assigning new unique ip"));
  2275. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2276. puts(_("Write packets directly to netmap enabled network adapter"));
  2277. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2278. puts(_("Netmap startup delay"));
  2279. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2280. puts(_("Suppress printing and tracking flow count, rates and expirations"));
  2281. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2282. puts(_("Number of inactive seconds before a flow is considered expired"));
  2283. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2284. puts(_("Print the PID of tcpreplay at startup"));
  2285. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2286. puts(_("Print statistics every X seconds, or every loop if '0'"));
  2287. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2288. puts(_("suppress printing warning messages"));
  2289. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2290. puts(_("Write packets directly to AF_XDP enabled network adapter"));
  2291. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2292. puts(_("The maximum number of packets that can be submitted to the AF_XDP TX\n\
  2293. ring at once"));
  2294. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2295. puts(_("Print version information"));
  2296. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2297. puts(_("Display less usage information and exit"));
  2298. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2299. puts(_("display extended usage information and exit"));
  2300. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2301. puts(_("extended usage information passed thru pager"));
  2302. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2303. puts(_("save the option state to a config file"));
  2304. /* referenced via tcpreplayOptions.pOptDesc->pzText */
  2305. puts(_("load options from a config file"));
  2306. /* referenced via tcpreplayOptions.pzUsageTitle */
  2307. puts(_("tcpreplay (tcpreplay) - Replay network traffic stored in pcap files\n\
  2308. Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
  2309. \t\t<pcap_file(s)> | <pcap_dir(s)>\n"));
  2310. /* referenced via tcpreplayOptions.pzExplain */
  2311. puts(_("tcpreplay is a tool for replaying network traffic from files saved with\n\
  2312. tcpdump or other tools which write pcap(3) files.\n"));
  2313. /* referenced via tcpreplayOptions.pzDetail */
  2314. puts(_("The basic operation of tcpreplay is to resend all packets from the input\n\
  2315. file(s) at the speed at which they were recorded, or a specified data rate,\n\
  2316. up to as fast as the hardware is capable.\n\n"));
  2317. puts(_("Optionally, the traffic can be split between two interfaces, written to\n\
  2318. files, filtered and edited in various ways, providing the means to test\n\
  2319. firewalls, NIDS and other network devices.\n\n"));
  2320. puts(_("For more details, please see the Tcpreplay Manual at:\n\
  2321. http://tcpreplay.appneta.com\n"));
  2322. /* referenced via tcpreplayOptions.pzFullUsage */
  2323. puts(_("<<<NOT-FOUND>>>"));
  2324. /* referenced via tcpreplayOptions.pzShortUsage */
  2325. puts(_("<<<NOT-FOUND>>>"));
  2326. /* LIBOPTS-MESSAGES: */
  2327. #line 67 "../autoopts.c"
  2328. puts(_("allocation of %d bytes failed\n"));
  2329. #line 89 "../autoopts.c"
  2330. puts(_("allocation of %d bytes failed\n"));
  2331. #line 48 "../init.c"
  2332. puts(_("AutoOpts function called without option descriptor\n"));
  2333. #line 81 "../init.c"
  2334. puts(_("\tThis exceeds the compiled library version: "));
  2335. #line 79 "../init.c"
  2336. puts(_("Automated Options Processing Error!\n"
  2337. "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
  2338. #line 78 "../autoopts.c"
  2339. puts(_("realloc of %d bytes at 0x%p failed\n"));
  2340. #line 83 "../init.c"
  2341. puts(_("\tThis is less than the minimum library version: "));
  2342. #line 121 "../version.c"
  2343. puts(_("Automated Options version %s\n"
  2344. "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
  2345. #line 49 "../makeshell.c"
  2346. puts(_("(AutoOpts bug): %s.\n"));
  2347. #line 90 "../reset.c"
  2348. puts(_("optionResetOpt() called, but reset-option not configured"));
  2349. #line 241 "../usage.c"
  2350. puts(_("could not locate the 'help' option"));
  2351. #line 330 "../autoopts.c"
  2352. puts(_("optionProcess() was called with invalid data"));
  2353. #line 697 "../usage.c"
  2354. puts(_("invalid argument type specified"));
  2355. #line 568 "../find.c"
  2356. puts(_("defaulted to option with optional arg"));
  2357. #line 76 "../alias.c"
  2358. puts(_("aliasing option is out of range."));
  2359. #line 210 "../enum.c"
  2360. puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
  2361. #line 78 "../find.c"
  2362. puts(_(" The following options match:\n"));
  2363. #line 263 "../find.c"
  2364. puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
  2365. #line 161 "../check.c"
  2366. puts(_("%s: Command line arguments required\n"));
  2367. #line 43 "../alias.c"
  2368. puts(_("%d %s%s options allowed\n"));
  2369. #line 56 "../makeshell.c"
  2370. puts(_("%s error %d (%s) calling %s for '%s'\n"));
  2371. #line 268 "../makeshell.c"
  2372. puts(_("interprocess pipe"));
  2373. #line 171 "../version.c"
  2374. puts(_("error: version option argument '%c' invalid. Use:\n"
  2375. "\t'v' - version only\n"
  2376. "\t'c' - version and copyright\n"
  2377. "\t'n' - version and full copyright notice\n"));
  2378. #line 58 "../check.c"
  2379. puts(_("%s error: the '%s' and '%s' options conflict\n"));
  2380. #line 187 "../find.c"
  2381. puts(_("%s: The '%s' option has been disabled."));
  2382. #line 400 "../find.c"
  2383. puts(_("%s: The '%s' option has been disabled."));
  2384. #line 38 "../alias.c"
  2385. puts(_("-equivalence"));
  2386. #line 439 "../find.c"
  2387. puts(_("%s: illegal option -- %c\n"));
  2388. #line 110 "../reset.c"
  2389. puts(_("%s: illegal option -- %c\n"));
  2390. #line 241 "../find.c"
  2391. puts(_("%s: illegal option -- %s\n"));
  2392. #line 740 "../find.c"
  2393. puts(_("%s: illegal option -- %s\n"));
  2394. #line 118 "../reset.c"
  2395. puts(_("%s: illegal option -- %s\n"));
  2396. #line 305 "../find.c"
  2397. puts(_("%s: unknown vendor extension option -- %s\n"));
  2398. #line 135 "../enum.c"
  2399. puts(_(" or an integer from %d through %d\n"));
  2400. #line 145 "../enum.c"
  2401. puts(_(" or an integer from %d through %d\n"));
  2402. #line 696 "../usage.c"
  2403. puts(_("%s error: invalid option descriptor for %s\n"));
  2404. #line 1030 "../usage.c"
  2405. puts(_("%s error: invalid option descriptor for %s\n"));
  2406. #line 355 "../find.c"
  2407. puts(_("%s: invalid option name: %s\n"));
  2408. #line 497 "../find.c"
  2409. puts(_("%s: The '%s' option requires an argument.\n"));
  2410. #line 150 "../autoopts.c"
  2411. puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
  2412. "\t'%s' and '%s'."));
  2413. #line 94 "../check.c"
  2414. puts(_("%s error: The %s option is required\n"));
  2415. #line 602 "../find.c"
  2416. puts(_("%s: The '%s' option cannot have an argument.\n"));
  2417. #line 151 "../check.c"
  2418. puts(_("%s: Command line arguments are not allowed.\n"));
  2419. #line 568 "../save.c"
  2420. puts(_("error %d (%s) creating %s\n"));
  2421. #line 210 "../enum.c"
  2422. puts(_("%s error: '%s' does not match any %s keywords.\n"));
  2423. #line 93 "../reset.c"
  2424. puts(_("%s error: The '%s' option requires an argument.\n"));
  2425. #line 122 "../save.c"
  2426. puts(_("error %d (%s) stat-ing %s\n"));
  2427. #line 175 "../save.c"
  2428. puts(_("error %d (%s) stat-ing %s\n"));
  2429. #line 143 "../restore.c"
  2430. puts(_("%s error: no saved option state\n"));
  2431. #line 225 "../autoopts.c"
  2432. puts(_("'%s' is not a command line option.\n"));
  2433. #line 113 "../time.c"
  2434. puts(_("%s error: '%s' is not a recognizable date/time.\n"));
  2435. #line 50 "../time.c"
  2436. puts(_("%s error: '%s' is not a recognizable time duration.\n"));
  2437. #line 92 "../check.c"
  2438. puts(_("%s error: The %s option must appear %d times.\n"));
  2439. #line 165 "../numeric.c"
  2440. puts(_("%s error: '%s' is not a recognizable number.\n"));
  2441. #line 176 "../enum.c"
  2442. puts(_("%s error: %s exceeds %s keyword count\n"));
  2443. #line 279 "../usage.c"
  2444. puts(_("Try '%s %s' for more information.\n"));
  2445. #line 45 "../alias.c"
  2446. puts(_("one %s%s option allowed\n"));
  2447. #line 170 "../makeshell.c"
  2448. puts(_("standard output"));
  2449. #line 905 "../makeshell.c"
  2450. puts(_("standard output"));
  2451. #line 223 "../usage.c"
  2452. puts(_("standard output"));
  2453. #line 364 "../usage.c"
  2454. puts(_("standard output"));
  2455. #line 574 "../usage.c"
  2456. puts(_("standard output"));
  2457. #line 178 "../version.c"
  2458. puts(_("standard output"));
  2459. #line 223 "../usage.c"
  2460. puts(_("standard error"));
  2461. #line 364 "../usage.c"
  2462. puts(_("standard error"));
  2463. #line 574 "../usage.c"
  2464. puts(_("standard error"));
  2465. #line 178 "../version.c"
  2466. puts(_("standard error"));
  2467. #line 170 "../makeshell.c"
  2468. puts(_("write"));
  2469. #line 905 "../makeshell.c"
  2470. puts(_("write"));
  2471. #line 222 "../usage.c"
  2472. puts(_("write"));
  2473. #line 363 "../usage.c"
  2474. puts(_("write"));
  2475. #line 573 "../usage.c"
  2476. puts(_("write"));
  2477. #line 177 "../version.c"
  2478. puts(_("write"));
  2479. #line 60 "../numeric.c"
  2480. puts(_("%s error: %s option value %ld is out of range.\n"));
  2481. #line 44 "../check.c"
  2482. puts(_("%s error: %s option requires the %s option\n"));
  2483. #line 121 "../save.c"
  2484. puts(_("%s warning: cannot save options - %s not regular file\n"));
  2485. #line 174 "../save.c"
  2486. puts(_("%s warning: cannot save options - %s not regular file\n"));
  2487. #line 193 "../save.c"
  2488. puts(_("%s warning: cannot save options - %s not regular file\n"));
  2489. #line 567 "../save.c"
  2490. puts(_("%s warning: cannot save options - %s not regular file\n"));
  2491. /* END-LIBOPTS-MESSAGES */
  2492. /* USAGE-TEXT: */
  2493. #line 822 "../usage.c"
  2494. puts(_("\t\t\t\t- an alternate for '%s'\n"));
  2495. #line 1097 "../usage.c"
  2496. puts(_("Version, usage and configuration options:"));
  2497. #line 873 "../usage.c"
  2498. puts(_("\t\t\t\t- default option for unnamed options\n"));
  2499. #line 786 "../usage.c"
  2500. puts(_("\t\t\t\t- disabled as '--%s'\n"));
  2501. #line 1066 "../usage.c"
  2502. puts(_(" --- %-14s %s\n"));
  2503. #line 1064 "../usage.c"
  2504. puts(_("This option has been disabled"));
  2505. #line 813 "../usage.c"
  2506. puts(_("\t\t\t\t- enabled by default\n"));
  2507. #line 40 "../alias.c"
  2508. puts(_("%s error: only "));
  2509. #line 1143 "../usage.c"
  2510. puts(_(" - examining environment variables named %s_*\n"));
  2511. #line 168 "../file.c"
  2512. puts(_("\t\t\t\t- file must not pre-exist\n"));
  2513. #line 172 "../file.c"
  2514. puts(_("\t\t\t\t- file must pre-exist\n"));
  2515. #line 329 "../usage.c"
  2516. puts(_("Options are specified by doubled hyphens and their name or by a single\n"
  2517. "hyphen and the flag character.\n"));
  2518. #line 882 "../makeshell.c"
  2519. puts(_("\n"
  2520. "= = = = = = = =\n\n"
  2521. "This incarnation of genshell will produce\n"
  2522. "a shell script to parse the options for %s:\n\n"));
  2523. #line 142 "../enum.c"
  2524. puts(_(" or an integer mask with any of the lower %d bits set\n"));
  2525. #line 846 "../usage.c"
  2526. puts(_("\t\t\t\t- is a set membership option\n"));
  2527. #line 867 "../usage.c"
  2528. puts(_("\t\t\t\t- must appear between %d and %d times\n"));
  2529. #line 331 "../usage.c"
  2530. puts(_("Options are specified by single or double hyphens and their name.\n"));
  2531. #line 853 "../usage.c"
  2532. puts(_("\t\t\t\t- may appear multiple times\n"));
  2533. #line 840 "../usage.c"
  2534. puts(_("\t\t\t\t- may not be preset\n"));
  2535. #line 1258 "../usage.c"
  2536. puts(_(" Arg Option-Name Description\n"));
  2537. #line 1194 "../usage.c"
  2538. puts(_(" Flg Arg Option-Name Description\n"));
  2539. #line 1252 "../usage.c"
  2540. puts(_(" Flg Arg Option-Name Description\n"));
  2541. #line 1253 "../usage.c"
  2542. puts(_(" %3s %s"));
  2543. #line 1259 "../usage.c"
  2544. puts(_(" %3s %s"));
  2545. #line 336 "../usage.c"
  2546. puts(_("The '-#<number>' option may omit the hash char\n"));
  2547. #line 332 "../usage.c"
  2548. puts(_("All arguments are named options.\n"));
  2549. #line 920 "../usage.c"
  2550. puts(_(" - reading file %s"));
  2551. #line 358 "../usage.c"
  2552. puts(_("\n"
  2553. "Please send bug reports to: <%s>\n"));
  2554. #line 100 "../version.c"
  2555. puts(_("\n"
  2556. "Please send bug reports to: <%s>\n"));
  2557. #line 129 "../version.c"
  2558. puts(_("\n"
  2559. "Please send bug reports to: <%s>\n"));
  2560. #line 852 "../usage.c"
  2561. puts(_("\t\t\t\t- may NOT appear - preset only\n"));
  2562. #line 893 "../usage.c"
  2563. puts(_("\n"
  2564. "The following option preset mechanisms are supported:\n"));
  2565. #line 1141 "../usage.c"
  2566. puts(_("\n"
  2567. "The following option preset mechanisms are supported:\n"));
  2568. #line 631 "../usage.c"
  2569. puts(_("prohibits these options:\n"));
  2570. #line 626 "../usage.c"
  2571. puts(_("prohibits the option '%s'\n"));
  2572. #line 81 "../numeric.c"
  2573. puts(_("%s%ld to %ld"));
  2574. #line 79 "../numeric.c"
  2575. puts(_("%sgreater than or equal to %ld"));
  2576. #line 75 "../numeric.c"
  2577. puts(_("%s%ld exactly"));
  2578. #line 68 "../numeric.c"
  2579. puts(_("%sit must lie in one of the ranges:\n"));
  2580. #line 68 "../numeric.c"
  2581. puts(_("%sit must be in the range:\n"));
  2582. #line 88 "../numeric.c"
  2583. puts(_(", or\n"));
  2584. #line 66 "../numeric.c"
  2585. puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
  2586. #line 77 "../numeric.c"
  2587. puts(_("%sless than or equal to %ld"));
  2588. #line 339 "../usage.c"
  2589. puts(_("Operands and options may be intermixed. They will be reordered.\n"));
  2590. #line 601 "../usage.c"
  2591. puts(_("requires the option '%s'\n"));
  2592. #line 604 "../usage.c"
  2593. puts(_("requires these options:\n"));
  2594. #line 1270 "../usage.c"
  2595. puts(_(" Arg Option-Name Req? Description\n"));
  2596. #line 1264 "../usage.c"
  2597. puts(_(" Flg Arg Option-Name Req? Description\n"));
  2598. #line 143 "../enum.c"
  2599. puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
  2600. "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
  2601. "will set them all. Multiple entries may be passed as an option\n"
  2602. "argument list.\n"));
  2603. #line 859 "../usage.c"
  2604. puts(_("\t\t\t\t- may appear up to %d times\n"));
  2605. #line 52 "../enum.c"
  2606. puts(_("The valid \"%s\" option keywords are:\n"));
  2607. #line 1101 "../usage.c"
  2608. puts(_("The next option supports vendor supported extra options:"));
  2609. #line 722 "../usage.c"
  2610. puts(_("These additional options are:"));
  2611. /* END-USAGE-TEXT */
  2612. }
  2613. #endif /* uncompilable code */
  2614. #ifdef __cplusplus
  2615. }
  2616. #endif
  2617. /* tcpreplay_opts.c ends here */