Commit Graph

83066 Commits

Author SHA1 Message Date
John Thacker b9e299b1a3 text2pcap test: Add fractional seconds qualifier
text2pcap now has support for fractional sections using the field
descriptor %f and doesn't support the old method, so change the format
string in the test.  None of the existing tests depended on the
fractional seconds being correct.
2021-12-25 21:01:12 -05:00
John Thacker 9e7b5c9189 text2pcap: Use debug level
Pass the debug level parameter from text2pcap to text_import
so that it is used as it was before to print internal parsing
information.
2021-12-25 15:52:46 -05:00
Gerald Combs 38dbb8486f text import: Remove an unneeded cast.
Don't bother casting to a guint32. We check for large values further on.
2021-12-25 19:43:35 +00:00
John Thacker 5f3197e8be text2pcap: Update usage for new time format options 2021-12-25 13:26:04 -05:00
John Thacker 8cafcfa5a9 text2pcap: Support OFFSET_NONE 2021-12-25 09:19:07 -05:00
John Thacker f63571c3e8 text_import: Ignore offsets in no offset mode
If we're in the no offset mode and we parse an offset,
warn the user and ignore. At the very beginning of the file try
adding it to the preamble, maybe there's something unfortunate
like an all numeric time stamp format (ISO-8601 Basic).
2021-12-25 08:39:29 -05:00
Guy Harris 126971191a text2pcap: use ws_strtou8() to process the -i flag.
Based on Gerald's !5562.

Use ws_strtou8() rather than doing all the error checking ourselves.

Have a common routine to call when an IP "next protocol" value is set;
it does all the necessary work, and could also check for colliding
settings, such as combining "-i 99" with "-s", "-S", "-u", or "-T", or
combining "-u" with "-T", or....
2021-12-24 23:52:47 -08:00
Guy Harris 37d90b7c04 text2pcap: have a Boolean flag indicating whether -i was specified.
That avoids worrying about finding an appropriate out-of-range value to
indicate whether -i was specified or not.
2021-12-24 23:05:52 -08:00
John Thacker 857d518c17 text_import: Use time format directly
Also use g_strcmp0 for setting the ISO format.
2021-12-25 03:35:24 +00:00
John Thacker 54c4c7b0a6 text_import: Another explicit cast for unsigned long and clang 2021-12-24 21:54:40 -05:00
John Thacker a369a2172a text2pcap: Explicit case to keep clang happy 2021-12-24 20:56:43 -05:00
John Thacker 0d68a1364f text2pcap: Use common failure messages, exit codes
Use the common exit codes and failure messages.
2021-12-24 17:01:35 -05:00
John Thacker 96c299c6b8 text_import: Reduce globals
A bunch of the globals are simply copied from the input parameter
text_import_info_t, just use them directly.

Move the count for packets read and written into the info type,
so that callers like text2pcap can access them as results.
2021-12-24 08:20:27 -05:00
Odysseus Yang 6d1be225c6 MBIM: dissect the commands of MBIM extended version 4.0
MBIM_CID_MS_DEVICE_CAPS_V2
MBIM_CID_MS_REGISTRATION_PARAMS
MBIM_CID_PACKET_SERVICE
MBIM_CID_MS_NETWORK_PARAMS
MBIM_CID_MS_UE_POLICY
MBIM_CID_CONNECT
MBIM_CID_MS_PROVISIONED_CONTEXT_V2
MBIM_CID_SUBSCRIBER_READY_STATUS
2021-12-24 09:00:57 +00:00
John Thacker 0867374044 text2pcap: Call text_import
Have text2pcap call text_import to do the work.
Related to #16724.
2021-12-23 20:41:52 -05:00
John Thacker 48574e3a58 text_import: Report errors and warnings
Don't exit in the middle with unexpected values. Report a failure
and return a failed exit status when something goes really wrong.
Use warnings when appropriate, like when a time code value couldn't
be parsed.
2021-12-23 19:26:45 -05:00
Gerald Combs 4605ad2ed7 CMake: Clean up the Qt CMakeLists.txt
Sort each of our file lists and remove a duplicate item. Make our
indentaion consistent.
2021-12-23 10:32:55 -08:00
John Thacker bc9cfa6340 text_import: Allow ISO8601 format times
Includes allowing the string "ISO" in the format string text box
in the GUI, so this works in "Import from Hex Dump" as well as
being for the text2pcap transition. Part of #16724.
2021-12-23 11:42:51 -05:00
John Thacker bc4b27bbe2 text_import: Report failure to write
Use report_message and report wtap_dump failures. Pass in
the output filename and keep track of the frame numbers for
the message parameters.

