Hello, i am currently writing a dissector with lua which use data from UDP AND TCP. So i register the dissector like this
but in the function SEL.dissector(_tvbuf, _pktinfo, _root), i need to know if this if data is coming from UDP or TCP. Is there a way to detect UDP ou TCP data ? Thank asked 26 Apr '17, 12:28 SebastienRolle edited 26 Apr '17, 17:07 |
One Answer:
Yes, there is. Create the answered 26 Apr '17, 23:48 Jaap ♦ |
Thank a lot. Can you point me to an existing dissector in order for me to understand.
Thank, Sebastien
i have done this but unfortunately, it doesn't work. Can you give me a little more details about the proposed solution.
I don’t do LUA myself, but recon it would be something like this:
If you don’t want to have the separate dissector registrations (one for UDP, one for TCP) you might also be able to look at pktinfo. In that structure you should have a ptype field, which indicates the (transport) protocol as well.