X-Git-Url: http://sjero.net/git/?p=iperf;a=blobdiff_plain;f=src%2FSettings.cpp;fp=src%2FSettings.cpp;h=3cb619faf3bd36ef257ec383b94f0cb8e153beb2;hp=15b5ccd532b5a88605f40a8d96798f722f4500bf;hb=a660a50b3e9e08f71aee558f3a51d002bee05be7;hpb=4a61594d8e95e2d9662816ae595f8257b69012eb diff --git a/src/Settings.cpp b/src/Settings.cpp index 15b5ccd..3cb619f 100644 --- a/src/Settings.cpp +++ b/src/Settings.cpp @@ -101,6 +101,7 @@ const struct option long_options[] = {"server", no_argument, NULL, 's'}, {"time", required_argument, NULL, 't'}, {"udp", no_argument, NULL, 'u'}, +{"udplite", required_argument, NULL, 'u'}, {"version", no_argument, NULL, 'v'}, {"window", required_argument, NULL, 'w'}, {"reportexclude", required_argument, NULL, 'x'}, @@ -174,7 +175,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:A:B:CDF:IJ:L:M:NP:RS:T:UV:W"; + "12b::c:df:hi:j:l:mn:o:p:rst:u::vw:x:y:A:B:CDF:IJ:L:M:NP:RS:T:UV:W"; /* ------------------------------------------------------------------- * defaults @@ -472,8 +473,16 @@ void Settings_Interpret( char option, const char *optarg, thread_Settings *mExtS mExtSettings->mAmount = (int) (atof( optarg ) * 100.0); break; - case 'u': // UDP instead of TCP - mExtSettings->mProtocol = kProto_UDP; + case 'u': // UDP(-Lite) instead of TCP + if (optarg) { + mExtSettings->mProtocol = kProto_UDPLITE; + // Set partial checksum coverage: + // - 0 means entire datagram, + // - 1..7 is illegal and will be rounded up to 8; + // - 8 and greater mean genuine partial coverage. + mExtSettings->cscov = atoi(optarg); + } else + mExtSettings->mProtocol = kProto_UDP; setPacketOriented(mExtSettings); // if -b has already been processed, UDP rate will