summaryrefslogtreecommitdiff
path: root/wiretap/k12.c
AgeCommit message (Collapse)AuthorFilesLines
2013-03-17From beroset:Anders Broman1-9/+5
implemented wtap_dump_file_seek() and _tell() implemented the previously declared but unimplemented wtap_dump_file_seek() and wtap_dump_file_tell() functions and used them in the seven files that had previously used a plain ftell or fseek and added error checking as appropriate. I also added a new error WTAP_ERR_CANT_SEEK_COMPRESSED and put it next to WTAP_ERR_CANT_SEEK causing renumbering of two of the existing error codes. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48348
2012-12-27Do not call wtap_file_read_unknown_bytes() orGuy Harris1-1/+1
wtap_file_read_expected_bytes() from an open routine - open routines are supposed to return -1 on error, 0 if the file doesn't appear to be a file of the specified type, or 1 if the file does appear to be a file of the specified type, but those macros will cause the caller to return FALSE on errors (so that, even if there's an I/O error, it reports "the file isn't a file of the specified type" rather than "we got an error trying to read the file"). When doing reads in an open routine before we've concluded that the file is probably of the right type, return 0, rather than -1, if we get WTAP_ERR_SHORT_READ - if we don't have enough data to check whether a file is of a given type, we should keep trying other types, not give up. For reads done *after* we've concluded the file is probably of the right type, if a read doesn't return the number of bytes we asked for, but returns an error of 0, return WTAP_ERR_SHORT_READ - the file is apparently cut short. For NetMon and NetXRay/Windows Sniffer files, use a #define for the magic number size, and use that for both magic numbers. svn path=/trunk/; revision=46803
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-27/+28
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
2012-10-10From Bill Parker: fix typo.Guy Harris1-1/+1
svn path=/trunk/; revision=45457
2012-10-10From Bill Parker: check for ws_fopen() failing.Guy Harris1-5/+11
From me: instead of logging the error with a macro that requires dbg_out to be set, and giving up, set dbg_out to stderr, log the message (which now notes that logging will be done to the standard error), and drive on. Part of fix for bug 7824. svn path=/trunk/; revision=45454
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-2/+0
svn path=/trunk/; revision=45015
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-02Try to squelch warningsAnders Broman1-3/+3
svn path=/trunk/; revision=43000
2012-06-02Try to squelch warningsAnders Broman1-11/+11
svn path=/trunk/; revision=42998
2012-05-04Clean up indentation.Guy Harris1-31/+30
svn path=/trunk/; revision=42427
2012-05-04file_seek() used to be a wrapper around fseek() or gzseek(), both ofGuy Harris1-4/+1
which could use lseek() and were thus expensive due to system call overhead. To avoid making a system call for every packet on a sequential read, we maintained a data_offset field in the wtap structure for sequential reads. It's now a routine that just returns information from the FILE_T data structure, so it's cheap. Use it, rather than maintaining the data_offset field. Readers for some file formats need to maintain file offset themselves; have them do so in their private data structures. svn path=/trunk/; revision=42423
2012-04-14More double-free fixes - destroy_k12_file_data() frees its argument, soGuy Harris1-2/+0
calling g_free() on that argument after calling destroy_k12_file_data() is always an error. svn path=/trunk/; revision=42067
2012-04-14From From Evan Huus: Potential double-free while importing k12xx *.rf5 files ↵Anders Broman1-2/+0
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7084 svn path=/trunk/; revision=42062
2012-02-25Add a presence flag field to the packet information structure filled inGuy Harris1-0/+2
by Wiretap, to indicate whether certain fields in that structure actually have data in them. Use the "time stamp present" flag to omit showing time stamp information for packets (and "packets") that don't have time stamps; don't bother working very hard to "fake" a time stamp for data files. Use the "interface ID present" flag to omit the interface ID for packets that don't have an interface ID. We don't use the "captured length, separate from packet length, present" flag to omit the captured length; that flag might be present but equal to the packet length, and if you want to know if a packet was cut short by a snapshot length, comparing the values would be the way to do that. More work is needed to have wiretap/pcapng.c properly report the flags, e.g. reporting no time stamp being present for a Simple Packet Block. svn path=/trunk/; revision=41185
2011-12-13Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports anyGuy Harris1-1/+1
form of corruption/bogosity in a file, including in a file header as well as in records in the file. Change the error message wtap_strerror() returns for it to reflect that. Use it for some file header problems for which it wasn't already being used - WTAP_ERR_UNSUPPORTED shouldn't be used for that, it should only be used for files that we have no reason to believe are invalid but that have a version number we don't know about or some other non-link-layer-encapsulation-type value we don't know about. svn path=/trunk/; revision=40175
2011-09-01Use guint8 rather than guchar for raw octets and pointers to arrays ofGuy Harris1-2/+2
same. Add to wiretap/pcap-common.c a routine to fill in the pseudo-header for ATM (by looking at the VPI, VCI, and packet data, and guessing) and Ethernet (setting the FCS length appropriately). Use it for both pcap and pcap-ng files. svn path=/trunk/; revision=38840
2011-04-21Add a new WTAP_ERR_DECOMPRESS error, and use that for errors discoveredGuy Harris1-6/+6
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. svn path=/trunk/; revision=36748
2011-04-18Wrap actual_len inside #ifdef DEBUG_K12 to avoid gcc 4.6.0 warning reported byChris Maynard1-2/+8
Kaul: http://www.wireshark.org/lists/wireshark-dev/201104/msg00170.html svn path=/trunk/; revision=36710
2011-04-12"This file format can't be written to a pipe" and "this file formatGuy Harris1-6/+1
can't be saved in compress form" are both equivalent to "this file file format requires seeking when writing it". Change the "can compress" Boolean in the file format table to "writing requires seeking", give all the entries the proper value, and do the checks for attempting to write a file format to a pipe or write it in compressed format to common code. This means we don't need to pass the "can't seek" flag to the dump open routines. svn path=/trunk/; revision=36575
2011-04-06From Jakub Zawadzki: fix the type of an argument.Guy Harris1-1/+1
svn path=/trunk/; revision=36492
2011-04-06From Jakub Zawadzki:Guy Harris1-6/+6
file_read(buf, bsize, count, file) macro is compilant with fread function and takes elements count+ size of each element, however to make it compilant with gzread() it always returns number of bytes. In wiretap file_read() this is not really used, file_read is called either with bsize set to 1 or count to 1. Attached patch remove bsize argument from macro. svn path=/trunk/; revision=36491
2011-02-10Add some information based on a Tektronix manual whose name popped up inGuy Harris1-2/+57
an email I found when looking for some other stuff and which I then found with a Google search. svn path=/trunk/; revision=35898
2011-02-04Set the error code and additional information string in more cases.Guy Harris1-27/+70
svn path=/trunk/; revision=35809
2010-06-06Don't use fwrite directly when writing a dump file; call it throughGuy Harris1-22/+8
wtap_dump_file_write(). Replace various wrappers around fwrite() with wtap_dump_file_write(), or at least make the wrappers call wtap_dump_file_write(). svn path=/trunk/; revision=33116
2010-02-26Move the definitions of all the private data structures out ofGuy Harris1-29/+50
wtap-int.h, and change the unions of pointers to those private data structures into just void *'s. Have the generic wtap close routine free up the private data, rather than the type-specific close routine, just as the wtap_dumper close routine does for its private data. Get rid of close routines that don't do anything any more. svn path=/trunk/; revision=32015
2009-04-22Signed vs. unsigned fix.Guy Harris1-1/+1
svn path=/trunk/; revision=28119
2009-04-22Clean up some 64-bit issues.Guy Harris1-103/+103
svn path=/trunk/; revision=28117
2009-03-31Add a check to make sure we don't try to allocate a huge buffer. IfGerald Combs1-7/+11
we get an improper buffer length, throw an error instead of aborting. Clean up the debugging code. svn path=/trunk/; revision=27918
2009-03-15From Jakub Zawadzki:Stig Bjørlykke1-6/+2
More remove checking for NULL before g_free(). svn path=/trunk/; revision=27728
2009-03-09P64 fixes.Gerald Combs1-2/+2
svn path=/trunk/; revision=27683
2009-03-08Change a a remaining eth_fopen to ws_fopen (used only under an #if debug).Bill Meier1-1/+1
svn path=/trunk/; revision=27659
2008-09-03g_ascii_strdown() and g_ascii_strup(), unlike g_strdown() and g_strup(),Guy Harris1-1/+7
do *not* modify the string handed to them - they g_mallocate a new string and return it. Create routines that *do* ASCII-only case mapping in place, and use them instead. Clean up indentation. svn path=/trunk/; revision=26131
2008-08-05luis.ontanon@gmail.com => luis@ontanon.orgLuis Ontanon1-1/+1
svn path=/trunk/; revision=25937
2008-06-23Fixed some "shadowed variables", as pointed out by John Smith.Stig Bjørlykke1-13/+13
svn path=/trunk/; revision=25539
2008-05-08From Anders: Checkapi enabled for wiretap and more functions converted.Martin Mathieson1-1/+1
svn path=/trunk/; revision=25257
2008-01-24s/%ll/%" G_GINT64_MODIFIER "/gJeff Morriss1-2/+2
svn path=/trunk/; revision=24181
2007-10-16From tmiller@hcjbtech.org : Spelling error on GDS DB protocol dissector: ↵Sake Blok1-3/+3
"Buffer lenght:" (recursively grepped through the source and corrected all occurences, even the ones just in comments) svn path=/trunk/; revision=23211
2007-10-16Change more fopen() to eth_fopen() to finish fixing bug 1827:Jeff Morriss1-166/+166
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=1827 Update README.developer to tell developers not to use fopen() and friends directly. svn path=/trunk/; revision=23206
2007-09-28Add error checking for fwrites; replacement for the 2nd of the patches ↵Bill Meier1-22/+44
provided in bug #1864 svn path=/trunk/; revision=23015
2007-06-13Fix coverity bug 244, [WS Bug 1649]Luis Ontanon1-30/+21
svn path=/trunk/; revision=22091
2007-04-21Explicitly mark new_k12_file_data() as taking no arguments - in C89, atGuy Harris1-1/+1
least, "int foo()" defines or declares an old-style function, not one with no arguments. svn path=/trunk/; revision=21488
2007-04-02There are odd packet records in k15 generated files where the interface ↵Luis Ontanon1-4/+33
record does not match any given one. I noticed that these records have the first byte changed so When a lookup fails mask the byte and lookup again. svn path=/trunk/; revision=21303
2007-03-21fix another warningUlf Lamping1-1/+1
svn path=/trunk/; revision=21079
2007-03-21set compiler option "treat warnings as errors" - to prevent new warnings for ↵Ulf Lamping1-1/+1
wiretap remove all compiler warnings: a) prevent wrong malloc/free definitions by lex/yacc generated files b) add int/time_t casts - MSVC2005 is more "sensitive" about this than MSVC6 svn path=/trunk/; revision=21078
2007-03-17rename a variable.Luis Ontanon1-5/+5
svn path=/trunk/; revision=21045
2007-03-17K15 final:Luis Ontanon1-20/+5
add another interface record type with the very same arch than the "old" one. now I can read all the K15 files I got. svn path=/trunk/; revision=21044
2007-03-17K15 phase 1Luis Ontanon1-169/+207
be able to read files with records larger than 0x2000 bytes this fixes http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=532 svn path=/trunk/; revision=21043
2007-03-10Major cleanup of debug code and whitespace changes.Luis Ontanon1-700/+632
svn path=/trunk/; revision=21013
2007-02-08From: Kriang LerdsuwanakijLuis Ontanon1-2/+28
In the attached patch, the K12 wiretap now saves the content of record after captured packet data. The K12 dissector then could extract them and provide useful information to properly dissect FP frames (user plane of UTRAN Iub interface). svn path=/trunk/; revision=20749
2007-02-04from:Luis Ontanon1-30/+63
Kriang Lerdsuwanakij <lerdsuwa@users.sourceforge.net> I discovered that Wireshark K12xx detects the type of input (E1 timeslot or ATM) based on the extra information. My previous patch to enable Wireshark to open K12xx files with no extra information (extra_len equals 0 in SRCDEST record) failed to give later dissectors the input type. Attached is the patch to correct this for ATM PVC. It adds VPI/VCI/CID information for display in the dissected tree (in k12_open function). k12_read and k12_seek_read are also made more robust. These are reverse engineered based on hexeditor and constants found in tektronix configuration file. Please apply the patch. svn path=/trunk/; revision=20705