From 086774b71f236b797a9e7a14e2bbb444b55e6d79 Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Fri, 25 Jul 2003 03:44:05 +0000 Subject: 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 --- epan/ftypes/ftype-ipv4.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'epan/ftypes/ftype-ipv4.c') diff --git a/epan/ftypes/ftype-ipv4.c b/epan/ftypes/ftype-ipv4.c index ad978a7915..e583f17aa0 100644 --- a/epan/ftypes/ftype-ipv4.c +++ b/epan/ftypes/ftype-ipv4.c @@ -1,5 +1,5 @@ /* - * $Id: ftype-ipv4.c,v 1.10 2003/02/08 04:22:37 gram Exp $ + * $Id: ftype-ipv4.c,v 1.11 2003/07/25 03:44:02 gram Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs @@ -45,7 +45,7 @@ value_get(fvalue_t *fv) } static gboolean -val_from_string(fvalue_t *fv, char *s, LogFunc logfunc) +val_from_unparsed(fvalue_t *fv, char *s, LogFunc logfunc) { guint32 addr; unsigned int nmask_bits; @@ -98,7 +98,8 @@ val_from_string(fvalue_t *fv, char *s, LogFunc logfunc) return FALSE; } - nmask_fvalue = fvalue_from_string(FT_UINT32, net_str, logfunc); + /* XXX - this is inefficient */ + nmask_fvalue = fvalue_from_unparsed(FT_UINT32, net_str, logfunc); g_free(s_copy); if (!nmask_fvalue) { return FALSE; @@ -167,7 +168,8 @@ ftype_register_ipv4(void) 4, NULL, NULL, - val_from_string, + val_from_unparsed, /* val_from_unparsed */ + NULL, /* val_from_string */ NULL, /* val_to_string_repr */ NULL, /* len_string_repr */ -- cgit v1.2.1