D-Bus: dbus-server-socket.c Source File

D-Bus 1.8.16

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

- File List

dbus-server-socket.c
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-server-socket.c Server implementation for sockets
3 *
4 * Copyright (C) 2002, 2003, 2004, 2006 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
24 #include <config.h>
25 #include "dbus-internals.h"
26 #include "dbus-server-socket.h"
27 #include "dbus-transport-socket.h"
28 #include "dbus-connection-internal.h"
29 #include "dbus-memory.h"
30 #include "dbus-nonce.h"
31 #include "dbus-string.h"
32
44 typedef struct DBusServerSocket DBusServerSocket;
45
50 struct DBusServerSocket
51 {
52 DBusServer base;
53 int n_fds;
54 int *fds;
55 DBusWatch **watch;
56 char *socket_name;
57 DBusNonceFile *noncefile;
58 };
59
60 static void
61 socket_finalize (DBusServer *server)
62 {
63 DBusServerSocket *socket_server = (DBusServerSocket*) server;
64 int i;
65
66 _dbus_server_finalize_base (server);
67
68 for (i = 0 ; i < socket_server->n_fds ; i++)
69 if (socket_server->watch[i])
70 {
71 _dbus_watch_unref (socket_server->watch[i]);
72 socket_server->watch[i] = NULL;
73 }
74
75 dbus_free (socket_server->fds);
76 dbus_free (socket_server->watch);
77 dbus_free (socket_server->socket_name);
78 if (socket_server->noncefile)
79 _dbus_noncefile_delete (socket_server->noncefile, NULL);
80 dbus_free (socket_server->noncefile);
81 dbus_free (server);
82 }
83
84 /* Return value is just for memory, not other failures. */
85 static dbus_bool_t
86 handle_new_client_fd_and_unlock (DBusServer *server,
87 int client_fd)
88 {
89 DBusConnection *connection;
90 DBusTransport *transport;
91 DBusNewConnectionFunction new_connection_function;
92 void *new_connection_data;
93
94 _dbus_verbose ("Creating new client connection with fd %d\n", client_fd);
95
96 HAVE_LOCK_CHECK (server);
97
98 if (!_dbus_set_fd_nonblocking (client_fd, NULL))
99 {
100 SERVER_UNLOCK (server);
101 return TRUE;
102 }
103
104 transport = _dbus_transport_new_for_socket (client_fd, &server->guid_hex, NULL);
105 if (transport == NULL)
106 {
107 _dbus_close_socket (client_fd, NULL);
108 SERVER_UNLOCK (server);
109 return FALSE;
110 }
111
112 if (!_dbus_transport_set_auth_mechanisms (transport,
113 (const char **) server->auth_mechanisms))
114 {
115 _dbus_transport_unref (transport);
116 SERVER_UNLOCK (server);
117 return FALSE;
118 }
119
120 /* note that client_fd is now owned by the transport, and will be
121 * closed on transport disconnection/finalization
122 */
123
124 connection = _dbus_connection_new_for_transport (transport);
125 _dbus_transport_unref (transport);
126 transport = NULL; /* now under the connection lock */
127
128 if (connection == NULL)
129 {
130 SERVER_UNLOCK (server);
131 return FALSE;
132 }
133
134 /* See if someone wants to handle this new connection, self-referencing
135 * for paranoia.
136 */
137 new_connection_function = server->new_connection_function;
138 new_connection_data = server->new_connection_data;
139
140 _dbus_server_ref_unlocked (server);
141 SERVER_UNLOCK (server);
142
143 if (new_connection_function)
144 {
145 (* new_connection_function) (server, connection,
146 new_connection_data);
147 }
148 dbus_server_unref (server);
149
150 /* If no one grabbed a reference, the connection will die. */
151 _dbus_connection_close_if_only_one_ref (connection);
152 dbus_connection_unref (connection);
153
154 return TRUE;
155 }
156
157 static dbus_bool_t
158 socket_handle_watch (DBusWatch *watch,
159 unsigned int flags,
160 void *data)
161 {
162 DBusServer *server = data;
163 DBusServerSocket *socket_server = data;
164
165 #ifndef DBUS_DISABLE_ASSERT
166 int i;
167 dbus_bool_t found = FALSE;
168 #endif
169
170 SERVER_LOCK (server);
171
172 #ifndef DBUS_DISABLE_ASSERT
173 for (i = 0 ; i < socket_server->n_fds ; i++)
174 {
175 if (socket_server->watch[i] == watch)
176 found = TRUE;
177 }
178 _dbus_assert (found);
179 #endif
180
181 _dbus_verbose ("Handling client connection, flags 0x%x\n", flags);
182
183 if (flags & DBUS_WATCH_READABLE)
184 {
185 int client_fd;
186 int listen_fd;
187
188 listen_fd = dbus_watch_get_socket (watch);
189
190 if (socket_server->noncefile)
191 client_fd = _dbus_accept_with_noncefile (listen_fd, socket_server->noncefile);
192 else
193 client_fd = _dbus_accept (listen_fd);
194
195 if (client_fd < 0)
196 {
197 /* EINTR handled for us */
198
199 if (_dbus_get_is_errno_eagain_or_ewouldblock ())
200 _dbus_verbose ("No client available to accept after all\n");
201 else
202 _dbus_verbose ("Failed to accept a client connection: %s\n",
203 _dbus_strerror_from_errno ());
204
205 SERVER_UNLOCK (server);
206 }
207 else
208 {
209 if (!handle_new_client_fd_and_unlock (server, client_fd))
210 _dbus_verbose ("Rejected client connection due to lack of memory\n");
211 }
212 }
213
214 if (flags & DBUS_WATCH_ERROR)
215 _dbus_verbose ("Error on server listening socket\n");
216
217 if (flags & DBUS_WATCH_HANGUP)
218 _dbus_verbose ("Hangup on server listening socket\n");
219
220 return TRUE;
221 }
222
223 static void
224 socket_disconnect (DBusServer *server)
225 {
226 DBusServerSocket *socket_server = (DBusServerSocket*) server;
227 int i;
228
229 HAVE_LOCK_CHECK (server);
230
231 for (i = 0 ; i < socket_server->n_fds ; i++)
232 {
233 if (socket_server->watch[i])
234 {
235 _dbus_server_remove_watch (server,
236 socket_server->watch[i]);
237 _dbus_watch_invalidate (socket_server->watch[i]);
238 _dbus_watch_unref (socket_server->watch[i]);
239 socket_server->watch[i] = NULL;
240 }
241
242 _dbus_close_socket (socket_server->fds[i], NULL);
243 socket_server->fds[i] = -1;
244 }
245
246 if (socket_server->socket_name != NULL)
247 {
248 DBusString tmp;
249 _dbus_string_init_const (&tmp, socket_server->socket_name);
250 _dbus_delete_file (&tmp, NULL);
251 }
252
253 if (server->published_address)
254 _dbus_daemon_unpublish_session_bus_address();
255
256 HAVE_LOCK_CHECK (server);
257 }
258
259 static const DBusServerVTable socket_vtable = {
260 socket_finalize,
261 socket_disconnect
262 };
263
279 DBusServer*
280 _dbus_server_new_for_socket (int *fds,
281 int n_fds,
282 const DBusString *address,
283 DBusNonceFile *noncefile)
284 {
285 DBusServerSocket *socket_server;
286 DBusServer *server;
287 int i;
288
289 socket_server = dbus_new0 (DBusServerSocket, 1);
290 if (socket_server == NULL)
291 return NULL;
292
293 socket_server->noncefile = noncefile;
294
295 socket_server->fds = dbus_new (int, n_fds);
296 if (!socket_server->fds)
297 goto failed_0;
298
299 socket_server->watch = dbus_new0 (DBusWatch *, n_fds);
300 if (!socket_server->watch)
301 goto failed_1;
302
303 for (i = 0 ; i < n_fds ; i++)
304 {
305 DBusWatch *watch;
306
307 watch = _dbus_watch_new (fds[i],
308 DBUS_WATCH_READABLE,
309 TRUE,
310 socket_handle_watch, socket_server,
311 NULL);
312 if (watch == NULL)
313 goto failed_2;
314
315 socket_server->n_fds++;
316 socket_server->fds[i] = fds[i];
317 socket_server->watch[i] = watch;
318 }
319
320 if (!_dbus_server_init_base (&socket_server->base,
321 &socket_vtable, address))
322 goto failed_2;
323
324 server = (DBusServer*)socket_server;
325
326 SERVER_LOCK (server);
327
328 for (i = 0 ; i < n_fds ; i++)
329 {
330 if (!_dbus_server_add_watch (&socket_server->base,
331 socket_server->watch[i]))
332 {
333 int j;
334 for (j = 0 ; j < i ; j++)
335 _dbus_server_remove_watch (server,
336 socket_server->watch[j]);
337
338 SERVER_UNLOCK (server);
339 _dbus_server_finalize_base (&socket_server->base);
340 goto failed_2;
341 }
342 }
343
344 SERVER_UNLOCK (server);
345
346 _dbus_server_trace_ref (&socket_server->base, 0, 1, "new_for_socket");
347 return (DBusServer*) socket_server;
348
349 failed_2:
350 for (i = 0 ; i < n_fds ; i++)
351 {
352 if (socket_server->watch[i] != NULL)
353 {
354 _dbus_watch_unref (socket_server->watch[i]);
355 socket_server->watch[i] = NULL;
356 }
357 }
358 dbus_free (socket_server->watch);
359
360 failed_1:
361 dbus_free (socket_server->fds);
362
363 failed_0:
364 dbus_free (socket_server);
365 return NULL;
366 }
367
387 DBusServer*
388 _dbus_server_new_for_tcp_socket (const char *host,
389 const char *bind,
390 const char *port,
391 const char *family,
392 DBusError *error,
393 dbus_bool_t use_nonce)
394 {
395 DBusServer *server;
396 int *listen_fds = NULL;
397 int nlisten_fds = 0, i;
398 DBusString address;
399 DBusString host_str;
400 DBusString port_str;
401 DBusNonceFile *noncefile;
402
403 _DBUS_ASSERT_ERROR_IS_CLEAR (error);
404
405 noncefile = NULL;
406
407 if (!_dbus_string_init (&address))
408 {
409 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
410 return NULL;
411 }
412
413 if (!_dbus_string_init (&port_str))
414 {
415 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
416 goto failed_0;
417 }
418
419 if (host == NULL)
420 host = "localhost";
421
422 if (port == NULL)
423 port = "0";
424
425 if (bind == NULL)
426 bind = host;
427 else if (strcmp (bind, "*") == 0)
428 bind = NULL;
429
430 nlisten_fds =_dbus_listen_tcp_socket (bind, port, family,
431 &port_str,
432 &listen_fds, error);
433 if (nlisten_fds <= 0)
434 {
435 _DBUS_ASSERT_ERROR_IS_SET(error);
436 goto failed_1;
437 }
438
439 _dbus_string_init_const (&host_str, host);
440 if (!_dbus_string_append (&address, use_nonce ? "nonce-tcp:host=" : "tcp:host=") ||
441 !_dbus_address_append_escaped (&address, &host_str) ||
442 !_dbus_string_append (&address, ",port=") ||
443 !_dbus_string_append (&address, _dbus_string_get_const_data(&port_str)))
444 {
445 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
446 goto failed_2;
447 }
448 if (family &&
449 (!_dbus_string_append (&address, ",family=") ||
450 !_dbus_string_append (&address, family)))
451 {
452 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
453 goto failed_2;
454 }
455
456 if (use_nonce)
457 {
458 noncefile = dbus_new0 (DBusNonceFile, 1);
459 if (noncefile == NULL)
460 {
461 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
462 goto failed_2;
463 }
464
465 if (!_dbus_noncefile_create (noncefile, error))
466 goto failed_3;
467
468 if (!_dbus_string_append (&address, ",noncefile=") ||
469 !_dbus_address_append_escaped (&address, _dbus_noncefile_get_path (noncefile)))
470 {
471 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
472 goto failed_4;
473 }
474
475 }
476
477 server = _dbus_server_new_for_socket (listen_fds, nlisten_fds, &address, noncefile);
478 if (server == NULL)
479 {
480 dbus_set_error (error, DBUS_ERROR_NO_MEMORY, NULL);
481 if (noncefile != NULL)
482 goto failed_4;
483 else
484 goto failed_2;
485 }
486
487 _dbus_string_free (&port_str);
488 _dbus_string_free (&address);
489 dbus_free(listen_fds);
490
491 return server;
492
493 failed_4:
494 _dbus_noncefile_delete (noncefile, NULL);
495
496 failed_3:
497 dbus_free (noncefile);
498
499 failed_2:
500 for (i = 0 ; i < nlisten_fds ; i++)
501 _dbus_close_socket (listen_fds[i], NULL);
502 dbus_free(listen_fds);
503
504 failed_1:
505 _dbus_string_free (&port_str);
506
507 failed_0:
508 _dbus_string_free (&address);
509
510 return NULL;
511 }
512
525 DBusServerListenResult
526 _dbus_server_listen_socket (DBusAddressEntry *entry,
527 DBusServer **server_p,
528 DBusError *error)
529 {
530 const char *method;
531
532 *server_p = NULL;
533
534 method = dbus_address_entry_get_method (entry);
535
536 if (strcmp (method, "tcp") == 0 || strcmp (method, "nonce-tcp") == 0)
537 {
538 const char *host;
539 const char *port;
540 const char *bind;
541 const char *family;
542
543 host = dbus_address_entry_get_value (entry, "host");
544 bind = dbus_address_entry_get_value (entry, "bind");
545 port = dbus_address_entry_get_value (entry, "port");
546 family = dbus_address_entry_get_value (entry, "family");
547
548 *server_p = _dbus_server_new_for_tcp_socket (host, bind, port,
549 family, error, strcmp (method, "nonce-tcp") == 0 ? TRUE : FALSE);
550
551 if (*server_p)
552 {
553 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
554 return DBUS_SERVER_LISTEN_OK;
555 }
556 else
557 {
558 _DBUS_ASSERT_ERROR_IS_SET(error);
559 return DBUS_SERVER_LISTEN_DID_NOT_CONNECT;
560 }
561 }
562 else
563 {
564 _DBUS_ASSERT_ERROR_IS_CLEAR(error);
565 return DBUS_SERVER_LISTEN_NOT_HANDLED;
566 }
567 }
568
578 void
579 _dbus_server_socket_own_filename (DBusServer *server,
580 char *filename)
581 {
582 DBusServerSocket *socket_server = (DBusServerSocket*) server;
583
584 socket_server->socket_name = filename;
585 }
586
587
_dbus_string_append
dbus_bool_t _dbus_string_append(DBusString *str, const char *buffer)
Appends a nul-terminated C-style string to a DBusString.
Definition: dbus-string.c:918
_dbus_server_add_watch
dbus_bool_t _dbus_server_add_watch(DBusServer *server, DBusWatch *watch)
Adds a watch for this server, chaining out to application-provided watch handlers.
Definition: dbus-server.c:288
DBusServerSocket::noncefile
DBusNonceFile * noncefile
Nonce file used to authenticate clients.
Definition: dbus-server-socket.c:57
DBusWatch
Implementation of DBusWatch.
Definition: dbus-watch.c:40
NULL
#define NULL
A null pointer, defined appropriately for C or C++.
dbus_free
void dbus_free(void *memory)
Frees a block of memory previously allocated by dbus_malloc() or dbus_malloc0().
Definition: dbus-memory.c:701
_dbus_watch_invalidate
void _dbus_watch_invalidate(DBusWatch *watch)
Clears the file descriptor from a now-invalid watch object so that no one tries to use it...
Definition: dbus-watch.c:169
dbus_new
#define dbus_new(type, count)
Safe macro for using dbus_malloc().
Definition: dbus-memory.h:58
DBusServer
Internals of DBusServer object.
Definition: dbus-server-protected.h:56
_dbus_assert
#define _dbus_assert(condition)
Aborts with an error message if the condition is false.
Definition: dbus-internals.h:135
dbus_address_entry_get_method
const char * dbus_address_entry_get_method(DBusAddressEntry *entry)
Returns the method string of an address entry.
Definition: dbus-address.c:227
_dbus_connection_close_if_only_one_ref
void _dbus_connection_close_if_only_one_ref(DBusConnection *connection)
Used internally to handle the semantics of dbus_server_set_new_connection_function().
Definition: dbus-connection.c:2146
_dbus_accept
int _dbus_accept(int listen_fd)
Accepts a connection on a listening socket.
Definition: dbus-sysdeps-unix.c:1967
DBusConnection
Implementation details of DBusConnection.
Definition: dbus-connection.c:256
_dbus_string_init
dbus_bool_t _dbus_string_init(DBusString *str)
Initializes a string.
Definition: dbus-string.c:175
_dbus_server_ref_unlocked
void _dbus_server_ref_unlocked(DBusServer *server)
Like dbus_server_ref() but does not acquire the lock (must already be held)
Definition: dbus-server.c:448
_dbus_transport_new_for_socket
DBusTransport * _dbus_transport_new_for_socket(int fd, const DBusString *server_guid, const DBusString *address)
Creates a new transport for the given socket file descriptor.
Definition: dbus-transport-socket.c:1256
DBusNewConnectionFunction
void(* DBusNewConnectionFunction)(DBusServer *server, DBusConnection *new_connection, void *data)
Called when a new connection to the server is available.
Definition: dbus-server.h:47
DBusServerSocket::fds
int * fds
File descriptor or -1 if disconnected.
Definition: dbus-server-socket.c:54
DBusServer::new_connection_function
DBusNewConnectionFunction new_connection_function
Callback to invoke when a new connection is created.
Definition: dbus-server-protected.h:76
_dbus_server_new_for_tcp_socket
DBusServer * _dbus_server_new_for_tcp_socket(const char *host, const char *bind, const char *port, const char *family, DBusError *error, dbus_bool_t use_nonce)
Creates a new server listening on TCP.
Definition: dbus-server-socket.c:388
DBusServer::auth_mechanisms
char ** auth_mechanisms
Array of allowed authentication mechanisms.
Definition: dbus-server-protected.h:85
_dbus_transport_set_auth_mechanisms
dbus_bool_t _dbus_transport_set_auth_mechanisms(DBusTransport *transport, const char **mechanisms)
Sets the SASL authentication mechanisms supported by this transport.
Definition: dbus-transport.c:1496
DBusNonceFile
Definition: dbus-nonce.h:35
dbus_address_entry_get_value
const char * dbus_address_entry_get_value(DBusAddressEntry *entry, const char *key)
Returns a value from a key of an entry.
Definition: dbus-address.c:244
DBusServerSocket
Implementation details of DBusServerSocket.
Definition: dbus-server-socket.c:50
dbus_new0
#define dbus_new0(type, count)
Safe macro for using dbus_malloc0().
Definition: dbus-memory.h:59
DBusString
Definition: dbus-string.h:42
dbus_bool_t
dbus_uint32_t dbus_bool_t
A boolean, valid values are TRUE and FALSE.
Definition: dbus-types.h:35
_dbus_string_init_const
void _dbus_string_init_const(DBusString *str, const char *value)
Initializes a constant string.
Definition: dbus-string.c:190
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_server_socket_own_filename
void _dbus_server_socket_own_filename(DBusServer *server, char *filename)
This is a bad hack since it's really unix domain socket specific.
Definition: dbus-server-socket.c:579
_dbus_server_new_for_socket
DBusServer * _dbus_server_new_for_socket(int *fds, int n_fds, const DBusString *address, DBusNonceFile *noncefile)
Creates a new server listening on the given file descriptor.
Definition: dbus-server-socket.c:280
DBusAddressEntry
Internals of DBusAddressEntry.
Definition: dbus-address.c:43
_dbus_server_remove_watch
void _dbus_server_remove_watch(DBusServer *server, DBusWatch *watch)
Removes a watch previously added with _dbus_server_remove_watch().
Definition: dbus-server.c:304
DBusError
Object representing an exception.
Definition: dbus-errors.h:48
_dbus_address_append_escaped
dbus_bool_t _dbus_address_append_escaped(DBusString *escaped, const DBusString *unescaped)
Appends an escaped version of one string to another string, using the D-Bus address escaping mechanis...
Definition: dbus-address.c:104
_dbus_server_init_base
dbus_bool_t _dbus_server_init_base(DBusServer *server, const DBusServerVTable *vtable, const DBusString *address)
Initializes the members of the DBusServer base class.
Definition: dbus-server.c:111
dbus_set_error
void dbus_set_error(DBusError *error, const char *name, const char *format,...)
Assigns an error name and message to a DBusError.
Definition: dbus-errors.c:354
_dbus_server_finalize_base
void _dbus_server_finalize_base(DBusServer *server)
Finalizes the members of the DBusServer base class.
Definition: dbus-server.c:193
DBusServerVTable
Virtual table to be implemented by all server "subclasses".
Definition: dbus-server-protected.h:43
dbus_server_unref
void dbus_server_unref(DBusServer *server)
Decrements the reference count of a DBusServer.
Definition: dbus-server.c:720
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_connection_new_for_transport
DBusConnection * _dbus_connection_new_for_transport(DBusTransport *transport)
Creates a new connection for the given transport.
Definition: dbus-connection.c:1249
_dbus_string_free
void _dbus_string_free(DBusString *str)
Frees a string created by _dbus_string_init().
Definition: dbus-string.c:242
TRUE
#define TRUE
Expands to "1".
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
DBusServer::published_address
dbus_bool_t published_address
flag which indicates that server has published its bus address.
Definition: dbus-server-protected.h:70
DBusTransport
Object representing a transport such as a socket.
Definition: dbus-transport-protected.h:80
DBusServer::new_connection_data
void * new_connection_data
Data for new connection callback.
Definition: dbus-server-protected.h:78
_dbus_strerror_from_errno
const char * _dbus_strerror_from_errno(void)
Get error message from errno.
Definition: dbus-sysdeps.c:783
_dbus_server_listen_socket
DBusServerListenResult _dbus_server_listen_socket(DBusAddressEntry *entry, DBusServer **server_p, DBusError *error)
Tries to interpret the address entry for various socket-related addresses (well, currently only tcp a...
Definition: dbus-server-socket.c:526
DBusServerSocket::base
DBusServer base
Parent class members.
Definition: dbus-server-socket.c:52
_dbus_watch_new
DBusWatch * _dbus_watch_new(int fd, unsigned int flags, dbus_bool_t enabled, DBusWatchHandler handler, void *data, DBusFreeFunction free_data_function)
Creates a new DBusWatch.
Definition: dbus-watch.c:88
DBusServerSocket::socket_name
char * socket_name
Name of domain socket, to unlink if appropriate.
Definition: dbus-server-socket.c:56
_dbus_get_is_errno_eagain_or_ewouldblock
dbus_bool_t _dbus_get_is_errno_eagain_or_ewouldblock(void)
See if errno is EAGAIN or EWOULDBLOCK (this has to be done differently for Winsock so is abstracted) ...
Definition: dbus-sysdeps-unix.c:3913
DBusServer::guid_hex
DBusString guid_hex
Hex-encoded version of GUID.
Definition: dbus-server-protected.h:64
DBUS_ERROR_NO_MEMORY
#define DBUS_ERROR_NO_MEMORY
There was not enough memory to complete an operation.
Definition: dbus-protocol.h:352
FALSE
#define FALSE
Expands to "0".
DBusServerSocket::n_fds
int n_fds
Number of active file handles.
Definition: dbus-server-socket.c:53
_dbus_watch_unref
void _dbus_watch_unref(DBusWatch *watch)
Decrements the reference count of a DBusWatch object and finalizes the object if the count reaches ze...
Definition: dbus-watch.c:138
DBUS_WATCH_READABLE
As in POLLIN.
Definition: dbus-connection.h:60
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_close_socket
dbus_bool_t _dbus_close_socket(int fd, DBusError *error)
Closes a socket.
Definition: dbus-sysdeps-unix.c:201
_dbus_delete_file
dbus_bool_t _dbus_delete_file(const DBusString *filename, DBusError *error)
Deletes the given file.
Definition: dbus-file-unix.c:399
_dbus_transport_unref
void _dbus_transport_unref(DBusTransport *transport)
Decrements the reference count for the transport.
Definition: dbus-transport.c:477
_dbus_listen_tcp_socket
int _dbus_listen_tcp_socket(const char *host, const char *port, const char *family, DBusString *retport, int **fds_p, DBusError *error)
Creates a socket and binds it to the given path, then listens on the socket.
Definition: dbus-sysdeps-unix.c:1377
DBusServerSocket::watch
DBusWatch ** watch
File descriptor watch.
Definition: dbus-server-socket.c:55