Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

Wireshark-dev: Re: [Wireshark-dev] [Wireshark-users] bit operations are missingfrom lua binding

From: "Anders Broman" <anders.broman@xxxxxxxxxxxx>
Date: Fri, 5 Jun 2009 13:23:39 +0200
Hi,
Couldn't:

tvb_get_bits8() 
tvb_get_bits16() 
tvb_get_bits32() 
tvb_get_bits64()
 
Be used instead? 
There is also proto_tree_add_bits_item() and proto_tree_add_bits_ret_val()
Regards
Anders

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Stig Bjørlykke
Sent: den 5 juni 2009 12:20
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] [Wireshark-users] bit operations are missingfrom lua bindings?

On Fri, Jun 5, 2009 at 2:00 AM, Sam Roberts <vieuxtech@xxxxxxxxx> wrote:
> If  TvbRange_methods supported a :bitrange(pos, len) method, that 
> would mask and shift out a bitrange, and return it as a number, that 
> would be great.

Sure, have a look at the attached patch.  Please test and give feedback :)


--
Stig Bjørlykke