1 /* SPDX-License-Identifier: LGPL-2.1+ */
10 struct _packed_ bus_header
{
11 /* The first four fields are identical for dbus1, and dbus2 */
18 /* dbus1: Used for SOCK_STREAM connections */
22 /* Note that what the bus spec calls "serial" we'll call
23 "cookie" instead, because we don't want to imply that the
24 cookie was in any way monotonically increasing. */
29 /* dbus2: Used for kdbus connections */
35 /* Note that both header versions have the same size! */
42 _BUS_INVALID_ENDIAN
= 0,
43 BUS_LITTLE_ENDIAN
= 'l',
45 #if __BYTE_ORDER == __BIG_ENDIAN
46 BUS_NATIVE_ENDIAN
= BUS_BIG_ENDIAN
,
47 BUS_REVERSE_ENDIAN
= BUS_LITTLE_ENDIAN
49 BUS_NATIVE_ENDIAN
= BUS_LITTLE_ENDIAN
,
50 BUS_REVERSE_ENDIAN
= BUS_BIG_ENDIAN
57 BUS_MESSAGE_NO_REPLY_EXPECTED
= 1,
58 BUS_MESSAGE_NO_AUTO_START
= 2,
59 BUS_MESSAGE_ALLOW_INTERACTIVE_AUTHORIZATION
= 4,
65 _BUS_MESSAGE_HEADER_INVALID
= 0,
66 BUS_MESSAGE_HEADER_PATH
,
67 BUS_MESSAGE_HEADER_INTERFACE
,
68 BUS_MESSAGE_HEADER_MEMBER
,
69 BUS_MESSAGE_HEADER_ERROR_NAME
,
70 BUS_MESSAGE_HEADER_REPLY_SERIAL
,
71 BUS_MESSAGE_HEADER_DESTINATION
,
72 BUS_MESSAGE_HEADER_SENDER
,
73 BUS_MESSAGE_HEADER_SIGNATURE
,
74 BUS_MESSAGE_HEADER_UNIX_FDS
,
75 _BUS_MESSAGE_HEADER_MAX
78 /* RequestName parameters */
81 BUS_NAME_ALLOW_REPLACEMENT
= 1,
82 BUS_NAME_REPLACE_EXISTING
= 2,
83 BUS_NAME_DO_NOT_QUEUE
= 4
86 /* RequestName returns */
88 BUS_NAME_PRIMARY_OWNER
= 1,
89 BUS_NAME_IN_QUEUE
= 2,
91 BUS_NAME_ALREADY_OWNER
= 4
94 /* ReleaseName returns */
96 BUS_NAME_RELEASED
= 1,
97 BUS_NAME_NON_EXISTENT
= 2,
98 BUS_NAME_NOT_OWNER
= 3,
101 /* StartServiceByName returns */
103 BUS_START_REPLY_SUCCESS
= 1,
104 BUS_START_REPLY_ALREADY_RUNNING
= 2,
107 #define BUS_INTROSPECT_DOCTYPE \
108 "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n" \
109 "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
111 #define BUS_INTROSPECT_INTERFACE_PEER \
112 " <interface name=\"org.freedesktop.DBus.Peer\">\n" \
113 " <method name=\"Ping\"/>\n" \
114 " <method name=\"GetMachineId\">\n" \
115 " <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n" \
119 #define BUS_INTROSPECT_INTERFACE_INTROSPECTABLE \
120 " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \
121 " <method name=\"Introspect\">\n" \
122 " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \
126 #define BUS_INTROSPECT_INTERFACE_PROPERTIES \
127 " <interface name=\"org.freedesktop.DBus.Properties\">\n" \
128 " <method name=\"Get\">\n" \
129 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
130 " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
131 " <arg name=\"value\" direction=\"out\" type=\"v\"/>\n" \
133 " <method name=\"GetAll\">\n" \
134 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
135 " <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
137 " <method name=\"Set\">\n" \
138 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
139 " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
140 " <arg name=\"value\" direction=\"in\" type=\"v\"/>\n" \
142 " <signal name=\"PropertiesChanged\">\n" \
143 " <arg type=\"s\" name=\"interface\"/>\n" \
144 " <arg type=\"a{sv}\" name=\"changed_properties\"/>\n" \
145 " <arg type=\"as\" name=\"invalidated_properties\"/>\n" \
149 #define BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER \
150 " <interface name=\"org.freedesktop.DBus.ObjectManager\">\n" \
151 " <method name=\"GetManagedObjects\">\n" \
152 " <arg type=\"a{oa{sa{sv}}}\" name=\"object_paths_interfaces_and_properties\" direction=\"out\"/>\n" \
154 " <signal name=\"InterfacesAdded\">\n" \
155 " <arg type=\"o\" name=\"object_path\"/>\n" \
156 " <arg type=\"a{sa{sv}}\" name=\"interfaces_and_properties\"/>\n" \
158 " <signal name=\"InterfacesRemoved\">\n" \
159 " <arg type=\"o\" name=\"object_path\"/>\n" \
160 " <arg type=\"as\" name=\"interfaces\"/>\n" \