Commit Graph

83084 Commits

Author SHA1 Message Date
João Valverde e0dba4854b Exclude wmem_test.c from pre-commit 2021-12-18 20:13:41 +00:00
João Valverde f837dae4c4 Fix wmem_test.c indentation 2021-12-18 19:39:21 +00:00
João Valverde b83f264f7d Fix wsutil/time_util.c indentation 2021-12-18 19:39:21 +00:00
João Valverde d443197097 Prefer the portable _Noreturn attribute (C11)
Use _Noreturn, available with C11, instead of vendor specific
attributes. It's not compatible with C++ so we we must keep
the old code for now.
2021-12-18 18:54:08 +00:00
Gerald Combs 2de477f499 Docs: Prefer 64-bit Windows.
Document the 64-bit Windows build options first and switch to
"Wireshark-win64" in a couple of places.
2021-12-18 17:45:03 +00:00
Martin Mathieson 4901eefaa5 README.tapping: Some minor updates 2021-12-18 14:47:57 +00:00
Martin Mathieson 62a747bae3 file-jpeg: Fix value in vals_ifd_tags_exif[] 2021-12-18 11:43:03 +00:00
Chuck Craft 136b67b85e wsdg: cleanup epub3 build warnings - anchors; TOC
Closes #17790
2021-12-18 08:20:32 +00:00
João Valverde a8acda8fcc Docs: Add more info about transitioning to C99 fixed-width types 2021-12-18 07:24:46 +00:00
Joel Colledge f4123939d1 DRBD: Tidy up choice of display base for fields
When the dissector was added, BASE_HEX_DEC was used by default for many
fields. This is often not the most appropriate display format. The
biggest change is that all fields referring to sizes in bytes now
consistently use BASE_DEC_HEX.
2021-12-18 07:06:52 +00:00
Joel Colledge 217228eece DRBD: Decode two-phase commit payloads
This part of the DRBD protocol requires some state to correctly decode.
So we use a conversation to associate the packets. This conversation
stores a map of the two-phase commit data required for decoding later
packets.
2021-12-18 07:06:52 +00:00
Joel Colledge 4a28f5704f DRBD: Use CF_FUNC with BASE_CUSTOM
This is apparently necessary to prevent compilations warnings in certain
build environments.
2021-12-18 07:06:52 +00:00
Joel Colledge 583169ce06 DRBD: Add implicit data sizes as fields
Packets such as P_DATA do not have a dedicated field containing the size
of the data. It is simply the amount of extra data in the packet. It is
useful to be able to show or filter by this value, so add it as a
separate field.

Also combine the "blksize" and "size" fields, since they have the same
meaning.

Finally, remove some duplicates of the function decode_payload_data.
2021-12-18 07:06:52 +00:00
Joel Colledge 34f5c2c344 DRBD: Decode barrier numbers and block IDs little-endian
These values are opaque handles as far as the protocol is concerned.
They are sent from some node A to B, and then back from B to A. For node
B they have no meaning other than as a handle. However, on node A they
do have meaning, so it is useful to be able to interpret them. In
practice, they are usually little-endian encoded, so decode them
accordingly.
2021-12-18 07:06:52 +00:00
Antoine Gardiol e4cd4f92f8 5co-legacy: Fix dissector unique hash computing
*** CID 1495425:  Integer handling issues  (CONSTANT_EXPRESSION_RESULT) in packet-5co-legacy.c: 765 in fiveco_hash()
2021-12-18 06:29:41 +00:00
John Thacker f89d536503 text_import: Fix direction detection in Import from Hexdump
If the first character of the preamble indicates direction, it
needs to be skipped over and not tested as part of the timestamp.
2021-12-18 00:49:42 +00:00
Pau Espin de3359fe3e IuUP: Use proto_tree_add_checksum() to show CRC Header
Use standarized API to show checksum information. This also does the
checksum validation and shows computed CRC if found incorrect, etc.
2021-12-17 23:47:06 +00:00
Pau Espin f81a64e2bf IuUP: Fix CRC Header checks
All the packets coming from a known working source (nano3g femtocell)
where being shown as containing wrong CRC Header in Wireshark.

