aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
AgeCommit message (Collapse)AuthorFilesLines
2021-11-29Add files with WS_DLL_PUBLIC to DoxygenMoshe Kaplan7-7/+7
Add @file markers for most files that contain functions exported with WS_DLL_PUBLIC so that Doxygen will generate documentation for them.
2021-11-27epan: Initialize wiretapJoão Valverde1-0/+10
Clients of libwireshark should not be required to initialize explicitly wiretap, if they don't use it themselves.
2021-11-20BBLog: Fix the handling of skipped blocksMichael Tuexen1-2/+5
2021-11-08BBLog: Fix support of TCP window scalingMichael Tuexen1-0/+8
Rcv.Wind.Shift and Snd.Wind.Shift were not displayed correctly by the BBLog dissector and the TCP dissector was not using the information about the shift values available in the BBLog file.
2021-11-03Ericsson ENB log reader: Check the whole line for the magic string.Anders Broman1-1/+1
2021-10-29dissectors: support sysdig new block type BLOCK_TYPE_SYSDIG_EVENT_V2_LARGEFederico Di Pierro2-6/+17
The new block type enlarge payload lens up to 4B, to support larger payload sizes. Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
2021-10-26BLF: Direction is not ignored anymore (BUGFIX)Dr. Lars Völker2-1/+38
This patch adds direction support, so that incoming and outgoing frames can be differentiated.
2021-10-24Increase max packet size for all USB encapsulation formatsAidan MacDonald1-0/+4
Each "packet" in the USB encapsulation formats for at least Linux and Darwin corresponds to an OS-level USB request, so the packets can be much larger than a USB-level packet. The default max packet length of 256 KiB prevents Wireshark from loading capture files that contain requests >256 KiB. (Saving such a capture already works fine.) Fix this by making the Linux, Darwin, and FreeBSD formats use the same max packet length as the USBPCap format, which is 128 MiB.
2021-10-22Windows: Fix warnings using flexJoão Valverde4-0/+9
Fix some warnings complaining of macro redefinitions with stdint.h. Include stdint.h via wireshark.h everywhere so it stays fixed.
2021-10-22Add new global header wireshark.h with guidelineJoão Valverde3-5/+5
Remove ws_diag_control.h from config.h because that was a workaround for the lack of a public global header. Fix the resultant build errors.
2021-10-18Add a comment to explain a cast done in file_fdopen().Guy Harris1-0/+18
2021-10-18wiretap: fix a warning on Raspberry 4Nardi Ivan1-1/+1
/home/pi/wireshark/wiretap/file_wrappers.c: In function ‘file_fdopen’: /home/pi/wireshark/wiretap/file_wrappers.c:1136:27: error: comparison of integer expressions of different signedness: ‘__blksize_t’ {aka ‘long int’} and ‘unsigned int’ [-Werror=sign-compare] if (st.st_blksize <= MAX_READ_BUF_SIZE) ^~ cc1: all warnings being treated as errors
2021-10-13eNode-B: Fix check for eri_enb_log_magicStig Bjørlykke1-1/+1
Files not having the eri_enb_log_magic should not be opened as a eNode-B raw log file format.
2021-10-04Read eNode-B raw logsAnders Broman6-0/+193
2021-10-03wiretap: camins, vwr: Stop heuristics after 1GiBJohn Thacker2-3/+25
Very large 64 bit files are supported, so the CAM Inspector and Ixia Veriwave heuristics, which are fairly weak and either always (CAM Inspector) or possibly (Veriwave) try to read the entire file should stop their heuristics and make a decision after some reasonable length. Without this, the GUI freezes for seconds, minutes, or even hours by merely clicking on a large file in the file chooser, as wtap_open_offline attempts to determine the file type. The same issue occurs in capinfos, captype, tshark, editcap, etc. In addition, previously the CAM Inspector heuristics could give the wrong result on very large files, because 10 * invalid_pairs could overflow its guint32 and then end up comparing as less than valid_pairs. Fix #17620
2021-09-30ws_getopt: Rename struct and macrosJoão Valverde1-3/+3
This is part of the API and should also be renamed to avoid conflicts.
2021-09-30Qt: Reload Lua FileHandler when having a capture fileStig Bjørlykke2-0/+16
Support reloading a Lua FileHandler when this is in use for a loaded capture file. Prompt to save the file if having unsaved changes because the file must be reloaded. Fixes #17615
2021-09-25libwiretap: fix test for built-in file types.Guy Harris1-1/+1
The file type/subtype for built-in types are <= wtap_num_builtin_file_types_subtypes - the plugin types are given type/subtype values after the last built-in type/subtype value. Fixes #17614.
2021-09-15Support LZ4 versions earlier than 1.8.0Erik Rigtorp1-0/+10
2021-09-12blf: report a bunch of errors.Guy Harris1-2/+83
2021-09-12blf: most reads in a packet are errors even if they get an EOF.Guy Harris1-20/+31
If the *first* read for a packet gets an EOF, it means that there is an EOF right at the point where you're reading, which means "no more packets". If you get an EOF on any *subsequent* reads for the packet, it means the file was cut off in the middle of the packet's record, which is an error.
2021-09-12blf: remove the function name from ws_debug() calls.Guy Harris1-69/+69
ws_debug() inserts the file name, line number, and function name into the ws_debug() message (assuming the function name can be obtained from a macro), so there's no need to include it in the text of the message (we don't do so elsewhere).
2021-09-11blf: do more work in blf_init_rec().Guy Harris1-38/+35
Set the block, presence flags, capture length, and length there.
2021-09-11blf: use common code to read the log object header.Guy Harris1-82/+27
2021-09-11wiretap: Add zstd and lz4 as WTAP compression typesJohn Thacker2-16/+54
This has a few effects on the behavior of wtap_get_compression_type() and wtap_get_all_compression_type_extensions(): Make capinfos correctly report the compression type (instead of saying gzip compressed for zstd and lz4 compressed files). Makes files with the .zstd and .lz4 extension show up in the file chooser when "Files of type" is set to something other than "All Files", such as "All Capture Files" or "Wireshark/... pcapng" Makes the UI not default to gzip compression when saving a file compressed as zstd or lz4 (write support for zstd and lz4 doesn't exist yet, and the GUI doesn't have hooks for it anyway, though this can help as a prerequisite for later support for writing.) Also replace a couple of assert() with ws_assert(). Update the PURPOSE in CMakeLists for zstd and lz4 to note that they can be used to read compressed capture files.
2021-09-11blf: fix indentation.Guy Harris1-1/+1
Fix indentation of a while() clause, so that it's indented less than the body of the while() loop.
2021-09-11blf: make blf_read_block() static.Guy Harris1-3/+1
It's not used outside blf.c.
2021-09-11Fix spelling errors.Guy Harris2-2/+2
The Ubuntu build commented on some spelling errors in executable code files. Fix the errors that don't come from external files containing the spelling errors (USB product and vendor IDs, PCI IDs, ASN.1 specifications), and fix some errors that don't show up in the executable code files (e.g., in comments and variable names).
2021-09-09wtap_opttypes: move more if_filter and packet_verdict stuff together.Guy Harris1-4/+4
As we did in earlier changes.
2021-09-09BLF: Adding LIN supportDr. Lars Völker2-3/+118
This patch adds support for LIN Messages in BLF.
2021-09-09wtap_opttypes: move the specialized options after the custom options.Guy Harris2-114/+113
Move the if_filter and packet_verdict option stuff after the custom option stuff in various places. Fix some comments while we're at it.
2021-09-09pcapng: clean up block length checks.Guy Harris1-9/+26
Use the same style of message for too-short block errors ("pcapng: total block length XXX of {a,an} XXX is too small..."). Add an additional check for the "skip" Netflix cutom block, to make sure it has enough room for the 4-byte "skipped" value.
2021-09-08Fix two memory leaks on ZSTD and LZ4 decompressionNardi Ivan1-0/+6
2021-09-07file_wrappers.c: use LZ4 if the library is 1.7.3 or laterPascal Quantin1-7/+12
2021-09-07pcapng: Fix Branch condition evaluate to a garbage valueAlexis La Goutte1-0/+1
wblock->internal is not initialized on pcapng_read_custom_block function pcapng.c:3747:9: warning: Branch condition evaluates to a garbage value [core.uninitialized.Branch]
2021-09-06pcapng(wiretap): Fix Dead Store found by Clang AnalyzerAlexis La Goutte1-1/+0
pcapng.c:2675:5: warning: Value stored to 'opt_cont_buf_len' is never read [deadcode.DeadStores]
2021-09-06nettrace_3gpp (wiretap): Fix Dead Store found by Clang AnalyzerAlexis La Goutte1-3/+1
nettrace_3gpp_32_423.c:256:2: warning: Value stored to 'prev_pos' is never read [deadcode.DeadStores] nettrace_3gpp_32_423.c:295:2: warning: Value stored to 'next_msg_pos' is never read [deadcode.DeadStores] nettrace_3gpp_32_423.c:487:4: warning: Value stored to 'port_type_defined' is never read [deadcode.DeadStores]
2021-09-03Vector BLF: add WLAN interface nameTomas Kukosa1-0/+3
2021-09-03Vector BLF: WLAN frame supportedTomas Kukosa2-0/+72
2021-09-02Remove an out-of-date comment.Guy Harris1-5/+0
(It appears gsize/gssize are now the same size as size_t, even on 64-bit Windows, i.e. they're long longs on 64-bit Windows.)
2021-09-02file_wrapper: fix compilation without LZ4.Dario Lombardo1-0/+2
2021-09-02Clean up handling of buffer size/offset/etc. types.Guy Harris1-13/+67
Use guint for them, and don't let the buffer sizes get bigger than 2^30, so they all fit in a guint.
2021-09-01Fix build for debian and macOSErik Rigtorp1-5/+5
2021-09-01Add support for ZSTD and LZ4 decompressionErik Rigtorp2-11/+155
- Describe zstd and lz4 support in man pages - Update AUTHORS - Update mime types to recognize zstd and lz4
2021-08-30pcapng: write packet and Netflix custom blocks the same as other blocks.Guy Harris3-277/+441
Use compute_options_size() to get the total size of all the options, and use write_options() to write out the options for those blocks, as we do for other blocks. Get rid of wtap_block_option_get_value_size() and wtap_block_get_options_size_padded(); they're no longer needed, and their notion of an option's "size" is "size in a pcapng file", so that doesn't belong in code that's intended to support all file types.
2021-08-30ngsniffer: fix a routine name.Guy Harris1-10/+6
That routine now only processes frame records; call it process_frame_record().
2021-08-30ngsniffer: clean up the read process.Guy Harris1-72/+112
Have a routine to read the Sniffer record header, and call that in ngsniffer_read() and ngsniffer_seek_read(). Only call ngsniffer_process_record() for frame records that we understand, so that we only allocate a block for those rather than for records we don't understand or for EOF records, potentially leaking them.
2021-08-29wiretap: always allocate a block for a record.Guy Harris50-4/+80
Without that, you could add a comment to a record in a file format the reading code for which doesn't allocate blocks, but the comment doesn't get saved, as there's no block in which to save the comment option. This simplifies some code paths, as we're either using the record's modified block or we're using the block as read from the file, there's no third possibility. If we attempt to read a record, and we get an error, and a block was allocated for the record, unreference it, so the individual file readers don't have to worry about it.
2021-08-29pcapng: remove include of wtap_opttypes.h.Guy Harris1-1/+0
It's already included by wtap/wtap.h, which this file includes, and it doesn't need to be included that early, so that #include isn't necessary.
2021-08-29peektagged: set rec->block right after rec->rec_type.Guy Harris1-1/+1
That's how it's done in other files, and the two are somewhat connected (the record type and block type are somewhat correlated).