27#include "dbus-internals.h"
28#include "dbus-server-socket.h"
29#include "dbus-server-launchd.h"
30#include "dbus-transport-unix.h"
31#include "dbus-connection-internal.h"
32#include "dbus-sysdeps-unix.h"
33#include "dbus-string.h"
64 if (strcmp (method,
"systemd") == 0)
73 _DBUS_ASSERT_ERROR_IS_SET (error);
74 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
80 for (i = 0; i < n; i++)
92 if (*server_p ==
NULL)
98 return DBUS_SERVER_LISTEN_OK;
101 _DBUS_SET_OOM (error);
103 for (i = 0; i < n; i++)
110 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
112#ifdef DBUS_ENABLE_LAUNCHD
113 else if (strcmp (method,
"launchd") == 0)
116 if (launchd_env_var ==
NULL)
119 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
123 if (*server_p !=
NULL)
125 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
126 return DBUS_SERVER_LISTEN_OK;
130 _DBUS_ASSERT_ERROR_IS_SET(error);
131 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
140 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
141 return DBUS_SERVER_LISTEN_NOT_HANDLED;
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.
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.
#define NULL
A null pointer, defined appropriately for C or C++.
void dbus_free(void *memory)
Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().
DBusServer * _dbus_server_new_for_launchd(const char *launchd_env_var, DBusError *error)
Creates a new server from launchd.
DBusServer * _dbus_server_new_for_socket(DBusSocket *fds, int n_fds, const DBusString *address, DBusNonceFile *noncefile, DBusError *error)
Creates a new server listening on the given file descriptor.
DBusServerListenResult _dbus_server_listen_platform_specific(DBusAddressEntry *entry, DBusServer **server_p, DBusError *error)
Tries to interpret the address entry in a platform-specific way, creating a platform-specific server ...
dbus_bool_t _dbus_string_append(DBusString *str, const char *buffer)
Appends a nul-terminated C-style string to a DBusString.
dbus_bool_t _dbus_string_init(DBusString *str)
Initializes a string.
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...
int _dbus_listen_systemd_sockets(DBusSocket **fds, DBusError *error)
Acquires one or more sockets passed in from systemd.
dbus_bool_t _dbus_append_address_from_socket(DBusSocket fd, DBusString *address, DBusError *error)
Read the address from the socket and append it to the string.
dbus_bool_t _dbus_close_socket(DBusSocket *fd, DBusError *error)
Closes a socket and invalidates it.
Internals of DBusAddressEntry.
Object representing an exception.
Internals of DBusServer object.