Closed jseldent closed 2 years ago
Tested it. Works perfectly.
Might be nice to indicate which fields are absolutely required?
Would be even more perfect if it would be a context menu which opens when right-clicking on the object_id
field of the already dissected payload
field :sweat_smile:. The ID field could then be auto-populated from the value of payload
.
And seeing as a user already needs to fill in the topic_type_names
and types
tables, would it perhaps be possible to make the profile and topic fields dropdowns in the Set object dialog?
Oh, and just thought of this: what about a way for users to store the mapping in a companion .lua
file, next to a .pcap(ng)
file with the same name?
Would save recreating it every time the file gets loaded.
(and by store, I mean writing it by hand. Not that the dissector should necessarily be able to serialise the tables and mapping)
Edit: the pcapng
format supports user comments, both at the file and per-packet level. Might be able to use those to store the information needed by the dissector.
I've looked into creating a context menu, but as far as I can see, you can only create regular menus with Wireshark. And it seems that it's only possible to create text fields in dialog windows, not drop-down lists.
As for saving and loading the mapping to file, I'll have to look into that.
I've looked into creating a context menu, but as far as I can see, you can only create regular menus with Wireshark. And it seems that it's only possible to create text fields in dialog windows, not drop-down lists.
yes, I agree. Spent some time looking through the WS Lua API docs and it doesn't appear this is supported.
An alternative flow could be:
That would not need a context menu.
I'll see if I can add that later. It's just convenience of course.
As an update: this has been absolutely fantastic trying to make sense of a captured XRCE-DDS exchange.
Example dissection of a control_msgs_action_FollowJointTrajectory_Feedback
message from micro-ROS to a ROS 2 node:
Edit: one thing I'm wondering about: could we remove the need for a topic name? I realise the dissector currently uses it to lookup type information, but couldn't the object_id
be used for this directly?
An alternative flow could be:
- user selects packet (in packet listing) which contains the XRCE DDS pkt with the payload he wants to associate with a particular custom dissector
- dissector stores the payload value in a wireshark dissector field (as part of the normal dissector control flow)
- code-behind-dialog retrieves the value of the field which stores the ID for the selected packet
That would not need a context menu.
I've looked into that, but I can't find a way of discovering which packet is selected by the user. If we could, the rest would be easy. We could even pre-fill the profile
and topic
if we already have values for them.
Edit: one thing I'm wondering about: could we remove the need for a topic name? I realise the dissector currently uses it to lookup type information, but couldn't the object_id be used for this directly?
I've added a type
field to the "Set object..." dialog. You can use that to manually specify the type of an object. It takes precedence over the inferred type from the topic or profile name.
I've looked into that, but I can't find a way of discovering which packet is selected by the user.
would that be needed?
If instead of generic tvb text items, the dissector would add a ProtoField for payload.object_id
(similar to f_submessage_id
and the others), retrieving the value for that field would always return the value for the currently dissected (ie: displayed) packet AFAIK. That's at least how it works for me in other dissectors.
If instead of generic tvb text items, the dissector would add a ProtoField for the object_id (similar to f_submessage_id and the others), retrieving the value for that field would always return the value for the currently dissected (ie: displayed) packet AFAIK. That's at least how it works for me in other dissectors.
The problem is that there are often multiple submessages in a single packet, each with their own object ID. So it wouldn't be clear which ID to use.
Also, in the current implementation the deserialization of the submessages (in dds-xrce-types.lua
) is separate from the main dissector code (in dds-xrce-proto.lua
). So it's not trivial to use a field instead of a text item for the object ID.
I've tried to use a Field extractor, but you cannot use those outside a dissector. So it doesn't work for a GUI dialog.
However, the dissector implementation already tracks the object ID of the most recently dissected packet. Which, in practice, is the currently selected packet. If there are multiple submessages, it's the object ID of the last submessage. This is actually a useful default. For example, CREATE messages are often combined, with the last message being the data reader/writer. And that's generally the one you want to configure anyway.
I've added the known values for ID, profile, topic and type name to the dialog. It seems to work quite well.
I'll merge this now. Saving/loading the object type info can be a future PR.
This pull requests adds a menu that allows the user to manually specify the profile and/or topic name of an object. This makes it possible to deserialize payloads, even if the creation of the entities was not captured.