Commit Graph

39 Commits

Author SHA1 Message Date
John Thacker 2b5fd572f7 File sets: Match both formats, compressed files
For file sets produced by multiple file captures, match both
the number before time and the newer time before number format.
Distinguish them in the return value, since files of different
formats are not part of the same set.

Also handle files with a compression suffix as well, as we can
produce that in captures. Since in multi file captures compression
is done when switching files, allow file sets to have a mixture of files
compressed and uncompressed. When doing a multi file capture and
compressing, the last file is not compressed.

Add information to the user guide and release notes

Related to #12371
2024-01-29 13:39:08 +00:00
John Thacker ffbf7ff540 dfilter: Allow semicolons to separate macro name from arg list
Instead of requiring ${macro:arg1;...;argN}, allow the format
${macro;arg1;...;argN}.

The semicolon isn't used anywhere else, it's simple to support,
and already used in the macro syntax. It's easier to remember
if all the separators in a macro are the same.

The colon is allowed in literals, which is why it's not used
between the arguments in the macro argument list, and allowing
it after the name makes the grammar more complicated, including
tokenizing when having pop-ups of potential field matches in
the display filter line edit (#19499.)

Update the documentation for this. Also edit the documentation
for macro syntax in a few places where it implies that whitespace
in macro arguments would be ignored; in fact, it's significant.
2024-01-24 01:00:32 +00:00
Gerald Combs 676478c8d3 epan: Use an ellipsis to indicate truncated fields
Show truncated fields as "Field name […]: data" instead of "Field name
[truncated]: data". This lets us show a few more characters of data.
2024-01-22 08:01:56 +00:00
Gerald Combs a0f5d63515 Release notes: Note that the Parlay dissector has been removed 2024-01-12 18:40:01 +00:00
Timo Warns 73e5eeae50 GNSS: add dissectors for further UBX messages 2024-01-12 09:20:13 +00:00
John Thacker 0fc2359812 tshark: Deprecate -G with no argument
We've been planning on removing -G with no argument for
18 years (2f7fd680e2); start
warning users that it is deprecated.

Single letter options with optional arguments are tricky and
deprecated, see Guideline 12 of the POSIX Utility Syntax Guidelines.
( https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/V1_chap12.html )
We have special handling for -G as a result which forces it to the
first argument. -G with no argument can't be mixed with other options,
unlike the other reports. Removing this would allow relaxation of that
restriction.

Related to #17924
2023-12-22 10:45:52 +00:00
João Valverde b52d9173f8 Remove version component from plugin path
Remove the major.minor version from the plugin path, i.e:
    lib/plugins/X.Y/{epan,wiretap,codecs}
and use an unversioned path:
    lib/plugins/{epan,wiretap,codecs}

Introduce a new naming policy for plugins that requires
name.so.ABI_VERSION.

This is a simplified filesystem layoutfor plugins some
important benefits such as:

 * improves compatibility between Wireshark versions, because
a plugin that wasn't recompiled will be automatically picked
up, but only if it has a compatible ABI version in the file name.
 * does not clash with Apple guidelines
 * simpler for users to understand and apply
 * just overall simpler and easier to maintain, removes a lot
of complexity from CMake code

It does impose more requirements on the plugin naming scheme
but this should be handled completely transparently
by the build system.

It would also be possible to add support for unversioned *.so file
extensions at the same time, although in ths case it is not possible
to support multiple Wireshark ABI versions with only *.so, of course.
This wasn't done here but it may or may not be a useful enhancement
in the future.

Follow-up to 90b16b4092.
2023-12-14 14:28:30 +00:00
João Valverde b1521550c6 plugins: Give higher priority to the personal folder
In general user customization should take higher priority
over system defaults. Do that here. This allows the user
to replace system plugins without much hassle.

We load the personal plugin folder first and lower the report
for a plugin found in multiple folders to a console log message
with log level "message" (so by default it will be displayed).
2023-12-08 11:47:19 +00:00
João Valverde c76a28fca4 Qt: Add Install Plugin to Tools menu
Add an option to the tools menu to copy a binary plugin file
(a .dll or .so) to the personal plugin folder.

This avoids the user having to create the paths manually and
knowning a lot of relatively unimportant details about where and
how Wireshark loads binary plugins.

It will also try to validate the plugin and do some sanity checks to
ensure the ABI is compatible.
2023-12-07 22:58:33 +00:00
Martin Mathieson e17a22df89 Fix some spelling errors 2023-12-07 09:38:27 +00:00
John Thacker e66f010ca2 Qt: Add context menu to Resolved Addresses
Create a derived class for the TableViews to make it easier
to create the context menus.
Enable copying and saving only selected rows

Add release notes

Related to #16419
2023-12-04 11:19:41 +00:00
João Valverde f835dc800f Update README.plugins and release notes 2023-12-03 23:20:39 +00:00
John Thacker 697f37cf2b Capture: Get our capabilities list in one dumpcap call
Instead of calling dumpcap separately for each interface in
the list, make one dumpcap call.

There's still two calls, one to get the list of interfaces and
one to get the capabilities, which is partly because interfaces
that support monitor mode can indicate support for different
link-layer types depending on whether monitor mode is enabled,
and we have to check per-interface preferences for the name to
see if we want monitor mode.

This roughly doubles the speed to add interfaces at startup
in my testing on Windows and Linux, and should massively
reduce the number of UAC pop-ups when npcap is installed with
restrictions to administrative access.

Fix #16191. Related to #15082 (it improves the number of UACs,
but perhaps they could be reduced even further by having dumpcap
stay open for all the calls in the life of the program.)
2023-11-23 20:27:58 +00:00
John Thacker 24c0cba235 doc: Mention rpcap fix in release notes
[skip ci]
2023-11-21 21:03:33 -05:00
Timo Warns ad6947eb71 GNSS: add dissector for EGNOS Message Server (EMS) files
Add dissector for EGNOS Message Server (EMS) files including entries
with EGNOS SBAS navigation messages.
2023-11-21 06:43:40 +00:00
Timo Warns cea4faac39 GNSS: add wiretap for EGNOS Message Server (EMS) files
Add a wiretap implementation for EGNOS Message Server (EMS) files.
2023-11-21 06:43:40 +00:00
Gerald Combs 6ce97e418b Docs: Move attributes.adoc to the doc directory 2023-11-14 06:07:53 +00:00
João Valverde a1467a8ce2 Minor corrections to release notes
Add a missing sentence.

