Abhay Rao
Abhay Rao

Reputation: 11

All fields list for packets in Wireshark:Lua

Im trying to get a list of all protocol fields for a packet. I tried all_field_infos, but it returns userdata and i couldnt figure the metatable to use to read it. Does wireshark pass a protocol tree to a tap ? ( we accept (tvb,pinfo,tree) for dissectors so i figured that it might ) Is there some Proto.fields sorta property which returns all fields for a particular protocol ?

Upvotes: 1

Views: 1890

Answers (1)

RBerteig
RBerteig

Reputation: 43326

I haven't used Wireshark myself, but poking around in their user manual online produces this chapter that appears to document a list of methods and fields of a packet. There isn't a metamethod that allows a userdata to support pairs(), so the documentation is really all you get.

Alternatively, you can try calling getmetatable() on the userdata and listing its content. Of course, it might use __index() to hide the real methods somewhere else...

I think there has been some discussion of Wireshark on the Lua-L mailing list as well. Its archives might be helpful.

As a low priority resort, Wireshark is open source, so it must be possible to find the code that implements the interface to the Lua side of things...

Upvotes: 1

Related Questions