Ethereal-dev: RE: [ethereal-dev] Find parent of current tree

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

From: Jeff Foster <jfoste@xxxxxxxxxxxx>
Date: Thu, 12 Aug 1999 12:53:43 -0500
Using your example fitted to my problem,  what I get calling a new disector
for SMB Mailslot protocol with the tree use in the SMBtrans disector is  -- 

top-level proto_tree
    |
    + ------ Frame
    |        |
    |        +---- data
    |
    + ------ Ethernet
    |        |
    |        +---- data
    |
    + ------ LLC
    |        |
    |        +---- data
    |
    + ------ NETBIOS
    |        |
    |        +---- data
    |
    + ------ SMB
    |        |
    |        +---- data
             |
            +---- SMB Mailslot


What I want --
    .
    .
    |
    + ------ SMB
    |        |
    |        +---- data
    |
   +---- SMB Mailslot



Jeff Foster
jfoste@xxxxxxxxxxxx

> -----Original Message-----
> From:	Gilbert Ramirez [SMTP:gram@xxxxxxxxxx]
> Sent:	Thursday, August 12, 1999 12:00 PM
> To:	Jeff Foster
> Cc:	'Ethereal Developers List'
> Subject:	Re: [ethereal-dev] Find parent of current tree
> 
> On Thu, Aug 12, 1999 at 11:40:29AM -0500, Jeff Foster wrote:
> > 
> > 
> > 
> > I have an need to get the parent of the current proto_tree, can anyone
> tell
> > me how to do that ?
> > 
> > Jeff Foster
> > jfoste@xxxxxxxxxxxx
> > 
> 
> When you say 'parent', do you mean 'the parent protocol of a particular
> field', or 'the protocol lower in the stack'?
> 
> At the top level of the proto_tree, just as in the GUI tree, the
> protocols are not stacked in parent-child relationships, but in sibling
> relationships:
> 
> top-level proto_tree
>     |
>     + ------ Frame
>     |        |
>     |        +---- data
>     |        |
>     |        +---- data
>     |
>     |
>     + ------ Ethernet
>     |        |
>     |        +---- data
>     |        |
>     |        +---- data
>     |
>     |
>     + ------ LLC
>     |        |
>     |        +---- data
>     |        |
>     |        +---- data
>     .
>     .
>     .
> 
> If you are looking for the parent of one of the sub-branches (in order
> to find which protocol it belongs to), then you are looking for
> a parent relationship.
> 
> If you are looking for the protocol which preceded your protocol,
> you are looking for a sibling relationship.
> 
> Which are you trying to do? 
> 
> --gilbert