Vernier -- wrote:
> Jeremy Hinegardner wrote:
>> On Mon, Jan 05, 2009 at 04:24:02PM +0900, Vernier -- wrote:
>>> Any ideas on how you would do this?
>>> also, in cpp I'm using structs for the packet formats, but I have no
>>> idea on how to do that in ruby
>> Take a look at packetfu http://code.google.com/p/packetfu/
>>
>> enjoy,
>>
>> -jeremy
> 
> the bindata dependency for packetfu is exactly what I was looking for 
> for the structs, thanks a lot

Another option:

http://redshift.sourceforge.net/bit-struct/

I don't know bindata, but from a quick glance at the docs I see that it 
does handle related fields, like length fields that specify the length 
of another field. BitStruct does *not* do that.

Another difference is that BitStruct is a subclass of string, so it is 
very efficient to send a bitstruct to a socket or file or perform other 
string operations.

-- 
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407