Commit Graph

125 Commits

Author SHA1 Message Date
Guy Harris c193066114 At least some LAPB Windows Sniffer captures have 4 bytes of extra stuff
at the ends of packets.

svn path=/trunk/; revision=22540
2007-08-17 20:04:31 +00:00
Bill Meier 68cdbd4e65 Note invalidity of realtick for
captypes ETH_CAPTYPE_OTHERPOD2 and
ETH_CAPTYPE_GIGPOD2 in comments for
the associated TpS tables.

svn path=/trunk/; revision=22074
2007-06-11 15:50:03 +00:00
Guy Harris ef511c0bbc Note realtick's invalidity for ETH_CAPTYPE_OTHERPOD in the comment for
TpS_otherpod[].  Ask about its validity for ETH_CAPTYPE_OTHERPOD2 and
ETH_CAPTYPE_GIGPOD2.

svn path=/trunk/; revision=22016
2007-05-31 05:51:15 +00:00
Guy Harris aa3ac312b2 My comment is redundant with Bill's more-detailed comment; remove it.
svn path=/trunk/; revision=22015
2007-05-31 05:46:45 +00:00
Bill Meier e88e33d5e2 Update Comments
svn path=/trunk/; revision=22005
2007-05-30 15:32:31 +00:00
Guy Harris 70a9743831 Update a comment.
svn path=/trunk/; revision=21998
2007-05-30 00:36:32 +00:00
Guy Harris cba6441fa4 Give more detail on a captype of 6 for an Ethernet capture.
svn path=/trunk/; revision=21997
2007-05-29 23:35:45 +00:00
Guy Harris acde0f9f8a It's pretty clear that hdr.captype's interpretation depends on the
network type; there's no "presumably" about it.

