tcpcapinfo_opts.c 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899
  1. /* -*- buffer-read-only: t -*- vi: set ro:
  2. *
  3. * DO NOT EDIT THIS FILE (tcpcapinfo_opts.c)
  4. *
  5. * It has been AutoGen-ed
  6. * From the definitions tcpcapinfo_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 tcpcapinfo 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 tcpcapinfo program is copyrighted and licensed
  20. * under the following terms:
  21. *
  22. * Copyright (C) 2000-2012 Aaron Turner and Fred Klassen, all rights reserved.
  23. * This is free software. It is licensed for use, modification and
  24. * redistribution under the terms of the GNU General Public License,
  25. * version 3 or later <http://gnu.org/licenses/gpl.html>
  26. *
  27. * tcpcapinfo is free software: you can redistribute it and/or modify it
  28. * under the terms of the GNU General Public License as published by the
  29. * Free Software Foundation, either version 3 of the License, or
  30. * (at your option) any later version.
  31. *
  32. * tcpcapinfo is distributed in the hope that it will be useful, but
  33. * WITHOUT ANY WARRANTY; without even the implied warranty of
  34. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  35. * See the GNU General Public License for more details.
  36. *
  37. * You should have received a copy of the GNU General Public License along
  38. * with this program. If not, see <http://www.gnu.org/licenses/>.
  39. */
  40. #ifndef __doxygen__
  41. #define OPTION_CODE_COMPILE 1
  42. #include "tcpcapinfo_opts.h"
  43. #include <sys/types.h>
  44. #include <limits.h>
  45. #include <stdio.h>
  46. #include <stdlib.h>
  47. #include <errno.h>
  48. #ifdef __cplusplus
  49. extern "C" {
  50. #endif
  51. extern FILE * option_usage_fp;
  52. #define zCopyright (tcpcapinfo_opt_strs+0)
  53. #define zLicenseDescrip (tcpcapinfo_opt_strs+290)
  54. /*
  55. * global included definitions
  56. */
  57. #include "defines.h"
  58. #include "common.h"
  59. #include "config.h"
  60. #ifndef NULL
  61. # define NULL 0
  62. #endif
  63. /**
  64. * static const strings for tcpcapinfo options
  65. */
  66. static char const tcpcapinfo_opt_strs[1631] =
  67. /* 0 */ "tcpcapinfo (Tcpreplay Suite)\n"
  68. "Copyright (C) 2000-2012 Aaron Turner and Fred Klassen, all rights reserved.\n"
  69. "This is free software. It is licensed for use, modification and\n"
  70. "redistribution under the terms of the GNU General Public License,\n"
  71. "version 3 or later <http://gnu.org/licenses/gpl.html>\n\0"
  72. /* 290 */ "tcpcapinfo is free software: you can redistribute it and/or modify it under\n"
  73. "the terms of the GNU General Public License as published by the Free\n"
  74. "Software Foundation, either version 3 of the License, or (at your option)\n"
  75. "any later version.\n\n"
  76. "tcpcapinfo is distributed in the hope that it will be useful, but WITHOUT\n"
  77. "ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n"
  78. "FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n"
  79. "more details.\n\n"
  80. "You should have received a copy of the GNU General Public License along\n"
  81. "with this program. If not, see <http://www.gnu.org/licenses/>.\n\0"
  82. /* 899 */ "Enable debugging output\0"
  83. /* 923 */ "DBUG\0"
  84. /* 928 */ "dbug\0"
  85. /* 933 */ "Print version information\0"
  86. /* 959 */ "VERSION\0"
  87. /* 967 */ "version\0"
  88. /* 975 */ "display extended usage information and exit\0"
  89. /* 1019 */ "help\0"
  90. /* 1024 */ "extended usage information passed thru pager\0"
  91. /* 1069 */ "more-help\0"
  92. /* 1079 */ "TCPCAPINFO\0"
  93. /* 1090 */ "tcpcapinfo (Tcpreplay Suite) - Pcap file dissector for debugging broken pcap files\n"
  94. "Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <pcap_file(s)>\n\0"
  95. /* 1246 */ "tcpreplay-users@lists.sourceforge.net\0"
  96. /* 1284 */ "tcpcapinfo is a tool for decoding the structure of a pcap(3) file with a\n"
  97. "focus on finding broken pcap files and determining how two related pcap\n"
  98. "files might differ.\n\0"
  99. /* 1450 */ "tcpcapinfo will first print out the pcap_file_header_t in human readable\n"
  100. "form followed by a per-packet summary including the pcap_pkthdr_t and\n"
  101. "simple checksum value of the packet.\n";
  102. /**
  103. * dbug option description:
  104. */
  105. #ifdef DEBUG
  106. /** Descriptive text for the dbug option */
  107. #define DBUG_DESC (tcpcapinfo_opt_strs+899)
  108. /** Upper-cased name for the dbug option */
  109. #define DBUG_NAME (tcpcapinfo_opt_strs+923)
  110. /** Name string for the dbug option */
  111. #define DBUG_name (tcpcapinfo_opt_strs+928)
  112. /** The compiled in default value for the dbug option argument */
  113. #define DBUG_DFT_ARG ((char const*)0)
  114. /** Compiled in flag settings for the dbug option */
  115. #define DBUG_FLAGS (OPTST_DISABLED | OPTST_IMM \
  116. | OPTST_SET_ARGTYPE(OPARG_TYPE_NUMERIC))
  117. #else /* disable dbug */
  118. #define DBUG_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  119. #define DBUG_DFT_ARG NULL
  120. #define DBUG_NAME NULL
  121. #define DBUG_DESC NULL
  122. #define DBUG_name NULL
  123. #endif /* DEBUG */
  124. /**
  125. * version option description:
  126. */
  127. /** Descriptive text for the version option */
  128. #define VERSION_DESC (tcpcapinfo_opt_strs+933)
  129. /** Upper-cased name for the version option */
  130. #define VERSION_NAME (tcpcapinfo_opt_strs+959)
  131. /** Name string for the version option */
  132. #define VERSION_name (tcpcapinfo_opt_strs+967)
  133. /** Compiled in flag settings for the version option */
  134. #define VERSION_FLAGS (OPTST_DISABLED)
  135. /*
  136. * Help/More_Help option descriptions:
  137. */
  138. #define HELP_DESC (tcpcapinfo_opt_strs+975)
  139. #define HELP_name (tcpcapinfo_opt_strs+1019)
  140. #ifdef HAVE_WORKING_FORK
  141. #define MORE_HELP_DESC (tcpcapinfo_opt_strs+1024)
  142. #define MORE_HELP_name (tcpcapinfo_opt_strs+1069)
  143. #define MORE_HELP_FLAGS (OPTST_IMM | OPTST_NO_INIT)
  144. #else
  145. #define MORE_HELP_DESC HELP_DESC
  146. #define MORE_HELP_name HELP_name
  147. #define MORE_HELP_FLAGS (OPTST_OMITTED | OPTST_NO_INIT)
  148. #endif
  149. /**
  150. * Declare option callback procedures
  151. */
  152. #ifdef DEBUG
  153. static tOptProc doOptDbug;
  154. #else /* not DEBUG */
  155. # define doOptDbug NULL
  156. #endif /* def/not DEBUG */
  157. extern tOptProc
  158. optionBooleanVal, optionNestedVal, optionNumericVal,
  159. optionPagedUsage, optionPrintVersion, optionResetOpt,
  160. optionStackArg, optionTimeDate, optionTimeVal,
  161. optionUnstackArg, optionVendorOption;
  162. static tOptProc
  163. doOptVersion, doUsageOpt;
  164. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  165. /**
  166. * Define the tcpcapinfo Option Descriptions.
  167. * This is an array of OPTION_CT entries, one for each
  168. * option that the tcpcapinfo program responds to.
  169. */
  170. static tOptDesc optDesc[OPTION_CT] = {
  171. { /* entry idx, value */ 0, VALUE_OPT_DBUG,
  172. /* equiv idx, value */ 0, VALUE_OPT_DBUG,
  173. /* equivalenced to */ NO_EQUIVALENT,
  174. /* min, max, act ct */ 0, 1, 0,
  175. /* opt state flags */ DBUG_FLAGS, 0,
  176. /* last opt argumnt */ { DBUG_DFT_ARG },
  177. /* arg list/cookie */ NULL,
  178. /* must/cannot opts */ NULL, NULL,
  179. /* option proc */ doOptDbug,
  180. /* desc, NAME, name */ DBUG_DESC, DBUG_NAME, DBUG_name,
  181. /* disablement strs */ NULL, NULL },
  182. { /* entry idx, value */ 1, VALUE_OPT_VERSION,
  183. /* equiv idx, value */ 1, VALUE_OPT_VERSION,
  184. /* equivalenced to */ NO_EQUIVALENT,
  185. /* min, max, act ct */ 0, 1, 0,
  186. /* opt state flags */ VERSION_FLAGS, 0,
  187. /* last opt argumnt */ { NULL }, /* --version */
  188. /* arg list/cookie */ NULL,
  189. /* must/cannot opts */ NULL, NULL,
  190. /* option proc */ doOptVersion,
  191. /* desc, NAME, name */ VERSION_DESC, VERSION_NAME, VERSION_name,
  192. /* disablement strs */ NULL, NULL },
  193. { /* entry idx, value */ INDEX_OPT_HELP, VALUE_OPT_HELP,
  194. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_HELP,
  195. /* equivalenced to */ NO_EQUIVALENT,
  196. /* min, max, act ct */ 0, 1, 0,
  197. /* opt state flags */ OPTST_IMM | OPTST_NO_INIT, AOUSE_HELP,
  198. /* last opt argumnt */ { NULL },
  199. /* arg list/cookie */ NULL,
  200. /* must/cannot opts */ NULL, NULL,
  201. /* option proc */ doUsageOpt,
  202. /* desc, NAME, name */ HELP_DESC, NULL, HELP_name,
  203. /* disablement strs */ NULL, NULL },
  204. { /* entry idx, value */ INDEX_OPT_MORE_HELP, VALUE_OPT_MORE_HELP,
  205. /* equiv idx value */ NO_EQUIVALENT, VALUE_OPT_MORE_HELP,
  206. /* equivalenced to */ NO_EQUIVALENT,
  207. /* min, max, act ct */ 0, 1, 0,
  208. /* opt state flags */ MORE_HELP_FLAGS, AOUSE_MORE_HELP,
  209. /* last opt argumnt */ { NULL },
  210. /* arg list/cookie */ NULL,
  211. /* must/cannot opts */ NULL, NULL,
  212. /* option proc */ optionPagedUsage,
  213. /* desc, NAME, name */ MORE_HELP_DESC, NULL, MORE_HELP_name,
  214. /* disablement strs */ NULL, NULL }
  215. };
  216. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  217. /** Reference to the upper cased version of tcpcapinfo. */
  218. #define zPROGNAME (tcpcapinfo_opt_strs+1079)
  219. /** Reference to the title line for tcpcapinfo usage. */
  220. #define zUsageTitle (tcpcapinfo_opt_strs+1090)
  221. /** There is no tcpcapinfo configuration file. */
  222. #define zRcName NULL
  223. /** There are no directories to search for tcpcapinfo config files. */
  224. #define apzHomeList NULL
  225. /** The tcpcapinfo program bug email address. */
  226. #define zBugsAddr (tcpcapinfo_opt_strs+1246)
  227. /** Clarification/explanation of what tcpcapinfo does. */
  228. #define zExplain (tcpcapinfo_opt_strs+1284)
  229. /** Extra detail explaining what tcpcapinfo does. */
  230. #define zDetail (tcpcapinfo_opt_strs+1450)
  231. /** The full version string for tcpcapinfo. */
  232. #define zFullVersion (NULL)
  233. /* extracted from optcode.tlib near line 364 */
  234. #if defined(ENABLE_NLS)
  235. # define OPTPROC_BASE OPTPROC_TRANSLATE
  236. static tOptionXlateProc translate_option_strings;
  237. #else
  238. # define OPTPROC_BASE OPTPROC_NONE
  239. # define translate_option_strings NULL
  240. #endif /* ENABLE_NLS */
  241. #define tcpcapinfo_full_usage (NULL)
  242. #define tcpcapinfo_short_usage (NULL)
  243. #endif /* not defined __doxygen__ */
  244. /*
  245. * Create the static procedure(s) declared above.
  246. */
  247. /**
  248. * The callout function that invokes the optionUsage function.
  249. *
  250. * @param[in] opts the AutoOpts option description structure
  251. * @param[in] od the descriptor for the "help" (usage) option.
  252. * @noreturn
  253. */
  254. static void
  255. doUsageOpt(tOptions * opts, tOptDesc * od)
  256. {
  257. int ex_code;
  258. ex_code = TCPCAPINFO_EXIT_SUCCESS;
  259. optionUsage(&tcpcapinfoOptions, ex_code);
  260. /* NOTREACHED */
  261. exit(TCPCAPINFO_EXIT_FAILURE);
  262. (void)opts;
  263. (void)od;
  264. }
  265. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  266. /**
  267. * Code to handle the dbug option, when DEBUG is #define-d.
  268. * If configured with --enable-debug, then you can specify a verbosity
  269. * level for debugging output. Higher numbers increase verbosity.
  270. * @param[in] pOptions the tcpcapinfo options data structure
  271. * @param[in,out] pOptDesc the option descriptor for this option.
  272. */
  273. #ifdef DEBUG
  274. static void
  275. doOptDbug(tOptions* pOptions, tOptDesc* pOptDesc)
  276. {
  277. static struct {long rmin, rmax;} const rng[1] = {
  278. { 0, 5 } };
  279. int ix;
  280. if (pOptions <= OPTPROC_EMIT_LIMIT)
  281. goto emit_ranges;
  282. optionNumericVal(pOptions, pOptDesc);
  283. for (ix = 0; ix < 1; ix++) {
  284. if (pOptDesc->optArg.argInt < rng[ix].rmin)
  285. continue; /* ranges need not be ordered. */
  286. if (pOptDesc->optArg.argInt == rng[ix].rmin)
  287. return;
  288. if (rng[ix].rmax == LONG_MIN)
  289. continue;
  290. if (pOptDesc->optArg.argInt <= rng[ix].rmax)
  291. return;
  292. }
  293. option_usage_fp = stderr;
  294. emit_ranges:
  295. optionShowRange(pOptions, pOptDesc, VOIDP(rng), 1);
  296. }
  297. #endif /* defined DEBUG */
  298. /* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
  299. /**
  300. * Code to handle the version option.
  301. *
  302. * @param[in] pOptions the tcpcapinfo options data structure
  303. * @param[in,out] pOptDesc the option descriptor for this option.
  304. */
  305. static void
  306. doOptVersion(tOptions* pOptions, tOptDesc* pOptDesc)
  307. {
  308. /*
  309. * Be sure the flag-code[0] handles special values for the options pointer
  310. * viz. (poptions <= OPTPROC_EMIT_LIMIT) *and also* the special flag bit
  311. * ((poptdesc->fOptState & OPTST_RESET) != 0) telling the option to
  312. * reset its state.
  313. */
  314. /* extracted from tcpcapinfo_opts.def, line 99 */
  315. fprintf(stderr, "tcpcapinfo version: %s (build %s)", VERSION, git_version());
  316. #ifdef DEBUG
  317. fprintf(stderr, " (debug)");
  318. #endif
  319. fprintf(stderr, "\n");
  320. fprintf(stderr, "Copyright 2013-2018 by Fred Klassen <tcpreplay at appneta dot com> - AppNeta\n");
  321. fprintf(stderr, "Copyright 2000-2010 by Aaron Turner <aturner at synfin dot net>\n");
  322. fprintf(stderr, "The entire Tcpreplay Suite is licensed under the GPLv3\n");
  323. exit(0);
  324. (void)pOptDesc;
  325. (void)pOptions;
  326. }
  327. /* extracted from optmain.tlib near line 1250 */
  328. /**
  329. * The directory containing the data associated with tcpcapinfo.
  330. */
  331. #ifndef PKGDATADIR
  332. # define PKGDATADIR ""
  333. #endif
  334. /**
  335. * Information about the person or institution that packaged tcpcapinfo
  336. * for the current distribution.
  337. */
  338. #ifndef WITH_PACKAGER
  339. # define tcpcapinfo_packager_info NULL
  340. #else
  341. /** Packager information for tcpcapinfo. */
  342. static char const tcpcapinfo_packager_info[] =
  343. "Packaged by " WITH_PACKAGER
  344. # ifdef WITH_PACKAGER_VERSION
  345. " ("WITH_PACKAGER_VERSION")"
  346. # endif
  347. # ifdef WITH_PACKAGER_BUG_REPORTS
  348. "\nReport tcpcapinfo bugs to " WITH_PACKAGER_BUG_REPORTS
  349. # endif
  350. "\n";
  351. #endif
  352. #ifndef __doxygen__
  353. #endif /* __doxygen__ */
  354. /**
  355. * The option definitions for tcpcapinfo. The one structure that
  356. * binds them all.
  357. */
  358. tOptions tcpcapinfoOptions = {
  359. OPTIONS_STRUCT_VERSION,
  360. 0, NULL, /* original argc + argv */
  361. ( OPTPROC_BASE
  362. + OPTPROC_ERRSTOP
  363. + OPTPROC_SHORTOPT
  364. + OPTPROC_LONGOPT
  365. + OPTPROC_NO_REQ_OPT
  366. + OPTPROC_ARGS_REQ
  367. + OPTPROC_GNUUSAGE ),
  368. 0, NULL, /* current option index, current option */
  369. NULL, NULL, zPROGNAME,
  370. zRcName, zCopyright, zLicenseDescrip,
  371. zFullVersion, apzHomeList, zUsageTitle,
  372. zExplain, zDetail, optDesc,
  373. zBugsAddr, /* address to send bugs to */
  374. NULL, NULL, /* extensions/saved state */
  375. optionUsage, /* usage procedure */
  376. translate_option_strings, /* translation procedure */
  377. /*
  378. * Indexes to special options
  379. */
  380. { INDEX_OPT_MORE_HELP, /* more-help option index */
  381. NO_EQUIVALENT, /* save option index */
  382. NO_EQUIVALENT, /* '-#' option index */
  383. NO_EQUIVALENT /* index of default opt */
  384. },
  385. 4 /* full option count */, 2 /* user option count */,
  386. tcpcapinfo_full_usage, tcpcapinfo_short_usage,
  387. NULL, NULL,
  388. PKGDATADIR, tcpcapinfo_packager_info
  389. };
  390. #if ENABLE_NLS
  391. /**
  392. * This code is designed to translate translatable option text for the
  393. * tcpcapinfo program. These translations happen upon entry
  394. * to optionProcess().
  395. */
  396. #include <stdio.h>
  397. #include <stdlib.h>
  398. #include <string.h>
  399. #include <unistd.h>
  400. #ifdef HAVE_DCGETTEXT
  401. # include <gettext.h>
  402. #endif
  403. #include <autoopts/usage-txt.h>
  404. static char * AO_gettext(char const * pz);
  405. static void coerce_it(void ** s);
  406. /**
  407. * AutoGen specific wrapper function for gettext. It relies on the macro _()
  408. * to convert from English to the target language, then strdup-duplicates the
  409. * result string. It tries the "libopts" domain first, then whatever has been
  410. * set via the \a textdomain(3) call.
  411. *
  412. * @param[in] pz the input text used as a lookup key.
  413. * @returns the translated text (if there is one),
  414. * or the original text (if not).
  415. */
  416. static char *
  417. AO_gettext(char const * pz)
  418. {
  419. char * res;
  420. if (pz == NULL)
  421. return NULL;
  422. #ifdef HAVE_DCGETTEXT
  423. /*
  424. * While processing the option_xlateable_txt data, try to use the
  425. * "libopts" domain. Once we switch to the option descriptor data,
  426. * do *not* use that domain.
  427. */
  428. if (option_xlateable_txt.field_ct != 0) {
  429. res = dgettext("libopts", pz);
  430. if (res == pz)
  431. res = (char *)VOIDP(_(pz));
  432. } else
  433. res = (char *)VOIDP(_(pz));
  434. #else
  435. res = (char *)VOIDP(_(pz));
  436. #endif
  437. if (res == pz)
  438. return res;
  439. res = strdup(res);
  440. if (res == NULL) {
  441. fputs(_("No memory for duping translated strings\n"), stderr);
  442. exit(TCPCAPINFO_EXIT_FAILURE);
  443. }
  444. return res;
  445. }
  446. /**
  447. * All the pointers we use are marked "* const", but they are stored in
  448. * writable memory. Coerce the mutability and set the pointer.
  449. */
  450. static void coerce_it(void ** s) { *s = AO_gettext(*s);
  451. }
  452. /**
  453. * Translate all the translatable strings in the tcpcapinfoOptions
  454. * structure defined above. This is done only once.
  455. */
  456. static void
  457. translate_option_strings(void)
  458. {
  459. tOptions * const opts = &tcpcapinfoOptions;
  460. /*
  461. * Guard against re-translation. It won't work. The strings will have
  462. * been changed by the first pass through this code. One shot only.
  463. */
  464. if (option_xlateable_txt.field_ct != 0) {
  465. /*
  466. * Do the translations. The first pointer follows the field count
  467. * field. The field count field is the size of a pointer.
  468. */
  469. char ** ppz = (char**)VOIDP(&(option_xlateable_txt));
  470. int ix = option_xlateable_txt.field_ct;
  471. do {
  472. ppz++; /* skip over field_ct */
  473. *ppz = AO_gettext(*ppz);
  474. } while (--ix > 0);
  475. /* prevent re-translation and disable "libopts" domain lookup */
  476. option_xlateable_txt.field_ct = 0;
  477. coerce_it(VOIDP(&(opts->pzCopyright)));
  478. coerce_it(VOIDP(&(opts->pzCopyNotice)));
  479. coerce_it(VOIDP(&(opts->pzFullVersion)));
  480. coerce_it(VOIDP(&(opts->pzUsageTitle)));
  481. coerce_it(VOIDP(&(opts->pzExplain)));
  482. coerce_it(VOIDP(&(opts->pzDetail)));
  483. {
  484. tOptDesc * od = opts->pOptDesc;
  485. for (ix = opts->optCt; ix > 0; ix--, od++)
  486. coerce_it(VOIDP(&(od->pzText)));
  487. }
  488. }
  489. }
  490. #endif /* ENABLE_NLS */
  491. #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
  492. /** I18N function strictly for xgettext. Do not compile. */
  493. static void bogus_function(void) {
  494. /* TRANSLATORS:
  495. The following dummy function was crated solely so that xgettext can
  496. extract the correct strings. These strings are actually referenced
  497. by a field name in the tcpcapinfoOptions structure noted in the
  498. comments below. The literal text is defined in tcpcapinfo_opt_strs.
  499. NOTE: the strings below are segmented with respect to the source string
  500. tcpcapinfo_opt_strs. The strings above are handed off for translation
  501. at run time a paragraph at a time. Consequently, they are presented here
  502. for translation a paragraph at a time.
  503. ALSO: often the description for an option will reference another option
  504. by name. These are set off with apostrophe quotes (I hope). Do not
  505. translate option names.
  506. */
  507. /* referenced via tcpcapinfoOptions.pzCopyright */
  508. puts(_("tcpcapinfo (Tcpreplay Suite)\n\
  509. Copyright (C) 2000-2012 Aaron Turner and Fred Klassen, all rights reserved.\n\
  510. This is free software. It is licensed for use, modification and\n\
  511. redistribution under the terms of the GNU General Public License,\n\
  512. version 3 or later <http://gnu.org/licenses/gpl.html>\n"));
  513. /* referenced via tcpcapinfoOptions.pzCopyNotice */
  514. puts(_("tcpcapinfo is free software: you can redistribute it and/or modify it under\n\
  515. the terms of the GNU General Public License as published by the Free\n\
  516. Software Foundation, either version 3 of the License, or (at your option)\n\
  517. any later version.\n\n"));
  518. puts(_("tcpcapinfo is distributed in the hope that it will be useful, but WITHOUT\n\
  519. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\
  520. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n\
  521. more details.\n\n"));
  522. puts(_("You should have received a copy of the GNU General Public License along\n\
  523. with this program. If not, see <http://www.gnu.org/licenses/>.\n"));
  524. /* referenced via tcpcapinfoOptions.pOptDesc->pzText */
  525. puts(_("Enable debugging output"));
  526. /* referenced via tcpcapinfoOptions.pOptDesc->pzText */
  527. puts(_("Print version information"));
  528. /* referenced via tcpcapinfoOptions.pOptDesc->pzText */
  529. puts(_("display extended usage information and exit"));
  530. /* referenced via tcpcapinfoOptions.pOptDesc->pzText */
  531. puts(_("extended usage information passed thru pager"));
  532. /* referenced via tcpcapinfoOptions.pzUsageTitle */
  533. puts(_("tcpcapinfo (Tcpreplay Suite) - Pcap file dissector for debugging broken pcap files\n\
  534. Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <pcap_file(s)>\n"));
  535. /* referenced via tcpcapinfoOptions.pzExplain */
  536. puts(_("tcpcapinfo is a tool for decoding the structure of a pcap(3) file with a\n\
  537. focus on finding broken pcap files and determining how two related pcap\n\
  538. files might differ.\n"));
  539. /* referenced via tcpcapinfoOptions.pzDetail */
  540. puts(_("tcpcapinfo will first print out the pcap_file_header_t in human readable\n\
  541. form followed by a per-packet summary including the pcap_pkthdr_t and\n\
  542. simple checksum value of the packet.\n"));
  543. /* referenced via tcpcapinfoOptions.pzFullUsage */
  544. puts(_("<<<NOT-FOUND>>>"));
  545. /* referenced via tcpcapinfoOptions.pzShortUsage */
  546. puts(_("<<<NOT-FOUND>>>"));
  547. /* LIBOPTS-MESSAGES: */
  548. #line 67 "../autoopts.c"
  549. puts(_("allocation of %d bytes failed\n"));
  550. #line 93 "../autoopts.c"
  551. puts(_("allocation of %d bytes failed\n"));
  552. #line 53 "../init.c"
  553. puts(_("AutoOpts function called without option descriptor\n"));
  554. #line 86 "../init.c"
  555. puts(_("\tThis exceeds the compiled library version: "));
  556. #line 84 "../init.c"
  557. puts(_("Automated Options Processing Error!\n"
  558. "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
  559. #line 80 "../autoopts.c"
  560. puts(_("realloc of %d bytes at 0x%p failed\n"));
  561. #line 88 "../init.c"
  562. puts(_("\tThis is less than the minimum library version: "));
  563. #line 121 "../version.c"
  564. puts(_("Automated Options version %s\n"
  565. "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
  566. #line 87 "../makeshell.c"
  567. puts(_("(AutoOpts bug): %s.\n"));
  568. #line 90 "../reset.c"
  569. puts(_("optionResetOpt() called, but reset-option not configured"));
  570. #line 295 "../usage.c"
  571. puts(_("could not locate the 'help' option"));
  572. #line 336 "../autoopts.c"
  573. puts(_("optionProcess() was called with invalid data"));
  574. #line 751 "../usage.c"
  575. puts(_("invalid argument type specified"));
  576. #line 598 "../find.c"
  577. puts(_("defaulted to option with optional arg"));
  578. #line 76 "../alias.c"
  579. puts(_("aliasing option is out of range."));
  580. #line 235 "../enum.c"
  581. puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
  582. #line 108 "../find.c"
  583. puts(_(" The following options match:\n"));
  584. #line 293 "../find.c"
  585. puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
  586. #line 161 "../check.c"
  587. puts(_("%s: Command line arguments required\n"));
  588. #line 43 "../alias.c"
  589. puts(_("%d %s%s options allowed\n"));
  590. #line 94 "../makeshell.c"
  591. puts(_("%s error %d (%s) calling %s for '%s'\n"));
  592. #line 306 "../makeshell.c"
  593. puts(_("interprocess pipe"));
  594. #line 168 "../version.c"
  595. puts(_("error: version option argument '%c' invalid. Use:\n"
  596. "\t'v' - version only\n"
  597. "\t'c' - version and copyright\n"
  598. "\t'n' - version and full copyright notice\n"));
  599. #line 58 "../check.c"
  600. puts(_("%s error: the '%s' and '%s' options conflict\n"));
  601. #line 217 "../find.c"
  602. puts(_("%s: The '%s' option has been disabled."));
  603. #line 430 "../find.c"
  604. puts(_("%s: The '%s' option has been disabled."));
  605. #line 38 "../alias.c"
  606. puts(_("-equivalence"));
  607. #line 469 "../find.c"
  608. puts(_("%s: illegal option -- %c\n"));
  609. #line 110 "../reset.c"
  610. puts(_("%s: illegal option -- %c\n"));
  611. #line 271 "../find.c"
  612. puts(_("%s: illegal option -- %s\n"));
  613. #line 755 "../find.c"
  614. puts(_("%s: illegal option -- %s\n"));
  615. #line 118 "../reset.c"
  616. puts(_("%s: illegal option -- %s\n"));
  617. #line 335 "../find.c"
  618. puts(_("%s: unknown vendor extension option -- %s\n"));
  619. #line 160 "../enum.c"
  620. puts(_(" or an integer from %d through %d\n"));
  621. #line 170 "../enum.c"
  622. puts(_(" or an integer from %d through %d\n"));
  623. #line 750 "../usage.c"
  624. puts(_("%s error: invalid option descriptor for %s\n"));
  625. #line 1084 "../usage.c"
  626. puts(_("%s error: invalid option descriptor for %s\n"));
  627. #line 385 "../find.c"
  628. puts(_("%s: invalid option name: %s\n"));
  629. #line 527 "../find.c"
  630. puts(_("%s: The '%s' option requires an argument.\n"));
  631. #line 156 "../autoopts.c"
  632. puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
  633. "\t'%s' and '%s'."));
  634. #line 94 "../check.c"
  635. puts(_("%s error: The %s option is required\n"));
  636. #line 632 "../find.c"
  637. puts(_("%s: The '%s' option cannot have an argument.\n"));
  638. #line 151 "../check.c"
  639. puts(_("%s: Command line arguments are not allowed.\n"));
  640. #line 536 "../save.c"
  641. puts(_("error %d (%s) creating %s\n"));
  642. #line 235 "../enum.c"
  643. puts(_("%s error: '%s' does not match any %s keywords.\n"));
  644. #line 93 "../reset.c"
  645. puts(_("%s error: The '%s' option requires an argument.\n"));
  646. #line 186 "../save.c"
  647. puts(_("error %d (%s) stat-ing %s\n"));
  648. #line 239 "../save.c"
  649. puts(_("error %d (%s) stat-ing %s\n"));
  650. #line 143 "../restore.c"
  651. puts(_("%s error: no saved option state\n"));
  652. #line 231 "../autoopts.c"
  653. puts(_("'%s' is not a command line option.\n"));
  654. #line 113 "../time.c"
  655. puts(_("%s error: '%s' is not a recognizable date/time.\n"));
  656. #line 131 "../save.c"
  657. puts(_("'%s' not defined\n"));
  658. #line 50 "../time.c"
  659. puts(_("%s error: '%s' is not a recognizable time duration.\n"));
  660. #line 92 "../check.c"
  661. puts(_("%s error: The %s option must appear %d times.\n"));
  662. #line 165 "../numeric.c"
  663. puts(_("%s error: '%s' is not a recognizable number.\n"));
  664. #line 201 "../enum.c"
  665. puts(_("%s error: %s exceeds %s keyword count\n"));
  666. #line 333 "../usage.c"
  667. puts(_("Try '%s %s' for more information.\n"));
  668. #line 45 "../alias.c"
  669. puts(_("one %s%s option allowed\n"));
  670. #line 208 "../makeshell.c"
  671. puts(_("standard output"));
  672. #line 943 "../makeshell.c"
  673. puts(_("standard output"));
  674. #line 277 "../usage.c"
  675. puts(_("standard output"));
  676. #line 418 "../usage.c"
  677. puts(_("standard output"));
  678. #line 628 "../usage.c"
  679. puts(_("standard output"));
  680. #line 175 "../version.c"
  681. puts(_("standard output"));
  682. #line 277 "../usage.c"
  683. puts(_("standard error"));
  684. #line 418 "../usage.c"
  685. puts(_("standard error"));
  686. #line 628 "../usage.c"
  687. puts(_("standard error"));
  688. #line 175 "../version.c"
  689. puts(_("standard error"));
  690. #line 208 "../makeshell.c"
  691. puts(_("write"));
  692. #line 943 "../makeshell.c"
  693. puts(_("write"));
  694. #line 276 "../usage.c"
  695. puts(_("write"));
  696. #line 417 "../usage.c"
  697. puts(_("write"));
  698. #line 627 "../usage.c"
  699. puts(_("write"));
  700. #line 174 "../version.c"
  701. puts(_("write"));
  702. #line 60 "../numeric.c"
  703. puts(_("%s error: %s option value %ld is out of range.\n"));
  704. #line 44 "../check.c"
  705. puts(_("%s error: %s option requires the %s option\n"));
  706. #line 130 "../save.c"
  707. puts(_("%s warning: cannot save options - %s not regular file\n"));
  708. #line 185 "../save.c"
  709. puts(_("%s warning: cannot save options - %s not regular file\n"));
  710. #line 238 "../save.c"
  711. puts(_("%s warning: cannot save options - %s not regular file\n"));
  712. #line 257 "../save.c"
  713. puts(_("%s warning: cannot save options - %s not regular file\n"));
  714. #line 535 "../save.c"
  715. puts(_("%s warning: cannot save options - %s not regular file\n"));
  716. /* END-LIBOPTS-MESSAGES */
  717. /* USAGE-TEXT: */
  718. #line 876 "../usage.c"
  719. puts(_("\t\t\t\t- an alternate for '%s'\n"));
  720. #line 1151 "../usage.c"
  721. puts(_("Version, usage and configuration options:"));
  722. #line 927 "../usage.c"
  723. puts(_("\t\t\t\t- default option for unnamed options\n"));
  724. #line 840 "../usage.c"
  725. puts(_("\t\t\t\t- disabled as '--%s'\n"));
  726. #line 1120 "../usage.c"
  727. puts(_(" --- %-14s %s\n"));
  728. #line 1118 "../usage.c"
  729. puts(_("This option has been disabled"));
  730. #line 867 "../usage.c"
  731. puts(_("\t\t\t\t- enabled by default\n"));
  732. #line 40 "../alias.c"
  733. puts(_("%s error: only "));
  734. #line 1197 "../usage.c"
  735. puts(_(" - examining environment variables named %s_*\n"));
  736. #line 168 "../file.c"
  737. puts(_("\t\t\t\t- file must not pre-exist\n"));
  738. #line 172 "../file.c"
  739. puts(_("\t\t\t\t- file must pre-exist\n"));
  740. #line 383 "../usage.c"
  741. puts(_("Options are specified by doubled hyphens and their name or by a single\n"
  742. "hyphen and the flag character.\n"));
  743. #line 921 "../makeshell.c"
  744. puts(_("\n"
  745. "= = = = = = = =\n\n"
  746. "This incarnation of genshell will produce\n"
  747. "a shell script to parse the options for %s:\n\n"));
  748. #line 167 "../enum.c"
  749. puts(_(" or an integer mask with any of the lower %d bits set\n"));
  750. #line 900 "../usage.c"
  751. puts(_("\t\t\t\t- is a set membership option\n"));
  752. #line 921 "../usage.c"
  753. puts(_("\t\t\t\t- must appear between %d and %d times\n"));
  754. #line 385 "../usage.c"
  755. puts(_("Options are specified by single or double hyphens and their name.\n"));
  756. #line 907 "../usage.c"
  757. puts(_("\t\t\t\t- may appear multiple times\n"));
  758. #line 894 "../usage.c"
  759. puts(_("\t\t\t\t- may not be preset\n"));
  760. #line 1312 "../usage.c"
  761. puts(_(" Arg Option-Name Description\n"));
  762. #line 1248 "../usage.c"
  763. puts(_(" Flg Arg Option-Name Description\n"));
  764. #line 1306 "../usage.c"
  765. puts(_(" Flg Arg Option-Name Description\n"));
  766. #line 1307 "../usage.c"
  767. puts(_(" %3s %s"));
  768. #line 1313 "../usage.c"
  769. puts(_(" %3s %s"));
  770. #line 390 "../usage.c"
  771. puts(_("The '-#<number>' option may omit the hash char\n"));
  772. #line 386 "../usage.c"
  773. puts(_("All arguments are named options.\n"));
  774. #line 974 "../usage.c"
  775. puts(_(" - reading file %s"));
  776. #line 412 "../usage.c"
  777. puts(_("\n"
  778. "Please send bug reports to: <%s>\n"));
  779. #line 100 "../version.c"
  780. puts(_("\n"
  781. "Please send bug reports to: <%s>\n"));
  782. #line 129 "../version.c"
  783. puts(_("\n"
  784. "Please send bug reports to: <%s>\n"));
  785. #line 906 "../usage.c"
  786. puts(_("\t\t\t\t- may NOT appear - preset only\n"));
  787. #line 947 "../usage.c"
  788. puts(_("\n"
  789. "The following option preset mechanisms are supported:\n"));
  790. #line 1195 "../usage.c"
  791. puts(_("\n"
  792. "The following option preset mechanisms are supported:\n"));
  793. #line 685 "../usage.c"
  794. puts(_("prohibits these options:\n"));
  795. #line 680 "../usage.c"
  796. puts(_("prohibits the option '%s'\n"));
  797. #line 81 "../numeric.c"
  798. puts(_("%s%ld to %ld"));
  799. #line 79 "../numeric.c"
  800. puts(_("%sgreater than or equal to %ld"));
  801. #line 75 "../numeric.c"
  802. puts(_("%s%ld exactly"));
  803. #line 68 "../numeric.c"
  804. puts(_("%sit must lie in one of the ranges:\n"));
  805. #line 68 "../numeric.c"
  806. puts(_("%sit must be in the range:\n"));
  807. #line 88 "../numeric.c"
  808. puts(_(", or\n"));
  809. #line 66 "../numeric.c"
  810. puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
  811. #line 77 "../numeric.c"
  812. puts(_("%sless than or equal to %ld"));
  813. #line 393 "../usage.c"
  814. puts(_("Operands and options may be intermixed. They will be reordered.\n"));
  815. #line 655 "../usage.c"
  816. puts(_("requires the option '%s'\n"));
  817. #line 658 "../usage.c"
  818. puts(_("requires these options:\n"));
  819. #line 1324 "../usage.c"
  820. puts(_(" Arg Option-Name Req? Description\n"));
  821. #line 1318 "../usage.c"
  822. puts(_(" Flg Arg Option-Name Req? Description\n"));
  823. #line 168 "../enum.c"
  824. puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
  825. "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
  826. "will set them all. Multiple entries may be passed as an option\n"
  827. "argument list.\n"));
  828. #line 913 "../usage.c"
  829. puts(_("\t\t\t\t- may appear up to %d times\n"));
  830. #line 77 "../enum.c"
  831. puts(_("The valid \"%s\" option keywords are:\n"));
  832. #line 1155 "../usage.c"
  833. puts(_("The next option supports vendor supported extra options:"));
  834. #line 776 "../usage.c"
  835. puts(_("These additional options are:"));
  836. /* END-USAGE-TEXT */
  837. }
  838. #endif /* uncompilable code */
  839. #ifdef __cplusplus
  840. }
  841. #endif
  842. /* tcpcapinfo_opts.c ends here */