]>
Commit | Line | Data |
---|---|---|
d97eac36 LP |
1 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN" |
2 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
3 | ||
4 | <!-- | |
5 | SPDX-License-Identifier: LGPL-2.1+ | |
6 | ||
7 | This file is part of systemd. | |
8 | ||
9 | Copyright 2017 Lennart Poettering | |
d97eac36 LP |
10 | --> |
11 | ||
12 | <refentry id="sd_bus_message_set_destination"> | |
13 | ||
14 | <refentryinfo> | |
15 | <title>sd_bus_message_set_destination</title> | |
16 | <productname>systemd</productname> | |
17 | ||
18 | <authorgroup> | |
19 | <author> | |
20 | <contrib>Developer</contrib> | |
21 | <firstname>Lennart</firstname> | |
22 | <surname>Poettering</surname> | |
23 | <email>lennart@poettering.net</email> | |
24 | </author> | |
25 | </authorgroup> | |
26 | </refentryinfo> | |
27 | ||
28 | <refmeta> | |
29 | <refentrytitle>sd_bus_message_set_destination</refentrytitle> | |
30 | <manvolnum>3</manvolnum> | |
31 | </refmeta> | |
32 | ||
33 | <refnamediv> | |
34 | <refname>sd_bus_message_set_destination</refname> | |
35 | <refname>sd_bus_message_set_sender</refname> | |
36 | <refpurpose>Set the destination or sender service name of a bus message</refpurpose> | |
37 | </refnamediv> | |
38 | ||
39 | <refsynopsisdiv> | |
40 | <funcsynopsis> | |
41 | <funcsynopsisinfo>#include <systemd/sd-bus.h></funcsynopsisinfo> | |
42 | ||
43 | <funcprototype> | |
44 | <funcdef>int <function>sd_bus_message_set_destination</function></funcdef> | |
45 | <paramdef>sd_bus_message *<parameter>message</parameter></paramdef> | |
46 | <paramdef>const char *<parameter>destination</parameter></paramdef> | |
47 | </funcprototype> | |
48 | ||
49 | <funcprototype> | |
50 | <funcdef>int <function>sd_bus_message_set_sender</function></funcdef> | |
51 | <paramdef>sd_bus_message *<parameter>message</parameter></paramdef> | |
52 | <paramdef>const char *<parameter>sender</parameter></paramdef> | |
53 | </funcprototype> | |
54 | </funcsynopsis> | |
55 | </refsynopsisdiv> | |
56 | ||
57 | <refsect1> | |
58 | <title>Description</title> | |
59 | ||
60 | <para><function>sd_bus_message_set_destination()</function> sets the destination service name for the specified bus | |
61 | message object. The specified name must be a valid unique or well-known service name.</para> | |
62 | ||
63 | <para><function>sd_bus_message_set_sender()</function> sets the sender service name for the specified bus message | |
64 | object. The specified name must be a valid unique or well-known service name. This function is useful only for | |
65 | messages to send on direct connections as for connections to bus brokers the broker will fill in the destination | |
66 | field anyway, and the sender field set by original sender is ignored.</para> | |
67 | </refsect1> | |
68 | ||
69 | <refsect1> | |
70 | <title>Return Value</title> | |
71 | ||
72 | <para>On success, these calls return 0 or a positive integer. On failure, these calls return a negative errno-style | |
73 | error code.</para> | |
74 | </refsect1> | |
75 | ||
76 | <refsect1> | |
77 | <title>Errors</title> | |
78 | ||
79 | <para>Returned errors may indicate the following problems:</para> | |
80 | ||
81 | <variablelist> | |
82 | <varlistentry> | |
83 | <term><constant>-EINVAL</constant></term> | |
84 | ||
85 | <listitem><para>A specified parameter is invalid.</para></listitem> | |
86 | </varlistentry> | |
87 | ||
88 | <varlistentry> | |
89 | <term><constant>-EPERM</constant></term> | |
90 | ||
91 | <listitem><para>The message is already sealed.</para></listitem> | |
92 | </varlistentry> | |
93 | ||
94 | <varlistentry> | |
95 | <term><constant>-EEXIST</constant></term> | |
96 | ||
97 | <listitem><para>The message already has a destination or sender field set.</para></listitem> | |
98 | </varlistentry> | |
99 | </variablelist> | |
100 | </refsect1> | |
101 | ||
102 | <refsect1> | |
103 | <title>Notes</title> | |
104 | ||
105 | <para>The <function>sd_bus_message_set_destination()</function> and | |
106 | <function>sd_bus_message_set_sender()</function> interfaces | |
107 | are available as a shared library, which can be compiled and | |
108 | linked to with the | |
109 | <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
110 | file.</para> | |
111 | </refsect1> | |
112 | ||
113 | <refsect1> | |
114 | <title>See Also</title> | |
115 | ||
116 | <para> | |
117 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
118 | <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
119 | <citerefentry><refentrytitle>sd_bus_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>, | |
120 | <citerefentry><refentrytitle>sd_bus_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry> | |
121 | </para> | |
122 | </refsect1> | |
123 | ||
124 | </refentry> |