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

Hi ,

I am trying to write the lua script ( 5.2.3) for windows . extension lua script for wireshark .

facing error in this line "local f_proto = ProtoField.uint8("multi.protocol","Protocol",base.DEC,vs_protos)"

attempt to index global 'base' (a nil value) . How to fix this issue ..??

regards, Beno

asked 11 Sep '14, 22:16

benok's gravatar image

benok
11112
accept rate: 0%

Which version of wireshark/tshark are you using ?

And how are you executing the script ?

I've tried this specific line in Evaluate Lua window Tools->Lua->Evaluate of my wireshark 1.12.0 and it worked that is it did not raise any errors.

(12 Sep '14, 05:09) izopizo

hi izopizo ,

I am using wireshark 1.12.0 , executing via wireshark init.lua ( added dofile( "test.lua" ) , the content on the test.lua is local p_multi = Proto("multi","MultiProto");

local vs_protos = { [2] = "mtp2", [3] = "mtp3", [4] = "alcap", [5] = "h248", [6] = "ranap", [7] = "rnsap", [8] = "nbap" }

local f_proto = ProtoField.uint8("multi.protocol","Protocol",base.DEC,vs_protos)

(12 Sep '14, 05:22) benok

Where in init.lua did you put your "dofile(test.lua)" statement? I ask because the "base" table it's complaining about being a nil value is a Lua table defined in init.lua itself, at line 448 (or around there). So if you call "dofile(test.lua)" in init.lua before the base table is defined, you'll get that error.

The best thing to do would be to not call dofile() to load your test.lua file, but instead put test.lua in your personal plugins directory and Wireshark will automatically load it.

permanent link

answered 12 Sep '14, 07:33

Hadriel's gravatar image

Hadriel
2.7k2939
accept rate: 18%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×431
×31

question asked: 11 Sep '14, 22:16

question was seen: 3,197 times

last updated: 23 Oct '14, 02:39

p​o​w​e​r​e​d by O​S​Q​A