aboutsummaryrefslogtreecommitdiffstats
path: root/wiretap/ascend_scanner.l
AgeCommit message (Collapse)AuthorFilesLines
2018-02-16Use DIAG_OFF_FLEX/DIAG_ON_FLEX more consistently.Guy Harris1-1/+11
Add warning C4267 (size_t to int conversion) with MSVC to DIAG_OFF_FLEX. Addd -Wshorten-64-to-32 with Clang and GCC to DIAG_OFF_FLEX. Don't explicitly use #pragma to turn off warnings; use DIAG_OFF_FLEX for all of them. If we use DIAG_OFF_FLEX, use DIAG_ON_FLEX, even if we have no section of entirely included code at the end. Change-Id: Ibfd44e8954704e9a8bcb1bd8e54f31d28357fffb Reviewed-on: https://code.wireshark.org/review/25817 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-08replace SPDX identifier GPL-2.0+ with GPL-2.0-or-later.Dario Lombardo1-1/+1
The first is deprecated, as per https://spdx.org/licenses/. Change-Id: I8e21e1d32d09b8b94b93a2dc9fbdde5ffeba6bed Reviewed-on: https://code.wireshark.org/review/25661 Petri-Dish: Anders Broman <a.broman58@gmail.com> Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-20wiretap: more SPDX license convertions.Dario Lombardo1-14/+1
Change-Id: I12695d0713b1d7fe58f09b2037303fab523085e9 Reviewed-on: https://code.wireshark.org/review/25394 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Gerald Combs <gerald@wireshark.org>
2017-09-19Disable flex-generated [-Wsign-compare] warningsJoão Valverde1-0/+2
Change-Id: Iace0462e6bb50573f3e4603f7a19e4b7ee1f9733 Reviewed-on: https://code.wireshark.org/review/23541 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: João Valverde <j@v6e.pt>
2016-12-02Include config.h at the very beginning of all Flex scanners.Guy Harris1-2/+5
That way, if we #define anything for large file support, that's done before we include any system header files that either depend on that definition or that define it themselves if it's not already defined. Change-Id: I9b07344151103be337899dead44d6960715d6813 Reviewed-on: https://code.wireshark.org/review/19035 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-16Don't pick up junk from an unset error-number variable.Guy Harris1-4/+4
Keep the actual error code and pointer-to-error-string in the scanner state, rather than pointers to the variables passed in to us. Initialize them to 0 and NULL, respectively. That way, when the actual scanner routine returns, we don't check for an error by looking at the error variable pointed to by our argument, which might not have been set by the scanner and might have stack junk in it, we look at a structure member we set to 0 before the scan. Change-Id: I81a4fd6d5cf5e56f5638fae1253c48dc50c9c36d Reviewed-on: https://code.wireshark.org/review/17721 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-05Set the extra type the right way.Guy Harris1-0/+5
Use %option extra_type= rather than #defining YY_EXTRA_TYPE. Change comments to reflect that the state structure is used both by the lexical analyzer and the parser. Change-Id: I19a81de61cbd6e86d71154f376ef0681cc6d42fb Reviewed-on: https://code.wireshark.org/review/14826 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-03Fix #defines.Guy Harris1-3/+3
Change-Id: I0fcd865d686d50ae9be17e97a4495daebc4bc4fc Reviewed-on: https://code.wireshark.org/review/14801 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-04-03Make the Flex scanners and YACC parser in libraries reentrant.Guy Harris1-45/+81
master-branch libpcap now generates a reentrant Flex scanner and Bison/Berkeley YACC parser for capture filter expressions, so it requires versions of Flex and Bison/Berkeley YACC that support that. We might as well do the same. For libwiretap, it means we could actually have multiple K12 text or Ascend/Lucent text files open at the same time. For libwireshark, it might not be as useful, as we only read configuration files at startup (which should only happen once, in one thread) or on demand (in which case, if we ever support multiple threads running libwireshark, we'd need a mutex to ensure that only one file reads it), but it's still the right thing to do. We also require a version of Flex that can write out a header file, so we change the runlex script to generate the header file ourselves. This means we require a version of Flex new enough to support --header-file. Clean up some other stuff encountered in the process. Change-Id: Id23078c6acea549a52fc687779bb55d715b55c16 Reviewed-on: https://code.wireshark.org/review/14719 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-06Get rid of a bunch of unused variables.Guy Harris1-6/+1
("Unused" includes "set but not used".) Change-Id: Id67859b366e8caa50262f8530630ec4e8ef1507a Reviewed-on: https://code.wireshark.org/review/12457 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-05Use noyywrap rather than defining our own yywrap functions.Guy Harris1-11/+5
Tweak lemonflex-tail.inc to fix an issue this reveals. It appears that, at least on the buildbots, the Visual Studio compiler no longer issues warnings for the code generated with %option noyywrap. Change-Id: Id64d56f1ae8a79d0336488a4a50518da1f511497 Reviewed-on: https://code.wireshark.org/review/12433 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-08More unnecessary <stdio.h> includes.Guy Harris1-1/+0
libwiretap no longer uses standard I/O routines to read files; those includes are left over from when it did. Change-Id: Ia46c5e24ed25c6bd254cd271746ace539a37e590 Reviewed-on: https://code.wireshark.org/review/11634 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-11-06Don't include io.h in Flex scanners - they're not interactive.Guy Harris1-5/+1
We don't have any Flex scanners that support an interactive command-line interface, so none of our scanners are, or need to be, interactive. Mark text2pcap's scanner as not interactive. That means none of our scanners should call isatty(), so they don't have any need to include <io.h> on Windows; remove that include from the Lucent/Ascent text capture scanner. Update a comment to reflect that what matters isn't whether we can read from a terminal or whether we actually do so, what matters is whether they read *interactively* from a terminal (if you want to run text2pcap reading from the standard input and type at it, be my guest). Change-Id: I59979d1fdb37e1913125a400963ff7a3fa6b9bbd Reviewed-on: https://code.wireshark.org/review/11587 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-10-07Whitespace cleanups.Guy Harris1-1/+1
Change-Id: I92f983b2e04defab30eb31c14c484b9f0f582413 Reviewed-on: https://code.wireshark.org/review/4513 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-03-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(Using sed : sed -i '/^ \* \$Id\$/,+1 d') Fix manually some typo (in export_object_dicom.c and crc16-plain.c) Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8 Reviewed-on: https://code.wireshark.org/review/497 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2013-12-14Squelch a bunch of shorten-64-to-32 warnings by parsing all of ourGerald Combs1-14/+16
numeric values using strtoul and casting it the result to a guint32. Hopefully no user or session IDs are negative or greater than 32 bits. svn path=/trunk/; revision=54100
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
2011-06-09The only place where we care about zlib is file_wrappers.c; includeGuy Harris1-4/+2
<zlib.h> there, rather than wtap-int.h. That obviates the need to include config.h earlier in ascend_scanner.l; revert the previous change, so we don't require a version of Flex that supports %top. svn path=/trunk/; revision=37640
2011-06-09Move the copyright notice and the config.h include to the top of theGerald Combs1-2/+4
file so that we have the proper definitions in place for large file support on Solaris (bug 6102). svn path=/trunk/; revision=37635
2011-06-08Limit the lengths of some of our patterns. Fixes an infinite loop foundGerald Combs1-16/+16
when trying to read a TPNCP data file. svn path=/trunk/; revision=37625
2009-06-15Rename all of the ascend files:Jörg Mayer1-0/+359
That way we hopefully won't need the runlex.sh hack any more. Also the ylwrap stuff is (hopefully) obsolete. ascend.[hc] -> ascendtext.[hc] ascend-scanner.l -> ascend_scanner.l ascend-grammar.y -> ascend.y svn path=/trunk/; revision=28744