Commit Graph

81609 Commits

Author SHA1 Message Date
Gerald Combs a2718d0d22 CMake: Remove no-longer-used checks.
The following commits removed code that required the following defines,
so remove them:

c0711693ab HAVE_GETOPT_H (Partial; still required by CMake)
2925fb0850 HAVE_MKSTEMPS
0c889d6f5c HAVE_SYS_IOCTL_H
0c889d6f5c HAVE_SYS_SOCKIO_H
0c889d6f5c HAVE_STRUCT_SOCKADDR_SA_LEN
9c5049a80b HAVE_STRUCT_STAT_ST_FLAGS
2021-07-15 15:03:53 -07:00
Evan Huus f58850d207 tcp: switch packet_scope to pinfo->pool
Per mailing list discussion:
https://www.wireshark.org/lists/wireshark-dev/202107/msg00030.html

Long-term we want to get rid of the wmem_*_scope globals in favour of
passing wmem pools around. Step one is to replace all reasonable uses of
wmem_packet_scope() with pinfo->pool which has effectively the same
lifespan. This converts the TCP dissector as a proof of concept. TCP is
a common enough protocol this should stress-test the idea fairly well.
2021-07-15 18:14:16 +00:00
Arkady Gilinsky 96c0700c62 wireshark(HEAD): oampdu: Fix: do not stop GetReq packet parsing for Object 0
* The next_byte variable is taken before the pointer moved forward, this lead
   to stop parsing get request packets when object is 0. This commit fixes it.

Signed-off-by: Arkady Gilinsky <8351139-ark-g@users.noreply.gitlab.com>
2021-07-15 13:01:38 +00:00
Martin Mathieson 458d870a66 ORAN FH CUS: Fix C-Section dissection.
Some fields are present or not depending upon the section
type - fix reserved/beamId error.
2021-07-15 11:44:21 +01:00
Guy Harris 0822e8b3e5 tshark: fix the checks for --capture-comment.
Move those checks out of #ifdef HAVE_LIBPCAP/#endif, as that option is
supported even if we don't build with pcap - it's also used when reading
one file and writing another.

Don't check for pcapng when deciding whether, when reading from an
existing capture file, we can write it with added file comments; check
whether the specified file type supports file comments and, if it
doesn't, report all file formats that do as part of the error.
2021-07-15 02:10:52 -07:00
Developer Alexander 2a1ebd1e91 can: more specific dissector tables for CAN IDs and extended IDs
Introduces two new dissector tables can.id and can.extended_id to enable a
more precise control of subdissectors dependent on the can id which is often
used to identify the the payload.

Since standard CAN IDs and extended IDs can be used in the same network and
their ranges overlap it is necessary to have two different dissector tables.

Existing Decode as dissector table can.subdissector stays as is to prevent a
breaking change. But new dissector tables can.id and can.extended_id get
priority over can.subdissector since they are more specific. Id they get a
match can.subdissector won't be called.

New dissector tables can.id and can.extended_id are accessible in lua scripts
via DissectorTable:add() while can.subdissector unfortunately is not.

For related Discussion see MR !3405
2021-07-15 07:29:46 +00:00
Gerald Combs 34ef2066e5 CMake: Don't bother checking for fcntl.h or floorl.
fcntl.h appears to be available on all of our supported platforms,
including Windows. We've also been including it without HAVE_FCNTL_H
guards in a few places (e.g. sshdump.c) without any issues for some
time.

floorl is part of C99.
2021-07-15 06:41:05 +00:00
J M cbed7130de DoIP: Add TLS handover for encrypted communication 2021-07-15 06:40:22 +00:00
Guy Harris 0a9ef601d2 Clean up handling of --capture-comment.
Don't store the comments in a capture_options structure, because that's
available only if we're being built with capture support, and
--capture-comment can be used in TShark when reading a capture file and
writing another capture file, with no live capture taking place.

This means we don't handle that option in capture_opts_add_opt(); handle
it in the programs that support it.

Support writing multiple comments in dumpcap when capturing.

These changes also fix builds without pcap, and makes --capture-comment
work in Wireshark when a capture is started from the command line with
-k.

Update the help messages to indicate that --capture-comment adds a
capture comment, it doesn't change any comment (much less "the" comment,
as there isn't necessarily a single comment).

Update the man pages:

