Commit Graph

786 Commits

Author SHA1 Message Date
Balint Reczey ba4bec7d09 debian: Report upstream and package version instead of git revision 2021-10-10 19:26:17 +00:00
Balint Reczey 6617c7fc5d debian/rules: Don't pass --parallel to dh, it is the default now 2021-10-10 19:26:17 +00:00
Balint Reczey a1d964fa1c debian/rules: Turn on BUILD_corbaidl2wrs to ship idl2wrs man page 2021-10-10 19:26:17 +00:00
Balint Reczey a9c1d1ac9e debian: Bump compat level to 12 keeping backports in mind 2021-10-10 19:26:17 +00:00
Balint Reczey d87bc0d74d debian/control: Drop Conflists: and Replaces: referring to very old versions 2021-10-10 19:26:17 +00:00
Balint Reczey d74afba1f1 debian: Make wireshark depend on the same version of wireshark-qt 2021-10-10 19:26:17 +00:00
Balint Reczey aed6c130b9 debian/copyright: Fix typo and remove patterns for removed files 2021-10-10 19:26:17 +00:00
Brian Sipos ce0592514c BPv7: Add Bundle Protocol version 7 and BPSec dissectors from dtn-wireshark 2021-10-10 13:27:17 +00:00
Gerald Combs 0c4d4f6835 Version: 3.5.1 → 3.7.0
[skip ci]
2021-10-07 14:27:38 -07:00
Brian Sipos bc3bced07d COSE: Handle indefinite tstr/bstr encodings 2021-10-05 21:11:36 +00:00
Stig Bjørlykke 96cfaf67a3 Qt: Reload Lua FileHandler when having a capture file
Support reloading a Lua FileHandler when this is in use for a
loaded capture file. Prompt to save the file if having unsaved
changes because the file must be reloaded.

Fixes #17615
2021-09-30 11:07:08 +00:00
Brian Sipos abd0f1183f COSE dissector from dtn-wireshark project 2021-09-29 08:51:13 +00:00
Tomasz Moń 7b82110092 USB HID: Parse bit fields with correct bit order
Implement little endian support for tvb_get_bits family of functions.
The big/little endian refers to bit numbering within an octet. In big
endian, the most significant bit is considered bit 0, while in little
endian the least significant bit is considered bit 0.

Add encoding parameters to proto tree bits format family functions.
Specify ENC_BIG_ENDIAN in all dissectors using these functions except in
USB HID that requires ENC_LITTLE_ENDIAN to work correctly.

When formatting bits values, always display most significant bit on the
leftmost position regardless of the encoding. This results in no gaps
between octets and makes the displayed value comprehensible.

Close #4478
Fix #17014
2021-09-26 18:16:28 +02:00
Stig Bjørlykke 533d859499 Qt: Register import_hexdump.json as a profile file
Profile files which is only used in Qt is not automatically registered
during startup and must be explicit registered.

Add profile_register_persconffile() to handle this registration.
2021-09-21 18:20:34 +00:00
João Valverde a34a234cf2 wslog: Add ws_log_buffer()
Use the new API with dot11decrypt debug.
2021-09-18 10:59:10 +01:00
João Valverde 8df2a73594 Use the musl in-tree getopt_long() everywhere
Besides the obvious limitation of being unavailable on Windows,
the standard is vague about getopt() and getopt_long() has many
non-portable pitfalls and buggy implementations, that increase
the maintainance cost a lot. Also the GNU libc code currently
in the tree is not suited for embedding and is unmaintainable.

Own maintainership for getopt_long() and use the musl implementation
everywhere. This way we don't need to worry if optreset is available,
or if the $OPERATING_SYSTEM version behaves in subtly different ways.

The API is under the Wireshark namespace to avoid conflicts with
system headers.

Side-note, the Mingw-w64 9.0 getopt_long() implementation is buggy
with opterr and known to crash. In my experience it's a headache to
use the embedded getopt implementation if the system provides one.
2021-09-17 00:43:54 +01:00
João Valverde 36a2606064 Debian: Fix symbols 2021-09-17 00:08:41 +01:00
João Valverde 8208c68b49 Debian: Add missing wsutil symbols 2021-09-16 18:23:47 +01:00
João Valverde 0019723b14 Debian: Add missing wsutil symbols 2021-09-16 15:53:15 +00:00
Developer Alexander 03480fd6e1 epan: export epan_set_always_visible()
Exports (DLL) epan_set_always_visible() to make it accessible for plugins.

This enables post dissection taps to access all fields.
2021-09-08 14:40:24 +00:00
Evan Huus 6caf24e966 tvblist: explicitly scope memory
Allocate the root node in the same pool as the list itself, and make
that pool explicit so we can pass the pinfo scope instead of using the
global packet pool.
2021-09-08 01:37:07 +00:00
Evan Huus cdfab0d6e9 tvbuff: convert helper methods to pinfo->pool
A few of them just needed scratch memory, so allocate and free it
manually after doing any exception-raising checks.

