tcprewrite_opts.def 8.4 KB

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