]> The Tcpdump Group git mirrors - libpcap/commitdiff
Get rid of pcap-stdinc.h.
authorGuy Harris <[email protected]>
Tue, 5 Sep 2017 20:51:37 +0000 (13:51 -0700)
committerGuy Harris <[email protected]>
Tue, 5 Sep 2017 20:51:37 +0000 (13:51 -0700)
On Windows, in each file, include whatever that particular file needs,
just as we do on UN*X and MS-DOS.

19 files changed:
Makefile.in
Win32/Include/net/if.h
bpf/net/bpf_filter.c
bpf_image.c
etherent.c
gencode.c
grammar.y
inet.c
nametoaddr.c
optimize.c
pcap-common.c
pcap-snf.c
pcap-stdinc.h [deleted file]
pcap.c
pcap/pcap.h
savefile.c
scanner.l
sf-pcap-ng.c
sf-pcap.c

index f443711c6e1cdbf5863c367a327e806ffa913402..6d46d5c348b39791bb960e1ace2600970c961de8 100644 (file)
@@ -129,7 +129,6 @@ HDR = $(PUBHDR) \
        pcap-common.h \
        pcap-int.h \
        pcap-rpcap.h \
-       pcap-stdinc.h \
        pcap-types.h \
        portability.h \
        ppp.h \
index 58d3c16e0d856e1585ff013f8f8091785a169a8c..d7fe94f8b08537ff695652d60338cb09cffebf96 100644 (file)
@@ -41,9 +41,6 @@
  * <net/if.h> does not depend on <sys/time.h> on most other systems.  This
  * helps userland compatability.  (struct timeval ifi_lastchange)
  */
-#ifndef KERNEL
-#include <pcap-stdinc.h>
-#endif
 
 /*
  * Structure describing information about an interface
index fc63cac080ba2edf46e9f2a44c5dffb3adbccb5b..2f2a56622895196fc409e5a78f77450c87e8d715 100644 (file)
 
 #include <pcap-types.h>
 
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#else /* _WIN32 */
-
+#ifndef _WIN32
 #include <sys/param.h>
 #include <sys/types.h>
 #include <sys/time.h>
index 392f5d734a8da7bc0eeabf268fadf9386cd58f50..caaa8ceb1056e56fa508666fbbf8a509cb6129ad 100644 (file)
@@ -24,9 +24,6 @@
 #endif
 
 #include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
 
 #include <stdio.h>
 #include <string.h>
index 550a2203c83c3366b9497dc433872fe11a95f354..237a7fb253e600a659ab96ddf7b4348c099a56b6 100644 (file)
@@ -24,9 +24,6 @@
 #endif
 
 #include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
 
 #include <ctype.h>
 #include <memory.h>
index f0ad3426ce86cfdf45432946d6176ff309374257..cdf6b975fadf304c0eebfbe772e52785f037a905 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -26,7 +26,7 @@
 
 #include <pcap-types.h>
 #ifdef _WIN32
-#include <pcap-stdinc.h>
+#include <ws2tcpip.h>
 #else /* _WIN32 */
 #include <sys/socket.h>
 #endif /* _WIN32 */
index b7c90abb7565ac7cb6e82e4b13c035369b097cd3..edf92d606f06bafb11f033fbe8b6c19c97cab605 100644 (file)
--- a/grammar.y
+++ b/grammar.y
@@ -50,9 +50,7 @@
 #include <config.h>
 #endif
 
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#else /* _WIN32 */
+#ifndef _WIN32
 #include <sys/types.h>
 #include <sys/socket.h>
 #endif /* _WIN32 */
diff --git a/inet.c b/inet.c
index ef20bb4b613ed3a32647bc5997657286a5e64bd4..bfad07a1fe9456ba03e785ca2e67bbdca148a8cc 100644 (file)
--- a/inet.c
+++ b/inet.c
 #include <config.h>
 #endif
 
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#else /* _WIN32 */
-
+#ifndef _WIN32
 #include <sys/param.h>
 #ifndef MSDOS
 #include <sys/file.h>
index 0f55341a3bdcfd314e31570f1fcb2aa1f2410b5c..c22590ce58aaec9b425dabe6bbec76be7fee6930 100644 (file)
@@ -32,7 +32,8 @@
 #endif
 
 #ifdef _WIN32
-#include <pcap-stdinc.h>
+#include <winsock2.h>
+#include <ws2tcpip.h>
 
 #ifdef INET6
 /*
@@ -54,8 +55,7 @@
  * Wspiapi.h header file. This inline code will be used on older Windows
  * platforms that do not natively support the getaddrinfo function."
  *
- * We use getaddrinfo(), so we include Wspiapi.h here.  pcap-stdinc.h
- * includes Ws2tcpip.h, so we don't need to include it ourselves.
+ * We use getaddrinfo(), so we include Wspiapi.h here.
  */
 #include <Wspiapi.h>
 #endif
index 4d5834e5843a75c2c038624c724c32db6b7fc26f..926761d5d9e7aa00ab7824acdebdec5edee5ffc8 100644 (file)
@@ -26,9 +26,6 @@
 #endif
 
 #include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
 
 #include <stdio.h>
 #include <stdlib.h>
index 5fa9b7e5fd86ae0971d0678dabeaa36d49435559..c104078207b5d47884f554dfdb8e0563f5a409bc 100644 (file)
@@ -26,9 +26,6 @@
 #endif
 
 #include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
 
 #include "pcap-int.h"
 #include "extract.h"
