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

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: Tue, 15 Oct 2002 22:58:36 +0000
From: Guy Harris CC: ethereal-dev@xxxxxxxxxxxx
Subject: Re: [Ethereal-dev] Changing tap code not to call "epan_dissect_run()" one more time?
Date: Mon, 14 Oct 2002 09:54:10 -0700

Unfortunately, I think it would *not* be cleaner if the code were
changed to add rather than remove global variables; we already have the
"l_pseudo_header", "l_buf", and "l_fdata" globals, and I'd rather get
rid of them than add additional global variables.

You are right. Thanks for the input.
I redesigned the change and came up with the following:
1, remove the dissection completely from tap.c
2, add a global num_tap_filters that tells us how many tap listeners with filters there are. 3, change tap_queue_init() to take epan_dissect_t *edt as the only parameter, getting rid of the ugly other parameters. Change this function to IFF there are tap filters, add them to edt.
4, in file.c, add
  if( num_tap_filters )
      create_proto_tree=TRUE;
and also move the call to tap_queue_init(edt) to the line immediately before the epan_dissect_run() call. 5, Change tap_push_tapped_queue() to take epan_dissect_t * as a parameter and change it to not dissect the packet. The parts where it looped and added the filter to edt was moved to tap_queue_init().

That works quite well and will only call epan_dissect_run() exactly once for every packet.
It is also much cleaner than my previous suggestion.

I will provide a patch for review tomorrow.

best regards
ronnie sahlberg



_________________________________________________________________
Surf the Web without missing calls! Get MSN Broadband. http://resourcecenter.msn.com/access/plans/freeactivation.asp