279
279
</td></tr><tr><td><code class="literal">VARIANT</code></td><td>
280
A variant type has a marshaled <code class="literal">SIGNATURE</code>
281
followed by a marshaled value with the type
282
given in the signature.
283
Unlike a message signature, the variant signature
284
can contain only a single complete type.
285
So "i", "ai" or "(ii)" is OK, but "ii" is not.
280
A variant type has a marshaled
281
<code class="literal">SIGNATURE</code> followed by a marshaled
282
value with the type given in the signature. Unlike
283
a message signature, the variant signature can
284
contain only a single complete type. So "i", "ai"
285
or "(ii)" is OK, but "ii" is not. Use of variants may not
286
cause a total message depth to be larger than 64, including
287
other container types such as structures.
287
289
1 (alignment of the signature)
288
290
</td></tr><tr><td><code class="literal">DICT_ENTRY</code></td><td>
1338
1340
</p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="transports-unix-domain-sockets-addresses"></a>Server Address Format</h4></div></div></div><p>
1339
1341
Unix domain socket addresses are identified by the "unix:" prefix
1340
1342
and support the following key/value pairs:
1341
</p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>path</td><td>(path)</td><td>path of the unix domain socket. If set, the "tmpdir" and "abstract" key must not be set.</td></tr><tr><td>tmpdir</td><td>(path)</td><td>temporary directory in which a socket file with a random file name starting with 'dbus-' will be created by the server. This key can only be used in server addresses, not in client addresses. If set, the "path" and "abstract" key must not be set.</td></tr><tr><td>abstract</td><td>(string)</td><td>unique string (path) in the abstract namespace. If set, the "path" or "tempdir" key must not be set.</td></tr></tbody></table></div></div></div><div class="sect2" title="TCP Sockets"><div class="titlepage"><div><div><h3 class="title"><a name="transports-tcp-sockets"></a>TCP Sockets</h3></div></div></div><p>
1343
</p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>path</td><td>(path)</td><td>path of the unix domain socket. If set, the "tmpdir" and "abstract" key must not be set.</td></tr><tr><td>tmpdir</td><td>(path)</td><td>temporary directory in which a socket file with a random file name starting with 'dbus-' will be created by the server. This key can only be used in server addresses, not in client addresses. If set, the "path" and "abstract" key must not be set.</td></tr><tr><td>abstract</td><td>(string)</td><td>unique string (path) in the abstract namespace. If set, the "path" or "tempdir" key must not be set.</td></tr></tbody></table></div></div></div><div class="sect2" title="launchd"><div class="titlepage"><div><div><h3 class="title"><a name="transports-launchd"></a>launchd</h3></div></div></div><p>
1344
launchd is a open-source server management system that replaces init, inetd
1345
and cron on Apple Mac OS X versions 10.4 and above. It provides a common session
1346
bus address for each user and deprecates the X11-enabled D-Bus launcher on OSX.
1348
launchd allocates a socket and provides it with the unix path through the
1349
DBUS_LAUNCHD_SESSION_BUS_SOCKET variable in launchd's environment. Every process
1350
spawned by launchd (or dbus-daemon, if it was started by launchd) can access
1351
it through its environment.
1352
Other processes can query for the launchd socket by executing:
1353
$ launchctl getenv DBUS_LAUNCHD_SESSION_BUS_SOCKET
1354
This is normally done by the D-Bus client library so doesn't have to be done
1357
launchd is not available on Microsoft Windows.
1358
</p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="transports-launchd-addresses"></a>Server Address Format</h4></div></div></div><p>
1359
launchd addresses are identified by the "launchd:" prefix
1360
and support the following key/value pairs:
1361
</p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>env</td><td>(environment variable)</td><td>path of the unix domain socket for the launchd created dbus-daemon.</td></tr></tbody></table></div></div></div><div class="sect2" title="TCP Sockets"><div class="titlepage"><div><div><h3 class="title"><a name="transports-tcp-sockets"></a>TCP Sockets</h3></div></div></div><p>
1342
1362
The tcp transport provides TCP/IP based connections between clients
1343
1363
located on the same or different hosts.
1385
1405
</p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>host</td><td>(string)</td><td>dns name or ip address</td></tr><tr><td>port</td><td>(number)</td><td>The tcp port the server will open. A zero value let the server
1386
1406
choose a free port provided from the underlaying operating system.
1387
1407
libdbus is able to retrieve the real used port from the server.
1388
</td></tr><tr><td>family</td><td>(string)</td><td>If set, provide the type of socket family either "ipv4" or "ipv6". If unset, the family is unspecified.</td></tr><tr><td>noncefile</td><td>(path)</td><td>file location containing the secret</td></tr></tbody></table></div></div></div></div><div class="sect1" title="Naming Conventions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="naming-conventions"></a>Naming Conventions</h2></div></div></div><p>
1408
</td></tr><tr><td>family</td><td>(string)</td><td>If set, provide the type of socket family either "ipv4" or "ipv6". If unset, the family is unspecified.</td></tr><tr><td>noncefile</td><td>(path)</td><td>file location containing the secret</td></tr></tbody></table></div></div></div></div><div class="sect1" title="Meta Transports"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="meta-transports"></a>Meta Transports</h2></div></div></div><p>
1409
Meta transports are a kind of transport with special enhancements or
1410
behavior. Currently available meta transports include: autolaunch
1411
</p><div class="sect2" title="Autolaunch"><div class="titlepage"><div><div><h3 class="title"><a name="meta-transports-autolaunch"></a>Autolaunch</h3></div></div></div><p>The autolaunch transport provides a way for dbus clients to autodetect
1412
a running dbus session bus and to autolaunch a session bus if not present.
1413
</p><div class="sect3" title="Server Address Format"><div class="titlepage"><div><div><h4 class="title"><a name="meta-transports-autolaunch-addresses"></a>Server Address Format</h4></div></div></div><p>
1414
Autolaunch addresses uses the "autolaunch:" prefix and support the
1415
following key/value pairs:
1416
</p><div class="informaltable"><table border="1"><colgroup><col><col><col></colgroup><thead><tr><th>Name</th><th>Values</th><th>Description</th></tr></thead><tbody><tr><td>scope</td><td>(string)</td><td>scope of autolaunch (Windows only)
1417
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>
1418
"*install-path" - limit session bus to dbus installation path.
1419
The dbus installation path is determined from the location of
1420
the shared dbus library. If the library is located in a 'bin'
1421
subdirectory the installation root is the directory above,
1422
otherwise the directory where the library lives is taken as
1424
</p><pre class="programlisting">
1425
<install-root>/bin/[lib]dbus-1.dll
1426
<install-root>/[lib]dbus-1.dll
1428
</p></li><li class="listitem"><p>
1429
"*user" - limit session bus to the recent user.
1430
</p></li><li class="listitem"><p>
1431
other values - specify dedicated session bus like "release",
1433
</p></li></ul></div>
1434
</td></tr></tbody></table></div></div><div class="sect3" title="Windows implementation"><div class="titlepage"><div><div><h4 class="title"><a name="meta-transports-autolaunch-windows-implementation"></a>Windows implementation</h4></div></div></div><p>
1435
On start, the server opens a platform specific transport, creates a mutex
1436
and a shared memory section containing the related session bus address.
1437
This mutex will be inspected by the dbus client library to detect a
1438
running dbus session bus. The access to the mutex and the shared memory
1439
section are protected by global locks.
1441
In the recent implementation the autolaunch transport uses a tcp transport
1442
on localhost with a port choosen from the operating system. This detail may
1443
change in the future.
1445
Disclaimer: The recent implementation is in an early state and may not
1446
work in all cirumstances and/or may have security issues. Because of this
1447
the implementation is not documentated yet.
1448
</p></div></div></div><div class="sect1" title="Naming Conventions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a name="naming-conventions"></a>Naming Conventions</h2></div></div></div><p>
1389
1449
D-Bus namespaces are all lowercase and correspond to reversed domain
1390
1450
names, as with Java. e.g. "org.freedesktop"
2007
2071
The root window property must have type <code class="literal">STRING</code>.
2008
2072
The environment variable should have precedence over the
2009
2073
root window property.
2011
[FIXME specify location of .service files, probably using
2012
DESKTOP_DIRS etc. from basedir specification, though login session
2013
bus is not really desktop-specific]
2014
</p></div><div class="sect3" title="System message bus"><div class="titlepage"><div><div><h4 class="title"><a name="message-bus-types-system"></a>System message bus</h4></div></div></div><p>
2074
</p><p>The address of the login session message bus is given in the
2075
<code class="literal">DBUS_SESSION_BUS_ADDRESS</code> environment variable. If
2076
DBUS_SESSION_BUS_ADDRESS is not set, or if it's set to the string
2077
"autolaunch:", the system should use platform-specific methods of
2078
locating a running D-Bus session server, or starting one if a running
2079
instance cannot be found. Note that this mechanism is not recommended
2080
for attempting to determine if a daemon is running. It is inherently
2081
racy to attempt to make this determination, since the bus daemon may
2082
be started just before or just after the determination is made.
2083
Therefore, it is recommended that applications do not try to make this
2084
determination for their functionality purposes, and instead they
2085
should attempt to start the server.</p><div class="sect4" title="X Windowing System"><div class="titlepage"><div><div><h5 class="title"><a name="message-bus-types-login-x-windows"></a>X Windowing System</h5></div></div></div><p>
2086
For the X Windowing System, the application must locate the
2087
window owner of the selection represented by the atom formed by
2089
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>the literal string "_DBUS_SESSION_BUS_SELECTION_"</p></li><li class="listitem"><p>the current user's username</p></li><li class="listitem"><p>the literal character '_' (underscore)</p></li><li class="listitem"><p>the machine's ID</p></li></ul></div><p>
2091
The following properties are defined for the window that owns
2093
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td>
2098
<p>_DBUS_SESSION_BUS_ADDRESS</p>
2100
<p>the actual address of the server socket</p>
2102
<p>_DBUS_SESSION_BUS_PID</p>
2104
<p>the PID of the server process</p>
2105
</td></tr></tbody></table></div><p>
2107
At least the _DBUS_SESSION_BUS_ADDRESS property MUST be
2108
present in this window.
2110
If the X selection cannot be located or if reading the
2111
properties from the window fails, the implementation MUST conclude
2112
that there is no D-Bus server running and proceed to start a new
2113
server. (See below on concurrency issues)
2115
Failure to connect to the D-Bus server address thus obtained
2116
MUST be treated as a fatal connection error and should be reported
2119
As an alternative, an implementation MAY find the information
2120
in the following file located in the current user's home directory,
2121
in subdirectory .dbus/session-bus/:
2122
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>the machine's ID</p></li><li class="listitem"><p>the literal character '-' (dash)</p></li><li class="listitem"><p>the X display without the screen number, with the
2123
following prefixes removed, if present: ":", "localhost:"
2124
."localhost.localdomain:". That is, a display of
2125
"localhost:10.0" produces just the number "10"</p></li></ul></div><p>
2127
The contents of this file NAME=value assignment pairs and
2128
lines starting with # are comments (no comments are allowed
2129
otherwise). The following variable names are defined:
2130
</p><div class="informaltable"><table border="1"><colgroup><col><col></colgroup><tbody><tr><td>
2135
<p>DBUS_SESSION_BUS_ADDRESS</p>
2137
<p>the actual address of the server socket</p>
2139
<p>DBUS_SESSION_BUS_PID</p>
2141
<p>the PID of the server process</p>
2143
<p>DBUS_SESSION_BUS_WINDOWID</p>
2145
<p>the window ID</p>
2146
</td></tr></tbody></table></div><p>
2148
At least the DBUS_SESSION_BUS_ADDRESS variable MUST be present
2151
Failure to open this file MUST be interpreted as absence of a
2152
running server. Therefore, the implementation MUST proceed to
2153
attempting to launch a new bus server if the file cannot be
2156
However, success in opening this file MUST NOT lead to the
2157
conclusion that the server is running. Thus, a failure to connect to
2158
the bus address obtained by the alternative method MUST NOT be
2159
considered a fatal error. If the connection cannot be established,
2160
the implementation MUST proceed to check the X selection settings or
2161
to start the server on its own.
2163
If the implementation concludes that the D-Bus server is not
2164
running it MUST attempt to start a new server and it MUST also
2165
ensure that the daemon started as an effect of the "autolaunch"
2166
mechanism provides the lookup mechanisms described above, so
2167
subsequent calls can locate the newly started server. The
2168
implementation MUST also ensure that if two or more concurrent
2169
initiations happen, only one server remains running and all other
2170
initiations are able to obtain the address of this server and
2171
connect to it. In other words, the implementation MUST ensure that
2172
the X selection is not present when it attempts to set it, without
2173
allowing another process to set the selection between the
2174
verification and the setting (e.g., by using XGrabServer /
2176
</p></div><div class="sect4"><div class="titlepage"><div><div><h5 class="title"><a name="id366057"></a></h5></div></div></div><p>
2177
[FIXME specify location of .service files, probably using
2178
DESKTOP_DIRS etc. from basedir specification, though login session
2179
bus is not really desktop-specific]
2180
</p></div></div><div class="sect3" title="System message bus"><div class="titlepage"><div><div><h4 class="title"><a name="message-bus-types-system"></a>System message bus</h4></div></div></div><p>
2015
2181
A computer may have a <em class="firstterm">system message bus</em>,
2016
2182
accessible to all applications on the system. This message bus may be
2017
2183
used to broadcast system events, such as adding new hardware devices,