Commit Graph

551 Commits

Author SHA1 Message Date
Ulf Lamping 6b03887732 minor bugfix from recent check in
svn path=/trunk/; revision=10137
2004-02-20 18:37:00 +00:00
Ulf Lamping ec03b28e12 bugfix: resizing (values from recent) must be done, before the
top_level window is shown, otherwise it has no effect!

svn path=/trunk/; revision=10136
2004-02-20 17:43:50 +00:00
Ulf Lamping fed61823c6 win32 drag-n-drop: corrected handling of UNC filenames "\\host\share\dir..."
svn path=/trunk/; revision=10135
2004-02-20 17:36:37 +00:00
Ulf Lamping d50cbeb79a bugfix: use last_open_dir for the recent file,
instead of the somewhat duplicated value in the recent struct

svn path=/trunk/; revision=10077
2004-02-17 14:49:11 +00:00
Guy Harris 36ece5a17a Add a "window_new()" routine that creates a window of a given type, sets
the title, and arranges to set the icon for it.  Use that instead of
"gtk_window_new()" and separate calls to set the title and arrange to
set the icon.

Regularize #includes a bit.

Clean up white space.

svn path=/trunk/; revision=10054
2004-02-13 00:53:37 +00:00
Guy Harris c5b4dad036 Create only one "About Ethereal" window per process.
svn path=/trunk/; revision=10052
2004-02-13 00:00:25 +00:00
Guy Harris 90cf9a6b7b The HIG's and/or GUI toolkit documentation for:
Mac OS X

	GNOME

	Qt

	KDE

	Windows

all indicate that {message,alert} boxes are modal, at least for the
window to which they apply.  (Presumably the idea is that not forcing
the user to pay attention to the alert box, and allowing more than one
alert box to be up for a given window, causes more problems than not
letting the user do stuff to that window in order to figure out what the
underlying problem is or figure out what to do to fix it - the message
should be sufficient, in most if not all cases, to let you know what the
problem is.)

Make "simple_dialog()" unconditionally make the alert box modal, and get
rid of ESD_TYPE_MODAL.  XXX - we need to make it possible to make an
alert box modal for a given window, rather than just the top-level
window.

svn path=/trunk/; revision=10051
2004-02-12 22:24:28 +00:00
Guy Harris f99bb93e55 Cast "char" values to "guchar" before passing them to <ctype.h> macros,
so that characters with the 8th bit set don't get sign-extended and
cause the macros not to return the right answer.

