Wire format examples

Robert Middleton robert.middleton at rm5248.com
Thu Oct 17 15:17:17 UTC 2024


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.

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.

-Robert Middleton

On Thu, Oct 17, 2024 at 10:54 AM Simon McVittie <smcv at collabora.com> wrote:

> 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
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/dbus/attachments/20241017/27138db2/attachment.htm>


More information about the dbus mailing list