diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2015-06-08 19:38:48 +0200 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2015-07-17 13:54:43 +0000 |
commit | 3faec795e9c5b5f153f66960c11673c2f53e4243 (patch) | |
tree | 4df5f704a41290a0a0694c3896a8a7e6521001ac /epan/dissectors/packet-bthci_vendor.c | |
parent | 6514dece0c755854081a0a0ccb525e6bc9dbbaff (diff) | |
download | wireshark-3faec795e9c5b5f153f66960c11673c2f53e4243.tar.gz wireshark-3faec795e9c5b5f153f66960c11673c2f53e4243.tar.bz2 wireshark-3faec795e9c5b5f153f66960c11673c2f53e4243.zip |
Qt/Bluetooth: Add HCI Summary dialogue
HCI Summary dialogue collect HCI Opcodes, HCI Events, Hardware Errors,
Statuses and Reasons. Also show occurrence of them. The top level item
is group of items (by OGF or types), the second level item is in real
command, event, hardware error, status or reason. The third level items
are direct link to packet that contains second level item type.
Change-Id: I6b6bd02533c4605a2dd2c1f5dfee46f72a0f3fdc
Reviewed-on: https://code.wireshark.org/review/9676
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Diffstat (limited to 'epan/dissectors/packet-bthci_vendor.c')
-rw-r--r-- | epan/dissectors/packet-bthci_vendor.c | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/epan/dissectors/packet-bthci_vendor.c b/epan/dissectors/packet-bthci_vendor.c index 62872ac275..813ee013ab 100644 --- a/epan/dissectors/packet-bthci_vendor.c +++ b/epan/dissectors/packet-bthci_vendor.c @@ -26,6 +26,7 @@ #include <epan/packet.h> #include <epan/expert.h> +#include <epan/tap.h> #include "packet-bluetooth.h" #include "packet-bthci_cmd.h" @@ -404,6 +405,28 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre else col_append_fstr(pinfo->cinfo, COL_INFO, "Unknown Command 0x%04X (opcode 0x%04X)", ocf, opcode); + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_OPCODE; + tap_hci_summary->ogf = opcode >> 10; + tap_hci_summary->ocf = ocf; + if (try_val_to_str(ocf, opcode_ocf_vals)) + tap_hci_summary->name = description; + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + proto_tree_add_item(main_tree, hf_parameter_length, tvb, offset, 1, ENC_NA); length = tvb_get_guint8(tvb, offset); offset += 1; @@ -757,10 +780,32 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre col_add_fstr(pinfo->cinfo, COL_INFO, "Rcvd Broadcom "); event_code = tvb_get_guint8(tvb, offset); - col_append_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(event_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%08x")); + description = val_to_str_ext_const(event_code, &bthci_evt_evt_code_vals_ext, "Unknown 0x%08x"); + col_append_str(pinfo->cinfo, COL_INFO, description); proto_tree_add_item(main_tree, hf_event_code, tvb, offset, 1, ENC_NA); offset += 1; + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT; + tap_hci_summary->event = event_code; + if (try_val_to_str_ext(event_code, &bthci_evt_evt_code_vals_ext)) + tap_hci_summary->name = description; + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + proto_tree_add_item(main_tree, hf_parameter_length, tvb, offset, 1, ENC_NA); length = tvb_get_guint8(tvb, offset); offset += 1; @@ -785,6 +830,28 @@ dissect_bthci_vendor_broadcom(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tre else col_append_fstr(pinfo->cinfo, COL_INFO, " (Unknown Command 0x%04X [opcode 0x%04X])", ocf, opcode); + if (have_tap_listener(bluetooth_hci_summary_tap)) { + bluetooth_hci_summary_tap_t *tap_hci_summary; + + tap_hci_summary = wmem_new(wmem_packet_scope(), bluetooth_hci_summary_tap_t); + if (bluetooth_data) { + tap_hci_summary->interface_id = bluetooth_data->interface_id; + tap_hci_summary->adapter_id = bluetooth_data->adapter_id; + } else { + tap_hci_summary->interface_id = HCI_INTERFACE_DEFAULT; + tap_hci_summary->adapter_id = HCI_ADAPTER_DEFAULT; + } + + tap_hci_summary->type = BLUETOOTH_HCI_SUMMARY_VENDOR_EVENT_OPCODE; + tap_hci_summary->ogf = opcode >> 10; + tap_hci_summary->ocf = ocf; + if (try_val_to_str(ocf, opcode_ocf_vals)) + tap_hci_summary->name = description; + else + tap_hci_summary->name = NULL; + tap_queue_packet(bluetooth_hci_summary_tap, pinfo, tap_hci_summary); + } + proto_tree_add_item(main_tree, hf_status, tvb, offset, 1, ENC_NA); status = tvb_get_guint8(tvb, offset); offset += 1; |