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