1SD_BUS_MESSAGE_SET_DESTINsAdT_IbOuNs(_3m)essage_set_desStDi_nBaUtSi_oMnESSAGE_SET_DESTINATION(3)
2
3
4

NAME

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

SYNOPSIS

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

DESCRIPTION

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

RETURN VALUE

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

NOTES

76       These APIs are implemented as a shared library, which can be compiled
77       and linked to with the libsystemd pkg-config(1) file.
78

SEE ALSO

80       systemd(1), sd-bus(3), sd_bus_new(3), sd_bus_set_sender(3)
81
82
83
84systemd 248                                  SD_BUS_MESSAGE_SET_DESTINATION(3)
Impressum