How to compile the libbtbb plugin for Wireshark on BT5 (should work on other linux flavors as well)
Download and uncompress Wireshark source
Code:
wget http://www.wireshark.org/download/src/wireshark-1.4.6.tar.bz2
tar xvf wireshark-1.4.6.tar.bz2
Copy the btbb folder from 'libbtbb/wireshark/plugins/' to 'wireshark-1.4.6/plugins/'
Now we need to make several changes to make/config files in the Wireshark source code so that libbybb is compiled along with the rest of the code.
The following files need to be edited:
wireshark-1.4.6/plugins/Makefile.am
wireshark-1.4.6/plugins/Makefile.nmake
wireshark-1.4.6/Makefile.am
wireshark-1.4.6/Configure.in
wireshark-1.4.6/CMakeLists.txt
wireshark-1.4.6/epan/Makefile.am
wireshark-1.4.6/packaging/nsis/Makefile.nmake
wireshark-1.4.6/packaging/nsis/wireshark.nsi
* Changes to 'wireshark-1.4.6/plugins/Makefile.am'
At around line 25:
Code:
SUBDIRS = $(_CUSTOM_SUBDIRS_) \
asn1 \
btbb \ <--- Add this line
docsis \
* Changes to 'wireshark-1.4.6/plugins/Makefile.nmake'
At around line 9:
[code]
PLUGIN_LIST = \
asn1 \
btbb \ <--- Add this line
docsis \
...
[code]
* Changes to 'wireshark-1.4.6/Makefile.am'
At around line 264:
Code:
if HAVE_PLUGINS
-include plugins/Custom.make
plugin_ldadd = $(_CUSTOM_plugin_ldadd_) \
-dlopen plugins/asn1/asn1.la \
-dlopen plugins/btbb/btbb.la \ <--- Add this line
-dlopen plugins/docsis/docsis.la \
...
* Changes to 'wireshark-1.4.6/Configure.in'
At around line 1883:
Code:
AC_OUTPUT(
...
plugins/asn1/Makefile
plugins/btbb/Makefile <--- Add this line
plugins/docsis/Makefile
...
* Changes to 'wireshark-1.4.6/CMakeLists.txt'
At around line 353:
Code:
if(ENABLE_PLUGINS)
set(HAVE_PLUGINS 1)
set(PLUGIN_DIR="${DATAFILE_DIR}/plugins/${CPACK_PACKAGE_VERSION}")
set(PLUGIN_SRC_DIRS
plugins/asn1
plugins/btbb <--- Add this line
plugins/docsis
...
* Changes to 'wireshark-1.4.6/epan/Makefile.am'
At around line 190:
Code:
plugin_src = \
../plugins/asn1/packet-asn1.c \
../plugins/btbb/packet-btbb.c \ <--- Add this line
../plugins/btbb/packet-btlmp.c \ <--- Add this line
../plugins/docsis/packet-bintrngreq.c \
...
* Changes to 'wireshark-1.4.6/packaging/nsis/Makefile.nmake'
At around line 47:
Code:
PLUGINS= \
../../plugins/asn1/asn1.dll \
../../plugins/btbb/btbb.dll \ <--- Add this line
../../plugins/docsis/docsis.dll \
...
* Changes to 'wireshark-1.4.6/packaging/nsis/wireshark.nsi'
At around line 878:
Code:
Section "Dissector Plugins" SecPlugins
;-------------------------------------------
SetOutPath '$INSTDIR\plugins\${VERSION}'
File "..\..\plugins\asn1\asn1.dll"
File "..\..\plugins\btbb\btbb.dll" <--- Add this line
File "..\..\plugins\docsis\docsis.dll"
...
Now that you have done all the hard work, you can capture it into a patch file so that if you ever need to do it again, it's a much simpler process
Code:
mv wireshark-1.4.6 wireshark.new
tar xvf wireshark-1.4.6.tar.bz2
diff -rupN wireshark-1.4.6/ wireshark.new/ > btbb.patch
The above command will make a patch file of the differences between the original Wireshark source and your new modifications. It is important to note that it will also take into account the libbtbb files you copied in to the plugin folder. To get just the changes you made to the configuration/make files, just temporarily move the btbb folder somewhere else, then execute the diff command.
You can test the patch by moving it into the top-level of the clean Wireshark source directory and run:
[code]
patch -p1 < btbb.patch
[/quote]
If everything was successful you should see the exact same modifications as you made above.
Now we are ready to compile the Wireshark source along with the libbtbb plugin.
In order to compile Wireshark, you need the following dependencies. Some may be present on your system, but the below command references all of the requirements (beyond typical compile tools)
Code:
apt-get install autoconf libgtk2.0-dev libglib2.0-dev libgeoip-dev libpcre3-dev libpcap0.8-dev libtool byacc flex subversion
Compiling is a straightforward process but takes a bit of time. Simply move to the top level folder of your patched source and execute:
Code:
./autogen.sh
./configure
make
make install
Once that process is complete you should be able to run Wireshark and see 'btbb.so' listed under Help -> About -> Plugins.
If you want to save the binary or move it off to another platform, just look under Help -> About -> Folders -> Global Plugins to see where they are stored. You will need both btbb.so and btbb.la.
If everything worked, that's it. You are now able to decode bluetooth packets with btbb.
-----------------------------------------------------------
Here is the patch file for the current revision of libbtbb:
Code:
diff -rupN wireshark-1.4.6/CMakeLists.txt wireshark.new/CMakeLists.txt
--- wireshark-1.4.6/CMakeLists.txt 2011-04-18 14:43:07.000000000 -0400
+++ wireshark.new/CMakeLists.txt 2011-06-01 12:42:56.853391847 -0400
@@ -355,6 +355,7 @@ if(ENABLE_PLUGINS)
set(PLUGIN_DIR="${DATAFILE_DIR}/plugins/${CPACK_PACKAGE_VERSION}")
set(PLUGIN_SRC_DIRS
plugins/asn1
+ plugins/btbb
plugins/docsis
plugins/ethercat
plugins/giop
diff -rupN wireshark-1.4.6/configure.in wireshark.new/configure.in
--- wireshark-1.4.6/configure.in 2011-04-18 14:43:07.000000000 -0400
+++ wireshark.new/configure.in 2011-06-01 12:36:50.081391615 -0400
@@ -1881,6 +1881,7 @@ AC_OUTPUT(
packaging/svr4/pkginfo
plugins/Makefile
plugins/asn1/Makefile
+ plugins/btbb/Makefile
plugins/docsis/Makefile
plugins/ethercat/Makefile
plugins/giop/Makefile
diff -rupN wireshark-1.4.6/epan/Makefile.am wireshark.new/epan/Makefile.am
--- wireshark-1.4.6/epan/Makefile.am 2011-04-18 14:43:01.000000000 -0400
+++ wireshark.new/epan/Makefile.am 2011-06-01 12:40:35.305391757 -0400
@@ -189,6 +189,8 @@ if ENABLE_STATIC
-include ../plugins/Custom.make
plugin_src = \
../plugins/asn1/packet-asn1.c \
+ ../plugins/btbb/packet-btbb.c \
+ ../plugins/btbb/packet-btlmp.c \
../plugins/docsis/packet-bintrngreq.c \
../plugins/docsis/packet-bpkmattr.c \
../plugins/docsis/packet-bpkmreq.c \
diff -rupN wireshark-1.4.6/Makefile.am wireshark.new/Makefile.am
--- wireshark-1.4.6/Makefile.am 2011-04-18 14:43:07.000000000 -0400
+++ wireshark.new/Makefile.am 2011-06-01 12:34:02.169391507 -0400
@@ -265,6 +265,7 @@ if HAVE_PLUGINS
-include plugins/Custom.make
plugin_ldadd = $(_CUSTOM_plugin_ldadd_) \
-dlopen plugins/asn1/asn1.la \
+ -dlopen plugins/btbb/btbb.la \
-dlopen plugins/docsis/docsis.la \
-dlopen plugins/ethercat/ethercat.la \
-dlopen plugins/giop/cosnaming.la \
diff -rupN wireshark-1.4.6/packaging/nsis/Makefile.nmake wireshark.new/packaging/nsis/Makefile.nmake
--- wireshark-1.4.6/packaging/nsis/Makefile.nmake 2011-04-18 14:43:04.000000000 -0400
+++ wireshark.new/packaging/nsis/Makefile.nmake 2011-06-01 12:46:06.565391970 -0400
@@ -46,6 +46,7 @@ HELP=../../$(INSTALL_DIR)/help/capture_f
PLUGINS= \
../../plugins/asn1/asn1.dll \
+ ../../plugins/btbb/btbb.dll \
../../plugins/docsis/docsis.dll \
../../plugins/ethercat/ethercat.dll \
../../plugins/giop/coseventcomm.dll \
diff -rupN wireshark-1.4.6/packaging/nsis/wireshark.nsi wireshark.new/packaging/nsis/wireshark.nsi
--- wireshark-1.4.6/packaging/nsis/wireshark.nsi 2011-04-18 14:43:04.000000000 -0400
+++ wireshark.new/packaging/nsis/wireshark.nsi 2011-06-01 12:48:23.077392053 -0400
@@ -879,6 +879,7 @@ Section "Dissector Plugins" SecPlugins
;-------------------------------------------
SetOutPath '$INSTDIR\plugins\${VERSION}'
File "..\..\plugins\asn1\asn1.dll"
+File "..\..\plugins\btbb\btbb.dll"
File "..\..\plugins\docsis\docsis.dll"
File "..\..\plugins\ethercat\ethercat.dll"
File "..\..\plugins\giop\coseventcomm.dll"
diff -rupN wireshark-1.4.6/plugins/Makefile.am wireshark.new/plugins/Makefile.am
--- wireshark-1.4.6/plugins/Makefile.am 2011-04-18 14:42:24.000000000 -0400
+++ wireshark.new/plugins/Makefile.am 2011-06-01 12:27:27.649391259 -0400
@@ -24,6 +24,7 @@
-include Custom.make
SUBDIRS = $(_CUSTOM_SUBDIRS_) \
asn1 \
+ btbb \
docsis \
ethercat \
giop \
diff -rupN wireshark-1.4.6/plugins/Makefile.nmake wireshark.new/plugins/Makefile.nmake
--- wireshark-1.4.6/plugins/Makefile.nmake 2011-04-18 14:42:24.000000000 -0400
+++ wireshark.new/plugins/Makefile.nmake 2011-06-01 12:29:31.217391333 -0400
@@ -8,6 +8,7 @@ include ..\config.nmake
PLUGIN_LIST = \
asn1 \
+ btbb \
docsis \
ethercat \
giop \