aboutsummaryrefslogtreecommitdiffstats
path: root/bpf
diff options
context:
space:
mode:
authorguy <guy>2002-08-02 03:44:19 +0000
committerguy <guy>2002-08-02 03:44:19 +0000
commit309e3868706ee5115eefbc2ddf7e35bb9651dad6 (patch)
tree16414555c0f45ccb091efad9f37de3a92804fc3d /bpf
parent3073e4c400921ff0f4521ab199bcb8c51a582cf3 (diff)
Use <pcap-stdinc.h> only on Windows; on UNIX, selectively include, in
each source file, only the headers that file needs, and all the headers it needs in order to compile on various platforms and not to get any avoidable compiler warnings on those platforms (as well as any incomplete structure definitions needed to avoid those warnings). That also means that <pcap.h> doesn't include <pcap-stdinc.h> on UNIX; we don't want it to include <pcap-stdinc.h>, at least on UNIX, as doing so 1) would mean we'd have to install that, so that programs can build with libpcap and 2) would mean that programs including <pcap.h> would drag in a bunch of header files that they don't need. Put a newline at the end of "inet.c" - the Sun C compiler doesn't like it if the last line doesn't end with a newline.
Diffstat (limited to 'bpf')
-rw-r--r--bpf/net/bpf_filter.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/bpf/net/bpf_filter.c b/bpf/net/bpf_filter.c
index d0bc68c..0a32230 100644
--- a/bpf/net/bpf_filter.c
+++ b/bpf/net/bpf_filter.c
@@ -40,11 +40,19 @@
#if !(defined(lint) || defined(KERNEL) || defined(_KERNEL))
static const char rcsid[] =
- "@(#) $Header: /tcpdump/master/libpcap/bpf/net/bpf_filter.c,v 1.37 2002-08-01 08:33:12 risso Exp $ (LBL)";
+ "@(#) $Header: /tcpdump/master/libpcap/bpf/net/bpf_filter.c,v 1.38 2002-08-02 03:44:22 guy Exp $ (LBL)";
#endif
+#ifdef WIN32
+
#include <pcap-stdinc.h>
+#else /* WIN32 */
+
+#include <sys/param.h>
+#include <sys/types.h>
+#include <sys/time.h>
+
#define SOLARIS (defined(sun) && (defined(__SVR4) || defined(__svr4__)))
#if defined(__hpux) || SOLARIS
# include <sys/sysmacros.h>
@@ -57,6 +65,8 @@ static const char rcsid[] =
# define MLEN(m) ((m)->m_len)
#endif
+#endif /* WIN32 */
+
#include <net/bpf.h>
#if !defined(KERNEL) && !defined(_KERNEL)
@@ -74,6 +84,9 @@ static const char rcsid[] =
#endif
#ifndef LBL_ALIGN
+#ifndef WIN32
+#include <netinet/in.h>
+#endif
#define EXTRACT_SHORT(p) ((u_short)ntohs(*(u_short *)p))
#define EXTRACT_LONG(p) (ntohl(*(u_int32 *)p))