Commit Graph

3548 Commits

Author SHA1 Message Date
Guy Harris 0df6b59a91 Make the previous checkin actually compile on big-endian machines.
svn path=/trunk/; revision=1742
2000-03-22 23:47:28 +00:00
Guy Harris 1c07cd9b89 Byte-swap the frame table on big-endian machines.
Free it as soon as we're at the end of the sequential pass through the
file; that way, if we keep the capture file open with Wiretap even after
that's done (as I may do as part of some stuff I'm working on), we
at least aren't hanging on to the frame table memory after that point.

svn path=/trunk/; revision=1741
2000-03-22 09:52:21 +00:00
Guy Harris 005588b8b9 In a Network Monitor capture file, get the starting offsets of frames
from the frame table - Network Monitor 2.x, at least, doesn't always
write frame N+1 right after frame N.

To do that, we need to mallocate a big array to hold the frame table,
and free it when we close the capture file; this requires that we have
capture-file-type-specific close routines as well as
capture-file-type-specific read routines - we let it the pointer to that
routine be null if it's not needed.  Given that, we might as well get
rid of the switch statement in "wtap_close()", in favor of using
capture-file-type-specific close routines, as per the comment before
that switch statement.

svn path=/trunk/; revision=1740
2000-03-22 07:06:59 +00:00
Guy Harris 6fa0fd5fa8 Sigh. OpenBSD defines "HAVE_UNISTD_H" in the Makefile for zlib, so,
unlike FreeBSD and older versions of NetBSD, which give "gzseek()" and
"gztell()" signatures with "long" file-offset arguments, and thus, on
some versions, requires that "HAVE_UNISTD_H" *not* be defined before
including "zlib.h" if you want the functions declared with a signature
that matches what's actually in the library, it requires that it *be*
defined before including "zlib.h" if you want the functions declared
with a signature that matches what's actually in the library.

svn path=/trunk/; revision=1719
2000-03-14 18:27:44 +00:00
Gilbert Ramirez 9bcac07751 Fix for reading toshiba trace files that were created by using the
"save session" feature in many Windows-based telnet apps. CRT, by VanDyke,
in particular, will put in newlines at 80 columns.

svn path=/trunk/; revision=1692
2000-03-04 14:22:29 +00:00
Olivier Abad f84392ac60 The frame header in HP-UX 11 trace files is 4 octets longer (than HP-UX 9
and 10 files). Add OS version detection to handle this.

svn path=/trunk/; revision=1675
2000-03-01 10:25:14 +00:00
Guy Harris b903eb672a Note that one can probably symbolically request that nettl log incoming
and outgoing PDUs, rather than specifying a numerical mask with pduin
and pduout (0x30000000).

svn path=/trunk/; revision=1649
2000-02-19 08:50:11 +00:00
Guy Harris a5d5e3a55a If we see a file with an unknown network type, report the type in a
"g_message()" message, as other capture-file readers do.

svn path=/trunk/; revision=1648
2000-02-19 08:06:27 +00:00
Guy Harris 585268e3e1 Use WTAP_ERR_UNSUPPORTED_ENCAP for all attempts to open or read a
capture file for an unsupported link-layer encapsulation type (as the
nettl reader does), and report it correctly if it occurs on an open or
read attempt rather than a save attempt.

svn path=/trunk/; revision=1647
2000-02-19 08:00:08 +00:00
Olivier Abad 2d0cbfff6b Add support for raw IP nettl captures.
Update the nettl section in wiretap/README, and give sample commands to
make captures on HP-UX.

svn path=/trunk/; revision=1642
2000-02-17 21:08:15 +00:00
Gilbert Ramirez ddfa11e870 Create a header file for every packet-*.c file. Prune the packet.h file.
This change allows you to add a new packet-*.c file and not cause a
recompilation of everything that #include's packet.h

Add the plugin_api.[ch] files ot the plugins/Makefile.am packaging list.

Add #define YY_NO_UNPUT 1 to the lex source so that the yyunput symbol
is not defined, squelching a compiler complaint when compiling the generated
C file.

svn path=/trunk/; revision=1637
2000-02-15 21:06:58 +00:00
Guy Harris 533bc848a4 Get rid of the check for NetBSD in the Wiretap "configure.in"; we
eliminated the check in the top-level "configure.in", and leaving it in
the Wiretap one means that, on NetBSD, Ethereal gets built with zlib
support if zlib is present, but Wiretap doesn't - now they both get
built with zlib support.  Thanks to Itojun for catching this one.

Put into the Wiretap "configure.in" code to note that, if the test for
"gzgets()" in zlib fails, we're disabling compressed capture file
support, as is done in the top-level "configure.in".

svn path=/trunk/; revision=1625
2000-02-12 08:54:32 +00:00
Gilbert Ramirez 41f0a2c5e6 Update Makefiles for win32. Move local configuration to config.nmake,
have top-level Makefile.nmake call Makefile.nmake's in subdirectories.
Build plugins, and build generated source (lex, yacc). The only thing we
can't build is register.c; I need to re-work the top-level Makefile.nmake
because it lists object files, not C files, which make-reg-dotc needs.

svn path=/trunk/; revision=1608
2000-02-09 00:41:57 +00:00
Guy Harris a82c49732b Change from Ed Meaney - write capture files in binary, rather than ASCII
("w" and "wb" are the same on UNIX, but not on Win32).

svn path=/trunk/; revision=1598
2000-02-03 06:31:30 +00:00
Gilbert Ramirez 65b4006f46 Support for NetXray 3.03 (the program version, not file version) PPP
traces. The trace we got from Tom Poe (tomp@intrex.net) contains PPP
data which NetXRay has transformed into looking like Ethernet frames.
The hardware addresses are the bytes for the ASCII reprsentation of
"SRC" and "DEST", with null pad bytes at the end. Interesting.

svn path=/trunk/; revision=1576
2000-01-29 05:10:06 +00:00
Guy Harris 9f458a52fc Always declare, and define, "file_seek()" to return a "long", as it's
supposed to look like "ftell()".

If you don't have zlib, just define "file_seek" as an alias for "fseek",
rather than defining it as a routine.

svn path=/trunk/; revision=1571
2000-01-26 19:22:04 +00:00
Guy Harris f71823a907 "gztell()" is also affected by the libz mess on platforms where "off_t"
is bigger than a "long"; this is itojun's fix for that, turning
"file_tell()" into a wrapper function in "file_wrappers.c", just like
"file_seek()".

svn path=/trunk/; revision=1554
2000-01-25 04:49:55 +00:00
Gilbert Ramirez 46df25f532 Added the O_BINARY flag to open() for win32.
Ethereal on win32 now correctly reads trace files.

svn path=/trunk/; revision=1538
2000-01-24 19:16:39 +00:00
Guy Harris 3e067b812c Fix files that had Gilbert's old e-mail address or that didn't have my
forwarding e-mail address.

svn path=/trunk/; revision=1522
2000-01-22 06:22:44 +00:00
Olivier Abad ea77c943c5 The headers of HP-UX 9.04 and HP-UX 10.20 nettl files seem to be different.
Check for both "magic numbers".

svn path=/trunk/; revision=1512
2000-01-20 17:13:42 +00:00
Gilbert Ramirez 339d67b043 Merge in the final code to make Ethereal run on Win32, compiled
with MSVC 6.0 and 'nmake', the make tool that comes with MSVC.

It compiles, links, and runs. It doesn't run correctly. There's a problem
when reading files. I'm getting short reads.  I'm not linking in zlib or
libsnmp because it first needs to be debugged.

I changed the plugin code to use gmodule instead of libltdl, but the
Unix build still links ethereal against libltdl. I'll fix that tonight; sorry
about leaving it in such a sad state, but I wanted to check in this code
before I left work on a Friday night. Ethereal still works, but the
building is less than optimal.

svn path=/trunk/; revision=1479
2000-01-15 00:23:13 +00:00
Guy Harris 3d72fa5f87 Add "file_wrappers.c" to the list of things to compile with Microsoft
Visual C{++}.

svn path=/trunk/; revision=1467
2000-01-13 18:26:15 +00:00
Guy Harris cc9a1060ca Fix "ascend-scanner.l" to include "file_wrappers.h" rather than the
defunct "file.h".

Make "file_wrappers.c" include "wtap.h", so that the WTAP_ERR_ZLIB_
values are defined.

svn path=/trunk/; revision=1464
2000-01-13 07:18:50 +00:00
Guy Harris 7a36bede0b We are obliged to define HAVE_UNISTD_H in "config.h"; to avoid the
hideous problem on FreeBSD 3.[23] (and perhaps other BSDs) if
HAVE_UNISTD_H is defined before "zlib.h" is included, turn "file_seek()"
into a subroutine defined in a file that *undefines* HAVE_UNISTD_H
before including "zlib.h", so that the *only* call to "gzseek()" is made
from a file that does not have HAVE_UNISTD_H defined when it includes
"zlib.h".

Move "file_error()" to that file while you're at it, so it holds all the
wrappers that hide the presence or absence of zlib from routines to read
capture files.

Turn "file.h", which declared those wrapper functions as well as wrapper
macros, into "file_wrapper.h" - it belongs with the "file_wrapper.c"
file that defines the wrapper functions, not with "file.c" which handles
higher-layer file access functions.

Remove the comment in "configure.in" that explained why defining
HAVE_UNISTD_H was a bad idea, as we're not obliged to define it and work
around the problem.  (The comment in "file_wrapper.c" explains the
workaround.)

