OSQA is unmaintained. Help us figure out where to go from here.

I am trying to use proto_tree_add_bits_item() to select all the bits that are used in a 7-bit ASCII message of arbitrary length. I convert this 7-bit ASCII to 8-bit and then print out a string, but I would like Wireshark to select the bits that this string was derived from when the "Packet Bytes" window is in "Bits View" instead of the standard "Hex view". I have found that it will highlight the individual bits up to 7*3=21, and then it starts highlighting whole bytes. What's up?

ti = proto_tree_add_bits_item(cftext_sub_tree3, hf_cftext_textmess, tvb, 1918, 7*num_char, FALSE);

/* I am not interested in printing the bits here,
 * that's why I am using proto_item_set_text() instead of
 * proto_item_append_text().
proto_item_set_text(ti, "Text Message: %s", ascii_message);

Any ideas/answers are greatly appreciated!

asked 01 Sep '11, 12:10

Techboy's gravatar image

accept rate: 0%

edited 01 Sep '11, 14:07

helloworld's gravatar image


You should indent your code four spaces so that it is correctly formatted. Unserscores, asterisks, and backticks are used to format posts. See the OSQA User's Guide about markdown for more information.

(01 Sep '11, 12:25) multipleinte...
  1. To demonstrate the problem, can you add a screenshot to your question?
  2. Is num_char set to 3 in your code above?
  3. Does the incorrect highlighting occur only when you select the tree item added by proto_tree_add_bits_item() in the Packet Bytes window?
(01 Sep '11, 17:07) helloworld
Be the first one to answer this question!
toggle preview

Follow this question

By Email:

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



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:


question asked: 01 Sep '11, 12:10

question was seen: 1,879 times

last updated: 01 Sep '11, 17:07

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