Commit Graph

756 Commits

Author SHA1 Message Date
Gilbert Ramirez 756707ac0d FIRST_PROTO_PREFS_PAGE needs to be incremented by 2 in order for
the "Protocol Preferences" pop-up menu option to work properly.

svn path=/trunk/; revision=4735
2002-02-14 10:58:49 +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 c2136d0735 Include <string.h> to declare various string functions.
Include "snprintf.h", when needed, to declare "snprintf()" on platforms
that don't have it.

Fix some formats and arguments to various printing routines.

Fix "diameter_time_to_string()" to properly fetch the time value from
the data buffer handed to it.

svn path=/trunk/; revision=4639
2002-01-30 23:08:27 +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 a0d7e90519 Make the blurbs for protocol preference items into tooltips. (This also
lets us add tooltips to other preference items whose widgets are created
with the "create_preference_XXX()" routines - just pass in a tooltip
text string rather than a null pointer.)

svn path=/trunk/; revision=4577
2002-01-20 20:05:18 +00:00
Guy Harris 4d81335d28 Squelch a valid compiler warning (passing a "char" to the "is..." macros
can give the wrong answer if the 8th bit of the "char" is set).

svn path=/trunk/; revision=4567
2002-01-18 19:46:19 +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 b4867007ca Support for hex dump mode in "Follow TCP Stream" window showing hex and
ASCII data, from Jirka Novak.

svn path=/trunk/; revision=4564
2002-01-18 07:25:22 +00:00
Guy Harris 32d7eac1ce Get the current value of Boolean preferences before adding widgets for
them (by putting back a line that got accidentally deleted in a previous
checkin).

svn path=/trunk/; revision=4537
2002-01-14 01:14:52 +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 649cc279d6 Put the labels of check boxes to the left of the checkboxes,
right-aligned, and give all of them a colon at the end, to match the
style of other preferences.

svn path=/trunk/; revision=4535
2002-01-12 11:09:09 +00:00
Guy Harris 6437001da6 Get rid of unused variables.
Put the labels of check boxes to the left of the checkboxes,
right-aligned, and give all of them a colon at the end, to match the
style of module preferences.

svn path=/trunk/; revision=4534
2002-01-12 11:02:47 +00:00
Guy Harris ea02d23f06 While you're at it, use the key for the auto scroll option checkbox for
the pointer to the auto scroll options checkbox....

svn path=/trunk/; revision=4532
2002-01-12 09:19:59 +00:00
Guy Harris 0ad27ce8a7 Make the key for the capture preference window's pointer to the auto
scroll option checkbox distinct from the key for the pointer to the
real-time capture option checkbox, so thee auto scroll option checkbox
can be fetched.

svn path=/trunk/; revision=4531
2002-01-12 09:13:50 +00:00
Guy Harris 1aadf9cfc2 Label the window popped up by "Capture->Start" "Capture Options", not
"Capture Preferences", to avoid confusion with the "Capture" item in the
"Preferences" dialog (which sets the initial default values for the
"Capture Options" dialog).

svn path=/trunk/; revision=4523
2002-01-11 08:55:02 +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 9357047df5 Add a preferences page for capture preferences, so that the user can
directly edit the capture preferences, rather than only being able to
set them implicitly from the values for the most recent capture.

Add a preferences item for the interface on which to capture.

Get rid of some unused variables.

svn path=/trunk/; revision=4510
2002-01-10 07:43:39 +00:00
Guy Harris 3ecfaeedb5 Don't process a color filter if there's no filter associated with it.
Don't put a color filter into the list of color filters if we can't
allocate the colors for the filter.

Clean up white space.

svn path=/trunk/; revision=4502
2002-01-08 21:35:17 +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
Guy Harris 6b2ee38ad3 From Albert Chin: eliminate a GCCism.
svn path=/trunk/; revision=4467
2002-01-03 20:01:07 +00:00
Gerald Combs e8839785ad Fix a pointer error in find_stat_node.
Define a default width and maximum height for the stats dialog.

svn path=/trunk/; revision=4463
2001-12-31 20:40:34 +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
Guy Harris 794f0c04f4 Add an extra argument to "epan_dissect_new()" that indicates whether the
display representation should be put into protocol tree items if a
protocol tree is to be constructed; have it set "proto_tree_is_visible"
from that argument.

svn path=/trunk/; revision=4408
2001-12-16 22:16:14 +00:00
Guy Harris f589b96f81 Fix up the comment on "set_main_window_name()" (I'm not sure why I put
that note in about KWM, unless I was noting that the title bar entry for
a window has the window title rather than the icon title, but, as we're
setting both, I'm not sure it's relevant), and change the name of its
argument, as it's used to set both the window and icon titles.

Add some more information to the comments for "reactivate_window()" and
"window_icon_realize_cb()".

svn path=/trunk/; revision=4394
2001-12-13 09:26:15 +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
Guy Harris 39362af814 From Motonori Shindo:
fix a bogus batch mode inference rule of make, so that
	"vc60.pdb" files are created in the proper directory;

	delete ".pdb" files in a "nmake -f Makefile.nmake clean";

	include the text2pcap and mergecap ".pdb" files in the Windows
	binary distribution.

svn path=/trunk/; revision=4385
2001-12-12 01:29:13 +00:00
Guy Harris c5b1e310e3 From Motonori Shindo: add a cast of "ip" to "guint8 *" so pointer
arithmetic can be done on it.

svn path=/trunk/; revision=4384
2001-12-12 01:19:28 +00:00
Guy Harris 975be62d24 Put in a comment indicating that even loading a one-byte field from an
unaligned data structure could get an unaligned load fault on Alpha.

svn path=/trunk/; revision=4381
2001-12-10 23:27:25 +00:00
Guy Harris be4179a865 Test the link-layer type of the frame being looked at, not the
currently-selected frame - they're not necessarily the same.

svn path=/trunk/; revision=4380
2001-12-10 21:42:02 +00:00
Guy Harris b2d9276356 Use the encapsulation type of the current frame to decide what
link-layer header it has.

svn path=/trunk/; revision=4379
2001-12-10 21:26:25 +00:00
Guy Harris 3e55e6702f Get rid of the stuff to use bitfields to dissect IP and TCP headers -
bitfields are a pain to use when dealing with structures with a fixed
layout in memory (you have to worry about bit order, for example).

Don't assume that the Ethernet header is aligned on a 2-byte boundary -
use "pntohs()" to extract stuff from it.  (Perhaps C will force it onto
a 2-byte boundary, but why take chances, and why leave the code
vulnerable to changes outside this module?)

Don't assume that the pointers to the IP and TCP headers are nicely
aligned - use "memcpy()", not structure assignment, to copy the headers.
(They're probably *not* nicely aligned on platforms that require 4-byte
alignment of 4-byte integral quantities; the code was dumping core on
SPARC with an alignment error.)

Don't even make those pointers be pointers to structures, as that may
cause the C compiler to generate in-line 4-byte loads and stores for
"memcpy()" (in fact, it *did* do so with GCC 2.95.1 on SPARC), which has
the same problem as structure assignment.

Don't test the IP protocol number twice when handling PPP.

svn path=/trunk/; revision=4378
2001-12-10 21:19:13 +00:00
Gilbert Ramirez 156abcce61 Change a printf() error message to a simple_dialog() error message.
svn path=/trunk/; revision=4377
2001-12-10 20:34:52 +00:00
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +00:00
Guy Harris 5cc85c2426 Check for invalid maximum packet count values.
svn path=/trunk/; revision=4368
2001-12-09 03:20:19 +00:00
Guy Harris b93a7716e2 From Gordon McKinney: make IP-over-PPP work with the TCP graph code.
svn path=/trunk/; revision=4367
2001-12-09 01:20:14 +00:00
Guy Harris 39581e769b On Win32, a GUI application apparently can't use "popen()" (it
"returns an invalid file handle, if used in a Windows program,
that will cause the program to hang indefinitely"), so we can't
use a pipe to a print command to print to a printer.

Eventually, we should try to use the native Win32 printing API
for this (and also use various UNIX printing APIs, when present?).

For now, we support only printing to a file in Windows.

svn path=/trunk/; revision=4366
2001-12-09 01:12:07 +00:00
Guy Harris d4959b176e Give the help window a title.
svn path=/trunk/; revision=4361
2001-12-08 09:39:23 +00:00
Guy Harris cc97eed136 TCP time-sequence, round-trip time, and throughput graphs, from Pavel
Mores.

svn path=/trunk/; revision=4360
2001-12-08 09:27:51 +00:00
Guy Harris 75cc056222 Attach a descriptive name field type and base to dissector tables; that
specifies how the selector values used as keys in those tables are to be
displayed, and the title to use when displaying the table.

Use that information in the code to display the initial and current
entries of various dissector tables.

Have the dissector for BACnet APDUs register itself by name, and have
the BACnet NPDU dissector call it iff the BAC_CONTROL_NET bit isn't set,
rather than doing it with a dissector table.

svn path=/trunk/; revision=4358
2001-12-08 06:41:48 +00:00
Guy Harris 824071e92f Handle the case of the initial, or current, dissector handle for a
particular port number being null.

svn path=/trunk/; revision=4347
2001-12-06 08:50:14 +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 2026f857bc Don't update the "Save As..." dialog box if it doesn't exist.
Update some comments.

svn path=/trunk/; revision=4342
2001-12-06 03:09:28 +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 c95680e052 When making the "number of ring buffer files" spin button sensitive or
insensitive, make its label sensitive or insensitive too.