svn path=/trunk/; revision=1463
2000-01-13 07:09:20 +00:00
Gilbert Ramirez 1990d5fb5c Some initial changes for win32 support, but not all.
Added lots of #ifdef HAVE_*_H wrappers.
Added some #defines in config.h.win32
Check for more headers in configure.in
Added prototype for inet_aton() in inet_v6defs.h.
Changed "BYTE" token (i.e., #define) in ascend-gramamr.y because it
conflicts with a windows definition. Use HEXBYTE instead.

svn path=/trunk/; revision=1448
2000-01-10 17:33:17 +00:00
Guy Harris 78b75095f4 Add to some comments notes on the meaning of DLT types 15 and 16 on
Linux systems with the isdn4linux patches; they help make DLT types even
less useful than they were after the various flavors of BSD proceeded to
add their own types past 14, with no coordination whatosever, so that
they overlapped, rendering it impossible to read a libpcap capture file
without knowing what particular OS generated it.

svn path=/trunk/; revision=1442
2000-01-09 07:55:48 +00:00
Gilbert Ramirez c20bb290c5 Add relative timestamps. The Toshiba ISDN router has the same problem
as the Ascend routers; those little buggers don't remember time very well.
The only timestamp available in the trace is relative to the beginning
of the trace.

So, right now I'm just using this relative timestamp as the absoulte time.
All my times are in 1969 (my timezone is GMT - 6), but all I care about
for now is the relative time, which is preserved even if the absolute time
is in the wrong decade.

svn path=/trunk/; revision=1404
2000-01-01 04:01:41 +00:00
Guy Harris 910f1721ea Pull in some additional non-definitions, to make it match the current
"config.h" on my machine.  (Should YYTEXT_POINTER be defined?)

svn path=/trunk/; revision=1346
1999-12-15 08:13:04 +00:00
Guy Harris b806feb9d1 Bring it somewhat up to date.
svn path=/trunk/; revision=1345
1999-12-15 08:08:42 +00:00
Guy Harris 9658c33db6 Handle i4btrace captures if they're from a machine with the opposite
byte order from the machine that's reading them.

svn path=/trunk/; revision=1338
1999-12-15 02:25:50 +00:00
Guy Harris cc4e9f698b One field in the NetXRay header appears to be the number of frames in
the capture; set it to that when writing the capture.

Support Token Ring and FDDI captures (as per the network type in the
file header appearing to be either the NDIS network type, or the NDIS
network type minus 1 - I forget whether Ethernet has an NDIS type of 0
or 1).

Don't write the file header twice, keeping a static copy of it around,
as Wiretap code isn't supposed to keep any static data around; instead,
write it only when we're done writing out all the records (as we do on
Network Monitor captures).

Compute the time stamps when writing the file.

Give Windows Sniffer 1.1-format a short name, so "editcap" doesn't dump
core or print "(null)" in its usage message.

WTAP_ENCAP_NULL isn't supported by NetMon; don't write it.

