Commit Graph

84091 Commits

Author SHA1 Message Date
Jack Kaplan 05d33b9690 WSUG: removed extra "or".
Removed extra or to improve grammatical correctness.
2022-04-19 11:16:51 +00:00
John Thacker ea62d7d6fa hierarchy stats: Don't add text only fields to the hierarchy
Use proto_registrar_is_protocol instead of directly comparing
hfinfo->parent to -1 when determining if the field info is related
to a protocol or not.

This avoids adding the special case text only field, which does not
have a parent protocol id, to the protocol hierarchy. These fields are
merely strings on the GUI tree, not actual protocols.
2022-04-19 11:03:37 +00:00
Pascal Quantin 43828765c3 NR RRC: upgrade dissector to v16.8.0 2022-04-19 12:39:03 +02:00
Pascal Quantin 58af12cac7 LTE RRC: upgrade dissector to v16.8.0 2022-04-19 09:22:58 +00:00
Roland Knall 2d48d49524 Allow to filter interface types
Allow to only use interface types, that are allowed by the implementing applications.
2022-04-19 09:19:50 +00:00
Pascal Quantin 5c7c723feb LPP: upgrade dissector to v16.8.0 2022-04-19 10:05:41 +02:00
Gerald Combs 69b9c480fd Revert "wsutil: Use a separate "extlog" directory for Logwolf extcaps."
This reverts commit 54553de59d.

As noted in !6694, it would probably make more sense to handle this a
different way.
2022-04-18 16:46:20 -07:00
Gerald Combs fea6591b0c macOS: Add support for Sparkle 2.
Sparkle 2 deprecated the sharedUpdater singleton, so create our own
which uses Sparkle 2's updated API. Ping #18035.

