On Thu, Oct 02, 2003 at 02:32:17PM -0700, Guy Harris wrote:

> If you haven't, no - the only way to find a conversation to which a 
> packet might belong is to look it up, and that's done with 
> "find_conversation()".
> 
> The code typically looks like
> 
>       conversation = find_conversation(...);
>       if (conversation == NULL) {
>               /* There's no conversation - create one. */
>               conversation = conversation_new(...);
>       }

Ok.. That is exactly the way I'm doing....
I was wondering if there was a way to skip the find_conversation, if the
dissector is called as conversation dissector, using the result previous lookup...
Just because I hate wasting cpu time...:) 

> Creating a subtree without the intent of putting something under it is 
> pointless, so presumably you either
> 
>       1) want to create a subtree, but you don't know, at the time you'd 
> create it, whether you'll be putting anything under it or not
> 
> or
> 
>       2) want to create a subtree, but just put stuff under it with 
> "proto_tree_add_text()".
> 
> Both of those are possible.  You create a subtree with 
> "proto_item_create_subtree()", which requires no named fields, so the 
> way you create a subtree without named fields under it is the same way 
> you create a subtree with named fields under it - you just don't put 
> any named fields into that tree.

Probably I wasn't clear about the variables stuff... :)
Of course the subtree will have something under it, but not named fields
( so i can't do search on them ).
I used the tcp.flags as example of the look I need... 
Anyway, I found a way to get it, I've replaced the proto_tree_add_boolean,
with proto_tree_add_text( decode_boolean_bitfield( ) ).


-- 
Ciao,
 Emanuele

Reply via email to