How do we override the underlying udp dissector?
I've created the minimal packet-foo dissector verbatim from code in the documentation. It compiles (VS 2017) and I can see in Wireshark that it's registered and enabled.
In debug mode I hit break points in methods proto_register_foo and proto_reg_handoff_foo. When I send a message to FOO_PORT I hit a breakpoint in dissect_udp. I never hit a breakpoint in dissect_foo.
Is there something needed to explicitly make a dissector override (is that the right term) an underlying type, in this case udp? The only thing I see in code id this:
dissector_add_uint("udp.port", FOO_PORT, foo_handle);
Getting ahead of things, would adding this line also override the tcp dissector?
dissector_add_uint("tcp.port", FOO_PORT, foo_handle);
Thx
So does your protocol run on top of UDP - in which case you should expect that
dissect_udp()
is called, and you should dodissector_add_uint("udp.port", FOO_PORT, foo_handle);
to get the UDP dissector to calldissect_foo()
for traffic to and from port FOO_PORT - or does your protocol run instead of UDP, directly atop IPv4 or IPv6?FYI: He's working on the simple dissector from the developers guide.