Commit Graph

581 Commits

Author SHA1 Message Date
Guy Harris ae53260d02 Keep in the "wtap" structure the current offset into the file being
read, and maintain it ourselves as we read through the file, rather than
calling "ftell()" for every packet we read - "ftell()" may involve an
"lseek()" call, which could add a noticeable CPU overhead when reading a
large file.

svn path=/trunk/; revision=596
1999-08-28 01:19:45 +00:00
Gilbert Ramirez f7951bd593 Touched these files to make 'make dist' happy.
svn path=/trunk/; revision=595
1999-08-27 23:39:32 +00:00
Gilbert Ramirez 3764b0a3b1 Updated docs.
svn path=/trunk/; revision=594
1999-08-27 22:57:56 +00:00
Gilbert Ramirez e62dfe591b Added gtk subdirectory, with patched gtkclist.c in it. We can use this
optimized gtkclist until Guy's changes appear in the offical GTK+.

svn path=/trunk/; revision=593
1999-08-27 22:27:18 +00:00
Guy Harris 72eb495fab "long" -> "gint32" ("gint32" is 32 bits, "long" isn't necessarily 32
bits and is definitely not 32 bits on some platforms).

svn path=/trunk/; revision=592
1999-08-27 20:10:14 +00:00
Gilbert Ramirez b53d4ba179 Changed packet-tr.c to insert tr.sr, a FT_BOOLEAN field, only if tr.sr
is true. The test for truth now becomes a test for existence. The dfilter
grammar no longer recognizes 'true' and 'false', since you can now check
a boolean field via:

	tr.sr

or by its negation:

	!tr.sr

svn path=/trunk/; revision=591
1999-08-27 19:27:22 +00:00
Gilbert Ramirez a14aa01462 Updated RSVP decoder with Ashok's newest code.
svn path=/trunk/; revision=590
1999-08-27 19:21:36 +00:00
Gilbert Ramirez 11ca5817b6 The token-ring decoder now takes into account some really garbled
TR packets that are seen on Linux 2.0 boxes (viewing your own packets
before they get to the wire). Thanks to Tom Gallagher <Tom.Gallagher@madge.com>
for providing the patch.

svn path=/trunk/; revision=589
1999-08-27 19:15:38 +00:00
Guy Harris 6bd284169e No, 0xCC is SNRME. (I *told* you I hated reversing bit strings....)
svn path=/trunk/; revision=588
1999-08-27 18:02:41 +00:00
Guy Harris 970fa328a4 TEST is 0xE0, not 0xC0; 0xC0 is SNRME. (I hate having to reverse bit
strings....)  Thanks to Tom Gallagher at Madge for pointing this out.

svn path=/trunk/; revision=587
1999-08-27 18:01:02 +00:00
Guy Harris cb07f507aa Properly pluralize "bytes" in the detail line for "dissect_data()".
svn path=/trunk/; revision=586
1999-08-26 17:51:44 +00:00
Gilbert Ramirez da72d12846 Dissect unknown IP protocols with dissect_data().
svn path=/trunk/; revision=585
1999-08-26 17:31:37 +00:00
Guy Harris f93c76fd10 Convert a bunch of uses of "fd->cap_len" to use "pi.captured_len" (or to
use END_OF_FRAME), so that they don't look at stuff in an IP datagram
past the end of the IP datagram (i.e., frame padding).

svn path=/trunk/; revision=584
1999-08-26 07:34:43 +00:00
Gilbert Ramirez 8b2e03eea6 Introduces a new global gboolean variable: proto_tree_is_visible.
This is set before calling dissect_packet() to let the proto_tree routines
whether or not it needs to go through the trouble of formatting strings.
The use of this dramatically decreases the number of calls to vsnprintf.

svn path=/trunk/; revision=583
1999-08-26 07:01:44 +00:00
Gilbert Ramirez ae356ef145 The dfilter yacc grammar now keeps track of every GNode that it allocates.
After a bad parse, instead of leaking this memory, the memory used for
those GNodes is now freed.

Added some memory-freeing "cleanup" routines for the dfilter and proto_tree
modules, which are called right before ethereal exits. Maybe once we get
a complete set of cleanup routines, we'll be able to better check if
memory is leaking.

