tcpbridge_opts.c 112 KB

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