Commit Graph

81191 Commits

Author SHA1 Message Date
João Valverde c5b3842639 wslog: Add more documentation 2021-06-17 12:00:10 +01:00
João Valverde ff9acff6f2 Replace usage of GLogLevel flags everywhere
ws_log_domains.h needs to be included before wslog.h to be used
to define WS_LOG_DOMAIN. Also the definition for enum ws_log_level
needs to be exported for other APIs so move that to ws_log_domains.h
and rename the file to ws_log_defs.h to reflect the new scope.
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
João Valverde 01001485b9 wslog: Add a new log-fatal option
Enviroment variable WIRESHARK_LOG_FATAL and command line
option --log-fatal set the fatal log level. Messages with
fatal or highr priority cause the program to abort. By
default the fatal level is "error", but it can be set to
"critical" or "warning" with this option.
2021-06-17 12:00:09 +01:00
João Valverde 36c32de869 wslog: Add support for inverted domain matches
Domain filter expressions starting with '!' invert the match.
Only domains that do not match become active. Note that '!'
must be the first character in the filter and applies to the
whole expression.
2021-06-17 12:00:09 +01:00
João Valverde 05ed76d4c0 wslog: Use plain format with "message" level
Try out a simpler format with the default log level.

Don't display process and file/function information with "message"
level (experimental).
2021-06-17 12:00:09 +01:00
Anders Broman 790bbbe16d Diameter: Add a few AVPs 2021-06-17 09:00:02 +00:00
Chuck Craft 686bd3ac94 WSDG: update/clarify naming conventions 2021-06-17 08:43:57 +00:00
Chuck Craft 55cfd76003 WSDG: update/clarify naming conventions 2021-06-17 08:43:57 +00:00
Isaac Boukris d2c3489d79 Revert "test"
This reverts commit af3a9d72d9.
2021-06-17 10:14:55 +03:00
Isaac Boukris af3a9d72d9 test 2021-06-17 05:05:59 +00:00
Isaac Boukris dd39d9b46a credssp: add basic dissection of TSRemoteGuardCreds
as per MS-CSSP 2.2.1.2.3
2021-06-17 05:05:59 +00:00
Guy Harris 2c9d262ed1 pcapng: indentation cleanups. 2021-06-16 20:03:00 -07:00
Guy Harris 8aceee774a pcapng: get rid of some now-redundant rounding up of the block length.
Now that it's being done in common code, we don't need to do it in the
routines to read sysdig event blocks, systemd journal export blocks, or
unknown blocks.

Add in a comment to match other comments while we're at it.
2021-06-16 18:59:34 -07:00
Guy Harris a16f65ab20 pcapng: have more common code for processing options.
Have a common loop for processing options, with a callback to process
options for a particular block type.
2021-06-16 16:50:22 -07:00
Guy Harris ea38a1d419 pcapng: round up block lengths to a multiple of 4 in common code.
Do it earlier in the reading process, rather than in the packet block
code.
2021-06-16 13:15:24 -07:00
Chuck Craft 45cf1f8904 WSDG: define CRT; add UCRT 2021-06-16 17:09:54 +00:00
Adrian Granados 5852954828 ieee80211: Fix validation of subelements in the Multiple BSSID IE.
The IEEE Std 802.11ax-2021 amendment relaxes the requirements for
elements included in the Nontransmitted BSSID Profile subelement:

"Any element specific to the BSS or with content that is different
from the transmitted BSSID" can be included as a sublement.

However, it also enumerates elements that should not be included in the
Nontransmitted BSSID Profile subelement, including some extended element
IDs.

Thus, I've changed the add_tagged_field function to be more comprehensive, so that:

a) it can use the list of elements IDs to check for valid OR invalid element IDs
b) it defines necessary arguments for also checking valid OR invalid extended element IDs

The original function declaration is kept as it is, and the implementation calls the
new function, add_tagged_field_with_validation.

An alternative implementation of this change would be to have
the Multiple BSSID dissector implementation skip the check for invalid
element IDs in the Nontransmitted BSSID Profile subelement,
hence not requiring any changes to the add_tagged_field function.

