Commit Graph

801 Commits

Author SHA1 Message Date
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
Guy Harris a2e3440370 Properly turn the raw ISDN channel number field into an actual channel
number.

Put in some commented-out code to deal with some end-of-packet crud in
some ISDN captures - not all ISDN captures have it, so we can't
unconditionally slice it out.

svn path=/trunk/; revision=6867
2003-01-07 03:52:59 +00:00
Guy Harris 553235d47d The direction flag for LAPB/X.25 and ISDN appears to be in the
bottommost bit of the 12th byte of "hdr.hdr_2_x.xxx".

svn path=/trunk/; revision=6866
2003-01-07 02:21:38 +00:00
Guy Harris 84bbc626d2 Update a comment.
svn path=/trunk/; revision=6865
2003-01-07 01:11:34 +00:00
Guy Harris a83be44e56 Properly turn the raw ISDN channel number field into an actual channel
number.

Put in some commented-out code to deal with some end-of-packet crud in
some ISDN captures - not all ISDN captures have it, so we can't
unconditionally slice it out.

svn path=/trunk/; revision=6863
2003-01-07 01:06:58 +00:00
Guy Harris db1246913e Cast "secs" to "double" before multiplying by 1000000, so that we don't
get an overflow if secs*1000000 doesn't fit in 31 bits.

svn path=/trunk/; revision=6858
2003-01-06 20:30:38 +00:00
Guy Harris 705bf9a6cb Don't interpret NET_HDLC as LAPB/X.25 - sometimes it's some other
HDLC-flavored encapsulation (or, at least, it was in at least one
capture).  Instead, treat it as WTAP_ENCAP_PER_PACKET, and infer the
packet type, as we do for NET_ROUTER.

For NET_ROUTER captures, if the ISDN channel number is zero, infer the
packet type from the contents, rather than wiring it to PPP - it might
be, for example, Cisco or Wellfleet HDLC.

Fix the check for Cisco HDLC to look for 0x0F 0x00 and 0x8F 0x00, as
0x0F, not 0x08, is the unicast address in Cisco HDLC.

When fixing the pseudo-header, fix it for WTAP_ENCAP_WFLEET_HDLC,
WTAP_ENCAP_CHDLC, and WTAP_ENCAP_PPP_WITH_PHDR, as well as for
WTAP_ENCAP_ISDN, as the three ones listed don't use x25.flags, they use
p2p.sent.

svn path=/trunk/; revision=6850
2003-01-06 00:03:43 +00:00
Guy Harris e56b77f4cd Add support for SDLC encapsulation in DOS Sniffer captures; that
includes adding an SDLC dissector.

svn path=/trunk/; revision=6848
2003-01-03 22:31:26 +00:00
Guy Harris deadb2896c Well, at least some version 5 captures have type 7 records, and they
appear to look like the type 7 records in version 4 captures.

Note that sometimes the subtype is misleading.

svn path=/trunk/; revision=6847
2003-01-03 20:42:52 +00:00
Guy Harris d0606b986a Well, it's not as simple as "version 5 internetwork analyzer captures
hide the subtype in the reserved field in the version number", alas....

svn path=/trunk/; revision=6845
2003-01-03 20:09:01 +00:00
Guy Harris 4750bf47a7 Add some more comments.
svn path=/trunk/; revision=6843
2003-01-03 08:00:51 +00:00
Guy Harris ae6cb2b4e3 Get rid of some bogus commented-out statements.
svn path=/trunk/; revision=6842
2003-01-03 07:54:01 +00:00
Guy Harris eaea31134c It appears there are, indeed, two fields in the "xxb" part of the file
header that specify the detailed capture type for WAN captures; use
those fields.

svn path=/trunk/; revision=6841
2003-01-03 07:51:26 +00:00
Guy Harris 0a5be3f18b Rename WTAP_ENCAP_ATM_SNIFFER to WTAP_ENCAP_ATM_PDUS, as it's not just
used for the DOS-based ATM Sniffer.  (That's not a great name, but I
couldn't think of a better one.)

Add a new WTAP_ENCAP_ATM_PDUS_UNTRUNCATED encapsulation type for capture
files where reassembled frames don't have trailers, such as the AAL5
trailer, chopped off.  That's what at least some versions of the
Windows-based ATM Sniffer appear to have.

Map the ATM capture file type for NetXRay captures to
WTAP_ENCAP_ATM_PDUS_UNTRUNCATED, and put in stuff to fill in what we've
reverse-engineered, so far, for the pseudo-header; there's more that
needs to be done on it, e.g. getting the channel, AAL type, and traffic
type (or inferring them if they're not in the packet header).

svn path=/trunk/; revision=6840
2003-01-03 06:45:45 +00:00
Guy Harris decd1f84d1 Add support for version 002.000, and note that there's probably
something hidden in the per-packet header for ATM captures that
specifies the traffic type (and stuff such as that).

svn path=/trunk/; revision=6839
2003-01-03 02:24:56 +00:00
Guy Harris 785413e7c0 Update some comments.
Make the "fs" and "flags" fields in type 6 records unsigned, as they are
in other per-frame records - they're probably the same set of flag bits.

svn path=/trunk/; revision=6814
2002-12-20 22:30:15 +00:00
Guy Harris 156254096a Add an item for Wellfleet HDLC.
svn path=/trunk/; revision=6813
2002-12-20 21:59:33 +00:00
Guy Harris 9284c8f86d Make "infer_pkt_encap()" take a pointer and length as arguments.
Update some comments.

svn path=/trunk/; revision=6812
2002-12-20 21:58:46 +00:00
Guy Harris 9a6a8177e4 Supply more information about "WAN/Synchronous" captures.
svn path=/trunk/; revision=6811
2002-12-20 21:23:02 +00:00
Richard Sharpe 13970cc2eb This adds the beginning of support for Wellfleet HDLC to ngsniffer.c as
well as Cisco HDLC support. It compiles OK, but I do not claim that it is
not borken.

I will have to add a small dissector that eats the first two bytes and then
calls the Ethernet dissector as well, to complete the work.

svn path=/trunk/; revision=6809
2002-12-20 05:40:52 +00:00
Olivier Abad b8c787a7ab - some radcom files seem to have a different magic key than the one we
use : 42:f9:02:34:12:66:22:88 instead of 42:d2:00:34:12:66:22:88
  We should accept both (perhaps bytes 2 and 3 are a version number ?)

- the code which looks for the "capture start time" is wrong.
  Apparently, we should look for the string "Active Time" in the file.
  The "frame_date" structure which contains the capture start time is
  found 32 bytes before this string.

svn path=/trunk/; revision=6794
2002-12-17 21:53:57 +00:00
Guy Harris 7280374f3d Add support for the new DLT_ value of 127, for the AVS WLAN header.
svn path=/trunk/; revision=6780
2002-12-11 22:45:24 +00:00
Guy Harris c3674ba31c Sigh. We really *do* have to check whether a capture is a snoop or
Surveyor capture, as there's one link-layer type that UNICOS/mp snoop
treats one way and Shomiti Surveyor treats another way.  The only way to
check that is to look at the first record to see how much padding it
has.

svn path=/trunk/; revision=6750
2002-12-05 22:33:11 +00:00
Guy Harris 4056129fef Add a "--with-extra-gcc-checks" option, which causes "-Wcast-qual
-Wcast-align" to be added to CFLAGS (except in Wiretap, where we already
do "-Wcast-qual").  We don't do them by default, as they produce some
warnings that aren't easy to eliminate; if we figure out how to
eliminate them on all platforms (or at least, on the platforms where you
*can't* eliminate them, reduce them to a low level), we can make those
options the default.

svn path=/trunk/; revision=6689
2002-11-28 04:21:31 +00:00
Guy Harris 08044b0409 Add "-Wcast-qual" to the list of "-W" flags, so we catch code that could
attempt to store through a const pointer.

svn path=/trunk/; revision=6680
2002-11-27 22:24:27 +00:00
Guy Harris a40e352b26 The "pd" argument to "wtap_process_pcap_packet()" is a const pointer;
when extracting the ATM pseudo-header from the data it points to, cast
it to a "const struct sunatm_hdr *".

svn path=/trunk/; revision=6679
2002-11-27 22:23:34 +00:00
Guy Harris 50256af1c8 The arguments to the "pntoh" and "pletoh" macros could be const
pointers, so cast them to "const guint8 *".

svn path=/trunk/; revision=6678
2002-11-27 22:21:41 +00:00
Guy Harris 2fed18defb AIX's tcpdump has the same annoying habit as AIX's iptrace of putting 3
bytes of padding in front of FDDI frames; strip it off.

svn path=/trunk/; revision=6647
2002-11-16 20:20:30 +00:00
Guy Harris bb240540bd From Brian Ginsbach: upport for additional snoop file encapsulations in
UNICOS/mp.

svn path=/trunk/; revision=6621
2002-11-13 21:49:58 +00:00
Guy Harris f37932ff64 Update comments to reflect some information inferred from the Sniffer
documentation.

svn path=/trunk/; revision=6605
2002-11-10 20:52:56 +00:00
Guy Harris cc293e051d It appears that 0x80 in the fs field of an ISDN packet means "network to
user", not "user to network" (SETUP messages are generally sent *to* the
network).

svn path=/trunk/; revision=6592
2002-11-09 08:07:19 +00:00
Guy Harris 70c5b343bf Attempt to handle REC_HEADER2 records in major version 2 DOS Sniffer
captures.

svn path=/trunk/; revision=6591
2002-11-09 07:31:17 +00:00
Guy Harris 8ee4a65f76 From Solomon Peachy: support for new "wlancap" 802.11 extra-information
header.

Add overflow checks to "BYTES_ARE_IN_FRAME()", and cast all arguments to
unsigned values (negative values should never be passed) to squelch
compiler warnings.

svn path=/trunk/; revision=6567
2002-11-06 21:49:34 +00:00
Guy Harris a3cbe709a0 Handle the 3 bytes of padding before the FDDI frame data in iptrace
captures.

Use #defines rather than magic numbers for various header sizes, and put
in a comment explaining the header formats.

svn path=/trunk/; revision=6545
2002-11-01 20:43:11 +00:00
Guy Harris e601f03448 Fix up the handling of WAN captures somewhat, based on looking at a
bunch of those captures.

svn path=/trunk/; revision=6536
2002-11-01 08:18:36 +00:00
Guy Harris f0a7b04a05 Convert the "maj_vers" field of a REC_VERS record to host byte order
before passing it to "skip_header_records()".

svn path=/trunk/; revision=6530
2002-11-01 01:49:39 +00:00
Guy Harris 56f644145e Discard the WTAP_ENCAP_LAPD encapsulation type in favor of a
WTAP_ENCAP_ISDN encapsulation type, which includes a pseudo-header
giving the direction (user-to-network or network-to-user) and the
channel number.

Add a new circuit type, using the ISDN channel number as the circuit ID.

Add an ISDN dissector to put the direction and channel number into the
protocol tree and to call the appropriate dissector for the payload
based on the channel (LAPD for the D channel; V.120, PPP, or data for B
channels, based on some heuristics).

svn path=/trunk/; revision=6521
2002-10-31 07:12:42 +00:00
Guy Harris f806f64b71 Some fields that are treated as 16-bit or 8-bit fields followed by
unknown bytes might actually be 32-bit fields.

The field after the upper 32 bits of the time stamp of the capture start
appears to be the speed of the network, in bits/second.

Put in a field for the rest of the file header, as a bunch of 32-bit
values (most fields are 32 bits, and all of them might be, in that
header), for use when reverse-engineering.

At least in version 002.x of NetXRay-format captures, WAN captures might
be ISDN captures; treat all WAN version 002.x captures as ISDN captures
for now, until we see some captures where that's wrong (and thus stand a
chance of figuring out where in the file header it indicates what type
of capture it is).

