Commit Graph

80222 Commits

Author SHA1 Message Date
Guy Harris 2820156fbd Move still *more* headers outside of extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".
2021-03-16 13:50:13 -07:00
Pascal Quantin 205e77d404 ISAKMP: Pad Length field is 1 byte long 2021-03-16 15:28:30 +00:00
Mikael Kanstrup d3235c685b ieee80211: Support decrypting Fast BSS Transition with roaming
Support decrypting captures with Fast BSS Transition roaming present
by now also scanning (re)association frames for relevant information
elements and feeding it into the dot11decrypt engine.

Both (re)association request and response frames are scanned to allow
for potentially missing one frame and still be able to derive PTKs
needed for successful decryption.

Closes #17145

Change-Id: I08436582e4f83695dc606ddb92ff442d6258ef9b
2021-03-16 14:36:26 +00:00
Mikael Kanstrup da05e55c74 ieee80211: Display IGTK and GTK subelem key lengths in decimal form 2021-03-16 14:36:26 +00:00
Mikael Kanstrup 49f279a04d ieee80211: Convert proto data type define to an enum
Convert the proto data type defines to an enum to avoid explicitly
have to give each type a value.
2021-03-16 14:36:26 +00:00
Mikael Kanstrup f0dcee3787 ieee80211: Save dot11decrypt proto data only when decryption is enabled 2021-03-16 14:36:26 +00:00
ishaangandhi 37b3295175 ICMP6: Parse RFC 5837 extension structures 2021-03-16 14:16:43 +00:00
Guy Harris e434d404d0 Move even more headers outside extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".
2021-03-16 04:33:00 -07:00
Guy Harris 1e1f4e6b5f Move more headers outside extern "C".
If a header declares a function, or anything else requiring the extern
"C" decoration, have it wrap the declaration itself; don't rely on the
header itself being included inside extern "C".
2021-03-16 02:36:10 -07:00
Guy Harris a892a161d7 pcapng: add some comments warning not to cheat.
Add comments in various switch statements warning people *not* to add
standardized block types or option codes that aren't in the pcapng spec.
If you want a standardized block or option type, go through the
standards process.
2021-03-16 00:52:42 -07:00
Guy Harris a7d98a2cc9 Expand a comment.
Give details on what happens when running Wireshark from a GUI on
UN*Xes, or, at least, on {macOS,Ubuntu+GNOME,Ubuntu+KDE}, although
it's probably similar on other UN*Xes and on other desktop environments.
2021-03-15 18:40:19 -07:00
Guy Harris 8f965899b3 Remove unnecessary includes of wiretap/pcap-encap.h. 2021-03-15 16:04:02 -07:00
Guy Harris ce20c00049 Remove unnecessary inclues of wiretap/pcapng.h. 2021-03-15 15:29:40 -07:00
Guy Harris 9bf838b2ea tap_export_pdu: finish the job of reporting errors.
Provide the pathname of the file, and the frame number, to the error
routines.
2021-03-15 14:52:12 -07:00
Guy Harris 8795edd57c tap_export_pdu: report write errors on the output file.
Now that we have report_cfile_write_failure(), use it.

Also, if an error occurs, eturn TAP_PACKET_FAILED, so we don't keep
trying to write.
2021-03-15 14:03:24 -07:00
Guy Harris 37000e9565 tap_export_pdu: clean up includes.
Get rid of some unnecessary includes, put all the wsutil/ includes
together, use angle brackets for all of them, move version_info.h down.
2021-03-15 13:01:03 -07:00
Guy Harris c33e2f7b51 Add more error-reporting routines that call through a function pointer.
Have routines to report capture-file errors, using libwireshark error
codes and strings, that call through a pointer, so they can pop up
dialogs in GUI apps, print a message to the standard error on
command-line apps, and possibly do something different on server
programs.

Have init_report_message() take a pointer to structure containing those
function pointers, rather than the function pointers themselves, as
arguments.

Make other API changes to make that work.
2021-03-15 12:17:59 -07:00
Preston Hunt 89ae76d300 IEEE 802.11: Add Protected FTM Request/Response 2021-03-15 14:53:00 +00:00
Preston Hunt db8be3d200 IEEE 802.11: Refactor FTM Request/Response
Refactor FTM request/response code to prepare for adding protected FTM
request/response. This commit should not change the functionality in any
way.
2021-03-15 14:53:00 +00:00
Richard Sharpe 8252878a45 ieee1905: Fix a filter bitfield that was incorrect.
This was noticed by Peng Yan of the WFA.

