This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

How to implement collapsed subtrees in Wireshark?

0

Hi there,

I'm implementing a dissector. Whenever, I add a subtree by using proto_item_add_subtree() to my protocol tree, It appears in the GUI interface of wireshark expanded by default. I've noticed this not the case with the others dissectors such as SSL for example ( Its subtrees are collapsed by default). I want my subtrees to look collapsed by default also but I'm not sure how! Any help,hints would be appreciated.... thanks.

asked 02 Dec '14, 21:08

flora's gravatar image

flora
156313338
accept rate: 100%


One Answer:

2

You are probably using the same ett_ variable for all your subtrees, leading to this behavior. Use a different ett_ variable per subtree type and they will appear collapsed. The opened one will be remembered when you change the packet viewed.

answered 02 Dec '14, 22:14

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

This works for me. I was using the same tree type for all of my subtrees. Thanks!

(03 Dec '14, 08:58) flora