Add some more information about display filter plugins, besides
the "What's new" blurb.
2023-11-10 23:14:18 +00:00
João Valverde 7d87367e22 dfilter: Add a function-like macro syntax
Add an alternative macro notation as $mymacro(a,b,c,d). For me
this notation is more natural, I have difficulty remembering how
to use macros with ${mymacro:a;b;c} and it makes the filter
expression harder to understand.

For convenience and to simplify the code we also allow
curly braces to open/close macro argument lists and the semicolon
as an argument separator for the new syntax.

This added flexibility may be reevaluated and dropped later if it
turns out to be undesirable for some reason.
2023-11-08 15:48:00 +00:00
João Valverde bc64efa538 dfilter: Replace macro UAT config file and update GUI
Remove the UAT macro usage. The UAT API is nifty for dissectors
but clunky for everything else.

This allows using a hash table to store macros, that is the natural
data structure for the use case (and faster).

It also allows using the existing filter GUI dialog, adapted for
display filter macros. The difference isn't huge but it's better
and less limited than the more generic UAT dialog, with room for
improvement. Changing the UAT dialog for filter specific
use cases is difficult.

The config file is renamed to "dmacros" and uses the same format
as "dfilter", that is more amenable and forgiving for hand-editing
than the UAT storage format.

There is some logic to convert the "dfilter_macros" UAT config
file to a "dmacros" filter config file, for backward-compatibility.
The conversion is only done if there is no existing "dmacros" file
in the profile folder.
2023-11-08 11:45:54 +00:00
João Valverde 49f39be301 dfilter: Add IP address plugin
Add a display filter plugin with functions to test IP addresses.

This extends the display filter features with some more specialized
functions and serves as an example on how to write a display
filter plugin.
2023-10-31 08:50:54 +00:00
João Valverde 813be7fe50 dfilter: Allow writing references without curly braces
Allow references without braces, for a less cluttered syntax:

    Filter:
     frame.number > $frame.number

    Instructions:
     0000 READ_TREE        frame.number     -> R0
     0001 IF_FALSE_GOTO    5
     0002 READ_REFERENCE   ${frame.number}  -> R1
     0003 IF_FALSE_GOTO    5
     0004 ANY_GT           R0 > R1
     0005 RETURN

The original syntax of ${reference} came from macros but the
braces don't add much. In any case they are still allowed.
2023-10-31 08:48:48 +00:00
João Valverde db99904eea Qt: Include functions in display filter completions 2023-10-28 09:53:52 +00:00
Sergio de Paula 38b6c7cd0a [RF4CE] Added RF4CE protocols to release notes 2023-10-27 21:25:29 +00:00
João Valverde d99efed280 dfilter: Add display filter plugins
Allow writing display filter plugins in C. Plugins can
register one or more display filter functions.