Change-Id: I29a601ec7bd03f68bb5ee8ab4ab8f9e343d3bc36
2021-03-15 06:22:00 +00:00
Guy Harris 5f0dc153dd debian-setup: include GCC and G++ in the basic list.
At least on my just-now-installed Kubuntu 20.04 VM, G++ wasn't installed
by default, and you need that to compile Wireshark (you can avoid it if
you're not building the GUI code, but the GUI code is Qt-based, so it's
in C++).  Add both GCC and G++ to the basic list.
2021-03-14 21:38:36 -07:00
Richard Sharpe 528eb3b3aa ieee80211: Fix a tag_len calculation that was wrong.
Found by the WFA during testing.

Change-Id: I00b017254b2342655c1261cde1dd2023886a6d87
2021-03-14 18:23:26 -07:00
Richard Sharpe fd4c768972 ieee80211: Add the tag val for TAG_INTRA_ACCESS_CAT_PRIO.
This was missed off my earlier merge.

Change-Id: I4fa4258db26344e69bd2d3c82734e2f526065d91
2021-03-14 18:23:25 -07:00
Guy Harris f785cf5340 Fix the captions for the buttons in the "export specified packets" dialog.
The "Selected packet" caption is wrong, as there could be more than one
packet selected.  Furthermore, in the non-Windows "export specified
packets" dialog, the caption is "Selected packets only", so go with the
full caption.

The "Marked packets" caption also lacks the "only" that it has in the
other dialog; add it as well.
2021-03-14 17:10:57 -07:00
Guy Harris 03d6f39a99 libwiretap: make wtap_wtap_encap_to_pcap_encap() private to the library.
Only a tiny amount of code outside libwiretap needs to know about
pcap/pcapng LINKTYPE_ values, and all that code needs to know is, for a
given LINKTYPE_ value, what the corresponding WTAP_ENCAP_ value is.
Nothing should need to know, for a given WTAP_ENCAP_ value, what its
LINKTYPE_ value is.

Make it the case that nothing *does* need to know, for a given
WTAP_ENCAP_ value, what its LINKTYPE_ value is.  Export
wtap_dump_can_write_encap() and use *that*, in the "import hex dump"
code, what formats can be written to a pcap file.
2021-03-14 14:22:16 -07:00
Guy Harris 7dc17158db tap_export_pdu: fix an out-of-date comment. 2021-03-14 13:13:37 -07:00
Jirka Novak 2e87c27ce1 Voice dialogs: Unified naming and order of buttons in dialogs
Dialogs has same order of buttons:
- dialog specific (Flow Sequence, Find Reverse, Analyze, Reset Diagram)
- common voice functions (Prepare Filter, Play Streams)
- exports (Copy, Export)
- Close of dialog

Names were unified:
- Copy really copying to clipboard
- Save/Export was unified to Export
2021-03-14 19:08:45 +01:00
Guy Harris 01151ec332 Clean up "Export PDUs to File" code.
Combine exp_pdu_file_open() is called only by do_export_pdu(); just
combine them into one routine.

Get rid of the exp_pdu_t * argument to do_export_pdu(); instead, have
the exp_pdu_t structure be a local variable in that routine.  There's no
need to initialize exp_pdu_data.pkt_encap in
ExportPDUDialog::on_buttonBox_accepted() - do_export_pdu() already does
so.

