Commit Graph

88435 Commits

Author SHA1 Message Date
João Valverde a3d84bdc44 Lua: Print returned values in console
Print returned values from Lua chunk. Add "=" as a synonym for
"return", similarly to the upstream Lua REPL.
2023-08-21 20:48:34 +00:00
João Valverde 1daa76ae32 Qt: Make IOConsoleDialog a single instance
When opening a console dialog, make it reuse an existing instance
if it is already open. This is required because the output of
the Lua code currently only goes into a single GUI dialog
(the last one open). And in general it feels correct.

This depends on the QAction holding the pointer reference,
which seems reasonable because it is a dynamic menu action.
2023-08-21 21:30:16 +01:00
João Valverde 4f53f0acaf Qt: Remove unused Lua signals 2023-08-21 16:28:18 +00:00
João Valverde 37ace12ab0 Keep Lua console open and fix crash on Lua reload
Use global variables to save the state needed to restore the
print-to-console Lua function when the Lua state is destroyed
and re-created (reloaded).

Do not pass a lua_State pointer to the dialog, for the same reasons;
it is already a global variable, use that instead.

Fixes a crash that was easily reproduced on macOS, but probably
happens elsewhere too, where the saved state became inconsistent on
reload because the dialog wasn't re-registered. (It still isn't,
but now we are handling it with global variables on the Lua side).

Do not close the console dialog when Lua is reloaded. It is no
longer necessary and improves the usability of the dialog.
2023-08-21 16:28:18 +00:00
Martin Mathieson 55acd8fa0b Better detection of value_string conflicts, and some fixes 2023-08-21 16:43:48 +01:00
Martin Kaiser a983138bdc dissectors: new dissector for the MDB protocol
The MDB (Multi-Drop Bus) protocol is used inside a vending machine. MDB
defines the communication between the main control board (VMC = Vending
Machine Controller) and peripheral components, e.g. a payment terminal
or a bill validator.

The protocol specification is available from
https://namanow.org/nama-releases-mdb-version-4-3/

The pcap input format for this dissector is documented at
https://www.kaiser.cx/pcap-mdb.html

We are in the process of requesting an official DLT for MDB.
For now, the dissector can be mapped to a User-DLT for testing.
2023-08-21 10:21:32 +02:00
John Thacker 17cd9891be ICMPv6: Check for timestamp at the start of Echo data
Various ping programs send timevals at the start of Echo data
for ICMPv6 just as they do for ICMP for IPv4. Perform the same
check.
2023-08-20 21:24:46 +00:00
João Valverde 0e2faa112a CMake: Fix FETCH_lua build on Apple platforms 2023-08-20 17:26:38 +00:00
Gerald Combs 8586becd64 [Automatic update for 2023-08-20]
Update manuf, services enterprise numbers, translations, and other items.
2023-08-20 09:49:28 -07:00
João Valverde 159dc2c204 manuf: Remove parenthesis from short name 2023-08-20 16:59:39 +01:00
João Valverde 8985aa465f manuf: Add a special case 2023-08-20 16:59:39 +01:00
João Valverde ee633d20d9 Update manuf data 2023-08-20 16:59:39 +01:00
João Valverde c97982881f Release notes enhancements and fixups 2023-08-20 13:30:38 +01:00
Jorge Mora 268a9e243c RPC: add support for RPC-with-TLS
Add both TLS heuristic and non-heuristic dissector functions,
namely dissect_rpc_tls_heur() and dissect_rpc_tls() respectively.

Using same functionality as RPC-over-TCP in order to allow both
TLS and RPC fragmentation reassembly. Added extra option to pass
the tlsinfo struct in order to differentiate between TCP and TLS.

Do not use conversation_set_dissector() to set the non-heuristic
dissector for RPC-with-TLS, instead use tlsinfo->app_handle to
set it.

The RPC-with-TLS initialization starts by sending an RPC NULL
procedure with a credential flavor of AUTH_TLS over TCP thus
setting the non-heuristic dissector at this point will cause
all TLS packets to be dissected as RPC. To avoid this, keep
on using the heuristic dissector until an RPC with a credential
other than AUTH_TLS is used.
2023-08-20 08:44:35 +00:00
Markku Leiniö 68668655c9 UI: Fix capture options tab key ordering 2023-08-20 08:42:54 +00:00
John Thacker e111d255b7 ICMP: Improve heuristic for data time
When determining if the first few bytes of a ICMP Echo or
Echo Reply look like a timestamp, take the smaller difference
from the packet time instead of just taking the Big Endian time
if it's less than our maximum delta.

