tcpliveplay_opts.c 40 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083
  1. /* -*- buffer-read-only: t -*- vi: set ro:
  2. *
  3. * DO NOT EDIT THIS FILE (tcpliveplay_opts.c)
  4. *
  5. * It has been AutoGen-ed
  6. * From the definitions ../../src/tcpliveplay_opts.def
  7. * and the template file options
  8. *
  9. * Generated from AutoOpts 42:1:17 templates.
  10. *
  11. * AutoOpts is a copyrighted work. This source file is not encumbered
  12. * by AutoOpts licensing, but is provided under the licensing terms chosen
  13. * by the tcpliveplay 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 tcpliveplay program is copyrighted and licensed
  20. * under the following terms:
  21. *
  22. * Copyright (C) 2012 Yazan Siam, all rights reserved.
  23. * This is free software. It is licensed for use, modification and
  24. * redistribution under the terms of the
  25. * Modified (3 clause) Berkeley Software Distribution License
  26. * <http://www.xfree86.org/3.3.6/COPYRIGHT2.html>
  27. *
  28. * Redistribution and use in source and binary forms, with or without
  29. * modification, are permitted provided that the following conditions
  30. * are met:
  31. * 1. Redistributions of source code must retain the above copyright
  32. * notice, this list of conditions and the following disclaimer.
  33. * 2. Redistributions in binary form must reproduce the above copyright
  34. * notice, this list of conditions and the following disclaimer in the
  35. * documentation and/or other materials provided with the distribution.
  36. * 3. Neither the name ``Yazan Siam'' nor the name of any other
  37. * contributor may be used to endorse or promote products derived
  38. * from this software without specific prior written permission.
  39. *
  40. * tcpliveplay IS PROVIDED BY Yazan Siam ``AS IS'' AND ANY EXPRESS
  41. * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
  42. * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  43. * ARE DISCLAIMED. IN NO EVENT SHALL Yazan Siam OR ANY OTHER CONTRIBUTORS
  44. * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
  45. * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
  46. * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
  47. * BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
  48. * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
  49. * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  50. * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  51. */
  52. #ifndef __doxygen__
  53. #define OPTION_CODE_COMPILE 1
  54. #include "tcpliveplay_opts.h"
  55. #include <sys/types.h>
  56. #include <sys/stat.h>
  57. #include <errno.h>
  58. #include <fcntl.h>
  59. #include <limits.h>
  60. #include <stdio.h>
  61. #include <stdlib.h>
  62. #include <string.h>
  63. #include <unistd.h>
  64. #ifdef __cplusplus
  65. extern "C" {
  66. #endif
  67. extern FILE * option_usage_fp;
  68. #define zCopyright (tcpliveplay_opt_strs+0)
  69. #define zLicenseDescrip (tcpliveplay_opt_strs+287)
  70. /*
  71. * global included definitions
  72. */
  73. #include "defines.h"
  74. #include "tcpliveplay.h"
  75. #include "common.h"
  76. #include "config.h"
  77. #include "common/sendpacket.h"
  78. #include "send_packets.h"
  79. #include <stdlib.h>
  80. #include <string.h>
  81. #include <stdbool.h>
  82. #include <sys/types.h>
  83. #include <unistd.h>
  84. #ifndef NULL
  85. # define NULL 0
  86. #endif
  87. /**
  88. * static const strings for tcpliveplay options
  89. */
  90. static char const tcpliveplay_opt_strs[3209] =
  91. /* 0 */ "tcpliveplay (tcpliveplay)\n"
  92. "Copyright (C) 2012 Yazan Siam, all rights reserved.\n"
  93. "This is free software. It is licensed for use, modification and\n"
  94. "redistribution under the terms of the\n"
  95. "Modified (3 clause) Berkeley Software Distribution License\n"
  96. "<http://www.xfree86.org/3.3.6/COPYRIGHT2.html>\n\0"
  97. /* 287 */ "Redistribution and use in source and binary forms, with or without\n"
  98. "modification, are permitted provided that the following conditions are met:\n"
  99. "1. Redistributions of source code must retain the above copyright notice,\n"
  100. "this list of conditions and the following disclaimer. 2. Redistributions\n"
  101. "in binary form must reproduce the above copyright notice, this list of\n"
  102. "conditions and the following disclaimer in the documentation and/or other\n"
  103. "materials provided with the distribution. 3. Neither the name Yazan\n"
  104. "Siam'' nor the name of any other contributor may be used to endorse or\n"
  105. "promote products derived from this software without specific prior written\n"
  106. "permission.\n\n"
  107. "tcpliveplay IS PROVIDED BY Yazan Siam AS IS'' AND ANY EXPRESS OR IMPLIED\n"
  108. "WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n"
  109. "MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n"
  110. "EVENT SHALL Yazan Siam OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n"
  111. "INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n"
  112. "(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n"
  113. "SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n"
  114. "CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n"
  115. "LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n"
  116. "OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n"
  117. "DAMAGE.\n\0"
  118. /* 1682 */ "Enable debugging output\0"
  119. /* 1706 */ "DBUG\0"
  120. /* 1711 */ "dbug\0"
  121. /* 1716 */ "Print version information\0"
  122. /* 1742 */ "VERSION\0"
  123. /* 1750 */ "version\0"
  124. /* 1758 */ "Display less usage information and exit\0"
  125. /* 1798 */ "LESS_HELP\0"
  126. /* 1808 */ "less-help\0"
  127. /* 1818 */ "display extended usage information and exit\0"
  128. /* 1862 */ "help\0"
  129. /* 1867 */ "extended usage information passed thru pager\0"
  130. /* 1912 */ "more-help\0"
  131. /* 1922 */ "save the option state to a config file\0"
  132. /* 1961 */ "save-opts\0"
  133. /* 1971 */ "load options from a config file\0"
  134. /* 2003 */ "LOAD_OPTS\0"
  135. /* 2013 */ "no-load-opts\0"
  136. /* 2026 */ "no\0"
  137. /* 2029 */ "TCPLIVEPLAY\0"
  138. /* 2041 */ "tcpliveplay (tcpliveplay) - Replays network traffic stored in a pcap file on live networks using new TCP connections\n"
  139. "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n"
  140. "\t\t<eth0/eth1> <file.pcap> <Destination IP [1.2.3.4]> <Destination mac [0a:1b:2c:3d:4e:5f]> <'random' dst port OR specify dport #>\n\0"
  141. /* 2348 */ "$$/\0"
  142. /* 2352 */ ".tcpliveplayrc\0"
  143. /* 2367 */ "This program, 'tcpliveplay' replays a captured set of packets using new TCP\n"
  144. "connections with the captured TCP payloads against a remote host in order\n"
  145. "to do comprehensive vulnerability testing.\n\0"
  146. /* 2561 */ "The basic operation of tcpliveplay is it rewrites the given pcap file in a\n"
  147. "scheduled event format and responds with the appropriate packet if the\n"
  148. "remote host meets tcp protocal's SEQ/ACK expectation. Once expectations\n"
  149. "are met, then the local packets are sent with the same payload except with\n"
  150. "new tcp SEQ & ACK numbers meeting the response from the remote hose.\n\n"
  151. "The input pcap file are rewritten to start at the first encounter of the\n"
  152. "SYN packet for correct operation making this packet be the first action in\n"
  153. "the event schedule of local host doing the replay.\n\n"
  154. "For more details, please see the Tcpreplay Manual at:\n"
  155. "http://tcpreplay.appneta.com\n";
  156. /**
  157. * dbug option description:
  158. */
  159. #ifdef DEBUG
  160. /** Descriptive text for the dbug option */
  161. #define DBUG_DESC (tcpliveplay_opt_strs+1682)
  162. /** Upper-cased name for the dbug option */
  163. #define DBUG_NAME (tcpliveplay_opt_strs+1706)
  164. /** Name string for the dbug option */
  165. #define DBUG_name (tcpliveplay_opt_strs+1711)
  166. /** The compiled in default value for the dbug option argument */
  167. #define DBUG_DFT_ARG ((char const*)0)
  168. /** Compiled in flag settings for the dbug option */
  169. #define DBUG_FLAGS (OPTST_DISABLED | OPTST_IMM \
  170. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  171. #else /* disable dbug */
  172. #define DBUG_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  173. #define DBUG_DFT_ARG NULL
  174. #define DBUG_NAME NULL
  175. #define DBUG_DESC NULL
  176. #define DBUG_name NULL
  177. #endif /* DEBUG */
  178. /**
  179. * version option description:
  180. */
  181. /** Descriptive text for the version option */
  182. #define VERSION_DESC (tcpliveplay_opt_strs+1716)
  183. /** Upper-cased name for the version option */
  184. #define VERSION_NAME (tcpliveplay_opt_strs+1742)
  185. /** Name string for the version option */
  186. #define VERSION_name (tcpliveplay_opt_strs+1750)
  187. /** Compiled in flag settings for the version option */
  188. #define VERSION_FLAGS (OPTST_DISABLED)
  189. /**
  190. * less-help option description:
  191. */
  192. /** Descriptive text for the less-help option */
  193. #define LESS_HELP_DESC (tcpliveplay_opt_strs+1758)
  194. /** Upper-cased name for the less-help option */
  195. #define LESS_HELP_NAME (tcpliveplay_opt_strs+1798)
  196. /** Name string for the less-help option */
  197. #define LESS_HELP_name (tcpliveplay_opt_strs+1808)
  198. /** Compiled in flag settings for the less-help option */
  199. #define LESS_HELP_FLAGS (OPTST_DISABLED | OPTST_IMM)
  200. /*
  201. * Help/More_Help option descriptions:
  202. */
  203. #define HELP_DESC (tcpliveplay_opt_strs+1818)
  204. #define HELP_name (tcpliveplay_opt_strs+1862)
  205. #ifdef HAVE_WORKING_FORK
  206. #define MORE_HELP_DESC (tcpliveplay_opt_strs+1867)
  207. #define MORE_HELP_name (tcpliveplay_opt_strs+1912)
  208. #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
  209. #else
  210. #define MORE_HELP_DESC HELP_DESC
  211. #define MORE_HELP_name HELP_name
  212. #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  213. #endif
  214. #define SAVE_OPTS_DESC (tcpliveplay_opt_strs+1922)
  215. #define SAVE_OPTS_name (tcpliveplay_opt_strs+1961)
  216. #define LOAD_OPTS_DESC (tcpliveplay_opt_strs+1971)
  217. #define LOAD_OPTS_NAME (tcpliveplay_opt_strs+2003)
  218. #define NO_LOAD_OPTS_name (tcpliveplay_opt_strs+2013)
  219. #define LOAD_OPTS_pfx (tcpliveplay_opt_strs+2026)
  220. #define LOAD_OPTS_name (NO_LOAD_OPTS_name + 3)
  221. /**
  222. * Declare option callback procedures
  223. */
  224. #ifdef DEBUG
  225. static tOptProc doOptDbug;
  226. #else /* not DEBUG */
  227. # define doOptDbug NULL
  228. #endif /* def/not DEBUG */
  229. extern tOptProc
  230. optionBooleanVal, optionNestedVal, optionNumericVal,
  231. optionPagedUsage, optionPrintVersion, optionResetOpt,
  232. optionStackArg, optionTimeDate, optionTimeVal,
  233. optionUnstackArg, optionVendorOption;
  234. static tOptProc
  235. doOptLess_Help, doOptVersion, doUsageOpt;
  236. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  237. /**
  238. * Define the tcpliveplay Option Descriptions.
  239. * This is an array of OPTION_CT entries, one for each
  240. * option that the tcpliveplay program responds to.
  241. */
  242. static tOptDesc optDesc[OPTION_CT] = {
  243. { /* entry idx, value */ 0, VALUE_OPT_DBUG,
  244. /* equiv idx, value */ 0, VALUE_OPT_DBUG,
  245. /* equivalenced to */ NO_EQUIVALENT,
  246. /* min, max, act ct */ 0, 1, 0,
  247. /* opt state flags */ DBUG_FLAGS, 0,
  248. /* last opt argumnt */ { DBUG_DFT_ARG },
  249. /* arg list/cookie */ NULL,
  250. /* must/cannot opts */ NULL, NULL,
  251. /* option proc */ doOptDbug,
  252. /* desc, NAME, name */ DBUG_DESC, DBUG_NAME, DBUG_name,
  253. /* disablement strs */ NULL, NULL },
  254. { /* entry idx, value */ 1, VALUE_OPT_VERSION,
  255. /* equiv idx, value */ 1, VALUE_OPT_VERSION,
  256. /* equivalenced to */ NO_EQUIVALENT,
  257. /* min, max, act ct */ 0, 1, 0,
  258. /* opt state flags */ VERSION_FLAGS, 0,
  259. /* last opt argumnt */ { NULL }, /* --version */
  260. /* arg list/cookie */ NULL,
  261. /* must/cannot opts */ NULL, NULL,
  262. /* option proc */ doOptVersion,
  263. /* desc, NAME, name */ VERSION_DESC, VERSION_NAME, VERSION_name,
  264. /* disablement strs */ NULL, NULL },
  265. { /* entry idx, value */ 2, VALUE_OPT_LESS_HELP,
  266. /* equiv idx, value */ 2, VALUE_OPT_LESS_HELP,
  267. /* equivalenced to */ NO_EQUIVALENT,
  268. /* min, max, act ct */ 0, 1, 0,
  269. /* opt state flags */ LESS_HELP_FLAGS, 0,
  270. /* last opt argumnt */ { NULL }, /* --less-help */
  271. /* arg list/cookie */ NULL,
  272. /* must/cannot opts */ NULL, NULL,
  273. /* option proc */ doOptLess_Help,
  274. /* desc, NAME, name */ LESS_HELP_DESC, LESS_HELP_NAME, LESS_HELP_name,
  275. /* disablement strs */ NULL, NULL },
  276. { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
  277. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
  278. /* equivalenced to */ NO_EQUIVALENT,
  279. /* min, max, act ct */ 0, 1, 0,
  280. /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
  281. /* last opt argumnt */ { NULL },
  282. /* arg list/cookie */ NULL,
  283. /* must/cannot opts */ NULL, NULL,
  284. /* option proc */ doUsageOpt,
  285. /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
  286. /* disablement strs */ NULL, NULL },
  287. { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
  288. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
  289. /* equivalenced to */ NO_EQUIVALENT,
  290. /* min, max, act ct */ 0, 1, 0,
  291. /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
  292. /* last opt argumnt */ { NULL },
  293. /* arg list/cookie */ NULL,
  294. /* must/cannot opts */ NULL, NULL,
  295. /* option proc */ optionPagedUsage,
  296. /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
  297. /* disablement strs */ NULL, NULL },
  298. { /* entry idx, value */ INDEX_OPT_SAVE_OPTS, VALUE_OPT_SAVE_OPTS,
  299. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_SAVE_OPTS,
  300. /* equivalenced to */ NO_EQUIVALENT,
  301. /* min, max, act ct */ 0, 1, 0,
  302. /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
  303. | OPTST_ARG_OPTIONAL | OPTST_NO_INIT, AOUSE_SAVE_OPTS,
  304. /* last opt argumnt */ { NULL },
  305. /* arg list/cookie */ NULL,
  306. /* must/cannot opts */ NULL, NULL,
  307. /* option proc */ NULL,
  308. /* desc, NAME, name */ SAVE_OPTS_DESC, NULL, SAVE_OPTS_name,
  309. /* disablement strs */ NULL, NULL },
  310. { /* entry idx, value */ INDEX_OPT_LOAD_OPTS, VALUE_OPT_LOAD_OPTS,
  311. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_LOAD_OPTS,
  312. /* equivalenced to */ NO_EQUIVALENT,
  313. /* min, max, act ct */ 0, NOLIMIT, 0,
  314. /* opt state flags */ OPTST_SET_ARGTYPE(OPARG_TYPE_STRING)
  315. | OPTST_DISABLE_IMM, AOUSE_LOAD_OPTS,
  316. /* last opt argumnt */ { NULL },
  317. /* arg list/cookie */ NULL,
  318. /* must/cannot opts */ NULL, NULL,
  319. /* option proc */ optionLoadOpt,
  320. /* desc, NAME, name */ LOAD_OPTS_DESC, LOAD_OPTS_NAME, LOAD_OPTS_name,
  321. /* disablement strs */ NO_LOAD_OPTS_name, LOAD_OPTS_pfx }
  322. };
  323. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  324. /** Reference to the upper cased version of tcpliveplay. */
  325. #define zPROGNAME (tcpliveplay_opt_strs+2029)
  326. /** Reference to the title line for tcpliveplay usage. */
  327. #define zUsageTitle (tcpliveplay_opt_strs+2041)
  328. /** tcpliveplay configuration file name. */
  329. #define zRcName (tcpliveplay_opt_strs+2352)
  330. /** Directories to search for tcpliveplay config files. */
  331. static char const * const apzHomeList[2] = {
  332. tcpliveplay_opt_strs+2348,
  333. NULL };
  334. /** The tcpliveplay program bug email address. */
  335. #define zBugsAddr (NULL)
  336. /** Clarification/explanation of what tcpliveplay does. */
  337. #define zExplain (tcpliveplay_opt_strs+2367)
  338. /** Extra detail explaining what tcpliveplay does. */
  339. #define zDetail (tcpliveplay_opt_strs+2561)
  340. /** The full version string for tcpliveplay. */
  341. #define zFullVersion (NULL)
  342. /* extracted from optcode.tlib near line 342 */
  343. #if defined(ENABLE_NLS)
  344. # define OPTPROC_BASE OPTPROC_TRANSLATE
  345. static tOptionXlateProc translate_option_strings;
  346. #else
  347. # define OPTPROC_BASE OPTPROC_NONE
  348. # define translate_option_strings NULL
  349. #endif /* ENABLE_NLS */
  350. #define tcpliveplay_full_usage (NULL)
  351. #define tcpliveplay_short_usage (NULL)
  352. #endif /* not defined __doxygen__ */
  353. /*
  354. * Create the static procedure(s) declared above.
  355. */
  356. /**
  357. * The callout function that invokes the optionUsage function.
  358. *
  359. * @param[in] opts the AutoOpts option description structure
  360. * @param[in] od the descriptor for the "help" (usage) option.
  361. * @noreturn
  362. */
  363. static void
  364. doUsageOpt(tOptions * opts, tOptDesc * od)
  365. {
  366. int ex_code;
  367. ex_code = TCPLIVEPLAY_EXIT_SUCCESS;
  368. optionUsage(&tcpliveplayOptions, ex_code);
  369. /* NOTREACHED */
  370. exit(TCPLIVEPLAY_EXIT_FAILURE);
  371. (void)opts;
  372. (void)od;
  373. }
  374. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  375. /**
  376. * Code to handle the dbug option, when DEBUG is #define-d.
  377. * If configured with --enable-debug, then you can specify a verbosity
  378. * level for debugging output. Higher numbers increase verbosity.
  379. * @param[in] pOptions the tcpliveplay options data structure
  380. * @param[in,out] pOptDesc the option descriptor for this option.
  381. */
  382. #ifdef DEBUG
  383. static void
  384. doOptDbug(tOptions* pOptions, tOptDesc* pOptDesc)
  385. {
  386. static struct {long rmin, rmax;} const rng[1] = {
  387. { 0, 5 } };
  388. int ix;
  389. if (pOptions <= OPTPROC_EMIT_LIMIT)
  390. goto emit_ranges;
  391. optionNumericVal(pOptions, pOptDesc);
  392. for (ix = 0; ix < 1; ix++) {
  393. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  394. continue; /* ranges need not be ordered. */
  395. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  396. return;
  397. if (rng[ix].rmax == LONG_MIN)
  398. continue;
  399. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  400. return;
  401. }
  402. option_usage_fp = stderr;
  403. emit_ranges:
  404. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  405. }
  406. #endif /* defined DEBUG */
  407. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  408. /**
  409. * Code to handle the version option.
  410. *
  411. * @param[in] pOptions the tcpliveplay options data structure
  412. * @param[in,out] pOptDesc the option descriptor for this option.
  413. */
  414. static void
  415. doOptVersion(tOptions* pOptions, tOptDesc* pOptDesc)
  416. {
  417. /*
  418. * Be sure the flag-code[0] handles special values for the options pointer
  419. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  420. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  421. * reset its state.
  422. */
  423. /* extracted from tcpliveplay_opts.def, line 131 */
  424. fprintf(stderr, "tcpliveplay version: %s (build %s)", VERSION, git_version());
  425. #ifdef DEBUG
  426. fprintf(stderr, " (debug)");
  427. #endif
  428. fprintf(stderr, "\n");
  429. fprintf(stderr, "Copyright 2012 by Yazan Siam <tcpliveplay@gmail.com>\n");
  430. #ifdef HAVE_LIBDNET
  431. fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION);
  432. #else
  433. fprintf(stderr, "Not compiled with libdnet.\n");
  434. #endif
  435. #ifdef HAVE_WINPCAP
  436. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  437. #elif defined HAVE_PF_RING_PCAP
  438. fprintf(stderr, "Compiled against PF_RING libpcap: %s\n", get_pcap_version());
  439. #else
  440. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  441. #endif
  442. #ifdef ENABLE_64BITS
  443. fprintf(stderr, "64 bit packet counters: enabled\n");
  444. #else
  445. fprintf(stderr, "64 bit packet counters: disabled\n");
  446. #endif
  447. #ifdef ENABLE_VERBOSE
  448. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  449. #else
  450. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  451. #endif
  452. fprintf(stderr, "Injection method: %s\n", sendpacket_get_method(NULL));
  453. exit(0);
  454. (void)pOptDesc;
  455. (void)pOptions;
  456. }
  457. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  458. /**
  459. * Code to handle the less-help option.
  460. *
  461. * @param[in] pOptions the tcpliveplay options data structure
  462. * @param[in,out] pOptDesc the option descriptor for this option.
  463. */
  464. static void
  465. doOptLess_Help(tOptions* pOptions, tOptDesc* pOptDesc)
  466. {
  467. /*
  468. * Be sure the flag-code[0] handles special values for the options pointer
  469. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  470. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  471. * reset its state.
  472. */
  473. /* extracted from tcpliveplay_opts.def, line 174 */
  474. USAGE(EXIT_FAILURE);
  475. (void)pOptDesc;
  476. (void)pOptions;
  477. }
  478. /* extracted from optmain.tlib near line 1250 */
  479. /**
  480. * The directory containing the data associated with tcpliveplay.
  481. */
  482. #ifndef PKGDATADIR
  483. # define PKGDATADIR ""
  484. #endif
  485. /**
  486. * Information about the person or institution that packaged tcpliveplay
  487. * for the current distribution.
  488. */
  489. #ifndef WITH_PACKAGER
  490. # define tcpliveplay_packager_info NULL
  491. #else
  492. /** Packager information for tcpliveplay. */
  493. static char const tcpliveplay_packager_info[] =
  494. "Packaged by " WITH_PACKAGER
  495. # ifdef WITH_PACKAGER_VERSION
  496. " ("WITH_PACKAGER_VERSION")"
  497. # endif
  498. # ifdef WITH_PACKAGER_BUG_REPORTS
  499. "\nReport tcpliveplay bugs to " WITH_PACKAGER_BUG_REPORTS
  500. # endif
  501. "\n";
  502. #endif
  503. #ifndef __doxygen__
  504. #endif /* __doxygen__ */
  505. /**
  506. * The option definitions for tcpliveplay. The one structure that
  507. * binds them all.
  508. */
  509. tOptions tcpliveplayOptions = {
  510. OPTIONS_STRUCT_VERSION,
  511. 0, NULL, /* original argc + argv */
  512. ( OPTPROC_BASE
  513. + OPTPROC_ERRSTOP
  514. + OPTPROC_SHORTOPT
  515. + OPTPROC_LONGOPT
  516. + OPTPROC_NO_REQ_OPT
  517. + OPTPROC_ARGS_REQ
  518. + OPTPROC_GNUUSAGE ),
  519. 0, NULL, /* current option index, current option */
  520. NULL, NULL, zPROGNAME,
  521. zRcName, zCopyright, zLicenseDescrip,
  522. zFullVersion, apzHomeList, zUsageTitle,
  523. zExplain, zDetail, optDesc,
  524. zBugsAddr, /* address to send bugs to */
  525. NULL, NULL, /* extensions/saved state */
  526. optionUsage, /* usage procedure */
  527. translate_option_strings, /* translation procedure */
  528. /*
  529. * Indexes to special options
  530. */
  531. { INDEX_OPT_MORE_HELP, /* more-help option index */
  532. INDEX_OPT_SAVE_OPTS, /* save option index */
  533. NO_EQUIVALENT, /* '-#' option index */
  534. NO_EQUIVALENT /* index of default opt */
  535. },
  536. 7 /* full option count */, 3 /* user option count */,
  537. tcpliveplay_full_usage, tcpliveplay_short_usage,
  538. NULL, NULL,
  539. PKGDATADIR, tcpliveplay_packager_info
  540. };
  541. #if ENABLE_NLS
  542. /**
  543. * This code is designed to translate translatable option text for the
  544. * tcpliveplay program. These translations happen upon entry
  545. * to optionProcess().
  546. */
  547. #include <stdio.h>
  548. #include <stdlib.h>
  549. #include <string.h>
  550. #include <unistd.h>
  551. #ifdef HAVE_DCGETTEXT
  552. # include <gettext.h>
  553. #endif
  554. #include <autoopts/usage-txt.h>
  555. static char * AO_gettext(char const * pz);
  556. static void coerce_it(void ** s);
  557. /**
  558. * AutoGen specific wrapper function for gettext. It relies on the macro _()
  559. * to convert from English to the target language, then strdup-duplicates the
  560. * result string. It tries the "libopts" domain first, then whatever has been
  561. * set via the \a textdomain(3) call.
  562. *
  563. * @param[in] pz the input text used as a lookup key.
  564. * @returns the translated text (if there is one),
  565. * or the original text (if not).
  566. */
  567. static char *
  568. AO_gettext(char const * pz)
  569. {
  570. char * res;
  571. if (pz == NULL)
  572. return NULL;
  573. #ifdef HAVE_DCGETTEXT
  574. /*
  575. * While processing the option_xlateable_txt data, try to use the
  576. * "libopts" domain. Once we switch to the option descriptor data,
  577. * do *not* use that domain.
  578. */
  579. if (option_xlateable_txt.field_ct != 0) {
  580. res = dgettext("libopts", pz);
  581. if (res == pz)
  582. res = (char *)VOIDP(_(pz));
  583. } else
  584. res = (char *)VOIDP(_(pz));
  585. #else
  586. res = (char *)VOIDP(_(pz));
  587. #endif
  588. if (res == pz)
  589. return res;
  590. res = strdup(res);
  591. if (res == NULL) {
  592. fputs(_("No memory for duping translated strings\n"), stderr);
  593. exit(TCPLIVEPLAY_EXIT_FAILURE);
  594. }
  595. return res;
  596. }
  597. /**
  598. * All the pointers we use are marked "* const", but they are stored in
  599. * writable memory. Coerce the mutability and set the pointer.
  600. */
  601. static void coerce_it(void ** s) { *s = AO_gettext(*s);
  602. }
  603. /**
  604. * Translate all the translatable strings in the tcpliveplayOptions
  605. * structure defined above. This is done only once.
  606. */
  607. static void
  608. translate_option_strings(void)
  609. {
  610. tOptions * const opts = &tcpliveplayOptions;
  611. /*
  612. * Guard against re-translation. It won't work. The strings will have
  613. * been changed by the first pass through this code. One shot only.
  614. */
  615. if (option_xlateable_txt.field_ct != 0) {
  616. /*
  617. * Do the translations. The first pointer follows the field count
  618. * field. The field count field is the size of a pointer.
  619. */
  620. char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
  621. int ix = option_xlateable_txt.field_ct;
  622. do {
  623. ppz++; /* skip over field_ct */
  624. *ppz = AO_gettext(*ppz);
  625. } while (--ix > 0);
  626. /* prevent re-translation and disable "libopts" domain lookup */
  627. option_xlateable_txt.field_ct = 0;
  628. coerce_it(VOIDP(&(opts->pzCopyright)));
  629. coerce_it(VOIDP(&(opts->pzCopyNotice)));
  630. coerce_it(VOIDP(&(opts->pzFullVersion)));
  631. coerce_it(VOIDP(&(opts->pzUsageTitle)));
  632. coerce_it(VOIDP(&(opts->pzExplain)));
  633. coerce_it(VOIDP(&(opts->pzDetail)));
  634. {
  635. tOptDesc * od = opts->pOptDesc;
  636. for (ix = opts->optCt; ix > 0; ix--, od++)
  637. coerce_it(VOIDP(&(od->pzText)));
  638. }
  639. }
  640. }
  641. #endif /* ENABLE_NLS */
  642. #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
  643. /** I18N function strictly for xgettext. Do not compile. */
  644. static void bogus_function(void) {
  645. /* TRANSLATORS:
  646. The following dummy function was crated solely so that xgettext can
  647. extract the correct strings. These strings are actually referenced
  648. by a field name in the tcpliveplayOptions structure noted in the
  649. comments below. The literal text is defined in tcpliveplay_opt_strs.
  650. NOTE: the strings below are segmented with respect to the source string
  651. tcpliveplay_opt_strs. The strings above are handed off for translation
  652. at run time a paragraph at a time. Consequently, they are presented here
  653. for translation a paragraph at a time.
  654. ALSO: often the description for an option will reference another option
  655. by name. These are set off with apostrophe quotes (I hope). Do not
  656. translate option names.
  657. */
  658. /* referenced via tcpliveplayOptions.pzCopyright */
  659. puts(_("tcpliveplay (tcpliveplay)\n\
  660. Copyright (C) 2012 Yazan Siam, all rights reserved.\n\
  661. This is free software. It is licensed for use, modification and\n\
  662. redistribution under the terms of the\n\
  663. Modified (3 clause) Berkeley Software Distribution License\n\
  664. <http://www.xfree86.org/3.3.6/COPYRIGHT2.html>\n"));
  665. /* referenced via tcpliveplayOptions.pzCopyNotice */
  666. puts(_("Redistribution and use in source and binary forms, with or without\n\
  667. modification, are permitted provided that the following conditions are met:\n\
  668. 1. Redistributions of source code must retain the above copyright notice,\n\
  669. this list of conditions and the following disclaimer. 2. Redistributions\n\
  670. in binary form must reproduce the above copyright notice, this list of\n\
  671. conditions and the following disclaimer in the documentation and/or other\n\
  672. materials provided with the distribution. 3. Neither the name Yazan\n\
  673. Siam'' nor the name of any other contributor may be used to endorse or\n\
  674. promote products derived from this software without specific prior written\n\
  675. permission.\n\n"));
  676. puts(_("tcpliveplay IS PROVIDED BY Yazan Siam AS IS'' AND ANY EXPRESS OR IMPLIED\n\
  677. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\n\
  678. MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO\n\
  679. EVENT SHALL Yazan Siam OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY DIRECT,\n\
  680. INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES\n\
  681. (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR\n\
  682. SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER\n\
  683. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT\n\
  684. LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY\n\
  685. OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH\n\
  686. DAMAGE.\n"));
  687. /* referenced via tcpliveplayOptions.pOptDesc->pzText */
  688. puts(_("Enable debugging output"));
  689. /* referenced via tcpliveplayOptions.pOptDesc->pzText */
  690. puts(_("Print version information"));
  691. /* referenced via tcpliveplayOptions.pOptDesc->pzText */
  692. puts(_("Display less usage information and exit"));
  693. /* referenced via tcpliveplayOptions.pOptDesc->pzText */
  694. puts(_("display extended usage information and exit"));
  695. /* referenced via tcpliveplayOptions.pOptDesc->pzText */
  696. puts(_("extended usage information passed thru pager"));
  697. /* referenced via tcpliveplayOptions.pOptDesc->pzText */
  698. puts(_("save the option state to a config file"));
  699. /* referenced via tcpliveplayOptions.pOptDesc->pzText */
  700. puts(_("load options from a config file"));
  701. /* referenced via tcpliveplayOptions.pzUsageTitle */
  702. puts(_("tcpliveplay (tcpliveplay) - Replays network traffic stored in a pcap file on live networks using new TCP connections\n\
  703. Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... \\\n\
  704. \t\t<eth0/eth1> <file.pcap> <Destination IP [1.2.3.4]> <Destination mac [0a:1b:2c:3d:4e:5f]> <'random' dst port OR specify dport #>\n"));
  705. /* referenced via tcpliveplayOptions.pzExplain */
  706. puts(_("This program, 'tcpliveplay' replays a captured set of packets using new TCP\n\
  707. connections with the captured TCP payloads against a remote host in order\n\
  708. to do comprehensive vulnerability testing.\n"));
  709. /* referenced via tcpliveplayOptions.pzDetail */
  710. puts(_("The basic operation of tcpliveplay is it rewrites the given pcap file in a\n\
  711. scheduled event format and responds with the appropriate packet if the\n\
  712. remote host meets tcp protocal's SEQ/ACK expectation. Once expectations\n\
  713. are met, then the local packets are sent with the same payload except with\n\
  714. new tcp SEQ & ACK numbers meeting the response from the remote hose.\n\n"));
  715. puts(_("The input pcap file are rewritten to start at the first encounter of the\n\
  716. SYN packet for correct operation making this packet be the first action in\n\
  717. the event schedule of local host doing the replay.\n\n"));
  718. puts(_("For more details, please see the Tcpreplay Manual at:\n\
  719. http://tcpreplay.appneta.com\n"));
  720. /* referenced via tcpliveplayOptions.pzFullUsage */
  721. puts(_("<<<NOT-FOUND>>>"));
  722. /* referenced via tcpliveplayOptions.pzShortUsage */
  723. puts(_("<<<NOT-FOUND>>>"));
  724. /* LIBOPTS-MESSAGES: */
  725. #line 67 "../autoopts.c"
  726. puts(_("allocation of %d bytes failed\n"));
  727. #line 89 "../autoopts.c"
  728. puts(_("allocation of %d bytes failed\n"));
  729. #line 48 "../init.c"
  730. puts(_("AutoOpts function called without option descriptor\n"));
  731. #line 81 "../init.c"
  732. puts(_("\tThis exceeds the compiled library version: "));
  733. #line 79 "../init.c"
  734. puts(_("Automated Options Processing Error!\n"
  735. "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
  736. #line 78 "../autoopts.c"
  737. puts(_("realloc of %d bytes at 0x%p failed\n"));
  738. #line 83 "../init.c"
  739. puts(_("\tThis is less than the minimum library version: "));
  740. #line 121 "../version.c"
  741. puts(_("Automated Options version %s\n"
  742. "\tCopyright (C) 1999-2017 by Bruce Korb - all rights reserved\n"));
  743. #line 49 "../makeshell.c"
  744. puts(_("(AutoOpts bug): %s.\n"));
  745. #line 90 "../reset.c"
  746. puts(_("optionResetOpt() called, but reset-option not configured"));
  747. #line 241 "../usage.c"
  748. puts(_("could not locate the 'help' option"));
  749. #line 330 "../autoopts.c"
  750. puts(_("optionProcess() was called with invalid data"));
  751. #line 697 "../usage.c"
  752. puts(_("invalid argument type specified"));
  753. #line 568 "../find.c"
  754. puts(_("defaulted to option with optional arg"));
  755. #line 76 "../alias.c"
  756. puts(_("aliasing option is out of range."));
  757. #line 210 "../enum.c"
  758. puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
  759. #line 78 "../find.c"
  760. puts(_(" The following options match:\n"));
  761. #line 263 "../find.c"
  762. puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
  763. #line 161 "../check.c"
  764. puts(_("%s: Command line arguments required\n"));
  765. #line 43 "../alias.c"
  766. puts(_("%d %s%s options allowed\n"));
  767. #line 56 "../makeshell.c"
  768. puts(_("%s error %d (%s) calling %s for '%s'\n"));
  769. #line 268 "../makeshell.c"
  770. puts(_("interprocess pipe"));
  771. #line 171 "../version.c"
  772. puts(_("error: version option argument '%c' invalid. Use:\n"
  773. "\t'v' - version only\n"
  774. "\t'c' - version and copyright\n"
  775. "\t'n' - version and full copyright notice\n"));
  776. #line 58 "../check.c"
  777. puts(_("%s error: the '%s' and '%s' options conflict\n"));
  778. #line 187 "../find.c"
  779. puts(_("%s: The '%s' option has been disabled."));
  780. #line 400 "../find.c"
  781. puts(_("%s: The '%s' option has been disabled."));
  782. #line 38 "../alias.c"
  783. puts(_("-equivalence"));
  784. #line 439 "../find.c"
  785. puts(_("%s: illegal option -- %c\n"));
  786. #line 110 "../reset.c"
  787. puts(_("%s: illegal option -- %c\n"));
  788. #line 241 "../find.c"
  789. puts(_("%s: illegal option -- %s\n"));
  790. #line 740 "../find.c"
  791. puts(_("%s: illegal option -- %s\n"));
  792. #line 118 "../reset.c"
  793. puts(_("%s: illegal option -- %s\n"));
  794. #line 305 "../find.c"
  795. puts(_("%s: unknown vendor extension option -- %s\n"));
  796. #line 135 "../enum.c"
  797. puts(_(" or an integer from %d through %d\n"));
  798. #line 145 "../enum.c"
  799. puts(_(" or an integer from %d through %d\n"));
  800. #line 696 "../usage.c"
  801. puts(_("%s error: invalid option descriptor for %s\n"));
  802. #line 1030 "../usage.c"
  803. puts(_("%s error: invalid option descriptor for %s\n"));
  804. #line 355 "../find.c"
  805. puts(_("%s: invalid option name: %s\n"));
  806. #line 497 "../find.c"
  807. puts(_("%s: The '%s' option requires an argument.\n"));
  808. #line 150 "../autoopts.c"
  809. puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
  810. "\t'%s' and '%s'."));
  811. #line 94 "../check.c"
  812. puts(_("%s error: The %s option is required\n"));
  813. #line 602 "../find.c"
  814. puts(_("%s: The '%s' option cannot have an argument.\n"));
  815. #line 151 "../check.c"
  816. puts(_("%s: Command line arguments are not allowed.\n"));
  817. #line 568 "../save.c"
  818. puts(_("error %d (%s) creating %s\n"));
  819. #line 210 "../enum.c"
  820. puts(_("%s error: '%s' does not match any %s keywords.\n"));
  821. #line 93 "../reset.c"
  822. puts(_("%s error: The '%s' option requires an argument.\n"));
  823. #line 122 "../save.c"
  824. puts(_("error %d (%s) stat-ing %s\n"));
  825. #line 175 "../save.c"
  826. puts(_("error %d (%s) stat-ing %s\n"));
  827. #line 143 "../restore.c"
  828. puts(_("%s error: no saved option state\n"));
  829. #line 225 "../autoopts.c"
  830. puts(_("'%s' is not a command line option.\n"));
  831. #line 113 "../time.c"
  832. puts(_("%s error: '%s' is not a recognizable date/time.\n"));
  833. #line 50 "../time.c"
  834. puts(_("%s error: '%s' is not a recognizable time duration.\n"));
  835. #line 92 "../check.c"
  836. puts(_("%s error: The %s option must appear %d times.\n"));
  837. #line 165 "../numeric.c"
  838. puts(_("%s error: '%s' is not a recognizable number.\n"));
  839. #line 176 "../enum.c"
  840. puts(_("%s error: %s exceeds %s keyword count\n"));
  841. #line 279 "../usage.c"
  842. puts(_("Try '%s %s' for more information.\n"));
  843. #line 45 "../alias.c"
  844. puts(_("one %s%s option allowed\n"));
  845. #line 170 "../makeshell.c"
  846. puts(_("standard output"));
  847. #line 905 "../makeshell.c"
  848. puts(_("standard output"));
  849. #line 223 "../usage.c"
  850. puts(_("standard output"));
  851. #line 364 "../usage.c"
  852. puts(_("standard output"));
  853. #line 574 "../usage.c"
  854. puts(_("standard output"));
  855. #line 178 "../version.c"
  856. puts(_("standard output"));
  857. #line 223 "../usage.c"
  858. puts(_("standard error"));
  859. #line 364 "../usage.c"
  860. puts(_("standard error"));
  861. #line 574 "../usage.c"
  862. puts(_("standard error"));
  863. #line 178 "../version.c"
  864. puts(_("standard error"));
  865. #line 170 "../makeshell.c"
  866. puts(_("write"));
  867. #line 905 "../makeshell.c"
  868. puts(_("write"));
  869. #line 222 "../usage.c"
  870. puts(_("write"));
  871. #line 363 "../usage.c"
  872. puts(_("write"));
  873. #line 573 "../usage.c"
  874. puts(_("write"));
  875. #line 177 "../version.c"
  876. puts(_("write"));
  877. #line 60 "../numeric.c"
  878. puts(_("%s error: %s option value %ld is out of range.\n"));
  879. #line 44 "../check.c"
  880. puts(_("%s error: %s option requires the %s option\n"));
  881. #line 121 "../save.c"
  882. puts(_("%s warning: cannot save options - %s not regular file\n"));
  883. #line 174 "../save.c"
  884. puts(_("%s warning: cannot save options - %s not regular file\n"));
  885. #line 193 "../save.c"
  886. puts(_("%s warning: cannot save options - %s not regular file\n"));
  887. #line 567 "../save.c"
  888. puts(_("%s warning: cannot save options - %s not regular file\n"));
  889. /* END-LIBOPTS-MESSAGES */
  890. /* USAGE-TEXT: */
  891. #line 822 "../usage.c"
  892. puts(_("\t\t\t\t- an alternate for '%s'\n"));
  893. #line 1097 "../usage.c"
  894. puts(_("Version, usage and configuration options:"));
  895. #line 873 "../usage.c"
  896. puts(_("\t\t\t\t- default option for unnamed options\n"));
  897. #line 786 "../usage.c"
  898. puts(_("\t\t\t\t- disabled as '--%s'\n"));
  899. #line 1066 "../usage.c"
  900. puts(_(" --- %-14s %s\n"));
  901. #line 1064 "../usage.c"
  902. puts(_("This option has been disabled"));
  903. #line 813 "../usage.c"
  904. puts(_("\t\t\t\t- enabled by default\n"));
  905. #line 40 "../alias.c"
  906. puts(_("%s error: only "));
  907. #line 1143 "../usage.c"
  908. puts(_(" - examining environment variables named %s_*\n"));
  909. #line 168 "../file.c"
  910. puts(_("\t\t\t\t- file must not pre-exist\n"));
  911. #line 172 "../file.c"
  912. puts(_("\t\t\t\t- file must pre-exist\n"));
  913. #line 329 "../usage.c"
  914. puts(_("Options are specified by doubled hyphens and their name or by a single\n"
  915. "hyphen and the flag character.\n"));
  916. #line 882 "../makeshell.c"
  917. puts(_("\n"
  918. "= = = = = = = =\n\n"
  919. "This incarnation of genshell will produce\n"
  920. "a shell script to parse the options for %s:\n\n"));
  921. #line 142 "../enum.c"
  922. puts(_(" or an integer mask with any of the lower %d bits set\n"));
  923. #line 846 "../usage.c"
  924. puts(_("\t\t\t\t- is a set membership option\n"));
  925. #line 867 "../usage.c"
  926. puts(_("\t\t\t\t- must appear between %d and %d times\n"));
  927. #line 331 "../usage.c"
  928. puts(_("Options are specified by single or double hyphens and their name.\n"));
  929. #line 853 "../usage.c"
  930. puts(_("\t\t\t\t- may appear multiple times\n"));
  931. #line 840 "../usage.c"
  932. puts(_("\t\t\t\t- may not be preset\n"));
  933. #line 1258 "../usage.c"
  934. puts(_(" Arg Option-Name Description\n"));
  935. #line 1194 "../usage.c"
  936. puts(_(" Flg Arg Option-Name Description\n"));
  937. #line 1252 "../usage.c"
  938. puts(_(" Flg Arg Option-Name Description\n"));
  939. #line 1253 "../usage.c"
  940. puts(_(" %3s %s"));
  941. #line 1259 "../usage.c"
  942. puts(_(" %3s %s"));
  943. #line 336 "../usage.c"
  944. puts(_("The '-#<number>' option may omit the hash char\n"));
  945. #line 332 "../usage.c"
  946. puts(_("All arguments are named options.\n"));
  947. #line 920 "../usage.c"
  948. puts(_(" - reading file %s"));
  949. #line 358 "../usage.c"
  950. puts(_("\n"
  951. "Please send bug reports to: <%s>\n"));
  952. #line 100 "../version.c"
  953. puts(_("\n"
  954. "Please send bug reports to: <%s>\n"));
  955. #line 129 "../version.c"
  956. puts(_("\n"
  957. "Please send bug reports to: <%s>\n"));
  958. #line 852 "../usage.c"
  959. puts(_("\t\t\t\t- may NOT appear - preset only\n"));
  960. #line 893 "../usage.c"
  961. puts(_("\n"
  962. "The following option preset mechanisms are supported:\n"));
  963. #line 1141 "../usage.c"
  964. puts(_("\n"
  965. "The following option preset mechanisms are supported:\n"));
  966. #line 631 "../usage.c"
  967. puts(_("prohibits these options:\n"));
  968. #line 626 "../usage.c"
  969. puts(_("prohibits the option '%s'\n"));
  970. #line 81 "../numeric.c"
  971. puts(_("%s%ld to %ld"));
  972. #line 79 "../numeric.c"
  973. puts(_("%sgreater than or equal to %ld"));
  974. #line 75 "../numeric.c"
  975. puts(_("%s%ld exactly"));
  976. #line 68 "../numeric.c"
  977. puts(_("%sit must lie in one of the ranges:\n"));
  978. #line 68 "../numeric.c"
  979. puts(_("%sit must be in the range:\n"));
  980. #line 88 "../numeric.c"
  981. puts(_(", or\n"));
  982. #line 66 "../numeric.c"
  983. puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
  984. #line 77 "../numeric.c"
  985. puts(_("%sless than or equal to %ld"));
  986. #line 339 "../usage.c"
  987. puts(_("Operands and options may be intermixed. They will be reordered.\n"));
  988. #line 601 "../usage.c"
  989. puts(_("requires the option '%s'\n"));
  990. #line 604 "../usage.c"
  991. puts(_("requires these options:\n"));
  992. #line 1270 "../usage.c"
  993. puts(_(" Arg Option-Name Req? Description\n"));
  994. #line 1264 "../usage.c"
  995. puts(_(" Flg Arg Option-Name Req? Description\n"));
  996. #line 143 "../enum.c"
  997. puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
  998. "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
  999. "will set them all. Multiple entries may be passed as an option\n"
  1000. "argument list.\n"));
  1001. #line 859 "../usage.c"
  1002. puts(_("\t\t\t\t- may appear up to %d times\n"));
  1003. #line 52 "../enum.c"
  1004. puts(_("The valid \"%s\" option keywords are:\n"));
  1005. #line 1101 "../usage.c"
  1006. puts(_("The next option supports vendor supported extra options:"));
  1007. #line 722 "../usage.c"
  1008. puts(_("These additional options are:"));
  1009. /* END-USAGE-TEXT */
  1010. }
  1011. #endif /* uncompilable code */
  1012. #ifdef __cplusplus
  1013. }
  1014. #endif
  1015. /* tcpliveplay_opts.c ends here */