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

We have a temporary packet that we we're trying to do some quick dissecting on.

basically we read a field and its value determines what the next 10 or so fields are. Is there a way to overlay text for those next 10 fields, something like this:

some string { "first", "second", ....

}

proto_tree_add_item(some_tree, next_ten_fields, tvb, offset, 10, TRUE);

and have the following appear in the tree:

first: value second: value .... ten: value

If so the next question is probably how to adjust the size of each field (1 byte or 4 bytes).

Thanks, Brian

asked 11 Feb '13, 09:59

brwiese's gravatar image

brwiese
26111211
accept rate: 50%


tvb_get_guint8() / tvb_ntohs() / tvb_ntohl() and tvb_letohs() / tvb_letohl() are your friends here. Get that first fields value and branch based on that.

permanent link

answered 11 Feb '13, 14:38

Jaap's gravatar image

Jaap ♦
11.7k16101
accept rate: 14%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×41
×23
×9
×3

question asked: 11 Feb '13, 09:59

question was seen: 1,643 times

last updated: 11 Feb '13, 14:38

p​o​w​e​r​e​d by O​S​Q​A