Wireshark mailing list archives

Re: How to catch unlisted values of value_string?


From: eymanm <eymanm () gmail com>
Date: Fri, 17 Dec 2010 16:48:17 -0500

But how you combine it with typical
static const value_string MyValues[] = {
{ 1, "MV1" },
{ 2, "MV2" },
{ 3, "MV3" }
};

On Fri, Dec 17, 2010 at 3:39 PM, Jeff Morriss <jeff.morriss.ws () gmail com>wrote:

eymanm wrote:
In many cases, when a value_string array is defined, there are values
that are left unlisted. In some cases, way too many to include in the
list. Is there a way to make all of those be displayed as let's say,
"Unlisted_Value"?

Typically you'd do that with val_to_str():

val_to_str(val, my_val_string, "Unknown: %d"))

(The %d is optional, but it allows the user to see the actual value of
'val'.)
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
            mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe

Current thread: