aboutsummaryrefslogtreecommitdiffstats
path: root/merge.c
AgeCommit message (Collapse)AuthorFilesLines
2011-11-21On an I/O error, merge_read_packet() and merge_append_read_packet() needguy1-7/+22
to return a pointer to the merge_in_file_t that got the error. Set *err to 0 on success and an error code on an err, treat a null return as an EOF indication, and if we don't get a null return check for a non-zero error code and treat that as an I/O error. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39964 f5534014-38df-0310-8fa8-9805f1628bb7
2011-11-19When reporting "sorry, *this* packet can't be written to a file of thatguy1-10/+18
type" when writing out a capture file (i.e., writing a per-packet-encapsulation capture to a file type that supports it but doesn't support one of the packet's encapsulations), report the packet number and, when doing this in a merge operation, report the file from which it came. When reporting "sorry, that file can't be written to a file of that type, period", show the file type rather than the input file link-layer type that causes the problem. (We could show both. We could be *really* ambitious and iterate through all possible file types and show the ones that will or at least might work....) file_write_error_message() is documented as handling only UNIX-style errnos, and libwireshark should be usable without libwiretap, so leave it up to its callers to handle Wiretap errors such as WTAP_ERR_SHORT_WRITE. Clean up indentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@39949 f5534014-38df-0310-8fa8-9805f1628bb7
2010-03-27Squelch some compiler warnings.guy1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@32312 f5534014-38df-0310-8fa8-9805f1628bb7
2009-10-05Fixed a size data type.stig1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@30329 f5534014-38df-0310-8fa8-9805f1628bb7
2009-04-15Try to fix bug 3279 (initialize a time_t to a sane value).gerald1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28055 f5534014-38df-0310-8fa8-9805f1628bb7
2007-12-05The first component of a "wtap_nstime" is a "time_t", which could be anguy1-1/+1
"int" or a "long"; initialize it with LONG_MAX cast to "time_t". The second argument is an "int"; initialize it with INT_MAX. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@23764 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-24EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry! ulfl1-5/+5
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ... What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere. As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon. Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way... As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15520 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-19Add APIs to Wiretap to return the file of the size as supplied by the OSguy1-8/+4
(so if the file's gzipped, it's *NOT* the size of the file after uncompressing), and an approximation of the amount of that data read sequentially so far. Use those for various progress bars and the like. Make the fstat() in the Ascend trace reader directly use wth->fd, as it's inside Wiretap; that gets rid of the last caller of wtap_fd() (as we're no longer directly using fstat() or lseek() in Ethereal), so get rid of wtap_fd(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15437 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-29The common merge code merely needs to offer the abstraction of routinesguy1-137/+85
that return the next packet from a set of {chronologically sorted, sequential-by-file} packets; it doesn't need to have a loop over all those packets, or any code to write packets. Supply those abstractions, change the code that merges packets to do its own writing, and have the Ethereal version manage a progress bar and have the mergecap version print packet numbers in verbose mode, as the common merge code used to do. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12427 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-28Make "merge_files()" and "merge_append_files()" return a tri-stateguy1-19/+17
indication - success, read failure, write failure - and have their callers handle read failures by looking for the file that got the read failure and reporting the failure in question. Free up the err_info string returned by "wtap_read()" after using it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12423 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-28Remove all the verbose-mode code from merge.c, and put most of it inguy1-231/+147
mergecap.c (get rid of the verbose printing of information for each packet). Have "merge_append_files()" return FALSE only on a write error, as "merge_files()" does. Sort the routines in "merge.c" in the order from "merge.h". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12422 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-27Get rid of merge_n_files() - it's only called in one place now, andguy1-49/+0
absorbing its logic into "cf_merge_files()" simplifies things a bit. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12421 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-27Change some of the merge.c APIs to return more information on failure,guy1-44/+51
and use that information to provide better error messages. Have "merge_open_outfile()" do all the work of filling in the merge_out_file_t structure, with the values to use passed as arguments. Get rid of some structure members that used to be used solely to pass information to "merge_open_outfile()". Add a "cf_merge_files()" routine to do the merging and reporting of errors. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12420 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-27Fix indentation.guy1-9/+9
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12411 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-17From Mark C. Brown: allow the file type for the merge operation to beguy1-2/+2
specified in the GUI. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12326 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-29avoid using tmpnam() for security reasons.ulfl1-15/+11
instead of giving the merge stuff a filename, give it an already opened file descriptor git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11273 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-21if more than one file is (drag and) dropped into the program,ulfl1-12/+2
merge them together into a new temporary file (and notice the user by a simple_dialog about it) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11205 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-18Fix compile errors on Suse 9.1:jmayer1-2/+2
- It's gboolean not boolean Fix warning about extraneous , at end of enum. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11177 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-18merge: remove code duplication in merge.c and mergecap.c (put it in merge.c),ulfl1-99/+80
and doing some more code cleanup git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11176 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-18merge: bugfixes and code cleanupulfl1-11/+10
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11175 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-17add Merge functionality to Ethereal in an experimental state.ulfl1-0/+458
Copied and sligthly modified merge.c from mergecap.c (needs a lot of code cleanup, though) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11171 f5534014-38df-0310-8fa8-9805f1628bb7