The return value of do_export_pdu() isn't used; don't return anything.
2021-03-14 06:51:36 -07:00
Jirka Novak 006f0ab571 Voice dialogs: Added Select All/None/Invert to all of it 2021-03-14 13:14:53 +00:00
Gerald Combs bc45d75608 [Automatic update for 2021-03-14]
Update manuf, services enterprise numbers, translations, and other items.
2021-03-14 09:49:44 +00:00
Guy Harris d4c55ba464 tap_export_pdu: free err_info for WTAP_ERR_INTERNAL.
WTAP_ERR_INTERNAL also returns an err_info script describing the
internal error, so it should be freed to avoid leaking it.
2021-03-13 22:35:25 -08:00
Guy Harris 610dffbb19 pcapng: make sure the packet encapsulation matches the interface encapsulation.
If an attempt is made to write a packet with one encapsulation for an
interface with a different encapsulation, report an internal error.
2021-03-13 22:00:21 -08:00
Guy Harris c92f22d034 debian: wtap_register_backwards_compatibility_lua_name isn't a public API.
It's *not* for use by plugins, it's *only* for use by existing built-in
file type/subtype modules to provide support for an old deprecated
mechanism in Lua code.
2021-03-13 18:11:05 -08:00
John Thacker ea60a57826 tshark, export_pdu: Allow tshark to export PDUs to other file types
The export PDU API now allows writing to a different file type. tshark
already has a -F flag for the output file type. If that option is given,
respect it for export PDU. Also, rec.rec_header.packet_header.pkt_encap
expects WTAP encapsulation types, not PCAP encapsulation types, so don't
call wtap_wtap_encap_to_pcap_encap(), or else it won't actually write to
pcap files, only pcapng (using the wrong sort of encap numbers eventually
leads to WTAP_ENCAP_PER_PACKET, which we don't write to non-pcapng.)
2021-03-14 00:14:40 +00:00
Guy Harris 9bd144b8ea tshark: clean u the way the -U option lists available taps.
Allow "-U ?" as well as an empty argument; an empty argument is a bit
counterintuitive.

Simplify the introductory line of output - asking for a list of taps
isn't an error in which the user failed to supply a tap name, it's a
case where the user suplied a request for a list of tap names.

Just use fprintf() to print the list, and indent the elements of the
list, as we do with other lists of valid arguments.

List the valid arguments if the user specified an invalid argument as
well.
2021-03-13 15:32:14 -08:00
Thomas Sailer b5f2ed34b1 btle: decode new control PDUs and advertising info in 5.2
Decode control PDUs and advertising informationintroduced in
Bluetooth Core v5.2
2021-03-13 16:56:11 +00:00
Gerald Combs d23b0b82c4 GitLab CI: Fix our debian-stable version.
Run tools/make-version.pl in the build:debian-stable job.

Make sure make-version.pl updates debian/control correctly.
2021-03-13 16:36:35 +00:00
Preston Hunt 172323a3e1 IEEE 802.11: Add dissection of FTM action trigger values 2021-03-13 14:06:13 +00:00
Guy Harris 1eb4a62dbc tshark: fix handling of "you're writing to a closed pipe" errors on Windows.
On Windows, a write to a pipe where the read side has been closed
apparently may return the Windows error ERROR_BROKEN_PIPE, which the
Visual Studio C library maps to EPIPE, or may return the Windows error
ERROR_NO_DATA, which the Visual Studio C library maps to EINVAL.

So, on Windows, for errors other than the ones for which we're reporting
a special error message, check for EINVAL with a *Windows* error of
ERROR_NO_DATA and, if that's what we have, don't print an error message;
otherwise, print an error message that reports a message based on the
Windows error (rather than a relatively uninformative "Invalid argument"
error).

This should fix issue #16192.

Clean up indentation while we're at it.
2021-03-13 12:37:46 +00:00
Martin Mathieson e5916d1fc9 NVME: Fix some spellings 2021-03-13 12:01:11 +00:00
Guy Harris f99bd01cee nvme: don't assume "%lu" is the right format to use for a guint64.
The right format to use is "%" G_GUINT64_FORMAT.  A guint64 might be an
unsigned long or it might be an unsigned long long; do not assume which
one it will be on all platforms.
2021-03-13 03:31:12 -08:00
Guy Harris 5d39e36198 doc: Clean up lists of file types.
Add missing entries, regularize the descriptions, etc..

Note that pcap and pcapng are the native formats.

Fix various issues.

Update the editcap -F output to match urrent reality.

While we're at it, sort the libwiretap modules, putting observer.c in
the right place.
2021-03-13 10:02:02 +00:00
Valerii Zapodovnikov cc6a45420a VP8: some cosmetics from RFC 7741 2021-03-13 09:36:21 +00:00
Dr. Lars Völker dabf0af6b7 AUTOSAR NM: In default configuration all CAN packets will be dissected
The default value for the CAN-ID Mask is currently 0. If no config is
present, all comparisons would be always true. This leads to all CAN
packets are being dissected by this dissector by default.
This is a huge performance problem and surely not intended.

This patch sets the default of the CAN-ID Mask to 0xffffffff, so that
in the unconfigured case, only the CAN-ID 0 would be dissected.
2021-03-13 08:00:30 +00:00
Constantine Gavrilov 272ff625f5 NVME Identify Controller: decode TNVMCAP, UNVMCAP, RPMBS fields.
Also, undo a3000150a6 changes, per review comments.
2021-03-13 07:18:47 +00:00
Constantine Gavrilov d509e7e872 NVME Identify Controller: decode MTFA, HMPRE, HMMIN fields. 2021-03-13 07:18:47 +00:00
Constantine Gavrilov b7f3a922e0 NVME Identify Controller: decode AVSCC, APSTA, WCTEMP, CCTEMP fields. 2021-03-13 07:18:47 +00:00
Constantine Gavrilov 6b9adc46de NVME Identify Controller: Error Log Page Entries and Number of Power States decoding. 2021-03-13 07:18:47 +00:00
Constantine Gavrilov ded4a94c71 NVME Identify Controller: Firmware Updates and Log Page Attributes decoding. 2021-03-13 07:18:47 +00:00
Constantine Gavrilov e2b444a650 NVME Identify Controller: fix compile with CLANG in strict mode. 2021-03-13 07:18:47 +00:00