diff -u3 -Hb -u ../SVN-Latest/src/netcpu_ntperf.c ./netcpu_ntperf.c --- ../SVN-Latest/src/netcpu_ntperf.c Fri Feb 16 16:27:04 2007 +++ ./netcpu_ntperf.c Tue Jul 15 16:15:39 2008 @@ -15,31 +15,11 @@ # endif #endif -#if 0 -#include -#include -#include -#include #include -#include -#include -#endif - #include - #include #include -#include -#include - -#include -// If you are trying to compile on Windows 2000 or NT 4.0 you may -// need to define DONT_IPV6 in the "sources" files. -#ifndef DONT_IPV6 -#include -#endif - #include "netsh.h" #include "netlib.h" @@ -77,7 +57,7 @@ NT_QUERY_SYSTEM_INFORMATION NtQuerySystemInformation = NULL; -static LARGE_INTEGER TickHz = {0,0}; +static LARGE_INTEGER TickHz = {{0,0}}; _inline LARGE_INTEGER ReadPerformanceCounter(VOID) { @@ -190,7 +170,7 @@ { //Lint status = GetLastError(); - fprintf(stderr, "GetProcAddressFailed, status: %X\n", status); + fprintf(stderr, "GetProcAddressFailed, status: %lX\n", status); exit(1); } @@ -240,7 +220,7 @@ (PCHAR)&PerfCntrs->EndInfo[0], sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)*MAXCPUS, &returnLength )) != 0) { - fprintf(stderr, "NtQuery failed, status: %X\n", status); + fprintf(stderr, "NtQuery failed, status: %lX\n", status); exit(1); } @@ -250,7 +230,7 @@ if ((returnLength % sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION)) != 0) { fprintf(stderr, "NtQuery didn't return expected amount of data\n"); - fprintf(stderr, "Expected a multiple of %i, returned %i\n", + fprintf(stderr, "Expected a multiple of %i, returned %lu\n", sizeof(SYSTEM_PROCESSOR_PERFORMANCE_INFORMATION), returnLength); exit(1); } @@ -259,7 +239,7 @@ if (returnNumCPUs != (int)SystemInfo.dwNumberOfProcessors) { fprintf(stderr, "NtQuery didn't return expected amount of data\n"); - fprintf(stderr, "Expected data for %i CPUs, returned %i\n", + fprintf(stderr, "Expected data for %i CPUs, returned %lu\n", (int)SystemInfo.dwNumberOfProcessors, returnNumCPUs); exit(1); } diff -u3 -Hb -u ../SVN-Latest/src/netlib.c ./netlib.c --- ../SVN-Latest/src/netlib.c Tue Jul 15 15:12:13 2008 +++ ./netlib.c Tue Jul 15 16:14:33 2008 @@ -101,21 +101,8 @@ #include #include -#include -#define netperf_socklen_t socklen_t -#include - -/* the only time someone should need to define DONT_IPV6 in the - "sources" file is if they are trying to compile on Windows 2000 or - NT4 and I suspect this may not be their only problem :) */ -#ifndef DONT_IPV6 -#include -#endif - -#include #define SIGALRM (14) -#define sleep(x) Sleep((x)*1000) #endif /* WIN32 */ @@ -158,10 +145,6 @@ # include "missing/getaddrinfo.h" #endif - -#ifdef WANT_HISTOGRAM -#include "hist.h" -#endif /* WANT_HISTOGRAM */ /****************************************************************/ /* */ /* Local Include Files */ @@ -172,6 +155,10 @@ #include "netsh.h" #include "netcpu.h" +#ifdef WANT_HISTOGRAM +#include "hist.h" +#endif /* WANT_HISTOGRAM */ + /****************************************************************/ /* */ /* Global constants, macros and variables */ @@ -440,7 +427,7 @@ if (dwResult) fprintf(stream, "%s: %s\n", text, szTemp); else - fprintf(stream, "%s: error 0x%x\n", text, dwError); + fprintf(stream, "%s: error 0x%lx\n", text, dwError); fflush(stream); if (szTemp) @@ -2636,7 +2623,6 @@ void get_remote_system_info() { - int ret; char delim[2]; char *token; @@ -2762,7 +2748,6 @@ { #ifdef SO_SNDBUF int optname = (which == SEND_BUFFER) ? SO_SNDBUF : SO_RCVBUF; - netperf_socklen_t sock_opt_len; /* seems that under Windows, setting a value of zero is how one tells the stack you wish to enable copy-avoidance. Knuth only @@ -3794,7 +3779,7 @@ int delta_micro(LARGE_INTEGER *begin, LARGE_INTEGER *end) { LARGE_INTEGER DeltaTimestamp; - static LARGE_INTEGER TickHz = {0,0}; + static LARGE_INTEGER TickHz = {{0,0}}; if (TickHz.QuadPart == 0) { diff -u3 -Hb -u ../SVN-Latest/src/netlib.h ./netlib.h --- ../SVN-Latest/src/netlib.h Tue Jul 15 15:12:15 2008 +++ ./netlib.h Tue Jul 15 16:12:55 2008 @@ -236,6 +236,24 @@ # endif #endif +#ifdef WIN32 + +#define WIN32_LEAN_AND_MEAN /* Prevent inclusion of */ +#include + +#include +/* while it is unlikely that anyone running Windows 2000 or NT 4 is + going to be trying to compile this, if they are they will want to + define DONT_IPV6 in the sources file */ +#ifndef DONT_IPV6 +#include +#endif + +#define sleep(x) Sleep((x)*1000) +#define netperf_socklen_t socklen_t +#endif /* WIN32 */ + + enum sock_buffer{ SEND_BUFFER, RECV_BUFFER @@ -308,12 +326,12 @@ /* from public\sdk\inc\crt\errno.h */ #define ENOSPC 28 -#ifdef errno /* delete the one from stdlib.h */ /*#define errno (*_errno()) */ #undef errno -#endif -#define errno GetLastError() + +/* Use an 'int' cast to silence compiler when printf-ing errno */ +#define errno (int)GetLastError() #define Set_errno(num) SetLastError((num)) #define perror(text) PrintWin32Error(stderr, (text)) diff -u3 -Hb -u ../SVN-Latest/src/netperf.c ./netperf.c --- ../SVN-Latest/src/netperf.c Fri Feb 01 15:13:50 2008 +++ ./netperf.c Tue Jul 15 15:55:33 2008 @@ -64,11 +64,6 @@ #include #endif -#ifdef WIN32 -#include -#include -#endif /* WIN32 */ - #include "netsh.h" #include "netlib.h" #include "nettest_bsd.h" @@ -113,7 +108,7 @@ /* Initialize the winsock lib ( version 2.2 ) */ if ( WSAStartup(MAKEWORD(2,2), &wsa_data) == SOCKET_ERROR ){ - printf("WSAStartup() failed : %d\n", GetLastError()) ; + printf("WSAStartup() failed : %lu\n", GetLastError()) ; return 1 ; } #endif /* WIN32 */ diff -u3 -Hb -u ../SVN-Latest/src/netserver.c ./netserver.c --- ../SVN-Latest/src/netserver.c Tue Jul 15 15:12:12 2008 +++ ./netserver.c Tue Jul 15 16:12:22 2008 @@ -93,15 +93,7 @@ #include #ifdef WIN32 #include -#include #define netperf_socklen_t socklen_t -/* we need to find some other way to decide to include ws2 */ -/* if you are trying to compile on Windows 2000 or NT 4 you will */ -/* probably have to define DONT_IPV6 */ -#ifndef DONT_IPV6 -#include -#endif /* DONT_IPV6 */ -#include #define sleep(x) Sleep((x)*1000) #else #ifndef MPE @@ -869,7 +861,7 @@ /* Initialize the winsock lib ( version 2.2 ) */ if ( WSAStartup(MAKEWORD(2,2), &wsa_data) == SOCKET_ERROR ){ - printf("WSAStartup() failed : %d\n", GetLastError()) ; + perror("WSAStartup() failed") ; return 1 ; } #endif /* WIN32 */ diff -u3 -Hb -u ../SVN-Latest/src/netsh.c ./netsh.c --- ../SVN-Latest/src/netsh.c Tue Jul 15 15:12:15 2008 +++ ./netsh.c Tue Jul 15 16:17:33 2008 @@ -38,7 +38,6 @@ #include #else #include -#include #define netperf_socklen_t socklen_t #endif @@ -418,7 +417,6 @@ parse_protocol(char protocol_string[]) { char temp[10]; - int temp_protocol; strncpy(temp,protocol_string,10); diff -u3 -Hb -u ../SVN-Latest/src/nettest_bsd.c ./nettest_bsd.c --- ../SVN-Latest/src/nettest_bsd.c Tue Jul 15 15:12:15 2008 +++ ./nettest_bsd.c Tue Jul 15 16:17:01 2008 @@ -111,18 +111,6 @@ #include #else /* WIN32 */ #include -#define netperf_socklen_t socklen_t -#include - -/* while it is unlikely that anyone running Windows 2000 or NT 4 is - going to be trying to compile this, if they are they will want to - define DONT_IPV6 in the sources file */ -#ifndef DONT_IPV6 -#include -#endif -#include - -#define sleep(x) Sleep((x)*1000) #define __func__ __FUNCTION__ #endif /* WIN32 */ @@ -5398,12 +5386,6 @@ Send Recv Size Size Time Throughput \n\ bytes Bytes bytes bytes secs. %s/sec \n\n"; - char *tput_title_latency = "\ -Local /Remote\n\ -Socket Size Request Resp. Elapsed \n\ -Send Recv Size Size Time Latency \n\ -bytes Bytes bytes bytes secs. usec/tran \n\n"; - char *tput_fmt_0 = "%7.2f %s\n"; @@ -5424,12 +5406,6 @@ Send Recv Size Size Time %-8.8s local remote local remote\n\ bytes bytes bytes bytes secs. per sec %% %c %% %c us/Tr us/Tr\n\n"; - char *cpu_title_latency = "\ -Local /Remote\n\ -Socket Size Request Resp. Elapsed Latency CPU CPU S.dem S.dem\n\ -Send Recv Size Size Time usecs local remote local remote\n\ -bytes bytes bytes bytes secs. per tran %% %c %% %c us/Tr us/Tr\n\n"; - char *cpu_fmt_0 = "%6.3f %c %s\n"; diff -u3 -Hb -u ../SVN-Latest/src/nettest_bsd.h ./nettest_bsd.h --- ../SVN-Latest/src/nettest_bsd.h Tue Jul 15 15:12:15 2008 +++ ./nettest_bsd.h Tue Jul 15 15:34:20 2008 @@ -584,6 +584,7 @@ int family, void *addr, int *port); +extern void send_tcp_mss(char remote_host[]); extern void send_tcp_stream(char remote_host[]); extern void send_tcp_maerts(char remote_host[]); extern void send_tcp_rr(char remote_host[]); diff -u3 -Hb -u ../SVN-Latest/src/nettest_omni.c ./nettest_omni.c --- ../SVN-Latest/src/nettest_omni.c Tue Jul 15 15:12:13 2008 +++ ./nettest_omni.c Tue Jul 15 15:59:12 2008 @@ -77,19 +77,6 @@ #include #else /* WIN32 */ #include -#define netperf_socklen_t socklen_t -#include - -/* while it is unlikely that anyone running Windows 2000 or NT 4 is - going to be trying to compile this, if they are they will want to - define DONT_IPV6 in the sources file */ -#ifndef DONT_IPV6 -#include -#endif -#include - -#define sleep(x) Sleep((x)*1000) - #define __func__ __FUNCTION__ #endif /* WIN32 */ diff -u3 -Hb -u ../SVN-Latest/src/nettest_unix.c ./nettest_unix.c --- ../SVN-Latest/src/nettest_unix.c Fri Feb 16 16:27:04 2007 +++ ./nettest_unix.c Tue Jul 15 16:01:36 2008 @@ -8,13 +8,17 @@ #include #endif +#ifdef WIN32 +#error This is not for Win32 +#endif + #ifdef WANT_UNIX char nettest_unix_id[]="\ @(#)nettest_unix.c (c) Copyright 1994-2007 Hewlett-Packard Co. Version 2.4.3"; /****************************************************************/ /* */ -/* nettest_bsd.c */ +/* nettest_unix.c */ /* */ /* the BSD sockets parsing routine... */ /* */ @@ -42,18 +46,12 @@ #include #include #include -#ifndef WIN32 #include #include #include #include #include #include -#else /* WIN32 */ -#include -#include -#include -#endif /* WIN32 */ #include #include #include diff -u3 -Hb -u ../SVN-Latest/src/nettest_xti.c ./nettest_xti.c --- ../SVN-Latest/src/nettest_xti.c Fri Feb 16 16:27:04 2007 +++ ./nettest_xti.c Tue Jul 15 16:02:28 2008 @@ -11,6 +11,11 @@ #define WANT_HISTOGRAM #define WANT_INTERVALS #endif /* lint */ + +#ifdef WIN32 +#error This is not for Win32 +#endif + /****************************************************************/ /* */ /* nettest_xti.c */ @@ -40,18 +45,12 @@ #include #include -#ifndef WIN32 #include #include #include #include #include #include -#else /* WIN32 */ -#include -#include -#include -#endif /* WIN32 */ #include #include #include