aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes/ftypes.c
diff options
context:
space:
mode:
authorGilbert Ramirez <gram@alumni.rice.edu>2003-12-06 16:35:20 +0000
committerGilbert Ramirez <gram@alumni.rice.edu>2003-12-06 16:35:20 +0000
commit55a6251e7c52b3610cd8992b541be919a5dca5aa (patch)
tree11537545c74d4f5276cfffaf8cb7b2ad4e6fbba8 /epan/ftypes/ftypes.c
parent71c8b6077b28245ed7f65e129bf0bcab1066947e (diff)
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
Diffstat (limited to 'epan/ftypes/ftypes.c')
-rw-r--r--epan/ftypes/ftypes.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/epan/ftypes/ftypes.c b/epan/ftypes/ftypes.c
index 43b437a49d..c294ed75bb 100644
--- a/epan/ftypes/ftypes.c
+++ b/epan/ftypes/ftypes.c
@@ -1,5 +1,5 @@
/*
- * $Id: ftypes.c,v 1.18 2003/12/03 09:28:23 guy Exp $
+ * $Id: ftypes.c,v 1.19 2003/12/06 16:35:20 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -183,6 +183,15 @@ ftype_can_contains(enum ftenum ftype)
return ft->cmp_contains ? TRUE : FALSE;
}
+gboolean
+ftype_can_matches(enum ftenum ftype)
+{
+ ftype_t *ft;
+
+ FTYPE_LOOKUP(ftype, ft);
+ return ft->cmp_matches ? TRUE : FALSE;
+}
+
/* ---------------------------------------------------------- */
/* Allocate and initialize an fvalue_t, given an ftype */
@@ -501,3 +510,11 @@ fvalue_contains(fvalue_t *a, fvalue_t *b)
g_assert(a->ftype->cmp_contains);
return a->ftype->cmp_contains(a, b);
}
+
+gboolean
+fvalue_matches(fvalue_t *a, fvalue_t *b)
+{
+ /* XXX - check compatibility of a and b */
+ g_assert(a->ftype->cmp_matches);
+ return a->ftype->cmp_matches(a, b);
+}