tcpreplay_opts.def 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474
  1. autogen definitions options;
  2. copyright = {
  3. date = "2000-2008";
  4. owner = "Aaron Turner";
  5. type = "bsd";
  6. author = <<- EOText
  7. Copyright 2000-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 = "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/trac/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. tcpreplay-edit(1), 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. Packet timing at high speeds is a black art and very OS/CPU dependent.
  64. Replaying captured traffic may simulate odd or broken conditions on your
  65. network and cause all sorts of problems.
  66. In most cases, you can not replay traffic back to/at a server.
  67. Some operating systems by default do not allow for forging source MAC
  68. addresses. Please consult your operating system's documentation and the
  69. tcpreplay FAQ if you experience this issue.
  70. EOMan;
  71. flag = {
  72. ifdef = DEBUG;
  73. name = dbug;
  74. value = d;
  75. arg-type = number;
  76. max = 1;
  77. immediate;
  78. arg-range = "0->5";
  79. arg-default = 0;
  80. descrip = "Enable debugging output";
  81. doc = <<- EOText
  82. If configured with --enable-debug, then you can specify a verbosity
  83. level for debugging output. Higher numbers increase verbosity.
  84. EOText;
  85. };
  86. flag = {
  87. name = quiet;
  88. value = q;
  89. descrip = "Quiet mode";
  90. doc = "Print nothing except the statistics at the end of the run";
  91. };
  92. flag = {
  93. name = timer;
  94. value = T;
  95. arg-default = "gtod";
  96. max = 1;
  97. arg-type = string;
  98. descrip = "Select packet timing mode: select, ioport, rdtsc, gtod, nano, abstime";
  99. doc = <<- EOText
  100. Allows you to select the packet timing method to use:
  101. @enumerate
  102. @item nano
  103. - Use nanosleep() API
  104. @item select
  105. - Use select() API
  106. @item ioport
  107. - Write to the i386 IO Port 0x80
  108. @item rdtsc
  109. - Use the x86/x86_64/PPC RDTSC
  110. @item gtod [default]
  111. - Use a gettimeofday() loop
  112. @item abstime
  113. - Use OS X's AbsoluteTime API
  114. @end enumerate
  115. EOText;
  116. };
  117. flag = {
  118. name = sleep-accel;
  119. arg-type = number;
  120. arg-default = 0;
  121. descrip = "Reduce the amount of time to sleep by specified usec";
  122. doc = <<- EOText
  123. Reduce the amount of time we would normally sleep between two packets by the
  124. specified number of usec. This provides a "fuzz factor" to compensate for
  125. running on a non-RTOS and other processes using CPU time. Default is disabled.
  126. EOText;
  127. };
  128. flag = {
  129. name = rdtsc-clicks;
  130. max = 1;
  131. arg-type = number;
  132. arg-default = 0;
  133. descrip = "Specify the RDTSC clicks/usec";
  134. doc = <<- EOText
  135. Override the calculated number of RDTSC clicks/usec which is often the speed of the
  136. CPU in Mhz. Only useful if you specified @var{--timer=rdtsc}
  137. EOText;
  138. };
  139. /* Verbose decoding via tcpdump */
  140. flag = {
  141. ifdef = ENABLE_VERBOSE;
  142. name = verbose;
  143. value = v;
  144. max = 1;
  145. immediate;
  146. descrip = "Print decoded packets via tcpdump to STDOUT";
  147. settable;
  148. doc = "";
  149. };
  150. flag = {
  151. ifdef = ENABLE_VERBOSE;
  152. name = decode;
  153. flags-must = verbose;
  154. value = A;
  155. arg-type = string;
  156. max = 1;
  157. descrip = "Arguments passed to tcpdump decoder";
  158. doc = <<- EOText
  159. When enabling verbose mode (@var{-v}) you may also specify one or more
  160. additional arguments to pass to @code{tcpdump} to modify the way packets
  161. are decoded. By default, -n and -l are used. Be sure to
  162. quote the arguments like: -A "-axxx" so that they are not interpreted
  163. by tcpreplay. Please see the tcpdump(1) man page for a complete list of
  164. options.
  165. EOText;
  166. };
  167. /* Cache files to internal memory */
  168. flag = {
  169. name = enable_file_cache;
  170. value = K;
  171. flags-must = loop;
  172. descrip = "Enable caching of packets to internal memory";
  173. doc = <<- EOText
  174. Cache pcap file(s) the first time they are cached in RAM so that subsequent
  175. loops don't incurr any disk I/O latency in order to increase performance. Make
  176. sure you have enough free RAM to store the entire pcap file(s) in memory or the
  177. system will swap and performance will suffer.
  178. EOText;
  179. };
  180. /*
  181. * Output modifiers: -c
  182. */
  183. flag = {
  184. name = cachefile;
  185. value = c;
  186. arg-type = string;
  187. max = 1;
  188. descrip = "Split traffic via a tcpprep cache file";
  189. doc = "";
  190. };
  191. /*
  192. * Outputs: -i, -I
  193. */
  194. flag = {
  195. name = intf1;
  196. value = i;
  197. arg-type = string;
  198. max = 1;
  199. must-set;
  200. descrip = "Server/primary traffic output interface";
  201. doc = "";
  202. };
  203. flag = {
  204. name = intf2;
  205. value = I;
  206. arg-type = string;
  207. max = 1;
  208. flags-must = cachefile;
  209. descrip = "Client/secondary traffic output interface";
  210. doc = "";
  211. };
  212. flag = {
  213. ifdef = ENABLE_PCAP_FINDALLDEVS;
  214. name = listnics;
  215. descrip = "List available network interfaces and exit";
  216. immediate;
  217. doc = "";
  218. flag-code = <<- EOFlag
  219. interface_list_t *list = get_interface_list();
  220. list_interfaces(list);
  221. free(list);
  222. exit(0);
  223. EOFlag;
  224. };
  225. /*
  226. * Limits and loops: -l
  227. */
  228. flag = {
  229. name = loop;
  230. value = l;
  231. arg-type = number;
  232. arg-range = "0->";
  233. max = 1;
  234. descrip = "Loop through the capture file X times";
  235. arg-default = 1;
  236. doc = "";
  237. };
  238. flag = {
  239. name = pktlen;
  240. max = 1;
  241. descrip = "Override the snaplen and use the actual packet len";
  242. doc = <<- EOText
  243. By default, tcpreplay will send packets based on the size of the "snaplen"
  244. stored in the pcap file which is usually the correct thing to do. However,
  245. occasionally, tools will store more bytes then told to. By specifying this
  246. option, tcpreplay will ignore the snaplen field and instead try to send
  247. packets based on the original packet length. Bad things may happen if
  248. you specify this option.
  249. EOText;
  250. };
  251. flag = {
  252. name = limit;
  253. value = L;
  254. arg-type = number;
  255. max = 1;
  256. arg-default = -1;
  257. arg-range = "1->";
  258. descrip = "Limit the number of packets to send";
  259. doc = <<- EOText
  260. By default, tcpreplay will send all the packets. Alternatively, you can
  261. specify a maximum number of packets to send.
  262. EOText;
  263. };
  264. /*
  265. * Replay speed modifiers: -m, -p, -r, -R, -o
  266. */
  267. /* note that this is really a float, but autoopts does not support float */
  268. flag = {
  269. name = multiplier;
  270. flags-cant = pps;
  271. flags-cant = mbps;
  272. flags-cant = oneatatime;
  273. flags-cant = topspeed;
  274. value = x;
  275. arg-type = string;
  276. max = 1;
  277. descrip = "Modify replay speed to a given multiple";
  278. doc = <<- EOText
  279. Specify a floating point value to modify the packet replay speed.
  280. Examples:
  281. @example
  282. 2.0 will replay traffic at twice the speed captured
  283. 0.7 will replay traffic at 70% the speed captured
  284. @end example
  285. EOText;
  286. };
  287. flag = {
  288. name = pps;
  289. flags-cant = multiplier;
  290. flags-cant = mbps;
  291. flags-cant = oneatatime;
  292. flags-cant = topspeed;
  293. value = p;
  294. arg-type = number;
  295. max = 1;
  296. descrip = "Replay packets at a given packets/sec";
  297. doc = "";
  298. };
  299. flag = {
  300. name = mbps;
  301. flags-cant = multiplier;
  302. flags-cant = pps;
  303. flags-cant = oneatatime;
  304. flags-cant = topspeed;
  305. value = M;
  306. arg-type = string;
  307. max = 1;
  308. descrip = "Replay packets at a given Mbps";
  309. doc = <<- EOText
  310. Specify a floating point value for the Mbps rate that tcpreplay
  311. should send packets at.
  312. EOText;
  313. };
  314. flag = {
  315. name = topspeed;
  316. flags-cant = mbps;
  317. flags-cant = multiplier;
  318. flags-cant = pps;
  319. flags-cant = oneatatime;
  320. value = t;
  321. descrip = "Replay packets as fast as possible";
  322. doc = "";
  323. };
  324. flag = {
  325. name = oneatatime;
  326. flags-cant = mbps;
  327. flags-cant = pps;
  328. flags-cant = multiplier;
  329. flags-cant = topspeed;
  330. value = o;
  331. descrip = "Replay one packet at a time for each user input";
  332. doc = <<- EOText
  333. Allows you to step through one or more packets at a time.
  334. EOText;
  335. };
  336. flag = {
  337. name = pps-multi;
  338. arg-type = number;
  339. flags-must = pps;
  340. arg-default = 1;
  341. arg-range = "1->";
  342. descrip = "Number of packets to send for each time interval";
  343. doc = <<- EOText
  344. When trying to send packets at very high rates, the time between each packet
  345. can be so short that it is impossible to accurately sleep for the required
  346. period of time. This option allows you to send multiple packets at a time,
  347. thus allowing for longer sleep times which can be more accurately implemented.
  348. EOText;
  349. };
  350. flag = {
  351. name = pid;
  352. value = P;
  353. descrip = "Print the PID of tcpreplay at startup";
  354. flag-code = <<- EOPid
  355. fprintf(stderr, "PID: %hu\n", getpid());
  356. EOPid;
  357. doc = "";
  358. };
  359. flag = {
  360. name = version;
  361. value = V;
  362. descrip = "Print version information";
  363. flag-code = <<- EOVersion
  364. fprintf(stderr, "tcpreplay version: %s (build %s)", VERSION, svn_version());
  365. #ifdef DEBUG
  366. fprintf(stderr, " (debug)");
  367. #endif
  368. fprintf(stderr, "\n");
  369. fprintf(stderr, "Copyright 2001-2009 by Aaron Turner <aturner at synfin dot net>\n");
  370. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  371. #ifdef HAVE_LIBDNET
  372. fprintf(stderr, "Compiled against libdnet: %s\n", LIBDNET_VERSION);
  373. #else
  374. fprintf(stderr, "Not compiled with libdnet.\n");
  375. #endif
  376. #ifdef HAVE_WINPCAP
  377. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  378. #else
  379. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  380. #endif
  381. #ifdef ENABLE_64BITS
  382. fprintf(stderr, "64 bit packet counters: enabled\n");
  383. #else
  384. fprintf(stderr, "64 bit packet counters: disabled\n");
  385. #endif
  386. #ifdef ENABLE_VERBOSE
  387. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  388. #else
  389. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  390. #endif
  391. #ifdef TCPREPLAY_EDIT
  392. fprintf(stderr, "Packet editing: enabled\n");
  393. #else
  394. fprintf(stderr, "Packet editing: disabled\n");
  395. #endif
  396. #ifdef ENABLE_FRAGROUTE
  397. fprintf(stderr, "Fragroute engine: enabled\n");
  398. #else
  399. fprintf(stderr, "Fragroute engine: disabled\n");
  400. #endif
  401. fprintf(stderr, "Injection method: %s\n", sendpacket_get_method());
  402. exit(0);
  403. EOVersion;
  404. doc = "";
  405. };
  406. flag = {
  407. name = less-help;
  408. value = "h";
  409. immediate;
  410. descrip = "Display less usage information and exit";
  411. flag-code = <<- EOHelp
  412. USAGE(EXIT_FAILURE);
  413. EOHelp;
  414. doc = "";
  415. };