[netperf-dev] netperf2 commit notice r531 - trunk/src

raj at netperf.org raj at netperf.org
Wed Feb 1 14:19:45 PST 2012


Author: raj
Date: 2012-02-01 14:19:45 -0800 (Wed, 01 Feb 2012)
New Revision: 531

Modified:
   trunk/src/nettest_dlpi.c
   trunk/src/nettest_sdp.c
   trunk/src/nettest_xti.c
Log:
i am tired of kicking for now

Modified: trunk/src/nettest_dlpi.c
===================================================================
--- trunk/src/nettest_dlpi.c	2012-02-01 22:00:15 UTC (rev 530)
+++ trunk/src/nettest_dlpi.c	2012-02-01 22:19:45 UTC (rev 531)
@@ -57,7 +57,7 @@
 /* these are some variables global to all the DLPI tests. declare */
 /* them static to make them global only to this file */
 
-static int 
+static int
   rsw_size,		/* remote send window size	*/
   rrw_size,		/* remote recv window size	*/
   lsw_size,		/* local  send window size 	*/
@@ -96,12 +96,12 @@
 value, specifying a value with a leading comma will set just the second\n\
 parm, a value with a trailing comma will set just the first. To set\n\
 each parm to unique values, specify both and separate them with a\n\
-comma.\n"; 
+comma.\n";
 
 
 
 /* routines that used to be in src/netlib.c but this code is the only
-   code that uses them. raj 20110111 */ 
+   code that uses them. raj 20110111 */
 
 
 int
@@ -141,7 +141,7 @@
 
   return(0);
 }
-    
+
 int
 dl_open(char devfile[], int ppa)
 {
@@ -198,8 +198,8 @@
     *dlsap_len = bind_ack->dl_addr_length;
     return(0);
   }
-  else { 
-    return (-1); 
+  else {
+    return (-1);
   }
 }
 
@@ -227,7 +227,7 @@
   connection_req->dl_dest_addr_offset = sizeof(dl_connect_req_t);
   connection_req->dl_qos_length = 0;
   connection_req->dl_qos_offset = 0;
