Commit Graph

250 Commits

Author SHA1 Message Date
Gilbert Ramirez c74451becd Jochen Friedrich <jochen@nwe.de>
protocol type 0x0c in AIX iptrace is used for the IBM SP switch
devices. Encoding is RAW IP...

svn path=/trunk/; revision=1767
2000-03-30 21:41:11 +00:00
Guy Harris a91805901f Use the "-o" flag, rather than using the "-t" flag and redirecting the
standard output, in the rules to get Flex to produce scanner code; that
way, if Flex fails to run for some reason, we don't leave around a
zero-length or otherwise incorrect "XXX-scanner.c" file that might
keep a subsequent make from thinking it has to generate that file.

svn path=/trunk/; revision=1763
2000-03-29 19:55:51 +00:00
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