tcprewrite_opts.def 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. autogen definitions options;
  2. copyright = {
  3. date = "2004-2007";
  4. owner = "Aaron Turner";
  5. type = "bsd";
  6. author = <<- EOText
  7. Copyright 2004-2007 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. flag = {
  145. name = skip-soft-errors;
  146. max = 1;
  147. descrip = "Skip writing packets with soft errors";
  148. doc = <<- EOText
  149. In some cases, packets can't be decoded or the requested editing
  150. is not possible. Normally these packets are written to the output
  151. file unedited so that tcpprep cache files can still be used, but if
  152. you wish, these packets can be suppressed.
  153. One example of this is 802.11 management frames which contain no data.
  154. EOText;
  155. };
  156. flag = {
  157. name = version;
  158. value = V;
  159. descrip = "Print version information";
  160. flag-code = <<- EOVersion
  161. fprintf(stderr, "tcprewrite version: %s (build %s)", VERSION, svn_version());
  162. #ifdef DEBUG
  163. fprintf(stderr, " (debug)");
  164. #endif
  165. fprintf(stderr, "\n");
  166. fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n");
  167. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  168. #ifdef HAVE_LIBNET
  169. fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
  170. #else
  171. fprintf(stderr, "Not compiled with libnet.\n");
  172. #endif
  173. #ifdef HAVE_WINPCAP
  174. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  175. #else
  176. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  177. #endif
  178. #ifdef ENABLE_64BITS
  179. fprintf(stderr, "64 bit packet counters: enabled\n");
  180. #else
  181. fprintf(stderr, "64 bit packet counters: disabled\n");
  182. #endif
  183. #ifdef ENABLE_VERBOSE
  184. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  185. #else
  186. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  187. #endif
  188. exit(0);
  189. EOVersion;
  190. doc = "";
  191. };
  192. flag = {
  193. name = less-help;
  194. value = h;
  195. immediate;
  196. descrip = "Display less usage information and exit";
  197. flag-code = <<- EOHelp
  198. USAGE(EXIT_FAILURE);
  199. EOHelp;
  200. doc = "";
  201. };