tcprewrite_opts.c 112 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493249424952496249724982499250025012502250325042505250625072508250925102511251225132514251525162517251825192520252125222523252425252526252725282529253025312532253325342535253625372538253925402541254225432544254525462547254825492550255125522553255425552556255725582559256025612562256325642565256625672568256925702571257225732574257525762577257825792580258125822583258425852586258725882589259025912592259325942595259625972598259926002601260226032604260526062607260826092610261126122613261426152616261726182619262026212622262326242625262626272628262926302631263226332634263526362637263826392640264126422643264426452646264726482649265026512652265326542655265626572658265926602661266226632664266526662667266826692670267126722673267426752676267726782679268026812682268326842685268626872688268926902691269226932694269526962697269826992700270127022703270427052706270727082709271027112712271327142715271627172718271927202721272227232724272527262727272827292730273127322733273427352736273727382739274027412742274327442745274627472748274927502751275227532754275527562757275827592760276127622763276427652766276727682769277027712772277327742775277627772778277927802781278227832784278527862787278827892790279127922793279427952796279727982799280028012802280328042805280628072808280928102811281228132814281528162817281828192820282128222823282428252826282728282829283028312832283328342835283628372838283928402841284228432844284528462847284828492850285128522853285428552856285728582859286028612862286328642865286628672868286928702871287228732874287528762877287828792880288128822883288428852886288728882889289028912892289328942895289628972898289929002901290229032904290529062907290829092910291129122913291429152916291729182919292029212922292329242925292629272928292929302931293229332934293529362937293829392940294129422943294429452946294729482949295029512952295329542955295629572958295929602961296229632964296529662967296829692970297129722973297429752976297729782979298029812982298329842985298629872988298929902991299229932994299529962997299829993000300130023003300430053006300730083009301030113012
  1. /* -*- buffer-read-only: t -*- vi: set ro:
  2. *
  3. * DO NOT EDIT THIS FILE (tcprewrite_opts.c)
  4. *
  5. * It has been AutoGen-ed
  6. * From the definitions ../../src/tcprewrite_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 tcprewrite 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 tcprewrite 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. * tcprewrite 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. * tcprewrite 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 "tcprewrite_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 (tcprewrite_opt_strs+0)
  57. #define zLicenseDescrip (tcprewrite_opt_strs+285)
  58. /*
  59. * global included definitions
  60. */
  61. #include "defines.h"
  62. #include "common.h"
  63. #include "config.h"
  64. #include "tcprewrite.h"
  65. #include <stdlib.h>
  66. #include <string.h>
  67. extern tcprewrite_opt_t options;
  68. #ifndef NULL
  69. # define NULL 0
  70. #endif
  71. /**
  72. * static const strings for tcprewrite options
  73. */
  74. static char const tcprewrite_opt_strs[5172] =
  75. /* 0 */ "tcprewrite (tcprewrite)\n"
  76. "Copyright (C) 2000-2024 Aaron Turner and Fred Klassen, all rights reserved.\n"
  77. "This is free software. It is licensed for use, modification and\n"
  78. "redistribution under the terms of the GNU General Public License,\n"
  79. "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0"
  80. /* 285 */ "tcprewrite is free software: you can redistribute it and/or modify it under\n"
  81. "the terms of the GNU General Public License as published by the Free\n"
  82. "Software Foundation, either version 3 of the License, or (at your option)\n"
  83. "any later version.\n\n"
  84. "tcprewrite is distributed in the hope that it will be useful, but WITHOUT\n"
  85. "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
  86. "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n"
  87. "more details.\n\n"
  88. "You should have received a copy of the GNU General Public License along\n"
  89. "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0"
  90. /* 894 */ ":\0"
  91. /* 896 */ "Rewrite TCP/UDP ports\0"
  92. /* 918 */ "PORTMAP\0"
  93. /* 926 */ "portmap\0"
  94. /* 934 */ "Randomize src/dst IPv4/v6 addresses w/ given seed\0"
  95. /* 984 */ "SEED\0"
  96. /* 989 */ "seed\0"
  97. /* 994 */ "Rewrite IPv4/v6 addresses using pseudo-NAT\0"
  98. /* 1037 */ "PNAT\0"
  99. /* 1042 */ "pnat\0"
  100. /* 1047 */ "Rewrite source IPv4/v6 addresses using pseudo-NAT\0"
  101. /* 1097 */ "SRCIPMAP\0"
  102. /* 1106 */ "srcipmap\0"
  103. /* 1115 */ "Rewrite destination IPv4/v6 addresses using pseudo-NAT\0"
  104. /* 1170 */ "DSTIPMAP\0"
  105. /* 1179 */ "dstipmap\0"
  106. /* 1188 */ "Rewrite IP addresses to be between two endpoints\0"
  107. /* 1237 */ "ENDPOINTS\0"
  108. /* 1247 */ "endpoints\0"
  109. /* 1257 */ "Change TCP Sequence (and ACK) numbers /w given seed\0"
  110. /* 1309 */ "TCP_SEQUENCE\0"
  111. /* 1322 */ "tcp-sequence\0"
  112. /* 1335 */ "Skip rewriting broadcast/multicast IPv4/v6 addresses\0"
  113. /* 1388 */ "SKIPBROADCAST\0"
  114. /* 1402 */ "skipbroadcast\0"
  115. /* 1416 */ "Force recalculation of IPv4/TCP/UDP header checksums\0"
  116. /* 1469 */ "FIXCSUM\0"
  117. /* 1477 */ "fixcsum\0"
  118. /* 1485 */ "Alter IP/TCP header len to match packet length\0"
  119. /* 1532 */ "FIXHDRLEN\0"
  120. /* 1542 */ "fixhdrlen\0"
  121. /* 1552 */ "Override default MTU length (1500 bytes)\0"
  122. /* 1593 */ "MTU\0"
  123. /* 1597 */ "mtu\0"
  124. /* 1601 */ "Truncate packets larger then specified MTU\0"
  125. /* 1644 */ "MTU_TRUNC\0"
  126. /* 1654 */ "mtu-trunc\0"
  127. /* 1664 */ "Remove Ethernet checksums (FCS) from end of frames\0"
  128. /* 1715 */ "EFCS\0"
  129. /* 1720 */ "efcs\0"
  130. /* 1725 */ "Modify the IPv4/v6 TTL/Hop Limit\0"
  131. /* 1758 */ "TTL\0"
  132. /* 1762 */ "ttl\0"
  133. /* 1766 */ "Set the IPv4 TOS/DiffServ/ECN byte\0"
  134. /* 1801 */ "TOS\0"
  135. /* 1805 */ "tos\0"
  136. /* 1809 */ "Set the IPv6 Traffic Class byte\0"
  137. /* 1841 */ "TCLASS\0"
  138. /* 1848 */ "tclass\0"
  139. /* 1855 */ "Set the IPv6 Flow Label\0"
  140. /* 1879 */ "FLOWLABEL\0"
  141. /* 1889 */ "flowlabel\0"
  142. /* 1899 */ "Pad or truncate packet data to match header length\0"
  143. /* 1950 */ "FIXLEN\0"
  144. /* 1957 */ "fixlen\0"
  145. /* 1964 */ "Fuzz 1 in X packets. Edit bytes, length, or emulate packet drop\0"
  146. /* 2029 */ "FUZZ_SEED\0"
  147. /* 2039 */ "fuzz-seed\0"
  148. /* 2049 */ "Set the Fuzz 1 in X packet ratio (default 1 in 8 packets)\0"
  149. /* 2107 */ "FUZZ_FACTOR\0"
  150. /* 2119 */ "fuzz-factor\0"
  151. /* 2131 */ "Skip rewriting broadcast/multicast Layer 2 addresses\0"
  152. /* 2184 */ "SKIPL2BROADCAST\0"
  153. /* 2200 */ "skipl2broadcast\0"
  154. /* 2216 */ "Override output DLT encapsulation\0"
  155. /* 2250 */ "DLT\0"
  156. /* 2254 */ "dlt\0"
  157. /* 2258 */ "Override destination ethernet MAC addresses\0"
  158. /* 2302 */ "ENET_DMAC\0"
  159. /* 2312 */ "enet-dmac\0"
  160. /* 2322 */ "Override source ethernet MAC addresses\0"
  161. /* 2361 */ "ENET_SMAC\0"
  162. /* 2371 */ "enet-smac\0"
  163. /* 2381 */ "Substitute MAC addresses\0"
  164. /* 2406 */ "ENET_SUBSMAC\0"
  165. /* 2419 */ "enet-subsmac\0"
  166. /* 2432 */ "Randomize MAC addresses\0"
  167. /* 2456 */ "ENET_MAC_SEED\0"
  168. /* 2470 */ "enet-mac-seed\0"
  169. /* 2484 */ "ENET_MAC_SEED_KEEP_BYTES\0"
  170. /* 2509 */ "enet-mac-seed-keep-bytes\0"
  171. /* 2534 */ "Specify ethernet 802.1q VLAN tag mode\0"
  172. /* 2572 */ "ENET_VLAN\0"
  173. /* 2582 */ "enet-vlan\0"
  174. /* 2592 */ "Specify the new ethernet 802.1q VLAN tag value\0"
  175. /* 2639 */ "ENET_VLAN_TAG\0"
  176. /* 2653 */ "enet-vlan-tag\0"
  177. /* 2667 */ "Specify the ethernet 802.1q VLAN CFI value\0"
  178. /* 2710 */ "ENET_VLAN_CFI\0"
  179. /* 2724 */ "enet-vlan-cfi\0"
  180. /* 2738 */ "Specify the ethernet 802.1q VLAN priority\0"
  181. /* 2780 */ "ENET_VLAN_PRI\0"
  182. /* 2794 */ "enet-vlan-pri\0"
  183. /* 2808 */ "Specify VLAN tag protocol 802.1q or 802.1ad\0"
  184. /* 2852 */ "ENET_VLAN_PROTO\0"
  185. /* 2868 */ "enet-vlan-proto\0"
  186. /* 2884 */ "Specify HDLC control value\0"
  187. /* 2911 */ "HDLC_CONTROL\0"
  188. /* 2924 */ "hdlc-control\0"
  189. /* 2937 */ "Specify HDLC address\0"
  190. /* 2958 */ "HDLC_ADDRESS\0"
  191. /* 2971 */ "hdlc-address\0"
  192. /* 2984 */ "Set output file DLT type\0"
  193. /* 3009 */ "USER_DLT\0"
  194. /* 3018 */ "user-dlt\0"
  195. /* 3027 */ "Rewrite Data-Link layer with user specified data\0"
  196. /* 3076 */ "USER_DLINK\0"
  197. /* 3087 */ "user-dlink\0"
  198. /* 3098 */ "Enable debugging output\0"
  199. /* 3122 */ "DBUG\0"
  200. /* 3127 */ "dbug\0"
  201. /* 3132 */ "Input pcap file to be processed\0"
  202. /* 3164 */ "INFILE\0"
  203. /* 3171 */ "infile\0"
  204. /* 3178 */ "Output pcap file\0"
  205. /* 3195 */ "OUTFILE\0"
  206. /* 3203 */ "outfile\0"
  207. /* 3211 */ "Split traffic via tcpprep cache file\0"
  208. /* 3248 */ "CACHEFILE\0"
  209. /* 3258 */ "cachefile\0"
  210. /* 3268 */ "Print decoded packets via tcpdump to STDOUT\0"
  211. /* 3312 */ "VERBOSE\0"
  212. /* 3320 */ "verbose\0"
  213. /* 3328 */ "Arguments passed to tcpdump decoder\0"
  214. /* 3364 */ "DECODE\0"
  215. /* 3371 */ "decode\0"
  216. /* 3378 */ "Parse fragroute configuration file\0"
  217. /* 3413 */ "FRAGROUTE\0"
  218. /* 3423 */ "fragroute\0"
  219. /* 3433 */ "Which flows to apply fragroute to: c2s, s2c, both\0"
  220. /* 3483 */ "FRAGDIR\0"
  221. /* 3491 */ "fragdir\0"
  222. /* 3499 */ "Skip writing packets with soft errors\0"
  223. /* 3537 */ "SKIP_SOFT_ERRORS\0"
  224. /* 3554 */ "skip-soft-errors\0"
  225. /* 3571 */ "Print version information\0"
  226. /* 3597 */ "VERSION\0"
  227. /* 3605 */ "version\0"
  228. /* 3613 */ "Display less usage information and exit\0"
  229. /* 3653 */ "LESS_HELP\0"
  230. /* 3663 */ "less-help\0"
  231. /* 3673 */ "suppress printing warning messages\0"
  232. /* 3708 */ "SUPPRESS_WARNINGS\0"
  233. /* 3726 */ "suppress-warnings\0"
  234. /* 3744 */ "display extended usage information and exit\0"
  235. /* 3788 */ "help\0"
  236. /* 3793 */ "extended usage information passed thru pager\0"
  237. /* 3838 */ "more-help\0"
  238. /* 3848 */ "save the option state to a config file\0"
  239. /* 3887 */ "save-opts\0"
  240. /* 3897 */ "load options from a config file\0"
  241. /* 3929 */ "LOAD_OPTS\0"
  242. /* 3939 */ "no-load-opts\0"
  243. /* 3952 */ "no\0"
  244. /* 3955 */ "TCPREWRITE\0"
  245. /* 3966 */ "tcprewrite (tcprewrite) - Rewrite the packets in a pcap file.\n"
  246. "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n\0"
  247. /* 4086 */ "$$/\0"
  248. /* 4090 */ ".tcprewriterc\0"
  249. /* 4104 */ "tcpreplay-users@lists.sourceforge.net\0"
  250. /* 4142 */ "Tcprewrite is a tool to rewrite packets stored in 'pcap(3)' file format,\n"
  251. "such as created by tools such as 'tcpdump(1)' and 'wireshark(1)'. Once a\n"
  252. "pcap file has had it's packets rewritten, they can be replayed back out on\n"
  253. "the network using 'tcpreplay(1)'.\n\n"
  254. "tcprewrite currently supports reading the following DLT types:\n\n\n"
  255. "'DLT_C_HDLC' aka Cisco HDLC\n\n\n"
  256. "'DLT_EN10MB' aka Ethernet\n\n\n"
  257. "'DLT_LINUX_SLL' aka Linux Cooked Socket\n\n\n"
  258. "'DLT_LINUX_SLL2' aka Linux Cooked Socket v2\n\n\n"
  259. "'DLT_RAW' aka RAW IP\n\n\n"
  260. "'DLT_NULL' aka BSD Loopback\n\n\n"
  261. "'DLT_LOOP' aka OpenBSD Loopback\n\n\n"
  262. "'DLT_IEEE802_11' aka 802.11a/b/g\n\n\n"
  263. "'DLT_IEEE802_11_RADIO' aka 802.11a/b/g with Radiotap headers\n\n\n"
  264. "'DLT_JUNIPER_ETHER' aka Juniper Encapsulated Ethernet\n\n\n"
  265. "'DLT_PPP_SERIAL' aka PPP over Serial\n\n"
  266. "Please see the --dlt option for supported DLT types for writing.\n\n"
  267. "The packet editing features of tcprewrite which distinguish between\n"
  268. "\"client\" and \"server\" traffic requires a tcpprep(1) cache file.\n\n"
  269. "For more details, please see the Tcpreplay Manual at:\n"
  270. "http://tcpreplay.appneta.com\n";
  271. /**
  272. * tcpedit option description:
  273. */
  274. /** tcpedit option separation text */
  275. #define TCPEDIT_DESC (tcprewrite_opt_strs+894)
  276. #define TCPEDIT_FLAGS (OPTST_DOCUMENT | OPTST_NO_INIT)
  277. /**
  278. * portmap option description:
  279. */
  280. /** Descriptive text for the portmap option */
  281. #define PORTMAP_DESC (tcprewrite_opt_strs+896)
  282. /** Upper-cased name for the portmap option */
  283. #define PORTMAP_NAME (tcprewrite_opt_strs+918)
  284. /** Name string for the portmap option */
  285. #define PORTMAP_name (tcprewrite_opt_strs+926)
  286. /** Compiled in flag settings for the portmap option */
  287. #define PORTMAP_FLAGS (OPTST_DISABLED | OPTST_STACKED \
  288. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  289. /**
  290. * seed option description with
  291. * "Must also have options" and "Incompatible options":
  292. */
  293. /** Descriptive text for the seed option */
  294. #define SEED_DESC (tcprewrite_opt_strs+934)
  295. /** Upper-cased name for the seed option */
  296. #define SEED_NAME (tcprewrite_opt_strs+984)
  297. /** Name string for the seed option */
  298. #define SEED_name (tcprewrite_opt_strs+989)
  299. /** Other options that appear in conjunction with the seed option */
  300. static int const aSeedCantList[] = {
  301. INDEX_OPT_FUZZ_SEED, NO_EQUIVALENT };
  302. /** Compiled in flag settings for the seed option */
  303. #define SEED_FLAGS (OPTST_DISABLED \
  304. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  305. /**
  306. * pnat option description with
  307. * "Must also have options" and "Incompatible options":
  308. */
  309. /** Descriptive text for the pnat option */
  310. #define PNAT_DESC (tcprewrite_opt_strs+994)
  311. /** Upper-cased name for the pnat option */
  312. #define PNAT_NAME (tcprewrite_opt_strs+1037)
  313. /** Name string for the pnat option */
  314. #define PNAT_name (tcprewrite_opt_strs+1042)
  315. /** Other options that appear in conjunction with the pnat option */
  316. static int const aPnatCantList[] = {
  317. INDEX_OPT_SRCIPMAP, NO_EQUIVALENT };
  318. /** Compiled in flag settings for the pnat option */
  319. #define PNAT_FLAGS (OPTST_DISABLED | OPTST_STACKED \
  320. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  321. /**
  322. * srcipmap option description with
  323. * "Must also have options" and "Incompatible options":
  324. */
  325. /** Descriptive text for the srcipmap option */
  326. #define SRCIPMAP_DESC (tcprewrite_opt_strs+1047)
  327. /** Upper-cased name for the srcipmap option */
  328. #define SRCIPMAP_NAME (tcprewrite_opt_strs+1097)
  329. /** Name string for the srcipmap option */
  330. #define SRCIPMAP_name (tcprewrite_opt_strs+1106)
  331. /** Other options that appear in conjunction with the srcipmap option */
  332. static int const aSrcipmapCantList[] = {
  333. INDEX_OPT_PNAT, NO_EQUIVALENT };
  334. /** Compiled in flag settings for the srcipmap option */
  335. #define SRCIPMAP_FLAGS (OPTST_DISABLED \
  336. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  337. /**
  338. * dstipmap option description with
  339. * "Must also have options" and "Incompatible options":
  340. */
  341. /** Descriptive text for the dstipmap option */
  342. #define DSTIPMAP_DESC (tcprewrite_opt_strs+1115)
  343. /** Upper-cased name for the dstipmap option */
  344. #define DSTIPMAP_NAME (tcprewrite_opt_strs+1170)
  345. /** Name string for the dstipmap option */
  346. #define DSTIPMAP_name (tcprewrite_opt_strs+1179)
  347. /** Other options that appear in conjunction with the dstipmap option */
  348. static int const aDstipmapCantList[] = {
  349. INDEX_OPT_PNAT, NO_EQUIVALENT };
  350. /** Compiled in flag settings for the dstipmap option */
  351. #define DSTIPMAP_FLAGS (OPTST_DISABLED \
  352. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  353. /**
  354. * endpoints option description with
  355. * "Must also have options" and "Incompatible options":
  356. */
  357. #ifdef HAVE_CACHEFILE_SUPPORT
  358. /** Descriptive text for the endpoints option */
  359. #define ENDPOINTS_DESC (tcprewrite_opt_strs+1188)
  360. /** Upper-cased name for the endpoints option */
  361. #define ENDPOINTS_NAME (tcprewrite_opt_strs+1237)
  362. /** Name string for the endpoints option */
  363. #define ENDPOINTS_name (tcprewrite_opt_strs+1247)
  364. /** Other options that are required by the endpoints option */
  365. static int const aEndpointsMustList[] = {
  366. INDEX_OPT_CACHEFILE, NO_EQUIVALENT };
  367. /** Compiled in flag settings for the endpoints option */
  368. #define ENDPOINTS_FLAGS (OPTST_DISABLED \
  369. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  370. #else /* disable endpoints */
  371. #define ENDPOINTS_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  372. #define aEndpointsMustList NULL
  373. #define ENDPOINTS_NAME NULL
  374. #define ENDPOINTS_DESC NULL
  375. #define ENDPOINTS_name NULL
  376. #endif /* HAVE_CACHEFILE_SUPPORT */
  377. /**
  378. * tcp-sequence option description:
  379. */
  380. /** Descriptive text for the tcp-sequence option */
  381. #define TCP_SEQUENCE_DESC (tcprewrite_opt_strs+1257)
  382. /** Upper-cased name for the tcp-sequence option */
  383. #define TCP_SEQUENCE_NAME (tcprewrite_opt_strs+1309)
  384. /** Name string for the tcp-sequence option */
  385. #define TCP_SEQUENCE_name (tcprewrite_opt_strs+1322)
  386. /** The compiled in default value for the tcp-sequence option argument */
  387. #define TCP_SEQUENCE_DFT_ARG ((char const*)0)
  388. /** Compiled in flag settings for the tcp-sequence option */
  389. #define TCP_SEQUENCE_FLAGS (OPTST_DISABLED \
  390. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  391. /**
  392. * skipbroadcast option description:
  393. */
  394. /** Descriptive text for the skipbroadcast option */
  395. #define SKIPBROADCAST_DESC (tcprewrite_opt_strs+1335)
  396. /** Upper-cased name for the skipbroadcast option */
  397. #define SKIPBROADCAST_NAME (tcprewrite_opt_strs+1388)
  398. /** Name string for the skipbroadcast option */
  399. #define SKIPBROADCAST_name (tcprewrite_opt_strs+1402)
  400. /** Compiled in flag settings for the skipbroadcast option */
  401. #define SKIPBROADCAST_FLAGS (OPTST_DISABLED)
  402. /**
  403. * fixcsum option description:
  404. */
  405. /** Descriptive text for the fixcsum option */
  406. #define FIXCSUM_DESC (tcprewrite_opt_strs+1416)
  407. /** Upper-cased name for the fixcsum option */
  408. #define FIXCSUM_NAME (tcprewrite_opt_strs+1469)
  409. /** Name string for the fixcsum option */
  410. #define FIXCSUM_name (tcprewrite_opt_strs+1477)
  411. /** Compiled in flag settings for the fixcsum option */
  412. #define FIXCSUM_FLAGS (OPTST_DISABLED)
  413. /**
  414. * fixhdrlen option description:
  415. */
  416. /** Descriptive text for the fixhdrlen option */
  417. #define FIXHDRLEN_DESC (tcprewrite_opt_strs+1485)
  418. /** Upper-cased name for the fixhdrlen option */
  419. #define FIXHDRLEN_NAME (tcprewrite_opt_strs+1532)
  420. /** Name string for the fixhdrlen option */
  421. #define FIXHDRLEN_name (tcprewrite_opt_strs+1542)
  422. /** Compiled in flag settings for the fixhdrlen option */
  423. #define FIXHDRLEN_FLAGS (OPTST_DISABLED)
  424. /**
  425. * mtu option description:
  426. */
  427. /** Descriptive text for the mtu option */
  428. #define MTU_DESC (tcprewrite_opt_strs+1552)
  429. /** Upper-cased name for the mtu option */
  430. #define MTU_NAME (tcprewrite_opt_strs+1593)
  431. /** Name string for the mtu option */
  432. #define MTU_name (tcprewrite_opt_strs+1597)
  433. /** Compiled in flag settings for the mtu option */
  434. #define MTU_FLAGS (OPTST_DISABLED \
  435. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  436. /**
  437. * mtu-trunc option description:
  438. */
  439. /** Descriptive text for the mtu-trunc option */
  440. #define MTU_TRUNC_DESC (tcprewrite_opt_strs+1601)
  441. /** Upper-cased name for the mtu-trunc option */
  442. #define MTU_TRUNC_NAME (tcprewrite_opt_strs+1644)
  443. /** Name string for the mtu-trunc option */
  444. #define MTU_TRUNC_name (tcprewrite_opt_strs+1654)
  445. /** Compiled in flag settings for the mtu-trunc option */
  446. #define MTU_TRUNC_FLAGS (OPTST_DISABLED)
  447. /**
  448. * efcs option description:
  449. */
  450. /** Descriptive text for the efcs option */
  451. #define EFCS_DESC (tcprewrite_opt_strs+1664)
  452. /** Upper-cased name for the efcs option */
  453. #define EFCS_NAME (tcprewrite_opt_strs+1715)
  454. /** Name string for the efcs option */
  455. #define EFCS_name (tcprewrite_opt_strs+1720)
  456. /** Compiled in flag settings for the efcs option */
  457. #define EFCS_FLAGS (OPTST_DISABLED)
  458. /**
  459. * ttl option description:
  460. */
  461. /** Descriptive text for the ttl option */
  462. #define TTL_DESC (tcprewrite_opt_strs+1725)
  463. /** Upper-cased name for the ttl option */
  464. #define TTL_NAME (tcprewrite_opt_strs+1758)
  465. /** Name string for the ttl option */
  466. #define TTL_name (tcprewrite_opt_strs+1762)
  467. /** Compiled in flag settings for the ttl option */
  468. #define TTL_FLAGS (OPTST_DISABLED \
  469. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  470. /**
  471. * tos option description:
  472. */
  473. /** Descriptive text for the tos option */
  474. #define TOS_DESC (tcprewrite_opt_strs+1766)
  475. /** Upper-cased name for the tos option */
  476. #define TOS_NAME (tcprewrite_opt_strs+1801)
  477. /** Name string for the tos option */
  478. #define TOS_name (tcprewrite_opt_strs+1805)
  479. /** Compiled in flag settings for the tos option */
  480. #define TOS_FLAGS (OPTST_DISABLED \
  481. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  482. /**
  483. * tclass option description:
  484. */
  485. /** Descriptive text for the tclass option */
  486. #define TCLASS_DESC (tcprewrite_opt_strs+1809)
  487. /** Upper-cased name for the tclass option */
  488. #define TCLASS_NAME (tcprewrite_opt_strs+1841)
  489. /** Name string for the tclass option */
  490. #define TCLASS_name (tcprewrite_opt_strs+1848)
  491. /** Compiled in flag settings for the tclass option */
  492. #define TCLASS_FLAGS (OPTST_DISABLED \
  493. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  494. /**
  495. * flowlabel option description:
  496. */
  497. /** Descriptive text for the flowlabel option */
  498. #define FLOWLABEL_DESC (tcprewrite_opt_strs+1855)
  499. /** Upper-cased name for the flowlabel option */
  500. #define FLOWLABEL_NAME (tcprewrite_opt_strs+1879)
  501. /** Name string for the flowlabel option */
  502. #define FLOWLABEL_name (tcprewrite_opt_strs+1889)
  503. /** Compiled in flag settings for the flowlabel option */
  504. #define FLOWLABEL_FLAGS (OPTST_DISABLED \
  505. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  506. /**
  507. * fixlen option description:
  508. */
  509. /** Descriptive text for the fixlen option */
  510. #define FIXLEN_DESC (tcprewrite_opt_strs+1899)
  511. /** Upper-cased name for the fixlen option */
  512. #define FIXLEN_NAME (tcprewrite_opt_strs+1950)
  513. /** Name string for the fixlen option */
  514. #define FIXLEN_name (tcprewrite_opt_strs+1957)
  515. /** Compiled in flag settings for the fixlen option */
  516. #define FIXLEN_FLAGS (OPTST_DISABLED \
  517. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  518. /**
  519. * fuzz-seed option description:
  520. */
  521. /** Descriptive text for the fuzz-seed option */
  522. #define FUZZ_SEED_DESC (tcprewrite_opt_strs+1964)
  523. /** Upper-cased name for the fuzz-seed option */
  524. #define FUZZ_SEED_NAME (tcprewrite_opt_strs+2029)
  525. /** Name string for the fuzz-seed option */
  526. #define FUZZ_SEED_name (tcprewrite_opt_strs+2039)
  527. /** The compiled in default value for the fuzz-seed option argument */
  528. #define FUZZ_SEED_DFT_ARG ((char const*)0)
  529. /** Compiled in flag settings for the fuzz-seed option */
  530. #define FUZZ_SEED_FLAGS (OPTST_DISABLED \
  531. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  532. /**
  533. * fuzz-factor option description with
  534. * "Must also have options" and "Incompatible options":
  535. */
  536. /** Descriptive text for the fuzz-factor option */
  537. #define FUZZ_FACTOR_DESC (tcprewrite_opt_strs+2049)
  538. /** Upper-cased name for the fuzz-factor option */
  539. #define FUZZ_FACTOR_NAME (tcprewrite_opt_strs+2107)
  540. /** Name string for the fuzz-factor option */
  541. #define FUZZ_FACTOR_name (tcprewrite_opt_strs+2119)
  542. /** The compiled in default value for the fuzz-factor option argument */
  543. #define FUZZ_FACTOR_DFT_ARG ((char const*)8)
  544. /** Other options that are required by the fuzz-factor option */
  545. static int const aFuzz_FactorMustList[] = {
  546. INDEX_OPT_FUZZ_SEED, NO_EQUIVALENT };
  547. /** Compiled in flag settings for the fuzz-factor option */
  548. #define FUZZ_FACTOR_FLAGS (OPTST_DISABLED \
  549. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  550. /**
  551. * skipl2broadcast option description:
  552. */
  553. /** Descriptive text for the skipl2broadcast option */
  554. #define SKIPL2BROADCAST_DESC (tcprewrite_opt_strs+2131)
  555. /** Upper-cased name for the skipl2broadcast option */
  556. #define SKIPL2BROADCAST_NAME (tcprewrite_opt_strs+2184)
  557. /** Name string for the skipl2broadcast option */
  558. #define SKIPL2BROADCAST_name (tcprewrite_opt_strs+2200)
  559. /** Compiled in flag settings for the skipl2broadcast option */
  560. #define SKIPL2BROADCAST_FLAGS (OPTST_DISABLED)
  561. /**
  562. * dlt option description:
  563. */
  564. /** Descriptive text for the dlt option */
  565. #define DLT_DESC (tcprewrite_opt_strs+2216)
  566. /** Upper-cased name for the dlt option */
  567. #define DLT_NAME (tcprewrite_opt_strs+2250)
  568. /** Name string for the dlt option */
  569. #define DLT_name (tcprewrite_opt_strs+2254)
  570. /** Compiled in flag settings for the dlt option */
  571. #define DLT_FLAGS (OPTST_DISABLED \
  572. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  573. /**
  574. * enet-dmac option description:
  575. */
  576. /** Descriptive text for the enet-dmac option */
  577. #define ENET_DMAC_DESC (tcprewrite_opt_strs+2258)
  578. /** Upper-cased name for the enet-dmac option */
  579. #define ENET_DMAC_NAME (tcprewrite_opt_strs+2302)
  580. /** Name string for the enet-dmac option */
  581. #define ENET_DMAC_name (tcprewrite_opt_strs+2312)
  582. /** Compiled in flag settings for the enet-dmac option */
  583. #define ENET_DMAC_FLAGS (OPTST_DISABLED \
  584. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  585. /**
  586. * enet-smac option description:
  587. */
  588. /** Descriptive text for the enet-smac option */
  589. #define ENET_SMAC_DESC (tcprewrite_opt_strs+2322)
  590. /** Upper-cased name for the enet-smac option */
  591. #define ENET_SMAC_NAME (tcprewrite_opt_strs+2361)
  592. /** Name string for the enet-smac option */
  593. #define ENET_SMAC_name (tcprewrite_opt_strs+2371)
  594. /** Compiled in flag settings for the enet-smac option */
  595. #define ENET_SMAC_FLAGS (OPTST_DISABLED \
  596. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  597. /**
  598. * enet-subsmac option description:
  599. */
  600. /** Descriptive text for the enet-subsmac option */
  601. #define ENET_SUBSMAC_DESC (tcprewrite_opt_strs+2381)
  602. /** Upper-cased name for the enet-subsmac option */
  603. #define ENET_SUBSMAC_NAME (tcprewrite_opt_strs+2406)
  604. /** Name string for the enet-subsmac option */
  605. #define ENET_SUBSMAC_name (tcprewrite_opt_strs+2419)
  606. /** Compiled in flag settings for the enet-subsmac option */
  607. #define ENET_SUBSMAC_FLAGS (OPTST_DISABLED | OPTST_STACKED \
  608. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  609. /**
  610. * enet-mac-seed option description with
  611. * "Must also have options" and "Incompatible options":
  612. */
  613. /** Descriptive text for the enet-mac-seed option */
  614. #define ENET_MAC_SEED_DESC (tcprewrite_opt_strs+2432)
  615. /** Upper-cased name for the enet-mac-seed option */
  616. #define ENET_MAC_SEED_NAME (tcprewrite_opt_strs+2456)
  617. /** Name string for the enet-mac-seed option */
  618. #define ENET_MAC_SEED_name (tcprewrite_opt_strs+2470)
  619. /** Other options that appear in conjunction with the enet-mac-seed option */
  620. static int const aEnet_Mac_SeedCantList[] = {
  621. INDEX_OPT_ENET_SMAC,
  622. INDEX_OPT_ENET_DMAC,
  623. INDEX_OPT_ENET_SUBSMAC, NO_EQUIVALENT };
  624. /** Compiled in flag settings for the enet-mac-seed option */
  625. #define ENET_MAC_SEED_FLAGS (OPTST_DISABLED \
  626. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  627. /**
  628. * enet-mac-seed-keep-bytes option description with
  629. * "Must also have options" and "Incompatible options":
  630. */
  631. /** Descriptive text for the enet-mac-seed-keep-bytes option */
  632. #define ENET_MAC_SEED_KEEP_BYTES_DESC (tcprewrite_opt_strs+2432)
  633. /** Upper-cased name for the enet-mac-seed-keep-bytes option */
  634. #define ENET_MAC_SEED_KEEP_BYTES_NAME (tcprewrite_opt_strs+2484)
  635. /** Name string for the enet-mac-seed-keep-bytes option */
  636. #define ENET_MAC_SEED_KEEP_BYTES_name (tcprewrite_opt_strs+2509)
  637. /** Other options that are required by the enet-mac-seed-keep-bytes option */
  638. static int const aEnet_Mac_Seed_Keep_BytesMustList[] = {
  639. INDEX_OPT_ENET_MAC_SEED, NO_EQUIVALENT };
  640. /** Compiled in flag settings for the enet-mac-seed-keep-bytes option */
  641. #define ENET_MAC_SEED_KEEP_BYTES_FLAGS (OPTST_DISABLED \
  642. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  643. /**
  644. * enet-vlan option description:
  645. */
  646. /** Descriptive text for the enet-vlan option */
  647. #define ENET_VLAN_DESC (tcprewrite_opt_strs+2534)
  648. /** Upper-cased name for the enet-vlan option */
  649. #define ENET_VLAN_NAME (tcprewrite_opt_strs+2572)
  650. /** Name string for the enet-vlan option */
  651. #define ENET_VLAN_name (tcprewrite_opt_strs+2582)
  652. /** Compiled in flag settings for the enet-vlan option */
  653. #define ENET_VLAN_FLAGS (OPTST_DISABLED \
  654. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  655. /**
  656. * enet-vlan-tag option description with
  657. * "Must also have options" and "Incompatible options":
  658. */
  659. /** Descriptive text for the enet-vlan-tag option */
  660. #define ENET_VLAN_TAG_DESC (tcprewrite_opt_strs+2592)
  661. /** Upper-cased name for the enet-vlan-tag option */
  662. #define ENET_VLAN_TAG_NAME (tcprewrite_opt_strs+2639)
  663. /** Name string for the enet-vlan-tag option */
  664. #define ENET_VLAN_TAG_name (tcprewrite_opt_strs+2653)
  665. /** Other options that are required by the enet-vlan-tag option */
  666. static int const aEnet_Vlan_TagMustList[] = {
  667. INDEX_OPT_ENET_VLAN, NO_EQUIVALENT };
  668. /** Compiled in flag settings for the enet-vlan-tag option */
  669. #define ENET_VLAN_TAG_FLAGS (OPTST_DISABLED \
  670. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  671. /**
  672. * enet-vlan-cfi option description with
  673. * "Must also have options" and "Incompatible options":
  674. */
  675. /** Descriptive text for the enet-vlan-cfi option */
  676. #define ENET_VLAN_CFI_DESC (tcprewrite_opt_strs+2667)
  677. /** Upper-cased name for the enet-vlan-cfi option */
  678. #define ENET_VLAN_CFI_NAME (tcprewrite_opt_strs+2710)
  679. /** Name string for the enet-vlan-cfi option */
  680. #define ENET_VLAN_CFI_name (tcprewrite_opt_strs+2724)
  681. /** Other options that are required by the enet-vlan-cfi option */
  682. static int const aEnet_Vlan_CfiMustList[] = {
  683. INDEX_OPT_ENET_VLAN, NO_EQUIVALENT };
  684. /** Compiled in flag settings for the enet-vlan-cfi option */
  685. #define ENET_VLAN_CFI_FLAGS (OPTST_DISABLED \
  686. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  687. /**
  688. * enet-vlan-pri option description with
  689. * "Must also have options" and "Incompatible options":
  690. */
  691. /** Descriptive text for the enet-vlan-pri option */
  692. #define ENET_VLAN_PRI_DESC (tcprewrite_opt_strs+2738)
  693. /** Upper-cased name for the enet-vlan-pri option */
  694. #define ENET_VLAN_PRI_NAME (tcprewrite_opt_strs+2780)
  695. /** Name string for the enet-vlan-pri option */
  696. #define ENET_VLAN_PRI_name (tcprewrite_opt_strs+2794)
  697. /** Other options that are required by the enet-vlan-pri option */
  698. static int const aEnet_Vlan_PriMustList[] = {
  699. INDEX_OPT_ENET_VLAN, NO_EQUIVALENT };
  700. /** Compiled in flag settings for the enet-vlan-pri option */
  701. #define ENET_VLAN_PRI_FLAGS (OPTST_DISABLED \
  702. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  703. /**
  704. * enet-vlan-proto option description:
  705. */
  706. /** Descriptive text for the enet-vlan-proto option */
  707. #define ENET_VLAN_PROTO_DESC (tcprewrite_opt_strs+2808)
  708. /** Upper-cased name for the enet-vlan-proto option */
  709. #define ENET_VLAN_PROTO_NAME (tcprewrite_opt_strs+2852)
  710. /** Name string for the enet-vlan-proto option */
  711. #define ENET_VLAN_PROTO_name (tcprewrite_opt_strs+2868)
  712. /** Compiled in flag settings for the enet-vlan-proto option */
  713. #define ENET_VLAN_PROTO_FLAGS (OPTST_DISABLED \
  714. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  715. /**
  716. * hdlc-control option description:
  717. */
  718. /** Descriptive text for the hdlc-control option */
  719. #define HDLC_CONTROL_DESC (tcprewrite_opt_strs+2884)
  720. /** Upper-cased name for the hdlc-control option */
  721. #define HDLC_CONTROL_NAME (tcprewrite_opt_strs+2911)
  722. /** Name string for the hdlc-control option */
  723. #define HDLC_CONTROL_name (tcprewrite_opt_strs+2924)
  724. /** Compiled in flag settings for the hdlc-control option */
  725. #define HDLC_CONTROL_FLAGS (OPTST_DISABLED \
  726. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  727. /**
  728. * hdlc-address option description:
  729. */
  730. /** Descriptive text for the hdlc-address option */
  731. #define HDLC_ADDRESS_DESC (tcprewrite_opt_strs+2937)
  732. /** Upper-cased name for the hdlc-address option */
  733. #define HDLC_ADDRESS_NAME (tcprewrite_opt_strs+2958)
  734. /** Name string for the hdlc-address option */
  735. #define HDLC_ADDRESS_name (tcprewrite_opt_strs+2971)
  736. /** Compiled in flag settings for the hdlc-address option */
  737. #define HDLC_ADDRESS_FLAGS (OPTST_DISABLED \
  738. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  739. /**
  740. * user-dlt option description:
  741. */
  742. /** Descriptive text for the user-dlt option */
  743. #define USER_DLT_DESC (tcprewrite_opt_strs+2984)
  744. /** Upper-cased name for the user-dlt option */
  745. #define USER_DLT_NAME (tcprewrite_opt_strs+3009)
  746. /** Name string for the user-dlt option */
  747. #define USER_DLT_name (tcprewrite_opt_strs+3018)
  748. /** Compiled in flag settings for the user-dlt option */
  749. #define USER_DLT_FLAGS (OPTST_DISABLED \
  750. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  751. /**
  752. * user-dlink option description:
  753. */
  754. /** Descriptive text for the user-dlink option */
  755. #define USER_DLINK_DESC (tcprewrite_opt_strs+3027)
  756. /** Upper-cased name for the user-dlink option */
  757. #define USER_DLINK_NAME (tcprewrite_opt_strs+3076)
  758. /** Name string for the user-dlink option */
  759. #define USER_DLINK_name (tcprewrite_opt_strs+3087)
  760. /** Compiled in flag settings for the user-dlink option */
  761. #define USER_DLINK_FLAGS (OPTST_DISABLED | OPTST_STACKED \
  762. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  763. /**
  764. * dbug option description:
  765. */
  766. #ifdef DEBUG
  767. /** Descriptive text for the dbug option */
  768. #define DBUG_DESC (tcprewrite_opt_strs+3098)
  769. /** Upper-cased name for the dbug option */
  770. #define DBUG_NAME (tcprewrite_opt_strs+3122)
  771. /** Name string for the dbug option */
  772. #define DBUG_name (tcprewrite_opt_strs+3127)
  773. /** The compiled in default value for the dbug option argument */
  774. #define DBUG_DFT_ARG ((char const*)0)
  775. /** Compiled in flag settings for the dbug option */
  776. #define DBUG_FLAGS (OPTST_DISABLED | OPTST_IMM \
  777. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  778. #else /* disable dbug */
  779. #define DBUG_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  780. #define DBUG_DFT_ARG NULL
  781. #define DBUG_NAME NULL
  782. #define DBUG_DESC NULL
  783. #define DBUG_name NULL
  784. #endif /* DEBUG */
  785. /**
  786. * infile option description:
  787. */
  788. /** Descriptive text for the infile option */
  789. #define INFILE_DESC (tcprewrite_opt_strs+3132)
  790. /** Upper-cased name for the infile option */
  791. #define INFILE_NAME (tcprewrite_opt_strs+3164)
  792. /** Name string for the infile option */
  793. #define INFILE_name (tcprewrite_opt_strs+3171)
  794. /** Compiled in flag settings for the infile option */
  795. #define INFILE_FLAGS (OPTST_DISABLED | OPTST_MUST_SET | OPTST_IMM \
  796. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  797. /**
  798. * outfile option description:
  799. */
  800. /** Descriptive text for the outfile option */
  801. #define OUTFILE_DESC (tcprewrite_opt_strs+3178)
  802. /** Upper-cased name for the outfile option */
  803. #define OUTFILE_NAME (tcprewrite_opt_strs+3195)
  804. /** Name string for the outfile option */
  805. #define OUTFILE_name (tcprewrite_opt_strs+3203)
  806. /** Compiled in flag settings for the outfile option */
  807. #define OUTFILE_FLAGS (OPTST_DISABLED | OPTST_MUST_SET \
  808. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  809. /**
  810. * cachefile option description:
  811. */
  812. /** Descriptive text for the cachefile option */
  813. #define CACHEFILE_DESC (tcprewrite_opt_strs+3211)
  814. /** Upper-cased name for the cachefile option */
  815. #define CACHEFILE_NAME (tcprewrite_opt_strs+3248)
  816. /** Name string for the cachefile option */
  817. #define CACHEFILE_name (tcprewrite_opt_strs+3258)
  818. /** Compiled in flag settings for the cachefile option */
  819. #define CACHEFILE_FLAGS (OPTST_DISABLED \
  820. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  821. /**
  822. * verbose option description:
  823. */
  824. #ifdef ENABLE_VERBOSE
  825. /** Descriptive text for the verbose option */
  826. #define VERBOSE_DESC (tcprewrite_opt_strs+3268)
  827. /** Upper-cased name for the verbose option */
  828. #define VERBOSE_NAME (tcprewrite_opt_strs+3312)
  829. /** Name string for the verbose option */
  830. #define VERBOSE_name (tcprewrite_opt_strs+3320)
  831. /** Compiled in flag settings for the verbose option */
  832. #define VERBOSE_FLAGS (OPTST_DISABLED | OPTST_IMM)
  833. #else /* disable verbose */
  834. #define VERBOSE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  835. #define VERBOSE_NAME NULL
  836. #define VERBOSE_DESC NULL
  837. #define VERBOSE_name NULL
  838. #endif /* ENABLE_VERBOSE */
  839. /**
  840. * decode option description with
  841. * "Must also have options" and "Incompatible options":
  842. */
  843. #ifdef ENABLE_VERBOSE
  844. /** Descriptive text for the decode option */
  845. #define DECODE_DESC (tcprewrite_opt_strs+3328)
  846. /** Upper-cased name for the decode option */
  847. #define DECODE_NAME (tcprewrite_opt_strs+3364)
  848. /** Name string for the decode option */
  849. #define DECODE_name (tcprewrite_opt_strs+3371)
  850. /** Other options that are required by the decode option */
  851. static int const aDecodeMustList[] = {
  852. INDEX_OPT_VERBOSE, NO_EQUIVALENT };
  853. /** Compiled in flag settings for the decode option */
  854. #define DECODE_FLAGS (OPTST_DISABLED \
  855. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  856. #else /* disable decode */
  857. #define DECODE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  858. #define aDecodeMustList NULL
  859. #define DECODE_NAME NULL
  860. #define DECODE_DESC NULL
  861. #define DECODE_name NULL
  862. #endif /* ENABLE_VERBOSE */
  863. /**
  864. * fragroute option description:
  865. */
  866. #ifdef ENABLE_FRAGROUTE
  867. /** Descriptive text for the fragroute option */
  868. #define FRAGROUTE_DESC (tcprewrite_opt_strs+3378)
  869. /** Upper-cased name for the fragroute option */
  870. #define FRAGROUTE_NAME (tcprewrite_opt_strs+3413)
  871. /** Name string for the fragroute option */
  872. #define FRAGROUTE_name (tcprewrite_opt_strs+3423)
  873. /** Compiled in flag settings for the fragroute option */
  874. #define FRAGROUTE_FLAGS (OPTST_DISABLED \
  875. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  876. #else /* disable fragroute */
  877. #define FRAGROUTE_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  878. #define FRAGROUTE_NAME NULL
  879. #define FRAGROUTE_DESC NULL
  880. #define FRAGROUTE_name NULL
  881. #endif /* ENABLE_FRAGROUTE */
  882. /**
  883. * fragdir option description with
  884. * "Must also have options" and "Incompatible options":
  885. */
  886. #ifdef ENABLE_FRAGROUTE
  887. /** Descriptive text for the fragdir option */
  888. #define FRAGDIR_DESC (tcprewrite_opt_strs+3433)
  889. /** Upper-cased name for the fragdir option */
  890. #define FRAGDIR_NAME (tcprewrite_opt_strs+3483)
  891. /** Name string for the fragdir option */
  892. #define FRAGDIR_name (tcprewrite_opt_strs+3491)
  893. /** Other options that are required by the fragdir option */
  894. static int const aFragdirMustList[] = {
  895. INDEX_OPT_CACHEFILE, NO_EQUIVALENT };
  896. /** Compiled in flag settings for the fragdir option */
  897. #define FRAGDIR_FLAGS (OPTST_DISABLED \
  898. | OPTST_SET_ARGTYPE(OPARG_TYPE_STRING))
  899. #else /* disable fragdir */
  900. #define FRAGDIR_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  901. #define aFragdirMustList NULL
  902. #define FRAGDIR_NAME NULL
  903. #define FRAGDIR_DESC NULL
  904. #define FRAGDIR_name NULL
  905. #endif /* ENABLE_FRAGROUTE */
  906. /**
  907. * skip-soft-errors option description:
  908. */
  909. /** Descriptive text for the skip-soft-errors option */
  910. #define SKIP_SOFT_ERRORS_DESC (tcprewrite_opt_strs+3499)
  911. /** Upper-cased name for the skip-soft-errors option */
  912. #define SKIP_SOFT_ERRORS_NAME (tcprewrite_opt_strs+3537)
  913. /** Name string for the skip-soft-errors option */
  914. #define SKIP_SOFT_ERRORS_name (tcprewrite_opt_strs+3554)
  915. /** Compiled in flag settings for the skip-soft-errors option */
  916. #define SKIP_SOFT_ERRORS_FLAGS (OPTST_DISABLED)
  917. /**
  918. * version option description:
  919. */
  920. /** Descriptive text for the version option */
  921. #define VERSION_DESC (tcprewrite_opt_strs+3571)
  922. /** Upper-cased name for the version option */
  923. #define VERSION_NAME (tcprewrite_opt_strs+3597)
  924. /** Name string for the version option */
  925. #define VERSION_name (tcprewrite_opt_strs+3605)
  926. /** Compiled in flag settings for the version option */
  927. #define VERSION_FLAGS (OPTST_DISABLED)
  928. /**
  929. * less-help option description:
  930. */
  931. /** Descriptive text for the less-help option */
  932. #define LESS_HELP_DESC (tcprewrite_opt_strs+3613)
  933. /** Upper-cased name for the less-help option */
  934. #define LESS_HELP_NAME (tcprewrite_opt_strs+3653)
  935. /** Name string for the less-help option */
  936. #define LESS_HELP_name (tcprewrite_opt_strs+3663)
  937. /** Compiled in flag settings for the less-help option */
  938. #define LESS_HELP_FLAGS (OPTST_DISABLED | OPTST_IMM)
  939. /**
  940. * suppress-warnings option description:
  941. */
  942. /** Descriptive text for the suppress-warnings option */
  943. #define SUPPRESS_WARNINGS_DESC (tcprewrite_opt_strs+3673)
  944. /** Upper-cased name for the suppress-warnings option */
  945. #define SUPPRESS_WARNINGS_NAME (tcprewrite_opt_strs+3708)
  946. /** Name string for the suppress-warnings option */
  947. #define SUPPRESS_WARNINGS_name (tcprewrite_opt_strs+3726)
  948. /** Compiled in flag settings for the suppress-warnings option */
  949. #define SUPPRESS_WARNINGS_FLAGS (OPTST_DISABLED | OPTST_IMM)
  950. /*
  951. * Help/More_Help option descriptions:
  952. */
  953. #define HELP_DESC (tcprewrite_opt_strs+3744)
  954. #define HELP_name (tcprewrite_opt_strs+3788)
  955. #ifdef HAVE_WORKING_FORK
  956. #define MORE_HELP_DESC (tcprewrite_opt_strs+3793)
  957. #define MORE_HELP_name (tcprewrite_opt_strs+3838)
  958. #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
  959. #else
  960. #define MORE_HELP_DESC HELP_DESC
  961. #define MORE_HELP_name HELP_name
  962. #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  963. #endif
  964. #define SAVE_OPTS_DESC (tcprewrite_opt_strs+3848)
  965. #define SAVE_OPTS_name (tcprewrite_opt_strs+3887)
  966. #define LOAD_OPTS_DESC (tcprewrite_opt_strs+3897)
  967. #define LOAD_OPTS_NAME (tcprewrite_opt_strs+3929)
  968. #define NO_LOAD_OPTS_name (tcprewrite_opt_strs+3939)
  969. #define LOAD_OPTS_pfx (tcprewrite_opt_strs+3952)
  970. #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
  971. /**
  972. * Declare option callback procedures
  973. */
  974. #ifdef DEBUG
  975. static tOptProc doOptDbug;
  976. #else /* not DEBUG */
  977. # define doOptDbug NULL
  978. #endif /* def/not DEBUG */
  979. extern tOptProc
  980. optionBooleanVal, optionNestedVal, optionNumericVal,
  981. optionPagedUsage, optionPrintVersion, optionResetOpt,
  982. optionStackArg, optionTimeDate, optionTimeVal,
  983. optionUnstackArg, optionVendorOption;
  984. static tOptProc
  985. doOptCachefile, doOptEnet_Mac_Seed_Keep_Bytes,
  986. doOptEnet_Vlan_Cfi, doOptEnet_Vlan_Pri,
  987. doOptEnet_Vlan_Tag, doOptFlowlabel,
  988. doOptFuzz_Factor, doOptFuzz_Seed,
  989. doOptLess_Help, doOptMtu,
  990. doOptTclass, doOptTcp_Sequence,
  991. doOptTos, doOptVersion,
  992. doUsageOpt;
  993. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  994. /**
  995. * Define the tcprewrite Option Descriptions.
  996. * This is an array of OPTION_CT entries, one for each
  997. * option that the tcprewrite program responds to.
  998. */
  999. static tOptDesc optDesc[OPTION_CT] = {
  1000. { /* entry idx, value */ 0, 0,
  1001. /* equiv idx, value */ 0, 0,
  1002. /* equivalenced to */ NO_EQUIVALENT,
  1003. /* min, max, act ct */ 0, 0, 0,
  1004. /* opt state flags */ TCPEDIT_FLAGS, 0,
  1005. /* last opt argumnt */ { NULL },
  1006. /* arg list/cookie */ NULL,
  1007. /* must/cannot opts */ NULL, NULL,
  1008. /* option proc */ NULL,
  1009. /* desc, NAME, name */ TCPEDIT_DESC, NULL, NULL,
  1010. /* disablement strs */ NULL, NULL },
  1011. { /* entry idx, value */ 1, VALUE_OPT_PORTMAP,
  1012. /* equiv idx, value */ 1, VALUE_OPT_PORTMAP,
  1013. /* equivalenced to */ NO_EQUIVALENT,
  1014. /* min, max, act ct */ 0, 9999, 0,
  1015. /* opt state flags */ PORTMAP_FLAGS, 0,
  1016. /* last opt argumnt */ { NULL }, /* --portmap */
  1017. /* arg list/cookie */ NULL,
  1018. /* must/cannot opts */ NULL, NULL,
  1019. /* option proc */ optionStackArg,
  1020. /* desc, NAME, name */ PORTMAP_DESC, PORTMAP_NAME, PORTMAP_name,
  1021. /* disablement strs */ NULL, NULL },
  1022. { /* entry idx, value */ 2, VALUE_OPT_SEED,
  1023. /* equiv idx, value */ 2, VALUE_OPT_SEED,
  1024. /* equivalenced to */ NO_EQUIVALENT,
  1025. /* min, max, act ct */ 0, 1, 0,
  1026. /* opt state flags */ SEED_FLAGS, 0,
  1027. /* last opt argumnt */ { NULL }, /* --seed */
  1028. /* arg list/cookie */ NULL,
  1029. /* must/cannot opts */ NULL, aSeedCantList,
  1030. /* option proc */ optionNumericVal,
  1031. /* desc, NAME, name */ SEED_DESC, SEED_NAME, SEED_name,
  1032. /* disablement strs */ NULL, NULL },
  1033. { /* entry idx, value */ 3, VALUE_OPT_PNAT,
  1034. /* equiv idx, value */ 3, VALUE_OPT_PNAT,
  1035. /* equivalenced to */ NO_EQUIVALENT,
  1036. /* min, max, act ct */ 0, 2, 0,
  1037. /* opt state flags */ PNAT_FLAGS, 0,
  1038. /* last opt argumnt */ { NULL }, /* --pnat */
  1039. /* arg list/cookie */ NULL,
  1040. /* must/cannot opts */ NULL, aPnatCantList,
  1041. /* option proc */ optionStackArg,
  1042. /* desc, NAME, name */ PNAT_DESC, PNAT_NAME, PNAT_name,
  1043. /* disablement strs */ NULL, NULL },
  1044. { /* entry idx, value */ 4, VALUE_OPT_SRCIPMAP,
  1045. /* equiv idx, value */ 4, VALUE_OPT_SRCIPMAP,
  1046. /* equivalenced to */ NO_EQUIVALENT,
  1047. /* min, max, act ct */ 0, 1, 0,
  1048. /* opt state flags */ SRCIPMAP_FLAGS, 0,
  1049. /* last opt argumnt */ { NULL }, /* --srcipmap */
  1050. /* arg list/cookie */ NULL,
  1051. /* must/cannot opts */ NULL, aSrcipmapCantList,
  1052. /* option proc */ NULL,
  1053. /* desc, NAME, name */ SRCIPMAP_DESC, SRCIPMAP_NAME, SRCIPMAP_name,
  1054. /* disablement strs */ NULL, NULL },
  1055. { /* entry idx, value */ 5, VALUE_OPT_DSTIPMAP,
  1056. /* equiv idx, value */ 5, VALUE_OPT_DSTIPMAP,
  1057. /* equivalenced to */ NO_EQUIVALENT,
  1058. /* min, max, act ct */ 0, 1, 0,
  1059. /* opt state flags */ DSTIPMAP_FLAGS, 0,
  1060. /* last opt argumnt */ { NULL }, /* --dstipmap */
  1061. /* arg list/cookie */ NULL,
  1062. /* must/cannot opts */ NULL, aDstipmapCantList,
  1063. /* option proc */ NULL,
  1064. /* desc, NAME, name */ DSTIPMAP_DESC, DSTIPMAP_NAME, DSTIPMAP_name,
  1065. /* disablement strs */ NULL, NULL },
  1066. { /* entry idx, value */ 6, VALUE_OPT_ENDPOINTS,
  1067. /* equiv idx, value */ 6, VALUE_OPT_ENDPOINTS,
  1068. /* equivalenced to */ NO_EQUIVALENT,
  1069. /* min, max, act ct */ 0, 1, 0,
  1070. /* opt state flags */ ENDPOINTS_FLAGS, 0,
  1071. /* last opt argumnt */ { NULL }, /* --endpoints */
  1072. /* arg list/cookie */ NULL,
  1073. /* must/cannot opts */ aEndpointsMustList, NULL,
  1074. /* option proc */ NULL,
  1075. /* desc, NAME, name */ ENDPOINTS_DESC, ENDPOINTS_NAME, ENDPOINTS_name,
  1076. /* disablement strs */ NULL, NULL },
  1077. { /* entry idx, value */ 7, VALUE_OPT_TCP_SEQUENCE,
  1078. /* equiv idx, value */ 7, VALUE_OPT_TCP_SEQUENCE,
  1079. /* equivalenced to */ NO_EQUIVALENT,
  1080. /* min, max, act ct */ 0, 1, 0,
  1081. /* opt state flags */ TCP_SEQUENCE_FLAGS, 0,
  1082. /* last opt argumnt */ { TCP_SEQUENCE_DFT_ARG },
  1083. /* arg list/cookie */ NULL,
  1084. /* must/cannot opts */ NULL, NULL,
  1085. /* option proc */ doOptTcp_Sequence,
  1086. /* desc, NAME, name */ TCP_SEQUENCE_DESC, TCP_SEQUENCE_NAME, TCP_SEQUENCE_name,
  1087. /* disablement strs */ NULL, NULL },
  1088. { /* entry idx, value */ 8, VALUE_OPT_SKIPBROADCAST,
  1089. /* equiv idx, value */ 8, VALUE_OPT_SKIPBROADCAST,
  1090. /* equivalenced to */ NO_EQUIVALENT,
  1091. /* min, max, act ct */ 0, 1, 0,
  1092. /* opt state flags */ SKIPBROADCAST_FLAGS, 0,
  1093. /* last opt argumnt */ { NULL }, /* --skipbroadcast */
  1094. /* arg list/cookie */ NULL,
  1095. /* must/cannot opts */ NULL, NULL,
  1096. /* option proc */ NULL,
  1097. /* desc, NAME, name */ SKIPBROADCAST_DESC, SKIPBROADCAST_NAME, SKIPBROADCAST_name,
  1098. /* disablement strs */ NULL, NULL },
  1099. { /* entry idx, value */ 9, VALUE_OPT_FIXCSUM,
  1100. /* equiv idx, value */ 9, VALUE_OPT_FIXCSUM,
  1101. /* equivalenced to */ NO_EQUIVALENT,
  1102. /* min, max, act ct */ 0, 1, 0,
  1103. /* opt state flags */ FIXCSUM_FLAGS, 0,
  1104. /* last opt argumnt */ { NULL }, /* --fixcsum */
  1105. /* arg list/cookie */ NULL,
  1106. /* must/cannot opts */ NULL, NULL,
  1107. /* option proc */ NULL,
  1108. /* desc, NAME, name */ FIXCSUM_DESC, FIXCSUM_NAME, FIXCSUM_name,
  1109. /* disablement strs */ NULL, NULL },
  1110. { /* entry idx, value */ 10, VALUE_OPT_FIXHDRLEN,
  1111. /* equiv idx, value */ 10, VALUE_OPT_FIXHDRLEN,
  1112. /* equivalenced to */ NO_EQUIVALENT,
  1113. /* min, max, act ct */ 0, 1, 0,
  1114. /* opt state flags */ FIXHDRLEN_FLAGS, 0,
  1115. /* last opt argumnt */ { NULL }, /* --fixhdrlen */
  1116. /* arg list/cookie */ NULL,
  1117. /* must/cannot opts */ NULL, NULL,
  1118. /* option proc */ NULL,
  1119. /* desc, NAME, name */ FIXHDRLEN_DESC, FIXHDRLEN_NAME, FIXHDRLEN_name,
  1120. /* disablement strs */ NULL, NULL },
  1121. { /* entry idx, value */ 11, VALUE_OPT_MTU,
  1122. /* equiv idx, value */ 11, VALUE_OPT_MTU,
  1123. /* equivalenced to */ NO_EQUIVALENT,
  1124. /* min, max, act ct */ 0, 1, 0,
  1125. /* opt state flags */ MTU_FLAGS, 0,
  1126. /* last opt argumnt */ { NULL }, /* --mtu */
  1127. /* arg list/cookie */ NULL,
  1128. /* must/cannot opts */ NULL, NULL,
  1129. /* option proc */ doOptMtu,
  1130. /* desc, NAME, name */ MTU_DESC, MTU_NAME, MTU_name,
  1131. /* disablement strs */ NULL, NULL },
  1132. { /* entry idx, value */ 12, VALUE_OPT_MTU_TRUNC,
  1133. /* equiv idx, value */ 12, VALUE_OPT_MTU_TRUNC,
  1134. /* equivalenced to */ NO_EQUIVALENT,
  1135. /* min, max, act ct */ 0, 1, 0,
  1136. /* opt state flags */ MTU_TRUNC_FLAGS, 0,
  1137. /* last opt argumnt */ { NULL }, /* --mtu-trunc */
  1138. /* arg list/cookie */ NULL,
  1139. /* must/cannot opts */ NULL, NULL,
  1140. /* option proc */ NULL,
  1141. /* desc, NAME, name */ MTU_TRUNC_DESC, MTU_TRUNC_NAME, MTU_TRUNC_name,
  1142. /* disablement strs */ NULL, NULL },
  1143. { /* entry idx, value */ 13, VALUE_OPT_EFCS,
  1144. /* equiv idx, value */ 13, VALUE_OPT_EFCS,
  1145. /* equivalenced to */ NO_EQUIVALENT,
  1146. /* min, max, act ct */ 0, 1, 0,
  1147. /* opt state flags */ EFCS_FLAGS, 0,
  1148. /* last opt argumnt */ { NULL }, /* --efcs */
  1149. /* arg list/cookie */ NULL,
  1150. /* must/cannot opts */ NULL, NULL,
  1151. /* option proc */ NULL,
  1152. /* desc, NAME, name */ EFCS_DESC, EFCS_NAME, EFCS_name,
  1153. /* disablement strs */ NULL, NULL },
  1154. { /* entry idx, value */ 14, VALUE_OPT_TTL,
  1155. /* equiv idx, value */ 14, VALUE_OPT_TTL,
  1156. /* equivalenced to */ NO_EQUIVALENT,
  1157. /* min, max, act ct */ 0, 1, 0,
  1158. /* opt state flags */ TTL_FLAGS, 0,
  1159. /* last opt argumnt */ { NULL }, /* --ttl */
  1160. /* arg list/cookie */ NULL,
  1161. /* must/cannot opts */ NULL, NULL,
  1162. /* option proc */ NULL,
  1163. /* desc, NAME, name */ TTL_DESC, TTL_NAME, TTL_name,
  1164. /* disablement strs */ NULL, NULL },
  1165. { /* entry idx, value */ 15, VALUE_OPT_TOS,
  1166. /* equiv idx, value */ 15, VALUE_OPT_TOS,
  1167. /* equivalenced to */ NO_EQUIVALENT,
  1168. /* min, max, act ct */ 0, 1, 0,
  1169. /* opt state flags */ TOS_FLAGS, 0,
  1170. /* last opt argumnt */ { NULL }, /* --tos */
  1171. /* arg list/cookie */ NULL,
  1172. /* must/cannot opts */ NULL, NULL,
  1173. /* option proc */ doOptTos,
  1174. /* desc, NAME, name */ TOS_DESC, TOS_NAME, TOS_name,
  1175. /* disablement strs */ NULL, NULL },
  1176. { /* entry idx, value */ 16, VALUE_OPT_TCLASS,
  1177. /* equiv idx, value */ 16, VALUE_OPT_TCLASS,
  1178. /* equivalenced to */ NO_EQUIVALENT,
  1179. /* min, max, act ct */ 0, 1, 0,
  1180. /* opt state flags */ TCLASS_FLAGS, 0,
  1181. /* last opt argumnt */ { NULL }, /* --tclass */
  1182. /* arg list/cookie */ NULL,
  1183. /* must/cannot opts */ NULL, NULL,
  1184. /* option proc */ doOptTclass,
  1185. /* desc, NAME, name */ TCLASS_DESC, TCLASS_NAME, TCLASS_name,
  1186. /* disablement strs */ NULL, NULL },
  1187. { /* entry idx, value */ 17, VALUE_OPT_FLOWLABEL,
  1188. /* equiv idx, value */ 17, VALUE_OPT_FLOWLABEL,
  1189. /* equivalenced to */ NO_EQUIVALENT,
  1190. /* min, max, act ct */ 0, 1, 0,
  1191. /* opt state flags */ FLOWLABEL_FLAGS, 0,
  1192. /* last opt argumnt */ { NULL }, /* --flowlabel */
  1193. /* arg list/cookie */ NULL,
  1194. /* must/cannot opts */ NULL, NULL,
  1195. /* option proc */ doOptFlowlabel,
  1196. /* desc, NAME, name */ FLOWLABEL_DESC, FLOWLABEL_NAME, FLOWLABEL_name,
  1197. /* disablement strs */ NULL, NULL },
  1198. { /* entry idx, value */ 18, VALUE_OPT_FIXLEN,
  1199. /* equiv idx, value */ 18, VALUE_OPT_FIXLEN,
  1200. /* equivalenced to */ NO_EQUIVALENT,
  1201. /* min, max, act ct */ 0, 1, 0,
  1202. /* opt state flags */ FIXLEN_FLAGS, 0,
  1203. /* last opt argumnt */ { NULL }, /* --fixlen */
  1204. /* arg list/cookie */ NULL,
  1205. /* must/cannot opts */ NULL, NULL,
  1206. /* option proc */ NULL,
  1207. /* desc, NAME, name */ FIXLEN_DESC, FIXLEN_NAME, FIXLEN_name,
  1208. /* disablement strs */ NULL, NULL },
  1209. { /* entry idx, value */ 19, VALUE_OPT_FUZZ_SEED,
  1210. /* equiv idx, value */ 19, VALUE_OPT_FUZZ_SEED,
  1211. /* equivalenced to */ NO_EQUIVALENT,
  1212. /* min, max, act ct */ 0, 1, 0,
  1213. /* opt state flags */ FUZZ_SEED_FLAGS, 0,
  1214. /* last opt argumnt */ { FUZZ_SEED_DFT_ARG },
  1215. /* arg list/cookie */ NULL,
  1216. /* must/cannot opts */ NULL, NULL,
  1217. /* option proc */ doOptFuzz_Seed,
  1218. /* desc, NAME, name */ FUZZ_SEED_DESC, FUZZ_SEED_NAME, FUZZ_SEED_name,
  1219. /* disablement strs */ NULL, NULL },
  1220. { /* entry idx, value */ 20, VALUE_OPT_FUZZ_FACTOR,
  1221. /* equiv idx, value */ 20, VALUE_OPT_FUZZ_FACTOR,
  1222. /* equivalenced to */ NO_EQUIVALENT,
  1223. /* min, max, act ct */ 0, 1, 0,
  1224. /* opt state flags */ FUZZ_FACTOR_FLAGS, 0,
  1225. /* last opt argumnt */ { FUZZ_FACTOR_DFT_ARG },
  1226. /* arg list/cookie */ NULL,
  1227. /* must/cannot opts */ aFuzz_FactorMustList, NULL,
  1228. /* option proc */ doOptFuzz_Factor,
  1229. /* desc, NAME, name */ FUZZ_FACTOR_DESC, FUZZ_FACTOR_NAME, FUZZ_FACTOR_name,
  1230. /* disablement strs */ NULL, NULL },
  1231. { /* entry idx, value */ 21, VALUE_OPT_SKIPL2BROADCAST,
  1232. /* equiv idx, value */ 21, VALUE_OPT_SKIPL2BROADCAST,
  1233. /* equivalenced to */ NO_EQUIVALENT,
  1234. /* min, max, act ct */ 0, 1, 0,
  1235. /* opt state flags */ SKIPL2BROADCAST_FLAGS, 0,
  1236. /* last opt argumnt */ { NULL }, /* --skipl2broadcast */
  1237. /* arg list/cookie */ NULL,
  1238. /* must/cannot opts */ NULL, NULL,
  1239. /* option proc */ NULL,
  1240. /* desc, NAME, name */ SKIPL2BROADCAST_DESC, SKIPL2BROADCAST_NAME, SKIPL2BROADCAST_name,
  1241. /* disablement strs */ NULL, NULL },
  1242. { /* entry idx, value */ 22, VALUE_OPT_DLT,
  1243. /* equiv idx, value */ 22, VALUE_OPT_DLT,
  1244. /* equivalenced to */ NO_EQUIVALENT,
  1245. /* min, max, act ct */ 0, 1, 0,
  1246. /* opt state flags */ DLT_FLAGS, 0,
  1247. /* last opt argumnt */ { NULL }, /* --dlt */
  1248. /* arg list/cookie */ NULL,
  1249. /* must/cannot opts */ NULL, NULL,
  1250. /* option proc */ NULL,
  1251. /* desc, NAME, name */ DLT_DESC, DLT_NAME, DLT_name,
  1252. /* disablement strs */ NULL, NULL },
  1253. { /* entry idx, value */ 23, VALUE_OPT_ENET_DMAC,
  1254. /* equiv idx, value */ 23, VALUE_OPT_ENET_DMAC,
  1255. /* equivalenced to */ NO_EQUIVALENT,
  1256. /* min, max, act ct */ 0, 1, 0,
  1257. /* opt state flags */ ENET_DMAC_FLAGS, 0,
  1258. /* last opt argumnt */ { NULL }, /* --enet-dmac */
  1259. /* arg list/cookie */ NULL,
  1260. /* must/cannot opts */ NULL, NULL,
  1261. /* option proc */ NULL,
  1262. /* desc, NAME, name */ ENET_DMAC_DESC, ENET_DMAC_NAME, ENET_DMAC_name,
  1263. /* disablement strs */ NULL, NULL },
  1264. { /* entry idx, value */ 24, VALUE_OPT_ENET_SMAC,
  1265. /* equiv idx, value */ 24, VALUE_OPT_ENET_SMAC,
  1266. /* equivalenced to */ NO_EQUIVALENT,
  1267. /* min, max, act ct */ 0, 1, 0,
  1268. /* opt state flags */ ENET_SMAC_FLAGS, 0,
  1269. /* last opt argumnt */ { NULL }, /* --enet-smac */
  1270. /* arg list/cookie */ NULL,
  1271. /* must/cannot opts */ NULL, NULL,
  1272. /* option proc */ NULL,
  1273. /* desc, NAME, name */ ENET_SMAC_DESC, ENET_SMAC_NAME, ENET_SMAC_name,
  1274. /* disablement strs */ NULL, NULL },
  1275. { /* entry idx, value */ 25, VALUE_OPT_ENET_SUBSMAC,
  1276. /* equiv idx, value */ 25, VALUE_OPT_ENET_SUBSMAC,
  1277. /* equivalenced to */ NO_EQUIVALENT,
  1278. /* min, max, act ct */ 0, 9999, 0,
  1279. /* opt state flags */ ENET_SUBSMAC_FLAGS, 0,
  1280. /* last opt argumnt */ { NULL }, /* --enet-subsmac */
  1281. /* arg list/cookie */ NULL,
  1282. /* must/cannot opts */ NULL, NULL,
  1283. /* option proc */ optionStackArg,
  1284. /* desc, NAME, name */ ENET_SUBSMAC_DESC, ENET_SUBSMAC_NAME, ENET_SUBSMAC_name,
  1285. /* disablement strs */ NULL, NULL },
  1286. { /* entry idx, value */ 26, VALUE_OPT_ENET_MAC_SEED,
  1287. /* equiv idx, value */ 26, VALUE_OPT_ENET_MAC_SEED,
  1288. /* equivalenced to */ NO_EQUIVALENT,
  1289. /* min, max, act ct */ 0, 1, 0,
  1290. /* opt state flags */ ENET_MAC_SEED_FLAGS, 0,
  1291. /* last opt argumnt */ { NULL }, /* --enet-mac-seed */
  1292. /* arg list/cookie */ NULL,
  1293. /* must/cannot opts */ NULL, aEnet_Mac_SeedCantList,
  1294. /* option proc */ optionNumericVal,
  1295. /* desc, NAME, name */ ENET_MAC_SEED_DESC, ENET_MAC_SEED_NAME, ENET_MAC_SEED_name,
  1296. /* disablement strs */ NULL, NULL },
  1297. { /* entry idx, value */ 27, VALUE_OPT_ENET_MAC_SEED_KEEP_BYTES,
  1298. /* equiv idx, value */ 27, VALUE_OPT_ENET_MAC_SEED_KEEP_BYTES,
  1299. /* equivalenced to */ NO_EQUIVALENT,
  1300. /* min, max, act ct */ 0, 1, 0,
  1301. /* opt state flags */ ENET_MAC_SEED_KEEP_BYTES_FLAGS, 0,
  1302. /* last opt argumnt */ { NULL }, /* --enet-mac-seed-keep-bytes */
  1303. /* arg list/cookie */ NULL,
  1304. /* must/cannot opts */ aEnet_Mac_Seed_Keep_BytesMustList, NULL,
  1305. /* option proc */ doOptEnet_Mac_Seed_Keep_Bytes,
  1306. /* desc, NAME, name */ ENET_MAC_SEED_KEEP_BYTES_DESC, ENET_MAC_SEED_KEEP_BYTES_NAME, ENET_MAC_SEED_KEEP_BYTES_name,
  1307. /* disablement strs */ NULL, NULL },
  1308. { /* entry idx, value */ 28, VALUE_OPT_ENET_VLAN,
  1309. /* equiv idx, value */ 28, VALUE_OPT_ENET_VLAN,
  1310. /* equivalenced to */ NO_EQUIVALENT,
  1311. /* min, max, act ct */ 0, 1, 0,
  1312. /* opt state flags */ ENET_VLAN_FLAGS, 0,
  1313. /* last opt argumnt */ { NULL }, /* --enet-vlan */
  1314. /* arg list/cookie */ NULL,
  1315. /* must/cannot opts */ NULL, NULL,
  1316. /* option proc */ NULL,
  1317. /* desc, NAME, name */ ENET_VLAN_DESC, ENET_VLAN_NAME, ENET_VLAN_name,
  1318. /* disablement strs */ NULL, NULL },
  1319. { /* entry idx, value */ 29, VALUE_OPT_ENET_VLAN_TAG,
  1320. /* equiv idx, value */ 29, VALUE_OPT_ENET_VLAN_TAG,
  1321. /* equivalenced to */ NO_EQUIVALENT,
  1322. /* min, max, act ct */ 0, 1, 0,
  1323. /* opt state flags */ ENET_VLAN_TAG_FLAGS, 0,
  1324. /* last opt argumnt */ { NULL }, /* --enet-vlan-tag */
  1325. /* arg list/cookie */ NULL,
  1326. /* must/cannot opts */ aEnet_Vlan_TagMustList, NULL,
  1327. /* option proc */ doOptEnet_Vlan_Tag,
  1328. /* desc, NAME, name */ ENET_VLAN_TAG_DESC, ENET_VLAN_TAG_NAME, ENET_VLAN_TAG_name,
  1329. /* disablement strs */ NULL, NULL },
  1330. { /* entry idx, value */ 30, VALUE_OPT_ENET_VLAN_CFI,
  1331. /* equiv idx, value */ 30, VALUE_OPT_ENET_VLAN_CFI,
  1332. /* equivalenced to */ NO_EQUIVALENT,
  1333. /* min, max, act ct */ 0, 1, 0,
  1334. /* opt state flags */ ENET_VLAN_CFI_FLAGS, 0,
  1335. /* last opt argumnt */ { NULL }, /* --enet-vlan-cfi */
  1336. /* arg list/cookie */ NULL,
  1337. /* must/cannot opts */ aEnet_Vlan_CfiMustList, NULL,
  1338. /* option proc */ doOptEnet_Vlan_Cfi,
  1339. /* desc, NAME, name */ ENET_VLAN_CFI_DESC, ENET_VLAN_CFI_NAME, ENET_VLAN_CFI_name,
  1340. /* disablement strs */ NULL, NULL },
  1341. { /* entry idx, value */ 31, VALUE_OPT_ENET_VLAN_PRI,
  1342. /* equiv idx, value */ 31, VALUE_OPT_ENET_VLAN_PRI,
  1343. /* equivalenced to */ NO_EQUIVALENT,
  1344. /* min, max, act ct */ 0, 1, 0,
  1345. /* opt state flags */ ENET_VLAN_PRI_FLAGS, 0,
  1346. /* last opt argumnt */ { NULL }, /* --enet-vlan-pri */
  1347. /* arg list/cookie */ NULL,
  1348. /* must/cannot opts */ aEnet_Vlan_PriMustList, NULL,
  1349. /* option proc */ doOptEnet_Vlan_Pri,
  1350. /* desc, NAME, name */ ENET_VLAN_PRI_DESC, ENET_VLAN_PRI_NAME, ENET_VLAN_PRI_name,
  1351. /* disablement strs */ NULL, NULL },
  1352. { /* entry idx, value */ 32, VALUE_OPT_ENET_VLAN_PROTO,
  1353. /* equiv idx, value */ 32, VALUE_OPT_ENET_VLAN_PROTO,
  1354. /* equivalenced to */ NO_EQUIVALENT,
  1355. /* min, max, act ct */ 0, 1, 0,
  1356. /* opt state flags */ ENET_VLAN_PROTO_FLAGS, 0,
  1357. /* last opt argumnt */ { NULL }, /* --enet-vlan-proto */
  1358. /* arg list/cookie */ NULL,
  1359. /* must/cannot opts */ NULL, NULL,
  1360. /* option proc */ NULL,
  1361. /* desc, NAME, name */ ENET_VLAN_PROTO_DESC, ENET_VLAN_PROTO_NAME, ENET_VLAN_PROTO_name,
  1362. /* disablement strs */ NULL, NULL },
  1363. { /* entry idx, value */ 33, VALUE_OPT_HDLC_CONTROL,
  1364. /* equiv idx, value */ 33, VALUE_OPT_HDLC_CONTROL,
  1365. /* equivalenced to */ NO_EQUIVALENT,
  1366. /* min, max, act ct */ 0, 1, 0,
  1367. /* opt state flags */ HDLC_CONTROL_FLAGS, 0,
  1368. /* last opt argumnt */ { NULL }, /* --hdlc-control */
  1369. /* arg list/cookie */ NULL,
  1370. /* must/cannot opts */ NULL, NULL,
  1371. /* option proc */ optionNumericVal,
  1372. /* desc, NAME, name */ HDLC_CONTROL_DESC, HDLC_CONTROL_NAME, HDLC_CONTROL_name,
  1373. /* disablement strs */ NULL, NULL },
  1374. { /* entry idx, value */ 34, VALUE_OPT_HDLC_ADDRESS,
  1375. /* equiv idx, value */ 34, VALUE_OPT_HDLC_ADDRESS,
  1376. /* equivalenced to */ NO_EQUIVALENT,
  1377. /* min, max, act ct */ 0, 1, 0,
  1378. /* opt state flags */ HDLC_ADDRESS_FLAGS, 0,
  1379. /* last opt argumnt */ { NULL }, /* --hdlc-address */
  1380. /* arg list/cookie */ NULL,
  1381. /* must/cannot opts */ NULL, NULL,
  1382. /* option proc */ optionNumericVal,
  1383. /* desc, NAME, name */ HDLC_ADDRESS_DESC, HDLC_ADDRESS_NAME, HDLC_ADDRESS_name,
  1384. /* disablement strs */ NULL, NULL },
  1385. { /* entry idx, value */ 35, VALUE_OPT_USER_DLT,
  1386. /* equiv idx, value */ 35, VALUE_OPT_USER_DLT,
  1387. /* equivalenced to */ NO_EQUIVALENT,
  1388. /* min, max, act ct */ 0, 1, 0,
  1389. /* opt state flags */ USER_DLT_FLAGS, 0,
  1390. /* last opt argumnt */ { NULL }, /* --user-dlt */
  1391. /* arg list/cookie */ NULL,
  1392. /* must/cannot opts */ NULL, NULL,
  1393. /* option proc */ optionNumericVal,
  1394. /* desc, NAME, name */ USER_DLT_DESC, USER_DLT_NAME, USER_DLT_name,
  1395. /* disablement strs */ NULL, NULL },
  1396. { /* entry idx, value */ 36, VALUE_OPT_USER_DLINK,
  1397. /* equiv idx, value */ 36, VALUE_OPT_USER_DLINK,
  1398. /* equivalenced to */ NO_EQUIVALENT,
  1399. /* min, max, act ct */ 0, 2, 0,
  1400. /* opt state flags */ USER_DLINK_FLAGS, 0,
  1401. /* last opt argumnt */ { NULL }, /* --user-dlink */
  1402. /* arg list/cookie */ NULL,
  1403. /* must/cannot opts */ NULL, NULL,
  1404. /* option proc */ optionStackArg,
  1405. /* desc, NAME, name */ USER_DLINK_DESC, USER_DLINK_NAME, USER_DLINK_name,
  1406. /* disablement strs */ NULL, NULL },
  1407. { /* entry idx, value */ 37, VALUE_OPT_DBUG,
  1408. /* equiv idx, value */ 37, VALUE_OPT_DBUG,
  1409. /* equivalenced to */ NO_EQUIVALENT,
  1410. /* min, max, act ct */ 0, 1, 0,
  1411. /* opt state flags */ DBUG_FLAGS, 0,
  1412. /* last opt argumnt */ { DBUG_DFT_ARG },
  1413. /* arg list/cookie */ NULL,
  1414. /* must/cannot opts */ NULL, NULL,
  1415. /* option proc */ doOptDbug,
  1416. /* desc, NAME, name */ DBUG_DESC, DBUG_NAME, DBUG_name,
  1417. /* disablement strs */ NULL, NULL },
  1418. { /* entry idx, value */ 38, VALUE_OPT_INFILE,
  1419. /* equiv idx, value */ 38, VALUE_OPT_INFILE,
  1420. /* equivalenced to */ NO_EQUIVALENT,
  1421. /* min, max, act ct */ 1, 1, 0,
  1422. /* opt state flags */ INFILE_FLAGS, 0,
  1423. /* last opt argumnt */ { NULL }, /* --infile */
  1424. /* arg list/cookie */ NULL,
  1425. /* must/cannot opts */ NULL, NULL,
  1426. /* option proc */ NULL,
  1427. /* desc, NAME, name */ INFILE_DESC, INFILE_NAME, INFILE_name,
  1428. /* disablement strs */ NULL, NULL },
  1429. { /* entry idx, value */ 39, VALUE_OPT_OUTFILE,
  1430. /* equiv idx, value */ 39, VALUE_OPT_OUTFILE,
  1431. /* equivalenced to */ NO_EQUIVALENT,
  1432. /* min, max, act ct */ 1, 1, 0,
  1433. /* opt state flags */ OUTFILE_FLAGS, 0,
  1434. /* last opt argumnt */ { NULL }, /* --outfile */
  1435. /* arg list/cookie */ NULL,
  1436. /* must/cannot opts */ NULL, NULL,
  1437. /* option proc */ NULL,
  1438. /* desc, NAME, name */ OUTFILE_DESC, OUTFILE_NAME, OUTFILE_name,
  1439. /* disablement strs */ NULL, NULL },
  1440. { /* entry idx, value */ 40, VALUE_OPT_CACHEFILE,
  1441. /* equiv idx, value */ 40, VALUE_OPT_CACHEFILE,
  1442. /* equivalenced to */ NO_EQUIVALENT,
  1443. /* min, max, act ct */ 0, 1, 0,
  1444. /* opt state flags */ CACHEFILE_FLAGS, 0,
  1445. /* last opt argumnt */ { NULL }, /* --cachefile */
  1446. /* arg list/cookie */ NULL,
  1447. /* must/cannot opts */ NULL, NULL,
  1448. /* option proc */ doOptCachefile,
  1449. /* desc, NAME, name */ CACHEFILE_DESC, CACHEFILE_NAME, CACHEFILE_name,
  1450. /* disablement strs */ NULL, NULL },
  1451. { /* entry idx, value */ 41, VALUE_OPT_VERBOSE,
  1452. /* equiv idx, value */ 41, VALUE_OPT_VERBOSE,
  1453. /* equivalenced to */ NO_EQUIVALENT,
  1454. /* min, max, act ct */ 0, 1, 0,
  1455. /* opt state flags */ VERBOSE_FLAGS, 0,
  1456. /* last opt argumnt */ { NULL }, /* --verbose */
  1457. /* arg list/cookie */ NULL,
  1458. /* must/cannot opts */ NULL, NULL,
  1459. /* option proc */ NULL,
  1460. /* desc, NAME, name */ VERBOSE_DESC, VERBOSE_NAME, VERBOSE_name,
  1461. /* disablement strs */ NULL, NULL },
  1462. { /* entry idx, value */ 42, VALUE_OPT_DECODE,
  1463. /* equiv idx, value */ 42, VALUE_OPT_DECODE,
  1464. /* equivalenced to */ NO_EQUIVALENT,
  1465. /* min, max, act ct */ 0, 1, 0,
  1466. /* opt state flags */ DECODE_FLAGS, 0,
  1467. /* last opt argumnt */ { NULL }, /* --decode */
  1468. /* arg list/cookie */ NULL,
  1469. /* must/cannot opts */ aDecodeMustList, NULL,
  1470. /* option proc */ NULL,
  1471. /* desc, NAME, name */ DECODE_DESC, DECODE_NAME, DECODE_name,
  1472. /* disablement strs */ NULL, NULL },
  1473. { /* entry idx, value */ 43, VALUE_OPT_FRAGROUTE,
  1474. /* equiv idx, value */ 43, VALUE_OPT_FRAGROUTE,
  1475. /* equivalenced to */ NO_EQUIVALENT,
  1476. /* min, max, act ct */ 0, 1, 0,
  1477. /* opt state flags */ FRAGROUTE_FLAGS, 0,
  1478. /* last opt argumnt */ { NULL }, /* --fragroute */
  1479. /* arg list/cookie */ NULL,
  1480. /* must/cannot opts */ NULL, NULL,
  1481. /* option proc */ NULL,
  1482. /* desc, NAME, name */ FRAGROUTE_DESC, FRAGROUTE_NAME, FRAGROUTE_name,
  1483. /* disablement strs */ NULL, NULL },
  1484. { /* entry idx, value */ 44, VALUE_OPT_FRAGDIR,
  1485. /* equiv idx, value */ 44, VALUE_OPT_FRAGDIR,
  1486. /* equivalenced to */ NO_EQUIVALENT,
  1487. /* min, max, act ct */ 0, 1, 0,
  1488. /* opt state flags */ FRAGDIR_FLAGS, 0,
  1489. /* last opt argumnt */ { NULL }, /* --fragdir */
  1490. /* arg list/cookie */ NULL,
  1491. /* must/cannot opts */ aFragdirMustList, NULL,
  1492. /* option proc */ NULL,
  1493. /* desc, NAME, name */ FRAGDIR_DESC, FRAGDIR_NAME, FRAGDIR_name,
  1494. /* disablement strs */ NULL, NULL },
  1495. { /* entry idx, value */ 45, VALUE_OPT_SKIP_SOFT_ERRORS,
  1496. /* equiv idx, value */ 45, VALUE_OPT_SKIP_SOFT_ERRORS,
  1497. /* equivalenced to */ NO_EQUIVALENT,
  1498. /* min, max, act ct */ 0, 1, 0,
  1499. /* opt state flags */ SKIP_SOFT_ERRORS_FLAGS, 0,
  1500. /* last opt argumnt */ { NULL }, /* --skip-soft-errors */
  1501. /* arg list/cookie */ NULL,
  1502. /* must/cannot opts */ NULL, NULL,
  1503. /* option proc */ NULL,
  1504. /* desc, NAME, name */ SKIP_SOFT_ERRORS_DESC, SKIP_SOFT_ERRORS_NAME, SKIP_SOFT_ERRORS_name,
  1505. /* disablement strs */ NULL, NULL },
  1506. { /* entry idx, value */ 46, VALUE_OPT_VERSION,
  1507. /* equiv idx, value */ 46, VALUE_OPT_VERSION,
  1508. /* equivalenced to */ NO_EQUIVALENT,
  1509. /* min, max, act ct */ 0, 1, 0,
  1510. /* opt state flags */ VERSION_FLAGS, 0,
  1511. /* last opt argumnt */ { NULL }, /* --version */
  1512. /* arg list/cookie */ NULL,
  1513. /* must/cannot opts */ NULL, NULL,
  1514. /* option proc */ doOptVersion,
  1515. /* desc, NAME, name */ VERSION_DESC, VERSION_NAME, VERSION_name,
  1516. /* disablement strs */ NULL, NULL },
  1517. { /* entry idx, value */ 47, VALUE_OPT_LESS_HELP,
  1518. /* equiv idx, value */ 47, VALUE_OPT_LESS_HELP,
  1519. /* equivalenced to */ NO_EQUIVALENT,
  1520. /* min, max, act ct */ 0, 1, 0,
  1521. /* opt state flags */ LESS_HELP_FLAGS, 0,
  1522. /* last opt argumnt */ { NULL }, /* --less-help */
  1523. /* arg list/cookie */ NULL,
  1524. /* must/cannot opts */ NULL, NULL,
  1525. /* option proc */ doOptLess_Help,
  1526. /* desc, NAME, name */ LESS_HELP_DESC, LESS_HELP_NAME, LESS_HELP_name,
  1527. /* disablement strs */ NULL, NULL },
  1528. { /* entry idx, value */ 48, VALUE_OPT_SUPPRESS_WARNINGS,
  1529. /* equiv idx, value */ 48, VALUE_OPT_SUPPRESS_WARNINGS,
  1530. /* equivalenced to */ NO_EQUIVALENT,
  1531. /* min, max, act ct */ 0, 1, 0,
  1532. /* opt state flags */ SUPPRESS_WARNINGS_FLAGS, 0,
  1533. /* last opt argumnt */ { NULL }, /* --suppress-warnings */
  1534. /* arg list/cookie */ NULL,
  1535. /* must/cannot opts */ NULL, NULL,
  1536. /* option proc */ NULL,
  1537. /* desc, NAME, name */ SUPPRESS_WARNINGS_DESC, SUPPRESS_WARNINGS_NAME, SUPPRESS_WARNINGS_name,
  1538. /* disablement strs */ NULL, NULL },
  1539. { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
  1540. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
  1541. /* equivalenced to */ NO_EQUIVALENT,
  1542. /* min, max, act ct */ 0, 1, 0,
  1543. /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
  1544. /* last opt argumnt */ { NULL },
  1545. /* arg list/cookie */ NULL,
  1546. /* must/cannot opts */ NULL, NULL,
  1547. /* option proc */ doUsageOpt,
  1548. /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
  1549. /* disablement strs */ NULL, NULL },
  1550. { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
  1551. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
  1552. /* equivalenced to */ NO_EQUIVALENT,
  1553. /* min, max, act ct */ 0, 1, 0,
  1554. /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
  1555. /* last opt argumnt */ { NULL },
  1556. /* arg list/cookie */ NULL,
  1557. /* must/cannot opts */ NULL, NULL,
  1558. /* option proc */ optionPagedUsage,
  1559. /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
  1560. /* disablement strs */ NULL, NULL },
  1561. { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
  1562. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
  1563. /* equivalenced to */ NO_EQUIVALENT,
  1564. /* min, max, act ct */ 0, 1, 0,
  1565. /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
  1566. | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
  1567. /* last opt argumnt */ { NULL },
  1568. /* arg list/cookie */ NULL,
  1569. /* must/cannot opts */ NULL, NULL,
  1570. /* option proc */ NULL,
  1571. /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
  1572. /* disablement strs */ NULL, NULL },
  1573. { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
  1574. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
  1575. /* equivalenced to */ NO_EQUIVALENT,
  1576. /* min, max, act ct */ 0, NOLIMIT, 0,
  1577. /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
  1578. | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
  1579. /* last opt argumnt */ { NULL },
  1580. /* arg list/cookie */ NULL,
  1581. /* must/cannot opts */ NULL, NULL,
  1582. /* option proc */ optionLoadOpt,
  1583. /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
  1584. /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
  1585. };
  1586. tOptDesc * const tcpedit_tcpedit_optDesc_p = optDesc + 0;
  1587. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1588. /** Reference to the upper cased version of tcprewrite. */
  1589. #define zPROGNAME (tcprewrite_opt_strs+3955)
  1590. /** Reference to the title line for tcprewrite usage. */
  1591. #define zUsageTitle (tcprewrite_opt_strs+3966)
  1592. /** tcprewrite configuration file name. */
  1593. #define zRcName (tcprewrite_opt_strs+4090)
  1594. /** Directories to search for tcprewrite config files. */
  1595. static char const * const apzHomeList[2] = {
  1596. tcprewrite_opt_strs+4086,
  1597. NULL };
  1598. /** The tcprewrite program bug email address. */
  1599. #define zBugsAddr (tcprewrite_opt_strs+4104)
  1600. /** Clarification/explanation of what tcprewrite does. */
  1601. #define zExplain (NULL)
  1602. /** Extra detail explaining what tcprewrite does. */
  1603. #define zDetail (tcprewrite_opt_strs+4142)
  1604. /** The full version string for tcprewrite. */
  1605. #define zFullVersion (NULL)
  1606. /* extracted from optcode.tlib near line 342 */
  1607. #if defined(ENABLE_NLS)
  1608. # define OPTPROC_BASE OPTPROC_TRANSLATE
  1609. static tOptionXlateProc translate_option_strings;
  1610. #else
  1611. # define OPTPROC_BASE OPTPROC_NONE
  1612. # define translate_option_strings NULL
  1613. #endif /* ENABLE_NLS */
  1614. #define tcprewrite_full_usage (NULL)
  1615. #define tcprewrite_short_usage (NULL)
  1616. #endif /* not defined __doxygen__ */
  1617. /*
  1618. * Create the static procedure(s) declared above.
  1619. */
  1620. /**
  1621. * The callout function that invokes the optionUsage function.
  1622. *
  1623. * @param[in] opts the AutoOpts option description structure
  1624. * @param[in] od the descriptor for the "help" (usage) option.
  1625. * @noreturn
  1626. */
  1627. static void
  1628. doUsageOpt(tOptions * opts, tOptDesc * od)
  1629. {
  1630. int ex_code;
  1631. ex_code = TCPREWRITE_EXIT_SUCCESS;
  1632. optionUsage(&tcprewriteOptions, ex_code);
  1633. /* NOTREACHED */
  1634. exit(TCPREWRITE_EXIT_FAILURE);
  1635. (void)opts;
  1636. (void)od;
  1637. }
  1638. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1639. /**
  1640. * Code to handle the tcp-sequence option.
  1641. * Change all TCP sequence numbers, and related sequence-acknowledgement numbers.
  1642. * They will be shifted by a random amount based on the provided seed.
  1643. * @param[in] pOptions the tcprewrite options data structure
  1644. * @param[in,out] pOptDesc the option descriptor for this option.
  1645. */
  1646. static void
  1647. doOptTcp_Sequence(tOptions* pOptions, tOptDesc* pOptDesc)
  1648. {
  1649. static struct {long rmin, rmax;} const rng[1] = {
  1650. { 1, LONG_MAX } };
  1651. int ix;
  1652. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1653. goto emit_ranges;
  1654. optionNumericVal(pOptions, pOptDesc);
  1655. for (ix = 0; ix < 1; ix++) {
  1656. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1657. continue; /* ranges need not be ordered. */
  1658. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1659. return;
  1660. if (rng[ix].rmax == LONG_MIN)
  1661. continue;
  1662. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1663. return;
  1664. }
  1665. option_usage_fp = stderr;
  1666. emit_ranges:
  1667. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1668. }
  1669. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1670. /**
  1671. * Code to handle the mtu option.
  1672. * Override the default 1500 byte MTU size for determining the maximum padding length
  1673. * (--fixlen=pad) or when truncating (--mtu-trunc).
  1674. * @param[in] pOptions the tcprewrite options data structure
  1675. * @param[in,out] pOptDesc the option descriptor for this option.
  1676. */
  1677. static void
  1678. doOptMtu(tOptions* pOptions, tOptDesc* pOptDesc)
  1679. {
  1680. static struct {long rmin, rmax;} const rng[1] = {
  1681. { 1, MAX_SNAPLEN } };
  1682. int ix;
  1683. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1684. goto emit_ranges;
  1685. optionNumericVal(pOptions, pOptDesc);
  1686. for (ix = 0; ix < 1; ix++) {
  1687. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1688. continue; /* ranges need not be ordered. */
  1689. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1690. return;
  1691. if (rng[ix].rmax == LONG_MIN)
  1692. continue;
  1693. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1694. return;
  1695. }
  1696. option_usage_fp = stderr;
  1697. emit_ranges:
  1698. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1699. }
  1700. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1701. /**
  1702. * Code to handle the tos option.
  1703. * Allows you to override the TOS (also known as DiffServ/ECN) value in IPv4.
  1704. * @param[in] pOptions the tcprewrite options data structure
  1705. * @param[in,out] pOptDesc the option descriptor for this option.
  1706. */
  1707. static void
  1708. doOptTos(tOptions* pOptions, tOptDesc* pOptDesc)
  1709. {
  1710. static struct {long rmin, rmax;} const rng[1] = {
  1711. { 0, 255 } };
  1712. int ix;
  1713. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1714. goto emit_ranges;
  1715. optionNumericVal(pOptions, pOptDesc);
  1716. for (ix = 0; ix < 1; ix++) {
  1717. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1718. continue; /* ranges need not be ordered. */
  1719. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1720. return;
  1721. if (rng[ix].rmax == LONG_MIN)
  1722. continue;
  1723. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1724. return;
  1725. }
  1726. option_usage_fp = stderr;
  1727. emit_ranges:
  1728. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1729. }
  1730. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1731. /**
  1732. * Code to handle the tclass option.
  1733. * Allows you to override the IPv6 Traffic Class field.
  1734. * @param[in] pOptions the tcprewrite options data structure
  1735. * @param[in,out] pOptDesc the option descriptor for this option.
  1736. */
  1737. static void
  1738. doOptTclass(tOptions* pOptions, tOptDesc* pOptDesc)
  1739. {
  1740. static struct {long rmin, rmax;} const rng[1] = {
  1741. { 0, 255 } };
  1742. int ix;
  1743. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1744. goto emit_ranges;
  1745. optionNumericVal(pOptions, pOptDesc);
  1746. for (ix = 0; ix < 1; ix++) {
  1747. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1748. continue; /* ranges need not be ordered. */
  1749. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1750. return;
  1751. if (rng[ix].rmax == LONG_MIN)
  1752. continue;
  1753. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1754. return;
  1755. }
  1756. option_usage_fp = stderr;
  1757. emit_ranges:
  1758. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1759. }
  1760. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1761. /**
  1762. * Code to handle the flowlabel option.
  1763. * Allows you to override the 20bit IPv6 Flow Label field. Has no effect on IPv4
  1764. * packets.
  1765. * @param[in] pOptions the tcprewrite options data structure
  1766. * @param[in,out] pOptDesc the option descriptor for this option.
  1767. */
  1768. static void
  1769. doOptFlowlabel(tOptions* pOptions, tOptDesc* pOptDesc)
  1770. {
  1771. static struct {long rmin, rmax;} const rng[1] = {
  1772. { 0, 1048575 } };
  1773. int ix;
  1774. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1775. goto emit_ranges;
  1776. optionNumericVal(pOptions, pOptDesc);
  1777. for (ix = 0; ix < 1; ix++) {
  1778. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1779. continue; /* ranges need not be ordered. */
  1780. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1781. return;
  1782. if (rng[ix].rmax == LONG_MIN)
  1783. continue;
  1784. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1785. return;
  1786. }
  1787. option_usage_fp = stderr;
  1788. emit_ranges:
  1789. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1790. }
  1791. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1792. /**
  1793. * Code to handle the fuzz-seed option.
  1794. * This fuzzing was designed as to test layer 7 protocols such as voip protocols.
  1795. * It modifies randomly 1 out of X packets (where X = @var{--fuzz-factor}) in order
  1796. * for stateful protocols to cover more of their code. The random fuzzing actions
  1797. * focus on data start and end because it often is the part of the data application
  1798. * protocols base their decisions on.
  1799. *
  1800. * Possible fuzzing actions list:
  1801. * * drop packet
  1802. * * reduce packet size
  1803. * * edit packet Bytes:
  1804. * * Not all Bytes have the same probability of appearance in real life.
  1805. * Replace with 0x00, 0xFF, or a random byte with equal likelihood.
  1806. * * Not all Bytes have the same significance in a packet.
  1807. * Replace the start, the end, or the middle of the packet with equal likelihood.
  1808. * * do nothing (7 out of 8 packets)
  1809. *
  1810. * @param[in] pOptions the tcprewrite options data structure
  1811. * @param[in,out] pOptDesc the option descriptor for this option.
  1812. */
  1813. static void
  1814. doOptFuzz_Seed(tOptions* pOptions, tOptDesc* pOptDesc)
  1815. {
  1816. static struct {long rmin, rmax;} const rng[1] = {
  1817. { 0, LONG_MAX } };
  1818. int ix;
  1819. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1820. goto emit_ranges;
  1821. optionNumericVal(pOptions, pOptDesc);
  1822. for (ix = 0; ix < 1; ix++) {
  1823. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1824. continue; /* ranges need not be ordered. */
  1825. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1826. return;
  1827. if (rng[ix].rmax == LONG_MIN)
  1828. continue;
  1829. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1830. return;
  1831. }
  1832. option_usage_fp = stderr;
  1833. emit_ranges:
  1834. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1835. }
  1836. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1837. /**
  1838. * Code to handle the fuzz-factor option.
  1839. * Sets the ratio of for @var{--fuzz-seed} option. By default this value is 8,
  1840. * which means 1 in 8 packets are modified by fuzzing. Note that this ratio is
  1841. * based on the random number generated by the supplied fuzz seed. Therefore by
  1842. * default you cannot expect that exactly every eighth packet will be modified.
  1843. * @param[in] pOptions the tcprewrite options data structure
  1844. * @param[in,out] pOptDesc the option descriptor for this option.
  1845. */
  1846. static void
  1847. doOptFuzz_Factor(tOptions* pOptions, tOptDesc* pOptDesc)
  1848. {
  1849. static struct {long rmin, rmax;} const rng[1] = {
  1850. { 1, LONG_MAX } };
  1851. int ix;
  1852. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1853. goto emit_ranges;
  1854. optionNumericVal(pOptions, pOptDesc);
  1855. for (ix = 0; ix < 1; ix++) {
  1856. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1857. continue; /* ranges need not be ordered. */
  1858. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1859. return;
  1860. if (rng[ix].rmax == LONG_MIN)
  1861. continue;
  1862. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1863. return;
  1864. }
  1865. option_usage_fp = stderr;
  1866. emit_ranges:
  1867. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1868. }
  1869. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1870. /**
  1871. * Code to handle the enet-mac-seed-keep-bytes option.
  1872. * Keep some bytes untouched when usinging @var{--enet-mac-seed} option.
  1873. * @param[in] pOptions the tcprewrite options data structure
  1874. * @param[in,out] pOptDesc the option descriptor for this option.
  1875. */
  1876. static void
  1877. doOptEnet_Mac_Seed_Keep_Bytes(tOptions* pOptions, tOptDesc* pOptDesc)
  1878. {
  1879. static struct {long rmin, rmax;} const rng[1] = {
  1880. { 1, 6 } };
  1881. int ix;
  1882. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1883. goto emit_ranges;
  1884. optionNumericVal(pOptions, pOptDesc);
  1885. for (ix = 0; ix < 1; ix++) {
  1886. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1887. continue; /* ranges need not be ordered. */
  1888. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1889. return;
  1890. if (rng[ix].rmax == LONG_MIN)
  1891. continue;
  1892. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1893. return;
  1894. }
  1895. option_usage_fp = stderr;
  1896. emit_ranges:
  1897. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1898. }
  1899. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1900. /**
  1901. * Code to handle the enet-vlan-tag option.
  1902. *
  1903. * @param[in] pOptions the tcprewrite options data structure
  1904. * @param[in,out] pOptDesc the option descriptor for this option.
  1905. */
  1906. static void
  1907. doOptEnet_Vlan_Tag(tOptions* pOptions, tOptDesc* pOptDesc)
  1908. {
  1909. static struct {long rmin, rmax;} const rng[1] = {
  1910. { 0, 4095 } };
  1911. int ix;
  1912. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1913. goto emit_ranges;
  1914. optionNumericVal(pOptions, pOptDesc);
  1915. for (ix = 0; ix < 1; ix++) {
  1916. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1917. continue; /* ranges need not be ordered. */
  1918. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1919. return;
  1920. if (rng[ix].rmax == LONG_MIN)
  1921. continue;
  1922. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1923. return;
  1924. }
  1925. option_usage_fp = stderr;
  1926. emit_ranges:
  1927. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1928. }
  1929. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1930. /**
  1931. * Code to handle the enet-vlan-cfi option.
  1932. *
  1933. * @param[in] pOptions the tcprewrite options data structure
  1934. * @param[in,out] pOptDesc the option descriptor for this option.
  1935. */
  1936. static void
  1937. doOptEnet_Vlan_Cfi(tOptions* pOptions, tOptDesc* pOptDesc)
  1938. {
  1939. static struct {long rmin, rmax;} const rng[1] = {
  1940. { 0, 1 } };
  1941. int ix;
  1942. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1943. goto emit_ranges;
  1944. optionNumericVal(pOptions, pOptDesc);
  1945. for (ix = 0; ix < 1; ix++) {
  1946. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1947. continue; /* ranges need not be ordered. */
  1948. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1949. return;
  1950. if (rng[ix].rmax == LONG_MIN)
  1951. continue;
  1952. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1953. return;
  1954. }
  1955. option_usage_fp = stderr;
  1956. emit_ranges:
  1957. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1958. }
  1959. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1960. /**
  1961. * Code to handle the enet-vlan-pri option.
  1962. *
  1963. * @param[in] pOptions the tcprewrite options data structure
  1964. * @param[in,out] pOptDesc the option descriptor for this option.
  1965. */
  1966. static void
  1967. doOptEnet_Vlan_Pri(tOptions* pOptions, tOptDesc* pOptDesc)
  1968. {
  1969. static struct {long rmin, rmax;} const rng[1] = {
  1970. { 0, 7 } };
  1971. int ix;
  1972. if (pOptions <= OPTPROC_EMIT_LIMIT)
  1973. goto emit_ranges;
  1974. optionNumericVal(pOptions, pOptDesc);
  1975. for (ix = 0; ix < 1; ix++) {
  1976. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  1977. continue; /* ranges need not be ordered. */
  1978. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  1979. return;
  1980. if (rng[ix].rmax == LONG_MIN)
  1981. continue;
  1982. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  1983. return;
  1984. }
  1985. option_usage_fp = stderr;
  1986. emit_ranges:
  1987. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  1988. }
  1989. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  1990. /**
  1991. * Code to handle the dbug option, when DEBUG is #define-d.
  1992. * If configured with --enable-debug, then you can specify a verbosity
  1993. * level for debugging output. Higher numbers increase verbosity.
  1994. * @param[in] pOptions the tcprewrite options data structure
  1995. * @param[in,out] pOptDesc the option descriptor for this option.
  1996. */
  1997. #ifdef DEBUG
  1998. static void
  1999. doOptDbug(tOptions* pOptions, tOptDesc* pOptDesc)
  2000. {
  2001. static struct {long rmin, rmax;} const rng[1] = {
  2002. { 0, 5 } };
  2003. int ix;
  2004. if (pOptions <= OPTPROC_EMIT_LIMIT)
  2005. goto emit_ranges;
  2006. optionNumericVal(pOptions, pOptDesc);
  2007. for (ix = 0; ix < 1; ix++) {
  2008. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  2009. continue; /* ranges need not be ordered. */
  2010. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  2011. return;
  2012. if (rng[ix].rmax == LONG_MIN)
  2013. continue;
  2014. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  2015. return;
  2016. }
  2017. option_usage_fp = stderr;
  2018. emit_ranges:
  2019. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  2020. }
  2021. #endif /* defined DEBUG */
  2022. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2023. /**
  2024. * Code to handle the cachefile option.
  2025. * Use tcpprep cache file to split traffic based upon client/server relationships.
  2026. * @param[in] pOptions the tcprewrite options data structure
  2027. * @param[in,out] pOptDesc the option descriptor for this option.
  2028. */
  2029. static void
  2030. doOptCachefile(tOptions* pOptions, tOptDesc* pOptDesc)
  2031. {
  2032. /*
  2033. * Be sure the flag-code[0] handles special values for the options pointer
  2034. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  2035. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  2036. * reset its state.
  2037. */
  2038. /* extracted from tcprewrite_opts.def, line 157 */
  2039. options.cache_packets =
  2040. read_cache(&options.cachedata, OPT_ARG(CACHEFILE), &options.comment);
  2041. (void)pOptDesc;
  2042. (void)pOptions;
  2043. }
  2044. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2045. /**
  2046. * Code to handle the version option.
  2047. *
  2048. * @param[in] pOptions the tcprewrite options data structure
  2049. * @param[in,out] pOptDesc the option descriptor for this option.
  2050. */
  2051. static void
  2052. doOptVersion(tOptions* pOptions, tOptDesc* pOptDesc)
  2053. {
  2054. /*
  2055. * Be sure the flag-code[0] handles special values for the options pointer
  2056. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  2057. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  2058. * reset its state.
  2059. */
  2060. /* extracted from tcprewrite_opts.def, line 248 */
  2061. fprintf(stderr, "tcprewrite version: %s (build %s)", VERSION, git_version());
  2062. #ifdef DEBUG
  2063. fprintf(stderr, " (debug)");
  2064. #endif
  2065. fprintf(stderr, "\n");
  2066. fprintf(stderr, "Copyright 2013-2024 by Fred Klassen <tcpreplay at appneta dot com> - AppNeta\n");
  2067. fprintf(stderr, "Copyright 2000-2012 by Aaron Turner <aturner at synfin dot net>\n");
  2068. fprintf(stderr, "The entire Tcpreplay Suite is licensed under the GPLv3\n");
  2069. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  2070. #ifdef HAVE_LIBDNET
  2071. fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION);
  2072. #else
  2073. fprintf(stderr, "Not compiled with libdnet.\n");
  2074. #endif
  2075. #ifdef HAVE_WINPCAP
  2076. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  2077. #elif defined HAVE_PF_RING_PCAP
  2078. fprintf(stderr, "Compiled against PF_RING libpcap: %s\n", get_pcap_version());
  2079. #else
  2080. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  2081. #endif
  2082. #ifdef ENABLE_64BITS
  2083. fprintf(stderr, "64 bit packet counters: enabled\n");
  2084. #else
  2085. fprintf(stderr, "64 bit packet counters: disabled\n");
  2086. #endif
  2087. #ifdef ENABLE_VERBOSE
  2088. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  2089. #else
  2090. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  2091. #endif
  2092. #ifdef ENABLE_FRAGROUTE
  2093. fprintf(stderr, "Fragroute engine: enabled\n");
  2094. #else
  2095. fprintf(stderr, "Fragroute engine: disabled\n");
  2096. #endif
  2097. exit(0);
  2098. (void)pOptDesc;
  2099. (void)pOptions;
  2100. }
  2101. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  2102. /**
  2103. * Code to handle the less-help option.
  2104. *
  2105. * @param[in] pOptions the tcprewrite options data structure
  2106. * @param[in,out] pOptDesc the option descriptor for this option.
  2107. */
  2108. static void
  2109. doOptLess_Help(tOptions* pOptions, tOptDesc* pOptDesc)
  2110. {
  2111. /*
  2112. * Be sure the flag-code[0] handles special values for the options pointer
  2113. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  2114. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  2115. * reset its state.
  2116. */
  2117. /* extracted from tcprewrite_opts.def, line 297 */
  2118. USAGE(EXIT_FAILURE);
  2119. (void)pOptDesc;
  2120. (void)pOptions;
  2121. }
  2122. /* extracted from optmain.tlib near line 1250 */
  2123. /**
  2124. * The directory containing the data associated with tcprewrite.
  2125. */
  2126. #ifndef PKGDATADIR
  2127. # define PKGDATADIR ""
  2128. #endif
  2129. /**
  2130. * Information about the person or institution that packaged tcprewrite
  2131. * for the current distribution.
  2132. */
  2133. #ifndef WITH_PACKAGER
  2134. # define tcprewrite_packager_info NULL
  2135. #else
  2136. /** Packager information for tcprewrite. */
  2137. static char const tcprewrite_packager_info[] =
  2138. "Packaged by " WITH_PACKAGER
  2139. # ifdef WITH_PACKAGER_VERSION
  2140. " ("WITH_PACKAGER_VERSION")"
  2141. # endif
  2142. # ifdef WITH_PACKAGER_BUG_REPORTS
  2143. "\nReport tcprewrite bugs to " WITH_PACKAGER_BUG_REPORTS
  2144. # endif
  2145. "\n";
  2146. #endif
  2147. #ifndef __doxygen__
  2148. #endif /* __doxygen__ */
  2149. /**
  2150. * The option definitions for tcprewrite. The one structure that
  2151. * binds them all.
  2152. */
  2153. tOptions tcprewriteOptions = {
  2154. OPTIONS_STRUCT_VERSION,
  2155. 0, NULL, /* original argc + argv */
  2156. ( OPTPROC_BASE
  2157. + OPTPROC_ERRSTOP
  2158. + OPTPROC_SHORTOPT
  2159. + OPTPROC_LONGOPT
  2160. + OPTPROC_NO_REQ_OPT
  2161. + OPTPROC_NO_ARGS
  2162. + OPTPROC_GNUUSAGE ),
  2163. 0, NULL, /* current option index, current option */
  2164. NULL, NULL, zPROGNAME,
  2165. zRcName, zCopyright, zLicenseDescrip,
  2166. zFullVersion, apzHomeList, zUsageTitle,
  2167. zExplain, zDetail, optDesc,
  2168. zBugsAddr, /* address to send bugs to */
  2169. NULL, NULL, /* extensions/saved state */
  2170. optionUsage, /* usage procedure */
  2171. translate_option_strings, /* translation procedure */
  2172. /*
  2173. * Indexes to special options
  2174. */
  2175. { INDEX_OPT_MORE_HELP, /* more-help option index */
  2176. INDEX_OPT_SAVE_OPTS, /* save option index */
  2177. NO_EQUIVALENT, /* '-#' option index */
  2178. 11 /* index of default opt */
  2179. },
  2180. 53 /* full option count */, 49 /* user option count */,
  2181. tcprewrite_full_usage, tcprewrite_short_usage,
  2182. NULL, NULL,
  2183. PKGDATADIR, tcprewrite_packager_info
  2184. };
  2185. #if ENABLE_NLS
  2186. /**
  2187. * This code is designed to translate translatable option text for the
  2188. * tcprewrite program. These translations happen upon entry
  2189. * to optionProcess().
  2190. */
  2191. #include <stdio.h>
  2192. #include <stdlib.h>
  2193. #include <string.h>
  2194. #include <unistd.h>
  2195. #ifdef HAVE_DCGETTEXT
  2196. # include <gettext.h>
  2197. #endif
  2198. #include <autoopts/usage-txt.h>
  2199. static char * AO_gettext(char const * pz);
  2200. static void coerce_it(void ** s);
  2201. /**
  2202. * AutoGen specific wrapper function for gettext. It relies on the macro _()
  2203. * to convert from English to the target language, then strdup-duplicates the
  2204. * result string. It tries the "libopts" domain first, then whatever has been
  2205. * set via the \a textdomain(3) call.
  2206. *
  2207. * @param[in] pz the input text used as a lookup key.
  2208. * @returns the translated text (if there is one),
  2209. * or the original text (if not).
  2210. */
  2211. static char *
  2212. AO_gettext(char const * pz)
  2213. {
  2214. char * res;
  2215. if (pz == NULL)
  2216. return NULL;
  2217. #ifdef HAVE_DCGETTEXT
  2218. /*
  2219. * While processing the option_xlateable_txt data, try to use the
  2220. * "libopts" domain. Once we switch to the option descriptor data,
  2221. * do *not* use that domain.
  2222. */
  2223. if (option_xlateable_txt.field_ct != 0) {
  2224. res = dgettext("libopts", pz);
  2225. if (res == pz)
  2226. res = (char *)VOIDP(_(pz));
  2227. } else
  2228. res = (char *)VOIDP(_(pz));
  2229. #else
  2230. res = (char *)VOIDP(_(pz));
  2231. #endif
  2232. if (res == pz)
  2233. return res;
  2234. res = strdup(res);
  2235. if (res == NULL) {
  2236. fputs(_("No memory for duping translated strings\n"), stderr);
  2237. exit(TCPREWRITE_EXIT_FAILURE);
  2238. }
  2239. return res;
  2240. }
  2241. /**
  2242. * All the pointers we use are marked "* const", but they are stored in
  2243. * writable memory. Coerce the mutability and set the pointer.
  2244. */
  2245. static void coerce_it(void ** s) { *s = AO_gettext(*s);
  2246. }
  2247. /**
  2248. * Translate all the translatable strings in the tcprewriteOptions
  2249. * structure defined above. This is done only once.
  2250. */
  2251. static void
  2252. translate_option_strings(void)
  2253. {
  2254. tOptions * const opts = &tcprewriteOptions;
  2255. /*
  2256. * Guard against re-translation. It won't work. The strings will have
  2257. * been changed by the first pass through this code. One shot only.
  2258. */
  2259. if (option_xlateable_txt.field_ct != 0) {
  2260. /*
  2261. * Do the translations. The first pointer follows the field count
  2262. * field. The field count field is the size of a pointer.
  2263. */
  2264. char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
  2265. int ix = option_xlateable_txt.field_ct;
  2266. do {
  2267. ppz++; /* skip over field_ct */
  2268. *ppz = AO_gettext(*ppz);
  2269. } while (--ix > 0);
  2270. /* prevent re-translation and disable "libopts" domain lookup */
  2271. option_xlateable_txt.field_ct = 0;
  2272. coerce_it(VOIDP(&(opts->pzCopyright)));
  2273. coerce_it(VOIDP(&(opts->pzCopyNotice)));
  2274. coerce_it(VOIDP(&(opts->pzFullVersion)));
  2275. coerce_it(VOIDP(&(opts->pzUsageTitle)));
  2276. coerce_it(VOIDP(&(opts->pzExplain)));
  2277. coerce_it(VOIDP(&(opts->pzDetail)));
  2278. {
  2279. tOptDesc * od = opts->pOptDesc;
  2280. for (ix = opts->optCt; ix > 0; ix--, od++)
  2281. coerce_it(VOIDP(&(od->pzText)));
  2282. }
  2283. }
  2284. }
  2285. #endif /* ENABLE_NLS */
  2286. #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
  2287. /** I18N function strictly for xgettext. Do not compile. */
  2288. static void bogus_function(void) {
  2289. /* TRANSLATORS:
  2290. The following dummy function was crated solely so that xgettext can
  2291. extract the correct strings. These strings are actually referenced
  2292. by a field name in the tcprewriteOptions structure noted in the
  2293. comments below. The literal text is defined in tcprewrite_opt_strs.
  2294. NOTE: the strings below are segmented with respect to the source string
  2295. tcprewrite_opt_strs. The strings above are handed off for translation
  2296. at run time a paragraph at a time. Consequently, they are presented here
  2297. for translation a paragraph at a time.
  2298. ALSO: often the description for an option will reference another option
  2299. by name. These are set off with apostrophe quotes (I hope). Do not
  2300. translate option names.
  2301. */
  2302. /* referenced via tcprewriteOptions.pzCopyright */
  2303. puts(_("tcprewrite (tcprewrite)\n\
  2304. Copyright (C) 2000-2024 Aaron Turner and Fred Klassen, all rights reserved.\n\
  2305. This is free software. It is licensed for use, modification and\n\
  2306. redistribution under the terms of the GNU General Public License,\n\
  2307. version 3 or later <http://gnu.org/licenses/gpl.html>\n"));
  2308. /* referenced via tcprewriteOptions.pzCopyNotice */
  2309. puts(_("tcprewrite is free software: you can redistribute it and/or modify it under\n\
  2310. the terms of the GNU General Public License as published by the Free\n\
  2311. Software Foundation, either version 3 of the License, or (at your option)\n\
  2312. any later version.\n\n"));
  2313. puts(_("tcprewrite is distributed in the hope that it will be useful, but WITHOUT\n\
  2314. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\
  2315. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n\
  2316. more details.\n\n"));
  2317. puts(_("You should have received a copy of the GNU General Public License along\n\
  2318. with this program. If not, see <http://www.gnu.org/licenses/>.\n"));
  2319. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2320. puts(_(":"));
  2321. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2322. puts(_("Rewrite TCP/UDP ports"));
  2323. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2324. puts(_("Randomize src/dst IPv4/v6 addresses w/ given seed"));
  2325. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2326. puts(_("Rewrite IPv4/v6 addresses using pseudo-NAT"));
  2327. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2328. puts(_("Rewrite source IPv4/v6 addresses using pseudo-NAT"));
  2329. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2330. puts(_("Rewrite destination IPv4/v6 addresses using pseudo-NAT"));
  2331. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2332. puts(_("Rewrite IP addresses to be between two endpoints"));
  2333. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2334. puts(_("Change TCP Sequence (and ACK) numbers /w given seed"));
  2335. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2336. puts(_("Skip rewriting broadcast/multicast IPv4/v6 addresses"));
  2337. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2338. puts(_("Force recalculation of IPv4/TCP/UDP header checksums"));
  2339. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2340. puts(_("Alter IP/TCP header len to match packet length"));
  2341. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2342. puts(_("Override default MTU length (1500 bytes)"));
  2343. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2344. puts(_("Truncate packets larger then specified MTU"));
  2345. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2346. puts(_("Remove Ethernet checksums (FCS) from end of frames"));
  2347. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2348. puts(_("Modify the IPv4/v6 TTL/Hop Limit"));
  2349. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2350. puts(_("Set the IPv4 TOS/DiffServ/ECN byte"));
  2351. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2352. puts(_("Set the IPv6 Traffic Class byte"));
  2353. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2354. puts(_("Set the IPv6 Flow Label"));
  2355. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2356. puts(_("Pad or truncate packet data to match header length"));
  2357. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2358. puts(_("Fuzz 1 in X packets. Edit bytes, length, or emulate packet drop"));
  2359. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2360. puts(_("Set the Fuzz 1 in X packet ratio (default 1 in 8 packets)"));
  2361. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2362. puts(_("Skip rewriting broadcast/multicast Layer 2 addresses"));
  2363. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2364. puts(_("Override output DLT encapsulation"));
  2365. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2366. puts(_("Override destination ethernet MAC addresses"));
  2367. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2368. puts(_("Override source ethernet MAC addresses"));
  2369. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2370. puts(_("Substitute MAC addresses"));
  2371. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2372. puts(_("Randomize MAC addresses"));
  2373. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2374. puts(_("Randomize MAC addresses"));
  2375. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2376. puts(_("Specify ethernet 802.1q VLAN tag mode"));
  2377. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2378. puts(_("Specify the new ethernet 802.1q VLAN tag value"));
  2379. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2380. puts(_("Specify the ethernet 802.1q VLAN CFI value"));
  2381. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2382. puts(_("Specify the ethernet 802.1q VLAN priority"));
  2383. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2384. puts(_("Specify VLAN tag protocol 802.1q or 802.1ad"));
  2385. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2386. puts(_("Specify HDLC control value"));
  2387. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2388. puts(_("Specify HDLC address"));
  2389. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2390. puts(_("Set output file DLT type"));
  2391. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2392. puts(_("Rewrite Data-Link layer with user specified data"));
  2393. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2394. puts(_("Enable debugging output"));
  2395. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2396. puts(_("Input pcap file to be processed"));
  2397. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2398. puts(_("Output pcap file"));
  2399. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2400. puts(_("Split traffic via tcpprep cache file"));
  2401. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2402. puts(_("Print decoded packets via tcpdump to STDOUT"));
  2403. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2404. puts(_("Arguments passed to tcpdump decoder"));
  2405. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2406. puts(_("Parse fragroute configuration file"));
  2407. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2408. puts(_("Which flows to apply fragroute to: c2s, s2c, both"));
  2409. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2410. puts(_("Skip writing packets with soft errors"));
  2411. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2412. puts(_("Print version information"));
  2413. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2414. puts(_("Display less usage information and exit"));
  2415. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2416. puts(_("suppress printing warning messages"));
  2417. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2418. puts(_("display extended usage information and exit"));
  2419. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2420. puts(_("extended usage information passed thru pager"));
  2421. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2422. puts(_("save the option state to a config file"));
  2423. /* referenced via tcprewriteOptions.pOptDesc->pzText */
  2424. puts(_("load options from a config file"));
  2425. /* referenced via tcprewriteOptions.pzUsageTitle */
  2426. puts(_("tcprewrite (tcprewrite) - Rewrite the packets in a pcap file.\n\
  2427. Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]...\n"));
  2428. /* referenced via tcprewriteOptions.pzDetail */
  2429. puts(_("Tcprewrite is a tool to rewrite packets stored in 'pcap(3)' file format,\n\
  2430. such as created by tools such as 'tcpdump(1)' and 'wireshark(1)'. Once a\n\
  2431. pcap file has had it's packets rewritten, they can be replayed back out on\n\
  2432. the network using 'tcpreplay(1)'.\n\n"));
  2433. puts(_("tcprewrite currently supports reading the following DLT types:\n\n\n"));
  2434. puts(_("'DLT_C_HDLC' aka Cisco HDLC\n\n\n\
  2435. 'DLT_EN10MB' aka Ethernet\n\n\n"));
  2436. puts(_("'DLT_LINUX_SLL' aka Linux Cooked Socket\n\n\n"));
  2437. puts(_("'DLT_LINUX_SLL2' aka Linux Cooked Socket v2\n\n\n"));
  2438. puts(_("'DLT_RAW' aka RAW IP\n\n\n\
  2439. 'DLT_NULL' aka BSD Loopback\n\n\n"));
  2440. puts(_("'DLT_LOOP' aka OpenBSD Loopback\n\n\n\
  2441. 'DLT_IEEE802_11' aka 802.11a/b/g\n\n\n"));
  2442. puts(_("'DLT_IEEE802_11_RADIO' aka 802.11a/b/g with Radiotap headers\n\n\n"));
  2443. puts(_("'DLT_JUNIPER_ETHER' aka Juniper Encapsulated Ethernet\n\n\n"));
  2444. puts(_("'DLT_PPP_SERIAL' aka PPP over Serial\n\n\
  2445. Please see the --dlt option for supported DLT types for writing.\n\n"));
  2446. puts(_("The packet editing features of tcprewrite which distinguish between\n\
  2447. \"client\" and \"server\" traffic requires a tcpprep(1) cache file.\n\n\
  2448. For more details, please see the Tcpreplay Manual at:\n\
  2449. http://tcpreplay.appneta.com\n"));
  2450. /* referenced via tcprewriteOptions.pzFullUsage */
  2451. puts(_("<<<NOT-FOUND>>>"));
  2452. /* referenced via tcprewriteOptions.pzShortUsage */
  2453. puts(_("<<<NOT-FOUND>>>"));
  2454. /* LIBOPTS-MESSAGES: */
  2455. #line 67 "../autoopts.c"
  2456. puts(_("allocation of %d bytes failed\n"));
  2457. #line 89 "../autoopts.c"
  2458. puts(_("allocation of %d bytes failed\n"));
  2459. #line 48 "../init.c"
  2460. puts(_("AutoOpts function called without option descriptor\n"));
  2461. #line 81 "../init.c"
  2462. puts(_("\tThis exceeds the compiled library version: "));
  2463. #line 79 "../init.c"
  2464. puts(_("Automated Options Processing Error!\n"
  2465. "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
  2466. #line 78 "../autoopts.c"
  2467. puts(_("realloc of %d bytes at 0x%p failed\n"));
  2468. #line 83 "../init.c"
  2469. puts(_("\tThis is less than the minimum library version: "));
  2470. #line 121 "../version.c"
  2471. puts(_("Automated Options version %s\n"
  2472. "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
  2473. #line 49 "../makeshell.c"
  2474. puts(_("(AutoOpts bug): %s.\n"));
  2475. #line 90 "../reset.c"
  2476. puts(_("optionResetOpt() called, but reset-option not configured"));
  2477. #line 241 "../usage.c"
  2478. puts(_("could not locate the 'help' option"));
  2479. #line 330 "../autoopts.c"
  2480. puts(_("optionProcess() was called with invalid data"));
  2481. #line 697 "../usage.c"
  2482. puts(_("invalid argument type specified"));
  2483. #line 568 "../find.c"
  2484. puts(_("defaulted to option with optional arg"));
  2485. #line 76 "../alias.c"
  2486. puts(_("aliasing option is out of range."));
  2487. #line 210 "../enum.c"
  2488. puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
  2489. #line 78 "../find.c"
  2490. puts(_(" The following options match:\n"));
  2491. #line 263 "../find.c"
  2492. puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
  2493. #line 161 "../check.c"
  2494. puts(_("%s: Command line arguments required\n"));
  2495. #line 43 "../alias.c"
  2496. puts(_("%d %s%s options allowed\n"));
  2497. #line 56 "../makeshell.c"
  2498. puts(_("%s error %d (%s) calling %s for '%s'\n"));
  2499. #line 268 "../makeshell.c"
  2500. puts(_("interprocess pipe"));
  2501. #line 171 "../version.c"
  2502. puts(_("error: version option argument '%c' invalid. Use:\n"
  2503. "\t'v' - version only\n"
  2504. "\t'c' - version and copyright\n"
  2505. "\t'n' - version and full copyright notice\n"));
  2506. #line 58 "../check.c"
  2507. puts(_("%s error: the '%s' and '%s' options conflict\n"));
  2508. #line 187 "../find.c"
  2509. puts(_("%s: The '%s' option has been disabled."));
  2510. #line 400 "../find.c"
  2511. puts(_("%s: The '%s' option has been disabled."));
  2512. #line 38 "../alias.c"
  2513. puts(_("-equivalence"));
  2514. #line 439 "../find.c"
  2515. puts(_("%s: illegal option -- %c\n"));
  2516. #line 110 "../reset.c"
  2517. puts(_("%s: illegal option -- %c\n"));
  2518. #line 241 "../find.c"
  2519. puts(_("%s: illegal option -- %s\n"));
  2520. #line 740 "../find.c"
  2521. puts(_("%s: illegal option -- %s\n"));
  2522. #line 118 "../reset.c"
  2523. puts(_("%s: illegal option -- %s\n"));
  2524. #line 305 "../find.c"
  2525. puts(_("%s: unknown vendor extension option -- %s\n"));
  2526. #line 135 "../enum.c"
  2527. puts(_(" or an integer from %d through %d\n"));
  2528. #line 145 "../enum.c"
  2529. puts(_(" or an integer from %d through %d\n"));
  2530. #line 696 "../usage.c"
  2531. puts(_("%s error: invalid option descriptor for %s\n"));
  2532. #line 1030 "../usage.c"
  2533. puts(_("%s error: invalid option descriptor for %s\n"));
  2534. #line 355 "../find.c"
  2535. puts(_("%s: invalid option name: %s\n"));
  2536. #line 497 "../find.c"
  2537. puts(_("%s: The '%s' option requires an argument.\n"));
  2538. #line 150 "../autoopts.c"
  2539. puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
  2540. "\t'%s' and '%s'."));
  2541. #line 94 "../check.c"
  2542. puts(_("%s error: The %s option is required\n"));
  2543. #line 602 "../find.c"
  2544. puts(_("%s: The '%s' option cannot have an argument.\n"));
  2545. #line 151 "../check.c"
  2546. puts(_("%s: Command line arguments are not allowed.\n"));
  2547. #line 568 "../save.c"
  2548. puts(_("error %d (%s) creating %s\n"));
  2549. #line 210 "../enum.c"
  2550. puts(_("%s error: '%s' does not match any %s keywords.\n"));
  2551. #line 93 "../reset.c"
  2552. puts(_("%s error: The '%s' option requires an argument.\n"));
  2553. #line 122 "../save.c"
  2554. puts(_("error %d (%s) stat-ing %s\n"));
  2555. #line 175 "../save.c"
  2556. puts(_("error %d (%s) stat-ing %s\n"));
  2557. #line 143 "../restore.c"
  2558. puts(_("%s error: no saved option state\n"));
  2559. #line 225 "../autoopts.c"
  2560. puts(_("'%s' is not a command line option.\n"));
  2561. #line 113 "../time.c"
  2562. puts(_("%s error: '%s' is not a recognizable date/time.\n"));
  2563. #line 50 "../time.c"
  2564. puts(_("%s error: '%s' is not a recognizable time duration.\n"));
  2565. #line 92 "../check.c"
  2566. puts(_("%s error: The %s option must appear %d times.\n"));
  2567. #line 165 "../numeric.c"
  2568. puts(_("%s error: '%s' is not a recognizable number.\n"));
  2569. #line 176 "../enum.c"
  2570. puts(_("%s error: %s exceeds %s keyword count\n"));
  2571. #line 279 "../usage.c"
  2572. puts(_("Try '%s %s' for more information.\n"));
  2573. #line 45 "../alias.c"
  2574. puts(_("one %s%s option allowed\n"));
  2575. #line 170 "../makeshell.c"
  2576. puts(_("standard output"));
  2577. #line 905 "../makeshell.c"
  2578. puts(_("standard output"));
  2579. #line 223 "../usage.c"
  2580. puts(_("standard output"));
  2581. #line 364 "../usage.c"
  2582. puts(_("standard output"));
  2583. #line 574 "../usage.c"
  2584. puts(_("standard output"));
  2585. #line 178 "../version.c"
  2586. puts(_("standard output"));
  2587. #line 223 "../usage.c"
  2588. puts(_("standard error"));
  2589. #line 364 "../usage.c"
  2590. puts(_("standard error"));
  2591. #line 574 "../usage.c"
  2592. puts(_("standard error"));
  2593. #line 178 "../version.c"
  2594. puts(_("standard error"));
  2595. #line 170 "../makeshell.c"
  2596. puts(_("write"));
  2597. #line 905 "../makeshell.c"
  2598. puts(_("write"));
  2599. #line 222 "../usage.c"
  2600. puts(_("write"));
  2601. #line 363 "../usage.c"
  2602. puts(_("write"));
  2603. #line 573 "../usage.c"
  2604. puts(_("write"));
  2605. #line 177 "../version.c"
  2606. puts(_("write"));
  2607. #line 60 "../numeric.c"
  2608. puts(_("%s error: %s option value %ld is out of range.\n"));
  2609. #line 44 "../check.c"
  2610. puts(_("%s error: %s option requires the %s option\n"));
  2611. #line 121 "../save.c"
  2612. puts(_("%s warning: cannot save options - %s not regular file\n"));
  2613. #line 174 "../save.c"
  2614. puts(_("%s warning: cannot save options - %s not regular file\n"));
  2615. #line 193 "../save.c"
  2616. puts(_("%s warning: cannot save options - %s not regular file\n"));
  2617. #line 567 "../save.c"
  2618. puts(_("%s warning: cannot save options - %s not regular file\n"));
  2619. /* END-LIBOPTS-MESSAGES */
  2620. /* USAGE-TEXT: */
  2621. #line 822 "../usage.c"
  2622. puts(_("\t\t\t\t- an alternate for '%s'\n"));
  2623. #line 1097 "../usage.c"
  2624. puts(_("Version, usage and configuration options:"));
  2625. #line 873 "../usage.c"
  2626. puts(_("\t\t\t\t- default option for unnamed options\n"));
  2627. #line 786 "../usage.c"
  2628. puts(_("\t\t\t\t- disabled as '--%s'\n"));
  2629. #line 1066 "../usage.c"
  2630. puts(_(" --- %-14s %s\n"));
  2631. #line 1064 "../usage.c"
  2632. puts(_("This option has been disabled"));
  2633. #line 813 "../usage.c"
  2634. puts(_("\t\t\t\t- enabled by default\n"));
  2635. #line 40 "../alias.c"
  2636. puts(_("%s error: only "));
  2637. #line 1143 "../usage.c"
  2638. puts(_(" - examining environment variables named %s_*\n"));
  2639. #line 168 "../file.c"
  2640. puts(_("\t\t\t\t- file must not pre-exist\n"));
  2641. #line 172 "../file.c"
  2642. puts(_("\t\t\t\t- file must pre-exist\n"));
  2643. #line 329 "../usage.c"
  2644. puts(_("Options are specified by doubled hyphens and their name or by a single\n"
  2645. "hyphen and the flag character.\n"));
  2646. #line 882 "../makeshell.c"
  2647. puts(_("\n"
  2648. "= = = = = = = =\n\n"
  2649. "This incarnation of genshell will produce\n"
  2650. "a shell script to parse the options for %s:\n\n"));
  2651. #line 142 "../enum.c"
  2652. puts(_(" or an integer mask with any of the lower %d bits set\n"));
  2653. #line 846 "../usage.c"
  2654. puts(_("\t\t\t\t- is a set membership option\n"));
  2655. #line 867 "../usage.c"
  2656. puts(_("\t\t\t\t- must appear between %d and %d times\n"));
  2657. #line 331 "../usage.c"
  2658. puts(_("Options are specified by single or double hyphens and their name.\n"));
  2659. #line 853 "../usage.c"
  2660. puts(_("\t\t\t\t- may appear multiple times\n"));
  2661. #line 840 "../usage.c"
  2662. puts(_("\t\t\t\t- may not be preset\n"));
  2663. #line 1258 "../usage.c"
  2664. puts(_(" Arg Option-Name Description\n"));
  2665. #line 1194 "../usage.c"
  2666. puts(_(" Flg Arg Option-Name Description\n"));
  2667. #line 1252 "../usage.c"
  2668. puts(_(" Flg Arg Option-Name Description\n"));
  2669. #line 1253 "../usage.c"
  2670. puts(_(" %3s %s"));
  2671. #line 1259 "../usage.c"
  2672. puts(_(" %3s %s"));
  2673. #line 336 "../usage.c"
  2674. puts(_("The '-#<number>' option may omit the hash char\n"));
  2675. #line 332 "../usage.c"
  2676. puts(_("All arguments are named options.\n"));
  2677. #line 920 "../usage.c"
  2678. puts(_(" - reading file %s"));
  2679. #line 358 "../usage.c"
  2680. puts(_("\n"
  2681. "Please send bug reports to: <%s>\n"));
  2682. #line 100 "../version.c"
  2683. puts(_("\n"
  2684. "Please send bug reports to: <%s>\n"));
  2685. #line 129 "../version.c"
  2686. puts(_("\n"
  2687. "Please send bug reports to: <%s>\n"));
  2688. #line 852 "../usage.c"
  2689. puts(_("\t\t\t\t- may NOT appear - preset only\n"));
  2690. #line 893 "../usage.c"
  2691. puts(_("\n"
  2692. "The following option preset mechanisms are supported:\n"));
  2693. #line 1141 "../usage.c"
  2694. puts(_("\n"
  2695. "The following option preset mechanisms are supported:\n"));
  2696. #line 631 "../usage.c"
  2697. puts(_("prohibits these options:\n"));
  2698. #line 626 "../usage.c"
  2699. puts(_("prohibits the option '%s'\n"));
  2700. #line 81 "../numeric.c"
  2701. puts(_("%s%ld to %ld"));
  2702. #line 79 "../numeric.c"
  2703. puts(_("%sgreater than or equal to %ld"));
  2704. #line 75 "../numeric.c"
  2705. puts(_("%s%ld exactly"));
  2706. #line 68 "../numeric.c"
  2707. puts(_("%sit must lie in one of the ranges:\n"));
  2708. #line 68 "../numeric.c"
  2709. puts(_("%sit must be in the range:\n"));
  2710. #line 88 "../numeric.c"
  2711. puts(_(", or\n"));
  2712. #line 66 "../numeric.c"
  2713. puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
  2714. #line 77 "../numeric.c"
  2715. puts(_("%sless than or equal to %ld"));
  2716. #line 339 "../usage.c"
  2717. puts(_("Operands and options may be intermixed. They will be reordered.\n"));
  2718. #line 601 "../usage.c"
  2719. puts(_("requires the option '%s'\n"));
  2720. #line 604 "../usage.c"
  2721. puts(_("requires these options:\n"));
  2722. #line 1270 "../usage.c"
  2723. puts(_(" Arg Option-Name Req? Description\n"));
  2724. #line 1264 "../usage.c"
  2725. puts(_(" Flg Arg Option-Name Req? Description\n"));
  2726. #line 143 "../enum.c"
  2727. puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
  2728. "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
  2729. "will set them all. Multiple entries may be passed as an option\n"
  2730. "argument list.\n"));
  2731. #line 859 "../usage.c"
  2732. puts(_("\t\t\t\t- may appear up to %d times\n"));
  2733. #line 52 "../enum.c"
  2734. puts(_("The valid \"%s\" option keywords are:\n"));
  2735. #line 1101 "../usage.c"
  2736. puts(_("The next option supports vendor supported extra options:"));
  2737. #line 722 "../usage.c"
  2738. puts(_("These additional options are:"));
  2739. /* END-USAGE-TEXT */
  2740. }
  2741. #endif /* uncompilable code */
  2742. #ifdef __cplusplus
  2743. }
  2744. #endif
  2745. /* tcprewrite_opts.c ends here */