Suggest that "realtick" might have the right time stamp in other cases
(if not, a comment should explicitly indicate that, so that in all cases
where we either know that realtick is wrong or have a lot of evidence to
show that it's right, we note that fact).

svn path=/trunk/; revision=21996
2007-05-29 23:31:03 +00:00
Guy Harris f93cf6dd86 Update the big time unit comment to reflect Bill Meier's recent changes.
Fix some other comments.

Add a suggestion for why the realtick values might correlate with
packets having an FCS.

svn path=/trunk/; revision=21993
2007-05-29 22:52:42 +00:00
Bill Meier 0bf864bc32 (fix comment)
svn path=/trunk/; revision=21983
2007-05-29 14:27:42 +00:00
Bill Meier 3b12c867a2 Another sniffer timestamp display fix; addresses bug 866 and other reports.
(Also: change variable name to correctly reflect usage).

svn path=/trunk/; revision=21982
2007-05-29 14:20:54 +00:00
Guy Harris 235596a3c8 From Jeff Foster: add support for Cisco HDLC captures.
svn path=/trunk/; revision=21598
2007-04-26 20:06:06 +00:00
Ulf Lamping 59d6c8ea33 change all file offsets from long to gint64 so we can - theoretically - handle files > 2GB correct.
Please distclean Win32 builds!

svn path=/trunk/; revision=19814
2006-11-05 22:46:44 +00:00
Michael Tüxen 3ce4a70412 Use G_GINT64_CONSTANT to handle 64-bit constants in the code.
svn path=/trunk/; revision=19663
2006-10-23 17:12:48 +00:00
Bill Meier 798a4b8c77 fix 'save' to store hi-order 32 bits of time offset for each pkt; fixes bug 1168
svn path=/trunk/; revision=19622
2006-10-20 01:17:17 +00:00
Jaap Keuter b33cccd47f Sake Blok wrote....
I have taken a look at the trace myself and calculated the TpS to be 
20000000.0 for this particular trace. If I also discard the start_timestamp
like it has been done for other versions of the netxray format, then I get 
the proper results.

svn path=/trunk/; revision=17869
2006-04-15 19:00:42 +00:00
Luis Ontanon 9ed9299e17 Remove an entire horde of off-by-one errors pointed out by Coverity's CID: 83
(Coverity finds just one at a time...)


svn path=/trunk/; revision=17580
2006-03-11 11:48:35 +00:00
Luis Ontanon 83296ec679 Another off by one error found by coverity (CID 83), using > instead of >= when comparing index against array size.
svn path=/trunk/; revision=17521
2006-03-08 10:20:09 +00:00
Jaap Keuter ca4000cbaf The attached patch to fix bug 663 allows Ethereal to read Windows
Sniffer V2 format capture files with captyp=5, timeunit=0.
The ticks_per_sec for this case apparently is 1e6.

Bill Meier

svn path=/trunk/; revision=17019
2006-01-12 15:02:25 +00:00
Guy Harris 90ce35c64e From Bill Meier:
define "timezone" as "gint16", as it can be positive (west of
	UTC) or negative (east of UTC);

	update comments to refer to the new names for structure members;

	say the precision of the time stamps is 1 nanosecond only if the
	ticks per second is > 10 million;

	fix the handling of files truncated exactly on a frame boundary.

svn path=/trunk/; revision=15739
2005-09-09 08:40:58 +00:00
Guy Harris 88c5c6c0d8 Get rid of the old file header definition.
Set the time stamp resolution based on whether the number of ticks per
second is > 1 million or not.

svn path=/trunk/; revision=15606
2005-08-29 01:18:27 +00:00
Guy Harris 394582573d From Bill Meier:
1. Use the new (good work!) 'nanosec' precision only for gig pods;
2. Rework 'struct netxray_hdr' to make it (somewhat) easier
   to maintain and revise:
   a. Declare known hdr fields such as 'captype' instead
      of using offsets in 'xxx placeholder' fields.
   d. Define 'unknown' hdr fields using placeholder names
      based upon hex-offset in the netxray header record.
      (This isn't perfect, but I hope it will make things 
       more manageable).
3. Update hdr field info (based upon examination of various
   capture files):
   a. Define a hdr field which appears to be 'time-zone' 
      [offset in hours from UTC] for the machine doing
      the capture.
      (Maybe this field can eventually be used for Ethereal
       to display the (local) time as it was at the time
       of the capture).
   b. Describe certain hdr fields as being "file offsets"
      (altho the exact use is still unclear).

Update some comments.

svn path=/trunk/; revision=15603
2005-08-28 23:11:53 +00:00
Ulf Lamping 723c80ea90 timestamp display precision:
- automatic adjustment depending on file format
- manual adjustment through menu items

save the setting in the recent file

svn path=/trunk/; revision=15534
2005-08-25 21:29:54 +00:00
Ulf Lamping 6f43fbb2f0 EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry!
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ...

What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere.

As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon.

Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way...

As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number...

svn path=/trunk/; revision=15520
2005-08-24 21:31:56 +00:00
Guy Harris d5891d9623 Try yet another scheme for handling time stamps; realtick isn't always
correct.

svn path=/trunk/; revision=15404
2005-08-18 09:47:00 +00:00
Jörg Mayer adddb9819b Chris Lydick: Support for Sniffer 2.003 files.
Modified to match the current codebase.


svn path=/trunk/; revision=14832
2005-07-02 15:40:49 +00:00
Guy Harris f28456dd84 Note that the WAN_CAPTYPE value of 4 can correspond to Cisco HDLC
traffic as well as Frame Relay traffic, and give some information about
the cruft found in the xxc field of the header for one CHDLC and one FR
capture.

svn path=/trunk/; revision=14659
2005-06-16 08:10:13 +00:00
Guy Harris e4a550c538 Add some notes about stuff discovered by Ken Mann.
svn path=/trunk/; revision=13194
2005-01-29 10:48:16 +00:00
Guy Harris c3240e1ccb Note that the low-order bit of hdr->hdr_2_x.xxx[8] appears to be a "bad
FCS" bit for 802.11, just as it appears to be for Ethernet, and give
more details on the 4 bytes of junk at the end of the packet (i.e., that
we haven't yet seen an 802.11 capture where it's an FCS rather than just
junk).

svn path=/trunk/; revision=13028
2005-01-14 09:47:22 +00:00
Guy Harris bcedae3c1f Add some more comments about the FCS issue.
svn path=/trunk/; revision=12939
2005-01-03 10:27:20 +00:00
Guy Harris 0e1e5e9feb Give a bit more information on the "are there FCSes in the frame?"
issue.

svn path=/trunk/; revision=12938
2005-01-03 10:10:23 +00:00
Guy Harris fd56bd7689 Rename the CAPTYPE_ definitions as appropriate - many of them are
specific to particular types of captures, and the same value might
correspond to more than one CAPTYPE_ definition.

Add an additional CAPTYPE_ for some non-gigabit Ethereal capture seen by
Bill Meier, and fix the range check the time stamp units value as per
his mail.

svn path=/trunk/; revision=12937
2005-01-03 05:27:35 +00:00
Guy Harris b5070624a7 From James Fields and Kevin Johnson: fix the handling of time stamps in
a number of Windows Sniffer captures - apparently the time stamp units
are in a field in the file header.

Add a capture type value seen in at least one ATM capture.

Update some comments, and add some comments.

Get rid of some redundant setting of "timeunit".

svn path=/trunk/; revision=12936
2005-01-03 03:42:23 +00:00
Guy Harris 88982558b0 file_hdr.network is one byte long, so don't use htoles() on values it's
set to - that causes it to be set to zero.

svn path=/trunk/; revision=12328
2004-10-17 06:20:43 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
they have LF at the end of the line on UN*X and CR/LF on Windows;
hopefully this means that if a CR/LF version is checked in on Windows,
the CRs will be stripped so that they show up only when checked out on
Windows, not on UN*X.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris ba72e955dc Have "wtap_read()" set "wth->phdr.pkt_encap" to "wth->file_encap",
rather than requiring individual capture file type handlers to do it
(unless they're doing per-packet encapsulation, in which case we check
to make sure they didn't *leave* it as WTAP_ENCAP_PER_PACKET).

svn path=/trunk/; revision=10290
2004-03-03 22:24:53 +00:00
Guy Harris 2528c053ce Supply a pseudo-header for all 802.11 packets; add an "fcs_len" field to
it, similar to the Ethernet pseudo-header's "fcs_len" field, and use it
in the 802.11 dissector.

svn path=/trunk/; revision=9884
2004-01-27 08:06:12 +00:00
Guy Harris bbf3806ba7 Don't muck with the Ethernet pseudo-header if we have an 802.11 capture.
svn path=/trunk/; revision=9857
2004-01-25 23:50:48 +00:00
Guy Harris d6cd61061e Have the Wiretap open, read, and seek-and-read routines return, in
addition to an error code, an error info string, for
WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and
WTAP_ERR_BAD_RECORD errors.  Replace the error messages logged with
"g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed
strings returned as the error info string, and change the callers of
those routines to, for those errors, put the info string into the
printed message or alert box for the error.

Add messages for cases where those errors were returned without printing
an additional message.

Nobody uses the error code from "cf_read()" - "cf_read()" puts up the
alert box itself for failures; get rid of the error code, so it just
returns a success/failure indication.

Rename "file_read_error_message()" to "cf_read_error_message()", as it
handles read errors from Wiretap, and have it take an error info string
as an argument.  (That handles a lot of the work of putting the info
string into the error message.)

Make some variables in "ascend-grammar.y" static.

Check the return value of "erf_read_header()" in "erf_seek_read()".

Get rid of an unused #define in "i4btrace.c".

svn path=/trunk/; revision=9852
2004-01-25 21:55:17 +00:00
Guy Harris c19c7677fb It appears that, for ISDN captures, the rules for whether there's 4
bytes of extra stuff at the end of the packet or not are the same as for
Ethernet and 802.11.

svn path=/trunk/; revision=9728
2004-01-19 02:23:18 +00:00
Ulf Lamping f16ac7a482 removed some MSVC warnings (level 3)
svn path=/trunk/; revision=9558
2004-01-05 17:33:28 +00:00
Guy Harris be2736adcf Have a pseudo-header for Ethernet packets, giving the size of the FCS -
0 means "there is no FCS in the packet data", 4 means "there is an FCS
in the packet data", -1 means "I don't know whether there's an FCS in
the packet data, guess based on the packet size".

Assume that Ethernet encapsulated inside other protocols has no FCS, by
having the "eth" dissector assume that (and not check for an Ethernet
pseudo-header).

Have "ethertype()" take an argument giving the FCS size; pass 0 when
appropriate.

Fix up Wiretap routines to set the pseudo-header.  This means we no
longer use the "generic" seek-and-read routine, so get rid of it.

svn path=/trunk/; revision=8574
2003-10-01 07:11:49 +00:00
Guy Harris f4a639c7c1 It appears that, at least for gigabit pod captures, there are time stamp
differences between versions 002.001 and 002.002.

svn path=/trunk/; revision=8563
2003-09-28 23:15:40 +00:00
Guy Harris 924136d7d7 A couple of captures have been seen with the first (low-order) byte of
the network type being 1 and the byte after it being 2; we assume, for
now, that the network type is 1 byte, and that if the byte after it is
0, the network type is an NDIS type - 1, and if it's 2, it's an NDIS type.

svn path=/trunk/; revision=7973
2003-07-07 21:08:49 +00:00
Guy Harris 7ccb4234a0 The units, in non-whizzo-gigabit-pod captures, for hdr.timeunit = 2
aren't 1/1193000.0 second; the code used to use 1/1193180.0 second, but
at least one capture appears to have units of somewhere around
1/3579540.0 second.

svn path=/trunk/; revision=7388
2003-03-31 21:11:49 +00:00
Guy Harris 86518e40f5 Ian Schorr discovered that, for gigabit pod captures, if hdr.timeunit is
2 the time stamps are in units of 1/31250000 seconds rather than
nanoseconds - and, by generating Windows Sniffer captures with various
hdr.timeunit values, that for all the non-zero values he tested, the
time stamps for non-gigabit pod captures are in units of 1/1193000
second.

Instead of having a TpS array, just test for the exception value (0 for
non-gigabit pod captures, 2 for gigabit pod captures).

svn path=/trunk/; revision=7380
2003-03-28 21:59:12 +00:00
Guy Harris cdfc37b6b6 Handle the direction bit in SDLC and PPP Sniffer files.
svn path=/trunk/; revision=7267
2003-03-04 02:04:00 +00:00
Guy Harris 15eea3fbb6 Handle packet direction information for SDLC Sniffer captures.
Add a bunch of capture types discovered by stuffing them into Windows
Sniffer captures and seeing what a Sniffer thought they were.  Add
support for writing at least some of them.

svn path=/trunk/; revision=7265
2003-03-03 23:29:59 +00:00
Guy Harris a37b287a50 A "hdr.xxb[20]" value of 2 in a version 2 capture appears to mean that
it's a gigabit Ethernet capture, possibly, with special hardware, and
that time stamps have 1000 times the resolution that they have in other
captures (perhaps due to the special hardware having a higher-resolution
clock?).

svn path=/trunk/; revision=7240
2003-03-01 09:42:44 +00:00
Guy Harris f88816e60f Add WTAP_ENCAP_FRELAY_WITH_PHDR for use with Frame Relay capture files
that have direction information.

Support writing WTAP_ENCAP_FRELAY_WITH_PHDR and WTAP_ENCAP_PPP_WITH_PHDR
captures out in libpcap format - we throw away the direction
information, but so it goes.

When reading/writing Windows Sniffer format, read and write the
direction flag.

svn path=/trunk/; revision=7052
2003-01-31 01:02:14 +00:00