- not to presume that only pcapng files support file comments (even if
that's true now, it might not be true in the future);
- to note that multiple instances of --capture-comment are supported,
and that multiple comments will be written, whether capturing or reading
one file and writing another;
- clarify that Wireshark doesn't *discard* SHB comments other than the
first one, even though it only displays the first one;
2021-07-15 05:43:36 +00:00
Stefan Metzmacher 94ac641efa packet-kerberos: implement PAC Ticket checksum verification
We use some private functions from MIT kerberos:
- krb5_free_enc_tkt_part()
- decode_krb5_enc_tkt_part()
- encode_krb5_enc_tkt_part()
but we already do that for krb5int_c_mandatory_cksumtype(),
which is newer than the above functions.

We use all of them only under HAVE_KRB5_PAC_VERIFY,
so we don't seem to need additional configure tests.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2021-07-15 04:52:30 +00:00
Stefan Metzmacher 8cd877fc4d packet-kerberos: always get the true length from decrypt_krb5_data_asn1()
Otherwise the child_tvb blobs may contain to much data.

Signed-off-by: Stefan Metzmacher <metze@samba.org>
2021-07-15 04:52:30 +00:00
Gerald Combs 9b78a42855 CMake: Fixup qtui's includes.
Add ${MINIZIP_INCLUDE_DIRS} to qtui's includes instead of every
target's. Make more includes SYSTEM PRIVATE.
2021-07-14 17:33:18 -07:00
Gerald Combs f6872b0c3e GitLab CI: Produce less test output.
Pass `--output-on-failure` instead of `--verbose` to ctest so that we
produce more relevant output.
2021-07-14 18:17:08 +00:00
Alexis La Goutte 0ea7692ec4 sv: fix typo ConfRef => ConfRev
Reported by Robert Sandholzer (#17486)
2021-07-14 17:46:39 +00:00
Gerald Combs 8834b470d0 CMake: Fixup SpanDSP's TIFF includes.
Add TIFF_INCLUDE_DIR to SPANDSP_INCLUDE_DIRS, but only if TIFF has been
found.

Ping #17477.
2021-07-14 09:10:09 -07:00
Martin Mathieson 1f9f287fba ISO15765: Make a function static. 2021-07-14 13:29:33 +01:00
Martin Mathieson 560f271d27 ISIS-LSP: Fix spelling of "algorithm" 2021-07-14 10:56:24 +00:00
Guy Harris dfef4a750d Rename LONGOPT_NUM_CAP_COMMENT to LONGOPT_CAPTURE_COMMENT.
The latter is what editcap calls --capture-comment, and the _NUM serves
no purpose whatsoever.  One #define name for it suffices.
2021-07-14 09:51:54 +00:00
Dr. Lars Völker 95dc4f52bc LIN: Adding support for LIN dissection
This patch adds support for LIN (Local Interconnect Network) as
well as support for:
- Signal PDUs on LIN
- ISO 15765 (ISO TP) on LIN
- TECMP transported LIN is handle like LIN

LIN is a simple automotive fieldbus to connect for example simple
sensors and actuators to an electronic control unit.
2021-07-14 09:31:06 +00:00
Guy Harris cc36b74139 pcapng: shuffle functions that process various option types.
Define them in the order in which wiretap/wtap_opttypes.h defines the
corresponding enum values for wtap_opttype_e.
2021-07-14 01:01:27 -07:00
Guy Harris 7b0c4950a5 wiretap: clean up option definitions a bit.
Spell out "DESCRIPTION" for the IDB description option, as it's spelled
out in the pcapng spec.

Put the #defines for various options in the same order as the block
types for them are in the pcapng spec.
2021-07-14 06:55:12 +00:00
Chuck Craft b531a6aa61 WSUG: rpcapd not included with npcap
Open issues at npcap to support rpcap client and server:
https://github.com/nmap/npcap/issues/312
https://github.com/nmap/npcap/issues/74
2021-07-14 06:35:54 +00:00
David Perry 0c6d1216fe Rework how comments show in edit menu
Addresses [this issue][1] reported with the revised comment editing UI,
wherein comments with embedded newlines may not appear properly in the
menu.

[1]: https://gitlab.com/wireshark/wireshark/-/merge_requests/2859#note_621024711
2021-07-14 04:55:06 +00:00
David Perry 67b54e8b66 tshark: allow --capture-comment when reading a file
Allows adding one or more capture comments to a new pcapng file when
tshark is reading from a file. Currently, tshark only allows setting one
capture comment, and that only when doing a live capture.

The use case for this feature is given in bug #15005.
I decided to allow multiple capture comments to match the same ability
in `editcap`.

To allow this change, I changed the function signature of
`process_cap_file()` so it takes a `capture_options` struct instead of
individual parameters that affect the capture.
2021-07-14 04:34:52 +00:00
Gerald Combs ff60fcf92d CMake: Adjust wsutil includes and linking.
Mark wsutil's includes SYSTEM PRIVATE. This exposed a lot of targets
that were indirectly picking up include paths via the wsutil target, so
add direct includes where needed. The G.722 and G.726 codecs were
implicilty including tiffio.h; find it explicitly instead.

Mark some of wsutil's libraries PRIVATE, but leave commonly-used ones
PUBLIC.

Ping #17477.
2021-07-14 03:56:05 +00:00
Gerald Combs 9ae60d8483 GitLab CI: Don't print a performance summary on Windows.
In the Windows merge request build job, don't pass
/consoleloggerparameters:PerformanceSummary;NoSummary to msbuild. It
makes the output more verbose and in turn makes errors more difficult to
find.
2021-07-14 00:48:46 +00:00
Guy Harris 23f19e4a5d wiretap: iptrace/Sniffer/Peek classic always have packet flags.
For iptrace files, there's always a direction indication (which also
means that the flags field will never be zero - "outbound" and "inbound"
both have non-zero values - so the test for non-zero always succeeds, so
it's not even a useful test).

For Sniffer Ethernet/FDDI/synchronous serial line files, and for Peek
classic files, there are always flags; they might be zero if there were
no errors, but that doesn't mean that the lack of errors shouldn't be
noted with a flags field.

While we're at it, shuffle creating of the block next to the setting of
the record type - the block and record type should match, so the two
operations are doing related things.
2021-07-14 00:31:03 +00:00
Gerald Combs 9c344b207d CMake: Fix nullability warnings for the version_info target.
Add "SYSTEM" to "target_include_directories(version_info ...", which
keeps

```
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/_stdio.h:93:16: warning: pointer is missing a nullability type specifier (_Nonnull, _Nullable, or _Null_unspecified) [-Wnullability-completeness]
        unsigned char   *_base;
                        ^
```

from being printed here.
2021-07-13 23:56:42 +00:00
Chuck Craft a7d927a9e9 prefs_register_protocol_obsolete protocols with only obsolete prefs
Related to #17465 and !3526
2021-07-13 23:12:04 +00:00
bookding 175d75aa03 MySQL: Add support for session track gitds & transaction info 2021-07-13 21:43:41 +00:00
Martin Mathieson eb2015a373 DCT2000: Support a format for MAC-NR PDUs inside comment lines 2021-07-13 17:22:01 +01:00
Richard Sharpe 893ec461f2 ieee80211: Correctly handle trigger frames when there is no padding. 2021-07-13 07:10:15 -07:00
Dr. Lars Völker e8ceb9964c DoIP: Adding name resolution for Diagnostic Addresses (UAT)
This patch will add name resolution to the Diagnostic Addresses of
DoIP by using an UAT based table.
2021-07-13 09:25:16 +00:00
Dr. Lars Völker b82ef729aa TECMP: Adding name resolution for Channel IDs 2021-07-13 09:08:38 +00:00
Taisuke Sasaki 20785aed78 ISIS: Add Flexible Algorithm (draft-ietf-lsr-flex-algo-16)
- Add Flexible Algorithm Definition Sub-TLV
- Add IS-IS Application-Specific Link Attributes (rfc8919)
- Add Extended Administrative Groups Sub-TLV (rfc7308)
2021-07-13 08:49:06 +00:00
Anders Broman 1d590a8c4d ppcap: Remove unused preference code
These preferences has been obsoleted for a long time so let's get rid of
the code.
2021-07-13 07:43:07 +00:00
Uli Heilmeier 3413daad58 Multipart: Add option to uncompress data
Add an option to uncompress gzip:ed data.

Fixes: wireshark/wireshark#17471
2021-07-13 07:27:15 +00:00
Alexander Aring f9037e6537 packet-dlm3: update dissector for version 3.2
This patch updates the dlm3 dissector for version 3.2 which are
currently prepared for sending Linux upstream. The dlm dissector follows
the Linux implementation. There is no other protocol specification.

For the specific protocol changes see:

https://git.kernel.org/pub/scm/linux/kernel/git/teigland/linux-dlm.git/commit/?h=next&id=489d8e559c6596eb08e16447d9830bc39afbe54e
2021-07-13 07:10:48 +00:00
Alexander Aring 456c74cb1f packet-dlm3: dissect pdus for tcp case
Currently there can be multiple dlm messages in one tcp segment and in
some cases dlm message can be overlapped between two segments. The main
fix would be that we can now dissect multiple dlm messages if they
appear in one tcp segment. It's still own as one message in the "packet
flow" but in tree view it will be displayed as multiple messages which
are not visible.

For sctp the problem still exists, although there can't be overlapped messages.
2021-07-13 07:10:48 +00:00
Developer Alexander 69fb2a17e4 lua: dialog with prefilled values
new_dialog() lua api gets extended to enable that dialog fields can be
prefilled by lua scripts instead of always starting empty.
2021-07-13 06:52:55 +00:00
Arkady Gilinsky 054868cb0e oampdu: Fix DPoE get request parsing 2021-07-13 06:51:15 +00:00
Guy Harris fa9ee0f37a pcapng: process OPT_COMMENT in pcapng_process_options().
That option applies to all pcapng blocks, so handle it in common code.
2021-07-12 18:06:38 -07:00
Gerald Combs 4e5c892402 [Automatic update for 2021-07-11]
Update manuf, services enterprise numbers, translations, and other items.
2021-07-12 22:06:44 +00:00
Gerald Combs 077b787413 etwdump: Fixup our rec struct syntax.
Fix

```
C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\extcap\etl.c(590,10): error C2232: '->block': left operand has 'struct' type, use '.' [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\extcap\etwdump.vcxproj]
C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\extcap\etl.c(590,10): error C2232:     rec->block = wtap_block_create(WTAP_BLOCK_PACKET); [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\extcap\etwdump.vcxproj]
C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\extcap\etl.c(590,10): error C2232:          ^ [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\extcap\etwdump.vcxproj]
C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\extcap\etl.c(591,39): error C2232: '->block': left operand has 'struct' type, use '.' [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\extcap\etwdump.vcxproj]
C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\extcap\etl.c(591,39): error C2232:                                       ^ [C:\gitlab-builds\builds\-fyeYoMP\0\wireshark\wireshark\build\extcap\etwdump.vcxproj]
```
2021-07-12 14:40:21 -07:00
David Perry 06ed6930dc Carry EPB flags as an option on the packet block
As requested by [this comment][1] on !2859, move `pack_flags` from a
dedicated field in `wtap_rec` to a block option on the packet block in
`wtap_rec.block`.

[1]: https://gitlab.com/wireshark/wireshark/-/merge_requests/2859#note_615984624
2021-07-12 12:41:57 -04:00
Martin Mathieson 86e2fda11e check_typed_item_calls: fix typo 2021-07-11 17:15:44 +01:00
Martin Mathieson 030d659f88 More mask checks and some fixes. 2021-07-11 14:55:55 +00:00
João Valverde 89acb935bc wsutil: Start adding a test suite 2021-07-11 14:39:13 +00:00
João Valverde 396d560744 wsutil: Revert some changes to format_size()
Revert change to format_size() added in
f509a83381. This commit broke formatting
with spaces and introduced some dead code.

Also replace unnecessary call to format_size_wmem() and remove
unnecessary casts (since our warning settings were fixed in the
mean time).
2021-07-11 14:39:13 +00:00
Guy Harris c4731738fc sharkd: various cleanups.
Extend sharkd_dissect_request() so that it can replace
sharkd_dissect_columns().

Have it return a status indicating success, invalid frame number, or
read error, so that the caller knows what the problem is.

Pass it pointers to the wtap_rec and Buffer to use when reading packets
from the file, so that if it's called in a loop iterating over all
frames, those structures can be initialized once, before the loop, and
cleaned up once, after the loop, rather than doing both once per loop
iteration.

Pass pointers to the read error code and additional read error
information string pointer, so that, on a file read error, that
information is available to the caller.

Get rid of sharkd_dissect_columns(); instead, use
sharkd_dissect_request(), with code from the loop body pulled into a
callback routine.  Fix that code to correctly determine whether the
current frame has any comments, rather than just treating all frames
that have blocks as having comments.

Use _U_ to mark arguments as unused, rather than throwing in a

	(void) variablename;

statement.

Move some variables used only within a loop into the for() statement or
the loop body.
2021-07-11 03:06:10 -07:00