When "update list of packets in real time" mode is on, make the ring
buffer mode toggle button, and the "number of ring buffer files" spin
button, insensitive, as ring buffer mode is not supported in "update
list of packets in real time" captures.

When "update list of packets in real time" mode is off, make the
auto-scroll mode button insensitive, as auto-scroll mode is meaningless
unless you're doing an "update list of packets in real time" capture.

Bundle all the sensitivity setting into a single common routine.

Make "ring buffer" two words.

svn path=/trunk/; revision=4325
2001-12-04 09:46:01 +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 9426c4ad15 From Thomas Wittwer: remove unnecessary calls to
"prefs_module_foreach()".

svn path=/trunk/; revision=4321
2001-12-04 07:23:47 +00:00
Guy Harris 64ee59907d "ptype" is always set, even if only to PT_NONE; it will be set to PT_TCP
only there's TCP in the current frame and it will be set to PT_UDP only
if there's UDP in the current frame.  As such, there's no need to check
"ipproto" before checking "ptype" - and we should check "ptype" as well
as "ipproto" when deciding whether we'll put up a "Decode As" dialog
with anything in it.

(Not that there's anything other than IPv4 or IPv6 over which we
currently dissect TCP or UDP....)

svn path=/trunk/; revision=4318
2001-12-03 21:05:59 +00:00
Guy Harris a492a07a51 To check whether the current frame contains TCP or UDP traffic, check
whether the port type is PT_TCP or PT_UDP, don't check the IP protocol
type at the network layer (except to check whether it's set at all, to
decide whether it's IP/IPv6 - if it's not, the transport isn't TCP or
UDP); that way, we don't have to keep track of which IP protocol numbers
are being decoded as TCP or UDP.

svn path=/trunk/; revision=4317
2001-12-03 20:49:03 +00:00
Guy Harris 4212ae25fd When the dissector tables are reset to the default settings, the list of
IP protocol numbers to be decoded as TCP and as UDP should be reset as
well.

svn path=/trunk/; revision=4313
2001-12-03 09:09:11 +00:00
Guy Harris c22d3fdc96 Get rid of the lists of conversation dissectors; instead, have a
dissector table contain both a hash table, to use to look up port
numbers to find a dissector, and a list of all dissectors that *could*
be assigned to ports in that hash table, to be used by user interface
code.

Make the "Decode As" dialog box code use that.

Also make it *not* let you choose whether to set the dissector for both
the UDP and TCP versions of a port; some protocols run only atop TCP,
some run only atop UDP, and even those that can run atop both may have
different dissector handles to use over TCP and UDP, so handling a
single merged list would be a mess.  (If the user is setting the
dissector for a TCP port, only those protocols that Ethereal can handle
over TCP should be listed; if the user is setting the dissector for a
UDP port, only those protocols that Ethereal can handle over TCP should
be listed; if the user is setting a dissector for both, only those
protocols that Ethereal can handle over *both* TCP *and* UDP should be
listed, *and* there needs to be a way to let the "Decode As" code get
both the TCP handle *and* the UDP handle and use the right ones.  If
somebody really wants that, they need to implement all of the above if
they want the code to be correct.)

Fix the code that handles setting the dissection for the IP protocol
number to correctly update the lists of protocols being dissected as TCP
and as UDP; the code before this change wasn't updating the single such
list to add new protocols.

svn path=/trunk/; revision=4311
2001-12-03 08:47:31 +00:00
Guy Harris bced8711f6 Make "dissector_add()", "dissector_delete()", and "dissector_change()"
take a dissector handle as an argument, rather than a pointer to a
dissector function and a protocol ID.  Associate dissector handles with
dissector table entries.

svn path=/trunk/; revision=4308
2001-12-03 04:00:26 +00:00
Guy Harris 8d0ea8bc93 Get rid of an unused variable, and fix a comment.
svn path=/trunk/; revision=4307
2001-12-03 02:37:25 +00:00
Guy Harris cfa1112e79 From John McDermott:
Adds an "Add Expression..." button to the color filter
	creation dialog.

	Improve the look of the "Add color to protocols" window.

	Clean up some ugly code.

Give John credit in the AUTHORS file for the coloring stuff.

svn path=/trunk/; revision=4301
2001-12-02 00:16:02 +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 6f776aa40d Get rid of some unused variables.
svn path=/trunk/; revision=4239
2001-11-21 01:02:03 +00:00
Guy Harris 1c3f2e4cd5 Have a routine to add all the hex dump tabs to the hex dump notebook,
and call it both from "select_packet()" and "create_new_window()",
rather than having two similar loops in both places.

svn path=/trunk/; revision=4233
2001-11-20 10:37:16 +00:00
Guy Harris 800030b8a0 If bytes in a hex dump view are selected, the field in the corresponding
text view should be selected, rather than always selecting a field in
the main text view.

svn path=/trunk/; revision=4232
2001-11-20 10:10:45 +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 10843c0ddc From <a.stockmeier[AT]avm.de>: fix the file dialog box code to use
"g_strdup()", not "strdup()" to copy strings.

svn path=/trunk/; revision=4181
2001-11-09 00:08:30 +00:00
Guy Harris fbc3f2eb0e Include protocols for TCP conversation dissectors in the list of
protocols that can be used to decode stuff.

svn path=/trunk/; revision=4152
2001-11-04 04:12:03 +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 8b16a79d8f Add the Ethereal Web site's mirror of WinPcap to the dialog popped up if
you try to capture on Windows without having WinPcap installed.

svn path=/trunk/; revision=4113
2001-10-31 07:11:08 +00:00
Guy Harris dffa2a989a Get rid of a bunch of stuff that was there to support non-tvbuffified
dissectors and that's no longer needed.

svn path=/trunk/; revision=4112
2001-10-31 05:59:20 +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 d453f6d992 On Windows, put Ethereal configuration files under the "Application
Data\Ethereal" directory under the user's profile, as that appears to be
the Windows 2000 standard.

svn path=/trunk/; revision=4071
2001-10-24 06:13:07 +00:00
Guy Harris cf5a1d86e7 Add a new routine to create the ".ethereal" directory for a user.
Use that routine rather than duplicating that code in the routines to
write out the preference file and filter files.

Use it in the code for the color filter dialog, so that the directory in
question is created if necessary.

As that routine returns an error indication, have the code that calls
that routine put up a message box if the attempt fails.

svn path=/trunk/; revision=4065
2001-10-23 05:01:02 +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
Guy Harris a6da6905cf Use G_DIR_SEPARATOR_S rather than "/" as a pathname separator in format
strings used to generate pathnames.

svn path=/trunk/; revision=4057
2001-10-21 21:56:05 +00:00
Guy Harris e980dd9d3b Use G_DIR_SEPARATOR_S rather than "/" as a pathname separator in format
strings used to generate pathnames.

Move the definition of PF_DIR from <epan/epan.h> to <epan/filesystem.h>,
so that files requiring only the definition of PF_DIR don't have to
include <epan/epan.h>, and get rid of no-longer-necessary includes of
<epan/epan.h>.