However, for completeness, the add_tagged_field function should check for
valid extended element IDs in the same way it can check for valid element IDs,
and this commit provides it.
2021-06-16 15:05:33 +00:00
Chuck Craft 535315b7e1 WSDG: stale path and filename; correct typo in path name 2021-06-16 14:47:43 +00:00
João Valverde dcc02b1003 dissectors: Replace g_log() with ws_log() 2021-06-16 12:50:28 +00:00
João Valverde 39df3ae3c0 Replace g_log() calls with ws_log() 2021-06-16 12:50:27 +00:00
Tomas Kukosa 4c4bb915c8 ITS: fix displaying of curvature unavailable value 2021-06-16 12:34:06 +00:00
Joakim Karlsson e22b9733cf GTPv2: make dissect_diameter_3gpp_uli public for custom dissectors 2021-06-16 13:59:44 +02:00
Martin Mathieson 6b0cfb703a netlink-route: Fix a couple of spellings 2021-06-16 10:58:56 +00:00
Guy Harris 8176a16798 pcapng: fix indentation. 2021-06-16 03:31:27 -07:00
Joakim Karlsson 72193d037f NGAP: add more N2SmInfoType 2021-06-16 09:38:36 +00:00
Guy Harris 25a254823f wsutil: add a header that defines some "round to power of 2" macros.
Add macros to round to multiples of 2, 4, 8, 16, and 32.

Use them instead of independently defined macros.

(We don't define a general "round to a power of 2" macro to avoid the
risk of somebody passing something other than a power of 2 to it.)
2021-06-16 02:01:23 -07:00
John Thacker f541e5e769 MP2T: Catch exceptions thrown by reassembled fragments and continue
A TS packet can contain the end of a previous fragmented higher level
packet and the start of a new higher level packet. If an exception
is thrown in the first reassembled packet, catch it and continue to
process the start of the next. This is particularly likely when there
are dropped or out of order frames, since there are no fragment IDs,
just continuous streams (multiplexed by PIDs.) Similar to #13238,
but at a slightly different place in the protocol.
2021-06-16 08:00:01 +00:00
Guy Harris 6c043d5c73 wslua_tvb: fix documentation for reported_length_remaining().
In the past, tvb_reported_length_remaining(), and thus
Tvb:reported_length_remaining(), may have returned -1 if the offset was
invalid.  That's no longer the case; the former returns 0, and, as the
latter just returns the former's return value, that's true of the latter
as well.
2021-06-16 00:43:07 -07:00
Guy Harris bd9ceaebef wslua: a tvbuff doesn't have an "actual length".
It has a "reported length", which is the closes thing to an "actual
length", as it represents the length the packet, or subset thereof, had
on the network, and a "captured length", which is the amount of the
packet that the capture process saved.

In 99.999999999999999999999999999999% of all cases, a dissector should
look at the "reported length", not at the "captured length".

Rename the "len" method to "captured_len", leaving "len" around for
backwards compatibility.

Fix the documentation to reflect reality, to avoid issues such as #15655.
2021-06-16 07:12:12 +00:00
Adrian Granados 4fdf3f1038 ieee80211: Improve HE 6 GHz Capabilities IE dissector
Fixes field names and sets field values to be consistent
with equivalent HT and VHT capabilities fields as indicated
in the IEEE Std 802.11ax-2021 amendment.
2021-06-16 06:30:43 +00:00
Gerald Combs 2d9280089c GitLab CI: Add initial Windows package builds.
Start migrating the Windows package build steps from Buildbot.
2021-06-16 05:48:38 +00:00
Guy Harris 6771252f1b netlink: don't use -1 to mean "to end of packet".
Add dissect_netlink_attributes_to_end(), which takes no length argument,
and uses tvb_ensure_reported_length() to get the remaining length in the
packet.

In dissect_netlink_attributes_common(), treat negative lengths as if
they were a positive length >= 2^31, and throw a reported bounds error.

Also, throw a bounds error if there's more padding to a 4-byte boundary
than there is data in the packet.

At that point, we know the length is positive, so assign it to an
unsigned variable and use *that* in the loop.  Throw an error if the
attribute goes past the end of the packet (although we presumably would
have done that already).

(We really should eliminate all use of -1 as "to the end", and make
lengths unsigned.  We should also get rid of any places where we're
using negative offsets as offsets from the end of the packet - in the
few cases where you're dealing with trailers, you want to do that
carefully, so as not to throw an exception dissecting the trailer before
you get around to dissecting the rest of the packet - and make offsets
unsigned as well.)
2021-06-15 14:56:26 -07:00
Guy Harris e5ce3345db tvbuff: add tvb_ensure_reported_length_remaining().
It is to tvb_reported_length_remaining() as
tvb_ensure_captured_length_remaining() is to
tvb_captured_length_remaining() - it throws an exception if the offset
is out of range.