pcap file: https://osmocom.org/attachments/download/4744/3g_call_23112021.pcapng
2021-12-17 23:47:06 +00:00
João Valverde 77f95e18ab CMake: Disable Wformat-truncation (GCC warning)
Converting from GLib functions to stdio.h turns up many of these
warnings. They are disabled to allow work to go on and until
there is consensus on how to handle them.

    -Wformat-truncation
    -Wformat-truncation=1

        Level 1 of -Wformat-truncation enabled by -Wformat employs
        a conservative approach that warns only about calls to bounded
        functions whose return value is unused and that will most likely
        result in output truncation.
2021-12-17 19:34:55 +00:00
João Valverde b054f9aee6 ASN1: Convert I/O from GLib to stdio.h 2021-12-17 19:34:54 +00:00
João Valverde 64e8a2817e Add wsutil/glib-compat.h to wireshark.h
We are already adding glib.h, we should include glib-compat.h
as well in the base environment.
2021-12-17 19:34:54 +00:00
João Valverde 689976477a Add inttypes.h to wireshark.h
For convenience, having to add this header constantly is annoying
and kind of pointless, now that we are relying more on stdio.h.
2021-12-17 19:34:54 +00:00
Gerald Combs 271ab568b0 GitLab CI: Enable ccache in the "No options" job. 2021-12-17 18:53:53 +00:00
Gerald Combs f877e26b31 GitLab CI: Add back a missing variable. 2021-12-17 08:49:02 -08:00
Martin Mathieson 834312cb62 DCT2000: For ipprim frames, show header even when no payload dissector 2021-12-17 16:37:22 +00:00
John Thacker b4054d3879 text_import: Time delta between packets without timestamp
The "Import from Hex Dump" time delta for packets without a timestamp
was changed to be a nanosecond, but the time resolution for the file
created by import_text_dialog is the default, microseconds. Until
that is configurable, the time tick used needs to be microseconds like
it was before.

Clean up the code so that it's a little more consistent about when
and how the extra time tick is added, namely:
1. If there is no time format passed in.
2. If time format conversion for the packet fails for any reason.

We don't add an extra delta in other situations, e.g. if packets just
happen to have the same valid time value.

Fix #15562.
2021-12-17 13:37:29 +00:00
John Thacker 5f5f03f0e8 text_import: Fix spelling and grammar 2021-12-17 12:55:52 +00:00
Gerald Combs 07c4059277 GitLab CI+Qt+Docs: CMAKE_PREFIX_PATH updates.
Qt's documentation recommends using CMAKE_PREFIX_PATH to designate your
Qt installation prefix: https://doc.qt.io/qt-5/cmake-get-started.html.
Do so in GitLab's CI and update the Developer's Guide.
2021-12-16 18:47:18 -08:00
Gerald Combs 7d88f1e2b1 GitLab CI: More Windows environment updates.
Use Visual Studio's CMake in the MR build. Use CMAKE_PREFIX_PATH as
recommended by https://doc.qt.io/qt-5/cmake-get-started.html
2021-12-16 17:00:02 -08:00
Gerald Combs 476bf62494 GitLab CI: Remove a no-longer-needed build.
Remove the -DENABLE_PCAP=OFF build from the "macOS Arm Package" job.
It's no longer needed since we now have a "No options" job.
2021-12-16 22:51:47 +00:00
Dario Lombardo 1f7c4eff30
ci: add no options job.
Fix: #17786.
2021-12-16 22:54:21 +01:00
João Valverde 9ebeb39395 CMake: Be stricter about MSVC requirements 2021-12-16 12:19:22 +00:00
João Valverde 5bba669579 Remove some lingering uses of g_assert()
Also replace some incorrect uses of g_assert_true().

  g_assert_true -> g_assert -> ws_assert
