Commit Graph

153 Commits

Author SHA1 Message Date
Evan Huus 85d2eef619 btatt: guard against incomplete reassembly
If we try and reassemble a fragment whose end does not line up exactly with the
start of the following fragment, abort or else we will leave uninitialized gaps
in the resulting buffer.

Bug: 11436
Change-Id: I4cd05c1a9ac4404bf70a3945f80b12f7bf5f74ee
Reviewed-on: https://code.wireshark.org/review/9983
Reviewed-by: Evan Huus <eapache@gmail.com>
Petri-Dish: Evan Huus <eapache@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-15 06:52:38 +00:00
Gerald Combs c8ca0ae67f Try to fix casting issues with older versions of GLib.
Try to fix

packet-btatt.c: In function 'btatt_handle_value':
packet-btatt.c:1420: warning: cast to pointer from integer of different size
packet-btatt.c: In function 'btatt_uuid16_value':
packet-btatt.c:1443: warning: cast to pointer from integer of different size

on the 32-bit OS X builder.

Change-Id: I02884c02e7f7f5f7b50da122127fa96c41c3603a
Reviewed-on: https://code.wireshark.org/review/9913
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-07 16:15:29 +00:00
Michal Labedzki 8906e93096 Bluetooth: Fix some MSVC2015 warnings/errors
packet-btobex.c(1134): error C2220: warning treated as error - no 'object' file generated
packet-btobex.c(1134): warning C4312: 'type cast': conversion from 'gulong' to ' gpointer' of greater size
packet-btatt.c(1420): error C2220: warning treated as error - no 'object' file generated
packet-btatt.c(1420): warning C4312: 'type cast': conversion from 'gulong' to 'gpointer' of greater size
packet-btatt.c(1443): warning C4312: 'type cast': conversion from 'gulong' to 'gpointer' of greater size
packet-btl2cap.c(425): error C2220: warning treated as error - no 'object' file generated
packet-btl2cap.c(425): warning C4312: 'type cast': conversion from 'gulong' to 'gpointer' of greater size
packet-btl2cap.c(448): warning C4312: 'type cast': conversion from 'gulong' to 'gpointer' of greater size
packet-btrfcomm.c(287): error C2220: warning treated as error - no 'object' file generated
packet-btrfcomm.c(287): warning C4312: 'type cast': conversion from 'gulong' to 'gpointer' of greater size

Change-Id: Ie5b4fd1c47725b966f9b98d9480c1858b553efff
Reviewed-on: https://code.wireshark.org/review/9894
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-08-06 09:57:25 +00:00
Michal Labedzki 3b2e6d9610 Revert "[MSVC 2015] Fix errors seen with the released version by reverting the code to what failed on the RC version *sigh*"
Reverted commit break DecodeAs for Bluetooth, also caused crashes.

This reverts commit 2221153a9c.

Change-Id: Idb91747b986f110fffa3444f8c52d800c128e141
Reviewed-on: https://code.wireshark.org/review/9877
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-05 17:29:54 +00:00
AndersBroman 2221153a9c [MSVC 2015] Fix errors seen with the released version by reverting the
code to what failed on the RC version *sigh*

Change-Id: I1b7f6d57da4cb71473a074291da7e5a0d5242c95
Reviewed-on: https://code.wireshark.org/review/9874
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-08-05 12:40:36 +00:00
Michal Labedzki dac7cf9f8c Bluetooth: Add generic UUID table for DecodeBy
Replace L2CAP Service, RFCOMM Service and AVCTP PID dissector table
by shared Bluetooth Service UUID table. It also supports UUID16,
UUID32 and UUID128 by hex-string, like for AVRCP: "110e".

Change-Id: I473bc73d10939e8ed6dd55a6a92387c7a1ec125a
Reviewed-on: https://code.wireshark.org/review/9678
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-07-17 08:06:40 +00:00
Anders Broman e92086849a Revert "[MSVC2015] TRy to fix Warnings turned errors."
This reverts commit 8d78077d0d.

Reverted as requested.

Change-Id: I99461820d28215a52cc6bae6792f2892018d28b8
Reviewed-on: https://code.wireshark.org/review/9609
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-07-12 20:05:21 +00:00
Michal Labedzki 7102a06811 Qt/Bluetooth: Add Devices dialogue
Please found it under Bluetooth menu. It shows all devices found
in logs, not only connected, all that its address can be found in
logs. Show if device is local (in most cases: capturing on it side)
and manufacturer and LMP version what should answer the question what
version of Bluetooth is used by Bluetooth device chip.
Also firmware version.

