{
const char *format = NULL;
- /* bit operation to reset the potential BASE_RANGE_STRING (or others in
- * the future?) */
- switch(hfinfo->display & BASE_STRUCTURE_RESET) {
+ /* Get the underlying BASE_ value */
+ switch(hfinfo->display & BASE_DISPLAY_E_MASK) {
case BASE_NONE:
format = "%s: %s";
break;
{
const char *format = NULL;
- /* bit operation to reset the potential BASE_RANGE_STRING (or others in
- * the future?)*/
- switch(hfinfo->display & BASE_STRUCTURE_RESET) {
+ /* Get the underlying BASE_ value */
+ switch(hfinfo->display & BASE_DISPLAY_E_MASK) {
case BASE_NONE:
format = "%s: %s";
break;
range = NULL;
tfs = NULL;
- if ((hfinfo->display & BASE_STRUCTURE_RESET) != BASE_CUSTOM &&
+ if ((hfinfo->display & BASE_DISPLAY_E_MASK) != BASE_CUSTOM &&
(hfinfo->type == FT_UINT8 ||
hfinfo->type == FT_UINT16 ||
hfinfo->type == FT_UINT24 ||
vi = 0;
while (range[vi].strptr) {
/* Print in the proper base */
- if ((hfinfo->display & BASE_STRUCTURE_RESET) == BASE_HEX) {
+ if ((hfinfo->display & BASE_DISPLAY_E_MASK) == BASE_HEX) {
printf("R\t%s\t0x%x\t0x%x\t%s\n",
hfinfo->abbrev,
range[vi].value_min,
hfinfo->type == FT_INT64) {
- switch(hfinfo->display & BASE_STRUCTURE_RESET) {
+ switch(hfinfo->display & BASE_DISPLAY_E_MASK) {
case BASE_NONE:
base_name = "BASE_NONE";
break;
*/
format = "%s == %u";
} else {
- /* Pick the proper format string, ignoring BASE_RANGE_STRING flag */
- switch(hfinfo->display & ~BASE_RANGE_STRING) {
+ /* Get the underlying BASE_ value */
+ switch(hfinfo->display & BASE_DISPLAY_E_MASK) {
case BASE_DEC:
case BASE_DEC_HEX:
case BASE_OCT: /* I'm lazy */
DISSECTOR_ASSERT(hfinfo);
abbrev_len = (int) strlen(hfinfo->abbrev);
- if (hfinfo->strings && (hfinfo->display & BASE_STRUCTURE_RESET) == BASE_NONE) {
+ if (hfinfo->strings && (hfinfo->display & BASE_DISPLAY_E_MASK) == BASE_NONE) {
const gchar *str = NULL;
switch(hfinfo->type) {
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 */
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;
/** 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. */