svn path=/trunk/; revision=1336
1999-12-15 01:34:17 +00:00
Nathan Neulinger f78124579c more work on netxray, still not sniffer compatible though
svn path=/trunk/; revision=1333
1999-12-14 21:59:07 +00:00
Olivier Abad 8e8821b4a3 Changed the meaning of the 0x80 bit in "fs" in a frame2 record (from DTE
instead of from DCE).
I can now open a RADCOM X.25 capture in ethereal, save it as sniffer, and
read it with a sniffer. The frame directions are correct. (BTW, the
snifconv.exe tool provided by RADCOM doesn't work with X.25 captures).

svn path=/trunk/; revision=1331
1999-12-14 12:41:13 +00:00
Guy Harris 392e51a42e Include <string.h> to declare "memset()".
svn path=/trunk/; revision=1321
1999-12-14 05:34:30 +00:00
Nathan Neulinger 2ad53e520e Added support for writing netxray version 1.1 dumps.
It's very basic, and doesn't write out the timestamps currently. It also
only handles WTAP_ENCAP_ETHERNET, although it can probably do the others,
but I don't have a good way to test them. This code has not yet been tested
against a Sniffer Pro, although wiretap can read the files just fine.

svn path=/trunk/; revision=1318
1999-12-14 01:12:59 +00:00
Guy Harris e15761f1a5 Put the "." in "V.120".
svn path=/trunk/; revision=1305
1999-12-12 22:53:25 +00:00
Gilbert Ramirez 4a15f6582a Added Bert Driehuis <driehuis@playbeing.org>'s I4B wiretap module
and V.120 decoder.

svn path=/trunk/; revision=1304
1999-12-12 22:40:10 +00:00
Guy Harris bf611b0f7c Add short names (for "editcap" command lines and the like) for the
Kuznetsov "libpcap" format and the early Kuznetsov format Red Hat 6.1
uses.

svn path=/trunk/; revision=1303
1999-12-12 21:34:51 +00:00
Guy Harris 626078e808 Put in a private data structure hanging off the "wtap_dumper" structure
the "this is the first frame" flag, and the time stamp of the first
frame, used when writing Sniffer files, so that more than one could be
open at a time (Wiretap doesn't forbid that) and so that they're
initialized when you start writing a capture.

svn path=/trunk/; revision=1292
1999-12-11 10:02:13 +00:00
Olivier Abad e906581356 Correct timestamp calculation in ngsniffer_dump
svn path=/trunk/; revision=1291
1999-12-11 09:22:36 +00:00
Guy Harris 96a2e32a70 Provide different file types for "modified" and Red Hat 6.1 "libpcap"
files (the former have a different per-packet header, and a different
magic number, from the standard "libpcap"; the latter have the same
per-packet header as "modified" "libpcap" files, but the same magic
number as standard "libpcap" files, sigh).

Support writing "libpcap" captures in all three formats (so that, for
example, people running Ethereal on RH 6.1 can write out captures that
the "tcpdump" that comes with RH 6.1 can read, although that's not the
default format we save in - there's no way to tell whether you're
running on RH 6.1, as far as I know; "uname()" just tells you, on Linux
systems, that the kernel is Linux 2.x, and what "x" is, it doesn't say
what the *rest* of the system is).

Fix the table in "file.c" to use Olivier's code for writing Sniffer
files.

svn path=/trunk/; revision=1288
1999-12-11 00:40:40 +00:00
Olivier Abad 1c7d6cf9fc Add support to Wiretap for writing sniffer capture files.
I'm using 4.0 as the version in the REC_VERS record. It seems to work
with sniffer versions 4.40 and 5.0

No ATM support yet.

svn path=/trunk/; revision=1270
1999-12-09 23:17:20 +00:00
Guy Harris 959e02e540 Provide a table of descriptive and short (command-line) names for
encapsulation types, and routines to translate encapsulation types to
names and short names to encapsulation types, for the benefit of
"editcap".

svn path=/trunk/; revision=1212
1999-12-05 01:24:54 +00:00
Guy Harris db5e747c58 Expand on the description of "libpcap" and "snoop" capture file formats.
svn path=/trunk/; revision=1211
1999-12-05 01:23:22 +00:00
Guy Harris 2abff4ef8b Oops! First check if the short name in the "dump_open_table[]" entry is
NULL before checking if it matches the name you were handed....

svn path=/trunk/; revision=1208
1999-12-04 21:32:58 +00:00
Guy Harris ed78c10649 Give those capture file formats we can write a "short name", to be used
to, for example, specify on a command line the format that a program
should write; provide a routine to translate a file type to its short
name, and to translate a short name to the corresponding file type.

svn path=/trunk/; revision=1207
1999-12-04 21:20:09 +00:00
Guy Harris 0dcade2634 Fields in the "snoop" file header are big-endian; write them as such.
svn path=/trunk/; revision=1204
1999-12-04 11:19:04 +00:00
Guy Harris 1eaa99a669 Fix some names.
svn path=/trunk/; revision=1203
1999-12-04 09:38:38 +00:00
Guy Harris 3af8d95645 More infrastructure changes for Ethereal - make
"wtap_file_type_string()" take, as its argument, a file type, rather
than a "wtap *".

Fix some range checks of file types to check against WTAP_NUM_FILE_TYPES
rather than WTAP_NUM_ENCAP_TYPES.

svn path=/trunk/; revision=1201
1999-12-04 08:51:52 +00:00
Guy Harris 3b93574402 Add some infrastructure for the use of Ethereal, so it can make a list
of all the file types in which a file can be saved.

Giving each dumpable file type a routine that checks whether a file of a
given file type and encapsulation can be written lets us hoist some
checks into common code from out of the open routines.

If the "dump close" routine for a dump stream is NULL, have that mean
that there's no action that needs to be taken on a close by the code to
handle that file type; some file types don't need that, as they can be
written purely sequentially.

svn path=/trunk/; revision=1200
1999-12-04 08:32:14 +00:00
Guy Harris f256c54f79 Include <string.h> to declare "memset()".
svn path=/trunk/; revision=1198
1999-12-04 06:21:45 +00:00
Guy Harris a0de9d710e Null out the "pointer to private data" member of a "wtap_dumper"
structure before calling the "dump_open" routine for the file type; it
either has to be null or point to something that can be freed, as the
dump close routine frees what it points to if it's not null.

svn path=/trunk/; revision=1196
1999-12-04 05:37:36 +00:00
Guy Harris 94746f05da Add support to Wiretap for writing Network Monitor 1.x-format capture
files.

Make the return type of a number of routines that return 1 (for "true")
on success and 0 (for "false") on failure to "gboolean", and make the 1's
and 0's TRUEs and FALSEs.

svn path=/trunk/; revision=1195
1999-12-04 05:22:21 +00:00
Guy Harris 4c37395f73 Add support to Wiretap for writing Network Monitor 1.x-format capture
files.

Make the return type of a number of routines that return 1 (for "true")
on success and 0 (for "false") on failure to "gboolean", and make the 1's
and 0's TRUEs and FALSEs.

svn path=/trunk/; revision=1194
1999-12-04 05:14:39 +00:00
Guy Harris 4c6b80bb27 Add support to Wiretap for writing "snoop"-format capture files.
svn path=/trunk/; revision=1193
1999-12-04 03:36:22 +00:00
Guy Harris 93fdf81217 It appears that our "Makefile.in" won't work with the scripts generated
by pre-2.13 "autoconf", and there may be other problems with pre-2.12
"autoconf" as well; require "autoconf" 2.13 or later.

svn path=/trunk/; revision=1187
1999-12-03 07:04:54 +00:00
Gilbert Ramirez f6147bfdd9 Change Olivier's e-mail address.
svn path=/trunk/; revision=1158
1999-11-29 22:45:34 +00:00
Guy Harris 5feaeca5f2 Update one more comment.
svn path=/trunk/; revision=1150
1999-11-29 08:00:58 +00:00
Guy Harris 2fcfdf77d7 Update some comments.
svn path=/trunk/; revision=1149
1999-11-29 07:54:40 +00:00
Guy Harris f60e02335a Duh. If you say you're going to check for "gzgets()", check for
"gzgets()", not "gzseek()"....

svn path=/trunk/; revision=1145
1999-11-29 05:17:56 +00:00
Guy Harris f3c3ed2c03 Of the "zlib" functions we use that aren't in all versions of "zlib",
"gzgets()" is the one most recently added; it was added in 1.0.9.

Check for it, rather than for a list of functions, when checking for
"zlib" support - if you check for N functions, and they're all there,
you get N "-lz"s added to the list of libraries with which to link.

Indicate in the README that "zlib" versions prior to 1.0.9 definitely
won't work.

svn path=/trunk/; revision=1144
1999-11-29 05:10:18 +00:00
Guy Harris 818e9eff8c Don't add compressed-file-reading support unless "gzopen()" *and*
"gzseek()" *and* "gztell()" *and* "gzgets()" *and* "zError()" are all in
Zlib - we use all of them, and it appears that some older versions of
Zlib that some users had on their systems don't have some of them.

svn path=/trunk/; revision=1134
1999-11-29 00:17:19 +00:00
Guy Harris 9f084a7ebc Add in a comment about the "fs" and "flags" fields in the "frame2"
record.

svn path=/trunk/; revision=1130
1999-11-28 02:08:48 +00:00
Guy Harris d6c3d1b5bf Sigh. Apparently "Internetwork analyzer" covers a multitude of sins;
both LAPB and PPP captures get written out with that network type.

Flag it as WTAP_ENCAP_UNKNOWN when the file is opened, and, when we see
the first packet, check whether the address field is 0xFF, in which case
we flag it as PPP, or anything else, in which case we flag it as LAPB.

svn path=/trunk/; revision=1129
1999-11-27 20:46:46 +00:00
Guy Harris 7c502167e4 Update a comment.
svn path=/trunk/; revision=1125
1999-11-27 06:03:46 +00:00
Guy Harris 48d5f6de4d Move the "guess what type of ATM traffic this is" stuff into the ATM
dissector; I don't think it's guaranteed that even a Sniffer will tell
you that (there may be situations where it can't figure it out, and
where the user didn't tell it), we may need it for "atmsnoop" traffic
and other types of ATM traffic as well, we will probably want to add to
it the ability to let the user specify "virtual circuit X.Y is this kind
of traffic", and we may also have Ethereal try to intuit it based on
previous traffic in the capture (Q.2931 call setup, LANE traffic, etc.).

Don't show the cell count if it's zero - assume that means we don't know
how many cells made up the packet.  Also don't show the AAL5 trailer if
the cell count is zero - the ATM Sniffer *might* sometimes supply a cell
count of 0 even if it has the AAL5 trailer, I guess, and we *might* see
some other capture file format that has the AAL5 trailer but no cell
count, but we'll cross that bridge when we come to it.

Add support for "atmsnoop" captures to the code to handle "snoop"
captures.

Use the field in "iptrace" headers that appears to be, in ATM captures,
a direction indicator - we may have the direction backwards, but, as an
STP packet was tagged as a DCE->DTE packet, and as the capturing
machine, which also was presumably the recipient of the packet, was an
AIX box, not a switch or bridge or some piece of networking equipment
such as that, it *probably* wasn't sending the STP packet, it was
probably receiving it.

svn path=/trunk/; revision=1120
1999-11-27 01:55:44 +00:00
Guy Harris f08f10c093 It appears that the first frame in a NetMon 2.0 capture file doesn't
necessarily start at an offset of 128 into the file; we have to read the
first entry in the frame table to find the offset in the file of the
first frame.  (That also works on NetMon 1.0.)

Keep the header size around, though, as we'll need it if we add code to
*write* NetMon files.

svn path=/trunk/; revision=1119
1999-11-26 22:50:51 +00:00
Gilbert Ramirez 9d96677a18 Update documentation about iptrace version support.
svn path=/trunk/; revision=1118
1999-11-26 20:49:28 +00:00
Gilbert Ramirez 9b6369af4b Support for iptrace 1.0 traces (AIX 3). Thanks to Florian Lohoff
<flo@rfc822.org> for the sample traces.

It turns out that the iptrace 2.0 header is simply an extension to
the iptrace 1.0 header. It also appears that iptrace 1.0 has only tv_sec, but
not tv_usec, which explains why the fields are separated in the iptrace 2.0
header, but doesn't explain why the iptrace 2.0 header has tv_sec copied
in two places.

I changed iptrace.c to detect FDDI captures via if_type, even though I
don't have a trace to substantiate this. If *should* work, given that
loopback, ethernet, token-ring, and X.25 work. If it doesn't work, someone
will let me know.

svn path=/trunk/; revision=1117
1999-11-26 17:57:14 +00:00
Guy Harris 73813e04ce Add a bunch of placeholder entries for DLPI link-layer types, for
reference.

svn path=/trunk/; revision=1114
1999-11-26 11:18:12 +00:00
Guy Harris 72fa4b5d3a Don't define "pseudo_header" in "ascend-scanner.l", as that may cause
warnings about multiple declaration of "pseudo_header" as a common.
Instead, define it only in "ascend-grammar.y", and declare it in
"ascend-int.h" as an "extern".

svn path=/trunk/; revision=1103
1999-11-24 19:29:45 +00:00
Gilbert Ramirez d68a8709c7 Detect x.25 and loopback traces via if_type field, not the
interface name. Thanks to Olivier for testing this. The only link type
detected by interface name is FDDI.

svn path=/trunk/; revision=1094
1999-11-22 15:55:08 +00:00
Gilbert Ramirez f7cf81e479 Add comments showing IFT names for the IFT-to-Wiretap encapsulation array.
If a interface type is not recognized, set error to WTAP_ERR_UNSUPPORTED
instead of WTAP_BAD_RECORD.

Continue to check for X.25, FDDI, and loopback traces via the interface
name instead of the newly-discovered if_type field in the packet header.
Once Olivier confirms that his traces still work by checking only if_type,
I'll change the code. But he's on vacation right now. ATM, Ethernet, and
Token-Ring are discovered via the if_type field.

svn path=/trunk/; revision=1063
1999-11-19 05:48:21 +00:00
Guy Harris b8e05ffb2c Clean up some ANSI C nits pointed out by "gcc -pedantic".
Also, explicitly compare the result of "memcmp()" against 0 - the
appearance of a comparison operator in the expression makes it clearer
what test is being done.

svn path=/trunk/; revision=1061
1999-11-18 21:48:53 +00:00
Guy Harris ef8ff95ac8 (AppTrafType & ATT_HLTYPE) is the type of high-level traffic, and
AppHLType is the subtype of that type; set them appropriately (as best
we can, given that we can only *guess* what kind of traffic it is) for
"iptrace" captures in Wiretap.  (Alas, more work is needed to
distinguish Ethernet from Token-Ring LANE traffic....)

Handle VPI = 0, VCI = 5 as the Signalling AAL in "iptrace" captures.

svn path=/trunk/; revision=1058
1999-11-18 09:39:12 +00:00
Gilbert Ramirez 32e13732c0 Check in my work so far on enabling the ATM iptrace capability. Not
all packets are recognized yet, but ILMI and Classical IP (LLCMX) are.
The ATM iptrace facility uses the ngsniffer_atm_phdr pseudo header so that
ethereal doesn't have to worry about yet another psuedo header.

svn path=/trunk/; revision=1057
1999-11-18 08:50:37 +00:00
Gilbert Ramirez 95d752b466 Fixed the checking of the return value from file_gets() (fgets()).
svn path=/trunk/; revision=1053
1999-11-18 07:04:29 +00:00
Guy Harris 2937a86a62 Add some comment based on some spelunking done in some capture files,
and on a comment that "libpcap"/BPF on AIX appears to return 6 as the
network type for an Ethernet device - the BSD IFT_ETHER is 6.

svn path=/trunk/; revision=1048
1999-11-17 07:50:33 +00:00
Gilbert Ramirez 56b9fc4861 Remove potential for a bad toshiba trace file to overflow a fixed char[]
buffer in sscanf call.

svn path=/trunk/; revision=1012
1999-11-11 19:19:17 +00:00
Guy Harris f2b8eb42d0 Change my e-mail address to the forwarding address my *alma mater*
provides.  "Every problem in computer science can be solved by adding a
layer of indirection."

svn path=/trunk/; revision=1008
1999-11-11 08:45:34 +00:00
Gilbert Ramirez 3a64f9c655 Remove unnecessary file_seek per packet, speeding up loading of a
gzipped toshiba file.

svn path=/trunk/; revision=1005
1999-11-11 06:29:59 +00:00
Gilbert Ramirez 4ec9c54b4b Add LAPD support.
svn path=/trunk/; revision=1004
1999-11-11 05:36:16 +00:00
Gilbert Ramirez 0bf0d908ae More small memleak fixes.
colors.c wasn't freeing path in one place
main.c wasn't freeing rc_file
the frame_buffer fix in wtap.c didn't clear everything.

svn path=/trunk/; revision=1001
1999-11-10 19:58:54 +00:00
Gilbert Ramirez 02a64faea7 Fixed small memory leak in wiretap (frame_buffer wasn't being freed),
and aligned g_malloc calls with g_free calls (i.e, we no longer mix-and-match
C-library malloc with GLIB g_free, and vice-versa).

svn path=/trunk/; revision=1000
1999-11-10 19:47:57 +00:00
Guy Harris d49b158b49 Add in a gross heuristic that attempts to detect files with the version
of the "libpcap" patch that changes the per-packet header but not the
magic number - it seems to work on at least one capture file I tried it
on.

Give the modified "libpcap" format a WTAP_FILE type of its own (so that,
in the future, we could support writing captures out in that format,
possibly).

svn path=/trunk/; revision=987
1999-11-06 10:31:47 +00:00
Guy Harris 148d0c865a Add support for capture files written by programs linked with Alexey
Kuznetsov's modified "libpcap" *as long as you have the ss990915 or
later patch*; the 990417 patch, alas, changes the per-packet header but
*doesn't* change the magic number, so you can't just look at the magic
number to see that it's Not Standard Libpcap.  (Even more unfortunately,
Red Hat appears to have picked up *that* patch for Red Hat 6.1; I've
filed bug 6773 with Bugzilla on their site - hopefully, if I'm not
misremembering the RH 6.1 code I've seen, and they really *did* pick up
the older patch, they'll fix it ASAP to use the new magic number, and
will make updates available.)

svn path=/trunk/; revision=986
1999-11-06 08:42:01 +00:00
Guy Harris c0340af891 Give it an RCS ID.
svn path=/trunk/; revision=957
1999-10-31 19:35:32 +00:00
Guy Harris 841b4762ec Move the initial comment inside the first "%{", so that it shows up in
the generated parser, so that "ident" will tell you from which version
of the grammar that parser was generated.

svn path=/trunk/; revision=956
1999-10-31 19:34:46 +00:00
Guy Harris e5e89164b6 The answer to the question "why pass err to open_routines[i]() if err is
overwritten here?" is probably "because I was cutting-and-pasting text
to insert the error-handling code, and didn't remove the "*err = errno"
from that particular case.  Remove it now.

svn path=/trunk/; revision=955
1999-10-31 19:30:53 +00:00
Guy Harris 24807c0afa Give it an RCS ID.
Fix the error checking ("file_error()" returns an "errno" value *if*
there's an error and it's a UNIX error, but it may also return a
non-"errno" value for non-UNIX errors, so its return value should be
passed back through the "err" pointer).

svn path=/trunk/; revision=954
1999-10-31 19:23:37 +00:00
Gilbert Ramirez 558e714449 Add a module to wiretap to be able to read trace files from Toshiba's
line of ISDN routers. Much like the ascend reader, this module reads an
ASCII hex dump of trace data.

Rearranged the order in which wiretap tries trace files, to keep the
ASCII-readers (ascend and toshiba) at the end, and put the binary-readers
(everything else) at the front of the list. If a telnet session of
and ascend trace or toshiba trace were captured near the beginning of
another trace, wiretap might think the trace was ascend or toshiba if it
tried that module first.

Fixed the way wtap_seek_read() selects functions to call. It was using
the encap type instead of the file type. We got lucky because
WTAP_ENCAP_ASCEND == WTAP_FILE_ASCEND

svn path=/trunk/; revision=952
1999-10-31 17:46:11 +00:00
Gerald Combs 652fd211ac Change ASCEND_MAX_SEEK from 1000000 to 100000, so as not to excessively slow
down file opens.

svn path=/trunk/; revision=939
1999-10-28 01:42:43 +00:00
Guy Harris f494dfafa7 Include <time.h> to get "struct tm" declared.
svn path=/trunk/; revision=936
1999-10-27 17:07:08 +00:00
Guy Harris 2202c089fe A fix, from Olivier, to the previous patch.
svn path=/trunk/; revision=885
1999-10-19 04:41:52 +00:00
Guy Harris ae988d2f28 Add Gerald Combs to the list of contributors; he added the Ascend/Lucent
capture file code.

Add Ashok Narayanan to the list of contributors; he added the code to
read compressed files.

svn path=/trunk/; revision=880
1999-10-18 01:56:17 +00:00
Guy Harris dbd1955d62 Olivier Abad's patches to add:
more display filters for X.25;

	no LCN in X.25 RESTART / DIAGNOSTIC / REGISTRATION packets;

	support for nettl file format (nettl is a trace tool for HP-UX).
	For now, it only supports traces for X.25 interfaces (tested
	with HP-UX 10.20).

svn path=/trunk/; revision=879
1999-10-18 01:51:34 +00:00
Jun-ichiro itojun Hagino 45ca99c55b avoid mistakingly commit dynamically generated files, like "Makefile".
svn path=/trunk/; revision=837
1999-10-15 04:40:28 +00:00
Jun-ichiro itojun Hagino 810a67a6d0 implement ipprotostr() in ipproto.c, which basically does ipprotobynumber()
for ip.ip_p and ip6.ip6_nxt (and other IPv6 header chain).

use val_to_str() as much as possible in dissect_{ipv6,pim,ripng}().

make --disable-zlib a default for netbsd (temporary workaround).

svn path=/trunk/; revision=827
1999-10-14 03:50:51 +00:00
Guy Harris 5779d0b754 The #defines to turn "yy{lex,error}" into names specific to the
parser/lexical analyzer in question are needed only in the ".c" files
for the generated parser and lexical analyzer, and Flex and Byacc/Bison
put them there; don't bother putting them in a header file, just
directly declare the functions with the right names.

svn path=/trunk/; revision=801
1999-10-10 18:16:43 +00:00
Guy Harris 05af0607de Move some definitions of stuff not used outside the Lucent/Ascend
capture file reading code from "ascend.h" to "ascend-int.h".

svn path=/trunk/; revision=788
1999-10-08 07:45:31 +00:00
Guy Harris 21f0e54e7f Add an "ascend-int.h" file, to declare routines used by more than one of
the files in the Lucent/Ascend capture file code.

svn path=/trunk/; revision=787
1999-10-08 07:41:33 +00:00
Guy Harris 38f351e7d7 Give it a copyright notice and RCS ID.
svn path=/trunk/; revision=775
1999-10-06 03:38:37 +00:00
Guy Harris d86ecc2302 Whitespace cleanup.
svn path=/trunk/; revision=773
1999-10-06 03:30:21 +00:00
Guy Harris 0d43b16fdd Add "wtap_file_encap()", to return the encapsulation of packets in the
file (which could be WTAP_ENCAP_UNKNOWN, if we couldn't determine it, or
WTAP_ENCAP_PER_PACKET, if we could determine the encapsulation of
packets in the file, but they didn't all have the same encapsulation).
This may be useful in the future, if we allow files to be saved in
different capture file formats - we'd have to specify, when creating the
capture file, the per-file encapsulation, for those formats that don't
support per-packet encapsulations (we wouldn't be able to save a
multi-encapsulation capture in those formats).

Make the code to read "iptrace" files set the per-file packet
encapsulation - set it to the type of the first packet seen, and, if any
subsequent packets have a different encapsulation, set it to
WTAP_ENCAP_PER_PACKET.

svn path=/trunk/; revision=772
1999-10-06 03:29:36 +00:00
Guy Harris 66c411777b Make "wtap_strerror()" handle zlib errors *correctly*.
svn path=/trunk/; revision=770
1999-10-05 07:22:53 +00:00
Guy Harris 5f7868c7e0 Better handle errors from zlib:
Assign a range of Wiretap errors for zlib errors, and have
	"wtap_strerror()" use "zError()" to get an error message for
	them.

	Have the internal "file_error()" routine return 0 for no error
	and a Wiretap error code for an error.

svn path=/trunk/; revision=769
1999-10-05 07:06:08 +00:00
Guy Harris 57772323ad A "time units" value of 5 means "microseconds", according to an FDDI
Sniffer trace, and printout therefrom, sent to me by Jeff Foster.  (The
Sniffer manuals I'd had a chance to read didn't say what the units
were.)

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

svn path=/trunk/; revision=733
1999-09-28 01:19:01 +00:00
Guy Harris b34c49fa86 DO NOT check for "unistd.h"; due to an unfortunate botch in the way
"zlib" was built in FreeBSD 3.2 (and possibly other 4.4-Lite-derived
BSDs), if HAVE_UNISTD_H is defined before "zlib.h" is included, the
declaration of "gzseek()" in "zlib.h" expands to something that doesn't
match what's in the OS's "zlib".

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

svn path=/trunk/; revision=720
1999-09-24 05:49:53 +00:00
Gilbert Ramirez c2e3c9efb4 Many more packaging changes. Lets compilation with new gtk subdirectory
work if build tree is different than source tree. Some wiretap files
had to be added to the list of deliverables.

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

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

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

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

svn path=/trunk/; revision=701
1999-09-23 04:39:01 +00:00
Ashok Narayanan 911336a0e1 Fix to allow compressed file handling of Ascend captures
svn path=/trunk/; revision=699
1999-09-22 07:37:46 +00:00
Ashok Narayanan 818783636d Oops - new file for zLib commit which I missed out.
svn path=/trunk/; revision=696
1999-09-22 01:28:04 +00:00
Ashok Narayanan 3dfa56c498 This commit contains support for reading capture files compressed using
gzip. The zLib library is used for this purpose. If zLib is not available
(or it's use is disabled by the --disable-zlib option to configure), you
can still compile Ethereal but it will be unable to read compressed capture
files.

IMPORTANT:

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

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

svn path=/trunk/; revision=695
1999-09-22 01:26:50 +00:00
Gerald Combs 9275703fc5 Added support for Lucent/Ascend "wdd" output.
svn path=/trunk/; revision=675
1999-09-13 03:52:53 +00:00
Gerald Combs f4f6b71d0c Add support for "wdd" trace output.
svn path=/trunk/; revision=673
1999-09-13 03:49:04 +00:00
Laurent Deniel 35d5e37a82 Some old CPP or tools that take C code in input do
not like #preprocessor_macros that do not start at
the first column.

So write:

#ifdef FOO
#  include <dummy1.h>
#  define DUMMY 1
#else
#  include <dummy2.h>
#  define DUMMY 2
#endif

instead of

#ifdef FOO
  #include <dummy1.h>
  #define DUMMY 1
#else
  #include <dummy2.h>
  #define DUMMY 2
#endif

svn path=/trunk/; revision=668
1999-09-12 14:34:36 +00:00
Gerald Combs feda83f7e0 Added Guy's patch to use the pseudo header facility to pass up the Ascend
metadata.

Also added filter items for the session and task number.

svn path=/trunk/; revision=664
1999-09-11 22:36:38 +00:00
Guy Harris 4ac044cc3e Get rid of an unused variable.
svn path=/trunk/; revision=663
1999-09-11 20:30:34 +00:00
Guy Harris b32b29be35 "ascend_seek()" isn't used outside "ascend.c", so make it static to
"ascend.c".

svn path=/trunk/; revision=659
1999-09-11 07:07:41 +00:00
Guy Harris bac7494ff0 "ascend_read()" is local to "ascend.c" - declare it there, not in
"ascend.h".

svn path=/trunk/; revision=657
1999-09-11 06:49:42 +00:00
Guy Harris de7081f8ff Include "ascend.h" to declare "ascend_seek_read()".
"wtap_seek_read()" should return the value of "ascend_seek_read()" or
"wtap_def_seek_read()".

svn path=/trunk/; revision=656
1999-09-11 06:48:33 +00:00
Gerald Combs 70481fcc84 Add in ascend.c, ascend.h, ascend-grammar.y and ascend-scanner.l. These
read and parse the Lucent/Ascend trace output.

svn path=/trunk/; revision=653
1999-09-11 04:53:26 +00:00
Gerald Combs 9386f23fee Added support for Lucent/Ascend packet traces. The MAX and Pipeline router
family has a set of debug commands that allow you to log the traffic on a
WAN or dialup connection as text, e.g.

RECV-iguana:241:(task: B04E12C0, time: 1975358.50) 15 octets @ 8003D634
  [0000]: FF 03 00 3D C0 06 C9 96 2D 04 C1 72 00 05 B8

Created wtap_seek_read() which parses the textual data for and Ascend
trace, and does a normal fseek() and fread() for any other file type.
The fseek()/fread() pairs in file.c were replaced with the new function.

svn path=/trunk/; revision=652
1999-09-11 04:50:44 +00:00
Guy Harris 338f3ff2ad Put in an RCS ID (and a copyright notice and GPL notice; unfortunately,
this causes "Makefile.in" to have two GPL notices - "Makefile.in" and
the "Makefile" generated from it are generated files, so maybe that's
OK).

svn path=/trunk/; revision=639
1999-09-09 03:55:49 +00:00
Guy Harris c135be4e53 When skipping over the padding at the end of a record in a capture file,
don't seek around it - some implementations of the standard I/O library
routines (e.g., the ones in Solaris 2.5.1, at least) appear not to be
clever enough to handle seeks that occur within the buffer by moving the
current buffer position; instead, they do a seek on the underlying file
descriptor *and* appear to throw out the buffer, forcing them to do
another read.

Instead, read it into a buffer.

svn path=/trunk/; revision=626
1999-09-02 00:14:06 +00:00
Guy Harris b87ec88778 When reading packets from a capture file, don't seek around record
header fields we don't look at - some implementations of the standard
I/O library routines (e.g., the ones in Solaris 2.5.1, at least) appear
not to be clever enough to handle seeks that occur within the buffer by
moving the current buffer position; instead, they do a seek on the
underlying file descriptor *and* appear to throw out the buffer, forcing
them to do another read.

Instead, read the entire record header into a structure, and pick the
relevant bits out of it.

Also, skip over the FCS in LAPB captures by reading it rather than
seeking around it (should we put it in the pseudo-header?).

svn path=/trunk/; revision=625
1999-09-01 23:53:58 +00:00
Guy Harris 9d14dfd6a9 Fix, from Bert Driehuis, to the stuff that checks for BSD/OS.
svn path=/trunk/; revision=620
1999-08-31 22:36:20 +00:00
Guy Harris 81cda54d24 Olivier Abad's fix to the problem where some capture files appeared to
be truncated - treat a record with a data length of 0 as an end of file.

svn path=/trunk/; revision=619
1999-08-31 17:40:49 +00:00
Guy Harris 2f1f2b08ed Convert the seconds value to the right byte order before using it at
all, not just before the third time you use it....

svn path=/trunk/; revision=613
1999-08-31 00:25:19 +00:00
Guy Harris d6147cd00a Fixes from Olivier Abad to the code to maintain "wth->data_offset".
Use "pletohs()" and "pletohl()" to access 16-bit and 32-bit fields in
the file and packet headers, as those fields are little-endian.

svn path=/trunk/; revision=612
1999-08-30 20:40:13 +00:00
Guy Harris ae53260d02 Keep in the "wtap" structure the current offset into the file being
read, and maintain it ourselves as we read through the file, rather than
calling "ftell()" for every packet we read - "ftell()" may involve an
"lseek()" call, which could add a noticeable CPU overhead when reading a
large file.

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

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

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

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

svn path=/trunk/; revision=552
1999-08-22 19:08:40 +00:00
Guy Harris 5a2b4b7ad2 Fix the pcap-encapsulation-to-wiretap-encapsulation mapping table.
Have the code that opens "libpcap" files for writing check to make sure
that the Wiretap encapsulation can be written to a "libpcap" file, and
return -1 and supply a new WTAP_ERR_UNSUPPORTED_ENCAP error code if it
can't.

Handle that new error code in "wtap_strerror()".

svn path=/trunk/; revision=546
1999-08-22 03:50:31 +00:00
Guy Harris c82c5954f2 Add a "wtap_strerror()" routine, which takes as an argument an error
code supplied by a Wiretap routine (whether a positive UNIX "errno" code
or a negative Wiretap error code), and returns an error message
corresponding to it.

Use that to construct the message Ethereal put up in a message box for
those errors for which we don't have Ethereal put up a message of its
choice.

svn path=/trunk/; revision=545
1999-08-22 02:52:48 +00:00
Guy Harris 4b9ab6d1fc Get rid of some cruft left in by previous checkins as placeholders.
Get rid of WTAP_ENCAP_NONE; replace it with WTAP_ENCAP_UNKNOWN, which
means "I can't handle that file, it's using an encapsulation I don't
support".

Check for encapsulations we don't support, and return an error (as is
already done in "libpcap.c").

Check for too-large packet sizes, and return an error (as is already
done in "libpcap.c").

Print unsigned quantities in Wiretap messages with "%u", not "%d".

svn path=/trunk/; revision=544
1999-08-22 02:29:40 +00:00
Guy Harris ee39938f67 DLT_NULL, from "libpcap", means different things on different platforms
and in different capture files; throw in some heuristics to try to
figure out whether the 4-byte header is:

	1) PPP-over-HDLC (some version of ISDN4BSD?);

	2) big-endian AF_ value (BSD on big-endian platforms);

	3) little-endian AF_ value (BSD on little-endian platforms);

	4) two octets of 0 followed by an Ethernet type (Linux, at least
	   on little-endian platforms, as mutated by "libpcap").

