Commit Graph

76 Commits

Author SHA1 Message Date
Ronnie Sahlberg 89f022b12b name change
svn path=/trunk/; revision=18197
2006-05-21 05:12:17 +00:00
Gilbert Ramirez e3899ed4a4 Add infrastructure for display filter functions.
Add upper() and lower() display filter functions for string fields.

svn path=/trunk/; revision=18071
2006-05-02 14:26:17 +00:00
Guy Harris e361585aef The "new" routine for STTYPE_STRING and STTYPE_UNPARSED does a
"strdup()" on the argument, so we don't need to do that ourselves (and,
in fact, as we're doing it ourselves but not freeing the result, we leak
memory).

svn path=/trunk/; revision=13892
2005-03-24 05:27:03 +00:00
Guy Harris 8a8b883450 Set the svn:eol-style property on all text files to "native", so that
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.

svn path=/trunk/; revision=11400
2004-07-18 00:24:25 +00:00
Guy Harris 12fddb1280 G_MAXINT32, G_MININT32, and G_MAXUINT32 aren't defined by GLib 1.2[.x],
so we have to define them ourselves if they're not defined.

svn path=/trunk/; revision=11384
2004-07-17 08:45:10 +00:00
Guy Harris c27d80c9ad I'm not sure "strtol()" and "strtoul()" are guaranteed to clear "errno"
on success, so we clear it before calling them.

Assign the value of "strtol()" to a "long" and assign the value of
"strtoul()" to an "unsigned long", as those are the return types for
those functions - "gint32" and "guint32" might not be large enough for
the return value on an LP64 platform.

Check for errno being EINVAL, as that can happen if the number isn't
valid.

Before assigning the value returned by "strtol()" or "strtoul()" to the
final destination, check whether it's in the right range for that
destination.

svn path=/trunk/; revision=11382
2004-07-16 23:35:46 +00:00
Guy Harris e1e690ff3a From Graeme Hewson:
Use gint32 instead of guint32 for node data.

Fix up some other signed-vs-unsigned issues in the display filter
parser and lexical analyzer.

svn path=/trunk/; revision=11085
2004-06-03 07:36:25 +00:00
Guy Harris c02072be2c From Graeme Hewson:
Use gint32 instead of guint32 and strtol() instead of strtoul()
     for signed integers.

     Pathological slice specifications could cause Flex default rule
     to be invoked, echoing characters to stdout.
     Example: frame[0foo]==1

svn path=/trunk/; revision=11082
2004-06-03 07:17:24 +00:00
Guy Harris 4befb390d1 From Graeme Hewson: get rid of unnecessary check (it's necessary for
octal, as the maximum of 3 octal digits can be more than 0377, but not
necessary for hex, as the maximum of 2 hex digits can't be more than
0xff).

svn path=/trunk/; revision=10827
2004-05-08 22:03:43 +00:00
Gilbert Ramirez f31ddecf91 Add support for flex 2.5.31.
svn path=/trunk/; revision=10684
2004-04-25 04:53:42 +00:00
Olivier Biot 1791f84919 First attempt at "bitwise AND" display filter operator.
Document how a display operator can be added.

svn path=/trunk/; revision=10250
2004-02-27 12:00:32 +00:00
Guy Harris 60096bfad9 Use -1 rather than 0 as the SCAN_FAILED return value from the lexical
analyzer on errors, and check for SCAN_FAILED from the lexical analyzer
and abort the parse if we see it; 0 means "end of input", and we want to
distinguish errors from end-of-input, so that we can report errors as
such.

If we see end-of-input while parsing a double-quoted string, report the
error (missing closing quote).

Fix the URL for the "Start conditions" section of the Flex manual.

svn path=/trunk/; revision=10044
2004-02-11 22:52:54 +00:00
Gilbert Ramirez 4f1c2830f1 Don't assert that quoted_string be NULL; it can be non-NULL if
the previous dfilter failed to compile because a closing double-quote
was not provided. Handle that case.

svn path=/trunk/; revision=9585
2004-01-07 05:24:04 +00:00
Guy Harris 331b8b5a8b Add, for \xXX, the same sanity check (that 0xXX fits in a single byte)
that we have for \0OOO.

svn path=/trunk/; revision=9396
2003-12-21 21:04:56 +00:00
Ulf Lamping dea93d2bee removed some MSVC warnings (added type casts)
svn path=/trunk/; revision=9370
2003-12-20 23:50:50 +00:00
Gilbert Ramirez 55a6251e7c From Olivier Biot
New "matches" operater in display filter language. Uses PCRE.

