diff options
author | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-21 21:29:15 +0200 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-05-27 10:43:36 +0200 |
commit | 4f7f714e118e95896fac5239c7a8b529c39a4758 (patch) | |
tree | 41a78f39f2fe9bcec0d9394525500cc43b3f41ec /src/responder/ifp | |
parent | 886d29fced0bcc1668a3cb99a5bca66ea486b3a4 (diff) | |
download | sssd-4f7f714e118e95896fac5239c7a8b529c39a4758.tar.gz sssd-4f7f714e118e95896fac5239c7a8b529c39a4758.tar.xz sssd-4f7f714e118e95896fac5239c7a8b529c39a4758.zip |
SBUS: Implement org.freedesktop.DBus.Properties.GetAll for primitive types
This patch implements the GetAll method of the
org.freedesktop.DBus.Properties interface by iterating over the
available getters and putting all the results into a single getter.
The patch includes a unit test that exercies all currently supported
array types.
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com>
Diffstat (limited to 'src/responder/ifp')
-rw-r--r-- | src/responder/ifp/ifp_iface_generated.c | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/src/responder/ifp/ifp_iface_generated.c b/src/responder/ifp/ifp_iface_generated.c index d3cb4990c..91efda251 100644 --- a/src/responder/ifp/ifp_iface_generated.c +++ b/src/responder/ifp/ifp_iface_generated.c @@ -66,12 +66,39 @@ const struct sbus_method_meta infopipe_iface__methods[] = { { NULL, } }; +/* invokes GetAll for the 'org.freedesktop.sssd.infopipe' interface */ +static int invoke_infopipe_iface_get_all(struct sbus_request *dbus_req, void *function_ptr) +{ + DBusMessage *reply; + dbus_bool_t dbret; + DBusMessageIter iter; + DBusMessageIter iter_dict; + + reply = dbus_message_new_method_return(dbus_req->message); + if (!reply) return ENOMEM; + dbus_message_iter_init_append(reply, &iter); + dbret = dbus_message_iter_open_container( + &iter, DBUS_TYPE_ARRAY, + DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING + DBUS_TYPE_STRING_AS_STRING + DBUS_TYPE_VARIANT_AS_STRING + DBUS_DICT_ENTRY_END_CHAR_AS_STRING, + &iter_dict); + if (!dbret) return ENOMEM; + + dbret = dbus_message_iter_close_container(&iter, &iter_dict); + if (!dbret) return ENOMEM; + + return sbus_request_finish(dbus_req, reply); +} + /* interface info for org.freedesktop.sssd.infopipe */ const struct sbus_interface_meta infopipe_iface_meta = { "org.freedesktop.sssd.infopipe", /* name */ infopipe_iface__methods, NULL, /* no signals */ - NULL, /* no propetries */ + NULL, /* no properties */ + invoke_infopipe_iface_get_all, /* GetAll invoker */ }; /* invokes a handler with a 's' DBus signature */ |