aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/ngsniffer.c
AgeCommit message (Collapse)AuthorFilesLines
1999-11-27Sigh. Apparently "Internetwork analyzer" covers a multitude of sins;Guy Harris1-6/+35
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-10-05Better handle errors from zlib:Guy Harris1-25/+17
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-09-30A "time units" value of 5 means "microseconds", according to an FDDIGuy Harris1-2/+2
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-24Fix it so that it builds with "--disable-zlib".Guy Harris1-2/+2
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-22This commit contains support for reading capture files compressed usingAshok Narayanan1-20/+21
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-08-28Keep in the "wtap" structure the current offset into the file beingGuy Harris1-2/+12
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-24Add a new Wiretap encapsulation type WTAP_ENCAP_FDDI_BITSWAPPED, meaningGuy Harris1-2/+2
"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-22Get rid of some cruft left in by previous checkins as placeholders.Guy Harris1-26/+26
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-20The 16-bit and 32-bit fields in the "frame4" record header in ATMGuy Harris1-8/+8
Sniffer captures are little-endian; convert them as necessary. svn path=/trunk/; revision=535
1999-08-20Get rid of an unused variable left stranded on the beach when a waveGuy Harris1-2/+1
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-20Add support for reading Full Frontal ATM from an ATM Sniffer captureGuy Harris1-287/+43
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-19Have the per-capture-file-type open routines "wtap_open_offline()" callsGuy Harris1-70/+132
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-02Check in Olivier Abad's patch to add dissectors for LAP-B and X.25, andGuy Harris1-2/+4
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-07-13Added support for compiling on win32 with Visual C and 'nmake'. It compiles,Gilbert Ramirez1-1/+4
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-03-01Added display filters to wiretap.Gilbert Ramirez1-12/+11
svn path=/trunk/; revision=198
1999-01-07I removed the per-file encapsulation type from wiretap, and make all filetypesGilbert Ramirez1-1/+2
provide a per-packet encapsulation type. this required minor modifications to ethereal. svn path=/trunk/; revision=162
1998-12-17Added Guy Harris' patch to read Sniffer ATM trace files. Very nice.Gilbert Ramirez1-116/+569
svn path=/trunk/; revision=128
1998-12-15Fix the bitmask for the hour field in a DOS-format time (not that itGuy Harris1-2/+2
matters, as that code is commented out). svn path=/trunk/; revision=125
1998-12-13Added Guy's patch to calculate date of Sniffer packet trace. I copiedGilbert Ramirez1-4/+40
bits of it to do the same for Lanalyzer packets. svn path=/trunk/; revision=123
1998-11-23Added time-stamp decoding to LANalyzer decodes, made minor comment changes toGilbert Ramirez1-6/+6
ngsniffer.c, and removed DLT_* defines from wtap.h svn path=/trunk/; revision=119
1998-11-21The Sniffer-reading code now checks to make sure that it is tryingGilbert Ramirez1-9/+19
to read an uncompressed Sniffer file. svn path=/trunk/; revision=118
1998-11-15Add support to wiretap for reading Sun "snoop" capture files.Guy Harris1-4/+15
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-13The Sniffer-reading code in wiretap now decodes the time field for eachGilbert Ramirez1-19/+87
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-13Now that I know where to find the file format of Sniffer trace files, wiretapGilbert Ramirez1-43/+114
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-12I added the LANalzyer file format to wiretap. I cleaned up some code in theGilbert Ramirez1-1/+66
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-12A lengthy patch to add the wiretap library. Wiretap is not used by defaultGilbert Ramirez1-0/+36
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