svn path=/trunk/; revision=6519
2002-10-29 06:12:35 +00:00
Guy Harris 671ba8b6a6 Put in a comment noting that not *all* captures with a network type of 3
look like Ethernet captures.

svn path=/trunk/; revision=6474
2002-10-22 18:48:15 +00:00
Guy Harris 2a54cd2a76 Add a Wiretap encapsulation type for RFC 2625 IP-over-Fibre Channel, and
map libpcap's DLT_IP_OVER_FC to it.

svn path=/trunk/; revision=6473
2002-10-22 09:11:13 +00:00
Guy Harris d54e50d6a2 From Jason House: include <winsock2.h> early in "wtap-int.h" on Win32
builds with zlib - "zlib.h", alas, includes <winsock.h>, and you can't
include <winsock.h> before including <winsock2.h> (at least you can
include <winsock2.h> before including <winsock.h>; thank heaven for
small favors).

svn path=/trunk/; revision=6427
2002-10-15 05:38:01 +00:00
Guy Harris c0baecc0bb "tm_isdst" must be set to -1 before "mktime()" is called, so that
"mktime()" bases the DST-vs-non-DST decision on the date/time and on the
current time zone.

svn path=/trunk/; revision=6406
2002-10-10 21:47:12 +00:00
Jörg Mayer 110f9caebc Support for both old and brand new libtool versions
svn path=/trunk/; revision=6389
2002-10-09 22:58:53 +00:00
Jörg Mayer 6c895e2d26 Change by Didier Gautheron to make automake 1.7 work.
svn path=/trunk/; revision=6372
2002-10-06 18:18:45 +00:00
Guy Harris 7a973edb96 Update some comments.
svn path=/trunk/; revision=6176
2002-09-04 19:29:59 +00:00
Olivier Abad ca3fcebd1c Update my email.
svn path=/trunk/; revision=6166
2002-09-01 14:30:34 +00:00
Jörg Mayer 64b6acac6d Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6115
2002-08-28 20:30:45 +00:00
Jörg Mayer 8874c97191 Add gtk2/glib2 handling to configure. Use --enable-gtk2 to use
gtk2 instead of gtk and glib2 instead of glib.

Right now, --enable-gtk2 will fail during compile unless
acompanied by --disable-ethereal, as ethereal does not yet
support gtk2 (but does support glib2 alone).

svn path=/trunk/; revision=6107
2002-08-28 00:37:31 +00:00
Guy Harris c58356d62a Updates from Motonori Shindo.
svn path=/trunk/; revision=6000
2002-08-16 00:41:39 +00:00
Jörg Mayer e8a4485af4 Sort .cvsignore alphabetically and add libtool where missing.
svn path=/trunk/; revision=5993
2002-08-14 14:45:54 +00:00
Jörg Mayer cd5eb3cb8e Replace usage of AC_PROG_RANLIB which is deprecated for newer versions
of autoconf by AM_PROG_LIBTOOL

svn path=/trunk/; revision=5992
2002-08-14 14:42:42 +00:00
Guy Harris 77bb2477ba Get rid of the "vpi" and "vci" arguments to "atm_guess_traffic_type()",
have it get that information from the pseudo-header instead, and set the
VPI and VCI fields in the pseudo-header before calling it.

Don't call it for non-ATM NetMon captures.

svn path=/trunk/; revision=5982
2002-08-13 03:32:57 +00:00
Guy Harris 8616a33765 Use "atm_guess_traffic_type()" to guess the ATM traffic type for ATM
NetMon captures.

svn path=/trunk/; revision=5981
2002-08-13 03:26:30 +00:00
Guy Harris 1c7b05f665 Properly set the LANE traffic type.
svn path=/trunk/; revision=5967
2002-08-07 06:59:49 +00:00
Guy Harris 20557c1fb7 From Anand V. Narwani: add an entry for the DOCSIS encapsulation to the
Wiretap table of encapsuations.

svn path=/trunk/; revision=5955
2002-08-06 05:40:47 +00:00
Guy Harris dc3ea0605d Fix the declaration of "empty_line()" to match the definition.
svn path=/trunk/; revision=5954
2002-08-06 01:00:07 +00:00
Guy Harris ee623d5b73 Make the argument to "empty_line()" a "const guchar *", so we don't have
to worry about characters with the 8th bit set being sign-extended.

svn path=/trunk/; revision=5953
2002-08-06 00:59:15 +00:00
Jörg Mayer db0d014224 Use <zlib.h> instead of "zlib.h"
svn path=/trunk/; revision=5926
2002-07-31 22:52:38 +00:00
Jörg Mayer bc82e18843 Add conditional include of winsock2.h again, so compilation with MSVC++
will work again without complaints.

