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


Iam trying for custom dissector bit wise operation octet by octet.

I have used

   proto_tree_add_bits_item(my_sub_tree, hf_my_type, my_tvb, offset,6, TRUE);

This is 6 bit lenth.

           ..00 0010 = Message Type : FWD_CNTRL (0x02)

I can able to get the bits properly. No issues on that. i want remove

                          "..00 0010= " this PART and diplay only
                          Message Type : FWD_CNTRL (0x02)

I have tried another method using MASK

             proto_tree_add_item(my_sub_tree, hf_my_type, my_tvb, offset,6, ENC_LITTLE_ENDIAN);

             { &hf_msg_typ,
             { "Message Type ", "msg_type",FT_UINT8, BASE_HEX, VALS(msg_type_vals), 0x3f, NULL, HFILL }

This one also output as

                           ..00 0010 = Message Type : FWD_CNTRL (0x02)

How can i remove

                           "..00 0010= " this PART and diplay only
                            Message Type : FWD_CNTRL (0x02)

Please Help

asked 31 May '14, 00:40

umar's gravatar image

accept rate: 0%

edited 06 Jun '14, 02:59

IMHO removing ..00 0010 = Message Type : FWD_CNTRL (0x02) is a bad choice the former let you see exactly which bits are beeing dissected and the meaning of the bits. If the bits allways occure in the same Place using proto_add_item with a bit mask may be a better choice than proto_tree_add_bits_item(). Just my 2 cents.

(06 Jun '14, 04:38) Anders ♦

Have you looked at the proto_tree_add_xxx_format() or proto_tree_add_xxx_format_value() functions? They give you full control of the tree representation.

permanent link

answered 06 Jun '14, 03:54

grahamb's gravatar image

grahamb ♦
accept rate: 22%

Hi I have tried

                  proto_tree_add_xxx_format() or proto_tree_add_xxx_format_value()  both.

                  Rteurning error. How exactly i should use to remove 
                                        "..00 0010= " this PART and diplay only
                                        Message Type : FWD_CNTRL (0x02)

Thanks in advance!

(03 Jul '14, 02:13) umar

Just use proto_tree_add_text() then as that gives you full control of the tree representation, but note that the field won't be filterable.

(04 Jul '14, 03:55) grahamb ♦
Your answer
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]( "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: 31 May '14, 00:40

question was seen: 2,803 times

last updated: 04 Jul '14, 03:56

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