Report failure to initialize the lex scanner in text_import
instead of in the GUI, so that it would be reported from text2pcap,
and because text_import might have other failure cases that are
not the scanner.

The regex parser returns a positive number of packets processed
on success; save that number in text_import, and return zero on
success to our callers.
2021-12-23 15:49:04 +00:00
Jaap Keuter f151e1b0c2 Refactor VARINT handling 2021-12-23 14:27:30 +00:00
John Thacker 54e9c99041 text2pcap: Finish setting up error handling
Finish up all the setup for the common command line error
handling and for the report message handling when this eventually
calls ui/text_import
2021-12-23 00:09:54 -05:00
Gerald Combs 20ebe853d1 Qt: Make utils more independent.
Use qApp instead of wsApp in ColorUtils and StockIcon.
2021-12-22 19:00:13 -08:00
John Thacker 8d421de42c text_import: port ASCII identification from text2pcap
This is the special check for canonical hex+ASCII textdump
files that looks for the edge case where the beginning of the
ASCII column has strings that can be mistaken by the parser for
additional hex bytes. Not implemented in the GUI yet. Preparing
for text2pcap switchover. Related to #16724.
2021-12-22 20:08:29 -05:00
Gerald Combs dea3d5e5fc CMake: Update our WiX search paths. 2021-12-22 13:07:51 -08:00
Gerald Combs a11f105e44 GitLab CI: Simplify our Windows paths.
CMake's FindPerl module and our FindNSIS and FindWiX modules can find
perl, makensis, and the various WiX utilities in their default locations
so we don't need to prepopulate our PATH.

Update FindWiX to look for version 3.11.
2021-12-22 20:33:29 +00:00
John Thacker 50d66b6346 text_import: gracefully handle hexdump without trailing LF
Adjust the grammar to recognize two trailing hexadecimal characters
without a LF as a byte as well. Ported from text2pcap and commit
22cf80d30d which explains why this
is safe. More work for #16724.
2021-12-22 20:15:11 +00:00
Jaap Keuter 1b5acc8d57 Replace ENC_VARIANT_MASK by ENC_VARINT_MASK 2021-12-22 20:14:31 +00:00
John Thacker 334d24ec5b text_import: Fix IPv6 payload length 2021-12-22 19:40:13 +00:00
Roman Volkov 3b59cb018c mpeg-descriptor: Add support for official DVB 8K HEVC streams 2021-12-22 19:35:18 +00:00
João Valverde d8b7d1f821 dfilter: Add aliases "any_eq" and "all_ne" 2021-12-22 14:32:32 +00:00
João Valverde 8b23dd3a3c dfilter: Add an "all equal" operator
To complete the set of equality operators add an "all equal"
operator that matches a frame if all fields match the condition.

The symbol chosen for "all_eq" is "===".
2021-12-22 14:32:32 +00:00
Moshe Kaplan 69d54d6f8e Corrects repeated words throughout the code.
Repeated words were found with:
egrep "(\b[a-zA-Z]+) +\1\b" . -Ir
and then manually reviewed.
Non-displayed strings (e.g., in comments)
were also corrected, to ease future review.
2021-12-22 11:01:11 +00:00
Anders Broman b5928542b7 Ignore packet-PROTOABBREV.c 2021-12-22 11:18:07 +01:00
Jaap Keuter 6fa56bca0c Remove remnants of bygone GTK era 2021-12-22 06:02:10 +00:00
John Thacker 6a74dae750 text_import: Add interface and internals for IPv6
Add IPv6 handling to text_import, including the ability to
handle dummy IPv6 addresses instead of IPv4. GUI support is
still TBD. This further reduces the number of text2pcap features
that ui/text_import does not yet support. Related to #16724.
2021-12-22 05:13:17 +00:00
Jaap Keuter 2d7c888a70 MySQL: Replace illegal internal proto tree API use 2021-12-22 05:04:42 +00:00
John Thacker 3ff0c753a1 text_import: Add interface and internals for dummy IPv4 addresses
Add dummy IPv4 addresses to the text_import_info_t struct, and
use them if set in the same way text2pcap does. GUI support in
"Import from Hex Dump" is not added yet. This is also part of the
work for text2pcap to eventually call text_import. Related to #16724.
2021-12-22 02:41:11 +00:00
João Valverde 2c44afbba3 Use UINT64_C() with two constants 2021-12-22 01:53:46 +00:00
John Thacker f23296296e text2pcap: Clean up includes
Since we're using wtap_dump_open[_stdout] from file_access.c now,
we don't need to include io.h or fcntl.h on Windows anymore, and
we don't need to include pcapio either.
2021-12-22 01:38:49 +00:00
João Valverde d391d86c33 Debian: Fix header installation
Fixes a bunch of package warnings, and teaches the Debian package to
respect make install rules, and even more importantly to respect header
visibility rules, as defined by the build system. This prevents
private headers to be installed to the target system.

