Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detection of DLT_* macros #29

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 22 additions & 27 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -3890,21 +3890,16 @@ fi
fi



{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for BPF include path" >&5
$as_echo_n "checking for BPF include path... " >&6; }
BPF=`/usr/bin/perl -ne '/include\s+<(.*bpf\.h)>/ && print "$1\n"' $pcap_base/pcap.h`
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $BPF" >&5
$as_echo "$BPF" >&6; }
PCAP_H=$pcap_base/pcap.h


present=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_LINUX_SLL in $BPF" >&5
$as_echo_n "checking for DLT_LINUX_SLL in $BPF... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_LINUX_SLL in $PCAP_H" >&5
$as_echo_n "checking for DLT_LINUX_SLL in $PCAP_H... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_LINUX_SLL
yes
#endif
Expand All @@ -3922,12 +3917,12 @@ rm -f conftest*


present=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_LOOP in $BPF" >&5
$as_echo_n "checking for DLT_LOOP in $BPF... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_LOOP in $PCAP_H" >&5
$as_echo_n "checking for DLT_LOOP in $PCAP_H... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_LOOP
yes
#endif
Expand All @@ -3945,12 +3940,12 @@ rm -f conftest*


present=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_IEEE802_11 in $BPF" >&5
$as_echo_n "checking for DLT_IEEE802_11 in $BPF... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_IEEE802_11 in $PCAP_H" >&5
$as_echo_n "checking for DLT_IEEE802_11 in $PCAP_H... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_IEEE802_11
yes
#endif
Expand All @@ -3969,12 +3964,12 @@ rm -f conftest*


present=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_IEEE802_11_RADIO in $BPF" >&5
$as_echo_n "checking for DLT_IEEE802_11_RADIO in $BPF... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_IEEE802_11_RADIO in $PCAP_H" >&5
$as_echo_n "checking for DLT_IEEE802_11_RADIO in $PCAP_H... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_IEEE802_11_RADIO
yes
#endif
Expand All @@ -3993,12 +3988,12 @@ rm -f conftest*


present=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_RAW in $BPF" >&5
$as_echo_n "checking for DLT_RAW in $BPF... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_RAW in $PCAP_H" >&5
$as_echo_n "checking for DLT_RAW in $PCAP_H... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_RAW
yes
#endif
Expand All @@ -4017,12 +4012,12 @@ rm -f conftest*


present=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_PFLOG in $BPF" >&5
$as_echo_n "checking for DLT_PFLOG in $BPF... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_PFLOG in $PCAP_H" >&5
$as_echo_n "checking for DLT_PFLOG in $PCAP_H... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_PFLOG
yes
#endif
Expand All @@ -4041,12 +4036,12 @@ rm -f conftest*


present=""
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_IPNET in $BPF" >&5
$as_echo_n "checking for DLT_IPNET in $BPF... " >&6; }
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for DLT_IPNET in $PCAP_H" >&5
$as_echo_n "checking for DLT_IPNET in $PCAP_H... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_IPNET
yes
#endif
Expand Down
36 changes: 15 additions & 21 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -373,46 +373,40 @@ if test "$USE_PCAP_RESTART" = "1"; then
fi


dnl
dnl Next figure out which bpf header file to look at.
dnl

AC_MSG_CHECKING(for BPF include path)
BPF=`/usr/bin/perl -ne '/include\s+<(.*bpf\.h)>/ && print "$1\n"' $pcap_base/pcap.h`
AC_MSG_RESULT($BPF)
PCAP_H=$pcap_base/pcap.h

dnl
dnl Check for DLT_* types that might not have existed in older
dnl libpcap's
dnl

present=""
AC_MSG_CHECKING(for DLT_LINUX_SLL in $BPF)
AC_MSG_CHECKING(for DLT_LINUX_SLL in $PCAP_H)
AC_EGREP_CPP(yes,
[
#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_LINUX_SLL
yes
#endif
],
[HAVE_DLT_LINUX_SLL="1" && AC_MSG_RESULT(yes)], [HAVE_DLT_LINUX_SLL="0" && AC_MSG_RESULT(no)])

present=""
AC_MSG_CHECKING(for DLT_LOOP in $BPF)
AC_MSG_CHECKING(for DLT_LOOP in $PCAP_H)
AC_EGREP_CPP(yes,
[
#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_LOOP
yes
#endif
],
[HAVE_DLT_LOOP="1" && AC_MSG_RESULT(yes)], [HAVE_DLT_LOOP="0" && AC_MSG_RESULT(no)])

present=""
AC_MSG_CHECKING(for DLT_IEEE802_11 in $BPF)
AC_MSG_CHECKING(for DLT_IEEE802_11 in $PCAP_H)
AC_EGREP_CPP(yes,
[
#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_IEEE802_11
yes
#endif
Expand All @@ -421,10 +415,10 @@ yes


present=""
AC_MSG_CHECKING(for DLT_IEEE802_11_RADIO in $BPF)
AC_MSG_CHECKING(for DLT_IEEE802_11_RADIO in $PCAP_H)
AC_EGREP_CPP(yes,
[
#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_IEEE802_11_RADIO
yes
#endif
Expand All @@ -433,10 +427,10 @@ yes


present=""
AC_MSG_CHECKING(for DLT_RAW in $BPF)
AC_MSG_CHECKING(for DLT_RAW in $PCAP_H)
AC_EGREP_CPP(yes,
[
#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_RAW
yes
#endif
Expand All @@ -445,10 +439,10 @@ yes


present=""
AC_MSG_CHECKING(for DLT_PFLOG in $BPF)
AC_MSG_CHECKING(for DLT_PFLOG in $PCAP_H)
AC_EGREP_CPP(yes,
[
#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_PFLOG
yes
#endif
Expand All @@ -457,10 +451,10 @@ yes


present=""
AC_MSG_CHECKING(for DLT_IPNET in $BPF)
AC_MSG_CHECKING(for DLT_IPNET in $PCAP_H)
AC_EGREP_CPP(yes,
[
#include <$BPF>
#include <$PCAP_H>
#ifdef DLT_IPNET
yes
#endif
Expand Down