aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/toshiba.c
AgeCommit message (Collapse)AuthorFilesLines
2011-04-21Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discoveredguy1-13/+15
by the gunzipping code. Have it also supply a err_info string, and report it. Have file_error() supply an err_info string. Put "the file" - or, for WTAP_ERR_DECOMPRESS, "the compressed file", to suggest a decompression error - into the rawshark and tshark errors, along the lines of what other programs print. Fix a case in the Netscaler code where we weren't fetching the error code on a read failure. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36748 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-11Use ws_open(), not open(), so we handle UTF-8 pathnames on Windows.guy1-2/+1
Update or remove some additional "we don't have ferror() in zlib" comments to reflect the current reality. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36568 f5534014-38df-0310-8fa8-9805f1628bb7
2011-04-07Be more picky about our sscanf integer field widths. Hopefully this willgerald1-2/+2
help squelch Coverity CIDs 701-709. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36511 f5534014-38df-0310-8fa8-9805f1628bb7
2009-03-09More 64-bit fixes.gerald1-1/+1
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27685 f5534014-38df-0310-8fa8-9805f1628bb7
2006-11-05change all file offsets from long to gint64 so we can - theoretically - ↵ulfl1-7/+7
handle files > 2GB correct. Please distclean Win32 builds! git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@19814 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-25timestamp display precision:ulfl1-0/+1
- automatic adjustment depending on file format - manual adjustment through menu items save the setting in the recent file git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15534 f5534014-38df-0310-8fa8-9805f1628bb7
2005-08-24EVERYTHING IN THE BUILDBOT IS GOING TO BE RED!!! Sorry! ulfl1-2/+2
I've done more than a day to change the timestamp resolution from microseconds to nanoseconds. As I really don't want to loose those changes, I'm going to check in the changes I've done so far. Hopefully someone else will give me a helping hand with the things left ... What's done: I've changed the timestamp resolution from usec to nsec in almost any place in the sources. I've changed parts of the implementation in nstime.s/.h and a lot of places elsewhere. As I don't understand the editcap source (well, I'm maybe just too tired right now), hopefully someone else might be able to fix this soon. Doing all those changes, we get native nanosecond timestamp resolution in Ethereal. After fixing all the remaining issues, I'll take a look how to display this in a convenient way... As I've also changed the wiretap timestamp resolution from usec to nsec we might want to change the wiretap version number... git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@15520 f5534014-38df-0310-8fa8-9805f1628bb7
2005-04-03Make editcap use wtap_read(); that eliminates the last user ofguy1-1/+1
wtap_loop(), so eliminate wtap_loop(). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@14006 f5534014-38df-0310-8fa8-9805f1628bb7
2004-07-18Set the svn:eol-style property on all text files to "native", so thatguy1-1/+1
they have LF at the end of the line on UN*X and CR/LF on Windows; hopefully this means that if a CR/LF version is checked in on Windows, the CRs will be stripped so that they show up only when checked out on Windows, not on UN*X. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11400 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-25Have the Wiretap open, read, and seek-and-read routines return, inguy1-15/+27
addition to an error code, an error info string, for WTAP_ERR_UNSUPPORTED, WTAP_ERR_UNSUPPORTED_ENCAP, and WTAP_ERR_BAD_RECORD errors. Replace the error messages logged with "g_message()" for those errors with g_strdup()ed or g_strdup_printf()ed strings returned as the error info string, and change the callers of those routines to, for those errors, put the info string into the printed message or alert box for the error. Add messages for cases where those errors were returned without printing an additional message. Nobody uses the error code from "cf_read()" - "cf_read()" puts up the alert box itself for failures; get rid of the error code, so it just returns a success/failure indication. Rename "file_read_error_message()" to "cf_read_error_message()", as it handles read errors from Wiretap, and have it take an error info string as an argument. (That handles a lot of the work of putting the info string into the error message.) Make some variables in "ascend-grammar.y" static. Check the return value of "erf_read_header()" in "erf_seek_read()". Get rid of an unused #define in "i4btrace.c". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9852 f5534014-38df-0310-8fa8-9805f1628bb7
2004-01-05 removed some MSVC warnings (level 3)ulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9558 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-01Have a pseudo-header for Ethernet packets, giving the size of the FCS -guy1-1/+3
0 means "there is no FCS in the packet data", 4 means "there is an FCS in the packet data", -1 means "I don't know whether there's an FCS in the packet data, guess based on the packet size". Assume that Ethernet encapsulated inside other protocols has no FCS, by having the "eth" dissector assume that (and not check for an Ethernet pseudo-header). Have "ethertype()" take an argument giving the FCS size; pass 0 when appropriate. Fix up Wiretap routines to set the pseudo-header. This means we no longer use the "generic" seek-and-read routine, so get rid of it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8574 f5534014-38df-0310-8fa8-9805f1628bb7
2002-10-31Discard the WTAP_ENCAP_LAPD encapsulation type in favor of aguy1-5/+8
WTAP_ENCAP_ISDN encapsulation type, which includes a pseudo-header giving the direction (user-to-network or network-to-user) and the channel number. Add a new circuit type, using the ISDN channel number as the circuit ID. Add an ISDN dissector to put the direction and channel number into the protocol tree and to call the appropriate dissector for the payload based on the channel (LAPD for the D channel; V.120, PPP, or data for B channels, based on some heuristics). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6521 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-59/+59
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6115 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-07Graeme Hewson noted that zlib has a bug wherein "gzseek()" doesn't setguy1-4/+2
the internal z_err value for the stream if an "fseek()" call it makes fails, so that if "gzerror()" is subsequently called, it returns Z_OK rather than an error. To work around this, we pass "file_seek()" an "int *err", and have the with-zlib version of "file_seek()" check, if "gzseek()" fails, whether the return value of "file_error()" is 0 and, if so, have it return "errno" instead. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5642 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-05Make "wtap_seek_read()" return TRUE on success and FALSE on error, likeguy1-16/+15
"wtap_read()". Add some additional error checks to the Sniffer file reader. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4875 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-05Have "wtap_seek_read()" return 0 on success and -1 on failure, and takeguy1-10/+17
an "err" argument that points to an "int" into which to put an error code if it fails. Check for errors in one call to it, and note that we should do so in other places. In the "wtap_seek_read()" call in the TCP graphing code, don't overwrite "cfile.pseudo_header", and make the buffer into which we read the data WTAP_MAX_PACKET_SIZE bytes, as it should be. In some of the file readers for text files, check for errors from the "parse the record header" and "parse the hex dump" routines when reading sequentially. In "csids_seek_read()", fix some calls to "file_error()" to check the error on the random stream (that being what we're reading). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4874 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-04Check for errors in seeks, "tell"s, and "stat()"s/"fstat()"s.guy1-15/+36
For file types where we allocate private data, add "close" routines where they were missing, to free the private data. Also fix up the code to clean up after some errors by freeing private data where that wasn't being done. Get rid of unused arguments to "wtap_dump_open_finish()". Fix indentation. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4857 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-08Have Wiretap set the snapshot length to 0 if it can't be derived fromguy1-3/+8
reading the capture file. Have callers of "wtap_snapshot_length()" treat a value of 0 as "unknown", and default to WTAP_MAX_PACKET_SIZE (so that, when writing a capture file in a format that *does* store the snapshot length, we can at least put *something* in the file). If we don't know the snapshot length of the current capture file, don't display a value in the summary window. Don't use "cfile.snap" as the snapshot length option when capturing - doing so causes Ethereal to default, when capturing, to the snapshot length of the last capture file that you read in, rather than to the snapshot length of the last capture you did (or the initial default of "no snapshot length"). Redo the "Capture Options" dialog box to group options into sections with frames around them, and add units to the snapshot length, maximum file size, and capture duration options, as per a suggestion by Ulf Lamping. Also add units to the capture count option. Make the snapshot length, capture count, maximum file size, and capture duration options into a combination of a check box and a spin button. If the check box is not checked, the limit in question is inactive (snapshot length of 65535, no max packet count, no max file size, no max capture duration); if it's checked, the spinbox specifies the limit. Default all of the check boxes to "not checked" and all of the spin boxes to small values. Use "gtk_toggle_button_get_active()" rather than directly fetching the state of a check box. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4709 f5534014-38df-0310-8fa8-9805f1628bb7
2001-12-08Fix white space.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4359 f5534014-38df-0310-8fa8-9805f1628bb7
2001-11-13Hopefully the last time I have to change my e-mail address.gram1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4199 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-25Get rid of signed/unsigned comparison warnings in wiretap.gram1-5/+6
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4077 f5534014-38df-0310-8fa8-9805f1628bb7
2001-10-04Use longs as file offsets, so that on platforms with 64-bit "long" weguy1-8/+8
can handle capture files bigger than 2GB. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3993 f5534014-38df-0310-8fa8-9805f1628bb7
2001-03-10Obliging every capture file reader's "open()" routine to seek to theguy1-4/+2
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@3123 f5534014-38df-0310-8fa8-9805f1628bb7
2000-11-19"wtap_read()" must *always* set "*err" when it returns FALSE - if it'sguy1-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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2667 f5534014-38df-0310-8fa8-9805f1628bb7
2000-09-21Make sure to pass the sent/received direction from pppdump.c ingram1-3/+3
pseudo_header. Use generic "p2p_phdr" instead of "lapd_phdr". Modify toshiba.c and packet-lapd.c to take that into account. Add frame.p2p_dir, a filterable field, 0=sent, 1=recvd Make p2p_dir available in packe_info, as I think it will be needed in VJ COMP and UNCOMP dissection. Rename WTAP_ENCAP_TR to WTAP_ENCAP_TOKEN_RING. Mention pppd-log support in man page. Mention atmsnoop in README. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2455 f5534014-38df-0310-8fa8-9805f1628bb7
2000-09-07Change wtap_read() API so that the data offset is set via a pointer, andgram1-5/+6
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). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@2392 f5534014-38df-0310-8fa8-9805f1628bb7
2000-05-19Add wtap-int.h. Move definitions relevant to the internal workins of wiretapgram1-6/+7
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1989 f5534014-38df-0310-8fa8-9805f1628bb7
2000-05-19In Wiretap, a file stream handle is a "FILE_T", not a "FILE_T *" (aguy1-5/+5
"FILE_T" is either a "gzFile" or a "FILE *", depending on whether zlib support is enabled or not). Fix various function declarations and definitions. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1984 f5534014-38df-0310-8fa8-9805f1628bb7
2000-05-18Remove the "union pseudo_header" from the "frame_data" structure;guy1-28/+31
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). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1975 f5534014-38df-0310-8fa8-9805f1628bb7
2000-03-04Fix for reading toshiba trace files that were created by using thegram1-11/+23
"save session" feature in many Windows-based telnet apps. CRT, by VanDyke, in particular, will put in newlines at 80 columns. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1692 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-13We are obliged to define HAVE_UNISTD_H in "config.h"; to avoid theguy1-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.) git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1463 f5534014-38df-0310-8fa8-9805f1628bb7
2000-01-01Add relative timestamps. The Toshiba ISDN router has the same problemgram1-3/+3
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. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1404 f5534014-38df-0310-8fa8-9805f1628bb7
1999-11-18Fixed the checking of the return value from file_gets() (fgets()).gram1-5/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1053 f5534014-38df-0310-8fa8-9805f1628bb7
1999-11-11Remove potential for a bad toshiba trace file to overflow a fixed char[]gram1-3/+5
buffer in sscanf call. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1012 f5534014-38df-0310-8fa8-9805f1628bb7
1999-11-11Remove unnecessary file_seek per packet, speeding up loading of agram1-3/+4
gzipped toshiba file. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1005 f5534014-38df-0310-8fa8-9805f1628bb7
1999-11-11Add LAPD support.gram1-8/+8
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@1004 f5534014-38df-0310-8fa8-9805f1628bb7
1999-10-31Add a module to wiretap to be able to read trace files from Toshiba'sgram1-0/+410
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 git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@952 f5534014-38df-0310-8fa8-9805f1628bb7