tcprewrite_opts.def 4.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. autogen definitions options;
  2. copyright = {
  3. date = "2004-2005";
  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 \"tcprewrite.h\"\n"
  41. "#include \"mac.h\"\n"
  42. "extern char pcap_version[];\n"
  43. "extern tcprewrite_opt_t options;\n";
  44. homerc = "$$/";
  45. flag = {
  46. name = dbug;
  47. value = d;
  48. arg-type = number;
  49. descrip = "Enable debugging output";
  50. arg-range = "0->5";
  51. arg-default = 0;
  52. max = 1;
  53. immediate;
  54. doc = <<- EOText
  55. If configured with --enable-debug, then you can specify a verbosity
  56. level for debugging output. Higher numbers increase verbosity.
  57. EOText;
  58. };
  59. flag = {
  60. name = infile;
  61. value = i;
  62. arg-type = string;
  63. descrip = "Input pcap file to be processed";
  64. max = 1;
  65. immediate;
  66. must-set;
  67. doc = "";
  68. };
  69. flag = {
  70. name = outfile;
  71. value = o;
  72. arg-type = string;
  73. descrip = "Output pcap file";
  74. max = 1;
  75. must-set;
  76. doc = "";
  77. /* options.outfile is set in post_args, because we need to make
  78. * sure that options.infile is processed first
  79. */
  80. };
  81. flag = {
  82. name = cachefile;
  83. value = c;
  84. arg-type = string;
  85. max = 1;
  86. descrip = "Split traffic via tcpprep cache file";
  87. settable;
  88. flag-code = <<- EOCachefile
  89. options.cache_packets =
  90. read_cache(&options.cachedata, OPT_ARG(CACHEFILE), &options.comment);
  91. EOCachefile;
  92. doc = <<- EOText
  93. Use tcpprep cache file to split traffic based upon client/server relationships.
  94. EOText;
  95. };
  96. /* Verbose decoding via tcpdump */
  97. flag = {
  98. ifdef = HAVE_TCPDUMP;
  99. name = verbose;
  100. value = v;
  101. max = 1;
  102. immediate;
  103. descrip = "Print decoded packets via tcpdump to STDOUT";
  104. settable;
  105. doc = "";
  106. };
  107. flag = {
  108. ifdef = HAVE_TCPDUMP;
  109. name = decode;
  110. flags-must = verbose;
  111. value = A;
  112. arg-type = string;
  113. max = 1;
  114. descrip = "Arguments passed to tcpdump decoder";
  115. doc = <<- EOText
  116. When enabling verbose mode (@var{-v}) you may also specify one or
  117. more additional arguments to pass to @code{tcpdump} to modify
  118. the way packets are decoded. By default, -n and -l are used.
  119. Be sure to quote the arguments so that they are not interpreted
  120. by tcprewrite. The following arguments are valid:
  121. [ -aAeNqRStuvxX ]
  122. [ -E spi@ipaddr algo:secret,... ]
  123. [ -s snaplen ]
  124. EOText;
  125. };
  126. flag = {
  127. name = version;
  128. value = V;
  129. descrip = "Print version information";
  130. flag-code = <<- EOVersion
  131. fprintf(stderr, "tcprewrite version: %s (build %s)", VERSION, svn_version());
  132. #ifdef DEBUG
  133. fprintf(stderr, " (debug)");
  134. #endif
  135. fprintf(stderr, "\n");
  136. fprintf(stderr, "Copyright 2001-2006 by Aaron Turner <aturner@synfin.net>\n");
  137. fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
  138. fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
  139. fprintf(stderr, "Compiled against libpcap: %s\n", pcap_version);
  140. #ifdef ENABLE_64BITS
  141. fprintf(stderr, "64 bit packet counters: enabled\n");
  142. #else
  143. fprintf(stderr, "64 bit packet counters: disabled\n");
  144. #endif
  145. exit(0);
  146. EOVersion;
  147. doc = "";
  148. };
  149. flag = {
  150. name = less-help;
  151. value = h;
  152. immediate;
  153. descrip = "Display less usage information and exit";
  154. flag-code = <<- EOHelp
  155. USAGE(EXIT_FAILURE);
  156. EOHelp;
  157. doc = "";
  158. };