Commit Graph

801 Commits

Author SHA1 Message Date
Guy Harris 251ecc78f5 From Joe Marcus Clarke: force the standard output to be in binary mode
on Windows.

svn path=/trunk/; revision=10717
2004-04-28 05:47:33 +00:00
Olivier Biot af4a73a523 At last compiling on CygWin works again! Added the missing PCRE and GLIB
libraries to libftypes.

Provide caching of computed configure tests.

svn path=/trunk/; revision=10600
2004-04-14 18:42:19 +00:00
Guy Harris 1adc05c157 From Mark C. Brown: add support for FDDI and Token Ring cards.
Set the file encapsulation the same way it's done for iptrace captures -
leave it as "unknown" to start with, and, for each packet we see, set it
to the packet's encapsulation type if the file encapsulation type is
unknown and set it to "per-packet" if the file encapsulation type is
"known" but isn't the type of that packet, so files that have all the
same type of packet have that type as the file type and packets that
*don't* have all the same type of packet have "per-packet".

svn path=/trunk/; revision=10543
2004-04-02 08:27:26 +00:00
Guy Harris 78becd2967 From Rolf Fiedler: fix a comment, and fix the code to get the packet
length.

svn path=/trunk/; revision=10541
2004-04-02 07:40:37 +00:00
Guy Harris 5eb39c4638 From Albert Chin: "config.h" should come before all other #includes.
svn path=/trunk/; revision=10528
2004-03-30 19:37:31 +00:00
Jörg Mayer 9c83306a7e Some aclocal warning fixes during autogen.sh
svn path=/trunk/; revision=10507
2004-03-27 12:07:57 +00:00
Guy Harris 313ba9e2b8 From Mark C. Brown: add support for iether (dual-port gigabit) cards in
nettl files.

svn path=/trunk/; revision=10501
2004-03-27 11:16:54 +00:00
Olivier Biot eee9dc26ac Fix the CLEANFILES target so both static and shared libraries are cleaned.
svn path=/trunk/; revision=10475
2004-03-24 21:27:44 +00:00
Guy Harris 30b2831847 Add support for DLT_APPLE_IP_OVER_IEEE_1394.
svn path=/trunk/; revision=10446
2004-03-23 01:02:41 +00:00
Guy Harris ac38f86c69 Clean up the code to check the file type.
svn path=/trunk/; revision=10445
2004-03-23 00:17:50 +00:00
Guy Harris b9ab806214 In the read routine, set the 802.11 pseudo-header for
WTAP_ENCAP_PRISM_HEADER, WTAP_ENCAP_IEEE_802_11_WLAN_BSD, and
WTAP_ENCAP_IEEE_802_11_WLAN_AVS.

In the seek_read routine, set it for all 802.11 types.

