Wireshark-dev: Re: [Wireshark-dev] [PATCH] range_string in proto_tree_add_item
From: Sebastien Tandel <sebastien@xxxxxxxxx>
Date: Wed, 14 Feb 2007 00:03:31 +0100
Here it is.

Regards,
Sebastien Tandel

Stephen Fisher wrote:
> Thanks, I hadn't fully read that thread.  Could you write up a little 
> section for README.developer that describes how this functionality is 
> used and then I'll commit these.  Thanks.
>
> On Mon, Feb 05, 2007 at 09:59:13PM +0100, Sebastien Tandel wrote:
>
>   
>>    It was discussed in the thread with Guy
>> (http://www.wireshark.org/lists/wireshark-dev/200701/msg02454.html) ...
>>     
>
>   
>>>>    re-post of a patch described here ...
>>>> http://www.wireshark.org/lists/wireshark-dev/200701/msg00321.html
>>>>     
>>>>         
>>> Is there any way to avoid having to OR that one value when using an 
>>> RVAL()?  It would be a lot cleaner / easier for people to use if so.
>>>       
> _______________________________________________
> Wireshark-dev mailing list
> Wireshark-dev@xxxxxxxxxxxxx
> http://www.wireshark.org/mailman/listinfo/wireshark-dev
>   

Index: doc/README.developer
===================================================================
--- doc/README.developer	(révision 20799)
+++ doc/README.developer	(copie de travail)
@@ -958,8 +958,9 @@
 		FT_RELATIVE_TIME, FT_STRING, FT_STRINGZ, FT_UINT_STRING,
 		FT_ETHER, FT_BYTES, FT_IPv4, FT_IPv6, FT_IPXNET,
 		FT_FRAMENUM, FT_PROTOCOL, FT_GUID, FT_OID
-FIELDBASE	BASE_NONE, BASE_DEC, BASE_HEX, BASE_OCT, BASE_DEC_HEX, BASE_HEX_DEC
-FIELDCONVERT	VALS(x), TFS(x), NULL
+FIELDBASE	BASE_NONE, BASE_DEC, BASE_HEX, BASE_OCT, BASE_DEC_HEX,
+		BASE_HEX_DEC, BASE_RANGE_STRING
+FIELDCONVERT	VALS(x), RVALS(x), TFS(x), NULL
 BITMASK		Usually 0x0 unless using the TFS(x) field conversion.
 FIELDDESCR	A brief description of the field.
 PARENT_SUBFIELD	Lower level protocol field used for lookup, i.e. "tcp.port"
@@ -1590,6 +1591,9 @@
 
 If INTVAL_MIN equals INTVAL_MAX for a given entry the range_string 
 behavior collapses to the one of value_string. 
+For FT_(U)INT* fields that need a 'range_string' struct, the 'strings' field
+would be set to 'RVALS(rvalstringname)'. Furthermore, 'display' field must be
+ORed with 'BASE_RANGE_STRING' (e.g. BASE_DEC|BASE_RANGE_STRING).
 
 FT_BOOLEANS have a default map of 0 = "False", 1 (or anything else) = "True".
 Sometimes it is useful to change the labels for boolean values (e.g.,