jseldent / wireshark-dds-xrce

DDS-XRCE Protocol dissector for Wireshark
Apache License 2.0
8 stars 3 forks source link

Adding extra content to pinfo.cols.info from dds_xrce_submessage(..)? #4

Open gavanderhoorn opened 2 years ago

gavanderhoorn commented 2 years ago

The current implementation updates pinfo.cols.info at the end of dds_xrce_dissect(..):

https://github.com/jseldent/wireshark-dds-xrce/blob/f54bf40c203b90da1ab3c1941279d85b0fafb9d5/dds-xrce-proto.lua#L410

It would be useful if the dissector functions for user-defined-types would have some way of contributing to what gets appended to pinfo.cols.info. dds_xrce_submessage(..) does get passed pinfo, but it doesn't forward it (which makes sense in a way).

I've implemented something really primitive which lets my custom dissector functions do something like this here (it currently only appends the type name, but topic_name could be added as well of course if it is available):

image

but that's not something that should get merged.

This makes reading captures a lot more convenient, as it's much easier to find the specific messages/packets one might be interested in.

What would be the nicest way to implement something like this? Dissection functions currently only return the new offset, but could return a table instead with both the offset and a string. An alternative could be to have dds_xrce_submessage(..) pass them pinfo (here), but perhaps that'd not be something you'd want to do (expose too much of Wireshark 'internals' to simple dissection functions).

jseldent commented 2 years ago

I'm not sure the Info column is the best place for this information. It's getting quite crowded already.

But I have been looking into adding fields with (a comma-separated list of) topic and type names. That way you can add an extra column to display that information. And you can filter on it (something like dds-xrce.topics contains "my_topic").