D-Bus: dbus-connection.h Source File

D-Bus 1.8.16

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List

dbus-connection.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-connection.h DBusConnection object
3 *
4 * Copyright (C) 2002, 2003 Red Hat Inc.
5 *
6 * Licensed under the Academic Free License version 2.1
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21 *
22 */
23 #if !defined (DBUS_INSIDE_DBUS_H) && !defined (DBUS_COMPILATION)
24 #error "Only <dbus/dbus.h> can be included directly, this file may disappear or change contents."
25 #endif
26
27 #ifndef DBUS_CONNECTION_H
28 #define DBUS_CONNECTION_H
29
30 #include <dbus/dbus-errors.h>
31 #include <dbus/dbus-memory.h>
32 #include <dbus/dbus-message.h>
33 #include <dbus/dbus-shared.h>
34
35 DBUS_BEGIN_DECLS
36
42 /* documented in dbus-watch.c */
43 typedef struct DBusWatch DBusWatch;
44 /* documented in dbus-timeout.c */
45 typedef struct DBusTimeout DBusTimeout;
47 typedef struct DBusPreallocatedSend DBusPreallocatedSend;
49 typedef struct DBusPendingCall DBusPendingCall;
51 typedef struct DBusConnection DBusConnection;
53 typedef struct DBusObjectPathVTable DBusObjectPathVTable;
54
58 typedef enum
59 {
60 DBUS_WATCH_READABLE = 1 << 0,
61 DBUS_WATCH_WRITABLE = 1 << 1,
62 DBUS_WATCH_ERROR = 1 << 2,
67 DBUS_WATCH_HANGUP = 1 << 3
72 /* Internal to libdbus, there is also _DBUS_WATCH_NVAL in dbus-watch.h */
73 } DBusWatchFlags;
74
79 typedef enum
80 {
81 DBUS_DISPATCH_DATA_REMAINS,
82 DBUS_DISPATCH_COMPLETE,
83 DBUS_DISPATCH_NEED_MEMORY
84 } DBusDispatchStatus;
85
91 typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch,
92 void *data);
97 typedef void (* DBusWatchToggledFunction) (DBusWatch *watch,
98 void *data);
103 typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch,
104 void *data);
110 typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout,
111 void *data);
117 typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout,
118 void *data);
123 typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout,
124 void *data);
128 typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection,
129 DBusDispatchStatus new_status,
130 void *data);
135 typedef void (* DBusWakeupMainFunction) (void *data);
136
143 typedef dbus_bool_t (* DBusAllowUnixUserFunction) (DBusConnection *connection,
144 unsigned long uid,
145 void *data);
146
153 typedef dbus_bool_t (* DBusAllowWindowsUserFunction) (DBusConnection *connection,
154 const char *user_sid,
155 void *data);
156
157
162 typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending,
163 void *user_data);
164
169 typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection,
170 DBusMessage *message,
171 void *user_data);
172 DBUS_EXPORT
173 DBusConnection* dbus_connection_open (const char *address,
174 DBusError *error);
175 DBUS_EXPORT
176 DBusConnection* dbus_connection_open_private (const char *address,
177 DBusError *error);
178 DBUS_EXPORT
179 DBusConnection* dbus_connection_ref (DBusConnection *connection);
180 DBUS_EXPORT
181 void dbus_connection_unref (DBusConnection *connection);
182 DBUS_EXPORT
183 void dbus_connection_close (DBusConnection *connection);
184 DBUS_EXPORT
185 dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection);
186 DBUS_EXPORT
187 dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection);
188 DBUS_EXPORT
189 dbus_bool_t dbus_connection_get_is_anonymous (DBusConnection *connection);
190 DBUS_EXPORT
191 char* dbus_connection_get_server_id (DBusConnection *connection);
192 DBUS_EXPORT
193 dbus_bool_t dbus_connection_can_send_type (DBusConnection *connection,
194 int type);
195
196 DBUS_EXPORT
197 void dbus_connection_set_exit_on_disconnect (DBusConnection *connection,
198 dbus_bool_t exit_on_disconnect);
199 DBUS_EXPORT
200 void dbus_connection_flush (DBusConnection *connection);
201 DBUS_EXPORT
202 dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection,
203 int timeout_milliseconds);
204 DBUS_EXPORT
205 dbus_bool_t dbus_connection_read_write (DBusConnection *connection,
206 int timeout_milliseconds);
207 DBUS_EXPORT
208 DBusMessage* dbus_connection_borrow_message (DBusConnection *connection);
209 DBUS_EXPORT
210 void dbus_connection_return_message (DBusConnection *connection,
211 DBusMessage *message);
212 DBUS_EXPORT
213 void dbus_connection_steal_borrowed_message (DBusConnection *connection,
214 DBusMessage *message);
215 DBUS_EXPORT
216 DBusMessage* dbus_connection_pop_message (DBusConnection *connection);
217 DBUS_EXPORT
218 DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection);
219 DBUS_EXPORT
220 DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection);
221 DBUS_EXPORT
222 dbus_bool_t dbus_connection_has_messages_to_send (DBusConnection *connection);
223 DBUS_EXPORT
224 dbus_bool_t dbus_connection_send (DBusConnection *connection,
225 DBusMessage *message,
226 dbus_uint32_t *client_serial);
227 DBUS_EXPORT
228 dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection,
229 DBusMessage *message,
230 DBusPendingCall **pending_return,
231 int timeout_milliseconds);
232 DBUS_EXPORT
233 DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection,
234 DBusMessage *message,
235 int timeout_milliseconds,
236 DBusError *error);
237 DBUS_EXPORT
238 dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection,
239 DBusAddWatchFunction add_function,
240 DBusRemoveWatchFunction remove_function,
241 DBusWatchToggledFunction toggled_function,
242 void *data,
243 DBusFreeFunction free_data_function);
244 DBUS_EXPORT
245 dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection,
246 DBusAddTimeoutFunction add_function,
247 DBusRemoveTimeoutFunction remove_function,
248 DBusTimeoutToggledFunction toggled_function,
249 void *data,
250 DBusFreeFunction free_data_function);
251 DBUS_EXPORT
252 void dbus_connection_set_wakeup_main_function (DBusConnection *connection,
253 DBusWakeupMainFunction wakeup_main_function,
254 void *data,
255 DBusFreeFunction free_data_function);
256 DBUS_EXPORT
257 void dbus_connection_set_dispatch_status_function (DBusConnection *connection,
258 DBusDispatchStatusFunction function,
259 void *data,
260 DBusFreeFunction free_data_function);
261 DBUS_EXPORT
262 dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection,
263 unsigned long *uid);
264 DBUS_EXPORT
265 dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection,
266 unsigned long *pid);
267 DBUS_EXPORT
268 dbus_bool_t dbus_connection_get_adt_audit_session_data (DBusConnection *connection,
269 void **data,
270 dbus_int32_t *data_size);
271 DBUS_EXPORT
272 void dbus_connection_set_unix_user_function (DBusConnection *connection,
273 DBusAllowUnixUserFunction function,
274 void *data,
275 DBusFreeFunction free_data_function);
276 DBUS_EXPORT
277 dbus_bool_t dbus_connection_get_windows_user (DBusConnection *connection,
278 char **windows_sid_p);
279 DBUS_EXPORT
280 void dbus_connection_set_windows_user_function (DBusConnection *connection,
281 DBusAllowWindowsUserFunction function,
282 void *data,
283 DBusFreeFunction free_data_function);
284 DBUS_EXPORT
285 void dbus_connection_set_allow_anonymous (DBusConnection *connection,
286 dbus_bool_t value);
287 DBUS_EXPORT
288 void dbus_connection_set_route_peer_messages (DBusConnection *connection,
289 dbus_bool_t value);
290
291
292 /* Filters */
293
294 DBUS_EXPORT
295 dbus_bool_t dbus_connection_add_filter (DBusConnection *connection,
296 DBusHandleMessageFunction function,
297 void *user_data,
298 DBusFreeFunction free_data_function);
299 DBUS_EXPORT
300 void dbus_connection_remove_filter (DBusConnection *connection,
301 DBusHandleMessageFunction function,
302 void *user_data);
303
304
305 /* Other */
306 DBUS_EXPORT
307 dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p);
308 DBUS_EXPORT
309 void dbus_connection_free_data_slot (dbus_int32_t *slot_p);
310 DBUS_EXPORT
311 dbus_bool_t dbus_connection_set_data (DBusConnection *connection,
312 dbus_int32_t slot,
313 void *data,
314 DBusFreeFunction free_data_func);
315 DBUS_EXPORT
316 void* dbus_connection_get_data (DBusConnection *connection,
317 dbus_int32_t slot);
318
319 DBUS_EXPORT
320 void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);
321
322 DBUS_EXPORT
323 void dbus_connection_set_max_message_size (DBusConnection *connection,
324 long size);
325 DBUS_EXPORT
326 long dbus_connection_get_max_message_size (DBusConnection *connection);
327 DBUS_EXPORT
328 void dbus_connection_set_max_received_size (DBusConnection *connection,
329 long size);
330 DBUS_EXPORT
331 long dbus_connection_get_max_received_size (DBusConnection *connection);
332
333 DBUS_EXPORT
334 void dbus_connection_set_max_message_unix_fds (DBusConnection *connection,
335 long n);
336 DBUS_EXPORT
337 long dbus_connection_get_max_message_unix_fds (DBusConnection *connection);
338 DBUS_EXPORT
339 void dbus_connection_set_max_received_unix_fds(DBusConnection *connection,
340 long n);
341 DBUS_EXPORT
342 long dbus_connection_get_max_received_unix_fds(DBusConnection *connection);
343
344 DBUS_EXPORT
345 long dbus_connection_get_outgoing_size (DBusConnection *connection);
346 DBUS_EXPORT
347 long dbus_connection_get_outgoing_unix_fds (DBusConnection *connection);
348
349 DBUS_EXPORT
350 DBusPreallocatedSend* dbus_connection_preallocate_send (DBusConnection *connection);
351 DBUS_EXPORT
352 void dbus_connection_free_preallocated_send (DBusConnection *connection,
353 DBusPreallocatedSend *preallocated);
354 DBUS_EXPORT
355 void dbus_connection_send_preallocated (DBusConnection *connection,
356 DBusPreallocatedSend *preallocated,
357 DBusMessage *message,
358 dbus_uint32_t *client_serial);
359
360
361 /* Object tree functionality */
362
367 typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection,
368 void *user_data);
374 typedef DBusHandlerResult (* DBusObjectPathMessageFunction) (DBusConnection *connection,
375 DBusMessage *message,
376 void *user_data);
377
384 struct DBusObjectPathVTable
385 {
386 DBusObjectPathUnregisterFunction unregister_function;
387 DBusObjectPathMessageFunction message_function;
389 void (* dbus_internal_pad1) (void *);
390 void (* dbus_internal_pad2) (void *);
391 void (* dbus_internal_pad3) (void *);
392 void (* dbus_internal_pad4) (void *);
393 };
394
395 DBUS_EXPORT
396 dbus_bool_t dbus_connection_try_register_object_path (DBusConnection *connection,
397 const char *path,
398 const DBusObjectPathVTable *vtable,
399 void *user_data,
400 DBusError *error);
401
402 DBUS_EXPORT
403 dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection,
404 const char *path,
405 const DBusObjectPathVTable *vtable,
406 void *user_data);
407
408 DBUS_EXPORT
409 dbus_bool_t dbus_connection_try_register_fallback (DBusConnection *connection,
410 const char *path,
411 const DBusObjectPathVTable *vtable,
412 void *user_data,
413 DBusError *error);
414
415 DBUS_EXPORT
416 dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection,
417 const char *path,
418 const DBusObjectPathVTable *vtable,
419 void *user_data);
420 DBUS_EXPORT
421 dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection,
422 const char *path);
423
424 DBUS_EXPORT
425 dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection,
426 const char *path,
427 void **data_p);
428
429 DBUS_EXPORT
430 dbus_bool_t dbus_connection_list_registered (DBusConnection *connection,
431 const char *parent_path,
432 char ***child_entries);
433
434 DBUS_EXPORT
435 dbus_bool_t dbus_connection_get_unix_fd (DBusConnection *connection,
436 int *fd);
437 DBUS_EXPORT
438 dbus_bool_t dbus_connection_get_socket (DBusConnection *connection,
439 int *fd);
440
449 #ifndef DBUS_DISABLE_DEPRECATED
450 DBUS_EXPORT
451 DBUS_DEPRECATED int dbus_watch_get_fd (DBusWatch *watch);
452 #endif
453
454 DBUS_EXPORT
455 int dbus_watch_get_unix_fd (DBusWatch *watch);
456 DBUS_EXPORT
457 int dbus_watch_get_socket (DBusWatch *watch);
458 DBUS_EXPORT
459 unsigned int dbus_watch_get_flags (DBusWatch *watch);
460 DBUS_EXPORT
461 void* dbus_watch_get_data (DBusWatch *watch);
462 DBUS_EXPORT
463 void dbus_watch_set_data (DBusWatch *watch,
464 void *data,
465 DBusFreeFunction free_data_function);
466 DBUS_EXPORT
467 dbus_bool_t dbus_watch_handle (DBusWatch *watch,
468 unsigned int flags);
469 DBUS_EXPORT
470 dbus_bool_t dbus_watch_get_enabled (DBusWatch *watch);
471
479 DBUS_EXPORT
480 int dbus_timeout_get_interval (DBusTimeout *timeout);
481 DBUS_EXPORT
482 void* dbus_timeout_get_data (DBusTimeout *timeout);
483 DBUS_EXPORT
484 void dbus_timeout_set_data (DBusTimeout *timeout,
485 void *data,
486 DBusFreeFunction free_data_function);
487 DBUS_EXPORT
488 dbus_bool_t dbus_timeout_handle (DBusTimeout *timeout);
489 DBUS_EXPORT
490 dbus_bool_t dbus_timeout_get_enabled (DBusTimeout *timeout);
491
494 DBUS_END_DECLS
495
496 #endif /* DBUS_CONNECTION_H */
DBusObjectPathVTable::dbus_internal_pad2
void(* dbus_internal_pad2)(void *)
Reserved for future expansion.
Definition: dbus-connection.h:390
DBusWatchFlags
DBusWatchFlags
Indicates the status of a DBusWatch.
Definition: dbus-connection.h:58
dbus_connection_set_change_sigpipe
void dbus_connection_set_change_sigpipe(dbus_bool_t will_modify_sigpipe)
This function sets a global flag for whether dbus_connection_new() will set SIGPIPE behavior to SIG_I...
Definition: dbus-connection.c:6043
DBusTimeout
Internals of DBusTimeout.
Definition: dbus-timeout.c:40
DBusDispatchStatus
DBusDispatchStatus
Indicates the status of incoming data on a DBusConnection.
Definition: dbus-connection.h:79
DBusWatch
Implementation of DBusWatch.
Definition: dbus-watch.c:40
DBusFreeFunction
void(* DBusFreeFunction)(void *memory)
The type of a function which frees a block of memory.
Definition: dbus-memory.h:64
DBUS_DEPRECATED
#define DBUS_DEPRECATED
Tells the compiler to warn about a function or type if it's used.
DBUS_DISPATCH_NEED_MEMORY
More memory is needed to continue.
Definition: dbus-connection.h:83
DBUS_BEGIN_DECLS
#define DBUS_BEGIN_DECLS
Macro used prior to declaring functions in the D-Bus header files.
DBusPendingCallNotifyFunction
void(* DBusPendingCallNotifyFunction)(DBusPendingCall *pending, void *user_data)
Called when a pending call now has a reply available.
Definition: dbus-connection.h:162
dbus_connection_set_windows_user_function
void dbus_connection_set_windows_user_function(DBusConnection *connection, DBusAllowWindowsUserFunction function, void *data, DBusFreeFunction free_data_function)
Sets a predicate function used to determine whether a given user ID is allowed to connect...
Definition: dbus-connection.c:5404
dbus_connection_get_windows_user
dbus_bool_t dbus_connection_get_windows_user(DBusConnection *connection, char **windows_sid_p)
Gets the Windows user SID of the connection if known.
Definition: dbus-connection.c:5357
DBusWatchToggledFunction
void(* DBusWatchToggledFunction)(DBusWatch *watch, void *data)
Called when dbus_watch_get_enabled() may return a different value than it did before.
Definition: dbus-connection.h:97
dbus_connection_set_max_message_size
void dbus_connection_set_max_message_size(DBusConnection *connection, long size)
Specifies the maximum size message this connection is allowed to receive.
Definition: dbus-connection.c:6057
dbus_connection_try_register_fallback
dbus_bool_t dbus_connection_try_register_fallback(DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data, DBusError *error)
Registers a fallback handler for a given subsection of the object hierarchy.
Definition: dbus-connection.c:5742
dbus_watch_get_enabled
DBUS_EXPORT dbus_bool_t dbus_watch_get_enabled(DBusWatch *watch)
Returns whether a watch is enabled or not.
Definition: dbus-watch.c:667
dbus_connection_get_outgoing_size
long dbus_connection_get_outgoing_size(DBusConnection *connection)
Gets the approximate size in bytes of all messages in the outgoing message queue. ...
Definition: dbus-connection.c:6235
dbus_connection_ref
DBusConnection * dbus_connection_ref(DBusConnection *connection)
Increments the reference count of a DBusConnection.
Definition: dbus-connection.c:2681
dbus_connection_can_send_type
dbus_bool_t dbus_connection_can_send_type(DBusConnection *connection, int type)
Tests whether a certain type can be send via the connection.
Definition: dbus-connection.c:3105
dbus_connection_read_write
dbus_bool_t dbus_connection_read_write(DBusConnection *connection, int timeout_milliseconds)
This function is intended for use with applications that don't want to write a main loop and deal wit...
Definition: dbus-connection.c:3801
dbus_connection_set_dispatch_status_function
void dbus_connection_set_dispatch_status_function(DBusConnection *connection, DBusDispatchStatusFunction function, void *data, DBusFreeFunction free_data_function)
Set a function to be invoked when the dispatch status changes.
Definition: dbus-connection.c:5073
dbus_connection_set_data
dbus_bool_t dbus_connection_set_data(DBusConnection *connection, dbus_int32_t slot, void *data, DBusFreeFunction free_data_func)
Stores a pointer on a DBusConnection, along with an optional function to be used for freeing the data...
Definition: dbus-connection.c:5968
dbus_connection_set_route_peer_messages
void dbus_connection_set_route_peer_messages(DBusConnection *connection, dbus_bool_t value)
Normally DBusConnection automatically handles all messages to the org.freedesktop.DBus.Peer interface.
Definition: dbus-connection.c:5479
dbus_connection_return_message
void dbus_connection_return_message(DBusConnection *connection, DBusMessage *message)
Used to return a message after peeking at it using dbus_connection_borrow_message().
Definition: dbus-connection.c:3901
DBusPendingCall
Implementation details of DBusPendingCall - all fields are private.
Definition: dbus-pending-call.c:62
dbus_connection_set_timeout_functions
dbus_bool_t dbus_connection_set_timeout_functions(DBusConnection *connection, DBusAddTimeoutFunction add_function, DBusRemoveTimeoutFunction remove_function, DBusTimeoutToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)
Sets the timeout functions for the connection.
Definition: dbus-connection.c:4989
DBusConnection
Implementation details of DBusConnection.
Definition: dbus-connection.c:256
dbus_connection_remove_filter
void dbus_connection_remove_filter(DBusConnection *connection, DBusHandleMessageFunction function, void *user_data)
Removes a previously-added message filter.
Definition: dbus-connection.c:5563
DBusObjectPathVTable::dbus_internal_pad4
void(* dbus_internal_pad4)(void *)
Reserved for future expansion.
Definition: dbus-connection.h:392
dbus_connection_get_unix_user
dbus_bool_t dbus_connection_get_unix_user(DBusConnection *connection, unsigned long *uid)
Gets the UNIX user ID of the connection if known.
Definition: dbus-connection.c:5190
dbus_connection_list_registered
dbus_bool_t dbus_connection_list_registered(DBusConnection *connection, const char *parent_path, char ***child_entries)
Lists the registered fallback handlers and object path handlers at the given parent_path.
Definition: dbus-connection.c:5878
dbus_connection_has_messages_to_send
DBUS_EXPORT dbus_bool_t dbus_connection_has_messages_to_send(DBusConnection *connection)
Checks whether there are messages in the outgoing message queue.
Definition: dbus-connection.c:588
dbus_connection_set_max_received_size
void dbus_connection_set_max_received_size(DBusConnection *connection, long size)
Sets the maximum total number of bytes that can be used for all messages received on this connection...
Definition: dbus-connection.c:6152
DBusHandlerResult
DBusHandlerResult
Results that a message handler can return.
Definition: dbus-shared.h:66
dbus_connection_steal_borrowed_message
void dbus_connection_steal_borrowed_message(DBusConnection *connection, DBusMessage *message)
Used to keep a message after peeking at it using dbus_connection_borrow_message().
Definition: dbus-connection.c:3935
dbus_connection_free_data_slot
void dbus_connection_free_data_slot(dbus_int32_t *slot_p)
Deallocates a global ID for connection data slots.
Definition: dbus-connection.c:5938
DBusRemoveTimeoutFunction
void(* DBusRemoveTimeoutFunction)(DBusTimeout *timeout, void *data)
Called when libdbus no longer needs a timeout to be monitored by the main loop.
Definition: dbus-connection.h:123
DBUS_DISPATCH_DATA_REMAINS
There is more data to potentially convert to messages.
Definition: dbus-connection.h:81
dbus_timeout_get_enabled
DBUS_EXPORT dbus_bool_t dbus_timeout_get_enabled(DBusTimeout *timeout)
Returns whether a timeout is enabled or not.
Definition: dbus-timeout.c:486
dbus_connection_send_with_reply_and_block
DBusMessage * dbus_connection_send_with_reply_and_block(DBusConnection *connection, DBusMessage *message, int timeout_milliseconds, DBusError *error)
Sends a message and blocks a certain time period while waiting for a reply.
Definition: dbus-connection.c:3535
dbus_connection_open_private
DBusConnection * dbus_connection_open_private(const char *address, DBusError *error)
Opens a new, dedicated connection to a remote address.
Definition: dbus-connection.c:2659
dbus_connection_preallocate_send
DBusPreallocatedSend * dbus_connection_preallocate_send(DBusConnection *connection)
Preallocates resources needed to send a message, allowing the message to be sent without the possibil...
Definition: dbus-connection.c:3165
DBusObjectPathVTable
Virtual table that must be implemented to handle a portion of the object path hierarchy.
Definition: dbus-connection.h:384
DBusMessage
Internals of DBusMessage.
Definition: dbus-message-private.h:99
DBusObjectPathUnregisterFunction
void(* DBusObjectPathUnregisterFunction)(DBusConnection *connection, void *user_data)
Called when a DBusObjectPathVTable is unregistered (or its connection is freed).
Definition: dbus-connection.h:367
DBusObjectPathVTable::unregister_function
DBusObjectPathUnregisterFunction unregister_function
Function to unregister this handler.
Definition: dbus-connection.h:386
DBUS_WATCH_WRITABLE
As in POLLOUT.
Definition: dbus-connection.h:61
dbus_bool_t
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Definition: dbus-types.h:35
dbus_watch_get_socket
DBUS_EXPORT int dbus_watch_get_socket(DBusWatch *watch)
Returns a socket to be watched, on UNIX this will return -1 if our transport is not socket-based so d...
Definition: dbus-watch.c:586
dbus_connection_set_exit_on_disconnect
void dbus_connection_set_exit_on_disconnect(DBusConnection *connection, dbus_bool_t exit_on_disconnect)
Set whether _exit() should be called when the connection receives a disconnect signal.
Definition: dbus-connection.c:3145
dbus_timeout_handle
DBUS_EXPORT dbus_bool_t dbus_timeout_handle(DBusTimeout *timeout)
Calls the timeout handler for this timeout.
Definition: dbus-timeout.c:472
dbus_connection_dispatch
DBusDispatchStatus dbus_connection_dispatch(DBusConnection *connection)
Processes any incoming data.
Definition: dbus-connection.c:4549
dbus_connection_send
dbus_bool_t dbus_connection_send(DBusConnection *connection, DBusMessage *message, dbus_uint32_t *serial)
Adds a message to the outgoing message queue.
Definition: dbus-connection.c:3302
dbus_connection_get_dispatch_status
DBusDispatchStatus dbus_connection_get_dispatch_status(DBusConnection *connection)
Gets the current state of the incoming message queue.
Definition: dbus-connection.c:4378
DBUS_DISPATCH_COMPLETE
All currently available data has been processed.
Definition: dbus-connection.h:82
DBusAddTimeoutFunction
dbus_bool_t(* DBusAddTimeoutFunction)(DBusTimeout *timeout, void *data)
Called when libdbus needs a new timeout to be monitored by the main loop.
Definition: dbus-connection.h:110
dbus_connection_get_data
void * dbus_connection_get_data(DBusConnection *connection, dbus_int32_t slot)
Retrieves data previously set with dbus_connection_set_data().
Definition: dbus-connection.c:6017
dbus_connection_get_max_message_size
long dbus_connection_get_max_message_size(DBusConnection *connection)
Gets the value set by dbus_connection_set_max_message_size().
Definition: dbus-connection.c:6075
dbus_connection_get_unix_process_id
dbus_bool_t dbus_connection_get_unix_process_id(DBusConnection *connection, unsigned long *pid)
Gets the process ID of the connection if any.
Definition: dbus-connection.c:5226
dbus_connection_get_is_authenticated
dbus_bool_t dbus_connection_get_is_authenticated(DBusConnection *connection)
Gets whether the connection was authenticated.
Definition: dbus-connection.c:2995
dbus_connection_close
void dbus_connection_close(DBusConnection *connection)
Closes a private connection, so no further data can be sent or received.
Definition: dbus-connection.c:2932
dbus_connection_allocate_data_slot
dbus_bool_t dbus_connection_allocate_data_slot(dbus_int32_t *slot_p)
Allocates an integer ID to be used for storing application-specific data on any DBusConnection.
Definition: dbus-connection.c:5920
DBusAllowUnixUserFunction
dbus_bool_t(* DBusAllowUnixUserFunction)(DBusConnection *connection, unsigned long uid, void *data)
Called during authentication to check whether the given UNIX user ID is allowed to connect...
Definition: dbus-connection.h:143
DBusWakeupMainFunction
void(* DBusWakeupMainFunction)(void *data)
Called when the main loop's thread should be notified that there's now work to do.
Definition: dbus-connection.h:135
dbus_connection_register_object_path
dbus_bool_t dbus_connection_register_object_path(DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data)
Registers a handler for a given path in the object hierarchy.
Definition: dbus-connection.c:5702
dbus_connection_set_max_message_unix_fds
void dbus_connection_set_max_message_unix_fds(DBusConnection *connection, long n)
Specifies the maximum number of unix fds a message on this connection is allowed to receive...
Definition: dbus-connection.c:6096
dbus_connection_get_outgoing_unix_fds
long dbus_connection_get_outgoing_unix_fds(DBusConnection *connection)
Gets the approximate number of uni fds of all messages in the outgoing message queue.
Definition: dbus-connection.c:6296
dbus_connection_get_max_received_size
long dbus_connection_get_max_received_size(DBusConnection *connection)
Gets the value set by dbus_connection_set_max_received_size().
Definition: dbus-connection.c:6170
dbus_connection_open
DBusConnection * dbus_connection_open(const char *address, DBusError *error)
Gets a connection to a remote address.
Definition: dbus-connection.c:2616
dbus_connection_send_with_reply
dbus_bool_t dbus_connection_send_with_reply(DBusConnection *connection, DBusMessage *message, DBusPendingCall **pending_return, int timeout_milliseconds)
Queues a message to send, as with dbus_connection_send(), but also returns a DBusPendingCall used to ...
Definition: dbus-connection.c:3399
DBusError
Object representing an exception.
Definition: dbus-errors.h:48
dbus_connection_get_object_path_data
dbus_bool_t dbus_connection_get_object_path_data(DBusConnection *connection, const char *path, void **data_p)
Gets the user data passed to dbus_connection_register_object_path() or dbus_connection_register_fallb...
Definition: dbus-connection.c:5841
dbus_connection_get_is_anonymous
dbus_bool_t dbus_connection_get_is_anonymous(DBusConnection *connection)
Gets whether the connection is not authenticated as a specific user.
Definition: dbus-connection.c:3029
DBusObjectPathVTable::message_function
DBusObjectPathMessageFunction message_function
Function to handle messages.
Definition: dbus-connection.h:387
dbus_connection_get_max_message_unix_fds
long dbus_connection_get_max_message_unix_fds(DBusConnection *connection)
Gets the value set by dbus_connection_set_max_message_unix_fds().
Definition: dbus-connection.c:6114
DBusAllowWindowsUserFunction
dbus_bool_t(* DBusAllowWindowsUserFunction)(DBusConnection *connection, const char *user_sid, void *data)
Called during authentication to check whether the given Windows user ID is allowed to connect...
Definition: dbus-connection.h:153
DBUS_WATCH_ERROR
As in POLLERR (can't watch for this, but can be present in current state passed to dbus_watch_handle(...
Definition: dbus-connection.h:62
dbus_watch_get_unix_fd
DBUS_EXPORT int dbus_watch_get_unix_fd(DBusWatch *watch)
Returns a UNIX file descriptor to be watched, which may be a pipe, socket, or other type of descripto...
Definition: dbus-watch.c:557
dbus_connection_set_allow_anonymous
void dbus_connection_set_allow_anonymous(DBusConnection *connection, dbus_bool_t value)
This function must be called on the server side of a connection when the connection is first seen in ...
Definition: dbus-connection.c:5451
DBusTimeoutToggledFunction
void(* DBusTimeoutToggledFunction)(DBusTimeout *timeout, void *data)
Called when dbus_timeout_get_enabled() may return a different value than it did before.
Definition: dbus-connection.h:117
DBUS_WATCH_HANGUP
As in POLLHUP (can't watch for it, but can be present in current state passed to dbus_watch_handle())...
Definition: dbus-connection.h:67
dbus_watch_get_fd
DBUS_EXPORT DBUS_DEPRECATED int dbus_watch_get_fd(DBusWatch *watch)
Deprecated former name of dbus_watch_get_unix_fd().
Definition: dbus-watch.c:536
DBusAddWatchFunction
dbus_bool_t(* DBusAddWatchFunction)(DBusWatch *watch, void *data)
Called when libdbus needs a new watch to be monitored by the main loop.
Definition: dbus-connection.h:91
DBusObjectPathMessageFunction
DBusHandlerResult(* DBusObjectPathMessageFunction)(DBusConnection *connection, DBusMessage *message, void *user_data)
Called when a message is sent to a registered object path.
Definition: dbus-connection.h:374
dbus_watch_set_data
DBUS_EXPORT void dbus_watch_set_data(DBusWatch *watch, void *data, DBusFreeFunction free_data_function)
Sets data which can be retrieved with dbus_watch_get_data().
Definition: dbus-watch.c:642
DBusRemoveWatchFunction
void(* DBusRemoveWatchFunction)(DBusWatch *watch, void *data)
Called when libdbus no longer needs a watch to be monitored by the main loop.
Definition: dbus-connection.h:103
dbus_connection_set_wakeup_main_function
void dbus_connection_set_wakeup_main_function(DBusConnection *connection, DBusWakeupMainFunction wakeup_main_function, void *data, DBusFreeFunction free_data_function)
Sets the mainloop wakeup function for the connection.
Definition: dbus-connection.c:5027
DBusObjectPathVTable::dbus_internal_pad1
void(* dbus_internal_pad1)(void *)
Reserved for future expansion.
Definition: dbus-connection.h:389
dbus_watch_get_data
DBUS_EXPORT void * dbus_watch_get_data(DBusWatch *watch)
Gets data previously set with dbus_watch_set_data() or NULL if none.
Definition: dbus-watch.c:623
dbus_connection_pop_message
DBusMessage * dbus_connection_pop_message(DBusConnection *connection)
Returns the first-received message from the incoming message queue, removing it from the queue...
Definition: dbus-connection.c:4091
DBusPreallocatedSend
Internals of DBusPreallocatedSend.
Definition: dbus-connection.c:240
dbus_connection_set_unix_user_function
void dbus_connection_set_unix_user_function(DBusConnection *connection, DBusAllowUnixUserFunction function, void *data, DBusFreeFunction free_data_function)
Sets a predicate function used to determine whether a given user ID is allowed to connect...
Definition: dbus-connection.c:5305
DBusDispatchStatusFunction
void(* DBusDispatchStatusFunction)(DBusConnection *connection, DBusDispatchStatus new_status, void *data)
Called when the return value of dbus_connection_get_dispatch_status() may have changed.
Definition: dbus-connection.h:128
dbus_connection_set_watch_functions
dbus_bool_t dbus_connection_set_watch_functions(DBusConnection *connection, DBusAddWatchFunction add_function, DBusRemoveWatchFunction remove_function, DBusWatchToggledFunction toggled_function, void *data, DBusFreeFunction free_data_function)
Sets the watch functions for the connection.
Definition: dbus-connection.c:4926
DBusHandleMessageFunction
DBusHandlerResult(* DBusHandleMessageFunction)(DBusConnection *connection, DBusMessage *message, void *user_data)
Called when a message needs to be handled.
Definition: dbus-connection.h:169
dbus_connection_register_fallback
dbus_bool_t dbus_connection_register_fallback(DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data)
Registers a fallback handler for a given subsection of the object hierarchy.
Definition: dbus-connection.c:5774
dbus_connection_get_adt_audit_session_data
dbus_bool_t dbus_connection_get_adt_audit_session_data(DBusConnection *connection, void **data, dbus_int32_t *data_size)
Gets the ADT audit data of the connection if any.
Definition: dbus-connection.c:5259
DBusObjectPathVTable::dbus_internal_pad3
void(* dbus_internal_pad3)(void *)
Reserved for future expansion.
Definition: dbus-connection.h:391
dbus_timeout_set_data
DBUS_EXPORT void dbus_timeout_set_data(DBusTimeout *timeout, void *data, DBusFreeFunction free_data_function)
Sets data which can be retrieved with dbus_timeout_get_data().
Definition: dbus-timeout.c:446
dbus_timeout_get_data
DBUS_EXPORT void * dbus_timeout_get_data(DBusTimeout *timeout)
Gets data previously set with dbus_timeout_set_data() or NULL if none.
Definition: dbus-timeout.c:429
dbus_connection_get_server_id
char * dbus_connection_get_server_id(DBusConnection *connection)
Gets the ID of the server address we are authenticated to, if this connection is on the client side...
Definition: dbus-connection.c:3074
dbus_watch_handle
DBUS_EXPORT dbus_bool_t dbus_watch_handle(DBusWatch *watch, unsigned int flags)
Called to notify the D-Bus library when a previously-added watch is ready for reading or writing...
Definition: dbus-watch.c:698
dbus_connection_get_unix_fd
dbus_bool_t dbus_connection_get_unix_fd(DBusConnection *connection, int *fd)
Get the UNIX file descriptor of the connection, if any.
Definition: dbus-connection.c:5118
dbus_connection_get_is_connected
dbus_bool_t dbus_connection_get_is_connected(DBusConnection *connection)
Gets whether the connection is currently open.
Definition: dbus-connection.c:2973
dbus_watch_get_flags
DBUS_EXPORT unsigned int dbus_watch_get_flags(DBusWatch *watch)
Gets flags from DBusWatchFlags indicating what conditions should be monitored on the file descriptor...
Definition: dbus-watch.c:607
DBUS_WATCH_READABLE
As in POLLIN.
Definition: dbus-connection.h:60
dbus_connection_send_preallocated
void dbus_connection_send_preallocated(DBusConnection *connection, DBusPreallocatedSend *preallocated, DBusMessage *message, dbus_uint32_t *client_serial)
Sends a message using preallocated resources.
Definition: dbus-connection.c:3217
dbus_connection_unref
void dbus_connection_unref(DBusConnection *connection)
Decrements the reference count of a DBusConnection, and finalizes it if the count reaches zero...
Definition: dbus-connection.c:2817
dbus_connection_borrow_message
DBusMessage * dbus_connection_borrow_message(DBusConnection *connection)
Returns the first-received message from the incoming message queue, leaving it in the queue...
Definition: dbus-connection.c:3850
dbus_connection_add_filter
dbus_bool_t dbus_connection_add_filter(DBusConnection *connection, DBusHandleMessageFunction function, void *user_data, DBusFreeFunction free_data_function)
Adds a message filter.
Definition: dbus-connection.c:5511
dbus_connection_unregister_object_path
dbus_bool_t dbus_connection_unregister_object_path(DBusConnection *connection, const char *path)
Unregisters the handler registered with exactly the given path.
Definition: dbus-connection.c:5809
dbus_connection_get_max_received_unix_fds
long dbus_connection_get_max_received_unix_fds(DBusConnection *connection)
Gets the value set by dbus_connection_set_max_received_unix_fds().
Definition: dbus-connection.c:6212
dbus_connection_try_register_object_path
dbus_bool_t dbus_connection_try_register_object_path(DBusConnection *connection, const char *path, const DBusObjectPathVTable *vtable, void *user_data, DBusError *error)
Registers a handler for a given path in the object hierarchy.
Definition: dbus-connection.c:5672
dbus_connection_flush
void dbus_connection_flush(DBusConnection *connection)
Blocks until the outgoing message queue is empty.
Definition: dbus-connection.c:3641
dbus_connection_set_max_received_unix_fds
void dbus_connection_set_max_received_unix_fds(DBusConnection *connection, long n)
Sets the maximum total number of unix fds that can be used for all messages received on this connecti...
Definition: dbus-connection.c:6194
dbus_connection_get_socket
dbus_bool_t dbus_connection_get_socket(DBusConnection *connection, int *fd)
Gets the underlying Windows or UNIX socket file descriptor of the connection, if any.
Definition: dbus-connection.c:5148
dbus_connection_free_preallocated_send
void dbus_connection_free_preallocated_send(DBusConnection *connection, DBusPreallocatedSend *preallocated)
Frees preallocated message-sending resources from dbus_connection_preallocate_send().
Definition: dbus-connection.c:3191
dbus_timeout_get_interval
DBUS_EXPORT int dbus_timeout_get_interval(DBusTimeout *timeout)
Gets the timeout interval.
Definition: dbus-timeout.c:416
dbus_connection_read_write_dispatch
dbus_bool_t dbus_connection_read_write_dispatch(DBusConnection *connection, int timeout_milliseconds)
This function is intended for use with applications that don't want to write a main loop and deal wit...
Definition: dbus-connection.c:3769
DBUS_END_DECLS
#define DBUS_END_DECLS
Macro used after declaring functions in the D-Bus header files.