[netperf-dev] netperf2 commit notice r539 - in trunk/src: . NetPerfDir

raj at netperf.org raj at netperf.org
Wed Mar 21 13:17:12 PDT 2012


Author: raj
Date: 2012-03-21 13:17:12 -0700 (Wed, 21 Mar 2012)
New Revision: 539

Modified:
   trunk/src/NetPerfDir/sources
   trunk/src/netlib.h
   trunk/src/nettest_bsd.c
   trunk/src/nettest_omni.c
Log:
more windows cleanups from Jonathan

Modified: trunk/src/NetPerfDir/sources
===================================================================
--- trunk/src/NetPerfDir/sources	2012-03-21 17:58:11 UTC (rev 538)
+++ trunk/src/NetPerfDir/sources	2012-03-21 20:17:12 UTC (rev 539)
@@ -14,7 +14,7 @@
 
 MSC_WARNING_LEVEL=/W3 /WX
 
-C_DEFINES=$(C_DEFINES) -D_CONSOLE_ -DHAVE_STRING_H -DHAVE_STRUCT_SOCKADDR_STORAGE -DHAVE_GETADDRINFO -DHAVE_GETNAMEINFO -DSTDC_HEADERS -DHAVE_STDLIB_H -DHAVE_WS2TCPIP_H -DWANT_OMNI -DHAVE_INTTUPES_H -DWANT_DEMO -DWANT_HISTOGRAM
+C_DEFINES=$(C_DEFINES) -D_CONSOLE_ -DHAVE_STRING_H -DHAVE_STRUCT_SOCKADDR_STORAGE -DHAVE_GETADDRINFO -DHAVE_GETNAMEINFO -DSTDC_HEADERS -DHAVE_STDLIB_H -DHAVE_WS2TCPIP_H -DWANT_OMNI -DHAVE_INTTYPES_H -DWANT_DEMO -DWANT_HISTOGRAM
 
 #USER_C_FLAGS=$(USER_C_FLAGS) /E
 

Modified: trunk/src/netlib.h
===================================================================
--- trunk/src/netlib.h	2012-03-21 17:58:11 UTC (rev 538)
+++ trunk/src/netlib.h	2012-03-21 20:17:12 UTC (rev 539)
@@ -521,6 +521,7 @@
 extern  void    recv_response();
 extern  void    send_response();
 extern  int     recv_request();
+extern  int     recv_request_timed_n(int n, int seconds);
 extern  void    send_request_n(int n);  /* convert only the first N ints */
 extern  void    recv_response_n(int n); /* of the test-specific data via */
 extern  void    send_response_n(int n); /* htonl/ntonl as required */
@@ -587,6 +588,8 @@
 extern int      HIST_get_percentile();
 extern void     HIST_get_stats();
 extern void     find_security_info(int *enabled, int *type, char **specific);
+extern void     demo_first_timestamp();
+extern void     demo_stream_setup(uint32_t a, uint32_t b);
 #ifndef WIN32
 
 /* WIN32 requires that at least one of the file sets to select be

Modified: trunk/src/nettest_bsd.c
===================================================================
--- trunk/src/nettest_bsd.c	2012-03-21 17:58:11 UTC (rev 538)
+++ trunk/src/nettest_bsd.c	2012-03-21 20:17:12 UTC (rev 539)
@@ -582,7 +582,7 @@
   if ((setsockopt(socket,
 		  getprotobyname("tcp")->p_proto,
 		  TCP_MAXSEG,
-		  &mss,
+		  (const char *)&mss,
 		  sock_opt_len) == SOCKET_ERROR) && (debug)) {
     fprintf(where,
 	    "netperf: %s: setsockopt TCP_MAXSEG: %s (errno %d)\n",
@@ -1097,7 +1097,7 @@
     if (setsockopt(sock,
 		   IPPROTO_IP,
 		   IP_TOS,
-		   &my_tos,sizeof(my_tos)) == SOCKET_ERROR) {
+		   (const char *)&my_tos,sizeof(my_tos)) == SOCKET_ERROR) {
       fprintf(where,
 	      "%s ip_tos failed with %s (errno %d)\n",
 	      __FUNCTION__,
@@ -1111,7 +1111,7 @@
       getsockopt(sock,
 		 IPPROTO_IP,
 		 IP_TOS,
-		 &my_tos,
+		 (char *)&my_tos,
 		 &sock_opt_len);
     }
     break;
@@ -1123,7 +1123,7 @@
     if (setsockopt(sock,
 		   IPPROTO_IPV6,
 		   IPV6_TCLASS,
-		   &my_tos,sizeof(my_tos)) == SOCKET_ERROR) {
+		   (const char *)&my_tos,sizeof(my_tos)) == SOCKET_ERROR) {
       fprintf(where,
 	      "%s ip_tos failed with %s (errno %d)\n",
 	      __FUNCTION__,
@@ -1137,7 +1137,7 @@
       getsockopt(sock,
 		 IPPROTO_IPV6,
 		 IPV6_TCLASS,
-		 &my_tos,
+		 (char *)&my_tos,
 		 &sock_opt_len);
     }
     break;
@@ -6724,7 +6724,7 @@
 
 #ifdef WANT_DEMO
     if (demo_mode) {
-      demo_first_timetsamp();
+      demo_first_timestamp();
     }
 #endif
 

Modified: trunk/src/nettest_omni.c
===================================================================
--- trunk/src/nettest_omni.c	2012-03-21 17:58:11 UTC (rev 538)
+++ trunk/src/nettest_omni.c	2012-03-21 20:17:12 UTC (rev 539)
@@ -3957,6 +3957,16 @@
       requests_outstanding += 1;
 #endif
 
+#ifdef WIN32
+      /* this is used so the timer thread can close the socket out
+	from under us, which to date is the easiest/cleanest/least
+	Windows-specific way I can find to force the winsock calls to
+	return WSAEINTR with the test is over. anything that will run
+	on 95 and NT and is closer to what netperf expects from Unix
+	signals and such would be appreciated raj 1/96 */
+      win_kludge_socket = data_socket;
+#endif /* WIN32 */
+
       if (direction & NETPERF_RECV) {
 	rret = recv_data(data_socket,
 			recv_ring,
@@ -4589,6 +4599,14 @@
   send_omni_inner(remote_host, 0, name_buf);
 }
 
+#if defined(WIN32)
+#if !defined(InetNtop)
+/* +*+ Why isn't this in the winsock headers yet? */
+const char *
+inet_ntop(int af, const void *src, char *dst, size_t size);
+#endif
+#endif
+
 static void
 set_hostname_and_port_2(void *addr, char *hostname, char *portstr, int family, int port)
 {



More information about the netperf-dev mailing list