Commit Graph

7023 Commits

Author SHA1 Message Date
Guy Harris 2b9a6ee592 text_import: just suppress the two-initializers warning.
Stick with the simpler "init everything to invalid, and then override
that" mechanism, and just turn off the warning for thse structures.
2021-03-27 14:00:44 -07:00
Guy Harris fd39930f40 text_import: don't initialize array elements twice.
Some compilers warn about it with -Winitializer-overrides, and default
to setting that.
2021-03-27 12:35:01 -07:00
Jirka Novak 1c59f7d9ac RTP Player: Decoding of audio improved
Changes:
In nearly all cases decoding match content of capture. The exception is #2270,
where timestamps do not match recorded time which causes discrepancy in
decoding.
Decoding of audio correctly follows different soundcard rates.
RTP Player shows first sample rate in each stream in place of rate of playing.
Fixed incorrect time axis calculation

Fixes #16837
Fixes #4960
Fixes #2270
2021-03-27 12:12:43 +00:00
Jirka Novak e75e1fb580 Follow SIP Call: Added Follow SIP Call to Follow menu
Changes:
- epan/follow.c: follow_conv_filter_func has new parameter
  epan_dissect_t *edt, so filter can be generated based on decoded tree
of packet below the cursor
- menu Follow/SIP Call is enabled when sip packet is selected
- value of sip.Call-ID is used as filter for SIP call
- for sharkd it generates filter just 'sip.Call-ID' with no value
2021-03-27 09:02:14 +00:00
Jirka Novak cd5b568233 RTP Player: Showing of setup frame for RTP stream fixed
When RTP stream has no setup frame, but is decoded by Decode as or
with rtp_udp active, setup frame was shown as SETUP <number>, but
correct is RTP <number>.
2021-03-27 08:45:22 +00:00
Gerald Combs be2b0fc810 CMake: Enable AUTO{MOC,UIC,RCC} earlier.
Enable CMAKE_AUTOMOC, CMAKE_AUTOUIC, and CMAKE_AUTORCC before searching
for Qt packages. This is apparently required for CMake 3.20.0 and later.
Fixes #17314.
2021-03-26 20:48:22 +00:00
Paul Weiß 537c5f2955 Regex text imoprt: MSVC compiling and updated timestamps
replaced [min ... max] = val initiallizers with a macro expansion
removed __attibute__
updated timestamps to march
2021-03-26 06:44:25 +00:00
Paul Weiß b0289c5aaf Regex text import: fixed ui deviations
disabled RichText in regex text input, to prevent invisible
formatting from getting passed to the regex engine
fixed a issue where fields matched by duplicate groups would
not be parsed
2021-03-26 06:44:25 +00:00
Paul Weiß 8c1b29a597 Regex based textfile import
Modularized the parser backend slightly to have the needed hooks
Modified the timestamp format slightly to enable arbitrary postion for
second fractions
Added a regex based seeking parser for textfiles as frontend alternative
to text_import_scanner.l
Regex is using the GLib implementation
Supported frame-data formats are bin, hex, oct and base64
Regex based importing UI
Fixed Meory-leak in ImportTextDialog::exec()
A new tab was added to the text_import ui to accomodate the new fields
Hints are available and styled accordingly
2021-03-26 06:44:25 +00:00
Dario Lombardo ea929d6401 wsutils: add local implementation of g_memdup2.
g_memdup() was deprecated and replaced with g_memdup2() in GLib 2.68,
we provide our own copy of g_memdup2() for older GLib versions.
2021-03-25 09:38:10 +00:00
Jirka Novak f10ebb959d VoIP UI: Added shortcuts for dialog buttons
VoIP/SIP Calls, Sequence, RTP Streams, RTP Player and RTP Analysis
dialogs have shortcuts assigned. Shortcuts are same over all dialogs.
2021-03-24 20:02:41 +00:00
Jirka Novak 2a4859bd14 RTP Player: UI improvements
Changes:
- all waveforms has common scale therefore louder/quiter signal is visible
- when stream/streams are deleted from view, Y axis is rescaled and
  waveforms are rearranged to reuse empty space
2021-03-24 09:23:52 +00:00
Jirka Novak 030fbc7740 RTP Player: Fixed incorrect handling of legend in graph
Legend and it's elements were shown only when first waveform requires it.
Patch fixes it and all legend elements are shown when required by any
waveform.
2021-03-22 12:33:43 +00:00
Jirka Novak a123578fd5 RTP Player: Visual waveform shows what is really played
Visual waveform is derived from decoded audio. When audio is decoded
incorrectly, waveform now shows it.
E.g. on issue 14401 is now audio play aligned with waveform, but it
exhibits that decoded audio is incorrect - about two times longer than
pcap!

Changes:
- samplefile_ renamed to sample_file_
- tempfile_ is renamed to temp_file_
- decode() is separated to decodeAudio and decodeVisual
- Frame info stores frame len and frame_num for every frame. We must hold
it per frame as it may change in time. Info is stored in separate temp file
as waveform samples.
2021-03-22 04:43:30 +00:00
Gerald Combs 7c0ca88170 [Automatic update for 2021-03-21]
Update manuf, services enterprise numbers, translations, and other items.
2021-03-21 17:13:10 +00:00
Guy Harris 2820156fbd Move still *more* headers outside of extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".
2021-03-16 13:50:13 -07:00
Guy Harris a7d98a2cc9 Expand a comment.
Give details on what happens when running Wireshark from a GUI on
UN*Xes, or, at least, on {macOS,Ubuntu+GNOME,Ubuntu+KDE}, although
it's probably similar on other UN*Xes and on other desktop environments.
2021-03-15 18:40:19 -07:00
Guy Harris 8f965899b3 Remove unnecessary includes of wiretap/pcap-encap.h. 2021-03-15 16:04:02 -07:00
Guy Harris ce20c00049 Remove unnecessary inclues of wiretap/pcapng.h. 2021-03-15 15:29:40 -07:00
Guy Harris 9bf838b2ea tap_export_pdu: finish the job of reporting errors.
Provide the pathname of the file, and the frame number, to the error
routines.
2021-03-15 14:52:12 -07:00
Guy Harris 8795edd57c tap_export_pdu: report write errors on the output file.
Now that we have report_cfile_write_failure(), use it.

Also, if an error occurs, eturn TAP_PACKET_FAILED, so we don't keep
trying to write.
2021-03-15 14:03:24 -07:00
Guy Harris 37000e9565 tap_export_pdu: clean up includes.
Get rid of some unnecessary includes, put all the wsutil/ includes
together, use angle brackets for all of them, move version_info.h down.
2021-03-15 13:01:03 -07:00
Guy Harris c33e2f7b51 Add more error-reporting routines that call through a function pointer.
Have routines to report capture-file errors, using libwireshark error
codes and strings, that call through a pointer, so they can pop up
dialogs in GUI apps, print a message to the standard error on
command-line apps, and possibly do something different on server
programs.

Have init_report_message() take a pointer to structure containing those
function pointers, rather than the function pointers themselves, as
arguments.

Make other API changes to make that work.
2021-03-15 12:17:59 -07:00
Guy Harris 03d6f39a99 libwiretap: make wtap_wtap_encap_to_pcap_encap() private to the library.
Only a tiny amount of code outside libwiretap needs to know about
pcap/pcapng LINKTYPE_ values, and all that code needs to know is, for a
given LINKTYPE_ value, what the corresponding WTAP_ENCAP_ value is.
Nothing should need to know, for a given WTAP_ENCAP_ value, what its
LINKTYPE_ value is.

Make it the case that nothing *does* need to know, for a given
WTAP_ENCAP_ value, what its LINKTYPE_ value is.  Export
wtap_dump_can_write_encap() and use *that*, in the "import hex dump"
code, what formats can be written to a pcap file.
2021-03-14 14:22:16 -07:00
Guy Harris 7dc17158db tap_export_pdu: fix an out-of-date comment. 2021-03-14 13:13:37 -07:00
Jirka Novak 2e87c27ce1 Voice dialogs: Unified naming and order of buttons in dialogs
Dialogs has same order of buttons:
- dialog specific (Flow Sequence, Find Reverse, Analyze, Reset Diagram)
- common voice functions (Prepare Filter, Play Streams)
- exports (Copy, Export)
- Close of dialog

Names were unified:
- Copy really copying to clipboard
- Save/Export was unified to Export
2021-03-14 19:08:45 +01:00
Guy Harris 01151ec332 Clean up "Export PDUs to File" code.
Combine exp_pdu_file_open() is called only by do_export_pdu(); just
combine them into one routine.

Get rid of the exp_pdu_t * argument to do_export_pdu(); instead, have
the exp_pdu_t structure be a local variable in that routine.  There's no
need to initialize exp_pdu_data.pkt_encap in
ExportPDUDialog::on_buttonBox_accepted() - do_export_pdu() already does
so.