Add a routine to get the directory for "system files" such as
"/etc/ethers" - it's "/etc" on UNIX, and the datafile directory on
Windows (as there's no "/etc" on Windows).  Use that to construct the
pathname of the ethers and ipxnet files.

svn path=/trunk/; revision=4056
2001-10-21 21:48:00 +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
Richard Sharpe bd4a2b48b0 A small patch from Moronori Shindo to fix compiles under MSVC etc ...
svn path=/trunk/; revision=4026
2001-10-13 12:05:32 +00:00
Guy Harris 0adf5001dc Put the scrollbar for the scrolled window containing the CList in the
preferences dialog where the user specified, and register that scrolled
window so that if the preference is changed the scrollbar moves.

svn path=/trunk/; revision=4025
2001-10-13 07:56:27 +00:00
Guy Harris aa5c21f247 Set the data for E_{PRINT,COLUMN,STREAM,GUI}_PAGE_KEY to the notebook
page for the preferences item rather than to the frame for the
preferences item, as that's what the code in "gtk/gui_prefs.c" expects
(otherwise you get errors).

svn path=/trunk/; revision=4024
2001-10-13 07:47:30 +00:00
Gerald Combs bc34ab11b7 Reduce the CinemaScope-like proportions of the preferences dialog by
getting rid of the notebook tabs and using a CTree to select pages.

svn path=/trunk/; revision=4015
2001-10-11 02:17:29 +00:00
Guy Harris f2cb0c704d The Wiretapped.net mirror is OK again (it was a problem with the
mirroring procedure, due to the Politecnico di Torino site's IIS not
being configured to allow the relevant "virtual directories" to be
listed, thus keeping Wiretapped.net from figuring out what files were
there and whether they've changed), so put back the references to it.

svn path=/trunk/; revision=3976
2001-09-29 19:56:08 +00:00
Guy Harris 6515004633 Sigh. The wiretapped.net site appears to have an old version of
WinPcap's installer (it dates back to May, meaning it may be a beta of
2.2 or may even be 2.1), so don't suggest that people go there.

svn path=/trunk/; revision=3964
2001-09-28 07:50:48 +00:00
Guy Harris c2d19c1ceb Make the message popped up if you try to do a capture on a Win32 machine
when wpcap.dll couldn't be loaded more detailed, in the hopes that it'll
reduce the chances that somebody will see that message and not know what
to do.  Also, mention the Wiretapped.net mirror of the WinPcap site, as
the WinPcap site is all-too-often down due to networking glitches.

svn path=/trunk/; revision=3955
2001-09-26 20:02:36 +00:00
Guy Harris aa29eca046 The "Save only marked packets" checkbox should change as the file type
changes, just as the "Save only packets currently being displayed"
checkbox should.

svn path=/trunk/; revision=3913
2001-09-10 08:49:11 +00:00
Guy Harris 8d31fd0690 From Frank Singleton: add some missing includes of <string.h>.
svn path=/trunk/; revision=3889
2001-08-31 19:47:10 +00:00
Guy Harris d7973c6ede Fix a typo.
svn path=/trunk/; revision=3860
2001-08-21 07:03:50 +00:00
Guy Harris 9d601c6799 On Windows, use the directory in which the binary resides as the
directory in which global data files are stored.  If an installed binary
is being run, that's the correct directory for them; if a build-tree
binary is being run, the "manuf" file will be there, and you can put
other data files there as well, if necessary.

Do the same with plugins, except that, if there's no
"plugins\\{version}" subdirectory of that directory, fall back on the
default installation directory, so you at least have a place where you
can put plugins for use by build-tree binaries.  (Should we, instead,
have the Windows build procedure create a subdirectory of the "plugins"
source directory, with the plugin version number as its name, and copy
the plugins there, so you'd use the build-tree plugin binaries?)

Move "test_for_directory()" out of "util.c" and into
"epan/filesystem.c", with the other file system access portability
wrappers and convenience routines.  Fix "util.h" not to declare it - or
other routines moved to "epan/filesystem.c" a while ago.

svn path=/trunk/; revision=3858
2001-08-21 06:39:18 +00:00
Gilbert Ramirez aacb4d90f0 Use system's version of AM_PATH_GLIB macro.
Optimize use of AC_CHECK_FUNC in wiretap/acinclude.m4
Move #include "config.h" to be first include in some files.
From albert chin (china@thewrittenword.com)

svn path=/trunk/; revision=3857
2001-08-20 15:23:34 +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 6b664c122c Check for valid column titles (non-zero-length) and valid column formats
in preference settings.

In the process of doing that, fix a memory leak (we were handing a null
pointer, rather than a pointer to the list of strings in
"column.format", to "clear_string_list()").

svn path=/trunk/; revision=3775
2001-07-22 21:50:47 +00:00
Guy Harris c10166c5d0 Get rid of some unused variables.
svn path=/trunk/; revision=3744
2001-07-20 07:11:57 +00:00
Ed Warnicke 718e062823 Added a "Mark Frame" option to the packet_list_menu_items
so that you can right click on a packet in the packet list
and mark it.

svn path=/trunk/; revision=3737
2001-07-17 05:44:58 +00:00
Ed Warnicke add908fabd Added a "Suppress Unmarked" option to the print dialog to
allow you to suppress the printing of unmarked packets.
This allows a user to mark the packets they wish to print and
print ONLY those packets by suppressing all other unmarked packets.

This may seem like a bit of a convoluted way of expressing things,
as usually the desired behavior would be to print the marked packets.
However, we do NOT print marked packets that are not displayed under
the current filter.  To be maximally explicite I've expressed this
as suppressing unmarked frames.

svn path=/trunk/; revision=3736
2001-07-17 05:32:44 +00:00
Guy Harris 30846950d0 Support for {Enter,Return} keys toggling expansion of selected protocol
tree item, from Heikki Vatiainen.

svn path=/trunk/; revision=3672
2001-07-09 22:54:15 +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 fafefda449 Don't offer the ability to edit capture filters if Ethereal wasn't
linked with libpcap.

svn path=/trunk/; revision=3613
2001-06-27 10:00:14 +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
Guy Harris 25c2cb0ec0 A better fix - we don't use "assigned" if the action was E_DECODE_NO, so
don't bother fetching it if the action is E_DECODE_NO; that means we can
also avoid fetching the currently selected row if the action is
E_DECODE_NO, so the fact that we've cleared the selection if the action
is E_DECODE_NO doesn't matter.

svn path=/trunk/; revision=3606
2001-06-25 08:10:38 +00:00
Guy Harris 9c046f18a3 In "decode_network()", get the information about the currently selected
row *before* calling "decode_simple()", as, if the "Do not decode" radio
button is selected, "decode_simple()" will clear the current selection.

svn path=/trunk/; revision=3605
2001-06-25 07:57:50 +00:00
Guy Harris 60d762a7c2 In a capture child process, *completely ignore* the preference setting
for promiscuous mode; just do what the parent process told you, i.e. do
a non-promiscuous capture iff a "-p" flag was specified.

svn path=/trunk/; revision=3575
2001-06-19 08:47:48 +00:00
Guy Harris 0645bf8d3f Get rid of an unnecessary declaration of "packet_list".
svn path=/trunk/; revision=3565
2001-06-18 06:18:03 +00:00
Guy Harris 2da9bb2696 When printing the contents of a raw-data field, don't use the raw data
of the current frame as the source, use the raw data of the tvbuff
that's the data source of that field.

svn path=/trunk/; revision=3531
2001-06-08 08:50:51 +00:00
Guy Harris 2851b7ef76 Enable "Match Selected" only if there's a field selected *and* we can do
a "Match Selected" on it - we can't do a "Match Selected" if the field
has no value (e.g., FT_NULL) and has a length of 0.

If we unselect the current packet, we don't have a protocol tree, so we
don't have a currently selected field - clear the "Match Selected" menu
item and the display in the status line of information about the
currently selected field.

Move the low-level statusbar manipulation into "gtk/main.c", in routines
whose API doesn't expose anything GTK+-ish.

"close_cap_file()" calls one of those routines to clear out the status
bar, so it doesn't need to take a pointer to the statusbar widget as an
argument.

"clear_tree_and_hex_views()" is purely a display-manipulating routine;
move it to "gtk/proto_draw.c".

Extract from "tree_view_unselect_row_cb()" an "unselect_field()" routine
to do all the work that needs to be done if the currently selected
protocol tree row is unselected, and call it if the currently selected
packet list row is unselected (if it's unselected, there *is* no
protocol tree, so no row can be selected), as well as from
"tree_view_unselect_row_cb()".

Before pushing a new field-description message onto the statusbar, pop
the old one off.

Get rid of an unused variable (set, but not used).

svn path=/trunk/; revision=3513
2001-06-05 07:39:31 +00:00
Guy Harris b699efc451 Changes to structure initializations not to initialize some but not all
members, from Joerg Mayer.

svn path=/trunk/; revision=3501
2001-06-02 06:26:54 +00:00
Guy Harris 6ee04dad33 Support for "-N" flag enabling selected forms of name resolution, from
Joerg Meyer.

Support for saving to the preferences file the settings for all types of
name resolution.

Do a case-insensitive check for "true" and "false" in Boolean preference
settings.

svn path=/trunk/; revision=3489
2001-05-31 08:36:46 +00:00
Guy Harris 963de49427 Free the string you "g_strdup()"ed, rather than handing "g_free()" the
null pointer that provoked you to free the string.

svn path=/trunk/; revision=3485
2001-05-31 05:33:15 +00:00
Guy Harris cc6b18e6ab No old-style dissectors call "old_dissector_try_port()", so get rid of
"old_dissector_try_port()".

There are no longer any old-style heuristic or conversation dissectors,
so get rid of "old_heur_dissector_add()" and "old_conv_dissector_add()"
and the data-structure members that support old-style heuristic and
conversation dissectors.

svn path=/trunk/; revision=3478
2001-05-30 06:41:08 +00:00
Guy Harris 176eaa265a Give protocol tree windows a horizontal scrollbar - yes, sometimes
protocol tree lines can be long enough that you might want, or even
need, one (consider really long names for SNMP OIDs, for example).

svn path=/trunk/; revision=3466
2001-05-27 07:50:28 +00:00
Gerald Combs f9a822d78f Fix a bug reported by Christopher McAvaney in
http://www.ethereal.com/lists/ethereal-dev/200104/msg00152.html.
In the display filter help window, the height of the text widget
can easily exceed the maximum height of an X window, which results
in a nonfunctioning vertical scroll bar.  This fix disables the
GtkScrolledWindow vertical scroll bar, and creates a new scroll bar
attached directly to the GtkText widget.

The layout is a little off - the horizontal scroll bar now occupies the
full height of the GtkScrolledWindow widget.  There doesn't seem to be
an easy way to grab the height of the horizontal scroll bar in order to
pad out the are underneath the vertical scroll bar.

svn path=/trunk/; revision=3411
2001-05-12 19:45:37 +00:00
Guy Harris 025578a1bd "-l" command-line option to turn on automatic scrolling in "Update list
of captures in real time" captures, from Christian Lacunza.

svn path=/trunk/; revision=3389
2001-05-01 00:41:46 +00:00
Guy Harris bdb69627b2 "prefs.capture_real_time", not "prefs.capture_auto_scroll", should
control whether we have a child process do the capturing; a user might
want the packet list to be updated as packets arrive but *not* want it
to scroll so that the most recently arrived packets are shown.

"prefs.capture_auto_scroll", not "auto_scroll_live", should control
whether we scroll a real-time-update capture's packet list;
"auto_scroll_live" isn't set by the capture dialog box,
"prefs_capture_auto_scroll" is.

svn path=/trunk/; revision=3388
2001-05-01 00:18:48 +00:00
Guy Harris da38a630cb Undefine "isprint()" before re-defining it, to squelch a compiler
warning.

Put in a comment indicating that non-ASCII characters may well pass
"isprint()".

svn path=/trunk/; revision=3381
2001-04-25 06:33:41 +00:00
Guy Harris 799672571b Signed vs. unsigned fixes from Joerg Mayer.
svn path=/trunk/; revision=3373
2001-04-24 00:28:21 +00:00
Guy Harris c75f555d8c Move the declarations of IP protocol numbers to "ipproto.h" from
"packet-ip.h".

Fix Gerald's address in some files while we're at it.

svn path=/trunk/; revision=3366
2001-04-23 17:51:37 +00:00
Guy Harris f4db05c7d1 When displaying the numeric value for the value_string string that was
selected in the filter-construction GUI, treat BASE_BIN like BASE_DEC,
as that's currently how it's treated elsewhere.

svn path=/trunk/; revision=3351
2001-04-20 21:57:55 +00:00
Guy Harris 4caa331d21 Patch from Ronnie Sahlberg to cause the field description section of the
status bar to display nothing, rather than "Text (text)", when a
"proto_tree_add_text()" field is selected.

While we're at it, use a similar test to eliminate the text pseudo-field
from the output of "{ethereal,tethereal} -G", as well.

svn path=/trunk/; revision=3335
2001-04-19 23:06:23 +00:00
Guy Harris d2d999fb74 Check the validity of numbers specified in command-line options.
svn path=/trunk/; revision=3326
2001-04-18 05:45:58 +00:00
Guy Harris 4acaa8b961 Fix to a preferences dialog bug, from <inoue@ainet.or.jp>.
svn path=/trunk/; revision=3315
2001-04-17 18:49:55 +00:00
Guy Harris f8c9764894 There's no "enable name resolution in captures" preference in Ethereal,
and never was - there's only an Ethereal-wide "enable name resolution"
preference.  Name it just "name_resolve".

Replace all tests of "g_resolving_actif" with tests of
"prefs.name_resolv", and replace all code that sets "g_resolving_actif"
with code that sets "prefs.name_resolv", so that the setting of
"prefs.name_resolv" actually affects whether names are resolved or not.

svn path=/trunk/; revision=3300
2001-04-15 03:37:16 +00:00
Jeff Foster 78ce39994c Added the ethereal capture preferences to the preference file.
svn path=/trunk/; revision=3298
2001-04-13 14:59:30 +00:00
Gilbert Ramirez 2a2b4bb6b4 Check in isprint() hack for Win32 so that Ethereal is usably while
we figure out what the real bug is.

Fix set_last_open_dir() to use G_DIR_SEPARATOR and G_DIR_SEPARATOR_S
for cross-platform compatibility.

svn path=/trunk/; revision=3281
2001-04-10 12:07:40 +00:00
Gilbert Ramirez 8ea93329a8 last_open_dir needs a trailing slash in order for the GTK+
file-selection dialogue to open the directory and show its
contents, otherwise it opens the parent directory and shows *its*
contents.

svn path=/trunk/; revision=3279
2001-04-09 22:35:23 +00:00
Gilbert Ramirez 9fc1e0261b Win32 build fix, show "0.5.2 (WinPcap 2.1)" as the libpcap version
for Win32, and show a slightly more informative (i.e., geared to the
user) help message when trying to capture without having WinPcap installed.

svn path=/trunk/; revision=3261
2001-04-05 05:58:05 +00:00
Gilbert Ramirez a817e97015 Now that WinPcap is a DLL, I can load it at run-time rather than load-time.
That means that I no longer need to distribute capture and non-capture
versions of Ethereal for Win32; one version (compiled with WinPcap headers)
can run on systems with or without WinPcap.

For systems that don't have WinPcap, instead of disabling the Capture
menu, Capture|Start brings up a dialogue informing the user that wpcap.dll
was not loadable, and gives a URL to the WinPcap home page.

svn path=/trunk/; revision=3249
2001-04-03 05:26:27 +00:00
Guy Harris 65dc469326 "get_home_dir()", in "epan/filesystem.c", uses
"find_last_pathname_separator()" on Win32; move the other pathname
manipulation routines from "util.c" into "epan/filesystem.c".

Remove from "util.h" the declarations of routines not defined in
"util.c", and put them into "epan/filesystem.h" if they're not already
there.

Adjust #includes to make the above work.

svn path=/trunk/; revision=3241
2001-04-02 09:53:46 +00:00
Guy Harris d203637ade Use GLib types rather than "u_int" and "u_char" in "resolv.h"; "u_int"
and "u_char" aren't declared in <sys/types.h> in Win32, you have to
include <winsock.h>, which is a pain.

Throw in some "const"s while we're at it.

svn path=/trunk/; revision=3240
2001-04-02 09:41:56 +00:00
Ed Warnicke f5cf9c8dca Added two new arguments to epan_init() and proto_init() to
allow the passing of register_all_protocols() and
register_all_protocol_handoffs() through epan_init() to proto_init().
This allows the removal of the compile time dependence of proto.c
on register.h.  Modified dftest.c, tethereal.c, and gtk/main.c to
use the new style epan_init() and depend on register.h.

svn path=/trunk/; revision=3237
2001-04-02 00:38:36 +00:00
Gilbert Ramirez 9bda102f83 Change name of "Last-Protocol" columns to "End" so that there's
a better chance of them fitting horizontally into the window, for
users of small screens.

svn path=/trunk/; revision=3203
2001-03-29 04:21:35 +00:00
Guy Harris c58b7b49b5 Make "comp_info_str" static in Ethereal - there's no need for it outside
"gtk/main.c" in Ethereal.

Add the GLib version to it in Ethereal, and put in the GLib version
rather than the GTK+ version in Tethereal (which isn't linked with
GTK+...).

Make it a GString; this makes the code to construct it slightly less
ugly, especially now that we're putting the GLib version in.

Fix the code for the "-D" flag in Tethereal to compile in a no-libpcap
version (in a no-libpcap version, it just says that this version of
Tethereal wasn't compiled with capture support).

svn path=/trunk/; revision=3196
2001-03-27 06:48:12 +00:00
Guy Harris f380fba2b1 There's no "-D" option to Ethereal - remove the "D" from the getopt flag
list argument.

svn path=/trunk/; revision=3195
2001-03-27 06:19:30 +00:00
Guy Harris 92e96d7e9f GUI code fixes from Eduardo P�rez Ureta.
svn path=/trunk/; revision=3189
2001-03-26 10:28:34 +00:00
Gilbert Ramirez 16358126d5 Create dialogue box as top-level window, not transient window.
svn path=/trunk/; revision=3188
2001-03-26 03:02:57 +00:00
Guy Harris 51aa38785a Get rid of extra definition of "byte_nb_ptr"; it's defined in
"gtk/main.c", and declared in "gtk/gtkglobals.h".

The last argument to "gtk_object_set_data()" is a "gpointer"; cast it to
that.

svn path=/trunk/; revision=3186
2001-03-24 23:57:12 +00:00
Guy Harris 92a7d9b2eb Fix typos in comments.
svn path=/trunk/; revision=3185
2001-03-24 23:53:07 +00:00
Guy Harris 9b85728d1d "reactivate_window()" is used only by stuff in the "gtk" directory, and
has an API that depends on GTK+.  "set_main_window_name()" is
UI-toolkit-independent.  Declare the former in a new "gtk/ui_util.h"
file, rather than in "ui_util.h"; this helps separate
UI-toolkit-independent stuff from UI-toolkit-dependent stuff.

svn path=/trunk/; revision=3181
2001-03-24 02:23:08 +00:00
Guy Harris 8ac0e6618a The declaration of "destroy_packet_wins()" belongs in
"gtk/packet_win.h", along with the declarations of the other packet
window manipulation routines; put it there.

svn path=/trunk/; revision=3180
2001-03-24 02:14:56 +00:00
Guy Harris 58369df4ef Give the code that computes protocol statistics a progress dialog box,
as, on a large capture, it could take a significant amount of time.

Let the user stop the computation and, if they do, don't pop up the
statistics dialog box.

Create a new header file declaring the routines to create, update, and
destroy progress dialog boxes; those routines' APIs don't depend on
GTK+, but others declared in "ui_util.h" do, and we don't want to oblige
a source file to depend on GTK+ headers unless it uses a GTK+ API or an
API that depends on GTK+.

svn path=/trunk/; revision=3179
2001-03-24 02:07:22 +00:00
Guy Harris 720d7bb9f4 Put back some of Gilbert's changes lost by recent checkins.
svn path=/trunk/; revision=3176
2001-03-23 22:26:33 +00:00
Jeff Foster 2fd1bed04a Fix last minute edit mistake in add_byte_tab.
svn path=/trunk/; revision=3166
2001-03-23 17:14:40 +00:00
Jeff Foster 395b68ea19 Changes required to support multiple named data sources.
Tvbuffers changed to added the data source name,
GUI and printing code changed to support these changes
and display the multiple hex views.

svn path=/trunk/; revision=3165
2001-03-23 14:44:04 +00:00
Gilbert Ramirez e108afe2bb The Win32 build builds wiretap as a DLL and requires WinPcap 2.1.
svn path=/trunk/; revision=3163
2001-03-23 02:05:29 +00:00
Gilbert Ramirez 2218ce1220 Add a new tool which summarizes packet counts by protocols, but
organizes the protocols in the same hierarchical order in which
they are found in the packet.

The GUI needs some more refinement (placment of vertical
scrollbar, style of GtkCTree, initial sizing of window).

I need to add an option to honor/not honor the current display filter.

svn path=/trunk/; revision=3162
2001-03-22 23:54:47 +00:00
Gilbert Ramirez 712548da3e In the code that handles finding a field after a user clicks on
a byte in the hex dump,

1. Fix an off-by-one error when finding the field. This only showed up
if the selected byte had no field of its own and was only designated
as part of the parent protocol (like the 00-padding at the beginning of
TCP options).

2. Fix an off-by-one error when clicking on a character in the second
half of the "text dump" portion of the hex dump. I forgot about the
extra space between the first 8 characters and the second 8 characters.

svn path=/trunk/; revision=3117
2001-03-07 19:33:24 +00:00
Guy Harris bf1ebaea4f Use "proto_get_first_protocol()" and "proto_get_next_protocol()" to
enumerate the protocols, as that

	1) gives you the protocols in dictionary order;

	2) leaves out the non-protocol "text";

	3) doesn't even bother to show you non-protocols, so you don't
	   have to check for them.

