Ethereal-dev: [Ethereal-dev] Problems writing my first dissector for a special case of wireles
Hallo,
I'm
developing my first dissector and have problems to instruct Ethereal to call my
dissector routine.
I want
to write a dissector to decode special WLAN 802.11 frames (customized by my
company) not dissected by the standard wlan packet dissector in file
packet-ieee80211.c.
My dissector
should be called for all 802.11 frames which have the value 0x03 in the
type bits of the frame control field (0x00 = management frames, 0x01 = control
frames, 0x02 = data frames, 0x03 = reserved). This bit combination is not used
by the standard (reserved) until now.
My problem is
that I don't know how to say to Ethereal to give me these 802.11 reserved
frames. We named our protocol "mopio" and I wrote this
function
void
proto_reg_handoff_mopio(void)
{
dissector_handle_t mopio_handle;
mopio_handle
= find_dissector("mopio");
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.
I don't know
how to change the code to get it working and to describe the kind of 802.11
frames my dissectors wants to be called with.
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?
Can anybody
help me with this problem?
Thank you
very much for any help.
Klaus
W.