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

Display successive data on one row when dissecting

0

Hi Forum,

I would like to know how dissect and display data in as successive fields on a single row using.

My data N | followed by n bytes - ie 1001020304050607080910

I wish to dissect and display as Count : 10 Values : [1,2,3,4,5,6,7,8,9,10].

The current dissector I am using

  {&hf_count, {"Count",  "", FT_UINT8,    BASE_DEC,  NULL, 0x0, NULL, HFILL}},
  {&hf_value,{"Value", "",  FT_UINT8,    BASE_DEC,   NULL, 0x0, NULL, HFILL}},
  proto_tree_add_item(...hf_count.)
  for loop {
       proto_tree_add_item(...hf_value.)
  }

However, it shows the values on a separate row.

How set up the dissector to display the how I wish?

Thanks

Stuart

asked 24 Jan '13, 03:12

StuieNorris's gravatar image

StuieNorris
6557
accept rate: 0%


One Answer:

0

Use the various tvb_get_ routines, such as tvb_get_guint8(), to fetch the appropriate values from the tvbuff, and use proto_tree_add_text() to put in an entry into the protocol tree in whatever format you want.

answered 24 Jan '13, 03:15

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%