25#ifndef DBUS_CONNECTION_INTERNAL_H
26#define DBUS_CONNECTION_INTERNAL_H
28#include <dbus/dbus-internals.h>
29#include <dbus/dbus-connection.h>
30#include <dbus/dbus-credentials.h>
31#include <dbus/dbus-message.h>
32#include <dbus/dbus-transport.h>
33#include <dbus/dbus-resources.h>
34#include <dbus/dbus-list.h>
35#include <dbus/dbus-timeout.h>
36#include <dbus/dbus-dataslot.h>
42 DBUS_ITERATION_DO_WRITING = 1 << 0,
43 DBUS_ITERATION_DO_READING = 1 << 1,
44 DBUS_ITERATION_BLOCK = 1 << 2
48#define _DBUS_DEFAULT_TIMEOUT_VALUE (25 * 1000)
50typedef void (* DBusPendingFdsChangeFunction) (
void *data);
76 unsigned int condition,
89 int timeout_milliseconds);
94 int timeout_milliseconds,
104 dbus_uint32_t *client_serial);
119 DBusPendingFdsChangeFunction callback,
123dbus_bool_t _dbus_connection_get_linux_security_label (
DBusConnection *connection,
131 dbus_uint32_t *in_messages,
132 dbus_uint32_t *in_bytes,
133 dbus_uint32_t *in_fds,
134 dbus_uint32_t *in_peak_bytes,
135 dbus_uint32_t *in_peak_fds,
136 dbus_uint32_t *out_messages,
137 dbus_uint32_t *out_bytes,
138 dbus_uint32_t *out_fds,
139 dbus_uint32_t *out_peak_bytes,
140 dbus_uint32_t *out_peak_fds);
143DBUS_EMBEDDED_TESTS_EXPORT
144const char* _dbus_connection_get_address (
DBusConnection *connection);
void _dbus_bus_notify_shared_connection_disconnected_unlocked(DBusConnection *connection)
Internal function that checks to see if this is a shared connection owned by the bus and if it is unr...
dbus_bool_t _dbus_connection_handle_watch(DBusWatch *watch, unsigned int condition, void *data)
A callback for use with dbus_watch_new() to create a DBusWatch.
void _dbus_connection_toggle_timeout_unlocked(DBusConnection *connection, DBusTimeout *timeout, dbus_bool_t enabled)
Toggles a timeout and notifies app via connection's DBusTimeoutToggledFunction if available.
void _dbus_connection_do_iteration_unlocked(DBusConnection *connection, DBusPendingCall *pending, unsigned int flags, int timeout_milliseconds)
Queues incoming messages and sends outgoing messages for this connection, optionally blocking in the ...
dbus_bool_t _dbus_connection_send_and_unlock(DBusConnection *connection, DBusMessage *message, dbus_uint32_t *client_serial)
Like dbus_connection_send(), but assumes the connection is already locked on function entry,...
DBusConnection * _dbus_connection_new_for_transport(DBusTransport *transport)
Creates a new connection for the given transport.
dbus_bool_t _dbus_connection_has_messages_to_send_unlocked(DBusConnection *connection)
Checks whether there are messages in the outgoing message queue.
DBUS_PRIVATE_EXPORT void _dbus_connection_unlock(DBusConnection *connection)
Releases the connection lock.
DBUS_PRIVATE_EXPORT void _dbus_connection_lock(DBusConnection *connection)
Acquires the connection lock.
void _dbus_connection_remove_watch_unlocked(DBusConnection *connection, DBusWatch *watch)
Removes a watch using the connection's DBusRemoveWatchFunction if available.
dbus_bool_t _dbus_connection_add_timeout_unlocked(DBusConnection *connection, DBusTimeout *timeout)
Adds a timeout using the connection's DBusAddTimeoutFunction if available.
void _dbus_connection_toggle_watch_unlocked(DBusConnection *connection, DBusWatch *watch, dbus_bool_t enabled)
Toggles a watch and notifies app via connection's DBusWatchToggledFunction if available.
dbus_bool_t _dbus_connection_add_watch_unlocked(DBusConnection *connection, DBusWatch *watch)
Adds a watch using the connection's DBusAddWatchFunction if available.
void _dbus_connection_remove_pending_call(DBusConnection *connection, DBusPendingCall *pending)
Removes a pending call from the connection, such that the pending reply will be ignored.
void _dbus_connection_close_if_only_one_ref(DBusConnection *connection)
Used internally to handle the semantics of dbus_server_set_new_connection_function().
DBUS_PRIVATE_EXPORT void _dbus_connection_unref_unlocked(DBusConnection *connection)
Decrements the reference count of a DBusConnection.
DBusMessage * _dbus_connection_get_message_to_send(DBusConnection *connection)
Gets the next outgoing message.
void _dbus_connection_message_sent_unlocked(DBusConnection *connection, DBusMessage *message)
Notifies the connection that a message has been sent, so the message can be removed from the outgoing...
void _dbus_connection_remove_timeout_unlocked(DBusConnection *connection, DBusTimeout *timeout)
Removes a timeout using the connection's DBusRemoveTimeoutFunction if available.
DBUS_PRIVATE_EXPORT dbus_uint32_t _dbus_connection_get_next_client_serial(DBusConnection *connection)
Allocate and return the next non-zero serial number for outgoing messages.
void _dbus_connection_queue_received_message_link(DBusConnection *connection, DBusList *link)
Adds a message-containing list link to the incoming message queue, taking ownership of the link and t...
DBUS_PRIVATE_EXPORT int _dbus_connection_get_pending_fds_count(DBusConnection *connection)
Return how many file descriptors are pending in the loader.
DBUS_PRIVATE_EXPORT void _dbus_connection_set_pending_fds_function(DBusConnection *connection, DBusPendingFdsChangeFunction callback, void *data)
Register a function to be called whenever the number of pending file descriptors in the loader change...
void _dbus_connection_block_pending_call(DBusPendingCall *pending)
Blocks until a pending call times out or gets a reply.
void _dbus_connection_queue_synthesized_message_link(DBusConnection *connection, DBusList *link)
Adds a link + message to the incoming message queue.
void _dbus_connection_close_possibly_shared(DBusConnection *connection)
Closes a shared OR private connection, while dbus_connection_close() can only be used on private conn...
DBUS_PRIVATE_EXPORT DBusConnection * _dbus_connection_ref_unlocked(DBusConnection *connection)
Increments the reference count of a DBusConnection.
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.
struct DBusMutex DBusMutex
An opaque mutex type provided by the DBusThreadFunctions implementation installed by dbus_threads_ini...
dbus_bool_t(* DBusTimeoutHandler)(void *data)
function to run when the timeout is handled
Implementation details of DBusConnection.
Internals of DBusMessage.
Implementation details of DBusPendingCall - all fields are private.
Internals of DBusTimeout.
Object representing a transport such as a socket.
Implementation of DBusWatch.