From 7fffaafaf2e0ef88b0d9835a0da83173cd3438bb Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 21 Apr 2020 19:08:25 +0200 Subject: [PATCH 1/2] sd-bus: Rewrap sd_bus_set_server docs at 109 columns --- man/sd_bus_set_server.xml | 59 +++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 31 deletions(-) diff --git a/man/sd_bus_set_server.xml b/man/sd_bus_set_server.xml index 6b93b92594..309a535f51 100644 --- a/man/sd_bus_set_server.xml +++ b/man/sd_bus_set_server.xml @@ -64,54 +64,51 @@ 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_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_is_server() returns whether the server mode is enabled for - the given bus object. + sd_bus_is_server() returns whether the server mode is enabled for the given + bus object. 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. + sd_bus_set_server() (for server bus objects) or received during D-Bus authentication + (for client bus objects) in id. - sd_bus_set_bus_client() configures the bus object as a D-Bus daemon - client. b enables/disables the client mode. If zero, the client mode is - disabled and the bus object should connect directly to a D-Bus server. Otherwise, the client - mode is enabled and the bus object should connect to a D-Bus daemon. When connecting to an - existing bus using any of the functions in the - sd_bus_open3 + sd_bus_set_bus_client() configures the bus object as a D-Bus daemon client. + b enables/disables the client mode. If zero, the client mode is disabled and the + bus object should connect directly to a D-Bus server. Otherwise, the client mode is enabled and the bus + object should connect to a D-Bus daemon. When connecting to an existing bus using any of the functions in + the sd_bus_open3 family of functions or any of the functions in the - sd_bus_default3 - family of functions, the bus object is automatically configured as a bus client. However, when - connecting to a D-Bus daemon by calling + sd_bus_default3 family + of functions, the bus object is automatically configured as a bus client. However, when connecting to a + D-Bus daemon by calling sd_bus_set_address3 followed by - sd_bus_start3, - the bus object should be manually configured as a bus client using - sd_bus_set_bus_client(). By default, a bus object is not configured as a - D-Bus daemon client. + sd_bus_start3, the bus + object should be manually configured as a bus client using sd_bus_set_bus_client(). + By default, a bus object is not configured as a D-Bus daemon client. - sd_bus_is_bus_client() returns whether the client mode is - enabled/disabled for the given bus object. + sd_bus_is_bus_client() returns whether the client mode is enabled/disabled for + the given bus object. Return Value On success, sd_bus_set_server(), - sd_bus_get_bus_id() and sd_bus_set_bus_client() return - a non-negative integer. On failure, they return a negative errno-style error code. + sd_bus_get_bus_id() and sd_bus_set_bus_client() return a + non-negative integer. On failure, they return a negative errno-style error code. - sd_bus_is_server() and sd_bus_is_bus_client() - return a positive integer when the server or client mode is enabled, respectively. Otherwise, - they return zero. + sd_bus_is_server() and sd_bus_is_bus_client() return a + positive integer when the server or client mode is enabled, respectively. Otherwise, they return zero. From 0eb5b641c5f1d5160cd87cca016755dc45f15b33 Mon Sep 17 00:00:00 2001 From: Daan De Meyer Date: Tue, 21 Apr 2020 19:33:25 +0200 Subject: [PATCH 2/2] sd-bus: Add sd_bus_set/is_monitor docs --- man/rules/meson.build | 4 +++- man/sd-bus.xml | 2 ++ man/sd_bus_set_server.xml | 39 +++++++++++++++++++++++++++++++++------ 3 files changed, 38 insertions(+), 7 deletions(-) diff --git a/man/rules/meson.build b/man/rules/meson.build index 222c0d2919..656caece76 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -407,8 +407,10 @@ manpages = [ '3', ['sd_bus_get_bus_id', 'sd_bus_is_bus_client', + 'sd_bus_is_monitor', 'sd_bus_is_server', - 'sd_bus_set_bus_client'], + 'sd_bus_set_bus_client', + 'sd_bus_set_monitor'], ''], ['sd_bus_set_watch_bind', '3', ['sd_bus_get_watch_bind'], ''], ['sd_bus_slot_get_bus', diff --git a/man/sd-bus.xml b/man/sd-bus.xml index 9918e0c737..c576578cf2 100644 --- a/man/sd-bus.xml +++ b/man/sd-bus.xml @@ -84,6 +84,7 @@ sd_bus_get_scope3, sd_bus_get_tid3, sd_bus_get_unique_name3, +sd_bus_is_monitor3, sd_bus_is_bus_client3, sd_bus_is_server3, sd_bus_message_append3, @@ -131,6 +132,7 @@ sd_bus_set_description3, sd_bus_set_exit_on_disconnect3, sd_bus_set_method_call_timeout3, +sd_bus_set_monitor3, sd_bus_set_property3, sd_bus_set_propertyv3, sd_bus_set_sender3, diff --git a/man/sd_bus_set_server.xml b/man/sd_bus_set_server.xml index 309a535f51..625dfd4468 100644 --- a/man/sd_bus_set_server.xml +++ b/man/sd_bus_set_server.xml @@ -22,8 +22,10 @@ sd_bus_get_bus_id sd_bus_set_bus_client sd_bus_is_bus_client + sd_bus_set_monitor + sd_bus_is_monitor - Configure direct connection mode for a bus object + Configure connection mode for a bus object @@ -58,6 +60,17 @@ int sd_bus_is_bus_client sd_bus *bus + + + int sd_bus_set_monitor + sd_bus *bus + int b + + + + int sd_bus_is_monitor + sd_bus *bus + @@ -98,18 +111,32 @@ sd_bus_is_bus_client() returns whether the client mode is enabled/disabled for the given bus object. + + sd_bus_set_monitor() configures the bus object as a D-Bus monitor object. + b enables/disables the monitor mode. If zero, the monitor mode is disabled. If + non-zero, the monitor mode is enabled. When the monitor mode is enabled, no messages may be sent via the + bus object and it may not expose any objects on the bus. To start monitoring messages, call the + org.freedesktop.DBus.Monitoring.BecomeMonitor method of the D-Bus daemon and pass + a list of matches indicating which messages to intercept. See + + The D-Bus specification for more information. + + sd_bus_is_monitor() returns whether the monitor mode is enabled/disabled for + the given bus object. + Return Value On success, sd_bus_set_server(), - sd_bus_get_bus_id() and sd_bus_set_bus_client() return a - non-negative integer. On failure, they return a negative errno-style error code. + sd_bus_get_bus_id(), sd_bus_set_bus_client() and + sd_bus_set_monitor() return a non-negative integer. On failure, they return a + negative errno-style error code. - sd_bus_is_server() and sd_bus_is_bus_client() return a - positive integer when the server or client mode is enabled, respectively. Otherwise, they return zero. - + sd_bus_is_server(), sd_bus_is_bus_client() and + sd_bus_is_monitor() return a positive integer when the server or client mode is + enabled, respectively. Otherwise, they return zero. Errors