aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/k12text.l
AgeCommit message (Collapse)AuthorFilesLines
2013-06-16Have the seek-read routines take a Buffer rather than a guint8 pointerGuy Harris1-2/+3
as the "where to put the packet data" argument. This lets more of the libwiretap code be common between the read and seek-read code paths, and also allows for more flexibility in the "fill in the data" path - we can expand the buffer as needed in both cases. svn path=/trunk/; revision=49949
2013-05-17Don't pass globals as arguments to k12text_set_headers(), just use theGuy Harris1-7/+5
globals directly. If we ever manage to make them *not* globals (which might only be possible with newer versions of Flex), then we can do better. Get rid of an unused variable. Squelch a 64-bit-to-32-bit conversion warning. svn path=/trunk/; revision=49396
2013-05-17Rename k12text_set_pseudo_header() to k12text_set_headers() and have itGuy Harris1-13/+15
fill in the entire struct wtap_pkthdr. svn path=/trunk/; revision=49388
2013-02-10Add %option noinput to a bunch of Flex files, as we aren't using theGuy Harris1-0/+5
input() routine and thus don't need to have it generated - and as it produces warnings of a routine defined but not used, we don't want to have it generated. Squelch a casting-const-away warning. svn path=/trunk/; revision=47613
2013-01-04Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8105 :Pascal Quantin1-4/+8
Allow use of huges values for localtime / ctime / gmtime with MSVC 2008 or later svn path=/trunk/; revision=46930
2012-10-16Add wtap_pseudo_header union to wtap_pkthdr structure.Jakub Zawadzki1-4/+3
Use pkthdr instead of pseudo_header as argument for dissecting. svn path=/trunk/; revision=45601
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=45016
2012-06-02Try to squelch warningsAnders Broman1-1/+1
svn path=/trunk/; revision=43000
2012-05-04file_seek() used to be a wrapper around fseek() or gzseek(), both ofGuy Harris1-10/+33
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-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
2012-02-06Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
svn path=/trunk/; revision=40908
2012-01-14wth->phdr.pkt_encap isn't set on a seek-and-read; pass the encapsulationGuy Harris1-4/+4
directly to k12text_set_pseudo_header(), so that it's passed the right encapsulation for seek-and-read as well as for read. Fixes the "malformed frames when reading some K12 text files" problem for which we're using bug 6735. svn path=/trunk/; revision=40508
2012-01-14WTAP_ENCAP_UNKNOWN should never appear as an actual encapsulation type,Guy Harris1-2/+0
and can't be supported as an output encapsulation in any case. svn path=/trunk/; revision=40492
2011-12-13Rename WTAP_ERR_BAD_RECORD to WTAP_ERR_BAD_FILE; it really reports anyGuy Harris1-3/+3
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-11-18Fail if somebody tries to write out a packet with an unsupportedGuy Harris1-7/+16
encapsulation. svn path=/trunk/; revision=39944
2011-11-16OK, this should do it.Guy Harris1-1/+1
svn path=/trunk/; revision=39885
2011-11-16Fix build on Windows.Guy Harris1-2/+2
svn path=/trunk/; revision=39884
2011-11-16Another place where we have to protect against MSVC's time-conversionGuy Harris1-0/+8
routines blowing up if handed a too-large time_t. svn path=/trunk/; revision=39882
2011-09-01Use guint8 rather than guchar for raw octets and pointers to arrays ofGuy Harris1-1/+1
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-17Mark err as unused in k12text_dump_open().Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=36682
2011-04-12"This file format can't be written to a pipe" and "this file formatGuy Harris1-7/+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-03-29Don't put a 196808 byte variable on the stack: instead, malloc/free it.Jeff Morriss1-59/+83
Coverity 789-790. Since we've been keeping track of how many bytes we put in the buffer, use that value instead of calling strlen() find it again. Also, some white space/indentation cleanup. svn path=/trunk/; revision=36397
2011-02-04Set *err before *err_info - that's how it's done in most other modules.Guy Harris1-4/+4
svn path=/trunk/; revision=35807
2010-06-06Don't use fwrite directly when writing a dump file; call it throughGuy Harris1-20/+18
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-11/+0
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
2010-01-18Fix gcc -Wshadow warnings ....Bill Meier1-33/+33
svn path=/trunk/; revision=31558
2009-01-14Update comment re the use of the flex statement '%option noline'Bill Meier1-3/+3
svn path=/trunk/; revision=27231
2009-01-08get rid of few signed/unsigned mishmash warnings to have it with MSVC6 ↵Tomas Kukosa1-1/+1
compilable svn path=/trunk/; revision=27195
2009-01-06Addt'l fix for bug #1937: Fill in frame pseudo_header as req'd.Bill Meier1-18/+47
Also: comment out support for MTP_L2 and SSCOP (encapsulation types WTAP_ENCAP_MTP2 & WTAP_ENCAP_ATM_PDUS) since I don't know how to fill in the pseudo_headers required by packet-mtp2 and packet-atm. svn path=/trunk/; revision=27172
2009-01-05Use encap=WTAP_ENCAP_UNKNOWN if encap can't be determined from the file frame.Bill Meier1-1/+1
(The original code before SVN 27158 was correct). svn path=/trunk/; revision=27159
2009-01-05Rework code somewhat; Fixes bug 1937 & various other issues.Bill Meier1-33/+82
Fixed: Crash when reading a K12text file with one frame; Crash after selecting the last frame and then a previous frame after file open. Select of frame n (>1) immediately after file open incorrectly displayed the packet details & data from frame n+1. File ! Merge (for K12text files) did not work correctly. Fixes: Essentially: clear all lexer state (look-ahead buffer, etc) for every file read. Also: Don't use global for keeping track of the current file position. Also: Handle *nix-style line endings as well as DOS-style. svn path=/trunk/; revision=27158
2008-09-07From Neil Piercy: Anders Broman1-0/+4
VC6 Build problem: wiretap/k12text.c includes unistd. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2851 svn path=/trunk/; revision=26161
2008-05-30wtap_read() and wtap_seek_read(), and thus the functions that it calls,Guy Harris1-2/+2
are expected to return a g_mallocated error string; that's why they fill in a gchar **, not a const gchar **. g_strdup() the argument to KERROR(), so it's g_mallocated. svn path=/trunk/; revision=25398
2008-05-29Fix the types of k12text_read() and k12text_seek_read() to match whatGuy Harris1-4/+4
the types of read and seek_read routines in Wiretap are supposed to be, and get rid of the casts of pointers to those functions (type problems should be fixed, not papered over with casts, whenver possible). svn path=/trunk/; revision=25393
2008-05-13From: Luis OntanonAnders Broman1-10/+19
Fix errors from checkapi. svn path=/trunk/; revision=25287
2008-04-25 Bug 2493: Fix (Part 2): Bill Meier1-5/+11
To prevent Windows compiler errors when using flex 2.5.35. Fixes "missing unistd.h" and yywrap "mismatched parameter" warnings [Upcoming Part 3: ignore 'signed /unsigned mismatch' errors] svn path=/trunk/; revision=25173
2007-11-26Get rid of C++/C99 style comments--not all compilers support themJeff Morriss1-27/+27
svn path=/trunk/; revision=23608
2007-08-04Add a script as a front-end for Flex, to work around various problems,Guy Harris1-0/+1
such as the fact that Flex strips all but the last component of the "-o" argument, and that it doesn't generate a header file to declare routines the generated lexical analyzer defines. Use that script when building lexical analyzers, and, for each lexical analyzer, include the generated header file in the generated analyzer. svn path=/trunk/; revision=22446
2007-07-30Add comments to various %option items to explain what they're doing. Guy Harris1-2/+20
Move the %options to the beginning if they weren't already there, and put them in the same order in all files. Add "prefix=" options to .l files that don't already have them, so we don't have to pass a "-P" option. Add "never-interactive" and "noyywrap" options to our lexical analyzers, to remove extra isatty() checks and to eliminate the need for yywrap() from the Flex library. Get rid of %option nostdinit - that's the default. Add .l.c: rules to Makefile.am files, replacing the rules for specific .l files. Have those rules all check that $(LEX) is set. Update the address for the FSF. svn path=/trunk/; revision=22424
2007-05-24Get rid of CR's, and add a newline at the end.Guy Harris1-310/+310
Set svn:keywords and svn:eol-style appropriately. svn path=/trunk/; revision=21923
2007-05-04Add a plugin interface to wiretap.Luis Ontanon1-1/+0
So far I've done only regression testing (the new functionality and what's in wtap-plugins.c has not yet being tested). it is a first step in the way to have lua opening files. svn path=/trunk/; revision=21686
2007-05-03will this finally get rid of the warnigs?Luis Ontanon1-6/+6
svn path=/trunk/; revision=21666
2007-05-02fix warningsLuis Ontanon1-6/+7
svn path=/trunk/; revision=21653
2007-05-02add support for the text export format of textronix k1[25]Luis Ontanon1-0/+310
svn path=/trunk/; revision=21651