25#include "dbus-internals.h"
26#include "dbus-server-socket.h"
27#include "dbus-server-launchd.h"
28#include "dbus-transport-unix.h"
29#include "dbus-connection-internal.h"
30#include "dbus-sysdeps-unix.h"
31#include "dbus-string.h"
62 if (strcmp (method,
"systemd") == 0)
71 _DBUS_ASSERT_ERROR_IS_SET (error);
72 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
78 for (i = 0; i < n; i++)
90 if (*server_p ==
NULL)
96 return DBUS_SERVER_LISTEN_OK;
99 _DBUS_SET_OOM (error);
101 for (i = 0; i < n; i++)
108 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
110#ifdef DBUS_ENABLE_LAUNCHD
111 else if (strcmp (method,
"launchd") == 0)
114 if (launchd_env_var ==
NULL)
117 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
121 if (*server_p !=
NULL)
123 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
124 return DBUS_SERVER_LISTEN_OK;
128 _DBUS_ASSERT_ERROR_IS_SET(error);
129 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
138 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
139 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_I...
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.