Ethereal-dev: [Ethereal-dev] Changing tap code not to call "epan_dissect_run()" one more time?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Pia Sahlberg" <piabar@xxxxxxxxxxx>
Date: Fri, 11 Oct 2002 07:55:49 +0000
Hi list, hi guy.

I agree 100% that doing two dissections is bad and should be eliminated.

However, I would prefer a different approach.

I think it would be cleaner if the code was changed instead so that
in file.c   the display/color-filter handling itself would become
tap extensions.

For example: display-filter could be changed to be a 10 line tap extension that just changes a global variable. Then, in file.c (analog in tethereal.c) display filter handling would just be

filter_passed=0;
<do the tap calls>
if(filter_passed or no-filter-at-all){
} else {
}

Display filter would just be a tap extension, registered on the "frame" tap with no draw or reset callback, and one packet callback:
df_packet(){
  filter_passed=1;
}

This would basically remove all the display filter code from tap.c and tethereal.c and reuse the facilities of tap.


We could do a similar thing with color-filters. I.e. chganging them to really simple tap extensions that just change a global fg/bg variable when invoked.


With these two changes implemented, we have removed ALL filter handling from file.c (except the read-filter one, but i think it is semi-broken anyway since it calls the dissectors with frame-num==0 for all packets and reassembly and friends will be unhappy with that)

Since ALL filter handling has been removed from file.c   we can fold the
two functions tap_queue_init() and tap_push_tapped_queue() into a single
fiunction and rename it to tap_dissect_packet() which would unconditionally dissect the packet exactly once.


This would remove lots of code handling filters from file.c, code that by nessecity must be duplicated inside tap.c anyway for tap to work. We would be back at always, no matter what, packets are dissected exactly once, and not as now, twice if there are taps.


I want to make this change but life and travel has interfered.

best regards







_________________________________________________________________
Join the world’s largest e-mail service with MSN Hotmail. http://www.hotmail.com