Commit Graph

622 Commits

Author SHA1 Message Date
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
Guy Harris 1041ccdbe5 Don't have "set_menus_for_captured_packets()" call
"main_set_for_capture_file()"; it should only deal with menus, not
anything else - and it gets called while the menus are being set up,
which is before the main window has been completely created, so
"main_widgets_show_or_hide()", which is called by
"main_set_for_capture_file()", gets errors trying to show or hide
widgets the pointers to which are null.

svn path=/trunk/; revision=13328
2005-02-06 23:16:05 +00:00
Ulf Lamping 3a63719e38 another two steps towards privilege seperation:
move another two capture related fields (iface and cfilter) from cfile to capture_opts

also move the handling of capture related command line options from main.c to capture.c, that way a future privilege seperated capture program can use the same code to parse it's command line than Ethereal. 
It might be even possible to share this parser code even with Tethereal, didn't took a closer look at this.

svn path=/trunk/; revision=13320
2005-02-06 21:20:35 +00:00
Ulf Lamping 244c060b45 use the interfaces descriptive name to be shown in the statusbar as it's, well, more descriptive
svn path=/trunk/; revision=13307
2005-02-05 14:37:56 +00:00
Ulf Lamping 9d18adec33 minor enhancements to Guy's last update
svn path=/trunk/; revision=13304
2005-02-05 13:44:27 +00:00
Guy Harris fa3e5609ab Put "cf_status_t" back.
svn path=/trunk/; revision=13303
2005-02-05 12:50:47 +00:00
Ulf Lamping 9bf11427f4 make some string parameters const, as they are not changed inside
svn path=/trunk/; revision=13298
2005-02-05 11:00:04 +00:00
Guy Harris 2c89242aac Instead of having a single enumerated type for status return values from
cf_ functions, have separate ones for different classes of routines, and
use gboolean when the return value is just "success" or "failure" - that
way you don't get compiler warnings if a case statement isn't handling a
particular status value if the routine in question won't return it.

svn path=/trunk/; revision=13293
2005-02-04 20:54:12 +00:00
Guy Harris d3e4fe620c Properly define "cf_start_tail()".
svn path=/trunk/; revision=13292
2005-02-04 20:32:32 +00:00
Ulf Lamping 0861927ce3 huge cleanup of capture file API (functions in file.c/file.h).
This includes: all functions in file.h now have a cf_ prefix, will have doxygen tags, will have the capture_file *cf as the first parameter and I tried to generalize the return values for non trivial functions.

Hopefully, I didn't introduced any new bugs, as I had to change a lot of files...

svn path=/trunk/; revision=13289
2005-02-04 18:44:44 +00:00
Ulf Lamping 10ee9093c8 remove #include "globals.h" and access to global cfile, use access functions and capture_opts instead
svn path=/trunk/; revision=13284
2005-02-04 08:42:39 +00:00
Ulf Lamping 9f171b0485 remove #include "globals.h" and access to global cfile, use access functions and capture_opts instead
svn path=/trunk/; revision=13283
2005-02-04 08:27:41 +00:00
Ulf Lamping dd71ad695f (some) redesign of capture data structures.
don't use global cfile at all but only an untpyed handle to call the cf_... functions in file.c
move the save_file member from capture_file to capture_opts, as it's only used while capturing and while preparing it

svn path=/trunk/; revision=13276
2005-02-04 01:29:29 +00:00
Guy Harris 6e622fd24e "gtk_entry_get_text()" returns a "const char *" - assign the result to
one.

"get_basename()" doesn't modify its argument, and its callers don't
modify the substring pointed to by the result, so make it take a "const
char *" as an argument and return a "const char *". 

"find_last_pathname_separator()" doesn't modify its argument, so make it
a "const char *" - but some of its callers pass a non-"const" "char *"
and modify the result, so don't make its return value a "const char *".
And, as none of its callers are outside "filesystem.c", make it static.

In "about_folders_page_new()", have separate variables for pathnames
returned as "const char *" (which are cached by the routine that returns
them, so you can't modify them - and can't free them, so get rid of the
commented-out "g_free()" calls for them) and pathnames returned as "char
*" (which are allocated anew for each call, and can be modified, but
have to be freed).

Clean up white space.

