From 769347ad4d35d43488eb98f980143495b0db415d Mon Sep 17 00:00:00 2001 From: Stef Walter Date: Fri, 10 Jan 2014 08:58:12 +0100 Subject: sbus: Rework sbus to use interface metadata and vtables MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Previous commits added support for interface metadata and handler vtables. This commit ports sbus_dbus_connection to use them. Port the internal uses of dbus to use the new scheme in a very minimal way. Further cleanup is possible here. This commit provides basic definitions of the internal dbus interfaces. The interfaces aren't fully defined, as the handlers will continue to unpack manually, and often overload DBus methods with different arguments (which is rather unorthodox, but not the end of the world). Reviewed-by: Jakub Hrozek Reviewed-by: Sumit Bose Reviewed-by: Lukáš Slebodník Reviewed-by: Simo Sorce --- src/providers/proxy/proxy_child.c | 16 ++++++++++------ src/providers/proxy/proxy_init.c | 16 ++++++++++------ 2 files changed, 20 insertions(+), 12 deletions(-) (limited to 'src/providers/proxy') diff --git a/src/providers/proxy/proxy_child.c b/src/providers/proxy/proxy_child.c index 52968651b..737b0cfd6 100644 --- a/src/providers/proxy/proxy_child.c +++ b/src/providers/proxy/proxy_child.c @@ -49,16 +49,20 @@ static int pc_pam_handler(DBusMessage *message, struct sbus_connection *conn); -struct sbus_method pc_methods[] = { - { DP_METHOD_PAMHANDLER, pc_pam_handler }, - { NULL, NULL } +struct data_provider_iface pc_methods = { + { &data_provider_iface_meta, 0 }, + .RegisterService = NULL, + .pamHandler = pc_pam_handler, + .sudoHandler = NULL, + .autofsHandler = NULL, + .hostHandler = NULL, + .getDomains = NULL, + .getAccountInfo = NULL, }; struct sbus_interface pc_interface = { - DP_INTERFACE, DP_PATH, - SBUS_DEFAULT_VTABLE, - pc_methods, + &pc_methods.vtable, NULL }; diff --git a/src/providers/proxy/proxy_init.c b/src/providers/proxy/proxy_init.c index ae73fe702..60ae4a950 100644 --- a/src/providers/proxy/proxy_init.c +++ b/src/providers/proxy/proxy_init.c @@ -30,16 +30,20 @@ static int client_registration(DBusMessage *message, struct sbus_connection *conn); -static struct sbus_method proxy_methods[] = { - { DP_METHOD_REGISTER, client_registration }, - { NULL, NULL } +static struct data_provider_iface proxy_methods = { + { &data_provider_iface_meta, 0 }, + .RegisterService = client_registration, + .pamHandler = NULL, + .sudoHandler = NULL, + .autofsHandler = NULL, + .hostHandler = NULL, + .getDomains = NULL, + .getAccountInfo = NULL, }; struct sbus_interface proxy_interface = { - DP_INTERFACE, DP_PATH, - SBUS_DEFAULT_VTABLE, - proxy_methods, + &proxy_methods.vtable, NULL }; -- cgit