svn path=/trunk/; revision=10404
2004-03-19 05:22:41 +00:00
Guy Harris 40f3136dbf "esc_read()" is passed a FILE_T, not a FILE_T * - a FILE_T is a pointer
(a FILE * if zlib isn't used, a gzFile if zlib is used).

Use "size_t" for the amount of data to read in
"eyesdn_check_file_type()", to squelch signed vs. unsigned warnings.

svn path=/trunk/; revision=10392
2004-03-17 09:24:41 +00:00
Jörg Mayer b7803c8fc6 Make libethereal and libwiretap shared libs.
svn path=/trunk/; revision=10368
2004-03-13 10:15:36 +00:00
Guy Harris 48cd9f9358 Add support for DLT_ value 99, as used by the Axent Raptor
firewall/Symantec Enterprise Firewall.  Thanks, Axent/Symantec, for not
asking us for a DLT_ value and not telling us about the link-layer type.

svn path=/trunk/; revision=10361
2004-03-11 09:18:33 +00:00
Guy Harris 5ae946d67c From Jeff Morriss: delete "ascend-grammar.c" and "ascend-grammar.h" with
"make maintainer-clean", as they're generated files.

svn path=/trunk/; revision=10336
2004-03-06 21:46:27 +00:00
Guy Harris 03d1c9e781 Get rid of an out-of-date comment.
We only appear to need autoconf 2.52, not 2.53.

svn path=/trunk/; revision=10293
2004-03-04 06:30:14 +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
Jörg Mayer c4884cab89 Require autoconf 2.53 and automake 1.6
svn path=/trunk/; revision=10287
2004-03-03 21:35:57 +00:00
Guy Harris cf1466d623 Set the packet encapsulation value to the file encapsulation.
svn path=/trunk/; revision=10285
2004-03-03 01:49:16 +00:00
Guy Harris d7ea5b23cf A DLT_ value of 13, in a Nokia-format capture, appears to be an ATM
capture of some sort.

svn path=/trunk/; revision=10109
2004-02-19 08:02:06 +00:00
Guy Harris b5881ce528 Get rid of unused variables and #defines.
svn path=/trunk/; revision=10059
2004-02-13 19:19:13 +00:00
Guy Harris 26536d7a41 Use "guint8" for 8-bit binary data.
"file_getc()" returns either an 8-bit unsigned value, or -1 for error or
EOF; store its return value into an "int", and check for -1 and return
-2, in "esc_read()" (rather than checking "file_error()" at the end).

Clean up some comments, routine names, and variable names - eyeSDN files
are binary, not text.

In "parse_eyesdn_packet_data()", handle the case of an EOF from
"esc_read()".

svn path=/trunk/; revision=10050
2004-02-12 21:25:07 +00:00
Guy Harris 0aef15283a Note that 164 is reserved for Juniper chassis-internal meta-information
(DLT_JUNIPER_MONITOR/LINKTYPE_JUNIPER_MONITOR).

Fix a typo.

svn path=/trunk/; revision=10046
2004-02-12 19:49:08 +00:00
Guy Harris 131be6ce7d Map WTAP_ENCAP_IEEE_802_11_WITH_RADIO to DLT_IEEE802_11, for now; we
could probably map it to one of the many different 802.11+radio headers,
but we should probably just have *one* Wiretap encapsulation for 802.11,
with a radiotap-style list of attributes attached to it.

svn path=/trunk/; revision=10041
2004-02-11 20:47:00 +00:00
Guy Harris 2df960325a From Rolf Fiedler: support for reading EyeSDN USB S0 trace files.
svn path=/trunk/; revision=10038
2004-02-11 20:05:16 +00:00
Guy Harris 31c636ff4a Cast the arguments to <ctype.h> macros to "guchar", to squelch
"subscript has type `char'" warnings and to make the code work correctly
if there are characters with the 8th bit set.

svn path=/trunk/; revision=10010
2004-02-09 00:06:30 +00:00
Guy Harris a2d69c6fae Add extra {} to "avoid ambiguous `else'", to quote the GCC warning that
this squelches.

svn path=/trunk/; revision=10009
2004-02-09 00:05:35 +00:00
Jörg Mayer 55af6c35c4 Move -pedantic back to extra-gcc-flags, as glib generates more warnings than our code
svn path=/trunk/; revision=10008
2004-02-08 14:11:48 +00:00
Jörg Mayer 16970db9af Don't build as shared *and* static by default
svn path=/trunk/; revision=10004
2004-02-07 05:44:08 +00:00
Jörg Mayer 2a1cb9ce0f Ignore byproducts of shared lib compilation
svn path=/trunk/; revision=10003
2004-02-07 04:35:49 +00:00
Guy Harris 75d7c8727b Whether frames in an AiroPeek V9 802.11 capture have 4 bytes of 0 or an
FCS at the end appears to depend on the network subtype value.

svn path=/trunk/; revision=10001
2004-02-06 20:50:44 +00:00
Guy Harris 922c36ea57 A MediaSubType value of 1 also means 802.11. (Is that what indicates
whether there's an FCS or not?)

svn path=/trunk/; revision=9995
2004-02-06 05:23:46 +00:00
Guy Harris f23a8e64c0 Make sure a packet has one and only one length field, one and only one
timestamp lower field, and one and only one timestamp lower field.

svn path=/trunk/; revision=9994
2004-02-06 04:48:06 +00:00
Guy Harris 95ff961e2d The time stamps in *Peek V9 files appear to be in nanoseconds from the
Windows FILETIME epoch, i.e. midnight, January 1, 1601.

svn path=/trunk/; revision=9993
2004-02-06 04:27:19 +00:00
Guy Harris d5263942b5 Ethernet frames appear to have 4 bytes of 0 at the end, at least in the
captures I've seen.

svn path=/trunk/; revision=9991
2004-02-06 03:12:21 +00:00
Guy Harris 0875bf3afe V9 format appears to be used by some versions of EtherPeek, too.
The MediaType field seems to be 0 for the Ethernet captures; however,
the MediaSubType field is different.

The fields in the header are different - we can't use hard-coded offsets
for the fields, we have to process them as a sequence of tag/value
items.

Rename some routines to use the same naming convention as the V9 open
routine rather than the same convention as the V5/V6/V7 read and
seek/read routines.

svn path=/trunk/; revision=9990
2004-02-06 02:11:52 +00:00
Guy Harris 2cbe1a0bf5 Fix up a comment to note that this is also used for AiroPeek, and used
only for versions 5, 6, and 7 of the file format.

Add another comment explaining why this refers to "etherpeek" even
though it's also used for AiroPeek and probably also TokenPeek.

svn path=/trunk/; revision=9989
2004-02-06 02:09:11 +00:00
Guy Harris f3a4c61c93 Sort the link-layer type values a little better.
svn path=/trunk/; revision=9987
2004-02-06 00:45:27 +00:00
Guy Harris cf131d9e16 The DLT_ value 127 is being used for the BSD radio header, and the
current CVS libpcap uses 163 for the AVS radio header (127 was never
used for the AVS radio header).  Redo the Wiretap encapsulation values
for that (and shuffle them to put the 802.11 Wiretap values together).

svn path=/trunk/; revision=9904
2004-01-29 10:58:28 +00:00
Guy Harris 677db2dadd From Tomas Kukosa: reserve private WTAP_ENCAP values and map them to
reserved private DLT_ values.

svn path=/trunk/; revision=9892
2004-01-28 01:24:30 +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 1c8f8924ac Fix a compiler warning.
svn path=/trunk/; revision=9867
2004-01-26 21:26:52 +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
Jörg Mayer 6e59f95ceb Fix all fixable warnings
Move addional warnings from extra-gcc-checks to normal compilation flags

svn path=/trunk/; revision=9826
2004-01-24 16:48:12 +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
Olivier Biot 2857dfc114 Add -Wbad-function-cast to extra gcc flags.
svn path=/trunk/; revision=9639
2004-01-10 16:51:07 +00:00
Guy Harris f497416d24 The year in a LANalyzer capture's trace summary record is a 2-byte year
number.

svn path=/trunk/; revision=9583
2004-01-07 04:50:21 +00:00
Guy Harris 0b82bd5123 Packet data is an array of "guint8"s, not an array of "char"s; declare
variables appropriately.

Put in a cast to squelch MSVC++ warnings.

svn path=/trunk/; revision=9575
2004-01-06 20:05:39 +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 c45a2852f0 For WTAP_ENCAP_ETHERNET, you have to fill in the "eth.fcs_len" member of
the pseudo-header; these captures don't appear to have an FCS in them,
so set that member to 0.

svn path=/trunk/; revision=9502
2003-12-31 01:07:09 +00:00
Guy Harris 7110082aa4 From Neils Koot:
add the ability to read Ethernet captures;

	add the ability to read hex-only dumps.

svn path=/trunk/; revision=9468
2003-12-29 00:36:12 +00:00
Guy Harris 1b6d16c7cc Make all the byte arrays for writing out stuff "guint8" rather than
"gint8" - there's no reason for them to be signed, and making them
signed can cause compiler warnings if a value won't fit in 8 bits if
sign-extended.

svn path=/trunk/; revision=9467
2003-12-29 00:25:39 +00:00
Ulf Lamping cb2658031d removed some MSVC warnings (warning level 2)
svn path=/trunk/; revision=9459
2003-12-28 12:43:40 +00:00
Jörg Mayer 982b7a3f2b Add -pedantic to --with-extra-gcc-checks
svn path=/trunk/; revision=9443
2003-12-24 14:45:48 +00:00
Ulf Lamping 467c05b3ea removed some MSVC warnings (conversions between double/float and int)
svn path=/trunk/; revision=9422
2003-12-23 00:16:46 +00:00
Ulf Lamping 3b77bfee59 removed some MSVC warnings (moved pcap.h before glib.h)
svn path=/trunk/; revision=9393
2003-12-21 12:19:39 +00:00
Jörg Mayer 8d1f1c9b4f libpcap.c:1777: warning: implicit declaration of function htons
svn path=/trunk/; revision=9388
2003-12-21 06:02:06 +00:00
Guy Harris 8b0f0d5b7e Add some additional sanity checking.
svn path=/trunk/; revision=9360
2003-12-19 22:23:05 +00:00
Guy Harris 95e6fb64c0 Add support for a link-layer type value of 143 as DOCSIS in libpcap
captures.

svn path=/trunk/; revision=9350
2003-12-18 23:50:44 +00:00
Guy Harris b8299f0b98 From Jan Kiszka: IrDA support.
svn path=/trunk/; revision=9345
2003-12-18 19:07:14 +00:00
Guy Harris a98aa75a58 WildPackets' EtherHelp appears to write EtherPeek-compatible files,
except that the 0x80 bit is turned on in the file version number field.
Turn that bit off before processing that field.

svn path=/trunk/; revision=9342
2003-12-18 03:43:40 +00:00
Guy Harris c642c44ad8 Fix more "CPPLAGS" typoes.
svn path=/trunk/; revision=9310
2003-12-17 02:41:04 +00:00
Ulf Lamping 10e3320115 prevent MSVC warning:
"warning C4761: Gr��enkonflikt im Argument. Konvertierung vorgenommen"
-> size conflict in argument, conversion done

svn path=/trunk/; revision=9244
2003-12-11 21:23:37 +00:00
Guy Harris 02260b4056 From Jeff Morriss: add support for libpcap MTP2 and MTP3 captures.
Add a missing entry in "encap_table[]" for Bluetooth H4, and fix some
comments.

svn path=/trunk/; revision=9157
2003-12-03 22:40:39 +00:00
Guy Harris 95f25d46c1 "strtoul()" returns a "long", not a "long long".
svn path=/trunk/; revision=9154
2003-12-03 19:47:36 +00:00
Guy Harris 98c4d5d030 Check for errors and EOF, and handle them appropriately; don't treat all
errors when reading the header as indications that the file isn't an
AiroPeek V9 file.

Put in comments nothing some additional checks we should do.

svn path=/trunk/; revision=9145
2003-12-02 20:27:14 +00:00
Guy Harris fe73d8e3b6 From Martijn Schipper: support for reading AiroPeek files in V9 capture
file format (AiroPeek 2.x).

svn path=/trunk/; revision=9144
2003-12-02 19:37:05 +00:00
Richard Sharpe da672d6f17 It's RedHat, not Red Hat.
svn path=/trunk/; revision=9126
2003-12-01 06:59:10 +00:00
Guy Harris e3f791ebea "file_seek()" sets "*err" - we don't have to set it ourselves.
The same is true of "parse_cosine_rec_hdr()".

svn path=/trunk/; revision=9079
2003-11-25 05:58:56 +00:00
Guy Harris 6939f62da0 "file_seek()" sets "*err" - there's no need to set it ourselves. It
returns -1 on errors, so just check for that.

svn path=/trunk/; revision=9078
2003-11-25 05:56:16 +00:00
Guy Harris 240c946b82 From Olivier Biot: add a "--enable-profile-build" flag to request that
"-pg" binaries be built.

svn path=/trunk/; revision=9001
2003-11-18 08:13:10 +00:00
Guy Harris f0887775c2 From Brian Ginsbach: fix handling of IRIX and UNICOS/mp snoop captures
on loopback interfaces.

svn path=/trunk/; revision=8945
2003-11-11 20:49:46 +00:00
Guy Harris 4192ad9770 Let people configure whether to build with Zlib or not solely by
controlling whether ZLIB_DIR is defined or not in config.nmake.

svn path=/trunk/; revision=8911
2003-11-07 23:27:13 +00:00
Guy Harris 0543fbd427 From Scott Emberley: support for writing Network Instruments Observer
files.

svn path=/trunk/; revision=8900
2003-11-06 22:45:28 +00:00
Guy Harris 7fc668fbf9 Sigh. Some snoop files have 6 bytes of padding; assume the file is a
snoop file unless it has enoguh padding to hold a Shomiti trailer
record.  (DEAR SUN MICROSYSTEMS: PLEASE DO NOT STUFF 16 OR MORE BYTES OF
PADDING INTO A SNOOP PACKET.  THANK YOU.  HAVE A NICE DAY.)

Add a little paranoia about the record and captured data lengths.

svn path=/trunk/; revision=8883
2003-11-04 22:14:50 +00:00
Guy Harris 1cfad682cb The time in Observer files is in nanoseconds since midnight, January 1,
2000, 00:00:00 *local* time.  The amount to add to that is just the UNIX
time stamp value for that point in time; get it with "mktime()".

svn path=/trunk/; revision=8854
2003-11-01 03:38:10 +00:00
Guy Harris 1131dafe62 Temporarily get rid of the "struct tm" in "struct observer_time", and
get rid of the reference to its "tm_gmtoff" member - there are platforms
on which Ethereal runs that don't have "tm_gmtoff" in "struct tm".  If
the time stamp in the packets is nanoseconds since midnight 2001-01-01
*local* time, we'd need to compute the offset between that and midnight
2000-01-01 GMT, and adjust the time with that.

svn path=/trunk/; revision=8842
2003-10-31 08:06:25 +00:00
Guy Harris 0247fbeb15 From Scott Emberley: support for reading Network Instruments version 9
capture files.

svn path=/trunk/; revision=8840
2003-10-31 00:43:21 +00:00
Guy Harris 305afc4e97 The quantities in the hcidump header are little-endian, not big-endian.
svn path=/trunk/; revision=8831
2003-10-30 11:53:48 +00:00
Guy Harris 95c1f2f7c9 From Marcel Holtmann: support for reading Linux Bluez Bluetooth stack
"hcidump -w" traces.

Note that Jesper Peterson contributed support for reading Endace ERF
files.

svn path=/trunk/; revision=8824
2003-10-30 03:11:03 +00:00
Guy Harris b624dce63b Add a new WTAP_ENCAP_CHDLC_WITH_PHDR type, to distinguish Cisco HDLC
captures with packet direction information from captures without it.
Use them appropriately.

svn path=/trunk/; revision=8780
2003-10-25 07:17:28 +00:00
Guy Harris 4bd5126925 Move the version number checking for libpcap files, to see whether to
swap the "captured length" and "length" fields, to the open-file code;
store a tri-state (definitely swapped, definitely not swapped, maybe
swapped) value in the per-capture-file-format information for libpcap
format, and use that when processing packets.

svn path=/trunk/; revision=8774
2003-10-24 23:55:34 +00:00
Ronnie Sahlberg 7cb2dc0099 The capture tools for DGUX has swapped the included/original packet lengths of the frame header.
they specify the pcap version as 543.0

svn path=/trunk/; revision=8772
2003-10-24 10:52:04 +00:00
Guy Harris 02e1d2680a Give every Makefile.nmake file a "distclean" rule, and have "distclean"
recurse into subdirectories doing "nmake -f Makefile.nmake distclean".

Have "nmake -f Makefile.nmake clean" not remove stuff that "make clean"
doesn't remove (such as Flex/Bison output and config.h files) - and have
"nmake -f Makefile.nmake distclean" remove stuff that "make distclean"
removes, including "tethereal-tap-register.c" and
"ethereal-tap-register.c".

svn path=/trunk/; revision=8672
2003-10-10 21:31:53 +00:00
Jörg Mayer 391152faa5 Use #ifndef HAVE_UNISTD_H instead of #ifdef _WIN32
svn path=/trunk/; revision=8603
2003-10-03 21:12:49 +00:00
Guy Harris 6f1da2e1b2 From Graham Bloice: define YY_NO_UNISTD_H on Win32, so that if Flex was
a UNIX version generating code that, by default, assumes you have
<unistd.h> (as might be the case with recent versions of Cygwin, which I
assume *does* supply <unistd.h>), but you're building on a platform that
lacks <unistd.h> (e.g., building with MSVC++ or MinGW), you can still
compile.

svn path=/trunk/; revision=8602
2003-10-03 21:03:00 +00:00
Guy Harris 8f0aa18626 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=8578
2003-10-01 18:19:16 +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 aaa0e6d7e7 From packet steve: update to give the correct name for "file_access.c",
and add a discussion of how data_offset works.

svn path=/trunk/; revision=8535
2003-09-24 23:53:11 +00:00
Guy Harris 4bd548e034 From Jesper Peterson: add support for AAL5 records in ERF files,
treating them as PDUs with an AAL5 trailer.

svn path=/trunk/; revision=8493
2003-09-19 04:08:11 +00:00
Guy Harris 4f01e65223 Put in a note telling people how to add a new libpcap encapsulation
type, and telling them how it should *NOT* be done, i.e. you should ask
tcpdump-workers for a new DLT_ value, you should not just pick a value
on your own, and you should especially not reuse a value that's already
in use!

Put in comments about reserved values in the current CVS libpcap.

svn path=/trunk/; revision=8367
2003-09-04 06:40:45 +00:00
Guy Harris 982ece89cf From Jesper Peterson:
use WTAP_ENCAP_ATM_PDUS as the default encapsulation for ATM;

	don't use ULL constants, as not all C compilers that support
	gint64 support them, and as there's no need to make them ULL
	constants.

svn path=/trunk/; revision=8278
2003-08-26 23:07:43 +00:00
Guy Harris 4ecb7cb4f2 From Jesper Peterson: support for Endace ERF file format.
svn path=/trunk/; revision=8272
2003-08-26 07:10:39 +00:00
Guy Harris fb0480ae43 Use "file_access.c", not "file_io.c", as the latter is already in use in
a not-yet-ready-for-prime-time project of mine (fast random access to
gzipped files, plus an mechanism to allow support for other forms of
compression).

svn path=/trunk/; revision=8221
2003-08-23 08:34:12 +00:00
Guy Harris 995285fd9c Rename "wiretap/file.c" to "wiretap/file_io.c", as some tools, such as
the MS Visual Studio debugger, get confused by two files with the same
name being in a program's source, even though they're in different
directories.

svn path=/trunk/; revision=8208
2003-08-22 19:07:45 +00:00
Guy Harris 1ee1b5a582 Align the --with-pcap help message with other help messages.
svn path=/trunk/; revision=8203
2003-08-21 07:25:22 +00:00
Guy Harris 98909d9045 Clean up argument names.
svn path=/trunk/; revision=8097
2003-07-29 20:49:32 +00:00
Guy Harris 2a679c88f8 Use GLib's macros for converting from host byte order to little-endian.
svn path=/trunk/; revision=8096
2003-07-29 20:41:19 +00:00
Guy Harris 27022f52e4 Don't free "wdh->dump.opaque" in the close routine - "wtap_dump_close()"
does it for you.

"wdh->dump.opaque" should never be null, so unconditionally call
"lanalyzer_dump_header()".

svn path=/trunk/; revision=8095
2003-07-29 20:30:00 +00:00
Guy Harris cbd5c2a47d Use "guint16" and "guint32" for items in data records, rather than
"unsigned short", "unsigned int" (or "int", as the items appear to be
unsigned), or "unsigned long".

Convert data to and from the appropriate byte order.

Don't free the private data structure in the dumper's close routine -
"wtap_dump_close()" does that for you.

svn path=/trunk/; revision=8094
2003-07-29 20:26:34 +00:00
Guy Harris 2240c0668d From Thierry Martin: support for reading files from Accellent 5Views LAN
agents.

svn path=/trunk/; revision=8093
2003-07-29 19:42:01 +00:00
Gerald Combs 9d91efb9e2 Back out the changes made earlier.
svn path=/trunk/; revision=8075
2003-07-23 20:32:37 +00:00
Gerald Combs de1990a0ab Make "--enable-usr-local" disabled by default, as suggested by Joerg Mayer.
svn path=/trunk/; revision=8073
2003-07-23 18:00:15 +00:00
Guy Harris e3f7c2bb89 %yynowrap forces "yywrap()" to be a macro that returns 1, so there's no
need to define "ascendwrap()" to return 1 - "ascendwrap()" is no longer
used.

svn path=/trunk/; revision=7980
2003-07-08 02:11:09 +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 98e7c94dc1 Use the "rx_frm_len" field from the trace packet data record header,
rathe than the record length minus the record header length, as the
number of available (captured) bytes in the packet.  Check to make sure
that value isn't bigger than the record length minus the header length.

Only subtract the 4-byte FCS length from the purported length of the
packet on the wire if that would leave the on-the-wire length >= the
number of captured bytes, so that we can better handle capture files
from programs that produce LANalyzer-format captures where the
on-the-wire length *doesn't* include the FCS.

svn path=/trunk/; revision=7948
2003-06-30 00:41:33 +00:00
Guy Harris 9fa514388c GCC 3.3 noticed that checking whether the length of the slice is > 65535
is pointless, as it's a 16-bit unsigned quantity.  Remove those checks -
but note in a comment that WTAP_MAX_PACKET_SIZE must be at least 65535
(as there might well be link-layer types with packets at least that
large).

svn path=/trunk/; revision=7934
2003-06-25 17:35:17 +00:00
Guy Harris 8178db4980 Define GLIB_LIBS and GTK_LIBS variables in config.nmake (based on
variables the user configures - the user isn't expected to change
GLIB_LIBS or GTK_LIBS, and there's a comment nothing that users
shouldn't have to do so), which contain the appropriate libraries for
building stuff that requires only GLib, and stuff that required GTK+ and
GLib, respectively, and use those macros in the Makefile.nmake files.

svn path=/trunk/; revision=7885
2003-06-14 20:45:29 +00:00
Guy Harris 71424053cd Define GLIB_CFLAGS and GTK_CFLAGS variables in config.nmake (based on
variables the user configures - the user isn't expected to change
GLIB_CFLAGS or GTK_CFLAGS, and there's a comment nothing that users
shouldn't have to do so), which contain the appropriate "/I" flags for
building stuff that requires only GLib, and stuff that required GTK+ and
GLib, respectively, and use those macros in the Makefile.nmake files.

svn path=/trunk/; revision=7884
2003-06-14 20:36:04 +00:00
Guy Harris 10e7b49b11 From Graeme Hewson: fix the declaration of "open_routines[]".
svn path=/trunk/; revision=7753
2003-05-27 10:42:22 +00:00
Guy Harris fdb0e20f13 Make "vms_check_file_type()" seek back to the beginning of the line that
matched if it succeeds, so that it gets re-read when we read the capture
file - it's a line containing a time stamp for a packet, so we need to
re-read it to get that time stamp.

svn path=/trunk/; revision=7752
2003-05-27 10:14:06 +00:00
Guy Harris e634bd0856 From Martin Warnes: fix to check the "XXXtrace" part of the per-packet
line, not the "RCV packet" part, so that we recognize files even if they
don't have an "RCV packet" line in the first 200 lines.

svn path=/trunk/; revision=7699
2003-05-20 20:17:03 +00:00
Guy Harris f921aee54d From Martin Warnes: support for VMS UCX$TRACE output in wiretap.
svn path=/trunk/; revision=7692
2003-05-19 20:58:18 +00:00
Guy Harris 11a979dd4c Fix a typo.
svn path=/trunk/; revision=7681
2003-05-16 00:34:33 +00:00
Guy Harris 86f3c38c4a From Can Erkin Acar: OpenBSD is now using tcpdump.org-assigned DLT_
value for DLT_PFLOG, and that goes along with a change to the link-layer
header for DLT_PFLOG - support both the old and new values and format.

svn path=/trunk/; revision=7676
2003-05-15 07:14:46 +00:00
Guy Harris fe42cc9dd8 From Mark C. Brown:
Following fixes for nettl (HP-UX):

	1) Fixed 11.X timestamp issue
	      there is no difference in 10.X/11.X timestamps, so no
	      need to shift 11.X timestamps
	2) Fixed NS_LS_DRIVER trace record handling
	      now works rather than throwing "...network type that
	      Ethereal doesn't support" error
	3) Fixed handling of traces with sliced packets (nettl -m xx)
	      now uses correct packet and capture lengths
	4) Additional ethernet card support
	      now handles btlan[1,3-6],gelan,igelan,intl100 driver
	      trace records

