Commit Graph

7442 Commits

Author SHA1 Message Date
Guy Harris d9e662bc54 Rename some functions and types for endpoint tables.
The "conversation table" mechanism supports two types of tables, one for
the "Conversations" menu item under "Statistics" and one for the
"Endpoints" menu item under "Statistics".  The first of them shows
statistics for conversations at various layers of the networking stack;
the second of them shows statistics for endpoints at various layers of
the networking stack.

The latter is *not* a table of hosts; an endpoint might be a host,
identified by an address at some network level (MAC, IP, etc.), or it
might be a port on a host, identified by an address/port pair.

Some data types, function names, etc. use "host" or "hostlist" or other
terms that imply that an endpoint is a host; change them to speak of
endpoints rather than hosts, using names similar to the corresponding
functions for conversations.

Provide wrapper functions and typedefs for backwards source and binary
compatibility; mark them as deprecated in favor of the new names.

Clean up some comment errors found in the process.
2022-08-23 09:55:14 +00:00
João Valverde 6b35aa0773 Qt: Add dfilter error location to tooltip
If display filter compilation fails and the expression has a syntax
error and associated location, it will be displayed in the filter
tooltip, using a textual underline.

As far as I can tell using a graphical squiggly underline seems extremely
difficult for an object inheriting from QLineEdit, so the tooltip
textual method was used instead.
2022-08-22 07:31:08 +00:00
John Thacker 00bfdf46a7 Qt: Fix export objects memory leak
The export object entries were never getting freed, creating a
pretty serious memory leak.

=1307558==ERROR: LeakSanitizer: detected memory leaks

Direct leak of 2237664 byte(s) in 46618 object(s) allocated from:
    #0 0x55ac70d80457 in malloc (/home/johnthacker/wireshark-clang/run/wireshark+0x1a4a457) (BuildId: ad576854e9259fb05a7d0aacbff6e3e1f8e41157)
    #1 0x7fe8ff2f4278 in g_malloc (/lib64/libglib-2.0.so.0+0x5a278) (BuildId: 8a4c270219135729dff508e4bb3cc03099af40e8)
    #2 0x7fe910912ff4 in tap_push_tapped_queue /home/johnthacker/wireshark/epan/tap.c:366:15
    #3 0x7fe910711548 in epan_dissect_run_with_taps /home/johnthacker/wireshark/epan/epan.c:640:2
    #4 0x55ac7263288d in retap_packet /home/johnthacker/wireshark/file.c:2241:5
    #5 0x55ac7263201c in process_specified_records /home/johnthacker/wireshark/file.c:2207:14
    #6 0x55ac726315fc in cf_retap_packets /home/johnthacker/wireshark/file.c:2292:11
    #7 0x55ac712aed41 in ExportObjectDialog::show() /home/johnthacker/wireshark/ui/qt/export_object_dialog.cpp:173:15
...
Indirect leak of 1700955 byte(s) in 139854 object(s) allocated from:
    #0 0x55ac70d80457 in malloc (/home/johnthacker/wireshark-clang/run/wireshark+0x1a4a457) (BuildId: ad576854e9259fb05a7d0aacbff6e3e1f8e41157)
    #1 0x7fe8ff2f4278 in g_malloc (/lib64/libglib-2.0.so.0+0x5a278) (BuildId: 8a4c270219135729dff508e4bb3cc03099af40e8)
...
SUMMARY: AddressSanitizer: 3961187 byte(s) leaked in 186587 allocation(s).
2022-08-22 03:45:20 +00:00
Gerald Combs 70dbe58aea [Automatic update for 2022-08-21]
Update manuf, services enterprise numbers, translations, and other items.
2022-08-21 16:39:53 +00:00
Martin Mathieson eb197df564 RLC Graph: store secs in time_t 2022-08-20 19:56:34 +00:00
Gerald Combs a24f1cbd8d [Automatic update for 2022-08-14]
Update manuf, services enterprise numbers, translations, and other items.
2022-08-14 16:53:51 +00:00
John Thacker c7a136a5c0 epan: Rearrange column includes
Move all the declarations of routines that are internal and
not for use by dissectors from column-utils.h column-info.h
Move the column max length defines into column-utils.h because
dissectors might need that

Since packet.h already includes column-utils.h, dissectors don't
need to include column-utils.h anymore.
Remove or downgrade a few other column header includes that are
unnecessary.
2022-08-13 19:37:28 +00:00
Tomasz Moń d0a9de2af1
capture: Stop extcaps before dumpcap
Send SIGTERM on UNIX systems to all extcap processes when user requests
capture stop. Wait up to 30 seconds for extcaps to finish. If extcaps do
not finish in time, send SIGKILL to remaining extcaps.

