Commit Graph

474 Commits

Author SHA1 Message Date
Guy Harris 4d8d477018 Move create_tempfile() to tempfile.c out of util.c. This means dumpcap
no longer needs util.c, so it no longer includes routines that use
host_ip_af(), so it no longer needs to define its own host_ip_af().

That also means dumpcap.c no longer needs to include <sys/socket.h>.

svn path=/trunk/; revision=17278
2006-02-12 21:52:18 +00:00
Ulf Lamping 35dd233580 show the number of packets captured, if "Update list of packets ..." isn't used
svn path=/trunk/; revision=17071
2006-01-22 16:26:41 +00:00
Ulf Lamping 864edeb5ac add matched coloring rule name and string to the frame dissector output (or nothing if no coloring rule matched or none was set)
svn path=/trunk/; revision=17068
2006-01-21 17:49:00 +00:00
Guy Harris 0dbf17b690 Allow a progress dialog to have "Stop" or "Cancel" as the "terminate
button"; "Stop" should be used for operations that can only be stopped
(meaning that what it's already done isn't undone), not cancelled
(meaning that whatever it's already done *is* undone), for which
"Cancel" is used.

Allow the merging process to be cancelled.

Clean up indentation.

Update some comments.

svn path=/trunk/; revision=16489
2005-11-12 11:05:02 +00:00
Ulf Lamping a10a0d2636 from Jaap Keuter:
Anyone having objections to idea of stopping the load of a capture file
i.s.o. cancelling it? I'm refering to WishList Data I/O item #6.
It seems a very reasonable idea and easy to implement.

I've done some extensions:
-Improve the corresponding comment on the implications why this is useful
-added a new simple_dialog text to explain what's really going on (simply using the WTAP truncated packet message was a bit misleading)

svn path=/trunk/; revision=16441
2005-11-08 22:24:53 +00:00
Ulf Lamping c3187174bf replace *a lot* of file related calls by their GLib counterparts. This is necessary for the switch to GTK 2.6 (at least on WIN32).
to do this, I've added file_util.h to wiretap (would file_compat.h be a better name?), and provide compat_macros like eth_open() instead of open(). While at it, move other file related things there, like #include <io.h>, definition of O_BINARY and alike, so it's all in one place.

deleted related things from config.h.win32

As of these massive changes, I'm almost certain that this will break the Unix build. I'll keep an eye on the buildbot so hopefully everything is working again soon.

svn path=/trunk/; revision=16403
2005-11-06 22:43:25 +00:00
Guy Harris eb7e8111c6 Fix uninitialized variable errors.
Rename some variables to make the names used in progress bars more
common.  (Should more of that functionality be moved into common
progress bar code?)

svn path=/trunk/; revision=16347
2005-10-27 20:18:50 +00:00
Guy Harris 0203c65739 Check on every iteration of a loop whether to pop up a dialog box,
rather than checking only on every progress bar update quantum, so that
if the update quantum is *very* large, we don't end up waiting longer
than the standard time for a dialog box before checking.

svn path=/trunk/; revision=16327
2005-10-27 06:45:37 +00:00
Ulf Lamping bb5e5d6ce1 fix a packet_list_freeze / thaw pair, if a return comes in it's way
add a g_warning() call if an error occured while reading from capture file (while doing a live update), usually shouldn't happen but is difficult to debug *if* it happens
add a new log domain LOG_DOMAIN_MAIN and the standard log handler for it
add some (partly commented out) g_log() calls, useful for GUI sequence debugging

svn path=/trunk/; revision=16136
2005-10-06 00:55:21 +00:00
Ulf Lamping cd64e4627b minor bugfix: call cf_callback_invoke() from cf_close() even if the file is already closed. Otherwise the GUI will remain in the wrong state if a capture couldn't be started (e.g. wrong interface).
svn path=/trunk/; revision=16024
2005-09-27 21:46:39 +00:00
Ulf Lamping 831c54c4f5 add two new callbacks:
cf_cb_file_closing (called before closing a capture file) cf_cb_file_closed will be called afterwards, but both only if a file is really closed as cf_close is called more often ...

If we are closing large capture files (~20MB), the screen looks ugly while the file is closed. Change this so the screen will immediately go back to initial state and a dialog (without buttons) is shown that the file is currently closed. As the operation which takes most of the time to close the file is a single eth_clist_clear call, we can't use a progress bar here.

cf_cb_live_capture_stopping: called when the user wants to stop the capture (toolbar or menu clicked). At least on Win32, the time between this and the actual stop completed can be noticeable (1-2 seconds), so the user doesn't know if the button press did anything at all. Do something similar as above, show a dialog box without buttons to inform that the close is in progress.

svn path=/trunk/; revision=15891
2005-09-20 08:42:35 +00:00
Ulf Lamping 84cf7ce767 added compression support for capture file output. The Save/As dialog now has a checkbox "Compress with gzip"
currently limited to Ethereal and all the variants of libpcap filetypes only.

We might want to add output compression support to the other tools as well (tethereal, mergecap, ...).

We might also want to add support for the other filetypes, but this is only possible if the filetype functions doesn't use special output operations like fseek.

One bug is still left: if the input and output filetypes while saving are the same, Ethereal currently optimizes this by simply copy the binary file instead of using wiretap (so it will be faster but it will ignore the compress setting). 

Don't know a good workaround for this, as I don't know a way to find out if the input file is currently compressed or not. One idea might be to use a heuristic on the filesize (compared to the packet size summmary). Another workaround I see is to remove this optimization, which is of course not the way I like to do it ...

svn path=/trunk/; revision=15804
2005-09-14 21:57:30 +00:00
Guy Harris f34e1a97c6 Have cf_retap_packets() take an argument that indicates whether to
generate columns; use cf_retap_packets instead of cf_redissect_packets()
when running taps (the general flow graph stat uses the Info column).

svn path=/trunk/; revision=15793
2005-09-14 08:59:41 +00:00
Guy Harris d8873511a7 Frame numbers are unsigned, and they start at 1; 0 is what's used for
"unknown" for frame numbers.  Note that in epan/frame_data.h, and make
the frame number in experts unsigned, and use 0 for "unknown", and
display it as an unsigned number - and, if it's 0, don't display it at
all.

Fix the signature of "expert_dlg_draw()" to match what a tap's draw
routine's signature is expected to be.

svn path=/trunk/; revision=15760
2005-09-11 22:25:33 +00:00
Ulf Lamping 0b526d9703 start with fdata->num = -1, so we don't have an uninitialised value while doing read_filter style dissection
svn path=/trunk/; revision=15732
2005-09-08 21:36:40 +00:00
Ulf Lamping 723c80ea90 timestamp display precision:
- automatic adjustment depending on file format
- manual adjustment through menu items

save the setting in the recent file

svn path=/trunk/; revision=15534
2005-08-25 21:29:54 +00:00
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
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...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Guy Harris a0e68da918 Add a "register_dfilter_stat()", to register stats that take a display
filter as an argument on the command line and have a dialog box to enter
the display filter through the GUI.  Use it for all stats using
"gtk_tap_dfilter_dlg_cb()".

Add a top-level "stat_menu.h" file to declare "REGISTER_STAT_GROUP_E"
for the benefit of the declaration of "register_dfilter_stat()" in the
top-level "tap_dfilter_dlg.h".  Rename the "stat_menu.h" in the gtk
directory to "gtk_stat_menu.h", so as not to have two headers with the
same name.

Get rid of headers not declaring any functions not being used in the
module.

svn path=/trunk/; revision=15493
2005-08-21 09:48:27 +00:00
Guy Harris 0ec73a5eff Widen some variables so the code in question can handle large files if,
as, and when Wiretap can handle them.

svn path=/trunk/; revision=15462
2005-08-20 09:08:24 +00:00
Guy Harris 53b54d11ed Get rid of f_len field in capture_file structure - we can just keep
the length locally. within cf_read().

svn path=/trunk/; revision=15454
2005-08-20 02:14:01 +00:00
Guy Harris 38ec1644e6 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().

svn path=/trunk/; revision=15437
2005-08-19 19:40:00 +00:00
Ulf Lamping cc73e58f02 file.c(3079) : warning C4090: 'function' : different 'const' qualifiers
file.c(3079) : warning C4022: 'cf_callback_invoke' : pointer mismatch for actual parameter 2

svn path=/trunk/; revision=15418
2005-08-19 07:03:34 +00:00
Guy Harris e67b202e2c Have "f_datalen" keep track of the number of bytes of uncompressed file
data, so that "f_len" still keeps the size of the underlying file (which
is necessary in order to make the progress bar when files are being read
work correctly).

svn path=/trunk/; revision=15415
2005-08-19 01:17:24 +00:00
Jörg Mayer 956eee946f Some 'no previous declararion' warning fixes
svn path=/trunk/; revision=15355
2005-08-14 23:25:20 +00:00
Ulf Lamping 3e137afdc5 more snprintf() -> g_snprintf() replacements
svn path=/trunk/; revision=15284
2005-08-10 19:37:29 +00:00
Guy Harris 23b2341a9b We no longer generate a "Loading" message ourselves, we just pass the
name of the file being loaded to "delayed_create_progress_dlg()".  Get
rid of the pointless "g_strdup_printf()" call (which amounted to a
more-expensive "g_strdup()", and the variables it used.

svn path=/trunk/; revision=15248
2005-08-06 18:40:03 +00:00
Jörg Mayer 62b7cc3043 Last set of char -> const char trivial warning fixes.
svn path=/trunk/; revision=15244
2005-08-06 14:03:14 +00:00
Ulf Lamping bd1442f452 convenience: if a "Go To Packet" didn't succeeded, add the requested packet number to the error message,
svn path=/trunk/; revision=14510
2005-05-31 21:17:54 +00:00
Ulf Lamping a48744a84b add a new feature: list the files of a "File Set" (set of files generated by capturing "Multiple Files"/ringbuffer) and jump from one file of it to the next/previous one
svn path=/trunk/; revision=14231
2005-04-29 14:51:52 +00:00
Ulf Lamping 7ee0db1080 statusbar changes:
-show the current capture file size, if capturing in real time mode.
-move the packet "Drops" count (if available) from file to packets statusbar part

svn path=/trunk/; revision=14130
2005-04-18 22:05:56 +00:00
Ulf Lamping 55e312bb41 bugfix: show the right filesize after a live capture finished
svn path=/trunk/; revision=14118
2005-04-17 22:44:13 +00:00
Ulf Lamping 6e38159c25 add functions file_exists and file_identical to filesystem.c (coming from file.c)
svn path=/trunk/; revision=14057
2005-04-12 21:12:19 +00:00
Ulf Lamping 06ef0a3b52 it should now be possible to use "Update packets in real time" even if used with one of the "Multiple files" option.
If this is used together with an option where input files changes too fast (e.g. new file every second), capturing will be (hopefully) stopped.

I've replaced the former capture pipe message format into a somewhat more general format to remove a lot of confusion.


svn path=/trunk/; revision=14054
2005-04-12 00:54:52 +00:00
Ulf Lamping 0b132c9b1d bugfixes: bring non real-time captures back to former behaviour, other minor fixes
svn path=/trunk/; revision=13961
2005-03-28 21:05:53 +00:00
Ulf Lamping daa67c79ba a lot more capture engine code cleanup
most notably:

- moved opening of safe_file to the capture child (capture_loop.c)
- removed save_file_fd from capture_opts (no longer need to have it global)

svn path=/trunk/; revision=13953
2005-03-28 14:39:31 +00:00
Ulf Lamping 2b8ac21d60 move some color_filter related things from file.c to color_filters.c
svn path=/trunk/; revision=13920
2005-03-26 11:32:43 +00:00
Ulf Lamping ccff84dbdf code cleanup: use common prefix for all functions in color_filters.h
svn path=/trunk/; revision=13910
2005-03-26 01:09:14 +00:00
Ulf Lamping 008d4b8106 code cleanup: the term filter_list was used with different meanings throughout the code, and the filter_list of the color_filters is "global".
use appropriate prefixes to avoid confusion and bugs

svn path=/trunk/; revision=13905
2005-03-25 22:52:45 +00:00
Guy Harris d53df176c1 Add a "cleanup_dissection()" routine, intended to free up data
structures allocated by a dissection.  Currently, it's the same as
"init_dissection()", but they should be split with "init_dissection()"
allocating the initial data structures and "cleanup_dissection()"
freeing them and *not* reallocating the initial data structures.

Use "cleanup_dissection()" in "cf_close()" to make it easier to find leaks.

svn path=/trunk/; revision=13881
2005-03-23 12:58:59 +00:00
Ronnie Sahlberg d0009bca14 from didier
small fix to file.c



svn path=/trunk/; revision=13807
2005-03-19 10:01:34 +00:00
Ulf Lamping 801e9dd35e from Stefano Pettini: add CSV export function, similar to PSML export
svn path=/trunk/; revision=13724
2005-03-11 20:56:31 +00:00
Ulf Lamping 1be3391a94 bugfix in PSML export output: the epan API slightly changed, epan_dissect_fill_in_columns must be called now to fill in column data. This resulted in missing values in PSML output.
svn path=/trunk/; revision=13674
2005-03-09 07:51:07 +00:00
Ulf Lamping 399c821254 Another step towards using the parent/child mode for ALL captures.
This is currently still disabled, as we cannot pass all required capture flags to the child process (lack of command line parameters).

svn path=/trunk/; revision=13558
2005-02-28 22:46:49 +00:00
Guy Harris 9105b04e4b Have "cf_merge_files()" take a pointer-to-pointer-to-char as the output
file name argument; if the pointed-to pointer is null, it opens a
temporary file, and sets that pointer to a mallocated copy of the
pathname of the temporary file.  It no longer needs a file descriptor as
an argument.

svn path=/trunk/; revision=13419
2005-02-17 03:05:54 +00:00
Guy Harris ea7ef54b0d Have "cf_merge_files()" always close "out_fd" before returning; it does
so if "wtap_dump_fdopen()" succeeds (as a side-effect of calling
"wtap_dump_close()"), even if "cf_merge_fails()" after that, so it
should do so if it fails.

That means we don't need to close it in the callers of "cf_merge_files()".

svn path=/trunk/; revision=13407
2005-02-15 20:01:24 +00:00
Lars Roland f3294ee49a change nmake makefiles in /trunk and /trunk/epan so that
object code for libethereal.dll isn't generated by the
makefile in /trunk.

Having no code in /trunk linked into libethereal.dll
anymore, the definition of the macro _NEED_VAR_IMPORT_
can be moved from various source files in /trunk to /trunk/Makefile.nmake .
So do that, too.

svn path=/trunk/; revision=13389
2005-02-13 00:10:15 +00:00
Ulf Lamping 6d3d4bb708 bugfix for sync_mode captures, wasn't started correctly (cf_callback_invoke(cf_cb_live_capture_started); was never called)
svn path=/trunk/; revision=13369
2005-02-10 01:55:36 +00:00
Guy Harris 79a39eddbc Move the code to set the title on a window when a capture is in progress
to the "start live capture" callback, and call that from "do_capture()".

When opening a capture file, don't pop up the "What do you want to do?"
pane when closing any existing file you have open, as we're just going
to put the regular view up right after that.

svn path=/trunk/; revision=13332
2005-02-07 02:09:30 +00:00
Guy Harris 641106f21d Declare "cf_callback_t" before using it in a further declaration.
Mark the "func" argument to "cf_callback_remove()" as unused.

Get rid of the "iface" argument to "cf_start_tail()", as it's no longer
used.

svn path=/trunk/; revision=13331
2005-02-07 01:32:53 +00:00
Ulf Lamping 1c6b2cf0e3 Instead of calling each single thing when doing/finish a file operation, file.c shouldn't call all the GUI related functions itself, instead throwing some kind of Events to it's caller(s).
I've implemented a very simple callback mechanism which provides exactly this. I've tried GHook from GLib before, but this doesn't seem to be the right thing, as it's too inflexible for the purpose here.

So I've implemented a callback function in main.c which receives all "events" and spreads them to menu, statusbar and itself.

I would see this implementation as a prototype which may need  improvements. Please comment the changes.

svn path=/trunk/; revision=13330
2005-02-07 00:54:46 +00:00