Change-Id: I32e3b7100cdebcaa850b6541de0ab89dff41c0e1
Reviewed-on: https://code.wireshark.org/review/8901
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-06-15 05:40:25 +00:00
Anders 8d78077d0d [MSVC2015] TRy to fix Warnings turned errors.
Change-Id: I1156e66daad84004f4f7acae0175fcbb475db71a
Reviewed-on: https://code.wireshark.org/review/8760
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-04 13:32:17 +00:00
Michal Labedzki 187dedee03 Bluetooth: ATT: Enable UUID128 field
API used by this field is implemented, so field can be enabled now.

Change-Id: Ifc8de81157c9b125ba769d14ec57a498d9810c5f
Reviewed-on: https://code.wireshark.org/review/8507
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-05-18 07:08:33 +00:00
Michal Labedzki 2e8639d64b Bluetooth: ATT: Add request/response visual indicators
Use feature for visual tracking request/response on Packet List.

Change-Id: Iabe2ddf46425ebd586ec462140b3f7d8f7ebbf56
Reviewed-on: https://code.wireshark.org/review/7525
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>
2015-03-06 09:20:05 +00:00
Pascal Quantin 678a9b6463 BT ATT: memory given to add_new_data_source() must be allocated in pinfo scope
Bug: 10952
Change-Id: I0eb8e6891c35c70c9d405db87824c442caaa2f30
Reviewed-on: https://code.wireshark.org/review/7085
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-02-12 16:27:24 +00:00
Michal Labedzki 707522396c Little tuning of proto_tree_add_bytes_with_length
Change name from proto_tree_add_new_bytes to
proto_tree_add_bytes_with_length and other tweaks
pointed by Peter Wu.

Change-Id: I6058c28a74a154e2882e4eb04558bedcede6f508
Reviewed-on: https://code.wireshark.org/review/7039
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-12 09:22:55 +00:00
Guy Harris 3066d6b29f Don't call the Bluetooth code's UUID type "uuid_t".
uuid_t is a data type provided by a number of environments, thanks to
the Open Software Fuundation; calling the Bluetooth code's data type,
which includes an actual OSF-style UUID as a member, "uuid_t" can lead
to confusion and *does* lead to compile errors on platforms where, for
better or worse, system headers such as <unistd.h> define uuid_t (and
are included by, for example, Qt headers).

Just rename it "bluetooth_uuid_t".

Change-Id: Ic742723913ba4105cd3269dd24fc821147285176
Reviewed-on: https://code.wireshark.org/review/7017
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-07 22:52:06 +00:00
Michal Labedzki 13f6bce802 Bluetooth: ATT: Use proto_tree_add_new_bytes for UUID128
Change-Id: I018b3e125bcbb6908276dd2b3b9f66def9aa745b
Reviewed-on: https://code.wireshark.org/review/6907
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-07 16:56:17 +00:00
Bill Meier 722ce56cf0 btatt: fix bug ("Labeled code is unreachable");
Introduced in gca3fe28;
 Found by MSVC2013 Code Analysis

Change-Id: I4c754dfacca492b53debdaf82557e4fe91698460
Reviewed-on: https://code.wireshark.org/review/6991
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-07 16:53:57 +00:00
Michal Labedzki fb00452b30 Bluetooth/GUI: ATT: Add Server Attribute Table
It is a GUI+QT feature that introduce Bluetooth menu and
"ATT Server Attributes" that present all handle+UUID pairs
as table. User may copy cell value, row, selected rows or whole
table within header. On activate user will go to packet that
introduce UUID for specified handle.

Change-Id: If17e53aff5feb89ededc740a595ba5882b90be5e
Reviewed-on: https://code.wireshark.org/review/6911
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-07 16:35:39 +00:00
Michal Labedzki 2ff79ddeb2 Bluetooth: ATT: Fix Running Walking Sensor field name
Change-Id: I595c169e476cf86aa77ca926f4ce0d5d0e4aecd1
Reviewed-on: https://code.wireshark.org/review/7002
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-07 16:32:05 +00:00
Michal Labedzki 7610a69251 Bluetooth: ATT: Fix not missing break
"Break" is not missing, "error opcode" is part of opcode "Error Response"
that is needed to fetch request data.