(Note that an offset that's just past the end of the {reported,
captured} data is *not* out of range, it just means that there is no
data remaining.  Anything *past* that is out of range and thus invalid.)
2021-06-15 13:32:46 -07:00
João Valverde 2c6d897b58 wslog: Add ws_logv_full() 2021-06-15 18:51:40 +01:00
João Valverde e37b2ae637 wslog: Remove unused macro 2021-06-15 18:51:40 +01:00
João Valverde 477e7f7300 wslog: Do not filter default domain 2021-06-15 18:51:40 +01:00
João Valverde bec7b0c609 wslog: Fixup color support 2021-06-15 18:51:38 +01:00
João Valverde ac4a0c056b wslog: Use g_date_time_format() 2021-06-15 18:28:02 +01:00
Joakim Karlsson 9be67f167f NAS 5GS: add support for more binary IEs
TS 29.502 ch6.1.6.4.4 n1SmInfoFromUe, n1SmInfoToUe, unknownN1SmInfo
2021-06-15 16:33:56 +00:00
Martin Gallo 85df6d0273 Kerberos: Add support for MS-KILE Key List Request messages
This adds the MS-KILE pre-authentication data types KERB-KEY-LIST-REQ [161] and KERB-KEY-LIST-REP [162] as per the latest Microsoft' Open Specifications.
Keys obtained from KERB-KEY-LIST-REP are learnt and saved for further use in other packets.

References:
- [MS-KILE] 2.2.11 KERB-KEY-LIST-REQ https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/a8198db9-b537-4256-b903-80a716540398
- [MS-KILE] 2.2.12 KERB-KEY-LIST-REP https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/38a494fc-2885-47eb-b008-3a1b574f3614
- [MS-KILE] 3.3.5.7.8 Key List Request https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-kile/732211ae-4891-40d3-b2b6-85ebd6f5ffff
2021-06-15 14:51:07 +00:00
Constantine Gavrilov 01de470856 NVMe: fix for parsing data for logpage NVMeOF Discovery.
Take into acoount reported number of records.
Thus, discard extra payload, it target has not truncated response.
2021-06-15 17:01:01 +03:00
David Fort e43d26b39e rdp: many improvements and fixes
This big patch addresses the following items:

* implement the "message" virtual channel so that multi-transport and bandwidth
PDUs are dissected;
* prepare the identification of static channels to be able to dissect them later;
* fix the compression field in channelPDUHeader.channelFlags;
* implement the drdynvc channel dissector, so now we decode the traffic on this
channel and we're able to track data on dynamic channels and transition to UDP
transport
2021-06-15 08:42:47 +00:00
Constantine Gavrilov 6ba703cba7 MVMe: append command names for commands, responses and transfers to Info column. 2021-06-15 08:27:16 +00:00
Gerald Combs 147e7dce04 Debian: Remove a symbol.
Remove ws_log_fprint.
2021-06-15 00:39:02 -07:00
Nardi Ivan 50d878b92a HTTP3: add very basic support for PRIORITY_UPDATE frames 2021-06-15 06:11:17 +00:00
Guy Harris d92a4bfd90 netlink-route: don't dissect attributes for legacy messages.
They don't include any attributes - they're not large enough to contain
anything other than the netlink message header and the one-byte address
family.  For legacy messages, the attribute we hand to
dissect_netlink_route_attributes() is not aligned on a 4-byte boundary,
as it's the offset right after the 1-byte address family value;
dissect_netlink_route_attributes() will try to align that on a 4-byte
boundary, but that will go past the "immediately after the end of the
packet" offset, which can cause problems if any checking is done to make
sure the offset is valid.  Therefore, we don't try to dissect the
attributes, rather than relying on the attributes dissector to discover
that there's nothing left in the packet.
2021-06-14 22:24:52 -07:00
João Valverde dd78347a7e capture: Lower priority for some status messages 2021-06-14 22:05:35 +00:00
João Valverde 41fd46310f wslog: Change log format to display everything
Revert from alternating between function name and file name,
show both instead.
2021-06-14 22:05:35 +00:00