svn path=/trunk/; revision=7642
2003-05-05 01:01:36 +00:00
Jörg Mayer 1032b043e8 Newer build tools generate the following warning:
Makefile.am:99: `YFLAGS' is a user variable, you should not override it;
Makefile.am:99: use `AM_YFLAGS' instead.

Fix it in the proposed way.

svn path=/trunk/; revision=7582
2003-04-27 09:16:36 +00:00
Guy Harris 7e4d87a0d0 Add a new README.developer file for wiretap; it's currently just some
stuff I sent out in a mail message to somebody asking how to add support
for a new file format, but hopefully it'll get improved by various
contributors over time (hint hint).

svn path=/trunk/; revision=7397
2003-04-02 20:21:45 +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 2fecf91a17 AIX's BPF, and thus its tcpdump, appears to use 24 as the link-layer
type for loopback devices; map it to DLT_NULL when reading libpcap files
with a major version of 2 and a minor version of 2, and when capturing
from an "loN" device on AIX.

svn path=/trunk/; revision=7361
2003-03-25 06:04:54 +00:00
Guy Harris ad8856029b WTAP_ENCAP_ENC was, in fact, intended for use for DLT_ENC, so just
rename WTAP_ENCAP_ENC0 to WTAP_ENCAP_ENC.

un-#if 0 out the code to handle the value 109 for DLT_ENC, as I've just
checked in support for DLT_ENC in tcpdump.org libpcap and tcpdump, which
maps DLT_ENC to 109 in the file header.