Make a separate Wiretap encapsulation type, WTAP_ENCAP_NULL,
corresponding to DLT_NULL.

Have the PPP code dissect the frame if it's PPP-over-HDLC, and have
"ethertype()" dissect the Ethernet type and the rest of the packet if
it's a Linux-style header; dissect it ourselves only if it's an AF_
value.

Have Wiretap impose a maximum packet size of 65535 bytes, so that it
fails more gracefully when handed a corrupt "libpcap" capture file
(other capture file formats with more than a 16-bit capture length
field, if any, will have that check added later), and put that size in
"wtap.h" and have Ethereal use it as its notion of a maximum packet
size.

Have Ethereal put up a "this file appears to be damaged or corrupt"
message box if Wiretap returns a WTAP_ERR_BAD_RECORD error when opening
or reading a capture file.

Include loopback interfaces in the list of interfaces offered by the
"Capture" dialog box, but put them at the end of the list so that it
doesn't default to a loopback interface unless there are no other
interfaces.  Also, don't require that an interface in the list have an
IP address associated with it, and only put one entry in the list for a
given interface (SIOCGIFCONF returns one entry per interface *address*,
not per *interface* - and even if you were to use only IP addresses, an
interface could conceivably have more than one IP address).

Exclusively use Wiretap encapsulation types internally, even when
capturing; don't use DLT_ types.

svn path=/trunk/; revision=540
1999-08-22 00:47:56 +00:00
Guy Harris 3a41de3bbb The 16-bit and 32-bit fields in the "frame4" record header in ATM
Sniffer captures are little-endian; convert them as necessary.

svn path=/trunk/; revision=535
1999-08-20 23:11:05 +00:00
Guy Harris b66b74efe7 Fix a comment.
svn path=/trunk/; revision=528
1999-08-20 08:00:24 +00:00
Guy Harris e8ba74cbf1 Add Olivier Abad to the list of Wiretap authors, as the code to read
RADCOM WAN/LAN Analyzer capture files is his.

svn path=/trunk/; revision=527
1999-08-20 07:58:50 +00:00
Guy Harris ac2418871b Note that we now have the ability to read Ethernet and X.25 captures
from RADCOM WAN/LAN Analyzers.

(BTW, the previous checkin also removed the comments about the hack
wherein we pretended that ATM Sniffer captures were really Ethernet,
Token-Ring, or RFC 1483 captures, given that said hack was itself
removed.)

svn path=/trunk/; revision=526
1999-08-20 07:55:49 +00:00
Guy Harris bcb5f49177 Remove the stuff about filters in Wiretap, as that capability was
removed when a more powerful display filtering mechanism was added to
Ethereal.

svn path=/trunk/; revision=525
1999-08-20 07:51:22 +00:00
Guy Harris 942470521a Get rid of an unused variable left stranded on the beach when a wave
washed out to sea the code that used to pretend that an ATM Sniffer
capture was an Ethernet or Token-Ring Sniffer capture.

svn path=/trunk/; revision=524
1999-08-20 07:38:30 +00:00
Guy Harris a033390918 Add support for reading Full Frontal ATM from an ATM Sniffer capture
file, instead of throwing out all but LANE or RFC 1483 data frames and
pretending that the former are just Ethernet or Token-Ring frames.

Add some level of decoding for ATM LANE, but not all of it; the rest,
including decoding non-LANE frames, is left as an exercise for somebody
who has captures they want to decode, an interest in decoding them, ATM
expertise, and time....

svn path=/trunk/; revision=523
1999-08-20 06:55:20 +00:00
Gilbert Ramirez a3c2258350 Made LanAlyzer smarter about reading trace files, thereby removing a
variable from lanalyzer_t (plus an additional variable which wasn't being
used). While I was in there I cleaned up some comments and renamed a couple
variables to make more sense.

svn path=/trunk/; revision=521
1999-08-20 04:49:18 +00:00
Gilbert Ramirez 49388049d3 Made iptrace wiretap module return error on partial packets, instead of
expecting it as normal. Added paragraph about iptrace oddities to README.
I also added a section to the README about how to report bugs.

