Wireshark-dev: Re: [Wireshark-dev] Dynamic value string
From: Sylvain Munaut <246tnt@xxxxxxxxx>
Date: Fri, 9 Sep 2011 19:12:21 +0200
Hi,

> Well, at least in 1.6.x and later (I don't know whether this was supported in 1.4.x), doc/README.developer says:
>
>       [ .... snip ....]
>
>        BASE_CUSTOM allows one to specify a callback function pointer that will
>        format the value. The function pointer of the same type as defined by
>        custom_fmt_func_t in epan/proto.h, specifically:
>
>          void func(gchar *, guint32);
>
>        The first argument is a pointer to a buffer of the ITEM_LABEL_LENGTH size
>        and the second argument is the value to be formatted.

Very interesting ... seems I missed that because in the SVN, the
_proto_tree_add_bits_ret_val function doesn't seem to support that
display style.
They call hfinfo_uint_format directly. But I think this function could
actually benefit from using fill_label_uint rather than reimplementing
the logic locally.

Cheers,

    Sylvain