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)

           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: [email protected]
        ReportedBy: [email protected]

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 <[email protected]> and contributors.
This is free software; see the source for copying conditions. There is NO

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
(packet.dll version, 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

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.