Commit Graph

5765 Commits

Author SHA1 Message Date
Vasil Velichkov 88dd7e734a export_pdu.c: Fix a memory leak
Allocate the exp_pdu_data using the wmem_packet_scope allocator so the
epan_dissect_run_with_taps will free it after calling all registered tap
listeners.

valgrind --tool=memcheck --leak-check=full ./run/tshark -r sctp.pcap -U "OSI layer 3" -w exported.pcap

32 bytes in 1 blocks are definitely lost in loss record 48 of 76
   at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
   by 0xB3FC3C5: g_malloc (gmem.c:99)
   by 0x68C2BE1: export_pdu_create_tags (exported_pdu.c:251)
   by 0x68C2D5E: export_pdu_create_common_tags (exported_pdu.c:231)
   by 0x70AA54E: create_exp_pdu_proto_name (packet-sctp.c:3240)
   by 0x70AA54E: export_sctp_data_chunk.part.23 (packet-sctp.c:3268)
   by 0x70AB76B: export_sctp_data_chunk (packet-sctp.c:3256)
   by 0x70AB76B: dissect_data_chunk (packet-sctp.c:3509)

Change-Id: I6e247ab2861bbb053f0958faf253913b28dbcbeb
Reviewed-on: https://code.wireshark.org/review/29126
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-14 11:47:29 +00:00
Guy Harris 149e74b70d Put the interface descrptions into the IDB when capturing to pcapng.
capture_opts_add_iface_opt(), when called in a program acting as a
capture child, will fetch the description for the interface, and will
also generate a "display name" for the interface.

In the process, we clean up capture_opts_add_iface_opt() a bit,
combining duplicate code.

We rename console_display_name to just display_name, as it may also be
used in the title bar of Wireshark when capturing.

Change-Id: Ifd18955bb3cb41df4c0ed4362d4854068c825b96
Reviewed-on: https://code.wireshark.org/review/29117
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-13 04:37:00 +00:00
Guy Harris d48262753e Move get_iface_display_name() to ui/iface_lists.c.
It's only used there, so move it there.

Change-Id: I68472150e020ba94166782e3e4c08cba94c0f9ee
Reviewed-on: https://code.wireshark.org/review/29114
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-13 02:02:59 +00:00
Guy Harris 991f5a6e85 More interface view cleanups.
Rename some of the columns - IFTREE_COL_NAME is the interface name,
IFTREE_COL_DESCRIPTION is the description/friendly name, and a new
IFTREE_COL_DISPLAY_NAME column is the display name (which may include
both the description and the interface name).  Rename
IFTREE_COL_INTERFACE_COMMENT to just IFTREE_COL_COMMENT - there's no
*other* type of comment, and "IF" is short for "interface".

In the interface frame, use IFTREE_COL_DISPLAY_NAME, as that's the only
column that shows both and thus has something for all interfaces.

In the "Manage interfaces" dialog, put the description before the
interface name, as it was in earlier versions.

Change-Id: If0d959dcd4ca99913c941df00621da3c478233f6
Reviewed-on: https://code.wireshark.org/review/29090
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-12 01:56:23 +00:00
Guy Harris 713651d9c3 Show just the description in the description column.
Don't show the display name, as that may include either the interface
name, which is already in another column, or the column comment, which
is also already in another column.

Change-Id: I12f81d9e4579b82267062bb5e4e745925ed382b7
Reviewed-on: https://code.wireshark.org/review/29087
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-12 00:46:02 +00:00
Guy Harris beacbab55a Fix the "Manage interfaces" dialog columns.
Windows is not the only OS with "friendly" names for interfaces; macOS
has them as well, and some *BSDs let you tag interfaces with names as
well.

The column headings for the "Interface Name" and the "Friendly Name"
were backwards.

