Commit Graph

69 Commits

Author SHA1 Message Date
João Valverde 22ee2764a7 Replace g_snprintf() with snprintf() (dissectors)
Use macros from inttypes.h with format strings.
2021-12-19 20:25:11 +00:00
Martin Mathieson 7c178d752f Bluetooth protocols: fix some protocol item lengths 2020-10-28 22:35:28 +00:00
Martin Mathieson 4a4e50992a More spelling fixes, start of second pass of dissectors.
Now easier to find errors due to script improvements and more complete
dictionary file.
2020-08-30 22:34:34 +01:00
Matt Porter cef6752648 Bluetooth: AVRCP: add new AVRCP 1.6 MediaPlayer Item feature flags
Add new AVRCP 1.6 MediaPlayer Item feature flags as documented in
Section 6.10.2.1 of
https://www.bluetooth.org/docman/handlers/DownloadDoc.ashx?doc_id=292286

Change-Id: Id622da89ce1e15b4273f67cd53124cfd60d8a162
Signed-off-by: Matt Porter <mporter@konsulko.com>
Reviewed-on: https://code.wireshark.org/review/34095
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Petri-Dish: Jaap Keuter <jaap.keuter@xs4all.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-07-29 20:25:09 +00:00
Guy Harris 20800366dd HTTPS (almost) everywhere.
Change all wireshark.org URLs to use https.

Fix some broken links while we're at it.

Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c
Reviewed-on: https://code.wireshark.org/review/34089
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-07-26 18:44:40 +00:00
Gerald Combs 8d3ac3af86 epan: Convert our PROTO_ITEM_ macros to inline functions.
Convert our various PROTO_ITEM_ macros to inline functions and document
them.

Change-Id: I070b15d4f70d2189217a177ee8ba2740be36327c
Reviewed-on: https://code.wireshark.org/review/32706
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2019-04-04 04:03:38 +00:00
Guy Harris 7eb3e47fa4 Try to squeeze some bytes out of the frame_data structure.
Make the time stamp precision a 4-bit bitfield, so, when combined with
the other bitfields, we have 32 bits.  That means we put the flags at
the same structure level as the time stamp precision, so they can be
combined; that gets rid of an extra "flags." for references to the flags.

Put the two pointers next to each other, and after a multiple of 8 bytes
worth of other fields, so that there's no padding before or between them.

It's still not down to 64 bytes, which is the next lower power of 2, so
there's more work to do.

Change-Id: I6f3e9d9f6f48137bbee8f100c152d2c42adb8fbe
Reviewed-on: https://code.wireshark.org/review/31213
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-12-27 04:34:29 +00:00
Ajay Panicker 1fa2781b7a Bluetooth: Initialize ett features for Media Player Dissection
The ett_btavrcp_features and ett_btavrcp_featuers_not_used fields were
not initialzed causing an abort when dissecting.

Change-Id: I3ee2f557ace1643dfba5a978add66c3c7ba7d895
Reviewed-on: https://code.wireshark.org/review/26217
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-03-02 05:49:39 +00:00
Dario Lombardo fe219637a6 dissectors: use SPDX identifiers.
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a
Reviewed-on: https://code.wireshark.org/review/25756
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-12 16:49:58 +00:00
Stig Bjørlykke 29798bb8c9 bluetooth: Group Bluetooth dissector preferences
Change-Id: Ib5360fcbfd8f6b2aee6b33ec7d9dc77362feb50e
Reviewed-on: https://code.wireshark.org/review/25162
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-06 14:30:10 +00:00
Michael Mann b289699ace Remove oui_vals value_string and epan/oui.c
oui.c is a very small subset of what comes from http://standards.ieee.org/regauth/oui/oui.txt,
so use the "full" OUI list (and more) out of the manuf file and convert
hf_ fields to just use BASE_OUI.