svn path=/trunk/; revision=3115
2001-03-06 21:07:13 +00:00
Guy Harris c4562297ab Add a few more items to ".cvsignore".
svn path=/trunk/; revision=3100
2001-03-03 00:47:31 +00:00
Guy Harris 1c71e3a0fa Do a bunch of semantic checks when "Accept" is clicked, so that we catch
at least some invalid filter expressions.

svn path=/trunk/; revision=3099
2001-03-03 00:45:14 +00:00
Gilbert Ramirez 540f564993 Calculate the height and width of m_r_font globally, since various
routines need it.

When a user clicks on a hex digit or on the corresponding character
(the "text dump" portion) in the hex dump, find the field in the
proto_tree that the byte corresponds to, expand the GtkCTree so that
the field is viewable, select the field, and center it vertically.
LanAlyzer has this feature, and I've missed it in Ethereal.

svn path=/trunk/; revision=3096
2001-03-02 23:10:12 +00:00
Gilbert Ramirez 8260a34fe5 create_main_window() does not need to be called by the capture child
process.

svn path=/trunk/; revision=3094
2001-03-02 17:44:07 +00:00
Gilbert Ramirez c88e7b5a63 Add "Toggle All", "Enable All", and "Disable All" buttons to the
protocol GUI.

svn path=/trunk/; revision=3091
2001-03-01 21:34:09 +00:00
Gilbert Ramirez e9b0d49fb0 Don't let the color selection dialogue for TCP Streams
stretch itself due to a really wide notebook widget.