The return value of do_export_pdu() isn't used; don't return anything.
2021-03-14 06:51:36 -07:00
Jirka Novak 006f0ab571 Voice dialogs: Added Select All/None/Invert to all of it 2021-03-14 13:14:53 +00:00
Gerald Combs bc45d75608 [Automatic update for 2021-03-14]
Update manuf, services enterprise numbers, translations, and other items.
2021-03-14 09:49:44 +00:00
Guy Harris d4c55ba464 tap_export_pdu: free err_info for WTAP_ERR_INTERNAL.
WTAP_ERR_INTERNAL also returns an err_info script describing the
internal error, so it should be freed to avoid leaking it.
2021-03-13 22:35:25 -08:00
John Thacker ea60a57826 tshark, export_pdu: Allow tshark to export PDUs to other file types
The export PDU API now allows writing to a different file type. tshark
already has a -F flag for the output file type. If that option is given,
respect it for export PDU. Also, rec.rec_header.packet_header.pkt_encap
expects WTAP encapsulation types, not PCAP encapsulation types, so don't
call wtap_wtap_encap_to_pcap_encap(), or else it won't actually write to
pcap files, only pcapng (using the wrong sort of encap numbers eventually
leads to WTAP_ENCAP_PER_PACKET, which we don't write to non-pcapng.)
2021-03-14 00:14:40 +00:00
Jirka Novak 24d59017a6 RTP Player: Added additional shortcuts
Added shortcuts:
- Mute/Unmute/Invert Mute
- Play/Pause/Stop

Removed outdated help in tooltip text. It makes no sense to use it, all
actions are available in context menu.
2021-03-11 12:44:48 +00:00
Jirka Novak 649eab2dfe RTP player: It is possible to select SETUP packet related to RTP stream
When SETUP (or related signalling packet) exists, it is selected by
Shift+G. If RTP stream is "alone", first RTP packet of the stream is
selected.
2021-03-10 15:45:12 +00:00
Jirka Novak ce786ed265 Rtp player: It is possible to select multiple rows in stream's list and graph
Changes:
- It is possible to select multiple streams in list and in graph
- Select All/None/Invert implemented in list of streams and in graph
- Indication of "Selected" stream redesigned in graph
- Mouse hovering shows related row/wave
- All operations adapted to multiselection
2021-03-09 16:49:09 +00:00
Gerald Combs d3f17ee08a Remove modelines in ui/qt.
Remove the editor modeline blocks from most of the source files in ui/qt
by running

    perl -i -p0e 's{ \n+ /[ *\n]+ editor \s+ modelines .* shiftwidth= .* \*/ \s+ } {\n}gsix' $( ag -g '\.(cpp|h)' )

then cleaning up the remaining files by hand.

This *shouldn't* affect anyone since

- All of the source files in ui/qt use 4 space indentation, which
  matches the default in our top-level .editorconfig

- The one notable editor that's likely to be used on these files and
  *doesn't* support EditorConfig (Qt Creator) defaults to 4 space
  indentation.
2021-03-08 18:11:32 +00:00
Gerald Combs 095618ea87 [Automatic update for 2021-03-07]
Update manuf, services enterprise numbers, translations, and other items.
2021-03-07 09:49:41 +00:00
João Valverde 41a172cc95 if_capabilities: Use a structured error msg from dumpcap
Have dumpcap in child mode return an error message with a primary and
secondary string, instead of using stderr. When writing to the console
log we ignore the second message to prevent flooding the log with
tutorial-like info on permissions.
2021-03-06 12:56:11 +00:00
João Valverde b5530e7021 Teach our console log handler to use log domains (Unix)
By punting to the default log handler. tshark is using
g_log_default_handler(), Qt is too. Is there a reason
Wireshark cannot do the same?

Using g_defaut_log_handler() allows the user to
selectively turn on INFO and DEBUG messages using
the environment variable G_MESSAGES_DEBUG.

The fact that the output format is now consistent with
tshark is also a nice bonus.

Ping #17271.
2021-03-06 12:40:20 +00:00
Guy Harris 25d44cde11 wsutil: rename frequency-utils.[ch] to 802_11-utils.[ch].
It's 802.11-specific, and may include non-frequency/channel-related
items in the future.
2021-03-04 15:41:00 -08:00
Gerald Combs 25edc7439b Make ui/*.[ch] indentation consistent.
Switch ui/clopts_common.c, ui/filter_files.[ch], and ui/summary.[ch] to
4 space indentation. This brings them in line with all of the other
files in that directory and with ui/qt.

Fix the modelines in ui/qt/models/filter_list_model.cpp.
2021-03-01 22:41:23 +00:00
Gerald Combs e075626611 [Automatic update for 2021-02-28]
Update manuf, services enterprise numbers, translations, and other items.
2021-02-28 12:45:18 +00:00
Guy Harris ab7375dc6b Check for CaptureFileDialog::selectedFileType() failing.
Have it return WTAP_FILE_TYPE_SUBTYPE_UNKNOWN, rather than an
undecorated -1, if the hash table lookup fails.

Check for that as a return value, and pop up a "file an issue" dialog if
WTAP_FILE_TYPE_SUBTYPE_UNKNOWN is returned.

This should squelch Coverity CID 1473325; the error Coverity reports is
bogus, as negative file type/subtype values are check for before we try
to use them as suffixes, but this should catch the "this should not
happen" case that caused the error to pop up.
2021-02-27 14:25:55 -08:00
Guy Harris 4cdc6ee573 exp_pdu_open: swap two arguments.
The second argument is the file type/subtype, and the third argument is
the file descriptor, according to the function declaration and all the
calls to it.  Make it so in the function definition.

Fixes Coverity CIDs 1473314 and 1473312.
2021-02-23 18:38:53 -08:00
Guy Harris 166159f15d wiretap: eliminate the pcap/nspcap/pcapng WTAP_FILE_TYPE_SUBTYPE_ values.
Register the pcap and pcapng file types/subtypes rather than hardwiring
them into the table.

Call the registration routines for them directly, rather than through a
generated table; they're always supposed to be there, as some code in
Wireshark either writes only one of those formats or defaults to writing
one of those formats.  Don't run their source code through the
registration-routine-finder script.

Have the file type/subtype codes for them be directly exported to the
libwiretap core, and provide routines to return each of them, to be used
by the aforementioned code.

When reporting errors with cfile_write_failure_message(), use
wtap_dump_file_type_subtype() to get the file type/subtype value for the
wtap_dumper to which we're writing, rather than hardcoding it.

Have the "export PDU" code capable of supporting arbitrary file
types/subtypes, although we currently only use pcapng.

Get rid of declarations of now-static can_write_encap and
dump_open routines in various headers.
2021-02-23 21:56:20 +00:00
Thomas Dreibholz 2e7f2ffb7a
Added "Follow DCCP stream" feature.
This pull request includes:
* The "Follow DCCP stream" feature.
* Updated docbook documentation for the "Follow DCCP stream" feature.
* Test for the feature.
* Corresponding packet trace for the test.
2021-02-22 12:48:46 +01:00
Guy Harris 842a7cccf9 wiretap: have file handlers advertise blocks and options supported.
Instead of a "supports name resolution" Boolean and bitflags for types of
comments supported, provide a list of block types that the file
type/subtype supports, with each block type having a list of options
supported.  Indicate whether "supported" means "one instance" or
"multiple instances".

"Supports" doesn't just mean "can be written", it also means "could be
read".

Rename WTAP_BLOCK_IF_DESCRIPTION to WTAP_BLOCK_IF_ID_AND_INFO, to
indicate that it provides, in addition to information about the
interface, an ID (implicitly, in pcapng files, by its ordinal number)
that is associated with every packet in the file.  Emphasize that in
comments - just because your capture file format can list the interfaces
on which a capture was done, that doesn't mean it supports this; it
doesn't do so if the file doesn't indicate, for every packet, on which
of those interfaces it was captured (I'm looking at *you*, Microsoft
Network Monitor...).

Use APIs to query that information to do what the "does this file
type/subtype support name resolution information", "does this file
type/subtype support all of these comment types", and "does this file
type/subtype support - and require - interface IDs" APIs did.

Provide backwards compatibility for Lua.

This allows us to eliminate the WTAP_FILE_TYPE_SUBTYPE_ values for IBM's
iptrace; do so.
2021-02-21 23:18:35 +00:00
Martin Kaiser 0f0b340aa5 PacketList: mouseMoveEvent: fix memory leak
We allocate a QMimeData object at the beginning of PacketList::mouseMoveEvent.
Usually, this object is passed to a QDrag object by calling drag->setMimeData.
In this case, the QDrag object owns the mime data object and frees it when
it's no longer required.

If the mime data object contains no data that can be dragged and dropped, we
reach the end of PacketList::mouseMoveEvent without anyone taking care of
the mime object. We have to free it ourselves in this case.

The problem can be reproduced if you add a custom column for an element that
does not exist in your capture file. Left-click onto the empty column and
drag the empty column entry somewhere. An asan build will then show the
memory leak

Indirect leak of 240 byte(s) in 2 object(s) allocated from:
    #0 0x7f351e153d30 in operator new(unsigned long) (...)
    #1 0x7f3500b79802 in QMimeData::QMimeData() (...)

Indirect leak of 32 byte(s) in 2 object(s) allocated from:
    #0 0x7f351e153d30 in operator new(unsigned long) (...)
    #1 0x5635156dfbc7 in PacketList::mouseMoveEvent(QMouseEvent*) ...
    #2 0x7f3502eb94d7 in QWidget::event(QEvent*) (...)
2021-02-21 13:29:11 +00:00
Gerald Combs daf4e3cafe [Automatic update for 2021-02-21]
Update manuf, services enterprise numbers, translations, and other items.
2021-02-21 11:42:59 +00:00
naf 95f3d1b075 QT ByteViewText: calculate string widths consistently to prevent clipping
For QT >5.11, stringWidth() uses horizontalAdvance, which gives different
(longer) widths than the old boundingRect().width() method.

Other locations use the boundRect().width() method directly, resulting
in underestimating line widths and clipping the last characters in
the byte view window.

Fix by forcing all width calculations to use stringWidth().
Closes #17087.
2021-02-21 10:17:07 +00:00
Martin Mathieson cd77e5aa5f Some more spelling fixes.
Also add more words to dictionary file.
2021-02-21 09:59:04 +00:00
Guy Harris c80c16759b wiretap: eliminate two WTAP_FILE_TYPE_SUBTYPE_ values.
Eliminate WTAP_FILE_TYPE_SUBTYPE_ERF and
WTAP_FILE_TYPE_SUBTYPE_SYSTEMD_JOURNAL - instead, fetch the values by
name, using wtap_name_to_file_type_subtype().

This requires that wtap_init() be called before epan_init(); that's
currently the case, but put in comments to indicate why it must continue
to be the case.
2021-02-19 23:20:24 +00:00
Gerald Combs abf9e027fc Require Qt 5.6 or later.
Increase the minimum required version of Qt from 5.3 to 5.6. The various
Linux distribution versions that shipped with earlier Qt versions (RHEL
6, Fedora 23, openSUSE 13.2, Debian jessie, Ubuntu 16.04) have either
reached end of support or will do so soon.

The official Qt 5.6 releases for macOS require 10.8, so make that the
minimum macOS version.

Remove a bunch of no-longer-needed version checks.
2021-02-19 13:49:10 -08:00
Gerald Combs 4fd5224ecf CMake: Use target_include_directores more.
The include_directories documentation at
https://cmake.org/cmake/help/latest/command/include_directories.html
says:

"Note: Prefer the target_include_directories() command to add include
 directories to individual targets and optionally propagate/export them
 to dependents."

Switch from include_directories to target_include_directories in a bunch
of places.

Add "SYSTEM" to the remaining external include_directories calls in
order to minimize our compiler warning blast radius.
2021-02-18 06:34:46 +00:00
Guy Harris f3166ce07d ui/capture.c: simplify cf_open_error_message().
This only opens files for reading, so throw out all the stuff to handle
opening files for writing.
2021-02-17 16:08:31 -08:00
Guy Harris a7256d50b5 wiretap: more work on file type/subtypes.
Provide a wiretap routine to get an array of all savable file
type/subtypes, sorted with pcap and pcapng at the top, followed by the
other types, sorted either by the name or the description.

Use that routine to list options for the -F flag for various commands

Rename wtap_get_savable_file_types_subtypes() to
wtap_get_savable_file_types_subtypes_for_file(), to indicate that it
provides an array of all file type/subtypes in which a given file can be
saved.  Have it sort all types, other than the default type/subtype and,
if there is one, the "other" type (both of which are put at the top), by
the name or the description.

Don't allow wtap_register_file_type_subtypes() to override any existing
registrations; have them always register a new type.  In that routine,
if there are any emply slots in the table, due to an entry being
unregistered, use it rather than allocating a new slot.

Don't allow unregistration of built-in types.

Rename the "dump open table" to the "file type/subtype table", as it has
entries for all types/subtypes, even if we can't write them.

Initialize that table in a routine that pre-allocates the GArray before
filling it with built-in types/subtypes, so it doesn't keep getting
reallocated.

Get rid of wtap_num_file_types_subtypes - it's just a copy of the size
of the GArray.

Don't have wtap_file_type_subtype_description() crash if handed an
file type/subtype that isn't a valid array index - just return NULL, as
we do with wtap_file_type_subtype_name().

In wtap_name_to_file_type_subtype(), don't use WTAP_FILE_TYPE_SUBTYPE_
names for the backwards-compatibility names - map those names to the
current names, and then look them up.  This reduces the number of
uses of hardwired WTAP_FILE_TYPE_SUBTYPE_ values.

Clean up the type of wtap_module_count - it has no need to be a gulong.

Have built-in wiretap file handlers register names to be used for their
file type/subtypes, rather than building the table in init.lua.

Add a new Lua C function get_wtap_filetypes() to construct the
wtap_filetypes table, based on the registered names, and use it in
init.lua.

Add a #define WSLUA_INTERNAL_FUNCTION to register functions intended
only for internal use in init.lua, so they can be made available from
Lua without being documented.

Get rid of WTAP_NUM_FILE_TYPES_SUBTYPES - most code has no need to use
it, as it can just request arrays of types, and the space of
type/subtype codes can be sparse due to registration in any case, so
code has to be careful using it.

wtap_get_num_file_types_subtypes() is no longer used, so remove it.  It
returns the number of elements in the file type/subtype array, which is
not necessarily the name of known file type/subtypes, as there may have
been some deregistered types, and those types do *not* get removed from
the array, they just get cleared so that they're available for future
allocation (we don't want the indices of any registered types to changes
if another type is deregistered, as those indicates are the type/subtype
values, so we can't shrink the array).

Clean up white space and remove some comments that shouldn't have been
added.
2021-02-17 21:54:28 +00:00
Tomasz Moń ecaf1897aa Qt: Do not use obsolete functions
QDateTime to/from Time_t functions are deprecated in favor of 64-bit
to/from seconds since epoch introduced in Qt 5.8.

QLayout::setMargin() is deprecated in favor of setContentsMargin().
2021-02-15 15:22:55 +01:00
Gerald Combs e99c9afce8 Be more strict about opening URLs.
In the proto tree, copy URLs instead of opening them.

In the export dialog, enable previews only if the advertised MIME type
*and* the contents of the file are plain text, GIF, JPEG, or PNG.

Add warnings to the wslua browser_open_url and browser_open_data_file
documentation.

Fixes #17232.
2021-02-15 08:47:57 +00:00
Gerald Combs 270c8ed746 CMake: Make sure system headers are treated as such.
Use target_include_directories instead of include_directories in a few
places as recommended at

https://cmake.org/cmake/help/latest/command/include_directories.html

Doing so lets us mark a bunch of dependency includes SYSTEM PRIVATE, in
particular LIBXML2_INCLUDE_DIRS. On macOS this keeps us from triggering
the nullability warnings described at

https://www.wireshark.org/lists/wireshark-dev/202004/msg00056.html

(This might also keep the Visual Studio code analyzer from complaining
about various Qt headers, but I haven't tested this.)
2021-02-15 08:31:08 +00:00
Guy Harris c0711693ab Enable -Wredundant-decls.
Add it to the default list of checks, and fix some errors it causes.
(Sadly, it doesn't work in CLang.)
2021-02-14 14:43:42 -08:00
Gerald Combs 20bc017ba5 [Automatic update for 2021-02-14]
Update manuf, services enterprise numbers, translations, and other items.
2021-02-14 12:03:40 +00:00
Guy Harris 24acef0885 wiretap: file types have a name and a description.
The "short name" is really just the name, used to look it up.  The
"name" is really a description intended solely for human consumption.
Rename the fields, and the functions that access them, to match.

The "description" maintained by Lua for file type handlers is used
*only* for one debugging message; we should probably just eliminate it.
Call it an "internal description" for now.
2021-02-13 01:25:39 -08:00
Guy Harris 2c6b9e83f1 RTP player: squelch a narrowing warning. 2021-02-10 18:22:46 -08:00
Michal Ruprich c8246c9973 Moving glib.h out of extern C 2021-02-10 17:49:09 +00:00
Guy Harris 09684644ee wiretap: clean up WTAP_BLOCK_ names.
Remove NG from the names - it adds nothing.

Don't use the abbreviations for pcapng block names, spell out what the
block does (e.g. "WTAP_BLOCK_DECRYPTION_SECRETS" rather than
"WTAP_BLOCK_DSB"), to make it more obvious what the block does.

Spell out some other abbreviations.

Add WTAP_BLOCK_PACKET for future use for packet blocks; there's no need
to distinguish between the Enhanced Packet Block, the Simple Packet
Block, and the deprecated Packet Block here.
2021-02-09 22:32:57 +00:00
Jirka Novak 698dab4bfe RTP Stream Dialog: Selected rows keep selected during recap
When recap is initated, list in RTP Stream dialog is cleared and new list
is read from capture so previously selected rows are deselected.
Patch solves it.
2021-02-09 20:38:22 +00:00
Jirka Novak 7e063b6070 RTP Player dialog improved
Functional changes:
  Audio routing information is now stored in audio stream and not in table. It
is handled by separate utils/rtp_audio_routing.cpp class which is able to
convert it between mono/stereo etc.
  There is new utils/rtp_audio_routing_filter.cpp class which is able to
route mono audio stream to any audio channel.
  Sample file separated from audio stream file - sample file is generated only
during recap. So when we need new waveform, we just use existing sample file
and no recap required - it is much faster.
  Audio stream exports just mono audio. Mono audio is then expanded to stereo
and correct channel by AudioRoutingFilter during play as required. So when
audio routing is changed, no recap and no audio export is required.
  When audio stream is muted, no audio is produced nor played.
  Most of signals between RtpPlayerDialog and RtpAudioStream were removed.
Start/Pause/Stop is processed in RtpPlayDialog (just for non muted streams).
Play possition is not received from every playing stream but from independent
silence stream.
  Added Mute/Unmute function.

Optimalization:
  When audio routing is changed, just graphs are updated. No retap nor audio
decoding is required.
  When TOD is changed, just graphs are updated. No retap nor audio decoding is
required.
2021-02-09 18:10:14 +00:00
Jirka Novak 40c1929115 Refactored: Moved sample_bytes_ to rtp_media.h as SAMPLE_BYTES 2021-02-08 17:05:59 +00:00
Gerald Combs f93f7d80b3 [Automatic update for 2021-02-07]
Update manuf, services enterprise numbers, translations, and other items.
2021-02-07 14:32:00 +00:00
Guy Harris 1cbafa47b9 wiretap: add a mechanism for built-in modules to have a register routine.
Currently, only pcapng has one, and it does nothing, but this mechanism
will be used more in the future.

Update comments in epan/dissectors/CMakeLists.txt and ui/taps.h while
we're at it.
2021-02-06 17:54:19 -08:00
Jirka Novak 74961582b3 RTP Player: Possibility to remove stream from RTP player
When many streams are analyzed, some streams can be found as useless during
replay. Patch adds option to remove it from list in RTP player.
Once stream is removed, it can't be returned except close/reopen RTP player
with new selection.
2021-02-05 16:10:12 +00:00
Jirka Novak 67c666b251 RTP Stream Dialog fix: Duplicated streams could be shown
It may happen that a stream could be shown twice or more time in the list.
Patch solves it.
2021-02-05 12:45:01 +00:00
j.novak@netsystem.cz 88a86f5f01 RTP dissector: Remove unused functions
Patch removes (just comments out) functions not used by the code
as found by Martin Mathieson.
2021-02-05 09:19:48 +00:00
Gerald Combs f55813e518 Qt: Remove an unneeded semicolon. 2021-02-05 01:09:36 +00:00
Jirka Novak 1897208d34 RTP Player: Selected waveform is emphased. Waveform can be selected by click.
When there is many waveforms, it is not clear which one is selected in list.
It is important for selecting packets from graph.
Patch emphasis selected waveform. In addition, it allows to select waveform
by clicking on it.
2021-02-04 22:30:26 +00:00
Jirka Novak 68ae34fba7 RTP Player: Audio routing information refactored
Audio routing information storage refactored to separate mute information and
channel routing. It is required for next changes.
2021-02-04 22:30:26 +00:00
Jirka Novak 9db3617b46 RTP Player: Added notification message during long decoding
When RTP player updates view, it might take long time. So message
is shown in hint area.
2021-02-04 22:08:37 +00:00
Guy Harris 0773147a55 wiretap: redo the way we handle if_filter IDB options.
Change the data structure for that option to have a type field,
indicating that it's either a pcap filter string or a BPF program,
followed by a union with a string-pointer member for pcap filter strings
and an instruction-count-and-pointer-to-instructions structure for BPF
programs.

Have routines to add, set, and fetch that option that handle that
structure; discard the "generic structured option" routines.  That means
there's more type checking possible at compile time.

Add more code to handle BPF programs.

When writing pcapng files, check, both for that option and for string
options, whether the option length is too big for the data to fit in a
pcapng option, and don't write it if it is.  (XXX - truncate the data?
Report an error?)
2021-02-01 16:50:01 -08:00
Gerald Combs e642f94ecb [Automatic update for 2021-01-31]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-31 22:18:47 +00:00
Jirka Novak 80760302c9 RTP player: Doubled buffer for replay to avoid play stop caused by underruns
Patch solves issue for case when QT plays audio faster than reads it from file.
The change looks strange because there is no way how to get buffer size before
starting the play. So code start the play, reads buffer and stop it. Then
increases buffer size and start play again.

Note: You still can receive ALSA notifications like:
ALSA lib pcm.c:8545:(snd_pcm_recover) underrun occurred
but it do not stop audio replay.
2021-01-31 15:21:34 +00:00
Guy Harris 1f15c0899e epan: have a routine to register all tap listeners.
Pull the code to register plugin taps, and the loop to register built-in
taps, into a single register_all_tap_listeners() routine.

This leaves it up to libwireshark, not to the programs using it, to know
how to register them.
2021-01-30 21:15:30 -08:00
Guy Harris ca85c516fe Refer to options whose data isn't a simple data type as "structured".
"Custom", as in "requires custom handling of the option data, collides
with "custom", as in pcapng custom options.
2021-01-30 00:12:11 -08:00
Gerald Combs d50d075f88 [Automatic update for 2021-01-24]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-24 09:48:31 +00:00
Guy Harris 165792fb31 dup() can fail; check whether it does.
If, for example, you run out of file descriptors, dup() can fail, and
ws_dup() is a wrapper around it on UN*X.  Don't just pass the result of
ws_dup() to ws_fdopen(); instead, save its result, check against -1 and,
if it's -1, give up, otherwise pass it to ws_fdopen().

This addresses Coverity CID 1471708.

Also, if ws_fdopen() fails, close the descriptor we got from ws_dup();
this closes a possible FD leak.
2021-01-18 23:31:27 -08:00
Gerald Combs 85a7938925 Qt+tools: Fix most of our lupdate warnings.
Fix various warnings with the following changes:

Pass a list of include directories to lupdate. Fixes:

    ui/qt/proto_tree.cpp:57: Qualifying with unknown namespace/class ::ProtoTree

and similar warnings.

Use QT_TRANSLATE_NOOP instead of QT_TR_NOOP. Fixes:

    ui/qt/lte_rlc_statistics_dialog.cpp:993: tr() cannot be called without context
    ui/qt/lte_mac_statistics_dialog.cpp:911: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:28: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:29: tr() cannot be called without context
    ui/qt/font_color_preferences_frame.cpp:30: Discarding unconsumed meta data

Add Q_OBJECT to the class definition. Fixes:

    ui/qt/models/filter_list_model.cpp:120: Class 'FilterListModel' lacks Q_OBJECT macro

The following warnings were not fixed. This might require moving IOGraph
to its own file:

    ui/qt/io_graph_dialog.cpp:320: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:555: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1059: Qualifying with unknown namespace/class ::IOGraphDialog
    ui/qt/io_graph_dialog.cpp:1485: Qualifying with unknown namespace/class ::IOGraphDialog
2021-01-18 16:56:20 +00:00
Gerald Combs 675de0f4f1 [Automatic update for 2021-01-17]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-17 09:47:55 +00:00
Jirka Novak 737e18d37b SIP Flow: Fixed core dump when dialog opened
Copy&paste typo fixed.
2021-01-16 07:08:46 +00:00
Martin Kaiser 8e030dfbea tap-simple_stattable: fix a memory leak for tshark -z
Displaying statistics with tshark results in a memory leak.

tshark -r <any pcap file> -z dhcp,stat -q

==26971==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 24 byte(s) in 1 object(s) allocated from:
    #0 0x7f89a4bae518 in calloc (/usr/lib/x86_64-linux-gnu/libasan.so.5+0xe9518)
    #1 0x7f8989af2918 in g_malloc0 (/usr/lib/x86_64-linux-gnu/libglib-2.0.so.0+0x53918)

init_stat_table allocates a table_stat_t. This is used as private data while
the tap listener is running but it's not freed afterwards.

This patch adds a finish callback for the tap listener where the
table_stat_t is freed.
2021-01-15 06:03:45 +00:00
Dario Lombardo 60414fa60f Revert "Qt: fix memleak in DecodeAsDelegate."
This reverts commit dd13766fb9.
2021-01-14 13:38:53 +00:00
Joakim Karlsson 8b487e22e0 Qt: fix build error with older GCC
qt-5.12.2/include/QtCore/qstring.h:291:31: note: candidate 1: QString
QString::arg(double, int, char, int, QChar) const
     Q_REQUIRED_RESULT QString arg(double a, int fieldWidth = 0, char
fmt = 'g', int prec = -1,

qt-5.12.2/include/QtCore/qstring.h:975:16:
note: candidate 2: QString QString::arg(int, int, int, QChar) const
 inline QString QString::arg(int a, int fieldWidth, int base, QChar
fillChar) const

wireshark/ui/qt/rtp_analysis_dialog.cpp:926:77:
error: ISO C++ says that these are ambiguous, even though the worst
conversion for the first is better than the worst conversion for the
second: [-Werror]
             .arg(abs(r_calc.start_time_ms - f_calc.start_time_ms), 0,
'f', 6)

Change-Id: I6a27adff3b03bcfeac8fb56ceb0833d2707000b5
2021-01-13 11:54:08 +00:00
Moshe Kaplan e6a93a313b Qt: Debounce Preferences -> Advanced menu's "Search" to improve UX
As running pd_ui_->advancedView->expandAll() takes a noticeable amount
of time and so would introduce significant lag while typing a string
into the Search box, we instead debounce the call to
updateSearchLineEdit(), so that it doesn't run until a set amount of
time has elapsed with no updates to the Search field.

If the user types something before the timer elapses, the timer restarts
the countdown.

Fixes #17107
2021-01-12 22:11:47 +00:00
John Thacker fb422bed91 Qt: Make the checkSaveAsWithComment dialog box appear.
Set the parent of the QMessageBox in the constructor instead of calling
QMessageBox::setParent(). The latter inherits from QDialog, and it
"clear[s] the window flags specifying the window-system properties for
the widget (in particular it will reset the Qt::Dialog flag)."
(See https://doc.qt.io/qt-5/qdialog.html#details )
This makes the dialog properly appear instead of attempting to save a file
with comments to a file type that does not support comments silently failing.
Fixes #17146.
2021-01-12 07:11:35 +00:00
Jirka Novak 8dd8491713 Qt framework: Dialogs are correctly notified when capture file was closed
The patch reintroduces WiresharkDialog::captureFileClosed() method and
calls captureFileClosing() and captureFileClosed() in right order.
Both methods call updateWidgets() at its end.

All dialogs were reviewed and captureFileClosing/Closed methods updated
when appropriate.
captureEvent() method in multiple dialogs changed to captureFileClosing/Closed
as it does same actions - looks like old style of detecting of capture
file closing.
2021-01-11 13:30:18 +00:00
Gerald Combs a6ed43e06b [Automatic update for 2021-01-10]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-10 17:01:28 +00:00
Jirka Novak 1d43b2a3aa Telecom dialogs: Fixed issues during capture file closing
When capture file is closing/closed, dialogs do not disable buttons which
can't work without capture file. Patch fixes it.
2021-01-07 09:56:18 +00:00
Jirka Novak 55075f6e8d Fix: SIP Flows dialog can't be open when VoIP Calls dialog is opened
Patch fixes issue when SIP Flows dialog can't be open when VoIP Calls dialog
is opened and vice versa.
2021-01-07 08:56:14 +00:00
Dario Lombardo dd13766fb9 Qt: fix memleak in DecodeAsDelegate. 2021-01-07 08:37:22 +00:00
Dario Lombardo 602a1ef613 Qt: fix leak in DecodeAsModel.
The list of items was free'd, but not the items within it. Delete
them explicitly and do it in the class destructor.

Fix: #17127.
2021-01-07 08:37:22 +00:00
Stig Bjørlykke c1ba732861 Qt: Set Packet List scrollbar page step
Set the Packet List scrollbar page step to be equal to the height
of the scrollbar.

This makes page stepping using the packet list slider more natural.
2021-01-05 08:21:13 +00:00
Stig Bjørlykke 7980f25f99 Qt: Fetch OverlayScrollBar sliderPosition from the real ScrollBar
In OverlayScrollBar return the real ScrollBar sliderPosition to ensure
the correct value is used when handling the actionTriggered signal in
vScrollBarActionTriggered().

This improves turning on and off auto scroll during capture when page
stepping using the packet list slider, because the value is propagated
after this signal.
2021-01-05 08:04:14 +00:00
Gerald Combs dfc05555eb [Automatic update for 2021-01-03]
Update manuf, services enterprise numbers, translations, and other items.
2021-01-03 17:38:31 +00:00
Jirka Novak 7928f81b10 RTP processing: Modified RTP sequence verification
The patch changes:
- Removed first_packet_mac_addr staff. It was commented out many years ago...
- Removed delta_timestamp item. Not used.
- Sequence verification takes into account timestamp therefore it is able to detect delayed packets more clearly. As consequence of it, #16330 is solved.
- If packet is delayed, it is not used in calculation of diff/jitter/skew. It just mess output. As consequence of it, #16330 is solved.

I checked output with many RTP streams and looks well. But I have no
sample with wrapped timestamp and I have just a few samples with
missing/reordered packets. Nevertheless all are calculated same way as
before and #16330 is solved too.
2021-01-03 16:53:21 +00:00
Jirka Novak b9e5b58ee9 RTP dialogs fix: sigv occurs when dialogs are open when no cap file is open
Patch fixes the issue which causes sigv fault when user tries to open
VoIP Analysis or RTP Streams dialog and no capture file is open.
2021-01-03 08:22:33 +01:00
Darius Davis a256ad68d6 UI: Remove apostrophe from FAQs item in Help menu.
The apostrophe in "FAQ's" is incorrect -- and inconsistent with the FAQs item
on the main website -- so it is removed from the Help menu item.
2021-01-02 22:22:27 +00:00
Stig Bjørlykke a42ab09b72 Qt: Connect QScrollbar::actionTriggered to OverlayScrollBar
This will fix the issue where auto scroll during capture is not turned
off when the scroll bar position is changed.
2021-01-02 21:34:13 +00:00
Jirka Novak fd6c5e6a9b RTP analysis: Dialog uses common calculation function
UpdateStatistics method uses common rtpstream_info_calculate function.
2021-01-02 14:47:05 +00:00
Jirka Novak f0c703e22d RTP Player: x axis centering correction
When waveform start much later than at time 0s, centering of waveform
was incorrect. The reason was that range was taken before rescalingAxes.
Patch solves the issue.
2021-01-02 14:30:57 +00:00
Jirka Novak 976c560bea RTP Player: Fix for #16452
Reason for #16452 is that RTP Player dialog is destroyed before tap
finishes when Escape key pressed. The only solution I found is to check
whether dialog does exists when tap finishes. If so, data are processed
and shown. If dialog was destroyed in meanwhile, no data processing is done.
2021-01-02 08:02:35 +00:00
Jirka Novak 9e4ec8a616 RTP Player: Shows streams independently on active display filter
This patch solves issue #13325.
2021-01-02 07:41:06 +00:00
Jirka Novak e9e36e20bc RTP Stream Dialog: Start of call can be shown as Time of Day
Start of call column is shown as seconds from start of capture nowadays.
This patch add option to show it as Time of Day. It adds symetry to
other voice processing dialogs
2021-01-01 22:10:34 +01:00
Jirka Novak 2a5c96a799 Voice dialogs: Added option to apply display filter in VoIP/RTP dialogs
VoIP Calls dialog and RTP Streams dialog has now option to apply display
filter dialog during processing packets.
Filter checkbox is activated during dialog open when display filter is active.

New field apply_display_filter had to be added to voip_calls_tapinfo_t and
_rtpstream_tapinfo/rtpstream_tapinfo_t structures.
2021-01-01 19:06:58 +00:00
Jirka Novak 1f3a81de86 RTP Player: Time span column shows time of day when Time of Day enabled
Time span column shows relative start and end time of stream. When Time
of Day enabled, column now shows absolute start and end time.
2021-01-01 19:22:07 +01:00
Jirka Novak cf9ffd3d83 All RTP dialogs: Added option to specify count of decimal places
Preferences are extended with advanced settings:
gui.decimal_places1 - 2
gui.decimal_places2 - 4
gui.decimal_places3 - 6

rtp_analysis_dialog, rtp_player_dialog and rtp_stream_dialog uses new settings
for formating numbers. Same information in all dialogs uses same settings.
It solves request #15481.

Note: Other UI dialogs can be adapted later.
2021-01-01 12:41:09 +00:00
Jirka Novak ee78d8e616 VoIP Calls Dialog: List of calls is not cleared/refilled on retaps improved
I found that !1531 was too complex. For comparing calls we can use call_num.
Therefore I reverted creation of call_id for nonSIP call types.
2021-01-01 10:59:29 +00:00
Jirka Novak 6a300f13d0 RTP Stream Dialog: Added 'Start Time' and 'Duration' columns to the dialog.
New columns are added to the dialog.
2020-12-31 08:03:34 +00:00
Jirka Novak 41bf14a39d VoIP Calls Dialog: List of calls is not cleared/refilled on retaps
!1257 solved issue with duplication of information, but removed all
calls from VoIP Calls dialog. This patch solves the issue.
It was tested with many samples and provides same output as 3.4 branch.
2020-12-31 07:41:36 +00:00
Jim Young a727f83597 Qt: Allow color filters to use all valid display filters
We should not prevent a user from using a valid though perhaps enigmatic display
filter just because dfilter_deprecated_tokens() returns true.

Commit 3a53b8643b added ColoringRulesDialog::isValidFilter()
which would return false when dfilter_deprecated_tokens() returned true. Remove
the dfilter_deprecated_tokens() test.

Also fix memory leak for valid display filters.

Closes #17092
2020-12-30 21:09:09 +00:00
Moshe Kaplan c7e89940b5 funnel: Remove unused typedefs
Remove typedefs `funnel_tree_window_t`,
`funnel_node_t`, and `funnel_progress_window_t`
as none of them are used.
2020-12-30 11:02:41 +00:00
j.novak@netsystem.cz 396baef3e5 voip_calls_dialog/voip_calls: Fix for #16952
The fix solves issue #16952. It reverts commit 88813716 which introduced memory leak which causes the issue. The original issue with duplicating entries is solved too.
Because commit was cherry picked to 3.4.0 (might be in more branches), this patch should be cherry picked too.
2020-12-30 08:51:00 +00:00
Jirka Novak 71e3969d63 voip_calls_dialog/voip_calls: Fix for #16952
The fix solves issue #16952. It reverts commit 88813716 which introduced memory leak which causes the issue. The original issue with duplicating entries is solved too.
Because commit was cherry picked to 3.4.0 (might be in more branches), this patch should be cherry picked too.
2020-12-29 18:20:53 +00:00
Jirka Novak b586e194bd RTP player: Size of symbols increased
Size of symbols (Wrong Timestamp, ...) in graph increased from 4pt
to size of main UI font.
2020-12-29 15:00:58 +00:00
Jirka Novak 5a7f249edb RTP player: Added pause button
Pause button added. Button is visible only when media are played.
2020-12-29 14:41:14 +01:00
Jirka Novak 9443c14247 RTP: Added 'Play Streams' button to 'RTP Streams' dialog
When capture contains just RTP streams without signalizations, there
is no way how to play many streams in one player (Analyze button plays
just two streams). This patch adds Play Streams button to dialog and
allows a user to select as many streams they wish.
2020-12-28 22:18:59 +00:00
Moshe Kaplan 6bce7b859a Detect and replace bad allocation patterns (more)
Extension of !1413, to improve regex, detect
additional opportunities to replace
`g_malloc` with `g_new`, and fix them.
2020-12-23 14:07:18 +00:00
Moshe Kaplan 180b5e5dc0 Replace more g_malloc with g_new
Replace g_malloc with g_new to improve
source code readability.
2020-12-23 11:47:17 +00:00
Moshe Kaplan 5227f385b8 Replace g_malloc calls with g_new
Replace calls of `g_malloc(sizeof(foo_t))` with
`g_new(foo_t, 1)`, to improve readability.
2020-12-22 15:48:48 +00:00
Moshe Kaplan e16166a74c Detect and replace bad allocation patterns
Adds a pre-commit hook for detecting and replacing
occurrences of `g_malloc()` and `wmem_alloc()` with
`g_new()` and `wmem_new()`, to improve the
readability of Wireshark's code, and
occurrences of
`g_malloc(sizeof(struct myobj) * foo)`
with
`g_new(struct myobj, foo)`
to prevent integer overflows

Also fixes all existing occurrences across
the codebase.
2020-12-22 14:56:38 +00:00
Guy Harris ca99a821b4 Fix the way we get high-resolution time.
If we're not on Windows, use clock_gettime(CLOCK_REALTIME) *if* we have
it; otherwise, fall back on gettimeofday().

(Note: neither Linux, nor macOS, nor Windows necessarily "have"
particular APIs; particular *versions* of Linux distributions
(kernel+libc) have them, particular *versions* of macOS have them, and
particular *versions* of Windows+MSVC have them.

And Linux, Windows and macOS aren't the only platforms on which we run.)

Fixes #17101.
2020-12-20 13:31:57 -08:00
Gerald Combs 299d2f1ae5 [Automatic update for 2020-12-20]
Update manuf, services enterprise numbers, translations, and other items.
2020-12-20 20:12:13 +00:00
Guy Harris 6498bde741 In Wireshark's version info, indicate whether we were built with Minizip.
We can't determine the version number, as there's nothing in the header
to indicate the version with which we were compiled, nor is there an API
to determine the version with which we're running.
2020-12-18 22:16:04 -08:00
Gael Langlais b06b760dd2 UI: Fix Firewall ACL rules
Fix the Cisco Extended, IPFilter and IPFirewall inbound rules.

Closes #16446
2020-12-18 07:30:37 +00:00
Gerald Combs d4b40c0047 Qt: Force layer backing on Big Sur when needed.
Make sure NSView.wantsLayer is true by setting QT_MAC_WANTS_LAYER=1 at
startup if we're running on Big Sur and we were built with a version of
Qt susceptible to QTBUG-87014. Fixes #17075?
2020-12-16 20:28:16 +00:00
Pascal Quantin 4bf4a46f9b Qt: add support for new netsh syntax in Firewall ACL Rules window
Closes #17083
2020-12-14 22:39:53 +00:00
Jirka Novak ff3fffcf5c VoIP: VoIP calls statistics are cleared when retap is issued
Every press of Play Stream or Prepare Filter caused incorrect increasing
of Packets count and added Comments.
The reason was that callinfo statistics were not clear before recap
therefore all new values were added to exiting ones.
Patch solves it.
2020-12-14 13:29:38 +00:00
Gerald Combs 21928345d3 [Automatic update for 2020-12-13]
Update manuf, services enterprise numbers, translations, and other items.
2020-12-13 17:05:48 +00:00
Jaap Keuter beb1877841 Qt: Add missing break in Win32 file export init dialog function 2020-12-12 14:36:18 +00:00
Pascal Quantin 746051d099 Qt: fix crash when opening/saving IP map on Windows
According to https://bugreports.qt.io/browse/QTBUG-20372 you need to close
a QFile before calling fclose, otherwise it leads to an unexpected behavior.
Let's duplicate the file handle to avoid this issue as suggested in
https://stackoverflow.com/questions/9465727/convert-qfile-to-file

Closes #17074
2020-12-12 12:00:35 +00:00
Pascal Quantin 9fb03566c2 Qt: create endpoint IP map in temp folder
Closes #17074
2020-12-12 00:14:20 +00:00
Gerald Combs 6e1142c33a Win32: Add an include guard.
Add "#ifdef _WIN32" to file_dlg_win32.c so that it's ignored by
tools/validate-clang-check.sh.
2020-12-11 13:38:14 -08:00
Jirka Novak a61b6d277b RTP: RTP stream dialog exports to CSV and YAML pure and formated items
Current CSV/YAML export from RTP stream exports just pure/unformated items. Therefore e.g. SSRC looks different way than shown in dialog. This patch adds additional columns with formated values.
In addition, export uses same method how to get values from a record as dialog uses.
2020-12-09 11:38:03 +00:00
Guy Harris bb494c11de Fix various spelling errors.
Found by lintian and by looking for the misspelled words that lintian
found.

(Does not fix spelling errors in .asn1 files.)
2020-12-09 05:52:50 +00:00
Martin Kaiser ba16825c6c Qt: column list model: remove unused ListElement component
Selecting Edit / Preferences on my asan+ubsan build brings up the
following warning from ubsan:

/media/sf_wireshark.git/ui/qt/models/column_list_model.cpp:273:9:
runtime error: load of value 25, which is not a valid value for type 'bool'

The problem is in ColumnListModel::populate(), where a ListElement is
populated from fmt_data. The ListElement's "changed" component is not
initialized, though.

It looks like "changed" is not used anywhere. This patch removes it from
the ListElement struct.
2020-12-07 22:16:40 +00:00
Stig Bjørlykke cb3b469d7f Qt: Fix packet bytes hover rectangle position
For Qt 5.11 and newer use horizontalAdvance() instead of boundingRect().width()
to calculate the width of a QString to position the hover rectangle position,
and to select which byte(s) to highlight.

Closes #17033.
2020-12-07 09:59:07 +00:00
Jim Young 9fb22c1ec0 Four trivial comment typo fixes of ‘ad’ to ‘as’ 2020-12-06 19:07:08 +00:00
Gerald Combs f6c7cb1251 [Automatic update for 2020-12-06]
Update manuf, services enterprise numbers, translations, and other items.
2020-12-06 17:08:27 +00:00
Thomas Stewart d38de4c03e Initial try at y_axis_factor for I/O graph 2020-12-04 20:57:47 +00:00
Dylan Ulis 6ae2bdd84b Qt: Increase ring buffer file number limit
Notes:
1. Wireshark internal max limit for ring buffer files is 100,000
2. Wireshark internal limit before warning the user is 65,535
3. GTK: The old GUI did not limit the value for this parameter
4. Qt: This value was limited to 1,000

Change:
Set the GUI limit to match the warning limit (65,535)
2020-12-04 12:06:03 +00:00
Chuck Craft dca19aa2b3 Qt: UAT editor column widths, italic pathname
Closes #15968 #17059

 - set width of pull down list so items are visible
 - allow user to resize columns in UAT editor
 - resize columns on open and changing data
 - if a UAT file does not exist, display the UAT name in lower right
   where pathname is displayed for files
 - pad pathname on right to account for right tilt of italic fonts

Note: a future change may be to not resize columns where user has
changed width.
2020-12-04 09:33:10 +00:00
John Thacker 2d8dd9ed4f qt+export objects: Don't sort the header in with the content types
The Export Objects Content-Type filter combobox should not sort the
header of "All Content-Types" in with the list of content types, but
should ensure that it is always the first item, especially as the first
item position is used to show all content. This is particularly an issue
in some localizations; e.g., すべてのコンテントタイプ alphabetizes
after actual content types. Fixes bug #17048
2020-12-03 08:55:29 +00:00
Orgad Shaneh e74b6bdebe Qt: fix Qt 5.15 deprecation warning
QFont::ForceIntegerMetrics is deprecated, and the floating-point
variant of QFontMetrics is no longer used anyway since 96eec0beb9.

Change the font_width_ member to int, as should have been done in
that commit.
2020-11-30 13:03:53 +00:00
Gerald Combs 7c07202d78 [Automatic update for 2020-11-29]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-29 17:21:40 +00:00
Martin Kaiser cb8150cdf3 Qt: CaptureOptionsDialog: set parent for SparkLineDelegate
CaptureOptionsDialog allocates a SparkLineDelegate in its constructor.
It should set itself as parent of the SparkLineDelegate.

Without a parent, the SparkLineDelegate is never freed and each
invocation of Capture / Options leaks memory.
2020-11-29 16:59:17 +00:00
Stig Bjørlykke 7f4ae9a229 Qt: Load interfaces on profile change if settings have changed
Load interfaces on profile change if capture_no_interface_load or
capture_no_extcap preference have changed.
2020-11-27 11:34:24 +00:00
Pascal Quantin fb2414ae6d Qt: fix some Qt 5.15.2 deprecation warnings 2020-11-25 07:23:21 +00:00
Gerald Combs 7d8dbd98b0 [Automatic update for 2020-11-22]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-22 18:33:39 +00:00
Guy Harris 58aea1de62 PacketListRecord: add an ensureColorized() method and use it.
Don't call the columnString() and discard the result in order to force
colorization; instead, add a separate method to force colorization and
use that.

This avoids the need to choose a column; we were using 1 as the column
number, but column numbers are zero-origin, so that's column 2, which
isn't guaranteed to exist (a crash ensued if it didn't).
2020-11-20 14:14:09 -08:00
Masaru Tsuchiyama 69e6a16ba4 capture option dialog: fix unintentional dialog size by merge request 422 2020-11-18 05:53:53 +00:00
Gerald Combs 39050a72de [Automatic update for 2020-11-15]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-15 19:00:02 +00:00
Developer Alexander a9e414ce54 Tuning of IO Graph intervals
Improves the resolution of interval steps that can be selected in IO Graph.
Selectable interval steps follow a scheme of 1 -> 2 -> 5 -> 10.
Having a broad choice of different intervals is important for visualizing.
2020-11-14 19:39:24 +00:00
Gerald Combs 3a7966c716 Qt+epan: Print better-looking values in the packet diagram.
Pull the value-formatting code in proto_custom_set into
proto_item_fill_display_label. Use that in FieldInformation::toString
instead of fvalue_to_string_repr. Fixes #16911.
2020-11-13 19:41:51 +00:00
Gerald Combs 96eec0beb9 Qt: Fetch byte view text font metrics more often.
Add ByteViewText::updateLayoutMetrics, which fetches the character width
and line height.  Call it whenever our font changes and when we're about
to paint. Blind attempt at fixing #15819.
2020-11-12 13:37:56 -08:00
Chuck Craft 3730eb251f Qt: enable sorting for Help->About tables 2020-11-10 07:52:18 +00:00
Gerald Combs e1c72bd47c [Automatic update for 2020-11-08]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-08 19:09:19 +00:00
Uli Heilmeier 48c09fe046 QT: progress UI: Fix TextLabel string to loading
Change TextLabel to Loading for progress UI
Fixes: wireshark/wireshark#16987
2020-11-04 19:24:36 +00:00
Chuck Craft 44241f694e win32: fix MR180 - broke "-i -" input pipe 2020-11-02 12:56:44 +00:00
Masaru Tsuchiyama bd5431ff44 remove empty zorder (fix warning) 2020-11-02 08:05:49 +00:00
Stig Bjørlykke c84681aca2 Qt: Support ampersand in funnel menu and button
An ampersand in the menu item or a button is used as shortcut, so
use "&&" to get a real ampersand.
2020-11-02 07:16:42 +00:00
Gerald Combs 666e287c73 [Automatic update for 2020-11-01]
Update manuf, services enterprise numbers, translations, and other items.
2020-11-01 17:54:07 +00:00
Masaru Tsuchiyama 73f3bc97a5 enable compression options only when gbNewFileAuto is checked. 2020-10-30 00:25:22 +00:00
Masaru Tsuchiyama c14ea41233 add support for compression of capture file 2020-10-30 00:25:22 +00:00
Gerald Combs b1d18e41db Qt: Add a recent item for packet diagram field values.
Fixes #16957.
2020-10-28 20:11:25 +00:00
Gerald Combs 1c2fd68e26 Qt: Fix saving+restoring frozen packet list rows.
Use the packet list selection model to save and restore selected rows
when freezing and thawing. Fixes #16770.
2020-10-28 15:36:07 +00:00
Guy Harris 889e0d5cb6 Add a new record type REC_TYPE_SYSTEMD_JOURNAL.
Systemd journal entries aren't file-type-specific; they're found in both
systemd journal entry blocks in pcapng files and in systemd journal
export files.  Give it a record type, for use with both file types.

This fixes #16955.

It also means that you can open a systemd journal export file and save
it as a pcapng file.
2020-10-27 20:06:26 -07:00
Guy Harris 639891651f Impose limits on the number of records we read.
Start the limit at 2^32-1, as we use a guint32 to store the frame
number.

With Qt prior to Qt 6, lower the limit to 53 million packets; this
should fix issue #16908.
2020-10-26 16:52:58 -07:00
Stig Bjørlykke a88d72dc8e Qt: Avoid crash on ProtoTree item deselect
Handle the case of deselecting a ProtoTree item.
2020-10-26 13:15:42 +01:00
Chuck Craft 2920c49c1d Qt: use packet_list_colorize state in Flow Graph 2020-10-26 08:39:16 +00:00
Guy Harris 32b64c1694 Apparently, WS_WIKI_URL() can work in Qt C++ code. 2020-10-25 17:42:11 -07:00
Guy Harris f7c99f73e2 Revert "Apparently, WS_WIKI_URL() is unworkable not only in C++ but in C."
This reverts commit 5df2925434.

The problem only showed up in tfshark.c, and was caused by tfshark.c
using stuff from ui/urls.h but not *including* ui/urls.h.
2020-10-25 14:42:47 -07:00
Gerald Combs d9897f1ddf [Automatic update for 2020-10-25]
Update manuf, services enterprise numbers, translations, and other items.
2020-10-25 16:18:19 +00:00
Guy Harris 5df2925434 Apparently, WS_WIKI_URL() is unworkable not only in C++ but in C.
If you use it, GCC 9.3.0 seems to think there's a missing parenthesis
somewhere, just as the version of clang++ in my version of Xcode does,
even though other versions of GCC don't.  I'm clearly missing something
obscure about C here; I give up.
2020-10-24 13:53:23 -07:00
Guy Harris 4fd7983b04 dumpcap: fix the macOS "no permission to capture" message.
The macOS installer works differently from the way it did when that
message was written (it's now a drag-install for Wireshark, with
separate installers for ChmodBPF and for files to add the Wireshark
binary directory to the default $PATH), and the macOS main screen now
offers a "click this to install" link, running the ChmodBPF installer,
if the user doesn't have permissions to capture.  Update the message
to reflect that (although that's wrong if you directly run dumpcap or
run it via TShark - this needs to be cleaned up in some fashion).

Fix a capitalization error while we're at it.

In the code that generates the main screen message to which the dumpcap
message refers, add a comment saying that, if the main screen message
changes, dumpcap's message should also be updated.
2020-10-24 00:44:36 -07:00
Chuck Craft 059b64b971 Qt: restore welcome page release string after edit preferences 2020-10-23 07:27:49 +00:00
John Thacker 56e19bec49 Export Objects: Don't double increment count
Don't double increment the count when saving all Export Objects,
which effectively halves the maximum number allowed.
2020-10-23 03:53:15 +00:00
Gerald Combs 8b80b9111a Qt: Fix QCustomPlot deprecation warnings.
Fix Qt 5.15 deprecation warnings in QCustomPlot, similar to 76d92ba7e7.

Use default flags constructors instead of 0.

Use QWheelEvent::angleDelta() instead of QWheelEvent::angle().

Use QWheelEvent::position() instead of QWheelEvent::pos().

Use date::startOfDay() instead of QDateTime(date).

Use QMultiMap instead of QMap where needed.
2020-10-22 07:19:14 +00:00
Gerald Combs 4955219d1a Qt: Add a filter button menu indicator.
Fixes #16918.
2020-10-20 17:49:20 +00:00
Chuck Craft 5b242d62b0 WIN32 logging: connect stdio earlier in main() 2020-10-20 13:49:27 +00:00
Gerald Combs 08c2a13892 [Automatic update for 2020-10-18]
Update manuf, services enterprise numbers, translations, and other items.
2020-10-18 16:52:23 +00:00
Gerald Combs 5b8a54ab14 Qt: Add a dark mode warning background.
Add ColorUtils::warningBackground, which returns a theme-appropriate
background color for warnings. Use it where needed.
2020-10-16 23:12:17 +00:00
Roland Knall cfd9ffbb1b Qt: Show tooltips on submenu items
Tooltips should be shown on submenu entries

Closes !16912
2020-10-15 23:21:25 +00:00
Chuck Craft 90cd509d92 Consistent "Prepare as Filter" - menus and screenshots #16892 2020-10-15 09:18:56 +00:00
Guy Harris 793a57fae4 Give more detail for WTAP_ERR_INTERNAL when writing.
Report the file from which the record to be written came and the record
number within that file.
2020-10-14 00:01:49 -07:00
Guy Harris 6e6233521a Have WTAP_ERR_INTERNAL include an err_info string giving details.
That way, users won't just see "You got an internal error", the details
will be given, so they can report them in a bug.
2020-10-14 04:51:45 +00:00
Martin Kaiser 92e1b110f3 Qt: FieldFilterEdit: remove unused actions
The private members save_action_ and remove_action_ in class FieldFilterEdit
are not used. Remove them.

(It looks as if FieldFilterEdit was copied from DisplayFilterEdit, where
 those two actions are present and linked to slots...)
2020-10-14 03:53:45 +00:00
Guy Harris 63714518df Get rid of some debugging cruft accidentally checked in. 2020-10-13 14:39:55 -07:00
Guy Harris 16198291bc Fix file description in error message from cfile_dump_open_failure_message().
cfile_dump_open_failure_message() opens a file for output, not input, so
use output_file_description(), not input_file_description() (i.e., "-"
means "standard output", not "standard input").
2020-10-13 11:28:29 -07:00
Gerald Combs 02d91b67c5 [Automatic update for 2020-10-11]
Update manuf, services enterprise numbers, translations, and other items.
2020-10-11 20:08:38 +00:00
Gerald Combs 511fa081df Qt: Handle dark mode in syntax highlighting.
Add ColorUtils::contrastingTextColor, which chooses an appropriate text
color from the current application palette for a given background.

Use it in SyntaxLineEdit and FontColorPreferencesFrame for each state
background color.

Fixes #15840.
2020-10-06 19:24:59 +00:00
Gerald Combs 9a3b1ad6bc [Automatic update for 2020-10-04]
Update manuf, services enterprise numbers, translations, and other items.
2020-10-05 00:42:10 +00:00
Guy Harris 8a77692171 g_mallocate all strings returned from topic_action_url().
Callers assume it's been g_mallocated and attempt to free it.
2020-10-04 12:56:52 -07:00
Guy Harris 4a9c412218 Fix a Coverity complaint.
For all cases in topic_action_url(), set url and break out of the switch
statement.

For the default case, set the URL to WS_HOME_PAGE_URL - we should never
get there, as here's a g_assert_not_reached() call before that, but this
should squelch Coverity's complaint.

Should fix Coverity CID 1467697.
2020-10-04 00:59:48 -07:00
Guy Harris a883081b70 Update URLs pointing to the bug database.
Switch from bugs.wireshark.org to the GitLab issues list.
2020-10-03 07:54:12 -07:00
Guy Harris e013c5ec7f Clean up URLs.
Add ui/urls.h to define some URLs on various of our websites.  Use the
GitLab URL for the wiki.  Add a macro to generate wiki URLs.

Update wiki URLs in comments etc.

Use the #defined URL for the docs page in
WelcomePage::on_helpLabel_clicked; that removes the last user of
topic_online_url(), so get rid of it and swallow it up into
topic_action_url().
2020-10-02 20:13:42 -07:00
Gerald Combs d2da4c7afb Qt: Use … instead of UTF8_HORIZONTAL_ELLIPSIS in translated strings.
Run

$ gsed -i -e 's/\(tr *(.*".*\)" *UTF8_HORIZONTAL_ELLIPSIS/\1…"/' $( ag -l 'tr *\(.*" *UTF8_HORIZONTAL_ELLIPSIS' )
$ gsed -i -e 's/\(tr *( *\)UTF8_HORIZONTAL_ELLIPSIS *"/\1"…/' $( ag -l 'tr *\( *UTF8_HORIZONTAL_ELLIPSIS *"' )

in ui/qt. As discussed in #16812, the UTF8_ macros were required at one
time because we only allowed ASCII in our source code. However, that
requirement has since been relaxed and Qt's translation framework
doesn't handle concatenating strings and macros very well.
2020-10-01 06:40:14 +00:00
Gerald Combs c34bc0cf4c Qt: Handle palette changes in the packet diagram.
Handle ApplicationPaletteChange (e.g. dark / light mode switching)
events in the packet diagram. Add resetScene() and call it where needed.
2020-09-28 23:56:08 +00:00
Gerald Combs b7c0dc3cb1 Qt: Make sure the packet diagram always has a field value.
Have FieldInformation::toString return "[no value for field]" instead of
an empty string so that the packet diagram always has something to
display.
2020-09-28 12:14:14 -07:00
Gerald Combs d1f29ee338 Qt: Fix the packet diagram start offset arithmetic.
572c1ae5a3 introduced a bug that allowed for negative diagram item start
values. Fixup our arithmetic so that that doesn't happen.
2020-09-26 12:23:54 -07:00
Gerald Combs 8b9ec1b5a5 Qt: Reset the packet diagram between captures.
QGraphicsScene::clear() doesn't reset the scene's the size and scroll
position. This is useful when we switch between packets, but we should
do a hard reset when switching between captures.
2020-09-26 11:34:21 -07:00
Gerald Combs 572c1ae5a3 Qt: Collapse packet diagram items correctly.
Move our overlap and gap adjustments to the first pass and offset our
item start bits based on our collapsed length. Collapse 64-bit items
correctly.
2020-09-25 00:57:58 +00:00
Gerald Combs 3426b25621 Qt: Make sure the packet diagram's FT_NONE label exists.
Gap items have a null field_info pointer, so set "Unknown" as the
default representation string and fill it in after we've established
that field_info is valid. Closes #16851.
2020-09-15 19:40:35 +00:00
Ronnie Sahlberg 72921f8867 packet_diagram: use a better label for FT_NONE items
FT_NONE items all have the name "Text Item" which makes it look
poor in the packet diagram.
For these fields, switch to use ->representation insead of ->name
to make these fields look more meaningful.

SMB2 is a protocol that consists of two FT_NONE expansions,
one for the Header and a second for the actual Command.
This makes packet diagram show this much nicer.

Signed-off-by: Ronnie Sahlberg <ronniesahlberg@gmail.com>
2020-09-15 03:31:44 +00:00
Gerald Combs 3b9656780b Qt: Don't fill in the packet diagram if it's not visible.
Don't bother filling in our scene if the widget isn't visible.
2020-09-15 03:03:11 +00:00
Martin Kaiser adfded498a Qt: FieldInformationGraphicsItem: fix a memory leak
FieldInformationGraphicsItem's constructor allocates a FieldInformation
which is never freed.

Opening MTP3 statistics for any capture file causes memory leaks.

Indirect leak of 1120 byte(s) in 10 object(s) allocated from:
    #0 0x55e32cf19a42 in operator new(unsigned long)
    #1 0x7f4cca598661 in QObject::QObject(QObject*)
    #2 0x55e32d5f397f in PacketDiagram::addDiagram(_proto_node*)
...

Indirect leak of 400 byte(s) in 10 object(s) allocated from:
    #0 0x55e32cf19a42 in operator new(unsigned long) ...
    #1 0x55e32d5fce04 in FieldInformationGraphicsItem::FieldInformationGraphicsItem(...)
    #2 0x55e32d5f397f in PacketDiagram::addDiagram(_proto_node*)
...

Add a FieldInformationGraphicsItem destructor and delete FieldInformation there.
2020-09-14 21:51:11 +00:00
Gerald Combs 97a6146d81 Qt: Fixup packet diagram tick label placement.
Try to place the labels one space away from the nearest big tick mark.
2020-09-12 22:00:50 +00:00
Guy Harris 272502790b Add FT_STRINGZTRUNC.
FT_STRINGZPAD is for null-*padded* strings, where the field is in an
area of specified length, and, if the string is shorter than that
length, all bytes past the end of the string are NULs.

FT_STRINGZTRUNC is for null-*truncated* strings, where the field is in
an area of specified length and, if the string is shorter than that
length, there's a null character (which might be more than one byte, for
UCS-2, UTF-16, or UTF-32), and anything after that is not guaranteed to
have any particular value.

Use IS_FT_STRING() in some places rather than enumerating all the string
types, so that those places get automatically changed if the set of
string types changes.
2020-09-12 14:16:12 -07:00
Gerald Combs 6a08695e3e Qt: Remove an unused value.
Remove an unused value in packet_diagram.cpp. Fixes CID 1466402.
2020-09-09 04:56:33 +00:00
Gerald Combs e7ab0e6dc5 Qt: Update translation files. 2020-09-06 19:09:19 +00:00
Gerald Combs 7ab6440416 Tools: Clean up checkAPI and add ui/qt.
Remove the --check-addtext and --build flags. They were used for
checkAddTextCalls, which was removed in e2735ecfdd.

Add the sources in ui/qt except for qcustomplot.{cpp,h}. Fix issues in
main.cpp, rtp_audio_stream.cpp, and wireshark_zip_helper.cpp.

Rename "index"es in packet-usb-hid.c.
2020-09-05 07:41:29 +00:00
Stig Bjørlykke 07ad7843f6 Qt: Use UTF8 middle dot for non-printable characters
Use UTF8 middle dot for non-printable characters in ShowPacketBytes to
clearly show the difference between a non-printable character and '.',
and to align with the PacketBytes view.
2020-09-03 20:49:01 +00:00
John Thacker 847d3949c9 Apply Decode As induced protocol preference changes
Make sure that pending protocol preference changes caused by Decode
As have been fully applied before redissection. Prevents referencing
already freed memory Closes #16787. Also close #10305
2020-08-25 08:20:58 -04:00
Stig Bjørlykke 9cd9f02b34 Qt: Fix filename used in header comment
Fix a cut'n'paste issue in the filename used in the header comment.
2020-08-24 08:27:22 +00:00
Gerald Combs 69ab0b00af [Automatic update for 2020-08-23]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Id646b743f1634e9deb29f05186eb1ff87b3bc73a
Reviewed-on: https://code.wireshark.org/review/38232
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-08-23 08:17:41 +00:00
Tomas Kukosa 82a4968bc3 plugin_if: add plugin_if_get_frame_data() and plugin_if_get_capture_file()
Change-Id: I7505d4185f18d13d6836c9c9bb8f400d12f2a524
Reviewed-on: https://code.wireshark.org/review/38217
Petri-Dish: Tomáš Kukosa <keksa@email.cz>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-08-22 05:32:29 +00:00
Gerald Combs 521180d8d7 [Automatic update for 2020-08-16]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I8e16e1176b00ca16dd051ec5f86a7bf7cf4f2405
Reviewed-on: https://code.wireshark.org/review/38173
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-08-16 08:16:41 +00:00
Gerald Combs b1753ce511 Qt: Add debugging ifdefs for the packet diagram.
The PacketDiagram widget prints debugging information about items that
it skips and resizes. Make this conditional, similar to what we do
elsewhere.

Bug: 16769
Change-Id: Id7fbedbdac6096cbca8d997688d489eac4729f52
Reviewed-on: https://code.wireshark.org/review/38121
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>
2020-08-11 17:38:23 +00:00
Guy Harris d5fe2d494c wsutil: define HAVE_LIBGCRYPT_AEAD in wsutil/wsgcrypt.h.
It's used in a number of source files; don't force each of them to test
GCRYPT_VERSION_NUMBER independently.

Make sure every file that uses HAVE_LIBGCRYPT_AEAD includes
wsutil/wsgcrypt.h.

Also do some other definitions that are based on the libgcrypt version
there as well.

This requires that the Qt UI code be given the include directory for
libgcrypt, as the follow stream code includes
epan/dissectors/packet-quic.h, which includes wsutil/wsgcrypt.h to get
HAVE_LIBGCRYPT_AEAD defined, and wsutil/wsgcrypt.h includes <gcrypt.h>.

Change-Id: I9cb50f411f5b2b6b9e28a38bfd901f4a66d9cc8f
Reviewed-on: https://code.wireshark.org/review/38116
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-08-11 02:30:04 +00:00
Gerald Combs 9b07412277 Qt: Add a packet diagram view.
Add a new top-level view that shows each packet as a series of diagrams
similar to what you'd find in a networking textook or an RFC.

Add proto_item_set_bits_offset_len so that we can display some diagram
fields correctly.

Bugs / to do:
  - Make this a separate dialog instead of a main window view?
  - Handle bitfields / flags

Change-Id: Iba4897a5bf1dcd73929dde6210d5483cf07f54df
Reviewed-on: https://code.wireshark.org/review/37497
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>
2020-08-10 18:17:50 +00:00
John Thacker 744c57b42c UI: Follow Stream "Show and save data as" -> "Show data as"
"Save as" in Follow Stream saves whatever is displayed (except for
Raw), and has long always saved in UTF-8 encoding. (A few things are always
ASCII, which is still valid UTF-8.) The older description of "Show data as"
makes more sense here, as otherwise it implies data will be saved in the
original encoding instead of UTF-8. A checkbox or similar to save in the
original encoding instead of UTF-8 is a possible future enhancement.

Change-Id: I2d5016e9a974d5d614ff93eab0301ea0ce96108e
Reviewed-on: https://code.wireshark.org/review/37771
Reviewed-by: Guy Harris <gharris@sonic.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2020-08-09 23:56:13 +00:00
Gerald Combs 5ca2327cc0 [Automatic update for 2020-08-09]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I447ea71cd55ad637f1792ad0224ba43435ce2769
Reviewed-on: https://code.wireshark.org/review/38091
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-08-09 08:17:38 +00:00
Stig Bjørlykke e189bd2996 Qt: Always pop empty filter syntax
When checking a filter the status message should always be pop'ed when
having an empty filter, regardless of having the clear button or not.

This will ensure the status message is removed when removing a display
filter using DisplayFilterEdit in other dialogs than Main.

Change-Id: I3c9a4933cd0c60ab624ea1939ffafecb58b3ffd5
Reviewed-on: https://code.wireshark.org/review/38052
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-08-06 05:27:27 +00:00
Stig Bjørlykke 4ac54e27b0 Qt: Fix status message issues in find packet search
Fix some status message and tooltip issues introduced when enabling
autocomplete on find packet search in g0162ba73.

1. Enable or disable completion only when search type is changed.
   This setting is used in checkDisplayFilter(), which used to be
   called *before* changing allowCompletion in updateWidgets(), and
   this was causing issues with wrong status messages.

2. Check filter (usually triggered by changes in the search line)
   or reset filter syntax (added by DisplayFilterEdit) when search
   type is changed. This will trigger an update of the status message
   and the tooltip.

3. Stop checking display filter if not doing completion (not display
   filter search). This will avoid setting a status message from a
   previous illegal display filter.

Ping-Bug: 16638
Change-Id: I1534d9494cc4d7b7a0583cb845c091ae709458ae
Reviewed-on: https://code.wireshark.org/review/38061
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-05 21:31:13 +00:00
Stig Bjørlykke f54611d110 Qt: Pop filter syntax in search frame
Pop the filter syntax message in search frame when changing search type
and when hiding the widget to avoid having outdated status messages.

Change-Id: I87c63c070621cff0d5ecebc2fcd41f9d7c02adec
Reviewed-on: https://code.wireshark.org/review/38051
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-08-05 14:59:15 +00:00
Gerald Combs 93260afcff [Automatic update for 2020-08-02]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I08367d6811db844df8eb78b3ddf71684a7d9f6ec
Reviewed-on: https://code.wireshark.org/review/38024
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-08-02 08:17:51 +00:00
Gerald Combs 898b00c9a1 Qt: Restore an attribution.
The ByteViewText widget has been refactored a few times. At one point it
was based on QHexView by Evan Teran, and had a comment saying so. A
later refactor removed the comment but didn't completely rewrite all of
the code. Put the comment back (and spell Evan's name correctly this
time around).

Change-Id: I2fe7779e1b6773a5e8b38d317ebfd26b07900272
Reviewed-on: https://code.wireshark.org/review/37989
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>
2020-07-30 05:31:06 +00:00
Guy Harris c68d36b173 wiretap: have the file's time stamp resolution be a dump parameter.
Add a tsprec value to the wtap_dump_params structure, giving the
per-file time stamp precision.

In wtap_dump_init_dumper(), when constructing a dummy IDB for files that
don't have one, fill in the tsprecision and time_units_per_second values
based on the tsprec value in the wtap_dump_params structure.

Change-Id: I3708b144d4d0ac0dfbe32bd1c16768a75c942141
Reviewed-on: https://code.wireshark.org/review/37979
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-29 13:49:09 +00:00
Gerald Combs 4805a70e0c [Automatic update for 2020-07-26]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I62571ee63f6d515024e9dfe2a2caeb5634510b8d
Reviewed-on: https://code.wireshark.org/review/37962
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-26 08:17:29 +00:00
Gerald Combs fcf787b408 [Automatic update for 2020-07-19]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: Ibf53b551fdcaeb6aa90ab11ef9d8a2f48cde24c3
Reviewed-on: https://code.wireshark.org/review/37892
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-19 08:16:02 +00:00
Stig Bjørlykke e1df757c46 Qt: Improve status bar messages
Use pushStatus() in C++ code, improve translation support and end
each message with a dot.

Change-Id: I3f673da4736c3fe49203048da282afa1abf92337
Reviewed-on: https://code.wireshark.org/review/37887
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-18 04:02:23 +00:00
Roland Knall a5533561db Qt: Fix 5.15 deprecation warnings
QString is no longer allowed to be append()ed to QByteArray.

Change-Id: I177e271d01c51d190b57f679f38d11b31b1f96c4
Reviewed-on: https://code.wireshark.org/review/37879
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Roland Knall <rknall@gmail.com>
2020-07-16 08:09:28 +00:00
Stig Bjørlykke 3ff0a55d5c Qt: Check if "Apply as Column" column already exists
Use the existing (possible hidden) column when doing "Apply as Column"
on a field which is already used as a custom column. This will help
prevent having multiple equal custom columns, where all will be hidden
at startup and profile change when only one of them are configured as
hidden.

Multiple equal columns can always be manually configured using
"Preferences -> Appearance -> Columns" if this is intended.

Change-Id: Ib03893facfa3f194f3b3303645fb3f9313ec9e91
Reviewed-on: https://code.wireshark.org/review/37861
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-15 03:57:01 +00:00
David Perry 00b5c2809a Sort list of available filetypes when loading a capture
When loading a capture file in the GUI, this change causes the list of
available file types to be sorted alphabetically. "Automatically detect
file type", pcap, and pcapng remain at the top of the list.

Unlike my prior crack at this in change #36862, this is done directly in
the file open dialogs (open_file_hook_proc() for Windows,
CaptureFileDialog::addFormatTypeSelector() and CaptureFileDialog::open()
for Qt). No changes to wiretap.

It's not a huge deal if you folks decide this isn't necessary, I just
think this gives a bit of extra polish to the load-file dialog. It also
makes it easier for the user to spot the format they want if they aren't
aware that the file-format dropdown accepts keyboard input.

Change-Id: Ie81c6d99e83fe862f20b413318ac8ce76463a766
Reviewed-on: https://code.wireshark.org/review/37749
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-14 16:25:11 +00:00
Guy Harris 608835bf56 Don't call any routines from WinPcap/Npcap packet32.dll.
We aren't using them now; stick to libpcap APIs (including Windows-only
libpcap APIs).

Change-Id: I812eaa31ba1e6e611418853105d3e00c9130a420
Reviewed-on: https://code.wireshark.org/review/37852
Petri-Dish: Guy Harris <gharris@sonic.net>
Tested-by: Petri Dish Buildbot
Reviewed-by: Guy Harris <gharris@sonic.net>
2020-07-14 07:30:59 +00:00
Stig Bjørlykke 4fc9098830 Qt: Keep pane sizes when quit without loading a file
Change from master_split_.show() to packet_list_->show() in layoutPanes()
to avoid an issue where the pane sizes was stored with wrong values when
quit just after startup without loading a file.

This fixes a regression issue from g5ce52f74 and g7ebd5405.

Change-Id: I7ba1b5f8c9440d41d58dfd729013a0fd1e16be07
Reviewed-on: https://code.wireshark.org/review/37839
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-13 16:16:25 +00:00
Gerald Combs 300099e9e2 [Automatic update for 2020-07-12]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I68419eed3c7d203b483f51f09f56b863fd65ffd0
Reviewed-on: https://code.wireshark.org/review/37832
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-12 08:17:56 +00:00
Gerald Combs d0cd357825 Qt: Remove some dead code.
We no longer support Qt 5.2 or earlier.

Change-Id: I94ba6df2120956dadfce407fd999d39250485bc6
Reviewed-on: https://code.wireshark.org/review/37821
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: John Thacker <johnthacker@gmail.com>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-11 06:02:28 +00:00
John Thacker e84d431e39 QT: Don't use qAsConst and C+11 on QT < 5.7
Introduced QT 5.7 calls in my recent change (also C+11, which is
required for QT >= 5.7). Providing an alternate code path for QT < 5.7

Change-Id: I866af35138d4691a659aee756ce9c3ce4ffb933f
Reviewed-on: https://code.wireshark.org/review/37779
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2020-07-08 05:51:06 +00:00
Gerald Combs 4dc3114c05 Windows: Set our locale to ".UTF-8".
In each of our executables we were calling "setlocale(LC_ALL, "")" at
startup. This told Windows that output was encoded using the current
system code page. Unless the code page was 65001 (UTF-8), this was a lie.

We write UTF-8 to stdout and stderr, so call "setlocale(LC_ALL, ".UTF-8)"
at startup on Windows. This lets the CRT translate our output correctly
in more cases.

Clarify and expand the OUTPUT section in the tshark man page.

Bug: 16649
Change-Id: If93231fe5b332c292946c7f8e5e813e2f543e799
Reviewed-on: https://code.wireshark.org/review/37560
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-06 16:20:25 +00:00
John Thacker 9fc054a65b Add all supported charsets to Show Packet Bytes/Follow Stream
Use the QT text codec support to add charset conversions for all character
encodings supported by QT to Show Packet Bytes and Follow Stream (Save As
will convert to UTF-8.) Note that this is dynamic and the exact list will
depend on the version of QT and if libicu support is enabled. This does
make the list of codecs pretty long, so hopefully it shows up well on all
the different QT styles.

This does not yet support when multibyte characters span more than one packet
in Follow Stream, though the current code doesn't do that for UTF-8 or UTF-16
already. This is probably most useful for HTTP captures.

Bug: 16137
Change-Id: I6d5cd761a5d9d914b7a787fe8eb02b07b19642e6
Ping-Bug: 16630
Reviewed-on: https://code.wireshark.org/review/37707
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-06 14:21:41 +00:00
Gerald Combs 5e05fe0421 [Automatic update for 2020-07-05]
Update manuf, services enterprise numbers, translations, and other items.

Change-Id: I4a369852fe1fbe2917932ba2a1f56eeb0fc4db28
Reviewed-on: https://code.wireshark.org/review/37703
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2020-07-05 08:15:50 +00:00
Martin Mathieson 0162ba730a Enable display filter autocomplete on find packet search.
Bug: 16638
Change-Id: Ifd9c9e4392fdc3d32b2aa4466d5a7f2835893338
Reviewed-on: https://code.wireshark.org/review/37682
Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2020-07-05 07:46:41 +00:00
Stig Bjørlykke daebdc4b1a Qt: Handle filenames in preference editor frame
Add support for handling PREF_SAVE_FILENAME, PREF_OPEN_FILENAME and
PREF_DIRNAME in a preference editor frame.

Change-Id: Ie9d1cc08bc79a0adefff344fd0d117405f86475c
Reviewed-on: https://code.wireshark.org/review/37669
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-03 06:12:48 +00:00
Stig Bjørlykke a6d8a2c118 Qt: List all protocols in PacketList "Protocol Preferences"
Show all protocols which has preferences in the packet list context
menu "Protocol Preferences".

Change-Id: I72e2ed95db36cc6d817ca44db214782f075d55d6
Reviewed-on: https://code.wireshark.org/review/37666
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2020-07-03 06:12:40 +00:00