extern const char wait_server_threads[];
+extern const char dccp_byte_stream_mode[];
+
+extern const char dccp_ccid_default[];
+
+extern const char dccp_ccid_val[];
+
/* -------------------------------------------------------------------
* reports
* ------------------------------------------------------------------- */
int mBufLen; // -l
int mMSS; // -M
int mWinSize; // -w
+ int mCCID; //-Z
/* flags is a BitMask of old bools
bool mBufLenSet; // -l
bool mCompat; // -C
int mBufLen; // -l
int mMSS; // -M
int mWinSize; // -w
+ int mCCID; // -Z
/* flags is a BitMask of old bools
bool mBufLenSet; // -l
bool mCompat; // -C
/* UDP-Lite specific definitions and includes */
#ifdef IPPROTO_UDPLITE
-#include <netinet/udplite.h>
+/*#include <netinet/udplite.h> Ubuntu doesn't have this header*/
+#include "udplite.h"
#else
#define IPPROTO_UDPLITE 136
#define SOL_UDPLITE 136
-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\
+ -Z, --ccid # Set DCCP congestion control algorithm\n\
\n\
Server specific:\n\
-s, --server run in server mode\n\
const char wait_server_threads[] =
"Waiting for server threads to complete. Interrupt again to force quit.\n";
+const char dccp_byte_stream_mode[]=
+"NOTE: running in bytestream-mode (maximum speed)\n";
+
+const char dccp_ccid_default[]=
+"CCID: (default)\n";
+
+const char dccp_ccid_val[]=
+"CCID: %i\n";
+
/* -------------------------------------------------------------------
* reports
* ------------------------------------------------------------------- */
rc = setsockopt( inSettings->mSock, SOL_DCCP, DCCP_SOCKOPT_SERVICE,
&val, len );
WARN_errno( rc == SOCKET_ERROR, "setsockopt DCCP_SOCKOPT_SERVICE" );
+
+ if(inSettings->mCCID!=0){
+ char cv=inSettings->mCCID;
+ rc=setsockopt( inSettings->mSock, SOL_DCCP, DCCP_SOCKOPT_CCID,
+ &cv, sizeof(cv));
+
+ WARN_errno( rc == SOCKET_ERROR, "Error Setting CCID");
+ }
}
// UDP-Lite specific options
if ( inSettings->mProtocol == kProto_UDPLITE ) {
data->mThreadMode != kMode_Listener);
win_requested = data->mWinSize;
- printf( seperator_line );
+ printf(seperator_line);
if ( data->mThreadMode == kMode_Listener ) {
printf( server_port,
protoName(data->mProtocol),
data->mBufLen );
if (SockAddr_isMulticast((struct sockaddr *)&data->connection.peer))
printf( multicast_ttl, data->info.mTTL);
- } else if (data->mProtocol == kProto_DCCP)
- printf("NOTE: running in bytestream-mode (maximum speed)\n");
+ } else if (data->mProtocol == kProto_DCCP){
+ printf(dccp_byte_stream_mode);
+ }
+
+ if (data->mProtocol == kProto_DCCP){
+ if(data->mCCID==0){
+ printf(dccp_ccid_default);
+ }else{
+ printf(dccp_ccid_val,data->mCCID);
+ }
+ }
byte_snprintf( buffer, sizeof(buffer), win,
toupper( data->info.mFormat));
data->info.congAlgo = agent->congAlgo;
data->connection.peer = agent->peer;
data->connection.local = agent->local;
+ data->mCCID=agent->mCCID;
#ifdef HAVE_THREAD
/*
{"single_udp", no_argument, NULL, 'U'},
{"ipv6_domian", no_argument, NULL, 'V'},
{"suggest_win_size", no_argument, NULL, 'W'},
+{"ccid", required_argument, NULL, 'Z'},
{0, 0, 0, 0}
};
{"IPERF_SINGLE_UDP", no_argument, NULL, 'U'},
{"IPERF_IPV6_DOMAIN", no_argument, NULL, 'V'},
{"IPERF_SUGGEST_WIN_SIZE", required_argument, NULL, 'W'},
+{"IPERF_CCID", required_argument, NULL, 'Z'},
{0, 0, 0, 0}
};
#define SHORT_OPTIONS()
const char short_options[] =
- "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";
+ "12b::c:df:hi:j:l:mn:o:p:rst:uvw:x:y:A:B:CDF:IJ:L:M:NP:RS:T:UV:WZ:";
/* -------------------------------------------------------------------
* defaults
fprintf( stderr, "The -W option is not available in this release\n");
break;
+ case 'Z': //DCCP CCID
+ mExtSettings->mCCID=atoi(optarg);
+ if(mExtSettings->mCCID > 255 || mExtSettings->mCCID<=0){
+ fprintf( stderr, "CCID %s is invalid\n", optarg);
+ }
+ break;
+
default: // ignore unknown
break;
}