Ethereal-dev: Re: [ethereal-dev] Dissector exceptions

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

Date: Mon, 8 May 2000 09:18:40 +0200
<knip>

Some protocols have values that span a couple of bytes, but do not use both 
endbytes completely (f.i. 6 byte values with bytes 0 and 1 in byte 1 and bits 
2..5 in byte 2)

I don't know how common this is, but I have just finished a couple of protocols that use this VERY 
much. In my situation it would result in much cleaner code to retrieve bits, instead of bytes. Other 
protocols could just multiply all values by 8, or just use another version of the function....

Let the tvbuff handle the bytes / bits conversion in one piece and all protocols that deal with 
bits themselves result in much cleaner code that works, instead of all that shifting, and-ing, 
or-ing that's (in my view) very error-prone.

Maybe I'm way out here, but what are your ideas on this?

-- 
Andreas Sikkema
andreas.sikkema@xxxxxxxxxxx
"Standing barefoot in a river of clues, most people would 
         not get their toes wet." - Brian Kantor in a.s.r.