svn path=/trunk/; revision=12881
2004-12-31 00:26:36 +00:00
Guy Harris f1deabed56 Make the tone of the error messages a bit less formal, by using
contractions.  (Safari does, at least when you're trying to open a file
to which you don't have read access.)

svn path=/trunk/; revision=12852
2004-12-29 01:08:20 +00:00
Guy Harris e09e12621a 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.

svn path=/trunk/; revision=12427
2004-10-29 00:36:52 +00:00
Guy Harris 66e85e4e43 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.

svn path=/trunk/; revision=12423
2004-10-28 01:52:05 +00:00
Guy Harris dc2280bc1e 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".

svn path=/trunk/; revision=12422
2004-10-28 01:06:11 +00:00
Guy Harris d9bdadc4dd 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.

svn path=/trunk/; revision=12421
2004-10-27 23:45:10 +00:00
Guy Harris b48b8847b1 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.

svn path=/trunk/; revision=12420
2004-10-27 23:28:37 +00:00
Guy Harris 7f5b234c5c Move the column preferences stuff to epan (the rest of the preferences
stuff is already there).

Update Gerald's e-mail address in column.h.

svn path=/trunk/; revision=12131
2004-09-29 02:54:22 +00:00
Guy Harris 6472876ab3 Move the tap infrastructure to the epan directory.
svn path=/trunk/; revision=12128
2004-09-29 00:06:36 +00:00
Guy Harris bbe7f89742 Move prefs.c and prefs.h into the epan subdirectory.
svn path=/trunk/; revision=12115
2004-09-27 22:55:15 +00:00
Guy Harris f23f4ecf04 Use _WIN32 rather than WIN32 to determine if we're compiling on Win32;
according to Gisle Vanem, WIN32 isn't a built-in in MSVC, but _WIN32 is.

svn path=/trunk/; revision=11972
2004-09-11 23:03:36 +00:00
Guy Harris f06c1b5fb0 The packet range stuff knows about capture_file structures, so it's
really more of an Ethereal/Tethereal component than a libethereal
component (nothing else in libethereal knows about capture files); move
it back out of libethereal.  (The range stuff doesn't; we leave it in
libethereal.)

svn path=/trunk/; revision=11898
2004-09-04 20:02:11 +00:00
Guy Harris 478ba9a691 Rename "range.c" and "range.h" to "packet-range.c" and "packet-range.h";
they should ultimately be split into files with routines that handle
ranges, which are just subsets of [0,2^32), and packet ranges, which are
subsets of the packet list, possibly specified by a range.

Move them into epan, so they can be used by, for example, utilities that
handle ranges, such editcap.

svn path=/trunk/; revision=11890
2004-09-04 00:53:16 +00:00
Gerald Combs 16c708571a Move the guts of gtk/file_dlg.c:goto_framenum_cb() to
file.c:goto_framenum(), where all of the other goto_ routines live.

svn path=/trunk/; revision=11887
2004-09-02 19:52:39 +00:00
Gerald Combs c8235fae25 Move the file-reloading code from gtk/file_dlg.c to file.c.
svn path=/trunk/; revision=11823
2004-08-25 03:01:32 +00:00
Gerald Combs 76fd761686 As suggested by Guy: Have mark_frame() do nothing if the frame has
already been marked and have unmark_frame() do likewise.  Don't mess
with the marked frame count in mark_all_frames().

Be a little more paranoid about the marked frame count in other places.

svn path=/trunk/; revision=11775
2004-08-19 14:35:55 +00:00
Gerald Combs e986e98f0a If you mark all frames, then unmark all frames "marked_count" overflows.
Keep this from happening.

svn path=/trunk/; revision=11771
2004-08-18 21:05:38 +00:00
Gerald Combs 70ee7740c5 From Greg Morris: Add a configuration option to control search wrapping.
svn path=/trunk/; revision=11744
2004-08-15 19:26:25 +00:00
Guy Harris 999867b710 Move the code to open the printer/print file from "print_packets()" to
"print_ok_cb()", and have "print_packets()" just work on a
"print_stream_t" handed to it, so that different platforms can open the
printer/print file in different ways (opening the file is probably not
going to be platform-dependent, but opening the printer will be).

svn path=/trunk/; revision=11544
2004-07-27 20:10:02 +00:00
Guy Harris 5a3ab160c1 Make some generic print routines that take, as an argument, a pointer to
a structure containing a pointer to print operations for that object and
a pointer to the private subclass-dependent data for that object, with
subclasses for text and PostScript, and use those rather than the old
scheme where a print format was passed as an argument - or where (as in
the case of printing summary information in Tethereal) we just printed
as text even if "-T ps" was selected.

Check whether those routines succeed or get an I/O error writing output.

Clean up indentation.

svn path=/trunk/; revision=11514
2004-07-25 08:53:38 +00:00
Guy Harris c3cba6617b Move the color-filter related stuff out of "color.h" into
"color_filters.h", as that's the appropriate place for it - "color.h"
should just deal with "color_t".

svn path=/trunk/; revision=11503
2004-07-24 02:29:14 +00:00
Gilbert Ramirez 669db206cb Move dissectors to epan/dissectors directory.
Also move ncp222.py, x11-fields, process-x11-fields.pl,
make-reg-dotc, and make-reg-dotc.py.

Adjust #include lines in files that include packet-*.h
files.

svn path=/trunk/; revision=11410
2004-07-18 18:06:47 +00:00
Guy Harris 8a8b883450 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.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris d26e67c773 If we're producing PostScript, don't put the column headers out if we're
not putting the column data out.

Don't fill in the column information if we're not going to use it.

svn path=/trunk/; revision=11343
2004-07-08 11:07:29 +00:00
Guy Harris b650d01031 Make the "human-readable text vs. PSML vs. PDML" choice separate from
the "text vs.  PostScript" choice.  The "text vs. PostScript" choice
should probably ultimately be done with a generic set of print methods,
to handle various platform-native print mechanisms more cleanly (and
perhaps the dialog box code for "export as {PDML,PSML}" should be
separate from the "export as text"/"print" dialog).

svn path=/trunk/; revision=11342
2004-07-08 10:36:29 +00:00
Guy Harris 5f1b5daf6b A read can return WTAP_ERR_UNSUPPORTED_ENCAP if the encapsulation type
is per-packet and the packet has an encapsulation type we don't know
about, so handle it on reads as well as errors - show an error message
noting that we had a packet with a network type we don't know about, and
show the extra info returned for that error giving details.

It shouldn't return WTAP_ERR_UNSUPPORTED, however, so just give the
"wtap_strerror()" error for that case.

svn path=/trunk/; revision=11340
2004-07-08 07:45:46 +00:00
Guy Harris 272a2055ab On at least some platforms, a #define of O_BINARY is needed even if
<fcntl.h> is included, as <fcntl.h> doesn't define it.

svn path=/trunk/; revision=11276
2004-06-30 06:58:59 +00:00
Ulf Lamping a24b176c32 define of O_BINARY not needed, if fcntl.h is included
other #include related cleanups

svn path=/trunk/; revision=11272
2004-06-29 20:51:26 +00:00
Ulf Lamping 76af137169 added a small comment
svn path=/trunk/; revision=11023
2004-05-27 21:48:10 +00:00
Guy Harris 15af0f656f From Lars Roland: add support for building a libethereal.dll with MSVC:
add a config.nmake option to control whether to build
	libethereal.dll or not;

	remove "./wiretap" from PATH to prevent problems due to
	wrongly-loaded files;

	build dissector.lib with MSVC;

	move "print.c" and "ps.c" to the dissector helpers, as "print.c"
	imports variables from packet-frame.c and packet-data.c, which
	are in libethereal;

	move "g711.c" out of the dissector helpers, as they're used only
	by Ethereal in a tap, not in Tethereal or in any dissector;

	add a .def file for libethereal;

	arrange to declare global variables exported from libethereal
	with "__declspec(dllimport)" when building programs that import
	those variables;

	update the NSIS installer.

Make the "configure" script define ETH_VAR_IMPORT as "extern".

svn path=/trunk/; revision=10834
2004-05-09 10:03:41 +00:00
Ulf Lamping f02a0353ac bugfix: reset the tap listeners, when the capture file is closed
svn path=/trunk/; revision=10769
2004-05-02 15:04:14 +00:00
Olivier Biot ec6f31bced The display filter engine can return an error message that is not safe
when using GTK2 code for rendering the error. In order to correctly
render the error message, it must be XML escaped.

TODO: track down the remaining places where this XML escaping is
      required, and fix it there too (not sure if they exist though).

svn path=/trunk/; revision=10764
2004-05-01 22:55:22 +00:00
Ulf Lamping d9118dc089 add PROTO_ITEM_SET_HIDDEN() and PROTO_ITEM_SET_GENERATED(),
this sets flags for later rendering of the field data

svn path=/trunk/; revision=10752
2004-05-01 15:15:08 +00:00
Ulf Lamping 895375603d put all required data into the print_args,
instead of confusing seperation of data

svn path=/trunk/; revision=10692
2004-04-25 12:04:08 +00:00
Ulf Lamping 1531315c18 some code cleanup of the printing system
svn path=/trunk/; revision=10682
2004-04-24 23:13:46 +00:00
Ulf Lamping 51f987e04f added some options and enhancements to the print output:
-ps: added formatting hints for ghostscript, so pdf conversion will be much better
-ps: print a thin line at the top and bottom of each page
-ps/text: add an option to start a new page for every packet (formfeed)

svn path=/trunk/; revision=10660
2004-04-22 17:03:21 +00:00
Ulf Lamping 91e61df84e changed postscript output:
reduced print margin to 1/2 inch and font size to 8 point,
include filename in page header,
wrap too long lines

svn path=/trunk/; revision=10652
2004-04-20 22:34:08 +00:00
Guy Harris 6d2501b49f If we're printing summaries and packet detail or hex dump information,
print the header before each summary line, and print a blank line
separating the summary line and the remaining information.

svn path=/trunk/; revision=10614
2004-04-16 20:20:54 +00:00
Ulf Lamping 8c42aa51f7 make print dialog "Packet Format" options somewhat similar to the
Ethereal panes, thus better understandable

svn path=/trunk/; revision=10611
2004-04-16 18:17:48 +00:00
Guy Harris e5f2451735 Rename a bunch of variables and routines that pertain to string search
with "string" rather than "ascii", to make it clearer what they're
involved with.

Use "gtk_toggle_button_set_active()", not
"gtk_toggle_button_set_state()" (the latter is a deprecated alias for
the former, probably dating back to GTK+ 1.0[.x] - 1.2[.x] and later
have "gtk_toggle_button_set_active()").

Do *NOT* change the radio buttons for the type of string search to do
based on whether we're doing a string search or not - doing so means we
don't correctly remember the type of string search.

Get rid of code to fetch some values that we don't subsequently use.

svn path=/trunk/; revision=10609
2004-04-15 23:28:11 +00:00
Ulf Lamping 27ca219d2b two memory leaks removed
svn path=/trunk/; revision=10599
2004-04-14 05:46:34 +00:00
Michael Tüxen 254aba8282 From Jon Oberheide: Add interface name to the capture and ethereal window
while capturing.

svn path=/trunk/; revision=10594
2004-04-13 18:01:40 +00:00
Guy Harris 9feb374670 Don't refer to "auto_scroll_live" if HAVE_LIBPCAP isn't defined - and
put the definition of it back under HAVE_LIBPCAP and don't add an extra
declaration in "file.h", as there's no longer code that needs to refer
to it if HAVE_LIBPCAP isn't defined.

svn path=/trunk/; revision=10350
2004-03-08 23:45:25 +00:00
Jörg Mayer 452789c91f This makes ethereal compile again when configured --without-pcap
I don't know whether this is the optimal patch, but it does the job.

file.h: extern declaration of auto_scroll_live
file.c: always declare auto_scroll_live

svn path=/trunk/; revision=10347
2004-03-08 23:07:15 +00:00
Ulf Lamping 1cd1731da9 tweaked the simple_dialog texts, to reflect the current search behaviour
svn path=/trunk/; revision=10260
2004-02-28 22:04:28 +00:00
Guy Harris 6064ef84c2 Add a "force" argument to "filter_packets()" and
"main_filter_packets()", to force the filtering to be done even if the
filter is the same as the current one; this is necessary in order to
make sure "Follow TCP Stream" gets the packets processed even if you're
filtering the stream that's currently filtered in.

svn path=/trunk/; revision=10209
2004-02-23 22:48:52 +00:00
Guy Harris d84a87c5b3 Make the message a bit more detailed (modeled after the one from the
UNIX version of Acrobat Reader 4.0).

svn path=/trunk/; revision=10185
2004-02-22 22:33:59 +00:00
Guy Harris ca86d812b3 From Greg Morris: if a search reaches the end or beginning of the list,
pop up an alert box letting the user know, and asking whether they want
to continue the search.

svn path=/trunk/; revision=10184
2004-02-22 22:22:47 +00:00
Ulf Lamping ba50469654 rework of capture.c: better seperation of sync and capture pipe by using
explicit names and seperated functionality of do_capture(),
but no functional change!

svn path=/trunk/; revision=10168
2004-02-21 12:58:42 +00:00
Guy Harris 83634f54c7 Add routines that can be called from dissectors to report file open and
read errors; there are separate implementations for Ethereal (pops up an
alert box) and Tethereal (prints an error message).

Use those routines in the ASN.1 dissector.

svn path=/trunk/; revision=10152
2004-02-21 02:15:07 +00:00
Ulf Lamping 0a4e5cc16d fixed dialog box text and some comments
svn path=/trunk/; revision=10078
2004-02-17 17:48:44 +00:00
Guy Harris 75b5cbf585 Replace the "cf_XXX_error_message()" routines with
"cf_XXX_failure_alert_box()" routines that put the alert box up, and
directly call the "alert_box.h" routines for OS errors.

svn path=/trunk/; revision=10028
2004-02-11 02:02:38 +00:00
Guy Harris 3a4e71a724 Add "write_failure_alert_box()" to put up an alert box for a failed
attempt to write to a file (or close a file opened for writing).

Get rid of no-longer-needed #includes of <epan/filesystem.h>.

svn path=/trunk/; revision=10027
2004-02-11 01:37:13 +00:00
Guy Harris 727b913bbd Add an "open_failure_alert_box()" routine to pop up an alert box for a
failed attempt to open/create a file.

Fix one call to pass the right value for the "for_writing" flag.

svn path=/trunk/; revision=10026
2004-02-11 01:23:25 +00:00
Guy Harris c7fd1b2b13 Add a routine to be used to put up alert boxes for invalid display
filter expressions; use that in a number of places, so we use the same
alert box.  (More work is needed to figure out the right way to handle
some other "dfilter_compile()" failures.)

Use the error message from the display filter as the primary error, as
that's the message that tells you what the underlying problem is.  (The
GNOME HIG says "In most situations the user should only need the primary
text to make a quick decision", so the primary text should tell you
what's wrong with the filter, not just that it's invalid.  If there are
messages from the display filter code that don't give enough
information, or are a bit cryptic, such as "Unexpected end of filter
string," those should be fixed in the display filter code.)

Improve the error used if an empty filter is used for "find frame".

svn path=/trunk/; revision=10025
2004-02-11 00:55:28 +00:00
Ulf Lamping 1d2c791ab6 enhanced some dialog messages,
close capture file when user told so

svn path=/trunk/; revision=9965
2004-02-03 17:59:01 +00:00
Guy Harris e8a196911c Use "%ld", not "%u", to print "long" values.
svn path=/trunk/; revision=9962
2004-02-03 00:30:50 +00:00
Ulf Lamping 3f2f2929eb added some more info to the statusbar (filesize, packet count, ..),
fixed a minor bug in the cfile handling (file length in summary dialog)

svn path=/trunk/; revision=9961
2004-02-03 00:16:59 +00:00
Guy Harris f914e6e9e7 Fix the spelling of "cumulative" (and variables whose names derive from
that spelling).

svn path=/trunk/; revision=9917
2004-01-31 04:10:05 +00:00
Guy Harris 1980fa5dbf Pass ESD_BTN_OK rather than NULL as a second argument to
"simple_dialog()"; NULL might be #defined to be a pointer expression on
some platforms, causing compiler warnings (and, on platforms where a
null pointer doesn't have all its bits 0, possibly causing misbehavior,
although I don't think there are any such platforms on which Ethereal
runs).

Don't allow 0 as button mask argument to "simple_dialog()".

Squelch a compiler warning.

Report fatal problems as errors, not warnings.

Report file I/O errors with "file_open_error_message()".

Report file write errors (including those reported by "close()", e.g.
some errors writing to an NFS server) when saving raw packet data to a
file.

svn path=/trunk/; revision=9915
2004-01-31 03:22:42 +00:00
Ulf Lamping 25edd1c53e renamed ESD_TYPE_CRIT to ESD_TYPE_ERROR to
better reflect the real error text

svn path=/trunk/; revision=9913
2004-01-31 02:25:46 +00:00
Ulf Lamping fdc839f11b filter_packets: don't refilter all the packets,
if the new filter string is identical to the old one (as it's useless then)

svn path=/trunk/; revision=9858
2004-01-26 06:43:00 +00:00
Guy Harris f78b963082 Don't use "cf_read_error_message()" when reporting errors not from
Wiretap.

svn path=/trunk/; revision=9856
2004-01-25 22:27:12 +00:00
Guy Harris d6cd61061e Have the Wiretap open, read, and seek-and-read routines return, in
addition to an error code, an error info string, for
WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and
WTAP_ERR_BAD_RECORD errors.  Replace the error messages logged with
"g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed
strings returned as the error info string, and change the callers of
those routines to, for those errors, put the info string into the
printed message or alert box for the error.

Add messages for cases where those errors were returned without printing
an additional message.

Nobody uses the error code from "cf_read()" - "cf_read()" puts up the
alert box itself for failures; get rid of the error code, so it just
returns a success/failure indication.

Rename "file_read_error_message()" to "cf_read_error_message()", as it
handles read errors from Wiretap, and have it take an error info string
as an argument.  (That handles a lot of the work of putting the info
string into the error message.)

Make some variables in "ascend-grammar.y" static.

Check the return value of "erf_read_header()" in "erf_seek_read()".

Get rid of an unused #define in "i4btrace.c".

svn path=/trunk/; revision=9852
2004-01-25 21:55:17 +00:00
Guy Harris 7502ac216a There's no need to keep a "FILE *" for the file being printed to in a
"capture_file" structure.  Keep it locally, instead.

Check for errors when printing packets.

Report failure to open a print destination and failure to write to a
print destination differently.

Don't have the "print preamble" and "print final" routines return
success/failure indications - revert to the old scheme where they
didn't, and have the callers use "ferror()" to check for errors.

Report write errors when printing dissections in Tethereal.

Report print errors as errors, not warnings.

svn path=/trunk/; revision=9828
2004-01-25 00:58:13 +00:00
Guy Harris 65f18bb833 As with "file_write_error_message()", so with
"file_close_error_message()" - but just use "file_write_error_message()"
for UNIX-style errors, under the assumption that a close will only fail
because a buffer-flushing write fails or because "close()" itself fails
when, for example, pushing unsynced NFS client-side writes out over the
wire.

Make several routines in "print.c" return success/failure indications.

Check for write errors when printing "Follow TCP Stream" stuff or saving
it to a file.

svn path=/trunk/; revision=9825
2004-01-24 10:53:25 +00:00
Guy Harris d8d91ff347 As with "cf_open_error_message()"/"file_open_error_message()", so with
"cf_write_error_message()"/"file_write_error_message()".

Use "file_open_error_message()" instead of "cf_open_error_message()" in
some places we missed in the previous checkin.

Catch ENOSPC and EDQUOT in "file_open_error_message()".

Use "file_open_error_message()" rather than "file_write_error_message()"
to report errors when creating the file to which we're saving the
"Follow TCP Stream" data.

svn path=/trunk/; revision=9823
2004-01-24 02:01:44 +00:00
Guy Harris 46848f0a9e Add a new "file_open_error_message()" routine in "epan/filesystem.c", to
translate UNIX errno values to a somewhat friendly message format
string.

Rename "file_open_error_message()" in "file.c" to
"cf_open_error_message()", make "cf_open_error_message()" use the new
"file_open_error_message()" for UNIX errno values, have "do_capture()"
in "capture.c" use "file_open_error_message()" to report errors from
"open()", and make "cf_open_error_message()" static as nothing outside
"file.c" uses it.

Do similar stuff in "tethereal.c".

svn path=/trunk/; revision=9821
2004-01-24 01:44:29 +00:00
Ulf Lamping 503a830e48 The progressbar had a parameter to specify the text of the Cancel/Stop button.
As this will always be a Cancel of a running operation, this parameter was removed.
This makes us also able to use a stock button for this.

svn path=/trunk/; revision=9774
2004-01-21 22:00:28 +00:00
Ulf Lamping ef57df088f a.) saving GTK1 and GTK2 fontnames in different preference setting, to prevent problems when switching between GTK1 and GTK2 ethereal versions
b.) added new feature "Edit->Go To First Packet" "Edit->Go To Last Packet" with corresponding menu and toolbar items
c.) added new feature "View->Zoom In" / "View->Zoom Out" / View->Normal Size" with corresponding menu and toolbar items
This feature will act as a "size offset" to the current fontsize, so that the packet list/tree view/... will have a larger/smaller font size.
The value is stored inside the recent file.
d.) Win32 only: Try to get the win32 system font and fontsize at program startup and show the menus/dialogs and such with the same font and fontsize like other win32 windows.
This makes the program make a *lot* more feel like a normal win32 program.

