Commit Graph

2083 Commits

Author SHA1 Message Date
Guy Harris b1f950b377 Add support for a global "ethereal.conf" preferences file, stored in the
same directory as the "manuf" file ("/etc" or "/usr/local/etc", most
likely).

Add a mechanism to allow modules (e.g., dissectors) to register
preference values, which:

	can be put into the global or the user's preference file;

	can be set from the command line, with arguments to the "-o"
	flag;

	can be set from tabs in the "Preferences" dialog box.

Use that mechanism to register the "Decode IPv4 TOS field as DiffServ
field" variable for IP as a preference.

Stuff that still needs to be done:

	documenting the API for registering preferences;

	documenting the "-o" values in the man page (probably needs a
	flag similar to "-G", and a Perl script to turn the output into
	documentation as is done with the list of field);

	handling error checking for numeric values (range checking,
	making sure that if the user changes the variable from the GUI
	they change it to a valid numeric value);

	using the callbacks to, for example, update the display when
	preferences are changed (could be expensive);

	panic if the user specifies a numeric value with a base other
	than 10, 8, or 16.

We may also want to clean up the existing wired-in preferences not to
take effect the instant you tweak the widget, and to add an "Apply"
button to the "Preferences" dialog.

svn path=/trunk/; revision=2117
2000-07-05 09:41:07 +00:00
Guy Harris ed5651a909 Get rid of the stuff to let the callback that pops up the Preferences
dialog select a particular page - I think that was used only by the
filter code back when "Filter:" buttons popped up a Preferences dialog
with the Filter page (which is no longer a Preferences dialog page)
selected, but now there's a separate Filter dialog box.

svn path=/trunk/; revision=2116
2000-07-05 06:33:02 +00:00
Guy Harris 4522bab239 Put the close button in an HButtonBox, so that it doesn't expand to the
width of the window.

svn path=/trunk/; revision=2115
2000-07-05 06:19:27 +00:00
Guy Harris 83fe7fc195 Put the "Cancel" button in a progress dialog box in an HButtonBox,
rather than an Alignment; that appears to be the correct way to keep
buttons from expanding to the full width of the window.

Don't use "gtk_widget_show()" on every single widget in the progress
dialog box, use "gtk_widget_show_all()" on the top-level widget.

svn path=/trunk/; revision=2114
2000-07-05 05:50:00 +00:00
Guy Harris 36d85ce33c To make windows modal, use "gtk_window_set_modal()" rather than
"gtk_grab_add()"; the former makes it a bit clearer what's being done,
and I think it may be considered the right way to do it (GTK+ remembers
the state of the window and appears to add and remove the grab as
appropriate).

