aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap
AgeCommit message (Collapse)AuthorFilesLines
2012-06-02Try to squelch warningsAnders Broman7-23/+23
svn path=/trunk/; revision=43000
2012-06-02Try to squelch warningsAnders Broman1-20/+20
svn path=/trunk/; revision=42999
2012-06-02Try to squelch warningsAnders Broman9-35/+35
svn path=/trunk/; revision=42998
2012-06-01Export those file_ routines that Wiretap plugins would use (othersGuy Harris1-0/+8
should only be used inside Wiretap). svn path=/trunk/; revision=42986
2012-06-01TShark doesn't need wtap_fdreopen(), as it doesn't do saves and thusGuy Harris2-81/+28
doesn't do safe saves, so wtap_fdreopen() always needs to reopen the random file descriptor. At the point where a safe save is done, the sequential read is done, so the sequential stream is closed; there's no need to reopen it. (The former fourth argument to wtap_fdreopen() wasn't an indication of whether the file was compressed, it was an indicationof whether the random stream should be reopened.) svn path=/trunk/; revision=42977
2012-06-01Move wtap_fdreopen() to file_access.c for now, as it requires many ofGuy Harris2-118/+114
the same #includes. svn path=/trunk/; revision=42963
2012-06-01Need fcntl.h for the O_ #defines on Windows.Guy Harris1-0/+4
svn path=/trunk/; revision=42962
2012-06-01Sigh. There appears to be no way to get Windows to allow us to rename aGuy Harris6-21/+171
file that we ourselves have open. In the "safe save" code path for capture files, on Windows temporarily close the file descriptors for the currently-open capture before doing the rename and then, if the rename failed, reopen them, leaving the rest of the wtap and capture_file structures intact. Rename filed_open() to file_fdopen(), to make its name match what it does a bit better (it's an fdopen()-style routine, i.e. do the equivalent of an open with an already-open file descriptor rather than a pathname, in the file_wrappers.c set of routines). Remove the file_ routines from the .def file for Wiretap - they should only be called by code inside Wiretap. Closing a descriptor open for input has no reason to fail (closing a descriptor open for *writing* could fail if the file is on a server and dirty pages are pushed asynchronously to the server and synchronously on a close), so just have file_close() return void. svn path=/trunk/; revision=42961
2012-05-28Interface lists currently have to be constructed in the open routineGuy Harris1-12/+17
(otherwise, nobody sees them); do so. Fix some cases where we weren't doing the proper post-processing after doing the heuristics for format changes that didn't involve magic-number changes (discovered because constructing the interface list is now being done as part of that post-processing). Fixes bug 7287. svn path=/trunk/; revision=42872
2012-05-27Clean up indentation (remove tabs from one structure definition).Guy Harris1-26/+26
svn path=/trunk/; revision=42869
2012-05-27vwr_read_rec_header()'s return value is used only to distinguish successGuy Harris1-16/+9
(read a record header) from failure (got an EOF or an error). Make it just return a Boolean. If it fails in vwr_read(), don't overwrite *err_info (yes, vwr_read_rec_header() might have set *err_info, so don't lose - and leak! - the value it returned) - trust vwr_read_rec_header(), or the routines it calls, to have set it. (If there's a code path where that doesn't happen, that code path needs to be fixed; the setting of *err_info in vwr_read() should *not* be restored.) Thanks to Evan Huus for finding a useless variable with cppcheck, and reporting it in bug 7295, provoking me to look at this. svn path=/trunk/; revision=42865
2012-05-25In ns_hrtime2nsec(), cast "val" to guint64 to fix Coverity CID 702389 ↵Chris Maynard1-1/+1
Unintentional integer overflow. svn path=/trunk/; revision=42846
2012-05-24From Stephen Donnelly:Anders Broman3-35/+60
Add frame.interface_id support for pcap DLT_ERF file format https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7281 svn path=/trunk/; revision=42824
2012-05-24Keep track, in Wiretap, of whether the file is compressed, and provideGuy Harris5-3/+23
an API to fetch that. When doing "Save" on a compressed file, write it out compressed. In the Statistics -> Summary dialog and in capinfos, report whether the file is gzip-compressed. svn path=/trunk/; revision=42818
2012-05-23From Stephen Donnelly:Anders Broman1-1/+39
Add frame.interface_id support for ERF file format https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7266 svn path=/trunk/; revision=42807
2012-05-23In Windows, in the Save As and Export Selected Packets dialog, appendGuy Harris2-6/+12
the default extension for the file type iff the file type we're using has a list of extensions; the file has no extension or it has one but it's not one of the ones in the list. *Don't* expect a file extension to be at most 5 characters plus the dot - the extension for pcap-ng, our default capture file type, is "pcapng", and that's 6 characters! svn path=/trunk/; revision=42800
2012-05-19Z_BLOCK was added in zlib-1.2.0.5Jakub Zawadzki1-2/+8
Pass Z_NO_FLUSH to inflate() when Z_BLOCK is not defined, just in case also disable fast seeking when it's not defined. References: http://www.wireshark.org/lists/wireshark-dev/201205/msg00145.html svn path=/trunk/; revision=42714
2012-05-16Fix a bunch of uninitialized variables found by Coverity Scan. CIDsGerald Combs2-5/+5
702403, 702404, 702405, 702406, 702407, 702408, 702409, 702410, 702411, and 702412. svn path=/trunk/; revision=42658
2012-05-11Use "%parse-param" instead of a global variable. Fixes a scan-buildGerald Combs1-31/+31
warning. svn path=/trunk/; revision=42578
2012-05-05Directly calculate the time stamp based on the offset in the stream fromGuy Harris1-20/+18
the first bit in the stream. This prevents accumulated truncation errors. Get the seek offset from file_tell(). svn path=/trunk/; revision=42436
2012-05-04Clean up indentation.Guy Harris1-31/+30
svn path=/trunk/; revision=42427
2012-05-04ng_file_seek_rand() is supposed to return a Boolean; make it do so.Guy Harris1-3/+3
svn path=/trunk/; revision=42424
2012-05-04file_seek() used to be a wrapper around fseek() or gzseek(), both ofGuy Harris45-333/+172
which could use lseek() and were thus expensive due to system call overhead. To avoid making a system call for every packet on a sequential read, we maintained a data_offset field in the wtap structure for sequential reads. It's now a routine that just returns information from the FILE_T data structure, so it's cheap. Use it, rather than maintaining the data_offset field. Readers for some file formats need to maintain file offset themselves; have them do so in their private data structures. svn path=/trunk/; revision=42423
2012-05-04Fix comments.Guy Harris1-2/+2
svn path=/trunk/; revision=42413
2012-05-04Get rid of declaration of non-existent routine.Guy Harris1-1/+0
svn path=/trunk/; revision=42412
2012-05-04Make everything static that doesn't need to be exported.Guy Harris1-19/+19
svn path=/trunk/; revision=42409
2012-05-04Fix indentation.Guy Harris1-3/+3
svn path=/trunk/; revision=42408
2012-05-02Add a file_skip() routine to skip N bytes forward in the file - it'sGuy Harris2-7/+19
currently just a wrapper around file_seek(), but could be implemented by reading forward if, for example, we add support for reading (sequentially only!) from a pipe. Sort the declarations of file-reading routines into one block. svn path=/trunk/; revision=42391
2012-05-02Put all the comments about the "don't check the CRC" flag together, andGuy Harris1-11/+10
expand the resulting comment a bit. svn path=/trunk/; revision=42390
2012-05-02Use WTAP_ENCAP_IEEE_802_11_xxx for all the "802.11 plus radio header"Guy Harris5-95/+30
encapsulations. For pre-V9 AiroPeek captures, leave the radio information in the packet data, just as we do with the Prism, AVS, radiotap, and NetMon headers. Add a dissector for it. svn path=/trunk/; revision=42379
2012-05-01Remove unnecessary null-pointer check.Guy Harris1-4/+2
svn path=/trunk/; revision=42376
2012-05-01Fix 2 redundant redeclaration warnings and a bug where logical AND (&&) was ↵Chris Maynard1-4/+1
incorrectly used where bit-wise AND (&) was meant. svn path=/trunk/; revision=42373
2012-04-29Add ".dmp" as a suffix for pcap files of various flavors. Add ".ntar"Guy Harris1-8/+8
as a suffix for pcap-ng files. svn path=/trunk/; revision=42330
2012-04-28Remove _U_ from arguments that are actually used.Guy Harris1-5/+5
Fix a comment. svn path=/trunk/; revision=42311
2012-04-28If xml_get_int() fails, bail immediately; don't use the variable itGuy Harris1-14/+18
would have filled in had it not failed. (Thanks and a tip of the Hatlo hat to the Clang static analyzer for complaining about this.) svn path=/trunk/; revision=42306
2012-04-28Get rid of some unnecessary assignments, to remove warnings from theGuy Harris1-5/+1
Clang static analyzer. svn path=/trunk/; revision=42304
2012-04-26Remove duplicate comment.Guy Harris1-2/+0
svn path=/trunk/; revision=42270
2012-04-26Add a pcoreytohll() macro to extract "Corey-endian" 64-bit quantities,Guy Harris1-27/+24
and use it. Fix some comments. svn path=/trunk/; revision=42269
2012-04-26Use the pletohXX macros when fetching little-endian values.Guy Harris1-8/+5
svn path=/trunk/; revision=42256
2012-04-26Put the pseudo-header information for Veriwave packets into the bufferGuy Harris2-37/+196
in little-endian byte order, as that's what the dissector expects. Add a pletohl() macro for that purpose. Fix comments (the Veriwave code is *not* writing data to a file!) and clean up indentation. svn path=/trunk/; revision=42255
2012-04-26Use pntohs(), pntoh24(), and pntohl() to fetch big-endian data from theGuy Harris1-40/+32
headers. Fix some indentation. svn path=/trunk/; revision=42252
2012-04-26Global variables considered harmful. Move all the per-capture-fileGuy Harris1-407/+421
global variables into a structure that's attached to the wtap_t as private data, and make all the per-*packet* global variables local variables. svn path=/trunk/; revision=42251
2012-04-26Put pcapng_open() right after libpcap_open(); pcap and pcap-ng are ourGuy Harris1-2/+2
native file formats, so try them first. Move eyesdn_open() to the section for open routines for file formats that have a magic number - EyeSDN traces all start with "EyeSDN". svn path=/trunk/; revision=42250
2012-04-26If you get an I/O error when looking for the FPGA version, return -1, soGuy Harris1-16/+23
we know we had a real problem with the file. If we just get a short read, return 0, as it means the file is probably not a VWR file. If we get an invalid message length when reading packets (rather than when looking for the FPGA version), return WTAP_ERR_BAD_FILE and an "Invalid message record length" indication, not a generic fallback "can't read the file" error. For file_tell() errors, fetch the error code with file_error(). For file_seek() errors, use the error file_seek returned. svn path=/trunk/; revision=42249
2012-04-25Return 0 if doesn't match signature of vwr files.Martin Mathieson1-2/+4
Pointed out by Martin Kaiser in bug 7196. svn path=/trunk/; revision=42248
2012-04-25Add wtap_dump_fdopen_ngAnders Broman1-0/+1
svn path=/trunk/; revision=42231
2012-04-25Handle wtap_dump_fdopen() as wtap_dump_open() eg callAnders Broman2-37/+79
wtap_dump_fdopen_ng() and add a dummy IDB to be able to write pcapng files. Solves https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6969 mergecap: Can't open or create <FILENAME>: Internal error. We might want to add a SHB comment from mergecap giving the merged filenames or something like that, Merging of pcapng files is a different issue, idealy we should probably start using several SHB:s in that case. svn path=/trunk/; revision=42230
2012-04-25Remove some unnecessary includes and fix some indentation.Martin Mathieson1-8/+7
svn path=/trunk/; revision=42227
2012-04-22Fix a buildbot compile warning.Bill Meier1-1/+1
svn path=/trunk/; revision=42197
2012-04-22Various minor cleanup:Bill Meier1-200/+222
- fix a few small memory leaks; - fix some indentation to match style used (gnu); - remove trailing whitespace; - ... svn path=/trunk/; revision=42196