A few others were returning memory, and needed conversion to accept a
wmem scope argument.
2021-09-01 03:54:52 +00:00
Guy Harris 030b06ba3c pcapng: write packet and Netflix custom blocks the same as other blocks.
Use compute_options_size() to get the total size of all the options, and
use write_options() to write out the options for those blocks, as we do
for other blocks.

Get rid of wtap_block_option_get_value_size() and
wtap_block_get_options_size_padded(); they're no longer needed, and
their notion of an option's "size" is "size in a pcapng file", so that
doesn't belong in code that's intended to support all file types.
2021-08-30 16:29:04 -07:00
Gerald Combs f51b018f87 Version: 3.5.0 → 3.5.1. 2021-08-27 21:40:12 +00:00
Guy Harris 8acd0d1151 pcapng: export routines to do the option-section processing.
That way, add-on modules to handle block types not handled by the core
pcapng code can use pcap_process_options() to process a block's options
and can use the routines to handle the "standard" option value types to
handle particular options.

Also, allow both everything-is-little-endian and
everything-is-big-endian Custom Block types in pcap_process_options().
2021-08-27 06:48:47 +00:00
Triton Circonflexe d4de52690f Thrift: Complete handling of Binary & Compact protocols
- Make sure reassembly requests & errors are properly propagated from
  any point in the PDU, no matter how many sub-structure levels.
- Handle the sub-dissection methods as well:
  - Ensure the sub-dissection methods handle errors from previous calls.
  - Reduce the error handling needed in sub-dissector implementations.
  - Add missing sub-dissection methods for list, set, and map.
  - Add the handling of sub-structure.
- Handle Compact protocol in addition to the existing binary protocol.
  - Include and improve MR !3171
  - Handle reassembly the same way as for binary protocol.
  - Handle sub-dissection with the same functions.
    => Sub-dissectors only depend on .thrift files.

