tcprewrite_opts.def 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219
  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. Please see the --dlt option for supported DLT types for writing.
  42. The packet editing features of tcprewrite which distinguish between "client"
  43. and "server" traffic requires a tcpprep(1) cache file.
  44. For more details, please see the Tcpreplay Manual at:
  45. http://tcpreplay.synfin.net/wiki/manual
  46. EOText;
  47. man-doc = <<- EOMan
  48. .SH "SEE ALSO"
  49. tcpdump(1), tcpprep(1), tcpreplay(1)
  50. EOMan;
  51. config-header = "config.h";
  52. include = "#include \"defines.h\"\n"
  53. "#include \"common.h\"\n"
  54. "#include \"config.h\"\n"
  55. "#include \"tcprewrite.h\"\n"
  56. "#include <stdlib.h>\n"
  57. "#include <string.h>\n"
  58. "extern tcprewrite_opt_t options;\n";
  59. homerc = "$$/";
  60. flag = {
  61. ifdef = DEBUG;
  62. name = dbug;
  63. value = d;
  64. arg-type = number;
  65. descrip = "Enable debugging output";
  66. arg-range = "0->5";
  67. arg-default = 0;
  68. max = 1;
  69. immediate;
  70. doc = <<- EOText
  71. If configured with --enable-debug, then you can specify a verbosity
  72. level for debugging output. Higher numbers increase verbosity.
  73. EOText;
  74. };
  75. flag = {
  76. name = infile;
  77. value = i;
  78. arg-type = string;
  79. descrip = "Input pcap file to be processed";
  80. max = 1;
  81. immediate;
  82. must-set;
  83. doc = "";
  84. };
  85. flag = {
  86. name = outfile;
  87. value = o;
  88. arg-type = string;
  89. descrip = "Output pcap file";
  90. max = 1;
  91. must-set;
  92. doc = "";
  93. /* options.outfile is set in post_args, because we need to make
  94. * sure that options.infile is processed first
  95. */
  96. };
  97. flag = {
  98. name = cachefile;
  99. value = c;
  100. arg-type = string;
  101. max = 1;
  102. descrip = "Split traffic via tcpprep cache file";
  103. settable;
  104. flag-code = <<- EOCachefile
  105. options.cache_packets =
  106. read_cache(&options.cachedata, OPT_ARG(CACHEFILE), &options.comment);
  107. EOCachefile;
  108. doc = <<- EOText
  109. Use tcpprep cache file to split traffic based upon client/server relationships.
  110. EOText;
  111. };
  112. /* Verbose decoding via tcpdump */
  113. flag = {
  114. ifdef = ENABLE_VERBOSE;
  115. name = verbose;
  116. value = v;
  117. max = 1;
  118. immediate;
  119. descrip = "Print decoded packets via tcpdump to STDOUT";
  120. settable;
  121. doc = "";
  122. };
  123. flag = {
  124. ifdef = ENABLE_VERBOSE;
  125. name = decode;
  126. flags-must = verbose;
  127. value = A;
  128. arg-type = string;
  129. max = 1;
  130. descrip = "Arguments passed to tcpdump decoder";
  131. doc = <<- EOText
  132. When enabling verbose mode (@var{-v}) you may also specify one or
  133. more additional arguments to pass to @code{tcpdump} to modify
  134. the way packets are decoded. By default, -n and -l are used.
  135. Be sure to quote the arguments so that they are not interpreted
  136. by tcprewrite. The following arguments are valid:
  137. [ -aAeNqRStuvxX ]
  138. [ -E spi@ipaddr algo:secret,... ]
  139. [ -s snaplen ]
  140. EOText;
  141. };
  142. flag = {
  143. name = version;
  144. value = V;
  145. descrip = "Print version information";
  146. flag-code = <<- EOVersion
  147. fprintf(stderr, "tcprewrite version: %s (build %s)", VERSION, svn_version());
  148. #ifdef DEBUG
  149. fprintf(stderr, " (debug)");
  150. #endif
  151. fprintf(stderr, "\n");
  152. fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n");
  153. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  154. #ifdef HAVE_LIBNET
  155. fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
  156. #else
  157. fprintf(stderr, "Not compiled with libnet.\n");
  158. #endif
  159. #ifdef HAVE_WINPCAP
  160. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  161. #else
  162. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  163. #endif
  164. #ifdef ENABLE_64BITS
  165. fprintf(stderr, "64 bit packet counters: enabled\n");
  166. #else
  167. fprintf(stderr, "64 bit packet counters: disabled\n");
  168. #endif
  169. #ifdef ENABLE_VERBOSE
  170. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  171. #else
  172. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  173. #endif
  174. exit(0);
  175. EOVersion;
  176. doc = "";
  177. };
  178. flag = {
  179. name = less-help;
  180. value = h;
  181. immediate;
  182. descrip = "Display less usage information and exit";
  183. flag-code = <<- EOHelp
  184. USAGE(EXIT_FAILURE);
  185. EOHelp;
  186. doc = "";
  187. };