Commit Graph

29 Commits

Author SHA1 Message Date
Guy Harris 1f5f63f8ef Generalize wtap_pkthdr into a structure for packet and non-packet records.
Separate the stuff that any record could have from the stuff that only
particular record types have; put the latter into a union, and put all
that into a wtap_rec structure.

Add some record-type checks as necessary.

Change-Id: Id6b3486858f826fce4b096c59231f463e44bfaa2
Reviewed-on: https://code.wireshark.org/review/25696
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-09 00:29:51 +00:00
Dario Lombardo 8cd389e161 replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.
The first is deprecated, as per https://spdx.org/licenses/.

Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed
Reviewed-on: https://code.wireshark.org/review/25661
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-02-08 14:57:36 +00:00
Dario Lombardo 6c13f7070c Qt: add initializers in PacketDialog() (CID: 1427679).
Change-Id: Id2f16d849b85275308101f49a5ea22fbddf66f3b
Reviewed-on: https://code.wireshark.org/review/25411
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2018-02-02 05:29:42 +00:00
Gerald Combs 47351fb617 Qt: Initialize a struct (found by Coverity)
CID: 1427679
Change-Id: I2ed276f0da413b4853b7dc9ccde3530e655ad760
Reviewed-on: https://code.wireshark.org/review/25403
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-21 13:12:42 +00:00
Dario Lombardo c5560babbd Qt: return if cf_read_record() fails in PacketDialog (found by clang).
Change-Id: I5187b378db9bae092052ce50b337f266e08e4332
Reviewed-on: https://code.wireshark.org/review/25340
Petri-Dish: Dario Lombardo <lomato@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2018-01-18 15:48:30 +00:00
Gerald Combs bdb6baa740 Qt: Switch ProtoTree to a treeview+model.
Add a ProtoTreeModel and use it in ProtoTree. This should make the UI
more responsive when we have lots of items in the tree.

Change-Id: Id26e6bcff84663867a8da17fd9ae86ff639b633f
Reviewed-on: https://code.wireshark.org/review/24774
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-12-15 20:58:14 +00:00
Guy Harris 8aa14236f8 Have the frame_tvbuff.c routines not use the global cfile.
Have the routines that create them take a pointer to a struct
packet_provider_data, store that in the tvbuff data, and use it to get
the wtap from which packets are being read.

While we're at it, don't include globals.h in any header files, and
include it in source files iff the source file actually uses cfile.  Add
whatever includes that requires.

Change-Id: I9f1ee391f951dc427ff62c80f67aa4877a37c229
Reviewed-on: https://code.wireshark.org/review/24733
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-08 08:31:41 +00:00
Guy Harris ccc55bc80c Put the structure of a capture_file back in cfile.h.
The split isn't necessary now that epan no longer uses the capture_file
structure.

Change-Id: Ia232712a2fb5db511865805518e8d03509b2167f
Reviewed-on: https://code.wireshark.org/review/24693
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-04 05:35:36 +00:00
Guy Harris eb8ffb74e2 Use cfile.h to define the capture_file type.
Have cfile-int.h declare the structure, and use it in files that
directly access the structure.

Have cfile.h just incompletely declare the structure and include it
rather than explicitly declaring it in source files or other header
files.

Never directly refer to struct _capture_file except when typedeffing
capture_file.

Add #includes as necessary, now that cfile.h doesn't drag in a ton of

Change-Id: I7931c8039d75ff7c980b0f2a6e221f20e602a556
Reviewed-on: https://code.wireshark.org/review/24686
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2017-12-03 18:54:37 +00:00
Roland Knall e13e2df9a1 Qt: Rename packetSelection to frameSelected
In order to consolidate the interfaces between certain parts of the UI,
the signal emitted after a frame change has occured, has to include the
number of the frame. This led to two signals for frame change, and therefore
packetSelection is to be removed.

Change-Id: I24e0e0890291d2243935b0c48387beb66904bfa3
Reviewed-on: https://code.wireshark.org/review/24377
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-12 17:18:44 +00:00
Roland Knall 8a6ea0e454 Qt: Further cleanup ByteView
This further separates ByteView and the rest of the system.

Using FieldInformation and DataPrinter, this is the final cleanup
of the ByteViewTab

