aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/ascend.c
AgeCommit message (Collapse)AuthorFilesLines
2001-07-13From Joerg Mayer:Guy Harris1-2/+2
* gcc 3.0 warning fixes: - text2pcap.c: The number of characters to scan should probably not be 0 - wiretap/csids.c: using preincrement on a variable used on both sides of an assignment might be undefined by the C99(?) standard * turn on additional warnings for epan and wiretap too - epan/configure.in - wiretap/configure.in * Fix some warnings (missing includes, signed/unsigned, missing initializers) found by turning on the warnings - all other files :-) svn path=/trunk/; revision=3709
2001-03-10Obliging every capture file reader's "open()" routine to seek to theGuy Harris1-2/+1
beginning of the file before reading anything from the file is bogus - do that in the loop that tries each of the open routines, instead. (They may have to reset the seek pointer later if, for example, the capture file begins with the first packet, and the "open()" routine looks at that packet to try to guess whether the packet is in the file format in question.) Set "wth->data_offset" to 0 while you're at it, so capture file readers don't have to do that, either. svn path=/trunk/; revision=3123
2000-11-19"wtap_read()" must *always* set "*err" when it returns FALSE - if it'sGuy Harris1-1/+2
just an EOF, it should set "*err" to 0. Fix up a bunch of read routines for various capture file types to set "*err" appropriately. svn path=/trunk/; revision=2667
2000-11-12"wtap_loop()" no longer has problems with packet offsets of 0, so weGuy Harris1-20/+71
don't need to work around that. The offset, for a given packet, at which "ascend_seek()" should start searching for that packet's header must be computed separately from the offset, for that packet, at which "ascend_seek()" should start searching for the *next* packet - if the file is a "wdd" capture, and the packet has a "Date:" header and a WD_DIALOUT_DISP header, the search for that packet should start at the beginning of the "Date:" header, but the search for the next packet should start after the WD_DIALOUT_DISP header, as if we start it after the "Date:" header, the search will stop at the packet's own WD_DIALOUT_DISP header, as a packet could have a WD_DIALOUT_DISP header but no "Date:" header. svn path=/trunk/; revision=2620
2000-11-12Not all packets in a "wdd" dump necessarily have a "Cause an attempt toGuy Harris1-4/+4
place call to" header (I presume this can happen if there was a call in progress when the packet was sent or received); don't require the Date: 01/12/1990. Time: 12:22:33 Cause an attempt to place call to 14082750382 to be present in every packet. (Only the date on the first packet is used, and only if it's present in the first packet; if the first packet doesn't have a date, we can't easily go back and fix up the previous packets, *especially* in programs such as Tethereal and editcap which make only one pass through the capture. We set the called number to a null string if that's the case; we could assume, in the sequential pass, that it's the phone number from the last call, and remember that for use when doing random access.) svn path=/trunk/; revision=2617
2000-11-11In "wdd" captures:Guy Harris1-6/+20
fix the interpretation of the date and time reported in capture files; use that date and time only to set the start date and time of the capture, not to generate the time stamp for every packet. Make the "struct tm" used for that local to the code to handle that production in the grammar, rather than global. For all captures, we *can* now fstat a compressed file (and have been able to do so for a while, in fact), so revert to doing so and using the ctime of the capture file if we can't get a date and time from the file's contents. svn path=/trunk/; revision=2605
2000-09-07Change wtap_read() API so that the data offset is set via a pointer, andGilbert Ramirez1-6/+7
a "keep reading" boolean value is returned from the function. This avoids having to hack around the fact that some file formats truly do have records that start at offset 0. (i4btrace and csids have no file header. Neither does the pppdump-style file that I'm looking at right now). svn path=/trunk/; revision=2392
2000-08-11Miscellaneous code cleaningLaurent Deniel1-1/+3
- add <stdarg.h> or <varargs.h> in snprintf.h and remove those inclusions in the other #ifdef NEED_SNPRINTF_H codes - remove the check of multiple inclusions in source (.c) code (there is a bit loss of _cpp_ performance, but I prefer the gain of code reading and maintenance; and nowadays, disk caches and VM are correctly optimized ;-). - protect all (well almost) header files against multiple inclusions - add header (i.e. GPL license) in some include files - reorganize a bit the way header files are included: First: #include <system_include_files> #include <external_package_include_files (e.g. gtk, glib etc.)> Then #include "ethereal_include_files" with the correct HAVE_XXX or NEED_XXX protections. - add some HAVE_XXX checks before including some system header files - add the same HAVE_XXX in wiretap as in ethereal Please forgive me, if I break something (I've only compiled and regression tested on Linux). svn path=/trunk/; revision=2254
2000-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapGilbert Ramirez1-4/+4
to that file, leave public definitions in wtap.h. Rename "union pseudo_header" to "union wtap_pseudo_header". Make the wtap_pseudo_header pointer available in packet_info struct. svn path=/trunk/; revision=1989
2000-05-18Remove the "union pseudo_header" from the "frame_data" structure;Guy Harris1-5/+9
there's no need to keep it around in memory - when the frame data is read in when handing a frame, read in the information, if any, necessary to reconstruct the frame header, and reconstruct it. This saves some memory. This requires that the seek-and-read function be implemented inside Wiretap, and that the Wiretap handle remain open even after we've finished reading the file sequentially. This also points out that we can't really do X.25-over-Ethernet correctly, as we don't know where the direction (DTE->DCE or DCE->DTE) flag is stored; it's not clear how the Ethernet type 0x0805 for X.25 Layer 3 is supposed to be handled in any case. We eliminate X.25-over-Ethernet support (until we find out what we're supposed to do). svn path=/trunk/; revision=1975
2000-05-10Include an example of "wdd" output data from an Ascend trace I got agesGuy Harris1-1/+17
ago. svn path=/trunk/; revision=1937
2000-03-22In a Network Monitor capture file, get the starting offsets of framesGuy Harris1-1/+8
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-01-22Fix files that had Gilbert's old e-mail address or that didn't have myGuy Harris1-2/+2
forwarding e-mail address. svn path=/trunk/; revision=1522
2000-01-13We are obliged to define HAVE_UNISTD_H in "config.h"; to avoid theGuy Harris1-2/+2
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-10Some initial changes for win32 support, but not all.Gilbert Ramirez1-1/+5
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
1999-10-28Change ASCEND_MAX_SEEK from 1000000 to 100000, so as not to excessively slowGerald Combs1-2/+2
down file opens. svn path=/trunk/; revision=939
1999-10-08Move some definitions of stuff not used outside the Lucent/AscendGuy Harris1-1/+2
capture file reading code from "ascend.h" to "ascend-int.h". svn path=/trunk/; revision=788
1999-09-23Get rid of unused variable.Guy Harris1-2/+1
svn path=/trunk/; revision=702
1999-09-22Fix to allow compressed file handling of Ascend capturesAshok Narayanan1-16/+18
svn path=/trunk/; revision=699
1999-09-13Add support for "wdd" trace output.Gerald Combs1-17/+34
svn path=/trunk/; revision=673
1999-09-11Added Guy's patch to use the pseudo header facility to pass up the AscendGerald Combs1-8/+11
metadata. Also added filter items for the session and task number. svn path=/trunk/; revision=664
1999-09-11"ascend_seek()" isn't used outside "ascend.c", so make it static toGuy Harris1-2/+2
"ascend.c". svn path=/trunk/; revision=659
1999-09-11"ascend_read()" is local to "ascend.c" - declare it there, not inGuy Harris1-1/+3
"ascend.h". svn path=/trunk/; revision=657
1999-09-11Add in ascend.c, ascend.h, ascend-grammar.y and ascend-scanner.l. TheseGerald Combs1-0/+186
read and parse the Lucent/Ascend trace output. svn path=/trunk/; revision=653