]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Declare the Bluetooth pseudo-header ourselves.
authorGuy Harris <[email protected]>
Wed, 23 May 2018 21:12:45 +0000 (14:12 -0700)
committerGuy Harris <[email protected]>
Wed, 23 May 2018 21:12:45 +0000 (14:12 -0700)
It's not specified by a libpcap header that might have a different
layout in different pcap releases, it's specified on the list of
link-layer header types and must remain the same forever (except for
getting additional bits defined), so we don't need to pick it up from
libpcap.

This means we get to use tcpdump's nd_ types; do so.

CMakeLists.txt
config.h.in
configure
configure.ac
print-bt.c

index 704e48c130603bf99888d8167f588462b0d52186..ab359f44d9d48dddb2560b0d12d2574a0d7c7040 100644 (file)
@@ -546,7 +546,6 @@ check_include_file(pcap/pcap-inttypes.h HAVE_PCAP_PCAP_INTTYPES_H)
 # netdissect-stdinc.h first.
 #
 set(CMAKE_EXTRA_INCLUDE_FILES netdissect-stdinc.h)
-check_include_file(pcap/bluetooth.h HAVE_PCAP_BLUETOOTH_H)
 check_include_file(pcap/nflog.h HAVE_PCAP_NFLOG_H)
 cmake_pop_check_state()
 
index db43da3436ad17f2e660c98c5654f5243fbf8544..fafdae2b43732e3f94bc4769d3585c81ce201a19 100644 (file)
@@ -96,9 +96,6 @@
 /* if there's an os_proto.h for this platform, to use additional prototypes */
 #undef HAVE_OS_PROTO_H
 
-/* Define to 1 if you have the <pcap/bluetooth.h> header file. */
-#undef HAVE_PCAP_BLUETOOTH_H
-
 /* Define to 1 if you have the `pcap_breakloop' function. */
 #undef HAVE_PCAP_BREAKLOOP
 
index 70724a2fcd55347023fc1270b32659705a77b20e..63372c10399e9825bb74ecc778354c9fd76a734d 100755 (executable)
--- a/configure
+++ b/configure
@@ -6523,19 +6523,6 @@ fi
 #
 savedcppflags="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $V_INCLS"
-for ac_header in pcap/bluetooth.h
-do :
-  ac_fn_c_check_header_compile "$LINENO" "pcap/bluetooth.h" "ac_cv_header_pcap_bluetooth_h" "#include \"netdissect-stdinc.h\"
-"
-if test "x$ac_cv_header_pcap_bluetooth_h" = xyes; then :
-  cat >>confdefs.h <<_ACEOF
-#define HAVE_PCAP_BLUETOOTH_H 1
-_ACEOF
-
-fi
-
-done
-
 for ac_header in pcap/nflog.h
 do :
   ac_fn_c_check_header_compile "$LINENO" "pcap/nflog.h" "ac_cv_header_pcap_nflog_h" "#include \"netdissect-stdinc.h\"
index bc74568a8194a4f908e592bf81d7f970673d1f0a..d6546ff39dfcdf6d9ce026a6c9e6b371f6b239a1 100644 (file)
@@ -897,7 +897,6 @@ AC_CHECK_TYPE([u_int64_t], ,
 #
 savedcppflags="$CPPFLAGS"
 CPPFLAGS="$CPPFLAGS $V_INCLS"
-AC_CHECK_HEADERS(pcap/bluetooth.h,,,[#include "netdissect-stdinc.h"])
 AC_CHECK_HEADERS(pcap/nflog.h,,,[#include "netdissect-stdinc.h"])
 CPPFLAGS="$savedcppflags"
 
index 049a0e781e50181e39f9c3aab0c946b80742df08..93b7c5ff6f658cc615b41aa20c67caefe68f2777 100644 (file)
 #include "netdissect.h"
 #include "extract.h"
 
-#if defined(DLT_BLUETOOTH_HCI_H4_WITH_PHDR) && defined(HAVE_PCAP_BLUETOOTH_H)
-#include <pcap/bluetooth.h>
+#ifdef DLT_BLUETOOTH_HCI_H4_WITH_PHDR
 
+/*
+ * Header prepended by libpcap to each bluetooth h4 frame;
+ * the direction field is in network byte order.
+ */
+typedef struct _bluetooth_h4_header {
+       nd_uint32_t direction; /* if first bit is set direction is incoming */
+} bluetooth_h4_header;
+
+#define        BT_HDRLEN sizeof(bluetooth_h4_header)
 
-#define        BT_HDRLEN sizeof(pcap_bluetooth_h4_header)
 /*
  * This is the top level routine of the printer.  'p' points
  * to the bluetooth header of the packet, 'h->ts' is the timestamp,
@@ -44,7 +51,7 @@ bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *
 {
        u_int length = h->len;
        u_int caplen = h->caplen;
-       const pcap_bluetooth_h4_header* hdr = (const pcap_bluetooth_h4_header*)p;
+       const bluetooth_h4_header* hdr = (const bluetooth_h4_header*)p;
 
        ndo->ndo_protocol = "bt_if";
        if (caplen < BT_HDRLEN || length < BT_HDRLEN)
@@ -55,7 +62,7 @@ bt_if_print(netdissect_options *ndo, const struct pcap_pkthdr *h, const u_char *
        ND_TCHECK_4(&hdr->direction);
        if (ndo->ndo_eflag)
                ND_PRINT("hci length %u, direction %s, ", length,
-                        (EXTRACT_BE_U_4(&hdr->direction)&0x1) ? "in" : "out");
+                        (EXTRACT_BE_U_4(hdr->direction)&0x1) ? "in" : "out");
 
        if (!ndo->ndo_suppress_default_print)
                ND_DEFAULTPRINT(p, caplen);