Commit graph

66 commits

Author SHA1 Message Date
Michal Labedzki
768e37b792 Bluetooth: Fix tools/checkAPI issues
Change-Id: I8ffbd4a0da800594d9888f6a30612d4fc5273119
Reviewed-on: https://code.wireshark.org/review/7474
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-02 18:28:17 +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
1a30c9767a Bluetooth: A2DP: APT-X: Unhardcode stream configuration
Change-Id: I16cfb4d014020a7fb2c67fef3128021c9901719a
Reviewed-on: https://code.wireshark.org/review/6442
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:36:39 +00:00
Michal Labedzki
17f1a44168 Bluetooth: AVDTP: Fix other-side Reconfigure
It is used to properly configure internal SEP data using to
properly decode music stream.

Change-Id: If8a15267ce072eaedfac947d7558be2d3e796483
Reviewed-on: https://code.wireshark.org/review/6404
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-09 07:00:41 +00:00
Michal Labedzki
5be440f1cb Bluetooth: AVDTP/VDP: Add link to first and last packet in the stream
Useful for analyzing stream issues.

Change-Id: I1c9f43807dc3abc050cf17c971fbd270b812faa5
Reviewed-on: https://code.wireshark.org/review/6402
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>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-01-09 07:00:21 +00:00
Michal Labedzki
e63e77169c Bluetooth: AVDTP: Present bitfields for codec ad true/false
Previously they are present as hex value.

Change-Id: Ia30ba4da02e6bd4b0d68987506245e0534feadb6
Reviewed-on: https://code.wireshark.org/review/6400
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-08 14:45:48 +00:00
Martin Mathieson
596669f921 First batch of unincludes. Last attempt...
Change-Id: I3681462aeb98ca62ed3ec5eb226b2553317391a9
Reviewed-on: https://code.wireshark.org/review/5997
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-22 21:03:13 +00:00
Bill Meier
b5d7b7ab6e Cleanup use of #includes in non-generated epan/dissector/*.c
Specifically:
- Set packet.h to be the first wireshark #include after
   config.h and "system" #includes.
   packet.h added as an #include in some cases when missing.
- Remove some #includes included (directly/indirectly) in
   packet.h. E.g., glib.h.
   (Done only for those files including packet.h).
- As needed, move "system" #includes to be after config.h and
   before wireshark #includes.
- Rework various #include file specifications for consistency.
- Misc.

Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95
Reviewed-on: https://code.wireshark.org/review/5923
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-21 05:46:22 +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
Alexis La Goutte
7f7d566518 btavdtp: Add missing break;
Issue found by Clang Analyzer:
Value stored to 'codec_dissector' is never read

Change-Id: I7a9fc5e3ffd04c77cbbb8d5e5b885d8a29468cfd
Reviewed-on: https://code.wireshark.org/review/5330
Reviewed-by: Balint Reczey <balint@balintreczey.hu>
2014-11-16 14:56:25 +00:00
Michal Labedzki
f1dee59d66 Bluetooth: A2DP: Add AVRCP song position indicator
"sbc.avrcp_song_position" can be used to determine time synchronization
between AVRCP and A2DP. It is updated on every
AVRCP PlaybackPositionChanged. Also provide version for aptx.

