aboutsummaryrefslogtreecommitdiffstats
path: root/util.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 /util.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 'util.c')
-rw-r--r--util.c36
1 files changed, 35 insertions, 1 deletions
diff --git a/util.c b/util.c
index 1b245c3e3c..26ee78395f 100644
--- a/util.c
+++ b/util.c
@@ -1,7 +1,7 @@
/* util.c
* Utility routines
*
- * $Id: util.c,v 1.73 2003/12/01 20:27:09 gerald Exp $
+ * $Id: util.c,v 1.74 2003/12/06 16:35:18 gram Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -60,6 +60,10 @@ typedef int mode_t; /* for win32 */
#include <zlib.h> /* to get the libz version number */
#endif
+#ifdef HAVE_LIBPCRE
+#include <pcre.h> /* to get the libpcre version number */
+#endif /* HAVE_LIBPCRE */
+
#ifdef HAVE_LIBPCAP
#include <pcap.h>
#endif /* HAVE_LIBPCAP */
@@ -152,6 +156,26 @@ get_compiled_version_info(GString *str)
g_string_append(str, ",");
do_word_wrap(str, break_point);
+ g_string_append(str, " ");
+ break_point = str->len - 1;
+#ifdef HAVE_LIBPCRE
+ g_string_append(str, "with libpcre ");
+#ifdef PCRE_MAJOR
+#ifdef PCRE_MINOR
+ g_string_sprintfa(str, "%u.%u", PCRE_MAJOR, PCRE_MINOR);
+#else /* PCRE_MINOR */
+ g_string_sprintfa(str, "%u", PCRE_MAJOR);
+#endif /* PCRE_MINOR */
+#else /* PCRE_MAJOR */
+ g_string_append(str, "(version unknown)");
+#endif /* PCRE_MAJOR */
+#else /* HAVE_LIBPCRE */
+ g_string_append(str, "without libpcre");
+#endif /* HAVE_LIBPCRE */
+
+ g_string_append(str, ",");
+ do_word_wrap(str, break_point);
+
/* Oh, this is pretty. */
/* Oh, ha. you think that was pretty. Try this:! --Wes */
g_string_append(str, " ");
@@ -181,7 +205,17 @@ get_compiled_version_info(GString *str)
#else
g_string_append(str, "without ADNS");
#endif /* HAVE_GNU_ADNS */
+
+ g_string_append(str, ".");
+ do_word_wrap(str, break_point);
+
+#ifndef HAVE_LIBPCRE
+ break_point = str->len - 1;
+ g_string_append(str,
+ "\nNOTE: this build does not support the \"matches\" operator"
+ "\nfor Ethereal filter syntax.\n");
do_word_wrap(str, break_point);
+#endif /* HAVE_LIBPCRE */
}
/*