Give packet-enc.c an RCS ID.

svn path=/trunk/; revision=7323
2003-03-08 09:11:53 +00:00
Gerald Combs 0b94d9a228 From Markus Friedl:
Add support for the OpenBSD enc(4) encapsulating interface.  Add
  support for Ethernet over IP (RFC 3378).

Fold Markus' .h files into their respective .c files, add a define to
ipproto.h and use it.

svn path=/trunk/; revision=7310
2003-03-07 16:52:46 +00:00
Guy Harris 3cc1053182 A captured length bigger than the actual length makes no sense; clip the
captured length so it's <= the actual length.

svn path=/trunk/; revision=7268
2003-03-04 02:38:02 +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 4632490ab1 From Pavel Roskin:
Get rid of acconfig.h, as it's an archaism; put descriptions
	into AC_DEFINE instead.  That squelches some warnings from
	later versions of autoconf.

	Fix an unquoted call to AC_MSG_ERROR.

	Move the stuff to define HAVE_SOME_SNMP into configure.in.

svn path=/trunk/; revision=7203
2003-02-26 20:08:33 +00:00
Guy Harris 7aceda45b5 Sigh. It appears that atmsnoop might, at least for some packets, put 4
bytes of padding into the packet (possibly more, as if it's putting
extra stuff in the padding as Shomiti/Finisar Surveyor does, it might be
up to 7).  Fortunately, Surveyor puts lots of stuff into the padding, so
we'll crank up the "snoop vs. Surveyor" check to look for 4 or more
bytes.

