Commit Graph

80049 Commits

Author SHA1 Message Date
João Valverde e20ca8e9e8 tests: skip plugin count test if feature is disabled 2021-02-26 15:57:10 +00:00
Thomas Dreibholz 404f619ea2 Added decoding of ProtocolID and PPID into Component Status Protocol dissector.
This merge request adds:
* Decoding of ProtocolID and PPID in Component Status Protocol dissector.
* Moved SCTP PPID list from SCTP dissector into separate file sctpppids.c,
  due to reuse in Component Status Protocol dissector.
* Export of sctpppid_val_ext containing the PPID list.
2021-02-26 15:31:44 +00:00
Martin Kaiser 12edf427ab dvb-ci: clean up the protocol column for mime files
Some DVB-CI messages contain a file that can be dissected by the mime-encap
dissector. mime-encap adds itself to the protocol column. We already set a
fence, but things still look messy:

DVB-CIMIME_FILE

This patch adds ", " before the fence and "Data" afterwards. If mime-encap
is enabled, it'll overwrite the Data with its protocol name

DVB-CI, MIME_FILE

If mime-encap is disabled, the embedded file will be handled by the data
dissector, who doesn't touch the protocol column. So we keep

DVB-CI, Data
2021-02-25 22:22:02 +01:00
Gerald Combs eceff254b6 Docs: Recommend EditorConfig.
Note that we use EditorConfig in the WSDG and README.developer, and that
you should make sure your editor uses it. Recommend 4 space indentation
more strongly. Ping #17253.

Reorder and reword the coding style sections of each document while
we're here.
2021-02-25 09:37:49 -08:00
Anders Broman 8ccbdb786a Add support for SRVName SAN extension for TLS certificates
Closes #17256
2021-02-25 10:21:24 +01:00
Nardi Ivan e2ee14ae03 GQUIC: add support for some missing tags
Fix decoding of VER tag
2021-02-25 08:28:07 +00:00
Joerg Mayer 92b3edd798 macos-setup.sh: Starting with major 11, the minor SDK version no longer matters 2021-02-25 07:09:54 +00:00
Prashant Tripathi 525ad67066 The latest power profile C37.237-2017 has IEEE_C37_238 TLV different
from the earlier version C37.237-2011. The previous version of this
standard, IEEE Std C37.238-2011, separated grandmaster time inaccuracy
and what was then called NetworkTimeInaccuracy into two fields. The
first, grandmasterTimeInaccuracy, was located immediately before
totalTimeInaccuracy in this version (now a reserved field). The second,
networkTimeInaccuracy, was located where totalTimeInaccuracy is now
found.
2021-02-25 06:23:21 +00:00
Guy Harris 7665075241 wiretap: make WTAP_FILE_TYPE_SUBTYPE_UNKNOWN -1 rather than an index.
And get rid of the entry for that type in the table of type/subtypes.
2021-02-24 17:30:47 -08:00
Michele Mazzante 715fc20a92 Update packet-mux27010.c following the correct interpretation of the EA bit from the specs https://www.3gpp.org/ftp/tsg_t/tsg_t/tsgt_04/docs/pdfs/TP-99119.pdf where it is described the case of info field bigger than 127 bytes:
* the first octet stores the first 7 LSB bits
 * the second octet stores the other 8 MSB bits (see pg. 18).
2021-02-24 12:53:25 +00:00
Guy Harris 9191746670 wiretap: add a block type for systemd journal entries.
Those are used by more than one file type, so we should provide a block
type for them.  (We don't *currently* use that block type, or the packet
block type, but this makes them available for future use.)
2021-02-24 03:09:03 -08:00
Guy Harris 7ffc11e38f wiretap: add some additional bounds checks for file type/subtype values.
Check to make sure the value is non-negative and less than the number of
file type/subtypes.

Make it clearer than one check is unnecessary:

* pull wtap_dump_open_check() into wtap_dump_init_dumper(), so it's
clear that wtap_dump_init_dumper() ensures the validity of the file
type/subtype value early on (wtap_dump_can_open() fails if it's not
valid);

* pull wtap_dump_alloc_wdh() into wtap_dump_init_dumper(), so that the
allocation and all the initialiation is done there - that makes it clear
that it sets the file_type_subtype member of the wtap_dumper structure
before wtap_dump_init_dumper() returns;