Do not call TerminateProcess() on Windows in the same place where UNIX
SIGTERM is sent. Instead schedule extcap termination timeout to happen
as soon as control returns back to the event loop.

There is no universally agreed replacement for SIGTERM on Windows, so
just keep things simple (forcefully terminate like always) until we
have agreed on something.
2022-08-13 20:23:51 +02:00
John Thacker b5cea67768 Qt: Expert Info: Return TAP_PACKET_REDRAW if any ei is added
Any time an expert info is added to the Expert Info tap, the
Expert Info GUI tap listener needs to set TAP_PACKET_REDRAW.

draw_tap_listeners(FALSE) is called from MainApplication::updateTaps()
on a timer (controlled by a preference, defaulting to 3 seconds),
and that clears the Expert Info tap's need_redraw flag. The larger
a capture and the more expert infos, the more likely that the timer
can trigger while epan_dissect_run_with_taps() is still generating
more EI entries, but has already generated EIs of all severities
that are present in the capture. This prevents the expertInfoTreeView
from being redrawn at the end when the captureEvent is finished
retapping the packets.

Fix #18232. Fix #16591.
2022-08-13 10:55:32 +00:00
Chuck Craft a6813db329 Qt: traffic tables - tcp/udp port name resolution
Allow conversation/endpoint tabs that include IP address and
port number to resolve either or both. Currently IP address
(network) resolution is required to resolve tcp/udp ports.
2022-08-08 09:10:10 +00:00
Gerald Combs dc24cdfc4b Qt: Add an "x-reset" icon and use to reset extcap options.
Add an "x-reset" stock icon and use it instead of Qt's SP_BrowserReload
icon to reset extcap options.
2022-08-07 20:21:12 +00:00
Gerald Combs a7be80b04a [Automatic update for 2022-08-07]
Update manuf, services enterprise numbers, translations, and other items.
2022-08-07 16:38:23 +00:00
Jaap Keuter da5603a0d0 extcap: implement saving and restoring radio button setting 2022-08-06 20:19:04 +00:00
Roland Knall d24d27ebc1 Qt: Fix interface auto slot
The signal attached "currentIndexChanged" takes only int as argument,
the correct signal is "currentTextChanged". This also fixes a crash
whenever you changed the visible/nonvisible setting for an interface
2022-08-05 08:56:22 +00:00
Gerald Combs 74e0b506be Windows: Don't define or check for WIN32.
_WIN32 is defined by the compiler, and is arguably a more reliable
test that WIN32. Switch to checking for _WIN32 in a couple of places in
the code.

Remove a WIN32 definition from config.h. It was added for the WinPcap
developer pack but we no longer use that.
2022-08-05 08:33:49 +00:00
Chuck Craft 077547d033 dccp: allow port resolution in conversation table 2022-08-05 00:52:56 +00:00
João Valverde 5a430097b0 About: Reformat and expand some text. 2022-08-03 09:10:07 +00:00
Guy Harris 20a013a8af Qt: fix speling. 2022-08-02 23:31:44 -07:00
Guy Harris 71f32ef2a8 Make sure we don't create comment options longer than 65535 bytes.
Check in both editcap and Wireshark to make sure that comments have
fewer than 65536 bytes before accepting them.

