Wireshark-dev: Re: [Wireshark-dev] [PATCH] IEEE 802.15.4 dissectors and libpcap support.

From: Owen Kirby <osk@xxxxxxxxxxxxx>
Date: Mon, 23 Jul 2007 18:15:35 -0700
Hi Richard,

> The ccitt crc16 routines are already in crc16.h - please could you use them
> rather than reinventing this particular wheel?
When I first wrote the dissectors, I was having trouble finding a CRC algorithm that would produce the right answer. IEEE 802.15.4 transmits bytes in reflected bit-order, and calculates the CRC over those bits as they are transmitted over the air. IEEE 802.15.4 also further violates the CCITT specification by using initial and final values of 0x0000, instead of 0xFFFF. I now know substantially more about CRC's than I did when I first wrote those functions, and I really should have replaced them with those already available in Wireshark. They have been fixed in the attached patch.

> Your patch messes up the indentation in libpcap.c - please can you sort it out? My apologies about that, my editor mucked that up, and I thought I had fixed the damage, but apparently I didn't. I should note that the indentation in libpcap.c is inconsistent anyways (some parts use soft tabs, others use hard tabs). Hopefully, the attached patch should correct any out-of-place hard or soft tabs.

> I'm not generally a fan of 500-line functions - any chance the offender could
> be split up a bit?
I assume you are referring to dissect_ieee802154_common()? Well, I have taken the time to break that function down a bit, but it's still a bit on the lengthy side (just over 300 lines). I also broke the command dissector function down into a bunch of subroutines. Hopefully this is more to your liking.

> Please could you create a Protocols/ieee802154 page on the wiki, and add an
> example capture, so we can see what your dissector does?
Certainly, I would be more than happy to add a protocol Wiki page for IEEE 802.15.4, is it a high priority, or can I get that done later this week once I have some time?

Thanks,
Owen Kirby

Attachment: ieee802154r3.patch.gz
Description: GNU Zip compressed data