tcpreplay_opts.def 8.5 KB

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