svn path=/trunk/; revision=5925
2002-07-31 22:41:34 +00:00
Guy Harris 5d929e0e8f From Motonori Shindo: support for reading CoSine L2 debug output.
svn path=/trunk/; revision=5922
2002-07-31 19:27:57 +00:00
Guy Harris 6e21561be8 From Joerg Mayer:
All files:
  - Replace types from sys/types.h by those from glib.h
  - Replace ntoh family of macros from netinet/in.h and winsock2.h
    by g_ntoh family from glib.h
  - Remove now unneeded includes of sys/types.h, netinet/in.h and
    winsock2.h
wtap.h
  Move includes to the top

svn path=/trunk/; revision=5909
2002-07-29 06:09:59 +00:00
Guy Harris c10a2f283d Don't allocate structures to remember how to re-access a packet's data,
or the array to hold pointers to those structures, if we're only reading
the file sequentially.

svn path=/trunk/; revision=5885
2002-07-16 09:41:32 +00:00
Guy Harris 44d19627ef From Graeme Hewson:
Allow "-" as the output file name in Wiretap, referring to the
	standard error.

	Optimize the capture loop.

Fix some of the error-message printing code in Ethereal and Tethereal.

Have Wiretap check whether it can seek on a file descriptor, and pass
the results of that test to the file-type-specific "open for output"
routine.  Have the "open for output" routines for files where we need to
seek when writing the file return an error if seeks don't work.

svn path=/trunk/; revision=5884
2002-07-16 07:15:09 +00:00
Guy Harris 6f9a78cc79 Clean up the setting of "id_offset" and "sd_offset"; this fixes a bug in
handling the first few packets in a file.

svn path=/trunk/; revision=5875
2002-07-15 09:50:02 +00:00
Guy Harris 2537158d48 Redo the way random access is handled. Save, for each packet, the
offset of the beginning of the first record containing data from that
packet, and the offset from the first byte of data in that record of the
first byte of data from that packet; to read a given packet, seek to the
offset of the first record, and keep processing packets until we find
one with the right direction.

This fixes a problem where it wasn't correctly reading the packet, when
doing random access, in cases where you have a sequence of records that
stop in the middle of a packet.

svn path=/trunk/; revision=5873
2002-07-15 08:45:32 +00:00
Guy Harris 3dc1693e97 Clarify the octet-stuffed framing code, by adding comments and by using
hex values rather than characters in a switch statement.

svn path=/trunk/; revision=5869
2002-07-14 10:59:38 +00:00
Guy Harris 8a9b35cb5e From Anand V. Narwani:
DOCSIS support, including support for "Ethernet" captures where
	    the raw frame is a DOCSIS frame rather than an Ethernet
	    frame (some Cisco cable-modem head-end gear can send out a
	    trace of all traffic on an Ethernet, but what it sends are
	    the raw bytes of DOCSIS frames, not Ethernet frames)

Get rid of second AUTHORS entry for Devin Heitmueller, merging its item
into the older entry.

Clean up the order of some lists of plugin items.

svn path=/trunk/; revision=5861
2002-07-12 22:52:43 +00:00
Guy Harris 78b3b038e1 From Nix:
Don't add "-I/usr/include" to CFLAGS or CPPFLAGS; GCC 3.1 warns
	about it, and it's not necessary.

	Expand the plugin directory path used for installation at
	installation time, rather than configuration time, so the user
	can reset "prefix" at installation time.

svn path=/trunk/; revision=5828
2002-07-06 20:40:50 +00:00
Guy Harris 9745ed6988 From Markus Steinmann: support for writing LANalyzer files.
svn path=/trunk/; revision=5771
2002-06-27 22:46:48 +00:00
Guy Harris 73ef5a2753 WinPcap 2.3's <pcap.h> includes <packet32.h>, and WinPcap 2.3's
<packet32.h> includes <winsock2.h>; we include that rather than
<winsock.h>, to avoid errors due to conflicting declarations in
<winsock.h> and <winsock2.h>.

svn path=/trunk/; revision=5742
2002-06-23 10:32:36 +00:00
Guy Harris 5e42823dc0 Move the entries to map between platform-dependent libpcap link-layer
types and Wiretap encapsulations after the entries to map between
platform-independent libpcap link-layer types and those Wiretap
encapsulations, so that, when writing a libpcap-format file, we choose
the platform-independent link-layer types.

svn path=/trunk/; revision=5668
2002-06-13 11:03:23 +00:00
Guy Harris 63ae5638e1 Add /I$(PCAP_DIR)/include to the list of directories in which to look
for header files, so that we find "pcap.h".

svn path=/trunk/; revision=5667
2002-06-13 10:39:29 +00:00
Guy Harris 5c93900204 Export the new wtap_process_pcap_packet routine.
svn path=/trunk/; revision=5662
2002-06-13 06:50:41 +00:00
Gilbert Ramirez 87e011637c Add #define HAVE_PCAP_H 1 to config.h.win32.
In libpcap.c, move wtap_pcap_encap_to_wtap_encap before libpcap_open
so that if HAVE_PCAP_H is not true, the file will still compile.

svn path=/trunk/; revision=5660
2002-06-10 15:45:30 +00:00
Guy Harris c2b438ddfa Add a Wiretap routine to process packets captured via libpcap, possibly
extracting a pseudo-header, for the use of SunATM captures.

Add support for SunATM capture.

svn path=/trunk/; revision=5652
2002-06-07 21:11:24 +00:00
Guy Harris 1b72ef68e6 Add a new error for attempts to open a pipe or FIFO for random access.
Have "wtap_open_offline()", if asked to open a FIFO, return that error
if it was asked to open the file for random access.

svn path=/trunk/; revision=5643
2002-06-07 07:47:58 +00:00
Guy Harris 2aad75bb82 Graeme Hewson noted that zlib has a bug wherein "gzseek()" doesn't set
the internal z_err value for the stream if an "fseek()" call it makes
fails, so that if "gzerror()" is subsequently called, it returns Z_OK
rather than an error.

To work around this, we pass "file_seek()" an "int *err", and have the
with-zlib version of "file_seek()" check, if "gzseek()" fails, whether
the return value of "file_error()" is 0 and, if so, have it return
"errno" instead.

svn path=/trunk/; revision=5642
2002-06-07 07:27:35 +00:00
Guy Harris 199aaacbb7 BSD/OS Frame Relay packets just begin with the Frame Relay header, so
they are, in fact, WTAP_ENCAP_FRELAY.  Support 11 as WTAP_ENCAP_FRELAY
if DLT_FR is defined and is equal to 11, and support 107 as
WTAP_ENCAP_FRELAY unconditionally.

Get rid of a comment indicating that 105 isn't used - it's been
supported as DLT_IEEE802_11 for a while.

svn path=/trunk/; revision=5640
2002-06-07 04:48:36 +00:00
Guy Harris 7acc6a8e1a Use "phtons()", not "htons()", just as we use "pntohs()" rather than
"ntohs()".

svn path=/trunk/; revision=5636
2002-06-06 18:58:12 +00:00
Guy Harris bb778e86a7 Support the Solaris+SunATM libpcap capture file type (not yet checked
into libpcap or tcpdump, but the LINKTYPE_ number is reserved for that
purpose).

svn path=/trunk/; revision=5633
2002-06-06 09:18:28 +00:00
Guy Harris 290fc65130 The "sequential_close" routine for a capture file type, if it has one,
is always called before the "close" routine is called, so the "close"
routine doesn't need to free anything that's freed by the
"sequential_close" routine.

svn path=/trunk/; revision=5619
2002-06-04 21:56:45 +00:00
Guy Harris 15a5bdca30 The frame table isn't needed once we've made a sequential pass through
the packets, as the offsets of the frames have been saved by our caller
(because they need them to pass to the random-read routine); add a
sequential_close routine for Netmon files and free up the frame table in
that routine.

svn path=/trunk/; revision=5618
2002-06-04 21:55:38 +00:00
Guy Harris 7d72c3c429 Check for EtherPeek files before checking for pppdump files; the
EtherPeek heuristic is a bit stronger, and there's at least one
EtherPeek capture that gets misidentified as a pppdump capture if you
check for pppdump captures first.

svn path=/trunk/; revision=5585
2002-05-29 02:19:49 +00:00
Guy Harris 2e936ea423 Fail somewhat more gracefully when confronted with a bad file.
svn path=/trunk/; revision=5584
2002-05-29 02:11:57 +00:00
Guy Harris 586e97727f Add support for old NetXRay format.
svn path=/trunk/; revision=5576
2002-05-28 02:39:15 +00:00
Guy Harris 31fe776a02 Get rid of an unused variable.
svn path=/trunk/; revision=5571
2002-05-26 21:32:39 +00:00
Guy Harris 85c7401856 Set the LANE subtype in the "seek and read" routine.
svn path=/trunk/; revision=5529
2002-05-23 08:17:31 +00:00
Guy Harris 93be885871 The old URL for the LANalyzer file format is no longer valid; replace it
with one that's currently valid.

