tcprewrite_opts.def 7.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. autogen definitions options;
  2. copyright = {
  3. date = "2004-2008";
  4. owner = "Aaron Turner";
  5. type = "bsd";
  6. author = <<- EOText
  7. Copyright 2004-2008 Aaron Turner
  8. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  9. The latest version of this software is always available from:
  10. http://tcpreplay.synfin.net/
  11. EOText;
  12. };
  13. package = "tcprewrite";
  14. prog-name = "tcprewrite";
  15. prog-title = "Rewrite the packets in a pcap file.";
  16. long-opts;
  17. gnu-usage;
  18. help-value = "H";
  19. save-opts-value = "";
  20. load-opts-value = "";
  21. config-header = "config.h";
  22. #include tcpedit/tcpedit_opts.def
  23. detail = <<- EOText
  24. Tcprewrite is a tool to rewrite packets stored in @file{pcap(3)} file format,
  25. such as crated by tools such as @file{tcpdump(1)} and @file{ethereal(1)}.
  26. Once a pcap file has had it's packets rewritten, they can be replayed back
  27. out on the network using @file{tcpreplay(1)}.
  28. tcprewrite currently supports reading the following DLT types:
  29. @item
  30. @var{DLT_C_HDLC} aka Cisco HDLC
  31. @item
  32. @var{DLT_EN10MB} aka Ethernet
  33. @item
  34. @var{DLT_LINUX_SLL} aka Linux Cooked Socket
  35. @item
  36. @var{DLT_RAW} aka RAW IP
  37. @item
  38. @var{DLT_NULL} aka BSD Loopback
  39. @item
  40. @var{DLT_LOOP} aka OpenBSD Loopback
  41. @item
  42. @var{DLT_IEEE802_11} aka 802.11a/b/g
  43. @item
  44. @var{DLT_IEEE802_11_RADIO} aka 802.11a/b/g with Radiotap headers
  45. Please see the --dlt option for supported DLT types for writing.
  46. The packet editing features of tcprewrite which distinguish between "client"
  47. and "server" traffic requires a tcpprep(1) cache file.
  48. For more details, please see the Tcpreplay Manual at:
  49. http://tcpreplay.synfin.net/trac/wiki/manual
  50. EOText;
  51. man-doc = <<- EOMan
  52. .SH "SEE ALSO"
  53. tcpdump(1), tcpprep(1), tcpreplay(1)
  54. EOMan;
  55. config-header = "config.h";
  56. include = "#include \"defines.h\"\n"
  57. "#include \"common.h\"\n"
  58. "#include \"config.h\"\n"
  59. "#include \"tcprewrite.h\"\n"
  60. "#include <stdlib.h>\n"
  61. "#include <string.h>\n"
  62. "extern tcprewrite_opt_t options;\n";
  63. homerc = "$$/";
  64. flag = {
  65. ifdef = DEBUG;
  66. name = dbug;
  67. value = d;
  68. arg-type = number;
  69. descrip = "Enable debugging output";
  70. arg-range = "0->5";
  71. arg-default = 0;
  72. max = 1;
  73. immediate;
  74. doc = <<- EOText
  75. If configured with --enable-debug, then you can specify a verbosity
  76. level for debugging output. Higher numbers increase verbosity.
  77. EOText;
  78. };
  79. flag = {
  80. name = infile;
  81. value = i;
  82. arg-type = string;
  83. descrip = "Input pcap file to be processed";
  84. max = 1;
  85. immediate;
  86. must-set;
  87. doc = "";
  88. };
  89. flag = {
  90. name = outfile;
  91. value = o;
  92. arg-type = string;
  93. descrip = "Output pcap file";
  94. max = 1;
  95. must-set;
  96. doc = "";
  97. /* options.outfile is set in post_args, because we need to make
  98. * sure that options.infile is processed first
  99. */
  100. };
  101. flag = {
  102. name = cachefile;
  103. value = c;
  104. arg-type = string;
  105. max = 1;
  106. descrip = "Split traffic via tcpprep cache file";
  107. settable;
  108. flag-code = <<- EOCachefile
  109. options.cache_packets =
  110. read_cache(&options.cachedata, OPT_ARG(CACHEFILE), &options.comment);
  111. EOCachefile;
  112. doc = <<- EOText
  113. Use tcpprep cache file to split traffic based upon client/server relationships.
  114. EOText;
  115. };
  116. /* Verbose decoding via tcpdump */
  117. flag = {
  118. ifdef = ENABLE_VERBOSE;
  119. name = verbose;
  120. value = v;
  121. max = 1;
  122. immediate;
  123. descrip = "Print decoded packets via tcpdump to STDOUT";
  124. settable;
  125. doc = "";
  126. };
  127. flag = {
  128. ifdef = ENABLE_VERBOSE;
  129. name = decode;
  130. flags-must = verbose;
  131. value = A;
  132. arg-type = string;
  133. max = 1;
  134. descrip = "Arguments passed to tcpdump decoder";
  135. doc = <<- EOText
  136. When enabling verbose mode (@var{-v}) you may also specify one or
  137. more additional arguments to pass to @code{tcpdump} to modify
  138. the way packets are decoded. By default, -n and -l are used.
  139. Be sure to quote the arguments so that they are not interpreted
  140. by tcprewrite. Please see the tcpdump(1) man page for a complete list of
  141. options.
  142. EOText;
  143. };
  144. /* Fragroute */
  145. flag = {
  146. ifdef = ENABLE_FRAGROUTE;
  147. name = fragroute;
  148. arg-type = string;
  149. max = 1;
  150. descrip = "Parse fragroute configuration file";
  151. doc = <<- EOText
  152. Enable advanced evasion techniques using the built-in fragroute(8)
  153. engine. See the fragroute(8) man page for more details. Important:
  154. tcprewrite does not support the delay, echo or print commands.
  155. EOText;
  156. };
  157. flag = {
  158. ifdef = ENABLE_FRAGROUTE;
  159. name = fragdir;
  160. flags-must = cachefile;
  161. arg-type = string;
  162. max = 1;
  163. descrip = "Which flows to apply fragroute to: c2s, s2c, both";
  164. doc = <<- EOText
  165. Apply the fragroute engine to packets going c2s, s2c or both when using a cache file.
  166. EOText;
  167. };
  168. flag = {
  169. name = skip-soft-errors;
  170. max = 1;
  171. descrip = "Skip writing packets with soft errors";
  172. doc = <<- EOText
  173. In some cases, packets can't be decoded or the requested editing
  174. is not possible. Normally these packets are written to the output
  175. file unedited so that tcpprep cache files can still be used, but if
  176. you wish, these packets can be suppressed.
  177. One example of this is 802.11 management frames which contain no data.
  178. EOText;
  179. };
  180. flag = {
  181. name = version;
  182. value = V;
  183. descrip = "Print version information";
  184. flag-code = <<- EOVersion
  185. fprintf(stderr, "tcprewrite version: %s (build %s)", VERSION, svn_version());
  186. #ifdef DEBUG
  187. fprintf(stderr, " (debug)");
  188. #endif
  189. fprintf(stderr, "\n");
  190. fprintf(stderr, "Copyright 2001-2009 by Aaron Turner <aturner at synfin dot net>\n");
  191. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  192. #ifdef HAVE_LIBDNET
  193. fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION);
  194. #else
  195. fprintf(stderr, "Not compiled with libdnet.\n");
  196. #endif
  197. #ifdef HAVE_WINPCAP
  198. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  199. #else
  200. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  201. #endif
  202. #ifdef ENABLE_64BITS
  203. fprintf(stderr, "64 bit packet counters: enabled\n");
  204. #else
  205. fprintf(stderr, "64 bit packet counters: disabled\n");
  206. #endif
  207. #ifdef ENABLE_VERBOSE
  208. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  209. #else
  210. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  211. #endif
  212. #ifdef ENABLE_FRAGROUTE
  213. fprintf(stderr, "Fragroute engine: enabled\n");
  214. #else
  215. fprintf(stderr, "Fragroute engine: disabled\n");
  216. #endif
  217. exit(0);
  218. EOVersion;
  219. doc = "";
  220. };
  221. flag = {
  222. name = less-help;
  223. value = h;
  224. immediate;
  225. descrip = "Display less usage information and exit";
  226. flag-code = <<- EOHelp
  227. USAGE(EXIT_FAILURE);
  228. EOHelp;
  229. doc = "";
  230. };