1 /* SPDX-License-Identifier: LGPL-2.1+ */
5 This file is part of systemd.
7 Copyright 2013 Lennart Poettering
16 struct _packed_ bus_header {
17 /* The first four fields are identical for dbus1, and dbus2 */
24 /* dbus1: Used for SOCK_STREAM connections */
28 /* Note that what the bus spec calls "serial" we'll call
29 "cookie" instead, because we don't want to imply that the
30 cookie was in any way monotonically increasing. */
35 /* dbus2: Used for kdbus connections */
41 /* Note that both header versions have the same size! */
48 _BUS_INVALID_ENDIAN = 0,
49 BUS_LITTLE_ENDIAN = 'l',
51 #if __BYTE_ORDER == __BIG_ENDIAN
52 BUS_NATIVE_ENDIAN = BUS_BIG_ENDIAN,
53 BUS_REVERSE_ENDIAN = BUS_LITTLE_ENDIAN
55 BUS_NATIVE_ENDIAN = BUS_LITTLE_ENDIAN,
56 BUS_REVERSE_ENDIAN = BUS_BIG_ENDIAN
63 BUS_MESSAGE_NO_REPLY_EXPECTED = 1,
64 BUS_MESSAGE_NO_AUTO_START = 2,
65 BUS_MESSAGE_ALLOW_INTERACTIVE_AUTHORIZATION = 4,
71 _BUS_MESSAGE_HEADER_INVALID = 0,
72 BUS_MESSAGE_HEADER_PATH,
73 BUS_MESSAGE_HEADER_INTERFACE,
74 BUS_MESSAGE_HEADER_MEMBER,
75 BUS_MESSAGE_HEADER_ERROR_NAME,
76 BUS_MESSAGE_HEADER_REPLY_SERIAL,
77 BUS_MESSAGE_HEADER_DESTINATION,
78 BUS_MESSAGE_HEADER_SENDER,
79 BUS_MESSAGE_HEADER_SIGNATURE,
80 BUS_MESSAGE_HEADER_UNIX_FDS,
81 _BUS_MESSAGE_HEADER_MAX
84 /* RequestName parameters */
87 BUS_NAME_ALLOW_REPLACEMENT = 1,
88 BUS_NAME_REPLACE_EXISTING = 2,
89 BUS_NAME_DO_NOT_QUEUE = 4
92 /* RequestName returns */
94 BUS_NAME_PRIMARY_OWNER = 1,
95 BUS_NAME_IN_QUEUE = 2,
97 BUS_NAME_ALREADY_OWNER = 4
100 /* ReleaseName returns */
102 BUS_NAME_RELEASED = 1,
103 BUS_NAME_NON_EXISTENT = 2,
104 BUS_NAME_NOT_OWNER = 3,
107 /* StartServiceByName returns */
109 BUS_START_REPLY_SUCCESS = 1,
110 BUS_START_REPLY_ALREADY_RUNNING = 2,
113 #define BUS_INTROSPECT_DOCTYPE \
114 "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n" \
115 "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
117 #define BUS_INTROSPECT_INTERFACE_PEER \
118 " <interface name=\"org.freedesktop.DBus.Peer\">\n" \
119 " <method name=\"Ping\"/>\n" \
120 " <method name=\"GetMachineId\">\n" \
121 " <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n" \
125 #define BUS_INTROSPECT_INTERFACE_INTROSPECTABLE \
126 " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \
127 " <method name=\"Introspect\">\n" \
128 " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \
132 #define BUS_INTROSPECT_INTERFACE_PROPERTIES \
133 " <interface name=\"org.freedesktop.DBus.Properties\">\n" \
134 " <method name=\"Get\">\n" \
135 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
136 " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
137 " <arg name=\"value\" direction=\"out\" type=\"v\"/>\n" \
139 " <method name=\"GetAll\">\n" \
140 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
141 " <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
143 " <method name=\"Set\">\n" \
144 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
145 " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
146 " <arg name=\"value\" direction=\"in\" type=\"v\"/>\n" \
148 " <signal name=\"PropertiesChanged\">\n" \
149 " <arg type=\"s\" name=\"interface\"/>\n" \
150 " <arg type=\"a{sv}\" name=\"changed_properties\"/>\n" \
151 " <arg type=\"as\" name=\"invalidated_properties\"/>\n" \
155 #define BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER \
156 " <interface name=\"org.freedesktop.DBus.ObjectManager\">\n" \
157 " <method name=\"GetManagedObjects\">\n" \
158 " <arg type=\"a{oa{sa{sv}}}\" name=\"object_paths_interfaces_and_properties\" direction=\"out\"/>\n" \
160 " <signal name=\"InterfacesAdded\">\n" \
161 " <arg type=\"o\" name=\"object_path\"/>\n" \
162 " <arg type=\"a{sa{sv}}\" name=\"interfaces_and_properties\"/>\n" \
164 " <signal name=\"InterfacesRemoved\">\n" \
165 " <arg type=\"o\" name=\"object_path\"/>\n" \
166 " <arg type=\"as\" name=\"interfaces\"/>\n" \