Change-Id: I35432b22fae492a93332a8787213dd8fcf796e3b
Reviewed-on: https://code.wireshark.org/review/7001
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-07 16:31:51 +00:00
Alexis La Goutte 1eec03469d Bluetooth: ATT: Missing break in switch (CID 1268199)
Change-Id: I562f1b8c1d39586c2a3f25363e89e81587176c58
Reviewed-on: https://code.wireshark.org/review/6987
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-07 09:05:39 +00:00
Alexis La Goutte 1ecd0ad076 Bluetooth: ATT: Fix Dead Store (Dead assignement/Dead increment) warning found by Clang
Change-Id: Id323b783e2931ad9b4e08727df91c8e0138d35c1
Reviewed-on: https://code.wireshark.org/review/6986
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-02-07 09:04:16 +00:00
Gerald Combs a2eec54285 BT ATT: Fix what appears to be a value string mismatch.
Change-Id: I440ed41c659bed9dcee43d8388ad780015971611
Reviewed-on: https://code.wireshark.org/review/6930
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-03 16:57:37 +00:00
Michal Labedzki e9429732ff Bluetooth/USB HID: Move boot form of reports from bthid to usbhid
Then call it as new dissectors from bthid and btatt.
In future they will be used in usbhid, because they are part of HID.

Change-Id: I9cb545f3079c27945b17bf8791ba4e3736c29e7c
Reviewed-on: https://code.wireshark.org/review/6912
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>
2015-02-03 12:05:43 +00:00
Guy Harris 8417fbf6f9 Initialize the entire UUID.
Squelches a compiler warning.

Change-Id: I050710dd296f7fe7d315f881b0edf43699d2fa91
Reviewed-on: https://code.wireshark.org/review/6928
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-03 07:53:12 +00:00
Michal Labedzki ca3fe281f5 Bluetooth: ATT: Dissect almost all attributes
Change-Id: Ia388c07150d9664327daf2d1990b4465b5f4ae28
Reviewed-on: https://code.wireshark.org/review/6910
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>
2015-02-03 06:45:56 +00:00
Michal Labedzki 60b9be9644 Bluetooth: ATT: Dissect Read Multiple Response
Change-Id: Ifcbde05389901bd66355e42540f3850bfd55def5
Reviewed-on: https://code.wireshark.org/review/6909
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-03 06:45:43 +00:00
Michal Labedzki db068ff60f Bluetooth: ATT: Decode some HOGP attributes
Change-Id: I169f767b699a2f95e5a1553f1380f0b88cd7c67d
Reviewed-on: https://code.wireshark.org/review/6908
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-03 06:45:32 +00:00
Michal Labedzki 73579ddb34 Bluetooth: ATT: Dissection stage 3: Assign UUID to Handle
Add possibility to dissect attributes by UUID assigned to handle.

Change-Id: I0e510bf902492f87e0eaee339d82609c37e12741
Reviewed-on: https://code.wireshark.org/review/6905
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-03 06:45:20 +00:00
Michal Labedzki 8ba3d6fbe6 Bluetooth: ATT: Dissect GATT level
ATT dissector is now able to decode GATT level fields.
This is results of added request-response tracking/share information.

Change-Id: I41ac622a38916a7a20f625fa30ac72d7812446c6
Reviewed-on: https://code.wireshark.org/review/6904
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-03 06:45:07 +00:00
Michal Labedzki 6521771124 Bluetooth: Simplify to "UnknownDirection" in Info column when direction is unknown
Change-Id: Ibad679c0b6c95d65389ce087f65b8f31cf3acd68
Reviewed-on: https://code.wireshark.org/review/6903
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-02-02 10:48:56 +00:00
Michal Labedzki c69b2ab320 Bluetooth: ATT: Dissect opcode with more precision
Change-Id: Iddc1a6d899b10b0d5c25723a71da7dcd11c6dfad
Reviewed-on: https://code.wireshark.org/review/6405
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-10 15:35:03 +00:00
Michal Labedzki f5cd21543d Bluetooth: Add generic Bluetooth dissector
Bluetooth dissector is used to add ability to filter all bluetooth
payload from capture files (there are many transport like:
hci_h4, hci_h1, hci_usb, hci_mon, btle). Also it is used to placeholder for
all data tree used to store additional informations like bd_addrs, names, etc.
Finally it is used to be one point for Bluetooth
Endpoints/Conversation filtering what is enabled now.

Also add Master/Slave Role and Connection Mode tracking.

Change-Id: I67048080fb8ee16fa0f4ec429c1257de81ddd737
Reviewed-on: https://code.wireshark.org/review/5771
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-12-18 11:03:05 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Michal Labedzki 444cdf5f6b Bluetooth: ATT: Add missing offset calculations
Change-Id: Ia0fe426bff7d48a45d915a18aa679bb8978d2fca
Reviewed-on: https://code.wireshark.org/review/1095
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-04-14 06:24:30 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Michael Mann 11a61d757d Bluetooth/Ubertooth improvements. Bug 9606 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9606)
From Michal Labedzki