Change-Id: If41521167527cf5664c2564cdd0d45fea0f3f612
Reviewed-on: https://code.wireshark.org/review/22783
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-11-08 20:20:31 +00:00
Roland Knall 56a130a152 ByteViewText: Remove epan dependancy
Remove all dependancy for the byte_view_text from the epan system,
and therefore cleanly separate data and display for further separation
of dissection and view

Change-Id: Id1ee91b93da4511afa95f24da4cbbf39cbb89b1f
Reviewed-on: https://code.wireshark.org/review/24050
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2017-10-31 11:42:21 +00:00
Gerald Combs 37c928f28d Qt: Show the correct data in the packet dialog.
Set our pointers and copy our data *after* we read our packet.

Bug: 12556
Change-Id: I5b373f94ad5b2fa2e6563142200a80912e717a96
Reviewed-on: https://code.wireshark.org/review/16211
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
2016-06-30 06:07:15 +00:00
Peter Wu 959fe0e18b Qt: Keep byte tab when reloading/closing capture file
Do not remove byte view on closing a capture file. For this to work, the
tree items must also be remembered.

Change-Id: Ice5cd1006b957e2d1331effc15c4c0a9de89916d
Reviewed-on: https://code.wireshark.org/review/14715
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2016-04-02 21:17:18 +00:00
Stig Bjørlykke 1a716800e3 Qt: Add dialog geometry restore
Add GeometryStateDialog class to handle load and save dialog geometry.
The QDialog class name will be used as window name.  For shared
classes the UAT name or the statistics title or abbr will be used.

Change-Id: I5a019598307fb3861518f41e733de834788184d8
Reviewed-on: https://code.wireshark.org/review/14139
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-02-28 18:25:50 +00:00
Pascal Quantin 62b03da49a Fix display of bytes as EBCDIC
MSVC compiler does not support properly setting an enum being part of a bit field.
For example the following code:
pinfo->fd->flags.encoding = PACKET_CHAR_ENC_CHAR_EBCDIC;
changes pinfo->fd->flags.encoding from 0x0 to 0xfffffffe instead of 0x1
Let's put back an unsigned int definition (like it is in master-1.12 branch) and add explicit casts where required

Bug: 11787
Change-Id: Idae0140fb6c172f1b3dbf10baefc8cfb00128f4c
Reviewed-on: https://code.wireshark.org/review/12220
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-11-27 18:39:09 +00:00
Peter Wu 759bfb6c45 Do not expand packets in packet dialog by default
Do not expand the packet tree in the packet dialog by default, it
results in forgetting the previous collapse state and deviates from
previous GTK+ behavior. It is just annoying to have all Frame, Ethernet,
etc. trees expanded while you are just looking at application layer
traffic.

(The previous tree is restored when calling ProtoTree::fillProtocolTree
which calls proto_tree_draw_node and then invokes setExpanded()).

Bug: 11731
Change-Id: I48c7f28a1777874b1c23025335305493777bca1d
Reviewed-on: https://code.wireshark.org/review/11998
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2015-11-22 11:26:07 +00:00
João Valverde c00420efa2 Move utf8_entities.h to wsutil
Change-Id: I6298b3de5f0a1cb988014ff16082eaf8c2a3c3c0
Reviewed-on: https://code.wireshark.org/review/10786
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-05 14:34:53 +00:00
Gerald Combs 3687d39304 Qt: Initial RTP playback.
Note the "initial". This is woefully incomplete.  See the "to do" lists
below and in the code.

This differs a bit from the GTK+ version in that you specify one or more
streams to be decoded.

Instead of showing waveforms in individual widgets, add them all to a
single QCustomPlot. This conserves screen real estate and lets us more
easily take advantage of the QCP API. It also looks better IMHO.

Change a bunch of checks for QtMultimediaWidgets to QtMultimedia. We
probably won't use the widgets until we make 5.0 our minimum Qt
version and plain old QtMultimedia lets us support Qt 4 more easily
(in theory at least).

Add resampling code from libspeex. I initially used this to resample
each packet to match the preferred rate of our output device, but this
resulted in poorer audio quality than expected. Leave it in and use to
create visual samples for QCP and to match rates any time the rate
changes. The latter is currently untested.

Add some debugging macros.

Note that both the RTP player and RTP analysis dialogs decode audio data
using different code.

Note that voip_calls_packet and voip_calls_init_tap appear to be dead
code.

To do:

