tcpreplay_opts.def 9.0 KB

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