From 1e12002c828280c2143d24788effce7c91ce56d1 Mon Sep 17 00:00:00 2001 From: Jon Dugan Date: Wed, 2 Apr 2008 08:25:36 +0000 Subject: [PATCH] worked in Claus Klein's help string patches removed silly #error from the congestion patch preliminary manpage (!) bumped version number to 2.0.4 changed email address to iperf-users@lists.sourceforge.net removed duplicate help strings --- include/Locale.h | 4 -- include/version.h | 4 +- man/iperf.1 | 148 ++++++++++++++++++++++++++++++++++++++++++++ src/Locale.c | 67 +++----------------- src/ReportDefault.c | 2 + src/Settings.cpp | 9 +-- 6 files changed, 164 insertions(+), 70 deletions(-) create mode 100644 man/iperf.1 diff --git a/include/Locale.h b/include/Locale.h index 926b47a..241289a 100644 --- a/include/Locale.h +++ b/include/Locale.h @@ -63,12 +63,8 @@ extern "C" { extern const char usage_short[]; -#ifdef WIN32 extern const char usage_long1[]; extern const char usage_long2[]; -#else -extern const char usage_long[]; -#endif extern const char version[]; diff --git a/include/version.h b/include/version.h index 04e20e2..8e4744b 100644 --- a/include/version.h +++ b/include/version.h @@ -1,2 +1,2 @@ -#define IPERF_VERSION "2.0.3" -#define IPERF_VERSION_DATE "18 Mar 2008" +#define IPERF_VERSION "2.0.4" +#define IPERF_VERSION_DATE "4 Apr 2008" diff --git a/man/iperf.1 b/man/iperf.1 new file mode 100644 index 0000000..b6e4ce5 --- /dev/null +++ b/man/iperf.1 @@ -0,0 +1,148 @@ +.TH IPERF 1 "APRIL 2008" NLANR/DAST "User Manuals" +.SH NAME +iperf \- perform network throughput tests +.SH SYNOPSIS +.B iperf -s [ +.I options +.B ] + +.B iperf -c +.I server +.B [ +.I options +.B ] + +.B iperf -u -s [ +.I options +.B ] + +.B iperf -u -c +.I server +.B [ +.I options +.B ] +.SH DESCRIPTION +iperf is a tool for performing network throughput measurements. It can test +either TCP or UDP throughput. To perform an iperf test the user must +establish both a server (to discard traffic) and a client (to generate +traffic). +.SH "GENERAL OPTIONS" +.TP +.BR -f ", " --format " " +[kmKM] format to report: Kbits, Mbits, KBytes, MBytes +.TP +.BR -h ", " --help " " +print a help synopsis +.TP +.BR -i ", " --interval " \fIn\fR" +pause \fIn\fR seconds between periodic bandwidth reports +.TP +.BR -l ", " --len " \fIn\fR[KM]" +set length read/write buffer to \fIn\fR (default 8 KB) +.TP +.BR -m ", " --print_mss " " +print TCP maximum segment size (MTU - TCP/IP header) +.TP +.BR -o ", " --output " " +output the report or error message to this specified file +.TP +.BR -p ", " --port " \fIn\fR" +set server port to listen on/connect to to \fIn\fR (default 5001) +.TP +.BR -u ", " --udp " " +use UDP rather than TCP +.TP +.BR -w ", " --window " \fIn\fR[KM]" +TCP window size (socket buffer size) +.TP +.BR -B ", " --bind " " +bind to , an interface or multicast address +.TP +.BR -C ", " --compatibility " " +for use with older versions does not sent extra msgs +.TP +.BR -M ", " --mss " \fIn\fR" +set TCP maximum segment size (MTU - 40 bytes) +.TP +.BR -N ", " --nodelay " " +set TCP no delay, disabling Nagle's Algorithm +.TP +.BR -v ", " --version " " +print version information and quit +.TP +.BR -V ", " --IPv6Version " " +Set the domain to IPv6 +.TP +.BR -x ", " --reportexclude " " +[CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports +.TP +.BR -y ", " --reportstyle " C|c" +if set to C or c report results as CSV (comma separated values) +.SH "SERVER SPECIFIC OPTIONS" +.TP +.BR -s ", " --server " " +run in server mode +.TP +.BR -U ", " --single_udp " " +run in single threaded UDP mode +.TP +.BR -D ", " --daemon " " +run the server as a daemon +.SH "CLIENT SPECIFIC OPTIONS" +.TP +.BR -b ", " --bandwidth " \fIn\fR[KM]" +set target bandwidth to \fIn\fR bits/sec (default 1 Mbit/sec). +This setting requires UDP (-u). +.TP +.BR -c ", " --client " " +run in client mode, connecting to +.TP +.BR -d ", " --dualtest " " +Do a bidirectional test simultaneously +.TP +.BR -n ", " --num " \fIn\fR[KM]" +number of bytes to transmit (instead of -t) +.TP +.BR -r ", " --tradeoff " " +Do a bidirectional test individually +.TP +.BR -t ", " --time " \fIn\fR" +time in seconds to transmit for (default 10 secs) +.TP +.BR -F ", " --fileinput " " +input the data to be transmitted from a file +.TP +.BR -I ", " --stdin " " +input the data to be transmitted from stdin +.TP +.BR -L ", " --listenport " \fIn\fR" +port to recieve bidirectional tests back on +.TP +.BR -P ", " --parallel " \fIn\fR" +number of parallel client threads to run +.TP +.BR -T ", " --ttl " \fIn\fR" +time-to-live, for multicast (default 1) +.TP +.BR -Z ", " --linux-congestion " " +set TCP congestion control algorithm (Linux only) +.SH ENVIRONMENT +.TP +.BR TCP_WINDOW_SIZE +Controls the size of TCP buffers. +.SH DIAGNOSTICS +This section needs to be filled in. +.SH BUGS +Exit statuses are inconsistent. +The threading implementation is rather heinous. +.SH AUTHORS +Iperf was originally written by Mark Gates and Alex Warshavsky. +Man page and maintence by Jon Dugan . +Other contributions from Ajay Tirumala, Jim Ferguson, +Feng Qin, +Kevin Gibbs, +John Estabrook , +Andrew Gallatin , +Stephen Hemminger +.SH "SEE ALSO" +http://iperf.sourceforge.net/ diff --git a/src/Locale.c b/src/Locale.c index 0f6c297..39bb740 100644 --- a/src/Locale.c +++ b/src/Locale.c @@ -71,7 +71,6 @@ const char usage_short[] = "\ Usage: %s [-s|-c host] [options]\n\ Try `%s --help' for more information.\n"; -#ifdef WIN32 const char usage_long1[] = "\ Usage: iperf [-s|-c host] [options]\n\ iperf [-h|--help] [-v|--version]\n\ @@ -94,8 +93,11 @@ Client/Server:\n\ Server specific:\n\ -s, --server run in server mode\n\ -U, --single_udp run in single threaded UDP mode\n\ - -D, --daemon run the server as a daemon\n\ - -R, --remove remove service in win32\n"; + -D, --daemon run the server as a daemon\n" +#ifdef WIN32 +" -R, --remove remove service in win32\n" +#endif +; const char usage_long2[] = "\ \n\ @@ -112,8 +114,11 @@ Client specific:\n\ -L, --listenport # port to recieve bidirectional tests back on\n\ -P, --parallel # number of parallel client threads to run\n\ -T, --ttl # time-to-live, for multicast (default 1)\n\ + -Z, --linux-congestion set TCP congestion control algorithm (Linux only)\n\ \n\ Miscellaneous:\n\ + -x, --reportexclude [CDMSV] exclude C(connection) D(data) M(multicast) S(settings) V(server) reports\n\ + -y, --reportstyle C report as a Comma-Separated Values\n\ -h, --help print this message and quit\n\ -v, --version print version information and quit\n\ \n\ @@ -123,59 +128,7 @@ The TCP window size option can be set by the environment variable\n\ TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\ IPERF_, such as IPERF_BANDWIDTH.\n\ \n\ -Report bugs to \n"; - -#else -const char usage_long[] = "\ -Usage: iperf [-s|-c host] [options]\n\ - iperf [-h|--help] [-v|--version]\n\ -\n\ -Client/Server:\n\ - -f, --format [kmKM] format to report: Kbits, Mbits, KBytes, MBytes\n\ - -i, --interval # seconds between periodic bandwidth reports\n\ - -l, --len #[KM] length of buffer to read or write (default 8 KB)\n\ - -m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)\n\ - -p, --port # server port to listen on/connect to\n\ - -u, --udp use UDP rather than TCP\n\ - -w, --window #[KM] TCP window size (socket buffer size)\n\ - -B, --bind bind to , an interface or multicast address\n\ - -C, --compatibility for use with older versions does not sent extra msgs\n\ - -M, --mss # set TCP maximum segment size (MTU - 40 bytes)\n\ - -N, --nodelay set TCP no delay, disabling Nagle's Algorithm\n\ - -V, --IPv6Version Set the domain to IPv6\n\ -\n\ -Server specific:\n\ - -s, --server run in server mode\n\ - -U, --single_udp run in single threaded UDP mode\n\ - -D, --daemon run the server as a daemon\n\ -\n\ -Client specific:\n\ - -b, --bandwidth #[KM] for UDP, bandwidth to send at in bits/sec\n\ - (default 1 Mbit/sec, implies -u)\n\ - -c, --client run in client mode, connecting to \n\ - -d, --dualtest Do a bidirectional test simultaneously\n\ - -n, --num #[KM] number of bytes to transmit (instead of -t)\n\ - -r, --tradeoff Do a bidirectional test individually\n\ - -t, --time # time in seconds to transmit for (default 10 secs)\n\ - -F, --fileinput input the data to be transmitted from a file\n\ - -I, --stdin input the data to be transmitted from stdin\n\ - -L, --listenport # port to recieve bidirectional tests back on\n\ - -P, --parallel # number of parallel client threads to run\n\ - -T, --ttl # time-to-live, for multicast (default 1)\n\ - --linux-congestion set TCP congestion control algorithm (Linux only)\n\ -\n\ -Miscellaneous:\n\ - -h, --help print this message and quit\n\ - -v, --version print version information and quit\n\ -\n\ -[KM] Indicates options that support a K or M suffix for kilo- or mega-\n\ -\n\ -The TCP window size option can be set by the environment variable\n\ -TCP_WINDOW_SIZE. Most other options can be set by an environment variable\n\ -IPERF_, such as IPERF_BANDWIDTH.\n\ -\n\ -Report bugs to \n"; -#endif +Report bugs to \n"; // include a description of the threading in the version #if defined( HAVE_POSIX_THREAD ) @@ -375,7 +328,7 @@ const char warn_invalid_report_style[] = "WARNING: unknown reporting style \"%s\", switching to default\n"; const char warn_invalid_report[] = -"WARNING: unknown reporting type \"%c\"\n"; +"WARNING: unknown reporting type \"%c\", ignored\n valid options are:\n\t exclude: C(connection) D(data) M(multicast) S(settings) V(server) report\n\n"; #ifdef __cplusplus } /* end extern "C" */ diff --git a/src/ReportDefault.c b/src/ReportDefault.c index 7944e03..b2b0aee 100644 --- a/src/ReportDefault.c +++ b/src/ReportDefault.c @@ -76,11 +76,13 @@ void reporter_printstats( Transfer_Info *stats ) { if ( stats->mUDP != (char)kMode_Server ) { // TCP Reporting + printf( report_bw_header); printf( report_bw_format, stats->transferID, stats->startTime, stats->endTime, buffer, &buffer[sizeof(buffer)/2] ); } else { // UDP Reporting + printf( report_bw_jitter_loss_header); printf( report_bw_jitter_loss_format, stats->transferID, stats->startTime, stats->endTime, buffer, &buffer[sizeof(buffer)/2], diff --git a/src/Settings.cpp b/src/Settings.cpp index c6c7762..6535cbd 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -118,9 +118,9 @@ const struct option long_options[] = {"tos", required_argument, NULL, 'S'}, {"ttl", required_argument, NULL, 'T'}, {"single_udp", no_argument, NULL, 'U'}, -{"ipv6_domian", no_argument, NULL, 'V'}, +{"ipv6_domain", no_argument, NULL, 'V'}, {"suggest_win_size", no_argument, NULL, 'W'}, -{"congestion", required_argument, NULL, 'Z'}, +{"linux-congestion", required_argument, NULL, 'Z'}, {0, 0, 0, 0} }; @@ -375,12 +375,8 @@ void Settings_Interpret( char option, const char *optarg, thread_Settings *mExtS break; case 'h': // print help and exit -#ifndef WIN32 - fprintf( stderr, usage_long ); -#else fprintf(stderr, usage_long1); fprintf(stderr, usage_long2); -#endif exit(1); break; @@ -672,7 +668,6 @@ void Settings_Interpret( char option, const char *optarg, thread_Settings *mExtS mExtSettings->mCongestion = new char[strlen(optarg)+1]; strcpy( mExtSettings->mCongestion, optarg); #else -#error fix includes fprintf( stderr, "The -Z option is not available on this operating system\n"); #endif break;