]> sjero.net Git - iperf/blobdiff - src/Settings.cpp
TCP Congestion Control Module via options
[iperf] / src / Settings.cpp
index 549a9cca9d7523afb8c88e31e72901e3b16f8124..4034158cf261d326965afb4d5496de18700871a4 100644 (file)
@@ -107,6 +107,7 @@ const struct option long_options[] =
 {"reportstyle",required_argument, NULL, 'y'},
 
 // more esoteric options
+{"algorithm",  required_argument, NULL, 'A'},
 {"bind",       required_argument, NULL, 'B'},
 {"compatibility",    no_argument, NULL, 'C'},
 {"daemon",           no_argument, NULL, 'D'},
@@ -152,6 +153,7 @@ const struct option env_options[] =
 {"IPERF_REPORTSTYLE",required_argument, NULL, 'y'},
 
 // more esoteric options
+{"IPERF_CC",         required_argument, NULL, 'A'},
 {"IPERF_BIND",       required_argument, NULL, 'B'},
 {"IPERF_COMPAT",           no_argument, NULL, 'C'},
 {"IPERF_DAEMON",           no_argument, NULL, 'D'},
@@ -172,7 +174,7 @@ const struct option env_options[] =
 #define SHORT_OPTIONS()
 
 const char short_options[] =
-      "12b::c:df:hi:j:l:mn:o:p:rst:uvw:x:y:B:CDF:IJ:L:M:NP:RS:T:UV:W";
+      "12b::c:df:hi:j:l:mn:o:p:rst:uvw:x:y:A:B:CDF:IJ:L:M:NP:RS:T:UV:W";
 
 /* -------------------------------------------------------------------
  * defaults
@@ -542,6 +544,11 @@ void Settings_Interpret( char option, const char *optarg, thread_Settings *mExtS
 
 
             // more esoteric options
+        case 'A': // set TCP congestion control algorithm
+            mExtSettings->congAlgo = new char[ strlen( optarg ) + 1 ];
+            strcpy( mExtSettings->congAlgo, optarg );
+            break;
+
         case 'B': // specify bind address
             mExtSettings->mLocalhost = new char[ strlen( optarg ) + 1 ];
             strcpy( mExtSettings->mLocalhost, optarg );