This should lower the barrier for implementing and sharing
new display feature extensions.

An example plugin will be provided in a follow-up commit.

TODO: Put some work into refactoring display filter headers.
Right now some plugin-related APIs are implemented in dfilter-int.h,
which we'd rather not install to the system.
2023-10-26 00:13:30 +01:00
João Valverde 7fbed5b306 plugins: Allow multiple types in description
Allow plugins to declare their type, for the purpose of inserting
a description in the UI. The type consist of one or more bit ORed
flags.

This fixes the 'stats_tree' plugin description in the UI.
The plugin is not a dissector type plugin, as was being displayed
before. Now it correctly shows "tap listener" plugin.
2023-10-25 23:12:21 +00:00
João Valverde d44e9d3b4c IPv6: Add special-purpose block flags 2023-10-25 13:05:44 +00:00
João Valverde c37d10383d IPv6: Make the "show address detail" preference default enabled 2023-10-25 13:05:44 +00:00
João Valverde 5609c77144 dfilter: Allow testing for nonzero function result
Allow functions to be tested for "existence". This is in fact
not an existence test but a truthiness test for the function
return value.
2023-10-24 20:51:24 +01:00
Pedro Alvarez fcee2a36d2 mac-nr: add mac-nr-framed protocol 2023-10-24 10:27:09 +00:00
João Valverde c86a85022d dfilter: Add "bitand" as an alternative operator keyword
It's more compact than "bitwise_and" and inspired by C.
2023-10-23 10:39:28 +00:00
João Valverde 356b3ed6c9 dfilter: Add time multiplication by scalar floats
Extend the time arithmetic to support multiplication and division
with floating point numbers.

In this case the multiplier/divisor is parsed according to its
lexical number type.

Fixes #19150.
2023-10-22 11:08:37 +01:00
João Valverde ec669afcbb dfilter: Add time multiplication by scalar integers
The multiplication of two time values is not well-defined,
because time is represented internally as a vector.

Add a scalar multiplication/division for time values
using integer numbers. The scalar multiplier must appear
on the RHS of the operation. (This limitation mat be
removed in the future.)

This is useful to compare relative time values. The
operation is also allowed for absolute date and time values
because it is mathematically consistent but that is
probably less useful in practice.

Related to #19150.
2023-10-22 10:54:26 +01:00
João Valverde 7595fc7b01 Revert "plugins: Do not require a "type" subfolder hierarchy"
This reverts commit ef836e9afe.

To improve usability the commit created other issues that do not
have an easy fix.
2023-10-18 14:30:46 +00:00
João Valverde 2cc9d615e9 plugins: Add back a (flexible) folder type hierarchy
Restore the type hierarchy for efficient loading of binary
plugins. Do not recurse.

Allow an exception for the root of the binary plugins
folder. Scan this path also and skip incompatible plugins.
This facilitates quick manual copying of plugins.

Follow-up to ef836e9afe.
2023-10-17 22:21:51 +00:00
João Valverde c7d0e02b49 plugins: Optimize directory scanning
Move the "right type or skip" check to the top.

Make the type string shorter and closer to natural text.

Add the API/ABI break to the release notes.
2023-10-17 12:33:31 +01:00
João Valverde ef836e9afe plugins: Do not require a "type" subfolder hierarchy
The folder structure was introduced to organize the
plugins and permit more efficient loading during the
startup but the gains are slight and the requirement
is awkward to describe and easy to forget in practice.

Remove that requirement and load any compatible binary
plugin in the plugin folder. This also allows extra
flexibility to organize the plugins in categories,
for example adding an "external" folder for plugins
external to the project, or whatever else one might
wish.

To check for library compatibility we add an extra string
signature token in the plugin that can be compared with
the expected plugin type.

The downside is that the initialization is still performed
3 times and more files need to be skipped now but in practice
this should not have a measurable performance impact
and this eliminates a class of annoying small forgetful mistakes
when manually installing files.

This is still compatible with the old requirement of having a
epan/wiretap/codecs subfolder. At most one sublevel is allowed
to minimize security risks and slowness with any random folder
hierarchies if the plugins folder setting is somehow misconfigured
or hijacked.

Ping #19389.
2023-10-11 08:08:16 +01:00
Gerald Combs 36fb1a1122 Doc: Fix the include path in the release notes
Update a note about the asciidoctor's --failure-level flag.
2023-10-06 21:09:33 +00:00
João Valverde 81cb82abf4 CMake: Try to fix release notes dependencies (take 2) 2023-10-03 15:43:26 +00:00