svn path=/trunk/; revision=2113
2000-07-05 02:52:39 +00:00
Guy Harris 105d0f4f70 Add a "dlg_window_new()" routine, which creates a GTK_WINDOW_DIALOG
window and makes it transient for the top-level window; the
transient-for at least provides a hint to X window managers to

	minimize the dialog if the main window is minimized;

	keep the dialog on top of the main window in the Z order for
	windows;

	perhaps (if there are any window managers that actually *do*
	this) even put it atop the main window in the X-Y plane (KWM
	doesn't and I seem to remember that the Exceed X server for
	Windows doesn't).

It's generally considered the Right Thing To Do for dialog boxes.

Use that routine to create dialog boxes, rather than doing it directly
in the code for that dialog box.

svn path=/trunk/; revision=2112
2000-07-05 02:45:42 +00:00
Guy Harris 1e59b9dc86 Set the locale for Tethereal to the native environment; Ethereal already
does so, as a side-effect of calling "gtk_set_locale()".

svn path=/trunk/; revision=2111
2000-07-05 02:06:58 +00:00
Guy Harris 0c94e5bd81 Note, in a comment, that "gtk_set_locale()" sets the C-language locale.
svn path=/trunk/; revision=2110
2000-07-05 02:04:16 +00:00
Gilbert Ramirez 32fe73b2de Change version to 0.8.10
In gtk/Makefile.nmake, add progress_dlg.obj

svn path=/trunk/; revision=2108
2000-07-04 12:10:06 +00:00
Gilbert Ramirez 5e56c77cfc More news for 0.8.10
svn path=/trunk/; revision=2107
2000-07-04 12:04:45 +00:00
Olivier Abad 7fd7ebe2d8 Add a missing build dependency (debhelper) and change build dependency on
libsnmp4.0-dev to libsnmp4.1-dev (this should close bugs #66391 and #66018
from the Debian bug tracking system).

svn path=/trunk/; revision=2106
2000-07-03 22:40:13 +00:00
Guy Harris 864c5eabe1 GtkLabel is a subclass of GtkMisc, so it has alignment and padding
parameters and doesn't have to be stuffed into a GtkAlignment to align
it on the left.  (Alas, GtkButton *isn't* a subclass of GtkMisc, so we
have to stuff the Cancel button into an alignment to keep it from
growing to the width of the window.)

svn path=/trunk/; revision=2105
2000-07-03 19:42:36 +00:00
Guy Harris e4a9d0f426 If the user clicks the "Cancel" button in a progress-bar dialog box for
reading a capture file, we should just clean up and return so that
Ethereal continues running with no capture file loaded, unless the read
is being done as a result of Ethereal being run with the "-r" flag, in
which case we still exit (although we may eventually choose to continue
running with no capture file loaded even in that case).

svn path=/trunk/; revision=2104
2000-07-03 09:34:27 +00:00
Guy Harris 9e42b3a4ed Remove the progress bar from the status line, and, instead, for any
potentially long-running operation that has a progress indicator, pop up
a modal dialog box with

	an indication of what is being done;

	a progress bar;

	a "Cancel" button to stop the operation.

This:

	leaves more room on the status line for a filter expression;

	provides a mechanism to allow the user to cancel long-running
	operations (although the way we do so may not back out of them
	as nicely as the user might like, if it's not obvious what the
	"right" way is or if the "right" way is difficult to implement
	or involves doing as much work as letting the operation
	continue);

	means that, because the dialog box is modal, we don't have to
	worry about the user performing arbitrary UI operations out from
	under the operation and changing arbitrary bits of state being
	used by that operation.

svn path=/trunk/; revision=2103
2000-07-03 08:36:52 +00:00
Guy Harris 6f4d2c0cb8 "asn1_octet_string_decode()" sets the pointer to the raw octets to NULL
if the octet string is zero-length; if the octets are to be interpreted
as a character string, we have to check for a null pointer and replace
it with a pointer to a null string.

svn path=/trunk/; revision=2102
2000-07-02 07:10:16 +00:00
Guy Harris 3cc5187b0c Fix the comment at the beginning of the routine to give the right file
name, and add the RFC number for ISAKMP to it.

Fix the structures for headers to treat all multi-byte quantities as
arrays of bytes; the certificate request header needs to be done that
way, so that it's *not* padded to a multiple of the size of the longest
integral element (the longest integral element is 2 bytes, but the size
of the header is 5 bytes, so certificate requests were being
misdissected), and other structures might require this as well - it also
catches code that doesn't use "pntohl()" or "pntohs()" to get the values
of integral fields bigger than 1 byte.

In fact, it *did* catch some; the configuration attribute header's
"identifier" field was being used without being put in host byte order.
In addition, that field required padding to be aligned on its natural
boundary, but the padding wasn't given as a structure member; given that
the length field was specified as one byte but extracted with
"pntohs()", and that the length field is 2 bytes in the other headers,
it probably should be 2 bytes in this header as well - make it so.

svn path=/trunk/; revision=2101
2000-07-02 03:25:48 +00:00
Guy Harris c3587ce540 Add support for OSI CLTP.
Redo the way the variable part of COTP and CLTP packets are handled, by
having a single routine to handle it for all packets, rather than having
the dissector for each type of packet handle the parameters those
packets are supposed to have.

Fix "is_LI_NORMAL_AK()" to test (heuristically) whether an AK COTP
packet is normal rather than extended, rather than testing whether it's
normal, and invert the test where it's used (i.e. make what it does
correspond to what its name says, which means we invert the test it
does, and then change the code that uses it appropriately).

Add support for the "preferred maximum TPDU size" and "inactivity timer"
parameters, and fix various problems in the dissection of particular
parameters.

svn path=/trunk/; revision=2100
2000-07-01 08:55:28 +00:00
Guy Harris 2f5825776b Make "format_oid()" allocate a buffer that's big enough, format the OID
string into it, and return a pointer to that buffer, rather than being
passed a buffer.  This gets rid of some additional fixed-length string
buffers (and makes it more closely resemble the "format_oid()" in the
libsmi-based "packet-snmp.c" under development).

