tcprewrite_opts.c 109 KB

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