* have wtap_dump_open_finish() use that value rather than being passed
the type/subtype value explicitly, so it's clear that it's dealing with
a validated value.
2021-02-24 10:36:05 +00:00
Jonathan Nieder 23e6b32855 git: show expert info for unrecognized special packet 0003
In Git protocol, a pkt-line consists of a 4-hexdigit pkt-length,
followed by several bytes of pkt-data.  The pkt-length represents the
length of the entire pkt-line including the length field, so for an
ordinary pkt-line the length is always >= 4.  This allows the protocol
to use values less than 4 as special values --- for example, 0000 is a
so-called flush-pkt, representing the end of a command.

There's one particular pkt-length value that should never appear: 0003
is not >= 4 and is not a flush-pkt, delim-pkt, or response-end-pkt, so
it is not permitted in Git protocol.  Currently the dissector handles
this case by returning length 0 so it doesn't show up in wireshark as
Git protocol.  Better to treat it as Git protocol and add expert-info
describing what is wrong in case it shows up in a corrupt capture.

Part of #17093.  Based on a hint from Pascal Quantin at [1].

[1] https://gitlab.com/wireshark/wireshark/-/merge_requests/1946#note_515567051
2021-02-24 08:37:16 +00:00
Preston Hunt a3f1408649 IEEE 802.11: Extend RSNX to dissect octet 2
Refactor existing code to use a similar approach to dissecting as is
used for Extended Capabilities.
2021-02-24 07:49:00 +00:00
Nardi Ivan 7fd7153696 GQUIC: add decoding of CGST tag
Regression introduced by b287e7165e.

To avoid an infinite loop with malformed packets, that commit stops
parsing the tags list after finding an unknown tag.
When this "unknown" tag is perfectly valid but not supported by
Wireshark, we don't decode any subsequent (valid) tags anymore.

GQUIC is going to die soon and it is quite unlikely it will change in
the next future. Therefore the best/quick solution is simply decoding
any valid tag.

Close #17250
2021-02-24 06:22:14 +00:00
Guy Harris ed86f51e49 wiretap: rename wtap_register_file_type_subtypes().
It only registers one file type/subtype, so rename it to
wtap_register_file_type_subtype().

That will also force plugins to be recompiled; that will produce compile
errors for some plugins that didn't change to match the new contents of
the file_type_subtype_info structure.

Also check to make sure that the registered file type/subtype supports
at least one type of block; a file type/subtype that doesn't return
*any* blocks and doesn't permit *any* block types to be written is not
very useful.  That should also catch most if not all other plugins that
didn't change to match the new contents of the file_type_subtype_info
structure.

Don't make errors registering a file type/subtype fatal; just complain,
don't register the bogus file type/subtype, and drive on.
2021-02-23 20:39:16 -08:00
Guy Harris 4cdc6ee573 exp_pdu_open: swap two arguments.
The second argument is the file type/subtype, and the third argument is
the file descriptor, according to the function declaration and all the
calls to it.  Make it so in the function definition.

Fixes Coverity CIDs 1473314 and 1473312.
2021-02-23 18:38:53 -08:00
Guy Harris 0e301fba78 usbdump: update struct file_type_subtype_info.
Update this to match the new layout of that structure, providing a list
of supported packets.
2021-02-23 16:59:44 -08:00
Guy Harris 166159f15d wiretap: eliminate the pcap/nspcap/pcapng WTAP_FILE_TYPE_SUBTYPE_ values.
Register the pcap and pcapng file types/subtypes rather than hardwiring
them into the table.

Call the registration routines for them directly, rather than through a
generated table; they're always supposed to be there, as some code in
Wireshark either writes only one of those formats or defaults to writing
one of those formats.  Don't run their source code through the
registration-routine-finder script.

Have the file type/subtype codes for them be directly exported to the
libwiretap core, and provide routines to return each of them, to be used
by the aforementioned code.

When reporting errors with cfile_write_failure_message(), use
wtap_dump_file_type_subtype() to get the file type/subtype value for the
wtap_dumper to which we're writing, rather than hardcoding it.

Have the "export PDU" code capable of supporting arbitrary file
types/subtypes, although we currently only use pcapng.

