Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm running Ubuntu 10.04.1 and am trying to get packet capturing working for my Bluetooth dongle using hcidump.

From what I've read, libpcap must be compiled to enable Bluetooth sniffing and given that hcidump isn't finding a single packet, I'm guessing the version Ubuntu has installed for me isn't compiled with bluetooth support.

So I downloaded a newer version of libpcap and installed the bluez header files. Configured libpcap and it gave a "Yes" for bluetooth support. It is now installed and sitting in /usr/local/lib/.

Now I'm trying to compile hcidump to use this lib rather than the system default but I can't figure out how...

I've read that GCC can be passed the -lpcap flag to set the path but I haven't figured out how to do this.

Any ideas?

share|improve this question

I had a quick look at the libpcap package and it appears that all you need to do to get Bluetooth support is to compile it with bluetooth development files installed. That is, install the libbluetooth-dev Install libbluetooth-dev package, then recompile libpcap:

sudo apt-get install libbluetooth-dev build-essential fakeroot
sudo apt-get build-dep libpcap
apt-get source libpcap
cd libpcap-*
dpkg-buildpackage -rfakeroot -b -nc -us -uc
sudo dpkg -iGO ../*.deb

(Better, before the dpkg-buildpackage step, add a version to debian/control so that your package bears a version number that's different from the official package, such as 1.0.0-6bloo1.)

Then try the hcidump executable from the bluez-hcidump Install bluez-hcidump.

If you do need to recompile hcidump and pass it a custom include file path (and probably a custom library file path as well), the way with most programs that have a configure script is to run

CFLAGS='-I /path/to/dependency/include' LDFLAGS='-L /path/to/dependency/lib' ./configure …

/usr/local/include and /usr/local/lib are usually included in the default search, though.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .