]> The Tcpdump Group git mirrors - tcpdump/blobdiff - netdissect-stdinc.h
(for 4.9.3) CVE-2018-14470/Babel: fix an existing length check
[tcpdump] / netdissect-stdinc.h
index de277319db014d65e40a289b10971aed2d581aac..8282c58462be3ac8e92a4c915eb3c1aa5c4652ce 100644 (file)
 #include <stdio.h>
 #include <winsock2.h>
 #include <ws2tcpip.h>
-#include "bittypes.h"   /* in wpcap's Win32/include */
 #include <ctype.h>
 #include <time.h>
 #include <io.h>
 #include <fcntl.h>
 #include <sys/types.h>
-#include <net/netdb.h>  /* in wpcap's Win32/include */
 
 #ifndef uint8_t
 #define uint8_t                unsigned char
 
 #endif /* _MSC_EXTENSIONS */
 
+/*
+ * Suppress definition of intN_t in bittypes.h, as included by <pcap/pcap.h>
+ * on Windows.
+ * (Yes, HAVE_U_INTn_T, as the definition guards are UN*X-oriented, and
+ * we check for u_intN_t in the UN*X configure script.)
+ */
+#define HAVE_U_INT8_T
+#define HAVE_U_INT16_T
+#define HAVE_U_INT32_T
+#define HAVE_U_INT64_T
+
 #ifdef _MSC_VER
 #define stat _stat
 #define open _open
 #define inline __inline
 #endif
 
+#ifdef AF_INET6
+#define HAVE_OS_IPV6_SUPPORT
+#endif
+
 #ifndef INET6_ADDRSTRLEN
 #define INET6_ADDRSTRLEN 46
 #endif
@@ -306,6 +319,7 @@ typedef char* caddr_t;
  * define struct in6_addr so that we can use it for IPv6 addresses.
  */
 #ifndef HAVE_OS_IPV6_SUPPORT
+#ifndef AF_INET6
 #define AF_INET6       24
 
 struct in6_addr {
@@ -316,11 +330,12 @@ struct in6_addr {
        } __u6_addr;                    /* 128-bit IP6 address */
 };
 #endif
+#endif
 
 #ifndef NI_MAXHOST
 #define        NI_MAXHOST      1025
 #endif
-  
+
 #ifndef INET_ADDRSTRLEN
 #define INET_ADDRSTRLEN 16
 #endif
@@ -379,6 +394,11 @@ struct in6_addr {
  * end of Apple deprecation workaround macros
  */
 
+/*
+ * Function attributes, for various compilers.
+ */
+#include "funcattrs.h"
+
 #ifndef min
 #define min(a,b) ((a)>(b)?(b):(a))
 #endif