[SSSD] [PATCH] DBus: Automatic pack/unpack of method handler arguments

Stef Walter stefw at redhat.com
Fri Mar 14 22:00:42 UTC 2014


Here's the next set of DBus patches. This implements automatic packing
and unpacking of arguments for method handlers.

This means adding a handler to a vtable is now type safe and checked by
the compiler. Type safe reply xxx_finish() are also generated. Together
these avoid the complexity and the pitfalls of building and parsing DBus
messages via varargs (such as dbus_bool_t != bool).

Handlers have their pack/unpack method handlers automatically generated
unless they have this annotation in their DBus XML definition:

    <annotation name="org.freedesktop.sssd.RawHandler" value="true"/>

Only simple argument types, and arrays of them are supported. More
complex arguments can continue to be handled via the "RawHandler"
annotation. sbus_codegen will force you to add this annotation for
methods that have complex arguments. In later work we could add commit
for more complex, but common arguments such as dictionaries.

Because so many of the internal sssd DBus methods do strange things with
their arguments, I haven't migrated them to automatic packing and
unpacking of arguments. They are all now marked with the above
"RawHandler" annotation. At some point someone could pick through these
and see which ones are candidates for moving away from "RawHandler".

You can find this as a branch here:

https://github.com/stefwalter/sssd/commits/dbus-invoke

Cheers,

Stef

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-sbus-Add-type-safe-DBus-method-handlers-and-finish-f.patch
Type: text/x-patch
Size: 44490 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20140314/55e45fa9/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-sbus_codegen_tests-Add-test-case-type-safe-handler-a.patch
Type: text/x-patch
Size: 32510 bytes
Desc: not available
URL: <https://lists.fedorahosted.org/pipermail/sssd-devel/attachments/20140314/55e45fa9/attachment-0001.bin>


More information about the sssd-devel mailing list