Wireshark-bugs: [Wireshark-bugs] [Bug 4700] WSLUA improvement (ProtoField.bool extension)

Date: Wed, 3 Nov 2010 17:25:27 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4700

--- Comment #26 from Tamas Regos <tamas.regos@xxxxxxxxxxxx> 2010-11-03 17:25:16 PDT ---
  *  Why do you choose a 0 mask value?  I would imagine that would always
evaluate to 0 (false).
This is just an example. For example you can use tvb(0,4):uint() or similar to
extract the octet which contains you bits. Then the Protfield.bool which filter
out the bit you need. 

  *  Now that the ProtoField.bool interface deals in integers instead of
booleans, how is it any advantage over the existing integer options?  I guess I
thought the whole point of having a bool field was that it would accept bool
arguments instead of ints.

In my point of view was to filter out bits of an octet easily with a similar 
method like integers.
e.g
BIT0_MASK  = 0x01

one_bit = ProtoField.bool("proto.bit0", "This is the 0 bit", 16,
tfs_set_notset, BIT0_MASK, "This can be a description of bit 0")

tree:add(one_bit,tvb(0,4),tvb(0,4):uint())

Here you have a 4 octets long number where every bit can mean something.
So you extract the whole 4 octets in tree:add but the one_bit ProtoField.bool
will do the real job, filtering out bit0 with BIT0_MASK, adding a value
(tfs_set_notset), description, etc...

-- 
Configure bugmail: https://bugs.wireshark.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.