aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
AgeCommit message (Collapse)AuthorFilesLines
2022-04-13wiretap: Try opening systemd journal files before IxVeriWave.Gerald Combs1-1/+1
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-06wiretap: Update a comment.Gerald Combs1-1/+1
Wireshark's file formats are now listed in WiresharkInfo.plist.in.
2022-04-04Replace g_log() calls with ws_log()João Valverde1-1/+1
2022-03-17ieee80211-radiotap: Add support for headers to be bit-based as well as TLVs.Richard Sharpe1-0/+1
Johannes Berg pointed out this was the intent of the TLV definitions and supplied some code for implementing that. I simply made it work.
2022-03-14wiretap: have wtap_dump_close() provide a "needs to be reloaded" indication.Guy Harris3-10/+20
This allows the "needs to be reloaded" indication to be set in the close process, as is the case for ERF; having a routine that returns the value of that indication is not useful if it gets seet in the close process, as the handle for the wtap_dumper is no longer valid after wtap_dump_close() finishes. We also get rid of wtap_dump_get_needs_reload(), as callers should get that information via the added argument to wtap_dump_close(). Fixes #17989.
2022-03-14wiretap: Fix doxygen commentsMoshe Kaplan1-43/+59
Add asterisks to doxygen generates for existing supported_block_type comments. Add < to #define's so that doxygen associates comments with the #define above, instead of below.
2022-03-12Move Freedesktop files to resources/freedesktop.Gerald Combs1-1/+1
2022-03-10mpeg: handle the presence of an image in the ID3v2 header.Jeff Morriss1-1/+16
Fixes #17985.
2022-03-09Rename the "image" directory to "resources".Gerald Combs1-1/+1
The "image" directory contains resource compiler assets and other application resources, so name it "resources."
2022-03-04pcap: fix the handling of the reserved field.Guy Harris1-21/+18
Don't commit to it being a "class" field. Fix the bitfield for it.
2022-03-04pcap: process the subfields of the link-layer-type-plus-stuff field.Guy Harris1-41/+91
Extract the FCS length information from that field, and reject captures that have a non-zero "class" field (the 10-bit reserved field that was once intended to allow other "classes" of link layer type, with class 0 being "LINKTYPE_ values", but the original use case doesn't appear ever to have been used).
2022-02-28packetlogger: Handle SCO data packetsStig Bjørlykke1-0/+4
Add handling of sent and received SCO data packets. Fixes #17964.
2022-02-20pcap/pcapng: byte-swap the CAN ID field in CAN pseudo-headers for SLL2.Guy Harris1-1/+52
As for LINUX_SLL, so for LINUX_SLL2.
2022-02-13libpcap(wiretap): Fix unreachable-codeAlexis La Goutte1-1/+1
libpcap.c:1007:19: warning: code will never be executed [-Wunreachable-code]
2022-02-13blf: fix Wunreachable-codeAlexis La Goutte1-2/+0
blf.c:764:47: warning: code will never be executed [-Wunreachable-code]
2022-02-09Specify directory for temporary capturesDavid Perry4-9/+12
2022-02-01pflog: byte swap UID and PID fields in the header if necessary.Guy Harris1-0/+59
2022-01-30Add ZBOSS NCP protocol dissectorVladimir Bespalov3-0/+7
2022-01-18BLF: Make sure a struct is completely initialized.Gerald Combs1-4/+1
Initialize infstream. Fixes ``` *** CID 1497282: (UNINIT) /builds/wireshark/wireshark/wiretap/blf.c: 506 in blf_pull_logcontainer_into_memory() 500 } 501 502 int ret = inflate(&infstream, Z_NO_FLUSH); 503 /* Z_OK should not happen here since we know how big the buffer should be */ 504 if (Z_STREAM_END != ret) { 505 ws_debug("inflate failed (return code %d) for LogContainer %d", ret, index_log_container); >>> CID 1497282: (UNINIT) >>> Using uninitialized value "infstream.msg". 506 if (infstream.msg != NULL) { 507 ws_debug("inflate returned: \"%s\"", infstream.msg); 508 } 509 return FALSE; 510 } 511 /builds/wireshark/wireshark/wiretap/blf.c: 514 in blf_pull_logcontainer_into_memory() 508 } 509 return FALSE; 510 } 511 512 if (Z_OK != inflateEnd(&infstream)) { 513 ws_debug("inflateEnd failed for LogContainer %d", index_log_container); >>> CID 1497282: (UNINIT) >>> Using uninitialized value "infstream.msg". 514 if (infstream.msg != NULL) { 515 ws_debug("inflateEnd returned: \"%s\"", infstream.msg); 516 } 517 return FALSE; 518 } 519 /builds/wireshark/wireshark/wiretap/blf.c: 496 in blf_pull_logcontainer_into_memory() 490 infstream.avail_out = (unsigned int)tmp.real_length; 491 infstream.next_out = buf; 492 493 /* the actual DE-compression work. */ 494 if (Z_OK != inflateInit(&infstream)) { 495 ws_debug("inflateInit failed for LogContainer %d", index_log_container); >>> CID 1497282: (UNINIT) >>> Using uninitialized value "infstream.msg". 496 if (infstream.msg != NULL) { 497 ws_debug("inflateInit returned: \"%s\"", infstream.msg); 498 } 499 return FALSE; 500 } 501 ```
2022-01-17Frame: Parsing of PCAPNG Option Block PEN 46254Dr. Lars Völker1-0/+1
2022-01-16libpcap: set wth->priv to the libpcap_t before returning errors.Guy Harris1-6/+6
That ensures that it'll be freed on an error, fixing Coverity CID 1497311.
2022-01-16libpcap (wiretap): reorganize the file open code.Guy Harris1-345/+386
2022-01-16tshark: improve robustness for PCAPNGs not starting with IDBsDr. Lars Völker1-0/+1
The PCAPNG code assumes that PCAPNGs start with IDBs, which might not be true. This patch adds a workaround for Tshark to process such files.
2022-01-16BLF: improved checks to avoid hangsDr. Lars Völker1-5/+10
Improvements to fix a few hang scenarios found by fuzzing.
2022-01-15erf(wiretap): Fix Clang Warning Uninitialized argument valueAlexis La Goutte1-1/+1
2022-01-15BLF: Improve handling of zlib errorsDr. Lars Völker1-4/+26
2022-01-14BLF: improve debug log outputDr. Lars Völker1-3/+3
2022-01-14wiretap: Register a systemd Journal Export BlockJohn Thacker1-0/+21
The block is lightweight and doesn't have any options so the create function doesn't really do anything, but it needs to be registered so that when systemd journal files are opened, the wtap_block_create() call works and doesn't segfault. Fix #17875
2022-01-13libpcap: remove definition of unused structure.Guy Harris1-4/+0
We don't allocate a per-dumper private data structure, so there's no need to define a structure type.
2022-01-13wiretap: Fix description of Custom BlockJohn Thacker1-1/+1
2022-01-07Adding secret management in DSB.Jérôme HAMM1-0/+1
2022-01-06rfc7468: allow multiple structures per fileРоман Донченко1-51/+132
It's common to put multiple certificates in one RFC 7468 file in order to store a certificate chain, as described in the introduction to RFC 7468 itself. Support this usage by presenting each such certificate (or any other encoded structure - the code doesn't discriminate) as a separate packet. The new parsing code supports arbitrary line lengths, so update the detection code to support arbitrary line lengths as well. Instead of probing up to 20 lines, we now try to find the first pre-encapsulation boundary in the first 2048 bytes of the file. I chose this new limit so that it works roughly the same in practice as the old one (it's equal to 20 lines times 80 characters per line, rounded to a power of two).
2022-01-05BLF: Fix a coverity warning.Gerald Combs1-0/+1
Fix ``` *** CID 1496851: Resource leaks (RESOURCE_LEAK) /builds/wireshark/wireshark/wiretap/blf.c: 1621 in blf_read_apptextmessage() 1615 } 1616 1617 gchar *text = g_try_malloc0((gsize)apptextheader.textLength); 1618 1619 if (!blf_read_bytes(params, data_start + sizeof(apptextheader), text, apptextheader.textLength, err, err_info)) { 1620 ws_debug("not enough bytes for apptext text in file"); >>> CID 1496851: Resource leaks (RESOURCE_LEAK) >>> Variable "text" going out of scope leaks the storage it points to. 1621 return FALSE; 1622 } 1623 1624 /* returns a NULL terminated array of NULL terminates strings */ 1625 gchar **tokens = g_strsplit_set(text, ";", -1); ```
2022-01-03BLF: Adding support to read interface namesDr. Lars Völker2-26/+153
This patch reads out the interface of the meta data in BLF to set the interface names in Wireshark to these values.
2022-01-01Revert "epan: Initialize wiretap"João Valverde1-10/+0
This reverts commit c15f2aadc1aef3f4855c682ff7f686d5f63088cb. Crashes on exit. Needs more work. Fixes #17821.
2022-01-01Windows: UTF-8 harder.Gerald Combs1-1/+1
Set the process code page in wireshark.exe.manifest to UTF-8 as described at https://docs.microsoft.com/en-us/windows/apps/design/globalizing/use-utf8-code-page Make sure each of our command line resource files includes our main manifest. Rename wiretap.rc to libwiretap.rc to match our other libraries.
2021-12-22Corrects repeated words throughout the code.Moshe Kaplan9-10/+10
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-21Add a ws_posix_compat.h headerJoão Valverde1-1/+1
Currently used to define ssize_t on platforms that lack it. Fix some Windows build errors caused by moving the definition into a separate header. Fix some narrowing warnings on Windows x64 from changing the definition of ssize_t from long int to int64_t. The casts in dumpcap are ugly but necessary. The whole code needs to be rewritten for portability, or the warnings disabled.
2021-12-19Fix stdio.h conversions to use the scanf macrosJoão Valverde1-1/+1
2021-12-19Replace g_strdup_printf() with ws_strdup_printf()João Valverde53-345/+342
Use macros from inttypes.h.
2021-12-19Replace g_snprintf() with snprintf() (dissectors)João Valverde1-1/+1
Use macros from inttypes.h with format strings.
2021-12-19Replace g_snprintf() with snprintf()João Valverde15-36/+36
Use macros from inttypes.h with format strings.
2021-12-15wiretap: have dummy IDBs set OPT_IDB_TSRESOL if neededJohn Thacker1-0/+6
In wtap_dump_init_dumper(), when constructing a dummy IDB for files that don't have one, if the tsprecision value is anything other than the default, then the OPT_IDB_TSRESOL option also needs to be set. Without it, for a pcapng the timestamps will be written according to the tsprecision and time_units_per_second values, but when it is read, the values will be interpreted incorrectly. It would probably be better if the consistency of these values were enforced.
2021-12-15blf: Set OPT_IDB_TSRESOLJohn Thacker1-0/+1
In addition to setting tsprecision and time_units_per_second, add the OPT_IDB_TSRESOL option as well, because pcapng expects that to be set if tsprecision is anything other than the default.
2021-12-02wiretap: Fix an underflow in pcapng.Gerald Combs1-1/+1
Make sure account for our rounded option length when we process opt_endofopt. Fixes #17755.
2021-12-01nstime: Support ISO 8601 basic formatJohn Thacker2-2/+2
Add support in iso8601_to_nstime for the ISO 8601 Basic date/time format that lacks the - and : separators.
2021-11-29wiretap: Add header files to DoxygenMoshe Kaplan74-74/+80
Add @file markers for wiretap headers so that Doxygen will generate documentation for them.
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