Commit Graph

2977 Commits

Author SHA1 Message Date
Martin Mathieson 276a70ea92 Fix more warnings from tools/check_typed_item_calls.py 2023-02-24 11:11:34 +00:00
Martin Mathieson b8bf46459f Try to check that all items in bitmask set have same width 2023-02-12 21:37:10 +00:00
Martin Mathieson 8812c5ed20 Fix some spelling errors 2023-02-09 19:37:20 +00:00
John Thacker ca230a59e0 wiretap, pcapng: Distinguish WTAP_ENCAP_UNKNOWN and _NONE
WTAP_ENCAP_UNKNOWN is used for two different cases:
1. Encapsulation type values that are unsupported by libwiretap or
bogus values (and thus "unknown" to libwiretap).

2. An initial state where the encapsulation type is "not yet" known
for a file type like pcapng without a single encapsulation type in the
header, before any packets or interfaces that set the encapsulation type
have been read. (If the file has no packets, this may be the value after
the file is entirely read in.) This can be the value when an output file
is written out simultaneously with reading an input file, rather than
reading the entire input file first, and, e.g., there is a custom block
before any IDBs.

The first case can never be handled when writing out a file, but the
second case can possibly be handled, so long as (for pcapng) IDBs
are available to write when they become necessary, or (for file
types like pcap with a single link-layer type in the header) the
writer waits until a link-layer type is seen to create the output
header. (It is possible, of course, that writing would fail in the
middle if an unsupported encapsulation type appears, or if the
encapsulation becomes per-packet for file types that don't support that,
but that is an unavoidable risk when writing without reading the entire
input file(s).)

Introduce WTAP_ENCAP_NONE for the second case, and use it for pcapng,
where we guarantee that any necessary IDBs will be passed along.
Continue to use WTAP_ENCAP_UNKNOWN for the first case.

Allow pcapng files to open a file for writing with WTAP_ENCAP_NONE.

There are some other file types that support per-packet link-types,
and could also use WTAP_ENCAP_NONE, but they require more work to
generate IDBs. (Note that all of them currently are impossible to
write to pcapng when they have multiple encapsulations, even if
the encapsulations are all supported by pcapng, because they don't
properly generate IDBs.)

Remove the workaround in ef43fd48b4
for tshark writing to pcapng when the source file is WTAP_ENCAP_UNKNOWN,
since now such files will be WTAP_ENCAP_NONE and work properly (and
also work in editcap, mergcap, etc.)

Along with 8cddc32d35, fix #18449.
2023-02-07 13:33:20 +00:00
João Valverde 02238edf92 Do not require using wsgcrypt.h
The reason to use wsgcrypt.h was to wrap it around DIAG_OFF()
macros and that should no longer be necessary.
2023-02-06 15:52:10 +00:00
João Valverde 71cfbd81b3 Remove wspcap.h and use config.h instead
Forcing the use of a dedicated header to replace pcap.h is
unnecessary code and mental overhead in this case. We can
use config.h instead for the same purpose of defining a
macro symbol before including pcap.h.
2023-02-06 15:05:36 +00:00
David Perry 9b797e97a2 generate-dissector.py: allow creating plugin
Tweak the script used for creating a new skeleton dissector, to allow it
to create the dissector in `plugins/epan/PROTOSHORTNAME` instead of in
`epan/dissectors`. Handles modifying the appropriate CMake file in the
appropriate way, and generates the plugin's `CMakeLists.txt` if needed.
2023-02-06 14:32:55 +00:00
Martin Mathieson c331e17bea Ignore or fix more warnings (check_typed_item_calls) 2023-02-06 09:24:26 +00:00
Gerald Combs 577fe5781b Tools: Update macos-setup-brew.sh
Intitialize some environment variables using `brew shellenv`.

