Ask Your Question
0

Usage of proto_tree_add_text

asked 2018-01-22 19:35:44 +0000

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-01-22 21:18:59 +0000

Jaap gravatar image

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.

edit flag offensive delete link more

Comments

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

Mikhail gravatar imageMikhail ( 2018-01-23 11:40:32 +0000 )edit

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

Jaap gravatar imageJaap ( 2018-01-23 12:00:46 +0000 )edit

I will try

Mikhail gravatar imageMikhail ( 2018-01-23 14:25:56 +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

1 follower

Stats

Asked: 2018-01-22 19:35:44 +0000

Seen: 97 times

Last updated: Jan 22