aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-bthci_cmd.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2013-11-02 19:20:04 +0000
committerMichael Mann <mmann78@netscape.net>2013-11-02 19:20:04 +0000
commita267501b82a84ab3d5b9cb7d2f06129d5ca57e42 (patch)
tree056e815b8f475e4c3b5ae57d80f89e202d47aa13 /epan/dissectors/packet-bthci_cmd.c
parent2c85824a469dba2edc674f29a18058bcec19139e (diff)
Bluetooth: Use dissector data instead of pinfo->private_data. Bug 7893 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7893)
From Michal Labedzki svn path=/trunk/; revision=53051
Diffstat (limited to 'epan/dissectors/packet-bthci_cmd.c')
-rw-r--r--epan/dissectors/packet-bthci_cmd.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/epan/dissectors/packet-bthci_cmd.c b/epan/dissectors/packet-bthci_cmd.c
index 36dc31981d..1de3c8869e 100644
--- a/epan/dissectors/packet-bthci_cmd.c
+++ b/epan/dissectors/packet-bthci_cmd.c
@@ -3201,20 +3201,23 @@ dissect_le_cmd(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree,
}
/* Code to actually dissect the packets */
-static void
-dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
+static gint
+dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
- proto_item *ti_cmd = NULL;
- proto_tree *bthci_cmd_tree = NULL;
+ proto_item *ti_cmd;
+ proto_tree *bthci_cmd_tree;
guint16 opcode;
guint16 ocf;
guint8 param_length;
guint8 ogf;
- int offset = 0;
+ gint offset = 0;
proto_item *ti_opcode;
proto_tree *opcode_tree;
gint hfx;
+ ti_cmd = proto_tree_add_item(tree, proto_bthci_cmd, tvb, offset, -1, ENC_NA);
+ bthci_cmd_tree = proto_item_add_subtree(ti_cmd, ett_bthci_cmd);
+
switch (pinfo->p2p_dir) {
case P2P_DIR_SENT:
col_set_str(pinfo->cinfo, COL_INFO, "Sent ");
@@ -3228,11 +3231,6 @@ dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
break;
}
- if (tree) {
- ti_cmd = proto_tree_add_item(tree, proto_bthci_cmd, tvb, offset, -1, ENC_NA);
- bthci_cmd_tree = proto_item_add_subtree(ti_cmd, ett_bthci_cmd);
- }
-
opcode = tvb_get_letohs(tvb, offset);
ocf = opcode & 0x03ff;
ogf = (guint8) (opcode >> 10);
@@ -3314,6 +3312,8 @@ dissect_bthci_cmd(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
proto_tree_add_expert(bthci_cmd_tree, pinfo, &ei_command_parameter_unexpected, tvb, offset, -1);
/*offset += tvb_length_remaining(tvb, offset);*/
}
+
+ return offset;
}
@@ -5140,7 +5140,7 @@ proto_register_bthci_cmd(void)
/* Register the protocol name and description */
proto_bthci_cmd = proto_register_protocol("Bluetooth HCI Command", "HCI_CMD", "bthci_cmd");
- register_dissector("bthci_cmd", dissect_bthci_cmd, proto_bthci_cmd);
+ new_register_dissector("bthci_cmd", dissect_bthci_cmd, proto_bthci_cmd);
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_bthci_cmd, hf, array_length(hf));