summaryrefslogtreecommitdiffstats
path: root/src/providers/data_provider_be.c
diff options
context:
space:
mode:
authorStef Walter <stefw@redhat.com>2014-01-10 08:58:12 +0100
committerJakub Hrozek <jhrozek@redhat.com>2014-02-24 11:14:59 +0100
commit769347ad4d35d43488eb98f980143495b0db415d (patch)
tree1613fff70e57d363ceda4f5d2d3d48efd87073a0 /src/providers/data_provider_be.c
parent3e7d7af1953410f3f009bf3b2e481a46fb80de83 (diff)
downloadsssd-769347ad4d35d43488eb98f980143495b0db415d.tar.gz
sssd-769347ad4d35d43488eb98f980143495b0db415d.tar.xz
sssd-769347ad4d35d43488eb98f980143495b0db415d.zip
sbus: Rework sbus to use interface metadata and vtables
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 <jhrozek@redhat.com> Reviewed-by: Sumit Bose <sbose@redhat.com> Reviewed-by: Lukáš Slebodník <lslebodn@redhat.com> Reviewed-by: Simo Sorce <simo@redhat.com>
Diffstat (limited to 'src/providers/data_provider_be.c')
-rw-r--r--src/providers/data_provider_be.c43
1 files changed, 21 insertions, 22 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 2e6422693..67d521032 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -63,20 +63,21 @@ static int data_provider_reset_offline(DBusMessage *message,
static int data_provider_logrotate(DBusMessage *message,
struct sbus_connection *conn);
-struct sbus_method monitor_be_methods[] = {
- { MON_CLI_METHOD_PING, monitor_common_pong },
- { MON_CLI_METHOD_RES_INIT, data_provider_res_init },
- { MON_CLI_METHOD_OFFLINE, data_provider_go_offline },
- { MON_CLI_METHOD_RESET_OFFLINE, data_provider_reset_offline },
- { MON_CLI_METHOD_ROTATE, data_provider_logrotate },
- { NULL, NULL }
+struct mon_cli_iface monitor_be_methods = {
+ { &mon_cli_iface_meta, 0 },
+ .ping = monitor_common_pong,
+ .resInit = data_provider_res_init,
+ .shutDown = NULL,
+ .goOffline = data_provider_go_offline,
+ .resetOffline = data_provider_reset_offline,
+ .rotateLogs = data_provider_logrotate,
+ .clearMemcache = NULL,
+ .clearEnumCache = NULL,
};
struct sbus_interface monitor_be_interface = {
- MONITOR_INTERFACE,
MONITOR_PATH,
- SBUS_DEFAULT_VTABLE,
- monitor_be_methods,
+ &monitor_be_methods.vtable,
NULL
};
@@ -88,22 +89,20 @@ static int be_autofs_handler(DBusMessage *message, struct sbus_connection *conn)
static int be_host_handler(DBusMessage *message, struct sbus_connection *conn);
static int be_get_subdomains(DBusMessage *message, struct sbus_connection *conn);
-struct sbus_method be_methods[] = {
- { DP_METHOD_REGISTER, client_registration },
- { DP_METHOD_GETACCTINFO, be_get_account_info },
- { DP_METHOD_PAMHANDLER, be_pam_handler },
- { DP_METHOD_SUDOHANDLER, be_sudo_handler },
- { DP_METHOD_AUTOFSHANDLER, be_autofs_handler },
- { DP_METHOD_HOSTHANDLER, be_host_handler },
- { DP_METHOD_GETDOMAINS, be_get_subdomains },
- { NULL, NULL }
+struct data_provider_iface be_methods = {
+ { &data_provider_iface_meta, 0 },
+ .RegisterService = client_registration,
+ .pamHandler = be_pam_handler,
+ .sudoHandler = be_sudo_handler,
+ .autofsHandler = be_autofs_handler,
+ .hostHandler = be_host_handler,
+ .getDomains = be_get_subdomains,
+ .getAccountInfo = be_get_account_info,
};
struct sbus_interface be_interface = {
- DP_INTERFACE,
DP_PATH,
- SBUS_DEFAULT_VTABLE,
- be_methods,
+ &be_methods.vtable,
NULL
};