Commit Graph

348 Commits

Author SHA1 Message Date
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