Commit Graph

385 Commits

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