Change-Id: I48cd49f0fee54131a738290e2a70a24d33ba1d22
Reviewed-on: https://code.wireshark.org/review/5290
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-14 10:28:22 +00:00
Michal Labedzki
6e44997584 Bluetooth: AVDTP: Add possibility to force decode as APT-X
Change-Id: Id99647846c9bc7666f33938c811358576353390d
Reviewed-on: https://code.wireshark.org/review/5286
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-14 10:25:31 +00:00
Michal Labedzki
fc4471f061 Bluetooth: A2DP: APT-X does not use RTP while there is no content protection
Change-Id: I5ff8ffdda827b08ee7e284c15e70dadc368b009e
Reviewed-on: https://code.wireshark.org/review/4906
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>
2014-10-22 13:07:57 +00:00
Michal Labedzki
56a09d24dc Try to fix some buildbot warnings
Most interesting are:
 warning: cannot optimize loop, the loop counter may overflow [-Wunsafe-loop-optimizations]
 warning: ISO C forbids zero-size array [-Wpedantic]
 warning: ISO C90 doesn't support unnamed structs/unions [-Wpedantic]
 warning: cast discards '__attribute__((const))' qualifier from pointer target type [-Wcast-qual
 warning: initializer element is not computable at load time [enabled by default]

Change-Id: I5573c6bdca856a304877d9bef643f8c0fa93cdaf
Reviewed-on: https://code.wireshark.org/review/3174
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>
2014-09-22 10:52:03 +00:00
Michal Labedzki
9fce9ba188 Bluetooth: ACL/AVDTP: Fix ACL session handling
In case like reusing "connection handle" number in next connection
(2 -> 3 -> 2 again) AVDTP dissector does not properly dissected packets
(it should be Signal, but dissect as Media).

Add expert error to all packets that are not in ACL connection. This will
show invalid packages (send after dissconnect), however incomplete
(mostly beginning) connection will be marked too, but I think it have more
pros than cons.

Change-Id: I29cf706600cb12c8b93d0188dd2fba18dd5eba88
Reviewed-on: https://code.wireshark.org/review/4167
Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-19 20:13:18 +00:00
Michal Labedzki
10fc6e2531 Bluetooth: A2DP: Fix fuzz failture
Fix invalid structure casting by using defaults values,
this also fix DecodeAs for A2DP.

Do the same for VDP.

Change-Id: I360787af648ed65205eb54732ab6d88f8532cf15
Reviewed-on: https://code.wireshark.org/review/2551
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-06-22 16:56:48 +00:00
Guy Harris
ce3d2ff3de Rename dissector_add_handle() to dissector_add_for_decode_as().
Hopefully that name makes it clear what the routiner's purpose is, and
will encourage people to use it rather than using dissector_add_uint()
with a bogus integer value.

Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8
Reviewed-on: https://code.wireshark.org/review/2483
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-20 16:43:56 +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
Martin Kaiser
a1656bc421 fix
packet-btavdtp.c: In function 'dissect_bta2dp':
packet-btavdtp.c:2796:36: error: 'sep_data.vendor_codec' may be used uninitialized in this function [-Werror=maybe-uninitialized]
packet-btavdtp.c:2799:12: error: 'sep_data.vendor_id' may be used uninitialized in this function [-Werror=maybe-uninitialized]

Change-Id: I5b9e22e7ec787430ee25d2cd7dbe13f854f9eaa2
Reviewed-on: https://code.wireshark.org/review/1884
Reviewed-by: Martin Kaiser <wireshark@kaiser.cx>
2014-05-30 13:08:26 +00:00
Michal Labedzki
1258ce7bce Bluetooth: AVDTP: First step to fully support AVDTP session
Session should be finished too on HCI Disconnect and Adapter disappear.

Change-Id: I0823872e60ec932fc0831975e54dc33d49fb5dbc
Reviewed-on: https://code.wireshark.org/review/1882
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-05-30 11:27:33 +00:00
Michal Labedzki
49cc95784b Bluetooth: AVDTP: Add support for APT-X configuration
Also add Service informations to Info column and service item.

Change-Id: I0a565df94d7980432c524bd675b291f0e80704e5
Reviewed-on: https://code.wireshark.org/review/1881
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-05-30 11:26:42 +00:00
Michal Labedzki
53c66a9e08 Bluetooth: Avoid using macro GPOINTER_TO_UINT()
Fix warnings and try to inform user about unknown values in
"Decode As".

Also use define instead of magic number for Unknown L2CAP CIDs.

Change-Id: Ie6f26a9e3330b84cef14bbf8861ffbdbdb789225
Reviewed-on: https://code.wireshark.org/review/1880
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-05-30 11:26:28 +00:00
Michal Labedzki
5742d2e145 Bluetooth: L2CAP: Another fix for CIDs
Example: if there is Connection Request than field with CID always
is called SCID. If we Sent this packet, it is okay, but if we Receive
it, then it is not SCID for us, but DCID. If we receive
Connection Request (DCID) and than we want to make disconnection,
so we send Disconnection Request with DCID that is SCID in
Connection Request... etc.

I try to clarify this, so rename stored SCID to Local CID
and DCID  to Remote CID.

Change-Id: Idde0939a03955d8f4a10d8c9f7c43fd364254460
Reviewed-on: https://code.wireshark.org/review/1879
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-05-30 11:25:50 +00:00
Michal Labedzki
e3473c921f Bluetooth: AVDTP: Upgrade session logic
To correctly resolve connections single "ID" value
like L2CAP PSM, is not enough, because next connection may use
the same PSM value. Solution is save frame number of frame that
make disconnection.

Conclusion:
Any session key values should be updated to pair:
{ID_1, disconnect_in_frame}, {ID_2, disconnect_in_frame}...
then we should check if  "disconnect_in_frame" is greater then
current frame number, otherwise it is not valid session.

Change-Id: I3d760112b6e53358a93c994f4aae455ac1bf5de6
Reviewed-on: https://code.wireshark.org/review/1878
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-05-30 11:25:35 +00:00
Michal Labedzki
2abc54158d Bluetooth AVDTP/RTP: Separate the streams
The Stream is defined here as media stream that beginning on
AVDTP Start (ResponseAccept).

Also fix recognizing Channel streams by AVDTP according to the
specification that says:
1. First channel is always Signaling.
2. Second may be Media.
3. Third may be Reporting.
4. Fourth may be Recovery.
First and second will be supported right now.

Change-Id: Id6d4dae6be1b9df68382288c2d520b7ed3661237
Reviewed-on: https://code.wireshark.org/review/1053
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-05-30 11:24:59 +00:00
Michal Labedzki
32e66a4cc6 Bluetooth: Add music duration info for SBC
Music duration info can be used to detect underflow, what can
decrease music quality.

Change-Id: I8ea06655395d3e66473a09ee72b6833b894aa6e1
Reviewed-on: https://code.wireshark.org/review/1052
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-05-30 11:24:19 +00:00
Evan Huus
532c3bc783 Initialize int_seid to 0 in btavdtp dissector
Fixes uninitialized read in fuzzed capture.

While I'm there, reorder the fields to reduce alignment-padding and shrink the
size of the sep_entry_t struct slightly.

Bug:10095
Change-Id: I3ace279e97874dbcfeb36f947c4c3428bd83e490
Reviewed-on: https://code.wireshark.org/review/1574
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-09 15:14:09 +00:00
Michal Labedzki
ab42220b65 Bluetooth: AVDTP: Add option to disable Force Codec preference
In real option "SBC" was Default/Off, now user can choose between
Default and Force SBC Codec.

Change-Id: I605320d89fade11dc7172793bc0492bc4b319e9c
Reviewed-on: https://code.wireshark.org/review/822
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-25 09:08:58 +00:00
Michal Labedzki
01c46852a8 Bluetooth: AVDTP: Use full name for MPF field
Change-Id: I25d359926fa5790383624378a6826c8fd5a9bd5c
Reviewed-on: https://code.wireshark.org/review/805
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-24 12:25:03 +00:00
Michal Labedzki
9c370fcb29 Bluetooth: AVDTP: Improve filtering
A few more filtering name separated by "." for convention.

Change-Id: Ie1ceb0ba807e033085c43826c334933c6b178389
Reviewed-on: https://code.wireshark.org/review/804
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-24 12:24:36 +00:00
Michal Labedzki
825ce03222 Bluetooth: A2DP/VDP: Display SEIDs used in conversation
Change-Id: I855ccbee2248cafcc9b1d32245894e2933ca745a
Reviewed-on: https://code.wireshark.org/review/474
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-07 05:05:52 +00:00
Michal Labedzki
d0132adb07 Bluetooth: AVDTP: Fix trees and distinguish local and remote SEPs
When there is more then one interface or adapter then AVDTP dissector
incorrectly mixing it data together. Patch extends keys to support
multiple interfaces/adapters. Also do little simplification on trees.

There are two device, both use SEPs to configuration and
it is possible to use the same SEID. SetConfiguration use
remote "ACP" SEID and local "INT" SEID, so there is need to
distinguish them and please remember then INT SEID types can be
unknown in most case.

Change-Id: I150f3625f532386a1078deb8d0ac70a1c05c3f04
Reviewed-on: https://code.wireshark.org/review/473
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-03-07 05:04:53 +00:00
Michal Labedzki
f4591ef55d Bluetooth: Avoid using find_dissector()
Also remove SVN $Id$ lines.

Change-Id: I4f2925e6ad8dcfe4a62d879a2cef44447f8ae916
Reviewed-on: https://code.wireshark.org/review/476
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-06 21:58:07 +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
Michal Labedzki
8c72070c33 Bluetooth: AVDTP: Fix byte order
AVDTP does not specify byte order of protocol, but define that at byte level
(MSB/LSB). Moreover: Codec VendorId is in Little Endian and this patch fix that.

Change-Id: I91d8e9321e9909cb07d92d3df348ab6e1e5b1e1b
Reviewed-on: https://code.wireshark.org/review/222
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-16 14:16:24 +00:00
Michal Labedzki
4ba8609d10 Bluetooth: AVDTP: Fix offset in case with Error Code
Change-Id: I6e97781bfd1775dcc13c4488af11d615ef6594fb
Reviewed-on: https://code.wireshark.org/review/102
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-04 13:15:35 +00:00
Jörg Mayer
ca7923f7d5 Revert r53073, by now the vast majority of dissector do declare the
registration functions and if we want to standardize it makes more
sense to fix the remaining ones.

svn path=/trunk/; revision=53075
2013-11-04 10:07:33 +00:00
Jörg Mayer
f8e232e8ba Remove forward declarations of registration functions.
svn path=/trunk/; revision=53073
2013-11-03 22:12:48 +00:00
Michael Mann
65b6a98b4a Bluetooth: AVDTP: Add support for Content Protection type SCMS-T (and some minor cleanup). Bug 7893 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7893)
From Michal Labedzki

