sssd_dbus.h revision c4545b1e910857bc0dae7ce2ed6291d8bd1fc4f2
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync SSSD - D-BUS interface
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync Copyright (C) Stephen Gallagher 2008
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync This program is free software; you can redistribute it and/or modify
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync it under the terms of the GNU General Public License as published by
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync the Free Software Foundation; either version 3 of the License, or
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync (at your option) any later version.
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync This program is distributed in the hope that it will be useful,
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync but WITHOUT ANY WARRANTY; without even the implied warranty of
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync GNU General Public License for more details.
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync You should have received a copy of the GNU General Public License
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsync along with this program. If not, see <http://www.gnu.org/licenses/>.
a9b62afc62b28da7a1a77f34259f8013892d9664vboxsynctypedef int (*sbus_msg_handler_fn)(DBusMessage *, struct sbus_connection *);
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * sbus_conn_destructor_fn
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync * Function to be called when a connection is finalized
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsynctypedef int (*sbus_conn_destructor_fn)(void *);
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsynctypedef void (*sbus_conn_reconn_callback_fn)(struct sbus_connection *, int, void *);
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync * sbus_server_conn_init_fn
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync * Set up function for connection-specific activities
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * This function should define the sbus_conn_destructor_fn
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * for this connection at a minimum
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsynctypedef int (*sbus_server_conn_init_fn)(struct sbus_connection *, void *);
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync/* Special interface and method for D-BUS introspection */
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync#define DBUS_INTROSPECT_INTERFACE "org.freedesktop.DBus.Introspectable"
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync#define SBUS_DEFAULT_VTABLE { NULL, sbus_message_handler, NULL, NULL, NULL, NULL }
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync const char *method;
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync const char *path;
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync/* Server Functions */
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync const char *address,
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync sbus_server_conn_init_fn init_fn, void *init_pvt_data);
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync/* Connection Functions */
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync/* sbus_new_connection
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync * Use this function when connecting a new process to
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * the standard SSSD interface.
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync * This will connect to the address specified and then
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync * call sbus_add_connection to integrate with the main
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync const char *address,
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync/* sbus_add_connection
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * Integrates a D-BUS connection with the TEvent main
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * loop. Use this function when you already have a
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * DBusConnection object (for example from dbus_bus_get)
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * Connection type can be either:
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * SBUS_CONN_TYPE_PRIVATE: Used only from within a D-BUS
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * server such as the Monitor in the
3b0af6c6de3509194973be62078331fc930175f7vboxsync * new_connection_callback
3b0af6c6de3509194973be62078331fc930175f7vboxsync * SBUS_CONN_TYPE_SHARED: Used for all D-BUS client
3b0af6c6de3509194973be62078331fc930175f7vboxsync * connections, including those retrieved from
3b0af6c6de3509194973be62078331fc930175f7vboxsync * dbus_bus_get
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncvoid sbus_conn_set_destructor(struct sbus_connection *conn,
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncDBusConnection *sbus_get_connection(struct sbus_connection *conn);
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncvoid sbus_conn_set_private_data(struct sbus_connection *conn, void *pvt_data);
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncvoid *sbus_conn_get_private_data(struct sbus_connection *conn);
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncint sbus_conn_add_interface(struct sbus_connection *conn,
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncbool sbus_conn_disconnecting(struct sbus_connection *conn);
cdaeb34871aa28b96c0d80b474f3c8f9805d0388vboxsync/* max_retries < 0: retry forever
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * max_retries = 0: never retry (why are you calling this function?)
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * max_retries > 0: obvious
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncvoid sbus_reconnect_init(struct sbus_connection *conn,
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync/* Default message handler
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * Should be usable for most cases */
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncDBusHandlerResult sbus_message_handler(DBusConnection *conn,
3b0af6c6de3509194973be62078331fc930175f7vboxsync * Send a message across the SBUS
3b0af6c6de3509194973be62078331fc930175f7vboxsync * If requested, the DBusPendingCall object will
3b0af6c6de3509194973be62078331fc930175f7vboxsync * be returned to the caller.
3b0af6c6de3509194973be62078331fc930175f7vboxsync * This function will return EAGAIN in the event
3b0af6c6de3509194973be62078331fc930175f7vboxsync * that the connection is not open for
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync * communication.
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsyncvoid sbus_conn_send_reply(struct sbus_connection *conn,
3c4dd6a990d38eba0aad586bb42f72d2b10b682avboxsync#endif /* _SSSD_DBUS_H_*/