diff -ru ./iperf-1.7.0-orig/lib/Socket.cpp ./iperf-1.7.0-rude/lib/Socket.cpp --- ./iperf-1.7.0-orig/lib/Socket.cpp 2003-02-26 13:25:28.000000000 -0700 +++ ./iperf-1.7.0-rude/lib/Socket.cpp 2003-04-20 15:21:52.000000000 -0600 @@ -261,6 +261,15 @@ FAIL_errno( rc == SOCKET_ERROR, "bind" ); } + if (mRude) { + int rude_me=1; + if (setsockopt(mSock, IPPROTO_TCP, TCP_RUDE, &rude_me, sizeof(int))<0) { + printf("ERROR: Could not set socket to be rude; %s\n", strerror(errno)); + } else { + printf("Set socket to be rude.\n"); + } + } + #ifdef DBG_MJZ { // DBG MJZ diff -ru ./iperf-1.7.0-orig/lib/Socket.hpp ./iperf-1.7.0-rude/lib/Socket.hpp --- ./iperf-1.7.0-orig/lib/Socket.hpp 2003-02-24 14:38:10.000000000 -0700 +++ ./iperf-1.7.0-rude/lib/Socket.hpp 2003-04-20 15:18:52.000000000 -0600 @@ -96,6 +96,7 @@ void McastSetTTL( int val, SocketAddr &inAddr ); int mSock; // socket file descriptor (sockfd) + int mRude; unsigned short mPort; // port to listen to bool mUDP; // true for UDP, false for TCP diff -ru ./iperf-1.7.0-orig/src/Client.cpp ./iperf-1.7.0-rude/src/Client.cpp --- ./iperf-1.7.0-orig/src/Client.cpp 2003-02-26 15:36:06.000000000 -0700 +++ ./iperf-1.7.0-rude/src/Client.cpp 2003-04-20 15:28:57.000000000 -0600 @@ -73,6 +73,7 @@ Thread() { mSettings = inSettings; + mRude = inSettings->mRude; // connect Connect( mSettings->mHost, mSettings->mLocalhost ); diff -ru ./iperf-1.7.0-orig/src/Locale.hpp ./iperf-1.7.0-rude/src/Locale.hpp --- ./iperf-1.7.0-orig/src/Locale.hpp 2003-03-03 14:17:08.000000000 -0700 +++ ./iperf-1.7.0-rude/src/Locale.hpp 2003-04-20 15:25:15.000000000 -0600 @@ -73,6 +73,7 @@ -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\ + -e, --rude Set socket to use no congestion control\n\ -m, --print_mss print TCP maximum segment size (MTU - TCP/IP header)\n\ -o, --output output the report or error message to this specified file\n\ -p, --port # server port to listen on/connect to\n\ @@ -126,6 +127,7 @@ -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\ + -e, --rude Set socket to use no congestion control\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\ diff -ru ./iperf-1.7.0-orig/src/Settings.cpp ./iperf-1.7.0-rude/src/Settings.cpp --- ./iperf-1.7.0-orig/src/Settings.cpp 2003-03-03 14:17:08.000000000 -0700 +++ ./iperf-1.7.0-rude/src/Settings.cpp 2003-04-20 15:28:07.000000000 -0600 @@ -86,6 +86,7 @@ {"format", required_argument, NULL, 'f'}, {"help", no_argument, NULL, 'h'}, {"interval", required_argument, NULL, 'i'}, +{"rude", required_argument, NULL, 'e'}, {"len", required_argument, NULL, 'l'}, {"print_mss", no_argument, NULL, 'm'}, {"num", required_argument, NULL, 'n'}, @@ -156,7 +157,7 @@ #define SHORT_OPTIONS() -const char short_options[] = "b:c:df:hi:l:mn:o:p:rst:uvw:B:CDF:IL:M:NP:RS:T:VW"; +const char short_options[] = "b:c:def:hi:l:mn:o:p:rst:uvw:B:CDF:IL:M:NP:RS:T:VW"; /* ------------------------------------------------------------------- * defaults @@ -186,6 +187,7 @@ // skip help // -h, mExtSettings->mBufLenSet = false; // -l, mExtSettings->mBufLen = 8 * 1024; // -l, 8 Kbyte + mExtSettings->mRude = 0; // -e, not rude. mExtSettings->mInterval = 0; // -i, ie. no periodic bw reports mExtSettings->mPrintMSS = false; // -m, don't print MSS // mAmount is time also // -n, N/A @@ -315,6 +317,10 @@ #endif break; + case 'e': // Rude? + mExtSettings->mRude = 1; + break; + case 'f': // format to print in mExtSettings->mFormat = (*optarg); break; diff -ru ./iperf-1.7.0-orig/src/Settings.hpp ./iperf-1.7.0-rude/src/Settings.hpp --- ./iperf-1.7.0-orig/src/Settings.hpp 2003-02-27 15:35:24.000000000 -0700 +++ ./iperf-1.7.0-rude/src/Settings.hpp 2003-04-20 15:26:56.000000000 -0600 @@ -111,6 +111,7 @@ char* mOutputFileName; // -o double mInterval; // -i int mAmount; // -n or -t + int mRude; // -e int mBufLen; // -l int mMSS; // -M int mTCPWin; // -w