I need to dissect a bit mapped octet in a Wireshark lua dissector. The octet has format:
bit 0: Concatenation (0=No concatenation, 1=Concatenation)
bits 1..3: Reserved
bits 4..7: Version
I have successfully dissected it with:
Concatenation_F = ProtoField.uint8("Concatenation", "Concatenation", base.DEC, NULL, 0x1)
Version_F = ProtoField.uint8("Version", "Version", base.DEC, NULL, 0xF0)
my_protocol.fields = { Concatenation_F,
Version_F
}
<snip>
local Concatenation_range = buffer(0,1)
local Version_range = buffer(0,1)
local Concatenation = Concatenation_F:uint()
local Version = Version_range:uint()
subtree:add(Concatenation_F, Concatenation_range, Concatenation)
subtree:add(Version_F, Version_range, Version)
That works, but I would like to show the meaning of the Concatenation field, like:
but to do that I need to get the value of the Concatenation bit. How can I do that?