svn path=/trunk/; revision=53065
2013-11-03 15:25:52 +00:00
Michael Mann
3b7f6f0e5f Partially revert r53052 because hf_ fields aren't defined (or used)
svn path=/trunk/; revision=53054
2013-11-02 21:06:07 +00:00
Michael Mann
f1e8e58ec5 Bluetooth: minor improvements. Bug 7893 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7893)
1. AVDTP: Fix double decoded stream
2. AVDTP: Use items for logical block objects
3. HCI_USB use handoffed dissector handles instead of find_dissector() 

From Michal Labedzki

svn path=/trunk/; revision=53052
2013-11-02 20:10: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
Michael Mann
6b3ac2d952 Batch of filterable expert infos.
svn path=/trunk/; revision=50454
2013-07-09 01:18:52 +00:00
Michael Mann
59e46d816b Fix typo in retrieving h263 dissector. Bug 7893 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7893)
From Michal Labedzki

svn path=/trunk/; revision=50291
2013-07-01 11:55:48 +00:00
Evan Huus
5d53d63cd7 From Michal Labedzki via
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8824

Convert bluetooth emem trees to wmem trees.
Add modelines and fix indentation.
Correct typo in wmem_tree.h that still referred to emem.

svn path=/trunk/; revision=50076
2013-06-20 16:31:53 +00:00
Chris Maynard
ee5c5e9361 Both tvb_length_remaining and tvb_reported_length_remaining can return -1.
#BACKPORT(1.6,1.8 ... manually as other occurrences are in those trunks)

svn path=/trunk/; revision=48710
2013-04-02 21:13:02 +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