diff options
author | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-05-31 09:53:21 +0000 |
---|---|---|
committer | guy <guy@f5534014-38df-0310-8fa8-9805f1628bb7> | 2004-05-31 09:53:21 +0000 |
commit | d2fb0850b504bd25e91a41b859c94baa2395febb (patch) | |
tree | 7187d5a919b5f168a36241fde5ee75d0fb7d2829 /tap.c | |
parent | 0a3c113b09974a831ed9dcad08b1364f42f4cbd2 (diff) |
Add a routine that indicates where there are any tap listeners
registered (not whether there are any tap *filters* registered).
Do dissection in Tethereal iff:
we're printing information about each packet;
we're using a read filter on the packets;
there are any tap listeners registered (even if there are no tap
filters registered - not all taps use filters).
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11040 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tap.c')
-rw-r--r-- | tap.c | 17 |
1 files changed, 14 insertions, 3 deletions
@@ -1,7 +1,7 @@ /* tap.c * packet tap interface 2002 Ronnie Sahlberg * - * $Id: tap.c,v 1.9 2003/04/23 08:20:02 guy Exp $ + * $Id: tap.c,v 1.10 2004/05/31 09:53:21 guy Exp $ * * Ethereal - Network traffic analyzer * By Gerald Combs <gerald@ethereal.com> @@ -417,5 +417,16 @@ remove_tap_listener(void *tapdata) return; } - - +/* + * Return TRUE if we have tap listeners, FALSE otherwise. + * Checking "num_tap_filters" isn't the right way to check whether we need + * to do any dissection in order to run taps, as not all taps necessarily + * have filters, and "num_tap_filters" is the number of tap filters, not + * the number of tap listeners; it's only the right way to check whether + * we need to build a protocol tree when doing dissection. + */ +gboolean +have_tap_listeners(void) +{ + return tap_listener_queue != NULL; +} |