summaryrefslogtreecommitdiff
path: root/server/dbus/sssd_dbus.h
diff options
context:
space:
mode:
authorSimo Sorce <ssorce@redhat.com>2008-10-24 19:09:44 +0200
committerSimo Sorce <idra@samba.org>2008-10-27 10:02:38 -0400
commit6fe2bfce9fb9bb1564be8257cccc52bcec589de4 (patch)
tree1b9e603f7b08f8697b443e94a0e358b4fb00f07c /server/dbus/sssd_dbus.h
parent054a931b01f98cf94b42f1ff1f48fbcb4928c869 (diff)
downloadsssd-6fe2bfce9fb9bb1564be8257cccc52bcec589de4.tar.gz
sssd-6fe2bfce9fb9bb1564be8257cccc52bcec589de4.tar.bz2
sssd-6fe2bfce9fb9bb1564be8257cccc52bcec589de4.zip
D-BUS integration style changes.
Rework interfaces a bit to simplify and uniform function names so that they use a well defined namespace (sssd_*). Simplify headers file, split them into a private and a public one only. Make static all file private functions. Rename sssd_dbus_client.c to sssd_dbus_connection.c to reflect it's function, as it is is used by both a server and a client. Introduce a function table to know where to dipatch messages. Fix coding style issues, and start pointing out where clean-up fucntions are missing.
Diffstat (limited to 'server/dbus/sssd_dbus.h')
-rw-r--r--server/dbus/sssd_dbus.h48
1 files changed, 48 insertions, 0 deletions
diff --git a/server/dbus/sssd_dbus.h b/server/dbus/sssd_dbus.h
new file mode 100644
index 00000000..00a665bc
--- /dev/null
+++ b/server/dbus/sssd_dbus.h
@@ -0,0 +1,48 @@
+/*
+ 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_
+
+typedef int (*sssd_dbus_msg_handler_fn)(DBusMessage *msg, void *data,
+ DBusMessage **reply);
+
+struct sssd_dbus_method {
+ const char *method;
+ sssd_dbus_msg_handler_fn fn;
+};
+
+struct sssd_dbus_ctx {
+ struct event_context *ev;
+ char *name;
+ char *path;
+ struct sssd_dbus_method *methods;
+};
+
+/* Server Functions */
+int sssd_new_dbus_server(struct sssd_dbus_ctx *ctx, const char *address);
+
+/* Connection Functions */
+int sssd_new_dbus_connection(struct sssd_dbus_ctx *ctx, const char *address,
+ DBusConnection **connection);
+
+
+#endif /* _SSSD_DBUS_H_*/