If a "matches" operator is found in a dfilter
while libpcre has not been used to build the binary, then an
exception is thrown after using dfilter_fail() to set an apporporiate
error message.

svn path=/trunk/; revision=9182
2003-12-06 16:35:20 +00:00
Guy Harris 4b1fda78b9 Allow + and , in unparsed strings, so that you can use + as a sign in a
number or exponent and so that floating-point numbers can use , as well
as . as a decimal point.

svn path=/trunk/; revision=8791
2003-10-27 22:45:47 +00:00
Gilbert Ramirez 52338a3baf Add a "contains" operator for byte-strings, strings, and tvbuffs (protocols).
The search uses a naive approach; more work is required to add a
Boyer-Moore Search algorithm.

svn path=/trunk/; revision=8280
2003-08-27 15:23:11 +00:00
Gilbert Ramirez 086774b71f Add to the fundamental types passed between the scanner and the parser.
Besides "STRING", there is now "UNPARSED_STRING", where the distinction
is that "STRING" was a double-quoted string and "UNPARSED_STRING" is just
a sequence of characters that the scanner didn't know how to scan/parse,
so it's up to the Ftype to parse it.

This gives us more flexibility and prepares the dfilter parsing engine
for the upcoming addition of the "contains" operator.

In the process of doing this, I also re-did the double-quoted string
support in the scanner, so that instead of the naively-simple support we
used to have, double-quoted strings now can have embedded dobule-quotes,
embedded octal sequences, and embedded hexadecimal sequences:
    "\""    embedded double-quote
    "\110"  embedded octal
    "\x48"  embedded hex

Enhance the dfilter unit test script to be able to run a single collection
of tests instead of having to run all of them all the time.

svn path=/trunk/; revision=8083
2003-07-25 03:44:05 +00:00
Guy Harris 30f02bc99c Move the code to build the balanced tree of fields into "proto_init()",
move the code from "dfilter_lookup_token()" into
"proto_registrar_get_byname()", and get rid of "dfilter_lookup_token()"
and have its callers call "proto_registrar_get_byname()" instead.

svn path=/trunk/; revision=5287
2002-04-29 07:55:32 +00:00
Gilbert Ramirez 5c75eb2df7 Add "-" (hyphen) to the pattern for field-name/non-quoted string.
svn path=/trunk/; revision=5139
2002-04-11 03:26:26 +00:00
Gilbert Ramirez 39b0e82f63 Support CIDR notation in IPv4 address filtering.
svn path=/trunk/; revision=3601
2001-06-22 16:29:15 +00:00
Gilbert Ramirez b24dff17bd Enable slices of [i-j], where i is start offset and j is end offset,
inclusive. That is, [0-1] is a slice of 2 bytes.

svn path=/trunk/; revision=3092
2001-03-02 17:04:25 +00:00
Gilbert Ramirez 2a50f8af4f Add Ed Warnicke's drange code to the new dfilter system.
Not supported yet: [i-j] (offset-offset)
Supported:
	[i]	index
	[i:j]	offset:length
	[:j]	0:offset
	[i:]	offset:end
	[x,y]	concatenation of slices

svn path=/trunk/; revision=3080
2001-02-27 19:23:30 +00:00
Gilbert Ramirez 96e0398fc6 Grumble, grumble. I forgot to add the license comment at the top
of these files.

svn path=/trunk/; revision=2968
2001-02-01 20:31:21 +00:00
Gilbert Ramirez 8f1fff2e6a Create a more modular type system for the FT_* types. Put them
into epan/ftypes.

Re-write display filter routines using Lemon parser instead of yacc.
Besides using a different tool, the new grammar is much simpler, while
the display filter engine itself is more powerful and more easily extended.

Add dftest executable, to test display filter "bytecode" generation.
Add option to "configure" to build dftest or randpkt, both of which are not
built by default.

Implement Ed Warnicke's ideas about dranges in the new display filter and
ftype code.

Remove type FT_TEXT_ONLY in favor of FT_NONE, and have protocols registered
as FT_PROTOCOL. Thus, FT_NONE is used only for simple labels in the proto tree,
while FT_PROTOCOL is used for protocols. This was necessary for being
able to make byte slices (ranges) out of protocols, like "frame[0:3]"

Win32 Makefile.nmake's will be added tonight.

svn path=/trunk/; revision=2967
2001-02-01 20:21:25 +00:00