Change-Id: I72543505cec9d479d8ab8aab3850daab3667805f
Reviewed-on: https://code.wireshark.org/review/29082
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-11 22:27:22 +00:00
Guy Harris 530061b66e More comments.
Change-Id: I1fc6df514983bb73b7e620d05223728496de7919
Reviewed-on: https://code.wireshark.org/review/29078
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-11 20:40:33 +00:00
Guy Harris 1b3aaeae72 Make a routine static that's not used outside its source file.
Change-Id: I5121828c1fb95cbf89e7304dd748f8fcac63ad5a
Reviewed-on: https://code.wireshark.org/review/29073
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-11 19:02:23 +00:00
Guy Harris 863ba5cd98 Give a structure a better name.
It's not a set of command-line options, it's information that's used
when showing summary information about the interface.

Change-Id: Ie1c3d998a3cc7cd8b54945186098ebae726cef11
Reviewed-on: https://code.wireshark.org/review/29070
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-11 10:04:31 +00:00
Guy Harris 254364f7e4 Get rid of unused routine.
Change-Id: I3f5ff89695cedc57daa8c17018fbe5681053f675
Reviewed-on: https://code.wireshark.org/review/29069
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-08-11 07:52:06 +00:00
Vasil Velichkov 51299192e2 tap_export_pdu: Fix two memory leaks
253 (8 direct, 245 indirect) bytes in 1 blocks are definitely lost in loss record 87 of 93
   at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
   by 0xBC4B3C5: g_malloc (gmem.c:99)
   by 0x13E225: exp_pdu_open (tap_export_pdu.c:128)

372 (40 direct, 332 indirect) bytes in 1 blocks are definitely lost in loss record 88 of 93
   at 0x4C2EBAB: malloc (vg_replace_malloc.c:299)
   by 0xBC4B3C5: g_malloc (gmem.c:99)
   by 0xBC62FF6: g_slice_alloc (gslice.c:1025)
   by 0xBC16984: g_array_sized_new (garray.c:194)
   by 0x13E143: exp_pdu_open (tap_export_pdu.c:93)

Change-Id: I24a3cec1dc4491032232c282b01fea04a23872b3
Reviewed-on: https://code.wireshark.org/review/28934
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>
2018-08-03 09:27:06 +00:00
Vasil Velichkov ad145baeee tshark: Allow exporting of PDUs to stdout
The following command will export the PDUs to stdout
tshark -r ./test.pcapng -U "OSI layer 3" -w -

Change-Id: Idddded6bfcac458d82cdc033babc7546b67f7327
Reviewed-on: https://code.wireshark.org/review/28919
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-08-01 13:04:58 +00:00
Vasil Velichkov 7e755f71ad SCTPGraphDialog: fix displaying a single TSN
When the SCTP association contains a single DATA/SACK chunk in direction
the max and min TSN values are equal and as a result the Y axis range is
(maxTSN, maxTSN) or (0, 0) and the dots for the TSN are not visible

To fix this always set the Y axis maximum to maxTSN + 1 similar to the X
axis maximum of max_secs + 1

Also removed one unused local variable

Change-Id: Id38eb4dbd13a8ebbba98d4df00f3707331bd1464
Reviewed-on: https://code.wireshark.org/review/28862
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-30 12:19:49 +00:00
Vasil Velichkov 02b2c86c53 SCTPGraphArwndDialog: Detect max arwnd value when startArwnd is not set
When the capture does not contains SCTP INIT and INAT_ACK packets the
startArwnd value is 0 (not set) and as a result the Y axis range is
(0,0) and the dots are not visible

Change-Id: Iafb1981e62f28fe09b106138836c866d0dbebb27
Reviewed-on: https://code.wireshark.org/review/28861
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-30 12:19:35 +00:00
Gerald Combs ce2d45dfc1 Qt: Comment some of the sparkline code.
Explain some of the magic numbers and other parts of the sparkline code.

Change-Id: Idfad30e773bd852ac021326467cf03ada91f6efc
Reviewed-on: https://code.wireshark.org/review/28874
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-07-27 21:54:15 +00:00
Vasil Velichkov 13f7978169 SCTPGraphDialog: Remove two unused members
Those two members are leftovers from the gtk interface where a single
button was used. Current Qt interface uses three buttons so those two
members are no longer needed.

