diff options
author | Michael Mann <mmann78@netscape.net> | 2013-02-21 22:00:32 +0000 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2013-02-21 22:00:32 +0000 |
commit | e094c213016f483a3d02deccd49cebc5f0e9797d (patch) | |
tree | 98f63fb2617ceba41113c92b693089e71cd9809c /epan/dissectors/packet-btavctp.c | |
parent | bfeeba6f5e9ae0994842992c04670247c71bd879 (diff) |
Minor Bluetooth fixes
1. Allow to DecodeBy payload over AVCTP
2. Fix L2CAP CID payload recognize after disc
3. Removed unneeded _U_
4. Fall back to control channel in AVRCP
5. Fix time-tracking for passthrough and capability AVRCP commands
From Michal Labedzki, bug 8367 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8367)
svn path=/trunk/; revision=47810
Diffstat (limited to 'epan/dissectors/packet-btavctp.c')
-rw-r--r-- | epan/dissectors/packet-btavctp.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/epan/dissectors/packet-btavctp.c b/epan/dissectors/packet-btavctp.c index d31bbf4fad..750d2e95b2 100644 --- a/epan/dissectors/packet-btavctp.c +++ b/epan/dissectors/packet-btavctp.c @@ -51,7 +51,8 @@ static int hf_btavctp_number_of_packets = -1; static gint ett_btavctp = -1; -static dissector_handle_t btavrcp_handle = NULL; +static dissector_table_t avctp_service_dissector_table; + static dissector_handle_t data_handle = NULL; typedef struct _fragment_t { @@ -187,10 +188,10 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) /* reassembling */ next_tvb = tvb_new_subset(tvb, offset, length, length); if (packet_type == PACKET_TYPE_SINGLE) { - if (pid == BTSDP_AVRCP_SERVICE_UUID && btavrcp_handle != NULL) - call_dissector(btavrcp_handle, next_tvb, pinfo, tree); - else + if (!dissector_try_uint(avctp_service_dissector_table, pid, next_tvb, pinfo, tree)) { call_dissector(data_handle, next_tvb, pinfo, tree); + } + } else { emem_tree_key_t key[6]; guint32 k_interface_id; @@ -377,9 +378,7 @@ dissect_btavctp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree) next_tvb = tvb_new_child_real_data(tvb, reassembled, length, length); add_new_data_source(pinfo, next_tvb, "Reassembled AVCTP"); - if (fragments->pid == BTSDP_AVRCP_SERVICE_UUID && btavrcp_handle != NULL) { - call_dissector(btavrcp_handle, next_tvb, pinfo, tree); - } else { + if (!dissector_try_uint(avctp_service_dissector_table, fragments->pid, next_tvb, pinfo, tree)) { call_dissector(data_handle, next_tvb, pinfo, tree); } } @@ -442,6 +441,8 @@ proto_register_btavctp(void) reassembling = se_tree_create(EMEM_TREE_TYPE_RED_BLACK, "btavctp reassembling"); + avctp_service_dissector_table = register_dissector_table("btavctp.service", "AVCTP Service", FT_UINT16, BASE_HEX); + proto_btavctp = proto_register_protocol("Bluetooth AVCTP Protocol", "AVCTP", "btavctp"); register_dissector("btavctp", dissect_btavctp, proto_btavctp); @@ -461,7 +462,6 @@ proto_reg_handoff_btavctp(void) dissector_handle_t btavctp_handle; btavctp_handle = find_dissector("btavctp"); - btavrcp_handle = find_dissector("btavrcp"); data_handle = find_dissector("data"); dissector_add_uint("btl2cap.service", BTSDP_AVCTP_PROTOCOL_UUID, btavctp_handle); |