Speexdsp is required. Make some variable names match their respective
command line flags.
2023-02-03 10:45:01 -08:00
Gerald Combs 1bcc5d097d GitLab CI: Add a macOS merge request build.
Add an initial "macOS Build" job that uses GitLab's macOS beta.
https://about.gitlab.com/blog/2021/08/23/build-cloud-for-macos-beta/

Add command line options to macos-setup-brew.sh and use it to install
our packages.

Skip running tests for now.
2023-02-02 23:13:29 +00:00
Martin Mathieson 54e5e2c8a6 Fix some spelling errors 2023-02-02 12:13:21 +00:00
Martin Mathieson ed8ee831fd More fussing with items and calls. 2023-01-31 17:32:05 +00:00
Martin Mathieson efe35a4ccc Fix or suppress more warnings from check_typed_item_calls 2023-01-30 10:28:24 +00:00
João Valverde 43e530e94d Update msys2-setup.sh 2023-01-29 22:08:47 +00:00
Martin Mathieson 407b707e1f check_typed_item_calls: filter out some false positives 2023-01-29 18:39:20 +00:00
Martin Mathieson b1b180fd9e Fix some spelling errors. 2023-01-25 10:52:18 +00:00
Martin Mathieson 32d80bd54e check_typed_item_calls.py: change re for calls to allow ws before params 2023-01-24 12:23:43 +00:00
Martin Mathieson c84a54c82f Checked encoded values for proto_tree_add_item() 2023-01-21 11:16:20 +00:00
João Valverde c66fc43e5b GUI: Ship authors as a Qt resource file 2023-01-20 13:35:03 +00:00
Martin Mathieson be51acfffb Fix some issues seen by tools/check_typed_item_calls.py 2023-01-20 12:47:59 +00:00
João Valverde 5f63989ee0 Update authors file in place
Instead of having AUTHORS.src and copying that to a new AUTHORS
file with git log information appended to that have a single
AUHTORS file and update it in place with git log info.
2023-01-20 12:04:57 +00:00
Martin Mathieson 4dd78f11c9 Fix various issues seen with tools/check_typed_item_calls.py 2023-01-16 15:35:04 +00:00
João Valverde 7e6266d33d MSYS2: Add Lua 5.1 support and fix test suite failures 2023-01-16 11:54:43 +00:00
João Valverde 89188380ae MSYS2: Add better support for other environments
Add support for and generally recommend using UCRT64.
2023-01-14 23:38:55 +00:00
João Valverde aff45e6318 MSYS2: Update GitHub action 2023-01-12 21:04:37 +00:00
Pascal Quantin 92d4052cf8 extract_asn1_from_spec.pl: add support for M2AP and M3AP specs 2023-01-11 12:52:23 +01:00
Guy Harris 03cb1cb077 macos-setup: go with the current autoconf and automake releases.
(Too bad we have to install these to get a decent Makefile for minizip.)

[skip ci]
2023-01-08 15:17:15 -08:00
Martin Mathieson 872db1fe87 For 'fields' param in add_bitmask_, check item masks 2023-01-03 07:28:48 +00:00
João Valverde f2218ae5f0 Lemon: Update code and remove cruft
Remove some unused historical files.

Aggressively disable warnings to keep the lemon source
pristine and avoid the maintenance burden for lemon itself.

Lemon has its own lax policy for warnings that doesn't match our
own and they won't accept external patches to remove the
warnings, so just ignore them. Lemon is just executed to generate
code for the Wireshark build and the minor code issues it has
have no influence at runtime.

For lemon generated code we selectively disable some linting
warnings.

