D-Bus 1.13.18

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-macros.h>
32 #include <dbus/dbus-memory.h>
33 #include <dbus/dbus-message.h>
34 #include <dbus/dbus-shared.h>
35
36 DBUS_BEGIN_DECLS
37
43 /* documented in dbus-watch.c */
44 typedef struct DBusWatch DBusWatch;
45 /* documented in dbus-timeout.c */
46 typedef struct DBusTimeout DBusTimeout;
48 typedef struct DBusPreallocatedSend DBusPreallocatedSend;
50 typedef struct DBusPendingCall DBusPendingCall;
52 typedef struct DBusConnection DBusConnection;
54 typedef struct DBusObjectPathVTable DBusObjectPathVTable;
55
59 typedef enum
60 {
61 DBUS_WATCH_READABLE = 1 << 0,
62 DBUS_WATCH_WRITABLE = 1 << 1,
63 DBUS_WATCH_ERROR = 1 << 2,
68 DBUS_WATCH_HANGUP = 1 << 3
73 /* Internal to libdbus, there is also _DBUS_WATCH_NVAL in dbus-watch.h */
74 } DBusWatchFlags;
75
80 typedef enum
81 {
82 DBUS_DISPATCH_DATA_REMAINS,
83 DBUS_DISPATCH_COMPLETE,
84 DBUS_DISPATCH_NEED_MEMORY
85 } DBusDispatchStatus;
86
92 typedef dbus_bool_t (* DBusAddWatchFunction) (DBusWatch *watch,
93 void *data);
98 typedef void (* DBusWatchToggledFunction) (DBusWatch *watch,
99 void *data);
104 typedef void (* DBusRemoveWatchFunction) (DBusWatch *watch,
105 void *data);
111 typedef dbus_bool_t (* DBusAddTimeoutFunction) (DBusTimeout *timeout,
112 void *data);
118 typedef void (* DBusTimeoutToggledFunction) (DBusTimeout *timeout,
119 void *data);
124 typedef void (* DBusRemoveTimeoutFunction) (DBusTimeout *timeout,
125 void *data);
129 typedef void (* DBusDispatchStatusFunction) (DBusConnection *connection,
130 DBusDispatchStatus new_status,
131 void *data);
136 typedef void (* DBusWakeupMainFunction) (void *data);
137
144 typedef dbus_bool_t (* DBusAllowUnixUserFunction) (DBusConnection *connection,
145 unsigned long uid,
146 void *data);
147
154 typedef dbus_bool_t (* DBusAllowWindowsUserFunction) (DBusConnection *connection,
155 const char *user_sid,
156 void *data);
157
158
163 typedef void (* DBusPendingCallNotifyFunction) (DBusPendingCall *pending,
164 void *user_data);
165
170 typedef DBusHandlerResult (* DBusHandleMessageFunction) (DBusConnection *connection,
171 DBusMessage *message,
172 void *user_data);
173 DBUS_EXPORT
174 DBusConnection* dbus_connection_open (const char *address,
175 DBusError *error);
176 DBUS_EXPORT
177 DBusConnection* dbus_connection_open_private (const char *address,
178 DBusError *error);
179 DBUS_EXPORT
180 DBusConnection* dbus_connection_ref (DBusConnection *connection);
181 DBUS_EXPORT
182 void dbus_connection_unref (DBusConnection *connection);
183 DBUS_EXPORT
184 void dbus_connection_close (DBusConnection *connection);
185 DBUS_EXPORT
186 dbus_bool_t dbus_connection_get_is_connected (DBusConnection *connection);
187 DBUS_EXPORT
188 dbus_bool_t dbus_connection_get_is_authenticated (DBusConnection *connection);
189 DBUS_EXPORT
190 dbus_bool_t dbus_connection_get_is_anonymous (DBusConnection *connection);
191 DBUS_EXPORT
192 char* dbus_connection_get_server_id (DBusConnection *connection);
193 DBUS_EXPORT
194 dbus_bool_t dbus_connection_can_send_type (DBusConnection *connection,
195 int type);
196
197 DBUS_EXPORT
198 void dbus_connection_set_exit_on_disconnect (DBusConnection *connection,
199 dbus_bool_t exit_on_disconnect);
200 DBUS_EXPORT
201 void dbus_connection_flush (DBusConnection *connection);
202 DBUS_EXPORT
203 dbus_bool_t dbus_connection_read_write_dispatch (DBusConnection *connection,
204 int timeout_milliseconds);
205 DBUS_EXPORT
206 dbus_bool_t dbus_connection_read_write (DBusConnection *connection,
207 int timeout_milliseconds);
208 DBUS_EXPORT
209 DBusMessage* dbus_connection_borrow_message (DBusConnection *connection);
210 DBUS_EXPORT
211 void dbus_connection_return_message (DBusConnection *connection,
212 DBusMessage *message);
213 DBUS_EXPORT
214 void dbus_connection_steal_borrowed_message (DBusConnection *connection,
215 DBusMessage *message);
216 DBUS_EXPORT
217 DBusMessage* dbus_connection_pop_message (DBusConnection *connection);
218 DBUS_EXPORT
219 DBusDispatchStatus dbus_connection_get_dispatch_status (DBusConnection *connection);
220 DBUS_EXPORT
221 DBusDispatchStatus dbus_connection_dispatch (DBusConnection *connection);
222 DBUS_EXPORT
223 dbus_bool_t dbus_connection_has_messages_to_send (DBusConnection *connection);
224 DBUS_EXPORT
225 dbus_bool_t dbus_connection_send (DBusConnection *connection,
226 DBusMessage *message,
227 dbus_uint32_t *client_serial);
228 DBUS_EXPORT
229 dbus_bool_t dbus_connection_send_with_reply (DBusConnection *connection,
230 DBusMessage *message,
231 DBusPendingCall **pending_return,
232 int timeout_milliseconds);
233 DBUS_EXPORT
234 DBusMessage * dbus_connection_send_with_reply_and_block (DBusConnection *connection,
235 DBusMessage *message,
236 int timeout_milliseconds,
237 DBusError *error);
238 DBUS_EXPORT
239 dbus_bool_t dbus_connection_set_watch_functions (DBusConnection *connection,
240 DBusAddWatchFunction add_function,
241 DBusRemoveWatchFunction remove_function,
242 DBusWatchToggledFunction toggled_function,
243 void *data,
244 DBusFreeFunction free_data_function);
245 DBUS_EXPORT
246 dbus_bool_t dbus_connection_set_timeout_functions (DBusConnection *connection,
247 DBusAddTimeoutFunction add_function,
248 DBusRemoveTimeoutFunction remove_function,
249 DBusTimeoutToggledFunction toggled_function,
250 void *data,
251 DBusFreeFunction free_data_function);
252 DBUS_EXPORT
253 void dbus_connection_set_wakeup_main_function (DBusConnection *connection,
254 DBusWakeupMainFunction wakeup_main_function,
255 void *data,
256 DBusFreeFunction free_data_function);
257 DBUS_EXPORT
258 void dbus_connection_set_dispatch_status_function (DBusConnection *connection,
259 DBusDispatchStatusFunction function,
260 void *data,
261 DBusFreeFunction free_data_function);
262 DBUS_EXPORT
263 dbus_bool_t dbus_connection_get_unix_user (DBusConnection *connection,
264 unsigned long *uid);
265 DBUS_EXPORT
266 dbus_bool_t dbus_connection_get_unix_process_id (DBusConnection *connection,
267 unsigned long *pid);
268 DBUS_EXPORT
269 dbus_bool_t dbus_connection_get_adt_audit_session_data (DBusConnection *connection,
270 void **data,
271 dbus_int32_t *data_size);
272 DBUS_EXPORT
273 void dbus_connection_set_unix_user_function (DBusConnection *connection,
274 DBusAllowUnixUserFunction function,
275 void *data,
276 DBusFreeFunction free_data_function);
277 DBUS_EXPORT
278 dbus_bool_t dbus_connection_get_windows_user (DBusConnection *connection,
279 char **windows_sid_p);
280 DBUS_EXPORT
281 void dbus_connection_set_windows_user_function (DBusConnection *connection,
282 DBusAllowWindowsUserFunction function,
283 void *data,
284 DBusFreeFunction free_data_function);
285 DBUS_EXPORT
286 void dbus_connection_set_allow_anonymous (DBusConnection *connection,
287 dbus_bool_t value);
288 DBUS_EXPORT
289 void dbus_connection_set_route_peer_messages (DBusConnection *connection,
290 dbus_bool_t value);
291
292
293 /* Filters */
294
295 DBUS_EXPORT
296 dbus_bool_t dbus_connection_add_filter (DBusConnection *connection,
297 DBusHandleMessageFunction function,
298 void *user_data,
299 DBusFreeFunction free_data_function);
300 DBUS_EXPORT
301 void dbus_connection_remove_filter (DBusConnection *connection,
302 DBusHandleMessageFunction function,
303 void *user_data);
304
305
306 /* Other */
307 DBUS_EXPORT
308 dbus_bool_t dbus_connection_allocate_data_slot (dbus_int32_t *slot_p);
309 DBUS_EXPORT
310 void dbus_connection_free_data_slot (dbus_int32_t *slot_p);
311 DBUS_EXPORT
312 dbus_bool_t dbus_connection_set_data (DBusConnection *connection,
313 dbus_int32_t slot,
314 void *data,
315 DBusFreeFunction free_data_func);
316 DBUS_EXPORT
317 void* dbus_connection_get_data (DBusConnection *connection,
318 dbus_int32_t slot);
319
320 DBUS_EXPORT
321 void dbus_connection_set_change_sigpipe (dbus_bool_t will_modify_sigpipe);
322
323 DBUS_EXPORT
324 void dbus_connection_set_max_message_size (DBusConnection *connection,
325 long size);
326 DBUS_EXPORT
327 long dbus_connection_get_max_message_size (DBusConnection *connection);
328 DBUS_EXPORT
329 void dbus_connection_set_max_received_size (DBusConnection *connection,
330 long size);
331 DBUS_EXPORT
332 long dbus_connection_get_max_received_size (DBusConnection *connection);
333
334 DBUS_EXPORT
335 void dbus_connection_set_max_message_unix_fds (DBusConnection *connection,
336 long n);
337 DBUS_EXPORT
338 long dbus_connection_get_max_message_unix_fds (DBusConnection *connection);
339 DBUS_EXPORT
340 void dbus_connection_set_max_received_unix_fds(DBusConnection *connection,
341 long n);
342 DBUS_EXPORT
343 long dbus_connection_get_max_received_unix_fds(DBusConnection *connection);
344
345 DBUS_EXPORT
346 long dbus_connection_get_outgoing_size (DBusConnection *connection);
347 DBUS_EXPORT
348 long dbus_connection_get_outgoing_unix_fds (DBusConnection *connection);
349
350 DBUS_EXPORT
351 DBusPreallocatedSend* dbus_connection_preallocate_send (DBusConnection *connection);
352 DBUS_EXPORT
353 void dbus_connection_free_preallocated_send (DBusConnection *connection,
354 DBusPreallocatedSend *preallocated);
355 DBUS_EXPORT
356 void dbus_connection_send_preallocated (DBusConnection *connection,
357 DBusPreallocatedSend *preallocated,
358 DBusMessage *message,
359 dbus_uint32_t *client_serial);
360
361
362 /* Object tree functionality */
363
368 typedef void (* DBusObjectPathUnregisterFunction) (DBusConnection *connection,
369 void *user_data);
375 typedef DBusHandlerResult (* DBusObjectPathMessageFunction) (DBusConnection *connection,
376 DBusMessage *message,
377 void *user_data);
378
385 struct DBusObjectPathVTable
386 {
387 DBusObjectPathUnregisterFunction unregister_function;
388 DBusObjectPathMessageFunction message_function;
390 void (* dbus_internal_pad1) (void *);
391 void (* dbus_internal_pad2) (void *);
392 void (* dbus_internal_pad3) (void *);
393 void (* dbus_internal_pad4) (void *);
394 };
395
396 DBUS_EXPORT
397 dbus_bool_t dbus_connection_try_register_object_path (DBusConnection *connection,
398 const char *path,
399 const DBusObjectPathVTable *vtable,
400 void *user_data,
401 DBusError *error);
402
403 DBUS_EXPORT
404 dbus_bool_t dbus_connection_register_object_path (DBusConnection *connection,
405 const char *path,
406 const DBusObjectPathVTable *vtable,
407 void *user_data);
408
409 DBUS_EXPORT
410 dbus_bool_t dbus_connection_try_register_fallback (DBusConnection *connection,
411 const char *path,
412 const DBusObjectPathVTable *vtable,
413 void *user_data,
414 DBusError *error);
415
416 DBUS_EXPORT
417 dbus_bool_t dbus_connection_register_fallback (DBusConnection *connection,
418 const char *path,
419 const DBusObjectPathVTable *vtable,
420 void *user_data);
421 DBUS_EXPORT
422 dbus_bool_t dbus_connection_unregister_object_path (DBusConnection *connection,
423 const char *path);
424
425 DBUS_EXPORT
426 dbus_bool_t dbus_connection_get_object_path_data (DBusConnection *connection,
427 const char *path,
428 void **data_p);
429
430 DBUS_EXPORT
431 dbus_bool_t dbus_connection_list_registered (DBusConnection *connection,
432 const char *parent_path,
433 char ***child_entries);
434
435 DBUS_EXPORT
436 dbus_bool_t dbus_connection_get_unix_fd (DBusConnection *connection,
437 int *fd);
438 DBUS_EXPORT
439 dbus_bool_t dbus_connection_get_socket (DBusConnection *connection,
440 int *fd);
441
464 static inline void
465 dbus_clear_connection (DBusConnection **pointer_to_connection)
466 {
467 _dbus_clear_pointer_impl (DBusConnection, pointer_to_connection,
468 dbus_connection_unref);
469 }
470
479 #ifndef DBUS_DISABLE_DEPRECATED
480 DBUS_EXPORT
481 DBUS_DEPRECATED int dbus_watch_get_fd (DBusWatch *watch);
482 #endif
483
484 DBUS_EXPORT
485 int dbus_watch_get_unix_fd (DBusWatch *watch);
486 DBUS_EXPORT
487 int dbus_watch_get_socket (DBusWatch *watch);
488 DBUS_EXPORT
489 unsigned int dbus_watch_get_flags (DBusWatch *watch);
490 DBUS_EXPORT
491 void* dbus_watch_get_data (DBusWatch *watch);
492 DBUS_EXPORT
493 void dbus_watch_set_data (DBusWatch *watch,
494 void *data,
495 DBusFreeFunction free_data_function);
496 DBUS_EXPORT
497 dbus_bool_t dbus_watch_handle (DBusWatch *watch,
498 unsigned int flags);
499 DBUS_EXPORT
500 dbus_bool_t dbus_watch_get_enabled (DBusWatch *watch);
501
509 DBUS_EXPORT
510 int dbus_timeout_get_interval (DBusTimeout *timeout);
511 DBUS_EXPORT
512 void* dbus_timeout_get_data (DBusTimeout *timeout);
513 DBUS_EXPORT
514 void dbus_timeout_set_data (DBusTimeout *timeout,
515 void *data,
516 DBusFreeFunction free_data_function);
517 DBUS_EXPORT
518 dbus_bool_t dbus_timeout_handle (DBusTimeout *timeout);
519 DBUS_EXPORT
520 dbus_bool_t dbus_timeout_get_enabled (DBusTimeout *timeout);
521
524 DBUS_END_DECLS
525
526 #endif /* DBUS_CONNECTION_H */
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:3190
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:5478
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:3768
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:5431
DBusObjectPathVTable::unregister_function
DBusObjectPathUnregisterFunction unregister_function
Function to unregister this handler.
Definition: dbus-connection.h:387
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:512
DBusWatchFlags
DBusWatchFlags
Indicates the status of a DBusWatch.
Definition: dbus-connection.h:60
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:6134
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:5816
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:6312
dbus_connection_ref
DBusConnection * dbus_connection_ref(DBusConnection *connection)
Increments the reference count of a DBusConnection.
Definition: dbus-connection.c:2684
DBusDispatchStatus
DBusDispatchStatus
Indicates the status of incoming data on a DBusConnection.
Definition: dbus-connection.h:81
DBUS_DEPRECATED
#define DBUS_DEPRECATED
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:5097
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:6042
DBusObjectPathVTable::dbus_internal_pad2
void(* dbus_internal_pad2)(void *)
Reserved for future expansion.
Definition: dbus-connection.h:391
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....
Definition: dbus-connection.c:5553
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:129
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:3900
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:5637
DBUS_DISPATCH_COMPLETE
@ DBUS_DISPATCH_COMPLETE
All currently available data has been processed.
Definition: dbus-connection.h:83
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:702
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:3104
DBusFreeFunction
void(* DBusFreeFunction)(void *memory)
Definition: dbus-memory.h:63
DBusObjectPathVTable::dbus_internal_pad4
void(* dbus_internal_pad4)(void *)
Reserved for future expansion.
Definition: dbus-connection.h:393
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:5952
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:3800
DBusWatch
Implementation of DBusWatch.
Definition: dbus-watch.c:41
DBUS_END_DECLS
#define DBUS_END_DECLS
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:6012
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:375
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:5013
DBusConnection
Implementation details of DBusConnection.
Definition: dbus-connection.c:257
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:3534
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:472
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:5219
DBusObjectPathVTable
Virtual table that must be implemented to handle a portion of the object path hierarchy.
Definition: dbus-connection.h:386
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_int32_t
int dbus_int32_t
Definition: dbus-arch-deps.h:42
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:6229
DBUS_WATCH_READABLE
@ DBUS_WATCH_READABLE
As in POLLIN.
Definition: dbus-connection.h:61
DBusObjectPathUnregisterFunction
void(* DBusObjectPathUnregisterFunction)(DBusConnection *connection, void *user_data)
Called when a DBusObjectPathVTable is unregistered (or its connection is freed).
Definition: dbus-connection.h:368
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:3934
DBUS_WATCH_ERROR
@ 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:63
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:677
DBusObjectPathVTable::dbus_internal_pad1
void(* dbus_internal_pad1)(void *)
Reserved for future expansion.
Definition: dbus-connection.h:390
DBusPendingCallNotifyFunction
void(* DBusPendingCallNotifyFunction)(DBusPendingCall *pending, void *user_data)
Called when a pending call now has a reply available.
Definition: dbus-connection.h:163
DBusHandleMessageFunction
DBusHandlerResult(* DBusHandleMessageFunction)(DBusConnection *connection, DBusMessage *message, void *user_data)
Called when a message needs to be handled.
Definition: dbus-connection.h:170
dbus_connection_dispatch
DBusDispatchStatus dbus_connection_dispatch(DBusConnection *connection)
Processes any incoming data.
Definition: dbus-connection.c:4574
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:92
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:3301
DBUS_BEGIN_DECLS
#define DBUS_BEGIN_DECLS
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:4377
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:6091
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:2662
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:6152
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:3164
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:136
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:2931
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:6373
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:111
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:6247
DBUS_DISPATCH_DATA_REMAINS
@ DBUS_DISPATCH_DATA_REMAINS
There is more data to potentially convert to messages.
Definition: dbus-connection.h:82
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:3144
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:593
dbus_connection_open
DBusConnection * dbus_connection_open(const char *address, DBusError *error)
Gets a connection to a remote address.
Definition: dbus-connection.c:2619
dbus_uint32_t
unsigned int dbus_uint32_t
Definition: dbus-arch-deps.h:43
DBusTimeout
Internals of DBusTimeout.
Definition: dbus-timeout.c:41
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:5915
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:3028
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:6191
DBusHandlerResult
DBusHandlerResult
Results that a message handler can return.
Definition: dbus-shared.h:67
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:5255
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:5994
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:2994
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:6173
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:5776
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:564
DBusMessage
Internals of DBusMessage.
Definition: dbus-message-private.h:100
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:3398
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:4090
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:5334
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:5525
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:4950
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:455
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:98
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:5848
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:543
dbus_timeout_get_interval
DBUS_EXPORT int dbus_timeout_get_interval(DBusTimeout *timeout)
Gets the timeout interval.
Definition: dbus-timeout.c:442
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:118
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:658
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:5051
DBusError
Object representing an exception.
Definition: dbus-errors.h:49
DBusPreallocatedSend
Internals of DBusPreallocatedSend.
Definition: dbus-connection.c:241
DBUS_DISPATCH_NEED_MEMORY
@ DBUS_DISPATCH_NEED_MEMORY
More memory is needed to continue.
Definition: dbus-connection.h:84
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:642
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:5142
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:733
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:2972
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:2816
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:154
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:5288
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:3849
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:124
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:104
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:5746
DBusObjectPathVTable::message_function
DBusObjectPathMessageFunction message_function
Function to handle messages.
Definition: dbus-connection.h:388
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:5585
DBusObjectPathVTable::dbus_internal_pad3
void(* dbus_internal_pad3)(void *)
Reserved for future expansion.
Definition: dbus-connection.h:392
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:6289
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:144
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:3073
DBusPendingCall
Implementation details of DBusPendingCall - all fields are private.
Definition: dbus-pending-call.c:63
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:5172
dbus_timeout_handle
DBUS_EXPORT dbus_bool_t dbus_timeout_handle(DBusTimeout *timeout)
Calls the timeout handler for this timeout.
Definition: dbus-timeout.c:498
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:3216
DBUS_WATCH_WRITABLE
@ DBUS_WATCH_WRITABLE
As in POLLOUT.
Definition: dbus-connection.h:62
DBUS_WATCH_HANGUP
@ 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:68
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:5883
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:6117
dbus_connection_flush
void dbus_connection_flush(DBusConnection *connection)
Blocks until the outgoing message queue is empty.
Definition: dbus-connection.c:3640
dbus_bool_t
dbus_uint32_t dbus_bool_t
Definition: dbus-types.h:35
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:6271