svn path=/trunk/; revision=9753
2004-01-20 18:47:25 +00:00
Guy Harris 58ee0d5b69 Reset the tap listeners in "retap_packets()" before rerunning the taps.
svn path=/trunk/; revision=9677
2004-01-16 19:35:32 +00:00
Guy Harris 4dd10c6687 Add a routine "retap_packet()" that runs through all packets, dissecting
them and running all taps on them, but not reconstructing the packet
list.  Use that in the IO-stat tap rather than "redissect_packet()"; the
latter does more work and redraws the display, neither of which are
necessary.

Call the filter callback when the Calc field is changed, to redraw the
graphs; that change also fixes things so that it's called when the
Filter field is changed.

Rename the "filter_button" member of an io_stat_graph_t to
"filter_field", as it's not the "Filter:" button, it's the text field
containing the filter expression.

svn path=/trunk/; revision=9659
2004-01-13 22:34:10 +00:00
Ulf Lamping a6ff7799a2 close the Save (As) dialog, when the capture file is closed
svn path=/trunk/; revision=9642
2004-01-10 17:29:26 +00:00
Guy Harris 1591028c8e Have a common "process_specified_packets()" routine for processing
packets in a loop; it handles reading the packet from the capture file,
creating and updating the progress bar, handling the stop button,
and handling range specifications.