- Add silence frames where needed.
- Implement the jitter buffer.
- Implement the playback timing controls.
- Tapping / scanning streams might be too slow.

Change-Id: I20dd3b66d3df53c9b1f3501262dc01458849f6b4
Bug: 9007
Reviewed-on: https://code.wireshark.org/review/10458
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-10-02 18:26:05 +00:00
Stig Bjørlykke 18747939fd Remove unused signal
Change-Id: Ic2d4057ee95849bc1b026663dae1430432ad9707
Reviewed-on: https://code.wireshark.org/review/10241
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-24 21:00:23 +00:00
Stig Bjørlykke 7176958357 Close packet dialogs when reload Lua plugins.
We could keep the dialogs with the current content if postponing
proto_free_deregistered_fields() until all dialogs are closed.
This would give a feature where the user is able to compare packets
before and after a reload.

Or we could add functions in PacketDialog to reload the packet details
in all open dialogs.  This would give a feature to always have a
updated dialog for all interesting packets.

Change-Id: I805352b65844eafafafc54cd61f08b4605416e64
Reviewed-on: https://code.wireshark.org/review/10201
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2015-08-24 07:43:22 +00:00
Gerald Combs 1afe288c8c More packet detail context menu items.
Add the wiki and field reference items to the packet detail context
menu. Add the "Go To Linked Packet" item in the Go menu and packet
detail context menu. Use "Linked Packet" instead of "Packet Reference"
and "Corresponding Packet". Remove more pending item comments.

Change-Id: I66c40f71738f0996690f4818a546520ea0747088
Reviewed-on: https://code.wireshark.org/review/9841
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-01 01:07:23 +00:00
Michael Mann da09a1bfd8 Take all epan_column_info members that always get allocated to "number of columns" to share their own data structure.
Change-Id: Ib982662db6cf68730a7d121eac60d9bc5ae67429
Reviewed-on: https://code.wireshark.org/review/9195
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-29 02:11:04 +00:00
Martin Kaiser 534d1d5eae Qt: use <> for including the generated ui_*.h files
this should make Visual Studio pick up the generated include files
from the build directory instead of the source directory (which may
contain lefovers from an in-tree build)

Change-Id: Ie3de4cdd85a2865e203118a42ab10f443372f03b
Reviewed-on: https://code.wireshark.org/review/9129
Petri-Dish: Martin Kaiser <wireshark@kaiser.cx>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-25 17:11:19 +00:00
Gerald Combs b25faac85d Qt: Add a "[closed]" hint to the packet dialog.
Try to make it more obvious that the file has closed.

Ping-Bug: 11044
Change-Id: I76ae5724316c6fd9e7efdd817c39ac268b7d4dd0
Reviewed-on: https://code.wireshark.org/review/8593
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-05-22 21:05:47 +00:00
Guy Harris 99ceab898c Don't create a packet dialog if we don't have a packet.
Move the "find the frame" stuff to openPacketDialog(), and don't even
bother creating a new PacketDialog if we don't find the frame.  This
should squelch Coverity CID 1270934, by giving up quickly if fdata is
null.

Change-Id: I4605ba7e271a55724f02cafed4122f9dd9b1b6f7
Reviewed-on: https://code.wireshark.org/review/7467
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-02 04:01:43 +00:00
Gerald Combs 6e88978fd9 Qt: More #include → forward declarations.
Change-Id: Ib6de71f801cd3053374b6c867370acd594dcd396
Reviewed-on: https://code.wireshark.org/review/7089
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-13 02:31:16 +00:00
Gerald Combs a5652c7257 Qt: ElidedLabel doesn't support rich text / HTML.
Change-Id: Ia5ca9784c60325c01ba5e6378997008f8ef1dd6e
Reviewed-on: https://code.wireshark.org/review/7091
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-13 00:50:20 +00:00
Gerald Combs 931807ea61 Qt: Add the "new packet" window^Wdialog^Wwindow.
Allow persistence across files. Preserve the use of "window" even
though we're really a dialog.

Update ByteViewTab and ProtoTree to support multiple instances.

Remove the need for a cast in frame_data.

Add more forward declarations.

Change-Id: I50d3d9d1455b8ecc158a37218f9e41fe696d5ae2
Reviewed-on: https://code.wireshark.org/review/7086
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-02-12 23:32:54 +00:00