Change-Id: Ic0c2ff618d8a6212f498e3b7475e0a7856c22b5b
Reviewed-on: https://code.wireshark.org/review/24007
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-21 08:22:30 +00:00
Marie Janssen d0e8b26ee2 AVRCP: fix parsing of Media Player Items
From the AVRCP 1.6.1 spec, page 76, the "Player ID" is two octets.
Also, the Play Status field comes before the Feature Bit Mask.

Change-Id: Ifd0ad82650d395395b16f9441f02b8835befa360
Reviewed-on: https://code.wireshark.org/review/22709
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-07-19 03:42:21 +00:00
Guy Harris 913f9fb353 Rename BASE_VALS_NO_UNKNOWN to BASE_SPECIAL_VALS.
It makes it a bit clearer what its purpose is - to allow a value_string
to be used for numeric rather than enumerated fields, giving certain
values of the field a special meaning.

Change the explanation in the documentation to match as well.

Change-Id: Id07b22eee996b79ea5f3473928d29adcabe09bf3
Reviewed-on: https://code.wireshark.org/review/21209
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-18 22:28:07 +00:00
Alexis La Goutte 043df01c56 Add support for BASE_VALS_NO_UNKNOWN
BASE_VALS_NO_UNKNOWN is a special value_string value for only a single
(maybe 2) numerical value(s).  If a field has the numerical value
that doesn't match anything in the value_string, just the number
is supplied for the field (no "Unknown")

Dissectors that had this use case have been converted in the patch.

Change-Id: Ie63a36cceec2fe4436938ec7e3d7f9e690d2b8d9
Reviewed-on: https://code.wireshark.org/review/20736
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-04-10 20:31:37 +00:00
Guy Harris aa82f522c2 You can't get a string value from an FT_NONE string.
Make it an FT_STRING.

Change-Id: I2a44c4542c79daa486382bd5b28f6c37c9c46111
Reviewed-on: https://code.wireshark.org/review/20827
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-04-01 03:39:51 +00:00
Alexis La Goutte 2d6e634f34 dissectors (and tools): fix typo dependant -> dependent
found by lintian

Change-Id: I50907b9721f3941c291cf322916f553ab3b4b168
Reviewed-on: https://code.wireshark.org/review/20638
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-03-19 21:55:21 +00:00
Michael Mann 2ab4155794 tvb_get_string_enc + proto_tree_add_item = proto_tree_add_item_ret_string
Also some other tricks to remove unnecessary tvb_get_string_enc calls.

Change-Id: I2f40d9175b6c0bb0b1364b4089bfaa287edf0914
Reviewed-on: https://code.wireshark.org/review/16158
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-06-27 15:20:06 +00:00
Guy Harris d4339c6fbd Remove the MIBenum stuff from the WAP code.
MIBenum values are from an IANA registry, not a WAP specification; add
<epan/iana_charsets.h> to declare the MIBenum -> Wireshark encoding
mapper routine and the value_string_ext for MIBenum values, and
epan/iana_charsets.c to define them.

Change-Id: I6d9c82cd011bd5211c688322e6423de38e161f41
Reviewed-on: https://code.wireshark.org/review/15298
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-08 21:15:43 +00:00
Guy Harris 2cb16b2efd Show MIBenum values for character sets as decimal.
http://www.iana.org/assignments/character-sets/character-sets.xhtml is
the official IANA registry for character sets, including MIBenum values,
and it shows MIBenum values in decimal, not hex, so show them in
decimal, not hex.

Change-Id: Id00a0d351a1f758401232aba621cc60aeccf360a
Reviewed-on: https://code.wireshark.org/review/15292
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-05-08 20:43:24 +00:00
Pascal Quantin 9abbf8b69d Do not mix wmem and glib allocators
Change-Id: I0e845668a1b9dbec93ea920a8585ecfe60f001d1
Reviewed-on: https://code.wireshark.org/review/15044
Reviewed-by: Michael Mann <mmann78@netscape.net>
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-04-22 04:32:32 +00:00
Guy Harris bc5a0374bf Add the packet number to the packet_info structure, and use it.
That removes most of the uses of the frame number field in the
frame_data structure.

