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