diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2008-11-03 09:50:19 -0500 |
---|---|---|
committer | Simo Sorce <idra@samba.org> | 2008-11-03 10:12:29 -0500 |
commit | 73f7183c9d244e7cdbe5c7ec91677b64a5f08e8e (patch) | |
tree | 5c54276a07dd0e15f6438d9019d9e03619aa7a0f /server/sbus/sssd_dbus.h | |
parent | 8b8210c79b297b87e56d068e8839f7fe6755ab15 (diff) | |
download | sssd-73f7183c9d244e7cdbe5c7ec91677b64a5f08e8e.tar.gz sssd-73f7183c9d244e7cdbe5c7ec91677b64a5f08e8e.tar.bz2 sssd-73f7183c9d244e7cdbe5c7ec91677b64a5f08e8e.zip |
Renaming sssd/server/dbus to sssd/server/sbus. Making necessary changes to header includes and makefiles.
Diffstat (limited to 'server/sbus/sssd_dbus.h')
-rw-r--r-- | server/sbus/sssd_dbus.h | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/server/sbus/sssd_dbus.h b/server/sbus/sssd_dbus.h new file mode 100644 index 00000000..1bd062d4 --- /dev/null +++ b/server/sbus/sssd_dbus.h @@ -0,0 +1,86 @@ +/* + SSSD + + SSSD - D-BUS interface + + Copyright (C) Stephen Gallagher 2008 + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see <http://www.gnu.org/licenses/>. +*/ + +#ifndef _SSSD_DBUS_H_ +#define _SSSD_DBUS_H_ +struct sbus_conn_ctx; +typedef int (*sbus_msg_handler_fn)(DBusMessage *msg, void *data, + DBusMessage **reply); + +/* + * sbus_conn_destructor_fn + * Function to be called when a connection is finalized + */ +typedef int (*sbus_conn_destructor_fn)( + void *ctx); + +/* + * sbus_server_conn_init_fn + * Set up function for connection-specific activities + * This function should define the sbus_conn_destructor_fn + * for this connection at a minimum + */ +typedef int (*sbus_server_conn_init_fn)( + struct sbus_conn_ctx *dct_ctx); + +enum { + SBUS_CONN_TYPE_PRIVATE = 1, + SBUS_CONN_TYPE_SHARED +}; + +struct sbus_method { + const char *method; + sbus_msg_handler_fn fn; +}; + +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; +}; + +/* Server Functions */ +int sbus_new_server(struct event_context *ev, struct sbus_method_ctx *ctx, const char *address, sbus_server_conn_init_fn init_fn); + +/* Connection Functions */ +int sbus_new_connection(TALLOC_CTX *ctx, struct event_context *ev, const char *address, + struct sbus_conn_ctx **dct_ctx, + sbus_conn_destructor_fn destructor); + +void sbus_conn_set_destructor(struct sbus_conn_ctx *dct_ctx, + sbus_conn_destructor_fn destructor); +int sbus_default_connection_destructor(void *ctx); + +DBusConnection *sbus_get_connection(struct sbus_conn_ctx *dct_ctx); +void sbus_disconnect (struct sbus_conn_ctx *dct_ctx); +void sbus_conn_set_private_data(struct sbus_conn_ctx *dct_ctx, void *private); +int sbus_conn_add_method_ctx(struct sbus_conn_ctx *dct_ctx, struct sbus_method_ctx *method_ctx); + +#endif /* _SSSD_DBUS_H_*/ |