Also, test for timevals using 64 bit time_t, since that's common
now. Assume that suseconds_t is 64 bit if time_t is, even though
it doesn't have to be (do any 32 bit systems do that?)

Assume that if something looks like a LE timeval with a 64 bit time_t
that it is one, rather than being a LE timeval with a 32 bit time_t
and 0 fractional seconds. (Otherwise we'd make the wrong heuristic
decision with clock skew that makes the ping timestamp in the future.)

Fix #19283
2023-08-20 00:13:04 +00:00
John Thacker 0b9e591c3a Qt: Remove now unused pref (CID 1541123) 2023-08-19 19:52:43 -04:00
Guy Harris e3fa5e6c22 Add wtap_buffer_append_epdu_string() to add a string TLV to an EPDU.
That obviates the need to count characters in a string (which is done
incorrectly in some places, as Coverity pointed out in CID 1541122), and
also lets us do a better job of making sure the length fits in 16 bits
(by clamping it at 65535, rather than just casting it to a 16-bit
unsigned integer).
2023-08-19 15:54:39 -07:00
Martin Mathieson 21aa2bf370 check_typed_item_calls.py: check for value_string conflicts 2023-08-19 21:34:46 +00:00
Markku Leiniö 07b255d47d DHCPFO: Add more Microsoft-specified fields, based on MS docs
- Rename existing MS-specific options according to the docs
- Modify option 30 to handle list of scope IDs
- Add option 32: microsoft-client-description
- Add option 36: microsoft-client-type
- Add option 37: microsoft-client-NAP-status
- Add option 38: microsoft-client-NAP-probation
- Add option 39: microsoft-client-NAP-capable
- Add option 40: microsoft-client-matched-policy
- Add option 41: microsoft-extended-address-state
2023-08-19 23:12:17 +03:00
John Thacker 6c23a93e35 Qt: Set autoscroll in setCaptureInProgress
Instead of always requiring that setCaptureInProgress be
followed by a call to setVerticalAutoScroll to properly set
the auto scroll status, pass in the auto scroll checkbox status
to setCaptureInProgress.

This is simpler since we no longer to set up the timer.
2023-08-19 11:00:40 +00:00
João Valverde 3f841e8553 sharkd: Fix a name collision with MinGW headers 2023-08-19 11:43:10 +01:00
João Valverde 369b1d0696 manuf: Print short name with tshark -G
Add the short name (used by Wireshark for MAC address name resolution)
to the output as another column. This matches the historical
format for this text file, before it was turned into static
binary data.

The use case for still parsing an optional external manuf text file
is to allow customization of the compiled in data, for any reason.

In that case it is useful to be able to run something like:

    tshark -G manuf | grep MyVendorName >> ~/.config/wireshark/manuf

And then edit the newly added short name entries to one's satisfaction.
2023-08-19 07:39:50 +00:00
Niels Widger 44e4ad3bc5 tshark: Add more fields to -G protocols and -G heuristic-decodes
This commit adds new fields to the output of both `-G protocols` and
`-G heuristic-decodes` in `tshark`.

For `-G protocols`, three new fields (4, 5 and 6) have been appened to
the existing ones:

- Field 1: protocol name
- Field 2: protocol short name
- Field 3: protocol filter name
- Field 4 (NEW): protocol enabled (e.g. "T" or "F")
- Field 5 (NEW): protocol enabled by default (e.g. "T" or "F")
- Field 6 (NEW): protocol can toggle (e.g. "T" or "F")

For `-G heuristic-decodes`, similarly three new fields (4, 5 and 6)
have been appended to the existing ones:

- Field 1: underlying dissector (e.g. "tcp")
- Field 2: name of heuristic decoder (e.g. "ucp")
- Field 3: heuristic enabled (e.g. "T" or "F")
- Field 4 (NEW): heuristic enabled by default (e.g. "T" or "F")
- Field 5 (NEW): heuristic short name (e.g. "ucp_tcp")
- Field 6 (NEW): heuristic display name (e.g. "UCP over TCP")

