sd_bus_set_server
systemd
sd_bus_set_server
3
sd_bus_set_server
sd_bus_get_bus_id
Configure server mode for a bus object
#include <systemd/sd-bus.h>
int sd_bus_set_server
sd_bus *bus
int b
sd_id128_t id
int sd_bus_get_bus_id
sd_bus *bus
sd_id128_t *id
Description
sd_bus_set_server() configures the bus object as a server for direct
D-Bus connections. b enables/disables the server mode. If zero, the
server mode is disabled. Otherwise, the server mode is enabled. Configuring a bus object as a
server is required to allow establishing direct connections between two peers without going via
the D-Bus daemon. id must contain a 128-bit integer id for the server. If
clients add a guid field to their D-Bus address string, the server id must match this guid or
the D-Bus authentication handshake will fail. If no specific id is defined for the server,
sd_id128_randomize3
can be used to generate a random id instead.
sd_bus_get_bus_id() stores the D-Bus server id configured using
sd_bus_set_server() (for server bus objects) or received during
D-Bus authentication (for client bus objects) in id.
Return Value
On success, these functions return a non-negative integer. On failure, they return a
negative errno-style error code.
Errors
Returned errors may indicate the following problems:
-ECHILD
The bus connection has been created in a different process.
-EPERM
The bus connection has already been started.
-ENOPKG
The bus cannot be resolved.
-EINVAL
A required parameter was NULL or
b was zero and id did not equal
SD_ID128_NULL.
-ENOTCONN
The bus is not connected.
See Also
systemd1,
sd-bus3