svn path=/trunk/; revision=519
1999-08-20 04:07:09 +00:00
Guy Harris aae22bd227 Have the per-capture-file-type open routines "wtap_open_offline()" calls
return 1 on success, -1 if they got an error, and 0 if the file isn't of
the type that file is checking for, and supply an error code if they
return -1; have "wtap_open_offline()" use that error code.  Also, have
the per-capture-file-type open routines treat errors accessing the file
as errors, and return -1, rather than just returning 0 so that we try
another file type.

Have the per-capture-file-type read routines "wtap_loop()" calls return
-1 and supply an error code on error (and not, as they did in some
cases, call "g_error()" and abort), and have "wtap_loop()", if the read
routine returned an error, return FALSE (and pass an error-code-pointer
argument onto the read routines, so they fill it in), and return TRUE on
success.

Add some new error codes for them to return.

Now that "wtap_loop()" can return a success/failure indication and an
error code, in "read_cap_file()" put up a message box if we get an error
reading the file, and return the error code.

Handle the additional errors we can get when opening a capture file.

If the attempt to open a capture file succeeds, but the attempt to read
it fails, don't treat that as a complete failure - we may have managed
to read some of the capture file, and we should display what we managed
to read.

svn path=/trunk/; revision=518
1999-08-19 05:52:55 +00:00
Guy Harris 137ba48d18 Have the per-capture-file-type open routines "wtap_open_offline()" calls
return 1 on success, -1 if they got an error, and 0 if the file isn't of
the type that file is checking for, and supply an error code if they
return -1; have "wtap_open_offline()" use that error code.  Also, have
the per-capture-file-type open routines treat errors accessing the file
as errors, and return -1, rather than just returning 0 so that we try
another file type.

Have the per-capture-file-type read routines "wtap_loop()" calls return
-1 and supply an error code on error (and not, as they did in some
cases, call "g_error()" and abort), and have "wtap_loop()", if the read
routine returned an error, return FALSE (and pass an error-code-pointer
argument onto the read routines, so they fill it in), and return TRUE on
success.

Add some new error codes for them to return.

Now that "wtap_loop()" can return a success/failure indication and an
error code, in "read_cap_file()" put up a message box if we get an error
reading the file, and return the error code.

Handle the additional errors we can get when opening a capture file.

If the attempt to open a capture file succeeds, but the attempt to read
it fails, don't treat that as a complete failure - we may have managed
to read some of the capture file, and we should display what we managed
to read.

svn path=/trunk/; revision=516
1999-08-19 05:31:38 +00:00
Gilbert Ramirez 7843c01d38 Changes to compile in win32.
svn path=/trunk/; revision=515
1999-08-18 22:49:48 +00:00
Guy Harris 0f62ffc5df In "wtap_dump_close()", don't shove the return value of "fclose()" into
the variable for the return value of "wtap_dump_close()", just check it
against EOF; shoving it into "ret" means it gets set to 0 on a
successful close, but a return value of 0 means "wtap_dump_close()"
failed.

svn path=/trunk/; revision=514
1999-08-18 17:49:34 +00:00
Guy Harris 31d104a9c5 "wtap_pcap_encap_to_wtap_encap()" shouldn't return a file type if it
can't translate the encapsulation type, it should return an
encapsulation type; we add a new one, WTAP_ENCAP_UNKNOWN. and have it
return that.

Have "capture()" handle "wtap_pcap_encap_to_wtap_encap()" returning that
encapsulation type (if it happens, we need to add a new Wiretap
encapsulation type to handle the new "libpcap" encapsulation type).

svn path=/trunk/; revision=513
1999-08-18 17:08:47 +00:00
Guy Harris 28809e2002 Make "wtap_dump()" and "wtap_dump_close()" return error codes, and check
for errors when closing a file to which we've written packets (we don't
bother checking if we're giving up on a capture).

Add some more error checks in Wiretap.

Make a single list of all Wiretap error codes, giving them all different
values (some can be returned by more than one routine, so they shouldn't
be per-routine).

svn path=/trunk/; revision=510
1999-08-18 04:41:20 +00:00
Guy Harris df490a7085 Add to Wiretap the ability to write capture files; for now, it can only
write them in "libpcap" format, but the mechanism can have other formats
added.

When creating the temporary file for a capture, use "create_tempfile()",
to close a security hole opened by the fact that "tempnam()" creates a
temporary file, but doesn't open it, and we open the file with the name
it gives us - somebody could remove the file and plant a link to some
file, and, if as may well be the case when Ethereal is capturing
packets, it's running as "root", that means we write a capture on top of
that file....  (The aforementioned changes to Wiretap let you open a
capture file for writing given an file descriptor, "fdopen()"-style,
which this change requires.)

svn path=/trunk/; revision=509
1999-08-18 04:17:38 +00:00
Guy Harris 8f0acf3551 Have "wtap_open_offline()" return, on failure, an indication of the
reason for the failure, and have it do the checks to make sure the file
being opened is a plain file or a pipe.

Have "open_cap_file()" make use of that.

Don't automatically set "last_open_dir" if a "-r" flag was specified on
the command line - do so only if the file in question could actually be
opened.

svn path=/trunk/; revision=495
1999-08-15 06:59:13 +00:00
Gilbert Ramirez d45629555b Update version numbers to 0.7.0, and update win32 Makefiles. I made some
initial #ifdef changes to capture.c to support the win32 version of libpcap.

svn path=/trunk/; revision=428
1999-08-03 20:51:41 +00:00
Guy Harris 582a64f482 Add to "wtap_close()" code to free up data structures allocated for
reading RADCOM WAN/LAN analyzer files and NetXRay/Windows Sniffer files.

svn path=/trunk/; revision=418
1999-08-02 02:35:57 +00:00
Guy Harris a75f7d1d24 Olivier Abad's patch to add dissectors for LAP-B and X.25, and wiretap
support for RADCOM Ltd.'s WAN/LAN analyzers (see

	http://www.radcom-inc.com/

).  Note: a

Make "S" a mnemonic for "Summary" in the "Tools" menu.

Move the routine, used for the "Tools/Summary" display, that turns a
wiretap file type into a descriptive string for it into the wiretap
library itself, expand on some of its descriptions, and add an entry for
files from a RADCOM analyzer.

Have "Tools/Summary" display the snapshot length for the capture.

svn path=/trunk/; revision=417
1999-08-02 02:26:22 +00:00
Guy Harris 79c2223425 Check in Olivier Abad's patch to add dissectors for LAP-B and X.25, and
wiretap support for RADCOM Ltd.'s WAN/LAN analyzers (see

	http://www.radcom-inc.com/

).  Note: as I remember, IEEE 802.2/ISO 8022 LLC has somewhat of an SDLC
flavor to it, just as I think LAP, LAPB, LAPD, and so on do, so we may
be able to combine some of the LLC dissection and the LAPB dissection
into common code that could, conceivably be used for other SDLC-flavored
protocols.

Make "S" a mnemonic for "Summary" in the "Tools" menu.

Move the routine, used for the "Tools/Summary" display, that turns a
wiretap file type into a descriptive string for it into the wiretap
library itself, expand on some of its descriptions, and add an entry for
files from a RADCOM analyzer.

Have "Tools/Summary" display the snapshot length for the capture.

svn path=/trunk/; revision=416
1999-08-02 02:04:38 +00:00
Guy Harris 6f1d3a3be8 Patches from Thierry Andry to support Classical IP captures from systems
with the ATM on Linux software from <http://lrcwww.epfl.ch/linux-atm/>.

svn path=/trunk/; revision=401
1999-07-28 23:16:42 +00:00
Laurent Deniel c42634dd82 Fix the -S option :
- read only the real number of packets that have been written
  by the child process. That's avoid incomplete packet read.
- special timeout handling no more necessary and the whole
  real time capture and display behavior is much more
  satisfying with this patch.
- wiretap modified to allow the reading of 'count' packets
  with wtap_loop.

svn path=/trunk/; revision=398
1999-07-28 20:17:24 +00:00
Gerald Combs c7e8a7e855 Added a patch from Olivier Abad to handle X.25 iptrace captures.
svn path=/trunk/; revision=390
1999-07-28 01:35:34 +00:00
Gilbert Ramirez 1708722fc2 Removed automatically-generated files from CVS. Some files are generated,
others are copied into the build-tree by 'automake -a'. The autogen.sh
script runs autoheader, automake, and autoconf for the developer in order
to populate a fresh CVS image with the generated build tools.

svn path=/trunk/; revision=388
1999-07-27 04:43:22 +00:00
Gilbert Ramirez 7e9230a0bd Finally got the win32 ethereal to link properly with MSVC.
svn path=/trunk/; revision=374
1999-07-21 17:40:42 +00:00
Gilbert Ramirez 0d36ec8de2 Modified the proto_register_field_array usage again. Thanks to Guy's
suggestion, this new method using a static array should use less memory
and be faster. It also has a nice side-effect of making the source-code
more readble, IMHO.

Changed the print routines to look for protocol proto_data instead of
looking at the text label as they did before, hoping that the data hex
dump field item starts with "Data (".

Added the -G keyword to ethereal to make it dump a glossary of display
filter keywords to stdout and exit. This data is then formatted with
the doc/dfilter2pod perl program to pod format, which is combined
with doc/ethereal.pod.template to create doc/ethereal.pod, from which
the ethereal manpage is created. This way we can keep the manpage up-to-date
with a list of fields that can be filtered on.

svn path=/trunk/; revision=364
1999-07-15 15:33:52 +00:00
Gilbert Ramirez 601c52f0fb Added support for compiling on win32 with Visual C and 'nmake'. It compiles,
but does not link. Perhaps someone who understands the MS tools can help
out. I made it link a few months ago, but with different version of glib/gtk+.
I can't remember how I made it link.

Most of the compatibility issues were resolved with adding
#ifdef HAVE_UNISTD_H the the source code. Please be sure to add this to all
future code.

svn path=/trunk/; revision=359
1999-07-13 02:53:26 +00:00
Gilbert Ramirez 53d2a96094 Added Johan's RADIUS dissector, finally. I modified it to fit in with the
new proto_tree routines. I also removed the check for lex and yacc from
wiretap's configure script. The IP dissector now uses
proto_register_field_array().