The new fields added to `-G heuristic-decodes` are useful as the short
name argument required for `--enable-heuristic` was not previously
shown in the `-G heuristic-decodes` output.
2023-08-19 07:38:49 +00:00
Alexis La Goutte 2dd4de5c51 QUIC: Add Multipath support (draft-04/draft-05) 2023-08-19 07:35:45 +00:00
Niels Widger 2904e8c3e5 sharkd: Generate "eo:<name>" object list in "download" method when needed
Previously, a `download` method request for an `eo:<name>_<row>`
export object (for example, `eo:http_0` to download the HTTP export
object with row 0) would fail unless a `tap` method for `eo:<name>`
had already been run.  This behavior is surprising as the other
resources downloadable via the `download` method do not work this way.
This commit addresses this issue by updating the `download` method to,
when a `eo:<name>_<row>` export object is requested, see if an
`eo:<name>` object list already exists in `sharkd_eo_list`.  If it
does not exist, the `download` method first generates the object list
for `eo:<name>` and adds it to `sharkd_eo_list` using `sharkd_retap`
in the same manner that the `tap` method does.  After that, the
`download` method looks for the exported object in `sharkd_eo_list`
just as it did before.

This commit also adds a `sha1` field to the list of exported objects
returned by the `tap` method for `eo` objects in
`sharkd_session_process_tap_eo_cb`.
2023-08-19 07:33:38 +00:00
Stig Bjørlykke bf2f8c5fad tshark: Register extcap preferences when needed
TShark is not always capturing when cf_name is empty. Improve check
for when to not register extcap preferences for this cases.
2023-08-19 07:32:46 +00:00
Alexis La Goutte 7e5018b254 Fortinet: Add Dissector for FGCP (FortiGate Cluster Protocol) - HeartBeat 2023-08-19 07:30:33 +00:00
Gerald Combs 9663e021e1 Sysdig Event: Sync with upstream and fix the info column
Update generate-sysdig-event.py to match falcosecurity/libs master.
Extract and generate our syscall codes. Regenerate the dissector.

Resolve generic syscalls and show them in the info column. Add a
sysdig.event_name field.
2023-08-18 15:36:33 -07:00
Pascal Quantin 233da618a6 BLF: fix a typo introduced in 9bdf256a8d 2023-08-18 17:42:50 +02:00
John Thacker 8025d90971 Qt: Remove tail update timer from packet list
We have a preference that controls how often we get capture updates,
so there's no reason (nor CPU savings) to have a separate timer
checking for when to auto scroll. We can just scroll to the bottom
whenever we insert new rows (which doesn't happen any faster than
prefs.capture_update_interval, which the user can change.)

This makes the auto scrolling smoother, instead of having a gap where
rows have been inserted but not scrolled yet. If the scrolling is too
fast, a user can change the preference.
2023-08-18 07:50:27 -04:00
John Thacker 9752021f17 Qt: Preserve horizontal scroll extent for Home/End
Preserve the horizontal scroll extent when scrolling with Home/End,
the same as for other keyboard movement.
2023-08-18 11:35:42 +00:00
Anders Broman 9bdf256a8d BLF: Put EthernetStatus Objects in packet lis using Exported PDU
Put AppText ans EthernetStatus objects in the packet list.
Closes #19269
2023-08-18 11:31:15 +00:00
John Thacker 95c299a065 Move autoscroll preference behavior to recent
Make whether or not we are autoscrolling a "recent" item.

Make the selection of automatically scrolling in the Capture
Options tab actually have an effect (right now it does nothing.)

Switching to a recent also means that the command line "-l" option
actually turns on automatic scrolling if the recent value is off
(currently it has no effect because it is always later overridden
by the preference value).