svn path=/trunk/; revision=10036
2004-02-11 09:19:54 +00:00
Guy Harris 2e4e229739 Get rid of the "Question" alert box type - rename it to "Confirmation",
as that seems to be the name used in the GNOME HIG, at least.  Make it
use the Warning icon (that's what the GNOME HIG says - and it's also
what's used for the equivalent on Windows), and use it for the "Save
current capture?" alert boxes.

svn path=/trunk/; revision=10030
2004-02-11 03:55:48 +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
Jörg Mayer 348c83db8c Fix a few warnings
svn path=/trunk/; revision=9997
2004-02-06 14:59:52 +00:00
Guy Harris 372e6b2da0 Add some comments about the types of alert boxes you get with the
simple_dialog routines (which are really just message box/alert box
routines).

Add some macros for combinations of buttons (corresponding to
combinations that some GUI toolkits, which only support some
combinations, allow).

svn path=/trunk/; revision=9977
2004-02-04 01:10:37 +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
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 7b5e98bf8e Mark the "widget" argument to "main_load_window_geometry()" as unused
when building for GTK+ 1.2[.x].

svn path=/trunk/; revision=9955
2004-02-01 22:43:34 +00:00
Ulf Lamping d11080a09f moved window geometry values from prefs to recent,
added new pref / recent setting: "maximized main window",
which will save, if the main window is maximized or not,
this will take effect on GTK version 2 only, but is saved nonetheless

svn path=/trunk/; revision=9949
2004-02-01 20:28:11 +00:00
Ulf Lamping db13141aab DND: also unescape URI characters (e.g. %20 -> ' ')
svn path=/trunk/; revision=9940
2004-02-01 10:01:19 +00:00
Guy Harris e1e17ea8b2 Konqueror, in KDE 3.0, appears to drop file names of the form
"file:/foo/bar/...", so that only the "file:" should be stripped off.

Note that we should probably look for "file:" followed by an arbitrary
number of "/"s, and, at least on UNIX, strip off all but the last of
those "/"s.

svn path=/trunk/; revision=9932
2004-02-01 02:59:20 +00:00
Ulf Lamping 5b38a022e4 Implemented rudimentary Drag and Drop support.
svn path=/trunk/; revision=9926
2004-01-31 18:32:37 +00:00
Ulf Lamping d244cd82f5 cleanup of new "question dialogs",
using GTK2 primary/secondary message text from GNOME HIG for simple_dialogs,
added a "question dialog" for the coloring rules "Clear" button

svn path=/trunk/; revision=9921
2004-01-31 12:13:23 +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 3c76ec1aa2 every GUI action, which will erease a currently unsaved capture file,
will now raise a dialog "Save xy before z?" with Yes/No/Cancel buttons.

svn path=/trunk/; revision=9908
2004-01-29 23:11:38 +00:00
Guy Harris a06e94af42 "gtk/main.c" no longer has any code to manage the packet list, so it no
longer needs to define the "column_arrows" structure.

svn path=/trunk/; revision=9894
2004-01-28 09:10:50 +00:00
Ulf Lamping c1a7c24df3 added a tooltip to explain the behaviour of the syntax check in the filter toolbar
svn path=/trunk/; revision=9861
2004-01-26 18:40:44 +00:00
Guy Harris e608fdfda3 In "main_filter_packets()", use the "cf" argument rather than always
passing "&cfile" to "filter_packets()".

Mark the "w" argument to "filter_activate_cb()" as unused.

svn path=/trunk/; revision=9853
2004-01-25 22:20:21 +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
Ulf Lamping c890e29a99 apply automatically generated filters strings to the recent dropdown list,
e.g. when applying a "Follow TCP stream",
fix a bug in the recent function, discarding the newest entries when
saving a full list (now discarding the oldest).

svn path=/trunk/; revision=9849
2004-01-25 18:51:26 +00:00
Ulf Lamping 24eb4363ef add syntax check and an "Add Expression" button to the filter toolbar
svn path=/trunk/; revision=9839
2004-01-25 15:10:36 +00:00
Guy Harris 89c529db8e Have "font_apply()" return an indication as to whether it succeeded or
failed and, if it failed, how it failed.  Have it leave up to its caller
the job of reporting that it couldn't load the requested font; have its
callers do that, and have them set the zoom level on failure so that we
have a zoom level that is at least more likely to work.  Make the alert
boxes for "font_apply()" failures be error boxes, not warning boxes.

svn path=/trunk/; revision=9818
2004-01-24 01:02:54 +00:00
Guy Harris 89edd94cb3 Do the font loading code as two larger sections of code, one for GTK+
1.2[.x] and one for GTK+ 2.x, rather than as one section peppered with
#ifdefs.

svn path=/trunk/; revision=9817
2004-01-23 21:22:18 +00:00
Guy Harris b64241c4a6 Include the AddStyleName information in the zoomed font name.
svn path=/trunk/; revision=9816
2004-01-23 20:34:11 +00:00
Guy Harris 32e5a4bdbc If the zoom factor is zero, don't construct a new font name - the
supplied font name is correct.  That lets us handle fonts whose size we
can't change because this is GTK+ 1.2[.x] and the name isn't an XLFD
name so we don't know where the size is.

In "font_zoom()", remove some code from the GTK+ 1.2[.x] vs. GTK+ 2.x
#ifdefs.

Fix the comment for "font_zoom()".

Get rid of a no-longer-used "simple_dialog()" argument.

svn path=/trunk/; revision=9814
2004-01-23 20:11:59 +00:00
Guy Harris d10d0f20f2 Clean up indentation.
Make "font_zoom()" static - it's not used outside gtk/main.c.

Use "g_strdup()" rather than "strdup()", as we use "g_free()" to free
the result.

Put in a little more information when "font_zoom()" fails due to the
font name not being an XLFD font name, and don't continue if it fails.

Don't continue if the attempt to load the fonts fails, either.

svn path=/trunk/; revision=9813
2004-01-23 19:53:10 +00:00
Ulf Lamping 6551f25ee9 fix assert, when failed loading zoomed font,
prepare possibility to put filter toolbar just below the main toolbar

svn path=/trunk/; revision=9807
2004-01-23 16:07:37 +00:00
Ulf Lamping 8e2a930023 implemented dlg_button_row_new to get a standard function for
layouting the dialog buttons, and use it where appropriate.
This will help us with the GTK1/2 conflict on button layouts and
will also result in a more consistent look of the dialogs at all.

svn path=/trunk/; revision=9771
2004-01-21 21:19:34 +00:00
Guy Harris 9c9fd17906 Squelch some compiler warnings.
"font_point_size_l" is a "long", so use "strtol()" to set it (note that
even "strtoul()", for some not-entirely-obvious reason, accepts numbers
starting with a "-" as input - ANSI C requires it!).

svn path=/trunk/; revision=9767
2004-01-21 09:00:48 +00:00
Ulf Lamping 76910636e0 don't try to set font size <= 0
svn path=/trunk/; revision=9762
2004-01-21 03:02:19 +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
Ulf Lamping 1b852172e2 minor tooltip changes
svn path=/trunk/; revision=9748
2004-01-20 02:26:00 +00:00
Guy Harris d4ab584f0f Move "ts_type_text" out of "epan/timestamp.h into "gtk/recent.c", as
it's only used in the latter; that avoids lots of warnings about
"ts_type_text" being defined but not used in other source files that
include "epan/timestamp.h".  (If it's going to be used in more than one
file, make it non-static and declare it "extern" in "epan/timestamp.h".)

Define TS_NOT_SET as ((ts_type)-1), and use that when initializing
"timestamp_type" in Ethereal and when checking to see whether
"timestamp_type" was set, to avoid signed vs. unsigned comparison
warnings.

Clean up indentation.

svn path=/trunk/; revision=9740
2004-01-19 23:03:20 +00:00
Jörg Mayer da5f6f9472 The current year is 2004
svn path=/trunk/; revision=9731
2004-01-19 18:21:18 +00:00
Ulf Lamping 0353c5823f move timestamp format options from "View->Options" dialog into
menuitems under "View->Time Display Format".
renamed timestamp enum items e.g. from ABSOLUTE to TS_ABSOLUTE,
to prevent conflicting definitions with MSVC

svn path=/trunk/; revision=9729
2004-01-19 03:46:43 +00:00
Ulf Lamping 453309c0c6 added some menuitems "View->Show" including show/hide of all main widgets,
saving the states in the recent file

svn path=/trunk/; revision=9726
2004-01-19 00:42:12 +00:00
Jörg Mayer 5972f31427 Output the result of -h to stdout, not stderr
svn path=/trunk/; revision=9703
2004-01-18 02:19:07 +00:00
Olivier Biot 8db6fb47cd Nice rendering of the CVS version as "(cvs 200401181200003000)".
The make-version.pl script only defines CVSVERSION if this was a build
from CVS.

svn path=/trunk/; revision=9701
2004-01-18 01:41:14 +00:00
Ulf Lamping 59125a7304 no more differences, wether display filter dialog is called from
menu "Analyze->Display Filter" or statusbar "Filter:" button.

svn path=/trunk/; revision=9698
2004-01-18 00:40:39 +00:00
Jörg Mayer 0ac74ed036 In case of CVS sources, add the date of the last change to the version
number.

2do: Add support to Makefile.nmake
     Enforce the generation of cvsversion.h on each run of make

svn path=/trunk/; revision=9679
2004-01-16 20:04:21 +00:00
Guy Harris b97626862e Rename DISSECTOR_HELPER_{SRC,OBJECTS} to
DISSECTOR_SUPPORT_{SRC,OBJECTS}.

Add some additional files, required by dissectors, to those lists.

Extract the stuff to get version information strings for libraries and
the OS, which is *not* needed by dissectors, from "util.c", which
contains routines that *are* needed by dissectors, and put it into a
separate file.

Make "dftest" link only with the dissector support stuff, not with all
of the Ethereal common files.

svn path=/trunk/; revision=9645
2004-01-11 22:17:43 +00:00
Ulf Lamping 949f1f2d07 using button compatibility macros
svn path=/trunk/; revision=9636
2004-01-10 16:27:43 +00:00
Guy Harris 563f423d76 Turn the GTK+ 1.2.10 clist code into our own widget; that lets us modify it
to add functionality or improve performance, although, until we make it
work on GTK+ 1.3[.x] and 2.x, we shouldn't count on the performance
improvements, or make its API different from that of the GtkClist API
(other than names).

Move all the code that knows about the packet list into
gtk/packet_list.c, so that the GtkClist vs. EthClist stuff is
encapsulated inside it.

svn path=/trunk/; revision=9608
2004-01-09 08:36:23 +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
Guy Harris c0b33a22f9 If building without libpcap, exclude some stuff that builds only if
you're building with libpcap or that's not necessary if you're not
building with libpcap.

svn path=/trunk/; revision=9601
2004-01-08 20:39:51 +00:00
Richard Sharpe fa9874ef73 Apply the patches from Tadaaki Nagao for a global version of disabled
protocols ...

svn path=/trunk/; revision=9538
2004-01-03 18:40:08 +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
Ulf Lamping 3b77bfee59 removed some MSVC warnings (moved pcap.h before glib.h)
svn path=/trunk/; revision=9393
2003-12-21 12:19:39 +00:00
Ulf Lamping 1a2ecc19c3 removed some more MSVC warnings (type casting), GTK2 specific
svn path=/trunk/; revision=9333
2003-12-17 23:41:10 +00:00
Ulf Lamping 1f97bdc27a removed some more MSVC warnings (type casting)
svn path=/trunk/; revision=9326
2003-12-17 22:11:43 +00:00
Olivier Abad abb4aec1fe Use gtk compatibility macros (from compat_macros.h) instead of some gtk+
v1.2 functions which are deprecated in gtk+ v2.

Update OBJECT_SET_DATA macros to cast "data" to (gpointer).

svn path=/trunk/; revision=9296
2003-12-16 18:43:35 +00:00
Guy Harris 7cae9249aa Squelch some compiler warnings.
Clean up white space.

svn path=/trunk/; revision=9278
2003-12-13 22:05:08 +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 8e43886258 mention the GPL license in the Help->About dialog
svn path=/trunk/; revision=9272
2003-12-13 16:30:10 +00:00
Gerald Combs 9ed6beff38 In "dlg_window_new()" check to see if "top_level" has been initialized,
as is the case for the spawned capture process.

svn path=/trunk/; revision=9245
2003-12-12 02:50:04 +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
Olivier Abad 96acd9f8bf Update various set_menu_object_data() calls to reflect recent menu
hierarchy changes. This avoids a crash when selecting "Folow TCP stream"
from the "Analyze" menu.

svn path=/trunk/; revision=9193
2003-12-07 09:43:53 +00:00
Guy Harris dcd98ae8d3 The "ptr_u" unions no longer have a "next" pointer - they now just have
one member - or have one that's not used, so get rid of those unions.

svn path=/trunk/; revision=9151
2003-12-03 09:28:26 +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
Guy Harris bd9f96738c From Didier Gautheron: put an "fvalue_t" structure into a "field_info"
structure, rather than separately allocating "fvalue_t"s and having the
"field_info" structure point to them - this appears to speed up protocol
tree construction a bit.

svn path=/trunk/; revision=9146
2003-12-02 21:15:49 +00:00
Ulf Lamping cd01ca6cb0 using dlg_utils.c functions to catch the ESC key to close the dialog
svn path=/trunk/; revision=9110
2003-11-28 00:13:08 +00:00
Guy Harris 41cedaa088 Show the -z flag in the usage message.
svn path=/trunk/; revision=9105
2003-11-27 22:12:18 +00:00
Guy Harris 122dd3959c Make the recent epan/proto.{c,h} change compile.
svn path=/trunk/; revision=9075
2003-11-24 22:11:55 +00:00
Gerald Combs fee0d98c18 Check the environment variables SSH_CONNECTION, SSH_CLIENT, REMOTEHOST,
DISPLAY, and CLIENTNAME (in that order).  If any of them are set, create
a capture filter that excludes their traffic and set it as the default.
The longer filters should be efficient without being overly long; they
may need some tweaking.

svn path=/trunk/; revision=8994
2003-11-18 04:16:28 +00:00
Gerald Combs 2bdac88860 The recent link-layer type additions broke "-r". Make it work again.
svn path=/trunk/; revision=8857
2003-11-02 19:31:20 +00:00
Guy Harris 3c2706c338 Return FALSE from the configure event handler, so that anybody else
who's registered for it can get notified about it.

svn path=/trunk/; revision=8849
2003-11-01 03:03:25 +00:00
Guy Harris 219b6cefa2 Based on a patch from Brian Fundakowski Feldman, add support for setting
link-layer type when capturing, using the "pcap_set_datalink()" and
related APIs.

svn path=/trunk/; revision=8848
2003-11-01 02:30:18 +00:00
Guy Harris ef74a0b574 If a tap menu item doesn't have a "selected_packet_enabled()" or
"selected_tree_row_enabled()" routine, enable it by default, so that
tap windows can be popped up even if you have no capture file.

Assorted code cleanups.

svn path=/trunk/; revision=8740
2003-10-20 22:28:22 +00:00
Olivier Abad 67e641ff5f - use stock icons in the toolbar when using GTK2
- use GTK1/2 compatibility macros [GS]ET_OBJECT_DATA where needed
- add a set_toolbar_object_data() function which associates the display
  filter entry (from the main window) with the E_DFILTER_TE_KEY for the
  open and reload buttons (it is needed by the open and reload
  callbacks). The function is called in create_main_window()
- reindent

svn path=/trunk/; revision=8718
2003-10-16 20:56:07 +00:00
Guy Harris 18556fed07 There doesn't seem to be any need to set "cfile.dfilter" to the contents
of the filter text entry when reloading the file, and:

	1) that doesn't work with the toolbar "reload" button (the
	   widget passed in for that button doesn't have a
	   E_DFILTER_TE_KEY data item pointing to the text entry);

	2) that causes the Tools > Summary dialog box to report what
	   you've typed in that box, not the filter that's actually in
	   effect (i.e., it causes "cfile.dfilter" to reflect what's
	   been typed, not what's been applied);

so don't bother doing so.  That also means that the "/File/Reload" menu
item doesn't need a E_DFILTER_TE_KEY data item, so don't give it one.

svn path=/trunk/; revision=8713
2003-10-16 00:45:12 +00:00
Guy Harris a27dcb4e3f From Ulf Lamping: toolbar.
svn path=/trunk/; revision=8707
2003-10-15 19:40:42 +00:00
Guy Harris ffa3ad8ef5 From Ian Schorr:
Add a preference to control whether the "File > Open" dialog box
	should start out in the last directory in which it looked - and
	save that in the preferences file across invocations - or should
	always start out in a user-specified directory, and add another
	preference to specify that directory.

	Write out section name comments into the preferences file.

Clean up white space a bit.

svn path=/trunk/; revision=8699
2003-10-14 23:20:17 +00:00
Ronnie Sahlberg 3d32354336 Updates to TimeReference Frames
Add a Goto Next/Previous  time reference menu option

svn path=/trunk/; revision=8657
2003-10-10 08:39:24 +00:00
Guy Harris cace3b6df9 Make the window geometry information static - it's not used outside this
file.

Fetch the geometry information whenever we get a configure_notify event,
i.e. if it actually changes, rather than doing so when we get asked to
delete the main window or we exit.  Don't save the geometry if we've
never gotten such an event, as it presumably means the size and position
haven't changed.

svn path=/trunk/; revision=8634
2003-10-07 04:36:36 +00:00
Olivier Abad 959850bf16 In packet_list_button_pressed_cb (gtk2 version) :
- put back the event_button->window == GTK_CLIST(w)->clist_window test
  now that we use the correct structure definition for GtkCList (from
  the right include file, not from our version of gtkclist.h).

svn path=/trunk/; revision=8528
2003-09-24 06:18:20 +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
Olivier Abad 1ba0dfec6f Temporary patch for the packet_list column resize problem in gtk2.
We should use the same test (event_button->window == GTK_CLIST(w)->clist_window)
we already use in gtk v1.2 code but in doesn't seem to work in gtk2.

svn path=/trunk/; revision=8515
2003-09-23 06:25:10 +00:00
Guy Harris f3dd4b5eec Clean up an error message.
svn path=/trunk/; revision=8481
2003-09-15 23:20:34 +00:00
Guy Harris 2e98c97118 Don't pop up tap windows specified with "-z" options until we have a
capture file open.

svn path=/trunk/; revision=8480
2003-09-15 23:15:32 +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 0d87da9c92 Don't allow -k and a capture file to both be specified on the command
line - either we're doing a live capture or we're reading a saved
capture file, we can't do both at the same time.

svn path=/trunk/; revision=8475
2003-09-15 20:45:19 +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 27ea7816ee Have "get_interface_list()" return a list of "if_info_t" structures
containing a pointer to an interface name and possibly a pointer to an
interface description (although that pointer might be null if no
description is available), rather than having the Windows version glue
together the name and description into a single string.

Supply for the Linux "any" device the same description that libpcap's
"pcap_findalldevs()" returns.

svn path=/trunk/; revision=8440
2003-09-10 05:35:26 +00:00
Guy Harris d7c622e309 Check for "wtap_seek_read()" failing.
svn path=/trunk/; revision=8364
2003-09-03 23:32: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
Olivier Abad 0c678f74c7 Marking packets with the middle mouse button works now with GTK2.
svn path=/trunk/; revision=8301
2003-08-28 20:33:14 +00:00
Guy Harris 23f105da58 Construct the About box ourselves, so it has the title "About Ethereal"
and doesn't have a message-box-type icon.

This might want to be tweaked further, to more closely resemble various
desktop environments' About boxes (although what's appropriate might
depend on the environment).

