4 This file is part of systemd.
6 Copyright 2013 Lennart Poettering
8 systemd is free software; you can redistribute it and/or modify it
9 under the terms of the GNU Lesser General Public License as published by
10 the Free Software Foundation; either version 2.1 of the License, or
11 (at your option) any later version.
13 systemd is distributed in the hope that it will be useful, but
14 WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Lesser General Public License for more details.
18 You should have received a copy of the GNU Lesser General Public License
19 along with systemd; If not, see <http://www.gnu.org/licenses/>.
28 struct _packed_ bus_header {
29 /* The first four fields are identical for dbus1, and dbus2 */
36 /* dbus1: Used for SOCK_STREAM connections */
40 /* Note that what the bus spec calls "serial" we'll call
41 "cookie" instead, because we don't want to imply that the
42 cookie was in any way monotonically increasing. */
47 /* dbus2: Used for kdbus connections */
53 /* Note that both header versions have the same size! */
60 _BUS_INVALID_ENDIAN = 0,
61 BUS_LITTLE_ENDIAN = 'l',
63 #if __BYTE_ORDER == __BIG_ENDIAN
64 BUS_NATIVE_ENDIAN = BUS_BIG_ENDIAN,
65 BUS_REVERSE_ENDIAN = BUS_LITTLE_ENDIAN
67 BUS_NATIVE_ENDIAN = BUS_LITTLE_ENDIAN,
68 BUS_REVERSE_ENDIAN = BUS_BIG_ENDIAN
75 BUS_MESSAGE_NO_REPLY_EXPECTED = 1,
76 BUS_MESSAGE_NO_AUTO_START = 2,
77 BUS_MESSAGE_ALLOW_INTERACTIVE_AUTHORIZATION = 4,
83 _BUS_MESSAGE_HEADER_INVALID = 0,
84 BUS_MESSAGE_HEADER_PATH,
85 BUS_MESSAGE_HEADER_INTERFACE,
86 BUS_MESSAGE_HEADER_MEMBER,
87 BUS_MESSAGE_HEADER_ERROR_NAME,
88 BUS_MESSAGE_HEADER_REPLY_SERIAL,
89 BUS_MESSAGE_HEADER_DESTINATION,
90 BUS_MESSAGE_HEADER_SENDER,
91 BUS_MESSAGE_HEADER_SIGNATURE,
92 BUS_MESSAGE_HEADER_UNIX_FDS,
93 _BUS_MESSAGE_HEADER_MAX
96 /* RequestName parameters */
99 BUS_NAME_ALLOW_REPLACEMENT = 1,
100 BUS_NAME_REPLACE_EXISTING = 2,
101 BUS_NAME_DO_NOT_QUEUE = 4
104 /* RequestName returns */
106 BUS_NAME_PRIMARY_OWNER = 1,
107 BUS_NAME_IN_QUEUE = 2,
109 BUS_NAME_ALREADY_OWNER = 4
112 /* ReleaseName returns */
114 BUS_NAME_RELEASED = 1,
115 BUS_NAME_NON_EXISTENT = 2,
116 BUS_NAME_NOT_OWNER = 3,
119 /* StartServiceByName returns */
121 BUS_START_REPLY_SUCCESS = 1,
122 BUS_START_REPLY_ALREADY_RUNNING = 2,
125 #define BUS_INTROSPECT_DOCTYPE \
126 "<!DOCTYPE node PUBLIC \"-//freedesktop//DTD D-BUS Object Introspection 1.0//EN\"\n" \
127 "\"http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd\">\n"
129 #define BUS_INTROSPECT_INTERFACE_PEER \
130 " <interface name=\"org.freedesktop.DBus.Peer\">\n" \
131 " <method name=\"Ping\"/>\n" \
132 " <method name=\"GetMachineId\">\n" \
133 " <arg type=\"s\" name=\"machine_uuid\" direction=\"out\"/>\n" \
137 #define BUS_INTROSPECT_INTERFACE_INTROSPECTABLE \
138 " <interface name=\"org.freedesktop.DBus.Introspectable\">\n" \
139 " <method name=\"Introspect\">\n" \
140 " <arg name=\"data\" type=\"s\" direction=\"out\"/>\n" \
144 #define BUS_INTROSPECT_INTERFACE_PROPERTIES \
145 " <interface name=\"org.freedesktop.DBus.Properties\">\n" \
146 " <method name=\"Get\">\n" \
147 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
148 " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
149 " <arg name=\"value\" direction=\"out\" type=\"v\"/>\n" \
151 " <method name=\"GetAll\">\n" \
152 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
153 " <arg name=\"properties\" direction=\"out\" type=\"a{sv}\"/>\n" \
155 " <method name=\"Set\">\n" \
156 " <arg name=\"interface\" direction=\"in\" type=\"s\"/>\n" \
157 " <arg name=\"property\" direction=\"in\" type=\"s\"/>\n" \
158 " <arg name=\"value\" direction=\"in\" type=\"v\"/>\n" \
160 " <signal name=\"PropertiesChanged\">\n" \
161 " <arg type=\"s\" name=\"interface\"/>\n" \
162 " <arg type=\"a{sv}\" name=\"changed_properties\"/>\n" \
163 " <arg type=\"as\" name=\"invalidated_properties\"/>\n" \
167 #define BUS_INTROSPECT_INTERFACE_OBJECT_MANAGER \
168 " <interface name=\"org.freedesktop.DBus.ObjectManager\">\n" \
169 " <method name=\"GetManagedObjects\">\n" \
170 " <arg type=\"a{oa{sa{sv}}}\" name=\"object_paths_interfaces_and_properties\" direction=\"out\"/>\n" \
172 " <signal name=\"InterfacesAdded\">\n" \
173 " <arg type=\"o\" name=\"object_path\"/>\n" \
174 " <arg type=\"a{sa{sv}}\" name=\"interfaces_and_properties\"/>\n" \
176 " <signal name=\"InterfacesRemoved\">\n" \
177 " <arg type=\"o\" name=\"object_path\"/>\n" \
178 " <arg type=\"as\" name=\"interfaces\"/>\n" \