svn path=/trunk/; revision=582
1999-08-26 06:20:50 +00:00
Gilbert Ramirez 11b9a6e949 Correctly set global_df->dftree to NULL after a bad parse.
svn path=/trunk/; revision=581
1999-08-25 22:54:17 +00:00
Gilbert Ramirez 8904b3b217 Reverted TCP follow back to old behavior of leaving list of packets in
filtered state. The display filter text entry widget is left in its
original state, so an ENTER can reset the packet list. The manpage has
been changed to mention this.

svn path=/trunk/; revision=580
1999-08-25 22:20:03 +00:00
Guy Harris 27e81cb483 Use END_OF_FRAME rather than "fd->cap_len - offset" - END_OF_FRAME used
to be just "fd->cap_len - offset", but it's now "pi.captured_len - offset",
which means that, for a protocol built atop TCP, like LPD, it'll take
into account the fact that the IP (and thus TCP) data in the packet may
end before the end of the frame.

svn path=/trunk/; revision=579
1999-08-25 17:38:36 +00:00
Guy Harris adf5b4881c Add in the Async Map option.
Add in the Identification and Time Remaining codes for LCP.

Add in a pile of other LCP options, albeit without anything more than
names for now.

Don't say "1 bytes", say "1 byte".

Don't use "dissect_data()" to dissect part of a *CP packet, and don't
dissect opaque data if there're zero bytes of it.

svn path=/trunk/; revision=578
1999-08-25 07:32:46 +00:00
Guy Harris 8a6cdd595e Put in support for dissecting LCP and IPCP options.
Have a common routine to parse both LCP and IPCP, as IPCP is based on
LCP.

Have only one "value_string" array of PPP protocol types, with all the
types we know about.