svn path=/trunk/; revision=8194
2003-08-19 20:35:33 +00:00
Ronnie Sahlberg 4ea90cdabc Update to the Response Time Statistics taps.
SMB/FC/ONC-RPC/DCE-RPC now all use the default tap filter string as the
same filter string as is used in the main window instead of using a default
NULL filter string.

The idea is that if you have applied a certain filter to your main window, it
is likely that if you want to invoke the response time statistics feature you
probably want to do the response time statistics over the same set of packets, i.e. the ones you see in the main window.

svn path=/trunk/; revision=8192
2003-08-19 10:09:20 +00:00
Guy Harris ddf6a8acf2 From Michael Lum: add the ability to have a preferences file containing
a list of disabled protocols, and to save that list from the Edit >
Protocols dialog box.

Add checks for read errors in "read_prefs()".

Clean up white space.

svn path=/trunk/; revision=8144
2003-08-07 00:41:28 +00:00
Gilbert Ramirez c91b8e713f Fix signed/unsigned comparison warnings.
svn path=/trunk/; revision=8084
2003-07-25 04:11:51 +00:00
Olivier Abad bf36806318 In packet_list_button_pressed_cb :
we must check if the event occured in the clist_window (because the x,y
pixel positions of the event are relative to this window), before
calling gtk_clist_get_selection_info()

Fixes debian bug #199763

svn path=/trunk/; revision=8053
2003-07-19 10:25:59 +00:00
Olivier Abad 800027bf02 In set_plist_sel_browse : change broken logic when determining if the
mode has changed.

