#include <time.h>
#include <math.h>
-#ifdef WIN32
-
-/* Windows config file */
- #include "config.win32.h"
-
-/* Windows headers */
- #define _WIN32_WINNT 0x0400 /* use (at least) WinNT 4.0 API */
- #define WIN32_LEAN_AND_MEAN /* exclude unnecesary headers */
- #include <windows.h>
- #include <winsock2.h>
- #include <ws2tcpip.h>
-
-/* define EINTR, just to help compile; it isn't useful */
- #ifndef EINTR
- #define EINTR WSAEINTR
- #endif // EINTR
-
-/* Visual C++ has INT64, but not 'long long'.
- * Metrowerks has 'long long', but INT64 doesn't work. */
- #ifdef __MWERKS__
- #define int64_t long long
- #else
- #define int64_t INT64
- #endif // __MWERKS__
-
-/* Visual C++ has _snprintf instead of snprintf */
- #ifndef __MWERKS__
- #define snprintf _snprintf
- #endif // __MWERKS__
-
-/* close, read, and write only work on files in Windows.
- * I get away with #defining them because I don't read files. */
- #define close( s ) closesocket( s )
- #define read( s, b, l ) recv( s, (char*) b, l, 0 )
- #define write( s, b, l ) send( s, (char*) b, l, 0 )
-
-#else /* not defined WIN32 */
-
/* required on AIX for FD_SET (requires bzero).
* often this is the same as <string.h> */
#ifdef HAVE_STRINGS_H
#define SOCKET_ERROR -1
#define INVALID_SOCKET -1
-#endif /* not defined WIN32 */
-
#ifndef INET6_ADDRSTRLEN
#define INET6_ADDRSTRLEN 40
#endif
#define INET_ADDRSTRLEN 15
#endif
-//#ifdef __cplusplus
- #ifdef HAVE_IPV6
- #define REPORT_ADDRLEN (INET6_ADDRSTRLEN + 1)
-typedef struct sockaddr_storage iperf_sockaddr;
- #else
- #define REPORT_ADDRLEN (INET_ADDRSTRLEN + 1)
-typedef struct sockaddr_in iperf_sockaddr;
- #endif
-//#endif
+// All addresses use struct sockaddr_storage, for compatibility with both v4/v6
+// The maximum report length is the maximum host name length for getnameinfo(3).
+#define REPORT_ADDRLEN (NI_MAXHOST + 1)
// Rationalize stdint definitions and sizeof, thanks to ac_create_stdint_h.m4
// from the gnu archive
#define SHUT_RDWR 2
#endif // SHUT_RD
-#endif /* HEADERS_H */
-
-
-
-
-
+/* Plug-able TCP congestion control algorithm */
+#ifndef TCP_CONGESTION
+#define TCP_CONGESTION 13 /* include/linux/tcp.h */
+#endif
+/* DCCP-specific definitions */
+#include <linux/dccp.h>
+#ifndef SOCK_DCCP
+#define SOCK_DCCP 6 /* include/linux/net.h */
+#endif
+#ifndef IPPROTO_DCCP
+#define IPPROTO_DCCP 33 /* include/linux/in.h */
+#endif
+#ifndef SOL_DCCP
+#define SOL_DCCP 269 /* include/linux/socket.h */
+#endif
+#endif /* HEADERS_H */