First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

Usage of proto_tree_add_text

  • retag add tags

Hi, I want to add option for JSON dissector to display JSON data in more compcat form, like in developer tools in Firefox or Chrome.

This are links for pictures of original form: link text, and for compact form (new feature, test implementation): link text.

I'm planning to use function proto_tree_add_text to add new items. These new items will be used only to display but not for filtering. Filtering will be done by original json dissector.

I can't find dissectors which use it, but have found that there is scriptconvert_proto_tree_add_text.pl for covertion proto_tree_add_text to other function.

So I'm confused, can I use proto_tree_add_text or not?

Mikhail's avatar
1
Mikhail
asked 2018-01-22 19:35:44 +0000
edit flag offensive 0 remove flag close merge delete

Comments

add a comment see more comments

1 Answer

0

You cannot. This function is on its way out and should not be used in code. Fact is any added information to a protocol tree should be filterable. In this case add it as a string and mark the protocol tree item as 'generated'. That would be the clearest way to represent the data.

Jaap's avatar
13.7k
Jaap
answered 2018-01-22 21:18:59 +0000
edit flag offensive 0 remove flag delete link

Comments

It's clear about proto_tree_add_text. But how to mark protocol tree item as "generated"?

Mikhail's avatar Mikhail (2018-01-23 11:40:32 +0000) edit

In C there's a macro for it: PROTO_ITEM_SET_GENERATED(proto_item)

Jaap's avatar Jaap (2018-01-23 12:00:46 +0000) edit

I will try

Mikhail's avatar Mikhail (2018-01-23 14:25:56 +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