tcpcapinfo_opts.c 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898
  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:0:16 templates.
  10. *
  11. * AutoOpts is a copyrighted work. This source file is not encumbered
  12. * by AutoOpts licensing, but is provided under the licensing terms chosen
  13. * by the 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(1);
  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, (void *)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 2000-2010 by Aaron Turner <aturner at synfin dot net>\n");
  321. fprintf(stderr, "The entire Tcpreplay Suite is licensed under the GPLv3\n");
  322. exit(0);
  323. (void)pOptDesc;
  324. (void)pOptions;
  325. }
  326. /* extracted from optmain.tlib near line 1245 */
  327. /**
  328. * The directory containing the data associated with tcpcapinfo.
  329. */
  330. #ifndef PKGDATADIR
  331. # define PKGDATADIR ""
  332. #endif
  333. /**
  334. * Information about the person or institution that packaged tcpcapinfo
  335. * for the current distribution.
  336. */
  337. #ifndef WITH_PACKAGER
  338. # define tcpcapinfo_packager_info NULL
  339. #else
  340. /** Packager information for tcpcapinfo. */
  341. static char const tcpcapinfo_packager_info[] =
  342. "Packaged by " WITH_PACKAGER
  343. # ifdef WITH_PACKAGER_VERSION
  344. " ("WITH_PACKAGER_VERSION")"
  345. # endif
  346. # ifdef WITH_PACKAGER_BUG_REPORTS
  347. "\nReport tcpcapinfo bugs to " WITH_PACKAGER_BUG_REPORTS
  348. # endif
  349. "\n";
  350. #endif
  351. #ifndef __doxygen__
  352. #endif /* __doxygen__ */
  353. /**
  354. * The option definitions for tcpcapinfo. The one structure that
  355. * binds them all.
  356. */
  357. tOptions tcpcapinfoOptions = {
  358. OPTIONS_STRUCT_VERSION,
  359. 0, NULL, /* original argc + argv */
  360. ( OPTPROC_BASE
  361. + OPTPROC_ERRSTOP
  362. + OPTPROC_SHORTOPT
  363. + OPTPROC_LONGOPT
  364. + OPTPROC_NO_REQ_OPT
  365. + OPTPROC_ARGS_REQ
  366. + OPTPROC_GNUUSAGE ),
  367. 0, NULL, /* current option index, current option */
  368. NULL, NULL, zPROGNAME,
  369. zRcName, zCopyright, zLicenseDescrip,
  370. zFullVersion, apzHomeList, zUsageTitle,
  371. zExplain, zDetail, optDesc,
  372. zBugsAddr, /* address to send bugs to */
  373. NULL, NULL, /* extensions/saved state */
  374. optionUsage, /* usage procedure */
  375. translate_option_strings, /* translation procedure */
  376. /*
  377. * Indexes to special options
  378. */
  379. { INDEX_OPT_MORE_HELP, /* more-help option index */
  380. NO_EQUIVALENT, /* save option index */
  381. NO_EQUIVALENT, /* '-#' option index */
  382. NO_EQUIVALENT /* index of default opt */
  383. },
  384. 4 /* full option count */, 2 /* user option count */,
  385. tcpcapinfo_full_usage, tcpcapinfo_short_usage,
  386. NULL, NULL,
  387. PKGDATADIR, tcpcapinfo_packager_info
  388. };
  389. #if ENABLE_NLS
  390. /**
  391. * This code is designed to translate translatable option text for the
  392. * tcpcapinfo program. These translations happen upon entry
  393. * to optionProcess().
  394. */
  395. #include <stdio.h>
  396. #include <stdlib.h>
  397. #include <string.h>
  398. #include <unistd.h>
  399. #ifdef HAVE_DCGETTEXT
  400. # include <gettext.h>
  401. #endif
  402. #include <autoopts/usage-txt.h>
  403. static char * AO_gettext(char const * pz);
  404. static void coerce_it(void ** s);
  405. /**
  406. * AutoGen specific wrapper function for gettext. It relies on the macro _()
  407. * to convert from English to the target language, then strdup-duplicates the
  408. * result string. It tries the "libopts" domain first, then whatever has been
  409. * set via the \a textdomain(3) call.
  410. *
  411. * @param[in] pz the input text used as a lookup key.
  412. * @returns the translated text (if there is one),
  413. * or the original text (if not).
  414. */
  415. static char *
  416. AO_gettext(char const * pz)
  417. {
  418. char * res;
  419. if (pz == NULL)
  420. return NULL;
  421. #ifdef HAVE_DCGETTEXT
  422. /*
  423. * While processing the option_xlateable_txt data, try to use the
  424. * "libopts" domain. Once we switch to the option descriptor data,
  425. * do *not* use that domain.
  426. */
  427. if (option_xlateable_txt.field_ct != 0) {
  428. res = dgettext("libopts", pz);
  429. if (res == pz)
  430. res = (char *)(void *)_(pz);
  431. } else
  432. res = (char *)(void *)_(pz);
  433. #else
  434. res = (char *)(void *)_(pz);
  435. #endif
  436. if (res == pz)
  437. return res;
  438. res = strdup(res);
  439. if (res == NULL) {
  440. fputs(_("No memory for duping translated strings\n"), stderr);
  441. exit(TCPCAPINFO_EXIT_FAILURE);
  442. }
  443. return res;
  444. }
  445. /**
  446. * All the pointers we use are marked "* const", but they are stored in
  447. * writable memory. Coerce the mutability and set the pointer.
  448. */
  449. static void coerce_it(void ** s) { *s = AO_gettext(*s);
  450. }
  451. /**
  452. * Translate all the translatable strings in the tcpcapinfoOptions
  453. * structure defined above. This is done only once.
  454. */
  455. static void
  456. translate_option_strings(void)
  457. {
  458. tOptions * const opts = &tcpcapinfoOptions;
  459. /*
  460. * Guard against re-translation. It won't work. The strings will have
  461. * been changed by the first pass through this code. One shot only.
  462. */
  463. if (option_xlateable_txt.field_ct != 0) {
  464. /*
  465. * Do the translations. The first pointer follows the field count
  466. * field. The field count field is the size of a pointer.
  467. */
  468. char ** ppz = (char**)(void*)&(option_xlateable_txt);
  469. int ix = option_xlateable_txt.field_ct;
  470. do {
  471. ppz++; /* skip over field_ct */
  472. *ppz = AO_gettext(*ppz);
  473. } while (--ix > 0);
  474. /* prevent re-translation and disable "libopts" domain lookup */
  475. option_xlateable_txt.field_ct = 0;
  476. coerce_it((void*)&(opts->pzCopyright));
  477. coerce_it((void*)&(opts->pzCopyNotice));
  478. coerce_it((void*)&(opts->pzFullVersion));
  479. coerce_it((void*)&(opts->pzUsageTitle));
  480. coerce_it((void*)&(opts->pzExplain));
  481. coerce_it((void*)&(opts->pzDetail));
  482. {
  483. tOptDesc * od = opts->pOptDesc;
  484. for (ix = opts->optCt; ix > 0; ix--, od++)
  485. coerce_it((void*)&(od->pzText));
  486. }
  487. }
  488. }
  489. #endif /* ENABLE_NLS */
  490. #ifdef DO_NOT_COMPILE_THIS_CODE_IT_IS_FOR_GETTEXT
  491. /** I18N function strictly for xgettext. Do not compile. */
  492. static void bogus_function(void) {
  493. /* TRANSLATORS:
  494. The following dummy function was crated solely so that xgettext can
  495. extract the correct strings. These strings are actually referenced
  496. by a field name in the tcpcapinfoOptions structure noted in the
  497. comments below. The literal text is defined in tcpcapinfo_opt_strs.
  498. NOTE: the strings below are segmented with respect to the source string
  499. tcpcapinfo_opt_strs. The strings above are handed off for translation
  500. at run time a paragraph at a time. Consequently, they are presented here
  501. for translation a paragraph at a time.
  502. ALSO: often the description for an option will reference another option
  503. by name. These are set off with apostrophe quotes (I hope). Do not
  504. translate option names.
  505. */
  506. /* referenced via tcpcapinfoOptions.pzCopyright */
  507. puts(_("tcpcapinfo (Tcpreplay Suite)\n\
  508. Copyright (C) 2000-2012 Aaron Turner and Fred Klassen, all rights reserved.\n\
  509. This is free software. It is licensed for use, modification and\n\
  510. redistribution under the terms of the GNU General Public License,\n\
  511. version 3 or later <http://gnu.org/licenses/gpl.html>\n"));
  512. /* referenced via tcpcapinfoOptions.pzCopyNotice */
  513. puts(_("tcpcapinfo is free software: you can redistribute it and/or modify it under\n\
  514. the terms of the GNU General Public License as published by the Free\n\
  515. Software Foundation, either version 3 of the License, or (at your option)\n\
  516. any later version.\n\n"));
  517. puts(_("tcpcapinfo is distributed in the hope that it will be useful, but WITHOUT\n\
  518. ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or\n\
  519. FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for\n\
  520. more details.\n\n"));
  521. puts(_("You should have received a copy of the GNU General Public License along\n\
  522. with this program. If not, see <http://www.gnu.org/licenses/>.\n"));
  523. /* referenced via tcpcapinfoOptions.pOptDesc->pzText */
  524. puts(_("Enable debugging output"));
  525. /* referenced via tcpcapinfoOptions.pOptDesc->pzText */
  526. puts(_("Print version information"));
  527. /* referenced via tcpcapinfoOptions.pOptDesc->pzText */
  528. puts(_("display extended usage information and exit"));
  529. /* referenced via tcpcapinfoOptions.pOptDesc->pzText */
  530. puts(_("extended usage information passed thru pager"));
  531. /* referenced via tcpcapinfoOptions.pzUsageTitle */
  532. puts(_("tcpcapinfo (Tcpreplay Suite) - Pcap file dissector for debugging broken pcap files\n\
  533. Usage: %s [ -<flag> [<val>] | --<name>[{=| }<val>] ]... <pcap_file(s)>\n"));
  534. /* referenced via tcpcapinfoOptions.pzExplain */
  535. puts(_("tcpcapinfo is a tool for decoding the structure of a pcap(3) file with a\n\
  536. focus on finding broken pcap files and determining how two related pcap\n\
  537. files might differ.\n"));
  538. /* referenced via tcpcapinfoOptions.pzDetail */
  539. puts(_("tcpcapinfo will first print out the pcap_file_header_t in human readable\n\
  540. form followed by a per-packet summary including the pcap_pkthdr_t and\n\
  541. simple checksum value of the packet.\n"));
  542. /* referenced via tcpcapinfoOptions.pzFullUsage */
  543. puts(_("<<<NOT-FOUND>>>"));
  544. /* referenced via tcpcapinfoOptions.pzShortUsage */
  545. puts(_("<<<NOT-FOUND>>>"));
  546. /* LIBOPTS-MESSAGES: */
  547. #line 67 "../autoopts.c"
  548. puts(_("allocation of %d bytes failed\n"));
  549. #line 93 "../autoopts.c"
  550. puts(_("allocation of %d bytes failed\n"));
  551. #line 53 "../init.c"
  552. puts(_("AutoOpts function called without option descriptor\n"));
  553. #line 90 "../init.c"
  554. puts(_("\tThis exceeds the compiled library version: "));
  555. #line 88 "../init.c"
  556. puts(_("Automated Options Processing Error!\n"
  557. "\t%s called AutoOpts function with structure version %d:%d:%d.\n"));
  558. #line 80 "../autoopts.c"
  559. puts(_("realloc of %d bytes at 0x%p failed\n"));
  560. #line 92 "../init.c"
  561. puts(_("\tThis is less than the minimum library version: "));
  562. #line 121 "../version.c"
  563. puts(_("Automated Options version %s\n"
  564. "\tCopyright (C) 1999-2014 by Bruce Korb - all rights reserved\n"));
  565. #line 82 "../makeshell.c"
  566. puts(_("(AutoOpts bug): %s.\n"));
  567. #line 90 "../reset.c"
  568. puts(_("optionResetOpt() called, but reset-option not configured"));
  569. #line 292 "../usage.c"
  570. puts(_("could not locate the 'help' option"));
  571. #line 336 "../autoopts.c"
  572. puts(_("optionProcess() was called with invalid data"));
  573. #line 748 "../usage.c"
  574. puts(_("invalid argument type specified"));
  575. #line 598 "../find.c"
  576. puts(_("defaulted to option with optional arg"));
  577. #line 76 "../alias.c"
  578. puts(_("aliasing option is out of range."));
  579. #line 234 "../enum.c"
  580. puts(_("%s error: the keyword '%s' is ambiguous for %s\n"));
  581. #line 108 "../find.c"
  582. puts(_(" The following options match:\n"));
  583. #line 293 "../find.c"
  584. puts(_("%s: ambiguous option name: %s (matches %d options)\n"));
  585. #line 161 "../check.c"
  586. puts(_("%s: Command line arguments required\n"));
  587. #line 43 "../alias.c"
  588. puts(_("%d %s%s options allowed\n"));
  589. #line 89 "../makeshell.c"
  590. puts(_("%s error %d (%s) calling %s for '%s'\n"));
  591. #line 301 "../makeshell.c"
  592. puts(_("interprocess pipe"));
  593. #line 168 "../version.c"
  594. puts(_("error: version option argument '%c' invalid. Use:\n"
  595. "\t'v' - version only\n"
  596. "\t'c' - version and copyright\n"
  597. "\t'n' - version and full copyright notice\n"));
  598. #line 58 "../check.c"
  599. puts(_("%s error: the '%s' and '%s' options conflict\n"));
  600. #line 217 "../find.c"
  601. puts(_("%s: The '%s' option has been disabled."));
  602. #line 430 "../find.c"
  603. puts(_("%s: The '%s' option has been disabled."));
  604. #line 38 "../alias.c"
  605. puts(_("-equivalence"));
  606. #line 469 "../find.c"
  607. puts(_("%s: illegal option -- %c\n"));
  608. #line 110 "../reset.c"
  609. puts(_("%s: illegal option -- %c\n"));
  610. #line 271 "../find.c"
  611. puts(_("%s: illegal option -- %s\n"));
  612. #line 755 "../find.c"
  613. puts(_("%s: illegal option -- %s\n"));
  614. #line 118 "../reset.c"
  615. puts(_("%s: illegal option -- %s\n"));
  616. #line 335 "../find.c"
  617. puts(_("%s: unknown vendor extension option -- %s\n"));
  618. #line 159 "../enum.c"
  619. puts(_(" or an integer from %d through %d\n"));
  620. #line 169 "../enum.c"
  621. puts(_(" or an integer from %d through %d\n"));
  622. #line 747 "../usage.c"
  623. puts(_("%s error: invalid option descriptor for %s\n"));
  624. #line 1081 "../usage.c"
  625. puts(_("%s error: invalid option descriptor for %s\n"));
  626. #line 385 "../find.c"
  627. puts(_("%s: invalid option name: %s\n"));
  628. #line 527 "../find.c"
  629. puts(_("%s: The '%s' option requires an argument.\n"));
  630. #line 156 "../autoopts.c"
  631. puts(_("(AutoOpts bug): Equivalenced option '%s' was equivalenced to both\n"
  632. "\t'%s' and '%s'."));
  633. #line 94 "../check.c"
  634. puts(_("%s error: The %s option is required\n"));
  635. #line 632 "../find.c"
  636. puts(_("%s: The '%s' option cannot have an argument.\n"));
  637. #line 151 "../check.c"
  638. puts(_("%s: Command line arguments are not allowed.\n"));
  639. #line 535 "../save.c"
  640. puts(_("error %d (%s) creating %s\n"));
  641. #line 234 "../enum.c"
  642. puts(_("%s error: '%s' does not match any %s keywords.\n"));
  643. #line 93 "../reset.c"
  644. puts(_("%s error: The '%s' option requires an argument.\n"));
  645. #line 184 "../save.c"
  646. puts(_("error %d (%s) stat-ing %s\n"));
  647. #line 238 "../save.c"
  648. puts(_("error %d (%s) stat-ing %s\n"));
  649. #line 143 "../restore.c"
  650. puts(_("%s error: no saved option state\n"));
  651. #line 231 "../autoopts.c"
  652. puts(_("'%s' is not a command line option.\n"));
  653. #line 111 "../time.c"
  654. puts(_("%s error: '%s' is not a recognizable date/time.\n"));
  655. #line 132 "../save.c"
  656. puts(_("'%s' not defined\n"));
  657. #line 50 "../time.c"
  658. puts(_("%s error: '%s' is not a recognizable time duration.\n"));
  659. #line 92 "../check.c"
  660. puts(_("%s error: The %s option must appear %d times.\n"));
  661. #line 164 "../numeric.c"
  662. puts(_("%s error: '%s' is not a recognizable number.\n"));
  663. #line 200 "../enum.c"
  664. puts(_("%s error: %s exceeds %s keyword count\n"));
  665. #line 330 "../usage.c"
  666. puts(_("Try '%s %s' for more information.\n"));
  667. #line 45 "../alias.c"
  668. puts(_("one %s%s option allowed\n"));
  669. #line 203 "../makeshell.c"
  670. puts(_("standard output"));
  671. #line 938 "../makeshell.c"
  672. puts(_("standard output"));
  673. #line 274 "../usage.c"
  674. puts(_("standard output"));
  675. #line 415 "../usage.c"
  676. puts(_("standard output"));
  677. #line 625 "../usage.c"
  678. puts(_("standard output"));
  679. #line 175 "../version.c"
  680. puts(_("standard output"));
  681. #line 274 "../usage.c"
  682. puts(_("standard error"));
  683. #line 415 "../usage.c"
  684. puts(_("standard error"));
  685. #line 625 "../usage.c"
  686. puts(_("standard error"));
  687. #line 175 "../version.c"
  688. puts(_("standard error"));
  689. #line 203 "../makeshell.c"
  690. puts(_("write"));
  691. #line 938 "../makeshell.c"
  692. puts(_("write"));
  693. #line 273 "../usage.c"
  694. puts(_("write"));
  695. #line 414 "../usage.c"
  696. puts(_("write"));
  697. #line 624 "../usage.c"
  698. puts(_("write"));
  699. #line 174 "../version.c"
  700. puts(_("write"));
  701. #line 60 "../numeric.c"
  702. puts(_("%s error: %s option value %ld is out of range.\n"));
  703. #line 44 "../check.c"
  704. puts(_("%s error: %s option requires the %s option\n"));
  705. #line 131 "../save.c"
  706. puts(_("%s warning: cannot save options - %s not regular file\n"));
  707. #line 183 "../save.c"
  708. puts(_("%s warning: cannot save options - %s not regular file\n"));
  709. #line 237 "../save.c"
  710. puts(_("%s warning: cannot save options - %s not regular file\n"));
  711. #line 256 "../save.c"
  712. puts(_("%s warning: cannot save options - %s not regular file\n"));
  713. #line 534 "../save.c"
  714. puts(_("%s warning: cannot save options - %s not regular file\n"));
  715. /* END-LIBOPTS-MESSAGES */
  716. /* USAGE-TEXT: */
  717. #line 873 "../usage.c"
  718. puts(_("\t\t\t\t- an alternate for '%s'\n"));
  719. #line 1148 "../usage.c"
  720. puts(_("Version, usage and configuration options:"));
  721. #line 924 "../usage.c"
  722. puts(_("\t\t\t\t- default option for unnamed options\n"));
  723. #line 837 "../usage.c"
  724. puts(_("\t\t\t\t- disabled as '--%s'\n"));
  725. #line 1117 "../usage.c"
  726. puts(_(" --- %-14s %s\n"));
  727. #line 1115 "../usage.c"
  728. puts(_("This option has been disabled"));
  729. #line 864 "../usage.c"
  730. puts(_("\t\t\t\t- enabled by default\n"));
  731. #line 40 "../alias.c"
  732. puts(_("%s error: only "));
  733. #line 1194 "../usage.c"
  734. puts(_(" - examining environment variables named %s_*\n"));
  735. #line 168 "../file.c"
  736. puts(_("\t\t\t\t- file must not pre-exist\n"));
  737. #line 172 "../file.c"
  738. puts(_("\t\t\t\t- file must pre-exist\n"));
  739. #line 380 "../usage.c"
  740. puts(_("Options are specified by doubled hyphens and their name or by a single\n"
  741. "hyphen and the flag character.\n"));
  742. #line 916 "../makeshell.c"
  743. puts(_("\n"
  744. "= = = = = = = =\n\n"
  745. "This incarnation of genshell will produce\n"
  746. "a shell script to parse the options for %s:\n\n"));
  747. #line 166 "../enum.c"
  748. puts(_(" or an integer mask with any of the lower %d bits set\n"));
  749. #line 897 "../usage.c"
  750. puts(_("\t\t\t\t- is a set membership option\n"));
  751. #line 918 "../usage.c"
  752. puts(_("\t\t\t\t- must appear between %d and %d times\n"));
  753. #line 382 "../usage.c"
  754. puts(_("Options are specified by single or double hyphens and their name.\n"));
  755. #line 904 "../usage.c"
  756. puts(_("\t\t\t\t- may appear multiple times\n"));
  757. #line 891 "../usage.c"
  758. puts(_("\t\t\t\t- may not be preset\n"));
  759. #line 1309 "../usage.c"
  760. puts(_(" Arg Option-Name Description\n"));
  761. #line 1245 "../usage.c"
  762. puts(_(" Flg Arg Option-Name Description\n"));
  763. #line 1303 "../usage.c"
  764. puts(_(" Flg Arg Option-Name Description\n"));
  765. #line 1304 "../usage.c"
  766. puts(_(" %3s %s"));
  767. #line 1310 "../usage.c"
  768. puts(_(" %3s %s"));
  769. #line 387 "../usage.c"
  770. puts(_("The '-#<number>' option may omit the hash char\n"));
  771. #line 383 "../usage.c"
  772. puts(_("All arguments are named options.\n"));
  773. #line 971 "../usage.c"
  774. puts(_(" - reading file %s"));
  775. #line 409 "../usage.c"
  776. puts(_("\n"
  777. "Please send bug reports to: <%s>\n"));
  778. #line 100 "../version.c"
  779. puts(_("\n"
  780. "Please send bug reports to: <%s>\n"));
  781. #line 129 "../version.c"
  782. puts(_("\n"
  783. "Please send bug reports to: <%s>\n"));
  784. #line 903 "../usage.c"
  785. puts(_("\t\t\t\t- may NOT appear - preset only\n"));
  786. #line 944 "../usage.c"
  787. puts(_("\n"
  788. "The following option preset mechanisms are supported:\n"));
  789. #line 1192 "../usage.c"
  790. puts(_("\n"
  791. "The following option preset mechanisms are supported:\n"));
  792. #line 682 "../usage.c"
  793. puts(_("prohibits these options:\n"));
  794. #line 677 "../usage.c"
  795. puts(_("prohibits the option '%s'\n"));
  796. #line 81 "../numeric.c"
  797. puts(_("%s%ld to %ld"));
  798. #line 79 "../numeric.c"
  799. puts(_("%sgreater than or equal to %ld"));
  800. #line 75 "../numeric.c"
  801. puts(_("%s%ld exactly"));
  802. #line 68 "../numeric.c"
  803. puts(_("%sit must lie in one of the ranges:\n"));
  804. #line 68 "../numeric.c"
  805. puts(_("%sit must be in the range:\n"));
  806. #line 88 "../numeric.c"
  807. puts(_(", or\n"));
  808. #line 66 "../numeric.c"
  809. puts(_("%sis scalable with a suffix: k/K/m/M/g/G/t/T\n"));
  810. #line 77 "../numeric.c"
  811. puts(_("%sless than or equal to %ld"));
  812. #line 390 "../usage.c"
  813. puts(_("Operands and options may be intermixed. They will be reordered.\n"));
  814. #line 652 "../usage.c"
  815. puts(_("requires the option '%s'\n"));
  816. #line 655 "../usage.c"
  817. puts(_("requires these options:\n"));
  818. #line 1321 "../usage.c"
  819. puts(_(" Arg Option-Name Req? Description\n"));
  820. #line 1315 "../usage.c"
  821. puts(_(" Flg Arg Option-Name Req? Description\n"));
  822. #line 167 "../enum.c"
  823. puts(_("or you may use a numeric representation. Preceding these with a '!'\n"
  824. "will clear the bits, specifying 'none' will clear all bits, and 'all'\n"
  825. "will set them all. Multiple entries may be passed as an option\n"
  826. "argument list.\n"));
  827. #line 910 "../usage.c"
  828. puts(_("\t\t\t\t- may appear up to %d times\n"));
  829. #line 77 "../enum.c"
  830. puts(_("The valid \"%s\" option keywords are:\n"));
  831. #line 1152 "../usage.c"
  832. puts(_("The next option supports vendor supported extra options:"));
  833. #line 773 "../usage.c"
  834. puts(_("These additional options are:"));
  835. /* END-USAGE-TEXT */
  836. }
  837. #endif /* uncompilable code */
  838. #ifdef __cplusplus
  839. }
  840. #endif
  841. /* tcpcapinfo_opts.c ends here */