Wireshark-bugs: [Wireshark-bugs] [Bug 4049] New: Add support for FT_BOOLEAN fields to wslua Fiel

Date: Thu, 24 Sep 2009 07:59:06 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4049

           Summary: Add support for FT_BOOLEAN fields to wslua FieldInfo
           Product: Wireshark
           Version: 1.3.x (Experimental)
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Minor
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: beth.tridium@xxxxxxxxx


Created an attachment (id=3696)
 --> (https://bugs.wireshark.org/bugzilla/attachment.cgi?id=3696)
Patch adds support for FT_BOOLEAN to wslua FieldInfo

Build Information:
Version 1.3.1-trunk-TridiumSedona

Copyright 1998-2009 Gerald Combs <gerald@xxxxxxxxxxxxx> 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.

Check the man page and http://www.wireshark.org for more information.
--
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 end

On the line with marked().value you will get the error: "FT_ not yet supported"

After applying the patch, the above code will work correctly.


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