Document our behavior that autoscrolling, if turned on, temporarily
turns off when manually scrolling upwards or Go'ing directly to
a packet (so that a user can examine a chosen packet.) This temporary
effect does not change the "recent" status, which changes only when
the user directly turns the behavior on or off (through the capture
window, the button or menu item, or the -l command line option.)
2023-08-18 10:49:03 +00:00
Anders Broman c5452afb8d Exported PDU: Add new tag EXP_PDU_TAG_COL_PROT_TEXT
Add a new tag to write to the info column.
2023-08-18 08:57:12 +00:00
João Valverde e5e004e064 Qt: Ensure the IOConsoleDialog destructor is called 2023-08-18 01:01:10 +00:00
João Valverde 96c9153560 epan: Fix a memory leak 2023-08-18 01:01:10 +00:00
João Valverde 152fef5b38 Qt: Remove an #ifdef 2023-08-18 01:01:10 +00:00
Martin Mathieson d0312ddf4a Fix some filters and field widths 2023-08-17 22:08:30 +01:00
João Valverde 759c0feab3 CMake: Accept any supported Lua version by default 2023-08-17 18:16:12 +00:00
Alexis La Goutte 008d389e94 ieee80211: fix mask is all set
packet-ieee80211.c hf_ieee80211_gann_flags_reserved filter= wlan.gann.flags.reserved  - mask is all set - this is confusing - set 0 instead! : 0xFF
packet-ieee80211.c hf_ieee80211_he_trigger_bar_info_blk_ack_seq_ctrl filter= wlan.trigger.he.common_info.bar_info.blk_ack_starting_seq_ctrl  - mask is all set - this is confusing - set 0 instead! : 0xFFFF
2023-08-17 17:43:02 +00:00
Alexis La Goutte e4544bd5ae ieee80211: fix wrong item type/length and bitmask
Warning: epan/dissectors/packet-ieee80211.c:24227 proto_tree_add_uint called for hf_ieee80211_he_om_rx_nss  -  item type is FT_UINT16 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24229 proto_tree_add_uint called for hf_ieee80211_he_om_channel_width  -  item type is FT_UINT16 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24233 proto_tree_add_uint called for hf_ieee80211_he_om_tx_nsts  -  item type is FT_UINT16 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24326 proto_tree_add_uint called for hf_ieee80211_he_uph_ul_power_headroom  -  item type is FT_UINT8 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24330 proto_tree_add_uint called for hf_ieee80211_he_uph_reserved  -  item type is FT_UINT8 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24348 proto_tree_add_uint called for hf_ieee80211_he_btc_avail_chan  -  item type is FT_UINT16 but call has len 4
Warning: epan/dissectors/packet-ieee80211.c:24350 proto_tree_add_uint called for hf_ieee80211_he_btc_reserved  -  item type is FT_UINT16 but call has len 4
2023-08-17 17:43:02 +00:00
Stig Bjørlykke 66a502e195 Qt: Add loadGeometry to ManufDialog
Load and save dialog geometry for MAC Address Blocks dialog.
2023-08-17 19:01:50 +02:00
Huang Qiangxiong b86172a37d STUN: add Change IP or Port to INFO column 2023-08-17 16:32:03 +00:00
João Valverde fea3f90147 Rename the Lua log domain
The name "WSLua" looks kind of weird. Use just "Lua" instead.
2023-08-17 15:39:21 +01:00
João Valverde 80c63485e4 Qt: Close console dialog when reloading Lua
Fixes a crash using the console because the dialog holds a pointer
to the Lua state that gets invalidated by the reload.

Forcing the dialog to close drops the invalid reference and avoids
the crash and all the other attending state problems with the reload.

In theory there might be console types other than Lua so we may
want to fix the code to close only Lua type dialogs if only Lua
plugins are reloaded.
2023-08-17 15:38:57 +01:00
João Valverde 8ebbcd4ecf Qt: Use a vertical layout with Lua console
Switch from a horizontal input/output text layout to a vertical
layout with a splitter in the middle.

Change to a QTextEdit while at it, just because the performance
reasons that might suggest using QPlainTextEdit are not very
relevant here.

Use the proper keyboard shortcut for macOS.
2023-08-17 15:32:36 +01:00
Stig Bjørlykke 249516680b Qt: Add loadGeometry to CredentialsDialog
Load and save dialog geometry for Credentials dialog.
2023-08-17 15:18:18 +02:00
John Thacker 615c2bf15a batadv: Can't add bitmask with no fields
proto_tree_add_bitmask has an error if called with an empty
set of fields. The flags field is unusued in BATADV_OGM2, so
just add without using a bitmask tree.

Part of #17890
2023-08-17 07:29:09 -04:00
Jonas Wamsler e6110367de sapsnc: Fix dissection of Quality of Protection parameter
Fixing the bug of the dissector that swaps the Quality of Protection parameter "min" and "use" in snc.
2023-08-17 10:42:32 +00:00