Change-Id: Ie22e4533e87f8360d7c0a61ca6ffb796cc233f22
Reviewed-on: https://code.wireshark.org/review/13509
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-24 03:41:28 +00:00
Guy Harris 9141bd9700 Add more fields to packet_info structure and use them.
Add fields for the absolute time stamp (and another field for a presence
flag for the absolute time stamp) and the packet encapsulation for the
packet.

This lets us remove the field for the packet encapsulation in the
frame_data structure; do so.

Change-Id: Ifb910a9a192414e2a53086f3f7b97f39ed36aa39
Reviewed-on: https://code.wireshark.org/review/13499
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-23 03:50:58 +00:00
Alexis La Goutte 4ae3543a3d BTAVRCP: fix misspelling (found by Lintian)
Extention -> Extension

Change-Id: I1624721b2e7725ec6129b3ad06327e25c0a6291d
Reviewed-on: https://code.wireshark.org/review/13053
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-06 01:05:45 +00:00
Michael Mann 31a54708f4 new_register_dissector -> register_dissector for dissector directory.
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c
Reviewed-on: https://code.wireshark.org/review/12485
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09 12:38:06 +00:00
Michal Labedzki bdf3c0b558 Bluetooth: Make dissectors independent of passed data
If Bluetooth dissectors has additional data from previous layer - good.
But if do not... try to decode as much as possible - probably using
some "force" dissector preferences you can decode payload correctly.

Change-Id: I6427afafb987ed3b9b751fd91616e670802b3542
Reviewed-on: https://code.wireshark.org/review/11021
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2015-10-17 10:22:02 +00:00
Pascal Quantin 322e09676c Fix some memory leaks when extracting a string from TVB
Change-Id: If3970a20045d84200924f89ac467c4eb0206cb11
Reviewed-on: https://code.wireshark.org/review/10446
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.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>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-09-09 07:39:18 +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
Guy Harris 2d63e58b47 Fix some more constants to be unsigned.
Change-Id: I714078683cff517c79a15abf29e1ae4a9a60271d
Reviewed-on: https://code.wireshark.org/review/8365
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-09 06:56:10 +00:00
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
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 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 38218dfc57 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>
2014-11-14 10:26:29 +00:00
Michal Labedzki 5a46f2652b Bluetooth: AVRCP: Fix swappend SongPosition and SongLength
SongPosition and SongLength are swapped in Info column. Fix it.

Change-Id: I4c9bece51dbfe62885e8426a8aef07f336670099
Reviewed-on: https://code.wireshark.org/review/5287
Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-11-14 10:25: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
Michael Mann daa70feddc Revert "Fixup: tvb_ensure_length_remaining -> tvb_ensure_captured_length_remaining"
See https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 021e7afc9f.

Change-Id: I0640eabce5ce8c4ff3a88ebf848b499f8bb8ed2f
Reviewed-on: https://code.wireshark.org/review/2429
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 17:23:41 +00:00
Dario Lombardo 021e7afc9f Fixup: tvb_ensure_length_remaining -> tvb_ensure_captured_length_remaining
Change-Id: I0228f3b6b7067bc0ce51f9d359f99fd18feb2b66
Reviewed-on: https://code.wireshark.org/review/2378
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:20:32 +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
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +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
Chris Maynard b5e3775535 eject the packet if data is NULL without doing anything else.
svn path=/trunk/; revision=53733
2013-12-02 21:13:29 +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
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Evan Huus 6df83e8078 Add _g_ to the names of functions that allocate glib memory. This is a bit more
explicit, and frees up the "generic" names (like tvb_memdup) for new signatures
that take the appropriate wmem pool.

Majority of the conversion done with sed.

svn path=/trunk/; revision=52164
2013-09-21 17:04:41 +00:00
Michael Mann 6b3ac2d952 Batch of filterable expert infos.
svn path=/trunk/; revision=50454
2013-07-09 01:18:52 +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
Jaap Keuter 97136126bc Typo's. That is all.
svn path=/trunk/; revision=48685
2013-04-01 15:29:49 +00:00