Use that for printing and saving packets.  (There might be other loops
that should use it as well.)

svn path=/trunk/; revision=9620
2004-01-09 22:56:59 +00:00
Guy Harris 84dcd53b03 We don't need to keep the progress bar quantum or next step in the
capture_file structure - just make it local to the routine scanning
through the packets.

svn path=/trunk/; revision=9616
2004-01-09 21:38:21 +00:00
Ulf Lamping ea0a32e92f use the same packet range things for "Print" dialog, as already implemented
in the "Save As" dialog and some other minor changes

svn path=/trunk/; revision=9610
2004-01-09 18:11:21 +00:00
Ulf Lamping 7e20ddc9f6 some code cleanup in range.c
svn path=/trunk/; revision=9609
2004-01-09 14:05:20 +00:00
Olivier Biot f5f60f1ba3 Fix the "unmarking a packet matching a color filter does not apply the color
filter's colors" bug, by storing the pointer to the matching color_filter_t
structure in the frame_data structure.

Replace "frame" and "frames" by "packet" and "packets" in many places.

svn path=/trunk/; revision=9607
2004-01-09 02:57:54 +00:00
Ulf Lamping 185b88da79 bugfix: init progbar to NULL at the right place
svn path=/trunk/; revision=9526
2004-01-02 21:47:06 +00:00
Ulf Lamping 7ec5f2a06c added a progressbar, when saving a large capture file
svn path=/trunk/; revision=9525
2004-01-02 21:01:40 +00:00
Ulf Lamping 14e2a790f9 From Dick Gooris (and me :-)
more ways to choose which packets can be saved,
in the save(as) dialog box

