summaryrefslogtreecommitdiffstats
path: root/server/sbus/sssd_dbus.h
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2008-11-17 09:41:06 -0500
committerSimo Sorce <idra@samba.org>2008-11-17 10:02:34 -0500
commit977a6d0035dc1add3f490fcb31376271450ebfac (patch)
tree02d0eee222ce472f0ed71d29d68fb7129cb18976 /server/sbus/sssd_dbus.h
parent12136300b98a87169964dfe72adc442b6d91a47a (diff)
downloadsssd-977a6d0035dc1add3f490fcb31376271450ebfac.tar.gz
sssd-977a6d0035dc1add3f490fcb31376271450ebfac.tar.xz
sssd-977a6d0035dc1add3f490fcb31376271450ebfac.zip
The default message handler will now pass both the method_ctx and the
sbus_conn_ctx to all message handling functions. This will allow connection-specific data to be passed in by taking advantage of the sbus_conn_set_private_data() function on the sbus_conn_ctx struct. Presently this private data is global to all methods of the connection context.
Diffstat (limited to 'server/sbus/sssd_dbus.h')
-rw-r--r--server/sbus/sssd_dbus.h18
1 files changed, 11 insertions, 7 deletions
diff --git a/server/sbus/sssd_dbus.h b/server/sbus/sssd_dbus.h
index 5510b6e4a..321bd603e 100644
--- a/server/sbus/sssd_dbus.h
+++ b/server/sbus/sssd_dbus.h
@@ -52,19 +52,17 @@ struct sbus_method {
struct sbus_method_ctx {
struct sbus_method_ctx *prev, *next;
- /*struct event_context *ev;*/
char *interface;
char *path;
-
- /* If a non-default message_handler is desired, set it in this
- * object before calling sbus_conn_add_method_ctx()
- * Otherwise it will default to message_handler() in
- * sssd_dbus_connection.c
- */
DBusObjectPathMessageFunction message_handler;
struct sbus_method *methods;
};
+struct sbus_message_handler_ctx {
+ struct sbus_conn_ctx *conn_ctx;
+ struct sbus_method_ctx *method_ctx;
+};
+
/* Server Functions */
int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx,
const char *address,
@@ -87,4 +85,10 @@ void sbus_conn_set_private_data(struct sbus_conn_ctx *conn_ctx, void *pvt_data);
int sbus_conn_add_method_ctx(struct sbus_conn_ctx *conn_ctx,
struct sbus_method_ctx *method_ctx);
+/* Default message handler
+ * Should be usable for most cases */
+DBusHandlerResult sbus_message_handler(DBusConnection *conn,
+ DBusMessage *message,
+ void *user_data);
+
#endif /* _SSSD_DBUS_H_*/