svn path=/trunk/; revision=7167
2003-02-18 19:59:00 +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
Guy Harris 3f0e5dad19 Add support for writing Frame Relay files in NetXRay format 2.x.
svn path=/trunk/; revision=7048
2003-01-30 22:38:47 +00:00
Jörg Mayer 758685ca0d AC_ARG_ENABLE takes 4 argument: The 3rd specifies what to do in case a
configure option is given on the command line. The value of the arguement
is passwd in the enableval variable. The 4th argument tells what to do in
case no command line argument was given.
This causes --disable-gtk2 (which is the default) to behave differently
from the case when no option is given.
I do not really understand where the difference in the behaviour of the
generated codes comes from, but I definitely see a difference.

Fixed all occurrences where the 3rd arguement was empty.

svn path=/trunk/; revision=7044
2003-01-30 10:20:47 +00:00
Guy Harris 8e6518ea60 In the BSDs, ARCNET packets don't have an offset field between the
addresses and the protocol type, as supplied by BPF; on Linux, they *do*
have an offset field, as supplied by PF_PACKET sockets.  Add a new
WTAP_ENCAP_ARCNET_LINUX, with packets that include the offset field, and
don't dissect an offset in WTAP_ENCAP_ARCNET packets.

Map a libpcap link-layer type of 129 to WTAP_ENCAP_ARCNET_LINUX; that
value was recently assigned to Linux-style ARCNET.

