flowreplay_opts.def 7.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309
  1. autogen definitions options;
  2. copyright = {
  3. date = "2004-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 = "flowreplay";
  14. prog-name = "flowreplay";
  15. prog-title = "Connect to servers based on 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 \"flowreplay.h\"\n"
  25. "#include \"common.h\"\n"
  26. "#include \"config.h\"\n"
  27. "extern flowreplay_opt_t options;\n";
  28. homerc = "$$/";
  29. explain = <<- EOExplain
  30. flowreplay is a tool for using network traffic stored in pcap(3) files as
  31. the basis for replaying connections to servers.
  32. EOExplain;
  33. detail = <<- EODetail
  34. Please note that flowreplay is currently in *alpha*. As such, it is still
  35. very much a work in progress and currently will not work for most uses. If
  36. you have the skill and interest to help make flowreplay work better, please
  37. contact Aaron Turner.
  38. For more details, please see the Tcpreplay Manual at:
  39. http://tcpreplay.synfin.net/trac/wiki/manual
  40. EODetail;
  41. flag = {
  42. ifdef = DEBUG;
  43. name = dbug;
  44. value = d;
  45. arg-type = number;
  46. max = 1;
  47. immediate;
  48. arg-range = "0->5";
  49. arg-default = 0;
  50. descrip = "Enable debugging output";
  51. doc = <<- EOText
  52. If configured with --enable-debug, then you can specify a verbosity
  53. level for debugging output. Higher numbers increase verbosity.
  54. EOText;
  55. };
  56. /* Verbose decoding via tcpdump */
  57. flag = {
  58. ifdef = ENABLE_VERBOSE;
  59. name = verbose;
  60. value = v;
  61. max = 1;
  62. immediate;
  63. descrip = "Print decoded packets via tcpdump to STDOUT";
  64. settable;
  65. doc = "";
  66. };
  67. flag = {
  68. ifdef = ENABLE_VERBOSE;
  69. name = decode;
  70. flags-must = verbose;
  71. value = A;
  72. arg-type = string;
  73. max = 1;
  74. descrip = "Arguments passed to tcpdump decoder";
  75. doc = <<- EOText
  76. When enabling verbose mode (@var{-v}) you may also specify one or more
  77. additional arguments to pass to @code{tcpdump} to modify the way packets
  78. are decoded. By default, -n and -l are used. Be sure to
  79. quote the arguments like: -A "-axxx" so that they are not interpreted
  80. by tcpreplay. The following arguments are vaild:
  81. [ -aAeNqRStuvxX ]
  82. [ -E spi@ipaddr algo:secret,... ]
  83. [ -s snaplen ]
  84. EOText;
  85. };
  86. flag = {
  87. name = mode;
  88. value = m;
  89. arg-type = string;
  90. max = 1;
  91. must-set;
  92. descrip = "Replay mode";
  93. doc = <<- EOText
  94. Flowreplay needs to know handle client/server exchanges to properly time.
  95. The options are:
  96. @table @bullet
  97. @item @var{send}
  98. Replay traffic as fast as possible. Do not wait for server to reply.
  99. @item @var{wait}
  100. Wait @var{--wait} sec.usec for the server to reply before sending.
  101. @item @var{bytes}
  102. Wait until the server has sent the number of bytes stored in the pcap file.
  103. @item @var{user}
  104. Send packets based on user interaction.
  105. @end table
  106. EOText;
  107. flag-code = <<- EOText
  108. if (strcasecmp(OPT_ARG(MODE), "send") == 0) {
  109. options.sendmode = MODE_SEND;
  110. } else if (strcasecmp(OPT_ARG(MODE), "wait") == 0) {
  111. options.sendmode = MODE_WAIT;
  112. } else if (strcasecmp(OPT_ARG(MODE), "bytes") == 0) {
  113. options.sendmode = MODE_BYTES;
  114. } else if (strcasecmp(OPT_ARG(MODE), "user") == 0) {
  115. options.sendmode = MODE_USER;
  116. } else {
  117. errx(1, "Invalid --mode: %s", OPT_ARG(MODE));
  118. }
  119. EOText;
  120. };
  121. flag = {
  122. name = wait;
  123. value = w;
  124. arg-type = string;
  125. max = 1;
  126. default = "2.0";
  127. descrip = "Number of sec.usec to wait between client's turn to send";
  128. doc = <<- EOText
  129. If @var{--mode} is @var{wait}, then you can specify the amount of time to
  130. wait for the server to complete it's side of the transaction before starting
  131. to send the client side again.
  132. EOText;
  133. flag-code = <<- EOText
  134. float2timer(atof(OPT_ARG(WAIT)), &options.timeout);
  135. EOText;
  136. };
  137. flag = {
  138. name = targetip;
  139. value = t;
  140. arg-type = string;
  141. max = 1;
  142. must-set;
  143. descrip = "Target host to connect to";
  144. flag-code = <<- EOText
  145. #ifdef INET_ATON
  146. if (inet_aton(OPT_ARG(TARGETIP), &options.targetaddr) == 0)
  147. errx(1, "Invalid target IP address: %s", OPT_ARG(TARGETIP));
  148. #else
  149. if ((options.targetaddr.s_addr = inet_addr(OPT_ARG(TARGETIP))) == -1)
  150. errx(1, "Invalid target IP address: %s", OPT_ARG(TARGETIP));
  151. #endif
  152. EOText;
  153. };
  154. flag = {
  155. name = filter;
  156. value = f;
  157. arg-type = string;
  158. max = 1;
  159. descrip = "BPF filter to limit which flows are replayed";
  160. doc = "";
  161. };
  162. flag = {
  163. name = clientnet;
  164. value = c;
  165. arg-type = string;
  166. descrip = "Client network(s)";
  167. flag-code = <<- EOText
  168. char *cidr = safe_strdup(OPT_ARG(CLIENTNET));
  169. if (!parse_cidr(&options.clients, cidr, ","))
  170. errx(1, "Unable to parse CIDR: %s", OPT_ARG(CLIENTNET));
  171. free(cidr);
  172. EOText;
  173. };
  174. flag = {
  175. name = servernet;
  176. value = s;
  177. arg-type = string;
  178. descrip = "Server network(s)";
  179. flag-code = <<- EOText
  180. char *cidr = safe_strdup(OPT_ARG(SERVERNET));
  181. if (!parse_cidr(&options.servers, cidr, ","))
  182. errx(1, "Unable to parse CIDR: %s", OPT_ARG(SERVERNET));
  183. free(cidr);
  184. EOText;
  185. };
  186. flag = {
  187. name = nosyn;
  188. value = n;
  189. descrip = "Disable Syn packet requirement to start connections";
  190. flag-code = <<- EOText
  191. options.nosyn = 1;
  192. EOText;
  193. };
  194. flag = {
  195. name = slimit;
  196. value = l;
  197. descrip = "Service limit to proto/port";
  198. arg-type = string;
  199. flag-code = <<- EOText
  200. char *p_parse = NULL, *myarg;
  201. myarg = safe_strdup(OPT_ARG(SLIMIT));
  202. p_parse = strtok(myarg, "/");
  203. if (strcasecmp(p_parse, "TCP") == 0) {
  204. options.proto = IPPROTO_TCP;
  205. } else if (strcasecmp(p_parse, "UDP") == 0) {
  206. options.proto = IPPROTO_UDP;
  207. } else {
  208. errx(1, "Unsupported protocol: %s", p_parse);
  209. }
  210. /* if port is specified, set it */
  211. if ((p_parse = strtok(NULL, "/")))
  212. options.port = htons(atoi(p_parse));
  213. EOText;
  214. };
  215. flag = {
  216. name = version;
  217. value = V;
  218. descrip = "Print version information";
  219. flag-code = <<- EOVersion
  220. fprintf(stderr, "flowreplay version: %s (build %s)", VERSION, svn_version());
  221. #ifdef DEBUG
  222. fprintf(stderr, " (debug)");
  223. #endif
  224. fprintf(stderr, "\n");
  225. fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n");
  226. #ifdef HAVE_LIBNET
  227. fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
  228. #else
  229. fprintf(stderr, "Not compiled with libnet.\n");
  230. #endif
  231. #ifdef HAVE_WINPCAP
  232. fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
  233. #else
  234. fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
  235. #endif
  236. #ifdef ENABLE_64BITS
  237. fprintf(stderr, "64 bit packet counters: enabled\n");
  238. #else
  239. fprintf(stderr, "64 bit packet counters: disabled\n");
  240. #endif
  241. #ifdef ENABLE_VERBOSE
  242. fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
  243. #else
  244. fprintf(stderr, "Verbose printing via tcpdump: disabled\n");
  245. #endif
  246. exit(0);
  247. EOVersion;
  248. doc = "";
  249. };
  250. flag = {
  251. name = less-help;
  252. value = "h";
  253. immediate;
  254. descrip = "Display less usage information and exit";
  255. flag-code = <<- EOHelp
  256. USAGE(EXIT_FAILURE);
  257. EOHelp;
  258. doc = "";
  259. };