Ask Your Question
0

How to create a tree with two subtrees in a plugin dissector (c)?

asked 2020-11-30 10:58:35 +0000

Robin26689 gravatar image

Hi Togehter,

For example, i get a frame of 4 hex values. 2 hex values belongs to the master and 2 to the device. I want to create a Tree "DATA" and if i open the tree i want to see a "Master" and a "Device" Tree and if i open them, i want to see the hex values and some definitions from a text. I didn't find an answer to my question online. I hope you can help.

Thx and best regards

rob

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2020-11-30 11:29:26 +0000

grahamb gravatar image

updated 2020-11-30 11:30:14 +0000

Look at README.dissector, section 1,5.2 for the proto_item_add_subtree() method.

If you haven't looked at README.dissector before, you're missing out on a lot of excellent info about writing dissectors.

There are also many examples in the source code of other dissectors.

edit flag offensive delete link more

Comments

Thank you very much grahamb! I figured it out with the help of the readme. I think i just didnt read well enough last time or i am just too unexperienced but now it works as i want.

Do you maybe know how or if i can save a hex value from for example frame #1 and add it to frame #2?

thx ahead

rob

Robin26689 gravatar imageRobin26689 ( 2020-11-30 11:50:43 +0000 )edit

@Robin26689 : That is a new question. Please open up a new one instead of attaching it to this. This is not a forum.

Jaap gravatar imageJaap ( 2020-11-30 13:14:55 +0000 )edit

A dissector is usually just concerned with dissecting the data in the current frame. To use data from other frames you'll have to look into conversations, discussed in section 2.2 of the same document.

If an answer has solved your question, please accept it by clicking the checkmark icon to the left of it. This helps others who may have similar questions.

grahamb gravatar imagegrahamb ( 2020-11-30 13:14:57 +0000 )edit

@Jaap Yes sorry, won't do it again :)

@grahamb thank you very much, will dig a bit deeper in the readme file as i did before

Robin26689 gravatar imageRobin26689 ( 2020-11-30 13:18:17 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

Asked: 2020-11-30 10:58:35 +0000

Seen: 562 times

Last updated: Nov 30 '20