Add some more ARCNET protocol IDs.

For most protocol IDs, dissect an ATA 878.2 fragmentation header; don't
do it for RFC 1051 IP and ARP, and Diagnose packets.  Set the length of
the ARCNET protocol tree item appropriately.

Dissect both the RFC 1051 and RFC 1201 styles of IP and ARP over ARCNET,
and dissect the RFC 1201 style of RARP as well.

svn path=/trunk/; revision=6981
2003-01-23 04:04:01 +00:00
Jörg Mayer 8adf7a08fd Check for pcap in before /usr/local and stop on first hit
svn path=/trunk/; revision=6962
2003-01-21 20:38:32 +00:00
Guy Harris eeb05c3b1c From Marc Milgram: e-mail address update.
svn path=/trunk/; revision=6936
2003-01-17 23:54:19 +00:00
Guy Harris 2955489887 We don't know what, in captures with a major version number of 3,
indicates the subtype of an "Internetwork analyzer" capture; we've seen
only one such capture, and it was a frame relay capture, so we just wire
it to frame relay for now.

svn path=/trunk/; revision=6923
2003-01-14 19:52:47 +00:00
Guy Harris 61e9a95dba If it doesn't begin with FF 00 it can't be LANE LE Control; if it's
LANE, claimed to be LE Control, but doesn't begin with FF 00, call it
802.3.

