From e162470d6b60999deebdb389cdba33e6ddd97ca5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig=20Bj=C3=B8rlykke?= Date: Fri, 2 Oct 2009 19:55:43 +0000 Subject: Prime interesting fields when selecting a package, so Lua's ProtoField can extract the field value correctly. This fixes bug 4058. svn path=/trunk/; revision=30252 --- epan/tap.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'epan/tap.c') diff --git a/epan/tap.c b/epan/tap.c index efbf9ddbc4..c0a06c8a33 100644 --- a/epan/tap.c +++ b/epan/tap.c @@ -192,6 +192,25 @@ tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data) /* ********************************************************************** * Functions used by file.c to drive the tap subsystem * ********************************************************************** */ + +void tap_build_interesting (epan_dissect_t *edt) +{ + tap_listener_t *tl; + + /* nothing to do, just return */ + if(!tap_listener_queue){ + return; + } + + /* 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); + } + } +} + /* This function is used to delete/initialize the tap queue and prime an epan_dissect_t with all the filters for tap listeners. To free the tap queue, we just prepend the used queue to the free queue. @@ -199,8 +218,6 @@ tap_queue_packet(int tap_id, packet_info *pinfo, const void *tap_specific_data) void tap_queue_init(epan_dissect_t *edt) { - tap_listener_t *tl; - /* nothing to do, just return */ if(!tap_listener_queue){ return; @@ -210,13 +227,7 @@ tap_queue_init(epan_dissect_t *edt) tap_packet_index=0; - /* 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); - } - } + tap_build_interesting (edt); } /* this function is called after a packet has been fully dissected to push the tapped -- cgit v1.2.3