sss_sifp_dbus.h revision 931b39232b82be374256d8532d86903fe1d87bf2
2035N/A/*
2035N/A Authors:
2035N/A Pavel Březina <pbrezina@redhat.com>
2035N/A
2035N/A Copyright (C) 2014 Red Hat
2035N/A
2035N/A This program is free software; you can redistribute it and/or modify
2035N/A it under the terms of the GNU General Public License as published by
2035N/A the Free Software Foundation; either version 3 of the License, or
2035N/A (at your option) any later version.
2035N/A
2035N/A This program is distributed in the hope that it will be useful,
2035N/A but WITHOUT ANY WARRANTY; without even the implied warranty of
2035N/A MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2035N/A GNU General Public License for more details.
2035N/A
2035N/A You should have received a copy of the GNU General Public License
2035N/A along with this program. If not, see <http://www.gnu.org/licenses/>.
2035N/A*/
2035N/A
2899N/A#ifndef SSS_SIFP_DBUS_H_
2035N/A#define SSS_SIFP_DBUS_H_
2035N/A
2035N/A#include <sss_sifp.h>
2035N/A#include <dbus/dbus.h>
2035N/A
2035N/A/**
2035N/A * @defgroup sss_sifp_dbus Advanced InfoPipe method calls.
2035N/A *
2035N/A * Functions in this module provide a way to reuse sss_sifp connection
2035N/A * to the SSSD's InfoPipe responder.
2035N/A *
2035N/A * This allows the caller to send more sophisticated messages to the InfoPipe
2035N/A * and to use both sss_sifp and D-Bus without the need of maintaining two
2899N/A * separate D-Bus connections.
2899N/A *
2035N/A * However, these functions require the caller to understand the D-Bus
2035N/A * bindings from libdbus.
2035N/A *
2035N/A * @{
2035N/A */
2035N/A
2035N/A/**
2035N/A * @brief Create a new method call message for SSSD InfoPipe bus.
2035N/A *
2035N/A * @param[in] object_path D-Bus object path
2035N/A * @param[in] interface D-Bus interface
2035N/A * @param[in] method D-Bus method
2035N/A *
2035N/A * @return D-Bus message.
2035N/A */
2035N/ADBusMessage *
2035N/Asss_sifp_create_message(const char *object_path,
const char *interface,
const char *method);
/**
* @brief Send D-Bus message to SSSD InfoPipe bus with 5 seconds timeout.
*
* @param[in] ctx sss_sifp context
* @param[in] msg D-Bus message
* @param[in] _reply D-Bus reply, may be NULL if the caller is not interested
*
* @return D-Bus message.
*/
sss_sifp_error
sss_sifp_send_message(sss_sifp_ctx *ctx,
DBusMessage *msg,
DBusMessage **_reply);
/**
* @brief Send D-Bus message to SSSD InfoPipe bus.
*
* @param[in] ctx sss_sifp context
* @param[in] msg D-Bus message
* @param[in] timeout Timeout
* @param[in] _reply D-Bus reply, may be NULL if the caller is not interested
*
* @return D-Bus message.
*/
sss_sifp_error
sss_sifp_send_message_ex(sss_sifp_ctx *ctx,
DBusMessage *msg,
int timeout,
DBusMessage **_reply);
/**
* @brief List objects that satisfies given conditions. This routine will
* invoke List<method> D-Bus method on SSSD InfoPipe interface. Arguments
* to this method are given as standard variadic D-Bus arguments.
*
* @param[in] ctx sss_sifp context
* @param[in] method D-Bus method to call without the 'List' prefix
* @param[out] _object_paths List of object paths
* @param[in] first_arg_type Type of the first D-Bus argument
* @param[in] ... D-Bus arguments
*/
sss_sifp_error
sss_sifp_invoke_list(sss_sifp_ctx *ctx,
const char *method,
char ***_object_paths,
int first_arg_type,
...);
/**
* @brief Find single object that satisfies given conditions. This routine will
* invoke Find<method> D-Bus method on SSSD InfoPipe interface. Arguments
* to this method are given as standard variadic D-Bus arguments.
*
* @param[in] ctx sss_sifp context
* @param[in] method D-Bus method to call without the 'Find' prefix
* @param[out] _object_path Object path
* @param[in] first_arg_type Type of the first D-Bus argument
* @param[in] ... D-Bus arguments
*/
sss_sifp_error
sss_sifp_invoke_find(sss_sifp_ctx *ctx,
const char *method,
char **_object_path,
int first_arg_type,
...);
/**
* @}
*/
#endif /* SSS_SIFP_DBUS_H_ */