123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426 |
- autogen definitions options;
- copyright = {
- date = "2000-2007";
- owner = "Aaron Turner";
- type = "bsd";
- author = <<- EOText
- Copyright 2000-2007 Aaron Turner
- For support please use the tcpreplay-users@lists.sourceforge.net mailing list.
- The latest version of this software is always available from:
- http://tcpreplay.synfin.net/
- EOText;
- };
- package = "tcpreplay";
- prog-name = "tcpreplay";
- prog-title = "Replay network traffic stored in pcap files";
- long-opts;
- gnu-usage;
- help-value = "H";
- save-opts-value = "";
- load-opts-value = "";
- argument = "<pcap_file(s)>";
- config-header = "config.h";
- include = "#include \"defines.h\"\n"
- "#include \"tcpreplay.h\"\n"
- "#include \"common.h\"\n"
- "#include \"config.h\"\n"
- "#include <stdlib.h>\n"
- "#include <sys/types.h>\n"
- "#include <unistd.h>\n"
- "extern tcpreplay_opt_t options;\n";
- homerc = "$$/";
- #ifdef TCPREPLAY_EDIT
- #include tcpedit/tcpedit_opts.def
- #endif
- explain = <<- EOExplain
- tcpreplay is a tool for replaying network traffic from files saved with
- tcpdump or other tools which write pcap(3) files.
- EOExplain;
- detail = <<- EODetail
- The basic operation of tcpreplay is to resend all packets from the
- input file(s) at the speed at which they were recorded, or a specified
- data rate, up to as fast as the hardware is capable.
- Optionally, the traffic can be split between two interfaces, written to
- files, filtered and edited in various ways, providing the means to test
- firewalls, NIDS and other network devices.
- For more details, please see the Tcpreplay Manual at:
- http://tcpreplay.synfin.net/trac/wiki/manual
- EODetail;
- man-doc = <<- EOMan
- .SH "SIGNALS"
- tcpreplay understands the following signals:
- @enumerate
- @item @var{SIGUSR1}
- Suspend tcpreplay
- @item @var{SIGCONT}
- Restart tcpreplay
- @end enumerate
- .SH "SEE ALSO"
- tcpdump(1), tcpprep(1), tcprewrite(1), libnet(3)
- .SH "BUGS"
- tcpreplay can only send packets as fast as your computer's interface,
- processor, disk and system bus will allow.
- Replaying captured traffic may simulate odd or broken conditions on your
- network and cause problems.
- In most cases, you can not replay traffic back to/at a server.
- Some operating systems by default do not allow for forging source MAC
- addresses. Please consult your operating system's documentation and the
- tcpreplay FAQ if you experiance this issue.
- EOMan;
- flag = {
- ifdef = DEBUG;
- name = dbug;
- value = d;
- arg-type = number;
- max = 1;
- immediate;
- arg-range = "0->5";
- arg-default = 0;
- descrip = "Enable debugging output";
- doc = <<- EOText
- If configured with --enable-debug, then you can specify a verbosity
- level for debugging output. Higher numbers increase verbosity.
- EOText;
- };
- flag = {
- name = quiet;
- value = q;
- descrip = "Quiet mode";
- doc = "Print nothing except the statistics at the end of the run";
- };
- flag = {
- name = accurate;
- value = a;
- max = 1;
- flags-cant = accurate2;
- descrip = "Enable more accurate packet timing";
- doc = <<- EOText
- Enables more accurate timing between packets at the cost of higher
- CPU utilization by using the gettimeofday() system call. This method
- works better on some systems then others and may have rather non-granular
- resolution which makes it problematic for replaying at high rates of speed.
- EOText;
- };
- flag = {
- name = accurate2;
- max = 1;
- flags-cant = accurate;
- arg-type = number;
- descrip = "Enable even more accurate packet timing";
- doc = <<- EOText
- Enables the "even more" accurate timing at the cost of higher CPU
- utilization by using a tight loop which increments a counter. This method
- provides the most accurate timing of any option, but requires you to specify
- a cost for each loop. This cost value is VERY system dependent, so you will
- need to run --loop-test to get this value.
- EOText;
- };
- /* Verbose decoding via tcpdump */
- flag = {
- ifdef = ENABLE_VERBOSE;
- name = verbose;
- value = v;
- max = 1;
- immediate;
- descrip = "Print decoded packets via tcpdump to STDOUT";
- settable;
- doc = "";
- };
- flag = {
- ifdef = ENABLE_VERBOSE;
- 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 like: -A "-axxx" so that they are not interpreted
- by tcpreplay. Please see the tcpdump(1) man page for a complete list of
- options.
- EOText;
- };
- /* Cache files to internal memory */
- flag = {
- name = enable_file_cache;
- value = C;
- flags-must = loop;
- descrip = "Enable caching of packets to internal memory";
- doc = <<- EOText
- Cache pcap file(s) the first time they are cached in RAM so that subsequent
- loops don't incurr any disk I/O latency in order to increase performance. Make
- sure you have enough free RAM to store the entire pcap file(s) in memory or the
- system will swap and performance will suffer.
- EOText;
- };
- /*
- * Output modifiers: -c
- */
- flag = {
- name = cachefile;
- value = c;
- arg-type = string;
- max = 1;
- descrip = "Split traffic via a tcppep cache file";
- doc = "";
- };
- /*
- * Outputs: -i, -I
- */
- flag = {
- name = intf1;
- value = i;
- arg-type = string;
- max = 1;
- must-set;
- descrip = "Server/primary traffic output interface";
- doc = "";
- };
- flag = {
- name = intf2;
- value = I;
- arg-type = string;
- max = 1;
- flags-must = cachefile;
- descrip = "Client/secondary traffic output interface";
- doc = "";
- };
- flag = {
- ifdef = ENABLE_PCAP_FINDALLDEVS;
- name = listnics;
- value = N;
- descrip = "List available network interfaces and exit";
- immediate;
- doc = "";
- flag-code = <<- EOFlag
-
- interface_list_t *list = get_interface_list();
- list_interfaces(list);
- free(list);
- exit(0);
-
- EOFlag;
- };
- /*
- * Limits and loops: -l
- */
- flag = {
- name = loop;
- value = l;
- arg-type = number;
- arg-range = "0->";
- max = 1;
- descrip = "Loop through the capture file X times";
- arg-default = 1;
- doc = "";
- };
- flag = {
- name = pktlen;
- value = S;
- max = 1;
- descrip = "Override the snaplen and use the actual packet len";
- doc = <<- EOText
- By default, tcpreplay will send packets based on the size of the "snaplen"
- stored in the pcap file which is usually the correct thing to do. However,
- occasionally, tools will store more bytes then told to. By specifying this
- option, tcpreplay will ignore the snaplen field and instead try to send
- packets based on the original packet length. Bad things may happen if
- you specify this option.
- EOText;
- };
- flag = {
- name = limit;
- value = L;
- arg-type = number;
- max = 1;
- arg-default = -1;
- arg-range = "1->";
- descrip = "Limit the number of packets to send";
- doc = <<- EOText
- By default, tcpreplay will send all the packets. Alternatively, you can
- specify a maximum number of packets to send.
- EOText;
- };
- /*
- * Replay speed modifiers: -m, -p, -r, -R, -o
- */
- /* note that this is really a float, but autoopts does not support float */
- flag = {
- name = multiplier;
- flags-cant = pps;
- flags-cant = mbps;
- flags-cant = oneatatime;
- flags-cant = topspeed;
- value = m;
- arg-type = string;
- max = 1;
- descrip = "Modify replay speed to a given multiple";
- doc = <<- EOText
- Specify a floating point value to modify the packet replay speed.
- Examples:
- @example
- 2.0 will replay traffic at twice the speed captured
- 0.7 will replay traffic at 70% the speed captured
- @end example
- EOText;
- };
- flag = {
- name = pps;
- flags-cant = multiplier;
- flags-cant = mbps;
- flags-cant = oneatatime;
- flags-cant = topspeed;
- value = p;
- arg-type = number;
- max = 1;
- descrip = "Replay packets at a given packets/sec";
- doc = "";
- };
- flag = {
- name = mbps;
- flags-cant = multiplier;
- flags-cant = pps;
- flags-cant = oneatatime;
- flags-cant = topspeed;
- value = M;
- arg-type = string;
- max = 1;
- descrip = "Replay packets at a given Mbps";
- doc = <<- EOText
- Specify a floating point value for the Mbps rate that tcpreplay
- should send packets at.
- EOText;
- };
- flag = {
- name = topspeed;
- flags-cant = mbps;
- flags-cant = multiplier;
- flags-cant = pps;
- flags-cant = oneatatime;
- value = t;
- descrip = "Replay packets as fast as possible";
- doc = "";
- };
- flag = {
- name = oneatatime;
- flags-cant = mbps;
- flags-cant = pps;
- flags-cant = multiplier;
- flags-cant = topspeed;
- value = o;
- descrip = "Replay one packet at a time for each user input";
- doc = <<- EOText
- Allows you to step through one or more packets at a time.
- EOText;
- };
- flag = {
- name = pid;
- value = P;
- descrip = "Print the PID of tcpreplay at startup";
- flag-code = <<- EOPid
-
- fprintf(stderr, "PID: %hu\n", getpid());
-
- EOPid;
- doc = "";
- };
- flag = {
- name = version;
- value = V;
- descrip = "Print version information";
- flag-code = <<- EOVersion
-
- fprintf(stderr, "tcpreplay version: %s (build %s)", VERSION, svn_version());
- #ifdef DEBUG
- fprintf(stderr, " (debug)");
- #endif
- fprintf(stderr, "\n");
- fprintf(stderr, "Copyright 2001-2007 by Aaron Turner <aturner at synfin dot net>\n");
- fprintf(stderr, "Cache file supported: %s\n", CACHEVERSION);
- #ifdef HAVE_LIBNET
- fprintf(stderr, "Compiled against libnet: %s\n", LIBNET_VERSION);
- #else
- fprintf(stderr, "Not compiled with libnet.\n");
- #endif
- #ifdef HAVE_WINPCAP
- fprintf(stderr, "Compiled against winpcap: %s\n", get_pcap_version());
- #else
- fprintf(stderr, "Compiled against libpcap: %s\n", get_pcap_version());
- #endif
- #ifdef ENABLE_64BITS
- fprintf(stderr, "64 bit packet counters: enabled\n");
- #else
- fprintf(stderr, "64 bit packet counters: disabled\n");
- #endif
- #ifdef ENABLE_VERBOSE
- fprintf(stderr, "Verbose printing via tcpdump: enabled\n");
- #else
- fprintf(stderr, "Verbose printing via tcpdump: 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 = "";
- };
|