Wire format examples

Simon McVittie smcv at collabora.com
Thu Oct 17 14:54:10 UTC 2024


On Thu, 17 Oct 2024 at 09:09:20 -0400, Link Dupont wrote:
> I’m experimenting with writing a client library from scratch
> (rather than building on libdbus or using bindings to bridge to an
> existing library). I’ve been reading about the Type System[1] and the
> Marshaling Wire Format[2]. There are a few examples in the specification,
> but in order to verify my marshal/unmarshal logic, I’d like some
> more real-world examples of signatures, marshaled message bodies and
> the primitive types they are expected to unmarshal into. Does anyone
> know of a collection of more thorough wire format examples? Or a means
> through which I could generate my own?

The reference implementation (dbus, the same project that contains libdbus)
has a few raw messages in test/data/valid-messages, although currently only
a very small set. The *.hex files contain annotated hexdumps explaining the
format in more detail.

I think there's a merge request open where I added some more, but it got
stalled by discussion of whether the cases I was testing were API guarantees
or implementation details.

You can generate a marshalled message most conveniently by calling
dbus_message_marshal() from libdbus or g_dbus_message_to_blob() from GLib.

    smcv


More information about the dbus mailing list