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

Lua Dissector - Access other dissectors' fields

0

I wrote a custom dissector to dissect TCP payloads. I would like to access the wlan.sa field from within my dissector. How can I access data (fields) from "lower layer" dissectors, like the 802.11 dissector.

asked 29 Jul '16, 10:04

J_Turner's gravatar image

J_Turner
715510
accept rate: 0%


One Answer:

2

I've provided many Lua-related links in my answer to this question. The documentation explains how to do this and there are many example scripts that show you exactly how to do it as well. One such example is the "postdissectors" example, where it shows things like:

 5 tcp_src_f = Field.new("tcp.srcport")

18 local tcp_src = tcp_src_f()

Refer to the documentation for Field.new for more information.

answered 29 Jul ‘16, 12:42

cmaynard's gravatar image

cmaynard ♦♦
9.4k1038142
accept rate: 20%

Thank you for the answer. I know it’s annoying when people post questions that have obvious answers in the docs. I did wander through all that documentation for a day before I posted the question, but as a noob, I just didn’t put it all together. However, I got it to work quickly with your brief guidance. All this just to say: thanks for being patient and not blowing off the obvious questions.

(01 Aug ‘16, 06:08) J_Turner

For the record, I was not annoyed and I apologize if my answer came across if I was. My answer wasn’t meant to infer that you hadn’t looked at the documentation either, but linking to the documentation, examples, manual, etc. may help you (and others) with similar Lua-related questions in the future.

(01 Aug ‘16, 17:12) cmaynard ♦♦