svn path=/trunk/; revision=577
1999-08-25 06:52:04 +00:00
Guy Harris f551cee575 The bulk of the PPP dissection is common between "dissect_ppp()" and
"dissect_payload_ppp()"; put it into a common routine, called by both
(which means we now dissect LCP and IPCP in PPP requests even if they
aren't inside PPPOE or GRE packets).

svn path=/trunk/; revision=576
1999-08-25 03:56:07 +00:00
Guy Harris 0259c6ec29 "read_filters()" is actually called late enough in the startup process
that it can pop up a message box; have it do so.

Make the "Can't open file" message boxes in "colors.c" include the
"errno" error message in the message they put up.

Don't complain about being unable to open the color filter file if it
doesn't exist (perhaps the user just never made one).

Make the message for a failure to open the preferences file resemble
that for a failure to open a color filter file.

svn path=/trunk/; revision=575
1999-08-25 03:22:46 +00:00
Guy Harris a5fd847154 NBIPX packet type 3 appears to be the equivalent, in NBIPXland, of the
NetBIOS Datagram Service in NBTland; a capture Gilbert sent had a pile
of those packets containing what looked like SMB browser announcements,
which are sent out as broadcast datagrams.  Label them as such, and
treat them as such.

Might packet type 2 be the equivalent of the NetBIOS Session Service -
both of them contain SMBs, but the former is a connection-oriented
service (LLC I frames, presumably, in NBF, and TCP in NBT), and the
latter is a datagram-oriented service (LLC UI frames, presumably, in
NBF, and UDP in NBT)?  For now, we leave type 2 as "SMB (over NBIPX)",
but we might want to label it as "NetBIOS session" or whatever the
appropriate term is.

svn path=/trunk/; revision=574
1999-08-25 01:36:21 +00:00
Guy Harris 265b8eeaee Dump the values of the "flags" and "ttl" fields of the CDP header.
Don't treat the CDP header as an in-memory data structure; that might
cause problems if it's not aligned on a 2-byte boundary.

Make the type and length fields of a TLV unsigned.

Correctly check for the end of the (captured part of the) frame.

Show most TLVs as "expandable" entries, where they expand into type,
length, and data entries.

Dissect "unknown" TLVs.

svn path=/trunk/; revision=573
1999-08-25 00:55:45 +00:00
Guy Harris de939144b6 Instead of adding the TLV type and length values as hidden values, enter
them with "proto_tree_add_item()" rather than "proto_tree_add_text()"
when adding them to the subtree for a TLV item.

svn path=/trunk/; revision=572
1999-08-25 00:42:49 +00:00
Guy Harris 8db745d962 Dump the values of the "flags" and "ttl" fields of the CDP header.
Don't treat the CDP header as an in-memory data structure; that might
cause problems if it's not aligned on a 2-byte boundary.

Make the type and length fields of a TLV unsigned.

Correctly check for the end of the (captured part of the) frame.

Show most TLVs as "expandable" entries, where they expand into type,
length, and data entries.

Dissect "unknown" TLVs.

svn path=/trunk/; revision=571
1999-08-25 00:24:32 +00:00
Gilbert Ramirez fb80e69cb3 Fixed CPP #ifdef and comment.
svn path=/trunk/; revision=570
1999-08-25 00:03:59 +00:00
Gilbert Ramirez 882b921a0a Removed unnecessary #include lines.
svn path=/trunk/; revision=569
1999-08-24 23:00:56 +00:00
Gilbert Ramirez 3c793444cc Fixed the array problem in packet-netbios.
Fixed the default case in the packet-cdp while() statement to look for
non-zero offsets. I should fix the other cases where offset += length.
Meanwhile, however, I added cdp.tlv.type and cdp.tlv.len as two filterable
fields so that one can use "cdp.tlv.len == 0" as a display filter to
find the packet that was causing problems.

svn path=/trunk/; revision=568
1999-08-24 22:36:34 +00:00
Guy Harris f7f65443d2 Use "strchr()" rather than "index()" - "strchr()" is the ANSI standard
routine, it's what we use elsewhere in Ethereal, all modern UNIXes have
it, and it's declared in <string.h>, unlike "index()" which isn't
necessarily declared there (and thus we get GCC warnings about "index()"
being undeclared).

svn path=/trunk/; revision=567
1999-08-24 18:53:08 +00:00
Gilbert Ramirez e580c1b8a0 Changed #include "glib.h" to #include <glib.h>, for stylistic reasons.
svn path=/trunk/; revision=566
1999-08-24 17:36:24 +00:00
Gilbert Ramirez cb1e32da97 Removed unnecessary #include "etypes.h" lines.
svn path=/trunk/; revision=565
1999-08-24 17:26:16 +00:00
Gilbert Ramirez 8cdb786ae9 Updated the deliverables because of the spec-file change.
svn path=/trunk/; revision=564
1999-08-24 17:19:45 +00:00
Gilbert Ramirez dcc1cbe7eb Changed spec file for producing RPMs to ethereal.spec.in so that
'configure' can update the version automatically. That way we don't
have to update the spec file every time the version of ethereal changes.

svn path=/trunk/; revision=563
1999-08-24 17:18:35 +00:00
Gilbert Ramirez e1bd4fd73f Added John McDermott's colorization routines. There's still some
debug printf's in there.

svn path=/trunk/; revision=562
1999-08-24 16:27:23 +00:00
Guy Harris 5a221703bb In the summary display for CLIP frames, make the protocol CLIP (which
will get overridden in any case).

svn path=/trunk/; revision=561
1999-08-24 06:16:27 +00:00
Guy Harris 8ac1277397 In the summary display for PPP frames, make the protocol PPP (which will
get overridden in any case).

svn path=/trunk/; revision=560
1999-08-24 06:14:16 +00:00
Guy Harris 3c9b4047aa In the summary display for Ethernet frames, make the protocol Ethernet
and the info field an indication of whether it's Ethernet II, raw 802.3,
or (LLC-atop) 802.3 (which will be overridden by other protocols, if we
know the protocol inside the frame).

svn path=/trunk/; revision=559
1999-08-24 06:10:05 +00:00
Guy Harris b24043fe31 More completely decode the frame control field of an FDDI frame.
In the summary display for FDDI frames, make the protocol FDDI and the
info field the description of the frame control field (which will be
overridden by other protocols, if the frame is an async LLC frame).

svn path=/trunk/; revision=558
1999-08-24 06:01:45 +00:00
Guy Harris 678b5fd6ff Add a new Wiretap encapsulation type WTAP_ENCAP_FDDI_BITSWAPPED, meaning
"FDDI with the MAC addresses bit-swapped"; whether the MAC addresses are
bit-swapped is a property of the machine on which the capture was taken,
not of the machine on which the capture is being read - right now, none
of the capture file formats we read indicate whether FDDI MAC addresses
are bit-swapped, but this does let us treat non-"libpcap" captures as
being bit-swapped or not bit-swapped independent of the machine on which
they're being read (and of the machine on which they were captured, but
I have the impression they're bit-swapped on most platforms), and allows
us to, if, as, and when we implement packet capture in Wiretap, mark
packets in a capture file written in Wiretap-native format based on the
machine on which they are captured (assuming the rule "Ultrix, Alpha,
and BSD/OS are the only platforms that don't bit-swap", or some other
compile-time rule, gets the right answer, or that some platform has
drivers that can tell us whether the addresses are bit-swapped).

(NOTE: if, for any of the capture file formats used only on one
platform, FDDI MAC addresses aren't bit-swapped, the code to read that
capture file format should be fixed to flag them as not bit-swapped.)

Use the encapsulation type to decide whether to bit-swap addresses in
"dissect_fddi()".

svn path=/trunk/; revision=557
1999-08-24 03:19:34 +00:00
Guy Harris 9fc0d3aefe Have "get_xdlc_control()" and "dissect_xdlc_control()" just return a
Boolean indicating whether the frame has any payload to dissect or not.

svn path=/trunk/; revision=556
1999-08-23 23:24:36 +00:00
Guy Harris 397b2be709 The only LLC frame types that should be dissected based on their SAP or,
if the SAPs are SNAP, based on their ethertype are I frames and UI
frames; others don't have payload to be dissected as belonging to other
protocols.

svn path=/trunk/; revision=555
1999-08-23 22:47:13 +00:00
Gilbert Ramirez 42aba512c6 Alwasy compile in swaptab[] so that we can swap addresses, even if we
don't need to.

svn path=/trunk/; revision=554
1999-08-23 22:13:35 +00:00
Guy Harris 3a2f97bce9 The Single UNIX Specification doesn't say that "mkstemp()" creates the
temporary file with mode rw-------, so we won't assume that all UNIXes
will do so; instead, we set the umask to 0077 to take away all group and
other permissions, attempt to create the file, and then put the umask
back (puts into "try_tempfile()", called by "create_tempfile()" to
create temporary files, the "umask()" calls that Gilbert put into
"capture.c" to deal with the same problem).

svn path=/trunk/; revision=553
1999-08-23 05:02:50 +00:00
Guy Harris 73df88f11e Modify the comments to show how much of a mess the different DLT_ values
on different flavors of BSD are - even worse than I thought, now that
I've seen the BSD/OS <net/bpf.h>.

svn path=/trunk/; revision=552
1999-08-22 19:08:40 +00:00
Guy Harris 7348611bcb Rename BSD_AF_INET6_OPENBSD to BSD_AF_INET6_BSD, as
1) OpenBSD and NetBSD might use the same value;

	2) BSD/OS uses the same value;

