]> The Tcpdump Group git mirrors - libpcap/commitdiff
Check for "/dev/bpf"; if we find it, use BPF as the capture mechanism,
authorguy <guy>
Fri, 15 Jun 2007 17:57:26 +0000 (17:57 +0000)
committerguy <guy>
Fri, 15 Jun 2007 17:57:26 +0000 (17:57 +0000)
and assume it's a cloning device.

config.h.in
configure
configure.in
pcap-bpf.c

index a519d9a74d6f98506abb20e7c943ecc78926c69f..0bc48dcab567167aed4bd967f119a7e0418e138b 100644 (file)
@@ -10,6 +10,9 @@
 /* Enable optimizer debugging */
 #undef BDEBUG
 
+/* define if you have a cloning BPF device */
+#undef HAVE_CLONING_BPF
+
 /* define if you have the DAG API */
 #undef HAVE_DAG_API
 
index fa4fe5d38b7919d48aaaf1c658c944d7217281e0..e551863ded31ed22818394283d7e22832c22a8e3 100755 (executable)
--- a/configure
+++ b/configure
@@ -1,5 +1,5 @@
 #! /bin/sh
-# From configure.in Revision: 1.120.2.11 .
+# From configure.in Revision: 1.120.2.12 .
 # Guess values for system-dependent variables and create Makefiles.
 # Generated by GNU Autoconf 2.59.
 #
@@ -5207,6 +5207,16 @@ echo "$as_me:$LINENO: checking packet capture type" >&5
 echo $ECHO_N "checking packet capture type... $ECHO_C" >&6
 if test ! -z "$with_pcap" ; then
        V_PCAP="$withval"
+elif test -r /dev/bpf ; then
+       #
+       # Cloning BPF device.
+       #
+       V_PCAP=bpf
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_CLONING_BPF 1
+_ACEOF
+
 elif test -r /dev/bpf0 ; then
        V_PCAP=bpf
 elif test -r /usr/include/net/pfilt.h ; then
index 5451be8022b928672394d97ac08ffa36750eb96f..67f174a6dd574ba2db4dde913f84479f44a59071 100644 (file)
@@ -1,4 +1,4 @@
-dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.120.2.11 2007-06-11 09:52:04 guy Exp $ (LBL)
+dnl @(#) $Header: /tcpdump/master/libpcap/configure.in,v 1.120.2.12 2007-06-15 17:57:26 guy Exp $ (LBL)
 dnl
 dnl Copyright (c) 1994, 1995, 1996, 1997
 dnl    The Regents of the University of California.  All rights reserved.
@@ -6,7 +6,7 @@ dnl
 dnl Process this file with autoconf to produce a configure script.
 dnl
 
-AC_REVISION($Revision: 1.120.2.11 $)
+AC_REVISION($Revision: 1.120.2.12 $)
 AC_PREREQ(2.50)
 AC_INIT(pcap.c)
 
@@ -184,6 +184,12 @@ AC_ARG_WITH(pcap, [  --with-pcap=TYPE        use packet capture TYPE])
 AC_MSG_CHECKING(packet capture type)
 if test ! -z "$with_pcap" ; then
        V_PCAP="$withval"
+elif test -r /dev/bpf ; then
+       #
+       # Cloning BPF device.
+       #
+       V_PCAP=bpf
+       AC_DEFINE(HAVE_CLONING_BPF,1,[define if you have a cloning BPF device])
 elif test -r /dev/bpf0 ; then
        V_PCAP=bpf
 elif test -r /usr/include/net/pfilt.h ; then
index b00100394bee22f144516e6f736d8941de99cd6f..21aa1cc22d6b32e39a5919880d7021ddd46fe87a 100644 (file)
@@ -20,7 +20,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.86.2.11 2007-06-11 09:52:05 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/libpcap/pcap-bpf.c,v 1.86.2.12 2007-06-15 17:57:27 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -35,13 +35,6 @@ static const char rcsid[] _U_ =
 #include <sys/ioctl.h>
 #include <sys/utsname.h>
 
-#ifdef HAVE_PATHS_H
-#include <paths.h>
-#if defined(__NetBSD__) && defined(_PATH_BPF)
-#define HAVE_CLONING_BPF
-#endif /* __NetBSD__ && _PATH_BPF */
-#endif /* HAVE_PATHS_H */
-
 #include <net/if.h>
 
 #ifdef _AIX
@@ -531,7 +524,7 @@ bpf_open(pcap_t *p, char *errbuf)
 {
        int fd;
 #ifdef HAVE_CLONING_BPF
-       static const char device[] = _PATH_BPF;
+       static const char device[] = "/dev/bpf";
 #else
        int n = 0;
        char device[sizeof "/dev/bpf0000000000"];