svn path=/trunk/; revision=8051
2003-07-19 08:59:29 +00:00
Olivier Abad 5d8e9b0d14 Various fixes related to GTK2 :
- give the focus to the packet_list when a capture file is opened, and
  each time we change the selection in the packet list (it seems that
  the tree view has the focus if we don't do this) ;

- in set_plist_sel_browse() : it seems that packet_list->selection_mode
  is always 0 in GTK2 so we can't use it to determine the current mode.
  Use a static variable instead.

This should fix the second part of debian bug #199763

svn path=/trunk/; revision=8045
2003-07-18 20:55:11 +00:00
Guy Harris 33bdfd46d7 From Lars Roland: load WinPcap *before* constructing the information
about library versions.

svn path=/trunk/; revision=7964
2003-07-04 23:50:10 +00:00
Laurent Deniel 0afce7ca81 Ringbuffer rework.
Almost completely rewritten in order to:

- be able to use a unlimited number of ringbuffer files

  0 specified with -b argument or in the GUI, means that the number of file
  is unlimited.

  else the maximum number of ring buffer files is arbitrarily set to 1024.

- close the current file and open (truncating it) the next file at switch

- set the final file name once open (or reopen)

- avoid the deletion of files that could not be truncated (can't arise now)
  and do not erase empty files

The idea behind that is to remove the limitation of the maximum # of
ringbuffer files being less than the maximum # of open fd per process
and to be able to reduce the amount of virtual memory usage (having only
one file open at most) or the amount of file system usage (by truncating
the files at switch and not the capture stop, and by closing them which
makes possible their move or deletion after a switch).

svn path=/trunk/; revision=7912
2003-06-22 16:09:04 +00:00
Guy Harris ecf87b705c Clean up the usage message a bit (using the convention, adhered to by at
least some UNIX utilities, of listing all the flags with no arguments in
a single lump, and then listing the ones with arguments individually;
also, make lines as long as possible, as long as they fit in 80 columns).

svn path=/trunk/; revision=7815
2003-06-09 07:54:11 +00:00
Olivier Abad c4c4bb0d1a Add a "--enable-threads" option, which allows to build the gtk+ v2
ethereal with or without threads. The default is to use threads.
(see http://www.ethereal.com/lists/ethereal-dev/200210/msg00111.html and
http://www.ethereal.com/lists/ethereal-dev/200306/msg00061.html).

svn path=/trunk/; revision=7807
2003-06-08 09:12:23 +00:00
Guy Harris 2689d287d4 Squelch some compiler complaints.
svn path=/trunk/; revision=7682
2003-05-16 00:48:26 +00:00
Laurent Deniel 3070b797d5 Implement a ring buffer switch duration:
when the new "Rotate capture file every n second(s)" checkbox or the
-b <# of file>[:<duration>] argument are used, [t]ethereal will skip to the
next ring buffer file if the specified duration has elapsed (even if the
specified capture size is not reached). This is useful when you want to have
separate capture files per hour or day for instance.

I let the autostop filesize parameter mandatory (i.e. the "rotate capture
file after n kilobytes") but this could be no longer strictly necessary when
that new feature is used ...

Another point: it might be interesting to really truncate the file at the
switch and not the closure ... According to user comments and my own real
case tests, I might plan to enhance this point and others (still ring buffer
related) in the future.

svn path=/trunk/; revision=7678
2003-05-15 13:40:20 +00:00
Gerald Combs 1d9b54fc07 Add support for asynchronous DNS updates using the GNU ADNS library.
Support can be enabled at configure time by using "--with-adns=DIR".
If support is enabled, async queries happen whenever host name resolution
is enabled.  Do we need a separate preference for async queries?

Currently, only IPv4 reverse queries are supported.  I can add IPv4 forward
lookup support, but I don't have any way to test IPv6 queries.

svn path=/trunk/; revision=7640
2003-05-04 18:50:56 +00:00
Guy Harris ca318813a4 Rename "proto_alloc_dfilter_string()" to
"proto_construct_dfilter_string()", to more accurately reflect what it
does.

Give it, and "proto_can_match_selected()", an "epan_dissect_t *"
argument, which replaces the raw data pointer argument to
"proto_construct_dfilter_string()".

For fields that don't have a type we can directly filter on, we don't
support filtering on the field as raw data if:

	the "epan_dissect_t *" argument is null;

	the data source tvbuff for the field isn't the tvbuff for the
	"epan_dissect_t" in question (i.e., it's in the result of a
	reassembly, and "frame[N:M]" can't get at it).

Trim the length the raw data in the case of such a field to the length
of the tvbuff for the "epan_dissect_t" in question, so we don't go past
it.  Fetch the raw data bytes to match from that tvbuff.

Have "proto_construct_dfilter_string()" return a null pointer if it
can't construct the filter string, and have "protocolinfo_packet()" in
the tap-protocolinfo tap ignore a field if
"proto_construct_dfilter_string()" can't construct a filter string for
it - and have it pass NULL as the "epan_dissect_t *", for now.  If
somebody decides it makes sense to dump out a "frame[N:M] =" value for
non-registered fields, it can be changed to pass "edt".

svn path=/trunk/; revision=7635
2003-05-03 00:48:37 +00:00
Laurent Deniel f8a077d10b Change copyright date to 2003.
svn path=/trunk/; revision=7545
2003-04-23 20:51:57 +00:00
Guy Harris 1b872b3648 Make "register_tap_listener()" return NULL on success and a "GString *"
referring to a GString containing an error message on failure, and don't
have it print anything on failure.

If it fails, have its Tethereal-tap callers print an error message
before exiting, and have its Ethereal callers pop up a dialog box with
the error (except in cases where the failure is guaranteed not to be the
user's fault, and where we exit, in which case we just print an error
message before we exit).  In all cases, the error message includes the
text of the GString.

Fix a scanf format string in the DCE RPC statistics Ethereal tap, so
that it properly skips the comma before the filter string.

Fix some Ethereal error messages not to say "tethereal".

svn path=/trunk/; revision=7542
2003-04-23 08:20:06 +00:00
Guy Harris 4cfd8b0f36 Allow taps to have menu item registration routines; the menu item
registration routines, for taps with menu items (taps that can be run
from the "Tools->Statistics" menu), create the menu item for the tap.
"make-tapreg-dotc" constructs a "register_all_tap_menus()" function that
calls all the tap menu item registration routines it finds, and Ethereal
calls that routine after the main window has been constructed (so that
the main menu exists, as the menu items are added to it).  (Tethereal
doesn't call it.)

Get rid of the "menu" and "menu_init" arguments to
"register_ethereal_tap"; the menu item is registered in the tap's menu
item registration routine, not in its main registration routine.

Have the RTP GUI tap register its menu item that way, rather than by
having it compiled into "gtk/menu.c".  (We're not ready yet to have taps
whose menu items are under a submenu register themselves in that
fashion, as "register_tap_menu_item()" can't yet create submenus.)

svn path=/trunk/; revision=7540
2003-04-23 03:51:03 +00:00
Guy Harris 2678786425 Pull the stuff done in "dissect_packet()" to initialize a column_info
structure into its own routine; rename "col_init()" to "col_setup()",
and call the new routine "col_init()".

svn path=/trunk/; revision=7467
2003-04-16 05:55:41 +00:00
Guy Harris 24ec2110d1 Add the notion of a "fence" to columns. A dissector can set the fence
to "protect" what's currently in the column, so that attempts to clear
the column will only clear stuff after the fence and attempts to
overwrite the column will append stuff after the fence.  This, for
example, allows a dissector to arrange that the Info column contain
information for its protocol and for protocols running atop it.

svn path=/trunk/; revision=7466
2003-04-16 04:52:55 +00:00
Guy Harris ab84d8be6e Change the version messages to put the "compiled with" stuff on a
separate line, and to put the "running with" info on a separate line
from that, to make the output narrower.

svn path=/trunk/; revision=7344
2003-03-12 00:07:46 +00:00
Guy Harris 170b5028e9 Put the code to get version numbers of various libraries with which
Ethereal/Tethereal was linked into a common routine, and use that in
both Ethereal and Tethereal.

Add to that routine code to get OS version information.

svn path=/trunk/; revision=7320
2003-03-08 07:00:48 +00:00
Guy Harris 300aa657cc Get rid of unneeded includes of "../ui_util.h".
svn path=/trunk/; revision=7257
2003-03-02 22:31:25 +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 cc90efa654 The correct way to go to a frame with a given number is to use
"goto_frame()", not to assume that all frames are being displayed and to
go to the row whose number is the frame number - 1.

svn path=/trunk/; revision=7242
2003-03-01 10:18:54 +00:00
Olivier Abad abe08df6d7 In gtk2 code, replace gdk_string_width() with the "Pango" way of
computing strings width and height.

svn path=/trunk/; revision=7159
2003-02-17 07:50:49 +00:00
Guy Harris 6ca5407668 Separate the routines to allocate colors from the routines to handle
color filters.

svn path=/trunk/; revision=6872
2003-01-08 01:59:42 +00:00
Guy Harris a97b83a7f4 Add a new field type FT_FRAMENUM; an FT_FRAMENUM is a 32-bit unsigned
frame number, which is always decimal.  If you select an FT_FRAMENUM
field, there are menu items that let you go to the frame whose frame
number appears in that field.

Add FT_FRAMENUM fields for the ONC RPC "matching request is in this
frame" and "matching reply is in this frame" protocol tree items.

svn path=/trunk/; revision=6802
2002-12-19 02:58:53 +00:00
Guy Harris 0051e3c2e8 That was the wrong cast, d00d....
svn path=/trunk/; revision=6686
2002-11-28 02:04:23 +00:00
Guy Harris 5dbad1dcdc Constify some pointers to avoid converting const pointers to non-const
pointers.

svn path=/trunk/; revision=6685
2002-11-28 01:58:27 +00:00
Gerald Combs 2329ea1483 Add tethereal's tap objects to Makefile.nmake's "clean" target.
Instead of setting MIBDIRS in tethereal.c and gtk/main.c, set it in
packet-snmp.c.

svn path=/trunk/; revision=6606
2002-11-10 20:53:06 +00:00
Olivier Abad 425e7406d2 When opening tap windows, we don't need to search the tap_list again. It
has been done when processing the -z command line option.

svn path=/trunk/; revision=6602
2002-11-10 11:41:45 +00:00
Olivier Abad 573f0840eb - use gtk1/gtk2 compatibility macros to reduce #ifdefs
- when processing tap extensions command line options, wait until the
  main window has been created before opening the tap window, to avoid
  lots of GTK warnings.

svn path=/trunk/; revision=6601
2002-11-10 11:36:39 +00:00
Ronnie Sahlberg b3e0a56390 First step in creating an API to register TAPs for use with ethereal instead of hardcoding them in main.c/menu.c
This adds functions to register the command line arguments to use the API in the same way as is done for tethereal.

Later it may be extended to also register the GUI/Menu entry point to ethereal using this api but that iwll be later since the changes required to menu.c are not as intrusive as the main.c command line parsing ones were.


Some of the latest changes (before this checkin) has made ethereal to produce lots of GTK errors when starting up the extension windows.
They were there before this checking but will be investigated.

svn path=/trunk/; revision=6566
2002-11-06 10:53:36 +00:00
Olivier Abad 05ef1fc475 Merge gtk and gtk2 directories.
svn path=/trunk/; revision=6552
2002-11-03 17:38:45 +00:00
Guy Harris 72d59f0596 The versions of UCD SNMP that we now support all install
<ucd-snmp/version.h>, so get rid of the stuff to check for its presence
and handle its absence.

svn path=/trunk/; revision=6503
2002-10-25 03:13:11 +00:00
Guy Harris 35c1970720 From Ronnie Sahlberg: Ethereal support for DCERPCSTAT.
svn path=/trunk/; revision=6499
2002-10-25 01:08:49 +00:00
Guy Harris f54f6a1a0a At least according to the UNIX 98 spec, you need to include <unistd.h>
to declare "getopt()" and the variables it uses; tethereal.c already
includes it, but gtk/main.c and gtk2/main.c, which also use "getopt()",
don't - make them do so.

svn path=/trunk/; revision=6497
2002-10-25 00:29:12 +00:00
Guy Harris ae1ebc09da Don't include the header file to get the SNMP version unless we're
building with an SNMP library.

If we have Net-SNMP, include <net-snmp/version.h>, not
<ucd-snmp/version.h>.

Don't include any of the SNMP headers unless HAVE_SOME_SNMP is defined.

Include <net-snmp/config_api.h> if we have Net-SNMP, to declare
"read_premib_configs()" and "read_configs()".

Supply the include directories for Net-SNMP in the Makefile.nmake for
GTK 1.2 and GTK 2.

svn path=/trunk/; revision=6493
2002-10-24 07:08:26 +00:00
Guy Harris cc8a765d8e From Wes Hardaker:
Define HAVE_SOME_SNMP if either HAVE_UCD_SNMP or HAVE_NET_SNMP
	is defined, and use HAVE_SOME_SNMP, rather than HAVE_UCD_SNMP,
	in most places when testing whether we have an SNMP library or
	not.

	Be more selective when including Net-SNMP header files.

Fix up {gtk,gtk2}/main.c to do the same SNMP stuff that tethereal.c
does - including the MIB stuff that gtk/main.c was doing but gtk2/main.c
wasn't doing.

Fix the copyright date in gtk/main.c.

svn path=/trunk/; revision=6483
2002-10-23 18:24:09 +00:00
Gerald Combs ec8fd2703a Link to libsnmp under Win32.
In gtk/main.c and tethereal.c set MIBDIRS to <get_program_path()>\snmp\mibs
so that we can drop the MIB files there, instead of the default c:\usr\...
path.

Add NET_SNMP_DIR to config.nmake and modify Makefile.nmake to adjust
CFLAGs, ethereal_LIBS and tethereal_LIBS accordingly.

Define HAVE_UCD_SNMP in config.h.win32.

I tested this by creating c:\program files\ethereal\snmp\mibs and
dropping in the MIB files that come with Net-SNMP.  Ethereal resolved
system.sysDescr.0 to "iso.3.6.1.2.1.1.1.0" under Windows.  Under Linux
it resolved to "SNMPv2-MIB::sysDescr.0".

Ethereal.nsi still needs to be updated.

A compiled version of the Net-SNMP library can be found at

    http://www.ethereal.com/distribution/win32/development/

svn path=/trunk/; revision=6385
2002-10-09 03:07:34 +00:00
Ronnie Sahlberg c0b84c028f Update tethereal to put the filter string in the statistics table for RPC_STAT.
Update gtk and gtk2 versions of RPC_STAT to allow a filter string to be specified on both the command line as well as the GUI.

Update the documentation for ethereal to reflect this.

svn path=/trunk/; revision=6343
2002-09-27 11:07:16 +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
Guy Harris 5e8ecbaf46 From Graeme Hewson:
Currently Ethereal sets and uses a default directory for reading
	and writing, but only in some places.  This set of patches extends
	the setting of the default directory to the -w option as well as
	the -r option, and causes all file dialogs to use and set the
	default consistently.  (I haven't changed the
	Preferences/Printing/File dialog, though, as that's a special
	case.)

	There's also a fix for a bug where Ethereal was issuing the
	message "Ring buffer requested, but capture isn't being saved to
	a permanent file" even though a file was specified with -w.

There also appear to be some other cleanups in his patch.

svn path=/trunk/; revision=6238
2002-09-09 20:39:01 +00:00
Ronnie Sahlberg 5b2510fb8e Tap system supprot for Gtk1 and both rpc_stat and rpc_progs
Gtk1 is still single threaded so if the tap extensions need to do something
time consuming or cpu intensive, then the main application will suffer.

It is better than nothing.

svn path=/trunk/; revision=6215
2002-09-07 10:02:36 +00:00
Ronnie Sahlberg 429b24827b From Vassilii Khachaturov, cleanup of redundant code.
svn path=/trunk/; revision=6202
2002-09-06 22:45:44 +00:00
Jörg Mayer e4a2e2cefe Include cleanups in gtk and gtk2:
Remove unneded includes
Add include wrappers where missing

svn path=/trunk/; revision=6191
2002-09-05 18:48:52 +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 d6d0a33cf7 Give the routines that implement the "Match" and "Prepare" menu items
more meaningful names, indicating whether they look at something in the
protocol tree or the packet list.

svn path=/trunk/; revision=6077
2002-08-24 01:17:09 +00:00
Jörg Mayer 96ab70e209 Replace the types from sys/types.h and netinet/in.h by their glib.h
equivalents for the gtk/ directory.

svn path=/trunk/; revision=5930
2002-08-02 22:34:54 +00:00
Jörg Mayer 9630bf353e Fix a few more memleaks found by valgrind (all deriving
from the get_persconffile_path mess).

svn path=/trunk/; revision=5927
2002-08-01 03:15:29 +00:00
Guy Harris b083cf0b39 Fields can be up to 2^32-1 bytes long, as they may have come from a
reassembled packet and are thus not limited to the maximum frame size;
leave room for a Really Big number in the length item in the status bar,
and use "snprintf()" to format the length item Just To Be Sure.

svn path=/trunk/; revision=5839
2002-07-07 22:14:03 +00:00
Guy Harris 192749474f From Liviu Daia <Liviu.Daia[AT]imar.ro>: move "col_init()" call after
the command-line options are processed, so that we don't crash if you've
set the "column.format" preference from the command line.

Fix a grammaro in a comment.

svn path=/trunk/; revision=5838
2002-07-07 21:52:51 +00:00
Gerald Combs 0255b96a8f From a suggestion by PEN <codes [at] lycos.com>, add the length in bytes to
the status bar when a tree item is selected.

svn path=/trunk/; revision=5825
2002-07-06 16:47:17 +00:00
Guy Harris b5f0786318 Don't assume that just because a purported font name begins with "-"
it's an XLFD font name.

svn path=/trunk/; revision=5596
2002-05-30 00:44:50 +00:00
Guy Harris 7d85ca00df Clean up the data structures for the color filter code a bit. The old
"colfilter" structure contained items of use only when the colorizing
dialog was up, so make the items in it private to "gtk/color_dlg.c".
Make the "Edit" and "Delete" buttons sensitive only when a row is
selected, and make the "Up" and "Down" buttons sensitive only when a row
is selected *and* that row has somewhere to move in the specified
direction.

svn path=/trunk/; revision=5575
2002-05-27 22:00:37 +00:00
Guy Harris e2630eed79 Command-line interface cleanups, from Graeme Hewson:
- Exit if an error is found in the options or arguments.

	- In print_usage(), improve the visibility of any getopt() error
	  message by suppressing the version information when -h is not
	  specified, and by adding an empty line.

	Ethereal:

	- If the -k option is specified, use the interface in the preferences
	  file, if present.

	- Prevent the user from specifying any hidden options which are used
	  internally in -S mode.

	Tethereal:

	- Fix a memory leak in the processing of the -f option.

	- In print_usage(), change "capture file type" to "output file type",
	  which I think is clearer; move the -q flag from the non-libpcap case
	  to the libpcap case.

svn path=/trunk/; revision=5525
2002-05-22 23:22:56 +00:00
Guy Harris 976a82b06a Use "-G fields" rather than "-G" in Makefiles.
Print an error and exit if an invalid option is given for the "-G" flag.

svn path=/trunk/; revision=5466
2002-05-14 18:27:28 +00:00
Guy Harris e390d7e0cc Make the "-G" flag take an argument. If no arugment is specified, or if
the argument is "fields", dump out a table of the fields, as we
currently do; if the argument is "protocols", dump out a table of the
protocols.

svn path=/trunk/; revision=5462
2002-05-14 10:15:12 +00:00
Guy Harris 4df4388b91 Make the filter list combo box case-sensitive, as filter expressions are
case-sensitive.

Squelch a compiler complaint.

svn path=/trunk/; revision=5369
2002-05-03 03:30:15 +00:00
Guy Harris 433e8801a1 Clean up the handling of filter strings:
have "filter_packets()" make a copy of the filter string handed
	to it, as it may save the filter string in the "capture_file"
	structure, and the caller of "filter_packets()" shouldn't have
	to worry about the string it passed to "filter_packets()" being
	stashed away somewhere so that it can't just free that string or
	change it;

	have callers of "filter_packets()" free up the string they
	handed to it, if the string was allocated and they're done with
	it;

	plug some memory leaks in "match_selected_cb_do()".

Check for an illegal "action" argument being passed to
"match_selected_cb_do()".

Move some keys out of "keys.h" into "gtk/main.c", as they're only used
in "gtk/main.c".

Make the pointer to the filter list a data item for the combo box, as
it's a copy of the list of strings for the combo box, rather than
attaching it to the widgets that activate the filter (a pointer to the
combo box *itself* is a data item for those widgets).

In "filter_activate_cb()", make a copy of the text from the text entry
field as soon as we fetch it, and use that copy.  Free that copy if
we didn't add the filter to the filter list.

Don't make a copy of the entire filter list and use that to set the
combo box's list of items - just use the list itself.  Also, when the
list is changed, make the new value the data for the combo box (the list
pointer will actually not be changed, because we happen to be using
"g_list_append()", but let's not rely on that).

svn path=/trunk/; revision=5368
2002-05-03 03:24:47 +00:00
Gilbert Ramirez 5c10ad55a8 More static-ization.
svn path=/trunk/; revision=5131
2002-04-08 20:30:56 +00:00
Guy Harris f5c5669291 Get rid of unused arguments.
Use the "nb" argument to "redraw_hex_dump()", so we redraw the specified
byte view pane, rather than always redrawing the main window's byte view
pane (and never redrawing the byte view pane of additional packet
windows, so that the font for them doesn't change if you change the font
preference).

svn path=/trunk/; revision=5066
2002-03-31 23:11:04 +00:00
Guy Harris 6327b456db Get rid of the "--enable-snmp" option; instead, use "--with-ucdsnmp".
Make the directory option to "--with-ucdsnmp" optional.  Handle
"--with-ucdsnmp" similar to the way "--with-pcap" is handled.

Get rid of unnecessary #defines in "packet-cops.c".

Get rid of no-longer-necessary include of "dlfcn.h" in "packet-snmp.c".

svn path=/trunk/; revision=4930
2002-03-12 10:37:04 +00:00
Guy Harris 37dd5f340c Remove code to show the presence, and version number, of the CMU SNMP
library, as we no longer support linking with that library.

svn path=/trunk/; revision=4917
2002-03-10 23:19:44 +00:00
Guy Harris 43ca2567dc Don't say "without SNMP"; that can confuse people into thinking it means
Ethereal doesn't dissect SNMP if not linked with an SNMP library (and
*did* confuse at least one person into thinking that).  Say "without
SNMP MIB support", instead, as you only lose the ability to read SNMP
MIBs and interpret OIDs and variable bindings according to those MIBs.

svn path=/trunk/; revision=4894
2002-03-06 23:37:12 +00:00
Guy Harris e28f56867d From Joerg Mayer: remove unused variables.
svn path=/trunk/; revision=4879
2002-03-05 12:03:27 +00:00
Guy Harris 5fe414c555 From Joerg Mayer: use _U_ to flag unused arguments.
svn path=/trunk/; revision=4878
2002-03-05 11:56:00 +00:00
Guy Harris e300f4db52 Have "wtap_seek_read()" return 0 on success and -1 on failure, and take
an "err" argument that points to an "int" into which to put an error
code if it fails.

Check for errors in one call to it, and note that we should do so in
other places.

In the "wtap_seek_read()" call in the TCP graphing code, don't overwrite
"cfile.pseudo_header", and make the buffer into which we read the data
WTAP_MAX_PACKET_SIZE bytes, as it should be.

In some of the file readers for text files, check for errors from the
"parse the record header" and "parse the hex dump" routines when reading
sequentially.

In "csids_seek_read()", fix some calls to "file_error()" to check the
error on the random stream (that being what we're reading).

svn path=/trunk/; revision=4874
2002-03-05 05:58:41 +00:00
Guy Harris 541c654ff0 Put all the capture options into a structure.
Move the ringbuffer capture options from the "capture_file" structure to
the structure for capture options, as they're a property of an
in-progress capture, not a property of a particular capture file.

svn path=/trunk/; revision=4799
2002-02-24 09:25:36 +00:00
Guy Harris b767826991 Have "get_positive_int()" really check for positive integers, not just
non-negative integers.

Get rid of unused "get_positive_int()" routine in "gtk/capture_dlg.c".

svn path=/trunk/; revision=4796
2002-02-24 06:01:03 +00:00
Guy Harris 8bd63530ed "autostop_filesize" and "autostop_duration" don't need to be in the
"capture_file" structure - they're a property of an in-progress capture,
not a property of an open capture file.  Make them just variables.

The maximum number of packets to be captured should be a variable
separate from the "count" field in the "capture_file" structure - the
latter is a count of the packets in the capture file in question.

Have Boolean variables indicating whether a maximum packet count,
maximum capture file size, and maximum capture duration were specified.
If an option isn't set, and we're doing an "update list of packets in
real time" capture, don't pass the option to the child process with a
command-line argument.

Don't create "stop when the capture file reaches this size" or "stop
when the capture's run for this long" conditions if a maximum capture
file size or a maximum capture duration, respectively, haven't been
specified.  Don't test or free a condition if it wasn't created.

Don't allow a 0 argument to the "-c" flag - the absence of a "-c" flag
is the way you specify "no limit on the number of packets".

Initialize the check boxes and spin buttons for the "maximum packets to
capture", "maximum capture size", and "maximum capture duration" options
to the values they had in the last capture.  If an option wasn't
specified, don't read its value from the dialog box and set the
variable.

svn path=/trunk/; revision=4795
2002-02-24 03:33:05 +00:00
Guy Harris 309e86246e From Peter Valchev: fix editcap to assign the result of "getopt()" to an
"int" and to check "getopt()"s return value with -1 rather than EOF.

Fix other "getopt()" loops to check against -1 as well (EOF is -1 on
most if not all platforms, but the Single UNIX Specification says
"getopt()" returns -1, so we should check against -1, not EOF).

svn path=/trunk/; revision=4793
2002-02-24 01:26:45 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris 89a4acb438 Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file.  Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).

If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.

Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").

Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping.  Also add units to the capture count option.

Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.

Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.

svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"epan/..." pathnames, so as to avoid collisions with header files in any
of the directories in which we look (e.g., "proto.h", as some other
package has its own "proto.h" file which it installs in the top-level
include directory).

Don't add "-I" flags to search "epan", as that's no longer necessary
(and we want includes of "epan" headers to fail if the "epan/" is left
out, so that we don't re-introduce includes lacking "epan/").

svn path=/trunk/; revision=4586
2002-01-21 07:37:49 +00:00
Guy Harris 7fbd9f378f Memory freeing fix, from Jirka Novak.
svn path=/trunk/; revision=4565
2002-01-18 07:29:40 +00:00
Guy Harris 0a03b0f73e Add a preferences page for the name resolution flags.
Separate the preferences value for those flags and the name resolution
code's value into separate variables; this means that the resolution
code no longer depends on the preferences code, and may let us
eventually have the current setting and the preference setting differ
(so that a user can temporarily override the preference setting without
causing subsequent saves of the preferences to save the temporary
value).

Add routines to create various types of widgets for preferences, and to
fetch the values for "enumerated" preferences, and use them both in the
code to handle hardwired preference pages and table-driven preference
pages.

svn path=/trunk/; revision=4536
2002-01-13 20:35:12 +00:00
Guy Harris 30a043931e From Jirka Novak:
Support for generating filter expressions based on packet list
	    column values
	Support for adding filter expressions generated from column or
	    protocol tree field values to the current expression rather
	    than replacing the current expression

svn path=/trunk/; revision=4522
2002-01-11 08:21:02 +00:00
Guy Harris feb5791d6a Have a routine to create a scrolled window, set its vertical scrollbar
preference, and add it to the list of scrolled windows; call that
routine to create scrolled windows, rather than creating it and calling
other routines to do the other two operations.

As "set_scrollbar_placement_all()" and "set_ctree_styles_all()" always
set the styles to match the user's preference, don't have them take an
argument, have them just use the user's preference settings.

Get rid of unnecessary includes of "prefs_dlg.h", replacing them with
includes of "prefs.h" if necessary.  Don't have "prefs_dlg.h" include
"prefs.h" - its sole purpose is to declare routines defined in
"prefs_dlg.c" - and add any additional includes of "prefs.h" this
requires.

Get rid of unnecessary includes of "prefs.h" and "gtkglobals.h".

Fix up white space.

svn path=/trunk/; revision=4521
2002-01-11 07:40:32 +00:00
Guy Harris e592fa4a6b Have routines to create GtkCTrees, set their line and expander style
based on the user's UI preferences, and add them to a list of GtkCTrees.
Use those routines to create all GtkCTrees.

Have a routine to update the preferences for all of those GtkCTrees.
Call that routine whenever the preferences change.

Label the line and expander style preferences as "Tree line style" and
"Tree expander style", as they no longer apply only to protocol trees.

Move the routines to maintain a list of scrolled windows, and to update
scrollbar placement for scrolled windows, to "ui_util.c".

svn path=/trunk/; revision=4520
2002-01-11 06:43:18 +00:00
Guy Harris b3f81eb30c Separate the promiscuous mode, "Update list of packets in real time",
and "Automatic scrolling in live capture" options from the preference
settings for them, so that the preference settings affect the initial
values of those options, but changing those values in a capture don't
affect the preferences, and don't automatically get saved when you save
the preferences.

If we're building without libpcap, don't have an "Automatic scrolling in
live capture" option anywhere.

svn path=/trunk/; revision=4514
2002-01-10 11:05:50 +00:00
Guy Harris d663cdb4a1 Fix some problems with building Ethereal/Tethereal without libpcap.
Get rid of a #include I'd #if 0'ed out.

svn path=/trunk/; revision=4513
2002-01-10 09:51:23 +00:00
Guy Harris 12d566c0ac Add a routine to kill a capture child if it exists, so that if we exit
(by deleting the main window or selecting File->Quit or typing ^Q) while
an "Update list of packets in real time" capture is in progress, we can
abort the capture.

Arrange that "fork_child" is -1 when there is no capture child, so said
routine knows when it can kill the child.

When we exit, kill off any capture child, using that routine, and, if
we're exiting due to a request to delete the main window and, if a read
is in progress (from an "Update list of packets in real time" capture),
don't delete the main window - just set the "Read aborted" flag, so that
the code doing the read will see that flag (it will be called because
the pipe to the capture child is closed due to the child exiting) will
see that and clean up and exit itself.

svn path=/trunk/; revision=4498
2002-01-08 09:32:15 +00:00
Gerald Combs 30c5551caa Add preferences to save the main window size and position. If enabled,
the geometry is saved at exit.  Should we save the main window pane
sizes as well?

Move the DEF_WIDTH and DEF_HEIGHT #defines from gtk/main.h to prefs.h.
Remove the reference to DEF_WIDTH from proto_hier_stats_dlg.c.

svn path=/trunk/; revision=4462
2001-12-31 04:41:50 +00:00
Guy Harris fef1e91788 Print out messages if any of the ring buffer checks fail.
Do the ring buffer checks at the same time other command-line argument
checks are done.

svn path=/trunk/; revision=4439
2001-12-21 20:33:47 +00:00
Guy Harris b89a117a61 There is no such thing as an optional parameter to a command-line flag
if you're using "getopt" - if a flag requires a parameter, not
specifying the parameter is an error.

svn path=/trunk/; revision=4437
2001-12-21 20:18:40 +00:00
Gilbert Ramirez 791f5774d0 Provide for per-protocol-tree data in the proto_tree code.
Put a hash-table of "interesting" fields in the per-proto-tree data.
The dfilter code records which fields/protocols are "interesting" (by which
I mean, their value or existence is checked). Thus, the proto_tree routines
can create special arrays of field_info*'s that are ready for the dfilter
engine to use during a filter operation.

Also store the "proto_tree_is_visible" boolean, renamed "visible", in
the per-proto-tree data.

Move epan_dissect_t to its own header file to make #include dependencies
easier to handle.

Provide epan_dissect_fill_in_columns(), which accepts just the epan_dissect_t*
as an argument.

epan_dissect_new() needs to be followed by epan_dissect_run() for the
dissection to actually take place. Between those two calls,
epan_dissect_prime_dfilter() can be run 0, 1, or multiple times in order to
prime the empty proto_tree with the "intersesting" fields from the dfilter_t.

svn path=/trunk/; revision=4422
2001-12-18 19:09:08 +00:00
Gerald Combs 7e092f2dd8 Go nuts with the 3D logo.
Add a routine to ui_util.c that sets a window's icon pixmap to a 16x16
version of the 3D logo.  Call the routine for each window that is created.
This has been tested with kwm and Sawfish (which expect a 16x16 icon), but
we may have to come up with a better solution for other window managers
(e.g. olwm and mwm).

Add a 3D exclamation point image.  Replace the exclamation point and
Ethereal logo images used in simple_dialog() with their 3D counterparts.

Remove the old icons from the source distribution.

svn path=/trunk/; revision=4390
2001-12-12 21:39:01 +00:00
Gilbert Ramirez 6542c18172 Remove proto_tree from capture_file and PacketWinData, since they
already contain a pointer to an epan_dissect_t, which contains
the proto_tree.

Routines calling epan_dissect_new() do not create their own
proto_tree via proto_tree_create_root(); instead, they pass a boolean
to epan_dissect_new() telling it whether it should create the root
proto_tree.

svn path=/trunk/; revision=4343
2001-12-06 04:25:09 +00:00
Guy Harris a936b559df Make the "Save only marked frames" button in the "Save As..." dialog box
sensitive only if there *are* marked frames.

svn path=/trunk/; revision=4341
2001-12-06 02:21:26 +00:00
Guy Harris 8032fa8a1b Make the bytes-written information from Wiretap a long, as we allow
files to get that big.

From Thomas Wittwer and Matthias Nyffenegger:

Support for "ring buffer mode", wherein there's a ring buffer of N
capture files; as each capture file reaches its maximum size (the ring
buffer works only with a maximum capture file size specified), Ethereal
rolls over to the next capture file in the ring buffer, replacing
whatever packets might be in it with new packets.

svn path=/trunk/; revision=4323
2001-12-04 08:26:00 +00:00
Guy Harris a1660d6d3a Support for stopping capture at specified capture file size or capture
duration, from Thomas Wittwer and Matthias Nyffenegger.

svn path=/trunk/; revision=4322
2001-12-04 07:32:05 +00:00
Guy Harris eef6af7f86 If a non-option command-line argument is specified to Ethereal, treat it
as the pathname of a capture file to be read.  If more than one such
option is specified, print a usage message.

Fix the documentation of the "-r" option to Ethereal and Tethereal.

svn path=/trunk/; revision=4253
2001-11-24 08:46:13 +00:00
Gilbert Ramirez 8743a4a8a7 Remove the global packet_info called "pi". Dissectors now only
access their own "pinfo". A packet_info is stored in epan_dissect_t,
which is created for the dissection of a single packet.

GUI functions which need to access the packet_info of the currently
selected packet used to use "pi"; now they use cfile.edt->pi. cfile's
"edt" member is the epan_dissect_t of the currently-selected packet.

The functionality of blank_packetinfo() was moved into
dissect_packet(), as that's the only place that called blank_packetinfo(),
after a spurious call to blank_packetinfo() was removed from
packet_list_select_cb().

svn path=/trunk/; revision=4246
2001-11-21 23:16:26 +00:00
Guy Harris 8550cfcc6f Allow the tvbuff pointer to various "proto_tree_add" routines to be null
if (and only if) the length of the item being added is 0 (so that it has
no data backing it).

This means the data stream name pointer for the item in question is
null; make sure we handle that.

Use that for some "uses the value from the matching request" fields in
the SMB Pipe protocol.

svn path=/trunk/; revision=4231
2001-11-20 09:07:34 +00:00
Guy Harris 40b22f317b Wrap calls to "pcap_datalink()" in a routine that attempts to compensate
for AIX 5.x's non-standard libpcap, where "pcap_datalink()" doesn't
return DLT_ values, it returns RFC 1573 ifType values.

Put that wrapper, and the routine to get the interface list, in a
separate file, for packet-capture utility routines, so not everybody who
includes "util.h" needs to include <pcap.h>.

Fix up the Wiretap hack for dealing with said incompatibility to use the
correct ifType value for Token Ring.

svn path=/trunk/; revision=4184
2001-11-09 07:44:51 +00:00
Guy Harris cc7347ebf6 Allow a dissector to register preferences that it no longer supports as
obsolete; we silently ignore attempts to set those in a preferences
file, so that we don't spam the user with error messages caused by them
having saved preferences in an earlier release that contained those
preferences.

Make the Diameter and iSCSI dissectors register obsolete preferences.

Crash if some code tries to register a preferences module with a name
that contains something other than lower-case ASCII letters, numbers, or
underscores, or that has already been registered, or if some code tries
to register a preference with a name that contains something other than
lower-case ASCII letters, numbers, underscores, or periods, or that has
already been registered, so that we don't put code like that in a
release and have to shovel code into "prefs.c" to fix it up later.  (The
problem with multiple modules or preferences with the same name should
be obvious; the problem with names with blanks, or upper-case letters,
or punctuation, is that they're a pain to type on the command line.)

svn path=/trunk/; revision=4148
2001-11-04 02:50:21 +00:00
Guy Harris 509f30374e Have a routine that takes a file name for a personal configuration file
and generates the path name; have it, if the file is to be opened for
reading on Win32, check whether it exists and, if not, check for it in
the old home directory-based configuration directory and, if so, return
that path instead, so that files saved with earlier versions of Ethereal
will be seen.

svn path=/trunk/; revision=4072
2001-10-24 07:18:39 +00:00
Guy Harris e4db9c4b64 Add a routine to get the directory in which personal configuration files
reside.  Use it, rather than concatenating the user's home directory and
".ethereal" in a number of files.

Fix up some additional places to use G_DIR_SEPARATOR_S as the pathname
separator.

svn path=/trunk/; revision=4061
2001-10-22 22:59:26 +00:00
Gerald Combs 5521ff2ba5 Add little arrows to the column titles to indicate which column we're
using to sort as well as the sort direction.

svn path=/trunk/; revision=4050
2001-10-21 16:15:21 +00:00
Guy Harris 5bb08b0970 Fix AC_ETHEREAL_PCAP_CHECK so that, if a directory was specified with
"--with-pcap", it adds the "include" subdirectory of that directory to
the list of directories to search for include files, rather than adding
the directory itself.

Check whether libpcap defines "pcap_version", and define
HAVE_PCAP_VERSION if it does.  Use "pcap_version" iff HAVE_PCAP_VERSION
is defined, rather than special-casing MacOS X.

Don't #define a string for the WinPcap version; just leave
HAVE_PCAP_VERSION undefined on Windows, as WinPcap 2.2beta is out, so we
can no longer assume that the Windows version of Ethereal is using
WinPcap 2.1.

svn path=/trunk/; revision=3792
2001-07-27 07:10:13 +00:00
Guy Harris ae251f8426 MacOS support changes, from Michael Tuexen (with some modifications):
replace "--with-plugindir" with "--with-plugins", and have the
	plugin directory optional - this allows plugins to be disabled;

	add "--traditional-cpp" on MacOS X/Darwin (Apple's "cc" compiler
	requires it, for some annoying reason, even though it is, as far
	as I know, GCC-based, and other GCC's don't require it);

	on MacOS X, don't use "pcap_version[]", as, for some annoying
	reason, libpcap on MacOS X doesn't define it.

Clean up some whitespace in the help messages for the configure script.

Move the AM_CONDITIONAL for SETUID_INSTALL after the point at which
"enable_setuid_install" is set, as it tests "enable_setuid_install".

svn path=/trunk/; revision=3788
2001-07-26 07:25:49 +00:00
Guy Harris 537d308abe "open_cap_file()" in Ethereal and Tethereal don't use the FILE_T they
get from calling "wtap_file()", so get rid of the call and the
(otherwise unused) variable to which its result gets assigned.

That lets us get rid of "wtap_file()" in Wiretap.

It also lets us get rid of the include of "zlib.h" in "file.h"; the
#defines of "file_open()", "filed_open()", and "file_close()" are also
unnecessary, so we get rid of those as well.

However, that means we need to include <zlib.h> in "gtk/main.c" and
"tethereal.c", so that the version number of libz is defined and can
show up in the version string.

svn path=/trunk/; revision=3652
2001-07-05 00:34:42 +00:00
Guy Harris cc9df27294 Fix a problem that shows up if you build without libpcap.
svn path=/trunk/; revision=3612
2001-06-27 08:36:08 +00:00