1SD_BUS_MESSAGE_SET_DESTINsAdT_IbOuNs(_3m)essage_set_desStDi_nBaUtSi_oMnESSAGE_SET_DESTINATION(3)
2
3
4
6 sd_bus_message_set_destination, sd_bus_message_get_destination,
7 sd_bus_message_get_path, sd_bus_message_get_interface,
8 sd_bus_message_get_member, sd_bus_message_set_sender,
9 sd_bus_message_get_sender - Set and query bus message addressing
10 information
11
13 #include <systemd/sd-bus.h>
14
15 int sd_bus_message_set_destination(sd_bus_message *message,
16 const char *destination);
17
18 const char* sd_bus_message_get_destination(sd_bus_message *message);
19
20 const char* sd_bus_message_get_path(sd_bus_message *message);
21
22 const char* sd_bus_message_get_interface(sd_bus_message *message);
23
24 const char* sd_bus_message_get_member(sd_bus_message *message);
25
26 int sd_bus_message_set_sender(sd_bus_message *message,
27 const char *sender);
28
29 const char* sd_bus_message_get_sender(sd_bus_message *message);
30
32 sd_bus_message_set_destination() sets the destination service name for
33 the specified bus message object. The specified name must be a valid
34 unique or well-known service name.
35
36 sd_bus_message_get_destination(), sd_bus_message_get_path(),
37 sd_bus_message_get_interface(), and sd_bus_message_get_member() return
38 the destination, path, interface, and member fields from message
39 header. The return value will be NULL is message is NULL or the message
40 is of a type that doesn't use those fields or the message doesn't have
41 them set. See sd_bus_message_new_method_call(3) and
42 sd_bus_message_set_destination(3) for more discussion of those values.
43
44 sd_bus_message_set_sender() sets the sender service name for the
45 specified bus message object. The specified name must be a valid unique
46 or well-known service name. This function is useful only for messages
47 to send on direct connections as for connections to bus brokers the
48 broker will fill in the destination field anyway, and the sender field
49 set by original sender is ignored.
50
51 sd_bus_message_get_sender() returns the sender field from message.
52
53 When a string is returned, it is a pointer to internal storage, and may
54 not be modified or freed. It is only valid as long as the message
55 remains referenced and this field hasn't been changed by a different
56 call.
57
59 On success, these calls return 0 or a positive integer. On failure,
60 these calls return a negative errno-style error code.
61
62 Errors
63 Returned errors may indicate the following problems:
64
65 -EINVAL
66 The message parameter or the output parameter are NULL.
67
68 -EPERM
69 For sd_bus_message_set_destination() and
70 sd_bus_message_set_sender(), the message is already sealed.
71
72 -EEXIST
73 The message already has a destination or sender field set.
74
76 Functions described here are available as a shared library, which can
77 be compiled against and linked to with the libsystemd pkg-config(1)
78 file.
79
80 The code described here uses getenv(3), which is declared to be not
81 multi-thread-safe. This means that the code calling the functions
82 described here must not call setenv(3) from a parallel thread. It is
83 recommended to only do calls to setenv() from an early phase of the
84 program when no other threads have been started.
85
87 systemd(1), sd-bus(3), sd_bus_new(3), sd_bus_set_sender(3)
88
89
90
91systemd 254 SD_BUS_MESSAGE_SET_DESTINATION(3)