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/responder/pam/pamsrv.c | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'src/responder/pam/pamsrv.c') diff --git a/src/responder/pam/pamsrv.c b/src/responder/pam/pamsrv.c index 5f9844ebc..1fc9f6282 100644 --- a/src/responder/pam/pamsrv.c +++ b/src/responder/pam/pamsrv.c @@ -47,30 +47,38 @@ #define DEFAULT_PAM_FD_LIMIT 8192 -struct sbus_method monitor_pam_methods[] = { - { MON_CLI_METHOD_PING, monitor_common_pong }, - { MON_CLI_METHOD_RES_INIT, monitor_common_res_init }, - { MON_CLI_METHOD_ROTATE, responder_logrotate }, - { NULL, NULL } +struct mon_cli_iface monitor_pam_methods = { + { &mon_cli_iface_meta, 0 }, + .ping = monitor_common_pong, + .resInit = monitor_common_res_init, + .shutDown = NULL, + .goOffline = NULL, + .resetOffline = NULL, + .rotateLogs = responder_logrotate, + .clearMemcache = NULL, + .clearEnumCache = NULL, }; struct sbus_interface monitor_pam_interface = { - MONITOR_INTERFACE, MONITOR_PATH, - SBUS_DEFAULT_VTABLE, - monitor_pam_methods, + &monitor_pam_methods.vtable, NULL }; -static struct sbus_method pam_dp_methods[] = { - { NULL, NULL } +static struct data_provider_iface pam_dp_methods = { + { &data_provider_iface_meta, 0 }, + .RegisterService = NULL, + .pamHandler = NULL, + .sudoHandler = NULL, + .autofsHandler = NULL, + .hostHandler = NULL, + .getDomains = NULL, + .getAccountInfo = NULL, }; struct sbus_interface pam_dp_interface = { - DP_INTERFACE, DP_PATH, - SBUS_DEFAULT_VTABLE, - pam_dp_methods, + &pam_dp_methods.vtable, NULL }; -- cgit