Wireshark-dev: Re: [Wireshark-dev] what is the meaning of function proto_register_subtree_array

From: Bill Meier <wmeier@xxxxxxxxxxx>
Date: Sun, 16 Feb 2014 10:55:04 -0500
On 2/16/2014 7:44 AM, 我想不无聊 wrote:
when you register a protocol,you should do the following three steps,
1.proto_register_protocol();
2.proto_register_field_array();
3.proto_register_subtree_array()

what does the third function proto_register_subtree_array do?why ?and do
it for what reason?



Essentially: proto_register_subtree() registers variables (usually named ett_...) which are used to store state as to whether a particular sub-tree is expanded or not in the "packet-details" pane in the GUI.


See proto_item_add_subtree(...) in the code for pretty much any dissector.