This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Can Field.new retrieve a field defined previously with ProtoInfo?

0

For example, if you have the postdissector example, and append the following:

do
    local f_newfield1 = Field.new("http.newfield1")
end

It fails to start up with the following error:

tshark: Lua: Error during loading:
 [string "/home/alastair/.wireshark/plugins/http_extr..."]:38: bad argument #1 to 'new' (Field_new: a field with this name must exist)

.. even though the field was defined previously as a ProtoField.

Is this a bug or feature or something else?

asked 04 Mar '14, 08:51

randomphrase's gravatar image

randomphrase
21225
accept rate: 0%


One Answer:

0

What version are you running?

The ability to use a Field extractor (i.e., to call Field.new()) of a field created by your script was only possible relatively recently - as a fix in bug 3513, back in October. I think that means you have to be running Wireshark version 1.11 at least. (I think 1.10 was cut before then, so it won't have this because the bug wasn't critical) I could be wrong though - it might have gotten backported into 1.10 at some point.

answered 04 Mar '14, 09:25

Hadriel's gravatar image

Hadriel
2.7k2939
accept rate: 18%

Just checked - no it's not in 1.10, you need to go to 1.11.2, which you can get on the downloads page.

(04 Mar '14, 09:33) Hadriel

Yep that was the problem - Thanks for the timely answer!

(04 Mar '14, 12:05) randomphrase