Change-Id: I10e8c6aa887582e21ceec87bc3021a49abcc34dd
Reviewed-on: https://code.wireshark.org/review/28834
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-07-23 19:35:31 +00:00
Vasil Velichkov 0890837669 SCTPGraphDialog: Clear internal vectors
Every time the graph is redrawn new items are added to the vectors but
these items are never removed and the used memory increase over time
which for larger captures could be problematic.

Change-Id: I5f029d5f48e215aacf4a69fb7aef348d16df9846
Reviewed-on: https://code.wireshark.org/review/28782
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-07-23 17:10:48 +00:00
Guy Harris 9b731e2b32 Add a tap "finish" callback, called when a listener is removed.
Change-Id: Ic6c23dbd39d1adf8f730f1c866e409f731947475
Reviewed-on: https://code.wireshark.org/review/28786
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-21 00:51:13 +00:00
Gerald Combs 32098ac5b1 Qt: Remove an unneeded function.
Remove MainWindow::createByteViewDialog, which was called once and
contained one line.

Change-Id: Ibe03db2c527b0a817d8b99df87d161405805bac3
Reviewed-on: https://code.wireshark.org/review/28733
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: Anders Broman <a.broman58@gmail.com>
2018-07-17 09:06:03 +00:00
Peter Wu 8563b94d56 Qt: update to QCustomPlot 1.3.2
QCustomPlot 1.3.1 includes a fix for a crash ("Fixed potential crash in
QCPGraph::pointDistance if getScatterPlotData returns empty list").
Full changelog: http://www.qcustomplot.com/release/1.3.2/changelog.txt

The new files are based on QCustomPlot-source.tar.gz (1.3.2) with
Alexis' typo and license header changes from v1.99.2rc0-479-gc411029a3c
("Update to QCustomPlot 1.3.0") applied. All successive Wireshark
patches up to v2.5.0rc0-854-g6f28f1a59e ("Fix MacOS build") were
applied. The Retina patches ("Fix QCustmPlot retina problems." and "QCP:
Fix retina label calculations.") gave conflicts due contextual changes
which I resolved by renaming newCachedLabel to cachedLabel (following
the change in upstream commit baaad24706187f5be0a68011c780b51c4de11558).

Bug: 14971
Change-Id: I5012cb5a867891b466cbf1898fe4c28cbd11ba20
Reviewed-on: https://code.wireshark.org/review/28732
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-17 09:05:06 +00:00
Gerald Combs 2cfa3013bc Qt: Create the main display filter combo sooner.
Construct MainWindow::df_combo_box_ in our initializer list, otherwise
anything that triggers a resizeEvent early on might result in an NPE.

Wait until everything is in place before calling setMinimumWidth.

Bug: 14979
Change-Id: I78b349f9c3ea53d8b1399a77169bbbd0a4a69191
Reviewed-on: https://code.wireshark.org/review/28728
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-07-16 23:25:38 +00:00
Peter Wu 99ca2f3ed2 Qt: try to sort numeric columns (such as ports) as number
Ensure that columns with numbers are sorted according to their numeric
value instead of their alphabetical order.

Bug: 11460
Change-Id: I6ccfb9d3699c7e95de4ed31eb9424c5687661593
Reviewed-on: https://code.wireshark.org/review/28652
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-14 06:46:49 +00:00
Peter Wu 16953695d7 Qt: make "Save As" in Follow Streams usable
For formats other than "Raw" and "UTF-8", the written file does not
match the actual stream data. It would be duplicated in strange ways.
Executing the "Save As" action twice while the dialog is open would also
write two different files (huh?).

As a quick fix, just replace the strange save logic by writing the text
field contents. A functional difference is that previously it would
write data while parsing the "follow data" list, now it uses the text
field contents. That data will now be truncated after 500 MB.

Bug: 14933
Change-Id: I498676389d0da3ac070346d6903bd2e6b0fc7674
Fixes: v1.11.0-rc1-2538-g80f9326b2f ("Add TCP/UDP/SSL Follow feature to QtShark")
Reviewed-on: https://code.wireshark.org/review/28663
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
2018-07-11 16:30:36 +00:00
Guy Harris 325b033ca4 Expand another comment to explain why we're ignoring empty lines.
Change-Id: Iafaeaffa1004ae741bdb4c6be91528f65aa06cfd
Reviewed-on: https://code.wireshark.org/review/28668
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-10 04:11:43 +00:00
Guy Harris c29c043cdc Note that this code is checking for being on a new page.
Change-Id: Ib92292834bc00487958ff62584025e512de6d755
Reviewed-on: https://code.wireshark.org/review/28664
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-10 03:42:24 +00:00
Guy Harris 238c7dd61d Don't use QFileInfo()::baseName().
It strips off all suffixes, which is not useful behavior; it assumes
that nobody uses "." for any purpose other than separating a file name
from an extension - 1994 called, they want their version of Windows
back (and UN*X called, too...).

For the "Saving XXX" status bar message, just use the entire last
component of the file name.

Change-Id: Ib34fde3e49cd791c7baf333eebb71a8dbd672c19
Reviewed-on: https://code.wireshark.org/review/28638
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-06 09:47:07 +00:00
Guy Harris aab5ad074e Fix the calculation of a file's "basename".
Strip off only extensions that correspond to file types we know about;
QFileInfo::baseName() strips off *all* extensions, where "extension" is
"anything preceded by a .", so it turns foo.bar.pcap.gz into foo, not
foo.bar.  We don't want that; instead, we strip off only those
extensions that correspond to file types we know how to read, so we'd
strip off .pcap.gz in foo.bar.pcap.gz, and strip off .pcap in
foo.bar.pcap, leaving foo.bar in both cases.

Change-Id: I5385921ad2f0fef815d52e9902fef15735fd9dae
Reviewed-on: https://code.wireshark.org/review/28636
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-06 09:07:52 +00:00
Peter Wu 7a3f397c2b Qt: fix wrong Follow Stream text position after changing mode
When switching from ASCII to other modes (such as Hex), the previous
text to packet number mapping was not cleared. This resulted in
using the wrong packet number when hovering over the packet data.

Change-Id: I29ba1786925490c33fc9181373a31d51f5091642
Reviewed-on: https://code.wireshark.org/review/28614
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-06 07:27:55 +00:00
Peter Wu c40c26c04c Follow Stream: ensure linear performance with many packets
Reverse the payload chunks list to achieve a running time of O(n) rather
than O(n²) for insertion of all chunks. Executing a RelWithDebInfo+ASAN
build with `tshark -r chargen-session.pcapng.gz -qz follow,tcp,hex,0`
previously took 11m5s to complete, but now finishes in 16 seconds.

Tested using a capture file with 152k TCP packets (from bug 11777).
Backport note: must update ui/gtk/follow_stream.c too.

Change-Id: Icf70d45f33d4399e53209fb6199d3809608c8d99
Reviewed-on: https://code.wireshark.org/review/28595
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-06 07:24:46 +00:00
Guy Harris 2d36c475f9 Use the display name in "Save As..." output for statistics taps.
Change-Id: I78ecc2db6cf0020a51637b1595f2b001d66addf4
Reviewed-on: https://code.wireshark.org/review/28633
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-06 02:11:09 +00:00
Guy Harris 874c978bbc Use the file *base* name for statistics graphs etc..
For example, if the file is foo.pcap, make the default name for a saved
PDF of some graph be foo.pdf, as it was prior to 2.6, not foo.pcap.pdf.

Change-Id: Ide99c9c7fa1f3d16f829e731f968a209fbb52b8d
Reviewed-on: https://code.wireshark.org/review/28624
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-06 00:31:45 +00:00
Guy Harris d8df975e2e Change the print preview if "include column headings" changes.
While we're at it, sort some method declarations and definitions, to
group the top-level summary/details/bytes yes/no options together, with
two groups of suboptions for summary and details below.

Bug: 14945
Change-Id: Id06dd64e44b18b13e2131482edef46aee3efbd63
Reviewed-on: https://code.wireshark.org/review/28620
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-06 00:11:41 +00:00
Guy Harris d7ce2bece8 Add a "Include column headings" checkbox in export dissections and print.
Bug: 14945
Change-Id: I1c5ed0bc7e738a5c8d65c09f25686549e1e6dd67
Reviewed-on: https://code.wireshark.org/review/28615
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-05 23:49:47 +00:00
Alexis La Goutte 750660d60f tap-rtp-common: fix comma at end of enumerator list [-Wpedantic]
Change-Id: I8b66da3dcb3ad0c8b99e196d0c8c882388f8c5db
Reviewed-on: https://code.wireshark.org/review/28593
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-05 02:45:16 +00:00
Guy Harris 1c6dc6d31f Some fixes.
For filePath() and fileName(), just return a null string if we can't
convert from the native encoding to UTF-8 - those aren't used for
displaying, those are used for setting the main window's file name and
for generating names of files to save based on the capture file name.

Have fileDisplayName() just return the display name, without
"[closing]"/"[closed]" decoration or a special case for no file being
open (just return a null string if there's no file open), and have
fileTitle() return the decorated display name.

Change-Id: I244f318d5444dcf58527e5d38c4d073c28b73810
Reviewed-on: https://code.wireshark.org/review/28594
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-04 17:45:47 +00:00
Guy Harris 9655acc757 fileTitle -> fileDisplayName.
That more closely matches the name of the file.h routine that it uses.

Change-Id: Ia206fb8331f4f3ad8035da9f6137ad2428d53a49
Reviewed-on: https://code.wireshark.org/review/28589
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-04 02:09:04 +00:00
Guy Harris 60d5c04dc3 We have cf_get_display_name(); use it to get the title bar string.
Change-Id: I318472670722d24c3d3896cbd1e88623f5adb297
Reviewed-on: https://code.wireshark.org/review/28588
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-04 01:41:33 +00:00
Guy Harris a442fd512b Set the file path for a main window if it's not a temporary file.
That's needed to support the "proxy icon", so it can be dragged.

Change-Id: I1ad209cd43a2a6df9c52d076f6513780b0ac51be
Reviewed-on: https://code.wireshark.org/review/28587
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-04 00:52:08 +00:00
Guy Harris 9541945aa2 Just use CaptureFile::fileTitle() in MainWindow::setTitlebarForCaptureFile().
It now does the heavy lifting, so MainWindow::setTitlebarForCaptureFile()
doesn't have to duplicate it.

Change-Id: I97ded85306e625b2c67c3fde62a636ec6818a6f5
Reviewed-on: https://code.wireshark.org/review/28586
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-03 22:52:37 +00:00
Guy Harris d76db1de78 CaptureFile.fileTitle() is for display, not for file name processing.
Don't use CaptureFile.fileTitle() if you're constructing a pathname; use
it only if you're constructing a window title.

Change-Id: I40f225ddb07be2f7dc3ae03108dae816846f20c7
Reviewed-on: https://code.wireshark.org/review/28582
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-03 22:41:18 +00:00
Guy Harris 670377f491 Don't show temporary file names in title bars.
For dialogs and auxiliary windows, if we have a live capture that hasn't
yet been saved to a permanent location, there's no good reason to show
the temporary file name in the title bar, as:

  it's a random string that doesn't indicate where the capture was done
  and that could confuse people (see, for example, the confusion in bug
  14929, in which somebody referred to the "Follow TCP Stream" window as
  the ".pcap dialog" because its title had ".pcap" at the end, due to
  the capture file being a temporary file and its name showing up in the
  title bar of that window);

  it differs from what the main window title bar shows.

While we're at it, don't assume that the file name in the capture_file
structure is a UTF-8 string - some UN*Xes might not use UTF-8 for file
names.

Change-Id: I0d3dfd5d7f896ea37533daf7089b688710dbabf0
Reviewed-on: https://code.wireshark.org/review/28581
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-03 22:17:15 +00:00
Peter Wu 536e26c55e Qt: fix crash on opening a capture file while loading/saving another
Closing a capture file while it is being loaded will result in a crash.
As a workaround, disallow closing the capture file. The requested action
(e.g. MainWindow::openCaptureFile) will be silently ignored.

While at it, protect process_specified_records (called when saving
files) similarly to cf_read and fix a crash that occurs when a capture
from the Capture Dialog is started while a file is being loaded:

    file.c:360:cf_close: assertion failed: (cf->state != FILE_READ_IN_PROGRESS)

Bug: 10870 # moving rapidly between large files in a file set
Bug: 13594 # start capture while loading/saving file
Bug: 14351 # open another file while loading file
Change-Id: I6ce8f3163c3fa4869f0299e49909a32594326ce4
Reviewed-on: https://code.wireshark.org/review/28541
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-07-03 07:58:00 +00:00
Guy Harris c87a6d364d Make arrays of 4 octets arrays of 4 guint8.
That makes it clearer that it's not a string, and avoids some type
complaints from change Ida7b98af8c44a52ddac2c4ab0702db2519a0c4af.

Update a comment while we're at it.

Change-Id: I6737bb2a7ff3b4d461700c641cb580194f7809e7
Reviewed-on: https://code.wireshark.org/review/28572
Petri-Dish: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-02 21:42:37 +00:00
Guy Harris a88126d91f Make an array of 4 octets an array of 4 guint8.
That makes it clearer that it's not a string, and avoids some type
complaints from change Ida7b98af8c44a52ddac2c4ab0702db2519a0c4af.

Update a comment while we're at it.

Change-Id: Idba56f38d58d87f73aee41a11195371021a1328d
Reviewed-on: https://code.wireshark.org/review/28571
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-07-02 20:49:17 +00:00
Jiri Novak 3937f65e67 RTP: If multiple codecs are used in RTP stream flow, all are shown in codecs column
Change-Id: Ica8b3bc2b6b59790805764ec88c6f4e3f8689a85
Reviewed-on: https://code.wireshark.org/review/28435
Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-06-28 00:46:39 +00:00
Graham Bloice d8459d8930 packet export: Add default file extension
Adds a default file extension when exporting packet dissection
in various formats:

text       -> txt
postscript -> ps
csv        -> csv
pdml       -> pdml
psml       -> psml
c arrays   -> c
json       -> json

Change-Id: Ie5d942a3c694abd8edf9df184f6e219d4b870a1b
Reviewed-on: https://code.wireshark.org/review/28490
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Petri-Dish: Graham Bloice <graham.bloice@trihedral.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2018-06-27 23:01:03 +00:00
Gerald Combs fe94133f0d Remove code specific to older versions of Visual Studio.
Remove -DBUILD_WINDOWS and sections of code that we no longer use.

Bug: 14715
Change-Id: Iae1a950e2f52f4ce45fcf0ae5dea06c1172c3a28
Reviewed-on: https://code.wireshark.org/review/28466
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-26 22:30:50 +00:00
Gerald Combs 67a3f83769 GTK+: Remove the last original bit of GTK+ code.
Change-Id: If1eedf278336494d6989515aa573ae1682851d44
Reviewed-on: https://code.wireshark.org/review/28464
Reviewed-by: Roland Knall <rknall@gmail.com>
Reviewed-by: Dario Lombardo <lomato@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Peter Wu <peter@lekensteyn.nl>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-26 21:30:06 +00:00
Gerald Combs c74dba69fc Windows: Fetch our version using RtlGetVersion.
GetVersionEx is deprecated. Use RtlGetVersion instead. Remove
get_windows_major_version since it's no longer needed.

Change-Id: I02f6458608c2328a96a0ac71c6b1f9187babd049
Reviewed-on: https://code.wireshark.org/review/28443
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Guy Harris <guy@alum.mit.edu>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2018-06-26 20:30:02 +00:00
Roland Knall 1437b421a2 Qt: Fix crash when starting to drag on the wrong position
When dragging on the wrong position in the toolbar, wireshark
crashes

Change-Id: I756e9caebc844d32e99e9fd3e338a872986b9e96
Reviewed-on: https://code.wireshark.org/review/28458
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2018-06-26 19:51:57 +00:00