diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2014-11-07 15:41:29 +0100 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2014-11-14 10:26:29 +0000 |
commit | 38218dfc5726f8ab6f1fc87a340905d0c45fb2fe (patch) | |
tree | 6f6f54442f0b3dad7a4b58f195b8b2e67b4bcfc7 /epan/dissectors/packet-btavrcp.c | |
parent | 5a46f2652b27b8a768627239ca75d12b0c62c69a (diff) |
Bluetooth: AVRCP: Improve command/response trancing
Make command/response tracking field filterable and jumpable.
Change-Id: Ib0dfc9ea9954f8d29d06ceda3d44a7f95c94bc53
Reviewed-on: https://code.wireshark.org/review/5288
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-btavrcp.c')
-rw-r--r-- | epan/dissectors/packet-btavrcp.c | 25 |
1 files changed, 21 insertions, 4 deletions
diff --git a/epan/dissectors/packet-btavrcp.c b/epan/dissectors/packet-btavrcp.c index aafebadb62..195d7b665a 100644 --- a/epan/dissectors/packet-btavrcp.c +++ b/epan/dissectors/packet-btavrcp.c @@ -196,6 +196,8 @@ static int hf_btavrcp_feature_uid_persistency = -1; static int hf_btavrcp_reassembled = -1; static int hf_btavrcp_currect_path = -1; static int hf_btavrcp_response_time = -1; +static int hf_btavrcp_command_in_frame = -1; +static int hf_btavrcp_response_in_frame = -1; static int hf_btavrcp_data = -1; static gint ett_btavrcp = -1; @@ -209,6 +211,7 @@ static gint ett_btavrcp_features = -1; static gint ett_btavrcp_features_not_used = -1; static gint ett_btavrcp_path = -1; +static expert_field ei_btavrcp_no_response = EI_INIT; static expert_field ei_btavrcp_item_length_bad = EI_INIT; static expert_field ei_btavrcp_unexpected_data = EI_INIT; @@ -2292,17 +2295,20 @@ dissect_btavrcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data) if (response_time > timing_info->max_response_time) { proto_item_append_text(pitem, "; TIME EXCEEDED"); } + PROTO_ITEM_SET_GENERATED(pitem); if (timing_info->response_frame_number == 0) { - proto_item_append_text(pitem, "; There is no response"); + pitem = proto_tree_add_expert(btavrcp_tree, pinfo, &ei_btavrcp_no_response, tvb, 0, 0); + PROTO_ITEM_SET_GENERATED(pitem); } else { if (is_command) { - proto_item_append_text(pitem, "; Response is at frame: %u", timing_info->response_frame_number); + pitem = proto_tree_add_uint(btavrcp_tree, hf_btavrcp_response_in_frame, tvb, 0, 0, timing_info->response_frame_number); + PROTO_ITEM_SET_GENERATED(pitem); } else { - proto_item_append_text(pitem, "; Command is at frame: %u", timing_info->command_frame_number); + pitem = proto_tree_add_uint(btavrcp_tree, hf_btavrcp_command_in_frame, tvb, 0, 0, timing_info->command_frame_number); + PROTO_ITEM_SET_GENERATED(pitem); } } - PROTO_ITEM_SET_GENERATED(pitem); } @@ -3122,6 +3128,16 @@ proto_register_btavrcp(void) FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } }, + { &hf_btavrcp_command_in_frame, + { "Command in frame", "btavrcp.command_in_frame", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, + { &hf_btavrcp_response_in_frame, + { "Response in frame", "btavrcp.response_in_frame", + FT_FRAMENUM, BASE_NONE, NULL, 0x00, + NULL, HFILL } + }, { &hf_btavrcp_data, { "Data", "btavrcp.data", FT_NONE, BASE_NONE, NULL, 0x0, @@ -3143,6 +3159,7 @@ proto_register_btavrcp(void) static ei_register_info ei[] = { { &ei_btavrcp_item_length_bad, { "btavrcp.item.length.bad", PI_PROTOCOL, PI_WARN, "Item length does not correspond to sum of length of attributes", EXPFILL }}, { &ei_btavrcp_unexpected_data, { "btavrcp.unexpected_data", PI_PROTOCOL, PI_WARN, "Unexpected data", EXPFILL }}, + { &ei_btavrcp_no_response, { "btavrcp.no_response", PI_PROTOCOL, PI_WARN, "No response", EXPFILL }}, }; reassembling = wmem_tree_new_autoreset(wmem_epan_scope(), wmem_file_scope()); |