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

Hello,

I'm writing a tool that transfers some XML file into a LUA file. The XML file contains above 100 messages.

I have to have as minimum following 2 statements for each message:

local p_multi = Proto("multi", "MultiProto");
local f=p_multi.fields

meaning that I have at least 200 'local' records which is limited by LUA. I've tried to use it as follows, but getting an error:

local locals={}
locals.p_multi = Proto("multi", "MultiProto");
locals.f=p_multi.fields

I've also tried to remove the local statement, but in Wireshark I've received an empty message content (i.e all the fields were with null value)

p_multi = Proto("multi", "MultiProto");
f=p_multi.fields

Any suggestion how to solve it?

Thank you :)

asked 13 Sep '17, 21:55

BMWE's gravatar image

BMWE
467811
accept rate: 100%

edited 13 Sep '17, 22:00

I've found how can I reduce to a single local instead of two. but this still can be problematic as number of messages can be above 200 (different small messages send on the network).

(13 Sep '17, 22:12) BMWE

Replacing locals.f=p_multi.fields with locals.f=locals.p_multi.fields and doing same in all relevant places solved the issue

permanent link

answered 18 Sep '17, 01:48

BMWE's gravatar image

BMWE
467811
accept rate: 100%

Hello, I am also generating lua dissectors. Do you mind me asking what these are for?

Maybe we could share some knowledge. Here are a few examples:

https://github.com/Open-Markets-Initiative/wireshark-lua

Bill

(03 Oct '17, 13:13) william

Hi,

Having a glimpse on your work and it seems good. I'll have some additional look later.

(04 Oct '17, 07:08) BMWE
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:

×12

question asked: 13 Sep '17, 21:55

question was seen: 641 times

last updated: 04 Oct '17, 07:08

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