Get rid of declarations of now-static can_write_encap and
dump_open routines in various headers.
2021-02-23 21:56:20 +00:00
Jonathan Nieder 3742f921b2 git: read pkt-line length from specified offset
dissect_pkt_line takes an `offset` parameter (passed by reference) to
allow parsing multiple pkt-lines from a single tvbuff.  Currently the
only caller passes an offset of 0, so reading from `0` happens to do
the right thing, but that is about to change when [1] adds support for
dissecting multiple pkt-lines in a buffered HTTP request or response.

Part of #17093.  Noticed by Joey Salazar and explained by Pascal
Quantin.

[1] https://gitlab.com/wireshark/wireshark/-/merge_requests/1946
2021-02-23 21:35:11 +00:00
Alex Nik ef61fd4638 added description for UDP Multicast Streams
fixed UDP Multicast Streams title and also crossref in WSUG_chapter_use.adoc table

applied SME suggestions

minor fixes
2021-02-23 21:14:36 +00:00
Alex Nik c3ec4f52ce added description for the Flow Graph window + screenshot
added SME suggestions

minor fixes

minor fixes

applied SME suggestions
2021-02-23 20:55:00 +00:00
Joerg Mayer 30d14386b4 radius dict aerohive: Add comment about attr 212 (ap mgmt mac) 2021-02-23 20:27:05 +00:00
Joerg Mayer fe4555c3c1 Extremenetwork/Avaya/Lucent/Baynetworks/Wellfleet specific protocol updates 2021-02-23 20:01:13 +00:00
Joerg Mayer aae669118e packet-srt.c: Add link to some network protocol description 2021-02-23 15:43:14 +01:00
Joerg Mayer ba196f550d packet-tftp.c: Fix an incorrect value in a comment. 2021-02-23 14:54:44 +01:00
Martin Mathieson ea7131cee0 Make a couple of dissector vars static.
These are the very last ones that are not mentioned in header files.
2021-02-23 09:33:49 +00:00
Pascal Quantin 20720c8441 MBIM: fix some signedness warnings 2021-02-23 09:34:36 +01:00
Odysseus Yang cf14578c61 MBIM: dissect the commands of MBIM extended version 3.0
MBIM_CID_MS_DEVICE_CAP_V2
MBIM_CID_SUBSCRIBER_READY_STATUS
MBIM_CID_PACKET_SERVICE
MBIM_CID_CONNECT
MBIM_CID_IP_PACKET_FILTERS
MBIM_CID_MS_MODEM_CONFIG
MBIM_CID_MS_REGISTRATION_PARAMS
MBIM_CID_WAKE_REASON
2021-02-23 07:36:12 +00:00
Guy Harris bc3cc17bc4 Lua: add routines to return pcap/nsec pcap/pcapng file type/subtypes.
These will be backported, for the benefit of Lua scripts that want those
specific file types/subtypes (typically in order to write files of those
types); that allows those types to be fetched without having to know the
right string to hand to wslua_wtap_name_to_file_type_subtype().
2021-02-22 22:23:54 -08:00
Grzegorz Niemirowski 69ca16bdf0 ZVT: Dissect list of permitted ZVT commands 2021-02-22 21:28:55 +00:00
Guy Harris d50f712a85 wiretap: fix use of wrong index as array subscript.
"i" and "j" are too similar, so it's easy to use the wrong one if you're
using both as array indices and not easy enough to notice the mistake.

Use somewhat more meaningful names when we fix the index.

Fixes #17252.
2021-02-22 12:55:35 -08:00
Guy Harris 00d2661459 wiretap: fix dependency in CMakeLists.txt.
wtap_modules.c depends on ${WIRETAP_MODULE_FILES} rather than
${WIRETAP_NONGENERATED_FILES}.
2021-02-22 19:45:44 +00:00
Thomas Dreibholz 3a25ebbc42 Updated broken URL in headers. 2021-02-22 18:18:45 +00:00
Anders Broman 614df91e23 RTCP detect non zero padding and dont dissect zero length 2021-02-22 17:03:03 +00:00
Anders Broman d5d26679fc ZVT: Use g_ascii_strtoll instead of atol. 2021-02-22 17:03:31 +01:00
Thomas Dreibholz 2e7f2ffb7a
Added "Follow DCCP stream" feature.
This pull request includes:
* The "Follow DCCP stream" feature.
* Updated docbook documentation for the "Follow DCCP stream" feature.
* Test for the feature.
* Corresponding packet trace for the test.
2021-02-22 12:48:46 +01:00
Grzegorz Niemirowski a57a32c04e ZVT: Addedd dissection of amount, terminal ID, date and time. Registration fix. 2021-02-22 10:39:54 +01:00
Darius Davis f895014f68 reassemble: Improve perf of free_all_reassembled_fragments.
When we're walking the list of fragments to free, if we encounter
FD_VISITED_FREE, we can conclude traversal of this fragment list immediately
(and go to the next hash bucket), since everything subsequent to this point in
the list has already been processed by free_all_reassembled_fragments.  This
trims an O(n^2) hash table iteration down to O(n).

