aboutsummaryrefslogtreecommitdiffstats
path: root/epan
diff options
context:
space:
mode:
authorMichal Labedzki <michal.labedzki@tieto.com>2014-03-03 12:12:03 +0100
committerAnders Broman <a.broman58@gmail.com>2014-03-06 21:58:07 +0000
commitf4591ef55dfb6216394c0d60c149ece0ec70bbac (patch)
treedcc04902a3be5d26b1e48c8c67994394abaf67fb /epan
parent78ff87e655ee899a93c831581fcb005cb9ef955b (diff)
Bluetooth: Avoid using find_dissector()
Also remove SVN $Id$ lines. Change-Id: I4f2925e6ad8dcfe4a62d879a2cef44447f8ae916 Reviewed-on: https://code.wireshark.org/review/476 Reviewed-by: Anders Broman <a.broman58@gmail.com>
Diffstat (limited to 'epan')
-rw-r--r--epan/dissectors/packet-bt3ds.c8
-rw-r--r--epan/dissectors/packet-btamp.c8
-rw-r--r--epan/dissectors/packet-btavctp.c6
-rw-r--r--epan/dissectors/packet-btavdtp.c12
-rw-r--r--epan/dissectors/packet-btavrcp.c8
-rw-r--r--epan/dissectors/packet-btbnep.c7
-rw-r--r--epan/dissectors/packet-bthci_acl.c6
-rw-r--r--epan/dissectors/packet-bthci_sco.c7
-rw-r--r--epan/dissectors/packet-bthid.c9
-rw-r--r--epan/dissectors/packet-btmcap.c9
-rw-r--r--epan/dissectors/packet-btobex.c8
-rw-r--r--epan/dissectors/packet-btrfcomm.c31
-rw-r--r--epan/dissectors/packet-btsap.c6
-rw-r--r--epan/dissectors/packet-btsdp.c7
-rw-r--r--epan/dissectors/packet-btsmp.c7
-rw-r--r--epan/dissectors/packet-hci_h1.c10
-rw-r--r--epan/dissectors/packet-hci_h4.c8
17 files changed, 61 insertions, 96 deletions
diff --git a/epan/dissectors/packet-bt3ds.c b/epan/dissectors/packet-bt3ds.c
index 0daeb2ff7c..b82108bf95 100644
--- a/epan/dissectors/packet-bt3ds.c
+++ b/epan/dissectors/packet-bt3ds.c
@@ -46,6 +46,8 @@ static expert_field ei_unexpected_data = EI_INIT;
static gint ett_bt3ds = -1;
+static dissector_handle_t b3ds_handle;
+
static const value_string message_opcode_vals[] = {
{ 0x00, "3DG Connection Announcement" },
{ 0, NULL }
@@ -161,7 +163,7 @@ proto_register_bt3ds(void)
};
proto_bt3ds = proto_register_protocol("Bluetooth 3DS Profile", "BT 3DS", "bt3ds");
- new_register_dissector("bt3ds", dissect_bt3ds, proto_bt3ds);
+ b3ds_handle = new_register_dissector("bt3ds", dissect_bt3ds, proto_bt3ds);
proto_register_field_array(proto_bt3ds, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -179,10 +181,6 @@ proto_register_bt3ds(void)
void
proto_reg_handoff_bt3ds(void)
{
- dissector_handle_t b3ds_handle;
-
- b3ds_handle = find_dissector("bt3ds");
-
dissector_add_uint("btl2cap.service", BTSDP_3D_SYNCHRONIZATION_UUID, b3ds_handle);
dissector_add_uint("btl2cap.service", BTSDP_3D_DISPLAY_UUID, b3ds_handle);
dissector_add_uint("btl2cap.service", BTSDP_3D_GLASSES_UUID, b3ds_handle);
diff --git a/epan/dissectors/packet-btamp.c b/epan/dissectors/packet-btamp.c
index 4a044f8cef..ee2727531e 100644
--- a/epan/dissectors/packet-btamp.c
+++ b/epan/dissectors/packet-btamp.c
@@ -63,6 +63,9 @@ static gint ett_btamp_caps = -1;
static gint ett_btamp_controller_entry = -1;
static gint ett_btamp_controller_list = -1;
+static dissector_handle_t btamp_handle;
+
+
static const value_string command_code_vals[] = {
{ 0x01, "AMP Command Reject" },
{ 0x02, "AMP Discover Request" },
@@ -636,7 +639,7 @@ proto_register_btamp(void)
/* Register the protocol name and description */
proto_btamp = proto_register_protocol("Bluetooth AMP Packet", "BT AMP", "btamp");
- new_register_dissector("btamp", dissect_btamp, proto_btamp);
+ btamp_handle = new_register_dissector("btamp", dissect_btamp, proto_btamp);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_btamp, hf, array_length(hf));
@@ -646,9 +649,6 @@ proto_register_btamp(void)
void
proto_reg_handoff_btamp(void)
{
- dissector_handle_t btamp_handle;
-
- btamp_handle = find_dissector("btamp");
dissector_add_uint("btl2cap.cid", BTL2CAP_FIXED_CID_AMP_MAN, btamp_handle);
}
diff --git a/epan/dissectors/packet-btavctp.c b/epan/dissectors/packet-btavctp.c
index 3eb78da8ce..bde61fed37 100644
--- a/epan/dissectors/packet-btavctp.c
+++ b/epan/dissectors/packet-btavctp.c
@@ -56,6 +56,7 @@ static expert_field ei_btavctp_unexpected_frame = EI_INIT;
static dissector_table_t avctp_service_dissector_table;
+static dissector_handle_t btavctp_handle;
static dissector_handle_t data_handle = NULL;
typedef struct _fragment_t {
@@ -468,7 +469,7 @@ proto_register_btavctp(void)
avctp_service_dissector_table = register_dissector_table("btavctp.service", "BT AVCTP Service", FT_UINT16, BASE_HEX);
proto_btavctp = proto_register_protocol("Bluetooth AVCTP Protocol", "BT AVCTP", "btavctp");
- new_register_dissector("btavctp", dissect_btavctp, proto_btavctp);
+ btavctp_handle = new_register_dissector("btavctp", dissect_btavctp, proto_btavctp);
proto_register_field_array(proto_btavctp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -487,9 +488,6 @@ proto_register_btavctp(void)
void
proto_reg_handoff_btavctp(void)
{
- dissector_handle_t btavctp_handle;
-
- btavctp_handle = find_dissector("btavctp");
data_handle = find_dissector("data");
dissector_add_uint("btl2cap.service", BTSDP_AVCTP_PROTOCOL_UUID, btavctp_handle);
diff --git a/epan/dissectors/packet-btavdtp.c b/epan/dissectors/packet-btavdtp.c
index ffa136050e..c082f2d0f7 100644
--- a/epan/dissectors/packet-btavdtp.c
+++ b/epan/dissectors/packet-btavdtp.c
@@ -2056,7 +2056,7 @@ proto_register_btavdtp(void)
};
proto_btavdtp = proto_register_protocol("Bluetooth AVDTP Protocol", "BT AVDTP", "btavdtp");
- new_register_dissector("btavdtp", dissect_btavdtp, proto_btavdtp);
+ btavdtp_handle = new_register_dissector("btavdtp", dissect_btavdtp, proto_btavdtp);
proto_register_field_array(proto_btavdtp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -2079,10 +2079,6 @@ proto_register_btavdtp(void)
void
proto_reg_handoff_btavdtp(void)
{
- btavdtp_handle = find_dissector("btavdtp");
- bta2dp_handle = find_dissector("bta2dp");
- btvdp_handle = find_dissector("btvdp");
-
dissector_add_uint("btl2cap.service", BTSDP_AVDTP_PROTOCOL_UUID, btavdtp_handle);
dissector_add_uint("btl2cap.psm", BTL2CAP_PSM_AVDTP, btavdtp_handle);
@@ -2207,7 +2203,7 @@ proto_register_bta2dp(void)
proto_register_field_array(proto_bta2dp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
- new_register_dissector("bta2dp", dissect_bta2dp, proto_bta2dp);
+ bta2dp_handle = new_register_dissector("bta2dp", dissect_bta2dp, proto_bta2dp);
module = prefs_register_protocol(proto_bta2dp, NULL);
prefs_register_static_text_preference(module, "a2dp.version",
@@ -2234,7 +2230,6 @@ proto_reg_handoff_bta2dp(void)
/* TODO: ATRAC dissector does not exist yet */
atrac_handle = find_dissector("atrac");
- bta2dp_handle = find_dissector("bta2dp");
rtp_handle = find_dissector("rtp");
dissector_add_uint("btl2cap.service", BTSDP_A2DP_SOURCE_SERVICE_UUID, bta2dp_handle);
@@ -2359,7 +2354,7 @@ proto_register_btvdp(void)
};
proto_btvdp = proto_register_protocol("Bluetooth VDP Profile", "BT VDP", "btvdp");
- new_register_dissector("btvdp", dissect_btvdp, proto_btvdp);
+ btvdp_handle = new_register_dissector("btvdp", dissect_btvdp, proto_btvdp);
proto_register_field_array(proto_bta2dp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_btavdtp = expert_register_protocol(proto_btvdp);
@@ -2388,7 +2383,6 @@ proto_reg_handoff_btvdp(void)
mp4v_es_handle = find_dissector("mp4v-es");
rtp_handle = find_dissector("rtp");
- btvdp_handle = find_dissector("btvdp");
dissector_add_uint("btl2cap.service", BTSDP_VDP_SOURCE_SERVICE_UUID, btvdp_handle);
dissector_add_uint("btl2cap.service", BTSDP_VDP_SINK_SERVICE_UUID, btvdp_handle);
diff --git a/epan/dissectors/packet-btavrcp.c b/epan/dissectors/packet-btavrcp.c
index 9c88a9cdd7..22fcdfbde3 100644
--- a/epan/dissectors/packet-btavrcp.c
+++ b/epan/dissectors/packet-btavrcp.c
@@ -212,6 +212,8 @@ static gint ett_btavrcp_path = -1;
static expert_field ei_btavrcp_item_length_bad = EI_INIT;
static expert_field ei_btavrcp_unexpected_data = EI_INIT;
+static dissector_handle_t btavrcp_handle;
+
#define OPCODE_VENDOR_DEPENDANT 0x00
#define OPCODE_UNIT 0x30
#define OPCODE_SUBUNIT 0x31
@@ -3147,7 +3149,7 @@ proto_register_btavrcp(void)
timing = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope());
proto_btavrcp = proto_register_protocol("Bluetooth AVRCP Profile", "BT AVRCP", "btavrcp");
- new_register_dissector("btavrcp", dissect_btavrcp, proto_btavrcp);
+ btavrcp_handle = new_register_dissector("btavrcp", dissect_btavrcp, proto_btavrcp);
proto_register_field_array(proto_btavrcp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -3163,10 +3165,6 @@ proto_register_btavrcp(void)
void
proto_reg_handoff_btavrcp(void)
{
- dissector_handle_t btavrcp_handle;
-
- btavrcp_handle = find_dissector("btavrcp");
-
dissector_add_uint("btavctp.service", BTSDP_AVRCP_TG_SERVICE_UUID, btavrcp_handle);
dissector_add_uint("btavctp.service", BTSDP_AVRCP_CT_SERVICE_UUID, btavrcp_handle);
dissector_add_uint("btavctp.service", BTSDP_AVRCP_SERVICE_UUID, btavrcp_handle);
diff --git a/epan/dissectors/packet-btbnep.c b/epan/dissectors/packet-btbnep.c
index 49126b3045..928256d3c2 100644
--- a/epan/dissectors/packet-btbnep.c
+++ b/epan/dissectors/packet-btbnep.c
@@ -70,6 +70,8 @@ static gint ett_addr = -1;
static expert_field ei_btbnep_src_not_group_address = EI_INIT;
+static dissector_handle_t btbnep_handle;
+
static gboolean top_dissect = TRUE;
static dissector_handle_t eth_handle;
@@ -522,7 +524,7 @@ proto_register_btbnep(void)
};
proto_btbnep = proto_register_protocol("Bluetooth BNEP Protocol", "BT BNEP", "btbnep");
- new_register_dissector("btbnep", dissect_btbnep, proto_btbnep);
+ btbnep_handle = new_register_dissector("btbnep", dissect_btbnep, proto_btbnep);
proto_register_field_array(proto_btbnep, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -542,9 +544,6 @@ proto_register_btbnep(void)
void
proto_reg_handoff_btbnep(void)
{
- dissector_handle_t btbnep_handle;
-
- btbnep_handle = find_dissector("btbnep");
eth_handle = find_dissector("eth");
data_handle = find_dissector("data");
ethertype_handle = find_dissector("ethertype");
diff --git a/epan/dissectors/packet-bthci_acl.c b/epan/dissectors/packet-bthci_acl.c
index 2b4784e0f1..9163706e99 100644
--- a/epan/dissectors/packet-bthci_acl.c
+++ b/epan/dissectors/packet-bthci_acl.c
@@ -52,6 +52,7 @@ static int hf_bthci_acl_dst_name = -1;
/* Initialize the subtree pointers */
static gint ett_bthci_acl = -1;
+static dissector_handle_t bthci_acl_handle;
static dissector_handle_t btl2cap_handle = NULL;
static gboolean acl_reassembly = TRUE;
@@ -493,7 +494,7 @@ proto_register_bthci_acl(void)
/* Register the protocol name and description */
proto_bthci_acl = proto_register_protocol("Bluetooth HCI ACL Packet", "HCI_ACL", "bthci_acl");
- new_register_dissector("bthci_acl", dissect_bthci_acl, proto_bthci_acl);
+ bthci_acl_handle = new_register_dissector("bthci_acl", dissect_bthci_acl, proto_bthci_acl);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_bthci_acl, hf, array_length(hf));
@@ -513,9 +514,6 @@ proto_register_bthci_acl(void)
void
proto_reg_handoff_bthci_acl(void)
{
- dissector_handle_t bthci_acl_handle;
-
- bthci_acl_handle = find_dissector("bthci_acl");
dissector_add_uint("hci_h4.type", HCI_H4_TYPE_ACL, bthci_acl_handle);
dissector_add_uint("hci_h1.type", BTHCI_CHANNEL_ACL, bthci_acl_handle);
diff --git a/epan/dissectors/packet-bthci_sco.c b/epan/dissectors/packet-bthci_sco.c
index d38ad0d4ea..8e9d57e96d 100644
--- a/epan/dissectors/packet-bthci_sco.c
+++ b/epan/dissectors/packet-bthci_sco.c
@@ -42,6 +42,8 @@ static int hf_bthci_sco_data = -1;
/* Initialize the subtree pointers */
static gint ett_bthci_sco = -1;
+static dissector_handle_t bthci_sco_handle;
+
void proto_register_bthci_sco(void);
void proto_reg_handoff_bthci_sco(void);
@@ -257,7 +259,7 @@ proto_register_bthci_sco(void)
/* Register the protocol name and description */
proto_bthci_sco = proto_register_protocol("Bluetooth HCI SCO Packet", "HCI_SCO", "bthci_sco");
- new_register_dissector("bthci_sco", dissect_bthci_sco, proto_bthci_sco);
+ bthci_sco_handle = new_register_dissector("bthci_sco", dissect_bthci_sco, proto_bthci_sco);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_bthci_sco, hf, array_length(hf));
@@ -268,9 +270,6 @@ proto_register_bthci_sco(void)
void
proto_reg_handoff_bthci_sco(void)
{
- dissector_handle_t bthci_sco_handle;
-
- bthci_sco_handle = find_dissector("bthci_sco");
dissector_add_uint("hci_h4.type", HCI_H4_TYPE_SCO, bthci_sco_handle);
dissector_add_uint("hci_h1.type", BTHCI_CHANNEL_SCO, bthci_sco_handle);
}
diff --git a/epan/dissectors/packet-bthid.c b/epan/dissectors/packet-bthid.c
index b6801fd18c..c888237726 100644
--- a/epan/dissectors/packet-bthid.c
+++ b/epan/dissectors/packet-bthid.c
@@ -87,6 +87,9 @@ static gint ett_bthid = -1;
static expert_field ei_bthid_parameter_control_operation_deprecated = EI_INIT;
static expert_field ei_bthid_transaction_type_deprecated = EI_INIT;
+static dissector_handle_t bthid_handle;
+
+
static gboolean show_deprecated = FALSE;
static const value_string transaction_type_vals[] = {
@@ -1083,7 +1086,7 @@ proto_register_bthid(void)
};
proto_bthid = proto_register_protocol("Bluetooth HID Profile", "BT HID", "bthid");
- new_register_dissector("bthid", dissect_bthid, proto_bthid);
+ bthid_handle = new_register_dissector("bthid", dissect_bthid, proto_bthid);
proto_register_field_array(proto_bthid, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -1104,10 +1107,6 @@ proto_register_bthid(void)
void
proto_reg_handoff_bthid(void)
{
- dissector_handle_t bthid_handle;
-
- bthid_handle = find_dissector("bthid");
-
dissector_add_uint("btl2cap.service", BTSDP_HID_SERVICE_UUID, bthid_handle);
dissector_add_uint("btl2cap.service", BTSDP_HIDP_PROTOCOL_UUID, bthid_handle);
diff --git a/epan/dissectors/packet-btmcap.c b/epan/dissectors/packet-btmcap.c
index d30a00b383..1ca6fecaef 100644
--- a/epan/dissectors/packet-btmcap.c
+++ b/epan/dissectors/packet-btmcap.c
@@ -49,7 +49,6 @@ static int hf_btmcap_bluetooth_clock_access_resolution = -1;
static int hf_btmcap_sync_lead_time = -1;
static int hf_btmcap_timestamp_native_resolution = -1;
static int hf_btmcap_timestamp_native_accuracy = -1;
-
static int hf_btmcap_data = -1;
static gint ett_btmcap = -1;
@@ -58,6 +57,8 @@ static expert_field ei_btmcap_mdl_id_ffff = EI_INIT;
static expert_field ei_btmcap_response_parameters_bad = EI_INIT;
static expert_field ei_btmcap_unexpected_data = EI_INIT;
+static dissector_handle_t btmcap_handle;
+
static const value_string op_code_vals[] = {
{ 0x00, "ERROR_RSP" },
{ 0x01, "MD_CREATE_MDL_REQ" },
@@ -418,7 +419,7 @@ proto_register_btmcap(void)
};
proto_btmcap = proto_register_protocol("Bluetooth MCAP Protocol", "BT MCAP", "btmcap");
- new_register_dissector("btmcap", dissect_btmcap, proto_btmcap);
+ btmcap_handle = new_register_dissector("btmcap", dissect_btmcap, proto_btmcap);
proto_register_field_array(proto_btmcap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -435,10 +436,6 @@ proto_register_btmcap(void)
void
proto_reg_handoff_btmcap(void)
{
- dissector_handle_t btmcap_handle;
-
- btmcap_handle = find_dissector("btmcap");
-
dissector_add_uint("btl2cap.service", BTSDP_MCAP_CONTROL_CHANNEL_PROTOCOL_UUID, btmcap_handle);
dissector_add_uint("btl2cap.service", BTSDP_MCAP_DATA_CHANNEL_PROTOCOL_UUID, btmcap_handle);
diff --git a/epan/dissectors/packet-btobex.c b/epan/dissectors/packet-btobex.c
index 0806725bfe..c9a3580272 100644
--- a/epan/dissectors/packet-btobex.c
+++ b/epan/dissectors/packet-btobex.c
@@ -204,6 +204,8 @@ static gint ett_btobex_fragments = -1;
static expert_field ei_application_parameter_length_bad = EI_INIT;
+static dissector_handle_t btobex_handle;
+
static reassembly_table btobex_reassembly_table;
static const fragment_items btobex_frag_items = {
@@ -2520,7 +2522,7 @@ proto_register_btobex(void)
proto_btobex = proto_register_protocol("Bluetooth OBEX Protocol", "BT OBEX", "btobex");
- new_register_dissector("btobex", dissect_btobex, proto_btobex);
+ btobex_handle = new_register_dissector("btobex", dissect_btobex, proto_btobex);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_btobex, hf, array_length(hf));
@@ -2534,10 +2536,6 @@ proto_register_btobex(void)
void
proto_reg_handoff_btobex(void)
{
- dissector_handle_t btobex_handle;
-
- btobex_handle = find_dissector("btobex");
-
/* register in rfcomm and l2cap the profiles/services this dissector should handle */
dissector_add_uint("btrfcomm.service", BTSDP_OPP_SERVICE_UUID, btobex_handle);
dissector_add_uint("btrfcomm.service", BTSDP_FTP_SERVICE_UUID, btobex_handle);
diff --git a/epan/dissectors/packet-btrfcomm.c b/epan/dissectors/packet-btrfcomm.c
index 2a8f98e50d..2e51253c2d 100644
--- a/epan/dissectors/packet-btrfcomm.c
+++ b/epan/dissectors/packet-btrfcomm.c
@@ -1,8 +1,9 @@
/* packet-btrfcomm.c
* Routines for Bluetooth RFCOMM protocol dissection
* and RFCOMM based profile dissection:
- * - Dial-Up Networking (DUN) Profile
+ * - Dial-Up Networking Profile (DUN)
* - Serial Port Profile (SPP)
+ * - Global Navigation Satellite System (GNSS)
*
* Copyright 2002, Wolfgang Hansmann <hansmann@cs.uni-bonn.de>
*
@@ -119,6 +120,11 @@ static gint ett_btgnss = -1;
static expert_field ei_btrfcomm_mcc_length_bad = EI_INIT;
+static dissector_handle_t btrfcomm_handle;
+static dissector_handle_t btdun_handle;
+static dissector_handle_t btspp_handle;
+static dissector_handle_t btgnss_handle;
+
static dissector_table_t rfcomm_service_dissector_table;
static dissector_table_t rfcomm_channel_dissector_table;
@@ -1058,7 +1064,7 @@ proto_register_btrfcomm(void)
/* Register the protocol name and description */
proto_btrfcomm = proto_register_protocol("Bluetooth RFCOMM Protocol", "BT RFCOMM", "btrfcomm");
- new_register_dissector("btrfcomm", dissect_btrfcomm, proto_btrfcomm);
+ btrfcomm_handle = new_register_dissector("btrfcomm", dissect_btrfcomm, proto_btrfcomm);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_btrfcomm, hf, array_length(hf));
@@ -1104,9 +1110,6 @@ proto_register_btrfcomm(void)
void
proto_reg_handoff_btrfcomm(void)
{
- dissector_handle_t btrfcomm_handle;
-
- btrfcomm_handle = find_dissector("btrfcomm");
dissector_add_uint("btl2cap.psm", BTL2CAP_PSM_RFCOMM, btrfcomm_handle);
dissector_add_handle("btl2cap.cid", btrfcomm_handle);
@@ -1176,7 +1179,7 @@ proto_register_btdun(void)
};
proto_btdun = proto_register_protocol("Bluetooth DUN Packet", "BT DUN", "btdun");
- new_register_dissector("btdun", dissect_btdun, proto_btdun);
+ btdun_handle = new_register_dissector("btdun", dissect_btdun, proto_btdun);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_btdun, hf, array_length(hf));
@@ -1186,10 +1189,6 @@ proto_register_btdun(void)
void
proto_reg_handoff_btdun(void)
{
- dissector_handle_t btdun_handle;
-
- btdun_handle = find_dissector("btdun");
-
dissector_add_uint("btrfcomm.service", BTSDP_DUN_SERVICE_UUID, btdun_handle);
dissector_add_handle("btrfcomm.channel", btdun_handle);
@@ -1245,7 +1244,7 @@ proto_register_btspp(void)
};
proto_btspp = proto_register_protocol("Bluetooth SPP Packet", "BT SPP", "btspp");
- new_register_dissector("btspp", dissect_btspp, proto_btspp);
+ btspp_handle = new_register_dissector("btspp", dissect_btspp, proto_btspp);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_btspp, hf, array_length(hf));
@@ -1255,10 +1254,6 @@ proto_register_btspp(void)
void
proto_reg_handoff_btspp(void)
{
- dissector_handle_t btspp_handle;
-
- btspp_handle = find_dissector("btspp");
-
dissector_add_uint("btrfcomm.service", BTSDP_SPP_SERVICE_UUID, btspp_handle);
dissector_add_handle("btrfcomm.channel", btspp_handle);
}
@@ -1302,7 +1297,7 @@ proto_register_btgnss(void)
};
proto_btgnss = proto_register_protocol("Bluetooth GNSS Profile", "BT GNSS", "btgnss");
- new_register_dissector("btgnss", dissect_btgnss, proto_btgnss);
+ btgnss_handle = new_register_dissector("btgnss", dissect_btgnss, proto_btgnss);
proto_register_field_array(proto_btgnss, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -1311,10 +1306,6 @@ proto_register_btgnss(void)
void
proto_reg_handoff_btgnss(void)
{
- dissector_handle_t btgnss_handle;
-
- btgnss_handle = find_dissector("btgnss");
-
dissector_add_uint("btrfcomm.service", BTSDP_GNSS_UUID, btgnss_handle);
dissector_add_uint("btrfcomm.service", BTSDP_GNSS_SERVER_UUID, btgnss_handle);
dissector_add_handle("btrfcomm.channel", btgnss_handle);
diff --git a/epan/dissectors/packet-btsap.c b/epan/dissectors/packet-btsap.c
index cb3c6ca62a..36a102e11a 100644
--- a/epan/dissectors/packet-btsap.c
+++ b/epan/dissectors/packet-btsap.c
@@ -84,6 +84,7 @@ static expert_field ei_unexpected_data = EI_INIT;
static gint top_dissect = TOP_DISSECT_INTERNAL;
+static dissector_handle_t btsap_handle;
static dissector_handle_t gsm_sim_cmd_handle;
static dissector_handle_t gsm_sim_resp_handle;
static dissector_handle_t iso7816_atr_handle;
@@ -711,7 +712,7 @@ proto_register_btsap(void)
};
proto_btsap = proto_register_protocol("Bluetooth SAP Profile", "BT SAP", "btsap");
- new_register_dissector("btsap", dissect_btsap, proto_btsap);
+ btsap_handle = new_register_dissector("btsap", dissect_btsap, proto_btsap);
proto_register_field_array(proto_btsap, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -732,9 +733,6 @@ proto_register_btsap(void)
void
proto_reg_handoff_btsap(void)
{
- dissector_handle_t btsap_handle;
-
- btsap_handle = find_dissector("btsap");
gsm_sim_cmd_handle = find_dissector("gsm_sim.command");
gsm_sim_resp_handle = find_dissector("gsm_sim.response");
iso7816_atr_handle = find_dissector("iso7816.atr");
diff --git a/epan/dissectors/packet-btsdp.c b/epan/dissectors/packet-btsdp.c
index 25b2180d67..133d219eae 100644
--- a/epan/dissectors/packet-btsdp.c
+++ b/epan/dissectors/packet-btsdp.c
@@ -345,6 +345,8 @@ static expert_field ei_btsdp_continuation_state_none = EI_INIT;
static expert_field ei_btsdp_continuation_state_large = EI_INIT;
static expert_field ei_data_element_value_large = EI_INIT;
+static dissector_handle_t btsdp_handle;
+
static wmem_tree_t *tid_requests = NULL;
static wmem_tree_t *continuation_states = NULL;
static wmem_tree_t *record_handle_services = NULL;
@@ -5641,7 +5643,7 @@ proto_register_btsdp(void)
};
proto_btsdp = proto_register_protocol("Bluetooth SDP Protocol", "BT SDP", "btsdp");
- new_register_dissector("btsdp", dissect_btsdp, proto_btsdp);
+ btsdp_handle = new_register_dissector("btsdp", dissect_btsdp, proto_btsdp);
proto_register_field_array(proto_btsdp, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -5664,9 +5666,6 @@ proto_register_btsdp(void)
void
proto_reg_handoff_btsdp(void)
{
- dissector_handle_t btsdp_handle;
-
- btsdp_handle = find_dissector("btsdp");
dissector_add_uint("btl2cap.psm", BTL2CAP_PSM_SDP, btsdp_handle);
dissector_add_handle("btl2cap.cid", btsdp_handle);
}
diff --git a/epan/dissectors/packet-btsmp.c b/epan/dissectors/packet-btsmp.c
index 2694191170..5ac91ac54f 100644
--- a/epan/dissectors/packet-btsmp.c
+++ b/epan/dissectors/packet-btsmp.c
@@ -59,6 +59,8 @@ static gint ett_btsmp = -1;
static gint ett_btsmp_auth_req = -1;
static gint ett_btsmp_key_dist = -1;
+static dissector_handle_t btsmp_handle;
+
/* Opcodes */
static const value_string opcode_vals[] = {
{0x01, "Pairing Request"},
@@ -392,7 +394,7 @@ proto_register_btsmp(void)
proto_btsmp = proto_register_protocol("Bluetooth Security Manager Protocol",
"BT SMP", "btsmp");
- new_register_dissector("btsmp", dissect_btsmp, proto_btsmp);
+ btsmp_handle = new_register_dissector("btsmp", dissect_btsmp, proto_btsmp);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_btsmp, hf, array_length(hf));
@@ -402,9 +404,6 @@ proto_register_btsmp(void)
void
proto_reg_handoff_btsmp(void)
{
- dissector_handle_t btsmp_handle;
-
- btsmp_handle = find_dissector("btsmp");
dissector_add_uint("btl2cap.cid", BTL2CAP_FIXED_CID_SMP, btsmp_handle);
}
diff --git a/epan/dissectors/packet-hci_h1.c b/epan/dissectors/packet-hci_h1.c
index e55e6d41f4..ebfb3e1f9c 100644
--- a/epan/dissectors/packet-hci_h1.c
+++ b/epan/dissectors/packet-hci_h1.c
@@ -1,5 +1,5 @@
/* packet-hci_h1.c
- * Routines for the Bluetooth HCI h1 dissection
+ * Routines for the Bluetooth HCI H1 dissection
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
@@ -36,6 +36,8 @@ static int hf_hci_h1_direction = -1;
static gint ett_hci_h1 = -1;
static dissector_table_t hci_h1_table;
+
+static dissector_handle_t hci_h1_handle;
static dissector_handle_t data_handle;
static wmem_tree_t *chandle_to_bdaddr_table = NULL;
@@ -149,7 +151,7 @@ proto_register_hci_h1(void)
proto_hci_h1 = proto_register_protocol("Bluetooth HCI H1",
"HCI_H1", "hci_h1");
- new_register_dissector("hci_h1", dissect_hci_h1, proto_hci_h1);
+ hci_h1_handle = new_register_dissector("hci_h1", dissect_hci_h1, proto_hci_h1);
proto_register_field_array(proto_hci_h1, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -166,10 +168,8 @@ proto_register_hci_h1(void)
void
proto_reg_handoff_hci_h1(void)
{
- dissector_handle_t hci_h1_handle;
-
data_handle = find_dissector("data");
- hci_h1_handle = find_dissector("hci_h1");
+
dissector_add_uint("wtap_encap", WTAP_ENCAP_BLUETOOTH_HCI, hci_h1_handle);
}
diff --git a/epan/dissectors/packet-hci_h4.c b/epan/dissectors/packet-hci_h4.c
index 723d741e3e..0b734af790 100644
--- a/epan/dissectors/packet-hci_h4.c
+++ b/epan/dissectors/packet-hci_h4.c
@@ -41,6 +41,8 @@ static int hf_hci_h4_direction = -1;
static gint ett_hci_h4 = -1;
+static dissector_handle_t hci_h4_handle;
+
static dissector_table_t hci_h4_table;
static dissector_handle_t data_handle;
@@ -155,7 +157,7 @@ proto_register_hci_h4(void)
proto_hci_h4 = proto_register_protocol("Bluetooth HCI H4",
"HCI_H4", "hci_h4");
- new_register_dissector("hci_h4", dissect_hci_h4, proto_hci_h4);
+ hci_h4_handle = new_register_dissector("hci_h4", dissect_hci_h4, proto_hci_h4);
proto_register_field_array(proto_hci_h4, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
@@ -172,10 +174,8 @@ proto_register_hci_h4(void)
void
proto_reg_handoff_hci_h4(void)
{
- dissector_handle_t hci_h4_handle;
-
data_handle = find_dissector("data");
- hci_h4_handle = find_dissector("hci_h4");
+
dissector_add_uint("wtap_encap", WTAP_ENCAP_BLUETOOTH_H4, hci_h4_handle);
dissector_add_uint("wtap_encap", WTAP_ENCAP_BLUETOOTH_H4_WITH_PHDR, hci_h4_handle);
}