-  bcopy (remote_addr, 
+  bcopy (remote_addr,
          (unsigned char *)control_data + sizeof(dl_connect_req_t),
          remote_addr_len);
 
@@ -339,54 +339,54 @@
 /* output to the standard output. */
 
 
-void 
+void
 send_dlpi_co_stream()
 {
-  
+
   char *tput_title = "\
 Recv   Send    Send                          \n\
 Window Window  Message  Elapsed              \n\
 Size   Size    Size     Time     Throughput  \n\
 frames frames  bytes    secs.    %s/sec  \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1 =
     "%5d  %5d  %6d    %-6.2f   %7.2f   \n";
-  
+
   char *cpu_title = "\
 Recv   Send    Send                          Utilization    Service Demand\n\
 Window Window  Message  Elapsed              Send   Recv    Send    Recv\n\
 Size   Size    Size     Time     Throughput  local  remote  local   remote\n\
 frames frames  bytes    secs.    %-8.8s/s  %%      %%       us/KB   us/KB\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f\n";
-  
+
   char *cpu_fmt_1 =
     "%5d  %5d  %6d    %-6.2f     %7.2f   %-6.2f %-6.2f  %-6.3f  %-6.3f\n";
-  
+
   char *ksink_fmt = "\n\
 Alignment      Offset         %-8.8s %-8.8s    Sends   %-8.8s Recvs\n\
 Local  Remote  Local  Remote  Xfered   Per                 Per\n\
 Send   Recv    Send   Recv             Send (avg)          Recv (avg)\n\
 %5d   %5d  %5d   %5d %6.4g  %6.2f     %6d %6.2f   %6d\n";
-  
-  
+
+
   float			elapsed_time;
-  
+
 #ifdef WANT_INTERVALS
   int interval_count;
 #endif /* WANT_INTERVALS */
-  
+
   /* what we want is to have a buffer space that is at least one */
   /* send-size greater than our send window. this will insure that we */
   /* are never trying to re-use a buffer that may still be in the hands */
   /* of the transport. This buffer will be malloc'd after we have found */
   /* the size of the local senc socket buffer. We will want to deal */
   /* with alignment and offset concerns as well. */
-  
+
   struct ring_elt *send_ring;
   char	*message;
   char	*message_ptr;
@@ -396,7 +396,7 @@
   int	*message_int_ptr;
   int	message_offset;
   int	malloc_size;
-  
+
   int	len;
   int	nummessages;
   int	send_descriptor;
@@ -404,28 +404,28 @@
   /* with links like fddi, one can send > 32 bits worth of bytes */
   /* during a test... ;-) */
   double	bytes_sent;
-  
+
 #ifdef DIRTY
   int	i;
 #endif /* DIRTY */
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
   double	thruput;
-  
+
   struct	dlpi_co_stream_request_struct	*dlpi_co_stream_request;
   struct	dlpi_co_stream_response_struct	*dlpi_co_stream_response;
   struct	dlpi_co_stream_results_struct	*dlpi_co_stream_result;
-  
-  dlpi_co_stream_request	= 
+
+  dlpi_co_stream_request	=
     (struct dlpi_co_stream_request_struct *)netperf_request.content.test_specific_data;
   dlpi_co_stream_response	=
     (struct dlpi_co_stream_response_struct *)netperf_response.content.test_specific_data;
-  dlpi_co_stream_result	        = 
+  dlpi_co_stream_result	        =
     (struct dlpi_co_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if ( print_headers ) {
     fprintf(where,"DLPI CO STREAM TEST\n");
     if (local_cpu_usage || remote_cpu_usage)
@@ -433,33 +433,33 @@
     else
       fprintf(where,tput_title,format_units());
   }
-  
+
   /* initialize a few counters */
-  
+
   nummessages	=	0;
   bytes_sent	=	0.0;
   times_up 	= 	0;
-  
+
   /*set up the data descriptor                        */
-  send_descriptor = dl_open(loc_dlpi_device,loc_ppa);  
+  send_descriptor = dl_open(loc_dlpi_device,loc_ppa);
   if (send_descriptor < 0){
     perror("netperf: send_dlpi_co_stream: dlpi stream data descriptor");
     exit(1);
   }
-  
+
   /* bind the puppy and get the assigned dlsap */
   dlsap_len = BUFSIZ;
-  if (dl_bind(send_descriptor, 
+  if (dl_bind(send_descriptor,
               dlpi_sap, DL_CODLS, dlsap, &dlsap_len) != 0) {
     fprintf(where,"send_dlpi_co_rr: bind failure\n");
     fflush(where);
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,"send_dlpi_co_stream: send_descriptor obtained...\n");
   }
-  
+
 #ifdef DL_HP_SET_LOCAL_WIN_REQ
   if (lsw_size > 0) {
     if (debug > 1) {
@@ -474,37 +474,37 @@
       fprintf(where,"                          recv: %d\n",lrw_size);
     }
   }
-  
-  
+
+
   /* Now, we will find-out what the size actually became, and report */
   /* that back to the user. If the call fails, we will just report a -1 */
   /* back to the initiator for the recv buffer size. */
-  
-  
+
+
   if (debug) {
     fprintf(where,
 	    "netperf: send_dlpi_co_stream: window sizes determined...\n");
     fprintf(where,"         send: %d recv: %d\n",lsw_size,lrw_size);
     fflush(where);
   }
-  
+
 #else /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   lsw_size = -1;
   lrw_size = -1;
-  
+
 #endif /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   /* we should pick a default send_size, it should not be larger than */
   /* the min of the two interface MTU's, and should perhaps default to */
   /* the Interface MTU, but for now, we will default it to 1024... if */
   /* someone wants to change this, the should change the corresponding */
   /* lines in the recv_dlpi_co_stream routine */
-  
+
   if (send_size == 0) {
     send_size = 1024;
   }
-  
+
   /* set-up the data buffer with the requested alignment and offset. */
   /* After we have calculated the proper starting address, we want to */
   /* put that back into the message variable so we go back to the */
@@ -522,34 +522,34 @@
     send_width = (lsw_size/send_size) + 1;
     if (send_width == 1) send_width++;
   }
-  
+
   send_ring = allocate_buffer_ring(send_width,
 				   send_size,
 				   local_send_align,
 				   local_send_offset);
-  
+
   send_message.maxlen = send_size;
   send_message.len = send_size;
   send_message.buf = send_ring->buffer_ptr;
-  
+
   /* If the user has requested cpu utilization measurements, we must */
   /* calibrate the cpu(s). We will perform this task within the tests */
   /* themselves. If the user has specified the cpu rate, then */
   /* calibrate_local_cpu will return rather quickly as it will have */
   /* nothing to do. If local_cpu_rate is zero, then we will go through */
   /* all the "normal" calibration stuff and return the rate back.*/
-  
+
   if (local_cpu_usage) {
     local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
   }
-  
+
   /* Tell the remote end to do a listen. The server alters the socket */
   /* paramters on the other side at this point, hence the reason for */
   /* all the values being passed in the setup message. If the user did */
   /* not specify any of the parameters, they will be passed as 0, which */
   /* will indicate to the remote that no changes beyond the system's */
   /* default should be used. */
-  
+
   netperf_request.content.request_type	 =	DO_DLPI_CO_STREAM;
   dlpi_co_stream_request->send_win_size =	rsw_size;
   dlpi_co_stream_request->recv_win_size =	rrw_size;
@@ -563,9 +563,9 @@
   dlpi_co_stream_request->dev_name_len  =      strlen(rem_dlpi_device);
   strcpy(dlpi_co_stream_request->dlpi_device,
 	 rem_dlpi_device);
-  
+
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I didn't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -576,19 +576,19 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) dlpi_co_stream_request->dlpi_device;
     lastword = initword + ((strlen(rem_dlpi_device) + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = ntohl(*charword);
     }
   }
 #endif /* __alpha */
-  
+
   if (test_time) {
     dlpi_co_stream_request->test_length	=	test_time;
   }
@@ -599,15 +599,15 @@
   dlpi_co_stream_request->dirty_count       =       rem_dirty_count;
   dlpi_co_stream_request->clean_count       =       rem_clean_count;
 #endif /* DIRTY */
-  
-  
+
+
   if (debug > 1) {
     fprintf(where,
 	    "netperf: send_dlpi_co_stream: requesting DLPI CO stream test\n");
   }
-  
+
   send_request();
-  
+
   /* The response from the remote will contain all of the relevant 	*/
   /* parameters for this test type. We will put them back into 	*/
   /* the variables here so they can be displayed if desired.  The	*/
@@ -617,9 +617,9 @@
   /* after the connect returns. The remote will grab the counter right	*/
   /* after the accept call. This saves the hassle of extra messages	*/
   /* being sent for the TCP tests.					*/
-  
+
   recv_response();
-  
+
   if (!netperf_response.content.serv_errno) {
     if (debug)
       fprintf(where,"remote listen done.\n");
@@ -633,7 +633,7 @@
     perror("netperf: remote error");
     exit(1);
   }
-  
+
   /* Connect up to the remote port on the data descriptor */
   if(dl_connect(send_descriptor,
 		dlpi_co_stream_response->station_addr,
@@ -642,16 +642,16 @@
     fflush(where);
     exit(1);
   }
-  
+
   /* Data Socket set-up is finished. If there were problems, either the */
   /* connect would have failed, or the previous response would have */
   /* indicated a problem. I failed to see the value of the extra */
   /* message after the accept on the remote. If it failed, we'll see it */
   /* here. If it didn't, we might as well start pumping data. */
-  
+
   /* Set-up the test end conditions. For a stream test, they can be */
   /* either time or byte-count based. */
-  
+
   if (test_time) {
     /* The user wanted to end the test after a period of time. */
     times_up = 0;
@@ -663,27 +663,27 @@
     bytes_remaining = test_bytes;
     times_up = 1;
   }
-  
+
   /* The cpu_start routine will grab the current time and possibly */
   /* value of the idle counter for later use in measuring cpu */
   /* utilization and/or service demand and thruput. */
-  
+
   cpu_start(local_cpu_usage);
-  
+
   /* We use an "OR" to control test execution. When the test is */
   /* controlled by time, the byte count check will always return false. */
   /* When the test is controlled by byte count, the time test will */
   /* always return false. When the test is finished, the whole */
   /* expression will go false and we will stop sending data. */
-  
+
 #ifdef DIRTY
   /* initialize the random number generator for putting dirty stuff */
   /* into the send buffer. raj */
   srand((int) getpid());
 #endif /* DIRTY */
-  
+
   while ((!times_up) || (bytes_remaining > 0)) {
-    
+
 #ifdef DIRTY
     /* we want to dirty some number of consecutive integers in the buffer */
     /* we are about to send. we may also want to bring some number of */
@@ -699,7 +699,7 @@
       message_int_ptr++;
     }
 #endif /* DIRTY */
-    
+
     if((putmsg(send_descriptor,
 	       0,
 	       &send_message,
@@ -716,34 +716,34 @@
 	 interval_count < interval_wate;
 	 interval_count++);
 #endif /* WANT_INTERVALS */
-    
+
     if (debug > 4) {
       fprintf(where,"netperf: send_clpi_co_stream: putmsg called ");
       fprintf(where,"len is %d\n",send_message.len);
       fflush(where);
     }
-    
-    nummessages++;          
+
+    nummessages++;
     if (bytes_remaining) {
       bytes_remaining -= send_size;
     }
   }
-  
+
   /* The test is over. Flush the buffers to the remote end. We do a */
   /* graceful release to insure that all data has been taken by the */
   /* remote. this needs a little work - there is no three-way */
   /* handshake with type two as there is with TCP, so there really */
   /* should be a message exchange here. however, we will finesse it by */
-  /* saying that the tests shoudl run for a while. */ 
-  
+  /* saying that the tests shoudl run for a while. */
+
   if (debug) {
     fprintf(where,"sending test end signal \n");
     fflush(where);
   }
-  
+
   send_message.len = (send_size - 1);
   if (send_message.len == 0) send_message.len = 2;
-  
+
   if((putmsg(send_descriptor,
 	     0,
 	     &send_message,
@@ -751,17 +751,17 @@
     perror("netperf: data send error");
     exit(1);
   }
-  
+
   /* this call will always give us the elapsed time for the test, and */
   /* will also store-away the necessaries for cpu utilization */
-  
+
   cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being measured? */
   /* how long did we really run? */
-  
+
   /* Get the statistics from the remote end. The remote will have */
   /* calculated service demand and all those interesting things. If it */
   /* wasn't supposed to care, it will return obvious values. */
-  
+
   recv_response();
   if (!netperf_response.content.serv_errno) {
     if (debug)
@@ -770,10 +770,10 @@
   else {
     Set_errno(netperf_response.content.serv_errno);
     perror("netperf: remote error");
-    
+
     exit(1);
   }
-  
+
   /* We now calculate what our thruput was for the test. In the future, */
   /* we may want to include a calculation of the thruput measured by */
   /* the remote, but it should be the case that for a TCP stream test, */
@@ -782,10 +782,10 @@
   /* If it was time, we needed to, and if it was by bytes, the user may */
   /* have specified a number of bytes that wasn't a multiple of the */
   /* send_size, so we really didn't send what he asked for ;-) */
-  
+
   bytes_sent	= ((double) send_size * (double) nummessages) + (double) len;
   thruput		= calc_thruput(bytes_sent);
-  
+
   if (local_cpu_usage || remote_cpu_usage) {
     /* We must now do a little math for service demand and cpu */
     /* utilization for the system(s) */
@@ -810,7 +810,7 @@
       local_cpu_utilization	= -1.0;
       local_service_demand	= -1.0;
     }
-    
+
     if (remote_cpu_usage) {
       if (remote_cpu_rate == 0.0) {
 	fprintf(where,
@@ -829,7 +829,7 @@
       remote_cpu_utilization = -1.0;
       remote_service_demand  = -1.0;
     }
-    
+
     /* We are now ready to print all the information. If the user */
     /* has specified zero-level verbosity, we will just print the */
     /* local service demand, or the remote service demand. If the */
@@ -838,7 +838,7 @@
     /* of greater than 1, we will display a veritable plethora of */
     /* background information from outside of this block as it it */
     /* not cpu_measurement specific...  */
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -888,19 +888,19 @@
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   if (verbosity > 1) {
     /* The user wanted to know it all, so we will give it to him. */
     /* This information will include as much as we can find about */
     /* TCP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-    
+
     fprintf(where,
 	    ksink_fmt,
 	    "Bytes",
@@ -916,7 +916,7 @@
 	    bytes_sent / (double)dlpi_co_stream_result->recv_calls,
 	    dlpi_co_stream_result->recv_calls);
   }
-  
+
 }
 
 
@@ -924,17 +924,17 @@
 /* implemented as one routine. I could break things-out somewhat, but */
 /* didn't feel it was necessary. */
 
-int 
+int
   recv_dlpi_co_stream()
 {
-  
+
   int	data_descriptor;
   int	flags = 0;
   int	measure_cpu;
   int	bytes_received;
   int	receive_calls;
   float	elapsed_time;
-  
+
   struct ring_elt *recv_ring;
   char	*message_ptr;
   char	*message;
@@ -943,20 +943,20 @@
   int   dirty_count;
   int   clean_count;
   int   i;
-  
+
   struct	dlpi_co_stream_request_struct	*dlpi_co_stream_request;
   struct	dlpi_co_stream_response_struct	*dlpi_co_stream_response;
   struct	dlpi_co_stream_results_struct	*dlpi_co_stream_results;
-  
+
   dlpi_co_stream_request	= (struct dlpi_co_stream_request_struct *)netperf_request.content.test_specific_data;
   dlpi_co_stream_response	= (struct dlpi_co_stream_response_struct *)netperf_response.content.test_specific_data;
   dlpi_co_stream_results	= (struct dlpi_co_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_dlpi_co_stream: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -964,35 +964,35 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   netperf_response.content.response_type = DLPI_CO_STREAM_RESPONSE;
-  
+
   /* We now alter the message_ptr variable to be at the desired */
   /* alignment with the desired offset. */
-  
+
   if (debug > 1) {
     fprintf(where,"recv_dlpi_co_stream: requested alignment of %d\n",
 	    dlpi_co_stream_request->recv_alignment);
     fflush(where);
   }
-  
-  
+
+
   /* Grab a descriptor to listen on, and then listen on it. */
-  
+
   if (debug > 1) {
     fprintf(where,"recv_dlpi_co_stream: grabbing a descriptor...\n");
     fflush(where);
   }
-  
-  
-  
+
+
+
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -1003,19 +1003,19 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) dlpi_co_stream_request->dlpi_device;
     lastword = initword + ((dlpi_co_stream_request->dev_name_len + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = htonl(*charword);
     }
   }
 #endif /* __alpha */
-  
+
   data_descriptor = dl_open(dlpi_co_stream_request->dlpi_device,
 			    dlpi_co_stream_request->ppa);
   if (data_descriptor < 0) {
@@ -1023,13 +1023,13 @@
     send_response();
     exit(1);
   }
-  
+
   /* Let's get an address assigned to this descriptor so we can tell the */
   /* initiator how to reach the data descriptor. There may be a desire to */
   /* nail this descriptor to a specific address in a multi-homed, */
   /* multi-connection situation, but for now, we'll ignore the issue */
   /* and concentrate on single connection testing. */
-  
+
   /* bind the sap and retrieve the dlsap assigned by the system  */
   dlpi_co_stream_response->station_addr_len = 14; /* arbitrary */
   if (dl_bind(data_descriptor,
@@ -1041,28 +1041,28 @@
     fflush(where);
     exit(1);
   }
-  
+
   /* The initiator may have wished-us to modify the socket buffer */
   /* sizes. We should give it a shot. If he didn't ask us to change the */
   /* sizes, we should let him know what sizes were in use at this end. */
   /* If none of this code is compiled-in, then we will tell the */
   /* initiator that we were unable to play with the socket buffer by */
   /* setting the size in the response to -1. */
-  
+
 #ifdef DL_HP_SET_LOCAL_WIN_REQ
-  
+
   if (dlpi_co_stream_request->recv_win_size) {
   }
   /* Now, we will find-out what the size actually became, and report */
   /* that back to the user. If the call fails, we will just report a -1 */
   /* back to the initiator for the recv buffer size. */
-  
+
 #else /* the system won't let us play with the buffers */
-  
+
   dlpi_co_stream_response->recv_win_size	= -1;
-  
+
 #endif /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   /* what sort of sizes did we end-up with? */
   /* this bit of code whould default to the Interface MTU */
   if (dlpi_co_stream_request->receive_size == 0) {
@@ -1071,10 +1071,10 @@
   else {
     recv_size = dlpi_co_stream_request->receive_size;
   }
-  
+
   /* tell the other fellow what our receive size became */
   dlpi_co_stream_response->receive_size = recv_size;
-  
+
   /* just a little prep work for when we may have to behave like the */
   /* sending side... */
   message = (char *)malloc(recv_size * 2);
@@ -1087,34 +1087,34 @@
   recv_message.maxlen = recv_size;
   recv_message.len = 0;
   recv_message.buf = message_ptr;
-  
+
   if (debug > 1) {
     fprintf(where,
 	    "recv_dlpi_co_stream: receive alignment and offset set...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a -1 to */
   /* the initiator. */
-  
+
   dlpi_co_stream_response->cpu_rate = 0.0; 	/* assume no cpu */
   if (dlpi_co_stream_request->measure_cpu) {
     dlpi_co_stream_response->measure_cpu = 1;
-    dlpi_co_stream_response->cpu_rate = 
+    dlpi_co_stream_response->cpu_rate =
       calibrate_local_cpu(dlpi_co_stream_request->cpu_rate);
   }
-  
+
   send_response();
-  
+
   /* accept a connection on this file descriptor. at some point, */
   /* dl_accept will "do the right thing" with the last two parms, but */
   /* for now it ignores them, so we will pass zeros. */
-  
+
   if(dl_accept(data_descriptor, 0, 0) != 0) {
     fprintf(where,
 	    "recv_dlpi_co_stream: error in accept, errno %d\n",
@@ -1124,23 +1124,23 @@
     send_response();
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,"netserver:recv_dlpi_co_stream: connection accepted\n");
     fflush(where);
   }
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(dlpi_co_stream_request->measure_cpu);
-  
+
 #ifdef DIRTY
   /* we want to dirty some number of consecutive integers in the buffer */
   /* we are about to recv. we may also want to bring some number of */
   /* them cleanly into the cache. The clean ones will follow any dirty */
   /* ones into the cache. */
-  
+
   dirty_count = dlpi_co_stream_request->dirty_count;
   clean_count = dlpi_co_stream_request->clean_count;
   message_int_ptr = (int *)message_ptr;
@@ -1153,12 +1153,12 @@
     message_int_ptr++;
   }
 #endif /* DIRTY */
-  
-  recv_message.len = recv_size; 
+
+  recv_message.len = recv_size;
   while (recv_message.len == recv_size) {
-    if (getmsg(data_descriptor, 
+    if (getmsg(data_descriptor,
 	       0,
-	       &recv_message, 
+	       &recv_message,
 	       &flags) != 0) {
       netperf_response.content.serv_errno = errno;
       send_response();
@@ -1166,15 +1166,15 @@
     }
     bytes_received += recv_message.len;
     receive_calls++;
-    
+
     if (debug) {
       fprintf(where,
 	      "netserver:recv_dlpi_co_stream: getmsg accepted %d bytes\n",
 	      recv_message.len);
       fflush(where);
     }
-    
-    
+
+
 #ifdef DIRTY
     message_int_ptr = (int *)message_ptr;
     for (i = 0; i < dirty_count; i++) {
@@ -1186,23 +1186,23 @@
       message_int_ptr++;
     }
 #endif /* DIRTY */
-    
+
   }
-  
+
   /* The loop now exits due to zero bytes received. */
   /* should perform a disconnect to signal the sender that */
   /* we have received all the data sent. */
-  
+
   if (close(data_descriptor) == -1) {
     netperf_response.content.serv_errno = errno;
     send_response();
     exit(1);
   }
-  
+
   cpu_stop(dlpi_co_stream_request->measure_cpu,&elapsed_time);
-  
+
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_co_stream: got %d bytes\n",
@@ -1212,21 +1212,21 @@
 	    receive_calls);
     fflush(where);
   }
-  
+
   dlpi_co_stream_results->bytes_received	= bytes_received;
   dlpi_co_stream_results->elapsed_time	= elapsed_time;
   dlpi_co_stream_results->recv_calls		= receive_calls;
-  
+
   if (dlpi_co_stream_request->measure_cpu) {
     dlpi_co_stream_results->cpu_util	= calc_cpu_util(0.0);
   };
-  
+
   if (debug > 1) {
     fprintf(where,
 	    "recv_dlpi_co_stream: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   send_response();
 }
 
@@ -1234,87 +1234,87 @@
 
 int send_dlpi_co_rr(char remote_host[])
 {
-  
+
   char *tput_title = "\
  Local /Remote\n\
  Window Size   Request  Resp.   Elapsed  Trans.\n\
  Send   Recv   Size     Size    Time     Rate         \n\
  frames frames bytes    bytes   secs.    per sec   \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1_line_1 = "\
  %-6d %-6d %-6d   %-6d  %-6.2f   %7.2f   \n";
   char *tput_fmt_1_line_2 = "\
  %-6d %-6d\n";
-  
+
   char *cpu_title = "\
  Local /Remote\n\
  Window Size   Request Resp.  Elapsed Trans.   CPU    CPU    S.dem   S.dem\n\
  Send   Recv   Size    Size   Time    Rate     local  remote local   remote\n\
  frames frames bytes   bytes  secs.   per sec  %%      %%      us/Tr   us/Tr\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f\n";
-  
+
   char *cpu_fmt_1_line_1 = "\
  %-6d %-6d %-6d  %-6d %-6.2f  %-6.2f   %-6.2f %-6.2f %-6.3f  %-6.3f\n";
-  
+
   char *cpu_fmt_1_line_2 = "\
  %-6d %-6d\n";
-  
+
   char *ksink_fmt = "\
  Alignment      Offset\n\
  Local  Remote  Local  Remote\n\
  Send   Recv    Send   Recv\n\
  %5d  %5d   %5d  %5d\n";
-  
-  
+
+
   int			timed_out = 0;
   float			elapsed_time;
   int	    dlsap_len;
   char      dlsap[BUFSIZ];
-  
+
   int   flags = 0;
   char	*send_message_ptr;
   char	*recv_message_ptr;
   char	*temp_message_ptr;
   struct strbuf send_message;
   struct strbuf recv_message;
-  
+
   int	nummessages;
   int	send_descriptor;
   int	trans_remaining;
   double	bytes_xferd;
-  
+
   int	rsp_bytes_left;
-  
+
   /* we assume that station adresses fit within two ints */
   unsigned int   remote_address[1];
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
   double	thruput;
-  
+
   struct	dlpi_co_rr_request_struct	*dlpi_co_rr_request;
   struct	dlpi_co_rr_response_struct	*dlpi_co_rr_response;
   struct	dlpi_co_rr_results_struct	*dlpi_co_rr_result;
-  
-  dlpi_co_rr_request	= 
+
+  dlpi_co_rr_request	=
     (struct dlpi_co_rr_request_struct *)netperf_request.content.test_specific_data;
-  dlpi_co_rr_response	= 
+  dlpi_co_rr_response	=
     (struct dlpi_co_rr_response_struct *)netperf_response.content.test_specific_data;
-  dlpi_co_rr_result	= 
+  dlpi_co_rr_result	=
     (struct dlpi_co_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   /* since we are now disconnected from the code that established the */
   /* control socket, and since we want to be able to use different */
   /* protocols and such, we are passed the name of the remote host and */
   /* must turn that into the test specific addressing information. */
-  
+
   if ( print_headers ) {
     fprintf(where,"DLPI CO REQUEST/RESPONSE TEST\n");
     if (local_cpu_usage || remote_cpu_usage)
@@ -1322,62 +1322,62 @@
     else
       fprintf(where,tput_title,format_units());
   }
-  
+
   /* initialize a few counters */
-  
+
   nummessages	=	0;
   bytes_xferd	=	0.0;
   times_up 	= 	0;
-  
+
   /* set-up the data buffers with the requested alignment and offset */
   temp_message_ptr = (char *)malloc(req_size+MAXALIGNMENT+MAXOFFSET);
   if (temp_message_ptr == NULL) {
     printf("malloc(%d) failed!\n", req_size+MAXALIGNMENT+MAXOFFSET);
     exit(1);
   }
-  send_message_ptr = (char *)(( (long) temp_message_ptr + 
-			       (long) local_send_align - 1) &	
+  send_message_ptr = (char *)(( (long) temp_message_ptr +
+			       (long) local_send_align - 1) &
 			      ~((long) local_send_align - 1));
   send_message_ptr = send_message_ptr + local_send_offset;
   send_message.maxlen = req_size+MAXALIGNMENT+MAXOFFSET;
   send_message.len    = req_size;
   send_message.buf    = send_message_ptr;
-  
+
   temp_message_ptr = (char *)malloc(rsp_size+MAXALIGNMENT+MAXOFFSET);
   if (temp_message_ptr == NULL) {
     printf("malloc(%d) failed!\n", rsp_size+MAXALIGNMENT+MAXOFFSET);
     exit(1);
   }
-  recv_message_ptr = (char *)(( (long) temp_message_ptr + 
-			       (long) local_recv_align - 1) &	
+  recv_message_ptr = (char *)(( (long) temp_message_ptr +
+			       (long) local_recv_align - 1) &
 			      ~((long) local_recv_align - 1));
   recv_message_ptr = recv_message_ptr + local_recv_offset;
   recv_message.maxlen = rsp_size+MAXALIGNMENT+MAXOFFSET;
   recv_message.len    = 0;
   recv_message.buf    = send_message_ptr;
-  
+
   /*set up the data socket                        */
-  
+
   send_descriptor = dl_open(loc_dlpi_device,loc_ppa);
   if (send_descriptor < 0){
     perror("netperf: send_dlpi_co_rr: tcp stream data descriptor");
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,"send_dlpi_co_rr: send_descriptor obtained...\n");
   }
-  
+
   /* bind the puppy and get the assigned dlsap */
-  
+
   dlsap_len = BUFSIZ;
-  if (dl_bind(send_descriptor, 
+  if (dl_bind(send_descriptor,
 	      dlpi_sap, DL_CODLS, dlsap, &dlsap_len) != 0) {
     fprintf(where,"send_dlpi_co_rr: bind failure\n");
     fflush(where);
     exit(1);
   }
-  
+
   /* Modify the local socket size. The reason we alter the send buffer */
   /* size here rather than when the connection is made is to take care */
   /* of decreases in buffer size. Decreasing the window size after */
@@ -1390,7 +1390,7 @@
   /* that the socket buffers be altered, we will try to find-out what */
   /* their values are. If we cannot touch the socket buffer in any way, */
   /* we will set the values to -1 to indicate that.  */
-  
+
 #ifdef DL_HP_SET_LOCAL_WIN_REQ
   if (lsw_size > 0) {
     if (debug > 1) {
@@ -1404,36 +1404,36 @@
       fprintf(where,"                          recv: %d\n",lrw_size);
     }
   }
-  
-  
+
+
   /* Now, we will find-out what the size actually became, and report */
   /* that back to the user. If the call fails, we will just report a -1 */
   /* back to the initiator for the recv buffer size. */
-  
-  
+
+
   if (debug) {
     fprintf(where,"netperf: send_dlpi_co_rr: socket sizes determined...\n");
     fprintf(where,"         send: %d recv: %d\n",lsw_size,lrw_size);
   }
-  
+
 #else /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   lsw_size = -1;
   lrw_size = -1;
-  
+
 #endif /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   /* If the user has requested cpu utilization measurements, we must */
   /* calibrate the cpu(s). We will perform this task within the tests */
   /* themselves. If the user has specified the cpu rate, then */
   /* calibrate_local_cpu will return rather quickly as it will have */
   /* nothing to do. If local_cpu_rate is zero, then we will go through */
   /* all the "normal" calibration stuff and return the rate back.*/
-  
+
   if (local_cpu_usage) {
     local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
   }
-  
+
   /* Tell the remote end to do a listen. The server alters the socket */
   /* paramters on the other side at this point, hence the reason for */
   /* all the values being passed in the setup message. If the user did */
@@ -1441,7 +1441,7 @@
   /* will indicate to the remote that no changes beyond the system's */
   /* default should be used. Alignment is the exception, it will */
   /* default to 8, which will be no alignment alterations. */
-  
+
   netperf_request.content.request_type	        =	DO_DLPI_CO_RR;
   dlpi_co_rr_request->recv_win_size	=	rrw_size;
   dlpi_co_rr_request->send_win_size	=	rsw_size;
@@ -1459,7 +1459,7 @@
   strcpy(dlpi_co_rr_request->dlpi_device,
 	 rem_dlpi_device);
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -1470,32 +1470,32 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) dlpi_co_rr_request->dlpi_device;
     lastword = initword + ((strlen(rem_dlpi_device) + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = ntohl(*charword);
     }
   }
 #endif /* __alpha */
-  
+
   if (test_time) {
     dlpi_co_rr_request->test_length	=	test_time;
   }
   else {
     dlpi_co_rr_request->test_length	=	test_trans * -1;
   }
-  
+
   if (debug > 1) {
     fprintf(where,"netperf: send_dlpi_co_rr: requesting TCP stream test\n");
   }
-  
+
   send_request();
-  
+
   /* The response from the remote will contain all of the relevant 	*/
   /* socket parameters for this test type. We will put them back into 	*/
   /* the variables here so they can be displayed if desired.  The	*/
@@ -1505,9 +1505,9 @@
   /* after the connect returns. The remote will grab the counter right	*/
   /* after the accept call. This saves the hassle of extra messages	*/
   /* being sent for the TCP tests.					*/
-  
+
   recv_response();
-  
+
   if (!netperf_response.content.serv_errno) {
     if (debug)
       fprintf(where,"remote listen done.\n");
@@ -1515,17 +1515,17 @@
     rsw_size	=	dlpi_co_rr_response->send_win_size;
     remote_cpu_usage=	dlpi_co_rr_response->measure_cpu;
     remote_cpu_rate = 	dlpi_co_rr_response->cpu_rate;
-    
+
   }
   else {
     Set_errno(netperf_response.content.serv_errno);
     perror("netperf: remote error");
-    
+
     exit(1);
   }
-  
+
   /*Connect up to the remote port on the data descriptor  */
-  
+
   if(dl_connect(send_descriptor,
 		dlpi_co_rr_response->station_addr,
 		dlpi_co_rr_response->station_addr_len) != 0) {
@@ -1533,16 +1533,16 @@
     fflush(where);
     exit(1);
   }
-  
+
   /* Data Socket set-up is finished. If there were problems, either the */
   /* connect would have failed, or the previous response would have */
   /* indicated a problem. I failed to see the value of the extra */
   /* message after the accept on the remote. If it failed, we'll see it */
   /* here. If it didn't, we might as well start pumping data. */
-  
+
   /* Set-up the test end conditions. For a request/response test, they */
   /* can be either time or transaction based. */
-  
+
   if (test_time) {
     /* The user wanted to end the test after a period of time. */
     times_up = 0;
@@ -1554,13 +1554,13 @@
     trans_remaining = test_bytes;
     times_up = 1;
   }
-  
+
   /* The cpu_start routine will grab the current time and possibly */
   /* value of the idle counter for later use in measuring cpu */
   /* utilization and/or service demand and thruput. */
-  
+
   cpu_start(local_cpu_usage);
-  
+
   /* We use an "OR" to control test execution. When the test is */
   /* controlled by time, the byte count check will always return false. */
   /* When the test is controlled by byte count, the time test will */
@@ -1569,7 +1569,7 @@
   /* just arbitrarily decrement trans_remaining for the timed test, but */
   /* will not do that just yet... One other question is whether or not */
   /* the send buffer and the receive buffer should be the same buffer. */
-  
+
   while ((!times_up) || (trans_remaining > 0)) {
     /* send the request */
     if((putmsg(send_descriptor,
@@ -1585,13 +1585,13 @@
       perror("send_dlpi_co_rr: putmsg error");
       exit(1);
     }
-    
+
     if (debug) {
       fprintf(where,"recv_message.len %d\n",recv_message.len);
       fprintf(where,"send_message.len %d\n",send_message.len);
       fflush(where);
     }
-    
+
     /* receive the response */
     /* this needs some work with streams buffers if we are going to */
     /* support requests and responses larger than the MTU of the */
@@ -1612,19 +1612,19 @@
 	exit(1);
       }
       rsp_bytes_left -= recv_message.len;
-    }	
-    
+    }
+
     if (timed_out) {
       /* we may have been in a nested while loop - we need */
       /* another call to break. */
       break;
     }
-    
-    nummessages++;          
+
+    nummessages++;
     if (trans_remaining) {
       trans_remaining--;
     }
-    
+
     if (debug > 3) {
       fprintf(where,
 	      "Transaction %d completed\n",
@@ -1632,24 +1632,24 @@
       fflush(where);
     }
   }
-  
+
   /* At this point we used to call shutdown onthe data socket to be */
   /* sure all the data was delivered, but this was not germane in a */
   /* request/response test, and it was causing the tests to "hang" when */
   /* they were being controlled by time. So, I have replaced this */
   /* shutdown call with a call to close that can be found later in the */
   /* procedure. */
-  
+
   /* this call will always give us the elapsed time for the test, and */
   /* will also store-away the necessaries for cpu utilization */
-  
+
   cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being measured? */
   /* how long did we really run? */
-  
+
   /* Get the statistics from the remote end. The remote will have */
   /* calculated service demand and all those interesting things. If it */
   /* wasn't supposed to care, it will return obvious values. */
-  
+
   recv_response();
   if (!netperf_response.content.serv_errno) {
     if (debug)
@@ -1658,10 +1658,10 @@
   else {
     Set_errno(netperf_response.content.serv_errno);
     perror("netperf: remote error");
-    
+
     exit(1);
   }
-  
+
   /* We now calculate what our thruput was for the test. In the future, */
   /* we may want to include a calculation of the thruput measured by */
   /* the remote, but it should be the case that for a TCP stream test, */
@@ -1672,11 +1672,11 @@
   /* send_size, so we really didn't send what he asked for ;-) We use */
   /* Kbytes/s as the units of thruput for a TCP stream test, where K = */
   /* 1024. A future enhancement *might* be to choose from a couple of */
-  /* unit selections. */ 
-  
+  /* unit selections. */
+
   bytes_xferd	= (req_size * nummessages) + (rsp_size * nummessages);
   thruput		= calc_thruput(bytes_xferd);
-  
+
   if (local_cpu_usage || remote_cpu_usage) {
     /* We must now do a little math for service demand and cpu */
     /* utilization for the system(s) */
@@ -1702,7 +1702,7 @@
       local_cpu_utilization	= -1.0;
       local_service_demand	= -1.0;
     }
-    
+
     if (remote_cpu_usage) {
       if (remote_cpu_rate == 0.0) {
 	fprintf(where,"DANGER  DANGER  DANGER    DANGER  DANGER  DANGER    DANGER!\n");
@@ -1722,7 +1722,7 @@
       remote_cpu_utilization = -1.0;
       remote_service_demand  = -1.0;
     }
-    
+
     /* We are now ready to print all the information. If the user */
     /* has specified zero-level verbosity, we will just print the */
     /* local service demand, or the remote service demand. If the */
@@ -1731,7 +1731,7 @@
     /* of greater than 1, we will display a veritable plethora of */
     /* background information from outside of this block as it it */
     /* not cpu_measurement specific...  */
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -1786,32 +1786,32 @@
 	      tput_fmt_1_line_2,
 	      rsw_size, 		/* remote recvbuf size */
 	      rrw_size);
-      
+
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   if (verbosity > 1) {
     /* The user wanted to know it all, so we will give it to him. */
     /* This information will include as much as we can find about */
     /* TCP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-    
+
     fprintf(where,
 	    ksink_fmt);
   }
   /* The test is over. Kill the data descriptor */
-  
+
   if (close(send_descriptor) == -1) {
     perror("send_dlpi_co_rr: cannot shutdown tcp stream descriptor");
   }
-  
+
 }
 
 void
@@ -1826,38 +1826,38 @@
     "Window  Message  Elapsed      Messages                \n\
 Size    Size     Time         Okay Errors   Throughput\n\
 frames  bytes    secs            #      #   %s/sec\n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1 =
     "%5d   %5d    %-7.2f   %7d %6d    %7.2f\n\
 %5d            %-7.2f   %7d           %7.2f\n\n";
-  
-  
+
+
   char *cpu_title =
     "Window  Message  Elapsed      Messages                   CPU     Service\n\
 Size    Size     Time         Okay Errors   Throughput   Util    Demand\n\
 frames  bytes    secs            #      #   %s/sec   %%       us/KB\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.2f\n";
-  
+
   char *cpu_fmt_1 =
     "%5d   %5d    %-7.2f   %7d %6d    %7.1f      %-6.2f  %-6.3f\n\
 %5d            %-7.2f   %7d           %7.1f      %-6.2f  %-6.3f\n\n";
-  
+
   int	messages_recvd;
   float	elapsed_time,
-  local_cpu_utilization, 
+  local_cpu_utilization,
   remote_cpu_utilization;
-  
+
   float	local_service_demand, remote_service_demand;
   double	local_thruput, remote_thruput;
   double	bytes_sent;
   double	bytes_recvd;
-  
-  
+
+
   int	*message_int_ptr;
   char	*message_ptr;
   char	*message;
@@ -1865,7 +1865,7 @@
   struct strbuf send_message;
   struct strbuf sctl_message;
   dl_unitdata_req_t *data_req = (dl_unitdata_req_t *)sctl_data;
-  
+
   char dlsap[BUFSIZ];
   int  dlsap_len;
   int	message_offset;
@@ -1874,54 +1874,54 @@
   int	failed_cows;
   int 	messages_sent;
   int 	data_descriptor;
-  
-  
+
+
 #ifdef WANT_INTERVALS
   int	interval_count;
 #endif /* WANT_INTERVALS */
 #ifdef DIRTY
   int	i;
 #endif /* DIRTY */
-  
+
   struct	dlpi_cl_stream_request_struct	*dlpi_cl_stream_request;
   struct	dlpi_cl_stream_response_struct	*dlpi_cl_stream_response;
   struct	dlpi_cl_stream_results_struct	*dlpi_cl_stream_results;
-  
+
   dlpi_cl_stream_request	= (struct dlpi_cl_stream_request_struct *)netperf_request.content.test_specific_data;
   dlpi_cl_stream_response	= (struct dlpi_cl_stream_response_struct *)netperf_response.content.test_specific_data;
   dlpi_cl_stream_results	= (struct dlpi_cl_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if ( print_headers ) {
     printf("DLPI CL UNIDIRECTIONAL SEND TEST\n");
     if (local_cpu_usage || remote_cpu_usage)
       printf(cpu_title,format_units());
     else
       printf(tput_title,format_units());
-  }	
-  
+  }
+
   failed_sends	= 0;
   messages_sent	= 0;
   times_up	= 0;
-  
+
   /*set up the data descriptor			*/
-  
+
   data_descriptor = dl_open(loc_dlpi_device,loc_ppa);
   if (data_descriptor < 0){
     perror("send_dlpi_cl_stream: data descriptor");
     exit(1);
   }
-  
+
   /* bind the puppy and get the assigned dlsap */
   dlsap_len = BUFSIZ;
-  if (dl_bind(data_descriptor, 
+  if (dl_bind(data_descriptor,
               dlpi_sap, DL_CLDLS, dlsap, &dlsap_len) != 0) {
     fprintf(where,"send_dlpi_cl_stream: bind failure\n");
     fflush(where);
     exit(1);
   }
-  
+
   /* Modify the local socket size (SNDBUF size)    */
-  
+
 #ifdef DL_HP_SET_LOCAL_WIN_REQ
   if (lsw_size > 0) {
     if (debug > 1) {
@@ -1935,25 +1935,25 @@
       fprintf(where,"                          recv: %d\n",lrw_size);
     }
   }
-  
-  
+
+
   /* Now, we will find-out what the size actually became, and report */
   /* that back to the user. If the call fails, we will just report a -1 */
   /* back to the initiator for the recv buffer size. */
-  
+
 #else /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   lsw_size = -1;
   lrw_size = -1;
-  
+
 #endif /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   /* now, we want to see if we need to set the send_size */
   if (send_size == 0) {
     send_size = 1024;
   }
-  
-  
+
+
   /* set-up the data buffer with the requested alignment and offset, */
   /* most of the numbers here are just a hack to pick something nice */
   /* and big in an attempt to never try to send a buffer a second time */
@@ -1965,33 +1965,33 @@
     printf("malloc(%d) failed!\n", send_size * (send_width + 1) + local_send_align + local_send_offset);
     exit(1);
   }
-  message_ptr = (char *)(( (long) message + 
-			  (long) local_send_align - 1) &	
+  message_ptr = (char *)(( (long) message +
+			  (long) local_send_align - 1) &
 			 ~((long) local_send_align - 1));
   message_ptr = message_ptr + local_send_offset;
   message = message_ptr;
   send_message.maxlen = send_size;
   send_message.len = send_size;
   send_message.buf = message;
-  
+
   sctl_message.maxlen = BUFSIZ;
   sctl_message.len    = 0;
   sctl_message.buf    = sctl_data;
-  
+
   /* if the user supplied a cpu rate, this call will complete rather */
   /* quickly, otherwise, the cpu rate will be retured to us for */
   /* possible display. The Library will keep it's own copy of this data */
   /* for use elsewhere. We will only display it. (Does that make it */
   /* "opaque" to us?) */
-  
+
   if (local_cpu_usage)
     local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
-  
+
   /* Tell the remote end to set up the data connection. The server */
   /* sends back the port number and alters the socket parameters there. */
   /* Of course this is a datagram service so no connection is actually */
   /* set up, the server just sets up the socket and binds it. */
-  
+
   netperf_request.content.request_type                 = DO_DLPI_CL_STREAM;
   dlpi_cl_stream_request->recv_win_size	        = rrw_size;
   dlpi_cl_stream_request->message_size	        = send_size;
@@ -2004,9 +2004,9 @@
   dlpi_cl_stream_request->dev_name_len          = strlen(rem_dlpi_device);
   strcpy(dlpi_cl_stream_request->dlpi_device,
 	 rem_dlpi_device);
-  
+
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -2017,31 +2017,31 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) dlpi_cl_stream_request->dlpi_device;
     lastword = initword + ((strlen(rem_dlpi_device) + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = ntohl(*charword);
     }
   }
 #endif /* __alpha */
-  
+
   if (test_time) {
     dlpi_cl_stream_request->test_length	=	test_time;
   }
   else {
     dlpi_cl_stream_request->test_length	=	test_bytes * -1;
   }
-  
-  
+
+
   send_request();
-  
+
   recv_response();
-  
+
   if (!netperf_response.content.serv_errno) {
     if (debug)
       fprintf(where,"send_dlpi_cl_stream: remote data connection done.\n");
@@ -2051,11 +2051,11 @@
     perror("send_dlpi_cl_stream: error on remote");
     exit(1);
   }
-  
+
   /* place some of the remote's addressing information into the send */
   /* structure so our sends can be sent to the correct place. Also get */
   /* some of the returned socket buffer information for user display. */
-  
+
   /* set-up the destination addressing control info */
   data_req->dl_primitive = DL_UNITDATA_REQ;
   bcopy((char *)(dlpi_cl_stream_response->station_addr),
@@ -2070,25 +2070,25 @@
   data_req->dl_priority.dl_min = DL_QOS_DONT_CARE;
   data_req->dl_priority.dl_max = DL_QOS_DONT_CARE;
 
-  sctl_message.len = sizeof(dl_unitdata_req_t) + 
+  sctl_message.len = sizeof(dl_unitdata_req_t) +
     data_req->dl_dest_addr_length;
-  
+
   rrw_size	        = dlpi_cl_stream_response->recv_win_size;
   rsw_size	        = dlpi_cl_stream_response->send_win_size;
   remote_cpu_rate	= dlpi_cl_stream_response->cpu_rate;
-  
-  
+
+
   /* set up the timer to call us after test_time	*/
   start_timer(test_time);
-  
+
   /* Get the start count for the idle counter and the start time */
-  
+
   cpu_start(local_cpu_usage);
-  
+
 #ifdef WANT_INTERVALS
   interval_count = interval_burst;
 #endif /* WANT_INTERVALS */
-  
+
   /* Send datagrams like there was no tomorrow */
   while (!times_up) {
 #ifdef DIRTY
@@ -2128,12 +2128,12 @@
       }
       exit(1);
     }
-    messages_sent++;          
-    
+    messages_sent++;
+
     /* now we want to move our pointer to the next position in the */
     /* data buffer...since there was a successful send */
-    
-    
+
+
 #ifdef WANT_INTERVALS
     /* in this case, the interval count is the count-down couter */
     /* to decide to sleep for a little bit */
@@ -2146,20 +2146,20 @@
       }
       interval_count = interval_burst;
     }
-    
+
 #endif /* WANT_INTERVALS */
-    
+
   }
-  
+
   /* This is a timed test, so the remote will be returning to us after */
   /* a time. We should not need to send any "strange" messages to tell */
   /* the remote that the test is completed, unless we decide to add a */
   /* number of messages to the test. */
-  
+
   /* the test is over, so get stats and stuff */
-  cpu_stop(local_cpu_usage,	
+  cpu_stop(local_cpu_usage,
 	   &elapsed_time);
-  
+
   /* Get the statistics from the remote end	*/
   recv_response();
   if (!netperf_response.content.serv_errno) {
@@ -2171,19 +2171,19 @@
     perror("send_dlpi_cl_stream: error on remote");
     exit(1);
   }
-  
+
   bytes_sent	= send_size * messages_sent;
   local_thruput	= calc_thruput(bytes_sent);
-  
+
   messages_recvd	= dlpi_cl_stream_results->messages_recvd;
   bytes_recvd	= send_size * messages_recvd;
-  
+
   /* we asume that the remote ran for as long as we did */
-  
+
   remote_thruput	= calc_thruput(bytes_recvd);
-  
+
   /* print the results for this descriptor and message size */
-  
+
   if (local_cpu_usage || remote_cpu_usage) {
     /* We must now do a little math for service demand and cpu */
     /* utilization for the system(s) We pass zeros for the local */
@@ -2195,7 +2195,7 @@
 	fprintf(where,"Local CPU usage numbers based on process information only!\n");
 	fflush(where);
       }
-      
+
       local_cpu_utilization	= calc_cpu_util(0.0);
       local_service_demand	= calc_service_demand(bytes_sent,
 						      0.0,
@@ -2206,7 +2206,7 @@
       local_cpu_utilization	= -1.0;
       local_service_demand	= -1.0;
     }
-    
+
     /* The local calculations could use variables being kept by */
     /* the local netlib routines. The remote calcuations need to */
     /* have a few things passed to them. */
@@ -2216,7 +2216,7 @@
 	fprintf(where,"REMOTE CPU usage numbers based on process information only!\n");
 	fflush(where);
       }
-      
+
       remote_cpu_utilization	= dlpi_cl_stream_results->cpu_util;
       remote_service_demand	= calc_service_demand(bytes_recvd,
 						      0.0,
@@ -2227,7 +2227,7 @@
       remote_cpu_utilization	= -1.0;
       remote_service_demand	= -1.0;
     }
-    
+
     /* We are now ready to print all the information. If the user */
     /* has specified zero-level verbosity, we will just print the */
     /* local service demand, or the remote service demand. If the */
@@ -2236,7 +2236,7 @@
     /* of greater than 1, we will display a veritable plethora of */
     /* background information from outside of this block as it it */
     /* not cpu_measurement specific...  */
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -2300,7 +2300,7 @@
 int
   recv_dlpi_cl_stream()
 {
-  
+
   char  *message;
   int	data_descriptor;
   int	len;
@@ -2312,27 +2312,27 @@
   /* these are to make reading some of the DLPI control messages easier */
   dl_unitdata_ind_t *data_ind = (dl_unitdata_ind_t *)rctl_data;
   dl_uderror_ind_t  *uder_ind = (dl_uderror_ind_t *)rctl_data;
-  
+
   int	bytes_received = 0;
   float	elapsed_time;
-  
+
   int	message_size;
   int	messages_recvd = 0;
   int	measure_cpu;
-  
+
   struct	dlpi_cl_stream_request_struct	*dlpi_cl_stream_request;
   struct	dlpi_cl_stream_response_struct	*dlpi_cl_stream_response;
   struct	dlpi_cl_stream_results_struct	*dlpi_cl_stream_results;
-  
+
   dlpi_cl_stream_request	= (struct dlpi_cl_stream_request_struct *)netperf_request.content.test_specific_data;
   dlpi_cl_stream_response	= (struct dlpi_cl_stream_response_struct *)netperf_response.content.test_specific_data;
   dlpi_cl_stream_results	= (struct dlpi_cl_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_dlpi_cl_stream: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen descriptor with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -2340,19 +2340,19 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug > 1) {
     fprintf(where,"recv_dlpi_cl_stream: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = DLPI_CL_STREAM_RESPONSE;
-  
+
   if (debug > 2) {
     fprintf(where,"recv_dlpi_cl_stream: the response type is set...\n");
     fflush(where);
@@ -2364,10 +2364,10 @@
     printf("malloc(%d) failed!\n", DATABUFFERLEN);
     exit(1);
   }
-  
+
   /* We now alter the message_ptr variable to be at the desired */
   /* alignment with the desired offset. */
-  
+
   if (debug > 1) {
     fprintf(where,"recv_dlpi_cl_stream: requested alignment of %d\n",
 	    dlpi_cl_stream_request->recv_alignment);
@@ -2375,7 +2375,7 @@
   }
 
   message_ptr = ALIGN_BUFFER(message, dlpi_cl_stream_request->recv_alignment, dlpi_cl_stream_request->recv_offset);
-  
+
   if (dlpi_cl_stream_request->message_size > 0) {
     recv_message.maxlen = dlpi_cl_stream_request->message_size;
   }
@@ -2384,24 +2384,24 @@
   }
   recv_message.len    = 0;
   recv_message.buf    = message_ptr;
-  
+
   rctl_message.maxlen = BUFSIZ;
   rctl_message.len    = 0;
   rctl_message.buf    = rctl_data;
-  
+
   if (debug > 1) {
     fprintf(where,
 	    "recv_dlpi_cl_stream: receive alignment and offset set...\n");
     fflush(where);
   }
-  
+
   if (debug > 1) {
     fprintf(where,"recv_dlpi_cl_stream: grabbing a descriptor...\n");
     fflush(where);
   }
-  
+
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -2412,19 +2412,19 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) dlpi_cl_stream_request->dlpi_device;
     lastword = initword + ((dlpi_cl_stream_request->dev_name_len + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = htonl(*charword);
     }
   }
 #endif /* __alpha */
-  
+
   data_descriptor = dl_open(dlpi_cl_stream_request->dlpi_device,
 			    dlpi_cl_stream_request->ppa);
   if (data_descriptor < 0) {
@@ -2432,28 +2432,28 @@
     send_response();
     exit(1);
   }
-  
+
   /* The initiator may have wished-us to modify the window */
   /* sizes. We should give it a shot. If he didn't ask us to change the */
   /* sizes, we should let him know what sizes were in use at this end. */
   /* If none of this code is compiled-in, then we will tell the */
   /* initiator that we were unable to play with the sizes by */
   /* setting the size in the response to -1. */
-  
+
 #ifdef DL_HP_SET_LOCAL_WIN_REQ
-  
+
   if (dlpi_cl_stream_request->recv_win_size) {
     dlpi_cl_stream_response->recv_win_size	= -1;
   }
-  
+
 #else /* the system won't let us play with the buffers */
-  
+
   dlpi_cl_stream_response->recv_win_size	= -1;
-  
+
 #endif /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   dlpi_cl_stream_response->test_length = dlpi_cl_stream_request->test_length;
-  
+
   /* bind the sap and retrieve the dlsap assigned by the system  */
   dlpi_cl_stream_response->station_addr_len = 14; /* arbitrary */
   if (dl_bind(data_descriptor,
@@ -2465,15 +2465,15 @@
     fflush(where);
     exit(1);
   }
-  
+
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a -1 to */
   /* the initiator. */
-  
+
   dlpi_cl_stream_response->cpu_rate = 0.0; 	/* assume no cpu */
   if (dlpi_cl_stream_request->measure_cpu) {
     /* We will pass the rate into the calibration routine. If the */
@@ -2483,33 +2483,33 @@
     dlpi_cl_stream_response->measure_cpu = 1;
     dlpi_cl_stream_response->cpu_rate = calibrate_local_cpu(dlpi_cl_stream_request->cpu_rate);
   }
-  
+
   message_size	= dlpi_cl_stream_request->message_size;
   test_time	= dlpi_cl_stream_request->test_length;
-  
+
   send_response();
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(dlpi_cl_stream_request->measure_cpu);
-  
+
   /* The loop will exit when the timer pops, or if we happen to recv a */
   /* message of less than send_size bytes... */
-  
+
   times_up = 0;
   start_timer(test_time + PAD_TIME);
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_cl_stream: about to enter inner sanctum.\n");
     fflush(where);
   }
-  
+
   while (!times_up) {
-    if((getmsg(data_descriptor, 
-	       &rctl_message,    
+    if((getmsg(data_descriptor,
+	       &rctl_message,
 	       &recv_message,
-	       &flags) != 0) || 
+	       &flags) != 0) ||
        (data_ind->dl_primitive != DL_UNITDATA_IND)) {
       if (errno == EINTR) {
 	/* Again, we have likely hit test-end time */
@@ -2526,17 +2526,17 @@
     }
     messages_recvd++;
   }
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_cl_stream: got %d messages.\n",messages_recvd);
     fflush(where);
   }
-  
-  
+
+
   /* The loop now exits due timer or < send_size bytes received. */
-  
+
   cpu_stop(dlpi_cl_stream_request->measure_cpu,&elapsed_time);
-  
+
   if (times_up) {
     /* we ended on a timer, subtract the PAD_TIME */
     elapsed_time -= (float)PAD_TIME;
@@ -2544,25 +2544,25 @@
   else {
     stop_timer();
   }
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_cl_stream: test ended in %f seconds.\n",elapsed_time);
     fflush(where);
   }
-  
-  
+
+
   /* We will count the "off" message */
   bytes_received = (messages_recvd * message_size) + len;
-  
+
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_cl_stream: got %d bytes\n",
 	    bytes_received);
     fflush(where);
   }
-  
+
   netperf_response.content.response_type		= DLPI_CL_STREAM_RESULTS;
   dlpi_cl_stream_results->bytes_received	= bytes_received;
   dlpi_cl_stream_results->messages_recvd	= messages_recvd;
@@ -2573,58 +2573,58 @@
   else {
     dlpi_cl_stream_results->cpu_util	= -1.0;
   }
-  
+
   if (debug > 1) {
     fprintf(where,
 	    "recv_dlpi_cl_stream: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   send_response();
-  
+
 }
 
 int send_dlpi_cl_rr(char remote_host[])
 {
-  
+
   char *tput_title = "\
 Local /Remote\n\
 Window Size   Request  Resp.   Elapsed  Trans.\n\
 Send   Recv   Size     Size    Time     Rate         \n\
 frames frames bytes    bytes   secs.    per sec   \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1_line_1 = "\
 %-6d %-6d %-6d   %-6d  %-6.2f   %7.2f   \n";
   char *tput_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *cpu_title = "\
 Local /Remote\n\
 Window Size   Request Resp.  Elapsed Trans.   CPU    CPU    S.dem   S.dem\n\
 Send   Recv   Size    Size   Time    Rate     local  remote local   remote\n\
 frames frames bytes   bytes  secs.   per sec  %%      %%      us/Tr   us/Tr\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f\n";
-  
+
   char *cpu_fmt_1_line_1 = "\
 %-6d %-6d %-6d  %-6d %-6.2f  %-6.2f   %-6.2f %-6.2f %-6.3f  %-6.3f\n";
-  
+
   char *cpu_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *ksink_fmt = "\
 Alignment      Offset\n\
 Local  Remote  Local  Remote\n\
 Send   Recv    Send   Recv\n\
 %5d  %5d   %5d  %5d\n";
-  
-  
+
+
   float			elapsed_time;
-  
+
   int   dlsap_len;
   int   flags = 0;
   char	*send_message_ptr;
@@ -2637,23 +2637,23 @@
   struct strbuf recv_message;
   struct strbuf sctl_message;
   struct strbuf rctl_message;
-  
+
   /* these are to make reading some of the DLPI control messages easier */
   dl_unitdata_ind_t *data_ind = (dl_unitdata_ind_t *)rctl_data;
   dl_unitdata_req_t *data_req = (dl_unitdata_req_t *)sctl_data;
   dl_uderror_ind_t  *uder_ind = (dl_uderror_ind_t *)rctl_data;
-  
+
   int	nummessages;
   int	send_descriptor;
   int	trans_remaining;
   int	bytes_xferd;
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
   double thruput;
-  
+
 #ifdef WANT_INTERVALS
   /* timing stuff */
 #define	MAX_KEPT_TIMES	1024
@@ -2667,18 +2667,18 @@
   struct	timeval		recv_time;
   struct	timeval		sleep_timeval;
 #endif /* WANT_INTERVALS */
-  
+
   struct	dlpi_cl_rr_request_struct	*dlpi_cl_rr_request;
   struct	dlpi_cl_rr_response_struct	*dlpi_cl_rr_response;
   struct	dlpi_cl_rr_results_struct	*dlpi_cl_rr_result;
-  
-  dlpi_cl_rr_request	= 
+
+  dlpi_cl_rr_request	=
     (struct dlpi_cl_rr_request_struct *)netperf_request.content.test_specific_data;
-  dlpi_cl_rr_response	= 
+  dlpi_cl_rr_response	=
     (struct dlpi_cl_rr_response_struct *)netperf_response.content.test_specific_data;
-  dlpi_cl_rr_result	= 
+  dlpi_cl_rr_result	=
     (struct dlpi_cl_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   /* we want to zero out the times, so we can detect unused entries. */
 #ifdef WANT_INTERVALS
   time_index = 0;
@@ -2688,7 +2688,7 @@
   }
   time_index = 0;
 #endif /* WANT_INTERVALS */
-  
+
   if (print_headers) {
     fprintf(where,"DLPI CL REQUEST/RESPONSE TEST\n");
     if (local_cpu_usage || remote_cpu_usage)
@@ -2696,60 +2696,60 @@
     else
       fprintf(where,tput_title,format_units());
   }
-  
+
   /* initialize a few counters */
-  
+
   nummessages	=	0;
   bytes_xferd	=	0;
   times_up 	= 	0;
-  
+
   /* set-up the data buffer with the requested alignment and offset */
   temp_message_ptr = (char *)malloc(req_size+MAXALIGNMENT+MAXOFFSET);
   if (temp_message_ptr == NULL) {
     printf("malloc(%d) failed!\n", req_size+MAXALIGNMENT+MAXOFFSET);
     exit(1);
   }
-  send_message_ptr = (char *)(( (long)temp_message_ptr + 
-			       (long) local_send_align - 1) &	
+  send_message_ptr = (char *)(( (long)temp_message_ptr +
+			       (long) local_send_align - 1) &
 			      ~((long) local_send_align - 1));
   send_message_ptr = send_message_ptr + local_send_offset;
   send_message.maxlen = req_size;
   send_message.len    = req_size;
   send_message.buf    = send_message_ptr;
-  
+
   temp_message_ptr = (char *)malloc(rsp_size+MAXALIGNMENT+MAXOFFSET);
   if (temp_message_ptr == NULL) {
     printf("malloc(%d) failed!\n", rsp_size+MAXALIGNMENT+MAXOFFSET);
     exit(1);
   }
-  recv_message_ptr = (char *)(( (long)temp_message_ptr + 
-			       (long) local_recv_align - 1) &	
+  recv_message_ptr = (char *)(( (long)temp_message_ptr +
+			       (long) local_recv_align - 1) &
 			      ~((long) local_recv_align - 1));
   recv_message_ptr = recv_message_ptr + local_recv_offset;
   recv_message.maxlen = rsp_size;
   recv_message.len    = 0;
   recv_message.buf    = recv_message_ptr;
-  
+
   sctl_message.maxlen = BUFSIZ;
   sctl_message.len    = 0;
   sctl_message.buf    = sctl_data;
-  
+
   rctl_message.maxlen = BUFSIZ;
   rctl_message.len    = 0;
   rctl_message.buf    = rctl_data;
-  
+
   /* lets get ourselves a file descriptor */
-  
+
   send_descriptor = dl_open(loc_dlpi_device,loc_ppa);
   if (send_descriptor < 0){
     perror("netperf: send_dlpi_cl_rr: dlpi cl rr send descriptor");
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,"send_dlpi_cl_rr: send_descriptor obtained...\n");
   }
-  
+
   /* bind the sap to the descriptor and get the dlsap */
   dlsap_len = BUFSIZ;
   if (dl_bind(send_descriptor,
@@ -2761,14 +2761,14 @@
     fflush(where);
     exit(1);
   }
-  
+
   /* Modify the local socket size. If the user has not requested that */
   /* the socket buffers be altered, we will try to find-out what their */
   /* values are. If we cannot touch the socket buffer in any way, we */
   /* will set the values to -1 to indicate that.  The receive socket */
   /* must have enough space to hold addressing information so += a */
-  /* sizeof struct sockaddr_in to it. */ 
-  
+  /* sizeof struct sockaddr_in to it. */
+
   /* this is actually nothing code, and should be replaced with the */
   /* alalagous calls in the STREAM test where the window size is set */
   /* with the HP DLPI Extension. raj 8/94 */
@@ -2785,24 +2785,24 @@
       fprintf(where,"                          remote: %d\n",lrw_size);
     }
   }
-  
-  
+
+
   /* Now, we will find-out what the size actually became, and report */
   /* that back to the user. If the call fails, we will just report a -1 */
   /* back to the initiator for the recv buffer size. */
-  
+
   if (debug) {
     fprintf(where,"netperf: send_dlpi_cl_rr: socket sizes determined...\n");
     fprintf(where,"         send: %d recv: %d\n",lsw_size,lrw_size);
   }
-  
+
 #else /* SO_SNDBUF */
-  
+
   lsw_size = -1;
   lrw_size = -1;
-  
+
 #endif /* SO_SNDBUF */
-  
+
   /* If the user has requested cpu utilization measurements, we must */
   /* calibrate the cpu(s). We will perform this task within the tests */
   /* themselves. If the user has specified the cpu rate, then */
@@ -2811,11 +2811,11 @@
   /* all the "normal" calibration stuff and return the rate back. If */
   /* there is no idle counter in the kernel idle loop, the */
   /* local_cpu_rate will be set to -1. */
-  
+
   if (local_cpu_usage) {
     local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
   }
-  
+
   /* Tell the remote end to do a listen. The server alters the socket */
   /* paramters on the other side at this point, hence the reason for */
   /* all the values being passed in the setup message. If the user did */
@@ -2823,7 +2823,7 @@
   /* will indicate to the remote that no changes beyond the system's */
   /* default should be used. Alignment is the exception, it will */
   /* default to 8, which will be no alignment alterations. */
-  
+
   netperf_request.content.request_type	        =	DO_DLPI_CL_RR;
   dlpi_cl_rr_request->recv_win_size	=	rrw_size;
   dlpi_cl_rr_request->send_win_size	=	rsw_size;
@@ -2840,9 +2840,9 @@
   dlpi_cl_rr_request->dev_name_len      =       strlen(rem_dlpi_device);
   strcpy(dlpi_cl_rr_request->dlpi_device,
 	 rem_dlpi_device);
-  
+
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -2853,32 +2853,32 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) dlpi_cl_rr_request->dlpi_device;
     lastword = initword + ((strlen(rem_dlpi_device) + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = ntohl(*charword);
     }
   }
 #endif /* __alpha */
-  
+
   if (test_time) {
     dlpi_cl_rr_request->test_length	=	test_time;
   }
   else {
     dlpi_cl_rr_request->test_length	=	test_trans * -1;
   }
-  
+
   if (debug > 1) {
     fprintf(where,"netperf: send_dlpi_cl_rr: requesting DLPI CL request/response test\n");
   }
-  
+
   send_request();
-  
+
   /* The response from the remote will contain all of the relevant 	*/
   /* socket parameters for this test type. We will put them back into 	*/
   /* the variables here so they can be displayed if desired.  The	*/
@@ -2888,9 +2888,9 @@
   /* after the connect returns. The remote will grab the counter right	*/
   /* after the accept call. This saves the hassle of extra messages	*/
   /* being sent for the tests.                                          */
-  
+
   recv_response();
-  
+
   if (!netperf_response.content.serv_errno) {
     if (debug)
       fprintf(where,"remote listen done.\n");
@@ -2898,7 +2898,7 @@
     rsw_size	=	dlpi_cl_rr_response->send_win_size;
     remote_cpu_usage=	dlpi_cl_rr_response->measure_cpu;
     remote_cpu_rate = 	dlpi_cl_rr_response->cpu_rate;
-    
+
     /* set-up the destination addressing control info */
     data_req->dl_primitive = DL_UNITDATA_REQ;
     bcopy((char *)(dlpi_cl_rr_response->station_addr),
@@ -2908,7 +2908,7 @@
     data_req->dl_dest_addr_length = dlpi_cl_rr_response->station_addr_len;
     /* there is a dl_priority structure too, but I am ignoring it for */
     /* the time being. */
-    sctl_message.len = sizeof(dl_unitdata_req_t) + 
+    sctl_message.len = sizeof(dl_unitdata_req_t) +
       data_req->dl_dest_addr_length;
     /* famous last words - some DLPI providers get unhappy if the
        priority stuff is not initialized.  fix from Nicolas Thomas. */
@@ -2921,16 +2921,16 @@
     perror("netperf: remote error");
     exit(1);
   }
-  
+
   /* Data Socket set-up is finished. If there were problems, either the */
   /* connect would have failed, or the previous response would have */
   /* indicated a problem. I failed to see the value of the extra */
   /* message after the accept on the remote. If it failed, we'll see it */
   /* here. If it didn't, we might as well start pumping data. */
-  
+
   /* Set-up the test end conditions. For a request/response test, they */
   /* can be either time or transaction based. */
-  
+
   if (test_time) {
     /* The user wanted to end the test after a period of time. */
     times_up = 0;
@@ -2942,13 +2942,13 @@
     trans_remaining = test_bytes;
     times_up = 1;
   }
-  
+
   /* The cpu_start routine will grab the current time and possibly */
   /* value of the idle counter for later use in measuring cpu */
   /* utilization and/or service demand and thruput. */
-  
+
   cpu_start(local_cpu_usage);
-  
+
   /* We use an "OR" to control test execution. When the test is */
   /* controlled by time, the byte count check will always return false. */
   /* When the test is controlled by byte count, the time test will */
@@ -2975,17 +2975,17 @@
       perror("send_dlpi_cl_rr: data send error");
       exit(1);
     }
-    
+
     /* receive the response. at some point, we will need to handle */
     /* sending responses which are greater than the datalink MTU. we */
     /* may also want to add some DLPI error checking, but for now we */
     /* will ignore that and just let errors stop the test with little */
     /* indication of what might actually be wrong. */
-    
-    if((getmsg(send_descriptor, 
-	       &rctl_message,    
+
+    if((getmsg(send_descriptor,
+	       &rctl_message,
 	       &recv_message,
-	       &flags) != 0) || 
+	       &flags) != 0) ||
        (data_ind->dl_primitive != DL_UNITDATA_IND)) {
       if (errno == EINTR) {
 	/* Again, we have likely hit test-end time */
@@ -3000,18 +3000,18 @@
     }
 #ifdef WANT_INTERVALS
     gettimeofday(&recv_time,&dummy_zone);
-    
+
     /* now we do some arithmatic on the two timevals */
     if (recv_time.tv_usec < send_time.tv_usec) {
       /* we wrapped around a second */
       recv_time.tv_usec += 1000000;
       recv_time.tv_sec  -= 1;
     }
-    
+
     /* and store it away */
     kept_times[time_index] = (recv_time.tv_sec - send_time.tv_sec) * 1000000;
     kept_times[time_index] += (recv_time.tv_usec - send_time.tv_usec);
-    
+
     /* at this point, we may wish to sleep for some period of */
     /* time, so we see how long that last transaction just took, */
     /* and sleep for the difference of that and the interval. We */
@@ -3030,32 +3030,32 @@
 	       &sleep_timeval);
       }
     }
-    
+
     /* now up the time index */
     time_index = (time_index +1)%MAX_KEPT_TIMES;
 #endif /* WANT_INTERVALS */
-    nummessages++;          
+    nummessages++;
     if (trans_remaining) {
       trans_remaining--;
     }
-    
+
     if (debug > 3) {
       fprintf(where,"Transaction %d completed\n",nummessages);
       fflush(where);
     }
-    
+
   }
-  
+
   /* this call will always give us the elapsed time for the test, and */
   /* will also store-away the necessaries for cpu utilization */
-  
+
   cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being measured? */
   /* how long did we really run? */
-  
+
   /* Get the statistics from the remote end. The remote will have */
   /* calculated service demand and all those interesting things. If it */
   /* wasn't supposed to care, it will return obvious values. */
-  
+
   recv_response();
   if (!netperf_response.content.serv_errno) {
     if (debug)
@@ -3064,10 +3064,10 @@
   else {
     Set_errno(netperf_response.content.serv_errno);
     perror("netperf: remote error");
-    
+
     exit(1);
   }
-  
+
   /* We now calculate what our thruput was for the test. In the future, */
   /* we may want to include a calculation of the thruput measured by */
   /* the remote, but it should be the case that for a UDP stream test, */
@@ -3076,10 +3076,10 @@
   /* If it was time, we needed to, and if it was by bytes, the user may */
   /* have specified a number of bytes that wasn't a multiple of the */
   /* send_size, so we really didn't send what he asked for ;-) We use */
-  
+
   bytes_xferd	= (req_size * nummessages) + (rsp_size * nummessages);
   thruput		= calc_thruput(bytes_xferd);
-  
+
   if (local_cpu_usage || remote_cpu_usage) {
     /* We must now do a little math for service demand and cpu */
     /* utilization for the system(s) */
@@ -3105,7 +3105,7 @@
       local_cpu_utilization	= -1.0;
       local_service_demand	= -1.0;
     }
-    
+
     if (remote_cpu_usage) {
       if (remote_cpu_rate == 0.0) {
 	fprintf(where,"DANGER  DANGER  DANGER    DANGER  DANGER  DANGER    DANGER!\n");
@@ -3125,7 +3125,7 @@
       remote_cpu_utilization = -1.0;
       remote_service_demand  = -1.0;
     }
-    
+
     /* We are now ready to print all the information. If the user */
     /* has specified zero-level verbosity, we will just print the */
     /* local service demand, or the remote service demand. If the */
@@ -3134,7 +3134,7 @@
     /* of greater than 1, we will display a veritable plethora of */
     /* background information from outside of this block as it it */
     /* not cpu_measurement specific...  */
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -3191,23 +3191,23 @@
 	      tput_fmt_1_line_2,
 	      rsw_size, 		/* remote recvbuf size */
 	      rrw_size);
-      
+
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   if (verbosity > 1) {
     /* The user wanted to know it all, so we will give it to him. */
     /* This information will include as much as we can find about */
     /* UDP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-    
+
 #ifdef WANT_INTERVALS
     kept_times[MAX_KEPT_TIMES] = 0;
     time_index = 0;
@@ -3227,15 +3227,15 @@
   }
 }
 
-int 
+int
   recv_dlpi_cl_rr()
 {
-  
+
   char  *message;
   int	data_descriptor;
   int   flags = 0;
   int	measure_cpu;
-  
+
   char	*recv_message_ptr;
   char	*send_message_ptr;
   char  sctl_data[BUFSIZ];
@@ -3245,32 +3245,32 @@
   struct strbuf recv_message;
   struct strbuf sctl_message;
   struct strbuf rctl_message;
-  
+
   /* these are to make reading some of the DLPI control messages easier */
   dl_unitdata_ind_t *data_ind = (dl_unitdata_ind_t *)rctl_data;
   dl_unitdata_req_t *data_req = (dl_unitdata_req_t *)sctl_data;
   dl_uderror_ind_t  *uder_ind = (dl_uderror_ind_t *)rctl_data;
-  
+
   int	trans_received;
   int	trans_remaining;
   float	elapsed_time;
-  
+
   struct	dlpi_cl_rr_request_struct	*dlpi_cl_rr_request;
   struct	dlpi_cl_rr_response_struct	*dlpi_cl_rr_response;
   struct	dlpi_cl_rr_results_struct	*dlpi_cl_rr_results;
-  
-  dlpi_cl_rr_request  = 
+
+  dlpi_cl_rr_request  =
     (struct dlpi_cl_rr_request_struct *)netperf_request.content.test_specific_data;
-  dlpi_cl_rr_response = 
+  dlpi_cl_rr_response =
     (struct dlpi_cl_rr_response_struct *)netperf_response.content.test_specific_data;
-  dlpi_cl_rr_results  = 
+  dlpi_cl_rr_results  =
     (struct dlpi_cl_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_dlpi_cl_rr: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen descriptor with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -3278,19 +3278,19 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_cl_rr: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = DLPI_CL_RR_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_cl_rr: the response type is set...\n");
     fflush(where);
@@ -3302,10 +3302,10 @@
     printf("malloc(%d) failed!\n", DATABUFFERLEN);
     exit(1);
   }
-  
+
   /* We now alter the message_ptr variables to be at the desired */
   /* alignments with the desired offsets. */
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_cl_rr: requested recv alignment of %d offset %d\n",
@@ -3322,29 +3322,29 @@
   recv_message.maxlen = dlpi_cl_rr_request->request_size;
   recv_message.len    = 0;
   recv_message.buf    = recv_message_ptr;
-  
+
   send_message_ptr = ALIGN_BUFFER(message, dlpi_cl_rr_request->send_alignment, dlpi_cl_rr_request->send_offset);
   send_message.maxlen = dlpi_cl_rr_request->response_size;
   send_message.len    = dlpi_cl_rr_request->response_size;
   send_message.buf    = send_message_ptr;
-  
+
   sctl_message.maxlen = BUFSIZ;
   sctl_message.len    = 0;
   sctl_message.buf    = sctl_data;
-  
+
   rctl_message.maxlen = BUFSIZ;
   rctl_message.len    = 0;
   rctl_message.buf    = rctl_data;
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_cl_rr: receive alignment and offset set...\n");
     fprintf(where,"recv_dlpi_cl_rr: grabbing a socket...\n");
     fflush(where);
   }
-  
-  
+
+
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -3355,19 +3355,19 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) dlpi_cl_rr_request->dlpi_device;
     lastword = initword + ((dlpi_cl_rr_request->dev_name_len + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = htonl(*charword);
     }
   }
 #endif /* __alpha */
-  
+
   data_descriptor = dl_open(dlpi_cl_rr_request->dlpi_device,
 			    dlpi_cl_rr_request->ppa);
   if (data_descriptor < 0) {
@@ -3375,34 +3375,34 @@
     send_response();
     exit(1);
   }
-  
-  
+
+
   /* The initiator may have wished-us to modify the window */
   /* sizes. We should give it a shot. If he didn't ask us to change the */
   /* sizes, we should let him know what sizes were in use at this end. */
   /* If none of this code is compiled-in, then we will tell the */
   /* initiator that we were unable to play with the sizes by */
   /* setting the size in the response to -1. */
-  
+
 #ifdef DL_HP_SET_LOCAL_WIN_REQ
-  
+
   if (dlpi_cl_rr_request->recv_win_size) {
   }
-  
+
   if (dlpi_cl_rr_request->send_win_size) {
   }
-  
+
   /* Now, we will find-out what the sizes actually became, and report */
   /* them back to the user. If the calls fail, we will just report a -1 */
   /* back to the initiator for the buffer size. */
-  
+
 #else /* the system won't let us play with the buffers */
-  
+
   dlpi_cl_rr_response->recv_win_size	= -1;
   dlpi_cl_rr_response->send_win_size	= -1;
-  
+
 #endif /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   /* bind the sap and retrieve the dlsap assigned by the system  */
   dlpi_cl_rr_response->station_addr_len = 14; /* arbitrary */
   if (dl_bind(data_descriptor,
@@ -3414,28 +3414,28 @@
     fflush(where);
     exit(1);
   }
-  
+
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a 0.0 to */
   /* the initiator. */
-  
+
   dlpi_cl_rr_response->cpu_rate = 0.0; 	/* assume no cpu */
   if (dlpi_cl_rr_request->measure_cpu) {
     dlpi_cl_rr_response->measure_cpu = 1;
     dlpi_cl_rr_response->cpu_rate = calibrate_local_cpu(dlpi_cl_rr_request->cpu_rate);
   }
-  
+
   send_response();
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start receiving. */
-  
+
   cpu_start(dlpi_cl_rr_request->measure_cpu);
-  
+
   if (dlpi_cl_rr_request->test_length > 0) {
     times_up = 0;
     trans_remaining = 0;
@@ -3445,17 +3445,17 @@
   times_up = 1;
   trans_remaining = dlpi_cl_rr_request->test_length * -1;
 }
-  
+
   while ((!times_up) || (trans_remaining > 0)) {
-    
+
     /* receive the request from the other side. at some point we need */
     /* to handle "logical" requests and responses which are larger */
     /* than the data link MTU */
-    
-    if((getmsg(data_descriptor, 
-	       &rctl_message,    
+
+    if((getmsg(data_descriptor,
+	       &rctl_message,
 	       &recv_message,
-	       &flags) != 0) || 
+	       &flags) != 0) ||
        (data_ind->dl_primitive != DL_UNITDATA_IND)) {
       if (errno == EINTR) {
 	/* Again, we have likely hit test-end time */
@@ -3473,10 +3473,10 @@
       send_response();
       exit(1);
     }
-    
+
     /* Now, send the response to the remote. first copy the dlsap */
     /* information from the receive to the sending control message */
-    
+
     data_req->dl_dest_addr_offset = sizeof(dl_unitdata_req_t);
     bcopy((char *)data_ind + data_ind->dl_src_addr_offset,
 	  (char *)data_req + data_req->dl_dest_addr_offset,
@@ -3508,27 +3508,27 @@
       send_response();
       exit(1);
     }
-    
+
     trans_received++;
     if (trans_remaining) {
       trans_remaining--;
     }
-    
+
     if (debug) {
       fprintf(where,
 	      "recv_dlpi_cl_rr: Transaction %d complete.\n",
 	      trans_received);
       fflush(where);
     }
-    
+
   }
-  
-  
+
+
   /* The loop now exits due to timeout or transaction count being */
   /* reached */
-  
+
   cpu_stop(dlpi_cl_rr_request->measure_cpu,&elapsed_time);
-  
+
   if (times_up) {
     /* we ended the test by time, which was at least 2 seconds */
     /* longer than we wanted to run. so, we want to subtract */
@@ -3536,67 +3536,67 @@
     elapsed_time -= PAD_TIME;
   }
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_cl_rr: got %d transactions\n",
 	    trans_received);
     fflush(where);
   }
-  
-  dlpi_cl_rr_results->bytes_received	= (trans_received * 
-					   (dlpi_cl_rr_request->request_size + 
+
+  dlpi_cl_rr_results->bytes_received	= (trans_received *
+					   (dlpi_cl_rr_request->request_size +
 					    dlpi_cl_rr_request->response_size));
   dlpi_cl_rr_results->trans_received	= trans_received;
   dlpi_cl_rr_results->elapsed_time	= elapsed_time;
   if (dlpi_cl_rr_request->measure_cpu) {
     dlpi_cl_rr_results->cpu_util	= calc_cpu_util(elapsed_time);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_cl_rr: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   send_response();
-  
+
 }
 
-int 
+int
   recv_dlpi_co_rr()
 {
-  
+
   char  *message;
   SOCKET	s_listen,data_descriptor;
-  
+
   int	measure_cpu;
-  
+
   int   flags = 0;
   char	*recv_message_ptr;
   char	*send_message_ptr;
   struct strbuf send_message;
   struct strbuf recv_message;
-  
+
   int	trans_received;
   int	trans_remaining;
   int	request_bytes_remaining;
   int	timed_out = 0;
   float	elapsed_time;
-  
+
   struct	dlpi_co_rr_request_struct	*dlpi_co_rr_request;
   struct	dlpi_co_rr_response_struct	*dlpi_co_rr_response;
   struct	dlpi_co_rr_results_struct	*dlpi_co_rr_results;
-  
+
   dlpi_co_rr_request	= (struct dlpi_co_rr_request_struct *)netperf_request.content.test_specific_data;
   dlpi_co_rr_response	= (struct dlpi_co_rr_response_struct *)netperf_response.content.test_specific_data;
   dlpi_co_rr_results	= (struct dlpi_co_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_dlpi_co_rr: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -3604,19 +3604,19 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_co_rr: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = DLPI_CO_RR_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_co_rr: the response type is set...\n");
     fflush(where);
@@ -3628,10 +3628,10 @@
     printf("malloc(%d) failed!\n", DATABUFFERLEN);
     exit(1);
   }
-  
+
   /* We now alter the message_ptr variables to be at the desired */
   /* alignments with the desired offsets. */
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_co_rr: requested recv alignment of %d offset %d\n",
@@ -3648,12 +3648,12 @@
   recv_message.maxlen = dlpi_co_rr_request->request_size;
   recv_message.len    = 0;
   recv_message.buf    = recv_message_ptr;
-  
+
   send_message_ptr = ALIGN_BUFFER(message, dlpi_co_rr_request->send_alignment, dlpi_co_rr_request->send_offset);
   send_message.maxlen = dlpi_co_rr_request->response_size;
   send_message.len    = dlpi_co_rr_request->response_size;
   send_message.buf    = send_message_ptr;
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_co_rr: receive alignment and offset set...\n");
     fprintf(where,"recv_dlpi_co_rr: send_message.buf %x .len %d .maxlen %d\n",
@@ -3662,23 +3662,23 @@
 	    recv_message.buf,recv_message.len,recv_message.maxlen);
     fflush(where);
   }
-  
+
   /* Let's clear-out our sockaddr for the sake of cleanlines. Then we */
   /* can put in OUR values !-) At some point, we may want to nail this */
   /* socket to a particular network-level address, but for now, */
   /* INADDR_ANY should be just fine. */
-  
+
   /* Grab a socket to listen on, and then listen on it. */
-  
+
   if (debug) {
     fprintf(where,"recv_dlpi_co_rr: grabbing a socket...\n");
     fflush(where);
   }
-  
+
   /* lets grab a file descriptor for a particular link */
-  
+
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -3689,30 +3689,30 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) dlpi_co_rr_request->dlpi_device;
     lastword = initword + ((dlpi_co_rr_request->dev_name_len + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = htonl(*charword);
     }
   }
 #endif /* __alpha */
-  
+
   if ((data_descriptor = dl_open(dlpi_co_rr_request->dlpi_device,
 				 dlpi_co_rr_request->ppa)) < 0) {
     netperf_response.content.serv_errno = errno;
     send_response();
     exit(1);
   }
-  
+
   /* bind the file descriptor to a sap and get the resultant dlsap */
   dlpi_co_rr_response->station_addr_len = 14; /*arbitrary needs fixing */
-  if (dl_bind(data_descriptor, 
-              dlpi_co_rr_request->sap, 
+  if (dl_bind(data_descriptor,
+              dlpi_co_rr_request->sap,
               DL_CODLS,
               (char *)dlpi_co_rr_response->station_addr,
               &dlpi_co_rr_response->station_addr_len) != 0) {
@@ -3720,38 +3720,38 @@
     send_response();
     exit(1);
   }
-  
+
   /* The initiator may have wished-us to modify the socket buffer */
   /* sizes. We should give it a shot. If he didn't ask us to change the */
   /* sizes, we should let him know what sizes were in use at this end. */
   /* If none of this code is compiled-in, then we will tell the */
   /* initiator that we were unable to play with the socket buffer by */
   /* setting the size in the response to -1. */
-  
+
 #ifdef DL_HP_SET_LOCAL_WIN_REQ
-  
+
   if (dlpi_co_rr_request->recv_win_size) {
     /* SMOP */
   }
-  
+
   if (dlpi_co_rr_request->send_win_size) {
     /* SMOP */
   }
-  
+
   /* Now, we will find-out what the sizes actually became, and report */
   /* them back to the user. If the calls fail, we will just report a -1 */
   /* back to the initiator for the buffer size. */
-  
+
 #else /* the system won't let us play with the buffers */
-  
+
   dlpi_co_rr_response->recv_win_size	= -1;
   dlpi_co_rr_response->send_win_size	= -1;
-  
+
 #endif /* DL_HP_SET_LOCAL_WIN_REQ */
-  
+
   /* we may have been requested to enable the copy avoidance features. */
   /* can we actually do this with DLPI, the world wonders */
-  
+
   if (dlpi_co_rr_request->so_rcvavoid) {
 #ifdef SO_RCV_COPYAVOID
     dlpi_co_rr_response->so_rcvavoid = 0;
@@ -3760,7 +3760,7 @@
     dlpi_co_rr_response->so_rcvavoid = 0;
 #endif
   }
-  
+
   if (dlpi_co_rr_request->so_sndavoid) {
 #ifdef SO_SND_COPYAVOID
     dlpi_co_rr_response->so_sndavoid = 0;
@@ -3769,27 +3769,27 @@
     dlpi_co_rr_response->so_sndavoid = 0;
 #endif
   }
-  
+
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a 0.0 to */
   /* the initiator. */
-  
+
   dlpi_co_rr_response->cpu_rate = 0.0; 	/* assume no cpu */
   if (dlpi_co_rr_request->measure_cpu) {
     dlpi_co_rr_response->measure_cpu = 1;
     dlpi_co_rr_response->cpu_rate = calibrate_local_cpu(dlpi_co_rr_request->cpu_rate);
   }
-  
+
   send_response();
-  
+
   /* accept a connection on this file descriptor. at some point, */
   /* dl_accept will "do the right thing" with the last two parms, but */
   /* for now it ignores them, so we will pass zeros. */
-  
+
   if(dl_accept(data_descriptor, 0, 0) != 0) {
     fprintf(where,
 	    "recv_dlpi_co_rr: error in accept, errno %d\n",
@@ -3799,21 +3799,21 @@
     send_response();
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_co_rr: accept completes on the data connection.\n");
     fflush(where);
   }
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(dlpi_co_rr_request->measure_cpu);
-  
+
   /* The loop will exit when the sender does a shutdown, which will */
   /* return a length of zero   */
-  
+
   if (dlpi_co_rr_request->test_length > 0) {
     times_up = 0;
     trans_remaining = 0;
@@ -3823,10 +3823,10 @@
   times_up = 1;
   trans_remaining = dlpi_co_rr_request->test_length * -1;
 }
-  
+
   while ((!times_up) || (trans_remaining > 0)) {
     request_bytes_remaining	= dlpi_co_rr_request->request_size;
-    
+
     /* receive the request from the other side. there needs to be some */
     /* more login in place for handling messages larger than link mtu, */
     /* but that can wait for later */
@@ -3840,14 +3840,14 @@
 	  timed_out = 1;
 	  break;
 	}
-	
+
         if (debug) {
 	  fprintf(where,"failed getmsg call errno %d\n",errno);
 	  fprintf(where,"recv_message.len %d\n",recv_message.len);
 	  fprintf(where,"send_message.len %d\n",send_message.len);
 	  fflush(where);
         }
-	
+
 	netperf_response.content.serv_errno = errno;
 	send_response();
 	exit(1);
@@ -3856,19 +3856,19 @@
 	request_bytes_remaining -= recv_message.len;
       }
     }
-    
+
     if (timed_out) {
       /* we hit the end of the test based on time - lets bail out of */
-      /* here now... */ 
+      /* here now... */
       break;
     }
-    
+
     if (debug) {
       fprintf(where,"recv_message.len %d\n",recv_message.len);
       fprintf(where,"send_message.len %d\n",send_message.len);
       fflush(where);
     }
-    
+
     /* Now, send the response to the remote */
     if((putmsg(data_descriptor,
 	       0,
@@ -3883,12 +3883,12 @@
       send_response();
       exit(1);
     }
-    
+
     trans_received++;
     if (trans_remaining) {
       trans_remaining--;
     }
-    
+
     if (debug) {
       fprintf(where,
 	      "recv_dlpi_co_rr: Transaction %d complete\n",
@@ -3896,13 +3896,13 @@
       fflush(where);
     }
   }
-  
-  
+
+
   /* The loop now exits due to timeout or transaction count being */
   /* reached */
-  
+
   cpu_stop(dlpi_co_rr_request->measure_cpu,&elapsed_time);
-  
+
   if (timed_out) {
     /* we ended the test by time, which was at least 2 seconds */
     /* longer than we wanted to run. so, we want to subtract */
@@ -3910,31 +3910,31 @@
     elapsed_time -= PAD_TIME;
   }
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_co_rr: got %d transactions\n",
 	    trans_received);
     fflush(where);
   }
-  
-  dlpi_co_rr_results->bytes_received	= (trans_received * 
-					   (dlpi_co_rr_request->request_size + 
+
+  dlpi_co_rr_results->bytes_received	= (trans_received *
+					   (dlpi_co_rr_request->request_size +
 					    dlpi_co_rr_request->response_size));
   dlpi_co_rr_results->trans_received	= trans_received;
   dlpi_co_rr_results->elapsed_time	= elapsed_time;
   if (dlpi_co_rr_request->measure_cpu) {
     dlpi_co_rr_results->cpu_util	= calc_cpu_util(elapsed_time);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_dlpi_co_rr: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   send_response();
-  
+
 }
 
 /* this routine will display the usage string for the DLPI tests */
@@ -3952,9 +3952,9 @@
 {
   extern int	optind, opterrs;  /* index of first unused arg 	*/
   extern char	*optarg;	  /* pointer to option string	*/
-  
+
   int		c;
-  
+
   char	arg1[BUFSIZ],  /* argument holders		*/
   arg2[BUFSIZ];
 
@@ -3963,18 +3963,18 @@
 	    "The DLPI tests do not know how to run with no control connection\n");
     exit(-1);
   }
-  
+
   /* Go through all the command line arguments and break them */
   /* out. For those options that take two parms, specifying only */
   /* the first will set both to that value. Specifying only the */
   /* second will leave the first untouched. To change only the */
   /* first, use the form first, (see the routine break_args.. */
-  
+
 #define DLPI_ARGS "D:hM:m:p:r:s:W:w:"
-  
+
   while ((c= getopt(argc, argv, DLPI_ARGS)) != EOF) {
     switch (c) {
-    case '?':	
+    case '?':
     case 'h':
       print_dlpi_usage();
       exit(1);
@@ -4007,7 +4007,7 @@
       break_args(optarg,arg1,arg2);
       if (arg1[0])
 	req_size = atoi(arg1);
-      if (arg2[0])	
+      if (arg2[0])
 	rsp_size = atoi(arg2);
       break;
     case 's':

Modified: trunk/src/nettest_sdp.c
===================================================================
--- trunk/src/nettest_sdp.c	2012-02-01 22:00:15 UTC (rev 530)
+++ trunk/src/nettest_sdp.c	2012-02-01 22:19:45 UTC (rev 531)
@@ -29,7 +29,7 @@
 #endif
 
 #if defined(WANT_SDP)
-     
+
 #include <sys/types.h>
 #include <fcntl.h>
 #include <errno.h>
@@ -63,7 +63,7 @@
 #else
 #error Must have either MSG_EOF or MSG_FIN defined
 #endif
-#endif 
+#endif
 
 #include "netlib.h"
 #include "netsh.h"
@@ -87,7 +87,7 @@
 /* these variables are specific to SDP tests. declare */
 /* them static to make them global only to this file. */
 
-static int	
+static int
   msg_count = 0,	/* number of messages to transmit on association */
   non_block = 0,	/* default to blocking sockets */
   num_associations = 1; /* number of associations on the endpoint */
@@ -127,8 +127,8 @@
 value, specifying a value with a leading comma will set just the second\n\
 parm, a value with a trailing comma will set just the first. To set\n\
 each parm to unique values, specify both and separate them with a\n\
-comma.\n"; 
-     
+comma.\n";
+
 
  /* This routine is intended to retrieve interesting aspects of sdp */
  /* for the data connection. at first, it attempts to retrieve the */
@@ -147,7 +147,7 @@
 
   sock_opt_len = sizeof(netperf_socklen_t);
   if (getsockopt(socket,
-		 getprotobyname("tcp")->p_proto,	
+		 getprotobyname("tcp")->p_proto,
 		 TCP_MAXSEG,
 		 (char *)mss,
 		 &sock_opt_len) == SOCKET_ERROR) {
@@ -163,34 +163,34 @@
 
 }
 
-void 
+void
 send_sdp_stream(char remote_host[])
 {
-  
+
   char *tput_title = "\
 Recv   Send    Send                          \n\
 Socket Socket  Message  Elapsed              \n\
 Size   Size    Size     Time     Throughput  \n\
 bytes  bytes   bytes    secs.    %s/sec  \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f %s\n";
-  
+
   char *tput_fmt_1 =
     "%6d %6d %6d    %-6.2f   %7.2f   %s\n";
-  
+
   char *cpu_title = "\
 Recv   Send    Send                          Utilization       Service Demand\n\
 Socket Socket  Message  Elapsed              Send     Recv     Send    Recv\n\
 Size   Size    Size     Time     Throughput  local    remote   local   remote\n\
 bytes  bytes   bytes    secs.    %-8.8s/s  %% %c      %% %c      us/KB   us/KB\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f %c %s\n";
 
   char *cpu_fmt_1 =
     "%6d %6d %6d    %-6.2f     %7.2f   %-6.2f   %-6.2f   %-6.3f  %-6.3f %s\n";
-  
+
   char *ksink_fmt = "\n\
 Alignment      Offset         %-8.8s %-8.8s    Sends   %-8.8s Recvs\n\
 Local  Remote  Local  Remote  Xfered   Per                 Per\n\
@@ -202,19 +202,19 @@
 Segment\n\
 Size (bytes)\n\
 %6d\n";
-  
-  
+
+
   float			elapsed_time;
-  
+
   /* what we want is to have a buffer space that is at least one */
   /* send-size greater than our send window. this will insure that we */
   /* are never trying to re-use a buffer that may still be in the hands */
   /* of the transport. This buffer will be malloc'd after we have found */
   /* the size of the local senc socket buffer. We will want to deal */
   /* with alignment and offset concerns as well. */
-  
+
   struct ring_elt *send_ring;
-  
+
   int len;
   unsigned int nummessages = 0;
   SOCKET send_socket;
@@ -227,28 +227,28 @@
 
   unsigned long long local_bytes_sent = 0;
   double	bytes_sent = 0.0;
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
 
   double	thruput;
-  
+
   struct addrinfo *remote_res;
   struct addrinfo *local_res;
-  
+
   struct	sdp_stream_request_struct	*sdp_stream_request;
   struct	sdp_stream_response_struct	*sdp_stream_response;
   struct	sdp_stream_results_struct	*sdp_stream_result;
-  
-  sdp_stream_request  = 
+
+  sdp_stream_request  =
     (struct sdp_stream_request_struct *)netperf_request.content.test_specific_data;
   sdp_stream_response =
     (struct sdp_stream_response_struct *)netperf_response.content.test_specific_data;
-  sdp_stream_result   = 
+  sdp_stream_result   =
     (struct sdp_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
 #ifdef WANT_HISTOGRAM
   if (verbosity > 1) {
     time_hist = HIST_new();
@@ -258,7 +258,7 @@
   /* control socket, and since we want to be able to use different */
   /* protocols and such, we are passed the name of the remote host and */
   /* must turn that into the test specific addressing information. */
-  
+
   /* complete_addrinfos will either succede or exit the process */
   complete_addrinfos(&remote_res,
 		     &local_res,
@@ -266,7 +266,7 @@
 		     SOCK_STREAM,
 		     IPPROTO_TCP,
 		     0);
-  
+
   if ( print_headers ) {
     print_top_test_header("SDP STREAM TEST",local_res,remote_res);
   }
@@ -287,26 +287,26 @@
 
     /* initialize a few counters. we have to remember that we might be */
     /* going through the loop more than once. */
-    
+
     nummessages    =	0;
     bytes_sent     =	0.0;
     times_up       = 	0;
-    
+
     /*set up the data socket                        */
     /* fake things out by changing local_res->ai_family to AF_INET_SDP */
     local_res->ai_family = AF_INET_SDP;
     local_res->ai_protocol = 0;
     send_socket = create_data_socket(local_res);
-    
+
     if (send_socket == INVALID_SOCKET){
       perror("netperf: send_sdp_stream: sdp stream data socket");
       exit(1);
     }
-    
+
     if (debug) {
       fprintf(where,"send_sdp_stream: send_socket obtained...\n");
     }
-    
+
     /* at this point, we have either retrieved the socket buffer sizes, */
     /* or have tried to set them, so now, we may want to set the send */
     /* size based on that (because the user either did not use a -m */
@@ -321,7 +321,7 @@
 	send_size = 4096;
       }
     }
-    
+
     /* set-up the data buffer ring with the requested alignment and offset. */
     /* note also that we have allocated a quantity */
     /* of memory that is at least one send-size greater than our socket */
@@ -334,7 +334,7 @@
       send_width = (lss_size/send_size) + 1;
       if (send_width == 1) send_width++;
     }
-    
+
     if (send_ring == NULL) {
       /* only allocate the send ring once. this is a networking test, */
       /* not a memory allocation test. this way, we do not need a */
@@ -352,11 +352,11 @@
     /* calibrate_local_cpu will return rather quickly as it will have */
     /* nothing to do. If local_cpu_rate is zero, then we will go through */
     /* all the "normal" calibration stuff and return the rate back. */
-    
+
     if (local_cpu_usage) {
       local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
     }
-    
+
     if (!no_control) {
       /* Tell the remote end to do a listen. The server alters the
 	 socket paramters on the other side at this point, hence the
@@ -366,7 +366,7 @@
 	 that no changes beyond the system's default should be
 	 used. Alignment is the exception, it will default to 1, which
 	 will be no alignment alterations. */
-    
+
       netperf_request.content.request_type =	DO_SDP_STREAM;
       sdp_stream_request->send_buf_size	=	rss_size_req;
       sdp_stream_request->recv_buf_size	=	rsr_size_req;
@@ -394,9 +394,9 @@
 	fprintf(where,
 		"netperf: send_sdp_stream: requesting SDP stream test\n");
       }
-      
+
       send_request();
-      
+
       /* The response from the remote will contain all of the relevant
          socket parameters for this test type. We will put them back
          into the variables here so they can be displayed if desired.
@@ -407,9 +407,9 @@
          will grab the counter right after the accept call. This saves
          the hassle of extra messages being sent for the SDP
          tests.  */
-    
+
       recv_response();
-    
+
       if (!netperf_response.content.serv_errno) {
 	if (debug)
 	  fprintf(where,"remote listen done.\n");
@@ -418,12 +418,12 @@
 	rem_nodelay     =	sdp_stream_response->no_delay;
 	remote_cpu_usage=	sdp_stream_response->measure_cpu;
 	remote_cpu_rate = sdp_stream_response->cpu_rate;
-	
+
 	/* we have to make sure that the server port number is in
 	   network order */
 	set_port_number(remote_res,
 			(short)sdp_stream_response->data_port_number);
-	
+
 	rem_rcvavoid	= sdp_stream_response->so_rcvavoid;
 	rem_sndavoid	= sdp_stream_response->so_sndavoid;
       }
@@ -434,7 +434,7 @@
 		netperf_response.content.serv_errno);
 	perror("");
 	fflush(where);
-	
+
 	exit(1);
       }
     }
@@ -444,7 +444,7 @@
 #endif
 
     /*Connect up to the remote port on the data socket  */
-    if (connect(send_socket, 
+    if (connect(send_socket,
 		remote_res->ai_addr,
 		remote_res->ai_addrlen) == INVALID_SOCKET){
       perror("netperf: send_sdp_stream: data socket connect failed");
@@ -456,11 +456,11 @@
     /* have indicated a problem. I failed to see the value of the */
     /* extra  message after the accept on the remote. If it failed, */
     /* we'll see it here. If it didn't, we might as well start pumping */
-    /* data. */ 
-    
+    /* data. */
+
     /* Set-up the test end conditions. For a stream test, they can be */
     /* either time or byte-count based. */
-    
+
     if (test_time) {
       /* The user wanted to end the test after a period of time. */
       times_up = 0;
@@ -478,16 +478,16 @@
       bytes_remaining = test_bytes;
       times_up = 1;
     }
-    
+
     /* The cpu_start routine will grab the current time and possibly */
     /* value of the idle counter for later use in measuring cpu */
     /* utilization and/or service demand and thruput. */
-    
+
     cpu_start(local_cpu_usage);
 
     /* we only start the interval timer if we are using the
        timer-timed intervals rather than the sit and spin ones. raj
-       2006-02-06 */    
+       2006-02-06 */
 #if defined(WANT_INTERVALS)
     INTERVALS_INIT();
 #endif /* WANT_INTERVALS */
@@ -499,23 +499,23 @@
 	HIST_timestamp(demo_one_ptr);
       }
 #endif
-      
 
+
     /* We use an "OR" to control test execution. When the test is */
     /* controlled by time, the byte count check will always return false. */
     /* When the test is controlled by byte count, the time test will */
     /* always return false. When the test is finished, the whole */
     /* expression will go false and we will stop sending data. */
-    
+
     while ((!times_up) || (bytes_remaining > 0)) {
-      
+
 #ifdef DIRTY
       access_buffer(send_ring->buffer_ptr,
 		    send_size,
 		    loc_dirty_count,
 		    loc_clean_count);
 #endif /* DIRTY */
-      
+
 #ifdef WANT_HISTOGRAM
       if (verbosity > 1) {
 	/* timestamp just before we go into send and then again just
@@ -547,22 +547,22 @@
 	HIST_timestamp(&time_two);
 	HIST_add(time_hist,delta_micro(&time_one,&time_two));
       }
-#endif /* WANT_HISTOGRAM */      
+#endif /* WANT_HISTOGRAM */
 
 #ifdef WANT_DEMO
       DEMO_STREAM_INTERVAL(send_size)
-#endif 
+#endif
 
 #if defined(WANT_INTERVALS)
       INTERVALS_WAIT();
 #endif /* WANT_INTERVALS */
-      
+
       /* now we want to move our pointer to the next position in the */
       /* data buffer...we may also want to wrap back to the "beginning" */
       /* of the bufferspace, so we will mod the number of messages sent */
       /* by the send width, and use that to calculate the offset to add */
       /* to the base pointer. */
-      nummessages++;          
+      nummessages++;
       send_ring = send_ring->next;
       if (bytes_remaining) {
 	bytes_remaining -= send_size;
@@ -571,7 +571,7 @@
 
     /* The test is over. Flush the buffers to the remote end. We do a */
     /* graceful release to insure that all data has been taken by the */
-    /* remote. */ 
+    /* remote. */
 
     /* but first, if the verbosity is greater than 1, find-out what */
     /* the SDP maximum segment_size was (if possible) */
@@ -579,27 +579,27 @@
       sdp_mss = -1;
       get_sdp_info(send_socket,&sdp_mss);
     }
-    
+
     if (shutdown(send_socket,SHUT_WR) == SOCKET_ERROR) {
       perror("netperf: cannot shutdown sdp stream socket");
       exit(1);
     }
-    
+
     /* hang a recv() off the socket to block until the remote has */
     /* brought all the data up into the application. it will do a */
     /* shutdown to cause a FIN to be sent our way. We will assume that */
     /* any exit from the recv() call is good... raj 4/93 */
-    
+
     recv(send_socket, send_ring->buffer_ptr, send_size, 0);
-    
+
     /* this call will always give us the elapsed time for the test, and */
     /* will also store-away the necessaries for cpu utilization */
-    
+
     cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being */
 						/* measured and how */
 						/* long did we really */
 						/* run? */
-    
+
     /* we are finished with the socket, so close it to prevent hitting */
     /* the limit on maximum open files. */
 
@@ -610,7 +610,7 @@
 	 calculated service demand and all those interesting
 	 things. If it wasn't supposed to care, it will return obvious
 	 values. */
-    
+
       recv_response();
       if (!netperf_response.content.serv_errno) {
 	if (debug)
@@ -623,10 +623,10 @@
 		netperf_response.content.serv_errno);
 	perror("");
 	fflush(where);
-	
+
 	exit(1);
       }
-    
+
       /* We now calculate what our thruput was for the test. In the
 	 future, we may want to include a calculation of the thruput
 	 measured by the remote, but it should be the case that for a
@@ -636,7 +636,7 @@
 	 and if it was by bytes, the user may have specified a number
 	 of bytes that wasn't a multiple of the send_size, so we
 	 really didn't send what he asked for ;-) */
-    
+
       bytes_sent	= ntohd(sdp_stream_result->bytes_received);
     }
     else {
@@ -644,7 +644,7 @@
     }
 
     thruput	= calc_thruput(bytes_sent);
-    
+
     if (local_cpu_usage || remote_cpu_usage) {
       /* We must now do a little math for service demand and cpu */
       /* utilization for the system(s) */
@@ -652,7 +652,7 @@
       /* there was no idle counter in the kernel(s). We need to make */
       /* a note of this for the user's benefit...*/
       if (local_cpu_usage) {
-	
+
 	local_cpu_utilization	= calc_cpu_util(0.0);
 	local_service_demand	= calc_service_demand(bytes_sent,
 						      0.0,
@@ -663,9 +663,9 @@
 	local_cpu_utilization	= (float) -1.0;
 	local_service_demand	= (float) -1.0;
       }
-      
+
       if (remote_cpu_usage) {
-	
+
 	remote_cpu_utilization	= sdp_stream_result->cpu_util;
 	remote_service_demand	= calc_service_demand(bytes_sent,
 						      0.0,
@@ -676,7 +676,7 @@
 	remote_cpu_utilization = (float) -1.0;
 	remote_service_demand  = (float) -1.0;
       }
-    }    
+    }
     else {
       /* we were not measuring cpu, for the confidence stuff, we */
       /* should make it -1.0 */
@@ -689,7 +689,7 @@
     /* at this point, we want to calculate the confidence information. */
     /* if debugging is on, calculate_confidence will print-out the */
     /* parameters we pass it */
-    
+
     calculate_confidence(confidence_iteration,
 			 elapsed_time,
 			 thruput,
@@ -697,8 +697,8 @@
 			 remote_cpu_utilization,
 			 local_service_demand,
 			 remote_service_demand);
-    
-    
+
+
     confidence_iteration++;
   }
 
@@ -736,7 +736,7 @@
   if (local_cpu_usage || remote_cpu_usage) {
     local_cpu_method = format_cpu_method(cpu_method);
     remote_cpu_method = format_cpu_method(sdp_stream_result->cpu_method);
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -744,7 +744,7 @@
 		cpu_fmt_0,
 		local_service_demand,
 		local_cpu_method,
-		((print_headers) || 
+		((print_headers) ||
 		 (result_brand == NULL)) ? "" : result_brand);
       }
       else {
@@ -752,7 +752,7 @@
 		cpu_fmt_0,
 		remote_service_demand,
 		remote_cpu_method,
-		((print_headers) || 
+		((print_headers) ||
 		 (result_brand == NULL)) ? "" : result_brand);
       }
       break;
@@ -765,7 +765,7 @@
 		local_cpu_method,
 		remote_cpu_method);
       }
-    
+
       fprintf(where,
 	      cpu_fmt_1,		/* the format string */
 	      rsr_size,		        /* remote recvbuf size */
@@ -777,20 +777,20 @@
 	      remote_cpu_utilization,	/* remote cpu */
 	      local_service_demand,	/* local service demand */
 	      remote_service_demand,	/* remote service demand */
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       break;
     }
   }
   else {
     /* The tester did not wish to measure service demand. */
-    
+
     switch (verbosity) {
     case 0:
       fprintf(where,
 	      tput_fmt_0,
 	      thruput,
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       break;
     case 1:
@@ -805,27 +805,27 @@
 	      send_size,		/* how large were the sends */
 	      elapsed_time, 		/* how long did it take */
 	      thruput,                  /* how fast did it go */
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   if (verbosity > 1) {
     /* The user wanted to know it all, so we will give it to him. */
     /* This information will include as much as we can find about */
     /* SDP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-   
+
     /* this stuff needs to be worked-out in the presence of confidence */
     /* intervals and multiple iterations of the test... raj 11/94 */
- 
+
     fprintf(where,
 	    ksink_fmt,
 	    "Bytes",
@@ -850,7 +850,7 @@
     HIST_report(time_hist);
 #endif /* WANT_HISTOGRAM */
   }
-  
+
 }
 
 
@@ -862,34 +862,34 @@
    output to the standard output. */
 
 
-void 
+void
 send_sdp_maerts(char remote_host[])
 {
-  
+
   char *tput_title = "\
 Recv   Send    Send                          \n\
 Socket Socket  Message  Elapsed              \n\
 Size   Size    Size     Time     Throughput  \n\
 bytes  bytes   bytes    secs.    %s/sec  \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f %s\n";
-  
+
   char *tput_fmt_1 =
     "%6d %6d %6d    %-6.2f   %7.2f   \n %s";
-  
+
   char *cpu_title = "\
 Recv   Send    Send                          Utilization       Service Demand\n\
 Socket Socket  Message  Elapsed              Send     Recv     Send    Recv\n\
 Size   Size    Size     Time     Throughput  local    remote   local   remote\n\
 bytes  bytes   bytes    secs.    %-8.8s/s  %% %c      %% %c      us/KB   us/KB\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f %c %s\n";
 
   char *cpu_fmt_1 =
     "%6d %6d %6d    %-6.2f     %7.2f   %-6.2f   %-6.2f   %-6.3f  %-6.3f %s\n";
-  
+
   char *ksink_fmt = "\n\
 Alignment      Offset         %-8.8s %-8.8s    Recvs   %-8.8s Sends\n\
 Local  Remote  Local  Remote  Xfered   Per                 Per\n\
@@ -901,19 +901,19 @@
 Segment\n\
 Size (bytes)\n\
 %6d\n";
-  
-  
+
+
   float			elapsed_time;
-  
+
   /* what we want is to have a buffer space that is at least one */
   /* recv-size greater than our recv window. this will insure that we */
   /* are never trying to re-use a buffer that may still be in the hands */
   /* of the transport. This buffer will be malloc'd after we have found */
   /* the size of the local senc socket buffer. We will want to deal */
   /* with alignment and offset concerns as well. */
-  
+
   struct ring_elt *recv_ring;
-  
+
   int len;
   unsigned int nummessages = 0;
   SOCKET recv_socket;
@@ -932,21 +932,21 @@
   float	remote_service_demand;
 
   double	thruput;
-  
+
   struct addrinfo *remote_res;
   struct addrinfo *local_res;
-  
+
   struct	sdp_maerts_request_struct	*sdp_maerts_request;
   struct	sdp_maerts_response_struct	*sdp_maerts_response;
   struct	sdp_maerts_results_struct	*sdp_maerts_result;
-  
-  sdp_maerts_request  = 
+
+  sdp_maerts_request  =
     (struct sdp_maerts_request_struct *)netperf_request.content.test_specific_data;
   sdp_maerts_response =
     (struct sdp_maerts_response_struct *)netperf_response.content.test_specific_data;
-  sdp_maerts_result   = 
+  sdp_maerts_result   =
     (struct sdp_maerts_results_struct *)netperf_response.content.test_specific_data;
-  
+
 #ifdef WANT_HISTOGRAM
   if (verbosity > 1) {
     time_hist = HIST_new();
@@ -956,14 +956,14 @@
   /* control socket, and since we want to be able to use different */
   /* protocols and such, we are passed the name of the remote host and */
   /* must turn that into the test specific addressing information. */
-  
+
   complete_addrinfos(&remote_res,
 		     &local_res,
 		     remote_host,
 		     SOCK_STREAM,
 		     IPPROTO_TCP,
 		     0);
-  
+
   if ( print_headers ) {
     print_top_test_header("SDP MAERTS TEST",local_res,remote_res);
   }
@@ -984,22 +984,22 @@
 
     /* initialize a few counters. we have to remember that we might be */
     /* going through the loop more than once. */
-    
+
     nummessages    =	0;
     bytes_sent     =	0.0;
     times_up       = 	0;
-    
+
     /*set up the data socket                        */
     /* fake things out by changing local_res->ai_family to AF_INET_SDP */
     local_res->ai_family = AF_INET_SDP;
     local_res->ai_protocol = 0;
     recv_socket = create_data_socket(local_res);
-    
+
     if (recv_socket == INVALID_SOCKET){
       perror("netperf: send_sdp_maerts: sdp stream data socket");
       exit(1);
     }
-    
+
     if (debug) {
       fprintf(where,"send_sdp_maerts: recv_socket obtained...\n");
     }
@@ -1031,7 +1031,7 @@
       recv_width = (lsr_size/recv_size) + 1;
       if (recv_width == 1) recv_width++;
     }
-    
+
     if (recv_ring == NULL) {
       /* only allocate the recv ring once. this is a networking test, */
       /* not a memory allocation test. this way, we do not need a */
@@ -1049,11 +1049,11 @@
     /* calibrate_local_cpu will return rather quickly as it will have */
     /* nothing to do. If local_cpu_rate is zero, then we will go through */
     /* all the "normal" calibration stuff and return the rate back. */
-    
+
     if (local_cpu_usage) {
       local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
     }
-    
+
     if (!no_control) {
       /* Tell the remote end to do a listen. The server alters the
 	 socket paramters on the other side at this point, hence the
@@ -1091,9 +1091,9 @@
 	fprintf(where,
 		"netperf: send_sdp_maerts: requesting SDP maerts test\n");
       }
-      
+
       send_request();
-      
+
       /* The response from the remote will contain all of the relevant
 	 socket parameters for this test type. We will put them back
 	 into the variables here so they can be displayed if desired.
@@ -1104,9 +1104,9 @@
 	 will grab the counter right after the accept call. This saves
 	 the hassle of extra messages being sent for the SDP
 	 tests.  */
-      
+
       recv_response();
-    
+
       if (!netperf_response.content.serv_errno) {
 	if (debug)
 	  fprintf(where,"remote listen done.\n");
@@ -1116,7 +1116,7 @@
 	remote_cpu_usage=	sdp_maerts_response->measure_cpu;
 	remote_cpu_rate = sdp_maerts_response->cpu_rate;
 	send_size       = sdp_maerts_response->send_size;
-	
+
 	/* we have to make sure that the server port number is in
 	 network order */
       set_port_number(remote_res,
@@ -1131,7 +1131,7 @@
 		netperf_response.content.serv_errno);
 	perror("");
 	fflush(where);
-	
+
 	exit(1);
       }
     }
@@ -1141,7 +1141,7 @@
 #endif
 
     /*Connect up to the remote port on the data socket  */
-    if (connect(recv_socket, 
+    if (connect(recv_socket,
 		remote_res->ai_addr,
 		remote_res->ai_addrlen) == INVALID_SOCKET){
       perror("netperf: send_sdp_maerts: data socket connect failed");
@@ -1153,11 +1153,11 @@
     /* have indicated a problem. I failed to see the value of the */
     /* extra  message after the accept on the remote. If it failed, */
     /* we'll see it here. If it didn't, we might as well start pumping */
-    /* data. */ 
-    
+    /* data. */
+
     /* Set-up the test end conditions. For a maerts test, they can be */
     /* either time or byte-count based. */
-    
+
     if (test_time) {
       /* The user wanted to end the test after a period of time. */
       times_up = 0;
@@ -1180,18 +1180,18 @@
       }
     }
     else {
-      /* The tester wanted to recv a number of bytes. we don't do that 
+      /* The tester wanted to recv a number of bytes. we don't do that
 	 in a SDP_MAERTS test. sorry. raj 2002-06-21 */
       printf("netperf: send_sdp_maerts: test must be timed\n");
       exit(1);
     }
-    
+
     /* The cpu_start routine will grab the current time and possibly */
     /* value of the idle counter for later use in measuring cpu */
     /* utilization and/or service demand and thruput. */
-    
+
     cpu_start(local_cpu_usage);
-    
+
 #ifdef WANT_INTERVALS
     INTERVALS_INIT();
 #endif /* WANT_INTERVALS */
@@ -1218,7 +1218,7 @@
       HIST_timestamp(&time_one);
     }
 #endif /* WANT_HISTOGRAM */
-    
+
     while ((!times_up) && (len=recv(recv_socket,
 				    recv_ring->buffer_ptr,
 				    recv_size,
@@ -1230,7 +1230,7 @@
 	HIST_timestamp(&time_two);
 	HIST_add(time_hist,delta_micro(&time_one,&time_two));
       }
-#endif /* WANT_HISTOGRAM */      
+#endif /* WANT_HISTOGRAM */
 
 #ifdef DIRTY
       access_buffer(recv_ring->buffer_ptr,
@@ -1243,16 +1243,16 @@
       DEMO_STREAM_INTERVAL(len);
 #endif
 
-#ifdef WANT_INTERVALS      
+#ifdef WANT_INTERVALS
       INTERVALS_WAIT();
 #endif /* WANT_INTERVALS */
-      
+
       /* now we want to move our pointer to the next position in the */
       /* data buffer...we may also want to wrap back to the "beginning" */
       /* of the bufferspace, so we will mod the number of messages sent */
       /* by the recv width, and use that to calculate the offset to add */
       /* to the base pointer. */
-      nummessages++;          
+      nummessages++;
       recv_ring = recv_ring->next;
       if (bytes_remaining) {
 	bytes_remaining -= len;
@@ -1267,7 +1267,7 @@
 	HIST_timestamp(&time_one);
       }
 #endif /* WANT_HISTOGRAM */
-    
+
     }
 
     /* an EINTR is to be expected when this is a no_control test */
@@ -1276,13 +1276,13 @@
       printf("len was %d\n",len);
       exit(1);
     }
-    
+
     /* if we get here, it must mean we had a recv return of 0 before
        the watchdog timer expired, or the watchdog timer expired and
        this was a no_control test */
 
     /* The test is over. Flush the buffers to the remote end. We do a
-       graceful release to tell the  remote we have all the data. */  
+       graceful release to tell the  remote we have all the data. */
 
     /* but first, if the verbosity is greater than 1, find-out what */
     /* the SDP maximum segment_size was (if possible) */
@@ -1290,23 +1290,23 @@
       sdp_mss = -1;
       get_sdp_info(recv_socket,&sdp_mss);
     }
-    
+
     if (shutdown(recv_socket,SHUT_WR) == SOCKET_ERROR) {
       perror("netperf: cannot shutdown sdp maerts socket");
       exit(1);
     }
 
     stop_timer();
-    
+
     /* this call will always give us the local elapsed time for the
        test, and will also store-away the necessaries for cpu
-       utilization */ 
-    
+       utilization */
+
     cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being */
 						/* measured and how */
 						/* long did we really */
 						/* run? */
-    
+
     /* we are finished with the socket, so close it to prevent hitting */
     /* the limit on maximum open files. */
 
@@ -1317,7 +1317,7 @@
          calculated service demand and all those interesting
          things. If it wasn't supposed to care, it will return obvious
          values. */
-    
+
       recv_response();
       if (!netperf_response.content.serv_errno) {
 	if (debug)
@@ -1330,10 +1330,10 @@
 		netperf_response.content.serv_errno);
 	perror("");
 	fflush(where);
-	
+
 	exit(1);
       }
-      
+
       /* We now calculate what our thruput was for the test. In the
 	 future, we may want to include a calculation of the thruput
 	 measured by the remote, but it should be the case that for a
@@ -1343,7 +1343,7 @@
 	 and if it was by bytes, the user may have specified a number
 	 of bytes that wasn't a multiple of the recv_size, so we
 	 really didn't recv what he asked for ;-) */
-    
+
       bytes_sent	= ntohd(sdp_maerts_result->bytes_sent);
     }
     else {
@@ -1360,7 +1360,7 @@
       /* there was no idle counter in the kernel(s). We need to make */
       /* a note of this for the user's benefit...*/
       if (local_cpu_usage) {
-	
+
 	local_cpu_utilization	= calc_cpu_util(0.0);
 	local_service_demand	= calc_service_demand(bytes_sent,
 						      0.0,
@@ -1371,9 +1371,9 @@
 	local_cpu_utilization	= (float) -1.0;
 	local_service_demand	= (float) -1.0;
       }
-      
+
       if (remote_cpu_usage) {
-	
+
 	remote_cpu_utilization	= sdp_maerts_result->cpu_util;
 	remote_service_demand	= calc_service_demand(bytes_sent,
 						      0.0,
@@ -1384,7 +1384,7 @@
 	remote_cpu_utilization = (float) -1.0;
 	remote_service_demand  = (float) -1.0;
       }
-    }    
+    }
     else {
       /* we were not measuring cpu, for the confidence stuff, we */
       /* should make it -1.0 */
@@ -1405,8 +1405,8 @@
 			 remote_cpu_utilization,
 			 local_service_demand,
 			 remote_service_demand);
-    
-    
+
+
     confidence_iteration++;
   }
 
@@ -1444,7 +1444,7 @@
   if (local_cpu_usage || remote_cpu_usage) {
     local_cpu_method = format_cpu_method(cpu_method);
     remote_cpu_method = format_cpu_method(sdp_maerts_result->cpu_method);
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -1452,7 +1452,7 @@
 		cpu_fmt_0,
 		local_service_demand,
 		local_cpu_method,
-		((print_headers) || 
+		((print_headers) ||
 		 (result_brand == NULL)) ? "" : result_brand);
       }
       else {
@@ -1460,7 +1460,7 @@
 		cpu_fmt_0,
 		remote_service_demand,
 		remote_cpu_method,
-		((print_headers) || 
+		((print_headers) ||
 		 (result_brand == NULL)) ? "" : result_brand);
       }
       break;
@@ -1473,7 +1473,7 @@
 		local_cpu_method,
 		remote_cpu_method);
       }
-    
+
       fprintf(where,
 	      cpu_fmt_1,		/* the format string */
 	      rsr_size,		        /* remote recvbuf size */
@@ -1485,20 +1485,20 @@
 	      remote_cpu_utilization,	/* remote cpu */
 	      local_service_demand,	/* local service demand */
 	      remote_service_demand,	/* remote service demand */
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       break;
     }
   }
   else {
     /* The tester did not wish to measure service demand. */
-    
+
     switch (verbosity) {
     case 0:
       fprintf(where,
 	      tput_fmt_0,
 	      thruput,
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       break;
     case 1:
@@ -1513,27 +1513,27 @@
 	      send_size,		/* how large were the recvs */
 	      elapsed_time, 		/* how long did it take */
 	      thruput,                  /* how fast did it go */
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   if (verbosity > 1) {
     /* The user wanted to know it all, so we will give it to him. */
     /* This information will include as much as we can find about */
     /* SDP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-   
+
     /* this stuff needs to be worked-out in the presence of confidence */
     /* intervals and multiple iterations of the test... raj 11/94 */
- 
+
     fprintf(where,
 	    ksink_fmt,
 	    "Bytes",
@@ -1558,7 +1558,7 @@
     HIST_report(time_hist);
 #endif /* WANT_HISTOGRAM */
   }
-  
+
 }
 /* This is the server-side routine for the sdp stream test. It is */
 /* implemented as one routine. I could break things-out somewhat, but */
@@ -1567,7 +1567,7 @@
 void
 recv_sdp_stream()
 {
-  
+
   struct sockaddr_in myaddr_in, peeraddr_in;
   SOCKET s_listen,s_data;
   netperf_socklen_t addrlen;
@@ -1575,7 +1575,7 @@
   unsigned int	receive_calls;
   float	elapsed_time;
   double   bytes_received;
-  
+
   struct ring_elt *recv_ring;
 
   struct addrinfo *local_res;
@@ -1590,25 +1590,25 @@
   struct	sdp_stream_request_struct	*sdp_stream_request;
   struct	sdp_stream_response_struct	*sdp_stream_response;
   struct	sdp_stream_results_struct	*sdp_stream_results;
-  
+
 #ifdef DO_SELECT
   FD_ZERO(&readfds);
   timeout.tv_sec = 1;
   timeout.tv_usec = 0;
 #endif /* DO_SELECT */
 
-  sdp_stream_request	= 
+  sdp_stream_request	=
     (struct sdp_stream_request_struct *)netperf_request.content.test_specific_data;
-  sdp_stream_response	= 
+  sdp_stream_response	=
     (struct sdp_stream_response_struct *)netperf_response.content.test_specific_data;
-  sdp_stream_results	= 
+  sdp_stream_results	=
     (struct sdp_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_sdp_stream: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -1616,27 +1616,27 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_stream: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = SDP_STREAM_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_stream: the response type is set...\n");
     fflush(where);
   }
-  
+
   /* We now alter the message_ptr variable to be at the desired */
   /* alignment with the desired offset. */
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_stream: requested alignment of %d\n",
 	    sdp_stream_request->recv_alignment);
@@ -1670,20 +1670,20 @@
   local_res->ai_family = AF_INET_SDP;
   local_res->ai_protocol = 0;
   s_listen = create_data_socket(local_res);
-  
+
   if (s_listen == INVALID_SOCKET) {
     netperf_response.content.serv_errno = errno;
     send_response();
     exit(1);
   }
-  
+
 #ifdef WIN32
   /* The test timer can fire during operations on the listening socket,
      so to make the start_timer below work we have to move
      it to close s_listen while we are blocked on accept. */
   win_kludge_socket2 = s_listen;
 #endif
-  
+
   /* what sort of sizes did we end-up with? */
   if (sdp_stream_request->receive_size == 0) {
     if (lsr_size > 0) {
@@ -1696,7 +1696,7 @@
   else {
     recv_size = sdp_stream_request->receive_size;
   }
-  
+
   /* we want to set-up our recv_ring in a manner analagous to what we */
   /* do on the sending side. this is more for the sake of symmetry */
   /* than for the needs of say copy avoidance, but it might also be */
@@ -1718,52 +1718,52 @@
     fprintf(where,"recv_sdp_stream: receive alignment and offset set...\n");
     fflush(where);
   }
-  
+
   /* Now, let's set-up the socket to listen for connections */
   if (listen(s_listen, 5) == SOCKET_ERROR) {
     netperf_response.content.serv_errno = errno;
     close(s_listen);
     send_response();
-    
+
     exit(1);
   }
-  
-  
+
+
   /* now get the port number assigned by the system  */
   addrlen = sizeof(myaddr_in);
-  if (getsockname(s_listen, 
+  if (getsockname(s_listen,
 		  (struct sockaddr *)&myaddr_in,
 		  &addrlen) == SOCKET_ERROR){
     netperf_response.content.serv_errno = errno;
     close(s_listen);
     send_response();
-    
+
     exit(1);
   }
-  
+
   /* Now myaddr_in contains the port and the internet address this is */
   /* returned to the sender also implicitly telling the sender that the */
   /* socket buffer sizing has been done. */
-  
+
   sdp_stream_response->data_port_number = (int) ntohs(myaddr_in.sin_port);
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a -1 to */
   /* the initiator. */
-  
+
   sdp_stream_response->cpu_rate = (float)0.0; 	/* assume no cpu */
   if (sdp_stream_request->measure_cpu) {
     sdp_stream_response->measure_cpu = 1;
-    sdp_stream_response->cpu_rate = 
+    sdp_stream_response->cpu_rate =
       calibrate_local_cpu(sdp_stream_request->cpu_rate);
   }
   else {
     sdp_stream_response->measure_cpu = 0;
   }
-  
+
   /* before we send the response back to the initiator, pull some of */
   /* the socket parms from the globals */
   sdp_stream_response->send_buf_size = lss_size;
@@ -1774,9 +1774,9 @@
   sdp_stream_response->receive_size = recv_size;
 
   send_response();
-  
+
   addrlen = sizeof(peeraddr_in);
-  
+
   if ((s_data=accept(s_listen,
 		     (struct sockaddr *)&peeraddr_in,
 		     &addrlen)) == INVALID_SOCKET) {
@@ -1793,15 +1793,15 @@
   kludge_socket_options(s_data);
 
 #endif /* KLUDGE_SOCKET_OPTIONS */
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(sdp_stream_request->measure_cpu);
-  
+
   /* The loop will exit when the sender does a shutdown, which will */
   /* return a length of zero   */
-  
+
   /* there used to be an #ifdef DIRTY call to access_buffer() here,
      but we have switched from accessing the buffer before the recv()
      call to accessing the buffer after the recv() call.  The
@@ -1843,7 +1843,7 @@
 #endif /* DO_SELECT */
 
   }
-  
+
   /* perform a shutdown to signal the sender that */
   /* we have received all the data sent. raj 4/93 */
 
@@ -1852,11 +1852,11 @@
       send_response();
       exit(1);
     }
-  
+
   cpu_stop(sdp_stream_request->measure_cpu,&elapsed_time);
-  
+
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_sdp_stream: got %g bytes\n",
@@ -1866,18 +1866,18 @@
 	    receive_calls);
     fflush(where);
   }
-  
+
   sdp_stream_results->bytes_received	= htond(bytes_received);
   sdp_stream_results->elapsed_time	= elapsed_time;
   sdp_stream_results->recv_calls	= receive_calls;
-  
+
   sdp_stream_results->cpu_method = cpu_method;
   sdp_stream_results->num_cpus   = lib_num_loc_cpus;
-  
+
   if (sdp_stream_request->measure_cpu) {
     sdp_stream_results->cpu_util	= calc_cpu_util(0.0);
   };
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_sdp_stream: test complete, sending results.\n");
@@ -1901,12 +1901,12 @@
 
 /* This is the server-side routine for the sdp maerts test. It is
    implemented as one routine. I could break things-out somewhat, but
-   didn't feel it was necessary. */ 
+   didn't feel it was necessary. */
 
 void
 recv_sdp_maerts()
 {
-  
+
   struct sockaddr_in myaddr_in, peeraddr_in;
   struct addrinfo *local_res;
   char  local_name[BUFSIZ];
@@ -1918,25 +1918,25 @@
   unsigned int	send_calls;
   float	elapsed_time;
   double   bytes_sent = 0.0 ;
-  
+
   struct ring_elt *send_ring;
 
   struct	sdp_maerts_request_struct	*sdp_maerts_request;
   struct	sdp_maerts_response_struct	*sdp_maerts_response;
   struct	sdp_maerts_results_struct	*sdp_maerts_results;
-  
-  sdp_maerts_request	= 
+
+  sdp_maerts_request	=
     (struct sdp_maerts_request_struct *)netperf_request.content.test_specific_data;
-  sdp_maerts_response	= 
+  sdp_maerts_response	=
     (struct sdp_maerts_response_struct *)netperf_response.content.test_specific_data;
-  sdp_maerts_results	= 
+  sdp_maerts_results	=
     (struct sdp_maerts_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_sdp_maerts: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired
      parameters and then let the initiator know that all is ready. If
      socket size defaults are to be used, then the initiator will have
@@ -1944,27 +1944,27 @@
      send-back what they are. If that information cannot be
      determined, then we send-back -1's for the sizes. If things go
      wrong for any reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It
      would be best if the error that the remote reports to the user is
      the actual error we encountered, rather than some bogus
      unexpected response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_maerts: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = SDP_MAERTS_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_maerts: the response type is set...\n");
     fflush(where);
   }
-  
+
   /* We now alter the message_ptr variable to be at the desired */
   /* alignment with the desired offset. */
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_maerts: requested alignment of %d\n",
 	    sdp_maerts_request->send_alignment);
@@ -1972,12 +1972,12 @@
   }
 
   /* Grab a socket to listen on, and then listen on it. */
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_maerts: grabbing a socket...\n");
     fflush(where);
   }
-  
+
   /* create_data_socket expects to find some things in the global */
   /* variables, so set the globals based on the values in the request. */
   /* once the socket has been created, we will set the response values */
@@ -2005,13 +2005,13 @@
   local_res->ai_family = AF_INET_SDP;
   local_res->ai_protocol = 0;
   s_listen = create_data_socket(local_res);
-  
+
   if (s_listen == INVALID_SOCKET) {
     netperf_response.content.serv_errno = errno;
     send_response();
     exit(1);
   }
-  
+
 #ifdef WIN32
   /* The test timer can fire during operations on the listening socket,
      so to make the start_timer below work we have to move
@@ -2019,7 +2019,7 @@
   win_kludge_socket2 = s_listen;
 #endif
 
-  
+
   /* what sort of sizes did we end-up with? */
   if (sdp_maerts_request->send_size == 0) {
     if (lss_size > 0) {
@@ -2032,7 +2032,7 @@
   else {
     send_size = sdp_maerts_request->send_size;
   }
-  
+
   /* we want to set-up our recv_ring in a manner analagous to what we */
   /* do on the recving side. this is more for the sake of symmetry */
   /* than for the needs of say copy avoidance, but it might also be */
@@ -2054,52 +2054,52 @@
     fprintf(where,"recv_sdp_maerts: receive alignment and offset set...\n");
     fflush(where);
   }
-  
+
   /* Now, let's set-up the socket to listen for connections */
   if (listen(s_listen, 5) == SOCKET_ERROR) {
     netperf_response.content.serv_errno = errno;
     close(s_listen);
     send_response();
-    
+
     exit(1);
   }
-  
-  
+
+
   /* now get the port number assigned by the system  */
   addrlen = sizeof(myaddr_in);
-  if (getsockname(s_listen, 
+  if (getsockname(s_listen,
 		  (struct sockaddr *)&myaddr_in,
 		  &addrlen) == SOCKET_ERROR){
     netperf_response.content.serv_errno = errno;
     close(s_listen);
     send_response();
-    
+
     exit(1);
   }
-  
+
   /* Now myaddr_in contains the port and the internet address this is */
   /* returned to the sender also implicitly telling the sender that the */
   /* socket buffer sizing has been done. */
-  
+
   sdp_maerts_response->data_port_number = (int) ntohs(myaddr_in.sin_port);
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a -1 to */
   /* the initiator. */
-  
+
   sdp_maerts_response->cpu_rate = (float)0.0; 	/* assume no cpu */
   if (sdp_maerts_request->measure_cpu) {
     sdp_maerts_response->measure_cpu = 1;
-    sdp_maerts_response->cpu_rate = 
+    sdp_maerts_response->cpu_rate =
       calibrate_local_cpu(sdp_maerts_request->cpu_rate);
   }
   else {
     sdp_maerts_response->measure_cpu = 0;
   }
-  
+
   /* before we send the response back to the initiator, pull some of */
   /* the socket parms from the globals */
   sdp_maerts_response->send_buf_size = lss_size;
@@ -2110,7 +2110,7 @@
   sdp_maerts_response->send_size = send_size;
 
   send_response();
-  
+
   addrlen = sizeof(peeraddr_in);
 
   /* we will start the timer before the accept() to be somewhat
@@ -2121,10 +2121,10 @@
 
   /* Now it's time to start receiving data on the connection. We will
      first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(sdp_maerts_request->measure_cpu);
-  
 
+
   if ((s_data=accept(s_listen,
 		     (struct sockaddr *)&peeraddr_in,
 		     &addrlen)) == INVALID_SOCKET) {
@@ -2134,7 +2134,7 @@
   }
 
 #ifdef KLUDGE_SOCKET_OPTIONS
-  
+
   /* this is for those systems which *INCORRECTLY* fail to pass
      attributes across an accept() call. Including this goes against
      my better judgement :( raj 11/95 */
@@ -2142,10 +2142,10 @@
   kludge_socket_options(s_data);
 
 #endif /* KLUDGE_SOCKET_OPTIONS */
-  
+
   /* The loop will exit when the sender does a shutdown, which will */
   /* return a length of zero   */
-  
+
   bytes_sent = 0.0;
   send_calls  = 0;
 
@@ -2187,7 +2187,7 @@
     send_ring = send_ring->next;
 
   }
-  
+
   /* perform a shutdown to signal the sender that */
   /* we have received all the data sent. raj 4/93 */
 
@@ -2201,14 +2201,14 @@
      brought all the data up into the application. it will do a
      shutdown to cause a FIN to be sent our way. We will assume that
      any exit from the recv() call is good... raj 4/93 */
-    
+
   recv(s_data, send_ring->buffer_ptr, send_size, 0);
-    
-  
+
+
   cpu_stop(sdp_maerts_request->measure_cpu,&elapsed_time);
-  
+
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_sdp_maerts: got %g bytes\n",
@@ -2218,15 +2218,15 @@
 	    send_calls);
     fflush(where);
   }
-  
+
   sdp_maerts_results->bytes_sent	= htond(bytes_sent);
   sdp_maerts_results->elapsed_time	= elapsed_time;
   sdp_maerts_results->send_calls	= send_calls;
-  
+
   if (sdp_maerts_request->measure_cpu) {
     sdp_maerts_results->cpu_util	= calc_cpu_util(0.0);
   };
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_sdp_maerts: test complete, sending results.\n");
@@ -2239,7 +2239,7 @@
 	    len);
     fflush(where);
   }
-  
+
   sdp_maerts_results->cpu_method = cpu_method;
   sdp_maerts_results->num_cpus   = lib_num_loc_cpus;
   send_response();
@@ -2257,46 +2257,46 @@
 void
 send_sdp_rr(char remote_host[])
 {
-  
+
   char *tput_title = "\
 Local /Remote\n\
 Socket Size   Request  Resp.   Elapsed  Trans.\n\
 Send   Recv   Size     Size    Time     Rate         \n\
 bytes  Bytes  bytes    bytes   secs.    per sec   \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f %s\n";
-  
+
   char *tput_fmt_1_line_1 = "\
 %-6d %-6d %-6d   %-6d  %-6.2f   %7.2f   %s\n";
   char *tput_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *cpu_title = "\
 Local /Remote\n\
 Socket Size   Request Resp.  Elapsed Trans.   CPU    CPU    S.dem   S.dem\n\
 Send   Recv   Size    Size   Time    Rate     local  remote local   remote\n\
 bytes  bytes  bytes   bytes  secs.   per sec  %% %c    %% %c    us/Tr   us/Tr\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f %c %s\n";
-  
+
   char *cpu_fmt_1_line_1 = "\
 %-6d %-6d %-6d  %-6d %-6.2f  %-6.2f  %-6.2f %-6.2f %-6.3f  %-6.3f %s\n";
-  
+
   char *cpu_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *ksink_fmt = "\
 Alignment      Offset\n\
 Local  Remote  Local  Remote\n\
 Send   Recv    Send   Recv\n\
 %5d  %5d   %5d  %5d\n";
-  
-  
+
+
   int			timed_out = 0;
   float			elapsed_time;
-  
+
   int	len;
   char	*temp_message_ptr;
   int	nummessages;
@@ -2306,16 +2306,16 @@
 
   struct ring_elt *send_ring;
   struct ring_elt *recv_ring;
-  
+
   int	rsp_bytes_left;
   int	rsp_bytes_recvd;
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
   double	thruput;
-  
+
   struct addrinfo *local_res;
   struct addrinfo *remote_res;
 
@@ -2348,13 +2348,13 @@
 					       send */
 #endif
 
-  sdp_rr_request = 
+  sdp_rr_request =
     (struct sdp_rr_request_struct *)netperf_request.content.test_specific_data;
   sdp_rr_response=
     (struct sdp_rr_response_struct *)netperf_response.content.test_specific_data;
   sdp_rr_result	=
     (struct sdp_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
 #ifdef WANT_HISTOGRAM
   if (verbosity > 1) {
     time_hist = HIST_new();
@@ -2376,9 +2376,9 @@
   if ( print_headers ) {
     print_top_test_header("SDP REQUEST/RESPONSE TEST",local_res,remote_res);
   }
-  
+
   /* initialize a few counters */
-  
+
   send_ring = NULL;
   recv_ring = NULL;
   confidence_iteration = 1;
@@ -2418,7 +2418,7 @@
 
     if (send_width == 0) send_width = 1;
     if (recv_width == 0) recv_width = 1;
-  
+
     if (send_ring == NULL) {
       send_ring = allocate_buffer_ring(send_width,
 				       req_size,
@@ -2432,33 +2432,33 @@
 				       local_recv_align,
 				       local_recv_offset);
     }
-    
+
     /*set up the data socket                        */
     /* fake things out by changing local_res->ai_family to AF_INET_SDP */
     local_res->ai_family = AF_INET_SDP;
     local_res->ai_protocol = 0;
     send_socket = create_data_socket(local_res);
-  
+
     if (send_socket == INVALID_SOCKET){
       perror("netperf: send_sdp_rr: sdp stream data socket");
       exit(1);
     }
-    
+
     if (debug) {
       fprintf(where,"send_sdp_rr: send_socket obtained...\n");
     }
-  
+
     /* If the user has requested cpu utilization measurements, we must */
     /* calibrate the cpu(s). We will perform this task within the tests */
     /* themselves. If the user has specified the cpu rate, then */
     /* calibrate_local_cpu will return rather quickly as it will have */
     /* nothing to do. If local_cpu_rate is zero, then we will go through */
     /* all the "normal" calibration stuff and return the rate back.*/
-    
+
     if (local_cpu_usage) {
       local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
     }
-    
+
     if (!no_control) {
       /* Tell the remote end to do a listen. The server alters the
 	 socket paramters on the other side at this point, hence the
@@ -2468,7 +2468,7 @@
 	 that no changes beyond the system's default should be
 	 used. Alignment is the exception, it will default to 8, which
 	 will be no alignment alterations. */
-    
+
       netperf_request.content.request_type	=	DO_SDP_RR;
       sdp_rr_request->recv_buf_size	=	rsr_size_req;
       sdp_rr_request->send_buf_size	=	rss_size_req;
@@ -2491,13 +2491,13 @@
       }
       sdp_rr_request->port              =      atoi(remote_data_port);
       sdp_rr_request->ipfamily = af_to_nf(remote_res->ai_family);
-      
+
       if (debug > 1) {
 	fprintf(where,"netperf: send_sdp_rr: requesting SDP rr test\n");
       }
-      
+
       send_request();
-      
+
       /* The response from the remote will contain all of the relevant
 	 socket parameters for this test type. We will put them back
 	 into the variables here so they can be displayed if desired.
@@ -2508,9 +2508,9 @@
 	 will grab the counter right after the accept call. This saves
 	 the hassle of extra messages being sent for the SDP
 	 tests.  */
-  
+
       recv_response();
-  
+
       if (!netperf_response.content.serv_errno) {
 	if (debug)
 	  fprintf(where,"remote listen done.\n");
@@ -2529,7 +2529,7 @@
 		netperf_response.content.serv_errno);
 	perror("");
 	fflush(where);
-	
+
 	exit(1);
       }
     }
@@ -2539,23 +2539,23 @@
 #endif
 
     /*Connect up to the remote port on the data socket  */
-    if (connect(send_socket, 
+    if (connect(send_socket,
 		remote_res->ai_addr,
 		remote_res->ai_addrlen) == INVALID_SOCKET){
       perror("netperf: data socket connect failed");
-      
+
       exit(1);
     }
-    
+
     /* Data Socket set-up is finished. If there were problems, either the */
     /* connect would have failed, or the previous response would have */
     /* indicated a problem. I failed to see the value of the extra */
     /* message after the accept on the remote. If it failed, we'll see it */
     /* here. If it didn't, we might as well start pumping data. */
-    
+
     /* Set-up the test end conditions. For a request/response test, they */
     /* can be either time or transaction based. */
-    
+
     if (test_time) {
       /* The user wanted to end the test after a period of time. */
       times_up = 0;
@@ -2567,17 +2567,17 @@
       trans_remaining = test_bytes;
       times_up = 1;
     }
-    
+
     /* The cpu_start routine will grab the current time and possibly */
     /* value of the idle counter for later use in measuring cpu */
     /* utilization and/or service demand and thruput. */
-    
+
     cpu_start(local_cpu_usage);
 
 #ifdef WANT_INTERVALS
     INTERVALS_INIT();
 #endif /* WANT_INTERVALS */
-    
+
     /* We use an "OR" to control test execution. When the test is */
     /* controlled by time, the byte count check will always return false. */
     /* When the test is controlled by byte count, the time test will */
@@ -2630,7 +2630,7 @@
       }
 
 #endif /* WANT_FIRST_BURST */
-      
+
 #ifdef WANT_HISTOGRAM
       if (verbosity > 1) {
 	/* timestamp just before our call to send, and then again just
@@ -2641,7 +2641,7 @@
 	HIST_timestamp(&time_one);
       }
 #endif /* WANT_HISTOGRAM */
-      
+
       if ((len = send(send_socket,
 		      send_ring->buffer_ptr,
 		      req_size,
@@ -2679,9 +2679,9 @@
 	}
 	rsp_bytes_left -= rsp_bytes_recvd;
 	temp_message_ptr  += rsp_bytes_recvd;
-      }	
+      }
       recv_ring = recv_ring->next;
-      
+
 #ifdef WANT_FIRST_BURST
       /* so, since we've gotten a response back, update the
 	 bookkeeping accordingly.  there is one less request
@@ -2703,7 +2703,7 @@
 	/* another call to break. */
 	break;
       }
-      
+
 #ifdef WANT_HISTOGRAM
       if (verbosity > 1) {
 	HIST_timestamp(&time_two);
@@ -2715,15 +2715,15 @@
       DEMO_RR_INTERVAL(1);
 #endif
 
-#ifdef WANT_INTERVALS      
+#ifdef WANT_INTERVALS
       INTERVALS_WAIT();
 #endif /* WANT_INTERVALS */
-      
-      nummessages++;          
+
+      nummessages++;
       if (trans_remaining) {
 	trans_remaining--;
       }
-      
+
       if (debug > 3) {
 	if ((nummessages % 100) == 0) {
 	  fprintf(where,
@@ -2740,19 +2740,19 @@
        when they were being controlled by time. So, I have replaced
        this shutdown call with a call to close that can be found later
        in the procedure. */
-    
+
     /* this call will always give us the elapsed time for the test,
        and will also store-away the necessaries for cpu utilization */
-    
+
     cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being */
 						/* measured? how long */
 						/* did we really run? */
-    
+
     if (!no_control) {
       /* Get the statistics from the remote end. The remote will have
 	 calculated CPU utilization. If it wasn't supposed to care, it
-	 will return obvious values. */ 
-    
+	 will return obvious values. */
+
       recv_response();
       if (!netperf_response.content.serv_errno) {
 	if (debug)
@@ -2767,12 +2767,12 @@
 	exit(1);
       }
     }
-    
+
     /* We now calculate what our throughput was for the test. */
-  
+
     bytes_xferd	= (req_size * nummessages) + (rsp_size * nummessages);
     thruput	= nummessages/elapsed_time;
-  
+
     if (local_cpu_usage || remote_cpu_usage) {
       /* We must now do a little math for service demand and cpu
        utilization for the system(s) Of course, some of the
@@ -2793,7 +2793,7 @@
 	local_cpu_utilization	= (float) -1.0;
 	local_service_demand	= (float) -1.0;
       }
-      
+
       if (remote_cpu_usage) {
 	remote_cpu_utilization = sdp_rr_result->cpu_util;
 	/* since calc_service demand is doing ms/Kunit we will
@@ -2808,7 +2808,7 @@
 	remote_cpu_utilization = (float) -1.0;
 	remote_service_demand  = (float) -1.0;
       }
-      
+
     }
     else {
       /* we were not measuring cpu, for the confidence stuff, we */
@@ -2822,7 +2822,7 @@
     /* at this point, we want to calculate the confidence information.
        if debugging is on, calculate_confidence will print-out the
        parameters we pass it */
-    
+
     calculate_confidence(confidence_iteration,
 			 elapsed_time,
 			 thruput,
@@ -2830,8 +2830,8 @@
 			 remote_cpu_utilization,
 			 local_service_demand,
 			 remote_service_demand);
-    
-    
+
+
     confidence_iteration++;
 
     /* we are now done with the socket, so close it */
@@ -2865,7 +2865,7 @@
   if (local_cpu_usage || remote_cpu_usage) {
     local_cpu_method = format_cpu_method(cpu_method);
     remote_cpu_method = format_cpu_method(sdp_rr_result->cpu_method);
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -2873,7 +2873,7 @@
 		cpu_fmt_0,
 		local_service_demand,
 		local_cpu_method,
-		((print_headers) || 
+		((print_headers) ||
 		 (result_brand == NULL)) ? "" : result_brand);
       }
       else {
@@ -2881,7 +2881,7 @@
 		cpu_fmt_0,
 		remote_service_demand,
 		remote_cpu_method,
-		((print_headers) || 
+		((print_headers) ||
 		 (result_brand == NULL)) ? "" : result_brand);
       }
       break;
@@ -2906,7 +2906,7 @@
 	      remote_cpu_utilization,	/* remote cpu */
 	      local_service_demand,	/* local service demand */
 	      remote_service_demand,	/* remote service demand */
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       fprintf(where,
 	      cpu_fmt_1_line_2,
@@ -2917,13 +2917,13 @@
   }
   else {
     /* The tester did not wish to measure service demand. */
-    
+
     switch (verbosity) {
     case 0:
       fprintf(where,
 	      tput_fmt_0,
 	      thruput,
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       break;
     case 1:
@@ -2940,23 +2940,23 @@
 	      rsp_size,		/* how large were the responses */
 	      elapsed_time, 		/* how long did it take */
 	      thruput,
-	      ((print_headers) || 
+	      ((print_headers) ||
 	       (result_brand == NULL)) ? "" : result_brand);
       fprintf(where,
 	      tput_fmt_1_line_2,
 	      rss_size, 		/* remote recvbuf size */
 	      rsr_size);
-      
+
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   /* how to handle the verbose information in the presence of */
   /* confidence intervals is yet to be determined... raj 11/94 */
   if (verbosity > 1) {
@@ -2964,7 +2964,7 @@
     /* This information will include as much as we can find about */
     /* SDP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-    
+
     fprintf(where,
 	    ksink_fmt,
 	    local_send_align,
@@ -2979,14 +2979,14 @@
 #endif /* WANT_HISTOGRAM */
 
   }
-  
+
 }
  /* this routine implements the receive (netserver) side of a SDP_RR */
  /* test */
 void
 recv_sdp_rr()
 {
-  
+
   struct ring_elt *send_ring;
   struct ring_elt *recv_ring;
 
@@ -3007,23 +3007,23 @@
   int	timed_out = 0;
   int   sock_closed = 0;
   float	elapsed_time;
-  
+
   struct	sdp_rr_request_struct	*sdp_rr_request;
   struct	sdp_rr_response_struct	*sdp_rr_response;
   struct	sdp_rr_results_struct	*sdp_rr_results;
-  
-  sdp_rr_request = 
+
+  sdp_rr_request =
     (struct sdp_rr_request_struct *)netperf_request.content.test_specific_data;
   sdp_rr_response =
     (struct sdp_rr_response_struct *)netperf_response.content.test_specific_data;
   sdp_rr_results =
     (struct sdp_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_sdp_rr: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -3031,24 +3031,24 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_rr: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = SDP_RR_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_rr: the response type is set...\n");
     fflush(where);
   }
-  
+
   /* allocate the recv and send rings with the requested alignments */
   /* and offsets. raj 7/94 */
   if (debug) {
@@ -3075,9 +3075,9 @@
 				   sdp_rr_request->recv_alignment,
 				   sdp_rr_request->recv_offset);
 
-  
+
   /* Grab a socket to listen on, and then listen on it. */
-  
+
   if (debug) {
     fprintf(where,"recv_sdp_rr: grabbing a socket...\n");
     fflush(where);
@@ -3110,15 +3110,15 @@
   local_res->ai_family = AF_INET_SDP;
   local_res->ai_protocol = 0;
   s_listen = create_data_socket(local_res);
-  
+
   if (s_listen == INVALID_SOCKET) {
     netperf_response.content.serv_errno = errno;
     send_response();
-    
+
     exit(1);
   }
-  
-  
+
+
 #ifdef WIN32
   /* The test timer can fire during operations on the listening socket,
      so to make the start_timer below work we have to move
@@ -3126,42 +3126,42 @@
   win_kludge_socket2 = s_listen;
 #endif
 
-  
+
   /* Now, let's set-up the socket to listen for connections */
   if (listen(s_listen, 5) == SOCKET_ERROR) {
     netperf_response.content.serv_errno = errno;
     close(s_listen);
     send_response();
-    
+
     exit(1);
   }
-  
-  
+
+
   /* now get the port number assigned by the system  */
   addrlen = sizeof(myaddr_in);
   if (getsockname(s_listen,
-		  (struct sockaddr *)&myaddr_in, 
+		  (struct sockaddr *)&myaddr_in,
 		  &addrlen) == SOCKET_ERROR) {
     netperf_response.content.serv_errno = errno;
     close(s_listen);
     send_response();
-    
+
     exit(1);
   }
-  
+
   /* Now myaddr_in contains the port and the internet address this is */
   /* returned to the sender also implicitly telling the sender that the */
   /* socket buffer sizing has been done. */
-  
+
   sdp_rr_response->data_port_number = (int) ntohs(myaddr_in.sin_port);
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a 0.0 to */
   /* the initiator. */
-  
+
   sdp_rr_response->cpu_rate = (float)0.0; 	/* assume no cpu */
   sdp_rr_response->measure_cpu = 0;
 
@@ -3169,8 +3169,8 @@
     sdp_rr_response->measure_cpu = 1;
     sdp_rr_response->cpu_rate = calibrate_local_cpu(sdp_rr_request->cpu_rate);
   }
-  
-  
+
+
   /* before we send the response back to the initiator, pull some of */
   /* the socket parms from the globals */
   sdp_rr_response->send_buf_size = lss_size;
@@ -3180,18 +3180,18 @@
   sdp_rr_response->so_sndavoid = loc_sndavoid;
   sdp_rr_response->test_length = sdp_rr_request->test_length;
   send_response();
-  
+
   addrlen = sizeof(peeraddr_in);
-  
+
   if ((s_data = accept(s_listen,
 		       (struct sockaddr *)&peeraddr_in,
 		       &addrlen)) == INVALID_SOCKET) {
     /* Let's just punt. The remote will be given some information */
     close(s_listen);
-    
+
     exit(1);
   }
-  
+
 #ifdef KLUDGE_SOCKET_OPTIONS
   /* this is for those systems which *INCORRECTLY* fail to pass */
   /* attributes across an accept() call. Including this goes against */
@@ -3215,15 +3215,15 @@
     fprintf(where,"recv_sdp_rr: accept completes on the data connection.\n");
     fflush(where);
   }
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(sdp_rr_request->measure_cpu);
-  
+
   /* The loop will exit when we hit the end of the test time, or when */
   /* we have exchanged the requested number of transactions. */
-  
+
   if (sdp_rr_request->test_length > 0) {
     times_up = 0;
     trans_remaining = 0;
@@ -3235,7 +3235,7 @@
   }
 
   trans_received = 0;
-  
+
   while ((!times_up) || (trans_remaining > 0)) {
     temp_message_ptr = recv_ring->buffer_ptr;
     request_bytes_remaining	= sdp_rr_request->request_size;
@@ -3276,10 +3276,10 @@
       if (debug) {
 	fprintf(where,"yo5\n");
 	fflush(where);
-      }						
+      }
       break;
     }
-    
+
     /* Now, send the response to the remote */
     if((bytes_sent=send(s_data,
 			send_ring->buffer_ptr,
@@ -3289,14 +3289,14 @@
 	/* the test timer has popped */
 	timed_out = 1;
 	fprintf(where,"yo6\n");
-	fflush(where);						
+	fflush(where);
 	break;
       }
       netperf_response.content.serv_errno = 992;
       send_response();
       exit(1);
     }
-    
+
     send_ring = send_ring->next;
 
     trans_received++;
@@ -3304,13 +3304,13 @@
       trans_remaining--;
     }
   }
-  
-  
+
+
   /* The loop now exits due to timeout or transaction count being */
   /* reached */
-  
+
   cpu_stop(sdp_rr_request->measure_cpu,&elapsed_time);
-  
+
   stop_timer();
 
   if (timed_out) {
@@ -3321,16 +3321,16 @@
   }
 
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_sdp_rr: got %d transactions\n",
 	    trans_received);
     fflush(where);
   }
-  
-  sdp_rr_results->bytes_received = (trans_received * 
-				    (sdp_rr_request->request_size + 
+
+  sdp_rr_results->bytes_received = (trans_received *
+				    (sdp_rr_request->request_size +
 				     sdp_rr_request->response_size));
   sdp_rr_results->trans_received = trans_received;
   sdp_rr_results->elapsed_time   = elapsed_time;
@@ -3339,19 +3339,19 @@
   if (sdp_rr_request->measure_cpu) {
     sdp_rr_results->cpu_util	= calc_cpu_util(elapsed_time);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_sdp_rr: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   /* we are now done with the sockets */
   close(s_data);
   close(s_listen);
 
   send_response();
-  
+
 }
 
 
@@ -3374,10 +3374,10 @@
 #define SOCKETS_ARGS "b:DhH:I:L:m:M:P:r:s:S:V46"
 
   extern char	*optarg;	  /* pointer to option string	*/
-  
+
   int		c;
-  
-  char	
+
+  char
     arg1[BUFSIZ],  /* argument holders		*/
     arg2[BUFSIZ];
 
@@ -3389,16 +3389,16 @@
 
   strncpy(local_data_port,"0",sizeof(local_data_port));
   strncpy(remote_data_port,"0",sizeof(remote_data_port));
-  
+
   /* Go through all the command line arguments and break them */
   /* out. For those options that take two parms, specifying only */
   /* the first will set both to that value. Specifying only the */
   /* second will leave the first untouched. To change only the */
   /* first, use the form "first," (see the routine break_args.. */
-  
+
   while ((c= getopt(argc, argv, SOCKETS_ARGS)) != EOF) {
     switch (c) {
-    case '?':	
+    case '?':
     case '4':
       remote_data_family = AF_INET;
       local_data_family = AF_INET;
@@ -3433,7 +3433,7 @@
       break_args_explicit(optarg,arg1,arg2);
       if (arg1[0]) {
 	/* make sure we leave room for the NULL termination boys and
-	   girls. raj 2005-02-82 */ 
+	   girls. raj 2005-02-82 */
 	remote_data_address = malloc(strlen(arg1)+1);
 	strncpy(remote_data_address,arg1,strlen(arg1));
       }
@@ -3444,7 +3444,7 @@
       break_args_explicit(optarg,arg1,arg2);
       if (arg1[0]) {
 	/* make sure we leave room for the NULL termination boys and
-	   girls. raj 2005-02-82 */ 
+	   girls. raj 2005-02-82 */
 	local_data_address = malloc(strlen(arg1)+1);
 	strncpy(local_data_address,arg1,strlen(arg1));
       }
@@ -3458,7 +3458,7 @@
       break_args(optarg,arg1,arg2);
       if (arg1[0])
 	strncpy(local_data_port,arg1,sizeof(local_data_port));
-      if (arg2[0])	
+      if (arg2[0])
 	strncpy(remote_data_port,arg2,sizeof(remote_data_port));
       break;
     case 's':
@@ -3482,7 +3482,7 @@
       break_args(optarg,arg1,arg2);
       if (arg1[0])
 	req_size = convert(arg1);
-      if (arg2[0])	
+      if (arg2[0])
 	rsp_size = convert(arg2);
       break;
     case 'm':
@@ -3527,7 +3527,7 @@
       rem_rcvavoid = 1;
       break;
     case 'N':
-      /* this opton allows the user to set the number of 
+      /* this opton allows the user to set the number of
        * messages to send.  This in effect modifies the test
        * time.  If we know the message size, then the we can
        * express the test time as message_size * number_messages

Modified: trunk/src/nettest_xti.c
===================================================================
--- trunk/src/nettest_xti.c	2012-02-01 22:00:15 UTC (rev 530)
+++ trunk/src/nettest_xti.c	2012-02-01 22:19:45 UTC (rev 531)
@@ -41,7 +41,7 @@
 
 #ifdef HAVE_CONFIG_H
 #include <config.h>
-#endif 
+#endif
 
 #include <sys/types.h>
 #include <fcntl.h>
@@ -75,7 +75,7 @@
  /* these variables are specific to the XTI sockets tests. declare */
  /* them static to make them global only to this file. */
 
-static int	
+static int
   rss_size,		/* remote socket send buffer size	*/
   rsr_size,		/* remote socket recv buffer size	*/
   lss_size,		/* local  socket send buffer size 	*/
@@ -136,8 +136,8 @@
 value, specifying a value with a leading comma will set just the second\n\
 parm, a value with a trailing comma will set just the first. To set\n\
 each parm to unique values, specify both and separate them with a\n\
-comma.\n"; 
-     
+comma.\n";
+
 
  /* This routine is intended to retrieve interesting aspects of tcp */
  /* for the data connection. at first, it attempts to retrieve the */
@@ -186,7 +186,7 @@
 
   /*set up the data socket                        */
   temp_socket = t_open(name,O_RDWR,NULL);
-  
+
   if (temp_socket == INVALID_SOCKET){
     fprintf(where,
 	    "netperf: create_xti_endpoint: t_open %s: errno %d t_errno %d\n",
@@ -196,14 +196,14 @@
     fflush(where);
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,"create_xti_endpoint: socket %d obtained...\n",temp_socket);
     fflush(where);
   }
-  
+
   /* allocate what we need for option mgmt */
-  if ((opt_req = (struct t_optmgmt *)t_alloc(temp_socket,T_OPTMGMT,T_ALL)) == 
+  if ((opt_req = (struct t_optmgmt *)t_alloc(temp_socket,T_OPTMGMT,T_ALL)) ==
       NULL) {
     fprintf(where,
 	    "netperf: create_xti_endpoint: t_alloc: opt_req errno %d\n",
@@ -218,7 +218,7 @@
 	    opt_req->opt.buf,
 	    opt_req->opt.maxlen,
 	    opt_req->opt.len);
-    
+
     fflush(where);
   }
 
@@ -268,24 +268,24 @@
   /* the first part is for the netbuf that holds the option we want */
   /* to negotiate or check */
   /* the buffer of the netbuf points at the socket options structure */
-  
+
   /* we assume that the t_alloc call allocated a buffer that started */
   /* on a proper alignment */
   sock_option = (struct sock_option *)opt_req->opt.buf;
-  
+
   /* and next, set the fields in the sock_option structure */
   sock_option->myopthdr.level = XTI_GENERIC;
   sock_option->myopthdr.name  = XTI_SNDBUF;
   sock_option->myopthdr.len   = sizeof(struct t_opthdr) + sizeof(long);
   sock_option->value        = lss_size;
-  
+
   opt_req->opt.len          = sizeof(struct t_opthdr) + sizeof(long);
-  
+
   /* now, set-up the stuff to return the value in the end */
   /* we assume that the t_alloc call allocated a buffer that started */
   /* on a proper alignment */
   sock_option = (struct sock_option *)opt_ret->opt.buf;
-  
+
   /* finally, call t_optmgmt. clear as mud. */
   if (t_optmgmt(temp_socket,opt_req,opt_ret) == -1) {
     fprintf(where,
@@ -317,28 +317,28 @@
     /* the same as T_DEFAULT raj 3/95 */
     opt_req->flags = T_CURRENT;
   }
-  
+
   /* the first part is for the netbuf that holds the option we want */
   /* to negotiate or check */
   /* the buffer of the netbuf points at the socket options structure */
-  
+
   /* we assume that the t_alloc call allocated a buffer that started */
   /* on a proper alignment */
   sock_option = (struct sock_option *)opt_req->opt.buf;
-  
+
   /* and next, set the fields in the sock_option structure */
   sock_option->myopthdr.level = XTI_GENERIC;
   sock_option->myopthdr.name  = XTI_RCVBUF;
   sock_option->myopthdr.len   = sizeof(struct t_opthdr) + sizeof(long);
   sock_option->value        = lsr_size;
-  
+
   opt_req->opt.len          = sizeof(struct t_opthdr) + sizeof(long);
-  
+
   /* now, set-up the stuff to return the value in the end */
   /* we assume that the t_alloc call allocated a buffer that started */
   /* on a proper alignment */
   sock_option = (struct sock_option *)opt_ret->opt.buf;
-  
+
   /* finally, call t_optmgmt. clear as mud. */
   if (t_optmgmt(temp_socket,opt_req,opt_ret) == -1) {
     fprintf(where,
@@ -357,17 +357,17 @@
 	    lss_size,lsr_size);
     fflush(where);
   }
-  
+
 #else /* XTI_SNDBUF */
-  
+
   lss_size = -1;
   lsr_size = -1;
-  
+
 #endif /* XTI_SNDBUF */
 
   /* now, we may wish to enable the copy avoidance features on the */
   /* local system. of course, this may not be possible... */
-  
+
   if (loc_rcvavoid) {
     fprintf(where,
 	    "netperf: create_xti_endpoint: Could not enable receive copy avoidance");
@@ -381,13 +381,13 @@
     fflush(where);
     loc_sndavoid = 0;
   }
-  
+
   /* Now, we will see about setting the TCP_NODELAY flag on the local */
   /* socket. We will only do this for those systems that actually */
   /* support the option. If it fails, note the fact, but keep going. */
   /* If the user tries to enable TCP_NODELAY on a UDP socket, this */
   /* will cause an error to be displayed */
-  
+
 #ifdef TCP_NODELAY
   if ((strcmp(test_name,"XTI_TCP_STREAM") == 0) ||
       (strcmp(test_name,"XTI_TCP_RR") == 0) ||
@@ -402,28 +402,28 @@
       /* the same as T_DEFAULT raj 3/95 */
       opt_req->flags = T_CURRENT;
     }
-    
+
     /* the first part is for the netbuf that holds the option we want */
     /* to negotiate or check the buffer of the netbuf points at the */
-    /* socket options structure */ 
-    
+    /* socket options structure */
+
     /* we assume that the t_alloc call allocated a buffer that started */
     /* on a proper alignment */
     sock_option = (struct sock_option *)opt_req->opt.buf;
-    
+
     /* and next, set the fields in the sock_option structure */
     sock_option->myopthdr.level = INET_TCP;
     sock_option->myopthdr.name  = TCP_NODELAY;
     sock_option->myopthdr.len   = sizeof(struct t_opthdr) + sizeof(long);
     sock_option->value          = T_YES;
-    
+
     opt_req->opt.len          = sizeof(struct t_opthdr) + sizeof(long);
-    
+
     /* now, set-up the stuff to return the value in the end */
     /* we assume that the t_alloc call allocated a buffer that started */
     /* on a proper alignment */
     sock_option = (struct sock_option *)opt_ret->opt.buf;
-    
+
     /* finally, call t_optmgmt. clear as mud. */
     if (t_optmgmt(temp_socket,opt_req,opt_ret) == -1) {
       fprintf(where,
@@ -436,9 +436,9 @@
     loc_nodelay = sock_option->value;
   }
 #else /* TCP_NODELAY */
-  
+
   loc_nodelay = 0;
-  
+
 #endif /* TCP_NODELAY */
 
   return(temp_socket);
@@ -452,34 +452,34 @@
 /* output to the standard output. */
 
 
-void 
+void
 send_xti_tcp_stream(char remote_host[])
 {
-  
+
   char *tput_title = "\
 Recv   Send    Send                          \n\
 Socket Socket  Message  Elapsed              \n\
 Size   Size    Size     Time     Throughput  \n\
 bytes  bytes   bytes    secs.    %s/sec  \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1 =
     "%6d %6d %6d    %-6.2f   %7.2f   \n";
-  
+
   char *cpu_title = "\
 Recv   Send    Send                          Utilization       Service Demand\n\
 Socket Socket  Message  Elapsed              Send     Recv     Send    Recv\n\
 Size   Size    Size     Time     Throughput  local    remote   local   remote\n\
 bytes  bytes   bytes    secs.    %-8.8s/s  %% %c      %% %c      us/KB   us/KB\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f %c\n";
 
   char *cpu_fmt_1 =
     "%6d %6d %6d    %-6.2f     %7.2f   %-6.2f   %-6.2f   %-6.3f  %-6.3f\n";
-  
+
   char *ksink_fmt = "\n\
 Alignment      Offset         %-8.8s %-8.8s    Sends   %-8.8s Recvs\n\
 Local  Remote  Local  Remote  Xfered   Per                 Per\n\
@@ -491,26 +491,26 @@
 Segment\n\
 Size (bytes)\n\
 %6d\n";
-  
-  
+
+
   float			elapsed_time;
-  
+
 #ifdef WANT_INTERVALS
   int interval_count;
   sigset_t signal_set;
 #endif
-  
+
   /* what we want is to have a buffer space that is at least one */
   /* send-size greater than our send window. this will insure that we */
   /* are never trying to re-use a buffer that may still be in the hands */
   /* of the transport. This buffer will be malloc'd after we have found */
   /* the size of the local senc socket buffer. We will want to deal */
   /* with alignment and offset concerns as well. */
-  
+
   int	*message_int_ptr;
 
   struct ring_elt *send_ring;
-  
+
   int len;
   unsigned int nummessages;
   SOCKET send_socket;
@@ -522,32 +522,32 @@
   /* 64bit integral type, but those are not entirely common yet */
 
   double	bytes_sent;
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
 
   double	thruput;
-  
+
   /* some addressing information */
   struct	hostent	        *hp;
   struct	sockaddr_in	server;
   unsigned      int             addr;
 
   struct t_call server_call;
-  
+
   struct	xti_tcp_stream_request_struct	*xti_tcp_stream_request;
   struct	xti_tcp_stream_response_struct	*xti_tcp_stream_response;
   struct	xti_tcp_stream_results_struct	*xti_tcp_stream_result;
-  
-  xti_tcp_stream_request  = 
+
+  xti_tcp_stream_request  =
     (struct xti_tcp_stream_request_struct *)netperf_request.content.test_specific_data;
   xti_tcp_stream_response =
     (struct xti_tcp_stream_response_struct *)netperf_response.content.test_specific_data;
-  xti_tcp_stream_result   = 
+  xti_tcp_stream_result   =
     (struct xti_tcp_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
 #ifdef WANT_HISTOGRAM
   time_hist = HIST_new();
 #endif /* WANT_HISTOGRAM */
@@ -555,13 +555,13 @@
   /* control socket, and since we want to be able to use different */
   /* protocols and such, we are passed the name of the remote host and */
   /* must turn that into the test specific addressing information. */
-  
+
   bzero((char *)&server,
 	sizeof(server));
-  
+
   /* it would seem that while HP-UX will allow an IP address (as a */
   /* string) in a call to gethostbyname, other, less enlightened */
-  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */  
+  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */
   /* order changed to check for IP address first. raj 7/96 */
 
   if ((addr = inet_addr(remote_host)) == SOCKET_ERROR) {
@@ -586,8 +586,8 @@
     /* it was a valid IP address */
     server.sin_addr.s_addr = addr;
     server.sin_family = AF_INET;
-  }    
-  
+  }
+
   if ( print_headers ) {
     /* we want to have some additional, interesting information in */
     /* the headers. we know some of it here, but not all, so we will */
@@ -604,7 +604,7 @@
     if (loc_nodelay || rem_nodelay) {
       fprintf(where," : nodelay");
     }
-    if (loc_sndavoid || 
+    if (loc_sndavoid ||
 	loc_rcvavoid ||
 	rem_sndavoid ||
 	rem_rcvavoid) {
@@ -616,7 +616,7 @@
 #ifdef WANT_INTERVALS
     fprintf(where," : interval");
 #endif /* WANT_INTERVALS */
-#ifdef DIRTY 
+#ifdef DIRTY
     fprintf(where," : dirty data");
 #endif /* DIRTY */
     fprintf(where,"\n");
@@ -638,23 +638,23 @@
 
     /* initialize a few counters. we have to remember that we might be */
     /* going through the loop more than once. */
-    
+
     nummessages    =	0;
     bytes_sent     =	0.0;
     times_up       = 	0;
-    
+
     /*set up the data socket                        */
     send_socket = create_xti_endpoint(loc_xti_device);
-    
+
     if (send_socket == INVALID_SOCKET) {
       perror("netperf: send_xti_tcp_stream: tcp stream data socket");
       exit(1);
     }
-    
+
     if (debug) {
       fprintf(where,"send_xti_tcp_stream: send_socket obtained...\n");
     }
-    
+
     /* it would seem that with XTI, there is no implicit bind on a */
     /* connect, so we have to make a call to t_bind. this is not */
     /* terribly convenient, but I suppose that "standard is better */
@@ -664,7 +664,7 @@
       t_error("send_xti_tcp_stream: t_bind");
       exit(1);
     }
-      
+
     /* at this point, we have either retrieved the socket buffer sizes, */
     /* or have tried to set them, so now, we may want to set the send */
     /* size based on that (because the user either did not use a -m */
@@ -679,7 +679,7 @@
 	send_size = 4096;
       }
     }
-    
+
     /* set-up the data buffer ring with the requested alignment and offset. */
     /* note also that we have allocated a quantity */
     /* of memory that is at least one send-size greater than our socket */
@@ -693,7 +693,7 @@
       send_width = (lss_size/send_size) + 1;
       if (send_width == 1) send_width++;
     }
-    
+
     if (send_ring == NULL) {
       /* only allocate the send ring once. this is a networking test, */
       /* not a memory allocation test. this way, we do not need a */
@@ -711,11 +711,11 @@
     /* calibrate_local_cpu will return rather quickly as it will have */
     /* nothing to do. If local_cpu_rate is zero, then we will go through */
     /* all the "normal" calibration stuff and return the rate back. */
-    
+
     if (local_cpu_usage) {
       local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
     }
-    
+
     /* Tell the remote end to do a listen. The server alters the socket */
     /* paramters on the other side at this point, hence the reason for */
     /* all the values being passed in the setup message. If the user did */
@@ -723,7 +723,7 @@
     /* will indicate to the remote that no changes beyond the system's */
     /* default should be used. Alignment is the exception, it will */
     /* default to 1, which will be no alignment alterations. */
-    
+
     netperf_request.content.request_type          = DO_XTI_TCP_STREAM;
     xti_tcp_stream_request->send_buf_size  = rss_size;
     xti_tcp_stream_request->recv_buf_size  = rsr_size;
@@ -743,9 +743,9 @@
     xti_tcp_stream_request->so_sndavoid    = rem_sndavoid;
 
     strcpy(xti_tcp_stream_request->xti_device, rem_xti_device);
-  
+
 #ifdef __alpha
-  
+
     /* ok - even on a DEC box, strings are strings. I didn't really want */
     /* to ntohl the words of a string. since I don't want to teach the */
     /* send_ and recv_ _request and _response routines about the types, */
@@ -756,32 +756,32 @@
       int *charword;
       int *initword;
       int *lastword;
-      
+
       initword = (int *) xti_tcp_stream_request->xti_device;
       lastword = initword + ((strlen(rem_xti_device) + 3) / 4);
-      
+
       for (charword = initword;
 	   charword < lastword;
 	   charword++) {
-	
+
 	*charword = ntohl(*charword);
       }
     }
 #endif /* __alpha */
-    
+
 #ifdef DIRTY
     xti_tcp_stream_request->dirty_count         = rem_dirty_count;
     xti_tcp_stream_request->clean_count         = rem_clean_count;
 #endif /* DIRTY */
-    
-    
+
+
     if (debug > 1) {
       fprintf(where,
               "netperf: send_xti_tcp_stream: requesting TCP stream test\n");
     }
-    
+
     send_request();
-    
+
     /* The response from the remote will contain all of the relevant    */
     /* socket parameters for this test type. We will put them back into */
     /* the variables here so they can be displayed if desired.  The     */
@@ -791,9 +791,9 @@
     /* after the connect returns. The remote will grab the counter right*/
     /* after the accept call. This saves the hassle of extra messages   */
     /* being sent for the TCP tests.                                    */
-    
+
     recv_response();
-    
+
     if (!netperf_response.content.serv_errno) {
       if (debug)
         fprintf(where,"remote listen done.\n");
@@ -806,41 +806,41 @@
       /* we have to make sure that the server port number is in */
       /* network order */
       server.sin_port   = (short)xti_tcp_stream_response->data_port_number;
-      server.sin_port   = htons(server.sin_port); 
+      server.sin_port   = htons(server.sin_port);
       rem_rcvavoid      = xti_tcp_stream_response->so_rcvavoid;
       rem_sndavoid      = xti_tcp_stream_response->so_sndavoid;
     }
     else {
       Set_errno(netperf_response.content.serv_errno);
       perror("netperf: remote error");
-      
+
       exit(1);
     }
-    
+
     /*Connect up to the remote port on the data socket  */
     memset (&server_call, 0, sizeof(server_call));
     server_call.addr.maxlen = sizeof(struct sockaddr_in);
     server_call.addr.len    = sizeof(struct sockaddr_in);
     server_call.addr.buf    = (char *)&server;
 
-    if (t_connect(send_socket, 
+    if (t_connect(send_socket,
 		  &server_call,
 		  NULL) == INVALID_SOCKET){
       t_error("netperf: send_xti_tcp_stream: data socket connect failed");
       printf(" port: %d\n",ntohs(server.sin_port));
       exit(1);
     }
-    
+
     /* Data Socket set-up is finished. If there were problems, either */
     /* the connect would have failed, or the previous response would */
     /* have indicated a problem. I failed to see the value of the */
     /* extra  message after the accept on the remote. If it failed, */
     /* we'll see it here. If it didn't, we might as well start pumping */
-    /* data. */ 
-    
+    /* data. */
+
     /* Set-up the test end conditions. For a stream test, they can be */
     /* either time or byte-count based. */
-    
+
     if (test_time) {
       /* The user wanted to end the test after a period of time. */
       times_up = 0;
@@ -858,13 +858,13 @@
       bytes_remaining = test_bytes;
       times_up = 1;
     }
-    
+
     /* The cpu_start routine will grab the current time and possibly */
     /* value of the idle counter for later use in measuring cpu */
     /* utilization and/or service demand and thruput. */
-    
+
     cpu_start(local_cpu_usage);
-    
+
 #ifdef WANT_INTERVALS
     if ((interval_burst) || (demo_mode)) {
       /* zero means that we never pause, so we never should need the */
@@ -889,9 +889,9 @@
     /* When the test is controlled by byte count, the time test will */
     /* always return false. When the test is finished, the whole */
     /* expression will go false and we will stop sending data. */
-    
+
     while ((!times_up) || (bytes_remaining > 0)) {
-      
+
 #ifdef DIRTY
       /* we want to dirty some number of consecutive integers in the buffer */
       /* we are about to send. we may also want to bring some number of */
@@ -904,13 +904,13 @@
 		    loc_dirty_count,
 		    loc_clean_count);
 #endif /* DIRTY */
-      
+
 #ifdef WANT_HISTOGRAM
       /* timestamp just before we go into send and then again just after */
       /* we come out raj 8/94 */
       HIST_timestamp(&time_one);
 #endif /* WANT_HISTOGRAM */
-      
+
       if((len=t_snd(send_socket,
 		    send_ring->buffer_ptr,
 		    send_size,
@@ -932,9 +932,9 @@
       /* timestamp the exit from the send call and update the histogram */
       HIST_timestamp(&time_two);
       HIST_add(time_hist,delta_micro(&time_one,&time_two));
-#endif /* WANT_HISTOGRAM */      
+#endif /* WANT_HISTOGRAM */
 
-#ifdef WANT_INTERVALS      
+#ifdef WANT_INTERVALS
       if (demo_mode) {
         units_this_tick += send_size;
       }
@@ -956,13 +956,13 @@
         interval_count = interval_burst;
       }
 #endif /* WANT_INTERVALS */
-      
+
       /* now we want to move our pointer to the next position in the */
       /* data buffer...we may also want to wrap back to the "beginning" */
       /* of the bufferspace, so we will mod the number of messages sent */
       /* by the send width, and use that to calculate the offset to add */
       /* to the base pointer. */
-      nummessages++;          
+      nummessages++;
       send_ring = send_ring->next;
       if (bytes_remaining) {
         bytes_remaining -= send_size;
@@ -971,7 +971,7 @@
 
     /* The test is over. Flush the buffers to the remote end. We do a */
     /* graceful release to insure that all data has been taken by the */
-    /* remote. */ 
+    /* remote. */
 
     /* but first, if the verbosity is greater than 1, find-out what */
     /* the TCP maximum segment_size was (if possible) */
@@ -979,36 +979,36 @@
       tcp_mss = -1;
       get_xti_info(send_socket,info_struct);
     }
-    
+
     if (t_sndrel(send_socket) == -1) {
       t_error("netperf: cannot shutdown tcp stream socket");
       exit(1);
     }
-    
+
     /* hang a t_rcvrel() off the socket to block until the remote has */
     /* brought all the data up into the application. it will do a */
     /* t_sedrel to cause a FIN to be sent our way. We will assume that */
     /* any exit from the t_rcvrel() call is good... raj 2/95 */
-    
+
     if (debug > 1) {
       fprintf(where,"about to hang a receive for graceful release.\n");
       fflush(where);
     }
 
     t_rcvrel(send_socket);
-    
+
     /* this call will always give us the elapsed time for the test, and */
     /* will also store-away the necessaries for cpu utilization */
-    
+
     cpu_stop(local_cpu_usage,&elapsed_time);    /* was cpu being */
                                                 /* measured and how */
                                                 /* long did we really */
                                                 /* run? */
-    
+
     /* Get the statistics from the remote end. The remote will have */
     /* calculated service demand and all those interesting things. If it */
     /* wasn't supposed to care, it will return obvious values. */
-    
+
     recv_response();
     if (!netperf_response.content.serv_errno) {
       if (debug)
@@ -1017,10 +1017,10 @@
     else {
       Set_errno(netperf_response.content.serv_errno);
       perror("netperf: remote error");
-      
+
       exit(1);
     }
-    
+
     /* We now calculate what our thruput was for the test. In the future, */
     /* we may want to include a calculation of the thruput measured by */
     /* the remote, but it should be the case that for a TCP stream test, */
@@ -1029,11 +1029,11 @@
     /* If it was time, we needed to, and if it was by bytes, the user may */
     /* have specified a number of bytes that wasn't a multiple of the */
     /* send_size, so we really didn't send what he asked for ;-) */
-    
+
     bytes_sent  = xti_tcp_stream_result->bytes_received;
 
     thruput     = calc_thruput(bytes_sent);
-    
+
     if (local_cpu_usage || remote_cpu_usage) {
       /* We must now do a little math for service demand and cpu */
       /* utilization for the system(s) */
@@ -1041,7 +1041,7 @@
       /* there was no idle counter in the kernel(s). We need to make */
       /* a note of this for the user's benefit...*/
       if (local_cpu_usage) {
-        
+
         local_cpu_utilization   = calc_cpu_util(0.0);
         local_service_demand    = calc_service_demand(bytes_sent,
                                                       0.0,
@@ -1052,9 +1052,9 @@
         local_cpu_utilization   = -1.0;
         local_service_demand    = -1.0;
       }
-      
+
       if (remote_cpu_usage) {
-        
+
         remote_cpu_utilization  = xti_tcp_stream_result->cpu_util;
         remote_service_demand   = calc_service_demand(bytes_sent,
                                                       0.0,
@@ -1065,7 +1065,7 @@
         remote_cpu_utilization = -1.0;
         remote_service_demand  = -1.0;
       }
-    }    
+    }
     else {
       /* we were not measuring cpu, for the confidence stuff, we */
       /* should make it -1.0 */
@@ -1078,7 +1078,7 @@
     /* at this point, we want to calculate the confidence information. */
     /* if debugging is on, calculate_confidence will print-out the */
     /* parameters we pass it */
-    
+
     calculate_confidence(confidence_iteration,
                          elapsed_time,
                          thruput,
@@ -1086,8 +1086,8 @@
                          remote_cpu_utilization,
                          local_service_demand,
                          remote_service_demand);
-    
-    
+
+
     confidence_iteration++;
   }
 
@@ -1125,7 +1125,7 @@
   if (local_cpu_usage || remote_cpu_usage) {
     local_cpu_method = format_cpu_method(cpu_method);
     remote_cpu_method = format_cpu_method(xti_tcp_stream_result->cpu_method);
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -1150,7 +1150,7 @@
 		local_cpu_method,
 		remote_cpu_method);
       }
-    
+
       fprintf(where,
 	      cpu_fmt_1,		/* the format string */
 	      rsr_size,		        /* remote recvbuf size */
@@ -1167,7 +1167,7 @@
   }
   else {
     /* The tester did not wish to measure service demand. */
-    
+
     switch (verbosity) {
     case 0:
       fprintf(where,
@@ -1189,22 +1189,22 @@
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   if (verbosity > 1) {
     /* The user wanted to know it all, so we will give it to him. */
     /* This information will include as much as we can find about */
     /* TCP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-   
+
     /* this stuff needs to be worked-out in the presence of confidence */
     /* intervals and multiple iterations of the test... raj 11/94 */
- 
+
     fprintf(where,
 	    ksink_fmt,
 	    "Bytes",
@@ -1229,7 +1229,7 @@
     HIST_report(time_hist);
 #endif /* WANT_HISTOGRAM */
   }
-  
+
 }
 
 
@@ -1237,10 +1237,10 @@
 /* implemented as one routine. I could break things-out somewhat, but */
 /* didn't feel it was necessary. */
 
-void 
+void
 recv_xti_tcp_stream()
 {
-  
+
   struct sockaddr_in myaddr_in, peeraddr_in;
   struct t_bind      bind_req, bind_resp;
   struct t_call      call_req;
@@ -1251,28 +1251,28 @@
   unsigned int	receive_calls;
   float	        elapsed_time;
   double        bytes_received;
-  
+
   struct ring_elt *recv_ring;
 
   int   *message_int_ptr;
   int   i;
-  
+
   struct xti_tcp_stream_request_struct	*xti_tcp_stream_request;
   struct xti_tcp_stream_response_struct	*xti_tcp_stream_response;
   struct xti_tcp_stream_results_struct	*xti_tcp_stream_results;
-  
-  xti_tcp_stream_request	= 
+
+  xti_tcp_stream_request	=
     (struct xti_tcp_stream_request_struct *)netperf_request.content.test_specific_data;
-  xti_tcp_stream_response	= 
+  xti_tcp_stream_response	=
     (struct xti_tcp_stream_response_struct *)netperf_response.content.test_specific_data;
-  xti_tcp_stream_results	= 
+  xti_tcp_stream_results	=
     (struct xti_tcp_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_xti_tcp_stream: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -1280,27 +1280,27 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_stream: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = XTI_TCP_STREAM_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_stream: the response type is set...\n");
     fflush(where);
   }
-  
+
   /* We now alter the message_ptr variable to be at the desired */
   /* alignment with the desired offset. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_stream: requested alignment of %d\n",
 	    xti_tcp_stream_request->recv_alignment);
@@ -1311,20 +1311,20 @@
   /* can put in OUR values !-) At some point, we may want to nail this */
   /* socket to a particular network-level address, but for now, */
   /* INADDR_ANY should be just fine. */
-  
+
   bzero((char *)&myaddr_in,
 	sizeof(myaddr_in));
   myaddr_in.sin_family      = AF_INET;
   myaddr_in.sin_addr.s_addr = INADDR_ANY;
   myaddr_in.sin_port        = 0;
-  
+
   /* Grab a socket to listen on, and then listen on it. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_stream: grabbing a socket...\n");
     fflush(where);
   }
-  
+
   /* create_xti_endpoint expects to find some things in the global */
   /* variables, so set the globals based on the values in the request. */
   /* once the socket has been created, we will set the response values */
@@ -1336,7 +1336,7 @@
   loc_sndavoid = xti_tcp_stream_request->so_sndavoid;
 
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -1347,34 +1347,34 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) xti_tcp_stream_request->xti_device;
     lastword = initword + ((xti_tcp_stream_request->dev_name_len + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = htonl(*charword);
     }
   }
-  
+
 #endif /* __alpha */
 
   s_listen = create_xti_endpoint(xti_tcp_stream_request->xti_device);
-  
+
   if (s_listen == INVALID_SOCKET) {
     netperf_response.content.serv_errno = errno;
     send_response();
     exit(1);
   }
-  
+
   /* Let's get an address assigned to this socket so we can tell the */
   /* initiator how to reach the data socket. There may be a desire to */
   /* nail this socket to a specific IP address in a multi-homed, */
   /* multi-connection situation, but for now, we'll ignore the issue */
   /* and concentrate on single connection testing. */
-  
+
   bind_req.addr.maxlen = sizeof(struct sockaddr_in);
   bind_req.addr.len    = sizeof(struct sockaddr_in);
   bind_req.addr.buf    = (char *)&myaddr_in;
@@ -1391,7 +1391,7 @@
     netperf_response.content.serv_errno = t_errno;
     close(s_listen);
     send_response();
-    
+
     exit(1);
   }
 
@@ -1401,7 +1401,7 @@
 	    ntohs(myaddr_in.sin_port));
     fflush(where);
   }
-  
+
   /* what sort of sizes did we end-up with? */
   if (xti_tcp_stream_request->receive_size == 0) {
     if (lsr_size > 0) {
@@ -1414,7 +1414,7 @@
   else {
     recv_size = xti_tcp_stream_request->receive_size;
   }
-  
+
   /* we want to set-up our recv_ring in a manner analagous to what we */
   /* do on the sending side. this is more for the sake of symmetry */
   /* than for the needs of say copy avoidance, but it might also be */
@@ -1436,31 +1436,31 @@
     fprintf(where,"recv_xti_tcp_stream: recv alignment and offset set...\n");
     fflush(where);
   }
-  
+
   /* Now myaddr_in contains the port and the internet address this is */
   /* returned to the sender also implicitly telling the sender that the */
   /* socket buffer sizing has been done. */
-  
-  xti_tcp_stream_response->data_port_number = 
+
+  xti_tcp_stream_response->data_port_number =
     (int) ntohs(myaddr_in.sin_port);
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a -1 to */
   /* the initiator. */
-  
+
   xti_tcp_stream_response->cpu_rate = 0.0; 	/* assume no cpu */
   if (xti_tcp_stream_request->measure_cpu) {
     xti_tcp_stream_response->measure_cpu = 1;
-    xti_tcp_stream_response->cpu_rate = 
+    xti_tcp_stream_response->cpu_rate =
       calibrate_local_cpu(xti_tcp_stream_request->cpu_rate);
   }
   else {
     xti_tcp_stream_response->measure_cpu = 0;
   }
-  
+
   /* before we send the response back to the initiator, pull some of */
   /* the socket parms from the globals */
   xti_tcp_stream_response->send_buf_size = lss_size;
@@ -1471,7 +1471,7 @@
   xti_tcp_stream_response->receive_size = recv_size;
 
   send_response();
-  
+
   /* Now, let's set-up the socket to listen for connections. for xti, */
   /* the t_listen call is blocking by default - this is different */
   /* semantics from BSD - probably has to do with being able to reject */
@@ -1497,14 +1497,14 @@
     send_response();
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_stream: t_listen complete t_look 0x%.4x\n",
 	    t_look(s_listen));
     fflush(where);
   }
-  
+
   /* now just rubber stamp the thing. we want to use the same fd? so */
   /* we will just equate s_data with s_listen. this seems a little */
   /* hokey to me, but then I'm a BSD biggot still. raj 2/95 */
@@ -1520,7 +1520,7 @@
     close(s_listen);
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_stream: t_accept complete t_look 0x%.4x\n",
@@ -1534,12 +1534,12 @@
 
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(xti_tcp_stream_request->measure_cpu);
-  
+
   /* The loop will exit when the sender does a t_sndrel, which will */
   /* return T_LOOK error from the t_recv */
-  
+
 #ifdef DIRTY
     /* we want to dirty some number of consecutive integers in the buffer */
     /* we are about to recv. we may also want to bring some number of */
@@ -1562,10 +1562,10 @@
 		      &xti_flags)) != -1) {
     bytes_received += len;
     receive_calls++;
-    
+
     /* more to the next buffer in the recv_ring */
     recv_ring = recv_ring->next;
-    
+
 #ifdef DIRTY
 
   access_buffer(recv_ring->buffer_ptr,
@@ -1575,7 +1575,7 @@
 
 #endif /* DIRTY */
   }
-  
+
   if (t_look(s_data) == T_ORDREL) {
     /* this is a normal exit path */
     if (debug) {
@@ -1599,7 +1599,7 @@
     send_response();
     exit(1);
   }
-  
+
   /* receive the release and let the initiator know that we have */
   /* received all the data. raj 3/95 */
 
@@ -1607,7 +1607,7 @@
     netperf_response.content.serv_errno = errno;
     send_response();
     exit(1);
-  }    
+  }
 
   if (debug) {
     fprintf(where,
@@ -1620,7 +1620,7 @@
     send_response();
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_stream: t_sndrel complete\n");
@@ -1628,9 +1628,9 @@
   }
 
   cpu_stop(xti_tcp_stream_request->measure_cpu,&elapsed_time);
-  
+
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_stream: got %g bytes\n",
@@ -1640,15 +1640,15 @@
 	    receive_calls);
     fflush(where);
   }
-  
+
   xti_tcp_stream_results->bytes_received	= bytes_received;
   xti_tcp_stream_results->elapsed_time	= elapsed_time;
   xti_tcp_stream_results->recv_calls	= receive_calls;
-  
+
   if (xti_tcp_stream_request->measure_cpu) {
     xti_tcp_stream_results->cpu_util	= calc_cpu_util(0.0);
   };
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_stream: test complete, sending results.\n");
@@ -1661,7 +1661,7 @@
 	    len);
     fflush(where);
   }
-  
+
   xti_tcp_stream_results->cpu_method = cpu_method;
   send_response();
 
@@ -1674,49 +1674,49 @@
  /* this routine implements the sending (netperf) side of the XTI_TCP_RR */
  /* test. */
 
-void 
+void
 send_xti_tcp_rr(char remote_host[])
 {
-  
+
   char *tput_title = "\
 Local /Remote\n\
 Socket Size   Request  Resp.   Elapsed  Trans.\n\
 Send   Recv   Size     Size    Time     Rate         \n\
 bytes  Bytes  bytes    bytes   secs.    per sec   \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1_line_1 = "\
 %-6d %-6d %-6d   %-6d  %-6.2f   %7.2f   \n";
   char *tput_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *cpu_title = "\
 Local /Remote\n\
 Socket Size   Request Resp.  Elapsed Trans.   CPU    CPU    S.dem   S.dem\n\
 Send   Recv   Size    Size   Time    Rate     local  remote local   remote\n\
 bytes  bytes  bytes   bytes  secs.   per sec  %% %c    %% %c    us/Tr   us/Tr\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f %c\n";
-  
+
   char *cpu_fmt_1_line_1 = "\
 %-6d %-6d %-6d  %-6d %-6.2f  %-6.2f  %-6.2f %-6.2f %-6.3f  %-6.3f\n";
-  
+
   char *cpu_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *ksink_fmt = "\
 Alignment      Offset\n\
 Local  Remote  Local  Remote\n\
 Send   Recv    Send   Recv\n\
 %5d  %5d   %5d  %5d\n";
-  
-  
+
+
   int			timed_out = 0;
   float			elapsed_time;
-  
+
   int	len;
   char	*temp_message_ptr;
   int	nummessages;
@@ -1726,38 +1726,38 @@
 
   struct ring_elt *send_ring;
   struct ring_elt *recv_ring;
-  
+
   int	rsp_bytes_left;
   int	rsp_bytes_recvd;
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
   double	thruput;
-  
+
   struct	hostent	        *hp;
   struct	sockaddr_in	server;
   unsigned      int             addr;
-  
+
   struct t_call server_call;
 
   struct	xti_tcp_rr_request_struct	*xti_tcp_rr_request;
   struct	xti_tcp_rr_response_struct	*xti_tcp_rr_response;
   struct	xti_tcp_rr_results_struct	*xti_tcp_rr_result;
-  
+
 #ifdef WANT_INTERVALS
   int	interval_count;
   sigset_t signal_set;
 #endif /* WANT_INTERVALS */
 
-  xti_tcp_rr_request = 
+  xti_tcp_rr_request =
     (struct xti_tcp_rr_request_struct *)netperf_request.content.test_specific_data;
   xti_tcp_rr_response=
     (struct xti_tcp_rr_response_struct *)netperf_response.content.test_specific_data;
   xti_tcp_rr_result	=
     (struct xti_tcp_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
 #ifdef WANT_HISTOGRAM
   time_hist = HIST_new();
 #endif /* WANT_HISTOGRAM */
@@ -1769,10 +1769,10 @@
 
   bzero((char *)&server,
 	sizeof(server));
-  
+
   /* it would seem that while HP-UX will allow an IP address (as a */
   /* string) in a call to gethostbyname, other, less enlightened */
-  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */  
+  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */
   /* order changed to check for IP address first. raj 7/96 */
 
   if ((addr = inet_addr(remote_host)) == SOCKET_ERROR) {
@@ -1797,8 +1797,8 @@
     /* it was a valid IP address */
     server.sin_addr.s_addr = addr;
     server.sin_family = AF_INET;
-  }    
-  
+  }
+
   if ( print_headers ) {
     fprintf(where,"XTI TCP REQUEST/RESPONSE TEST");
     fprintf(where," to %s", remote_host);
@@ -1811,7 +1811,7 @@
     if (loc_nodelay || rem_nodelay) {
       fprintf(where," : nodelay");
     }
-    if (loc_sndavoid || 
+    if (loc_sndavoid ||
 	loc_rcvavoid ||
 	rem_sndavoid ||
 	rem_rcvavoid) {
@@ -1823,14 +1823,14 @@
 #ifdef WANT_INTERVALS
     fprintf(where," : interval");
 #endif /* WANT_INTERVALS */
-#ifdef DIRTY 
+#ifdef DIRTY
     fprintf(where," : dirty data");
 #endif /* DIRTY */
     fprintf(where,"\n");
   }
-  
+
   /* initialize a few counters */
-  
+
   send_ring = NULL;
   recv_ring = NULL;
   confidence_iteration = 1;
@@ -1861,7 +1861,7 @@
 
     if (send_width == 0) send_width = 1;
     if (recv_width == 0) recv_width = 1;
-  
+
     if (send_ring == NULL) {
       send_ring = allocate_buffer_ring(send_width,
 				       req_size,
@@ -1875,15 +1875,15 @@
 				       local_recv_align,
 				       local_recv_offset);
     }
-    
+
     /*set up the data socket                        */
     send_socket = create_xti_endpoint(loc_xti_device);
-  
+
     if (send_socket == INVALID_SOCKET){
       perror("netperf: send_xti_tcp_rr: tcp stream data socket");
       exit(1);
     }
-    
+
     if (debug) {
       fprintf(where,"send_xti_tcp_rr: send_socket obtained...\n");
     }
@@ -1897,18 +1897,18 @@
       t_error("send_xti_tcp_stream: t_bind");
       exit(1);
     }
-  
+
     /* If the user has requested cpu utilization measurements, we must */
     /* calibrate the cpu(s). We will perform this task within the tests */
     /* themselves. If the user has specified the cpu rate, then */
     /* calibrate_local_cpu will return rather quickly as it will have */
     /* nothing to do. If local_cpu_rate is zero, then we will go through */
     /* all the "normal" calibration stuff and return the rate back.*/
-    
+
     if (local_cpu_usage) {
       local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
     }
-    
+
     /* Tell the remote end to do a listen. The server alters the socket */
     /* paramters on the other side at this point, hence the reason for */
     /* all the values being passed in the setup message. If the user did */
@@ -1916,7 +1916,7 @@
     /* will indicate to the remote that no changes beyond the system's */
     /* default should be used. Alignment is the exception, it will */
     /* default to 8, which will be no alignment alterations. */
-    
+
     netperf_request.content.request_type	=	DO_XTI_TCP_RR;
     xti_tcp_rr_request->recv_buf_size	=	rsr_size;
     xti_tcp_rr_request->send_buf_size	=	rss_size;
@@ -1939,9 +1939,9 @@
     }
 
     strcpy(xti_tcp_rr_request->xti_device, rem_xti_device);
-  
+
 #ifdef __alpha
-  
+
     /* ok - even on a DEC box, strings are strings. I didn't really want */
     /* to ntohl the words of a string. since I don't want to teach the */
     /* send_ and recv_ _request and _response routines about the types, */
@@ -1952,25 +1952,25 @@
       int *charword;
       int *initword;
       int *lastword;
-      
+
       initword = (int *) xti_tcp_rr_request->xti_device;
       lastword = initword + ((strlen(rem_xti_device) + 3) / 4);
-      
+
       for (charword = initword;
 	   charword < lastword;
 	   charword++) {
-	
+
 	*charword = ntohl(*charword);
       }
     }
 #endif /* __alpha */
-    
+
     if (debug > 1) {
       fprintf(where,"netperf: send_xti_tcp_rr: requesting TCP rr test\n");
     }
-    
+
     send_request();
-    
+
     /* The response from the remote will contain all of the relevant 	*/
     /* socket parameters for this test type. We will put them back into */
     /* the variables here so they can be displayed if desired.  The	*/
@@ -1980,9 +1980,9 @@
     /* after the connect returns. The remote will grab the counter right*/
     /* after the accept call. This saves the hassle of extra messages	*/
     /* being sent for the TCP tests.					*/
-  
+
     recv_response();
-  
+
     if (!netperf_response.content.serv_errno) {
       if (debug)
 	fprintf(where,"remote listen done.\n");
@@ -1998,17 +1998,17 @@
     else {
       Set_errno(netperf_response.content.serv_errno);
       perror("netperf: remote error");
-      
+
       exit(1);
     }
-    
+
     /*Connect up to the remote port on the data socket  */
     memset (&server_call, 0, sizeof(server_call));
     server_call.addr.maxlen = sizeof(struct sockaddr_in);
     server_call.addr.len    = sizeof(struct sockaddr_in);
     server_call.addr.buf    = (char *)&server;
 
-    if (t_connect(send_socket, 
+    if (t_connect(send_socket,
 		  &server_call,
 		  NULL) == INVALID_SOCKET){
       t_error("netperf: send_xti_tcp_rr: data socket connect failed");
@@ -2021,10 +2021,10 @@
     /* indicated a problem. I failed to see the value of the extra */
     /* message after the accept on the remote. If it failed, we'll see it */
     /* here. If it didn't, we might as well start pumping data. */
-    
+
     /* Set-up the test end conditions. For a request/response test, they */
     /* can be either time or transaction based. */
-    
+
     if (test_time) {
       /* The user wanted to end the test after a period of time. */
       times_up = 0;
@@ -2036,11 +2036,11 @@
       trans_remaining = test_bytes;
       times_up = 1;
     }
-    
+
     /* The cpu_start routine will grab the current time and possibly */
     /* value of the idle counter for later use in measuring cpu */
     /* utilization and/or service demand and thruput. */
-    
+
     cpu_start(local_cpu_usage);
 
 #ifdef WANT_INTERVALS
@@ -2059,7 +2059,7 @@
       exit(1);
     }
 #endif /* WANT_INTERVALS */
-    
+
     /* We use an "OR" to control test execution. When the test is */
     /* controlled by time, the byte count check will always return false. */
     /* When the test is controlled by byte count, the time test will */
@@ -2072,13 +2072,13 @@
     while ((!times_up) || (trans_remaining > 0)) {
       /* send the request. we assume that if we use a blocking socket, */
       /* the request will be sent at one shot. */
-      
+
 #ifdef WANT_HISTOGRAM
       /* timestamp just before our call to send, and then again just */
       /* after the receive raj 8/94 */
       HIST_timestamp(&time_one);
 #endif /* WANT_HISTOGRAM */
-      
+
       if((len=t_snd(send_socket,
 		    send_ring->buffer_ptr,
 		    req_size,
@@ -2098,7 +2098,7 @@
         exit(1);
       }
       send_ring = send_ring->next;
-      
+
       /* receive the response */
       rsp_bytes_left = rsp_size;
       temp_message_ptr  = recv_ring->buffer_ptr;
@@ -2122,20 +2122,20 @@
 	}
 	rsp_bytes_left -= rsp_bytes_recvd;
 	temp_message_ptr  += rsp_bytes_recvd;
-      }	
+      }
       recv_ring = recv_ring->next;
-      
+
       if (timed_out) {
 	/* we may have been in a nested while loop - we need */
 	/* another call to break. */
 	break;
       }
-      
+
 #ifdef WANT_HISTOGRAM
       HIST_timestamp(&time_two);
       HIST_add(time_hist,delta_micro(&time_one,&time_two));
 #endif /* WANT_HISTOGRAM */
-#ifdef WANT_INTERVALS      
+#ifdef WANT_INTERVALS
       if (demo_mode) {
 	units_this_tick += 1;
       }
@@ -2157,12 +2157,12 @@
 	interval_count = interval_burst;
       }
 #endif /* WANT_INTERVALS */
-      
-      nummessages++;          
+
+      nummessages++;
       if (trans_remaining) {
 	trans_remaining--;
       }
-      
+
       if (debug > 3) {
 	if ((nummessages % 100) == 0) {
 	  fprintf(where,
@@ -2173,18 +2173,18 @@
       }
     }
 
-    
+
     /* this call will always give us the elapsed time for the test, and */
     /* will also store-away the necessaries for cpu utilization */
-    
+
     cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being */
 						/* measured? how long */
 						/* did we really run? */
-    
+
     /* Get the statistics from the remote end. The remote will have */
     /* calculated service demand and all those interesting things. If it */
     /* wasn't supposed to care, it will return obvious values. */
-    
+
     recv_response();
     if (!netperf_response.content.serv_errno) {
       if (debug)
@@ -2193,15 +2193,15 @@
     else {
       Set_errno(netperf_response.content.serv_errno);
       perror("netperf: remote error");
-      
+
       exit(1);
     }
-    
+
     /* We now calculate what our thruput was for the test. */
-  
+
     bytes_xferd	= (req_size * nummessages) + (rsp_size * nummessages);
     thruput	= nummessages/elapsed_time;
-  
+
     if (local_cpu_usage || remote_cpu_usage) {
       /* We must now do a little math for service demand and cpu */
       /* utilization for the system(s) */
@@ -2222,7 +2222,7 @@
 	local_cpu_utilization	= -1.0;
 	local_service_demand	= -1.0;
       }
-      
+
       if (remote_cpu_usage) {
 	remote_cpu_utilization = xti_tcp_rr_result->cpu_util;
 	/* since calc_service demand is doing ms/Kunit we will */
@@ -2237,7 +2237,7 @@
 	remote_cpu_utilization = -1.0;
 	remote_service_demand  = -1.0;
       }
-      
+
     }
     else {
       /* we were not measuring cpu, for the confidence stuff, we */
@@ -2251,7 +2251,7 @@
     /* at this point, we want to calculate the confidence information. */
     /* if debugging is on, calculate_confidence will print-out the */
     /* parameters we pass it */
-    
+
     calculate_confidence(confidence_iteration,
 			 elapsed_time,
 			 thruput,
@@ -2259,8 +2259,8 @@
 			 remote_cpu_utilization,
 			 local_service_demand,
 			 remote_service_demand);
-    
-    
+
+
     confidence_iteration++;
 
     /* we are now done with the socket, so close it */
@@ -2294,7 +2294,7 @@
   if (local_cpu_usage || remote_cpu_usage) {
     local_cpu_method = format_cpu_method(cpu_method);
     remote_cpu_method = format_cpu_method(xti_tcp_rr_result->cpu_method);
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -2340,7 +2340,7 @@
   }
   else {
     /* The tester did not wish to measure service demand. */
-    
+
     switch (verbosity) {
     case 0:
       fprintf(where,
@@ -2365,17 +2365,17 @@
 	      tput_fmt_1_line_2,
 	      rss_size, 		/* remote recvbuf size */
 	      rsr_size);
-      
+
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   /* how to handle the verbose information in the presence of */
   /* confidence intervals is yet to be determined... raj 11/94 */
   if (verbosity > 1) {
@@ -2383,7 +2383,7 @@
     /* This information will include as much as we can find about */
     /* TCP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-    
+
     fprintf(where,
 	    ksink_fmt,
 	    local_send_align,
@@ -2398,7 +2398,7 @@
 #endif /* WANT_HISTOGRAM */
 
   }
-  
+
 }
 
 void
@@ -2413,47 +2413,47 @@
 Socket  Message  Elapsed      Messages                \n\
 Size    Size     Time         Okay Errors   Throughput\n\
 bytes   bytes    secs            #      #   %s/sec\n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1 = "\
 %6d  %6d   %-7.2f   %7d %6d    %7.2f\n\
 %6d           %-7.2f   %7d           %7.2f\n\n";
-  
-  
+
+
   char *cpu_title = "\
 Socket  Message  Elapsed      Messages                   CPU      Service\n\
 Size    Size     Time         Okay Errors   Throughput   Util     Demand\n\
 bytes   bytes    secs            #      #   %s/sec %% %c%c     us/KB\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.2f %c\n";
-  
+
   char *cpu_fmt_1 = "\
 %6d  %6d   %-7.2f   %7d %6d    %7.1f     %-6.2f   %-6.3f\n\
 %6d           %-7.2f   %7d           %7.1f     %-6.2f   %-6.3f\n\n";
-  
+
   unsigned int	messages_recvd;
   unsigned int 	messages_sent;
   unsigned int	failed_sends;
 
-  float	elapsed_time,  
+  float	elapsed_time,
         recv_elapsed,
         local_cpu_utilization,
         remote_cpu_utilization;
-  
+
   float	 local_service_demand, remote_service_demand;
   double local_thruput, remote_thruput;
   double bytes_sent;
   double bytes_recvd;
-  
-  
+
+
   int	len;
   int	*message_int_ptr;
   struct ring_elt *send_ring;
   SOCKET data_socket;
-  
+
   unsigned int sum_messages_sent;
   unsigned int sum_messages_recvd;
   unsigned int sum_failed_sends;
@@ -2463,24 +2463,24 @@
   int	interval_count;
   sigset_t signal_set;
 #endif /* WANT_INTERVALS */
-  
+
   struct   hostent     *hp;
   struct   sockaddr_in server;
   unsigned int         addr;
-  
+
   struct t_unitdata unitdata;
-   
+
   struct xti_udp_stream_request_struct	*xti_udp_stream_request;
   struct xti_udp_stream_response_struct	*xti_udp_stream_response;
   struct xti_udp_stream_results_struct	*xti_udp_stream_results;
-  
-  xti_udp_stream_request  = 
+
+  xti_udp_stream_request  =
     (struct xti_udp_stream_request_struct *)netperf_request.content.test_specific_data;
-  xti_udp_stream_response = 
+  xti_udp_stream_response =
     (struct xti_udp_stream_response_struct *)netperf_response.content.test_specific_data;
-  xti_udp_stream_results  = 
+  xti_udp_stream_results  =
     (struct xti_udp_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
 #ifdef WANT_HISTOGRAM
   time_hist = HIST_new();
 #endif /* WANT_HISTOGRAM */
@@ -2489,13 +2489,13 @@
   /* control socket, and since we want to be able to use different */
   /* protocols and such, we are passed the name of the remote host and */
   /* must turn that into the test specific addressing information. */
-  
+
   bzero((char *)&server,
 	sizeof(server));
-  
+
   /* it would seem that while HP-UX will allow an IP address (as a */
   /* string) in a call to gethostbyname, other, less enlightened */
-  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */  
+  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */
   /* order changed to check for IP address first. raj 7/96 */
 
   if ((addr = inet_addr(remote_host)) == SOCKET_ERROR) {
@@ -2520,8 +2520,8 @@
     /* it was a valid IP address */
     server.sin_addr.s_addr = addr;
     server.sin_family = AF_INET;
-  }    
-  
+  }
+
   if ( print_headers ) {
     fprintf(where,"UDP UNIDIRECTIONAL SEND TEST");
     fprintf(where," to %s", remote_host);
@@ -2531,7 +2531,7 @@
 	      interval/0.02,
 	      confidence_level);
       }
-    if (loc_sndavoid || 
+    if (loc_sndavoid ||
 	loc_rcvavoid ||
 	rem_sndavoid ||
 	rem_rcvavoid) {
@@ -2543,12 +2543,12 @@
 #ifdef WANT_INTERVALS
     fprintf(where," : interval");
 #endif /* WANT_INTERVALS */
-#ifdef DIRTY 
+#ifdef DIRTY
     fprintf(where," : dirty data");
 #endif /* DIRTY */
     fprintf(where,"\n");
-  }	
-  
+  }
+
   send_ring            = NULL;
   confidence_iteration = 1;
   init_stat();
@@ -2566,17 +2566,17 @@
 
   while (((confidence < 0) && (confidence_iteration < iteration_max)) ||
 	 (confidence_iteration <= iteration_min)) {
-    
+
     /* initialize a few counters. we have to remember that we might be */
     /* going through the loop more than once. */
     messages_sent  = 0;
     messages_recvd = 0;
     failed_sends   = 0;
     times_up       = 0;
-    
+
     /*set up the data socket			*/
     data_socket = create_xti_endpoint(loc_xti_device);
-    
+
     if (data_socket == INVALID_SOCKET) {
       perror("send_xti_udp_stream: create_xti_endpoint");
       exit(1);
@@ -2596,36 +2596,36 @@
 	send_size = 4096;
       }
     }
-    
+
     /* set-up the data buffer with the requested alignment and offset, */
     /* most of the numbers here are just a hack to pick something nice */
     /* and big in an attempt to never try to send a buffer a second time */
     /* before it leaves the node...unless the user set the width */
     /* explicitly. */
     if (send_width == 0) send_width = 32;
-    
+
     if (send_ring == NULL ) {
       send_ring = allocate_buffer_ring(send_width,
 				       send_size,
 				       local_send_align,
 				       local_send_offset);
     }
-    
-    
+
+
     /* if the user supplied a cpu rate, this call will complete rather */
     /* quickly, otherwise, the cpu rate will be retured to us for */
     /* possible display. The Library will keep it's own copy of this data */
     /* for use elsewhere. We will only display it. (Does that make it */
     /* "opaque" to us?) */
-    
+
     if (local_cpu_usage)
       local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
-    
+
     /* Tell the remote end to set up the data connection. The server */
     /* sends back the port number and alters the socket parameters there. */
     /* Of course this is a datagram service so no connection is actually */
     /* set up, the server just sets up the socket and binds it. */
-    
+
     netperf_request.content.request_type      = DO_XTI_UDP_STREAM;
     xti_udp_stream_request->recv_buf_size  = rsr_size;
     xti_udp_stream_request->message_size   = send_size;
@@ -2636,11 +2636,11 @@
     xti_udp_stream_request->test_length    = test_time;
     xti_udp_stream_request->so_rcvavoid    = rem_rcvavoid;
     xti_udp_stream_request->so_sndavoid    = rem_sndavoid;
-    
+
     strcpy(xti_udp_stream_request->xti_device, rem_xti_device);
-  
+
 #ifdef __alpha
-  
+
     /* ok - even on a DEC box, strings are strings. I didn't really want */
     /* to ntohl the words of a string. since I don't want to teach the */
     /* send_ and recv_ _request and _response routines about the types, */
@@ -2651,23 +2651,23 @@
       int *charword;
       int *initword;
       int *lastword;
-      
+
       initword = (int *) xti_udp_stream_request->xti_device;
       lastword = initword + ((strlen(rem_xti_device) + 3) / 4);
-      
+
       for (charword = initword;
 	   charword < lastword;
 	   charword++) {
-	
+
 	*charword = ntohl(*charword);
       }
     }
 #endif /* __alpha */
 
     send_request();
-    
+
     recv_response();
-    
+
     if (!netperf_response.content.serv_errno) {
       if (debug)
 	fprintf(where,"send_xti_udp_stream: remote data connection done.\n");
@@ -2677,25 +2677,25 @@
       perror("send_xti_udp_stream: error on remote");
       exit(1);
     }
-    
+
     /* Place the port number returned by the remote into the sockaddr */
     /* structure so our sends can be sent to the correct place. Also get */
     /* some of the returned socket buffer information for user display. */
-    
+
     /* make sure that port numbers are in the proper order */
     server.sin_port = (short)xti_udp_stream_response->data_port_number;
     server.sin_port = htons(server.sin_port);
     rsr_size        = xti_udp_stream_response->recv_buf_size;
     rss_size        = xti_udp_stream_response->send_buf_size;
     remote_cpu_rate = xti_udp_stream_response->cpu_rate;
-    
+
     /* it would seem that XTI does not allow the expedient of */
     /* "connecting" a UDP end-point the way BSD does. so, we will do */
     /* everything with t_sndudata and t_rcvudata. Our "virtual" */
     /* connect here will be to assign the destination portion of the */
     /* t_unitdata struct here, where we would have otherwise called */
     /* t_connect() raj 3/95 */
-    
+
     memset (&unitdata, 0, sizeof(unitdata));
     unitdata.addr.maxlen = sizeof(struct sockaddr_in);
     unitdata.addr.len    = sizeof(struct sockaddr_in);
@@ -2720,7 +2720,7 @@
     /* test controlled by a byte count as well, but since UDP is not */
     /* reliable, that could prove difficult. so, in the meantime, we */
     /* only allow a XTI_UDP_STREAM test to be a timed test. */
-    
+
     if (test_time) {
       times_up = 0;
       start_timer(test_time);
@@ -2730,11 +2730,11 @@
       fflush(where);
       exit(1);
     }
-    
+
     /* Get the start count for the idle counter and the start time */
-    
+
     cpu_start(local_cpu_usage);
-    
+
 #ifdef WANT_INTERVALS
     if ((interval_burst) || (demo_mode)) {
       /* zero means that we never pause, so we never should need the */
@@ -2751,7 +2751,7 @@
       exit(1);
     }
 #endif /* WANT_INTERVALS */
-    
+
     /* Send datagrams like there was no tomorrow. at somepoint it might */
     /* be nice to set this up so that a quantity of bytes could be sent, */
     /* but we still need some sort of end of test trigger on the receive */
@@ -2760,7 +2760,7 @@
     /* then starts again, we would end the test too soon. something to */
     /* think about... */
     while (!times_up) {
-      
+
 #ifdef DIRTY
       /* we want to dirty some number of consecutive integers in the buffer */
       /* we are about to send. we may also want to bring some number of */
@@ -2773,11 +2773,11 @@
 		    loc_clean_count);
 
 #endif /* DIRTY */
-      
+
 #ifdef WANT_HISTOGRAM
       HIST_timestamp(&time_one);
 #endif /* WANT_HISTOGRAM */
-      
+
       if ((t_sndudata(data_socket,
 		      &unitdata))  != 0) {
 	if (errno == EINTR)
@@ -2790,20 +2790,20 @@
 	t_error("xti_udp_send: data send error");
 	exit(1);
       }
-      messages_sent++;          
-      
+      messages_sent++;
+
       /* now we want to move our pointer to the next position in the */
       /* data buffer...and update the unitdata structure */
-      
+
       send_ring          = send_ring->next;
       unitdata.udata.buf = send_ring->buffer_ptr;
-      
+
 #ifdef WANT_HISTOGRAM
       /* get the second timestamp */
       HIST_timestamp(&time_two);
       HIST_add(time_hist,delta_micro(&time_one,&time_two));
 #endif /* WANT_HISTOGRAM */
-#ifdef WANT_INTERVALS      
+#ifdef WANT_INTERVALS
       if (demo_mode) {
 	units_this_tick += send_size;
       }
@@ -2825,18 +2825,18 @@
 	interval_count = interval_burst;
       }
 #endif /* WANT_INTERVALS */
-      
+
     }
-    
+
     /* This is a timed test, so the remote will be returning to us after */
     /* a time. We should not need to send any "strange" messages to tell */
     /* the remote that the test is completed, unless we decide to add a */
     /* number of messages to the test. */
-    
+
     /* the test is over, so get stats and stuff */
-    cpu_stop(local_cpu_usage,	
+    cpu_stop(local_cpu_usage,
 	     &elapsed_time);
-    
+
     /* Get the statistics from the remote end	*/
     recv_response();
     if (!netperf_response.content.serv_errno) {
@@ -2848,19 +2848,19 @@
       perror("send_xti_udp_stream: error on remote");
       exit(1);
     }
-    
+
     bytes_sent    = (double) send_size * (double) messages_sent;
     local_thruput = calc_thruput(bytes_sent);
-    
+
     messages_recvd = xti_udp_stream_results->messages_recvd;
     bytes_recvd    = (double) send_size * (double) messages_recvd;
-    
+
     /* we asume that the remote ran for as long as we did */
-    
+
     remote_thruput = calc_thruput(bytes_recvd);
-    
+
     /* print the results for this socket and message size */
-    
+
     if (local_cpu_usage || remote_cpu_usage) {
       /* We must now do a little math for service demand and cpu */
       /* utilization for the system(s) We pass zeros for the local */
@@ -2880,7 +2880,7 @@
 	local_cpu_utilization	= -1.0;
 	local_service_demand	= -1.0;
       }
-      
+
       /* The local calculations could use variables being kept by */
       /* the local netlib routines. The remote calcuations need to */
       /* have a few things passed to them. */
@@ -2904,11 +2904,11 @@
       remote_cpu_utilization = -1.0;
       remote_service_demand  = -1.0;
     }
-    
+
     /* at this point, we want to calculate the confidence information. */
     /* if debugging is on, calculate_confidence will print-out the */
     /* parameters we pass it */
-    
+
     calculate_confidence(confidence_iteration,
 			 elapsed_time,
 			 remote_thruput,
@@ -2916,7 +2916,7 @@
 			 remote_cpu_utilization,
 			 local_service_demand,
 			 remote_service_demand);
-    
+
     /* since the routine calculate_confidence is rather generic, and */
     /* we have a few other parms of interest, we will do a little work */
     /* here to caclulate their average. */
@@ -2924,7 +2924,7 @@
     sum_messages_recvd += messages_recvd;
     sum_failed_sends   += failed_sends;
     sum_local_thruput  += local_thruput;
-    
+
     confidence_iteration++;
 
     /* this datapoint is done, so we don't need the socket any longer */
@@ -2956,8 +2956,8 @@
   /* of greater than 1, we will display a veritable plethora of */
   /* background information from outside of this block as it it */
   /* not cpu_measurement specific...  */
-    
-  
+
+
   if (confidence < 0) {
     /* we did not hit confidence, but were we asked to look for it? */
     if (iteration_max > 1) {
@@ -2968,7 +2968,7 @@
   if (local_cpu_usage || remote_cpu_usage) {
     local_cpu_method = format_cpu_method(cpu_method);
     remote_cpu_method = format_cpu_method(xti_udp_stream_results->cpu_method);
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -3073,26 +3073,26 @@
   int 	addrlen;
   unsigned int	bytes_received = 0;
   float	elapsed_time;
-  
+
   unsigned int	message_size;
   unsigned int	messages_recvd = 0;
-  
+
   struct xti_udp_stream_request_struct	*xti_udp_stream_request;
   struct xti_udp_stream_response_struct	*xti_udp_stream_response;
   struct xti_udp_stream_results_struct	*xti_udp_stream_results;
-  
-  xti_udp_stream_request  = 
+
+  xti_udp_stream_request  =
     (struct xti_udp_stream_request_struct *)netperf_request.content.test_specific_data;
-  xti_udp_stream_response = 
+  xti_udp_stream_response =
     (struct xti_udp_stream_response_struct *)netperf_response.content.test_specific_data;
-  xti_udp_stream_results  = 
+  xti_udp_stream_results  =
     (struct xti_udp_stream_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_xti_udp_stream: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -3100,27 +3100,27 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug > 1) {
     fprintf(where,"recv_xti_udp_stream: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = XTI_UDP_STREAM_RESPONSE;
-  
+
   if (debug > 2) {
     fprintf(where,"recv_xti_udp_stream: the response type is set...\n");
     fflush(where);
   }
-  
+
   /* We now alter the message_ptr variable to be at the desired */
   /* alignment with the desired offset. */
-  
+
   if (debug > 1) {
     fprintf(where,"recv_xti_udp_stream: requested alignment of %d\n",
 	    xti_udp_stream_request->recv_alignment);
@@ -3138,20 +3138,20 @@
     fprintf(where,"recv_xti_udp_stream: receive alignment and offset set...\n");
     fflush(where);
   }
-  
+
   /* Let's clear-out our sockaddr for the sake of cleanlines. Then we */
   /* can put in OUR values !-) At some point, we may want to nail this */
   /* socket to a particular network-level address, but for now, */
   /* INADDR_ANY should be just fine. */
-  
+
   bzero((char *)&myaddr_in,
 	sizeof(myaddr_in));
   myaddr_in.sin_family      = AF_INET;
   myaddr_in.sin_addr.s_addr = INADDR_ANY;
   myaddr_in.sin_port        = 0;
-  
+
   /* Grab a socket to listen on, and then listen on it. */
-  
+
   if (debug > 1) {
     fprintf(where,"recv_xti_udp_stream: grabbing a socket...\n");
     fflush(where);
@@ -3166,7 +3166,7 @@
   loc_sndavoid = xti_udp_stream_request->so_sndavoid;
 
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -3177,28 +3177,28 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) xti_udp_stream_request->xti_device;
     lastword = initword + ((xti_udp_stream_request->dev_name_len + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = htonl(*charword);
     }
   }
-  
+
 #endif /* __alpha */
-    
+
   s_data = create_xti_endpoint(xti_udp_stream_request->xti_device);
-  
+
   if (s_data == INVALID_SOCKET) {
     netperf_response.content.serv_errno = errno;
     send_response();
     exit(1);
   }
-  
+
   /* Let's get an address assigned to this socket so we can tell the */
   /* initiator how to reach the data socket. There may be a desire to */
   /* nail this socket to a specific IP address in a multi-homed, */
@@ -3220,27 +3220,27 @@
 	     &bind_resp) == SOCKET_ERROR) {
     netperf_response.content.serv_errno = t_errno;
     send_response();
-    
+
     exit(1);
   }
-  
-  xti_udp_stream_response->test_length = 
+
+  xti_udp_stream_response->test_length =
     xti_udp_stream_request->test_length;
-  
+
   /* Now myaddr_in contains the port and the internet address this is */
   /* returned to the sender also implicitly telling the sender that the */
   /* socket buffer sizing has been done. */
-  
-  xti_udp_stream_response->data_port_number = 
+
+  xti_udp_stream_response->data_port_number =
     (int) ntohs(myaddr_in.sin_port);
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a -1 to */
   /* the initiator. */
-  
+
   xti_udp_stream_response->cpu_rate    = 0.0; /* assume no cpu */
   xti_udp_stream_response->measure_cpu = 0;
   if (xti_udp_stream_request->measure_cpu) {
@@ -3249,13 +3249,13 @@
     /* "real" calibration. Otherwise, all it will really do is */
     /* store it away... */
     xti_udp_stream_response->measure_cpu = 1;
-    xti_udp_stream_response->cpu_rate = 
+    xti_udp_stream_response->cpu_rate =
       calibrate_local_cpu(xti_udp_stream_request->cpu_rate);
   }
-  
+
   message_size	= xti_udp_stream_request->message_size;
   test_time	= xti_udp_stream_request->test_length;
-  
+
   /* before we send the response back to the initiator, pull some of */
   /* the socket parms from the globals */
   xti_udp_stream_response->send_buf_size = lss_size;
@@ -3279,23 +3279,23 @@
   unitdata.udata.buf    = recv_ring->buffer_ptr;
 
   send_response();
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(xti_udp_stream_request->measure_cpu);
-  
+
   /* The loop will exit when the timer pops, or if we happen to recv a */
   /* message of less than send_size bytes... */
-  
+
   times_up = 0;
   start_timer(test_time + PAD_TIME);
-  
+
   if (debug) {
     fprintf(where,"recv_xti_udp_stream: about to enter inner sanctum.\n");
     fflush(where);
   }
-  
+
   while (!times_up) {
 #ifdef RAJ_DEBUG
     if (debug) {
@@ -3318,7 +3318,7 @@
       fflush(where);
     }
 #endif /* RAJ_DEBUG */
-    if (t_rcvudata(s_data, 
+    if (t_rcvudata(s_data,
 		   &unitdata,
 		   &flags) != 0) {
       if (errno == TNODATA) {
@@ -3335,17 +3335,17 @@
     recv_ring = recv_ring->next;
     unitdata.udata.buf = recv_ring->buffer_ptr;
   }
-  
+
   if (debug) {
     fprintf(where,"recv_xti_udp_stream: got %d messages.\n",messages_recvd);
     fflush(where);
   }
-  
-  
+
+
   /* The loop now exits due timer or < send_size bytes received. */
-  
+
   cpu_stop(xti_udp_stream_request->measure_cpu,&elapsed_time);
-  
+
   if (times_up) {
     /* we ended on a timer, subtract the PAD_TIME */
     elapsed_time -= (float)PAD_TIME;
@@ -3353,23 +3353,23 @@
   else {
     stop_timer();
   }
-  
+
   if (debug) {
     fprintf(where,"recv_xti_udp_stream: test ended in %f seconds.\n",elapsed_time);
     fflush(where);
   }
-  
+
   bytes_received = (messages_recvd * message_size);
-  
+
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_udp_stream: got %d bytes\n",
 	    bytes_received);
     fflush(where);
   }
-  
+
   netperf_response.content.response_type	= XTI_UDP_STREAM_RESULTS;
   xti_udp_stream_results->bytes_received	= bytes_received;
   xti_udp_stream_results->messages_recvd	= messages_recvd;
@@ -3381,58 +3381,58 @@
   else {
     xti_udp_stream_results->cpu_util	= -1.0;
   }
-  
+
   if (debug > 1) {
     fprintf(where,
 	    "recv_xti_udp_stream: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   send_response();
-  
+
 }
 
 void send_xti_udp_rr(char remote_host[])
 {
-  
+
   char *tput_title = "\
 Local /Remote\n\
 Socket Size   Request  Resp.   Elapsed  Trans.\n\
 Send   Recv   Size     Size    Time     Rate         \n\
 bytes  Bytes  bytes    bytes   secs.    per sec   \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1_line_1 = "\
 %-6d %-6d %-6d   %-6d  %-6.2f   %7.2f   \n";
   char *tput_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *cpu_title = "\
 Local /Remote\n\
 Socket Size   Request Resp.  Elapsed Trans.   CPU    CPU    S.dem   S.dem\n\
 Send   Recv   Size    Size   Time    Rate     local  remote local   remote\n\
 bytes  bytes  bytes   bytes  secs.   per sec  %% %c    %% %c    us/Tr   us/Tr\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f %c\n";
-  
+
   char *cpu_fmt_1_line_1 = "\
 %-6d %-6d %-6d  %-6d %-6.2f  %-6.2f   %-6.2f %-6.2f %-6.3f  %-6.3f\n";
-  
+
   char *cpu_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *ksink_fmt = "\
 Alignment      Offset\n\
 Local  Remote  Local  Remote\n\
 Send   Recv    Send   Recv\n\
 %5d  %5d   %5d  %5d\n";
-  
-  
+
+
   float			elapsed_time;
-  
+
   struct ring_elt *send_ring;
   struct ring_elt *recv_ring;
 
@@ -3447,20 +3447,20 @@
   SOCKET send_socket;
   int	trans_remaining;
   int	bytes_xferd;
-  
+
   int	rsp_bytes_recvd;
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
   double thruput;
-  
+
   struct	hostent	        *hp;
   struct	sockaddr_in	server, myaddr_in;
   unsigned      int             addr;
   int	                        addrlen;
-  
+
   struct	xti_udp_rr_request_struct	*xti_udp_rr_request;
   struct	xti_udp_rr_response_struct	*xti_udp_rr_response;
   struct	xti_udp_rr_results_struct	*xti_udp_rr_result;
@@ -3469,29 +3469,29 @@
   int	interval_count;
   sigset_t signal_set;
 #endif /* WANT_INTERVALS */
-  
+
   xti_udp_rr_request  =
     (struct xti_udp_rr_request_struct *)netperf_request.content.test_specific_data;
   xti_udp_rr_response =
     (struct xti_udp_rr_response_struct *)netperf_response.content.test_specific_data;
   xti_udp_rr_result	 =
     (struct xti_udp_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
 #ifdef WANT_HISTOGRAM
   time_hist = HIST_new();
 #endif
-  
+
   /* since we are now disconnected from the code that established the */
   /* control socket, and since we want to be able to use different */
   /* protocols and such, we are passed the name of the remote host and */
   /* must turn that into the test specific addressing information. */
-  
+
   bzero((char *)&server,
 	sizeof(server));
-  
+
   /* it would seem that while HP-UX will allow an IP address (as a */
   /* string) in a call to gethostbyname, other, less enlightened */
-  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */  
+  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */
   /* order changed to check for IP address first. raj 7/96 */
 
   if ((addr = inet_addr(remote_host)) == SOCKET_ERROR) {
@@ -3516,8 +3516,8 @@
     /* it was a valid IP address */
     server.sin_addr.s_addr = addr;
     server.sin_family = AF_INET;
-  }    
-  
+  }
+
   if ( print_headers ) {
     fprintf(where,"XTI UDP REQUEST/RESPONSE TEST");
         fprintf(where," to %s", remote_host);
@@ -3527,7 +3527,7 @@
 	      interval/0.02,
 	      confidence_level);
       }
-    if (loc_sndavoid || 
+    if (loc_sndavoid ||
 	loc_rcvavoid ||
 	rem_sndavoid ||
 	rem_rcvavoid) {
@@ -3539,14 +3539,14 @@
 #ifdef WANT_INTERVALS
     fprintf(where," : interval");
 #endif /* WANT_INTERVALS */
-#ifdef DIRTY 
+#ifdef DIRTY
     fprintf(where," : dirty data");
 #endif /* DIRTY */
     fprintf(where,"\n");
   }
-  
+
   /* initialize a few counters */
-  
+
   send_ring     = NULL;
   recv_ring     = NULL;
   nummessages	= 0;
@@ -3565,31 +3565,31 @@
 
   while (((confidence < 0) && (confidence_iteration < iteration_max)) ||
 	 (confidence_iteration <= iteration_min)) {
-    
+
     nummessages     = 0;
     bytes_xferd     = 0.0;
     times_up        = 0;
     trans_remaining = 0;
-    
+
     /* set-up the data buffers with the requested alignment and offset */
-    
+
     if (send_width == 0) send_width = 1;
     if (recv_width == 0) recv_width = 1;
-    
+
     if (send_ring == NULL) {
       send_ring = allocate_buffer_ring(send_width,
 				       req_size,
 				       local_send_align,
 				       local_send_offset);
     }
-    
+
     if (recv_ring == NULL) {
       recv_ring = allocate_buffer_ring(recv_width,
 				       rsp_size,
 				       local_recv_align,
 				       local_recv_offset);
     }
-    
+
   /* since we are going to call t_rcvudata() instead of t_rcv() we */
   /* need to init the unitdata structure raj 8/95 */
 
@@ -3597,43 +3597,43 @@
     recv_unitdata.addr.maxlen = sizeof(struct sockaddr_in);
     recv_unitdata.addr.len    = sizeof(struct sockaddr_in);
     recv_unitdata.addr.buf    = (char *)&server;
-    
+
     recv_unitdata.opt.maxlen = 0;
     recv_unitdata.opt.len    = 0;
     recv_unitdata.opt.buf    = NULL;
-    
+
     recv_unitdata.udata.maxlen = rsp_size;
     recv_unitdata.udata.len    = rsp_size;
     recv_unitdata.udata.buf    = recv_ring->buffer_ptr;
-    
+
     /* since we are going to call t_sndudata() instead of t_snd() we */
     /* need to init the unitdata structure raj 8/95 */
-    
+
     memset (&send_unitdata, 0, sizeof(send_unitdata));
     send_unitdata.addr.maxlen = sizeof(struct sockaddr_in);
     send_unitdata.addr.len    = sizeof(struct sockaddr_in);
     send_unitdata.addr.buf    = (char *)&server;
-    
+
     send_unitdata.opt.maxlen = 0;
     send_unitdata.opt.len    = 0;
     send_unitdata.opt.buf    = NULL;
-    
+
     send_unitdata.udata.maxlen = req_size;
     send_unitdata.udata.len    = req_size;
     send_unitdata.udata.buf    = send_ring->buffer_ptr;
 
     /*set up the data socket                        */
     send_socket = create_xti_endpoint(loc_xti_device);
-    
+
     if (send_socket == INVALID_SOCKET){
       perror("netperf: send_xti_udp_rr: udp rr data socket");
       exit(1);
     }
-    
+
     if (debug) {
       fprintf(where,"send_xti_udp_rr: send_socket obtained...\n");
     }
-    
+
     /* it would seem that with XTI, there is no implicit bind  */
     /* so we have to make a call to t_bind. this is not */
     /* terribly convenient, but I suppose that "standard is better */
@@ -3652,11 +3652,11 @@
     /* all the "normal" calibration stuff and return the rate back. If */
     /* there is no idle counter in the kernel idle loop, the */
     /* local_cpu_rate will be set to -1. */
-    
+
     if (local_cpu_usage) {
       local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
     }
-    
+
     /* Tell the remote end to do a listen. The server alters the socket */
     /* paramters on the other side at this point, hence the reason for */
     /* all the values being passed in the setup message. If the user did */
@@ -3664,7 +3664,7 @@
     /* will indicate to the remote that no changes beyond the system's */
     /* default should be used. Alignment is the exception, it will */
     /* default to 8, which will be no alignment alterations. */
-    
+
     netperf_request.content.request_type	= DO_XTI_UDP_RR;
     xti_udp_rr_request->recv_buf_size	= rsr_size;
     xti_udp_rr_request->send_buf_size	= rss_size;
@@ -3684,11 +3684,11 @@
     else {
       xti_udp_rr_request->test_length	= test_trans * -1;
     }
-    
+
     strcpy(xti_udp_rr_request->xti_device, rem_xti_device);
-  
+
 #ifdef __alpha
-  
+
     /* ok - even on a DEC box, strings are strings. I didn't really want */
     /* to ntohl the words of a string. since I don't want to teach the */
     /* send_ and recv_ _request and _response routines about the types, */
@@ -3699,14 +3699,14 @@
       int *charword;
       int *initword;
       int *lastword;
-      
+
       initword = (int *) xti_udp_rr_request->xti_device;
       lastword = initword + ((strlen(rem_xti_device) + 3) / 4);
-      
+
       for (charword = initword;
 	   charword < lastword;
 	   charword++) {
-	
+
 	*charword = ntohl(*charword);
       }
     }
@@ -3715,9 +3715,9 @@
     if (debug > 1) {
       fprintf(where,"netperf: send_xti_udp_rr: requesting UDP r/r test\n");
     }
-    
+
     send_request();
-    
+
     /* The response from the remote will contain all of the relevant 	*/
     /* socket parameters for this test type. We will put them back into */
     /* the variables here so they can be displayed if desired.  The	*/
@@ -3727,9 +3727,9 @@
     /* after the connect returns. The remote will grab the counter right*/
     /* after the accept call. This saves the hassle of extra messages	*/
     /* being sent for the UDP tests.					*/
-    
+
     recv_response();
-    
+
     if (!netperf_response.content.serv_errno) {
       if (debug)
 	fprintf(where,"remote listen done.\n");
@@ -3744,19 +3744,19 @@
     else {
       Set_errno(netperf_response.content.serv_errno);
       perror("netperf: remote error");
-      
+
       exit(1);
     }
-    
+
     /* Data Socket set-up is finished. If there were problems, either the */
     /* connect would have failed, or the previous response would have */
     /* indicated a problem. I failed to see the value of the extra */
     /* message after the accept on the remote. If it failed, we'll see it */
     /* here. If it didn't, we might as well start pumping data. */
-    
+
     /* Set-up the test end conditions. For a request/response test, they */
     /* can be either time or transaction based. */
-    
+
     if (test_time) {
       /* The user wanted to end the test after a period of time. */
       times_up = 0;
@@ -3768,11 +3768,11 @@
       trans_remaining = test_bytes;
       times_up = 1;
     }
-    
+
     /* The cpu_start routine will grab the current time and possibly */
     /* value of the idle counter for later use in measuring cpu */
     /* utilization and/or service demand and thruput. */
-    
+
     cpu_start(local_cpu_usage);
 
 #ifdef WANT_INTERVALS
@@ -3791,7 +3791,7 @@
       exit(1);
     }
 #endif /* WANT_INTERVALS */
-    
+
     /* We use an "OR" to control test execution. When the test is */
     /* controlled by time, the byte count check will always return */
     /* false. When the test is controlled by byte count, the time test */
@@ -3823,9 +3823,9 @@
 	exit(1);
       }
       send_ring = send_ring->next;
-      
+
       /* receive the response. with UDP we will get it all, or nothing */
-      
+
       if((t_rcvudata(send_socket,
 		     &recv_unitdata,
 		     &flags)) != 0) {
@@ -3857,18 +3857,18 @@
 	exit(1);
       }
       recv_ring = recv_ring->next;
-      
+
 #ifdef WANT_HISTOGRAM
       HIST_timestamp(&time_two);
       HIST_add(time_hist,delta_micro(&time_one,&time_two));
-      
+
       /* at this point, we may wish to sleep for some period of */
       /* time, so we see how long that last transaction just took, */
       /* and sleep for the difference of that and the interval. We */
       /* will not sleep if the time would be less than a */
       /* millisecond.  */
 #endif
-#ifdef WANT_INTERVALS      
+#ifdef WANT_INTERVALS
       if (demo_mode) {
 	units_this_tick += 1;
       }
@@ -3890,32 +3890,32 @@
 	interval_count = interval_burst;
       }
 #endif /* WANT_INTERVALS */
-      
-      nummessages++;          
+
+      nummessages++;
       if (trans_remaining) {
 	trans_remaining--;
       }
-      
+
       if (debug > 3) {
 	if ((nummessages % 100) == 0) {
 	  fprintf(where,"Transaction %d completed\n",nummessages);
 	  fflush(where);
 	}
       }
-      
+
     }
-    
+
     /* this call will always give us the elapsed time for the test, and */
     /* will also store-away the necessaries for cpu utilization */
-    
+
     cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being */
 						/* measured? how long */
 						/* did we really run? */
-    
+
     /* Get the statistics from the remote end. The remote will have */
     /* calculated service demand and all those interesting things. If */
     /* it wasn't supposed to care, it will return obvious values. */
-    
+
     recv_response();
     if (!netperf_response.content.serv_errno) {
       if (debug)
@@ -3924,20 +3924,20 @@
     else {
       Set_errno(netperf_response.content.serv_errno);
       perror("netperf: remote error");
-      
+
       exit(1);
     }
-    
+
     /* We now calculate what our thruput was for the test. In the */
     /* future, we may want to include a calculation of the thruput */
     /* measured by the remote, but it should be the case that for a */
     /* UDP rr test, that the two numbers should be *very* close... */
     /* We calculate bytes_sent regardless of the way the test length */
     /* was controlled.  */
-    
+
     bytes_xferd	= (req_size * nummessages) + (rsp_size * nummessages);
     thruput	= nummessages / elapsed_time;
-    
+
     if (local_cpu_usage || remote_cpu_usage) {
 
       /* We must now do a little math for service demand and cpu */
@@ -3949,11 +3949,11 @@
 
       if (local_cpu_usage) {
 	local_cpu_utilization = calc_cpu_util(0.0);
-	
+
 	/* since calc_service demand is doing ms/Kunit we will */
 	/* multiply the number of transaction by 1024 to get */
 	/* "good" numbers */
-	
+
 	local_service_demand  = calc_service_demand((double) nummessages*1024,
 						    0.0,
 						    0.0,
@@ -3963,14 +3963,14 @@
 	local_cpu_utilization	= -1.0;
 	local_service_demand	= -1.0;
       }
-      
+
       if (remote_cpu_usage) {
 	remote_cpu_utilization = xti_udp_rr_result->cpu_util;
-	
+
 	/* since calc_service demand is doing ms/Kunit we will */
 	/* multiply the number of transaction by 1024 to get */
 	/* "good" numbers */
-	
+
 	remote_service_demand  = calc_service_demand((double) nummessages*1024,
 						     0.0,
 						     remote_cpu_utilization,
@@ -3989,11 +3989,11 @@
       remote_cpu_utilization = -1.0;
       remote_service_demand  = -1.0;
     }
-    
+
     /* at this point, we want to calculate the confidence information. */
     /* if debugging is on, calculate_confidence will print-out the */
     /* parameters we pass it */
-    
+
     calculate_confidence(confidence_iteration,
 			 elapsed_time,
 			 thruput,
@@ -4001,10 +4001,10 @@
 			 remote_cpu_utilization,
 			 local_service_demand,
 			 remote_service_demand);
-    
-    
+
+
     confidence_iteration++;
-    
+
     /* we are done with the socket */
     t_close(send_socket);
   }
@@ -4017,7 +4017,7 @@
 			    &remote_cpu_utilization,
 			    &local_service_demand,
 			    &remote_service_demand);
-  
+
   /* We are now ready to print all the information. If the user */
   /* has specified zero-level verbosity, we will just print the */
   /* local service demand, or the remote service demand. If the */
@@ -4026,18 +4026,18 @@
   /* of greater than 1, we will display a veritable plethora of */
   /* background information from outside of this block as it it */
   /* not cpu_measurement specific...  */
-  
+
   if (confidence < 0) {
     /* we did not hit confidence, but were we asked to look for it? */
     if (iteration_max > 1) {
       display_confidence();
     }
   }
-  
+
   if (local_cpu_usage || remote_cpu_usage) {
     local_cpu_method = format_cpu_method(cpu_method);
     remote_cpu_method = format_cpu_method(xti_udp_rr_result->cpu_method);
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -4061,7 +4061,7 @@
 		local_cpu_method,
 		remote_cpu_method);
       }
-    
+
       fprintf(where,
 	      cpu_fmt_1_line_1,		/* the format string */
 	      lss_size,		/* local sendbuf size */
@@ -4094,7 +4094,7 @@
       if (print_headers) {
 	fprintf(where,tput_title,format_units());
       }
-    
+
       fprintf(where,
 	      tput_fmt_1_line_1,	/* the format string */
 	      lss_size,
@@ -4107,7 +4107,7 @@
 	      tput_fmt_1_line_2,
 	      rss_size, 		/* remote recvbuf size */
 	      rsr_size);
-      
+
       break;
     }
   }
@@ -4118,7 +4118,7 @@
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   /* how to handle the verbose information in the presence of */
   /* confidence intervals is yet to be determined... raj 11/94 */
 
@@ -4127,7 +4127,7 @@
     /* This information will include as much as we can find about */
     /* UDP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-    
+
 #ifdef WANT_HISTOGRAM
     fprintf(where,"\nHistogram of request/reponse times.\n");
     fflush(where);
@@ -4138,10 +4138,10 @@
 
  /* this routine implements the receive side (netserver) of a XTI_UDP_RR */
  /* test. */
-void 
+void
   recv_xti_udp_rr()
 {
-  
+
   struct ring_elt *recv_ring;
   struct ring_elt *send_ring;
 
@@ -4156,12 +4156,12 @@
   int	trans_received;
   int	trans_remaining;
   float	elapsed_time;
-  
+
   struct	xti_udp_rr_request_struct	*xti_udp_rr_request;
   struct	xti_udp_rr_response_struct	*xti_udp_rr_response;
   struct	xti_udp_rr_results_struct	*xti_udp_rr_results;
-  
-  
+
+
   /* a little variable initialization */
   memset (&myaddr_in, 0, sizeof(struct sockaddr_in));
   myaddr_in.sin_family      = AF_INET;
@@ -4170,18 +4170,18 @@
   memset (&peeraddr_in, 0, sizeof(struct sockaddr_in));
 
   /* and some not so paranoid :) */
-  xti_udp_rr_request  = 
+  xti_udp_rr_request  =
     (struct xti_udp_rr_request_struct *)netperf_request.content.test_specific_data;
-  xti_udp_rr_response = 
+  xti_udp_rr_response =
     (struct xti_udp_rr_response_struct *)netperf_response.content.test_specific_data;
-  xti_udp_rr_results  = 
+  xti_udp_rr_results  =
     (struct xti_udp_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_xti_udp_rr: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -4189,27 +4189,27 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_udp_rr: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = XTI_UDP_RR_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_xti_udp_rr: the response type is set...\n");
     fflush(where);
   }
-  
+
   /* We now alter the message_ptr variables to be at the desired */
   /* alignments with the desired offsets. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_udp_rr: requested recv alignment of %d offset %d\n",
 	    xti_udp_rr_request->recv_alignment,
@@ -4237,7 +4237,7 @@
     fprintf(where,"recv_xti_udp_rr: receive alignment and offset set...\n");
     fflush(where);
   }
-  
+
   /* create_xti_endpoint expects to find some things in the global */
   /* variables, so set the globals based on the values in the request. */
   /* once the socket has been created, we will set the response values */
@@ -4248,7 +4248,7 @@
   loc_sndavoid = xti_udp_rr_request->so_sndavoid;
 
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -4259,22 +4259,22 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) xti_udp_rr_request->xti_device;
     lastword = initword + ((xti_udp_rr_request->dev_name_len + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = htonl(*charword);
     }
   }
-  
+
 #endif /* __alpha */
-    
+
   s_data = create_xti_endpoint(xti_udp_rr_request->xti_device);
-  
+
   if (s_data == INVALID_SOCKET) {
     netperf_response.content.serv_errno = errno;
     send_response();
@@ -4285,7 +4285,7 @@
     fprintf(where,"recv_xti_udp_rr: endpoint created...\n");
     fflush(where);
   }
-  
+
   /* Let's get an address assigned to this socket so we can tell the */
   /* initiator how to reach the data socket. There may be a desire to */
   /* nail this socket to a specific IP address in a multi-homed, */
@@ -4315,7 +4315,7 @@
 
     netperf_response.content.serv_errno = t_errno;
     send_response();
-    
+
     exit(1);
   }
 
@@ -4326,41 +4326,41 @@
     fflush(where);
   }
 
-  xti_udp_rr_response->test_length = 
+  xti_udp_rr_response->test_length =
     xti_udp_rr_request->test_length;
 
-  
+
   /* Now myaddr_in contains the port and the internet address this is */
   /* returned to the sender also implicitly telling the sender that the */
   /* socket buffer sizing has been done. */
-  
+
   xti_udp_rr_response->data_port_number = (int) ntohs(myaddr_in.sin_port);
   netperf_response.content.serv_errno   = 0;
-  
+
   fprintf(where,"recv port number %d\n",myaddr_in.sin_port);
   fflush(where);
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a 0.0 to */
   /* the initiator. */
-  
+
   xti_udp_rr_response->cpu_rate    = 0.0; 	/* assume no cpu */
   xti_udp_rr_response->measure_cpu = 0;
   if (xti_udp_rr_request->measure_cpu) {
     xti_udp_rr_response->measure_cpu = 1;
-    xti_udp_rr_response->cpu_rate = 
+    xti_udp_rr_response->cpu_rate =
       calibrate_local_cpu(xti_udp_rr_request->cpu_rate);
   }
-   
+
   /* before we send the response back to the initiator, pull some of */
   /* the socket parms from the globals */
   xti_udp_rr_response->send_buf_size = lss_size;
   xti_udp_rr_response->recv_buf_size = lsr_size;
   xti_udp_rr_response->so_rcvavoid   = loc_rcvavoid;
   xti_udp_rr_response->so_sndavoid   = loc_sndavoid;
- 
+
   /* since we are going to call t_rcvudata() instead of t_rcv() we */
   /* need to init the unitdata structure raj 3/95 */
 
@@ -4394,13 +4394,13 @@
   send_unitdata.udata.buf    = send_ring->buffer_ptr;
 
   send_response();
-  
-  
+
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(xti_udp_rr_request->measure_cpu);
-  
+
   if (xti_udp_rr_request->test_length > 0) {
     times_up = 0;
     trans_remaining = 0;
@@ -4410,14 +4410,14 @@
     times_up = 1;
     trans_remaining = xti_udp_rr_request->test_length * -1;
   }
-  
+
   addrlen = sizeof(peeraddr_in);
   bzero((char *)&peeraddr_in, addrlen);
-  
+
   trans_received = 0;
 
   while ((!times_up) || (trans_remaining > 0)) {
-    
+
     /* receive the request from the other side */
     if (t_rcvudata(s_data,
 		   &recv_unitdata,
@@ -4463,27 +4463,27 @@
     }
     send_ring = send_ring->next;
     send_unitdata.udata.buf = send_ring->buffer_ptr;
-    
+
     trans_received++;
     if (trans_remaining) {
       trans_remaining--;
     }
-    
+
     if (debug) {
       fprintf(where,
 	      "recv_xti_udp_rr: Transaction %d complete.\n",
 	      trans_received);
       fflush(where);
     }
-    
+
   }
-  
-  
+
+
   /* The loop now exits due to timeout or transaction count being */
   /* reached */
-  
+
   cpu_stop(xti_udp_rr_request->measure_cpu,&elapsed_time);
-  
+
   if (times_up) {
     /* we ended the test by time, which was at least 2 seconds */
     /* longer than we wanted to run. so, we want to subtract */
@@ -4491,16 +4491,16 @@
     elapsed_time -= PAD_TIME;
   }
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_udp_rr: got %d transactions\n",
 	    trans_received);
     fflush(where);
   }
-  
-  xti_udp_rr_results->bytes_received = (trans_received * 
-				    (xti_udp_rr_request->request_size + 
+
+  xti_udp_rr_results->bytes_received = (trans_received *
+				    (xti_udp_rr_request->request_size +
 				     xti_udp_rr_request->response_size));
   xti_udp_rr_results->trans_received = trans_received;
   xti_udp_rr_results->elapsed_time	 = elapsed_time;
@@ -4508,13 +4508,13 @@
   if (xti_udp_rr_request->measure_cpu) {
     xti_udp_rr_results->cpu_util	= calc_cpu_util(elapsed_time);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_udp_rr: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   send_response();
 
   /* we are done with the socket now */
@@ -4524,10 +4524,10 @@
 
  /* this routine implements the receive (netserver) side of a XTI_TCP_RR */
  /* test */
-void 
+void
 recv_xti_tcp_rr()
 {
-  
+
   struct ring_elt *send_ring;
   struct ring_elt *recv_ring;
 
@@ -4545,23 +4545,23 @@
   int	request_bytes_remaining;
   int	timed_out = 0;
   float	elapsed_time;
-  
+
   struct	xti_tcp_rr_request_struct	*xti_tcp_rr_request;
   struct	xti_tcp_rr_response_struct	*xti_tcp_rr_response;
   struct	xti_tcp_rr_results_struct	*xti_tcp_rr_results;
-  
-  xti_tcp_rr_request = 
+
+  xti_tcp_rr_request =
     (struct xti_tcp_rr_request_struct *)netperf_request.content.test_specific_data;
   xti_tcp_rr_response =
     (struct xti_tcp_rr_response_struct *)netperf_response.content.test_specific_data;
   xti_tcp_rr_results =
     (struct xti_tcp_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_xti_tcp_rr: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -4569,24 +4569,24 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_rr: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = XTI_TCP_RR_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_rr: the response type is set...\n");
     fflush(where);
   }
-  
+
   /* allocate the recv and send rings with the requested alignments */
   /* and offsets. raj 7/94 */
   if (debug) {
@@ -4613,20 +4613,20 @@
 				   xti_tcp_rr_request->recv_alignment,
 				   xti_tcp_rr_request->recv_offset);
 
-  
+
   /* Let's clear-out our sockaddr for the sake of cleanlines. Then we */
   /* can put in OUR values !-) At some point, we may want to nail this */
   /* socket to a particular network-level address, but for now, */
   /* INADDR_ANY should be just fine. */
-  
+
   bzero((char *)&myaddr_in,
 	sizeof(myaddr_in));
   myaddr_in.sin_family      = AF_INET;
   myaddr_in.sin_addr.s_addr = INADDR_ANY;
   myaddr_in.sin_port        = 0;
-  
+
   /* Grab a socket to listen on, and then listen on it. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_rr: grabbing a socket...\n");
     fflush(where);
@@ -4641,9 +4641,9 @@
   loc_nodelay = xti_tcp_rr_request->no_delay;
   loc_rcvavoid = xti_tcp_rr_request->so_rcvavoid;
   loc_sndavoid = xti_tcp_rr_request->so_sndavoid;
-  
+
 #ifdef __alpha
-  
+
   /* ok - even on a DEC box, strings are strings. I din't really want */
   /* to ntohl the words of a string. since I don't want to teach the */
   /* send_ and recv_ _request and _response routines about the types, */
@@ -4654,29 +4654,29 @@
     int *charword;
     int *initword;
     int *lastword;
-    
+
     initword = (int *) xti_tcp_rr_request->xti_device;
     lastword = initword + ((xti_tcp_rr_request->dev_name_len + 3) / 4);
-    
+
     for (charword = initword;
 	 charword < lastword;
 	 charword++) {
-      
+
       *charword = htonl(*charword);
     }
   }
-  
+
 #endif /* __alpha */
 
   s_listen = create_xti_endpoint(xti_tcp_rr_request->xti_device);
-  
+
   if (s_listen == INVALID_SOCKET) {
     netperf_response.content.serv_errno = errno;
     send_response();
-    
+
     exit(1);
   }
-  
+
   /* Let's get an address assigned to this socket so we can tell the */
   /* initiator how to reach the data socket. There may be a desire to */
   /* nail this socket to a specific IP address in a multi-homed, */
@@ -4699,7 +4699,7 @@
     netperf_response.content.serv_errno = t_errno;
     close(s_listen);
     send_response();
-    
+
     exit(1);
   }
 
@@ -4709,20 +4709,20 @@
 	    ntohs(myaddr_in.sin_port));
     fflush(where);
   }
-  
+
   /* Now myaddr_in contains the port and the internet address this is */
   /* returned to the sender also implicitly telling the sender that the */
   /* socket buffer sizing has been done. */
-  
+
   xti_tcp_rr_response->data_port_number = (int) ntohs(myaddr_in.sin_port);
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a 0.0 to */
   /* the initiator. */
-  
+
   xti_tcp_rr_response->cpu_rate = 0.0; 	/* assume no cpu */
   xti_tcp_rr_response->measure_cpu = 0;
 
@@ -4730,8 +4730,8 @@
     xti_tcp_rr_response->measure_cpu = 1;
     xti_tcp_rr_response->cpu_rate = calibrate_local_cpu(xti_tcp_rr_request->cpu_rate);
   }
-  
-  
+
+
   /* before we send the response back to the initiator, pull some of */
   /* the socket parms from the globals */
   xti_tcp_rr_response->send_buf_size = lss_size;
@@ -4741,7 +4741,7 @@
   xti_tcp_rr_response->so_sndavoid = loc_sndavoid;
   xti_tcp_rr_response->test_length = xti_tcp_rr_request->test_length;
   send_response();
-  
+
   /* Now, let's set-up the socket to listen for connections. for xti, */
   /* the t_listen call is blocking by default - this is different */
   /* semantics from BSD - probably has to do with being able to reject */
@@ -4767,14 +4767,14 @@
     send_response();
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_rr: t_listen complete t_look 0x%.4x\n",
 	    t_look(s_listen));
     fflush(where);
   }
-  
+
   /* now just rubber stamp the thing. we want to use the same fd? so */
   /* we will just equate s_data with s_listen. this seems a little */
   /* hokey to me, but then I'm a BSD biggot still. raj 2/95 */
@@ -4790,7 +4790,7 @@
     close(s_listen);
     exit(1);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_rr: t_accept complete t_look 0x%.4x",
@@ -4801,12 +4801,12 @@
 	    ntohs(peeraddr_in.sin_port));
     fflush(where);
   }
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(xti_tcp_rr_request->measure_cpu);
-  
+
   if (xti_tcp_rr_request->test_length > 0) {
     times_up = 0;
     trans_remaining = 0;
@@ -4818,7 +4818,7 @@
   }
 
   trans_received = 0;
-  
+
   while ((!times_up) || (trans_remaining > 0)) {
     temp_message_ptr = recv_ring->buffer_ptr;
     request_bytes_remaining	= xti_tcp_rr_request->request_size;
@@ -4859,10 +4859,10 @@
       if (debug) {
 	fprintf(where,"yo5\n");
 	fflush(where);
-      }						
+      }
       break;
     }
-    
+
     /* Now, send the response to the remote */
     if((bytes_sent=t_snd(s_data,
 			 send_ring->buffer_ptr,
@@ -4873,7 +4873,7 @@
 	timed_out = 1;
 	if (debug) {
 	  fprintf(where,"yo6\n");
-	  fflush(where);						
+	  fflush(where);
 	}
 	break;
       }
@@ -4890,7 +4890,7 @@
       send_response();
       exit(1);
     }
-    
+
     send_ring = send_ring->next;
 
     trans_received++;
@@ -4898,13 +4898,13 @@
       trans_remaining--;
     }
   }
-  
-  
+
+
   /* The loop now exits due to timeout or transaction count being */
   /* reached */
-  
+
   cpu_stop(xti_tcp_rr_request->measure_cpu,&elapsed_time);
-  
+
   stop_timer(); /* this is probably unnecessary, but it shouldn't hurt */
 
   if (timed_out) {
@@ -4915,16 +4915,16 @@
   }
 
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_rr: got %d transactions\n",
 	    trans_received);
     fflush(where);
   }
-  
-  xti_tcp_rr_results->bytes_received = (trans_received * 
-					(xti_tcp_rr_request->request_size + 
+
+  xti_tcp_rr_results->bytes_received = (trans_received *
+					(xti_tcp_rr_request->request_size +
 					 xti_tcp_rr_request->response_size));
   xti_tcp_rr_results->trans_received = trans_received;
   xti_tcp_rr_results->elapsed_time   = elapsed_time;
@@ -4932,18 +4932,18 @@
   if (xti_tcp_rr_request->measure_cpu) {
     xti_tcp_rr_results->cpu_util	= calc_cpu_util(elapsed_time);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_rr: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   /* we are done with the socket, free it */
   t_close(s_data);
 
   send_response();
-  
+
 }
 
 
@@ -4955,50 +4955,50 @@
  /* it will also look (can look) much like the communication pattern */
  /* of http for www access. */
 
-void 
+void
 send_xti_tcp_conn_rr(char remote_host[])
 {
-  
+
   char *tput_title = "\
 Local /Remote\n\
 Socket Size   Request  Resp.   Elapsed  Trans.\n\
 Send   Recv   Size     Size    Time     Rate         \n\
 bytes  Bytes  bytes    bytes   secs.    per sec   \n\n";
-  
+
   char *tput_fmt_0 =
     "%7.2f\n";
-  
+
   char *tput_fmt_1_line_1 = "\
 %-6d %-6d %-6d   %-6d  %-6.2f   %7.2f   \n";
   char *tput_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *cpu_title = "\
 Local /Remote\n\
 Socket Size   Request Resp.  Elapsed Trans.   CPU    CPU    S.dem   S.dem\n\
 Send   Recv   Size    Size   Time    Rate     local  remote local   remote\n\
 bytes  bytes  bytes   bytes  secs.   per sec  %%      %%      us/Tr   us/Tr\n\n";
-  
+
   char *cpu_fmt_0 =
     "%6.3f\n";
-  
+
   char *cpu_fmt_1_line_1 = "\
 %-6d %-6d %-6d  %-6d %-6.2f  %-6.2f   %-6.2f %-6.2f %-6.3f  %-6.3f\n";
-  
+
   char *cpu_fmt_1_line_2 = "\
 %-6d %-6d\n";
-  
+
   char *ksink_fmt = "\
 Alignment      Offset\n\
 Local  Remote  Local  Remote\n\
 Send   Recv    Send   Recv\n\
 %5d  %5d   %5d  %5d\n";
-  
-  
+
+
   int 			one = 1;
   int			timed_out = 0;
   float			elapsed_time;
-  
+
   int	len;
   struct ring_elt *send_ring;
   struct ring_elt *recv_ring;
@@ -5010,13 +5010,13 @@
   int	sock_opt_len = sizeof(int);
   int	rsp_bytes_left;
   int	rsp_bytes_recvd;
-  
+
   float	local_cpu_utilization;
   float	local_service_demand;
   float	remote_cpu_utilization;
   float	remote_service_demand;
   double	thruput;
-  
+
   struct	hostent	        *hp;
   struct	sockaddr_in	server;
   struct        sockaddr_in     *myaddr;
@@ -5026,19 +5026,19 @@
   struct	xti_tcp_conn_rr_request_struct	*xti_tcp_conn_rr_request;
   struct	xti_tcp_conn_rr_response_struct	*xti_tcp_conn_rr_response;
   struct	xti_tcp_conn_rr_results_struct	*xti_tcp_conn_rr_result;
-  
-  xti_tcp_conn_rr_request = 
+
+  xti_tcp_conn_rr_request =
     (struct xti_tcp_conn_rr_request_struct *)netperf_request.content.test_specific_data;
-  xti_tcp_conn_rr_response = 
+  xti_tcp_conn_rr_response =
     (struct xti_tcp_conn_rr_response_struct *)netperf_response.content.test_specific_data;
   xti_tcp_conn_rr_result =
     (struct xti_tcp_conn_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   /* since we are now disconnected from the code that established the */
   /* control socket, and since we want to be able to use different */
   /* protocols and such, we are passed the name of the remote host and */
   /* must turn that into the test specific addressing information. */
-  
+
   myaddr = (struct sockaddr_in *)malloc(sizeof(struct sockaddr_in));
   if (myaddr == NULL) {
     printf("malloc(%d) failed!\n", sizeof(struct sockaddr_in));
@@ -5053,7 +5053,7 @@
 
   /* it would seem that while HP-UX will allow an IP address (as a */
   /* string) in a call to gethostbyname, other, less enlightened */
-  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */  
+  /* systems do not. fix from awjacks at ca.sandia.gov raj 10/95 */
   /* order changed to check for IP address first. raj 7/96 */
 
   if ((addr = inet_addr(remote_host)) == SOCKET_ERROR) {
@@ -5078,8 +5078,8 @@
     /* it was a valid IP address */
     server.sin_addr.s_addr = addr;
     server.sin_family = AF_INET;
-  }    
-  
+  }
+
   if ( print_headers ) {
     fprintf(where,"TCP Connect/Request/Response Test\n");
     if (local_cpu_usage || remote_cpu_usage)
@@ -5087,13 +5087,13 @@
     else
       fprintf(where,tput_title,format_units());
   }
-  
+
   /* initialize a few counters */
-  
+
   nummessages	=	0;
   bytes_xferd	=	0.0;
   times_up 	= 	0;
-  
+
   /* set-up the data buffers with the requested alignment and offset */
   if (send_width == 0) send_width = 1;
   if (recv_width == 0) recv_width = 1;
@@ -5112,18 +5112,18 @@
   if (debug) {
     fprintf(where,"send_xti_tcp_conn_rr: send_socket obtained...\n");
   }
-  
+
   /* If the user has requested cpu utilization measurements, we must */
   /* calibrate the cpu(s). We will perform this task within the tests */
   /* themselves. If the user has specified the cpu rate, then */
   /* calibrate_local_cpu will return rather quickly as it will have */
   /* nothing to do. If local_cpu_rate is zero, then we will go through */
   /* all the "normal" calibration stuff and return the rate back.*/
-  
+
   if (local_cpu_usage) {
     local_cpu_rate = calibrate_local_cpu(local_cpu_rate);
   }
-  
+
   /* Tell the remote end to do a listen. The server alters the socket */
   /* paramters on the other side at this point, hence the reason for */
   /* all the values being passed in the setup message. If the user did */
@@ -5131,7 +5131,7 @@
   /* will indicate to the remote that no changes beyond the system's */
   /* default should be used. Alignment is the exception, it will */
   /* default to 8, which will be no alignment alterations. */
-  
+
   netperf_request.content.request_type	        =	DO_XTI_TCP_CRR;
   xti_tcp_conn_rr_request->recv_buf_size	=	rsr_size;
   xti_tcp_conn_rr_request->send_buf_size	=	rss_size;
@@ -5152,13 +5152,13 @@
   else {
     xti_tcp_conn_rr_request->test_length	=	test_trans * -1;
   }
-  
+
   if (debug > 1) {
     fprintf(where,"netperf: send_xti_tcp_conn_rr: requesting TCP crr test\n");
   }
-  
+
   send_request();
-  
+
   /* The response from the remote will contain all of the relevant 	*/
   /* socket parameters for this test type. We will put them back into 	*/
   /* the variables here so they can be displayed if desired.  The	*/
@@ -5168,9 +5168,9 @@
   /* after the connect returns. The remote will grab the counter right	*/
   /* after the accept call. This saves the hassle of extra messages	*/
   /* being sent for the TCP tests.					*/
-  
+
   recv_response();
-  
+
   if (!netperf_response.content.serv_errno) {
     rsr_size	=	xti_tcp_conn_rr_response->recv_buf_size;
     rss_size	=	xti_tcp_conn_rr_response->send_buf_size;
@@ -5189,13 +5189,13 @@
   else {
     Set_errno(netperf_response.content.serv_errno);
     perror("netperf: remote error");
-    
+
     exit(1);
   }
-  
+
   /* Set-up the test end conditions. For a request/response test, they */
   /* can be either time or transaction based. */
-  
+
   if (test_time) {
     /* The user wanted to end the test after a period of time. */
     times_up = 0;
@@ -5207,13 +5207,13 @@
     trans_remaining = test_bytes;
     times_up = 1;
   }
-  
+
   /* The cpu_start routine will grab the current time and possibly */
   /* value of the idle counter for later use in measuring cpu */
   /* utilization and/or service demand and thruput. */
-  
+
   cpu_start(local_cpu_usage);
-  
+
   /* We use an "OR" to control test execution. When the test is */
   /* controlled by time, the byte count check will always return false. */
   /* When the test is controlled by byte count, the time test will */
@@ -5228,12 +5228,12 @@
   /* the port number as a signed 16 bit quantity. */
   myport = 65530;
   myaddr->sin_port = htons(myport);
-  
+
   while ((!times_up) || (trans_remaining > 0)) {
 
     /* set up the data socket */
     send_socket = create_xti_endpoint(loc_xti_device);
-  
+
     if (send_socket == INVALID_SOCKET) {
       perror("netperf: send_xti_tcp_conn_rr: tcp stream data socket");
       exit(1);
@@ -5268,7 +5268,7 @@
     }
 
     /* Connect up to the remote port on the data socket  */
-    if (connect(send_socket, 
+    if (connect(send_socket,
 		(struct sockaddr *)&server,
 		sizeof(server)) == INVALID_SOCKET){
       if (errno == EINTR) {
@@ -5319,7 +5319,7 @@
       }
       rsp_bytes_left -= rsp_bytes_recvd;
       temp_message_ptr  += rsp_bytes_recvd;
-    }	
+    }
     recv_ring = recv_ring->next;
 
     if (timed_out) {
@@ -5330,11 +5330,11 @@
 
     close(send_socket);
 
-    nummessages++;          
+    nummessages++;
     if (trans_remaining) {
       trans_remaining--;
     }
-    
+
     if (debug > 3) {
       fprintf(where,
 	      "Transaction %d completed on local port %d\n",
@@ -5368,17 +5368,17 @@
     }
 
   }
-  
+
   /* this call will always give us the elapsed time for the test, and */
   /* will also store-away the necessaries for cpu utilization */
 
   cpu_stop(local_cpu_usage,&elapsed_time);	/* was cpu being measured? */
   /* how long did we really run? */
-  
+
   /* Get the statistics from the remote end. The remote will have */
   /* calculated service demand and all those interesting things. If it */
   /* wasn't supposed to care, it will return obvious values. */
-  
+
   recv_response();
   if (!netperf_response.content.serv_errno) {
     if (debug)
@@ -5387,10 +5387,10 @@
   else {
     Set_errno(netperf_response.content.serv_errno);
     perror("netperf: remote error");
-    
+
     exit(1);
   }
-  
+
   /* We now calculate what our thruput was for the test. In the future, */
   /* we may want to include a calculation of the thruput measured by */
   /* the remote, but it should be the case that for a TCP stream test, */
@@ -5401,11 +5401,11 @@
   /* send_size, so we really didn't send what he asked for ;-) We use */
   /* Kbytes/s as the units of thruput for a TCP stream test, where K = */
   /* 1024. A future enhancement *might* be to choose from a couple of */
-  /* unit selections. */ 
-  
+  /* unit selections. */
+
   bytes_xferd	= (req_size * nummessages) + (rsp_size * nummessages);
   thruput	= calc_thruput(bytes_xferd);
-  
+
   if (local_cpu_usage || remote_cpu_usage) {
     /* We must now do a little math for service demand and cpu */
     /* utilization for the system(s) */
@@ -5431,7 +5431,7 @@
       local_cpu_utilization	= -1.0;
       local_service_demand	= -1.0;
     }
-    
+
     if (remote_cpu_usage) {
       if (remote_cpu_rate == 0.0) {
 	fprintf(where,"DANGER  DANGER  DANGER    DANGER  DANGER  DANGER    DANGER!\n");
@@ -5451,7 +5451,7 @@
       remote_cpu_utilization = -1.0;
       remote_service_demand  = -1.0;
     }
-    
+
     /* We are now ready to print all the information. If the user */
     /* has specified zero-level verbosity, we will just print the */
     /* local service demand, or the remote service demand. If the */
@@ -5460,7 +5460,7 @@
     /* of greater than 1, we will display a veritable plethora of */
     /* background information from outside of this block as it it */
     /* not cpu_measurement specific...  */
-    
+
     switch (verbosity) {
     case 0:
       if (local_cpu_usage) {
@@ -5515,34 +5515,34 @@
 	      tput_fmt_1_line_2,
 	      rss_size, 		/* remote recvbuf size */
 	      rsr_size);
-      
+
       break;
     }
   }
-  
+
   /* it would be a good thing to include information about some of the */
   /* other parameters that may have been set for this test, but at the */
   /* moment, I do not wish to figure-out all the  formatting, so I will */
   /* just put this comment here to help remind me that it is something */
   /* that should be done at a later time. */
-  
+
   if (verbosity > 1) {
     /* The user wanted to know it all, so we will give it to him. */
     /* This information will include as much as we can find about */
     /* TCP statistics, the alignments of the sends and receives */
     /* and all that sort of rot... */
-    
+
     fprintf(where,
 	    ksink_fmt);
   }
-  
+
 }
 
 
-void 
+void
 recv_xti_tcp_conn_rr()
 {
-  
+
   char  *message;
   struct	sockaddr_in        myaddr_in,
   peeraddr_in;
@@ -5558,23 +5558,23 @@
   int	request_bytes_remaining;
   int	timed_out = 0;
   float	elapsed_time;
-  
+
   struct	xti_tcp_conn_rr_request_struct	*xti_tcp_conn_rr_request;
   struct	xti_tcp_conn_rr_response_struct	*xti_tcp_conn_rr_response;
   struct	xti_tcp_conn_rr_results_struct	*xti_tcp_conn_rr_results;
-  
-  xti_tcp_conn_rr_request = 
+
+  xti_tcp_conn_rr_request =
     (struct xti_tcp_conn_rr_request_struct *)netperf_request.content.test_specific_data;
-  xti_tcp_conn_rr_response = 
+  xti_tcp_conn_rr_response =
     (struct xti_tcp_conn_rr_response_struct *)netperf_response.content.test_specific_data;
-  xti_tcp_conn_rr_results = 
+  xti_tcp_conn_rr_results =
     (struct xti_tcp_conn_rr_results_struct *)netperf_response.content.test_specific_data;
-  
+
   if (debug) {
     fprintf(where,"netserver: recv_xti_tcp_conn_rr: entered...\n");
     fflush(where);
   }
-  
+
   /* We want to set-up the listen socket with all the desired */
   /* parameters and then let the initiator know that all is ready. If */
   /* socket size defaults are to be used, then the initiator will have */
@@ -5582,19 +5582,19 @@
   /* send-back what they are. If that information cannot be determined, */
   /* then we send-back -1's for the sizes. If things go wrong for any */
   /* reason, we will drop back ten yards and punt. */
-  
+
   /* If anything goes wrong, we want the remote to know about it. It */
   /* would be best if the error that the remote reports to the user is */
   /* the actual error we encountered, rather than some bogus unexpected */
   /* response type message. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_conn_rr: setting the response type...\n");
     fflush(where);
   }
-  
+
   netperf_response.content.response_type = XTI_TCP_CRR_RESPONSE;
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_conn_rr: the response type is set...\n");
     fflush(where);
@@ -5606,10 +5606,10 @@
     printf("malloc(%d) failed!\n", DATABUFFERLEN);
     exit(1);
   }
-  
+
   /* We now alter the message_ptr variables to be at the desired */
   /* alignments with the desired offsets. */
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_conn_rr: requested recv alignment of %d offset %d\n",
@@ -5623,27 +5623,27 @@
   }
 
   recv_message_ptr = ALIGN_BUFFER(message, xti_tcp_conn_rr_request->recv_alignment, xti_tcp_conn_rr_request->recv_offset);
-  
+
   send_message_ptr = ALIGN_BUFFER(message, xti_tcp_conn_rr_request->send_alignment, xti_tcp_conn_rr_request->send_offset);
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_conn_rr: receive alignment and offset set...\n");
     fflush(where);
   }
-  
+
   /* Let's clear-out our sockaddr for the sake of cleanlines. Then we */
   /* can put in OUR values !-) At some point, we may want to nail this */
   /* socket to a particular network-level address, but for now, */
   /* INADDR_ANY should be just fine. */
-  
+
   bzero((char *)&myaddr_in,
 	sizeof(myaddr_in));
   myaddr_in.sin_family      = AF_INET;
   myaddr_in.sin_addr.s_addr = INADDR_ANY;
   myaddr_in.sin_port        = 0;
-  
+
   /* Grab a socket to listen on, and then listen on it. */
-  
+
   if (debug) {
     fprintf(where,"recv_xti_tcp_conn_rr: grabbing a socket...\n");
     fflush(where);
@@ -5658,9 +5658,9 @@
   loc_nodelay = xti_tcp_conn_rr_request->no_delay;
   loc_rcvavoid = xti_tcp_conn_rr_request->so_rcvavoid;
   loc_sndavoid = xti_tcp_conn_rr_request->so_sndavoid;
-  
+
   s_listen = create_xti_endpoint(loc_xti_device);
-  
+
   if (s_listen == INVALID_SOCKET) {
     netperf_response.content.serv_errno = errno;
     send_response();
@@ -5676,7 +5676,7 @@
   /* nail this socket to a specific IP address in a multi-homed, */
   /* multi-connection situation, but for now, we'll ignore the issue */
   /* and concentrate on single connection testing. */
-  
+
   if (bind(s_listen,
 	   (struct sockaddr *)&myaddr_in,
 	   sizeof(myaddr_in)) == SOCKET_ERROR) {
@@ -5701,7 +5701,7 @@
     }
     exit(1);
   }
-  
+
   /* now get the port number assigned by the system  */
   addrlen = sizeof(myaddr_in);
   if (getsockname(s_listen,
@@ -5716,11 +5716,11 @@
     }
     exit(1);
   }
-  
+
   /* Now myaddr_in contains the port and the internet address this is */
   /* returned to the sender also implicitly telling the sender that the */
   /* socket buffer sizing has been done. */
-  
+
   xti_tcp_conn_rr_response->data_port_number = (int) ntohs(myaddr_in.sin_port);
   if (debug) {
     fprintf(where,"telling the remote to call me at %d\n",
@@ -5728,22 +5728,22 @@
     fflush(where);
   }
   netperf_response.content.serv_errno   = 0;
-  
+
   /* But wait, there's more. If the initiator wanted cpu measurements, */
   /* then we must call the calibrate routine, which will return the max */
   /* rate back to the initiator. If the CPU was not to be measured, or */
   /* something went wrong with the calibration, we will return a 0.0 to */
   /* the initiator. */
-  
+
   xti_tcp_conn_rr_response->cpu_rate = 0.0; 	/* assume no cpu */
   if (xti_tcp_conn_rr_request->measure_cpu) {
     xti_tcp_conn_rr_response->measure_cpu = 1;
-    xti_tcp_conn_rr_response->cpu_rate = 
+    xti_tcp_conn_rr_response->cpu_rate =
       calibrate_local_cpu(xti_tcp_conn_rr_request->cpu_rate);
   }
-  
 
-  
+
+
   /* before we send the response back to the initiator, pull some of */
   /* the socket parms from the globals */
   xti_tcp_conn_rr_response->send_buf_size = lss_size;
@@ -5753,17 +5753,17 @@
   xti_tcp_conn_rr_response->so_sndavoid = loc_sndavoid;
 
   send_response();
-  
+
   addrlen = sizeof(peeraddr_in);
-  
+
   /* Now it's time to start receiving data on the connection. We will */
   /* first grab the apropriate counters and then start grabbing. */
-  
+
   cpu_start(xti_tcp_conn_rr_request->measure_cpu);
-  
+
   /* The loop will exit when the sender does a shutdown, which will */
   /* return a length of zero   */
-  
+
   if (xti_tcp_conn_rr_request->test_length > 0) {
     times_up = 0;
     trans_remaining = 0;
@@ -5773,7 +5773,7 @@
     times_up = 1;
     trans_remaining = xti_tcp_conn_rr_request->test_length * -1;
   }
-  
+
   trans_received = 0;
 
   while ((!times_up) || (trans_remaining > 0)) {
@@ -5790,18 +5790,18 @@
       fprintf(where,"recv_xti_tcp_conn_rr: accept: errno = %d\n",errno);
       fflush(where);
       close(s_listen);
-      
+
       exit(1);
     }
-  
+
     if (debug) {
       fprintf(where,"recv_xti_tcp_conn_rr: accepted data connection.\n");
       fflush(where);
     }
-  
+
     temp_message_ptr	= recv_message_ptr;
     request_bytes_remaining	= xti_tcp_conn_rr_request->request_size;
-    
+
     /* receive the request from the other side */
     while(request_bytes_remaining > 0) {
       if((request_bytes_recvd=recv(s_data,
@@ -5822,15 +5822,15 @@
 	temp_message_ptr  += request_bytes_recvd;
       }
     }
-    
+
     if (timed_out) {
       /* we hit the end of the test based on time - lets */
       /* bail out of here now... */
       fprintf(where,"yo5\n");
-      fflush(where);						
+      fflush(where);
       break;
     }
-    
+
     /* Now, send the response to the remote */
     if((bytes_sent=send(s_data,
 			send_message_ptr,
@@ -5840,19 +5840,19 @@
 	/* the test timer has popped */
 	timed_out = 1;
 	fprintf(where,"yo6\n");
-	fflush(where);						
+	fflush(where);
 	break;
       }
       netperf_response.content.serv_errno = 99;
       send_response();
       exit(1);
     }
-    
+
     trans_received++;
     if (trans_remaining) {
       trans_remaining--;
     }
-    
+
     if (debug) {
       fprintf(where,
 	      "recv_xti_tcp_conn_rr: Transaction %d complete\n",
@@ -5864,13 +5864,13 @@
     close(s_data);
 
   }
-  
-  
+
+
   /* The loop now exits due to timeout or transaction count being */
   /* reached */
-  
+
   cpu_stop(xti_tcp_conn_rr_request->measure_cpu,&elapsed_time);
-  
+
   if (timed_out) {
     /* we ended the test by time, which was at least 2 seconds */
     /* longer than we wanted to run. so, we want to subtract */
@@ -5878,31 +5878,31 @@
     elapsed_time -= PAD_TIME;
   }
   /* send the results to the sender			*/
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_conn_rr: got %d transactions\n",
 	    trans_received);
     fflush(where);
   }
-  
-  xti_tcp_conn_rr_results->bytes_received	= (trans_received * 
-					   (xti_tcp_conn_rr_request->request_size + 
+
+  xti_tcp_conn_rr_results->bytes_received	= (trans_received *
+					   (xti_tcp_conn_rr_request->request_size +
 					    xti_tcp_conn_rr_request->response_size));
   xti_tcp_conn_rr_results->trans_received	= trans_received;
   xti_tcp_conn_rr_results->elapsed_time	= elapsed_time;
   if (xti_tcp_conn_rr_request->measure_cpu) {
     xti_tcp_conn_rr_results->cpu_util	= calc_cpu_util(elapsed_time);
   }
-  
+
   if (debug) {
     fprintf(where,
 	    "recv_xti_tcp_conn_rr: test complete, sending results.\n");
     fflush(where);
   }
-  
+
   send_response();
-  
+
 }
 
 void
@@ -5920,13 +5920,13 @@
 #define XTI_ARGS "Dhm:M:r:s:S:Vw:W:X:"
   extern int	optind, opterrs;  /* index of first unused arg 	*/
   extern char	*optarg;	  /* pointer to option string	*/
-  
+
   int		c;
-  
-  char	
+
+  char
     arg1[BUFSIZ],  /* argument holders		*/
     arg2[BUFSIZ];
-  
+
   if (no_control) {
     fprintf(where,
 	    "The XTI tests do not know how to run with no control connection\n");
@@ -5938,10 +5938,10 @@
   /* the first will set both to that value. Specifying only the */
   /* second will leave the first untouched. To change only the */
   /* first, use the form "first," (see the routine break_args.. */
-  
+
   while ((c= getopt(argc, argv, XTI_ARGS)) != EOF) {
     switch (c) {
-    case '?':	
+    case '?':
     case 'h':
       print_xti_usage();
       exit(1);
@@ -5971,7 +5971,7 @@
       break_args(optarg,arg1,arg2);
       if (arg1[0])
 	req_size = convert(arg1);
-      if (arg2[0])	
+      if (arg2[0])
 	rsp_size = convert(arg2);
       break;
     case 'm':



More information about the netperf-dev mailing list