svn path=/trunk/; revision=2099
2000-06-29 09:37:02 +00:00
Guy Harris c53979e981 Make "format_oid()" allocate a buffer that's big enough, format the OID
string into it, and return a pointer to that buffer, rather than being
passed a buffer.  This gets rid of some additional fixed-length string
buffers (and makes it more closely resemble the "format_oid()" in the
libsmi-based "packet-snmp.c" under development).

svn path=/trunk/; revision=2098
2000-06-28 05:15:13 +00:00
Guy Harris 352246de2f Don't reposition the random stream in "ngsniffer_open()" if there isn't
a random stream open.

svn path=/trunk/; revision=2097
2000-06-28 03:58:52 +00:00
Guy Harris 6ea9c6aa9b Don't pass a pointer to the packet data buffer to "read_packet()"; let
it, rather than its callers, get that pointer from "cf->wth".

svn path=/trunk/; revision=2096
2000-06-27 09:26:10 +00:00
Guy Harris 7843ac6d0e Add routines to Wiretap to allow a client of Wiretap to get:
a pointer to the "wtap_pkthdr" structure for an open capture
	file;

	a pointer to the "wtap_pseudo_header" union for an open capture
	file;

	a pointer to the packet buffer for an open capture file;

so that a program using "wtap_read()" in a loop can get at those items.

Keep, in a "capture_file" structure, an indicator of whether:

	no file is open;

	a file is open, and being read;

	a file is open, and is being read, but the user tried to quit
	out of reading the file (e.g., by doing "File/Quit");

	a file is open, and has been completely read.

Abort if we try to close a capture that's being read if the user hasn't
tried to quit out of the read.

Have "File/Quit" check if a file is being read; if so, just set the
state indicator to "user tried to quit out of it", so that the code
reading the file can do what's appropriate to clean up, rather than
closing the file out from under that code and causing crashes.

Have "read_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
close the capture and return an indication that the read was aborted by
the user.  Otherwise, return an indication of whether the read
completely succeeded or failed in the middle (and, if it failed, return
the error code through a pointer).

Have "continue_tail_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
quit the loop, and after the loop finishes (even if it read no packets),
return an indication that the read was aborted by the user if that
happened.  Otherwise, return an indication of whether the read
completely succeeded or failed in the middle (and, if it failed, return
the error code through a pointer).

Have "finish_tail_cap_file()" read the capture file with a loop using
"wtap_read()", rather than by using "wtap_loop()"; have it check after
reading each packet whether the user tried to abort the read and, if so,
quit the loop, and after the loop finishes (even if it read no packets),
close the capture and return an indication that the read was aborted by
the user if that happened.  Otherwise, return an indication of whether
the read completely succeeded or failed in the middle (and, if it
failed, return the error code through a pointer).