svn path=/trunk/; revision=9476
2003-12-29 20:05:59 +00:00
Guy Harris 39f5418dc0 From Lars Roland:
use the common display filter dialog infrastructure in the MGCP
	service response time tap;

	add common infrastructure for updating the titles of tap dialogs
	when the capture file name changes.

svn path=/trunk/; revision=9366
2003-12-19 23:41:55 +00:00
Ulf Lamping 156be8aa9f added "most recently used" lists for
"opened capture files" and "display filter used",
the settings will be saved in the file "recent" in the users config path

svn path=/trunk/; revision=9275
2003-12-13 18:01:30 +00:00
Ulf Lamping 4b890b83fd print system enhanced, more print ranges and expanded states
svn path=/trunk/; revision=9223
2003-12-09 22:41:07 +00:00
Guy Harris 11d8817da0 Don't automatically size the columns - that's expensive in large
captures, as it has to compute the width of an auto-resizing column in
every row.  Just pick fixed widths for the columns (and tune the width
of the "Protocol" column so that it's not narrower than the column
title).

svn path=/trunk/; revision=9219
2003-12-09 06:48:40 +00:00
Guy Harris 33b25ac15e From Jeff Morriss: avoid at least some N^2 behavior when changing the
time stamp format.

svn path=/trunk/; revision=9179
2003-12-06 04:05:02 +00:00
Guy Harris f0b9d12b6a Don't use GNodes for the protocol tree, put the sibling pointer, and
pointers to the first *and* last child, in the "proto_node" structure
itself.  That saves us one level of indirection and memory allocation,
and lets us append to a tree by appending to the last child directly,
rather than having to scan through the list of siblings of the first
child to find the end of that list.