svn path=/trunk/; revision=3090
2001-03-01 20:49:50 +00:00
Guy Harris c1764ee28d Boolean fields are just like other fields - if you use the field name
without a comparison operator, it tests for the field's presence or
absence, not its value; to test whether a Boolean field is true, you
compare it with a non-zero value, and to test whether it's false, you
compare it with a zero value.

Make the filter expression construction dialog handle that correctly.

svn path=/trunk/; revision=3068
2001-02-23 07:09:39 +00:00
Guy Harris 52df3c73ec The text entry box that a filter construction dialog manipulates is
always attached to the dialog as the E_FILT_FILTER_TE_KEY data, but only
sometimes attached as the E_FILT_TE_KEY data.

Get rid of E_FILT_TE_KEY completely, as it's redundant, and use only
E_FILT_FILTER_TE_KEY; this keeps us from crashing as a result of trying
to manipulate the widget referred to by E_FILT_TE_KEY if E_FILT_TE_KEY
hasn't been set to refer to any widget.

svn path=/trunk/; revision=3067
2001-02-23 05:54:27 +00:00
Guy Harris 81f6ce8b71 Make the "activate" signal on the text entry boxes in the filter editing
dialog activate the entire dialog box.

svn path=/trunk/; revision=3062
2001-02-20 20:25:08 +00:00
Guy Harris 16091b24f1 Catch the "destroy" signal on the filter-expression-construction dialog,
and, when it's being destroyed, disconnect from the "destroy" signal on
the text entry box to which it's attached, so that, when that text entry
box is destroyed, we don't try to get rid of the no-longer-extant
filter-expression-construction dialog.

svn path=/trunk/; revision=3061
2001-02-20 20:14:18 +00:00
Guy Harris 83a7e036fb Catch the "destroy" signal on the text entry box to which a
filter-expression-construction dialog box is attached; if the text entry
box is destroyed (which typically means the window it's in was
destroyed), get rid of the filter-expression-construction dialog box.

svn path=/trunk/; revision=3060
2001-02-20 20:06:04 +00:00
Guy Harris d1337c0481 The all-purpose answer to "this widget expands to fill the space
available for it and it looks ugly" is "throw an alignment around it".
(I *still* don't know why it's not required in other dialog boxes, e.g.
the filter-editing dialog box.)

svn path=/trunk/; revision=3059
2001-02-20 19:09:30 +00:00
Guy Harris f49d4467fc Make the "activate" signal on the text entry boxes in the filter
expression construction dialog activate the entire dialog box.

Make a desperate but failed attempt to bludgeon GTK+, The Toolkit That
Knows Better Than You Do How Big Buttons Should Be Made, Even If It
Looks Butt-Ugly, And Which Appears To Randomly Decide Whether To Make It
Look Ugly Or Not, into making the "Cancel" button as tall as the inside
of the "Accept" button, not as tall as the "Accept" button plus its
"this is the default button" surround.

svn path=/trunk/; revision=3057
2001-02-20 09:53:48 +00:00
Guy Harris ef2d72eaf8 Call the test for a protocol "is present", just like the test for other
fields.

Show a relational operator on a field if the field supports it *or* if
the field can be sliced and the type generated by a range (FT_BYTES)
supports it.  (This lets you do a comparison on a protocol, not just on
a range of a protocol - e.g., "arp == 2", not just "arp[0:1] == 2" - but
the alternative would be to show only the "is present" test, as if you
don't offer the other tests, you can't turn on the range text box when
they select a comparison expression if you don't show comparison
expresions...).

svn path=/trunk/; revision=3056
2001-02-20 09:28:28 +00:00
Guy Harris 0db0d3d438 On Win32, if Ethereal started as a GUI rather than a console
application, catch what GLib message-logging calls we can, and create a
console and make it the standard input, output, and error if such a call
is made, so those messages show up in a console window.  Create the
console for the output of "ethereal -v" as well.

svn path=/trunk/; revision=3052
2001-02-20 04:09:37 +00:00
Guy Harris f6f6aa6424 "Decode As" UI cleanups, and documentation, from David Hampton.
svn path=/trunk/; revision=3032
2001-02-14 07:15:39 +00:00
Guy Harris bea00e22cf In a display filter expression, make a field name refer to any of the
fields with that name.

svn path=/trunk/; revision=3030
2001-02-13 18:34:51 +00:00
Guy Harris 0196634a17 If there are multiple fields with the same name, list only one of them
in the output of "{ethereal,tethereal} -G", so that it appears only once
in the documentation.

Expand some comments to give more details.

svn path=/trunk/; revision=3024
2001-02-12 10:06:51 +00:00
Guy Harris 32a7b693f9 If you register more than one field with the same name, the dfilter code
can now handle that; this allows us to register both the modulo-8 and
the modulo-128 versions of various X.25 bitfields with "x.25.XXX" names,
which lets us get rid of the "ex.25" protocol stuff completely and use
"x.25" for both modulo-8 and modulo-128 X.25.  Do so.  (Also, fix up
some cases where we appeared to be using the modulo-8 fields when
dissecting modulo-128 X.25.)

This, in turn, allows us to register the X.25 dissector, as there's now
only one protocol with which it's associated, and make it static and
have it called only through a handle, and to, when registering it with
the "llc.dsap" dissector table, associate it with "proto_x25".

That, in turn, allows us to get rid of the "CHECK_DISPLAY_AS_DATA()"
calls, and the code to set "pinfo->current_proto", in the X.25
dissector.

The code for the display filter expression dialog would, if there are
two fields with the same name registered under a protocol, list both of
them; have it list only one of them - the fields should have the same
type, the same radix, and the same value_string/true_false_string table
if any (if they don't, they're really not the same field...).

svn path=/trunk/; revision=3023
2001-02-12 09:06:19 +00:00
Guy Harris 076c614cfb Display Ethernet protocol types in hex, not decimal (that's how they're
generally shown), and display port numbers and IP protocol numbers as
unsigned.

svn path=/trunk/; revision=3022
2001-02-12 01:17:23 +00:00
Guy Harris 55662a3607 Inactivate the "Decode As" menu item if the "Decode As" dialog box
wouldn't actually offer any options to the user.

Make a bunch of routines static that aren't used outside
"decode_as_dlg.c".

Remove the declaration of the nonexistent "decode_as_register_tcpudp()"
routine.

svn path=/trunk/; revision=3020
2001-02-11 23:02:05 +00:00
Guy Harris bf0a3a32d1 In Ethereal, attempt to get the packet statistics from libpcap when
capturing; if we succeed, display the packet drops count as the "Drops"
value in the status line and as the "Dropped packets" statistics in the
summary dialog box, otherwise don't display it at all.

In Tethereal, attempt to get the packet statistics from libpcap when
capturing; if we succeed, and if there were any dropped packets, print
out the count of dropped packets when the capture finishes.

svn path=/trunk/; revision=3016
2001-02-11 09:28:17 +00:00
Guy Harris ada3b765ef If we failed to open a capture file specified by the "-r" flag, don't
attempt to free the read filter if we don't have a read filter.

svn path=/trunk/; revision=2999
2001-02-08 03:55:45 +00:00
Guy Harris 046863344e Fix the previous checkin to correctly handle presence tests on
protocols.

