Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Ethereal-dev: [Ethereal-dev] Proposal: Removing proto_tree_add_..._hidden() functions from epa

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Ulf Lamping <ulf.lamping@xxxxxx>
Date: Fri, 30 Apr 2004 07:49:53 +0200
Hi List!

When looking into epan/proto.h, I'm often wondering if the proto_tree_add_..._hidden() function are a good idea.

Example from epan/proto.h (but the other proto_tree_add_...) look and work similar:

proto_tree_add_uint
proto_tree_add_uint_hidden
proto_tree_add_uint_format

The only difference between add_uint and add_uint_hidden is the setting of fi->visible = FALSE.

IMHO it would be a lot better to remove the xy_hidden functions completely, use the normal one instead, and add a "hidden flag" to the FT_... fields (in hf_register_info).

When adding a flag to the FT field like: FT_UINT32 | FT_HIDDEN this could do the same thing as the xy_hidden() function above.

This would only make trouble in the case if the proto_field is both used for hidden and none hidden fields, but this should be very rarely the case. Even if it is a case, the specific field info could be duplicated without any problems.

In this scheme we could also add other flags like the earlier discussed FT_GENERATED without changing the proto API functions, and handle the behaviour only in the output rendering.

Regards, ULFL