Remove patches for lemon and lempar, they are no longer required
with these changes to silence warnings.
2023-01-01 18:18:06 +00:00
Martin Mathieson dfd3a4d61b check_tfs: find entries that define value_string identical to common tfs 2022-12-30 11:56:41 +00:00
Martin Mathieson 92a81b1361 Enable checks for proto_tree_add_bits APIs 2022-12-29 17:35:18 +00:00
Martin Mathieson 5bbe533244 WIP: Check types for _add_bits_ functions, and ensure no mask 2022-12-27 12:10:03 +00:00
Gerald Combs f809e62b2a Tools: Move speexdsp to the Alpine and RPM basic lists. 2022-12-22 17:44:37 +00:00
Martin Mathieson cc9905b87f tools/bsd_setup.sh: speexdsp is a required package 2022-12-20 12:27:41 +00:00
Gerald Combs 47fa90e41e Tools: Check the last modified date in make-tls-ct-logids.py
In "update" mode, exclude the last modified time when comparing against
the current code block.
2022-12-19 19:52:55 +00:00
Martin Mathieson 74dc39697f debian-setup.sh - install libspeexdsp-dev as default as is now required 2022-12-19 09:35:44 +00:00
Martin Mathieson b2572f3a35 Fix some spelling errors 2022-12-17 11:41:29 +00:00
João Valverde ae14849864 Windows: Use SpeexDSP binary package
Remove bundled code and use vcpkg binary library instead.
2022-12-16 11:11:28 +00:00
Martin Mathieson d17c018013 tools/check_typed_item_calls: check FT_BOOLEAN mask length 2022-12-15 13:28:05 +00:00
Gerald Combs dcf00fc3bd NCP: Add offset overflow checking.
Add and use check_offset_addition, which adds an expert item and throws
an exception if we're about to overflow our offset.

Fixes #18720
2022-12-14 08:57:44 +00:00
João Valverde d86a9910e5 tools/checklicense: Skip build directories
Skip a source tree root directory starting with 'build' (by
convention).

Remove previous logic from Chromium that does not apply to us.
2022-12-08 07:15:52 +00:00
Martin Mathieson b7c3bae518 check_typed_item_calls: add check for add_bitmask fields 2022-12-03 17:15:24 +00:00
Joakim Karlsson 4b0bf62791 asn2wrs: disable template line directive by default
Same as with !8955, To debug with line directive build with
-DENABLE_DEBUG_A2W=ON flag
2022-11-30 17:31:46 +00:00
Martin Mathieson 6eb734995a Change the re for matching an item's label 2022-11-30 09:25:13 +00:00
Martin Mathieson c69d0114ea tools/check_static.py - fix remaining errors 2022-11-30 08:49:38 +00:00
John Thacker 6e6386a3dc rpm-setup: Don't attempt to install cmake3
cmake is already in the basic list of packages. "cmake3" is
necessary for RHEL/CentOS 7 (where the "cmake" package is 2.8.12),
but that distribution isn't supported on 4.0 and later.

At the same time, the OpenSUSE 15.4 repository accidentally has
a "cmake3" package which is an earlier version than the "cmake" RPM,
which creates some conflicts when trying to install both.
(https://gitlab.com/wireshark/wireshark-containers/-/jobs/3328997023)

So, don't attempt to install cmake3 anymore.
2022-11-16 18:51:42 -05:00
John Thacker 73c291029d skinny: Resync xml code with dissector, regenerate
Make changes to packet-skinny.c.in and SkinnyProtocolOptimized.xml
that incorporate changes from 67f05835ca
and 8efad466c4 made to the dissector
manually and regenerate. Also fix a case where a comment mixed
tabs and spaces, which caused the python conversion tool to complain.
2022-11-03 20:55:05 -04:00
John Thacker 8c585cc228 skinny: Convert parse_xml2skinny_dissector.py to Py3
Convert parse_xml2skinny_dissector.py to Python 3.
This is mostly the output of running 2to3, but some of the
uses of dict.keys() were left as is instead of being converted
to lists, since only membership was tested.

The dissector still needs to be regenerated, which will happen
in a next commit, so that this change can be easily backported.
2022-11-03 20:28:19 -04:00
Martin Mathieson 3ac86775dc Fix some spelling errors 2022-11-02 20:54:24 +00:00
Huang Hao 58390334eb asn2wrs.py: fix Needs64b 2022-10-31 18:33:51 +00:00