Wireshark-bugs: [Wireshark-bugs] [Bug 2244] New: LUA: There's no tvb_get_stringz() equivalent
Date: Sun, 3 Feb 2008 21:25:22 +0000 (GMT)
http://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2244

           Summary: LUA: There's no tvb_get_stringz() equivalent
           Product: Wireshark
           Version: 0.99.7
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: Enhancement
          Priority: Low
         Component: Wireshark
        AssignedTo: wireshark-bugs@xxxxxxxxxxxxx
        ReportedBy: hcgpalm@xxxxxxxxx


Build Information:
wireshark 0.99.7

Copyright 1998-2007 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.10.13, with GLib 2.12.9, with libpcap 0.9.4, with libz
1.2.3, without libpcre, without SMI, without ADNS, with Lua 5.1, with GnuTLS
1.4.1, with Gcrypt 1.2.3, with MIT Kerberos, without PortAudio, without
AirPcap.
NOTE: this build doesn't support the "matches" operator for Wireshark filter
syntax.

Running on Linux 2.6.22.14-72.fc6, with libpcap version 0.9.4.

Built using gcc 4.1.2 20070626 (Red Hat 4.1.2-13).

--
The LUA API lacks an equivalent to tvb_get_stringz().
This could be worked-around with the following LUA code, but it would be nice
to have it in the API.

        local function tvb_get_stringz(tvb, offset)
                local len = 0
                while tvb(offset + len, 1):uint() ~= 0 do
                        len = len + 1
                end
                len = len + 1;
                return tvb(offset, len), offset + len
        end


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