diff options
author | Michael Mann <mmann78@netscape.net> | 2013-11-02 19:20:04 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-11-02 19:20:04 +0000 |
commit | a267501b82a84ab3d5b9cb7d2f06129d5ca57e42 (patch) | |
tree | 056e815b8f475e4c3b5ae57d80f89e202d47aa13 /epan/dissectors/packet-bthci_sco.c | |
parent | 2c85824a469dba2edc674f29a18058bcec19139e (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_sco.c')
-rw-r--r-- | epan/dissectors/packet-bthci_sco.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/epan/dissectors/packet-bthci_sco.c b/epan/dissectors/packet-bthci_sco.c index 906ec53ba0..b8fc4e7958 100644 --- a/epan/dissectors/packet-bthci_sco.c +++ b/epan/dissectors/packet-bthci_sco.c @@ -45,12 +45,15 @@ void proto_register_bthci_sco(void); void proto_reg_handoff_bthci_sco(void); /* Code to actually dissect the packets */ -static void -dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) +static gint +dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) { proto_item *ti; proto_tree *bthci_sco_tree; - int offset = 0; + gint offset = 0; + + ti = proto_tree_add_item(tree, proto_bthci_sco, tvb, offset, -1, ENC_NA); + bthci_sco_tree = proto_item_add_subtree(ti, ett_bthci_sco); switch (pinfo->p2p_dir) { case P2P_DIR_SENT: @@ -65,10 +68,6 @@ dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) break; } - ti = proto_tree_add_item(tree, proto_bthci_sco, tvb, offset, -1, ENC_NA); - bthci_sco_tree = proto_item_add_subtree(ti, ett_bthci_sco); - - proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_chandle, tvb, offset, 2, ENC_LITTLE_ENDIAN); offset += 2; @@ -76,6 +75,8 @@ dissect_bthci_sco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree) offset++; proto_tree_add_item(bthci_sco_tree, hf_bthci_sco_data, tvb, offset, -1, ENC_NA); + + return tvb_length(tvb); } @@ -107,7 +108,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"); - register_dissector("bthci_sco", dissect_bthci_sco, proto_bthci_sco); + 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)); |