tcpreplay_opts.def 9.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402
  1. autogen definitions options;
  2. copyright = {
  3. date = "2000-2007";
  4. owner = "Aaron Turner";
  5. type = "bsd";
  6. author = <<- EOText
  7. Copyright 2000-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 = "tcpreplay";
  14. prog-name = "tcpreplay";
  15. prog-title = "Replay network traffic stored in pcap files";
  16. long-opts;
  17. gnu-usage;
  18. help-value = "H";
  19. save-opts-value = "";
  20. load-opts-value = "";
  21. argument = "<pcap_file(s)>";
  22. config-header = "config.h";
  23. include = "#include \"defines.h\"\n"
  24. "#include \"tcpreplay.h\"\n"
  25. "#include \"common.h\"\n"
  26. "#include \"config.h\"\n"
  27. "#include <stdlib.h>\n"
  28. "#include <sys/types.h>\n"
  29. "#include <unistd.h>\n"
  30. "extern tcpreplay_opt_t options;\n";
  31. homerc = "$$/";
  32. #ifdef TCPREPLAY_EDIT
  33. #include tcpedit/tcpedit_opts.def
  34. #endif
  35. explain = <<- EOExplain
  36. tcpreplay is a tool for replaying network traffic from files saved with
  37. tcpdump or other tools which write pcap(3) files.
  38. EOExplain;
  39. detail = <<- EODetail
  40. The basic operation of tcpreplay is to resend all packets from the
  41. input file(s) at the speed at which they were recorded, or a specified
  42. data rate, up to as fast as the hardware is capable.
  43. Optionally, the traffic can be split between two interfaces, written to
  44. files, filtered and edited in various ways, providing the means to test
  45. firewalls, NIDS and other network devices.
  46. For more details, please see the Tcpreplay Manual at:
  47. http://tcpreplay.synfin.net/wiki/manual
  48. EODetail;
  49. man-doc = <<- EOMan
  50. .SH "SIGNALS"
  51. tcpreplay understands the following signals:
  52. @enumerate
  53. @item @var{SIGUSR1}
  54. Suspend tcpreplay
  55. @item @var{SIGCONT}
  56. Restart tcpreplay
  57. @end enumerate
  58. .SH "SEE ALSO"
  59. tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
  60. .SH "BUGS"
  61. tcpreplay can only send packets as fast as your computer's interface,
  62. processor, disk and system bus will allow.
  63. Replaying captured traffic may simulate odd or broken conditions on your
  64. network and cause problems.
  65. In most cases, you can not replay traffic back to/at a server.
  66. Some operating systems by default do not allow for forging source MAC
  67. addresses. Please consult your operating system's documentation and the
  68. tcpreplay FAQ if you experiance this issue.
  69. EOMan;
  70. flag = {
  71. name = quiet;
  72. value = q;
  73. descrip = "Quiet mode";
  74. };
  75. flag = {
  76. name = accurate;
  77. value = a;
  78. max = 1;
  79. descrip = "Enable more accurate packet timing";
  80. doc = <<- EOText
  81. Enables more accurate timing between packets at the cost of higher
  82. CPU utilization.
  83. EOText;
  84. };
  85. flag = {
  86. ifdef = DEBUG;
  87. name = dbug;
  88. value = d;
  89. arg-type = number;
  90. max = 1;
  91. immediate;
  92. arg-range = "0->5";
  93. arg-default = 0;
  94. descrip = "Enable debugging output";
  95. doc = <<- EOText
  96. If configured with --enable-debug, then you can specify a verbosity
  97. level for debugging output. Higher numbers increase verbosity.
  98. EOText;
  99. };
  100. /* Verbose decoding via tcpdump */
  101. flag = {
  102. ifdef = ENABLE_VERBOSE;
  103. name = verbose;
  104. value = v;
  105. max = 1;
  106. immediate;
  107. descrip = "Print decoded packets via tcpdump to STDOUT";
  108. settable;
  109. doc = "";
  110. };
  111. flag = {
  112. ifdef = ENABLE_VERBOSE;
  113. name = decode;
  114. flags-must = verbose;
  115. value = A;
  116. arg-type = string;
  117. max = 1;
  118. descrip = "Arguments passed to tcpdump decoder";
  119. doc = <<- EOText
  120. When enabling verbose mode (@var{-v}) you may also specify one or more
  121. additional arguments to pass to @code{tcpdump} to modify the way packets
  122. are decoded. By default, -n and -l are used. Be sure to
  123. quote the arguments like: -A "-axxx" so that they are not interpreted
  124. by tcpreplay. The following arguments are vaild:
  125. [ -aAeNqRStuvxX ]
  126. [ -E spi@ipaddr algo:secret,... ]
  127. [ -s snaplen ]
  128. EOText;
  129. };
  130. /* Cache files to internal memory */
  131. flag = {
  132. name = enable_file_cache;
  133. value = C;
  134. descrip = "Enable caching of packets to internal memory";
  135. };
  136. /*
  137. * Output modifiers: -c
  138. */
  139. flag = {
  140. name = cachefile;
  141. value = c;
  142. arg-type = string;
  143. max = 1;
  144. descrip = "Split traffic via a tcppep cache file";
  145. doc = "";
  146. };
  147. /*
  148. * Outputs: -i, -I
  149. */
  150. flag = {
  151. name = intf1;
  152. value = i;
  153. arg-type = string;
  154. max = 1;
  155. must-set;
  156. descrip = "Server/primary traffic output interface";
  157. doc = "";
  158. };
  159. flag = {
  160. name = intf2;
  161. value = I;
  162. arg-type = string;
  163. max = 1;
  164. flags-must = cachefile;
  165. descrip = "Client/secondary traffic output interface";
  166. doc = "";
  167. };
  168. flag = {
  169. ifdef = ENABLE_PCAP_FINDALLDEVS;
  170. name = listnics;
  171. value = N;
  172. descrip = "List available network interfaces and exit";
  173. immediate;
  174. doc = "";
  175. flag-code = <<- EOFlag
  176. interface_list_t *list = get_interface_list();
  177. list_interfaces(list);
  178. free(list);
  179. exit(0);
  180. EOFlag;
  181. };
  182. /*
  183. * Limits and loops: -l
  184. */
  185. flag = {
  186. name = loop;
  187. value = l;
  188. arg-type = number;
  189. arg-range = "0->";
  190. max = 1;
  191. descrip = "Loop through the capture file X times";
  192. arg-default = 1;
  193. doc = "";
  194. };
  195. flag = {
  196. name = pktlen;
  197. value = S;
  198. max = 1;
  199. descrip = "Override the snaplen and use the actual packet len";
  200. doc = <<- EOText
  201. By default, tcpreplay will send packets based on the size of the "snaplen"
  202. stored in the pcap file which is usually the correct thing to do. However,
  203. occasionally, tools will store more bytes then told to. By specifying this
  204. option, tcpreplay will ignore the snaplen field and instead try to send
  205. packets based on the original packet length. Bad things (TM) may happen if
  206. you specify this option.
  207. EOText;
  208. };
  209. flag = {
  210. name = limit;
  211. value = L;
  212. arg-type = number;
  213. max = 1;
  214. arg-default = -1;
  215. arg-range = "1->";
  216. descrip = "Limit the number of packets to send";
  217. doc = <<- EOText
  218. By default, tcpreplay will send all the packets. Alternatively, you can
  219. specify a maximum number of packets to send.
  220. EOText;
  221. };
  222. /*
  223. * Replay speed modifiers: -m, -p, -r, -R, -o
  224. */
  225. /* note that this is really a float, but autoopts does not support float */
  226. flag = {
  227. name = multiplier;
  228. flags-cant = pps;
  229. flags-cant = mbps;
  230. flags-cant = oneatatime;
  231. flags-cant = topspeed;
  232. value = m;
  233. arg-type = string;
  234. max = 1;
  235. descrip = "Modify replay speed to a given multiple";
  236. doc = <<- EOText
  237. Specify a floating point value to modify the packet replay speed.
  238. Examples:
  239. @example
  240. 2.0 will replay traffic at twice the speed captured
  241. 0.7 will replay traffic at 70% the speed captured
  242. @end example
  243. EOText;
  244. };
  245. flag = {
  246. name = pps;
  247. flags-cant = multiplier;
  248. flags-cant = mbps;
  249. flags-cant = oneatatime;
  250. flags-cant = topspeed;
  251. value = p;
  252. arg-type = number;
  253. max = 1;
  254. descrip = "Replay packets at a given packets/sec";
  255. doc = "";
  256. };
  257. flag = {
  258. name = mbps;
  259. flags-cant = multiplier;
  260. flags-cant = pps;
  261. flags-cant = oneatatime;
  262. flags-cant = topspeed;
  263. value = M;
  264. arg-type = string;
  265. max = 1;
  266. descrip = "Replay packets at a given Mbps";
  267. doc = <<- EOText
  268. Specify a floating point value for the Mbps rate that tcpreplay
  269. should send packets at.
  270. EOText;
  271. };
  272. flag = {
  273. name = topspeed;
  274. flags-cant = mbps;
  275. flags-cant = multiplier;
  276. flags-cant = pps;
  277. flags-cant = oneatatime;
  278. value = t;
  279. descrip = "Replay packets as fast as possible";
  280. doc = "";
  281. };
  282. flag = {
  283. name = oneatatime;
  284. flags-cant = mbps;
  285. flags-cant = pps;
  286. flags-cant = multiplier;
  287. flags-cant = topspeed;
  288. value = o;
  289. descrip = "Replay one packet at a time for each user input";
  290. doc = <<- EOText
  291. Allows you to step through one or more packets at a time.
  292. EOText;
  293. };
  294. flag = {
  295. name = pid;
  296. value = P;
  297. descrip = "Print the PID of tcpreplay at startup";
  298. flag-code = <<- EOPid
  299. fprintf(stderr, "PID: %hu\n", getpid());
  300. EOPid;
  301. doc = "";
  302. };
  303. flag = {
  304. name = version;
  305. value = V;
  306. descrip = "Print version information";
  307. flag-code = <<- EOVersion
  308. fprintf(stderr, "tcpreplay version: %s (build %s)", VERSION, svn_version());
  309. #ifdef DEBUG
  310. fprintf(stderr, " (debug)");
  311. #endif
  312. fprintf(stderr, "\n");
  313. fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n");
  314. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  315. #ifdef HAVE_LIBNET
  316. fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
  317. #else
  318. fprintf(stderr, "Not compiled with libnet.\n");
  319. #endif
  320. #ifdef HAVE_WINPCAP
  321. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  322. #else
  323. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  324. #endif
  325. #ifdef ENABLE_64BITS
  326. fprintf(stderr, "64 bit packet counters: enabled\n");
  327. #else
  328. fprintf(stderr, "64 bit packet counters: disabled\n");
  329. #endif
  330. #ifdef ENABLE_VERBOSE
  331. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  332. #else
  333. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  334. #endif
  335. exit(0);
  336. EOVersion;
  337. doc = "";
  338. };
  339. flag = {
  340. name = less-help;
  341. value = "h";
  342. immediate;
  343. descrip = "Display less usage information and exit";
  344. flag-code = <<- EOHelp
  345. USAGE(EXIT_FAILURE);
  346. EOHelp;
  347. doc = "";
  348. };