1 <!DOCTYPE refentry PUBLIC
"-//OASIS//DTD DocBook XML V4.2//EN"
2 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5 SPDX-License-Identifier: LGPL-2.1+
7 This file is part of systemd.
9 Copyright 2017 Lennart Poettering
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.
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.
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/>.
25 <refentry id=
"sd_bus_message_set_destination">
28 <title>sd_bus_message_set_destination
</title>
29 <productname>systemd
</productname>
33 <contrib>Developer
</contrib>
34 <firstname>Lennart
</firstname>
35 <surname>Poettering
</surname>
36 <email>lennart@poettering.net
</email>
42 <refentrytitle>sd_bus_message_set_destination
</refentrytitle>
43 <manvolnum>3</manvolnum>
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>
54 <funcsynopsisinfo>#include
<systemd/sd-bus.h
></funcsynopsisinfo>
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>
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>
71 <title>Description
</title>
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>
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>
83 <title>Return Value
</title>
85 <para>On success, these calls return
0 or a positive integer. On failure, these calls return a negative errno-style
92 <para>Returned errors may indicate the following problems:
</para>
96 <term><constant>-EINVAL
</constant></term>
98 <listitem><para>A specified parameter is invalid.
</para></listitem>
102 <term><constant>-EPERM
</constant></term>
104 <listitem><para>The message is already sealed.
</para></listitem>
108 <term><constant>-EEXIST
</constant></term>
110 <listitem><para>The message already has a destination or sender field set.
</para></listitem>
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
122 <constant>libsystemd
</constant> <citerefentry project='die-net'
><refentrytitle>pkg-config
</refentrytitle><manvolnum>1</manvolnum></citerefentry>
127 <title>See Also
</title>
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>