svn path=/trunk/; revision=5527
2002-05-23 06:34:10 +00:00
Guy Harris 7da9451781 Capture file formats that can be written need a "short name" to let you
specify them on the command line of Tethereal/editcap/etc. (and to keep
those programs from dropping core when enumerating the names); now that
we can write Windows Sniffer 2.00x-format files, give them a short name.

svn path=/trunk/; revision=5524
2002-05-22 22:57:54 +00:00
Ronnie Sahlberg d1fa53c605 Updated NS_LS_DRIVER to work with both pre-HPUX11 and HPUX11.
Added support for NS_LS_TCP, NS_LS_UDP, NS_LS_LOOPBACK, NS_LS_ICMP and
unnamed subsystem 0xb9 (which contains ethernet headers in my captures frames).
However, NS_LS_ICMP will not be dissected since we dont have a
RAW_ICMP wiretap encapsulation type.
Updated decoding of usec timestamp for HPUX11 since HPUX11 has 0.1us
resolution for the scalar in this field.

YMMV but all these ones works for me from nettl traces from HPUX11.

svn path=/trunk/; revision=5523
2002-05-22 10:53:17 +00:00
Ronnie Sahlberg bd351e3709 Added support for HPUX11 NETTL captures for the NS_LS_DRIVER type.
It works for such captures containing 100baseT captures. It may explode on
other link types.

svn path=/trunk/; revision=5496
2002-05-17 09:53:20 +00:00
Gilbert Ramirez 41cc7f0707 Merge the work in Novell_NCP_branch into the mainline code.
A little work still needs to be done on the new NCP dissector -- make
some of the COL_INFO texts more useful, handle a Unicode issue, and
modify some of the cases that use "request conditions".
But the NCP dissector as it stands is very usable now.

Note: I didn't merge in the PROTO_LENGTH_UNTIL_END macro... I wanted
to think about the various possible macros and review an email conversation
I had with Guy on the subject.

svn path=/trunk/; revision=5432
2002-05-09 23:50:34 +00:00
Guy Harris 4f82062233 From Joerg Mayer:
autoconf 2.53 creates directories named autom4te.cache
        Add them to .cvsignore

svn path=/trunk/; revision=5419
2002-05-08 22:24:03 +00:00
Guy Harris d471f94388 Traffic with a traffic type of 0x06 is Signalling AAL traffic, including
non-Q.2931 SSCOP traffic; change comments to reflect that.

svn path=/trunk/; revision=5411
2002-05-07 06:25:30 +00:00
Guy Harris 82f364ab1a Fix capture-file-specific "close output" routines to check whether the
"err" argument is null and return an error code through that argument
only if it isn't, to match what "wtap_dump_close()", which calls those
routines, does.

Put the NetXRay dump routines in order by version number.

svn path=/trunk/; revision=5385
2002-05-04 10:00:18 +00:00
Guy Harris 105efda404 Move the code to guess the traffic type based on the packet contents
into Wiretap, so that if you read a frame from Wiretap you have what
traffic type information could be gleaned from the information in the
capture file, and can write the frame out to a capture file where the
file contains some or all of that information without having to
determine it outside of Wiretap.

svn path=/trunk/; revision=5314
2002-04-30 18:58:16 +00:00
Guy Harris b0f59c0ce7 Support writing Sun atmsnoop files.
Map MARS to TRAF_UNKNOWN, not TRAF_ILMI.

Don't support writing WTAP_ENCAP_NULL files.

svn path=/trunk/; revision=5304
2002-04-30 09:23:29 +00:00
Guy Harris 329b59c858 Uniformly use "sizeof (struct netmon_atm_hdr)" for the size of Network
Monitor's ATM pseudo-header.

Fix a message.

svn path=/trunk/; revision=5303
2002-04-30 09:21:41 +00:00
Guy Harris ecb2a3939e Replace the "ngsniffer_atm" with an "atm" pseudo-header, which isn't
just an image of the ATM Sniffer data.  This means that Ethereal doesn't
have to know any ATM Sniffer-specific details (that's all hidden in
Wiretap), and allows us to add to that pseudo-header fields, traffic
types, etc. unknown to ATM Sniffers.

Have Wiretap map VPI 0/VCI 5 to the signalling AAL - for some capture
files, this might not be necessary, as they may mark all signalling
traffic as such, but, on other platforms, we don't know the AAL, so we
assume AAL5 except for 0/5 traffic.  Doing it in Wiretap lets us hide
those details from Ethereal (and lets Ethereal interpret 0/5 traffic as
non-signalling traffic, in case that happens to be what it is).

We may know that traffic is LANE, but not whether it's LE Control or
emulated 802.3/802.5; handle that case.

svn path=/trunk/; revision=5302
2002-04-30 08:48:27 +00:00
Guy Harris d415468153 The first byte of the frame header in atmsnoop does, in fact, contain an
indication of the type of traffic; use it.

svn path=/trunk/; revision=5301
2002-04-30 06:04:33 +00:00
Guy Harris 81567fd039 Cast the sum of "ngsniffer->rand.nextout" and "delta" to "size_t" before
comparing with the "size_t" value "ngsniffer->rand.nbytes", rather than
just casting "ngsniffer->rand.nextout" to "unsigned" - if "unsigned" is
shorter than "long", the latter doesn't do what you want.

svn path=/trunk/; revision=5252
2002-04-25 22:05:39 +00:00
Guy Harris 5fbabf3844 Add "stamp-h1", for automake 1.6.1, as per Joerg Mayer's suggestion.
svn path=/trunk/; revision=5236
2002-04-24 07:40:37 +00:00
Guy Harris ea17f40455 Initial support for writing NetXRay 2.x (Windows Sniffer) format
captures, from Olivier Abad.

svn path=/trunk/; revision=5202
2002-04-18 21:35:57 +00:00
Guy Harris bf7e4ce909 Move the definition of the FROM_DCE bit in the "flags" field of a
"struct x25_phdr" to "wiretap/wtap.h".

Have two X.25 dissectors, one of which assumes that there's a "struct
x25_phdr" pseudo-header and one of which doesn't; the former uses the
information in that pseudo-header to determine whether the packet is
DTE->DCE or DCE->DTE, and the latter assumes it has no clue whether the
packet is DTE->DCE or DCE->TDE.  Use the former one in the LAPB
dissector, and the latter one in the XOT dissector and in the LLC
dissector table.

In the X.25-over-TCP dissector, handle multiple X.25 packets per TCP
segment, and handle X.25 packets split across TCP segments.

svn path=/trunk/; revision=5134
2002-04-09 08:15:04 +00:00
Guy Harris 1f4dcf8319 Note the AiroPeek support in the message for the file type.
svn path=/trunk/; revision=5126
2002-04-08 17:42:40 +00:00
Guy Harris 8b9f8e4f3b The length passed into "seek_read" routines is the length supplied by
the "read" routine, which means it's already had any end-of-frame
padding/FCS removed; we don't need to remove it in the "seek_read"
routine.

svn path=/trunk/; revision=5124
2002-04-08 10:01:26 +00:00
Guy Harris b2c46086c3 Use WTAP_ENCAP_IEEE_802_11_WITH_RADIO for AiroPeek files, rather than
having a special encapsulation type for AiroPeek files.

svn path=/trunk/; revision=5123
2002-04-08 09:44:42 +00:00
Guy Harris 939b3c8e0a Add an encapsulation type for "802.11 with radio information"; that type
returns radio information such as signal strength, channel, and data
rate in a pseudo-header.  Add that pseudo-header.

Use the "802.11 with radio information" encapsulation type for Wireless
Sniffer files; extract the radio information from where it appears to be
in the header.

Add dissector code for that encapsulation type.

Fix an error in the code to put radio information into the AiroPeek
tree.

Make the "wrapped" flag for NetXRay/Windows Sniffer captures a
"gboolean".

