Wireshark-dev: Re: [Wireshark-dev] Lua dissector: How to set sub-field bit widths using prefere

From: "Maynard, Chris" <Christopher.Maynard@xxxxxxx>
Date: Thu, 6 Sep 2018 12:23:12 +0000
Small correction.

> -----Original Message-----
> > 2) What does this line do?
> >
> > table.insert(t, (bit.band(bit.rshift(val, i), 1) == 1 and '1') or '0')
> 
> This shifts val right i number of bits, where i is a value between 16 and 1, and
> then tests that bit to see if it's set or not.  If it is set, it inserts a '1' into the table
> t; otherwise it inserts a '0' into the table t.

This should read:
This shifts val right i number of bits, where i is a value between 15 and 0, and
then tests that bit to see if it's set or not.  If it is set, it inserts a '1' into the table
t; otherwise it inserts a '0' into the table t.

- Chris








CONFIDENTIALITY NOTICE: This message is the property of International Game Technology PLC and/or its subsidiaries and may contain proprietary, confidential or trade secret information.  This message is intended solely for the use of the addressee.  If you are not the intended recipient and have received this message in error, please delete this message from your system. Any unauthorized reading, distribution, copying, or other use of this message or its attachments is strictly prohibited.