THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

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

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

Robin26689's avatar
13
Robin26689
asked 2020-11-30 10:58:35 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

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.

grahamb's avatar
23.8k
grahamb
answered 2020-11-30 11:29:26 +0000, updated 2020-11-30 11:30:14 +0000
edit flag offensive 0 remove flag delete link

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's avatar Robin26689 (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's avatar Jaap (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's avatar grahamb (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's avatar Robin26689 (2020-11-30 13:18:17 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer