27#include "dbus-transport-protected.h"
28#include "dbus-transport-unix.h"
29#include "dbus-transport-socket.h"
30#include "dbus-connection-internal.h"
31#include "dbus-watch.h"
33#include "dbus-address.h"
34#include "dbus-credentials.h"
35#include "dbus-mainloop.h"
36#include "dbus-message.h"
37#ifdef DBUS_ENABLE_EMBEDDED_TESTS
38#include "dbus-server-debug-pipe.h"
72 _dbus_verbose (
"Size counter value is now %d\n",
74 _dbus_verbose (
"Unix FD counter value is now %d\n",
166 transport->
vtable = vtable;
167 transport->
loader = loader;
168 transport->
auth = auth;
175 transport->
address = address_copy;
202 live_messages_notify,
206 _dbus_verbose (
"Initialized transport on address %s\n", transport->
address);
252check_address (
const char *address,
DBusError *error)
259 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
264 for (i = 0; i < len; i++)
269 if (transport !=
NULL)
286_dbus_transport_new_for_autolaunch (
const char *scope,
DBusError *error)
291 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
301 _DBUS_ASSERT_ERROR_IS_SET (error);
305 result = check_address (_dbus_string_get_const_data (&address), error);
306 _DBUS_ASSERT_ERROR_XOR_BOOL (error, result !=
NULL);
313static DBusTransportOpenResult
323 if (strcmp (method,
"autolaunch") == 0)
327 *transport_p = _dbus_transport_new_for_autolaunch (scope, error);
329 if (*transport_p ==
NULL)
331 _DBUS_ASSERT_ERROR_IS_SET (error);
332 return DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT;
336 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
337 return DBUS_TRANSPORT_OPEN_OK;
342 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
343 return DBUS_TRANSPORT_OPEN_NOT_HANDLED;
355 { _dbus_transport_open_unixexec },
358 { _dbus_transport_open_autolaunch }
359#ifdef DBUS_ENABLE_EMBEDDED_TESTS
360 , { _dbus_transport_open_debug_pipe }
377 const char *expected_guid_orig;
382 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
388 if (expected_guid_orig !=
NULL && expected_guid ==
NULL)
390 _DBUS_SET_OOM (error);
396 DBusTransportOpenResult result;
398 _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
399 result = (* open_funcs[i].func) (entry, &transport, &tmp_error);
403 case DBUS_TRANSPORT_OPEN_OK:
404 _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
407 case DBUS_TRANSPORT_OPEN_NOT_HANDLED:
408 _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
411 case DBUS_TRANSPORT_OPEN_BAD_ADDRESS:
412 _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
415 case DBUS_TRANSPORT_OPEN_DID_NOT_CONNECT:
416 _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
427 if (transport ==
NULL)
432 "Unknown address type (examples of valid types are \"tcp\" and on UNIX \"unix\")");
434 _DBUS_ASSERT_ERROR_IS_SET (&tmp_error);
440 _DBUS_ASSERT_ERROR_IS_CLEAR (&tmp_error);
494 _dbus_verbose (
"finalizing\n");
513 _dbus_verbose (
"start\n");
524 _dbus_verbose (
"end\n");
548 void *unix_user_data;
561 _dbus_verbose (
"unlock\n");
564 allow = (* unix_user_function) (connection,
568 _dbus_verbose (
"lock post unix user function\n");
578 " was rejected, disconnecting\n",
593 void *windows_user_data;
606 if (windows_sid ==
NULL)
612 _dbus_verbose (
"unlock\n");
615 allow = (* windows_user_function) (connection,
619 _dbus_verbose (
"lock post windows user function\n");
624 _dbus_verbose (
"Client SID '%s' authorized\n", windows_sid);
628 _dbus_verbose (
"Client SID '%s' was rejected, disconnecting\n",
651 if (our_identity ==
NULL)
663 _dbus_verbose (
"Client authorized as SID '%s'"
664 "matching our SID '%s'\n",
678 _dbus_verbose (
"Client authorized as SID '%s'"
679 " but our SID is '%s', disconnecting\n",
739 dbus_bool_t maybe_authenticated;
747 maybe_authenticated =
751 if (maybe_authenticated)
755 case DBUS_AUTH_STATE_AUTHENTICATED:
759 case DBUS_AUTH_STATE_WAITING_FOR_INPUT:
760 case DBUS_AUTH_STATE_WAITING_FOR_MEMORY:
761 case DBUS_AUTH_STATE_HAVE_BYTES_TO_SEND:
762 case DBUS_AUTH_STATE_NEED_DISCONNECT:
763 maybe_authenticated =
FALSE;
766 case DBUS_AUTH_STATE_INVALID:
774 if (maybe_authenticated && !transport->
is_server)
776 const char *server_guid;
784 _dbus_verbose (
"Client expected GUID '%s' and we got '%s' from the server\n",
794 if (maybe_authenticated && transport->
is_server)
809 allow = auth_via_unix_user_function (transport);
814 allow = auth_via_windows_user_function (transport);
818 allow = auth_via_default_rules (transport);
822 maybe_authenticated =
FALSE;
828 return maybe_authenticated;
863 return DBUS_TRANSPORT_CAN_SEND_UNIX_FD(transport);
909 unsigned int condition)
1004 int timeout_milliseconds)
1008 _dbus_verbose (
"Transport iteration flags 0x%x timeout %d connected = %d\n",
1009 flags, timeout_milliseconds, !transport->
disconnected);
1011 if ((flags & (DBUS_ITERATION_DO_WRITING |
1012 DBUS_ITERATION_DO_READING)) == 0)
1020 timeout_milliseconds);
1023 _dbus_verbose (
"end\n");
1043 encoded, &plaintext))
1054 orig_len = _dbus_string_get_length (buffer);
1063 _dbus_verbose (
" %d unused bytes sent to message loader\n",
1064 _dbus_string_get_length (buffer) -
1078#ifdef DBUS_ENABLE_VERBOSE_MODE
1081 dbus_bool_t succeeded;
1088#ifdef DBUS_ENABLE_VERBOSE_MODE
1089 orig_len = _dbus_string_get_length (buffer);
1099 _dbus_verbose (
" %d unused bytes sent to message loader\n",
1100 _dbus_string_get_length (buffer) -
1115 _dbus_verbose (
"Not enough memory to transfer unused bytes from auth conversation\n");
1136 DBUS_AUTH_STATE_WAITING_FOR_MEMORY)
1143 !recover_unused_bytes (transport))
1171 _dbus_verbose (
"enter\n");
1183 message = link->
data;
1185 _dbus_verbose (
"queueing received message %p\n", message);
1211 _dbus_verbose (
"Corrupted message stream, disconnecting\n");
1282 live_messages_notify,
1300 live_messages_notify,
1352 DBUS_CREDENTIAL_UNIX_USER_ID))
1385 DBUS_CREDENTIAL_UNIX_PROCESS_ID))
1418 DBUS_CREDENTIAL_ADT_AUDIT_DATA_ID))
1455_dbus_transport_get_linux_security_label (
DBusTransport *transport,
1468 DBUS_CREDENTIAL_LINUX_SECURITY_LABEL))
1506 char **windows_sid_p)
1510 *windows_sid_p =
NULL;
1518 DBUS_CREDENTIAL_WINDOWS_SID))
1566 const char **mechanisms)
1604 void (* callback) (
void *),
1611#ifdef DBUS_ENABLE_STATS
1614 dbus_uint32_t *queue_bytes,
1615 dbus_uint32_t *queue_fds,
1616 dbus_uint32_t *peak_queue_bytes,
1617 dbus_uint32_t *peak_queue_fds)
1619 if (queue_bytes !=
NULL)
1622 if (queue_fds !=
NULL)
1625 if (peak_queue_bytes !=
NULL)
1626 *peak_queue_bytes = _dbus_counter_get_peak_size_value (transport->
live_messages);
1628 if (peak_queue_fds !=
NULL)
1629 *peak_queue_fds = _dbus_counter_get_peak_unix_fd_value (transport->
live_messages);
void _dbus_set_bad_address(DBusError *error, const char *address_problem_type, const char *address_problem_field, const char *address_problem_other)
Sets DBUS_ERROR_BAD_ADDRESS.
void dbus_address_entries_free(DBusAddressEntry **entries)
Frees a NULL-terminated array of address entries.
dbus_bool_t dbus_parse_address(const char *address, DBusAddressEntry ***entry_result, int *array_len, DBusError *error)
Parses an address string of the form:
const char * dbus_address_entry_get_method(DBusAddressEntry *entry)
Returns the method string of an address entry.
const char * dbus_address_entry_get_value(DBusAddressEntry *entry, const char *key)
Returns a value from a key of an entry.
DBusAuthState _dbus_auth_do_work(DBusAuth *auth)
Analyzes buffered input and moves the auth conversation forward, returning the new state of the auth ...
DBusCredentials * _dbus_auth_get_identity(DBusAuth *auth)
Gets the identity we authorized the client as.
dbus_bool_t _dbus_auth_decode_data(DBusAuth *auth, const DBusString *encoded, DBusString *plaintext)
Called post-authentication, decodes a block of bytes received from the peer.
void _dbus_auth_unref(DBusAuth *auth)
Decrements the refcount of an auth object.
dbus_bool_t _dbus_auth_set_mechanisms(DBusAuth *auth, const char **mechanisms)
Sets an array of authentication mechanism names that we are willing to use.
void _dbus_auth_delete_unused_bytes(DBusAuth *auth)
Gets rid of unused bytes returned by _dbus_auth_get_unused_bytes() after we've gotten them and succes...
const char * _dbus_auth_get_guid_from_server(DBusAuth *auth)
Gets the GUID from the server if we've authenticated; gets NULL otherwise.
dbus_bool_t _dbus_auth_needs_decoding(DBusAuth *auth)
Called post-authentication, indicates whether we need to decode the message stream with _dbus_auth_de...
DBusAuth * _dbus_auth_client_new(void)
Creates a new auth conversation object for the client side.
DBusAuth * _dbus_auth_server_new(const DBusString *guid)
Creates a new auth conversation object for the server side.
void _dbus_auth_get_unused_bytes(DBusAuth *auth, const DBusString **str)
Returns leftover bytes that were not used as part of the auth conversation.
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.
DBUS_PRIVATE_EXPORT void _dbus_connection_unref_unlocked(DBusConnection *connection)
Decrements the reference count of a DBusConnection.
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 DBusConnection * _dbus_connection_ref_unlocked(DBusConnection *connection)
Increments the reference count of a DBusConnection.
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,...
DBusDispatchStatus
Indicates the status of incoming data on a DBusConnection.
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,...
@ DBUS_DISPATCH_NEED_MEMORY
More memory is needed to continue.
@ DBUS_DISPATCH_COMPLETE
All currently available data has been processed.
@ DBUS_DISPATCH_DATA_REMAINS
There is more data to potentially convert to messages.
dbus_bool_t _dbus_credentials_include(DBusCredentials *credentials, DBusCredentialType type)
Checks whether the given credential is present.
dbus_bool_t _dbus_credentials_same_user(DBusCredentials *credentials, DBusCredentials *other_credentials)
Check whether the user-identifying credentials in two credentials objects are identical.
dbus_uid_t _dbus_credentials_get_unix_uid(DBusCredentials *credentials)
Gets the UNIX user ID in the credentials, or DBUS_UID_UNSET if the credentials object doesn't contain...
DBusCredentials * _dbus_credentials_new_from_current_process(void)
Creates a new object with the most important credentials (user ID and process ID) from the current pr...
DBusCredentials * _dbus_credentials_new(void)
Creates a new credentials object.
void * _dbus_credentials_get_adt_audit_data(DBusCredentials *credentials)
Gets the ADT audit data in the credentials, or NULL if the credentials object doesn't contain ADT aud...
const char * _dbus_credentials_get_linux_security_label(DBusCredentials *credentials)
Gets the Linux security label (as used by LSMs) from the credentials, or NULL if the credentials obje...
void _dbus_credentials_unref(DBusCredentials *credentials)
Decrement refcount on credentials.
dbus_pid_t _dbus_credentials_get_pid(DBusCredentials *credentials)
Gets the UNIX process ID in the credentials, or DBUS_PID_UNSET if the credentials object doesn't cont...
dbus_int32_t _dbus_credentials_get_adt_audit_data_size(DBusCredentials *credentials)
Gets the ADT audit data size in the credentials, or 0 if the credentials object doesn't contain ADT a...
const char * _dbus_credentials_get_windows_sid(DBusCredentials *credentials)
Gets the Windows user SID in the credentials, or NULL if the credentials object doesn't contain a Win...
dbus_bool_t _dbus_credentials_are_anonymous(DBusCredentials *credentials)
Checks whether a credentials object contains a user identity.
#define DBUS_ERROR_INIT
Expands to a suitable initializer for a DBusError on the stack.
void dbus_move_error(DBusError *src, DBusError *dest)
Moves an error src into dest, freeing src and overwriting dest.
void dbus_set_error(DBusError *error, const char *name, const char *format,...)
Assigns an error name and message to a DBusError.
void dbus_error_free(DBusError *error)
Frees an error that's been set (or just initialized), then reinitializes the error as in dbus_error_i...
dbus_bool_t dbus_error_is_set(const DBusError *error)
Checks whether an error occurred (the error is set).
#define _dbus_assert_not_reached(explanation)
Aborts with an error message if called.
#define _dbus_assert(condition)
Aborts with an error message if the condition is false.
void _dbus_warn_check_failed(const char *format,...)
Prints a "critical" warning to stderr when an assertion fails; differs from _dbus_warn primarily in t...
char * _dbus_strdup(const char *str)
Duplicates a string.
#define _DBUS_N_ELEMENTS(array)
Computes the number of elements in a fixed-size array using sizeof().
#define _DBUS_INT32_MAX
Maximum value of type "int32".
#define NULL
A null pointer, defined appropriately for C or C++.
#define TRUE
Expands to "1".
#define FALSE
Expands to "0".
void(* DBusFreeFunction)(void *memory)
The type of a function which frees a block of memory.
void dbus_free(void *memory)
Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().
void _dbus_message_loader_set_max_message_size(DBusMessageLoader *loader, long size)
Sets the maximum size message we allow.
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_message_loader_get_is_corrupted(DBusMessageLoader *loader)
Checks whether the loader is confused due to bad data.
DBUS_PRIVATE_EXPORT void _dbus_message_loader_unref(DBusMessageLoader *loader)
Decrements the reference count of the loader and finalizes the loader when the count reaches zero.
void _dbus_message_loader_set_pending_fds_function(DBusMessageLoader *loader, void(*callback)(void *), void *data)
Register a function to be called whenever the number of pending file descriptors in the loader change...
void _dbus_message_loader_putback_message_link(DBusMessageLoader *loader, DBusList *link)
Returns a popped message link, used to undo a pop.
int _dbus_message_loader_get_pending_fds_count(DBusMessageLoader *loader)
Return how many file descriptors are pending in the loader.
DBUS_PRIVATE_EXPORT void _dbus_message_loader_get_buffer(DBusMessageLoader *loader, DBusString **buffer, int *max_to_read, dbus_bool_t *may_read_unix_fds)
Gets the buffer to use for reading data from the network.
dbus_bool_t _dbus_message_add_counter(DBusMessage *message, DBusCounter *counter)
Adds a counter to be incremented immediately with the size/unix fds of this message,...
DBusMessage * _dbus_message_loader_peek_message(DBusMessageLoader *loader)
Peeks at first loaded message, returns NULL if no messages have been queued.
void _dbus_message_loader_set_max_message_unix_fds(DBusMessageLoader *loader, long n)
Sets the maximum unix fds per message we allow.
DBUS_PRIVATE_EXPORT long _dbus_message_loader_get_max_message_size(DBusMessageLoader *loader)
Gets the maximum allowed message size in bytes.
DBUS_PRIVATE_EXPORT DBusMessageLoader * _dbus_message_loader_new(void)
Creates a new message loader.
DBusList * _dbus_message_loader_pop_message_link(DBusMessageLoader *loader)
Pops a loaded message inside a list link (passing ownership of the message and link to the caller).
DBUS_PRIVATE_EXPORT dbus_bool_t _dbus_message_loader_queue_messages(DBusMessageLoader *loader)
Converts buffered data into messages, if we have enough data.
DBUS_PRIVATE_EXPORT void _dbus_message_loader_return_buffer(DBusMessageLoader *loader, DBusString *buffer)
Returns a buffer obtained from _dbus_message_loader_get_buffer(), indicating to the loader how many b...
long _dbus_message_loader_get_max_message_unix_fds(DBusMessageLoader *loader)
Gets the maximum allowed number of unix fds per message.
#define DBUS_ERROR_NO_MEMORY
There was not enough memory to complete an operation.
void _dbus_counter_set_notify(DBusCounter *counter, long size_guard_value, long unix_fd_guard_value, DBusCounterNotifyFunction function, void *user_data)
Sets the notify function for this counter; the notify function is called whenever the counter's value...
DBusCounter * _dbus_counter_new(void)
Creates a new DBusCounter.
long _dbus_counter_get_unix_fd_value(DBusCounter *counter)
Gets the current value of the unix fd counter.
void _dbus_counter_unref(DBusCounter *counter)
Decrements refcount of the counter and possibly finalizes the counter.
long _dbus_counter_get_size_value(DBusCounter *counter)
Gets the current value of the size counter.
dbus_bool_t _dbus_string_init(DBusString *str)
Initializes a string.
dbus_bool_t _dbus_string_copy(const DBusString *source, int start, DBusString *dest, int insert_at)
Like _dbus_string_move(), but does not delete the section of the source string that's copied to the d...
void _dbus_string_free(DBusString *str)
Frees a string created by _dbus_string_init(), and fills it with the same contents as _DBUS_STRING_IN...
dbus_bool_t _dbus_string_copy_data(const DBusString *str, char **data_return)
Copies the data from the string into a char*.
dbus_bool_t _dbus_string_move(DBusString *source, int start, DBusString *dest, int insert_at)
Moves the end of one string into another string.
unsigned long dbus_uid_t
A user ID.
#define DBUS_PID_UNSET
an invalid PID used to represent an uninitialized dbus_pid_t field
#define DBUS_UID_FORMAT
an appropriate printf format for dbus_uid_t
dbus_bool_t _dbus_get_autolaunch_address(const char *scope, DBusString *address, DBusError *error)
Returns the address of a new session bus.
DBusTransportOpenResult _dbus_transport_open_socket(DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)
Opens a TCP socket transport.
DBusTransportOpenResult _dbus_transport_open_unix_socket(DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)
Opens a UNIX socket transport.
DBusTransportOpenResult _dbus_transport_open_platform_specific(DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error)
Opens platform specific transport types.
void _dbus_transport_set_max_message_size(DBusTransport *transport, long size)
See dbus_connection_set_max_message_size().
void _dbus_transport_set_max_received_size(DBusTransport *transport, long size)
See dbus_connection_set_max_received_size().
DBusDispatchStatus _dbus_transport_get_dispatch_status(DBusTransport *transport)
Reports our current dispatch status (whether there's buffered data to be queued as messages,...
dbus_bool_t _dbus_transport_set_auth_mechanisms(DBusTransport *transport, const char **mechanisms)
Sets the SASL authentication mechanisms supported by this transport.
int _dbus_transport_get_pending_fds_count(DBusTransport *transport)
Return how many file descriptors are pending in the loader.
dbus_bool_t _dbus_transport_get_adt_audit_session_data(DBusTransport *transport, void **data, int *data_size)
See dbus_connection_get_adt_audit_session_data().
dbus_bool_t _dbus_transport_get_windows_user(DBusTransport *transport, char **windows_sid_p)
See dbus_connection_get_windows_user().
dbus_bool_t _dbus_transport_queue_messages(DBusTransport *transport)
Processes data we've read while handling a watch, potentially converting some of it to messages and q...
dbus_bool_t _dbus_transport_get_socket_fd(DBusTransport *transport, DBusSocket *fd_p)
Get the socket file descriptor, if any.
const char * _dbus_transport_get_address(DBusTransport *transport)
Gets the address of a transport.
dbus_bool_t _dbus_transport_handle_watch(DBusTransport *transport, DBusWatch *watch, unsigned int condition)
Handles a watch by reading data, writing data, or disconnecting the transport, as appropriate for the...
DBusTransport * _dbus_transport_ref(DBusTransport *transport)
Increments the reference count for the transport.
dbus_bool_t _dbus_transport_peek_is_authenticated(DBusTransport *transport)
Returns TRUE if we have been authenticated.
void _dbus_transport_set_allow_anonymous(DBusTransport *transport, dbus_bool_t value)
See dbus_connection_set_allow_anonymous()
void _dbus_transport_disconnect(DBusTransport *transport)
Closes our end of the connection to a remote application.
long _dbus_transport_get_max_received_size(DBusTransport *transport)
See dbus_connection_get_max_received_size().
DBusCredentials * _dbus_transport_get_credentials(DBusTransport *transport)
If the transport has already been authenticated, return its credentials.
dbus_bool_t _dbus_transport_set_connection(DBusTransport *transport, DBusConnection *connection)
Sets the connection using this transport.
void _dbus_transport_set_unix_user_function(DBusTransport *transport, DBusAllowUnixUserFunction function, void *data, DBusFreeFunction free_data_function, void **old_data, DBusFreeFunction *old_free_data_function)
See dbus_connection_set_unix_user_function().
long _dbus_transport_get_max_message_unix_fds(DBusTransport *transport)
See dbus_connection_get_max_message_unix_fds().
dbus_bool_t _dbus_transport_init_base(DBusTransport *transport, const DBusTransportVTable *vtable, const DBusString *server_guid, const DBusString *address)
Initializes the base class members of DBusTransport.
void _dbus_transport_set_max_received_unix_fds(DBusTransport *transport, long n)
See dbus_connection_set_max_received_unix_fds().
void _dbus_transport_unref(DBusTransport *transport)
Decrements the reference count for the transport.
dbus_bool_t _dbus_transport_can_pass_unix_fd(DBusTransport *transport)
Returns TRUE if the transport supports sending unix fds.
dbus_bool_t _dbus_transport_try_to_authenticate(DBusTransport *transport)
Returns TRUE if we have been authenticated.
void _dbus_transport_do_iteration(DBusTransport *transport, unsigned int flags, int timeout_milliseconds)
Performs a single poll()/select() on the transport's file descriptors and then reads/writes data as a...
long _dbus_transport_get_max_received_unix_fds(DBusTransport *transport)
See dbus_connection_set_max_received_unix_fds().
dbus_bool_t _dbus_transport_get_is_connected(DBusTransport *transport)
Returns TRUE if the transport has not been disconnected.
void _dbus_transport_set_max_message_unix_fds(DBusTransport *transport, long n)
See dbus_connection_set_max_message_unix_fds().
void _dbus_transport_set_pending_fds_function(DBusTransport *transport, void(*callback)(void *), void *data)
Register a function to be called whenever the number of pending file descriptors in the loader change...
void _dbus_transport_set_windows_user_function(DBusTransport *transport, DBusAllowWindowsUserFunction function, void *data, DBusFreeFunction free_data_function, void **old_data, DBusFreeFunction *old_free_data_function)
See dbus_connection_set_windows_user_function().
long _dbus_transport_get_max_message_size(DBusTransport *transport)
See dbus_connection_get_max_message_size().
dbus_bool_t _dbus_transport_get_unix_process_id(DBusTransport *transport, unsigned long *pid)
See dbus_connection_get_unix_process_id().
DBusTransport * _dbus_transport_open(DBusAddressEntry *entry, DBusError *error)
Try to open a new transport for the given address entry.
const char * _dbus_transport_get_server_id(DBusTransport *transport)
Gets the id of the server we are connected to (see dbus_server_get_id()).
dbus_bool_t _dbus_transport_get_is_anonymous(DBusTransport *transport)
See dbus_connection_get_is_anonymous().
void _dbus_transport_finalize_base(DBusTransport *transport)
Finalizes base class members of DBusTransport.
dbus_bool_t _dbus_transport_get_unix_user(DBusTransport *transport, unsigned long *uid)
See dbus_connection_get_unix_user().
void _dbus_watch_sanitize_condition(DBusWatch *watch, unsigned int *condition)
Sanitizes the given condition so that it only contains flags that the DBusWatch requested.
DBusWatch * _dbus_watch_ref(DBusWatch *watch)
Increments the reference count of a DBusWatch object.
void _dbus_watch_unref(DBusWatch *watch)
Decrements the reference count of a DBusWatch object and finalizes the object if the count reaches ze...
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...
Internals of DBusAddressEntry.
Internal members of DBusAuth.
Implementation details of DBusConnection.
Internals of DBusCounter.
Object representing an exception.
void * data
Data stored at this element.
Implementation details of DBusMessageLoader.
Internals of DBusMessage.
The virtual table that must be implemented to create a new kind of transport.
dbus_bool_t(* get_socket_fd)(DBusTransport *transport, DBusSocket *fd_p)
Get socket file descriptor.
void(* disconnect)(DBusTransport *transport)
Disconnect this transport.
void(* live_messages_changed)(DBusTransport *transport)
Outstanding messages counter changed.
void(* do_iteration)(DBusTransport *transport, unsigned int flags, int timeout_milliseconds)
Called to do a single "iteration" (block on select/poll followed by reading or writing data).
dbus_bool_t(* handle_watch)(DBusTransport *transport, DBusWatch *watch, unsigned int flags)
The handle_watch method handles reading/writing data as indicated by the flags.
void(* finalize)(DBusTransport *transport)
The finalize method must free the transport.
dbus_bool_t(* connection_set)(DBusTransport *transport)
Called when transport->connection has been filled in.
Object representing a transport such as a socket.
unsigned int authenticated
Cache of auth state; use _dbus_transport_peek_is_authenticated() to query value.
DBusAllowWindowsUserFunction windows_user_function
Function for checking whether a user is authorized.
int refcount
Reference count.
long max_live_messages_size
Max total size of received messages.
long max_live_messages_unix_fds
Max total unix fds of received messages.
unsigned int allow_anonymous
TRUE if an anonymous client can connect
void * windows_user_data
Data for windows_user_function.
unsigned int is_server
TRUE if on the server side
unsigned int disconnected
TRUE if we are disconnected.
char * address
Address of the server we are connecting to (NULL for the server side of a transport)
unsigned int unused_bytes_recovered
TRUE if we've recovered unused bytes from auth
const DBusTransportVTable * vtable
Virtual methods for this instance.
DBusFreeFunction free_unix_user_data
Function to free unix_user_data.
unsigned int send_credentials_pending
TRUE if we need to send credentials
void * unix_user_data
Data for unix_user_function.
DBusConnection * connection
Connection owning this transport.
unsigned int receive_credentials_pending
TRUE if we need to receive credentials
DBusMessageLoader * loader
Message-loading buffer.
char * expected_guid
GUID we expect the server to have, NULL on server side or if we don't have an expectation.
DBusFreeFunction free_windows_user_data
Function to free windows_user_data.
DBusAllowUnixUserFunction unix_user_function
Function for checking whether a user is authorized.
DBusCredentials * credentials
Credentials of other end read from the socket.
DBusAuth * auth
Authentication conversation.
DBusCounter * live_messages
Counter for size/unix fds of all live messages.
Implementation of DBusWatch.