Commit Graph

717 Commits

Author SHA1 Message Date
Gilbert Ramirez 7b732a9f80 Fixed assert error reported by Dewi Morgan <dewim@sco.com>.
After some bad dfilter parses, the top-level dfilter tree (global_df->dftree)
would erroneously be set to the last good dfilter_node that was parsed.
Later, the non-NULLness of the dftree made us clear it.. really confusing
GTK internals. After _that_, new GNodes created via g_node_new() would
all have the same address!

svn path=/trunk/; revision=735
1999-09-29 22:11:51 +00:00
Gilbert Ramirez 901754eb9b Added and extended Santeri Paavolainen's <santtu@ssh.fi> patch
to avoid applying NULL dfilters while setting colorization dfilters
during an ongoing, screen-updating, capture.

svn path=/trunk/; revision=734
1999-09-29 14:41:34 +00:00
Guy Harris 2ba5608a0b "snoop" seems to treat "IEEE 802.3" and "Ethernet" datalink types the
same (which raises the question "so why the heck are there two types?" -
note that the way you're supposed to tell Ethernet from 802.3 packets is
by looking at the value of the type/length field; both of them can be
transmitted on the same wire), so we'll treat them the same.

svn path=/trunk/; revision=733
1999-09-28 01:19:01 +00:00
Gilbert Ramirez a1f28feb1b Replace the parens around 'control' in the two macros that I modified. I
accidentally removed them.

svn path=/trunk/; revision=732
1999-09-27 13:51:54 +00:00
Guy Harris 073aced0b8 Don't bother setting the length of the LLC header when we create the LLC
tree to anything other than 0, as we're going to change it to the right
value once the control field has been parsed and we know the right value.

