aboutsummaryrefslogtreecommitdiffstats
path: root/tap.c
diff options
context:
space:
mode:
authorsahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2002-09-14 07:42:52 +0000
committersahlberg <sahlberg@f5534014-38df-0310-8fa8-9805f1628bb7>2002-09-14 07:42:52 +0000
commitab55b51227d50b32087e300bcc92a681414276eb (patch)
tree404e8e2f088e5a904d7fba08094a961c0b1b19c6 /tap.c
parent3e3d09033d8ccfdc8f5e5cebc620ea590ae86240 (diff)
Optimized edt handling as per Guy's suggestion.
The performance impact on using multiple tap extensions using filter strings should be greatly reduced. Next step would be to rewrite the color filtering in file.c to become a tap extension and then the checking of display filters in file.c as well. After that the edt/epan_dissect_run() calls can be completely removed from file.c git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6295 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'tap.c')
-rw-r--r--tap.c25
1 files changed, 16 insertions, 9 deletions
diff --git a/tap.c b/tap.c
index 9a61724893..1efbd7a817 100644
--- a/tap.c
+++ b/tap.c
@@ -1,7 +1,7 @@
/* tap.c
* packet tap interface 2002 Ronnie Sahlberg
*
- * $Id: tap.c,v 1.2 2002/09/05 06:46:34 sahlberg Exp $
+ * $Id: tap.c,v 1.3 2002/09/14 07:42:52 sahlberg Exp $
*
* Ethereal - Network traffic analyzer
* By Gerald Combs <gerald@ethereal.com>
@@ -237,20 +237,26 @@ tap_push_tapped_queue(void)
epan_dissect_t *edt;
tapping_is_active=0;
+ edt=epan_dissect_new(TRUE, FALSE);
+
+ /* loop over all tap listeners and build the list of all
+ interesting hf_fields */
+ for(tl=(tap_listener_t *)tap_listener_queue;tl;tl=tl->next){
+ if(tl->code){
+ epan_dissect_prime_dfilter(edt, tl->code);
+ }
+ }
+
+ epan_dissect_run(edt, l_pseudo_header, l_buf, l_fdata, NULL);
+
+ /* loop over all tap listeners and call the listener callback
+ for all packets that match the filter. */
for(tp=tap_packet_list_queue;tp;tp=tp->next){
for(tl=(tap_listener_t *)tap_listener_queue;tl;tl=tl->next){
if(tp->tap_id==tl->tap_id){
int passed=TRUE;
if(tl->code){
- edt=epan_dissect_new(TRUE, FALSE);
- epan_dissect_prime_dfilter(edt, tl->code);
- epan_dissect_run(edt,
- l_pseudo_header,
- l_buf,
- l_fdata,
- NULL);
passed=dfilter_apply_edt(tl->code, edt);
- epan_dissect_free(edt);
}
if(passed && tl->packet){
tl->needs_redraw|=tl->packet(tl->tapdata, tp->pinfo, tp->tap_specific_data);
@@ -259,6 +265,7 @@ tap_push_tapped_queue(void)
}
}
+ epan_dissect_free(edt);
}
/* This function is called when we need to reset all tap listeners, for example