From 8004ecccde981d80bf1e0f5d7e108f962195e046 Mon Sep 17 00:00:00 2001 From: Anders Broman Date: Sun, 4 Nov 2012 12:47:02 +0000 Subject: [PATCH] From Andrei Emeltchenko: Add OUI_BLUETOOTH part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7633 bt-oui: Add decoding Bluetooth High Speed over wireless svn path=/trunk/; revision=45887 --- epan/CMakeLists.txt | 1 + epan/dissectors/Makefile.common | 1 + epan/dissectors/packet-bt-oui.c | 86 +++++++++++++++++++++++++++++++++ epan/dissectors/packet-llc.c | 1 + epan/oui.h | 1 + 5 files changed, 90 insertions(+) create mode 100644 epan/dissectors/packet-bt-oui.c diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt index 373f92fb27..d6ba89755c 100644 --- a/epan/CMakeLists.txt +++ b/epan/CMakeLists.txt @@ -411,6 +411,7 @@ set(DISSECTOR_SRC dissectors/packet-btsap.c dissectors/packet-btsdp.c dissectors/packet-btsmp.c + dissectors/packet-bt-oui.c dissectors/packet-bvlc.c dissectors/packet-bzr.c dissectors/packet-calcappprotocol.c diff --git a/epan/dissectors/Makefile.common b/epan/dissectors/Makefile.common index bdb310980b..9ec8afb3e6 100644 --- a/epan/dissectors/Makefile.common +++ b/epan/dissectors/Makefile.common @@ -331,6 +331,7 @@ DISSECTOR_SRC = \ packet-btsap.c \ packet-btsdp.c \ packet-btsmp.c \ + packet-bt-oui.c \ packet-bvlc.c \ packet-bzr.c \ packet-calcappprotocol.c \ diff --git a/epan/dissectors/packet-bt-oui.c b/epan/dissectors/packet-bt-oui.c new file mode 100644 index 0000000000..369de1bb7c --- /dev/null +++ b/epan/dissectors/packet-bt-oui.c @@ -0,0 +1,86 @@ +/* packet-bt-oui.c + * Dissector for Bluetooth High Speed over wireless + * Copyright 2012 intel Corp. + * Written by Andrei Emeltchenko at intel dot com + * + * $Id$ + * + * Wireshark - Network traffic analyzer + * By Gerald Combs + * Copyright 1998 Gerald Combs + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +#include "config.h" + +#include +#include "packet-llc.h" +#include + +static int hf_llc_bluetooth_pid = -1; + +/* + * BLUETOOTH SPECIFICATION Version 4.0 [Vol 5] defines that + * before transmission, the PAL shall remove the HCI header, + * add LLC and SNAP headers and insert an 802.11 MAC header. + * Protocol identifier are described in Table 5.2. + */ + +#define AMP_U_L2CAP 0x0001 +#define AMP_C_ACTIVITY_REPORT 0x0002 +#define AMP_C_SECURITY_FRAME 0x0003 +#define AMP_C_LINK_SUP_REQUEST 0x0004 +#define AMP_C_LINK_SUP_REPLY 0x0005 + +static const value_string bluetooth_pid_vals[] = { + { AMP_U_L2CAP, "AMP_U L2CAP ACL data" }, + { AMP_C_ACTIVITY_REPORT, "AMP-C Activity Report" }, + { AMP_C_SECURITY_FRAME, "AMP-C Security frames" }, + { AMP_C_LINK_SUP_REQUEST, "AMP-C Link supervision request" }, + { AMP_C_LINK_SUP_REPLY, "AMP-C Link supervision reply" }, + { 0, NULL } +}; + +/* + * NOTE: there's no dissector here, just registration routines to set + * up the dissector table for the Bluetooth OUI + */ + +void proto_reg_handoff_bt_oui(void) +{ + dissector_handle_t eapol_handle; + dissector_handle_t btl2cap_handle; + + eapol_handle = find_dissector("eapol"); + btl2cap_handle = find_dissector("btl2cap"); + + dissector_add_uint("llc.bluetooth_pid", AMP_C_SECURITY_FRAME, eapol_handle); + dissector_add_uint("llc.bluetooth_pid", AMP_U_L2CAP, btl2cap_handle); +} + + +void proto_register_bt_oui(void) +{ + static hf_register_info hf[] = { + { &hf_llc_bluetooth_pid, + { "PID", "llc.bluetooth_pid", FT_UINT16, BASE_HEX, + VALS(bluetooth_pid_vals), 0x0, "Protocol ID", HFILL } + } + }; + + llc_add_oui(OUI_BLUETOOTH, "llc.bluetooth_pid", "Bluetooth OUI PID", hf); +} + diff --git a/epan/dissectors/packet-llc.c b/epan/dissectors/packet-llc.c index ee41c88684..c19ed782d9 100644 --- a/epan/dissectors/packet-llc.c +++ b/epan/dissectors/packet-llc.c @@ -205,6 +205,7 @@ http://www.cisco.com/univercd/cc/td/doc/product/software/ios113ed/113ed_cr/ibm_r { OUI_SONY_ERICSSON_5, "Sony Ericsson Mobile Communications AB" }, { OUI_SONY_ERICSSON_6, "Sony Ericsson Mobile Communications AB" }, { OUI_SONY_ERICSSON_7, "Sony Ericsson Mobile Communications AB" }, + { OUI_BLUETOOTH, "Bluetooth" }, { OUI_SONY_ERICSSON_8, "Sony Ericsson Mobile Communications AB" }, { OUI_IEEE_802_1QBG, "IEEE 802.1Qbg" }, { OUI_TURBOCELL, "Karlnet (Turbocell)" }, diff --git a/epan/oui.h b/epan/oui.h index 5aa4dc6e10..46ada702e5 100644 --- a/epan/oui.h +++ b/epan/oui.h @@ -59,6 +59,7 @@ #define OUI_SONY_ERICSSON_5 0x001620 /* Sony Ericsson Mobile Communications AB */ #define OUI_SONY_ERICSSON_6 0x0016B8 /* Sony Ericsson Mobile Communications AB */ #define OUI_SONY_ERICSSON_7 0x001813 /* Sony Ericsson Mobile Communications AB */ +#define OUI_BLUETOOTH 0x001958 /* Bluetooth SIG */ #define OUI_SONY_ERICSSON_8 0x001963 /* Sony Ericsson Mobile Communications AB */ #define OUI_IEEE_802_1QBG 0x001B3F /* IEEE 802.1 Qbg */ #define OUI_TURBOCELL 0x0020F6 /* KarlNet, who brought you Turbocell */