Ethereal-dev: Re: Fw: [Ethereal-dev] SMBpatch for read/write and x

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

From: Gilbert Ramirez <gram@xxxxxxxxxxxxxxx>
Date: Wed, 28 Nov 2001 15:25:08 -0600
On Wed, 28 Nov 2001 15:18:40 Ronnie Sahlberg wrote:
> Subject: Re: [Ethereal-dev] SMBpatch for read/write and x

> 
>  I assume it is an optimization, when inside proto_X, only look at hf_X
> when
>  matching display filters (we have quite a number of displayfilters now)
>  Perhaps the displayfilter stuff should always scan ALL hf_variables
> (speed
>  up smb which holds ~10% of them?)
>  and be made to handle that?
>  Say a fast and simple hash that produces values 0-255 (xor of all bytes
> in
>  name is fast and simple) which gives us a table between0-255
>  the table then stores pointers to binary trees, one tree per hash
>  value.Store the display filter entries matching the hash in the
>  corresponding
>  tree.  Since these trees are static, we only build the trees when the
>  application is starting, thus runtime is not really critical, thus we
> could
>  also make sure that the trees are perfectly balanced for furter
>  optimization.
>  Then we change the display filter stuff to always look through ALL hf_x
>  fields and not only a subset.
>  Another thing to put in the TODO list for some unknown future...

The display filter code can easily be changed to find an field under
*any* protocol, not just the one for which the field was registered.

In proto.c, proto_get_finfo_ptr_array() and
proto_check_for_protocol_or_field(), and perhaps some of their static
helper functions, need to be changed to scan the entire tree instead of
just a particular branch.  If this is what we want, I can make the change.

--gilbert