2021-12-16 10:19:45 +00:00
Jaap Keuter 9539f4e1d6 MMDBR: Don't pretend to be a multithreaded writer 2021-12-16 09:28:54 +00:00
Antoine Gardiol 4248e5b665 5co-legacy: New FiveCo Legacy dissector 2021-12-16 09:13:37 +00:00
Brian Sipos a8b4bffab5 TCPCL: Display extension names from dissectors
Dissector names allow extension items to be given standard text names.
This also uses a protocol-in-name-only to avoid the frame.protocols field from containing ":tcpcl:tcpcl:tcpcl:..." for each extension dissection.
2021-12-16 05:13:52 +00:00
João Valverde 06e6f7d922 Docs: First pass to update README.developer to C11
Update to reflect the transition from C99 to C11. Remove obsolete
comments and recommendations. Add a bit about transitioning to C
fixed width types.

Related to #17768.
2021-12-16 04:59:04 +00:00
Gerald Combs 606bc27777 GitLab CI: Update our Windows environments.
Use Visual Studio's CMake where we can.
2021-12-15 18:51:20 -08:00
John Thacker a74fabf73f text_import: Parse entire timestamp from hex dumps
_parse_time, which uses g_strlcpy, expects that end_field points
to the position after the end of the field (such as the \0.)
text_import_regex handles this correctly, but when importing from
hex dumps the last character of the timestamp was being cut off,
which makes a big difference when fractional seconds are not used.
2021-12-16 00:07:08 +00:00
João Valverde 9d97b8e361 JSON: Remove unnecessary hfindex lookup 2021-12-15 20:49:51 +00:00
Gerald Combs c324696504 CMake: Update a Windows SDK version check.
C11 support requires a newer Windows SDK. Add version checks and
workarounds as needed. Remove a redundant CMAKE_C_COMPILER_ID check. Add
a description of C5105 to match our other warning adjustments.
2021-12-15 10:54:02 -08:00
João Valverde 81de22e81a wslog: 'struct timespec' is C11, use that 2021-12-15 15:00:59 +00:00
João Valverde fe30cf2f8a wsutil: Add portability wrapper for clock_gettime(CLOCK_REALTIME) 2021-12-15 15:00:59 +00:00
João Valverde e877460a9e Revert "The function timespec_get() is C17 so assume we have it"
This reverts commit 8b15d0e641.
2021-12-15 15:00:59 +00:00
John Thacker 67a4e70382 wiretap: have dummy IDBs set OPT_IDB_TSRESOL if needed
In wtap_dump_init_dumper(), when constructing a dummy IDB for files
that don't have one, if the tsprecision value is anything other than
the default, then the OPT_IDB_TSRESOL option also needs to be set.
Without it, for a pcapng the timestamps will be written according to the
tsprecision and time_units_per_second values, but when it is read,
the values will be interpreted incorrectly.

It would probably be better if the consistency of these values were enforced.
2021-12-15 14:04:58 +00:00
Martin Mathieson bf15343241 Fix some spelling errors 2021-12-15 12:28:16 +00:00
João Valverde 663c1655b4 CMake: Use CMAKE_C_STANDARD to require C11
Related to #17768.
2021-12-15 10:41:45 +00:00
João Valverde 5623e60375 Revert "CMake: Change our configuration to enable C17"
This reverts commit 0781007df4.
2021-12-15 10:39:29 +00:00
John Thacker 85a8de25a4 blf: Set OPT_IDB_TSRESOL
In addition to setting tsprecision and time_units_per_second, add
the OPT_IDB_TSRESOL option as well, because pcapng expects that to
be set if tsprecision is anything other than the default.
2021-12-15 07:22:51 +00:00
Richard Sharpe 2b2c81a551 ieee80211-radiotap: Fix a problem with S1G 0-length PPDUS.
The code was not advancing the offset correctly and mis-dissecting NDP
frames.
2021-12-15 07:06:33 +00:00