gnikol / P4-Wireshark-Dissector

This repository contains the Wireshark dissector generator from a P4 file input.
Apache License 2.0
14 stars 6 forks source link

Error-DissectorTable_get: no such dissector_table #17

Open djin31 opened 6 years ago

djin31 commented 6 years ago

When I use the lua script generated I run into these errors on opening wireshark.

Lua: Error during loading: [string "C:...\AppData\Roaming\Wireshark..."]:45: bad argument #1 to 'get' (DissectorTable_get: no such dissector_table)

Lua: Error during loading: [string "C:...\AppData\Roaming\Wireshark..."]:44: bad argument #1 to 'get' (DissectorTable_get: no such dissector_table)

Any resolution for this?

djin31 commented 6 years ago

For both the errors the indicated line is my_table = DissectorTable.get("dstport")

djin31 commented 6 years ago

Found the cause for the issue. The main issue in my opinion is that this tool has been designed with the assumption that the protocol defined in P4 is at application level and not below that. There are two problems which made me to conclude the above statement: Firstly there is issue of the order in which the scripts get loaded by wireshark or tshark (if added into the personal plugin folder) is haphazard. This can be corrected by using an init file or by using a naming system for protocols defined inside a P4 program such that the loading in alphanumeric manner would lead to dependent fields being loaded later on.

Secondly, the protocols in the previous layer do not generate a new table which can be called by the current layer leading to the error of "no such dissector_table".

Also, a suggestion is to prompt the user if he wants to use the standard common protocols like ipv4 ipv6 etc instead of directly replacing them since it is possible the user may have tweaked them according to his needs