Update our CMake version check.
2022-04-18 18:57:43 +00:00
naesten c8d9c6fc6a Fix tools/*-setup.sh to work with no arguments
They were checking for --help in an unusual manner that failed when
run with no arguments.

I've checked that --help works for each script, and that debian-setup.sh
actually works.

NOTE: bsd-setup.sh and rpm-setup.sh seem to have sometimes-broken
formatting, because they try to pass escape sequences to echo, which
POSIX says is implementation-defined (except on XSI-conformant systems).

These changes were mostly made using the following script, with a
manual fix in bsd-setup.sh because it isn't using "switch case".

```python
#!/bin/env python3

import sys
import re

usage_p = re.compile(r'^if \[ "\$1" = "--help" \]\nthen\n((?:\t(?:printf|echo) .*\n)*)\texit 1\nfi$',
                     re.MULTILINE)

case_p = re.compile(r'(^\tcase \$arg in$)',
                    re.MULTILINE)

root_check_p = re.compile(r'(\n# Check if the user is root(?:\n|.)*?fi\n)',
                          re.MULTILINE)

done_p = re.compile(r'(^done\n)',
                    re.MULTILINE)

def fix_setup(name: str):
    assert name.endswith('-setup.sh')

    with open(name, 'r') as fin:
        s = fin.read()

    s = usage_p.sub(r'function print_usage() {\n\1}', s)
    s = case_p.sub(r'''\1
\t\t--help)
\t\t\tprint_usage
\t\t\texit 0
\t\t\t;;''', s)

    m1 = root_check_p.search(s)
    if m1:
        root_check = m1[0]
        s = root_check_p.sub('', s)
        pos = done_p.search(s).end()  # type: ignore[union-attr]
        s = s[:pos] + root_check + s[pos:]

    with open(name, 'w') as fout:
        fout.write(s)

if __name__ == '__main__':
    for name in sys.argv[1:]:
        fix_setup(name)
```
2022-04-18 17:05:03 +00:00
João Valverde fab32ea0cb dfilter: Allow arithmetic expressions as function arguments
This allows writing moderately complex expressions, for example
a float epsilon test (#16483):

Filter: {abs(_ws.ftypes.double - 1) / max(abs(_ws.ftypes.double), abs(1))} < 0.01

Syntax tree:
 0 TEST_LT:
   1 OP_DIVIDE:
     2 FUNCTION(abs#1):
       3 OP_SUBTRACT:
         4 FIELD(_ws.ftypes.double)
         4 FVALUE(1 <FT_DOUBLE>)
     2 FUNCTION(max#2):
       3 FUNCTION(abs#1):
         4 FIELD(_ws.ftypes.double)
       3 FUNCTION(abs#1):
         4 FVALUE(1 <FT_DOUBLE>)
   1 FVALUE(0.01 <FT_DOUBLE>)

Instructions:
00000 READ_TREE		_ws.ftypes.double -> reg#1
00001 IF_FALSE_GOTO	3
00002 SUBRACT		reg#1 - 1 <FT_DOUBLE> -> reg#2
00003 STACK_PUSH	reg#2
00004 CALL_FUNCTION	abs(reg#2) -> reg#0
00005 STACK_POP	1
00006 IF_FALSE_GOTO	24
00007 READ_TREE		_ws.ftypes.double -> reg#1
00008 IF_FALSE_GOTO	9
00009 STACK_PUSH	reg#1
00010 CALL_FUNCTION	abs(reg#1) -> reg#4
00011 STACK_POP	1
00012 IF_FALSE_GOTO	13
00013 STACK_PUSH	reg#4
00014 STACK_PUSH	1 <FT_DOUBLE>
00015 CALL_FUNCTION	abs(1 <FT_DOUBLE>) -> reg#5
00016 STACK_POP	1
00017 IF_FALSE_GOTO	18
00018 STACK_PUSH	reg#5
00019 CALL_FUNCTION	max(reg#5, reg#4) -> reg#3
00020 STACK_POP	2
00021 IF_FALSE_GOTO	24
00022 DIVIDE		reg#0 / reg#3 -> reg#6
00023 ANY_LT		reg#6 < 0.01 <FT_DOUBLE>
00024 RETURN

We now use a stack to pass arguments to the function. The
stack is implemented as a list of lists (list of registers).
Arguments may still be non-existent to functions (this is
a feature). Functions must check for nil arguments (NULL lists)
and handle that case.

It's somewhat complicated to allow literal values and test compatibility
for different types, both because of lack of type information with
unparsed/literal and also because it is an underdeveloped area in the
code. In my limited testing it was good enough and useful, further
enhancements are left for future work.
2022-04-18 17:10:31 +01:00
João Valverde 92c1519dfe dfilter: Add float multiplication/division 2022-04-18 17:09:05 +01:00
João Valverde eb2a9889c3 dfilter: Add abs() function
Add an absolute value function for ftypes.
2022-04-18 17:09:00 +01:00
Richard Sharpe 8889d8c78b ieee80211: Implement more KDEs from ieee802.11-2016 and on.
I have picked up more KDEs from ieee802.11-2016 and Draft P802.11REVmd_D5.0
and Draft P802.11be_D1.4.
2022-04-17 23:59:26 +00:00
Martin Mathieson 24d65950e9 check_typed_item_calls: Count all warnings 2022-04-17 22:47:09 +00:00
Gerald Combs bc29ce61d5 GitLab CI: Switch to clang 14. 2022-04-17 18:26:37 +00:00
Gerald Combs 6900065f2d Tools: Make the Alpine and Arch setup scripts more strict.
Make sure alpine-setup.sh and arch-setup.sh fail with a nonzero status
similar to debian-setup.sh and rpm-setup.sh.
2022-04-17 11:04:02 -07:00
Gerald Combs 05c86efcf6 Tools: Set a variable in rpm-setup.sh.
[skip ci]
2022-04-17 17:41:46 +00:00
Gerald Combs bce8825df8 [Automatic update for 2022-04-17]
Update manuf, services enterprise numbers, translations, and other items.
2022-04-17 16:37:54 +00:00
Ahmet Alperen Bulut d66c29ab07 IEEE1905: Fix CAC Termination Request's offset calculation
Fixes #18042
2022-04-17 08:49:59 +00:00
Andrii Vladyka f4c7bd9c75 DOCSIS: Fixed RNG-RSP Commanded Power Sub-TLVs dissection 2022-04-16 20:22:53 +00:00
Benedikt Heumüller 90c784bd97 fpp: Fix mCRC calculation
Conversations start at SMD-S and are continued with SMD-C frames
Added CRC information to proto_data of conversation for mCRC calculation
Continue checksum calculation for faulty fragments
Reassembly information added to info column
Reworked packet_direction
2022-04-16 18:46:05 +00:00
Alexis La Goutte 83959f77e3 dfvm: Fix Dead Store found by Clang Analyzer 2022-04-16 18:15:45 +00:00
Matthias Dietrich 86bc544fd3 PROFINET: Fix count of IO data objects and IOCS
Split the counts of IO data objects and IOCS between
input and output. Remove increment of IO data objects
in station information, sometimes leading to extremely
high and invalid number of IO data objects.
2022-04-16 13:57:16 +00:00
Matthias Dietrich dcffa0303a PROFINET: Split number of IOCS between in and out
Currently a single counter is used, but the number of
IOCS is not necessarily the same for input and output
CRs.
2022-04-16 13:57:16 +00:00
Arne Schwabe c2c20a6f2d Implement parsing of OpenVPN tls-crypt packets
This implements parsing the packets in tls-crypt mode. Parsing is very
limited since tls-crypt encrypts the packets. Since detecting tls-crypt
is not easy apart from two tls-crypt-v2 specific opcodes, it is preference
that needs explicitly set.
2022-04-16 13:40:15 +00:00
Dylan Ulis 88719f0884 CIP Safety: Minor Refactoring, Part 2 2022-04-16 06:57:13 +00:00
João Valverde af878388fe dfilter: Fix scanning of strings
The code was ignoring a SCAN_FAILED return value.
2022-04-15 22:51:15 +01:00
Gerald Combs e364444b24 wslua: Update the menu group documentation.
Update to match ca04f4c8cb.
2022-04-15 21:30:50 +00:00
easonweii b4a15f8be3 BER: Add the length check of dissecting BER integers, int64, and booleans
Add the length check of dissecting BER integers, int64, and booleans, the expert info is added for bad lengths, includes the name of the field and actual length.
Related to #18005
2022-04-15 11:56:17 +00:00
Chuck Craft 98793186b9 CQL: format timestamp as microseconds (ENC_TIME_USECS)
Closes #18038
2022-04-14 19:08:55 +00:00
Gerald Combs b51a635bce BACapp: Fix a recusion check.
Make sure fAbstractSyntaxNType() always decrements its proto_depth on
exit. Fixes #18039.

Remove a no-longer-needed p_add_proto_data() call.
2022-04-14 18:16:42 +00:00
Chuck Craft 4e0cd3dbd2 epan: add ENC_TIME_USECS timestamp encoding
Needed to format timestamp in #18038 - packet-cql.c
Mirrors changes made in !1924 - Add ENC_TIME_NSECS timestamp encoding
Documentation in README.dissector, proto.c, proto.h - could use
refresh in a different merge request.
2022-04-14 15:18:30 +00:00
João Valverde cef02cc3a0 dfilter: Add max()/min() tests and documentation 2022-04-14 13:07:41 +00:00
João Valverde 827d143e6e dfilter: Allow function arguments to be non-existent.
Instead of not calling the function if an argument is non-existent
(read tree fails), call the function and let the function handle
the condition.
2022-04-14 13:07:41 +00:00
João Valverde cb2f085f14 dfilter: Add max() and min() functions
Changes the function calling convention to pass the first register
number plus the number of registers after that sequentially. This
allows function with any number of arguments. Functions can still
only return one value.

Adds max() and min() function to select the maximum/minimum value
from any number of arguments, all of the same type. The functions
accept literals too. The return type is the same as the first argument
(cannot be a literal).
2022-04-14 13:07:41 +00:00
John Thacker a372497a85 hierarchy stats: Include appendix length in byte counts
The byte counts in Protocol Hierarchy Stats should include
the appendix length. Fix #17913.
2022-04-14 12:26:04 +00:00
Gerald Combs 62a2fe28c2 wiretap: Try opening systemd journal files before IxVeriWave.
The Ixia IxVeriWave .vwr file reader's heuristics matched a journal file
here, so place the systemd journal before it in the list.
2022-04-13 17:04:25 -07:00
Gerald Combs 8528fca055 Falco Bridge: Misc cleanup.
Remove unused header definitions in packet-falco-bridge.h and move the
remaining content to packet-falco-bridge.c and conversation-macros.h.
Explicitly set our header files in CMakeLists.txt.
2022-04-13 13:51:06 -07:00
Dylan Ulis 943c38d606 CIP Safety: Minor Refactoring, Part 1 2022-04-13 20:48:41 +00:00
Dylan Ulis 3c25b69ff6 CIP: Correct DATE, DATE_AND_TIME type handling, Part 2 2022-04-13 20:22:29 +00:00
Dylan Ulis 234db3b48f CIP Safety: Display human readable timestamps 2022-04-13 20:04:40 +00:00
Pascal Quantin 50ada3d65c NGAP: workaround a gcc 10.2.1 compilation issue
Fixes #17858
2022-04-13 16:58:54 +02:00
Chuck Craft 55f7b27b35 tshark.adoc: update -z conv/endpoints descriptions 2022-04-13 12:58:14 +00:00
John Thacker 01239eb59d whois: Assume UTF-8, add an expert info
Move the assumption for WHOIS responses to UTF-8 (which is backwards
compatible with ASCII), and add an expert info regarding that
assumption. There is no indication for encoding in the protocol.
Using Show Packet Bytes is sufficient for most purposes, but someone
could add a preference if desired.
2022-04-13 12:29:12 +00:00
Moshe Kaplan 1e352c3e7b manpage: Fix grammar errors and improve phrasing
Quickly review of fixing common grammatical errors in
the man pages.
2022-04-13 03:39:56 +00:00
João Valverde 0dba7456aa tests: Remove leftover debug print 2022-04-13 01:15:11 +01:00
Gerald Combs bcc286f341 UI: Rename the qt_logwolf directory to logwolf.
We might want to split the Wireshark-specific UI code into ui/wireshark,
but that can be done at another time.
2022-04-12 19:37:30 +00:00
Gerald Combs ca04f4c8cb Qt: Update our dynamic menu groups.
Add log-specific statistics groups, and use them to limit the dynamic
menu items in Wireshark and Logwolf.
2022-04-12 12:14:03 -07:00
João Valverde 8746eea297 dfilter: Try to resolve field reference instead of using a heuristic
Instead of using a heuristic to decide whether the form ${...} is
a macro or not, try to resolve the name to a registered protocol
field and use that instead.

This increases somewhat the surface for clobbering existing macro
names with new field registrations but we'll cross that bridge when
we get to it.

Rejecting protocol field types reduces this probability again but it
may not be intuitive to the user trying to mistakenly use a reference
to a protocol why it is parsed as a macro. The reasons for rejecting
FT_PROTOCOL types as not interesting field references are not
very strong but it seems reasonable.

$ dftest 'frame.number != ${frame.number}'
Filter: frame.number != ${frame.number}

Instructions:
00000 READ_TREE		frame.number -> reg#0
00001 IF_FALSE_GOTO	5
00002 READ_REFERENCE	${frame.number} -> reg#1
00003 IF_FALSE_GOTO	5
00004 ALL_NE		reg#0 != reg#1
00005 RETURN

$ dftest 'frame != ${frame}'
dftest: macro 'frame' does not exist
2022-04-12 14:03:18 +00:00
João Valverde 8355e96858 tests: Add test for display filter field reference 2022-04-12 14:03:18 +00:00