autogen definitions options; copyright = { date = "2004-2005"; owner = "Aaron Turner"; type = "bsd"; author = <<- EOText Copyright 2004-2005 Aaron Turner For support please use the tcpreplay-users@lists.sourceforge.net mailing list. EOText; }; package = "tcprewrite"; prog-name = "tcprewrite"; prog-title = "Rewrite the packets in a pcap file."; long-opts; gnu-usage; help-value = "H"; save-opts-value = ""; load-opts-value = ""; #include tcpedit/tcpedit_opts.def detail = <<- EOText Tcprewrite is a tool to rewrite packets stored in @file{pcap(3)} file format, such as crated by tools such as @file{tcpdump(1)} and @file{ethereal(1)}. Once a pcap file has had it's packets rewritten, they can be replayed back out on the network using @file{tcpreplay(1)}. tcprewrite currently supports the following DLT types: * DLT_C_HDLC * DLT_EN10MB * DLT_LINUX_SSL * DLT_RAW The packet editing features of tcprewrite which distinguish between "client" and "server" traffic requires a tcpprep(1) cache file. EOText; man-doc = <<- EOMan .SH "SEE ALSO" tcpdump(1), tcpprep(1), tcpreplay(1) EOMan; config-header = "config.h"; include = "#include \"defines.h\"\n" "#include \"common.h\"\n" "#include \"tcprewrite.h\"\n" "#include \"mac.h\"\n" "extern char pcap_version[];\n" "extern tcprewrite_opt_t options;\n"; homerc = "$$/"; flag = { name = dbug; value = d; arg-type = number; descrip = "Enable debugging output"; arg-range = "0->5"; arg-default = 0; max = 1; immediate; doc = <<- EOText If configured with --enable-debug, then you can specify a verbosity level for debugging output. Higher numbers increase verbosity. EOText; }; flag = { name = infile; value = i; arg-type = string; descrip = "Input pcap file to be processed"; max = 1; immediate; must-set; doc = ""; }; flag = { name = outfile; value = o; arg-type = string; descrip = "Output pcap file"; max = 1; must-set; doc = ""; /* options.outfile is set in post_args, because we need to make * sure that options.infile is processed first */ }; flag = { name = cachefile; value = c; arg-type = string; max = 1; descrip = "Split traffic via tcpprep cache file"; settable; flag-code = <<- EOCachefile options.cache_packets = read_cache(&options.cachedata, OPT_ARG(CACHEFILE), &options.comment); EOCachefile; doc = <<- EOText Use tcpprep cache file to split traffic based upon client/server relationships. EOText; }; /* Verbose decoding via tcpdump */ flag = { ifdef = HAVE_TCPDUMP; name = verbose; value = v; max = 1; immediate; descrip = "Print decoded packets via tcpdump to STDOUT"; settable; doc = ""; }; flag = { ifdef = HAVE_TCPDUMP; name = decode; flags-must = verbose; value = A; arg-type = string; max = 1; descrip = "Arguments passed to tcpdump decoder"; doc = <<- EOText When enabling verbose mode (@var{-v}) you may also specify one or more additional arguments to pass to @code{tcpdump} to modify the way packets are decoded. By default, -n and -l are used. Be sure to quote the arguments so that they are not interpreted by tcprewrite. The following arguments are valid: [ -aAeNqRStuvxX ] [ -E spi@ipaddr algo:secret,... ] [ -s snaplen ] EOText; }; flag = { name = version; value = V; descrip = "Print version information"; flag-code = <<- EOVersion fprintf(stderr, "tcprewrite version: %s (build %s)", VERSION, svn_version()); #ifdef DEBUG fprintf(stderr, " (debug)"); #endif fprintf(stderr, "\n"); fprintf(stderr, "Copyright 2001-2006 by Aaron Turner \n"); fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION); fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION); fprintf(stderr, "Compiled against libpcap: %s\n", pcap_version); #ifdef ENABLE_64BITS fprintf(stderr, "64 bit packet counters: enabled\n"); #else fprintf(stderr, "64 bit packet counters: disabled\n"); #endif exit(0); EOVersion; doc = ""; }; flag = { name = less-help; value = h; immediate; descrip = "Display less usage information and exit"; flag-code = <<- EOHelp USAGE(EXIT_FAILURE); EOHelp; doc = ""; };