From: Daan De Meyer Date: Sun, 19 Apr 2020 15:20:53 +0000 (+0200) Subject: sd-bus: Add sd_bus_add_filter docs X-Git-Tag: v246-rc1~564 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3841fa79164559404d4342fe58f626660a49ec32;p=thirdparty%2Fsystemd.git sd-bus: Add sd_bus_add_filter docs --- diff --git a/man/rules/meson.build b/man/rules/meson.build index b828cdfafc1..5fc2b5a9806 100644 --- a/man/rules/meson.build +++ b/man/rules/meson.build @@ -144,6 +144,7 @@ manpages = [ 'SD_BUS_WRITABLE_PROPERTY', 'sd_bus_add_fallback', 'sd_bus_add_fallback_vtable', + 'sd_bus_add_filter', 'sd_bus_add_object_vtable'], ''], ['sd_bus_attach_event', '3', ['sd_bus_detach_event', 'sd_bus_get_event'], ''], diff --git a/man/sd-bus.xml b/man/sd-bus.xml index 8c05e335126..389ae18b50b 100644 --- a/man/sd-bus.xml +++ b/man/sd-bus.xml @@ -45,6 +45,7 @@ sd_bus_add_object_vtable3, sd_bus_add_fallback3, sd_bus_add_fallback_vtable3, +sd_bus_add_filter3, sd_bus_attach_event3, sd_bus_call3, sd_bus_call_async3, diff --git a/man/sd_bus_add_object.xml b/man/sd_bus_add_object.xml index 2abe2342f0a..373609f0422 100644 --- a/man/sd_bus_add_object.xml +++ b/man/sd_bus_add_object.xml @@ -21,6 +21,7 @@ sd_bus_add_fallback sd_bus_add_object_vtable sd_bus_add_fallback_vtable + sd_bus_add_filter SD_BUS_VTABLE_START SD_BUS_VTABLE_END SD_BUS_METHOD_WITH_NAMES_OFFSET @@ -117,6 +118,14 @@ void *userdata + + int sd_bus_add_filter + sd_bus *bus + sd_bus_slot **slot + sd_bus_message_handler_t callback + void *userdata + + SD_BUS_VTABLE_START(flags) @@ -246,9 +255,14 @@ sd_bus_add_fallback() is similar to sd_bus_add_object() but applies to fallback paths instead. + sd_bus_add_filter() installs a callback that is invoked for each + incoming D-Bus message. Filters can be used to handle logic common to all messages received by + a service (e.g. authentication or authorization). + When a request is received, any associated callbacks are called sequentially until a callback returns a non-zero integer. Return zero from a callback to give other callbacks the - chance to process the request. Callbacks are called in the following order: first, callbacks + chance to process the request. Callbacks are called in the following order: first, global + callbacks installed with sd_bus_add_filter() are called. Second, callbacks attached directly to the request object path are called, followed by any D-Bus method callbacks attached to the request object path, interface and member. Finally, the property callbacks attached to the request object path, interface and member are called. If the final callback