Capturing Profisafe packets using Lua Wireshark dissector

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.

charvaka's avatar
1
charvaka
asked 2022-03-15 14:54:38 +0000
edit flag offensive 0 remove flag 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's avatar grahamb (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's avatar charvaka (2022-03-15 15:24:15 +0000) edit

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

grahamb's avatar grahamb (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's avatar Chuckc (2022-03-15 15:44:11 +0000) edit

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

charvaka's avatar charvaka (2022-03-15 15:58:55 +0000) edit
add a comment see more comments