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

Remove BlueZ dependence #417

Open
wants to merge 2 commits 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
6 changes: 0 additions & 6 deletions config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -256,9 +256,6 @@
/* target host supports Bluetooth sniffing */
#undef PCAP_SUPPORT_BT

/* target host supports Bluetooth Monitor */
#undef PCAP_SUPPORT_BT_MONITOR

/* target host supports CAN sniffing */
#undef PCAP_SUPPORT_CAN

Expand All @@ -277,9 +274,6 @@
/* include ACN support */
#undef SITA

/* if struct sockaddr_hci has hci_channel member */
#undef SOCKADDR_HCI_HAS_HCI_CHANNEL

/* Define to 1 if you have the ANSI C header files. */
#undef STDC_HEADERS

Expand Down
108 changes: 4 additions & 104 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -8020,117 +8020,17 @@ fi
if test "x$enable_bluetooth" != "xno" ; then
case "$host_os" in
linux*)
ac_fn_c_check_header_mongrel "$LINENO" "bluetooth/bluetooth.h" "ac_cv_header_bluetooth_bluetooth_h" "$ac_includes_default"
if test "x$ac_cv_header_bluetooth_bluetooth_h" = xyes; then :


$as_echo "#define PCAP_SUPPORT_BT 1" >>confdefs.h

BT_SRC=pcap-bt-linux.c
{ $as_echo "$as_me:${as_lineno-$LINENO}: Bluetooth sniffing is supported" >&5
BT_SRC=pcap-bt-linux.c
BT_MONITOR_SRC=pcap-bt-monitor-linux.c
{ $as_echo "$as_me:${as_lineno-$LINENO}: Bluetooth sniffing is supported" >&5
$as_echo "$as_me: Bluetooth sniffing is supported" >&6;}

#
# OK, does struct sockaddr_hci have an hci_channel
# member?
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if struct sockaddr_hci has hci_channel member" >&5
$as_echo_n "checking if struct sockaddr_hci has hci_channel member... " >&6; }
if ${ac_cv_lbl_sockaddr_hci_has_hci_channel+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>

int
main ()
{
u_int i = sizeof(((struct sockaddr_hci *)0)->hci_channel)
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_lbl_sockaddr_hci_has_hci_channel=yes
else
ac_cv_lbl_sockaddr_hci_has_hci_channel=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_sockaddr_hci_has_hci_channel" >&5
$as_echo "$ac_cv_lbl_sockaddr_hci_has_hci_channel" >&6; }
if test $ac_cv_lbl_sockaddr_hci_has_hci_channel = yes ; then

$as_echo "#define SOCKADDR_HCI_HAS_HCI_CHANNEL /**/" >>confdefs.h


#
# OK, is HCI_CHANNEL_MONITOR defined?
#
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking if HCI_CHANNEL_MONITOR is defined" >&5
$as_echo_n "checking if HCI_CHANNEL_MONITOR is defined... " >&6; }
if ${ac_cv_lbl_hci_channel_monitor_is_defined+:} false; then :
$as_echo_n "(cached) " >&6
else
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>

int
main ()
{
u_int i = HCI_CHANNEL_MONITOR
;
return 0;
}
_ACEOF
if ac_fn_c_try_compile "$LINENO"; then :
ac_cv_lbl_hci_channel_monitor_is_defined=yes
else
ac_cv_lbl_hci_channel_monitor_is_defined=no
fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi

{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lbl_hci_channel_monitor_is_defined" >&5
$as_echo "$ac_cv_lbl_hci_channel_monitor_is_defined" >&6; }
if test $ac_cv_lbl_hci_channel_monitor_is_defined = yes ; then

$as_echo "#define PCAP_SUPPORT_BT_MONITOR /**/" >>confdefs.h

BT_MONITOR_SRC=pcap-bt-monitor-linux.c
fi
fi
ac_lbl_bluetooth_available=yes

else
ac_lbl_bluetooth_available=no

fi


