<div><div dir="auto">The easiest thing that I have found to do is to run dbus-monitor —pcap, that will let you view the bus data in wireshark and export packets.</div></div><div dir="auto"><br></div><div dir="auto">In my experience, the parsing itself is not too hard, the fact that you can have nested objects and varied lengths of data is what really trips me up.</div><div><div dir="auto"><br></div><div dir="auto">-Robert Middleton</div><div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Oct 17, 2024 at 10:54 AM Simon McVittie <<a href="mailto:smcv@collabora.com" target="_blank">smcv@collabora.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Thu, 17 Oct 2024 at 09:09:20 -0400, Link Dupont wrote:<br>
> I’m experimenting with writing a client library from scratch<br>
> (rather than building on libdbus or using bindings to bridge to an<br>
> existing library). I’ve been reading about the Type System[1] and the<br>
> Marshaling Wire Format[2]. There are a few examples in the specification,<br>
> but in order to verify my marshal/unmarshal logic, I’d like some<br>
> more real-world examples of signatures, marshaled message bodies and<br>
> the primitive types they are expected to unmarshal into. Does anyone<br>
> know of a collection of more thorough wire format examples? Or a means<br>
> through which I could generate my own?<br>
<br>
The reference implementation (dbus, the same project that contains libdbus)<br>
has a few raw messages in test/data/valid-messages, although currently only<br>
a very small set. The *.hex files contain annotated hexdumps explaining the<br>
format in more detail.<br>
<br>
I think there's a merge request open where I added some more, but it got<br>
stalled by discussion of whether the cases I was testing were API guarantees<br>
or implementation details.<br>
<br>
You can generate a marshalled message most conveniently by calling<br>
dbus_message_marshal() from libdbus or g_dbus_message_to_blob() from GLib.<br>
<br>
smcv<br>
</blockquote></div></div>
</div>