Before this change, a very ugly 1.1 GByte TFTP capture (with lots of
out-of-order and retransmitted blocks) takes 4 hours to process with
tftp.defragment=TRUE -- output completes after 1.25 hours, and then about
2.75 hours of time is spent doing repeated list traversals within
free_all_reassembled_fragments...(!)  With this change, the same test completes
in 1.25 hours, with the cleanup taking just 71 msec.

Tested also with reassemble_test under Valgrind; No issues/leaks were reported.
2021-02-22 17:00:54 +10:00
Thomas Dreibholz 297246093b Small FGP dissector improvement 2021-02-22 06:38:44 +00:00
Guy Harris 842a7cccf9 wiretap: have file handlers advertise blocks and options supported.
Instead of a "supports name resolution" Boolean and bitflags for types of
comments supported, provide a list of block types that the file
type/subtype supports, with each block type having a list of options
supported.  Indicate whether "supported" means "one instance" or
"multiple instances".

"Supports" doesn't just mean "can be written", it also means "could be
read".

Rename WTAP_BLOCK_IF_DESCRIPTION to WTAP_BLOCK_IF_ID_AND_INFO, to
indicate that it provides, in addition to information about the
interface, an ID (implicitly, in pcapng files, by its ordinal number)
that is associated with every packet in the file.  Emphasize that in
comments - just because your capture file format can list the interfaces
on which a capture was done, that doesn't mean it supports this; it
doesn't do so if the file doesn't indicate, for every packet, on which
of those interfaces it was captured (I'm looking at *you*, Microsoft
Network Monitor...).

Use APIs to query that information to do what the "does this file
type/subtype support name resolution information", "does this file
type/subtype support all of these comment types", and "does this file
type/subtype support - and require - interface IDs" APIs did.

Provide backwards compatibility for Lua.

This allows us to eliminate the WTAP_FILE_TYPE_SUBTYPE_ values for IBM's
iptrace; do so.
2021-02-21 23:18:35 +00:00
Gerald Combs b8ce02e6fb editcap: Fixup our help output.
Make sure list_capture_types prints to the designated stream so that
tools/update-tools-help.py works correctly for `editcap -F`.
2021-02-21 22:57:13 +00:00
Gerald Combs b9bdce8484 NetPerfMeter: Fix compilation on Windows.
Use guint64 instead of u_int64_t. GLib might make it easier to use
standard types at some point[1] but they haven't yet. Make our offsets
unsigned.

[1]https://gitlab.gnome.org/GNOME/glib/-/issues/1484
2021-02-21 12:57:15 -08:00
Thomas Dreibholz dc3e92f638
Added NetPerfMeter test suite. 2021-02-21 18:23:48 +01:00
Thomas Dreibholz 2fe740c00d
Removed unnecessary check for transport protocol. 2021-02-21 16:45:11 +01:00
Thomas Dreibholz cdbbf5d384 Decode time stamp field to the actual UTC time. 2021-02-21 13:57:04 +00:00
Thomas Dreibholz 115472aaf8 Now using heuristic dissector for transport over TCP, UDP and DCCP instead of port number range. 2021-02-21 13:57:04 +00:00
Thomas Dreibholz 6f6537dfba Fixed typo. 2021-02-21 13:57:04 +00:00
Thomas Dreibholz 6737430111 Added NetPerfMeter test trace. 2021-02-21 13:57:04 +00:00
Thomas Dreibholz 77343db1fe Improved NetPerfMeterProtocol dissector with detection of protocol for TCP, UDP and DCCP by payload inspection. 2021-02-21 13:57:04 +00:00