This shoudl fix #18235, although there should also be checks in
libwiretap to catch cases where the user interface code doesn't do the
check (it should be done in the UI so that the user gets notified
appropriately).
2022-08-02 16:38:49 -07:00
John Thacker 66b26d7251 follow: Only retrieve matching conversations
The TCP and UDP follow conversation filter functions should
only retrieve a conversation and conversation data, not
create new conversations or new stream numbers. (That should
only happen during actual packet processing.) So they should
match on the endpoint type and not look up endpoints (since
TCP and UDP don't use the endpoint API.)

They still don't work with tunneling, or any other situation where
the addresses and ports have been changed (see #18231), but this
at least works when some other protocol _has_ used the endpoint
API, and also avoids creating nonsensical streams.

Making them work properly with tunneling either requires adding
packet info to each packet with the stream information, or using
the endpoint API (after finishing it to allow more than one endpoint
on the packet, and a way of searching for endpoints other than
the most recent.)
2022-08-02 20:54:36 +00:00
João Valverde 269e4b7d10 Qt: Remove capitalization of preposition in title
Most style guides recommend against capitalizing preposition in titles
with less than 5 letters or so.

For example KDE: https://develop.kde.org/hig/style/writing/capitalization/
2022-08-02 13:48:43 +01:00
João Valverde 2c4557d7ad About: Tweak a sentence about the project
Uncapitalize Open Source Software. Prefer the well established umbrella
term "free and open source software". Add specifics about the license
version.

Most references use an hyphen with "open-source". Do that as well.
2022-08-02 00:26:24 +00:00
João Valverde a97e1ee581 About: Make clipboard info a close copy of dialog info
To maintain familiarity and keep to expectations do an exact copy.

The last sentence to check the man page is an exception because it
is an addenda and recognizing that this clipboard information will
be used mostly in bug reports, it might get annoying.
2022-08-02 00:26:24 +00:00
João Valverde b8ec3199ab Convert Acknowledgements to markdown and update GUI
Move Acknowledgements to a separate file to enable some code
simplification and improve maintenance and discoverability
for acknowlegements.

Convert the Acknowledgements file to Github flavored markdown
and display it in rich text using QTextBrowser.

Add Acknowledgements.md to NSIS installer
2022-08-02 00:09:29 +00:00
Gerald Combs f231711f1e [Automatic update for 2022-07-31]
Update manuf, services enterprise numbers, translations, and other items.

Asterix failed.
2022-07-31 16:36:50 +00:00
Chuck Craft f50cd81ecb Qt: initialize endpoints name resolution 2022-07-30 15:25:07 -05:00
Tomasz Moń 2d1380ae5b
capture: Move capture pipe polling out of UI
Both CLI and Qt interfaces spin GLib mainloop. Move the capture pipe
polling into common code to reduce code duplication.
2022-07-30 16:42:12 +02:00
John Thacker 5aba5772e9 gboolean bitfields considered harmful
ISO C Std § 6.7.2, 5: "for bit-fields, it is implementation-defined
whether the specifier int designates the same type as signed int or the
same type as unsigned int." (See also the note in § 6.7.2.1 and ISO C
Std Appendix J.3.9.)

A gboolean is a typedef'd gint. Therefore, many implementations,
including gcc and clang, treat a gboolean bitfield of width 1 as
signed, meaning that it has two possible values: 0 and -1, any time
the integer promotions occur (which is all the time.) Constructs like this:

        dgram_info->from_server = TRUE;
        if (dgram_info->from_server == TRUE) ws_warning("True");

will not work as expected, though gcc (but not clang) will give an
error:

/home/johnthacker/wireshark/epan/dissectors/packet-quic.c:3457:37: error: comparison is always false due to limited range of data type [-Werror=type-limits]
 3457 |         if (dgram_info->from_server == TRUE)
      |

        proto_tree_add_debug_text(quic_tree, "Connection: %d %p from_server:%d", pinfo->num, dgram_info->conn, dgram_info->from_server);

Connection: 1 0x7fc4b47f2be0 from_server:0
Connection: 2 0x7fc4b47f2be0 from_server:-1
Connection: 3 0x7fc4b47f2be0 from_server:0
Connection: 4 0x7fc4b47f2be0 from_server:-1

At worst this can cause buffer overruns.

If a bitfield is desired, to guarantee expected behavior the standard
_Bool/bool should be used instead.
2022-07-30 08:49:08 -04:00
Roland Knall 59e7c16425 Revert "Qt: remove unnecessary method from FunnelStatistics"
This reverts commit ddcb429979
2022-07-29 13:13:36 +00:00
João Valverde 35f3fe1b1d Qt: Enable About->License external hyperlinks
Replace QTexteEdit with QTextBrowser and enable external
hyperlinks.
2022-07-27 16:30:48 +00:00
João Valverde e7f439bc2f Convert capture file regex search to PCRE2.
Replace the use of the obsolete GRegex with PCRE2.

Fixes a crash reported in issue #17500.
2022-07-27 11:21:03 +00:00
Roland Knall cb8fc2874c macos: Remove no longer needed function
Fixes #18221
2022-07-25 17:00:55 +00:00
Tomasz Moń 18e08d04d1
Qt: Setup GLib mainloop when needed
GLib watches and timeouts require GLib mainloop iterations. If the GLib
mainloop is not running, then GLib watches and timeouts won't trigger.
Back in the GTK+ days, then GLib mainloop was running on all systems.
Since the Qt transition, GLib mainloop only runs on Linux when Qt does
support it and environment variable QT_NO_GLIB=1 is not set.

Start polling GLib mainloop in separate thread if Qt is not running GLib
mainloop. Note that only the polling is handled in separate thread, the
dispatch and thus all user callbacks execute in the main thread.

Running GLib mainloop when needed enables full GLib functionality on all
platforms and thus allows us to simplify our code by using GLib platform
specific code.
2022-07-24 20:57:18 +02:00
Gerald Combs c252852c9d [Automatic update for 2022-07-24]
Update manuf, services enterprise numbers, translations, and other items.

Asterix failed.
2022-07-24 16:37:40 +00:00
Jirka Novak 476eb0e627 RTP player: fixed issue with no audio card available in Qt6 2022-07-21 20:09:52 +00:00
Jirka Novak ea91c5785a Qt6: Audio code review
Changes:
- audio rates are fixed, I selected common ones
- fixed signal names - they didn't matched expected autogenerated ones
- first play notification delay on Qt6 compensated
2022-07-21 20:09:52 +00:00
Gerald Combs b8d85227f6 Qt: Update the RTP stream UI to support Qt6Multimedia.
Fixes #18115
2022-07-21 20:09:52 +00:00
João Valverde d2b6b89b94 Update license file structure and GUI display
Add the text of the GPLv2 in HTML, taken from the FSF website,
and use rich text to display the license in the GUI.

Move the introductory note about the GPL from the COPYING
license text file to the README.

Remove various other license callouts at the end of the COPYING file
as unnecessary and unhelpful. This information is present in
each source file, where it belongs.
2022-07-21 19:10:06 +00:00
Roland Knall b90fb0da55 Qt: Fix jump on packetlist
If the packetlist is navigated via the up/down keys, the viewport
may jump, if the cell that is being navigated to, has content that
is greated than what is currently displayed

Fixes #16363
2022-07-18 15:25:12 +02:00
Roland Knall ddcb429979 Qt: remove unnecessary method from FunnelStatistics 2022-07-18 15:08:23 +02:00
João Valverde b50880f329 Qt: Update display filter expression dialog with any/all 2022-07-17 19:23:15 +00:00
Gerald Combs a6b09b52b4 [Automatic update for 2022-07-17]
Update manuf, services enterprise numbers, translations, and other items.

services failed.
2022-07-17 16:38:11 +00:00
Roland Knall 06cd84a6e9 Qt: Recommend 5.12 and enforce 5.10
In order to phase out older versions, we recommed 5.12 as a
minimum Qt version going forward. Although build support for
5.10 and 5.11 is not being removed at this point, it might
be for 4.x at a later time.
2022-07-13 21:26:46 +00:00
Chuck Craft 4ff209e881 Qt: Edit->Preferences resets titlebar and statusBar to defaults
Caused by a LanguageChange event - similar to #16356 /
!689
Not sure if enough to close issue #12966
2022-07-13 18:08:22 +00:00
Chuck Craft f99b056025 Qt: Supported Protocols search - increase debounce timeout
Increase the Qtimer value added in !3325 to allow human typing speed.
See !3328 for typing speed math.
2022-07-12 15:25:06 +00:00
John Thacker 8ac995578c epan: Respect custom column resolved/unresolved status everywhere
Add a function to get the column text of the nth column, taking
into account whether the column is resolved or unresolved. Use
this function in the GUI, as well as in tshark, when writing
PSML, exporting dissection to PSML, etc., instead of accessing
col_data directly.

This removes the direct accesses of col_data from outside
column.c and column-utils.c

Fix #18168.
2022-07-12 00:22:11 +00:00
Tomasz Moń 0438fca96b Qt: Concurrently fill display filter expression dialog
Use QtConcurrent to create and sort widget items. The dialog window is
immediately visible and usable. Search becomes available once all items
are added to the tree.

When compiled with Qt5, all items are added in bulk. Qt6 features new
QPromise interface that makes it possible to add tree items one by one.
2022-07-11 16:36:43 +00:00
Tomasz Moń fc85196f61 Qt: Do not spin event loops in display filter dialog
Pass comparator function so the list gets sorted alphabetically. Without
the comparator function, the pointer values were sorted. Insert already
sorted data into tree widget and thus remove the redundant sort call.

Use std::stable_sort() instead of std::sort() as stable sort is actually
faster here. The std::stable_sort() tends to do fewer comparisons and
more moves than std::sort(). When sorting QTreeWidgetItem pointers, the
move is very low cost (only the pointer itself is moved) and string
comparison is quite heavy (especially because the strings share common
prefix).
2022-07-11 16:36:43 +00:00
Gerald Combs d10253ebea [Automatic update for 2022-07-10]
Update manuf, services enterprise numbers, translations, and other items.
2022-07-10 18:42:22 +00:00
Roland Knall 26b8674320 Qt: Fix unitialized TrafficTree members 2022-07-09 11:08:15 -05:00