tcprewrite_opts.def 5.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236
  1. autogen definitions options;
  2. copyright = {
  3. date = "2004-2006";
  4. owner = "Aaron Turner";
  5. type = "bsd";
  6. author = <<- EOText
  7. Copyright 2004-2005 Aaron Turner
  8. For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
  9. EOText;
  10. };
  11. package = "tcprewrite";
  12. prog-name = "tcprewrite";
  13. prog-title = "Rewrite the packets in a pcap file.";
  14. long-opts;
  15. gnu-usage;
  16. help-value = "H";
  17. save-opts-value = "";
  18. load-opts-value = "";
  19. #include tcpedit/tcpedit_opts.def
  20. detail = <<- EOText
  21. Tcprewrite is a tool to rewrite packets stored in @file{pcap(3)} file format,
  22. such as crated by tools such as @file{tcpdump(1)} and @file{ethereal(1)}.
  23. Once a pcap file has had it's packets rewritten, they can be replayed back
  24. out on the network using @file{tcpreplay(1)}.
  25. tcprewrite currently supports the following DLT types:
  26. * DLT_C_HDLC
  27. * DLT_EN10MB
  28. * DLT_LINUX_SSL
  29. * DLT_RAW
  30. The packet editing features of tcprewrite which distinguish between "client"
  31. and "server" traffic requires a tcpprep(1) cache file.
  32. EOText;
  33. man-doc = <<- EOMan
  34. .SH "SEE ALSO"
  35. tcpdump(1), tcpprep(1), tcpreplay(1)
  36. EOMan;
  37. config-header = "config.h";
  38. include = "#include \"defines.h\"\n"
  39. "#include \"common.h\"\n"
  40. "#include \"config.h\"\n"
  41. "#include \"tcprewrite.h\"\n"
  42. "#include \"mac.h\"\n"
  43. "#include <stdlib.h>\n"
  44. "#include <string.h>\n"
  45. "extern char pcap_version[];\n"
  46. "extern tcprewrite_opt_t options;\n";
  47. homerc = "$$/";
  48. #ifndef TCPEDIT_DLT_DISABLE
  49. flag = {
  50. name = dlt;
  51. value = L;
  52. arg-type = number;
  53. arg-range = "0->65535";
  54. max = 1;
  55. descrip = "Change DLT type for output pcap file";
  56. doc = <<- EOText
  57. By default, tcprewrite uses the same DLT (data link type) for the
  58. output pcap as the input pcap. However, if you are changing the
  59. Layer 2 data with --dlink, then you probably also want to change the
  60. DLT type stored in the pcap. Common DLT types are:
  61. @table @bullet
  62. @item
  63. @var{0}
  64. No Layer 2 header (DLT_NULL)
  65. @item
  66. @var{1}
  67. Ethernet (DLT_EN10MB)
  68. @item
  69. @var{10}
  70. FDDI (DLT_FDDI)
  71. @item
  72. @var{12}
  73. BSD Raw header (DLT_RAW)
  74. @item
  75. @var{104}
  76. Cisco HDLC (DLT_C_HDLC)
  77. @item
  78. @var{113}
  79. Linux SLL pseudo-header (DLT_LINUX_SLL)
  80. For a full list of DLT types, see: src/common/dlt_names.h
  81. EOText;
  82. };
  83. #endif
  84. flag = {
  85. name = dbug;
  86. value = d;
  87. arg-type = number;
  88. descrip = "Enable debugging output";
  89. arg-range = "0->5";
  90. arg-default = 0;
  91. max = 1;
  92. immediate;
  93. doc = <<- EOText
  94. If configured with --enable-debug, then you can specify a verbosity
  95. level for debugging output. Higher numbers increase verbosity.
  96. EOText;
  97. };
  98. flag = {
  99. name = infile;
  100. value = i;
  101. arg-type = string;
  102. descrip = "Input pcap file to be processed";
  103. max = 1;
  104. immediate;
  105. must-set;
  106. doc = "";
  107. };
  108. flag = {
  109. name = outfile;
  110. value = o;
  111. arg-type = string;
  112. descrip = "Output pcap file";
  113. max = 1;
  114. must-set;
  115. doc = "";
  116. /* options.outfile is set in post_args, because we need to make
  117. * sure that options.infile is processed first
  118. */
  119. };
  120. flag = {
  121. name = cachefile;
  122. value = c;
  123. arg-type = string;
  124. max = 1;
  125. descrip = "Split traffic via tcpprep cache file";
  126. settable;
  127. flag-code = <<- EOCachefile
  128. options.cache_packets =
  129. read_cache(&options.cachedata, OPT_ARG(CACHEFILE), &options.comment);
  130. EOCachefile;
  131. doc = <<- EOText
  132. Use tcpprep cache file to split traffic based upon client/server relationships.
  133. EOText;
  134. };
  135. /* Verbose decoding via tcpdump */
  136. flag = {
  137. ifdef = HAVE_TCPDUMP;
  138. name = verbose;
  139. value = v;
  140. max = 1;
  141. immediate;
  142. descrip = "Print decoded packets via tcpdump to STDOUT";
  143. settable;
  144. doc = "";
  145. };
  146. flag = {
  147. ifdef = HAVE_TCPDUMP;
  148. name = decode;
  149. flags-must = verbose;
  150. value = A;
  151. arg-type = string;
  152. max = 1;
  153. descrip = "Arguments passed to tcpdump decoder";
  154. doc = <<- EOText
  155. When enabling verbose mode (@var{-v}) you may also specify one or
  156. more additional arguments to pass to @code{tcpdump} to modify
  157. the way packets are decoded. By default, -n and -l are used.
  158. Be sure to quote the arguments so that they are not interpreted
  159. by tcprewrite. The following arguments are valid:
  160. [ -aAeNqRStuvxX ]
  161. [ -E spi@ipaddr algo:secret,... ]
  162. [ -s snaplen ]
  163. EOText;
  164. };
  165. flag = {
  166. name = version;
  167. value = V;
  168. descrip = "Print version information";
  169. flag-code = <<- EOVersion
  170. fprintf(stderr, "tcprewrite version: %s (build %s)", VERSION, svn_version());
  171. #ifdef DEBUG
  172. fprintf(stderr, " (debug)");
  173. #endif
  174. fprintf(stderr, "\n");
  175. fprintf(stderr, "Copyright 2001-2006 by Aaron Turner <aturner at synfin dot net>\n");
  176. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  177. #ifdef HAVE_LIBNET
  178. fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
  179. #else
  180. fprintf(stderr, "Not compiled with libnet.\n");
  181. #endif
  182. fprintf(stderr, "Compiled against libpcap: %s\n", pcap_version);
  183. #ifdef ENABLE_64BITS
  184. fprintf(stderr, "64 bit packet counters: enabled\n");
  185. #else
  186. fprintf(stderr, "64 bit packet counters: disabled\n");
  187. #endif
  188. exit(0);
  189. EOVersion;
  190. doc = "";
  191. };
  192. flag = {
  193. name = less-help;
  194. value = h;
  195. immediate;
  196. descrip = "Display less usage information and exit";
  197. flag-code = <<- EOHelp
  198. USAGE(EXIT_FAILURE);
  199. EOHelp;
  200. doc = "";
  201. };