Remove the broken by design system that requires developers to
constantly fix headers by hand. Again the source of truth for which
headers are system headers is the build system, and that's what
any package must use, without requiring constant syncing of
installation rules in CMake and Debian.
2021-12-22 01:24:20 +00:00
John Thacker 4cfae8e378 text_import: pcap_link_type -> wtap_encap_type
The encapsulation type that text_import expects and puts
directly into rec.rec_header.packet_header.pkt_encap is a
wiretap encap type, not a pcap link type. Fix the name and
comment appropriately.
2021-12-22 01:00:19 +00:00
John Thacker c5cc836a48 text2pcap: Use wtap_dumper
Use wtap_dump instead of the pcapio functions for writing files.
This makes it easier to unify with text_import, and also makes it
easier to eventually write other file formats (with a similar option
to the other CLI programs), and allows using the standard CLI error
messages.

Also move some of the option validation before attempting to open
the output file.
2021-12-22 00:46:00 +00:00
João Valverde 9a52634c5f Add ws_version.h to wireshark.h 2021-12-21 23:00:04 +00:00
j.novak@netsystem.cz 9b62d8ba05 Extcap prefs: Selector correctly selects default value 2021-12-21 21:40:51 +00:00
j.novak@netsystem.cz df537a63fb Extcap logging: Corrected incorrect selector default value syntax 2021-12-21 21:05:22 +00:00
j.novak@netsystem.cz 55aad96738 Extcap prefs: Selector option shows tooltip 2021-12-21 20:14:14 +00:00
John Thacker bfbf8dfa23 IEC101/104: 101 Fixed frame len depends on address length
The PDU length for IEC101 Fixed Length frames depends on the
global address length setting. Fix #17775.
2021-12-21 09:39:28 -05:00
João Valverde 15565c2b25 Fixup -Wshorten-64-to-32 warnings with Clang
On Windows the POSIX read() and write() don't use the C99/POSIX
types size_t and ssize_t so we must do the same to avoid
gymnastics to squelch narrowing warnings.

This adds two types for that purpose that have the correct
definition for both Windows and POSIX.
2021-12-21 10:29:45 +00:00
Georg Sauthoff e273006a1d Add ETI/EOBI order flow/market data dissectors
The Enhanced Trading Interface (ETI) protocol and the Enhanced
Order Book Interface (EOBI) protocol are used by a few European
exchanges such as Eurex, Xetra and Börse Frankfurt.

Basically, a trader uses ETI to communicate with a matching
engine (over TCP), e.g. to add a new order, modify an existing
one, etc. while the matching engine also publicizes the current
state of the order book via EOBI over multicast UDP feeds.

ETI actually consists of two variants, i.e. ETI for derivatives
markets (such as Eurex) and ETI for cash markets (such as Xetra).
A common convention is to abbreviate them as ETI (for
derivatives) and XTI (for cash).

These protocols share the same encoding, i.e. messages start with
a length and a tag field and most messages and fields are fixed
size. See also
https://github.com/gsauthof/python-eti#protocol-introduction for
some more details.

The protocol specifications are openly available (cf.
https://github.com/gsauthof/python-eti#protocol-descriptions for
direct links) in human and machine-readable (XML) formats.

The Wireshark ETI/XTI/EOBI dissectors are code-generated by
`eti2wireshark.py`
(https://github.com/gsauthof/python-eti/blob/master/eti2wireshark.py)
which is GPL licensed. See also
https://github.com/gsauthof/python-eti#wireshark-protocol-dissectors
for usage examples and related work.
2021-12-21 08:10:43 +00:00
Gerald Combs b1d7775579 Fix some wiki file attachment URLs.
Wiki file attachment URLs changed when we migrated to GitLab. Update
the references in our code base to match.
2021-12-21 04:47:56 +00:00