Ethereal-dev: [Ethereal-dev] A elementary question about the dissector

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

From: Kelvin You <kelvin.sdc@xxxxxxxxx>
Date: Thu, 8 Dec 2005 16:36:25 +0800
Hi, All,
 
I 'm a freshman to ethereal development.
now I have some question about the dissector creation
 
static gint ett_xxx = -1;
 
   static gint *ett[] =
    {
        &ett_xxx,
    };
 
In my dissector,  I create many trees and use the same ett_xxx:
proto_item_add_subtree(sub_ti, ett_xxx);
 
It seems that everything is OK.
 
But I find some dissector use more ett_???
such as, they define
   static gint *ett[] =
    {
        &ett_xxx0,
        &ett_xxx1,
        ...
        &ett_xxxn
    };
 
and use them respectively when create the protocol trees,
My question is why not use one ett_xxx and why use multiple ett ? what's the difference ?
 
Thanks for your help.