diff options
author | Guy Harris <guy@alum.mit.edu> | 2009-12-12 03:15:28 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2009-12-12 03:15:28 +0000 |
commit | a4b7135ce3fa8362edf75804da448a362311e1b8 (patch) | |
tree | 2a0d0ac169b5b484093587992d71e01bae14d907 /epan/proto.h | |
parent | ed9f7440e3cc8e265a8d29c2d6e4cb5c3bb504ad (diff) |
Rename BASE_STRUCTURE_RESET to BASE_DISPLAY_E_MASK, to clarify that it's
a mask to select the base_display_e value from a display field in a
header_field_info structure.
Never select that value by masking out the BASE_RANGE_STRING flag bit,
as that won't continue to work if more flag bits, or other bitfields,
are added. Instead, mask with BASE_DISPLAY_E_MASK.
Note that the base_display_e value and BASE_RANGE_STRING flag are only
for integral field types, and clarify what BASE_DISPLAY_E_MASK is.
Give at least one of the reasons why hiding protocol fields is not
considered a good idea.
svn path=/trunk/; revision=31249
Diffstat (limited to 'epan/proto.h')
-rw-r--r-- | epan/proto.h | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/epan/proto.h b/epan/proto.h index 083953b40f..c0e146157d 100644 --- a/epan/proto.h +++ b/epan/proto.h @@ -140,15 +140,15 @@ typedef struct _protocol protocol_t; ep_strdup_printf("%s:%u: failed assertion \"%s\"", \ file, lineno, __DISSECTOR_ASSERT_STRINGIFY(expression)))) -/* BASE_STRUCTURE_RESET constant is used in proto.c to reset the bits - * identifying special structures used in translation of value for display. - * Its value means that we may have at most 16 base_display_e values */ -#define BASE_STRUCTURE_RESET 0x0F -/* Following constants have to be ORed with a base_display_e when dissector - * want to use specials MACROs (for the moment, only RVALS) for a - * header_field_info */ -#define BASE_RANGE_STRING 0x10 -/** radix for decimal values, used in header_field_info.display */ +/* Values for header_field_info.display */ + +/* For integral types, the display format is a base_display_e value + * possibly ORed with BASE_RANGE_STRING. */ + +/* BASE_DISPLAY_E_MASK selects the base_display_e value. Its current + * value means that we may have at most 16 base_display_e values. */ +#define BASE_DISPLAY_E_MASK 0x0F + typedef enum { BASE_NONE, /**< none */ BASE_DEC, /**< decimal */ @@ -159,14 +159,20 @@ typedef enum { BASE_CUSTOM /**< call custom routine (in ->strings) to format */ } base_display_e; +/* Following constants have to be ORed with a base_display_e when dissector + * want to use specials MACROs (for the moment, only RVALS) for a + * header_field_info */ +#define BASE_RANGE_STRING 0x10 + +/* BASE_ values that cause the field value to be displayed twice */ +#define IS_BASE_DUAL(b) ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC) + typedef enum { HF_REF_TYPE_NONE, /**< Field is not referenced */ HF_REF_TYPE_INDIRECT, /**< Field is indirectly referenced (only applicable for FT_PROTOCOL) via. its child */ HF_REF_TYPE_DIRECT /**< Field is directly referenced */ } hf_ref_type; -#define IS_BASE_DUAL(b) ((b)==BASE_DEC_HEX||(b)==BASE_HEX_DEC) - /** information describing a header field */ typedef struct _header_field_info header_field_info; @@ -237,7 +243,9 @@ typedef struct field_info { /** The protocol field should not be shown in the tree (it's used for filtering only), * used in field_info.flags. */ -/* HIDING PROTOCOL FIELDS IS DEPRECATED, IT'S CONSIDERED TO BE BAD GUI DESIGN! */ +/* HIDING PROTOCOL FIELDS IS DEPRECATED, IT'S CONSIDERED TO BE BAD GUI DESIGN! + A user cannot tell by looking at the packet detail that the field exists + and that they can filter on its value. */ #define FI_HIDDEN 0x00000001 /** The protocol field should be displayed as "generated by Wireshark", * used in field_info.flags. */ |