From 043df01c5645378bd61318c20cfdbf86c8f73288 Mon Sep 17 00:00:00 2001 From: Alexis La Goutte Date: Mon, 27 Mar 2017 06:42:03 -0400 Subject: Add support for BASE_VALS_NO_UNKNOWN BASE_VALS_NO_UNKNOWN is a special value_string value for only a single (maybe 2) numerical value(s). If a field has the numerical value that doesn't match anything in the value_string, just the number is supplied for the field (no "Unknown") Dissectors that had this use case have been converted in the patch. Change-Id: Ie63a36cceec2fe4436938ec7e3d7f9e690d2b8d9 Reviewed-on: https://code.wireshark.org/review/20736 Petri-Dish: Michael Mann Reviewed-by: Michael Mann --- doc/README.dissector | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'doc') diff --git a/doc/README.dissector b/doc/README.dissector index ac57159991..adf77ef241 100644 --- a/doc/README.dissector +++ b/doc/README.dissector @@ -117,7 +117,8 @@ FIELDDISPLAY --For FT_UINT{8,16,24,32,40,48,56,64} and BASE_DEC, BASE_HEX, BASE_OCT, BASE_DEC_HEX, BASE_HEX_DEC, BASE_CUSTOM, or BASE_NONE, possibly ORed with BASE_RANGE_STRING, BASE_EXT_STRING, BASE_VAL64_STRING, - BASE_ALLOW_ZERO, BASE_UNIT_STRING or BASE_NO_DISPLAY_VALUE + BASE_ALLOW_ZERO, BASE_UNIT_STRING, BASE_VALS_NO_UNKNOWN or + BASE_NO_DISPLAY_VALUE BASE_NONE may be used with a non-NULL FIELDCONVERT when the numeric value of the field itself is not of significance to @@ -949,6 +950,11 @@ indicate the end of the array). The 'strings' field would be set to If the field has a numeric rather than an enumerated type, the 'strings' field would be set to NULL. +If BASE_VALS_NO_UNKNOWN is also applied to the display bitmask, then if +the numeric value of a field doesn't match any values in the value_string +then just the numeric value is displayed (i.e. no "Unknown"). This is intended +for value_strings that may only have a single value or maybe an enumeration +for mix/max values of a field. -- Extended value strings You can also use an extended version of the value_string for faster lookups. @@ -993,9 +999,10 @@ val64_strings are like value_strings, except that the integer type used is a guint64 (instead of guint32). Instead of using the VALS() macro for the 'strings' field in the header_field_info struct array, 'VALS64()' is used. +BASE_VALS_NO_UNKNOWN can also be used for val64_string. -- Unit string -Some integer fields, of type FT_UINT* and float fiels, of type FT_FLOAT +Some integer fields, of type FT_UINT* and float fields, of type FT_FLOAT or FT_DOUBLE, need units of measurement to help convey the field value. A 'unit_name_string' structure is a way to add a unit suffix to a field. -- cgit v1.2.1