svn path=/trunk/; revision=9171
2003-12-04 10:59:34 +00:00
Guy Harris 0c84e1c329 From Didier Gautheron: for each column format type, save the first and
last columns, if any, with that format, and use that to speed up
processing of columns with a particular format and checking whether
we're displaying a column with a particular format.

svn path=/trunk/; revision=9147
2003-12-02 23:14:32 +00:00
Ronnie Sahlberg 9d88e58e51 remove another slow GMemChunk from ethereal making ethereal a little bit faster
svn path=/trunk/; revision=9085
2003-11-25 14:07:45 +00:00
Ulf Lamping 44b39a7b3e removed no longer used gtk includes
svn path=/trunk/; revision=8971
2003-11-15 10:06:44 +00:00
Ronnie Sahlberg cd46db5e4b For Time Reference frames reset the counter for CulmulativeBytes.
This makes the CulmulativeBytes field make more sense since if we want
something to be a TimeReference frame it is likely that we also want to
measure BOTH time and number of bytes (==culmulative bytes) until the event we are looking at.

svn path=/trunk/; revision=8956
2003-11-13 08:22:48 +00:00
Gerald Combs 6f4dfded96 Remove MAX_DECODE_BUFFER_SIZE; it's no longer used.
svn path=/trunk/; revision=8948
2003-11-12 18:48:53 +00:00
Ronnie Sahlberg c1ffe5216e Update to cf_get_display_name()
return "<no file>" if there is no file loaded yet instead of crashing in io-stat

io-stat  only print the label for the top tick on the y axis to make it look less cluttered

svn path=/trunk/; revision=8781
2003-10-26 03:09:03 +00:00
Guy Harris ffa946f215 Correctly handle the case where the selected frame doesn't pass the
filter and no frames after it pass the filter either.

svn path=/trunk/; revision=8540
2003-09-25 08:31:52 +00:00
Guy Harris a2a41b88ad If the currently selected frame doesn't pass the display filter, select
the closest frame to that frame that did pass the display filter, if any
did.

svn path=/trunk/; revision=8539
2003-09-25 08:20:01 +00:00
Guy Harris 4e64afcb25 Pass a pointer to a "capture_file" structure to
"set_menus_for_selected_packet()" and
"set_menus_for_selected_tree_row()", and have them decide whether to
enable or disable menu items based on whether that structure indicates
that a packet or field is selected and, if one is, on its properties.

Pass to the "selected packet enabled" routine for a menu item the
"frame_data" and "edt" members of the "capture_file" structure, and pass
to the "selected tree row enabled" routine the "field_info" member of
that structure.

Clear "cf->current_frame" if no packet is selected.

svn path=/trunk/; revision=8525
2003-09-24 02:36:35 +00:00
Guy Harris dd628e00c7 Make "finfo_selected" a member of a "capture_file" structure rather than
an independent global variable.

svn path=/trunk/; revision=8524
2003-09-24 00:47:37 +00:00
Guy Harris 6aed321bb5 From Lars Roland: initialize the flags.ref_time field of a frame_data
structure.

