1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 Copyright 2013 Lennart Poettering
14 struct _packed_ bus_header {
15 /* The first four fields are identical for dbus1, and dbus2 */
22 /* dbus1: Used for SOCK_STREAM connections */
26 /* Note that what the bus spec calls "serial" we'll call
27 "cookie" instead, because we don't want to imply that the
28 cookie was in any way monotonically increasing. */
33 /* dbus2: Used for kdbus connections */
39 /* Note that both header versions have the same size! */
46 _BUS_INVALID_ENDIAN = 0,
47 BUS_LITTLE_ENDIAN = 'l',
49 #if __BYTE_ORDER == __BIG_ENDIAN
50 BUS_NATIVE_ENDIAN = BUS_BIG_ENDIAN,
51 BUS_REVERSE_ENDIAN = BUS_LITTLE_ENDIAN
53 BUS_NATIVE_ENDIAN = BUS_LITTLE_ENDIAN,
54 BUS_REVERSE_ENDIAN = BUS_BIG_ENDIAN
61 BUS_MESSAGE_NO_REPLY_EXPECTED = 1,
62 BUS_MESSAGE_NO_AUTO_START = 2,
63 BUS_MESSAGE_ALLOW_INTERACTIVE_AUTHORIZATION = 4,
69 _BUS_MESSAGE_HEADER_INVALID = 0,
70 BUS_MESSAGE_HEADER_PATH,
71 BUS_MESSAGE_HEADER_INTERFACE,
72 BUS_MESSAGE_HEADER_MEMBER,
73 BUS_MESSAGE_HEADER_ERROR_NAME,
74 BUS_MESSAGE_HEADER_REPLY_SERIAL,
75 BUS_MESSAGE_HEADER_DESTINATION,
76 BUS_MESSAGE_HEADER_SENDER,
77 BUS_MESSAGE_HEADER_SIGNATURE,
78 BUS_MESSAGE_HEADER_UNIX_FDS,
79 _BUS_MESSAGE_HEADER_MAX
82 /* RequestName parameters */
85 BUS_NAME_ALLOW_REPLACEMENT = 1,
86 BUS_NAME_REPLACE_EXISTING = 2,
87 BUS_NAME_DO_NOT_QUEUE = 4
90 /* RequestName returns */
92 BUS_NAME_PRIMARY_OWNER = 1,
93 BUS_NAME_IN_QUEUE = 2,
95 BUS_NAME_ALREADY_OWNER = 4
98 /* ReleaseName returns */
100 BUS_NAME_RELEASED = 1,
101 BUS_NAME_NON_EXISTENT = 2,
102 BUS_NAME_NOT_OWNER = 3,
105 /* StartServiceByName returns */
107 BUS_START_REPLY_SUCCESS = 1,
108 BUS_START_REPLY_ALREADY_RUNNING = 2,
111 #define BUS_INTROSPECT_DOCTYPE \
112 "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n" \
113 "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
115 #define BUS_INTROSPECT_INTERFACE_PEER \
116 " <interface name=\"org.freedesktop.DBus.Peer\">\n" \
117 " <method name=\"Ping\"/>\n" \
118 " <method name=\"GetMachineId\">\n" \
119 " <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n" \
123 #define BUS_INTROSPECT_INTERFACE_INTROSPECTABLE \
124 " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \
125 " <method name=\"Introspect\">\n" \
126 " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \
130 #define BUS_INTROSPECT_INTERFACE_PROPERTIES \
131 " <interface name=\"org.freedesktop.DBus.Properties\">\n" \
132 " <method name=\"Get\">\n" \
133 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
134 " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
135 " <arg name=\"value\" direction=\"out\" type=\"v\"/>\n" \
137 " <method name=\"GetAll\">\n" \
138 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
139 " <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
141 " <method name=\"Set\">\n" \
142 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
143 " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
144 " <arg name=\"value\" direction=\"in\" type=\"v\"/>\n" \
146 " <signal name=\"PropertiesChanged\">\n" \
147 " <arg type=\"s\" name=\"interface\"/>\n" \
148 " <arg type=\"a{sv}\" name=\"changed_properties\"/>\n" \
149 " <arg type=\"as\" name=\"invalidated_properties\"/>\n" \
153 #define BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER \
154 " <interface name=\"org.freedesktop.DBus.ObjectManager\">\n" \
155 " <method name=\"GetManagedObjects\">\n" \
156 " <arg type=\"a{oa{sa{sv}}}\" name=\"object_paths_interfaces_and_properties\" direction=\"out\"/>\n" \
158 " <signal name=\"InterfacesAdded\">\n" \
159 " <arg type=\"o\" name=\"object_path\"/>\n" \
160 " <arg type=\"a{sa{sv}}\" name=\"interfaces_and_properties\"/>\n" \
162 " <signal name=\"InterfacesRemoved\">\n" \
163 " <arg type=\"o\" name=\"object_path\"/>\n" \
164 " <arg type=\"as\" name=\"interfaces\"/>\n" \