On Mon, Jun 1, 2015 at 4:55 AM, Richard Sharpe <[email protected]>
wrote:

> I have a bunch of flags, many of which can be set at the same time,
> and I thought I could use something like this:
>
> static const value_string posix_flags_vals[] = {
>         { 0x01, "POSIX_V1_POSIX_LOCK" },
>         { 0x08, "POSIX_V1_POSIX_FILE_SEMANTICS" },
>         { 0x10, "POSIX_V1_CASE_SENSITIVE" },
>         { 0x40, "POSIX_V1_POSIX_STAT_INFO" },
>         { 0, NULL }
> };
>
> However, when the flags are 0x50 I get unknown.
>
> I probably want a Non Set value, but then if any of the other bits are
> set, I should see that flag, but I don't really want things saying NOT
> SET.
>
> How do I do that?
>
Hi Richard,

the better solution is to use proto_tree_add_bitmask with bitmask field.

Regards,


>
> --
> Regards,
> Richard Sharpe
> (何以解憂?唯有杜康。--曹操)
> ___________________________________________________________________________
> Sent via:    Wireshark-dev mailing list <[email protected]>
> Archives:    https://www.wireshark.org/lists/wireshark-dev
> Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
>              mailto:[email protected]
> ?subject=unsubscribe
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <[email protected]>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:[email protected]?subject=unsubscribe

Reply via email to