svn path=/trunk/; revision=5122
2002-04-08 09:09:49 +00:00
Guy Harris 34ab745db0 Yes, that stuff really *does* appear to be just padding. Go figure.
svn path=/trunk/; revision=5119
2002-04-08 02:11:24 +00:00
Guy Harris 06adbfc556 Replace "--enable-zlib" with "--with-zlib", and have it take an optional
"=DIR" argument to specify the directory in subdirectories of which
zlib's headers and libraries can be found.

svn path=/trunk/; revision=5115
2002-04-08 01:34:39 +00:00
Guy Harris 5bb4bf06a9 Gerald says the padding has values that don't look like FCSes; note that
in the comment.

svn path=/trunk/; revision=5108
2002-04-07 21:44:55 +00:00
Guy Harris ae54ef681c Make the end-of-packet padding a per-capture-file property.
Read in the entire packet, including the padding, and just tell our
caller about the non-padding part; that avoids doing a "file_seek()"
("fseek()"s are inefficient on some platforms, as they flush the
standard I/O buffers and do an "lseek()"), and would also let us supply
the padding to the caller if it turns out it's an FCS rather than
padding.

svn path=/trunk/; revision=5107
2002-04-07 21:29:01 +00:00
Gerald Combs f0e2b1a83c Add support for Sniffer 4.6 wireless captures.
svn path=/trunk/; revision=5106
2002-04-07 19:10:10 +00:00
Guy Harris 952a4960f1 From Marc Milgram: properly handle fragmented packets.
svn path=/trunk/; revision=5018
2002-03-25 21:15:54 +00:00
Guy Harris 7d77975a14 Sigh. Tcpdump cannot handle capture files with a snapshot length of 0,
as BPF filters return either 0 if they fail or the snapshot length if
they succeed, and a snapshot length of 0 means success is
indistinguishable from failure and the filter expression would reject
all packets.

Now that a snapshot length of 0, inside Ethereal, means "snapshot length
unknown", we have to, when opening a libpcap file for output, make the
snapshot length some non-zero value.  We make it WTAP_MAX_PACKET_SIZE,
in case some program uses the snapshot length as a buffer size.  (That
doesn't help if there are packets with more than 65535 bytes of data; if
there are, we'd need to raise WTAP_MAX_PACKET_SIZE just to make those
files readable in Ethereal in any case.)

svn path=/trunk/; revision=4905
2002-03-09 23:07:26 +00:00
Guy Harris 828df9d18f Fix a comment.
svn path=/trunk/; revision=4899
2002-03-07 21:46:06 +00:00
Guy Harris ab0302ea1b Fix a typo - IFT_ISO88025 is 9, not 8.
svn path=/trunk/; revision=4898
2002-03-07 21:31:12 +00:00
Guy Harris 0070f850df Bug fix from Marc Milgram: occasionally the VMS parser would read off
the end of string, and find some old data that looked useful, but was
bogus for the frame.

svn path=/trunk/; revision=4897
2002-03-07 21:08:33 +00:00
Guy Harris b5e9cef2bf Make "wtap_seek_read()" return TRUE on success and FALSE on error, like
"wtap_read()".

Add some additional error checks to the Sniffer file reader.

svn path=/trunk/; revision=4875
2002-03-05 08:40:27 +00:00
Guy Harris e300f4db52 Have "wtap_seek_read()" return 0 on success and -1 on failure, and take
an "err" argument that points to an "int" into which to put an error
code if it fails.

Check for errors in one call to it, and note that we should do so in
other places.

In the "wtap_seek_read()" call in the TCP graphing code, don't overwrite
"cfile.pseudo_header", and make the buffer into which we read the data
WTAP_MAX_PACKET_SIZE bytes, as it should be.

In some of the file readers for text files, check for errors from the
"parse the record header" and "parse the hex dump" routines when reading
sequentially.

In "csids_seek_read()", fix some calls to "file_error()" to check the
error on the random stream (that being what we're reading).

svn path=/trunk/; revision=4874
2002-03-05 05:58:41 +00:00
Guy Harris d54bd0bd6b Check for errors in seeks, "tell"s, and "stat()"s/"fstat()"s.
For file types where we allocate private data, add "close" routines
where they were missing, to free the private data.  Also fix up the code
to clean up after some errors by freeing private data where that wasn't
being done.

Get rid of unused arguments to "wtap_dump_open_finish()".

Fix indentation.

svn path=/trunk/; revision=4857
2002-03-04 00:25:35 +00:00
Guy Harris 761ae95b19 From Joerg Mayer: get rid of "-Wno-unused" flag in some configure
scripts, and check in changes to add _U_ to some unused arguments (some
other should perhaps be used, so we leave the _U_ out so that the
warnings serve as a reminder to check those).

svn path=/trunk/; revision=4847
2002-03-02 20:41:08 +00:00
Guy Harris b4971b39bf From Joerg Mayer:
In the "configure.in" files, add

		-D_U_="__attribute__((unused))"

	to CFLAGS if we're using GCC, and add

		-D_U_=""

	otherwise, so _U_ can be used to mark arguments as unused.

Add -D_U_="" arguments to the Makefile.nmake files as well, so _U_ works
with Microsoft Visual C++ as well.

Add comments and RCS IDs to the Makefile.nmake files that don't already
have them.

svn path=/trunk/; revision=4824
2002-02-27 09:42:52 +00:00
Guy Harris cbf5c537c4 From Joerg Mayer: remove unused variables and declarations of
non-existent functions.

Remove the "filetype" argument from the "can_write_encap" functions for
particular capture file types - the argument value is implicit, in that
the routine being called is the routine for that particular file type.

svn path=/trunk/; revision=4823
2002-02-27 08:57:25 +00:00
Guy Harris 3e39a2b0f2 Put in a missing "break;" statement. (Testing the untested AiroPeek
support revealed that I'd left it out; putting it back made it work.)

svn path=/trunk/; revision=4740
2002-02-15 11:35:13 +00:00
Guy Harris 89a4acb438 Have Wiretap set the snapshot length to 0 if it can't be derived from
reading the capture file.  Have callers of "wtap_snapshot_length()"
treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so
that, when writing a capture file in a format that *does* store the
snapshot length, we can at least put *something* in the file).

If we don't know the snapshot length of the current capture file, don't
display a value in the summary window.

Don't use "cfile.snap" as the snapshot length option when capturing -
doing so causes Ethereal to default, when capturing, to the snapshot
length of the last capture file that you read in, rather than to the
snapshot length of the last capture you did (or the initial default of
"no snapshot length").

Redo the "Capture Options" dialog box to group options into sections
with frames around them, and add units to the snapshot length, maximum
file size, and capture duration options, as per a suggestion by Ulf
Lamping.  Also add units to the capture count option.

Make the snapshot length, capture count, maximum file size, and capture
duration options into a combination of a check box and a spin button.
If the check box is not checked, the limit in question is inactive
(snapshot length of 65535, no max packet count, no max file size, no max
capture duration); if it's checked, the spinbox specifies the limit.
Default all of the check boxes to "not checked" and all of the spin
boxes to small values.

Use "gtk_toggle_button_get_active()" rather than directly fetching the
state of a check box.

svn path=/trunk/; revision=4709
2002-02-08 10:07:41 +00:00
Guy Harris f9c109a239 Support in Wiretap for DLT_HHDLC, from Tomas Kukosa.
svn path=/trunk/; revision=4707
2002-02-07 20:41:28 +00:00
Guy Harris 23d1a63f39 zlib 1.0.8 - the version that comes with X11 - does have "gzseek()",
even if it doesn't have "gzgets()", so one might think we could use it
by using our own replacement for "gzgets()".

One would be wrong to think so, however, as the "gzseek()" it has
doesn't actually work when reading uncompressed files.

zlib 1.0.9 has "gzgets()", and fixes that bug, so we rever to checking
for "gzgets()" rather than "gzseek()", so that we don't accept pre-1.0.9
versions of zlib, and we get rid of our "gzgets()" replacement.

svn path=/trunk/; revision=4702
2002-02-06 09:58:30 +00:00
Guy Harris a9f7ef5058 Update a comment.
svn path=/trunk/; revision=4655
2002-02-01 00:10:03 +00:00
Guy Harris f180114360 Remove the "--without-gcc" option - it doesn't work with the Sun,
Digital UNIX, and HP C compilers, and it may not work with other
compilers (due to the GLib problem mentioned in the previous checkin),
so it runs the risk of being an "attractive nuisance", i.e. users may
try it, find it doesn't work, and then send mail to various Ethereal
mailing lists asking about it.

svn path=/trunk/; revision=4640
2002-01-30 23:48:53 +00:00
Guy Harris 595513d5cc Add a "--without-gcc" option, similar to what tcpdump and libpcap have.
(This isn't as useful for testing purposes as it is in tcpdump and
libpcap, as GLib is configured based on the compiler used to compile it,
so you can't necessarily build an application using GLib with a compiler
different from the one used to compile GLib, but we'll add it anyway.)

svn path=/trunk/; revision=4637
2002-01-30 23:01:33 +00:00
Guy Harris f560c48396 Bug fixes from Marc Milgram.
svn path=/trunk/; revision=4632
2002-01-30 18:58:04 +00:00
Guy Harris a66d50bbf2 Untested support for AiroPeek captures.
svn path=/trunk/; revision=4619
2002-01-29 09:45:58 +00:00
Guy Harris 5cf3587feb Support a libpcap link-layer type of 17 as DLT_PFLOG unless DLT_LANE8023
is defined as 17.

svn path=/trunk/; revision=4617
2002-01-29 08:55:24 +00:00
Guy Harris c873f79156 Support for capturing on, and reading captures from, OpenBSD firewall
logging virtual interface, from Mike Frantzen.

svn path=/trunk/; revision=4616
2002-01-29 08:44:53 +00:00
Guy Harris 32b4f58cd7 From Motonori Shindo: protect include of <netinet/in.h> with #ifdef
HAVE_NETINET_IN_H.

svn path=/trunk/; revision=4610
2002-01-25 09:44:52 +00:00
Guy Harris 886b4994ec Add support for ATM captures (based on writing one out and handing it to
NetMon 2.0; I don't have any ATM captures *from* NetMon to try it on, so
I don't know what significance the "destination address" and "source
address" fields have, but we can at least read the captures we ourselves
write out, as can NetMon).

svn path=/trunk/; revision=4606
2002-01-24 23:02:56 +00:00
Guy Harris 0a979b81b8 Get rid of "m"/"M" and other Macintosh references in names - it appears
that EtherPeek for Windows uses the same format as EtherPeek for MacOS,
so the code isn't specific to the MacOS version.

Check the physMedium value in the secondary header, and leave a
placeholder for a value of 1, which is presumably used in AiroPeek
captures.

Treat unknown mediaType and physMedium values as indications that we
don't have a *Peek file, not as unsupported *Peek files - we need all
the heuristics we can get.

svn path=/trunk/; revision=4601
2002-01-23 06:32:52 +00:00
Guy Harris be0b8a2d31 Fix up various product names and descriptions in the lists of file
formats we can read; include vendor names.

We should be able to read TokenPeek captures, as well as captures from
the Windows versions of EtherPeek.

Don't list the version numbers for EtherPeek and TokenPeek - those are
file format version numbers, not program version numbers.

svn path=/trunk/; revision=4599
2002-01-22 22:38:05 +00:00
Guy Harris 8d1812f93c From Alan Harrison: set "wth->phdr.pkt_encap" to "wth->file_encap" in
the V7-format read routine.

svn path=/trunk/; revision=4597
2002-01-22 20:01:07 +00:00
Guy Harris e6440c4f16 Fixes to EtherPeek file reader code, from Alan Harrison.
svn path=/trunk/; revision=4593
2002-01-21 23:45:58 +00:00
Guy Harris 203d0680a1 The time base in an EtherPeek capture isn't necessarily the start time
of the capture, so change some names and comments.

svn path=/trunk/; revision=4563
2002-01-18 01:08:36 +00:00
Guy Harris 68115d6089 It's EtherPeek, not Etherpeek, as WildPackets' Web site indicates.
svn path=/trunk/; revision=4562
2002-01-18 00:48:37 +00:00
Guy Harris 6cdc5dfde2 In the EtherPeek file reader, keep the capture start time in a private
data structure attached to the "wtap" structure, rather than in a
pseudo-header structure; get rid of the EtherPeek pseudo-header
structure, as it's not actually used as a pseudo-header, it's just used
as private data for the EtherPeek reader.

Get rid of an extra level of indentation in switch statements.

svn path=/trunk/; revision=4561
2002-01-18 00:25:50 +00:00
Guy Harris b8157b393c From Marc Milgram: fix to allow VMS TCPIPtrace files that don't have
exactly 3 spaces before the word "TCPIPtrace" to be recognized.

svn path=/trunk/; revision=4547
2002-01-15 20:18:02 +00:00
Guy Harris fc53c2b7b3 Oh, what the heck, write out FDDI and bit-swapped FDDI as the same type
in Sniffer Classic files; there's nothing we can do about those
platforms that bit-swap FDDI addresses before handing them to DLPI or
whatever, so we'll just let people live with wrong FDDI addresses (or
maybe someday put in code to bit-swap them before writing them out to
the capture file).

svn path=/trunk/; revision=4519
2002-01-11 02:51:31 +00:00
Gilbert Ramirez 573f3fb04a Provide a --disable-usr-local flag to configure so that
-I/usr/local/include and -L/usr/local/lib aren't automatically added
to the build flags.

svn path=/trunk/; revision=4507
2002-01-09 23:21:55 +00:00
Guy Harris 5e7698f322 From Marc Milgram: all packets in DBS Etherwatch and VMS TCPIPTRACE
captures are IP packets, so make the file encapsulation
WTAP_ENCAP_RAW_IP rather than WTAP_ENCAP_PER_PACKET, so you can save
those captures in other formats.

svn path=/trunk/; revision=4503
2002-01-08 22:30:29 +00:00
Gerald Combs e2106afbf2 VMS TCPIPtrace efficiency improvments, from Marc Milgram.
svn path=/trunk/; revision=4446
2001-12-24 17:00:01 +00:00
Guy Harris 2953cd1a97 From Irfan Khan: fix a couple of bugs in the pppdump reader.
svn path=/trunk/; revision=4414
2001-12-17 22:22:42 +00:00
Gilbert Ramirez d11f1dd6fb Get rid of newly-introduced signed/unsigned comparison warning.
svn path=/trunk/; revision=4392
2001-12-13 05:50:51 +00:00
Gilbert Ramirez 82380ce2c4 Don't leak memory when closing a pppdump trace file.
The second argument to g_ptr_array_free() does not indicate to
glib to free the objects that the pointers in the GPtrArray refer to,
but simply whether or not the free the block of pointers.  We have
to free the objects ourselves.

svn path=/trunk/; revision=4391
2001-12-13 05:49:13 +00:00
Guy Harris 39362af814 From Motonori Shindo:
fix a bogus batch mode inference rule of make, so that
	"vc60.pdb" files are created in the proper directory;

	delete ".pdb" files in a "nmake -f Makefile.nmake clean";

	include the text2pcap and mergecap ".pdb" files in the Windows
	binary distribution.

svn path=/trunk/; revision=4385
2001-12-12 01:29:13 +00:00
Guy Harris 291e50cea0 Fix white space.
svn path=/trunk/; revision=4359
2001-12-08 07:46:54 +00:00
Guy Harris f85f8bf466 Use "-no-cpp-precomp" rather than "-traditional-cpp" on MacOS X, as per
the "The Compiler and Tools" section on

	http://fink.sourceforge.net/doc/porting/basics.php

Do so on MacOS X regardless of whether the compiler is called "gcc" or
not, as that page also indicates that the compiler is installed as "cc".

svn path=/trunk/; revision=4354
2001-12-07 22:56:58 +00:00
Guy Harris 31519a0ff0 From Motonori Shindo: get rid of "send output to /dev/null" hack in
Ascend/Lucent trace reading code's Flex scanner.

svn path=/trunk/; revision=4346
2001-12-06 08:25:52 +00:00
Guy Harris fcdb378417 Update Gilbert's e-mail address.
svn path=/trunk/; revision=4340
2001-12-05 21:42:42 +00:00
Guy Harris faacd2b71c The data structure for per-packet headers for Mac V5 and V6 Etherpeek
files would put a 32-bit quantity on a 16-bit boundary without padding;
this means that many compilers will insert the padding and thus make the
structure not match what's in the file.

Instead of using a C structure, #define values for the offsets of
fields, read the header into an array of bytes, and extract values using
the offsets.

svn path=/trunk/; revision=4334
2001-12-05 07:19:11 +00:00
Guy Harris 2174f26cdc In the NetMon capture file reading code, if we get a short read when
trying to read the frame table, return -1 with "*err" set to
WTAP_ERR_SHORT_READ, don't return 0 - we've already decided that the
file is a NetMon file, so we shouldn't return a "this isn't a NetMon
file" indication, we should return a "this file is too short" error, as
that's what the problem is.

Fix up the error messages for WTAP_ERR_SHORT_READ to indicate that the
read might have gotten cut short in the middle of data other than a
packet.

svn path=/trunk/; revision=4331
2001-12-04 23:38:55 +00:00
Guy Harris bc225c2a87 Support for reading Visual Networks traffic capture files, from Tom
Nisbet.

Make a comment in "wiretap/file.c" clearer, so people know where to put
the entries for their capture file type.

svn path=/trunk/; revision=4328
2001-12-04 22:28:19 +00:00
Guy Harris 2e379072ec From Motonori Shindo: fix Ascend/Lucent trace reading code to handle
later trace formats that have an ASCII dump at the end of the line.

svn path=/trunk/; revision=4327
2001-12-04 10:07:30 +00:00
Guy Harris 8032fa8a1b Make the bytes-written information from Wiretap a long, as we allow
files to get that big.

From Thomas Wittwer and Matthias Nyffenegger:

Support for "ring buffer mode", wherein there's a ring buffer of N
capture files; as each capture file reaches its maximum size (the ring
buffer works only with a maximum capture file size specified), Ethereal
rolls over to the next capture file in the ring buffer, replacing
whatever packets might be in it with new packets.

svn path=/trunk/; revision=4323
2001-12-04 08:26:00 +00:00
Guy Harris a1660d6d3a Support for stopping capture at specified capture file size or capture
duration, from Thomas Wittwer and Matthias Nyffenegger.

svn path=/trunk/; revision=4322
2001-12-04 07:32:05 +00:00
Guy Harris a7bb49b0d9 Add support for LocalTalk Link Access Protocol.
Rename WTAP_ENCAP_PRISM to WTAP_ENCAP_PRISM_HEADER, to match
DLT_PRISM_HEADER.

Add in missing capture support for WTAP_ENCAP_PRISM_HEADER when
capturing with "pcap_open_live()" rather than reading the capture from a
pipe.

svn path=/trunk/; revision=4299
2001-11-30 07:14:22 +00:00
Guy Harris 56636f157a Support for 802.11+Prism II monitor-mode link-layer headers, from
Tim Newsham.

Add in missing item for WTAP_ENCAP_CISCO_IOS in the Wiretap
encapsulation type table.

svn path=/trunk/; revision=4290
2001-11-28 07:11:11 +00:00
Guy Harris 16bb4350ff Back the previous hack out - the padding is often zero, but it's not
*always* zero, so it won't always work, and it's somewhat gross.  The
right answer is "don't use Digital/Tru64 UNIX's tcpdump, use
tcpdump.org's".

svn path=/trunk/; revision=4202
2001-11-14 22:54:26 +00:00
Guy Harris e96b689067 Throw in a hack to try to detect FDDI captures from Digital UNIX's
tcpdump and, if we think we've found one, strip off the 3 padding bytes
they put in front of the frame.

svn path=/trunk/; revision=4201
2001-11-14 22:34:41 +00:00
Gilbert Ramirez f14a6b8b91 Hopefully the last time I have to change my e-mail address.
svn path=/trunk/; revision=4199
2001-11-13 23:55:44 +00:00
Guy Harris 40b22f317b Wrap calls to "pcap_datalink()" in a routine that attempts to compensate
for AIX 5.x's non-standard libpcap, where "pcap_datalink()" doesn't
return DLT_ values, it returns RFC 1573 ifType values.

Put that wrapper, and the routine to get the interface list, in a
separate file, for packet-capture utility routines, so not everybody who
includes "util.h" needs to include <pcap.h>.

Fix up the Wiretap hack for dealing with said incompatibility to use the
correct ifType value for Token Ring.

svn path=/trunk/; revision=4184
2001-11-09 07:44:51 +00:00
Guy Harris b7d32da1eb Expand on the comments about AIX libpcap.
No, Nokia *weren't* kind enough to change the major or minor version
number in the capture file when they changed the format, just as they
weren't kind enough to change the magic number.

svn path=/trunk/; revision=4173
2001-11-07 08:16:26 +00:00
Guy Harris 6910b84deb Add in some heuristics to try to detect AIX libpcap format. (This works
with one capture I've seen, but perhaps that was done with an old
version of AIX, and newer versions use a minor version number, in the
file, of 4.

However, libpcap hasn't used a minor version of 2 for ages, so perhaps
AIX hasn't updated their libpcap in ages, and aren't about to do so
soon.  If they do, let's hope they change the magic number.  The capture
file in question *does* have the capture length and real length in the
old, pre-2.3, order, so it really looks as if it's an old version,
rather than IBM trying to be "helpful" by using a different minor
version number so that you can distinguish between normal libpcap and
AIX libpcap formats.)

svn path=/trunk/; revision=4164
2001-11-06 01:55:14 +00:00
Gilbert Ramirez 0326e32563 Support DLT_CISCO_IOS.
svn path=/trunk/; revision=4126
2001-11-02 13:00:30 +00:00
Guy Harris 1b526aa894 Include <unistd.h>, if we have it, to declare "unlink()".
svn path=/trunk/; revision=4094
2001-10-28 01:51:46 +00:00
Gilbert Ramirez f686502750 Interface type 0x07 is Ethernet.
svn path=/trunk/; revision=4078
2001-10-25 20:36:26 +00:00
Gilbert Ramirez a505b64912 Get rid of signed/unsigned comparison warnings in wiretap.
svn path=/trunk/; revision=4077
2001-10-25 20:29:24 +00:00
Guy Harris 9c0c25dc17 DBS Etherwatch wiretap module, from Marc Milgram.
svn path=/trunk/; revision=4042
2001-10-19 20:18:48 +00:00
Guy Harris 3c78feeadc VMS TCPIPtrace wiretap module, from Marc Milgram.
Update the lists of known capture file formats in the Tethereal,
editcap, and mergecap man pages to match the current list (as found in
the Ethereal man page).

svn path=/trunk/; revision=4039
2001-10-18 20:29:56 +00:00
Guy Harris f509ddeaa5 Don't create a Wiretap dump file unless we're at least sure we support
the specified encapsulation with the specified capture file type, and
that we can allocate a "wtap_dumper *".

If we could do all that, and could create the dump file, but the
file-type-specific create routine fails (e.g., because there's not
enough disk space to write out the header), remove the dump file.

svn path=/trunk/; revision=4032
2001-10-16 04:58:24 +00:00
Guy Harris 3c9efdf478 Use longs as file offsets, so that on platforms with 64-bit "long" we
can handle capture files bigger than 2GB.

svn path=/trunk/; revision=3993
2001-10-04 08:30:36 +00:00
Guy Harris 61568581bd We have our own internal versions of "gzgets()" and "gzgetc()", so we
don't need to check whether zlib has them.  We *do*, however, have to
check for "gzseek()", as we don't have our own version of that.

svn path=/trunk/; revision=3963
2001-09-28 05:41:45 +00:00
Guy Harris c80cd072ac Update the URL for ATM-on-Linux.
svn path=/trunk/; revision=3949
2001-09-23 21:55:21 +00:00
Ashok Narayanan 29c8fa03b3 Removed the dependency on gzgetc and gzgets by implementing internal
versions of these commands in file_wrappers.c. This allows us to
compile successfully even on platforms where X has an older zlib built
in.

Removed this restriction from acinclude.m4

svn path=/trunk/; revision=3948
2001-09-20 16:36:45 +00:00
Guy Harris 606d363a9b The return value from "fwrite()" is a "size_t"; make the variable into
which we store it a "size_t", and then fix up the bugs that were
revealed by the compiler warnings that produced - "fwrite()" returns 0,
not a negative number, on an I/O error.

Fix up some other items to have type "size_t", or to have various
unsigned types, while we're at it, to squelch compiler warnings.

svn path=/trunk/; revision=3867
2001-08-25 03:18:48 +00:00
Guy Harris 837e848329 Sigh. Shomiti apparently didn't know that the RFC 1761 data link types
were just DLPI data link types, and didn't know that the list had
expanded at some point and that Sun *used* some of the new types (e.g.,
in atmsnoop), or decided on their own to go beyond those types to encode
an Oh-So-Useful link speed indication, or just didn't *care* that they
were just DLPI data link types.

Therefore, we have to map Shomiti link types to wiretap types using a
different mapping table.  For now, we assume files with a version number
of 2 are snoop files, and version numbers of 3, 4, and 5 are Shomiti
files; Shomiti claims to use a version number of 2 as well, but to
determine whether a file with a version number of 2 is a snoop file or a
Shomiti file requires that we look at the header of the first packet and
assume that if there's more than 3 bytes of padding it's a Shomiti file.

The return value from "fwrite()" is a "size_t"; make the variable into
which we store it a "size_t", and then fix up the bugs that were
revealed by the compiler warnings that produced - "fwrite()" returns 0,
not a negative number, on an I/O error.

svn path=/trunk/; revision=3866
2001-08-25 02:56:31 +00:00
Gilbert Ramirez aacb4d90f0 Use system's version of AM_PATH_GLIB macro.
Optimize use of AC_CHECK_FUNC in wiretap/acinclude.m4
Move #include "config.h" to be first include in some files.
From albert chin (china@thewrittenword.com)

svn path=/trunk/; revision=3857
2001-08-20 15:23:34 +00:00
Guy Harris 4533ae7c55 If there's no "zlib.h" header, we won't be using zlib, so don't bother
checking for "gzgets()" in zlib.

If there is a "zlib.h" header, and there is a "gzgets()" in zlib, check
whether we find "gzgets()" in zlib when we link with the GTK+ link
flags, and, if not, fail.  People often grab XFree86 source and build
and install it on their systems, and they appear sometimes to
misconfigure XFree86 so that, even on systems with zlib, it assumes
there is no zlib, so the XFree86 build process builds and installs its
own "mini-zlib" in the X11 library directory.  The "mini-zlib" lacks
"gzgets()", and that's the zlib with which Ethereal gets linked, so the
build of Ethereal fails.

svn path=/trunk/; revision=3849
2001-08-18 20:09:44 +00:00
Guy Harris 5bb08b0970 Fix AC_ETHEREAL_PCAP_CHECK so that, if a directory was specified with
"--with-pcap", it adds the "include" subdirectory of that directory to
the list of directories to search for include files, rather than adding
the directory itself.

Check whether libpcap defines "pcap_version", and define
HAVE_PCAP_VERSION if it does.  Use "pcap_version" iff HAVE_PCAP_VERSION
is defined, rather than special-casing MacOS X.

Don't #define a string for the WinPcap version; just leave
HAVE_PCAP_VERSION undefined on Windows, as WinPcap 2.2beta is out, so we
can no longer assume that the Windows version of Ethereal is using
WinPcap 2.1.

svn path=/trunk/; revision=3792
2001-07-27 07:10:13 +00:00
Guy Harris ae251f8426 MacOS support changes, from Michael Tuexen (with some modifications):
replace "--with-plugindir" with "--with-plugins", and have the
	plugin directory optional - this allows plugins to be disabled;

	add "--traditional-cpp" on MacOS X/Darwin (Apple's "cc" compiler
	requires it, for some annoying reason, even though it is, as far
	as I know, GCC-based, and other GCC's don't require it);

	on MacOS X, don't use "pcap_version[]", as, for some annoying
	reason, libpcap on MacOS X doesn't define it.

Clean up some whitespace in the help messages for the configure script.

Move the AM_CONDITIONAL for SETUID_INSTALL after the point at which
"enable_setuid_install" is set, as it tests "enable_setuid_install".

svn path=/trunk/; revision=3788
2001-07-26 07:25:49 +00:00
Guy Harris b7255e108a Fixes, from Scott Renfro, for some calls to "localtime()" that didn't
check whether the call succeeded (it doesn't always do so on Windows,
for example).

svn path=/trunk/; revision=3722
2001-07-15 19:14:03 +00:00
Guy Harris f7b50ca754 From Joerg Mayer:
* gcc 3.0 warning fixes:
  - text2pcap.c: The number of characters to scan should probably not be 0
  - wiretap/csids.c: using preincrement on a variable used on both
    sides of an assignment might be undefined by the C99(?) standard
 * turn on additional warnings for epan and wiretap too
  - epan/configure.in
  - wiretap/configure.in
 * Fix some warnings (missing includes, signed/unsigned, missing
    initializers) found by turning on the warnings
  - all other files :-)