svn path=/trunk/; revision=6901
2003-01-11 05:54:52 +00:00
Guy Harris fabf144b83 Rename the "version" argument to "process_header_records()" "maj_vers",
as it's the major version number.

Try using the first word of "rsvd" to determine whether a capture is an
ISDN capture or not in version 1 captures.

Version 1 captures look as if they might also have a REC_HEADER2 record
- it's longer than the ones in version 4 and 5 captures, but it still
appears to have a network subtype in the 5th byte.

Get rid of the heuristic that checks for WTAP_ENCAP_ISDN by looking at
the packet data; if we fail to recognize an ISDN capture, we should look
for stuff in the headers to determine whether the capture is one or not.

svn path=/trunk/; revision=6894
2003-01-10 09:04:44 +00:00
Guy Harris fbec15f6f2 It looks as if a value of 0xfa in the second byte of a REC_HEADER2
record might indicate an ISDN capture; treat that as an indication that
a capture is an ISDN capture.

svn path=/trunk/; revision=6893
2003-01-10 05:53:00 +00:00
Guy Harris 50e696df81 The Sniffer file formats include a file to identify raw cells; export
that flag in the ATM pseudo-header, and use it to determine whether a
frame is a raw cell or a reassembled frame, rather than using the AAL,
as you can have raw AAL5 cells in a capture.

