Capturing Profisafe packets using Lua Wireshark dissector

asked 2022-03-15 14:54:38 +0000

I am writing a Lua script to capture profisafe packets on wireshark.It is above the profinet layer in the stack.The wireshark has a built in profinet dissector but does not have a profisafe dissector.

For other protocols built on tcp or udp protocol one can do something like

local tcp_port = Dissector.get("tcp.port")
tcp_port:add(1234,foo_protocol)

to capture the packets that arises and received by the port 1234.

But profisafe is built on profinet and does not contain tcp or udp as the underlying layer.How to capture the packets in this case? I tried giving ethernet frame address in the place of port name but it did not work.

edit retag flag offensive close merge delete

Comments

I have no idea if this is related or what it does, but the Profinet IO dissector has an option for "detailed PROFIsafe dissection".

The Profinet IO dissector also has a sub-dissector table for heuristic dissectors named "pn_io" that can be used by sub-dissectors to add themselves to the table and be called by the PNIO dissector. Again I have no idea if this is useful to you.

grahamb gravatar imagegrahamb ( 2022-03-15 15:16:04 +0000 )edit

Thanks for the reply. Can you provide any examples or direct me to any resources/ links where pnio dissector is implemented?

charvaka gravatar imagecharvaka ( 2022-03-15 15:24:15 +0000 )edit

There is the source file here and the wiki page here.

grahamb gravatar imagegrahamb ( 2022-03-15 15:30:57 +0000 )edit

Add dissection for PROFINET PROFIsafe packets
There are sample files attached to the issue above but the decode seems to be missing a config file:
GSD-file networkpath failure! Please check your GSD-file networkpath. (No Path configured)

Chuckc gravatar imageChuckc ( 2022-03-15 15:44:11 +0000 )edit

i meant, can you show an example of Profisafe LUA dissector,

charvaka gravatar imagecharvaka ( 2022-03-15 15:58:55 +0000 )edit