Wireshark

  • Riverbed Technology
  • WinPcap
SHARKFEST '12 - Wireshark Developer and User Conference - June 24-27, 2012 - UC Berkeley, Clark Kerr Campus
  • Wireshark
    • About
    • Download
    • Blog
  • Get Help
    • Ask a Question
    • FAQs
    • Documentation
    • Mailing Lists
    • Online Tools
    • Wiki
    • Bug Tracker
  • Develop
    • Get Involved
    • Developer's Guide
    • Browse the Code
    • Latest Builds

Wireshark-dev: Re: [Wireshark-dev] How to format a subtree banner?

Date Index Thread Index Other Months All Mailing Lists
Date Prev Date Next Thread Prev Thread Next


From: Guy Harris <guy@xxxxxxxxxxxx>
Date: Fri, 30 Jul 2010 15:44:41 -0700

On Jul 30, 2010, at 2:24 PM, eymanm wrote:

> I've defined a 
> static const value_string String[]  = {
>   { 1, "String1" },
>   { 2, "String2" }
> };

Presumably you mean

static const value_string String[]  = {
  { 1, "String1" },
  { 2, "String2" },
  { 0, NULL }
};

right?  You have to put a terminator - i.e., an element with a null string pointer - at the end of value_string arrays.

> and can perfectly generate output, which looks like 
> string: String1 (1) 
> using proto_tree_add_item() function. In order to make the output a bit more user friendly, I'd prefer to have it as a subtree.

What would be in that subtree?  Presumably there would be more than one value in it (a subtree with only one value is generally not that useful); is the value that's decoded with the value_string in question one of the values?  If so, what are the other values?
  • References:
    • [Wireshark-dev] How to format a subtree banner?
      • From: eymanm
  • Prev by Date: [Wireshark-dev] How to format a subtree banner?
  • Previous by thread: [Wireshark-dev] How to format a subtree banner?
  • Index(es):
    • Date
    • Thread

Wireshark and the "fin" logo are registered trademarks of the Wireshark Foundation