svn path=/trunk/; revision=2977
2001-02-01 22:40:49 +00:00
Guy Harris c4f0b539d7 For protocols, call the test for the field being present "has this
protocol" rather than "is present".

svn path=/trunk/; revision=2976
2001-02-01 22:33:58 +00:00
Guy Harris bf4d3052e8 Use the pretty name for the type, not the internal name, in the help
dialog for display filter fields.

svn path=/trunk/; revision=2975
2001-02-01 22:28:58 +00:00
Guy Harris e7d46da0dd Use the ftype routines to determine what tests can be done on a field,
and whether you can slice a field.

svn path=/trunk/; revision=2974
2001-02-01 22:21:30 +00:00
Guy Harris baee1df878 FT_PROTOCOL is like FT_NONE; you can only test for the field's presence
(XXX or absence - we should offer that choice in the dialog).

svn path=/trunk/; revision=2973
2001-02-01 22:01:42 +00:00
Gilbert Ramirez c3d01c2f3f Always show the scrollbar in the tree view panel, so that the scrollbar
doesn't appearn and disappear depending on the size of the proto tree
in relation to the view window. I didn't like the horizontal jumps that
the proto tree had to do when the scrollbar either disappeared or
appeared.

svn path=/trunk/; revision=2969
2001-02-01 20:36:01 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00
Guy Harris 8b51643203 "Decode As" dialog, from David Hampton.
svn path=/trunk/; revision=2965
2001-02-01 07:34:33 +00:00
Guy Harris 00fcdc0900 There's no need for a member of a "capture_file" structure holding a
compiled capture filter program, so remove it, and remove the include of
<pcap.h> from "file.h"; instead, have local "struct bpf_program"
structures where needed, and have those files that need stuff from
<pcap.h> include it.

This cleans stuff up a bit, and should eliminate a pile of compile
warnings with Visual C++ due to <pcap.h> and some GTK+/GLib header file
(or files they include) both defining "inline".

svn path=/trunk/; revision=2954
2001-01-28 23:56:29 +00:00
Guy Harris 5999b61fdd Use "Close", rather than "Cancel", in the filter dialog box; clicking
that button doesn't undo edits you've made to the list of filters it's
displaying.

Don't show an "OK" button if the dialog isn't attached to a text entry
box, as the "OK" button means "enter the current filter into the
attached text entry box, and close the dialog", and if there *is* no
attached text entry box, "OK" doesn't do what you might expect (it's
equivalent to "Close").

svn path=/trunk/; revision=2952
2001-01-28 21:30:53 +00:00
Guy Harris cc74cc0a5f Get rid of support for old-style plugins (support for old-style plugins
requires that the dfilter code be initialized before the plugins are
added; this required us to *re*-initialize the dfilter code after
reading in all the plugins, as the plugins may themselves have added new
filterable fields - that was a bit of a mess), and make the
"Tools->Plugins" dialog box show the new-style plugins.

svn path=/trunk/; revision=2950
2001-01-28 21:17:29 +00:00
Guy Harris ceef26d2c1 Have separate capture and display filter lists; some filter dialog boxes
use the capture filter lists, and others use the display filter list, as
appropriate.

Have separate menu items for editing the capture and display filter
lists.

Have separate "~/.ethereal/cfilters" and "~/.ethereal/dfilters" files
for the two lists; if either of those files isn't found, we try
"~/.ethereal/filters", which means that you will start out with two
identical lists holding all your filters - if certain filters belong
only in one list, you'll have to delete them by hand from the other
list.

Do I/O error checking when reading and writing filter lists; when
writing a filter list, write it to a new file, and then rename the new
file on top of the old file, so that you don't lose your old filter list
if, for example, you run out of disk space or disk quota.

svn path=/trunk/; revision=2948
2001-01-28 09:13:10 +00:00
Guy Harris 3c596f5d71 Call "get_filter_list()" when Ethereal starts up.
Have it free up any list of filters we already have before reading in
new filters.

svn path=/trunk/; revision=2947
2001-01-28 04:52:29 +00:00
Guy Harris c8639c08ee Pull the stuff to read and write the list of filter expressions up into
a file in the top-level directory.

svn path=/trunk/; revision=2946
2001-01-28 04:43:26 +00:00
Guy Harris a86fd5444f Make the "Cancel" button in the "Protocol" dialog box, as well as a
delete event on that window, revert all the protocol enabling settings
to the values they had when the dialog box was first popped up.