svn path=/trunk/; revision=348
1999-07-08 04:23:28 +00:00
Gilbert Ramirez 56c0587491 Fixed the byte_range implementation, and removed some of the C-style
operators that I had thrown in at the last moment. Sorry! But I'm trying
to get rid of those embarrassing shift/reduce and reduce/reduce warnings.
I also removed wiretap/wiretap.c, which is no longer needed.

svn path=/trunk/; revision=345
1999-07-08 03:05:55 +00:00
Gilbert Ramirez 9f9d19f529 Removed old #include's.
svn path=/trunk/; revision=343
1999-07-07 22:58:37 +00:00
Gilbert Ramirez 07f42b5b31 Created a new protocol tree implementation and a new display filter
mechanism that is built into ethereal. Wiretap is now used to read all
file formats. Libpcap is used only for capturing.

svn path=/trunk/; revision=342
1999-07-07 22:52:57 +00:00
Guy Harris 7a4fe9b1c3 Include <sys/types.h> before including <netinet/in.h> - you have to do
that on FreeBSD, at least.

svn path=/trunk/; revision=338
1999-07-04 06:47:09 +00:00
Gilbert Ramirez 7ea29fb80d Added Aaron Hillegass' summary dialogue. We're ignoring the problem with
NetMon statistic packets for now. We might fix that problem with wiretap,
either filtering out those packets, and/or providing the summary
information through a new wiretap API.

svn path=/trunk/; revision=326
1999-06-22 22:02:39 +00:00
Gilbert Ramirez caf9c3e964 Made BPF disassembly in wiretap.c a bit easier to read.
svn path=/trunk/; revision=292
1999-05-19 13:49:35 +00:00
Guy Harris 6399732b86 Add support for Network Monitor 2.0 files, thanks to information
supplied by Tim Farley.

Tim also indicated that the Network Monitor network types may be NDIS
network types+1.  It also appears that NetXRay/Windows Sniffer network
types may be NDIS network types as well.

svn path=/trunk/; revision=284
1999-05-12 21:40:07 +00:00
Gilbert Ramirez 78b0c26cfa Changed wiretap rules so that ordinary user doesn't need bison and flex
if they just compile the source and don't modify any source files.

svn path=/trunk/; revision=280
1999-05-12 04:56:10 +00:00
Gilbert Ramirez 1f8cc10010 Made the executable portable; it will now work on machines other than my
own. It allocates and fills in its own wtap struct.

svn path=/trunk/; revision=257
1999-05-07 03:33:42 +00:00
Gilbert Ramirez 77e276e617 Fixed 0.6.0 packaging problems.
svn path=/trunk/; revision=252
1999-05-01 05:19:25 +00:00
Gilbert Ramirez 2b86d46d70 Jun-ichiro's IPv6 patch is merged in with ethereal and now uses the new
proto*() functions. The configure script tries to use ipv6 name resolution if
it knows the type of ipv6 stack the user has (this can be avoided with the
--disable-ipv6 switch) Additionally, the configure script now deals with wiretap
better. If the user doesn't want to compile wiretap, the wiretap is never
visited. A few unnecessary #includes were removed from some wiretap files, and
a CPP macro was moved from bpf.c to wtap.h.

svn path=/trunk/; revision=229
1999-03-28 18:32:03 +00:00
Guy Harris 4932ef3dcc The program that produced the version 2.001 file was Sniffer Pro 2.50.05
(presumably a Windows version).

Note also that version 2.001 files appear to have microsecond time
stamps, like version 1.1 files.

svn path=/trunk/; revision=228
1999-03-25 06:34:32 +00:00
Gilbert Ramirez bdbd5ee203 Got rid of "hdr_size may not be initialized" warning, even though it was
innocuous.

svn path=/trunk/; revision=221
1999-03-22 15:02:25 +00:00
Guy Harris dad4930e18 Add support for file format version 2.001 (used by Sniffer Basic 2.0?).
This assumes that the time stamps are still in units of microseconds; I
don't yet have a text decode of the version-2.001 file from the program
that decoded it, so I can't check the time stamps.

svn path=/trunk/; revision=218
1999-03-22 02:46:46 +00:00
Guy Harris 56b5a15d5f Add support for file format version 2.001 (used by Sniffer Basic 2.0?).
This assumes that the time stamps are still in units of microseconds; I
don't yet have a text decode of the version-2.001 file from the program
that decoded it, so I can't check the time stamps.

svn path=/trunk/; revision=217
1999-03-20 09:10:49 +00:00
Gilbert Ramirez f19fe6afea Added g_slist_nth_data() to glib-new.o so that glib-1.0.x, x < 4, will work.
It seems that a stable version of the library received a new function. This
should help RedHat folks, since they seem to have glib-1.0.1.

svn path=/trunk/; revision=216
1999-03-20 04:41:04 +00:00
Guy Harris 71b4a3f7c8 Add "phtons()" and "phtonl()" macros, which handle unaligned quantities,
and use them to extract stuff in "bpf_mk_bytecmp()", so as to avoid core
dumps on processors that require strict alignment.

svn path=/trunk/; revision=214
1999-03-13 08:39:08 +00:00
Guy Harris 985a5b01d7 It's not a problem if we don't have GLib 1.1.x or later, so don't
complain about it.

svn path=/trunk/; revision=209
1999-03-03 08:51:58 +00:00
Guy Harris 5044b432cf Include "config.h", so we know whether we have GLib 1.0[.x] or later, so
we know whether to include "glib-new.h".

svn path=/trunk/; revision=208
1999-03-03 08:31:43 +00:00
Gilbert Ramirez 0cf5b2de74 Fixed for glib-1.x.y, x > 0
svn path=/trunk/; revision=206
1999-03-02 19:32:33 +00:00
Guy Harris 2ed0b6d073 Have "rt-scanner.l" and "rt-grammar.y" depend on the filter description
files used to generate them.

svn path=/trunk/; revision=205
1999-03-02 07:04:55 +00:00
Guy Harris e2b7e1aba9 It turns out that the first of the unknown fields in the NetXRay header
appears to be the UNIX "time_t" when the capture started, so use that to
figure out the time when a packet was captured.

svn path=/trunk/; revision=204
1999-03-01 22:59:47 +00:00
Gilbert Ramirez 70451c547a lex_init() changed to wtap_lex_init()
svn path=/trunk/; revision=203
1999-03-01 21:50:20 +00:00
Gilbert Ramirez 3101077f2c Guy noticed that lex_init was a function in both libpcap and wiretap. Fixed.
svn path=/trunk/; revision=202
1999-03-01 21:48:30 +00:00
Guy Harris 4375cad111 Add an "acinclude.m4", from which "aclocal.m4" is made.
Add "HAVE_GLIB10" to "acconfig.h", so that all the "auto*" stuff is
happy.

svn path=/trunk/; revision=201
1999-03-01 21:45:54 +00:00
Guy Harris c8643cdee6 Fix a typo, and note that we can read Token Ring captures from Sniffer
Basic/Windows Sniffer Pro.

svn path=/trunk/; revision=200
1999-03-01 20:35:33 +00:00
Gilbert Ramirez 2dbd008ea5 Added display filters to wiretap.
svn path=/trunk/; revision=198
1999-03-01 18:57:07 +00:00
Guy Harris 8078050304 Update to reflect support for NetXRay format.
svn path=/trunk/; revision=195
1999-02-20 08:12:20 +00:00
Guy Harris 3200c25437 Add support for Cinco Networks NetXRay - which is, after their acquision
by Network General (subsequently merged with McAfee Associates into
Network Associates), called "Sniffer Basic".

A similar format appears to be used by the Windows Sniffer Pro.

svn path=/trunk/; revision=194
1999-02-20 06:49:27 +00:00
Guy Harris 0768c4b989 Make the "magic number" a "const" string.
svn path=/trunk/; revision=193
1999-02-20 06:46:57 +00:00
Guy Harris 19d8e24ab0 Fix a typo in a comment, and make the "magic number" a "const" string.
svn path=/trunk/; revision=192
1999-02-20 06:46:33 +00:00
Gilbert Ramirez bba66b6f0f Change to wtap.c switch() statement to allow compilation under IBM's C compiler.
It didn't like an empty default case. And <time.h> was forgotten in netmon.c

svn path=/trunk/; revision=188
1999-02-12 16:26:09 +00:00
Guy Harris 755e008e0d Correct and expand the discussion of ATM Sniffer captures.
svn path=/trunk/; revision=179
1999-01-30 09:44:21 +00:00
Gilbert Ramirez 7cae0c6bd3 Modified code to allow compilation under IBM's C compiler for AIX.
svn path=/trunk/; revision=178
1999-01-29 17:06:56 +00:00
Gilbert Ramirez 4e1c7318cb Added token-ring support to netmon.c
svn path=/trunk/; revision=176
1999-01-27 14:54:09 +00:00
Gilbert Ramirez 4efa83b58e Added news about Guy's netmon addition.
svn path=/trunk/; revision=174
1999-01-21 05:07:45 +00:00
Gilbert Ramirez 10c23c3cd2 I changed the wtap_open_offline() function so that it takes only the
filename as the parameter. So far all the filetypes that wiretap can read
can be inferred from the first few bytes of the file, so we never
have to give wiretap a hint as to the file type.

svn path=/trunk/; revision=173
1999-01-21 05:03:56 +00:00
Gilbert Ramirez 43a8b4b5a5 Added Guy's netmon.[ch] files to CVS for him. His firewall admins forgot
to add ssh to their firewall rules, so he's out of CVS for a few days.
This adds support for MS Network Monitor files to wiretap.

svn path=/trunk/; revision=172
1999-01-18 21:34:54 +00:00
Guy Harris 5910deaa46 Add suppport for Microsoft Network Monitor Ethernet capture files.
svn path=/trunk/; revision=171
1999-01-17 09:33:15 +00:00
Gerald Combs 14ea89ec11 * Modified Makefile.am and configure.in so that wiretap isn't built unless
--with-wiretap is specified.

svn path=/trunk/; revision=169
1999-01-13 04:14:29 +00:00
Gilbert Ramirez a68f557e27 Use g_free instead of free so that I don't have to include <stdlib.h>
for just one function.

