From 55a6251e7c52b3610cd8992b541be919a5dca5aa Mon Sep 17 00:00:00 2001 From: Gilbert Ramirez Date: Sat, 6 Dec 2003 16:35:20 +0000 Subject: 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 --- util.c | 36 +++++++++++++++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) (limited to 'util.c') 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 @@ -60,6 +60,10 @@ typedef int mode_t; /* for win32 */ #include /* to get the libz version number */ #endif +#ifdef HAVE_LIBPCRE +#include /* to get the libpcre version number */ +#endif /* HAVE_LIBPCRE */ + #ifdef HAVE_LIBPCAP #include #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 */ } /* -- cgit v1.2.1