Remove all $Id$ from top of file
[metze/wireshark/wip.git] / epan / dissectors / packet-bt-oui.c
1 /* packet-bt-oui.c
2  * Dissector for Bluetooth High Speed over wireless
3  * Copyright 2012 intel Corp.
4  * Written by Andrei Emeltchenko at intel dot com
5  *
6  * Wireshark - Network traffic analyzer
7  * By Gerald Combs <gerald@wireshark.org>
8  * Copyright 1998 Gerald Combs
9  *
10  * This program is free software; you can redistribute it and/or
11  * modify it under the terms of the GNU General Public License
12  * as published by the Free Software Foundation; either version 2
13  * of the License, or (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU General Public License for more details.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program; if not, write to the Free Software
22  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23  */
24
25 #include "config.h"
26
27 #include <epan/packet.h>
28 #include "packet-llc.h"
29 #include <epan/oui.h>
30
31 static int hf_llc_bluetooth_pid = -1;
32
33 /*
34  * BLUETOOTH SPECIFICATION Version 4.0 [Vol 5] defines that
35  * before transmission, the PAL shall remove the HCI header,
36  * add LLC and SNAP headers and insert an 802.11 MAC header.
37  * Protocol identifier are described in Table 5.2.
38  */
39
40 #define AMP_U_L2CAP             0x0001
41 #define AMP_C_ACTIVITY_REPORT   0x0002
42 #define AMP_C_SECURITY_FRAME    0x0003
43 #define AMP_C_LINK_SUP_REQUEST  0x0004
44 #define AMP_C_LINK_SUP_REPLY    0x0005
45
46 static const value_string bluetooth_pid_vals[] = {
47         { AMP_U_L2CAP,                  "AMP_U L2CAP ACL data" },
48         { AMP_C_ACTIVITY_REPORT,        "AMP-C Activity Report" },
49         { AMP_C_SECURITY_FRAME,         "AMP-C Security frames" },
50         { AMP_C_LINK_SUP_REQUEST,       "AMP-C Link supervision request" },
51         { AMP_C_LINK_SUP_REPLY,         "AMP-C Link supervision reply" },
52         { 0,    NULL }
53 };
54
55 void proto_register_bt_oui(void);
56 void proto_reg_handoff_bt_oui(void);
57
58 /*
59  * NOTE: there's no dissector here, just registration routines to set
60  * up the dissector table for the Bluetooth OUI
61  */
62
63 void proto_reg_handoff_bt_oui(void)
64 {
65         dissector_handle_t eapol_handle;
66         dissector_handle_t btl2cap_handle;
67
68         eapol_handle = find_dissector("eapol");
69         btl2cap_handle = find_dissector("btl2cap");
70
71         dissector_add_uint("llc.bluetooth_pid", AMP_C_SECURITY_FRAME, eapol_handle);
72         dissector_add_uint("llc.bluetooth_pid", AMP_U_L2CAP, btl2cap_handle);
73 }
74
75
76 void proto_register_bt_oui(void)
77 {
78         static hf_register_info hf[] = {
79                 { &hf_llc_bluetooth_pid,
80                         { "PID",        "llc.bluetooth_pid",  FT_UINT16, BASE_HEX,
81                                 VALS(bluetooth_pid_vals), 0x0, "Protocol ID", HFILL }
82                 }
83         };
84
85         llc_add_oui(OUI_BLUETOOTH, "llc.bluetooth_pid", "LLC Bluetooth OUI PID", hf);
86 }
87