if test "x$ac_lbl_bluetooth_available" == "xno" ; then
if test "x$enable_bluetooth" = "xyes" ; then
as_fn_error $? "Bluetooth sniffing is not supported; install bluez-lib devel to enable it" "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: Bluetooth sniffing is not supported; install bluez-lib devel to enable it" >&5
$as_echo "$as_me: Bluetooth sniffing is not supported; install bluez-lib devel to enable it" >&6;}
fi
fi
;;
*)
if test "x$enable_bluetooth" = "xyes" ; then
as_fn_error $? "no Bluetooth sniffing support implemented for $host_os" "$LINENO" 5
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: no Bluetooth sniffing support implemented for $host_os" >&5
{ $as_echo "$as_me:${as_lineno-$LINENO}: no Bluetooth sniffing support implemented for $host_os" >&5
$as_echo "$as_me: no Bluetooth sniffing support implemented for $host_os" >&6;}
fi
;;
esac

Expand Down
66 changes: 5 additions & 61 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -1468,69 +1468,13 @@ if test "x$enable_bluetooth" != "xno" ; then
dnl check for Bluetooth sniffing support
case "$host_os" in
linux*)
AC_CHECK_HEADER(bluetooth/bluetooth.h,
[
AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
BT_SRC=pcap-bt-linux.c
AC_MSG_NOTICE(Bluetooth sniffing is supported)

#
# OK, does struct sockaddr_hci have an hci_channel
# member?
#
AC_MSG_CHECKING(if struct sockaddr_hci has hci_channel member)
AC_CACHE_VAL(ac_cv_lbl_sockaddr_hci_has_hci_channel,
AC_TRY_COMPILE(
[
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
],
[u_int i = sizeof(((struct sockaddr_hci *)0)->hci_channel)],
ac_cv_lbl_sockaddr_hci_has_hci_channel=yes,
ac_cv_lbl_sockaddr_hci_has_hci_channel=no))
AC_MSG_RESULT($ac_cv_lbl_sockaddr_hci_has_hci_channel)
if test $ac_cv_lbl_sockaddr_hci_has_hci_channel = yes ; then
AC_DEFINE(SOCKADDR_HCI_HAS_HCI_CHANNEL,,
[if struct sockaddr_hci has hci_channel member])

#
# OK, is HCI_CHANNEL_MONITOR defined?
#
AC_MSG_CHECKING(if HCI_CHANNEL_MONITOR is defined)
AC_CACHE_VAL(ac_cv_lbl_hci_channel_monitor_is_defined,
AC_TRY_COMPILE(
[
#include <bluetooth/bluetooth.h>
#include <bluetooth/hci.h>
],
[u_int i = HCI_CHANNEL_MONITOR],
ac_cv_lbl_hci_channel_monitor_is_defined=yes,
ac_cv_lbl_hci_channel_monitor_is_defined=no))
AC_MSG_RESULT($ac_cv_lbl_hci_channel_monitor_is_defined)
if test $ac_cv_lbl_hci_channel_monitor_is_defined = yes ; then
AC_DEFINE(PCAP_SUPPORT_BT_MONITOR,,
[target host supports Bluetooth Monitor])
BT_MONITOR_SRC=pcap-bt-monitor-linux.c
fi
fi
ac_lbl_bluetooth_available=yes
],
ac_lbl_bluetooth_available=no
)
if test "x$ac_lbl_bluetooth_available" == "xno" ; then
if test "x$enable_bluetooth" = "xyes" ; then
AC_MSG_ERROR(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
else
AC_MSG_NOTICE(Bluetooth sniffing is not supported; install bluez-lib devel to enable it)
fi
fi
AC_DEFINE(PCAP_SUPPORT_BT, 1, [target host supports Bluetooth sniffing])
BT_SRC=pcap-bt-linux.c
BT_MONITOR_SRC=pcap-bt-monitor-linux.c
AC_MSG_NOTICE(Bluetooth sniffing is supported)
;;
*)
if test "x$enable_bluetooth" = "xyes" ; then
AC_MSG_ERROR(no Bluetooth sniffing support implemented for $host_os)
else
AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
fi
AC_MSG_NOTICE(no Bluetooth sniffing support implemented for $host_os)
;;
esac
AC_SUBST(PCAP_SUPPORT_BT)
Expand Down
Loading