svn path=/trunk/; revision=731
1999-09-27 08:39:10 +00:00
Guy Harris 0247d914ef When checking whether a control field is for a UI frame, you have to
check all the bits of the control field (otherwise, you're just checking
whether it's a U frame).

svn path=/trunk/; revision=730
1999-09-27 08:33:26 +00:00
Gilbert Ramirez a5558d09fe Mask out unnecessary bits in control guint16 in order to properly
compare against XDLC_I, XDLC_UI, and XDLC_U in XDLC_HAS_PAYLOAD() and
XDLC_CONTROL_LEN() macros.

svn path=/trunk/; revision=729
1999-09-27 03:12:55 +00:00
Guy Harris f76a67e084 Handle the length of the LLC(+SNAP) header correctly for SNAP frames.
svn path=/trunk/; revision=728
1999-09-26 20:40:00 +00:00
Guy Harris 63edea877f Have "get_xdlc_control()" and "dissect_xdlc_control()" return the
xDLC control field, so that its caller can not only determine from it
whether the frame has a payload, but can also determine how long the
control field is.  Put macros in "xdlc.h" to determine both of those.

Have "capture_llc()" and "dissect_llc()" use that information
appropriately.

svn path=/trunk/; revision=727
1999-09-26 20:31:51 +00:00
Laurent Deniel a673e8bb2c Added name resolution in GUI part:
- Capture->Start->"Active name resolution"

Allows the user to turn on/off name resolution
during a live capture.

- Display->Options->"Name resolution"

Turn on/off name resolution for the displayed
data (or during the -S mode).
E.g. clicking on a packet captured with
resolution disabled will resolve names in
the detailed list if this option is set.
And applying or resetting a display filter
allows the update of the packet list as well.

svn path=/trunk/; revision=726
1999-09-26 14:40:01 +00:00
Gilbert Ramirez 4536f01901 Make Information Frame honor is_extended variable when reading Control.
svn path=/trunk/; revision=725
1999-09-26 13:34:10 +00:00
Guy Harris a4ff298308 Squelch a (justified, although the child process *shouldn't* ever send
us, at that point, a character with the 8th bit set) complaint about a
"char" array subscript in an "isdigit()" call by making the character
unsigned.

svn path=/trunk/; revision=724
1999-09-25 02:02:11 +00:00
Gilbert Ramirez 096d72a6f5 Changed version to 0.7.5
svn path=/trunk/; revision=722
1999-09-24 14:59:32 +00:00
Guy Harris b34c49fa86 DO NOT check for "unistd.h"; due to an unfortunate botch in the way
"zlib" was built in FreeBSD 3.2 (and possibly other 4.4-Lite-derived
BSDs), if HAVE_UNISTD_H is defined before "zlib.h" is included, the
declaration of "gzseek()" in "zlib.h" expands to something that doesn't
match what's in the OS's "zlib".

svn path=/trunk/; revision=721
1999-09-24 06:38:22 +00:00
Guy Harris a9c36a4b69 Fix it so that it builds with "--disable-zlib".
The "fh" member of a "wtap" structure points to something constructed
from the "fd" member of that structure, so that closing the stream
referred to by "fh" also closes the underlying file descriptor; get rid
of an unnecessary close of "wth->fd".

svn path=/trunk/; revision=720
1999-09-24 05:49:53 +00:00
Gilbert Ramirez 702b8f7aed Re-enable progress bar movement during display filter processing.
svn path=/trunk/; revision=718
1999-09-24 05:22:28 +00:00
Gilbert Ramirez c2e3c9efb4 Many more packaging changes. Lets compilation with new gtk subdirectory
work if build tree is different than source tree. Some wiretap files
had to be added to the list of deliverables.

svn path=/trunk/; revision=717
1999-09-24 04:59:52 +00:00
Guy Harris 70cd911f61 In "try_tempfile()", if the buffer is too short for the temporary file
name, stuff as much of the name as will fit into the buffer before
returning an error, so the error message that gets displayed isn't
completely mangled.

svn path=/trunk/; revision=716
1999-09-24 04:14:43 +00:00
Gilbert Ramirez 4740872e1f Packaging changes
svn path=/trunk/; revision=715
1999-09-24 03:43:09 +00:00
Gilbert Ramirez e6015fbeb8 Moved version to 0.7.4; updated documentation.
svn path=/trunk/; revision=714
1999-09-24 03:28:59 +00:00
Guy Harris e22e07c397 Dirk Bonne's fix to ICMP timestamp dissection.
svn path=/trunk/; revision=713
1999-09-23 19:05:28 +00:00
Guy Harris f0e861465c Close the capture file in "do_capture()", right before unlinking the
current capture file if it's a temporary file, out of paranoia (so that
we don't get into a state where we have a capture file open but unlinked
- it's probably harmless to be in that state, as the file will remain
around until close, modulo NFS fun, and we may never be in that state
for very long, but I'd rather have it obviously stated in the code).

Remove the close in "capture()", and put one before the other call to
"capture()", in "main_realize_cb()" (is that call necessary, e.g. if you
pass "-r <filename>" *and* "-k", for some perverse reason, as
command-line arguments?).

If "cf.save_file" is non-null, free it before setting it, regardless of
whether it refers to a temporary file name or not.

svn path=/trunk/; revision=712
1999-09-23 07:57:23 +00:00
Guy Harris b2b8994f15 If we forcibly turn off "fork_mode" if the user doesn't enable "Update
list of packets in real time" in the "Capture/Start" dialog box,
"ethereal -F" won't work - you get your choice of non-forked capture or
"-S".

Don't have "fork_mode" track "sync_mode"; instead, in those places where
we check for "fork_mode", check for "sync_mode" as well.

svn path=/trunk/; revision=711
1999-09-23 07:20:20 +00:00
Guy Harris 3aa6164cba In fork mode, close the capture file in "do_capture()", because the
child will nuke that file before we get to open the capture in
"tail_cap_file()" - assuming we do, because the capture may not start.

If we fail while writing to, or closing, a capture file we've opened for
writing, don't treat that as a capture error, as we may have saved at
least some packets to the capture file (that's the way it worked before
my recent checkins).

svn path=/trunk/; revision=710
1999-09-23 07:04:23 +00:00
Guy Harris 5b83e8d86c Update to reflect changes to the "Capture/Start" and "Display/Options"
dialog boxes.

svn path=/trunk/; revision=709
1999-09-23 06:34:18 +00:00
Guy Harris 12d3278d0b Move the toolkit-independent code to create a temporary capture file,
and to fork off and run a separate copy of "ethereal" for "-S" and "-F"
captures or just call "capture()" otherwise, out of "gtk/capture_dlg.c"
and into a routine in "capture.c".

If the attempt to create said temporary capture file fails, pop up a
dialog box and don't do the capture.

Have the child capture process send a message upstream after it either
successfully starts the capture and syncs out the header of the capture
file, or fails to start the capture; the message indicates whether it
succeeded or failed, and, if it failed, includes a failure message.
This:

	avoids the use of a signal, and thus means we don't have to
	worry about whether to capture the signal, or whether to start
	or stop capturing depending on whether this particular capture
	is in sync mode or not;

	lets us pop up the message box for the error in the parent
	process if we're in sync mode, rather than doing it in the
	child, which didn't work well.


Add a check button to the Capture/Start dialog box, so that we can
control, for each capture, whether it's to be done in sync mode or not.

svn path=/trunk/; revision=708
1999-09-23 06:27:27 +00:00
Guy Harris 560e64cb73 Make the buffer into which we read from the sync pipe one byte bigger
than the size of the reads we do, so that we have an extra byte at the
end into which we can stick a '\0' to guarantee null-termination of the
buffer.

When reading the capture file in "tail_cap_file()", use "file_open()"
rather than "fopen()", so that we work correctly if we're using "zlib"
to read capture files.

svn path=/trunk/; revision=707
1999-09-23 05:55:56 +00:00
Guy Harris 522b27e290 Give it an RCS ID.
svn path=/trunk/; revision=706
1999-09-23 05:26:18 +00:00
Guy Harris bae65b863a Fix the calculation of the temporary file name length in
"try_tempfile()" - the first component of the name comes from the "dir"
argument, so use its length, not the length of the string in the buffer
it should fill in (said buffer may contain garbage, which may not *be* a
C string).

svn path=/trunk/; revision=705
1999-09-23 05:20:18 +00:00
Guy Harris ca7bc3fba9 Give it an RCS ID.
svn path=/trunk/; revision=704
1999-09-23 05:03:32 +00:00
Guy Harris 5e0274153e When reading a capture file, we can detect whether it's compressed or
not, so it's OK to use "zlib" to read capture files, as it handles
uncompressed files correctly.

When *writing* capture files, however, we can't detect automatically
whether the user wanted to write the file out as a compressed file or
not, so we should *NOT* use "zlib" until we add a flag to the API
specifying whether to write the file out as a compressed file or not.

Furthermore, the code in Ethereal that implements the "-S" flag depends
on being able to get the "FILE *" for a capture file being written, so
that it can "fflush()" it.

svn path=/trunk/; revision=703
1999-09-23 05:00:59 +00:00
Guy Harris 39ba76783b Get rid of unused variable.
svn path=/trunk/; revision=702
1999-09-23 04:56:52 +00:00
Ashok Narayanan 501b9b05e1 Adds progress bar functionality back for loading files (it was changed to
bounce bar for compressed file support). Note that the progress bar may
not grow smoothly for compressed files, but it should be reasonably accurate
for files which are large enough to matter.

svn path=/trunk/; revision=701
1999-09-23 04:39:01 +00:00
Guy Harris 5953b86866 "sync_mode" isn't used in "file.c", so there's no need to declare it
there (it's declared in "globals.h" in any case).

svn path=/trunk/; revision=700
1999-09-23 03:24:01 +00:00
Ashok Narayanan 911336a0e1 Fix to allow compressed file handling of Ascend captures
svn path=/trunk/; revision=699
1999-09-22 07:37:46 +00:00
Gilbert Ramirez 7bc6591130 Another change to make packet-tr more intelligent with regard to
short packets. Also increased RIF processing from 18 to 30 bytes of RIF, as
I learned that the token-ring spec changed. Don't call next dissector
if there are no more bytes in packet.

svn path=/trunk/; revision=698
1999-09-22 05:40:12 +00:00
Ashok Narayanan ac6ad294fb Documentation for compressed file support
svn path=/trunk/; revision=697
1999-09-22 01:38:00 +00:00
Ashok Narayanan 818783636d Oops - new file for zLib commit which I missed out.
svn path=/trunk/; revision=696
1999-09-22 01:28:04 +00:00
Ashok Narayanan 3dfa56c498 This commit contains support for reading capture files compressed using
gzip. The zLib library is used for this purpose. If zLib is not available
(or it's use is disabled by the --disable-zlib option to configure), you
can still compile Ethereal but it will be unable to read compressed capture
files.

IMPORTANT:

Now all file accesses to capture files should be done through special macros.
Specifically, for any use of the following functions on capture files, replace them.
The arguments for the right-side functions are exactly the same as for the
original stdio functions.

	fopen			file_open
	fdopen			filed_open
	fread			file_read
	fwrite			file_write
	fseek			file_seek
	fclose			file_close
	ferror			file_error

svn path=/trunk/; revision=695
1999-09-22 01:26:50 +00:00
Guy Harris 453a4e95fb Add code to dissect MX and LOC records ("sparc.com" has both).
svn path=/trunk/; revision=694
1999-09-21 07:15:38 +00:00
Guy Harris f37741ebde Line up the "configure --help" message for "--with-ucdsnmp", and explain
what the argument to that flag does.

svn path=/trunk/; revision=693
1999-09-20 21:11:06 +00:00
Laurent Deniel 6bb5358e85 Added "Automatic scrolling in live capture".
This display option is disabled by default.

svn path=/trunk/; revision=692
1999-09-19 16:03:46 +00:00
Laurent Deniel 3bd68e680b Added "Automatic scrolling in live capture".
This display option is disabled by default.

svn path=/trunk/; revision=691
1999-09-19 15:54:54 +00:00
Gerald Combs 2cbdb02208 Fixed a bug found by Derek W Poon <dpoon@uclink.berkeley.edu>, where deleted
filter list items were improperly removed from the filter list.

svn path=/trunk/; revision=690
1999-09-19 14:27:44 +00:00
Laurent Deniel bb54546a07 Decrease DNS resolving timeout.
svn path=/trunk/; revision=689
1999-09-18 16:01:52 +00:00
Laurent Deniel 86220d8c7a Convert OSI CLNP into new protocol tree dissectors.
svn path=/trunk/; revision=688
1999-09-18 15:51:31 +00:00
Laurent Deniel 89e7f49262 Handle the missing FT_BYTES field type.
svn path=/trunk/; revision=687
1999-09-18 15:44:41 +00:00
Guy Harris faad1274ed When we see a delimiter tag, if we've seen one before, we know how much
data corresponds to the attribute sequence belonging to the previous
delimiter tag, so set the length of the item for the previous delimiter
tag.

The "end of attributes" tag means "no more attributes after this, just
data"; dissect any stuff following it as data.

svn path=/trunk/; revision=686
1999-09-17 06:25:41 +00:00
Guy Harris 96e79ab6f8 Add a "BYTES_ARE_IN_FRAME()" macro, to test whether there are a
specified number of bytes of captured data in the frame at the specified
offset, and a "IS_DATA_IN_FRAME()" macro, to test whether there are any
bytes of captured data in the frame at the specified offset, and convert
some bounds checks to use them.

Add a dissector for the Internet Printing Protocol.

svn path=/trunk/; revision=685
1999-09-17 05:56:58 +00:00
Gilbert Ramirez ff20b92b67 Fixed randpkt so it isn't linked to X11 libs. Removed randpkt from default
target list, so a 'make randpkt' is required if you want to build it.

svn path=/trunk/; revision=684
1999-09-17 04:38:23 +00:00