1. Bluetooth: Implement the rest of fields in Low Energy Link Layer dissector
2. Bluetooth: Merge all UUIDs together
3. Bluetooth: Extract LE Channel MAP to separate dissector
4. Ubertooth: Dissect CC2400 registers

svn path=/trunk/; revision=54700
2014-01-12 02:29:51 +00:00
Michael Mann a267501b82 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
2013-11-02 19:20:04 +00:00
Bill Meier 0ad98563a2 From didier gautheron: remove redundant or use faster col_xxx functions
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster.
- same for  replace col_append_fstr and col_append_str
- remove col_clear() when it's redundant:
    + before a col_set/col_add if the dissector can't throw an exception.
- replace col_append() after a col_clear() with faster col_add... or col_set

   https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344


svn path=/trunk/; revision=52948
2013-10-29 14:09:20 +00:00
Michael Mann 3cc6957fa8 Bluetooth: Use items for logical block objects. Bug 9327 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9327)
Bluetooth protocols use items, so dissect it to improve filtering and better user experience - text object cannot be filterable or comparable.

From Michal Labedzki

svn path=/trunk/; revision=52863
2013-10-26 02:24:04 +00:00
Jakub Zawadzki 5fa2a99087 Keep result of [new_]register_dissector in some dissectors.
svn path=/trunk/; revision=51156
2013-08-05 18:09:43 +00:00
Anders Broman 24a60b1d6c From Michal Labedzki:
ATT: remove trailing white characters.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8948

svn path=/trunk/; revision=50811
2013-07-23 03:56:38 +00:00
Michael Mann 6b3ac2d952 Batch of filterable expert infos.
svn path=/trunk/; revision=50454
2013-07-09 01:18:52 +00:00
Alexis La Goutte 361b800eae Remove trailing whitespace
svn path=/trunk/; revision=50369
2013-07-03 16:46:20 +00:00
Alexis La Goutte 172b0237a3 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=50349
2013-07-03 16:43:12 +00:00
Evan Huus 6976653023 From Michal Labedzki via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8509
Unify bluetooth direction handling (sent vs rcvd).

svn path=/trunk/; revision=48661
2013-03-30 21:47:27 +00:00
Pascal Quantin d31620a7bf From Michal Labedzki via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 :
Remove C++ incompatibilities from Bluetooth dissectors and switch to wmem API

svn path=/trunk/; revision=48414
2013-03-19 13:51:52 +00:00
Anders Broman 3b24b8bbef From Michal Labedzki:
Be consistent in short name of protocols

Use prefix "BT " in short name for all Bluetooth dissectors. A reason
for that is protocol names start by "bt", Bluetooth dissectors can
be easy identificated, also DecodeBy looks better (sorted).
Please be note that "SDP" is reserved for different dissector, so using
"BT SDP" is good choice.

Also fix two naming mistakes.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8304

svn path=/trunk/; revision=48389
2013-03-18 06:23:22 +00:00
Anders Broman 2ae1d08bbe From Michal Labedzki:
Fix issues found by fix-encoding-args.pl
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8304

svn path=/trunk/; revision=48388
2013-03-18 06:13:09 +00:00
Jakub Zawadzki c5a71b1006 String passed to val_to_str() must have int format specifier (%u, %d, %x, and so on...).
Fix some cases (easy to grep) by call to val_to_str_const().

svn path=/trunk/; revision=47807
2013-02-21 21:04:59 +00:00
Pascal Quantin bbadc4134e Add missing newline at end of file
svn path=/trunk/; revision=45716
2012-10-22 16:12:37 +00:00
Anders Broman 0eefbb4b09 Fix
../../../epan/dissectors/packet-btatt.c:299:25: error: too many arguments for format [-Werror=format-extra-args]
../../../epan/dissectors/packet-btatt.c:254:12: error: unused variable 'col_info' [-Werror=unused-variable]

svn path=/trunk/; revision=45710
2012-10-22 13:23:42 +00:00
Anders Broman 576b37ddd8 from Allan M. Madsen:
Add support for HCI 3.0+HS and v4.0, Bluetooth Low Energy. This includes
dissection of additional HCI commands and events, Attribute Protocol and
Security Manager Protocol.

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7872

svn path=/trunk/; revision=45709
2012-10-22 12:49:04 +00:00