]> git.ipfire.org Git - thirdparty/systemd.git/blob - man/sd_bus_message_set_destination.xml
verify: use manager_load_startable_unit_or_warn() to load units for verification
[thirdparty/systemd.git] / man / sd_bus_message_set_destination.xml
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
10
11 systemd is free software; you can redistribute it and/or modify it
12 under the terms of the GNU Lesser General Public License as published by
13 the Free Software Foundation; either version 2.1 of the License, or
14 (at your option) any later version.
15
16 systemd is distributed in the hope that it will be useful, but
17 WITHOUT ANY WARRANTY; without even the implied warranty of
18 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 Lesser General Public License for more details.
20
21 You should have received a copy of the GNU Lesser General Public License
22 along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 -->
24
25 <refentry id="sd_bus_message_set_destination">
26
27 <refentryinfo>
28 <title>sd_bus_message_set_destination</title>
29 <productname>systemd</productname>
30
31 <authorgroup>
32 <author>
33 <contrib>Developer</contrib>
34 <firstname>Lennart</firstname>
35 <surname>Poettering</surname>
36 <email>lennart@poettering.net</email>
37 </author>
38 </authorgroup>
39 </refentryinfo>
40
41 <refmeta>
42 <refentrytitle>sd_bus_message_set_destination</refentrytitle>
43 <manvolnum>3</manvolnum>
44 </refmeta>
45
46 <refnamediv>
47 <refname>sd_bus_message_set_destination</refname>
48 <refname>sd_bus_message_set_sender</refname>
49 <refpurpose>Set the destination or sender service name of a bus message</refpurpose>
50 </refnamediv>
51
52 <refsynopsisdiv>
53 <funcsynopsis>
54 <funcsynopsisinfo>#include &lt;systemd/sd-bus.h&gt;</funcsynopsisinfo>
55
56 <funcprototype>
57 <funcdef>int <function>sd_bus_message_set_destination</function></funcdef>
58 <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
59 <paramdef>const char *<parameter>destination</parameter></paramdef>
60 </funcprototype>
61
62 <funcprototype>
63 <funcdef>int <function>sd_bus_message_set_sender</function></funcdef>
64 <paramdef>sd_bus_message *<parameter>message</parameter></paramdef>
65 <paramdef>const char *<parameter>sender</parameter></paramdef>
66 </funcprototype>
67 </funcsynopsis>
68 </refsynopsisdiv>
69
70 <refsect1>
71 <title>Description</title>
72
73 <para><function>sd_bus_message_set_destination()</function> sets the destination service name for the specified bus
74 message object. The specified name must be a valid unique or well-known service name.</para>
75
76 <para><function>sd_bus_message_set_sender()</function> sets the sender service name for the specified bus message
77 object. The specified name must be a valid unique or well-known service name. This function is useful only for
78 messages to send on direct connections as for connections to bus brokers the broker will fill in the destination
79 field anyway, and the sender field set by original sender is ignored.</para>
80 </refsect1>
81
82 <refsect1>
83 <title>Return Value</title>
84
85 <para>On success, these calls return 0 or a positive integer. On failure, these calls return a negative errno-style
86 error code.</para>
87 </refsect1>
88
89 <refsect1>
90 <title>Errors</title>
91
92 <para>Returned errors may indicate the following problems:</para>
93
94 <variablelist>
95 <varlistentry>
96 <term><constant>-EINVAL</constant></term>
97
98 <listitem><para>A specified parameter is invalid.</para></listitem>
99 </varlistentry>
100
101 <varlistentry>
102 <term><constant>-EPERM</constant></term>
103
104 <listitem><para>The message is already sealed.</para></listitem>
105 </varlistentry>
106
107 <varlistentry>
108 <term><constant>-EEXIST</constant></term>
109
110 <listitem><para>The message already has a destination or sender field set.</para></listitem>
111 </varlistentry>
112 </variablelist>
113 </refsect1>
114
115 <refsect1>
116 <title>Notes</title>
117
118 <para>The <function>sd_bus_message_set_destination()</function> and
119 <function>sd_bus_message_set_sender()</function> interfaces
120 are available as a shared library, which can be compiled and
121 linked to with the
122 <constant>libsystemd</constant> <citerefentry project='die-net'><refentrytitle>pkg-config</refentrytitle><manvolnum>1</manvolnum></citerefentry>
123 file.</para>
124 </refsect1>
125
126 <refsect1>
127 <title>See Also</title>
128
129 <para>
130 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
131 <citerefentry><refentrytitle>sd-bus</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
132 <citerefentry><refentrytitle>sd_bus_new</refentrytitle><manvolnum>3</manvolnum></citerefentry>,
133 <citerefentry><refentrytitle>sd_bus_set_sender</refentrytitle><manvolnum>3</manvolnum></citerefentry>
134 </para>
135 </refsect1>
136
137 </refentry>