summaryrefslogtreecommitdiff
path: root/wiretap
AgeCommit message (Collapse)AuthorFilesLines
2014-07-25Replace lseek/fstat by ws_lseek64/ws_fstat64Peter Wu2-4/+4
lseek returns an off_t type which is system-dependent. Use ws_lseek64 in favor of lseek as that supports 64-bit quanities. Use ws_fstat64 instead of stat to support 64-bit file sizes on Windows. For the majority of the changes, this makes no difference as they do not apply to Windows ("ifndef _WIN32"; availability of st_blksize). There are no other users of "struct stat" besides the portability code in wsutil. Forbid the use of fstat and lseek in checkAPIs. Change-Id: I17b930ab9543f21a9d3100f3795d250c9b9ae459 Reviewed-on: https://code.wireshark.org/review/3198 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-23Add cast to satisfy win7 buildbotEvan Huus1-1/+1
I really don't understand why MSVC would make the result of this computation an int64 then complain about down-casting to an int16 when *all* of the participating variables are int16 or smaller... Change-Id: I2d9c27ac22b51b10e4872a6640881c8d0ec566e7 Reviewed-on: https://code.wireshark.org/review/3180 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-23Logcat: Add support for conversion from Exported PDUMichal Labedzki1-8/+115
Exported PDU may contains (Binary) Logcat, so it is possible to "export" logcat binary from it. Change-Id: Ic6607126e739ea3972b46c2bf19f064597d4e970 Reviewed-on: https://code.wireshark.org/review/3001 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-07-20Use forward slashes in paths to runlex.shРоман Донченко1-1/+1
This gets rid of "MS-DOS style path detected" warnings from Cygwin. Change-Id: Id10429669704aa371dbf56a9398947c8002260ad Reviewed-on: https://code.wireshark.org/review/3024 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Graham Bloice <graham.bloice@trihedral.com> Tested-by: Wireshark Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-15Only one buffer.c, please.Guy Harris56-289/+52
Otherwise, if you link with both libwiretap and libfiletap, it's anybody's guess which one you get. That means you're wasting memory with two copies of its routines if they're identical, and means surprising behavior if they're not (which showed up when I was debugging a double-free crash - fixing libwiretap's buffer_free() didn't fix the problem, because Wireshark happened to be calling libfiletap' unfixed buffer_free()). There's nothing *tap-specific about Buffers, anyway, so it really belongs in wsutil. Change-Id: I91537e46917e91277981f8f3365a2c0873152870 Reviewed-on: https://code.wireshark.org/review/3066 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-15Have buffer_free() null out the buffer data pointer.Guy Harris1-1/+2
That prevents some double-free issues (I got one when doing non-"Update list of packets in real time" captures, if I do one such capture and then another one). Change-Id: Ia08034d9d1640bad21b74960efade8926dbfc5de Reviewed-on: https://code.wireshark.org/review/3063 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-15Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+0
Change-Id: I17dc2259e039586b9a06944bd1c2b552dd23855d Reviewed-on: https://code.wireshark.org/review/3052 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-07-15Fix up library names when using CMake on WindowsGraham Bloice1-4/+9
Change-Id: I3573e69eb54044bb915161756dbb8f18cc769061 Reviewed-on: https://code.wireshark.org/review/2957 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-11Fix the x64 builds after the commit:b3b1f7c3aa2233a147294bad833b748d38fba84dGraham Bloice1-3/+3
From Change: 2803 Change-Id: Ic57fb0e3c1e0450561aebe48a873a3fdb2e8e105 Reviewed-on: https://code.wireshark.org/review/3014 Reviewed-by: Graham Bloice <graham.bloice@trihedral.com>
2014-07-11Add strlen casts.Gerald Combs1-2/+2
Change-Id: Icaf80f060c476dd7259c04c4cce4123025ef1dab Reviewed-on: https://code.wireshark.org/review/3012 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-07-11logcat: improve (crash) robustness, improve namesPeter Wu1-102/+167
The logcat version detector would crash with ASAN enabled because it did not validate the payload length and hence a payload length of 0 would trigger out-of-bounds access. (This happened on non-logcat data.) This patch tries to get rid of all magic numbers by using a structure, improves the version detector to validate the payload length and prevents crashes due to missing nul-terminators in the input. Older Android kernels would create entries with __pad with random contents, so that cannot be used to determine version for v1. Instead, use heuristics on the priority, tag and maybe the msg field. Furthermore, Android is mostly (if not, always?) Little-Endian, so add conversions where necessary (just in case WS supports BE arches). "microseconds" has been renamed to "milliseconds" because that is what they are, actually. A duplicate logcat_log loop has been refactored such that one loop is sufficient, instead of separate buffers for each log part, a single one is now used. get_priority does not really need a pointer, just make it accept a character. The output has been validated against v1 and v2 logcat binary formats with __pad (hdr_size) equal to 0, and on attachment 9906. Change-Id: I46c8813e76fe705b293ffdee85b4c1bfff7d8362 Reviewed-on: https://code.wireshark.org/review/2803 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com> Tested-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-07-11Avoid sign-extending bytes before handing them to <ctype.h> macros.Guy Harris2-2/+2
Pointed out by the Visual Studio code analyzer. Change-Id: Idd429b4d0fb3db11ce171c3a5b38bdc55cc53c15 Reviewed-on: https://code.wireshark.org/review/2988 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-10Revert "More needed to get rid of "lib" in "libwsutil" on Windows."Guy Harris1-1/+1
This reverts commit 28719a4e4e01b478889dab9611fed517e506360e. Most of the change to remove "lib" seems to work, but the list of libraries to sign appears not to be in the source repository, so I can't make that step work. Change-Id: I32e400593e8a39f582cc702df34eea7f6e9e722a Reviewed-on: https://code.wireshark.org/review/2972 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-09More needed to get rid of "lib" in "libwsutil" on Windows.Guy Harris1-1/+1
Change-Id: Iffc12ce67a8245e96eac3cf253641a15385001a9 Reviewed-on: https://code.wireshark.org/review/2969 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06Fix more errors revealed by enum-to-integer conversion warnings.Guy Harris1-5/+5
Change-Id: Ib28af874cbac0623ed94e7558f3711e9a1b03a2d Reviewed-on: https://code.wireshark.org/review/2874 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06Squelch a warning.Guy Harris1-1/+1
Change-Id: Id27a6447dba9b6eda07933139a3f07edd71c8fd6 Reviewed-on: https://code.wireshark.org/review/2872 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06Pull the record processing into netmon_process_record().Guy Harris1-135/+126
That combines more common code from the read and seek-read code paths. Also, separate out the individual metadata record types, with a comment for each, to simplify the process of supporting some or all of them in the future. Change-Id: Ic8ded397d9550ec6013c1f5f138333b1ef5c37e5 Reviewed-on: https://code.wireshark.org/review/2869 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-05Fix an error caught by enum-conversion warnings.Guy Harris1-1/+1
(Strong typing is for weak minds. Human minds are weak. Therefore, strong typing is for human minds.) Change-Id: I2a973b6168235d5d1c7f2a5f8ac79b97b963d846 Reviewed-on: https://code.wireshark.org/review/2863 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-05Fix whitespace issues.Guy Harris1-5/+5
Change-Id: I69f84ca8b947be8e06005c82526559e3bc8f6387 Reviewed-on: https://code.wireshark.org/review/2861 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-05Handle the UTC timestamps in NetMon 2.3 files.Guy Harris1-122/+148
This addresses part of, but not all of, the issues in bug ten thousand, one hundred, and ninety: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=10190 (I'm spelling it out to make sure Gerrit doesn't think this change *does* address all the issues in that bug, and mark it as RESOLVED FIXED; I feel like I have to treat Gerrit as a dog or small child from whom I'm trying to keep a secret - "honey, I'm taking the dog to the vee eee tee".) Change-Id: Ic234130c1ea84cfaf47901485dca775e168f71d0 Reviewed-on: https://code.wireshark.org/review/2859 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-03catapult,irda: Fix ASAN crashes due to buffer underrunPeter Wu1-2/+2
The catapult dissector tripped on this random file I had. A quick look at other dissectors which use a construct like "-1] *= '*\\[rn]" showed packet-irda too, so fix that as well. Change-Id: I4b5fadcacd0b09d0fb29bdefc3dd1f28aef9b593 Reviewed-on: https://code.wireshark.org/review/2802 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-30Logcat: Remove commented codeMichal Labedzki1-8/+3
"g_strlcpy" guarante that "dest" to be null-terminated. Also cosmetic change from file_subtype to encap. Change-Id: If188a08cf34dd9def4203404962571c273740636 Reviewed-on: https://code.wireshark.org/review/2718 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-06-25Update a comment.Guy Harris1-13/+16
Also, make the block of code containing that comment intended consistently with spaces. Change-Id: I8e8eb346833662f15c53ece5869b12cc430bad11 Reviewed-on: https://code.wireshark.org/review/2661 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-25Boost the maximum snapshot length to 262144, for USBPcap.Guy Harris1-2/+2
Change-Id: I104bd9d1519298a0e4ff818f1cf821df594b3491 Reviewed-on: https://code.wireshark.org/review/2658 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-25Boost the maximum packet size to 131072.Guy Harris1-2/+2
Libpcap 1.6/tcpdump 4.6 will support up to 131072, as the MTU on the Linux loopback device is 65536 on at least some versions of the kernel, and that doesn't count the fake Ethernet header, so the maximum packet size is 65549; they went to the next power of 2 up. Change-Id: Ibfc66d01ef8ef7387887a75c2b567159bb78ac0f Reviewed-on: https://code.wireshark.org/review/2655 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-25Remove wiretap/AUTHORS (after ensuring all names are present in the ↵Jeff Morriss1-34/+0
top-level AUTHORS file). Change-Id: Ic3aa46c770f373541572e8507ec08b3439f3077f Reviewed-on: https://code.wireshark.org/review/2645 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-25Update my email address in a couple more spots.Jeff Morriss1-1/+1
Change-Id: I787ae2651a8083bc3082e5cb85dbd849823a16ca Reviewed-on: https://code.wireshark.org/review/2638 Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com>
2014-06-22Replace C++-style comments with "#if 0"/"#endif".Guy Harris1-2/+6
checkapi complains about C++-style comments, as some C compilers (IBM XLC, for one) reject them by default, and gcc -pedantic might do so as well. Change-Id: I1719da03d2fed0fe97574e200dd79434b3d760cd Reviewed-on: https://code.wireshark.org/review/2556 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-22Logcat: Fix dump formatsMichal Labedzki1-11/+13
Some dump formats are not exactly what should be done, so fix them and try to little improve them (mostly by space padding %-8s) Change-Id: I8ee38479c848abc0a2eaff30ce733e4b60930ac4 Reviewed-on: https://code.wireshark.org/review/2550 Reviewed-by: Michal Labedzki <michal.labedzki@tieto.com>
2014-06-20Add .rc files to the sources to have them included in the buildJoerg Mayer1-0/+1
Change-Id: I84dda519e617b24d92fcf374670a4a6ee6f488ee Reviewed-on: https://code.wireshark.org/review/2506 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2014-06-19Long and short names are invertedPascal Quantin1-1/+1
Change-Id: Ief3c86562d5eadb845b5a32dc704a61ccd27fdf6 Reviewed-on: https://code.wireshark.org/review/2443 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-16Explicitly declare/cast 'unsigned <variable>' as 'unsigned int <variable>'AndersBroman4-6/+6
Applying part of Bug 7825 Change-Id: I460b5c61b04d793ccc27c25debbd5e8f08bc6974 Reviewed-on: https://code.wireshark.org/review/2280 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-09HPM.2 IPMI Trace Data encapsulation formatU-beauty\bdn1-1/+4
Added a mapping between DLT_IPMI_HPM_2 link-layer header type to the IPMI Trace Wiretap encapsulation. Change-Id: I458d44ad0f51beecfe5589e0e9cb75f4771d866b Reviewed-on: https://code.wireshark.org/review/2054 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-06IPMI trace dissector (without PCAP-dependent part).U-beauty\bdn2-0/+4
Added KCS and TMode protocol dissectors. Request/response logic has been revised. Saved request data logic has been revised. Added Get Message command response dissector. Added missing PICMG command dissectors. Added new PICMG command dissectors. Added new PPS OEM command entries. Added VITA 46.11 command dissectors. From: Bill Meier: - refs to value_strings/range_strings in hf[] entries, by convention, should use VALS/RVALS macros; - refs to true_false_strings should use TFS(&...) macro. also: true_false_string definitions should not be defined as arrays. - remove some unneeded #includes (packet-ipmi.c). - Do some re-indentation. - Add editor-modelines as needed. bug: 10004 Change-Id: Ib269b35784c0b70892d1e0111bcfb483ea64092c Reviewed-on: https://code.wireshark.org/review/1185 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-04The subtype_seek_read() functions populate *phdr, not wth->phdr.Michael Tüxen1-3/+3
So don't use the values. This problem show up on pcapng files resulting from captures of multiple interfaces. Change-Id: I30b0598602b0b69233107d35be4360475d8648d8 Reviewed-on: https://code.wireshark.org/review/1950 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-04Guarantee that open routines are initializedMichal Labedzki1-0/+2
Open routines need to be initialized before try to open capture or add/remove routine. Change-Id: Ic3b88eef947ebd4a3dd2edf8120bb6bd8aec0765 Reviewed-on: https://code.wireshark.org/review/1874 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-05-30Honor configured CMAKE_INSTALL_LIBDIR when installing librariesBalint Reczey1-3/+3
Change-Id: I860c9408ed01e9567992b0dcf5c6c6421344c13e Reviewed-on: https://code.wireshark.org/review/1862 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-05-24Distinguish between "events" and "reports".Guy Harris2-8/+37
Have two different classes of file-type-specific records - "events" and "reports". An "event" indicates something that happened in the capture process, such as a status transition on the network; a "report" just gives information not corresponding to something happening in the capture process, such as capture statistics. Note that both of those should be dissected and displayed like packets, and leave open the possibility of file-type-specific records whose contents should be processed and saved but not displayed in the packet list. Shorten "file_type_specific" to "ft_specific". Change-Id: I2342d82ef992c794b76f354c057823dd5eb371e6 Reviewed-on: https://code.wireshark.org/review/1779 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24Fix a compiler warning.Guy Harris1-1/+1
Change-Id: I5b4b518982dc6033842b1e791e67d2faddfb5487 Reviewed-on: https://code.wireshark.org/review/1777 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24Add support for plugins to handle pcap-ng block types.Guy Harris5-14/+153
We rename "file format" plugins to "libwiretap" plugins, as they can register as read handlers for a new file type, read/write handlers for a pcap-ng block type (or both). To register as a pcap-ng block type handler, in the register_wtap_module() routine of your plugin, call register_pcapng_block_type_handler() with the pcap-ng block type and pointers to your routines to read and write those blocks. Those routines should read and write REC_TYPE_FILE_TYPE_SPECIFIC records, with the block type in the pseudo-header for the record in the struct wtap_pkthdr structure, with time stamps stored in that structure, and with a blob of data for the rest of the record. This is for bug 8590. Change-Id: I71847d834854a29ceb85894fd094c2ae91a04273 Reviewed-on: https://code.wireshark.org/review/1775 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-24Allow wtap_read() and wtap_seek_read() to return records other than packets.Guy Harris49-5/+218
Add a "record type" field to "struct wtap_pkthdr"; currently, it can be REC_TYPE_PACKET, for a record containing a packet, or REC_TYPE_FILE_TYPE_SPECIFIC, for records containing file-type-specific data. Modify code that reads packets to be able to handle non-packet records, even if that just means ignoring them. Rename some routines to indicate that they handle more than just packets. We don't yet have any libwiretap code that supplies records other than REC_TYPE_PACKET or that supporting writing records other than REC_TYPE_PACKET, or any code to support plugins for handling REC_TYPE_FILE_TYPE_SPECIFIC records; this is just the first step for bug 8590. Change-Id: Idb40b78f17c2c3aea72031bcd252abf9bc11c813 Reviewed-on: https://code.wireshark.org/review/1773 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-231.11.4 → 1.99.0.Gerald Combs1-1/+1
Change-Id: I5b0f713fdbc63e78f4f52177317c0e536aca3044 Reviewed-on: https://code.wireshark.org/review/1761 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2014-05-23file_seek() sets the error variable; no need to set it ourselves.Guy Harris1-1/+1
Change-Id: I637326841e6db562b0896e77c86c4ebf9c3b0561 Reviewed-on: https://code.wireshark.org/review/1756 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Fix comment.Guy Harris1-1/+1
Change-Id: Ifa526ff6a9f685a0956e1b2e49f35fecfd290cb0 Reviewed-on: https://code.wireshark.org/review/1755 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Get rid of extra trailing blank lines.Guy Harris1-1/+0
Change-Id: I2cb1fdc3bc27c0075cc1e4910dc32088d2695bff Reviewed-on: https://code.wireshark.org/review/1754 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Fix a comment.Guy Harris1-1/+1
Change-Id: I91a5c52939a516807431494a4120aecc5b0dba41 Reviewed-on: https://code.wireshark.org/review/1753 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Get rid of extra trailing blank lines.Guy Harris1-1/+0
Change-Id: I161bdbf08b35bfbfa1a19fc4facc5b72ef2b0390 Reviewed-on: https://code.wireshark.org/review/1752 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Get rid of trailing blank lines.Guy Harris1-2/+0
Change-Id: I53c560557d70e2a1cb78de37aad17d92a714ce2a Reviewed-on: https://code.wireshark.org/review/1751 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Fix the type of i4b_read_rec() to reflect what it actually returns.Guy Harris1-1/+1
Change-Id: Iafd4996a724418460043abda455a237a539c7925 Reviewed-on: https://code.wireshark.org/review/1750 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-05-23Remove trailing blank lines.Guy Harris1-1/+0
Change-Id: I62171eb8686fc31af901367182186ccd79098fe2 Reviewed-on: https://code.wireshark.org/review/1749 Reviewed-by: Guy Harris <guy@alum.mit.edu>