index 906e59eecdccd5aeff2f46b3f91dad2b3d4b28bd..b0021e70e043afe2c739259db63ea4df27f968b7 100644 (file)
@@ -2,9 +2,7 @@
 #include <config.h>
 #endif
 
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#else /* !_WIN32 */
+#ifndef _WIN32
 #include <sys/param.h>
 #endif /* !_WIN32 */
 
diff --git a/pcap-stdinc.h b/pcap-stdinc.h
deleted file mode 100644 (file)
index 28edd5d..0000000
+++ /dev/null
@@ -1,71 +0,0 @@
-/*
- * Copyright (c) 2002 - 2005 NetGroup, Politecnico di Torino (Italy)
- * Copyright (c) 2005 - 2009 CACE Technologies, Inc. Davis (California)
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- *
- * 1. Redistributions of source code must retain the above copyright
- * notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- * notice, this list of conditions and the following disclaimer in the
- * documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the Politecnico di Torino nor the names of its
- * contributors may be used to endorse or promote products derived from
- * this software without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
- * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
- * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
- * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
- * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-
-/*
- * Copyright (C) 1999 WIDE Project.
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 3. Neither the name of the project nor the names of its contributors
- *    may be used to endorse or promote products derived from this software
- *    without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE PROJECT AND CONTRIBUTORS ``AS IS'' AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
- * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE PROJECT OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
- * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
- * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
- * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
- * SUCH DAMAGE.
- */
-#ifndef pcap_stdinc_h
-#define pcap_stdinc_h
-
-#include <pcap-types.h>
-
-#include <fcntl.h>
-#include <time.h>
-#include <io.h>
-
-#include <ws2tcpip.h>
-
-#endif /* pcap_stdinc_h */
diff --git a/pcap.c b/pcap.c
index 003df0d95708507f4ed284a765892307b3e7eafd..fd4527a112c0fbe179a0b4f6a14c45bf66b926b2 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -36,9 +36,7 @@
 #endif
 
 #include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#else /* _WIN32 */
+#ifndef _WIN32
 #include <sys/param.h>
 #ifndef MSDOS
 #include <sys/file.h>
index 613a5697c5e88a6b9b4bb3b9c44b267fe2e6fe21..9a3d41563d9f726afa4a845393a3e99466f3e42c 100644 (file)
 #include <pcap/export-defs.h>
 
 #if defined(_WIN32)
-  #include <pcap-stdinc.h>
+  #include <winsock2.h>                /* u_int, u_char etc. */
 #elif defined(MSDOS)
-  #include <sys/types.h>
-  #include <sys/socket.h>  /* u_int, u_char etc. */
+  #include <sys/types.h>       /* u_int, u_char etc. */
+  #include <sys/socket.h>
 #else /* UN*X */
-  #include <sys/types.h>
+  #include <sys/types.h>       /* u_int, u_char etc. */
   #include <sys/time.h>
 #endif /* _WIN32/MSDOS/UN*X */
 
index 4dd8f54575fa6e01c1be040c49b129140aa0208c..2629f972eb7c919439dcaf72844d2fba5a043271 100644 (file)
@@ -34,7 +34,8 @@
 
 #include <pcap-types.h>
 #ifdef _WIN32
-#include <pcap-stdinc.h>
+#include <io.h>
+#include <fcntl.h>
 #endif /* _WIN32 */
 
 #include <errno.h>
index befcfdfd3d46be23190a4393f1f2a7dbc1caa228..54ce93dbd33ce126c2b01ca92583756745448350 100644 (file)
--- a/scanner.l
+++ b/scanner.l
  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
  */
 
-#ifdef _WIN32
-  #include <pcap-stdinc.h>
-#endif
-
 #include <ctype.h>
 #include <string.h>
 
@@ -105,6 +101,8 @@ void pcap_set_column(int, yyscan_t);
 #ifdef INET6
 
 #ifdef _WIN32
+#include <winsock2.h>
+#include <ws2tcpip.h>
 /*
  * To quote the MSDN page for getaddrinfo() at
  *
@@ -124,8 +122,7 @@ void pcap_set_column(int, yyscan_t);
  * Wspiapi.h header file. This inline code will be used on older Windows
  * platforms that do not natively support the getaddrinfo function."
  *
- * We use getaddrinfo(), so we include Wspiapi.h here.  pcap-stdinc.h
- * includes Ws2tcpip.h, so we don't need to include it ourselves.
+ * We use getaddrinfo(), so we include Wspiapi.h here.
  */
 #include <Wspiapi.h>
 #else /* _WIN32 */
index 639eed538833f2f627a9defd3874451faf60a81a..c3250c3fcd87cd986754624f7f80bd17cc883723 100644 (file)
@@ -26,9 +26,6 @@
 #endif
 
 #include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
 
 #include <errno.h>
 #include <memory.h>
index 8e12826b66c6352e8ced11da2f2ec56685fd3a0d..38ddf17ae8827d852d8e0aefca44a003c7ebe054 100644 (file)
--- a/sf-pcap.c
+++ b/sf-pcap.c
@@ -34,7 +34,8 @@
 
 #include <pcap-types.h>
 #ifdef _WIN32
-#include <pcap-stdinc.h>
+#include <io.h>
+#include <fcntl.h>
 #endif /* _WIN32 */
 
 #include <errno.h>