]> sjero.net Git - iperf/blobdiff - include/headers.h
Native IPv6 support for iperf
[iperf] / include / headers.h
index 6bf6da8462081b80b6b7c4b716619a2a39372b8b..0bc12dbf745550483f9f1d03cb479c9780efce5e 100644 (file)
@@ -126,15 +126,9 @@ SPECIAL_OSF1_EXTERN_C_STOP
     #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
@@ -153,10 +147,15 @@ typedef uintmax_t max_size_t;
     #define SHUT_RDWR 2
 #endif // SHUT_RD
 
+/* 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 */
-
-
-
-
-
-