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

How to register a Lua dissector for 802.1Q Ethernet payload

0

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)
    [...]
end

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

patrick_oppe…
466611
accept rate: 0%


One Answer:

1

Yes, this is the right way to do it.

answered 16 Aug '16, 07:42

sindy's gravatar image

sindy
6.0k4851
accept rate: 24%