so maybe FreeBSD is the only outlier.

svn path=/trunk/; revision=551
1999-08-22 19:05:44 +00:00
Guy Harris 15558acf54 Don't use zero-length arrays - not all compilers support them, and we're
not using the structure members so declared, anyway; instead, put in a
comment to note that the data follows, in a certain format.

Use "guint8", "guint16", and "guint32" instead of "unsigned char",
"unsigned short", and "unsigned long", as per the rest of Ethereal; the
first two pairs are equivalent, but "unsigned long" is *not* necessarily
a 32-bit data type (it's not a 32-bit data type on most 64-bit
platforms, for example).

svn path=/trunk/; revision=550
1999-08-22 07:27:06 +00:00
Guy Harris bf9895bb26 Remove the include of <sys/time.h> from "file.h" - it's neither
necessary nor sufficient if you're using "struct tm" (on many, perhaps
most, perhaps even all modern UNIXes, <sys/time.h> includes <time.h>,
which declares "struct tm", but that's not necessarily the case on
non-UNIX systems).

Include <time.h> in "file.c", to declare "struct tm".

Don't use PCAP_ERRBUF_SIZE to declare a message string buffer - that
won't work if you don't have "libpcap".

svn path=/trunk/; revision=549
1999-08-22 07:19:28 +00:00
Guy Harris b9ed78d5eb Don't check to make sure "-k" was specified with "-S" or "-F" but not
with "-W" unless we actually support "libpcap", as "fork_mode" isn't
defined unless HAVE_LIBPCAP is defined.

svn path=/trunk/; revision=548
1999-08-22 07:12:32 +00:00
Guy Harris 1a7eb86f1f Put "packet-atm.c" in.
svn path=/trunk/; revision=547
1999-08-22 07:10:08 +00:00