Wireshark-bugs: [Wireshark-bugs] [Bug 3513] New: Lua dissector field registration broken
Date: Fri, 5 Jun 2009 10:58:07 -0700 (PDT)
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3513

           Summary: Lua dissector field registration broken
           Product: Wireshark
           Version: 1.1.x (Experimental)
          Platform: Other
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: abaxter@xxxxxxxxxxxxxxxxx


Build Information:
wireshark 1.1.3

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.1, with GLib 2.20.1, with libpcap 0.9.5, with libz
1.2.3, without POSIX capabilities, without libpcre, without SMI, without
c-ares,
without ADNS, with Lua 5.1, without GnuTLS, without Gcrypt, with MIT Kerberos,
without GeoIP, without PortAudio, without AirPcap.
NOTE: this build doesn't support the "matches" operator for Wireshark filter
syntax.

Running on Darwin 9.7.0 (MacOS 10.5.7), with libpcap version 0.9.5.

Built using gcc 4.0.1 (Apple Inc. build 5490).
--
I hope I'm not mistaken again in this, but...

Firstly, in my dissector I added, as a test, a field:
; TestField = ProtoField.bytes("frame.len", "Test", "This should not work.")
; MyProtocol.fields = { TestField }

This is a duplicate field, and should be rejected (it would be rejected with c
code).  However, the field is accepted, and the original field kicks the error
'"206" is not a valid byte code' or similar when applied as a filter.  I
imagine this is a result of different field types.

The same happens if I duplicate a field in my dissector code.  Doing a search
with them both produces the error:
"Protocol ("ff") cannot appear on right-hand side of comparison."

I was working on a tap for this dissector, and none of my lua-dissector
registered fields were recognized when I was trying to extract them.
; local CallIndexField = Field.new("esi.callindex")
gives the error "bad argument #1 to 'new' (Field_new: a field with this name
must exist)".  The field extractor line is the first after the "do" at the
script top.  The tap script is run after the dissector script.

At the very least, what is the current status of Lua?  Is it so broken that it
is unusable for dissectors/taps?  Given the documentation and problems I've
encountered, it seems it is, and perhaps a notice should be put on the wiki
and/or Lua documentation pages?


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