Wireshark-dev: Re: [Wireshark-dev] How to catch unlisted values of value_string?
From: Joerg Mayer <jmayer@xxxxxxxxx>
Date: Sat, 18 Dec 2010 01:48:05 +0100
On Fri, Dec 17, 2010 at 04:48:17PM -0500, eymanm wrote:
> But how you combine it with typical
> static const value_string MyValues[] = {
> { 1, "MV1" },
> { 2, "MV2" },
> { 3, "MV3" }
> };

You don't. Because you are not allowed to have an unterminated value_string array.
In case of a terminated value_string array, you use it like the example states:
val_to_str(2, MyValues, "%d not in MyValues") would return "MV2".

Ciao
    Joerg

-- 
Joerg Mayer                                           <jmayer@xxxxxxxxx>
We are stuck with technology when what we really want is just stuff that
works. Some say that should read Microsoft instead of technology.