summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2017-09-05 13:51:37 -0700
committerGuy Harris <guy@alum.mit.edu>2017-09-05 13:51:37 -0700
commit787f37eeffdc3c37beeca8357d667ef35880c62b (patch)
treed5d05c10d3cf92fa27558aebf45afa7d737bd74f
parentd7c711dec95c78d6b638f54e3761bba095042992 (diff)
downloadlibpcap-787f37eeffdc3c37beeca8357d667ef35880c62b.tar.gz
Get rid of pcap-stdinc.h.
On Windows, in each file, include whatever that particular file needs, just as we do on UN*X and MS-DOS.
-rw-r--r--Makefile.in1
-rw-r--r--Win32/Include/net/if.h3
-rw-r--r--bpf/net/bpf_filter.c5
-rw-r--r--bpf_image.c3
-rw-r--r--etherent.c3
-rw-r--r--gencode.c2
-rw-r--r--grammar.y4
-rw-r--r--inet.c5
-rw-r--r--nametoaddr.c6
-rw-r--r--optimize.c3
-rw-r--r--pcap-common.c3
-rw-r--r--pcap-snf.c4
-rw-r--r--pcap-stdinc.h71
-rw-r--r--pcap.c4
-rw-r--r--pcap/pcap.h8
-rw-r--r--savefile.c3
-rw-r--r--scanner.l9
-rw-r--r--sf-pcap-ng.c3
-rw-r--r--sf-pcap.c3
19 files changed, 20 insertions, 123 deletions
diff --git a/Makefile.in b/Makefile.in
index f443711c..6d46d5c3 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -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 \
diff --git a/Win32/Include/net/if.h b/Win32/Include/net/if.h
index 58d3c16e..d7fe94f8 100644
--- a/Win32/Include/net/if.h
+++ b/Win32/Include/net/if.h
@@ -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
diff --git a/bpf/net/bpf_filter.c b/bpf/net/bpf_filter.c
index fc63cac0..2f2a5662 100644
--- a/bpf/net/bpf_filter.c
+++ b/bpf/net/bpf_filter.c
@@ -44,10 +44,7 @@
#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>
diff --git a/bpf_image.c b/bpf_image.c
index 392f5d73..caaa8ceb 100644
--- a/bpf_image.c
+++ b/bpf_image.c
@@ -24,9 +24,6 @@
#endif
#include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
#include <stdio.h>
#include <string.h>
diff --git a/etherent.c b/etherent.c
index 550a2203..237a7fb2 100644
--- a/etherent.c
+++ b/etherent.c
@@ -24,9 +24,6 @@
#endif
#include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
#include <ctype.h>
#include <memory.h>
diff --git a/gencode.c b/gencode.c
index f0ad3426..cdf6b975 100644
--- 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 */
diff --git a/grammar.y b/grammar.y
index b7c90abb..edf92d60 100644
--- 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 ef20bb4b..bfad07a1 100644
--- a/inet.c
+++ b/inet.c
@@ -36,10 +36,7 @@
#include <config.h>
#endif
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#else /* _WIN32 */
-
+#ifndef _WIN32
#include <sys/param.h>
#ifndef MSDOS
#include <sys/file.h>
diff --git a/nametoaddr.c b/nametoaddr.c
index 0f55341a..c22590ce 100644
--- a/nametoaddr.c
+++ b/nametoaddr.c
@@ -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
diff --git a/optimize.c b/optimize.c
index 4d5834e5..926761d5 100644
--- a/optimize.c
+++ b/optimize.c
@@ -26,9 +26,6 @@
#endif
#include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
#include <stdio.h>
#include <stdlib.h>
diff --git a/pcap-common.c b/pcap-common.c
index 5fa9b7e5..c1040782 100644
--- a/pcap-common.c
+++ b/pcap-common.c
@@ -26,9 +26,6 @@
#endif
#include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
#include "pcap-int.h"
#include "extract.h"
diff --git a/pcap-snf.c b/pcap-snf.c
index 906e59ee..b0021e70 100644
--- a/pcap-snf.c
+++ b/pcap-snf.c
@@ -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
index 28edd5d3..00000000
--- a/pcap-stdinc.h
+++ /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 003df0d9..fd4527a1 100644
--- 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>
diff --git a/pcap/pcap.h b/pcap/pcap.h
index 613a5697..9a3d4156 100644
--- a/pcap/pcap.h
+++ b/pcap/pcap.h
@@ -72,12 +72,12 @@
#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 */
diff --git a/savefile.c b/savefile.c
index 4dd8f545..2629f972 100644
--- a/savefile.c
+++ b/savefile.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>
diff --git a/scanner.l b/scanner.l
index befcfdfd..54ce93db 100644
--- a/scanner.l
+++ b/scanner.l
@@ -82,10 +82,6 @@
* 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 */
diff --git a/sf-pcap-ng.c b/sf-pcap-ng.c
index 639eed53..c3250c3f 100644
--- a/sf-pcap-ng.c
+++ b/sf-pcap-ng.c
@@ -26,9 +26,6 @@
#endif
#include <pcap-types.h>
-#ifdef _WIN32
-#include <pcap-stdinc.h>
-#endif /* _WIN32 */
#include <errno.h>
#include <memory.h>
diff --git a/sf-pcap.c b/sf-pcap.c
index 8e12826b..38ddf17a 100644
--- 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>