svn path=/trunk/; revision=3709
2001-07-13 00:55:58 +00:00
Guy Harris 42f88b6693 Remove a comment that no longer applies - we no longer seek forward in
compressed Sniffer files by sequentially moving forward, and we no
longer seek backward by seeking to the beginning and then seeking
forward to the new position, we now seek to the beginning of the
compressed block that contains the target position, if we're not already
in that block, and then move to the appropriate position in that block.

svn path=/trunk/; revision=3658
2001-07-06 00:17:36 +00:00
Guy Harris 42f55e0208 "wtap_file()" is no longer in Wiretap, so don't try to export it from
the Wiretap DLL.

svn path=/trunk/; revision=3655
2001-07-05 20:57:09 +00:00
Guy Harris 537d308abe "open_cap_file()" in Ethereal and Tethereal don't use the FILE_T they
get from calling "wtap_file()", so get rid of the call and the
(otherwise unused) variable to which its result gets assigned.

That lets us get rid of "wtap_file()" in Wiretap.

It also lets us get rid of the include of "zlib.h" in "file.h"; the
#defines of "file_open()", "filed_open()", and "file_close()" are also
unnecessary, so we get rid of those as well.

However, that means we need to include <zlib.h> in "gtk/main.c" and
"tethereal.c", so that the version number of libz is defined and can
show up in the version string.

