diff options
author | Pavel Březina <pbrezina@redhat.com> | 2014-12-10 19:24:58 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2015-01-23 21:29:17 +0100 |
commit | 9fa95168d80beba04b333b06edc492ecb8b085a1 (patch) | |
tree | 00071230415551a49b871f95a60f62ea392a8113 /src/sbus/sssd_dbus.h | |
parent | d6ddc35574ba897cf9b5de3350086d9d8604f06f (diff) | |
download | sssd-9fa95168d80beba04b333b06edc492ecb8b085a1.tar.gz sssd-9fa95168d80beba04b333b06edc492ecb8b085a1.tar.xz sssd-9fa95168d80beba04b333b06edc492ecb8b085a1.zip |
sbus: add new iface via sbus_conn_register_iface()
Rename sbus_conn_add_interface() to sbus_conn_register_iface()
and remove sbus_new_interface() calls since it is just one more
unnecessary call outside the sbus code.
The function sbus_new_interface() is made static and used
directly in sbus_conn_register_iface().
The name was chosen to better describe what the function is
doing. That it registers an interface on a given object path.
The same interface can be used with different paths so it is
not really about adding an interface.
Preparation for:
https://fedorahosted.org/sssd/ticket/2339
Reviewed-by: Jakub Hrozek <jhrozek@redhat.com>
Diffstat (limited to 'src/sbus/sssd_dbus.h')
-rw-r--r-- | src/sbus/sssd_dbus.h | 31 |
1 files changed, 14 insertions, 17 deletions
diff --git a/src/sbus/sssd_dbus.h b/src/sbus/sssd_dbus.h index 5b128eaed..7552fbcf1 100644 --- a/src/sbus/sssd_dbus.h +++ b/src/sbus/sssd_dbus.h @@ -113,21 +113,6 @@ struct sbus_interface { void *instance_data; }; -/* - * Creates a new struct sbus_interface instance to be exported by a DBus - * service. - * - * Pass the result to sbus_conn_add_interface(). The interface - * will be exported at @object_path. The method handlers are represented by - * @iface_vtable. @instance_data contains additional caller specific data - * which is made available to handlers. - */ -struct sbus_interface * -sbus_new_interface(TALLOC_CTX *mem_ctx, - const char *object_path, - struct sbus_vtable *iface_vtable, - void *instance_data); - /* Server Functions */ int sbus_new_server(TALLOC_CTX *mem_ctx, struct tevent_context *ev, @@ -170,9 +155,21 @@ int sbus_init_connection(TALLOC_CTX *ctx, struct sbus_connection **_conn); DBusConnection *sbus_get_connection(struct sbus_connection *conn); + void sbus_disconnect(struct sbus_connection *conn); -int sbus_conn_add_interface(struct sbus_connection *conn, - struct sbus_interface *intf); + +/* + * Register a new interface to be available at given object path. + * + * The interface will be exported at @object_path. The method handlers are + * represented by @iface_vtable. @pvt contains additional caller specific data + * which is made available to handlers. + */ +int sbus_conn_register_iface(struct sbus_connection *conn, + struct sbus_vtable *iface_vtable, + const char *object_path, + void *pvt); + bool sbus_conn_disconnecting(struct sbus_connection *conn); /* max_retries < 0: retry forever |