svn path=/trunk/; revision=6889
2003-01-10 04:04:42 +00:00
Guy Harris 7be2e513c5 The checksum in DOS ATM Sniffer files appears to be stored in big-endian
format.

svn path=/trunk/; revision=6885
2003-01-09 04:36:26 +00:00
Guy Harris a0c5cac89d It appears that a channel number of 0 means DTE->DCE, and a channel
number of 1 means DCE->DTE, in DOS Sniffer ATM captures.

svn path=/trunk/; revision=6881
2003-01-09 01:55:13 +00:00
Guy Harris 2b5eab973e It appears that ATM sniffer files with 4.x versions 4.95 and greater
have a bogus record length for type 4 records, but earlier 4.x versions,
and 5.x versions, don't.

svn path=/trunk/; revision=6880
2003-01-09 01:38:30 +00:00
Guy Harris 94800ef0fb From Chris Waters: support Tazmen Sniffer Protocol and DLT_TZSP captures
from network-based libpcaps that use that protocol.

svn path=/trunk/; revision=6875
2003-01-08 05:03:54 +00:00
Guy Harris 4ef5d24633 It appears that the first two bytes of "xxz" are, in fact, the actual
length of the packet, and the second two bytes are the captured length
of the packet.  The old "length" value appears to be the captured length
of the packet as well; perhaps it's to be interpreted as the number of
bytes of data following the packet header (just in case there's padding,
for example).

Treat "ATM/", as an encapsulation string, as RFC 1483 ATM.  (It may
actually be raw ATM, but the only capture I've seen had, in the parts I
saw, only RFC 1483 traffic LLC/SNAP traffic.)

There are 8 bytes in front of the LLC/SNAP header in ATM captures; skip
them, for now.  (Perhaps they're a pseudo-header, giving VPI/VCI
information and stuff such as that?  Or perhaps that's in the record
header?)

svn path=/trunk/; revision=6871
2003-01-07 08:41:23 +00:00
Guy Harris f8a7dc5ad3 PRI captures appear to be the ISDN captures with padding.
The Windows Sniffer does *not* appear to know the difference between
802.3 and 802.3 multicast LANE traffic.

svn path=/trunk/; revision=6870
2003-01-07 07:16:24 +00:00
Guy Harris fdedaea568 If the Windows Sniffer writes out one of its ATM capture files in DOS
Sniffer format, it doesn't distinguish between LE Control and LANE
encapsulated LAN frames, so we can't rely on the ATM subtype being
correct even when reading DOS Sniffer captures - we force it to
TRAF_ST_LANE_LE_CTRL for LANE frames that begin with 0xff 0x00.

Move the calls to "infer_pkt_encap()" into "fix_pseudo_header()".

svn path=/trunk/; revision=6869
2003-01-07 06:46:50 +00:00
Guy Harris 2639f7f9dc Use some fields in the per-packet header for ATM to get the AAL type
and traffic type.

svn path=/trunk/; revision=6868
2003-01-07 06:09:08 +00:00