tcpreplay_opts.def 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429
  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/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. 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. ifdef = DEBUG;
  72. name = dbug;
  73. value = d;
  74. arg-type = number;
  75. max = 1;
  76. immediate;
  77. arg-range = "0->5";
  78. arg-default = 0;
  79. descrip = "Enable debugging output";
  80. doc = <<- EOText
  81. If configured with --enable-debug, then you can specify a verbosity
  82. level for debugging output. Higher numbers increase verbosity.
  83. EOText;
  84. };
  85. flag = {
  86. name = quiet;
  87. value = q;
  88. descrip = "Quiet mode";
  89. doc = "Print nothing except the statistics at the end of the run";
  90. };
  91. flag = {
  92. name = accurate;
  93. value = a;
  94. max = 1;
  95. flags-cant = accurate2;
  96. descrip = "Enable more accurate packet timing";
  97. doc = <<- EOText
  98. Enables more accurate timing between packets at the cost of higher
  99. CPU utilization by using the gettimeofday() system call. This method
  100. works better on some systems then others and may have rather non-granular
  101. resolution which makes it problematic for replaying at high rates of speed.
  102. EOText;
  103. };
  104. flag = {
  105. name = accurate2;
  106. max = 1;
  107. flags-cant = accurate;
  108. arg-type = number;
  109. descrip = "Enable even more accurate packet timing";
  110. doc = <<- EOText
  111. Enables the "even more" accurate timing at the cost of higher CPU
  112. utilization by using a tight loop which increments a counter. This method
  113. provides the most accurate timing of any option, but requires you to specify
  114. a cost for each loop. This cost value is VERY system dependent, so you will
  115. need to run --loop-test to get this value.
  116. EOText;
  117. };
  118. /* Verbose decoding via tcpdump */
  119. flag = {
  120. ifdef = ENABLE_VERBOSE;
  121. name = verbose;
  122. value = v;
  123. max = 1;
  124. immediate;
  125. descrip = "Print decoded packets via tcpdump to STDOUT";
  126. settable;
  127. doc = "";
  128. };
  129. flag = {
  130. ifdef = ENABLE_VERBOSE;
  131. name = decode;
  132. flags-must = verbose;
  133. value = A;
  134. arg-type = string;
  135. max = 1;
  136. descrip = "Arguments passed to tcpdump decoder";
  137. doc = <<- EOText
  138. When enabling verbose mode (@var{-v}) you may also specify one or more
  139. additional arguments to pass to @code{tcpdump} to modify the way packets
  140. are decoded. By default, -n and -l are used. Be sure to
  141. quote the arguments like: -A "-axxx" so that they are not interpreted
  142. by tcpreplay. Please see the tcpdump(1) man page for a complete list of
  143. options.
  144. EOText;
  145. };
  146. /* Cache files to internal memory */
  147. flag = {
  148. name = enable_file_cache;
  149. value = K;
  150. flags-must = loop;
  151. descrip = "Enable caching of packets to internal memory";
  152. doc = <<- EOText
  153. Cache pcap file(s) the first time they are cached in RAM so that subsequent
  154. loops don't incurr any disk I/O latency in order to increase performance. Make
  155. sure you have enough free RAM to store the entire pcap file(s) in memory or the
  156. system will swap and performance will suffer.
  157. EOText;
  158. };
  159. /*
  160. * Output modifiers: -c
  161. */
  162. flag = {
  163. name = cachefile;
  164. value = c;
  165. arg-type = string;
  166. max = 1;
  167. descrip = "Split traffic via a tcpprep cache file";
  168. doc = "";
  169. };
  170. /*
  171. * Outputs: -i, -I
  172. */
  173. flag = {
  174. name = intf1;
  175. value = i;
  176. arg-type = string;
  177. max = 1;
  178. must-set;
  179. descrip = "Server/primary traffic output interface";
  180. doc = "";
  181. };
  182. flag = {
  183. name = intf2;
  184. value = I;
  185. arg-type = string;
  186. max = 1;
  187. flags-must = cachefile;
  188. descrip = "Client/secondary traffic output interface";
  189. doc = "";
  190. };
  191. flag = {
  192. ifdef = ENABLE_PCAP_FINDALLDEVS;
  193. name = listnics;
  194. descrip = "List available network interfaces and exit";
  195. immediate;
  196. doc = "";
  197. flag-code = <<- EOFlag
  198. interface_list_t *list = get_interface_list();
  199. list_interfaces(list);
  200. free(list);
  201. exit(0);
  202. EOFlag;
  203. };
  204. /*
  205. * Limits and loops: -l
  206. */
  207. flag = {
  208. name = loop;
  209. value = l;
  210. arg-type = number;
  211. arg-range = "0->";
  212. max = 1;
  213. descrip = "Loop through the capture file X times";
  214. arg-default = 1;
  215. doc = "";
  216. };
  217. flag = {
  218. name = pktlen;
  219. max = 1;
  220. descrip = "Override the snaplen and use the actual packet len";
  221. doc = <<- EOText
  222. By default, tcpreplay will send packets based on the size of the "snaplen"
  223. stored in the pcap file which is usually the correct thing to do. However,
  224. occasionally, tools will store more bytes then told to. By specifying this
  225. option, tcpreplay will ignore the snaplen field and instead try to send
  226. packets based on the original packet length. Bad things may happen if
  227. you specify this option.
  228. EOText;
  229. };
  230. flag = {
  231. name = limit;
  232. value = L;
  233. arg-type = number;
  234. max = 1;
  235. arg-default = -1;
  236. arg-range = "1->";
  237. descrip = "Limit the number of packets to send";
  238. doc = <<- EOText
  239. By default, tcpreplay will send all the packets. Alternatively, you can
  240. specify a maximum number of packets to send.
  241. EOText;
  242. };
  243. /*
  244. * Replay speed modifiers: -m, -p, -r, -R, -o
  245. */
  246. /* note that this is really a float, but autoopts does not support float */
  247. flag = {
  248. name = multiplier;
  249. flags-cant = pps;
  250. flags-cant = mbps;
  251. flags-cant = oneatatime;
  252. flags-cant = topspeed;
  253. value = x;
  254. arg-type = string;
  255. max = 1;
  256. descrip = "Modify replay speed to a given multiple";
  257. doc = <<- EOText
  258. Specify a floating point value to modify the packet replay speed.
  259. Examples:
  260. @example
  261. 2.0 will replay traffic at twice the speed captured
  262. 0.7 will replay traffic at 70% the speed captured
  263. @end example
  264. EOText;
  265. };
  266. flag = {
  267. name = pps;
  268. flags-cant = multiplier;
  269. flags-cant = mbps;
  270. flags-cant = oneatatime;
  271. flags-cant = topspeed;
  272. value = p;
  273. arg-type = number;
  274. max = 1;
  275. descrip = "Replay packets at a given packets/sec";
  276. doc = "";
  277. };
  278. flag = {
  279. name = mbps;
  280. flags-cant = multiplier;
  281. flags-cant = pps;
  282. flags-cant = oneatatime;
  283. flags-cant = topspeed;
  284. value = M;
  285. arg-type = string;
  286. max = 1;
  287. descrip = "Replay packets at a given Mbps";
  288. doc = <<- EOText
  289. Specify a floating point value for the Mbps rate that tcpreplay
  290. should send packets at.
  291. EOText;
  292. };
  293. flag = {
  294. name = topspeed;
  295. flags-cant = mbps;
  296. flags-cant = multiplier;
  297. flags-cant = pps;
  298. flags-cant = oneatatime;
  299. value = t;
  300. descrip = "Replay packets as fast as possible";
  301. doc = "";
  302. };
  303. flag = {
  304. name = oneatatime;
  305. flags-cant = mbps;
  306. flags-cant = pps;
  307. flags-cant = multiplier;
  308. flags-cant = topspeed;
  309. value = o;
  310. descrip = "Replay one packet at a time for each user input";
  311. doc = <<- EOText
  312. Allows you to step through one or more packets at a time.
  313. EOText;
  314. };
  315. flag = {
  316. name = pid;
  317. value = P;
  318. descrip = "Print the PID of tcpreplay at startup";
  319. flag-code = <<- EOPid
  320. fprintf(stderr, "PID: %hu\n", getpid());
  321. EOPid;
  322. doc = "";
  323. };
  324. flag = {
  325. name = version;
  326. value = V;
  327. descrip = "Print version information";
  328. flag-code = <<- EOVersion
  329. fprintf(stderr, "tcpreplay version: %s (build %s)", VERSION, svn_version());
  330. #ifdef DEBUG
  331. fprintf(stderr, " (debug)");
  332. #endif
  333. fprintf(stderr, "\n");
  334. fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n");
  335. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  336. #ifdef HAVE_LIBNET
  337. fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
  338. #else
  339. fprintf(stderr, "Not compiled with libnet.\n");
  340. #endif
  341. #ifdef HAVE_WINPCAP
  342. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  343. #else
  344. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  345. #endif
  346. #ifdef ENABLE_64BITS
  347. fprintf(stderr, "64 bit packet counters: enabled\n");
  348. #else
  349. fprintf(stderr, "64 bit packet counters: disabled\n");
  350. #endif
  351. #ifdef ENABLE_VERBOSE
  352. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  353. #else
  354. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  355. #endif
  356. #ifdef TCPREPLAY_EDIT
  357. fprintf(stderr, "Packet editing: enabled\n");
  358. #else
  359. fprintf(stderr, "Packet editing: disabled\n");
  360. #endif
  361. exit(0);
  362. EOVersion;
  363. doc = "";
  364. };
  365. flag = {
  366. name = less-help;
  367. value = "h";
  368. immediate;
  369. descrip = "Display less usage information and exit";
  370. flag-code = <<- EOHelp
  371. USAGE(EXIT_FAILURE);
  372. EOHelp;
  373. doc = "";
  374. };