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

Hi,

I've written a Wireshark Lua postdissector to calculate some timing values for HTTP packets. The initial code (the code that runs on Wireshark start up) includes the definition of some tables that are used to retain data between calls to the dissector function. Everything works OK but if I load a new trace file I'm picking up residual table entries associated with the previous file.

I can then reinitialize the global tables if I know that the trace file has changed.

How can my dissector detect that the trace file has changed?

Thanks and regards...Paul

asked 09 Jul '14, 13:07

PaulOfford's gravatar image

PaulOfford
131273237
accept rate: 11%

edited 10 Jul '14, 12:59

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196

Hadriel, is the init_routines table documented anywhere?

(10 Jul '14, 01:23) Guy Harris ♦♦

It's added to using the Lua "Proto.init()", so documented here.

(10 Jul '14, 11:33) Hadriel

Thanks for that. It works fine.

Best regards...Paul

(11 Jul '14, 13:54) PaulOfford

OK, so you'd add an init routine, using Lua Proto.init(), as per Hadriel's comment.

Your init routine would be called whenever you need to reinitialize whatever global state you maintain.

permanent link

answered 10 Jul '14, 12:58

Guy%20Harris's gravatar image

Guy Harris ♦♦
17.4k335196
accept rate: 19%

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:

×1,620
×431
×24

question asked: 09 Jul '14, 13:07

question was seen: 1,606 times

last updated: 11 Jul '14, 13:54

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