Have their callers check whether the read was aborted or not and, if it
was, bail out in the appropriate fashion (exit if it's reading a file
specified by "-r" on the command line; exit the main loop if it's
reading a file specified with File->Open; kill the capture child if it's
"continue_tail_cap_file()"; exit the main loop if it's
"finish_tail_cap_file()".

svn path=/trunk/; revision=2095
2000-06-27 07:13:42 +00:00
Guy Harris 5af6a8d416 Pull the code to fetch display options from the display options dialog
box into a common subroutine.

Don't call "change_time_formats()" to update the display unless the time
format actually changed.

svn path=/trunk/; revision=2094
2000-06-27 05:18:44 +00:00
Guy Harris 252385f3fa Get rid of a debugging fprintf.
svn path=/trunk/; revision=2093
2000-06-27 04:40:15 +00:00
Guy Harris 7fbf320b8a Patch from Ben Fowler to rename the global variable "cf" to "cfile", to
make it easier to use grep to find all references to it without getting
a lot of false hits and to check, after allocating the memory chunk for
"frame_data" structures, that the allocation succeeded.

svn path=/trunk/; revision=2092
2000-06-27 04:36:03 +00:00
Guy Harris 85a7f56ac0 Rename "format_value()" to "format_var()", and have it dynamically
allocate the buffer into which it formats the variable value, and return
that value.  This

	1) makes it more closely resemble the formatting routine in the
	   libsmi-based "packet-snmp.c" under development;

	2) makes it less likely to overrun the buffer (we can't be
	   certain how long the string "sprint_value()" generates will
	   be, but we can make a reasonable guess as to the maximum size
	   based on the type and size of the object we're formatting).

When *not* using "-lsnmp", dynamically allocate the buffers into which
we format octet strings and OID values, based on the size of the object
we're formatting, so that we don't overrun the buffer.

svn path=/trunk/; revision=2091
2000-06-26 00:13:21 +00:00
Guy Harris 5a8b587fc6 In "asn1_oid_value_decode()", set "size" directly from "enc_len", rather
than setting "eoc" from "asn1->pointer" and "enc_len" and then setting
"size" from "eoc" and "asn1->pointer", to make it clearer how it's being
set.

svn path=/trunk/; revision=2090
2000-06-26 00:08:48 +00:00
Guy Harris 33fccd5fa2 Make the string buffers into which stuff is formatted larger, to handle,
for example, larger octet string values.

svn path=/trunk/; revision=2089
2000-06-25 20:55:09 +00:00
Gilbert Ramirez 254c803dca Report changes for 0.8.10
svn path=/trunk/; revision=2088
2000-06-24 16:30:44 +00:00
Guy Harris ae1f565029 Joerg Mayer's changes to add support for NetXRay file format version
2.002, as used by release 3.50 of the Network Associates Sniffer for
Windows; currently, we treat it just like the 2.001 version, so we
rename the version #define WTAP_FILE_NETXRAY_2_001 to
WTAP_FILE_NETXRAY_2_00x and use that for both 2.001 and 2.002.

svn path=/trunk/; revision=2087
2000-06-24 05:32:48 +00:00
Guy Harris 068f36c4fe Write and read the temporary file for "Follow TCP Stream" as a binary
file, not as a text file; that makes no difference on UNIX, but, as the
file *is* binary, it makes a difference on Win32 systems.

svn path=/trunk/; revision=2086
2000-06-24 05:06:29 +00:00
Guy Harris 0c19288eb3 Add link instructions for "tvbtest", so that we link with GLib.
svn path=/trunk/; revision=2085
2000-06-22 06:37:59 +00:00
Guy Harris b5c534ddbf Add support for the reported length of tvbuffs and for the
ReportedBoundsError exception.

svn path=/trunk/; revision=2084
2000-06-22 06:36:45 +00:00
Guy Harris 480eaea7d4 Fix the display of volume names.
svn path=/trunk/; revision=2083
2000-06-21 04:41:30 +00:00
Gilbert Ramirez 942a561059 tvbuffify the IGMP dissector. There's still plenty more to do inside
packet-ip.c.

svn path=/trunk/; revision=2082
2000-06-20 13:21:55 +00:00
Gilbert Ramirez 4006708385 tvbuff-ify the TR MAC dissector.
svn path=/trunk/; revision=2081
2000-06-20 03:05:37 +00:00
Guy Harris 1cca166630 Make the "isis_hello.source_id" an FT_BYTES field rather than an
FT_ETHER field; the ISIS spec doesn't say it's necessarily a 6-byte
Ethernet address (and, if it's FT_BYTES, you can test it in a filter
much the same way you test an Ethernet address).

Make "isis_hello.lan_id" an FT_BYTES field rather than an FT_STRING
field - it's an array of bytes, not a character string.

Don't require that "system ID" fields be 6 octets; use the size value
from the ISIS PDU header.  (This means that PDUs containing "system ID"
fields can't be described as C structures; dissect them by stepping the
offset instead.)

svn path=/trunk/; revision=2080
2000-06-19 08:33:50 +00:00
Guy Harris 02fd86777e ISIS is ISO standard 10589, not 10598.
svn path=/trunk/; revision=2079
2000-06-19 04:49:36 +00:00
Gerald Combs 1513e26b0b Get rid of string overrun.
svn path=/trunk/; revision=2078
2000-06-18 22:12:14 +00:00
Guy Harris 7d67328a2a Instead of calling "snmp_set_full_objid()" to cause OIDs to be displayed
symbolically as full sequences, call "snmp_set_suffix_only(2)" to cause
them to be displayed symbolically as a module name and a name within
that module, as that might make it easier to find the RFC or whatever
that describes the object in question.

Don't just statically call it, though, on Linux, as that causes binaries
built on Red Hat releases prior to 6.2 to fail to run on 6.2, due to the
UCD SNMP 4.1.1 library used in RH 6.2 not being 100% binary-compatible
with the UCD SNMP libraries used in those prior releases.  Instead, on
Linux, try to "dlopen()" the "libsnmp.so" library and, if that succeeds,
try to find "snmp_set_suffix_only()" in that library - if that succeeds,
call it, otherwise try to find "ds_set_int()" in that library and, if
*that* succeeds, call it with the arguments that, in UCD SNMP 4.1.1, the
"snmp_set_suffix_only()" macro passes to it.

svn path=/trunk/; revision=2077
2000-06-17 05:56:22 +00:00
Guy Harris 6bf61848b7 Add braces to squelch a warning from GCC 2.8.1 on Solaris 7/x86.
svn path=/trunk/; revision=2076
2000-06-17 03:05:02 +00:00
Gilbert Ramirez 5afb4f7225 Small patch for the win32 makefile that improves the dependencies and
prints out exactly which executable is being linked.
From Graham Bloice <graham.bloice@trihedral.com>

svn path=/trunk/; revision=2075
2000-06-16 15:05:26 +00:00
Guy Harris f3eddb46cc Changes from Graham Bloice to support "Update list of packets in real
time" during captures on Win32.

svn path=/trunk/; revision=2074
2000-06-15 08:02:43 +00:00
Guy Harris 65b907e98d Patch from Joerg Mayer:
Make "tethereal -h" look as similar to "ethereal -h" as
	possible.  The ethereal help was the "better" of the two.

svn path=/trunk/; revision=2073
2000-06-15 07:49:25 +00:00
Guy Harris 7ec88ecbb4 Patch from Joerg Mayer to fix a problem reading Sniffer files:
Differentiate between LAPB and LAPD sync sniffer traces.
	Personally I think there must be a better way to find out which
	protocol is in the trace but I currently lack the time to look
	at the remaining frame info.

svn path=/trunk/; revision=2072
2000-06-15 06:18:32 +00:00
Guy Harris b27100abcb Patch from Joerg Mayer to fix a problem reading Sniffer files:
When trying to decode a sample trace from the NG offline sniffer
	installation, one trace resulted in a "corrupted" error.  The
	reason was, that the file was a version 2 file format.  That
	format used type 8 for header purposes while version 4 uses it
	for FRAME4.

svn path=/trunk/; revision=2071
2000-06-15 06:13:08 +00:00
Guy Harris 7250d49c49 Mark Clayton's patch to add support for capturing on ATM interfaces on
Linux (call the until-now-unused "capture_clip()" routine for each
packet).

svn path=/trunk/; revision=2070
2000-06-15 04:23:06 +00:00
Guy Harris 72ad5b91d6 Fix typos in some printf formats - "+%d", not "%+d"
svn path=/trunk/; revision=2069
2000-06-15 04:09:22 +00:00
Gilbert Ramirez 0ab8dd8cbd Convert IPX-and-friend dissectors in packet-ipx.c to use
tvbuffs.

In doing so, I realied that my recommendation for using
tvb_new_subset(pi.compat_top_tvb, -1, -1) was incorrect, because
some dissectors (ethernet!) change pi.len and pi.cap_len. So, I have
to take those two variables into account instead of using -1 and -1.

So, I provide a macro called tvb_create_from_top(offset), where
offset is the name of your offset variable. It is a wrapper around
tvb_new_subset().

I converted the lines that followed my suggestion to use
tvb_create_from_top().

In proto.c I added
proto_tree_add_debug_text(proto_tree*, const char*, ...)
It's much like proto_tree_add_text(), except that it takes no offset
or length; it's soley for temporarily putting debug text into the
proto_tree while debugging a dissector. In making sure that its
use is temporary, the funciton also prints the debug string to stdout
to remind the programmer that the debug code needs to be removed
before shipping the code.

svn path=/trunk/; revision=2068
2000-06-15 03:49:00 +00:00
Gerald Combs adaefea44d Added a passel-o-codes from Gaetan Soltesz <gaetan@cisco.com>
svn path=/trunk/; revision=2067
2000-06-14 19:53:37 +00:00