diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2009-10-02 19:55:43 +0000 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2009-10-02 19:55:43 +0000 |
commit | e162470d6b60999deebdb389cdba33e6ddd97ca5 (patch) | |
tree | 781c5862e40fa6d97ca5aff45cff83fa279ca233 /epan/tap.c | |
parent | 6f28135ec86e734f19b9f1907ef153da77120a44 (diff) |
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
Diffstat (limited to 'epan/tap.c')
-rw-r--r-- | epan/tap.c | 29 |
1 files changed, 20 insertions, 9 deletions
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 |