This issue was migrated from bug 4049 in our old bug tracker.
Original bug information:
Reporter: Beth Status: RESOLVED REMIND Product: Wireshark Component: GTK+ UI OS: All Platform: All Version: 1.3.x (Experimental)
Attachments:
svn.diff: Patch adds support for FT_BOOLEAN to wslua FieldInfo wslua_tree.diff: Patch adds support for FT_BOOLEAN to wslua TreeItem test_bool.lua: Test case for bug 4049 test_bool.lua: Re-upload of test case
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information
Child items
...
Show closed items
Linked items
0
Link issues together to show that they're related or that one is blocking others.
Learn more.
Created attachment 3696
Patch adds support for FT_BOOLEAN to wslua FieldInfo
Build Information:
Version 1.3.1-trunk-TridiumSedona
Copyright 1998-2009 Gerald Combs <gerald@wireshark.org> and contributors.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiled with GTK+ 2.16.6, with GLib 2.20.5, with WinPcap (version unknown),
with libz 1.2.3, without POSIX capabilities, with libpcre 7.0, with SMI 0.4.8,
with c-ares 1.6.0, with Lua 5.1, without Python, with GnuTLS 2.8.1, with Gcrypt
1.4.4, with MIT Kerberos, with GeoIP, with PortAudio V19-devel (built Sep 21
2009), with AirPcap, with new_packet_list.
Running on Windows XP Service Pack 3, build 2600, with WinPcap version 4.1 beta5
(packet.dll version 4.1.0.1452), based on libpcap version 1.0.0, GnuTLS 2.8.1,
Gcrypt 1.4.4, without AirPcap.
Built using Microsoft Visual C++ 9.0 build 21022
Wireshark is Open Source Software released under the GNU General Public License.
Field extractor for boolean header fields cannot extract boolean value. Attempt to do so results in luaL_error: "FT_ not yet supported".Temp workaround is to use FieldInfo.label instead and interpret as string.However the fix is trivial. Patch file attached.To reproduce the problem:-------------------------1. Create a Lua script with a field extractor for a boolean field, e.g.: local marked = Field.new("frame.marked")2. In the callback function (tap.packet or proto.dissector etc.), attempt to access the field as a boolean: local isMarked = false if marked() then isMarked = marked().value endOn the line with marked().value you will get the error: "FT_ not yet supported"After applying the patch, the above code will work correctly.
I discovered a parallel issue in wslua_tree.c, where FT_BOOLEAN type ProtoFields would similarly result in the "FT_ not yet supported" error, if added to the display tree.
Also added a Lua postdissector script to reproduce both issues, and test patches.