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

Ethereal-dev: Re: [Ethereal-dev] Field Type for non-8bit-unit field

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Motonori Shindo <mshindo@xxxxxxxxxxx>
Date: Wed, 02 Jun 2004 11:22:17 +0900 (JST)
Guy,

From: "Guy Harris" <gharris@xxxxxxxxx>
Subject: Re: [Ethereal-dev] Field Type for non-8bit-unit field
Date: Tue, 1 Jun 2004 11:43:48 -0700 (PDT)

> > What would be the best way to handle a case like this?
> 
> Bitfields.
> 
> Have two fields - a sample rate field, in the lower 14 bits, and a field
> for the higher 2 bits.
> 
>  		{&hf_cflow_samplerate,
>  		 {"SampleRate", "cflow.samplerate",
>  		  FT_UINT16, BASE_DEC, NULL, 0x3FFF,
>  		  "Sample Frequency of exporter", HFILL}
> 		 },
> 
> and a similar field with a mask of 0xC000 for the higher 2 bits.
> 
> I've just checked in a change to implement that.

Oh, I didn't know that BITMASK can be used even when FIELDCONVERT is
NULL:-) Now it looks good. Thanks!