summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaan De Meyer <daan.j.demeyer@gmail.com>2020-04-19 17:20:53 +0200
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2020-04-19 19:00:22 +0200
commit3841fa79164559404d4342fe58f626660a49ec32 (patch)
tree525707d6ca298300f62637b1bff691c44e4c9b59
parent5099fd44ca56f4be22191dafb16b967045bfbb90 (diff)
downloadsystemd-3841fa79164559404d4342fe58f626660a49ec32.tar.gz
sd-bus: Add sd_bus_add_filter docs
-rw-r--r--man/rules/meson.build1
-rw-r--r--man/sd-bus.xml1
-rw-r--r--man/sd_bus_add_object.xml16
3 files changed, 17 insertions, 1 deletions
diff --git a/man/rules/meson.build b/man/rules/meson.build
index b828cdfafc..5fc2b5a980 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 8c05e33512..389ae18b50 100644
--- a/man/sd-bus.xml
+++ b/man/sd-bus.xml
@@ -45,6 +45,7 @@
<citerefentry><refentrytitle>sd_bus_add_object_vtable</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_add_fallback</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_add_fallback_vtable</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
+<citerefentry><refentrytitle>sd_bus_add_filter</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_attach_event</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_call</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
<citerefentry><refentrytitle>sd_bus_call_async</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
diff --git a/man/sd_bus_add_object.xml b/man/sd_bus_add_object.xml
index 2abe2342f0..373609f042 100644
--- a/man/sd_bus_add_object.xml
+++ b/man/sd_bus_add_object.xml
@@ -21,6 +21,7 @@
<refname>sd_bus_add_fallback</refname>
<refname>sd_bus_add_object_vtable</refname>
<refname>sd_bus_add_fallback_vtable</refname>
+ <refname>sd_bus_add_filter</refname>
<refname>SD_BUS_VTABLE_START</refname>
<refname>SD_BUS_VTABLE_END</refname>
<refname>SD_BUS_METHOD_WITH_NAMES_OFFSET</refname>
@@ -117,6 +118,14 @@
<paramdef>void *<parameter>userdata</parameter></paramdef>
</funcprototype>
+ <funcprototype>
+ <funcdef>int <function>sd_bus_add_filter</function></funcdef>
+ <paramdef>sd_bus *<parameter>bus</parameter></paramdef>
+ <paramdef>sd_bus_slot **<parameter>slot</parameter></paramdef>
+ <paramdef>sd_bus_message_handler_t <parameter>callback</parameter></paramdef>
+ <paramdef>void *<parameter>userdata</parameter></paramdef>
+ </funcprototype>
+
<para>
<constant>SD_BUS_VTABLE_START(<replaceable>flags</replaceable>)</constant>
</para>
@@ -246,9 +255,14 @@
<function>sd_bus_add_fallback()</function> is similar to
<function>sd_bus_add_object()</function> but applies to fallback paths instead.</para>
+ <para><function>sd_bus_add_filter()</function> 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).</para>
+
<para>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 <function>sd_bus_add_filter()</function> 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