svn path=/trunk/; revision=2934
2001-01-22 09:33:19 +00:00
Guy Harris 23e7ce209a Arrange that if the filter list is edited in one dialog box, the filter
lists in all filter dialog boxes are updated to reflect reality.  (The
poor man's model-view.)

svn path=/trunk/; revision=2924
2001-01-21 03:30:24 +00:00
Guy Harris 1ddbe05e58 Give various filter constructing/editing dialog boxes titles to reflect
what they were popped up for.

svn path=/trunk/; revision=2923
2001-01-21 02:27:24 +00:00
Guy Harris d6dd1fea0d In the process of destroying a filter editing dialog box, we get a
selection change event on the list of filters.  Unfortunately, this can
happen after some other widgets in that dialog box have already been
destroyed - including some of the widgets that such a selection change
event can change.

This sometimes happened when "filter_prefs_delete()" hadn't been called,
so the mechanism we had been using, with a Boolean datum attached to the
dialog box, set in "filter_prefs_delete()" before we actually destroy
the dialog box, wasn't sufficient to keep that from happening.

Attach to the top-level window data items containing pointers to the
widgets changed when a filter is selected from the list, give each of
those widgets their own destroy callbacks, clear the pointer attached to
the top-level widget when the widget is destroyed, and don't do anything
to the widget when a filter is selected from the list if the pointer for
that widget is null, as that means the widget's been destroyed and we
*can't* do anything to it.

Not all filter editing dialogs created on behalf of a "Filter:" button
next to a text entry box should, when you click "OK", activate the text
entry box; if the text entry box is part of a dialog box with multiple
widgets, the user might not have filled in all of the items in that
dialog box, so you shouldn't activate it for them.  Add a mechanism by
which, when creating a filter editing dialog box, you can specify
whether the "OK" button should just fill in the text entry box or should
fill it in and also activate it.

svn path=/trunk/; revision=2922
2001-01-21 01:45:07 +00:00
Gilbert Ramirez 8470a8e9a1 Get rid of the magic "+4" and properly calculate the lineheight so
that automatic scrolling of the hex pane continues to work, but without
any special magic constant. This works for any size font (as long
as the font isn't so big as to cause a line wrap), and has been
tested on Linux and NT4. The lineheight calculation was found in the
source code to the GtkText widget (gtk/gtktext.c in the GTK+ distribution).

svn path=/trunk/; revision=2871
2001-01-11 05:51:10 +00:00
Gilbert Ramirez 46d08f79f5 Show the menu_item widget during the creation of an option menu for
enumerated option lists. This to overcome a small bug in which the
menu item text doesn't have enough vertical padding.

svn path=/trunk/; revision=2868
2001-01-11 04:40:26 +00:00
Guy Harris 8df3d51db4 Include "snprintf.h", if necessary, to declare "snprintf()".
svn path=/trunk/; revision=2866
2001-01-10 23:36:35 +00:00
Guy Harris b5477dc71c Fix up Gerald's e-mail address to be his "ethereal.com" address.
svn path=/trunk/; revision=2859
2001-01-10 10:11:27 +00:00
Gilbert Ramirez fd7367e9b2 Doesn't need #include "dfilter.h"
svn path=/trunk/; revision=2824
2001-01-04 04:56:20 +00:00
Guy Harris 0e7c1de08a Have "proto_register_protocol()" build a list of data structures for
protocols, in addition to adding structures to the list of filterable
fields.  Give it an extra argument that specifies a "short name" for the
protocol, for use in such places as

	pinfo->current_proto;

	the dialog box for constructing filters;

	the preferences tab for the protocol;

and so on (although we're not yet using it in all those places).

Make the preference name that appears in the preferences file and the
command line for the DIAMETER protocol "diameter", not "Diameter"; the
convention is that the name in question be all-lower-case.

Make some routines and variables that aren't exported static.

Update a comment in the ICP dissector to make it clear that the
dissector won't see fragments other than the first fragment of a
fragmented datagram.

svn path=/trunk/; revision=2810
2001-01-03 06:56:03 +00:00
Guy Harris e87346151d Base the decision of whether selecting an entry in the value list sets
the value entry on the type of the field, not on whether the value entry
is visible; the value entry is hidden, in "field_select_row_cb()", after
"build_boolean_values()" is called, and building the list in
"build_boolean_values()" will cause an entry in that list to be
selected, and "value_list_sel_cb()" will be called as a result, so it
can't correctly base its decision on whether to set the value entry on
whether the entry is visible, as it's not yet been made invisible.

Fix a comment.

svn path=/trunk/; revision=2807
2001-01-02 19:54:50 +00:00
Guy Harris 51aceed165 Don't show "Text" as one of the available fields.
svn path=/trunk/; revision=2806
2001-01-02 19:38:20 +00:00
Guy Harris 88d157ef96 Add a dialog box for constructing expressions that test a field in the
display tree, based on Jeff Foster's dialog box for selecting fields.

Make the dialog box for browsing filters into a dialog box for
constructing filters; make the "Apply" button and the "OK" button apply
the filter in the text entry box in the dialog, not the currently
selected filter (selecting a filter puts it in that text entry box, but
the user may edit it afterwards, or may use the aforementioned dialog
box to construct a filter not in the list).

Get rid of extra declarations of "m_r_font" and "m_b_font" in
"proto_draw.c"; they're declared in "gtk/gtkglobals.h", which it includes.

svn path=/trunk/; revision=2805
2001-01-02 01:32:21 +00:00
Gilbert Ramirez fe8e42b58e Enable FT_BYTES dfiltering, from Ed Warnicke.
svn path=/trunk/; revision=2768
2000-12-22 12:05:38 +00:00
Gilbert Ramirez 297e84fc24 Match Selected works better with FT_STRING variables.
From Ed Warnicke <hagbard@physics.rutgers.edu>

svn path=/trunk/; revision=2763
2000-12-15 13:53:11 +00:00
Guy Harris 35b1907af8 Pull the code to set the fields in the "cfile.cinfo" structure into a
common routine to initialize a "column_info()" structure, shared by
Ethereal and Tethereal.

svn path=/trunk/; revision=2739
2000-12-03 22:12:21 +00:00
Gilbert Ramirez 90e0fb129d Change Ethereal homepage URL from etheral.zing.org to www.ethereal.com.
svn path=/trunk/; revision=2696
2000-11-22 04:07:04 +00:00
Guy Harris fcd119d834 Add a "color.h" file that declares a nominally-toolkit-independent
"color_t" structure to store color values (although currently it has all
the same fields that a GdkColor has; its currently advantage is that you
don't have to include any GTK/GDK stuff to declare it).

Add routines in the "gtk" directory to convert between "color_t" and
GdkColor values.

Define, in "prefs.h", all colors as "color_t" values rather than
GdkColor values.  "prefs.h" now no longer needs to include <gtk/gtk.h>,
so don't include it.

svn path=/trunk/; revision=2692
2000-11-21 23:54:10 +00:00
Guy Harris 252d55d80f For each column, have both a buffer into which strings for that column
can be put, and a pointer to the string for the column, which might or
might not point to that buffer.

Add a routine "col_set_str()", which sets the string for the column to
the string passed to it as an argument; it should only be handed a
static string (a string constant would be ideal).  It doesn't do any
copying, so it's faster than "col_add_str()".

Make the routines that append to columns check whether the pointer to
the string for the column points to the buffer for the column and, if
not, copy the string for the column to the buffer for the column so that
you can append to it (so you can use "col_set_str()" and then use
"col_append_str()" or "col_append_fstr()").

Convert a bunch of "col_add_str()" calls that take a string constant as
an argument to "col_set_str()" calls.

Convert some "col_add_fstr()" calls that take a string constant as the
only argument - i.e., the format string doesn't have any "%" slots into
which to put strings for subsequent arguments to "col_set_str()" calls
(those calls are just like "col_add_str()" calls).

Replace an END_OF_FRAME reference in a tvbuffified dissector with a
"tvb_length(tvb)" call.

svn path=/trunk/; revision=2670
2000-11-19 08:54:37 +00:00
Guy Harris 74777083d3 Fix a number of problems that caused compiles to fail if
PLUGINS_NEED_ADDRESS_TABLE was defined.

svn path=/trunk/; revision=2662
2000-11-18 21:41:40 +00:00
Graham Bloice 56a0c40c18 Corrected wrong function call in plugins_enable_cb
svn path=/trunk/; revision=2657
2000-11-18 09:59:04 +00:00
Gilbert Ramirez abb6702fc2 Add #include <string.h>, to get prototypes for mem* and str* functions.
svn path=/trunk/; revision=2654
2000-11-17 21:00:40 +00:00
Guy Harris 2fa39ce7d3 Move the table of bit-swapped byte values to "epan/bitswap.c", and
declare it, and define a "BIT_SWAP" macro that uses it, in
"epan/bitswap.h".

Use that macro to bit-swap bytes in the IEEE 802.11 dissector, rather
than the macro that was used (said macro used GCCisms and didn't compile
on Windows).

Make an "init_plugin()" routine to enable a plugin and call its init
routine, and call it from "check_plugin_status()" and
"plugins_enable_cb()", rather than having very similar code in two
places; "patable" is now part of libethereal, and, at least on Windows,
attempts to refer to it from "libui" failed.  Make "patable" static to
"epan/plugins.c".  (This may still not work, as now "libui" is calling a
routine in "libethereal"; if that fails, perhaps it's time to get rid of
the "enable/disable plugins" stuff completely, as new-style plugins, at
least, register themselves as protocols and should be controllable from
the "Edit->Protocols" window just as built-in dissectors are.)

svn path=/trunk/; revision=2649
2000-11-15 09:37:53 +00:00
Guy Harris 7d663fe7b0 Add a fourth choice of time format in the packet list display, which
shows the date (in YYYY-MM-DD format) as well as the time of day when
the packet arrived.

svn path=/trunk/; revision=2547
2000-11-01 08:31:36 +00:00
Gilbert Ramirez 73dde275c1 Move declaration of wsaData (for Win32) out of HAVE_LIBPCAP #ifdef block.
It's needed for both capture and non-capture variants of Win32 builds.

svn path=/trunk/; revision=2542
2000-10-27 17:19:23 +00:00
Gilbert Ramirez e4199779ca This patch adds two things:
- Pressing Esc key will cause the filter selection dialog to
          "Cancel"

        - Double-clicking on a list item in filter selection dialog is
          equivalent to single-click followed by "OK"

Santeri Paavolainen <santtu@ssh.com>

svn path=/trunk/; revision=2533
2000-10-25 16:06:50 +00:00
Gilbert Ramirez 3424ae654e Remove #include "gtk/colors.h" from file.h, which keep the GTK+ header
files from being #included in epan/packet.c.
Fix the other files that need either "gtk/colors.h" or <gtk/gtk.h> #included
as a result of not pulling in gtk/colors.h automatically because of file.h.

svn path=/trunk/; revision=2519
2000-10-20 04:26:40 +00:00
Guy Harris fb84384942 Move the declaration of "g_resolving_actif" from the top-level
"globals.h" file to "epan/resolv.h", as it's exported by
"epan/resolv.c", have files that use "g_resolving_actif" include
"resolv.h", and don't have "epan/resolv.c" include "globals.h" so that
it doesn't drag in, for example, headers that, in turn, drag in GTK+
headers.

svn path=/trunk/; revision=2517
2000-10-19 22:59:24 +00:00
Guy Harris cba377df3c Give libethereal its own configuration file, and have that configuration
file, rather than the top-level Ethereal configuration file, check for
"inet_aton()", "inet_pton()", and "inet_ntop()".  Then make its
Makefile.am include the appropriate object files if necessary.
Otherwise, they don't get built and put into libethereal, and therefore
attempts to link with anything in libethereal that uses them fail on
platforms that lack ethem, causing the build to fail.

That means a bunch of things need to be fixed to cope with libethereal
having its own "config.h" file; this means removing the include of
"config.h" from some libethereal header files.  Move the definitions of
the path names used only by "resolv.c" to "resolv.c" from "resolv.h" (so
"resolv.h" doesn't need "config.h", define HAVE_PLUGINS in the configure
script (so we don't have to include it in "plugins.h" to check whether
HAVE_DLFCN_H is defined).

Unfortunately, stuff outside libethereal needs to know PLUGIN_DIR; for
now, define that in the top-level configuration file, and have Ethereal
and Tethereal pass it as an argument to "epan_init()" - that should be
cleaned up at some point.

Remove from the top-level configure script checks for things used only
in libethereal.

svn path=/trunk/; revision=2498
2000-10-16 23:18:05 +00:00
Guy Harris faf70584f2 Fix it to build on Windows.
svn path=/trunk/; revision=2488
2000-10-11 07:35:02 +00:00
Guy Harris 54ecbe2d4e Santeri Paavolainen's patch to add a "Capture->Stop" menu item to let
you stop an "Update list of packets in real time" capture from the main
window as well as from the capture statistics dialog.

svn path=/trunk/; revision=2487
2000-10-11 06:01:16 +00:00
Guy Harris 677abe54e1 Add support for modal message boxes ("simple dialog").
Make the message boxes popped up for errors when selecting a font modal,
so that the user has to say "yes, I know, I'll do better next time"
before hitting "OK" again, so that you don't get a pile of message
boxes.

svn path=/trunk/; revision=2485
2000-10-09 06:38:36 +00:00
Guy Harris fedb22f414 It appears there's no guarantee that you'll actually get a font name
from a font selection dialog box; check for a null pointer and, if so,
let the user know and don't dismiss the font selection dialog.

svn path=/trunk/; revision=2484
2000-10-09 06:28:49 +00:00
Gilbert Ramirez e69b5278aa Implement epan_dissect_new() and epan_dissect_free(). These are the
"top-level" dissectors that libepan-users call, instead of dissect_packet().
The epan_dissect_t holds the tvbuff after dissection so that the tvbuff's
memory is not cleared until after the proto_tree is freed. (I might stuff
the proto_tree into the epan_dissect_t, too).

What remains of dissect_packet() in packet.c handles the tvbuff initialiation.
The real meat of dissect_packet() is now in dissect_frame(), in packet-frame.c
This means that "packet.c" is no longer a dissector, os it is no longer
passed to make-reg-dotc.

Once dissect_fddi() gets two wrapper functions (dissect_fddi_swapped()
and dissect_fddi_nonswapped()), the a dissector handoff routine could
be used instead of the switch statement in dissect_frame(). I'd register
a field like "wtap.encap"

svn path=/trunk/; revision=2478
2000-10-06 10:11:40 +00:00
Gilbert Ramirez 9d9850f209 More EPAN-related code movements. Get rid of usage of #include "globals.h"
and #include "util.h" from epan code. Move get_home_dir() into epan/filesystem.c
as it's used by plugins.c.

svn path=/trunk/; revision=2461
2000-09-28 03:16:29 +00:00
Gilbert Ramirez 83ec54675c First step in moving core Ethereal routines to libepan.
svn path=/trunk/; revision=2458
2000-09-27 04:55:05 +00:00
Guy Harris 00b4224ee0 Add a "-p" command-line option, and a checkbox in the "Capture
Preferences" dialog box, to control whether to put the interface in
promiscuous mode or not; Debian bug #34376 asked for this.

svn path=/trunk/; revision=2439
2000-09-15 05:32:49 +00:00
Graham Bloice f30b84ce23 Corrected startup // shutdown of windows sockets to allow name resolution to work
svn path=/trunk/; revision=2438
2000-09-14 22:59:08 +00:00
Graham Bloice 0ae9cce784 Updated to ignore Win32 detritus
svn path=/trunk/; revision=2430
2000-09-13 22:03:52 +00:00
Guy Harris 0640b5f2ed Include <unistd.h> to declare "close()" and "unlink()".
svn path=/trunk/; revision=2419
2000-09-12 06:28:02 +00:00
Laurent Deniel 6755d16641 Small changes in help windows:
- update overview.
- add a note if packet capture is not available.

svn path=/trunk/; revision=2406
2000-09-09 15:00:36 +00:00
Guy Harris c1b76aa400 In the callback for the "OK" button in the font selection dialog, check
to make sure we can load the font the user selected *and* the font that
would, in theory, be the boldface version of that font; if not, pop up
an error dialog, and don't nuke the font selection dialog (i.e., the
user either has to pick fonts that work, or give up in disgust and click
"Cancel").

Don't set "prefs.gui_font_name" until the "fetch" function is called -
stuff the name in a static variable when the user clicks "OK" in the
font selection dialog.

svn path=/trunk/; revision=2405
2000-09-09 10:35:53 +00:00
Guy Harris f0efbd1a02 "redraw_hex_dump()" can't use "cfile.pd" or "cfile.current_frame", as it
may be redrawing a packet window that displays a frame other than the
current frame; give it arguments to specify the raw frame data and
"frame_data" structure for the frame.

This requires that each packet window have, associated with it, a
pointer to the "frame_data" structure; that replaces the "cap_len" and
"encoding" fields in a "PacketWinData" structure, as those are just
copies of fields from the frame's "frame_data" structure.

"packet_hex_print()" needn't be passed both the start and length values
from a "field_info" structure - just pass it a pointer to that
structure, or NULL for "no field is selected in the packet".  It also
needn't, any longer, be passed the "cap_len" and "flags.encoding" fields
of a "frame_data" structure - just pass it a pointer to that structure.

In "redraw_hex_dump_all()", don't redraw the hex dump pane of the main
window if there is no current frame.

svn path=/trunk/; revision=2404
2000-09-09 10:26:58 +00:00
Guy Harris 6e04ac48f9 Explain why "stream_prefs_apply()" doesn't do anything.
svn path=/trunk/; revision=2403
2000-09-09 10:04:53 +00:00
Guy Harris a11b619f2a "#if 0" out the code that puts "Cut", "Copy", and "Paste" items into the
"Edit" menu, pending the implementation of cut/copy/paste, so that users
don't think that there's something they can do (other than implementing
cut/copy/paste :-)) to be able to use those functions.

svn path=/trunk/; revision=2402
2000-09-09 08:17:51 +00:00
Guy Harris e91341e3c3 Redraw:
the text in all "Follow TCP Stream" windows;

	the text in the help window if we have one up;

	all hex dump windows;

when GUI preference changes are to be applied, so that font changes and
"Follow TCP Stream" color changes show up.

Update both the Roman and bold font when the font is changed.

Don't decrement the reference counts on the old Roman and bold fonts
until that's all done.

svn path=/trunk/; revision=2401
2000-09-08 10:59:21 +00:00
Guy Harris b85ddbe885 Graham Bloice's patch to support inverse video rather than boldface
highlighting of the bytes, in the hex dump window, corresponding to a
selected field.

Also, make "remember_ptree_widget()" static, as it's not used outside
"gtk/proto_draw.c".

svn path=/trunk/; revision=2399
2000-09-08 09:50:08 +00:00
Gilbert Ramirez e1f3604b37 Change variable from 'char*' to 'const char*' to avoid compiler warning.
svn path=/trunk/; revision=2391
2000-09-07 05:08:19 +00:00
Laurent Deniel 7acf24b370 Fix help display (random character displayed in tab).
svn path=/trunk/; revision=2388
2000-09-05 19:07:06 +00:00
Gilbert Ramirez 0e3cb70212 Add FT_STRINGZ type. NCP dissector is only one that uses it right now.
Remove tvb_get_stringz from quake dissector and add tvb_get_nstringz,
tvb_get_nstringz0, and tvb_strnlen to tvbuff.c.

Remove multiple definitions of pntohl and friends from various places
(except for wiretap) and put into pint.h

Consolidate duplicate code for turning FT_* enums into strings (ala the
glossary).

svn path=/trunk/; revision=2382
2000-08-30 02:50:18 +00:00
Laurent Deniel c691739727 Add some dlg_set_cancel().
Reduce a bit the button sizes for homogeneousness.

(still need some work on filter color selection, in progress ...)

svn path=/trunk/; revision=2363
2000-08-24 13:21:29 +00:00
Gilbert Ramirez 8e2feab49a Fix the appearance of the option menus in the GUI preference box.
It appears to be a buglet in GTK+; by explicitly calling gtk_widget_show()
on the menu item, it comes out with proper spacing. Previously I simply
used gtk_widget_show_all() on the topmost vbox, and while the option menu
menu-items showed, they came out with incorrect vertical spacing.

svn path=/trunk/; revision=2356
2000-08-24 03:16:47 +00:00
Laurent Deniel a33d2bfcd5 If the default build-in fonts are not found, use the "6x13" fonts
but change also the prefs.gui_font_name so that an unexisting font
will not be saved with the preferences.

svn path=/trunk/; revision=2354
2000-08-23 21:05:11 +00:00
Laurent Deniel a77af93938 Cosmetic changes.
Add a table so that the first 4 rows of the capture dialog
are correctly aligned.

Remove the unneeded hboxes.

svn path=/trunk/; revision=2353
2000-08-23 20:55:44 +00:00
Laurent Deniel 30c432f734 If you "save" your preferences without opening the color
selection dialog, the colors are saved with null values.
So do not call fetch_colors if the colors_changed boolean
is FALSE ...

svn path=/trunk/; revision=2350
2000-08-23 18:52:38 +00:00
Laurent Deniel fb3643b8d5 Remove the -D option.
svn path=/trunk/; revision=2349
2000-08-23 18:22:12 +00:00
Laurent Deniel 0c73ead218 Do the same as with colors for the font selection dialog.
Add a boolean that will be set to TRUE if the user hit OK
in the font selection dialog. And do nothing about fonts
in the apply routine if the font dialog has not been used
by the user. This gets rid of a warning which was displayed
each time the preferences are "OK, Saved or cancelled"
and that whether the user has used the font selection
dialog or not (which was very annoying) ...

svn path=/trunk/; revision=2348
2000-08-23 16:15:13 +00:00
Laurent Deniel fe01ebe5d2 Fix a comment.
svn path=/trunk/; revision=2347
2000-08-23 10:38:43 +00:00
Guy Harris 53252372a6 Don't set the marked-packet foreground and background colors in "prefs"
until the GUI-preferences fetch routine is called, and don't re-colorize
marked packets until the GUI-preferences apply routine is called;
those preferences shouldn't take effect until the user clicks "OK" or
"Apply", as that's the way other preferences work.

Treat a request to close the color selection dialog the same as a click
on the "Cancel" button.

svn path=/trunk/; revision=2346
2000-08-23 07:38:56 +00:00
Guy Harris 56697db466 Bleah. What was I thinking? "dlg_window_new()" should take the title
for the dialog window as an argument (as various dialog creators in GTK+
do), not oblige every caller of it to cut-and-paste a
"gtk_window_set_title()" call after it.

svn path=/trunk/; revision=2345
2000-08-23 06:56:31 +00:00
Laurent Deniel 2f1bab3f96 Do not display "Text (text)" (i.e. FT_TEXT_ONLY) for unfilterable
fields in status bar.

svn path=/trunk/; revision=2344
2000-08-22 20:17:27 +00:00
Laurent Deniel 609806cbd3 Add a help context identifier for the status bar.
This allows the display of a short field description (and
field abbreviation) in the status bar when a field is selected
in the protocol tree window.

The description is the blurb field when available (i.e. not empty),
the name otherwise.

When the item is unselected, the file context (e.g. the file name)
is restored.

Now it is much easier to build a display filter without the manual ;-)

svn path=/trunk/; revision=2343
2000-08-22 19:40:09 +00:00
Laurent Deniel 7c48f6c0d4 Remove the "Decode IPv4 TOS field as DiffServ field" option from the
display options since it is available from the preferences.

svn path=/trunk/; revision=2341
2000-08-22 14:39:41 +00:00
Laurent Deniel 85a4718c6b Small update (add accelerator).
svn path=/trunk/; revision=2340
2000-08-22 14:21:27 +00:00