ANNOUNCEMENT: Live Wireshark University & Allegro Packets online APAC Wireshark Training Session
July 17th, 2024 | 10:00am-11:55am SGT (UTC+8) | Online

Wireshark-dev: Re: [Wireshark-dev] Boolean Field Registration Qurey

From: Jakub Zawadzki <darkjames@xxxxxxxxxxxxxxxx>
Date: Thu, 15 Apr 2010 09:31:11 +0200
Hi,

On Thu, Apr 15, 2010 at 02:48:41PM +0800, Tam�s Reg?s wrote:
> In README.developer it says the general rules:
> 	static hf_register_info hf[] = {
> 		{ &hf_PROTOABBREV_FIELDABBREV,
> 			{ "FIELDNAME", "PROTOABBREV.FIELDABBREV",
> 			FIELDTYPE, FIELDBASE, FIELDCONVERT, BITMASK,
> 			"FIELDDESCR", HFILL }
> 		}
> 	};
> 
> In proto.h the FIELDBASE declared as enum:
> typedef enum {
> 	BASE_NONE,	/**< none */
> 	BASE_DEC,	/**< decimal */
> 	BASE_HEX,	/**< hexadecimal */
> 	BASE_OCT,	/**< octal */
> 	BASE_DEC_HEX,	/**< decimal (hexadecimal) */
> 	BASE_HEX_DEC,	/**< hexadecimal (decimal) */
> 	BASE_CUSTOM	/**< call custom routine (in ->strings) to format */
> } base_display_e;

If you are using FT_BOOLEAN, it's no longer BASE_* enum, but number of field bits.

>From proto.h:
  int display;        /**< one of BASE_, or number of field bits for FT_BOOLEAN */


If you have real boolean (0/1) field, I think you need to pass 1 there :)