Wireshark-dev: Re: [Wireshark-dev] LUA Dissector for custom packets
From: Reinhard Speyerer <[email protected]>
Date: Thu, 20 Aug 2009 22:16:04 +0200
Christian Gurk wrote:

> So I wrote the test dissector and it showes up in the Enable Protocols 
> List (and of course, I activate it). But when I try to use it with 
> "Decode as", this menu item is grayed out, so I can't use it.

> Here is the code of my first test:
>> -- trivial protocol example
>> -- declare our protocol
>>
>> mpic_proto = Proto("mpic485","MPIC 485 bus protocol")

>> -- local packet_table = DissectorTable.get("packet")
>> -- packet_table:add(packet.USER15,mpic_proto)

Hi Christian,

the following Lua code

local wtap_encap_table = DissectorTable.get("wtap_encap")
wtap_encap_table:add(wtap.USER15, mpic_proto)

combined with text2pcap -l 162 is probably the easiest way
to use your Lua dissector for your text file packet data.

Regards,
Reinhard