How can I traverse the Pinfo object in the dissector function?

asked 2021-11-12 09:57:36 +0000

I want to know what exactly fields does Pinfo object have, how Can I traverse this object during my_proto.dissector function has been called?

I want to do this because when I print pinfo.net_src during the dissector, nothing does at all.

edit retag flag offensive close merge delete


Does the pinfo section in the Developers Guide help?

The net_src field will only be set if a dissector called before yours has added info to the field. What's your protocol stack looking like?

grahamb gravatar imagegrahamb ( 2021-11-12 10:08:01 +0000 )edit

I can get the pinfo.src_port and pinfo.dst_port. I'm debugging dissector our private protocol, in the dissector function, I want to get the ip address info and show it by using print function. I know I can using display filter to get the ip info, but during the debugging process, I want to get ip from (tvb, pinfo, tree) these objects.

baozilaji gravatar imagebaozilaji ( 2021-11-12 10:15:01 +0000 )edit