svn path=/trunk/; revision=3652
2001-07-05 00:34:42 +00:00
Guy Harris c932345421 Replace "--enable-pcap" with "--with-pcap", and if an argument is
specified to "--with-pcap", add that directory to the include file and
library search paths, so that you can use "--with-pcap=DIR" to search
for libpcap in a directory other than the standard ones (either because
it was installed somewhere other than under "/usr" or "/usr/local", or
because you want to use a special version you've installed rather than
the standard one).

svn path=/trunk/; revision=3611
2001-06-27 07:47:50 +00:00
Guy Harris 288053a6db Patch from Chris Jepeway to use, in NetXRay 2.x captures, a field from
the file header to specify the time units; different files appear to
have different time stamp units.

svn path=/trunk/; revision=3407
2001-05-09 04:42:27 +00:00
Gilbert Ramirez 3277a5255a Distribute wtap.def
svn path=/trunk/; revision=3330
2001-04-18 21:34:22 +00:00
Gilbert Ramirez 6c89e58e7f #define YY_NEVER_INTERACTIVE to avoid reference to isatty() on Win32,
and thus avoid a compiler warning when compiling ascend-scanner.c.

svn path=/trunk/; revision=3322
2001-04-18 03:03:42 +00:00
Guy Harris 3782799323 As of GLib 1.2.9, you won't automatically get "-I/usr/local/include" and
"-L/usr/local/lib" added to CFLAGS and LDFLAGS merely as a result of
running AM_PATH_GLIB, as 1.2.9 and later don't install headers directly
under "/usr/local/include".  Therefore, we have to put
"-I/usr/local/include" into CFLAGS ourselves, just as we do in the
top-level configure script, or we run the risk of not being able to find
other packages (libpcap, zlib, etc.) if it's installed under
"/usr/local".

svn path=/trunk/; revision=3318
2001-04-17 22:47:37 +00:00
Guy Harris d73302ad9b Fix the e-mail address for Joerg Mayer (and remove it from files he
wasn't involved with).

svn path=/trunk/; revision=3311
2001-04-17 00:46:06 +00:00
Guy Harris aedaabc8c8 GCC 2.95.1 on SPARC/Solaris, at least, is clever enough to figure out
that the loop in "lanalyzer_open()" is an infinite loop, so the "return
0;" at the end isn't necessary to suppress a compiler warning with that
compiler - and Sun C not only figures it out, it warns that the
"g_assert_not_reached()" and the "return 0;" are unreachable, so I'll
take them out for now (and put them back if my older GCC at home still
requires it to suppress warnings).

svn path=/trunk/; revision=3310
2001-04-16 22:06:34 +00:00
Guy Harris 122ed97b4a The "data" member of a Buffer structure is a "u_char *"; when assigning
the result of a "g_malloc()" to it, cast it to "u_char *", not "char *".

svn path=/trunk/; revision=3309
2001-04-16 21:59:38 +00:00