Additional changes:
- Use of constants instead of hard-coded values.
- Removed U64 support (never supported by thrift code generator, only
  referenced in the C++ thrift library header but not supported in reality.
- Removed references to UTF-8 and UTF-16 string for the same reason.
- Replaced references to UTF-7 string with just string (same reason).
- Replaced references to byte with i8 as the documentation explicitly
  states that byte is a compatibility name.

Documentation reference:
- https://thrift.apache.org/developers
- https://thrift.apache.org/docs/idl.html
- https://github.com/apache/thrift/blob/master/doc/specs/thrift-compact-protocol.md
- https://erikvanoosten.github.io/thrift-missing-specification/
- https://diwakergupta.github.io/thrift-missing-guide/

Closes #16244

Additional changes:
- Add authors and improve consistency
- Fix typo and clarify documentation
2021-08-27 06:04:17 +00:00
Michael Tuexen b17f354304 Add initial support for BBLog files 2021-08-27 04:48:21 +02:00
David Perry 6e12643f19 [#17478] free blocks in more places
Bug 17478 was caused by `wtap_rec.block` being allocated for each
packet, but not freed when it was done being used -- typically at the
end of a loop.

Rather than requiring each caller of `wtap_read()` to know to free a
member of `rec`, I added a new function `wtap_rec_reset()` for a
slightly cleaner API. Added calls to it everywhere that seemed to make
sense.

Fixes #17478
2021-08-10 00:08:15 +00:00
João Valverde 0693674494 wslog: Add function to log directly without filtering
Used to write custom logging functions.
2021-07-29 20:17:44 +01:00
João Valverde 7b845e7194 wsutil: rename bytestring_to_str() -> bytes_to_str_punct() 2021-07-29 17:23:05 +00:00
João Valverde f0b02dd0ff wsutil: Add max length argument to bytes_to_str() 2021-07-29 17:23:04 +00:00
João Valverde c3bd5c9d91 Move bytes_to_str() to wsutil
This utility function is useful outside of epan. Move it to wsutil
and export the interface.

The move isn't completely clean as it requires duplicating two small
inline functions but that was necessary to avoiding moving too much at
once.
2021-07-29 17:23:04 +00:00
Gerald Combs 62c7734e64 Debian: Fixup our symbols.
wmem_epan_scope wmem_file_scope, and wmem_packet_scope are still in
epan.
2021-07-28 10:17:17 -07:00
João Valverde 925e01b23f Remove duplicate format_size() function
We have two format_size()s, with and without wmem scoped memory.
Move the wmem version to wsutil and add a convenience macro to
use g_malloc()ed memory.
2021-07-26 14:56:11 +00:00
João Valverde 133b0c583f Move epan/wmem/wmem_scopes.h to epan/
This header was installed incorrectly to epan/wmem_scopes.h.

Instead of creating additional installation rules for a single
header in a subfolder (kept for backward compatibility) just
rename the standard "epan/wmem/wmem.h" include to
"epan/wmem_scopes.h" and fix the documentation.

Now the header is installed *correctly* to epan/wmem_scopes.h.
2021-07-26 14:56:11 +00:00
João Valverde 7f9c1f5f92 Move wmem to wsutil
This allows wmem to be used from other libraries, namely wsutil.
It is often the case that a funtion exists in wsutil and cannot
be used with a wmem scope, requiring some code duplication or
extra memory allocations, or vice-versa, code in epan cannot be
moved to wsutil because it has a wmem dependency.

To this end wmem is moved to wsutil. Scope management remains part
of epan because those scope semantics are specific to dissection.
2021-07-26 14:56:11 +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
Guy Harris dd5907d2a3 Consistently refer to blocks that have been modified as "modified".
"User" sounds as if the blocks belong to the user; at most, the current
user might have modified them directly, but they might also have, for
example, run a Lua script that, unknown to them, modified comments.
Also, a file might have "user comments" added by a previous user, who
them wrote the file and and provided it to the current user.

"Modified" seems a bit clearer than "changed".
2021-07-08 00:05:35 -07:00
David Perry 73087d6fb4 Use wtap_blocks for packet comments
Mostly functioning proof of concept for #14329. This work is intended to
allow Wireshark to support multiple packet comments per packet.

Uses and expands upon the `wtap_block` API in `wiretap/wtap_opttypes.h`.
It attaches a `wtap_block` structure to `wtap_rec` in place of its
current `opt_comment` and `packet_verdict` members to hold OPT_COMMENT
and OPT_PKT_VERDICT option values.
2021-07-07 18:40:24 +00:00
Nardi Ivan c2d77d910d QUIC: improve "Follow QUIC Stream" support
This functionality has been added in d2a660d8, where its limitations
are described.
Improvements:
* the Substream index menu now properly filters for available stream numbers;
* Follow Stream selects the first stream in the current packet

Known issue (which is still there):  if a packet contains multiple QUIC
streams, then we will show data also from streams other than the selected
one (see #16093)

Note that there is no way to follow a QUIC connection.

Close #17453
2021-07-07 13:08:19 +00:00
Nardi Ivan a6932f56dc wmem: add a GCompareFunc implementation to compare unsigned integer 64 bits long 2021-07-07 13:08:19 +00:00
João Valverde c6a920686c wslog: Check environment initialization for errors
Initialiaze the cmdarg error stream earlier.

Dumpcap also needs to know earlier if it is running in capture
child mode.
2021-06-26 00:18:26 +01:00
João Valverde 7aae691f7d wsutil: Rewrite ws_assert() to minimize dependencies
This includes as little as possible in the assertion header, so
that it can be included globally in every file without pulling
any unwanted definitions. In particular pulling stdlib.h is
avoided because that can have side effects if it wants to
include non-portable extensions.

It is possible to have side-effects from include glib.h too, for
example because of G_LOG_DOMAIN.

These side-effects are usually avoidable with careful ordering
of pre-processor directives but with multiple levels of indirections
it can be hard to track. Better to make it robust to these kinds
of failures in the first place.

Also integrate with our logger for a cohesive experience (but
keep it a private dependency).
2021-06-25 22:06:32 +00:00
Michael Tuexen 1f0a16e472 pcapng: add support for custom options 2021-06-23 04:38:27 +00:00
Pascal Quantin 3ea51dba87 NGAP: fix dissection of multiple NGAP messages in the same HTTP2 packet
Also add dissection for more containers
2021-06-21 13:33:55 +00:00
João Valverde 7dea683bf1 wslog: Shorten ws_log_message_is_active() name 2021-06-21 00:07:21 +00:00
João Valverde a6738d72a0 wslog: Add support for inverted debug matches
The --log-debug and --log-noisy now accepts a '!' to invert the
match and disable the debug (noisy respectively) log level for
the listed domains.

Note this is different from --log-domains, that option
enables/disables the entire log domain itself, regardless of log
level.
2021-06-18 10:43:39 +01:00
João Valverde c5b3842639 wslog: Add more documentation 2021-06-17 12:00:10 +01:00
João Valverde 02e34357bc wslog: Add a noisy debug level
This is intended to replace logging in dissectors that has a
debug level with #ifdef DEBUG_foo and an extra level guarded
by a #ifdef DEBUG_EXTRA_foo.

But generally it can be used as another level of granularity
for debugging output, to avoid flooding the log with too
much information with typical usage.

Rename the filter functions without the unnecessary 'str'
suffix.
2021-06-17 12:00:09 +01:00
João Valverde ac50926d6f wslog: Add a new log-debug option
Option --log-debug or WIRESHARK_LOG_DEBUG is a list
of domains that are set to a "debug" log level. This
takes precedence over the normal log level and domain
filter options.
2021-06-17 12:00:09 +01:00