Commit Graph

15 Commits

Author SHA1 Message Date
guy b74f760334 Add APIs to Wiretap to return the file of the size as supplied by the OS
(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
2005-08-19 19:40:00 +00:00
guy e0f9d36726 The common merge code merely needs to offer the abstraction of routines
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-29 00:36:52 +00:00
guy e7b1af0dc3 Make "merge_files()" and "merge_append_files()" return a tri-state
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-28 01:52:05 +00:00
guy 2709d68876 Remove all the verbose-mode code from merge.c, and put most of it in
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-28 01:06:11 +00:00
guy a3f4d1e970 Get rid of merge_n_files() - it's only called in one place now, and
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-27 23:45:10 +00:00
guy 95062e56ac Change some of the merge.c APIs to return more information on failure,
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-27 23:28:37 +00:00
guy 1abff05524 Fix indentation.
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12411 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-27 19:36:48 +00:00
guy 915bd4358e From Mark C. Brown: allow the file type for the merge operation to be
specified in the GUI.


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@12326 f5534014-38df-0310-8fa8-9805f1628bb7
2004-10-17 02:53:26 +00:00
guy 0f43797234 Set the svn:eol-style property on all text files to "native", so that
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-07-18 00:24:25 +00:00
ulfl f077f76846 avoid using tmpnam() for security reasons.
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-29 20:59:24 +00:00
ulfl 6587327fe5 if more than one file is (drag and) dropped into the program,
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-21 16:45:07 +00:00
jmayer 9e21ab29a6 Fix compile errors on Suse 9.1:
- 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-18 12:04:49 +00:00
ulfl 27a28bca23 merge: remove code duplication in merge.c and mergecap.c (put it in merge.c),
and doing some more code cleanup


git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11176 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-18 10:01:59 +00:00
ulfl fdc11b5f22 merge: bugfixes and code cleanup
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11175 f5534014-38df-0310-8fa8-9805f1628bb7
2004-06-18 07:41:21 +00:00
ulfl 8649e3f687 add Merge functionality to Ethereal in an experimental state.
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
2004-06-17 21:53:26 +00:00