Ethereal-dev: Re: [Ethereal-dev] Problems writing my first dissector for a special case of wir

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

From: Guy Harris <gharris@xxxxxxxxx>
Date: Thu, 25 Nov 2004 14:26:27 -0800
Klaus Woersdoerfer wrote:

My problem is that I don't know how to say to Ethereal to give me these 802.11 reserved frames.

The 802.11 dissector gets all 802.11 frames, and doesn't hand off frames with the reserved value. You'd have to modify it to do so.

*dissector_add*("wlan.fc.type" , 0x03, mopio_handle);
*}*
to tell Ethereal when to call my dissector, but the code doesn't work. The call of dissector_add() returns in line 601 in packet.c in the call of
    dissector_table_t sub_dissector = find_dissector_table(name);
with 0 and then generates an exception in the following assertion.

That's because there isn't a "wlan.fc.type" dissector table. Not all fields have dissector tables associated with them (and not all dissector tables have fields associated with them).

Another possible solution could be, that my dissector receives all 802.11 frames, processes (filters) our special reserved frames and then calls the 802.11 dissector to dissect all other standard 802.11 frames. How could be it done?

Unfortunately, having your dissector receive all 802.11 frames would require that your dissector register in all the dissector tables that the 802.11 dissector registers in - *and* do so after the 802.11 dissector does, because the last dissector to register in a given table with a given value wins. It'd also have to do all the processing that the 802.11 dissector does.

Modifying the 802.11 dissector would work better.