diff options
author | Michal Labedzki <michal.labedzki@tieto.com> | 2015-12-14 17:28:06 +0100 |
---|---|---|
committer | Michal Labedzki <michal.labedzki@tieto.com> | 2016-01-20 11:47:40 +0000 |
commit | d51989e3ac8b1bab43a89ef07e12065a1c7485a0 (patch) | |
tree | 9b9495af5ff2577227a9ac1b729ee277b431bbe6 /epan/dissectors/packet-bthci_evt.c | |
parent | 5de7817315eddd5ee712d1bf9bfd4e379dbdb624 (diff) |
Bluetooth: Add dissector table for EIR/AD Manufacturer content
Now it is possible to DecodeAs manufacturer specific content of
EIR or AD, so you are able to write custom plugin to dissect it.
New dissector table: btcommon.eir_ad.manufacturer_company_id
Change-Id: Iac458cd51f7b9bab51ccf7a4411984fb269a86ef
Reviewed-on: https://code.wireshark.org/review/13389
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_evt.c')
-rw-r--r-- | epan/dissectors/packet-bthci_evt.c | 32 |
1 files changed, 29 insertions, 3 deletions
diff --git a/epan/dissectors/packet-bthci_evt.c b/epan/dissectors/packet-bthci_evt.c index 7cf68a5bda..e939f1aaea 100644 --- a/epan/dissectors/packet-bthci_evt.c +++ b/epan/dissectors/packet-bthci_evt.c @@ -2054,7 +2054,14 @@ dissect_bthci_evt_le_meta(tvbuff_t *tvb, int offset, packet_info *pinfo, offset += 1; if (length > 0) { - call_dissector_with_data(btcommon_ad_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree, bluetooth_data); + bluetooth_eir_ad_data_t *ad_data; + + ad_data = wmem_new0(wmem_packet_scope(), bluetooth_eir_ad_data_t); + ad_data->interface_id = bluetooth_data->interface_id; + ad_data->adapter_id = bluetooth_data->adapter_id; + ad_data->bd_addr = bd_addr; + + call_dissector_with_data(btcommon_ad_handle, tvb_new_subset_length(tvb, offset, length), pinfo, tree, ad_data); save_remote_device_name(tvb, offset, pinfo, length, bd_addr, bluetooth_data); offset += length; } @@ -2944,6 +2951,14 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, break; case 0x0c51: /* Read Extended Inquiry Response */ + { + bluetooth_eir_ad_data_t *eir_data; + + eir_data = wmem_new0(wmem_packet_scope(), bluetooth_eir_ad_data_t); + eir_data->interface_id = bluetooth_data->interface_id; + eir_data->adapter_id = bluetooth_data->adapter_id; + eir_data->bd_addr = NULL; + proto_tree_add_item(tree, hf_bthci_evt_status, tvb, offset, 1, ENC_LITTLE_ENDIAN); send_hci_summary_status_tap(tvb_get_guint8(tvb, offset), pinfo, bluetooth_data); offset += 1; @@ -2951,9 +2966,10 @@ dissect_bthci_evt_command_complete(tvbuff_t *tvb, int offset, proto_tree_add_item(tree, hf_bthci_evt_fec_required, tvb, offset, 1, ENC_LITTLE_ENDIAN); offset += 1; - call_dissector_with_data(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, tree, bluetooth_data); + call_dissector_with_data(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, tree, eir_data); offset += 240; + } break; case 0x0c55: /* Read Simple Pairing Mode */ @@ -4206,12 +4222,22 @@ dissect_bthci_evt(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *dat break; case 0x2f: /* Extended Inquiry Result */ + { + bluetooth_eir_ad_data_t *eir_data; + previous_offset = offset; offset = dissect_bthci_evt_inquire_result_with_rssi(tvb, offset, pinfo, bthci_evt_tree, bluetooth_data, bd_addr); - call_dissector_with_data(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, bthci_evt_tree, bluetooth_data); + eir_data = wmem_new0(wmem_packet_scope(), bluetooth_eir_ad_data_t); + eir_data->interface_id = bluetooth_data->interface_id; + eir_data->adapter_id = bluetooth_data->adapter_id; + eir_data->bd_addr = bd_addr; + + + call_dissector_with_data(btcommon_eir_handle, tvb_new_subset_length(tvb, offset, 240), pinfo, bthci_evt_tree, eir_data); save_remote_device_name(tvb, offset, pinfo, 240, (offset - previous_offset <= 1) ? NULL : bd_addr, bluetooth_data); offset += 240; + } break; |