svn path=/trunk/; revision=165
1999-01-08 17:24:01 +00:00
Gilbert Ramirez f1d8e63a43 Logged my change about per-packet encapsulation types.
svn path=/trunk/; revision=163
1999-01-07 16:43:40 +00:00
Gilbert Ramirez 7757b2e72b I removed the per-file encapsulation type from wiretap, and make all filetypes
provide a per-packet encapsulation type. this required minor modifications to
ethereal.

svn path=/trunk/; revision=162
1999-01-07 16:15:37 +00:00
Gerald Combs b0fe085dc3 * Final commit for version 0.5.1
* Added RPM .spec file (Martin Maciaszek)
* Added Martin to AUTHORS

svn path=/trunk/; revision=149
1999-01-04 01:31:18 +00:00
Gilbert Ramirez efa3b6ff41 Added files to handle AIX iptrace 2.0 files in wiretap.
svn path=/trunk/; revision=148
1999-01-03 04:30:13 +00:00
Gilbert Ramirez 9a50326466 I made sure to note that wiretap only supports iptrace 2.0 files so far.
iptrace 1.0 is not supported yet.

svn path=/trunk/; revision=146
1999-01-02 06:50:30 +00:00
Gilbert Ramirez 3688d96c45 Added the iptrace (AIX's packet-capture tool) file format to wiretap.
This necessitated a change in ethereal because iptrace supports multi-NIC
packet capturing, including multi-datalink-type capturing.

svn path=/trunk/; revision=145
1999-01-02 06:10:55 +00:00
Gerald Combs cb1f8e34c5 * Added Joerg Mayer's Vines patch
* Added Joerg to the AUTHORS file
* Added Guy's bitfield decode patch
* Fixed time output

svn path=/trunk/; revision=142
1998-12-29 04:05:38 +00:00
Gilbert Ramirez e071c65555 Added Guy Harris' patch to read Sniffer ATM trace files. Very nice.
svn path=/trunk/; revision=128
1998-12-17 06:39:13 +00:00
Gilbert Ramirez 5676298385 A patch spread across many files to let Ethereal compile under GTK+-1.1.x.
Tests for GTK versions are done during compilation, not during "./configure".
The big problems have been taken care of in this patch (functional change
in the packet clist and conversion of menu_factory to item_factory), but
plenty of smaller problems with dialogue boxes abound. I have fixed
a small problem with file_open*(), but have left 2 comments in just in case
I'm not going about this the right way. Can someone verify?

svn path=/trunk/; revision=127
1998-12-17 05:42:33 +00:00
Guy Harris dfceeaeb7c Fix the bitmask for the hour field in a DOS-format time (not that it
matters, as that code is commented out).

svn path=/trunk/; revision=125
1998-12-15 04:11:58 +00:00
Gilbert Ramirez 40dfa08bab Debug statement commented out.
svn path=/trunk/; revision=124
1998-12-13 05:38:13 +00:00
Gilbert Ramirez 84e0fc12a0 Added Guy's patch to calculate date of Sniffer packet trace. I copied
bits of it to do the same for Lanalyzer packets.

svn path=/trunk/; revision=123
1998-12-13 05:08:05 +00:00
Gilbert Ramirez 4220c8722e LANalyzer records time in half microseconds, not microseconds.
svn path=/trunk/; revision=120
1998-11-23 15:48:38 +00:00
Gilbert Ramirez cd7484ddf5 Added time-stamp decoding to LANalyzer decodes, made minor comment changes to
ngsniffer.c, and removed DLT_* defines from wtap.h

svn path=/trunk/; revision=119
1998-11-23 04:40:22 +00:00
Gilbert Ramirez bb9f28af0f The Sniffer-reading code now checks to make sure that it is trying
to read an uncompressed Sniffer file.

svn path=/trunk/; revision=118
1998-11-21 05:08:40 +00:00
Guy Harris f0e0581ff5 Pick up from Ethereal's "configure.in" the test to check whether we're
running GCC and, if so, to add the "-Wall" flag.

svn path=/trunk/; revision=116
1998-11-21 03:26:54 +00:00
Gilbert Ramirez 5174440b33 I gave Guy the credit he deserves.
svn path=/trunk/; revision=112
1998-11-20 05:54:39 +00:00
Gerald Combs dae8277e20 * Don't build wiretap if it isn't configured.
* Bump the version to 0.5.0

svn path=/trunk/; revision=106
1998-11-18 04:02:17 +00:00
Gerald Combs b0fdc8edb2 * Added patches from Laurent and Guy
svn path=/trunk/; revision=103
1998-11-18 03:01:44 +00:00
Guy Harris 7706f98d21 Add the header files to "libwiretap_a_SOURCES", so they get included if
you do "make dist".

svn path=/trunk/; revision=100
1998-11-17 06:16:52 +00:00
Guy Harris 54830f9398 Add the header files to "libwiretap_a_SOURCES", so they get included if
you do "make dist".

svn path=/trunk/; revision=99
1998-11-17 05:34:29 +00:00
Gerald Combs 6ca358948b * Added column formatting functionality.
* Added check_col(), add_col_str() and add_col_fmt() to replace references
  to ft->win_info.
* Added column prefs handling code.

svn path=/trunk/; revision=97
1998-11-17 04:29:13 +00:00
Guy Harris d8e026fc3b Un-comment "AC_CONFIG_SUBDIRS()", so that it'll run "configure" in the
"wiretap" subdirectory, and thus leave a "config.status" file around so
that one of the "auto{make,configure,header}" guys doesn't complain when
rebuilding stuff that it can't open "config.status".  (The
"automake"-generated Makefile will recurse into "wiretap", and, at least
if you're doing builds from a tree freshly checked out from CVS, "XXX"
files will probably have been checked out before "XXX.in", so "make"
will try to reconstruct the "XXX" files from the "XXX.in" files.)

That also obviates the need to make "wiretap/Makefile" here.

We can also re-delete "wiretap/Makefile" from CVS - the problem that
caused me to bring it back wasn't caused by its absence, it was caused
by the above.  As "Makefile"s generated by "configure" scripts depend on
the particular system on which you ran "configure", there's no One True
Makefile so "Makefile" should'n't be under CVS.

svn path=/trunk/; revision=95
1998-11-17 02:02:46 +00:00
Guy Harris 3e056dd83a Put the Makefile back, in the hopes that it'll prevent at least one of
the many complaints you get if you do a "configure" followed by a "make"
in a freshly-checked-out Ethereal source tree (it bitches when, or maybe
after, "automake"ing it, complaining about not being able to open
"config.status" - the right fix might be to make the "configure" script
recurse).

svn path=/trunk/; revision=94
1998-11-16 22:24:03 +00:00
Guy Harris 79bafc1b7d Remove the Makefile from CVS - Ethereal doesn't have its Makefile under
CVS; it's generated by the "configure" script, and the resulting
Makefile is platform-dependent, so there's no One True Makefile to put
under CVS.

svn path=/trunk/; revision=93
1998-11-15 05:45:36 +00:00
Guy Harris 86bf1fc851 Add support to wiretap for reading Sun "snoop" capture files.
That requires that, in the packet-reading loop, we pass to the callback
routine the offset in the file of a packet's data, because we can no
longer compute that offset by subtracting the size of the captured
packet data from the offset in the file after the data was read -
"snoop" may stick padding in after the packet data to align packet
headers on 4-byte boundaries.

Doing that required that we arrange that we do that for "libpcap"
capture files as well; the cleanest way to do that was to write our own
code for reading "libpcap" capture files, rather than using the
"libpcap" code to do it.

Make "wtap_dispatch_cb()" and "pcap_dispatch_cb()" static to "file.c",
as they're not used elsewhere.

If we're using wiretap, don't define in "file.h" stuff used only when
we're not using wiretap.

Update the wiretap README to reflect Gilbert's and my recent changes.

Clean up some memory leaks in "wiretap/lanalyzer.c" and
"wiretap/ngsniffer.c", where the capture-file-format-specific data
wasn't freed if the open failed.

svn path=/trunk/; revision=91
1998-11-15 05:29:17 +00:00
Guy Harris 8efdf8a74c Add "acconfig.h" to make the "auto*" stuff happy.
svn path=/trunk/; revision=90
1998-11-15 00:32:01 +00:00
Gilbert Ramirez d773727c23 The Sniffer-reading code in wiretap now decodes the time field for each
packet. The date is still not taken into account, so all the traces appear to
start on Jan 1, 1970. But the time of day is correct, so at least you get good
delta times.

svn path=/trunk/; revision=89
1998-11-13 06:47:37 +00:00
Gilbert Ramirez d744ff6a91 Now that I know where to find the file format of Sniffer trace files, wiretap
now *properly* reads Sniffer files. I now know the field in the file header
which denotes link type.

svn path=/trunk/; revision=88
1998-11-13 05:57:39 +00:00
Gilbert Ramirez 7b91cc8215 More patches from Guy to make wiretap compile better. I definitely
need to learn more about autoconf/automake. :)

svn path=/trunk/; revision=87
1998-11-13 03:21:20 +00:00
Gilbert Ramirez 1f2a75cd8f More patches from Guy, cleaning up warnings when using gcc -Wall.
svn path=/trunk/; revision=86
1998-11-12 23:29:34 +00:00
Gilbert Ramirez c90b202b22 Added a patch to wiretap from Guy Harris to help compile wiretap in
different situations.  I also fixed bootp so that is properly handles
unknown BOOTP options.

svn path=/trunk/; revision=85
1998-11-12 21:39:22 +00:00
Gilbert Ramirez c0f191e9e0 I added the LANalzyer file format to wiretap. I cleaned up some code in the
wiretap functions to be more generic and therefore allow an easier integration
of more packet-capture file types. I also put in all the GPL copyrights in the
wiretap code.

svn path=/trunk/; revision=83
1998-11-12 06:01:27 +00:00
Gilbert Ramirez fcb4c78a6a A lengthy patch to add the wiretap library. Wiretap is not used by default
because it is still in its infancy, but it can be compiled in optionally.
The library exists in its own subdirectory ethereal/wiretap. This patch also
edits all the packet-*.c files to remove the #include <pcap.h> line which is
unnecessary in these files. In the ethereal code, file.c is the most heavily
modified with #ifdef WITH_WIRETAP lines for the optional library.

svn path=/trunk/; revision=82
1998-11-12 00:06:47 +00:00