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

How to register a Lua dissector for 802.1Q Ethernet payload


I am developing a custom dissector in Lua that decodes a proprietary protocol developed by my company. The dissector should process the payload of Ethernet II frames that have a VLAN tag (as defined by IEEE 802.1Q). How can I tell Wireshark that?

I tried the following:

original_vlan_dissector = DissectorTable.get("ethertype"):get_dissector(0x8100)
function my_protocol.dissector(buffer, packet_info, tree)
    original_vlan_dissector:call(buffer, packet_info, tree)

local eth_table = DissectorTable.get("ethertype") eth_table:add(0x8100, my_protocol)

Is there a better place to register my dissector? There is no TCP or UDP involved here, so I have no idea which DissectorTable and port are suitable.

asked 16 Aug ‘16, 07:19

patrick_oppermann's gravatar image

accept rate: 0%

One Answer:


Yes, this is the right way to do it.

answered 16 Aug '16, 07:42

sindy's gravatar image

accept rate: 24%