svn path=/trunk/; revision=8496
2003-09-19 04:52:16 +00:00
Guy Harris 2b5a2b8926 We no longer pop up tap windows until we have a capture file open, so we
don't have to worry about the file name being null when
"cf_get_display_name()" is called.  (It should never be called before we
have a capture file open; if it is, that's a bug.)

svn path=/trunk/; revision=8482
2003-09-15 23:28:07 +00:00
Guy Harris 14509164fc Rename various capture file routines to have names starting with "cf_".
svn path=/trunk/; revision=8479
2003-09-15 22:48:42 +00:00
Guy Harris f56d16abab Add a routine to return the display name for a "capture_file" structure,
rather than constructing that name when a capture file is opened and
putting a pointer to it in that structure.

svn path=/trunk/; revision=8476
2003-09-15 22:16:08 +00:00
Guy Harris 673e47d4a9 Keep a "display name" as part of a capture_file structure; for live
capture temporary files, it's "<capture", and for saved capture files,
it's the last component of the pathname of the file.  Use that in
various places when displaying the file name.

svn path=/trunk/; revision=8474
2003-09-15 20:37:37 +00:00
Ronnie Sahlberg 007d873671 Added TimeReference frames.
One can now select a packet and mark it as a TimeReference packet using the menu.
A TimeReference packet will be indicated by having all timestamp related column entries replaced by the string *REF*
A TimeReference packet will always be displayed in the packet pane, and overrides any display filters.

When a frame is a TimeReference frame, all later frames will calculate the TimeRelativeToFirstPacket  relative to the timestamp of the TimeReference frame instead of the first frame of the capture.

You can have any number of TimeReference frames you like.

svn path=/trunk/; revision=8459
2003-09-12 02:48:23 +00:00
Guy Harris 3e1a532413 When saving packets, we have a "Save only marked packets" option; label
the option to print only marked packets similarly, rather than as
"Suppress unmarked packets" (for consistency, and because the latter
isn't unlike a double negative).

svn path=/trunk/; revision=8451
2003-09-10 22:23:58 +00:00
Ronnie Sahlberg 3185b945fb Update to the culmulative byte column.
Only calculate culmulative bytes on those packets that are actually displayed in the packet pane.

When a display filter is applied, culmulative bytes should only be calculated on thoise packets that are actually displayed.

svn path=/trunk/; revision=8418
2003-09-08 21:08:43 +00:00
Guy Harris 6d5d22162e If you get a read error while doing a search, go back to the frame where
we started.

svn path=/trunk/; revision=8365
2003-09-03 23:40:06 +00:00
Guy Harris 4a4d2dcf7e Check for "wtap_seek_read()" failing.
svn path=/trunk/; revision=8363
2003-09-03 23:15:40 +00:00
Ronnie Sahlberg b9ce30cd35 And for Cal,
Ethereal presents   a column to display culmulative bytes into the capture.

A new column type is added : Culmulative Bytes.
While PacketLength column type specifies the number of bytes in the current packet,
Culmulative Bytes specifies the culmulative number of bytes from the start of the capture.

svn path=/trunk/; revision=8359
2003-09-03 10:49:03 +00:00
Guy Harris 1cf6565adc Get rid of the EBCDIC stuff in the find dialog - it's not supported yet,
so we shouldn't torment the users by offering it.

Check the string type and convert it to an internal representation in
the GUI code; have the search code deal only with the internal
representation.

Save the case-sensitivity flag, and the indication of where string
searches look, along with other search parameters.

Upper-casify the string, for case-insensitive searches, in the GUI code;
don't save the upper-casified string, so it doesn't SHOUT at you when
you next pop up a "find" dialog.

Convert the hex value string to raw binary data in the GUI code, rather
than doing so in the search code.  Check that it's a valid string.

Connect the signals to the radio buttons after the pointers have been
attached to various GUI items - the signal handlers expect some of those
pointers to be attached, and aren't happy if they're not.

Have "find_packet()" contain a framework for searching, but not contain
the matching code; instead, pass it a pointer to a matching routine and
an opaque pointer to be passed to the matching routine.  Have all the
routines that do different types of searching have their own matching
routines, and use the common "find_packet()" code, rather than
duplicating that code.

Search for the Info column by column type, not by name (the user can
change the name).

When matching on the protocol tree, don't format the entire protocol
tree into a big buffer - just have a routine that matches the text
representation of a protocol tree item against a string, and, if it
finds a match, sets a "we found a match flag" and returns; have that
routine not bother doing any more work if that flag is set.
(Unfortunately, you can't abort "g_node_children_foreach()" in the
middle of a traversal.)

Free the generated display filter code after a find-by-display-filter
finishes.

svn path=/trunk/; revision=8306
2003-08-29 04:03:46 +00:00
Richard Sharpe 26285280d0 Apply Greg Morris' buffer overflow prevention patch to the find enhancements.
svn path=/trunk/; revision=8165
2003-08-14 22:32:45 +00:00
Richard Sharpe 2f8c75aed1 Applied the "Updated find capabilities...." from Greg Morris.
svn path=/trunk/; revision=8158
2003-08-11 22:41:10 +00:00
Guy Harris d2e2149ff9 From Greg Morris: add support for case-insensitive full-text searches.
svn path=/trunk/; revision=8132
2003-08-05 00:01:27 +00:00
Guy Harris 487d0def6b From Greg Morris: code to support searches for text or raw binary data
in a frame in Find Frame.

svn path=/trunk/; revision=8067
2003-07-22 23:08:48 +00:00
Guy Harris 4906ff281b From Tomas Kukosa: doubling the size of the line buffer when printing
isn't sufficient if the line to be printed is more than twice the
current size of the line buffer.  Make it twice the size of the line to
be printed, instead.

svn path=/trunk/; revision=7921
2003-06-24 06:14:46 +00:00
Guy Harris 55cb7ac8b7 The frame number passed to "goto_frame()" wasn't necessarily explicitly
specified by the user, so if the frame with that frame number isn't
being displayed, just refer to it as "That frame", not "The frame with
that frame number".  (That's even OK if they *did* specify it.)

(If there's no such frame, that "shouldn't happen" in cases where it was
implicitly specified, e.g. by getting it from a list of fragments, or a
"{request,reply} is in frame XXX" field, or clicking on a point in a TCP
graph.)

svn path=/trunk/; revision=7258
2003-03-02 22:37:03 +00:00
Guy Harris 6c9deead35 Have "goto_frame()" put up error dialog boxes itself, rather than having
its callers put up the same error dialog boxes.  Have it just return a
success vs. failure Boolean.

svn path=/trunk/; revision=7254
2003-03-02 22:07:25 +00:00
Guy Harris 25c3ac74fb The previous change caused the delta time to be the delta between a
frame and the previous frame in the capture - a frame that might not be
displayed, so you don't know what it was - rather than the previous
frame in the display, as is intended.  Fix that.

svn path=/trunk/; revision=6708
2002-12-01 20:19:44 +00:00
Ronnie Sahlberg 56e511657d calculate delta and rel time earlier and unconditionally of whether the packet passed the displayfilter or not.
there may be tap listeners that want to examine this field.

svn path=/trunk/; revision=6702
2002-11-29 11:02:13 +00:00
Guy Harris 96ba49f6ce From Tomas Kukosa: adjust the pointer into the line buffer if the line
buffer gets reallocated.

svn path=/trunk/; revision=6665
2002-11-23 03:19:39 +00:00
Guy Harris 79308de612 From Ronnie Sahlberg: don't have the tap code do a dissection, leave
that up to its callers, so only one dissection need be done when reading
a capture file.

svn path=/trunk/; revision=6442
2002-10-17 02:11:20 +00:00
Olivier Abad ec3cb87a27 Another problem found by valgrind :
in continue_tail_cap_file, the following test :
else if (*err != 0)
sometimes reads uninitialized memory (so the test might be incorrect).

We now set *err to 0 at the beginning of the function.

svn path=/trunk/; revision=6418
2002-10-14 19:59:51 +00:00
Olivier Abad 1b89d48835 Change to color filters :
- moved color_filter_t in color.h
- change color_filter_t to use color_t instead of GdkColor

This changed allowed to remove the last gtk includes in file.c. It is
now completely free of any gtk related code.

svn path=/trunk/; revision=6324
2002-09-23 19:09:52 +00:00
Olivier Abad d72aca0b7e Removed all gtk calls in file.c :
- created a few packet_list_xxx functions (ui_util.h gtk/packet_list.c
  gtk2/packet_list.c) ;
- removed almost all "gtk/xxx" and "gtk2/xxx" includes in file.c

The only remaining includes are related to color filters. We have to
make color_filter_t GUI independent by replacing GdkColor with color_t.
I'll work on this later.

svn path=/trunk/; revision=6311
2002-09-21 11:36:30 +00:00
Ronnie Sahlberg 756b43584a Enable the tap feature for ethereal as well. (will only update in real time for the gtk2 port though)
svn path=/trunk/; revision=6182
2002-09-04 22:15:39 +00:00
Olivier Abad 6c5954dac7 GTK+ v2 port.
All the deprecated widgets have not been replaced yet :

GtkList and GtkCList ==> GtkTreeView conversion :
- color_dlg.c
- column_prefs.c
- decode_as_dlg.c : done
- dfilter_expr_dialog
- filter_prefs.c
- main.c
- plugins_dlg.c : done

GtkCTree ==> GtkTreeView  conversion : done

GtkText ==> GtkTextView conversion : done

Remaining problems :
- gtk_font_selection_dialog_set_filter doesn't exist anymore (but hasn't
  been removed from the documentation). I don't know how to filter the
  font selection dialog to get only fixed width fonts ;
- we have to remove GUI prefs which are not usefule anymore : tree line
  style and tree expander style.

svn path=/trunk/; revision=6153
2002-08-31 09:55:22 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris abe6b6bcc8 From Ulf Lamping: extend the progress dialog box to give more progress
information.

Fix the types of some variables (make the file position in
"read_cap_file()" a "long", as Wiretap supports "long" offsets, and make
processed-packet counts in packet-processing loops "int"s, as the total
packet count in a "capture_file" structure is an "int").

svn path=/trunk/; revision=6112
2002-08-28 10:07:37 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the toplevel directory. The removal of winsock2.h will
hopefully not cause any problems under MSVC++, as those files using
struct timeval still include wtap.h, which still includes winsock2.h.

svn path=/trunk/; revision=5932
2002-08-02 23:36:07 +00:00
Guy Harris e04fc7ebfd From Graeme Hewson:
Ethereal sometimes creates a progress dialog bar and then, if
	the processing is fast, quickly destroys it.  The resulting
	"flash" can be disconcerting.  This set of patches ensures a
	progress bar is either not created or is displayed for a minimum
	time.

svn path=/trunk/; revision=5916
2002-07-30 10:13:16 +00:00
Richard Sharpe b5fa2524e6 Fix the problems WRT overwriting a capture file. From Joerg Mayer.
svn path=/trunk/; revision=5898
2002-07-21 16:54:22 +00:00
Guy Harris 44d19627ef From Graeme Hewson:
Allow "-" as the output file name in Wiretap, referring to the
	standard error.

	Optimize the capture loop.

Fix some of the error-message printing code in Ethereal and Tethereal.

Have Wiretap check whether it can seek on a file descriptor, and pass
the results of that test to the file-type-specific "open for output"
routine.  Have the "open for output" routines for files where we need to
seek when writing the file return an error if seeks don't work.

svn path=/trunk/; revision=5884
2002-07-16 07:15:09 +00:00
Richard Sharpe eac7bf1188 This seems to fix the problem of trying to save over the top of an existing
capture on some occassions.

svn path=/trunk/; revision=5872
2002-07-15 05:14:26 +00:00
Guy Harris 7dc9756921 Have "print_line()" take an indentation argument, and do blank
padding when printing text and use "putline" when printing PostScript.
Eliminate "hexdump", as it's just a special case of "putline".

Have "proto_tree_print_node()" just call "print_line()".

Get rid of "print_ps_hex()" - the font used for the hex dump and the
protocol tree are the same, so there's no need to switch fonts.

svn path=/trunk/; revision=5798
2002-06-29 09:45:06 +00:00
Guy Harris bf2c26e0b9 Get rid of trailing newline in lines passed to "print_line()".
svn path=/trunk/; revision=5732
2002-06-22 01:52:27 +00:00
Guy Harris 567aac9787 Get rid of separate "print_hex_data_text()" and "print_hex_data_ps()"
routines; instead, rename "print_hex_data_common()" to
"print_hex_data_buffer()" as it prints a buffer in hex and ASCII (or
EBCDIC), and have it take the print format as an argument.

Have it use "print_line()" to print lines, and fix "print_line()" so
that it prints a buffer *without* a newline at the end, printing the
newline itself.

svn path=/trunk/; revision=5729
2002-06-22 01:24:23 +00:00
Guy Harris 1b72ef68e6 Add a new error for attempts to open a pipe or FIFO for random access.
Have "wtap_open_offline()", if asked to open a FIFO, return that error
if it was asked to open the file for random access.

svn path=/trunk/; revision=5643
2002-06-07 07:47:58 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Guy Harris a6a5ff53ea Clean up the file saving code a bit.
svn path=/trunk/; revision=5531
2002-05-23 10:27:12 +00:00
Guy Harris 15fe575899 Make "save_cap_file()" return a Boolean (TRUE on success, FALSE on
failure) - and don't use "err" to determine success or failure, as it's
not set in some failure cases.

svn path=/trunk/; revision=5528
2002-05-23 07:46:58 +00:00
Guy Harris a0b8690230 The "fname" argument to "save_cap_file()", and "cf->filename" - and thus
"from_filename" - are both null-terminated strings; compare them with
"strcmp", not "strncmp()".  ("cf->filename" is a "char *", so
"sizeof(cf->filename)" is not the right third argument to "strncmp()" in
any case, as it's the size of a pointer, which is probably either 4 or 8
bytes.)

Make the dialog box for "Can't save over current capture file" an
ESD_TYPE_CRIT dialog box, as it's a fatal error.

svn path=/trunk/; revision=5526
2002-05-23 06:10:56 +00:00