Ethereal-dev: [Ethereal-dev] Re: About Dissector added with a "plugin" !

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

From: "ronnie sahlberg" <ronniesahlberg@xxxxxxxxx>
Date: Thu, 8 Jun 2006 10:51:39 +0000
try with
FT_UINT32 and BASE_HEX
instead of
FT_UINT8 and BASE_DEC



On 6/8/06, kyan-ki kyan-ki <kyan-ki@xxxxxxxxxx> wrote:
I've already tried this solution previously but it was not right.
My Mask is coded with 3 bytes (24 bits).

So, I would like to have a display e.g. : 1010 1101 1111 1000 1011 1110 =
Mask : .....
I tried to mask with { "FOO PDU Type","foo.type",FT_UINT8, BASE_DEC, NULL,
0xFFFFFF,"", HFILL } but only the first 8 bits are displayed : 1010 1101.

thanks for your support


>From: "ronnie sahlberg" <ronniesahlberg@xxxxxxxxx>
>To: "Ethereal development" <ethereal-dev@xxxxxxxxxxxx>
>CC: kyan-ki@xxxxxxxxxx
>Subject: Re: About Dissector added with a "plugin" !
>Date: Thu, 8 Jun 2006 08:56:17 +0000
>
>Not exactly what you are asking for    but you could try this:
>
>(dissecting and displaying the top 12 bits of a 16 bit integer in a
>somewhat binary representation)
>
>{ &hf_foo,
>{"Foo", "foo.foo", FT_UINT16, BASE_HEX, NULL, 0xfff0, "something", HFILL
>}},
>
>
>I.e   specifying a bitmask which will make ethereal decode it and display
>it as
>XXXX XXXX XXXX ....
>
>
>Probably not exactly what you want but maybe close enough?
>
>
>
>
>On 6/8/06, kyan-ki kyan-ki <kyan-ki@xxxxxxxxxx> wrote:
>>Hi,
>>
>>I'm developping an Ethereal plugin to add a dissector for a protocol.
>>This protocol has a field Mask that I would like to display in binary e.g.
>>Mask : 1100 1011 1010
>>But I can't find the solution that allows such a thing :
>>
>>In proto.c, one have :
>>
>>/** radix for decimal values, used in header_field_info.display */
>>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_display_e;
>>
>>But there is no BASE_BIN for example, in order to insert into (e.g.):
>>static hf_register_info hf[] = {
>>  { &hf_foo_pdu_type,
>>  { "FOO PDU Type","foo.type",
>>  FT_UINT8, BASE_DEC, NULL, 0x0,
>>  "", HFILL }
>>  },
>>};
>>
>>Has someone a solution for this problem without I have to modify ethereal
>>source code and rebuild it ?
>>
>>_________________________________________________________________
>>Windows Live Mail : venez tester la version bêta !
>>http://www.ideas.live.com/programpage.aspx?versionId=5d21c51a-b161-4314-9b0e-4911fb2b2e6d
>>
>>_______________________________________________
>>Ethereal-dev mailing list
>>Ethereal-dev@xxxxxxxxxxxx
>>http://www.ethereal.com/mailman/listinfo/ethereal-dev
>>

_________________________________________________________________
Windows Live Messenger : venez tester la version bêta !
http://www.ideas.live.com/programpage.aspx?versionId=0eccd94b-eb48-497c-8e60-c6313f7ebb73


_______________________________________________
Ethereal-dev mailing list
Ethereal-dev@xxxxxxxxxxxx
http://www.ethereal.com/mailman/listinfo/ethereal-dev