D-Bus 1.10.18

dbus-protocol.h
1 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */
2 /* dbus-protocol.h D-Bus protocol constants
3 *
4 * Copyright (C) 2002, 2003 CodeFactory AB
5 * Copyright (C) 2004, 2005 Red Hat, Inc.
6 *
7 * Licensed under the Academic Free License version 2.1
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
22 *
23 */
24
25 #ifndef DBUS_PROTOCOL_H
26 #define DBUS_PROTOCOL_H
27
28 /* Don't include anything in here from anywhere else. It's
29 * intended for use by any random library.
30 */
31
32 #ifdef __cplusplus
33 extern "C" {
34 #if 0
35 } /* avoids confusing emacs indentation */
36 #endif
37 #endif
38
39 /* Normally docs are in .c files, but there isn't a .c file for this. */
52 /* Message byte order */
53 #define DBUS_LITTLE_ENDIAN ('l')
54 #define DBUS_BIG_ENDIAN ('B')
57 #define DBUS_MAJOR_PROTOCOL_VERSION 1
58
60 #define DBUS_TYPE_INVALID ((int) '\0')
61
62 #define DBUS_TYPE_INVALID_AS_STRING "\0"
63
64 /* Primitive types */
66 #define DBUS_TYPE_BYTE ((int) 'y')
67
68 #define DBUS_TYPE_BYTE_AS_STRING "y"
69
70 #define DBUS_TYPE_BOOLEAN ((int) 'b')
71
72 #define DBUS_TYPE_BOOLEAN_AS_STRING "b"
73
74 #define DBUS_TYPE_INT16 ((int) 'n')
75
76 #define DBUS_TYPE_INT16_AS_STRING "n"
77
78 #define DBUS_TYPE_UINT16 ((int) 'q')
79
80 #define DBUS_TYPE_UINT16_AS_STRING "q"
81
82 #define DBUS_TYPE_INT32 ((int) 'i')
83
84 #define DBUS_TYPE_INT32_AS_STRING "i"
85
86 #define DBUS_TYPE_UINT32 ((int) 'u')
87
88 #define DBUS_TYPE_UINT32_AS_STRING "u"
89
90 #define DBUS_TYPE_INT64 ((int) 'x')
91
92 #define DBUS_TYPE_INT64_AS_STRING "x"
93
94 #define DBUS_TYPE_UINT64 ((int) 't')
95
96 #define DBUS_TYPE_UINT64_AS_STRING "t"
97
98 #define DBUS_TYPE_DOUBLE ((int) 'd')
99
100 #define DBUS_TYPE_DOUBLE_AS_STRING "d"
101
102 #define DBUS_TYPE_STRING ((int) 's')
103
104 #define DBUS_TYPE_STRING_AS_STRING "s"
105
106 #define DBUS_TYPE_OBJECT_PATH ((int) 'o')
107
108 #define DBUS_TYPE_OBJECT_PATH_AS_STRING "o"
109
110 #define DBUS_TYPE_SIGNATURE ((int) 'g')
111
112 #define DBUS_TYPE_SIGNATURE_AS_STRING "g"
113
114 #define DBUS_TYPE_UNIX_FD ((int) 'h')
115
116 #define DBUS_TYPE_UNIX_FD_AS_STRING "h"
117
118 /* Compound types */
120 #define DBUS_TYPE_ARRAY ((int) 'a')
121
122 #define DBUS_TYPE_ARRAY_AS_STRING "a"
123
124 #define DBUS_TYPE_VARIANT ((int) 'v')
125
126 #define DBUS_TYPE_VARIANT_AS_STRING "v"
127
136 #define DBUS_TYPE_STRUCT ((int) 'r')
137
138 #define DBUS_TYPE_STRUCT_AS_STRING "r"
139
143 #define DBUS_TYPE_DICT_ENTRY ((int) 'e')
144
145 #define DBUS_TYPE_DICT_ENTRY_AS_STRING "e"
146
151 #define DBUS_NUMBER_OF_TYPES (16)
152
153 /* characters other than typecodes that appear in type signatures */
154
156 #define DBUS_STRUCT_BEGIN_CHAR ((int) '(')
157
158 #define DBUS_STRUCT_BEGIN_CHAR_AS_STRING "("
159
160 #define DBUS_STRUCT_END_CHAR ((int) ')')
161
162 #define DBUS_STRUCT_END_CHAR_AS_STRING ")"
163
164 #define DBUS_DICT_ENTRY_BEGIN_CHAR ((int) '{')
165
166 #define DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{"
167
168 #define DBUS_DICT_ENTRY_END_CHAR ((int) '}')
169
170 #define DBUS_DICT_ENTRY_END_CHAR_AS_STRING "}"
171
178 #define DBUS_MAXIMUM_NAME_LENGTH 255
179
181 #define DBUS_MAXIMUM_SIGNATURE_LENGTH 255
182
186 #define DBUS_MAXIMUM_MATCH_RULE_LENGTH 1024
187
191 #define DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER 63
192
203 #define DBUS_MAXIMUM_ARRAY_LENGTH (67108864)
204
205 #define DBUS_MAXIMUM_ARRAY_LENGTH_BITS 26
206
210 #define DBUS_MAXIMUM_MESSAGE_LENGTH (DBUS_MAXIMUM_ARRAY_LENGTH * 2)
211
212 #define DBUS_MAXIMUM_MESSAGE_LENGTH_BITS 27
213
218 #define DBUS_MAXIMUM_MESSAGE_UNIX_FDS (DBUS_MAXIMUM_MESSAGE_LENGTH/4)
219
220 #define DBUS_MAXIMUM_MESSAGE_UNIX_FDS_BITS (DBUS_MAXIMUM_MESSAGE_LENGTH_BITS-2)
221
227 #define DBUS_MAXIMUM_TYPE_RECURSION_DEPTH 32
228
229 /* Types of message */
230
232 #define DBUS_MESSAGE_TYPE_INVALID 0
233
234 #define DBUS_MESSAGE_TYPE_METHOD_CALL 1
235
236 #define DBUS_MESSAGE_TYPE_METHOD_RETURN 2
237
238 #define DBUS_MESSAGE_TYPE_ERROR 3
239
240 #define DBUS_MESSAGE_TYPE_SIGNAL 4
241
242 #define DBUS_NUM_MESSAGE_TYPES 5
243
244 /* Header flags */
245
249 #define DBUS_HEADER_FLAG_NO_REPLY_EXPECTED 0x1
250
256 #define DBUS_HEADER_FLAG_NO_AUTO_START 0x2
257
261 #define DBUS_HEADER_FLAG_ALLOW_INTERACTIVE_AUTHORIZATION 0x4
262
263 /* Header fields */
264
266 #define DBUS_HEADER_FIELD_INVALID 0
267
270 #define DBUS_HEADER_FIELD_PATH 1
271
274 #define DBUS_HEADER_FIELD_INTERFACE 2
275
276 #define DBUS_HEADER_FIELD_MEMBER 3
277
280 #define DBUS_HEADER_FIELD_ERROR_NAME 4
281
284 #define DBUS_HEADER_FIELD_REPLY_SERIAL 5
285
288 #define DBUS_HEADER_FIELD_DESTINATION 6
289
293 #define DBUS_HEADER_FIELD_SENDER 7
294
297 #define DBUS_HEADER_FIELD_SIGNATURE 8
298
302 #define DBUS_HEADER_FIELD_UNIX_FDS 9
303
304
311 #define DBUS_HEADER_FIELD_LAST DBUS_HEADER_FIELD_UNIX_FDS
312
326 #define DBUS_HEADER_SIGNATURE \
327 DBUS_TYPE_BYTE_AS_STRING \
328 DBUS_TYPE_BYTE_AS_STRING \
329 DBUS_TYPE_BYTE_AS_STRING \
330 DBUS_TYPE_BYTE_AS_STRING \
331 DBUS_TYPE_UINT32_AS_STRING \
332 DBUS_TYPE_UINT32_AS_STRING \
333 DBUS_TYPE_ARRAY_AS_STRING \
334 DBUS_STRUCT_BEGIN_CHAR_AS_STRING \
335 DBUS_TYPE_BYTE_AS_STRING \
336 DBUS_TYPE_VARIANT_AS_STRING \
337 DBUS_STRUCT_END_CHAR_AS_STRING
338
339
346 #define DBUS_MINIMUM_HEADER_SIZE 16
347
348 /* Errors */
349 /* WARNING these get autoconverted to an enum in dbus-glib.h. Thus,
350 * if you change the order it breaks the ABI. Keep them in order.
351 * Also, don't change the formatting since that will break the sed
352 * script.
353 */
355 #define DBUS_ERROR_FAILED "org.freedesktop.DBus.Error.Failed"
356
357 #define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory"
358
359 #define DBUS_ERROR_SERVICE_UNKNOWN "org.freedesktop.DBus.Error.ServiceUnknown"
360
361 #define DBUS_ERROR_NAME_HAS_NO_OWNER "org.freedesktop.DBus.Error.NameHasNoOwner"
362
363 #define DBUS_ERROR_NO_REPLY "org.freedesktop.DBus.Error.NoReply"
364
365 #define DBUS_ERROR_IO_ERROR "org.freedesktop.DBus.Error.IOError"
366
367 #define DBUS_ERROR_BAD_ADDRESS "org.freedesktop.DBus.Error.BadAddress"
368
369 #define DBUS_ERROR_NOT_SUPPORTED "org.freedesktop.DBus.Error.NotSupported"
370
371 #define DBUS_ERROR_LIMITS_EXCEEDED "org.freedesktop.DBus.Error.LimitsExceeded"
372
373 #define DBUS_ERROR_ACCESS_DENIED "org.freedesktop.DBus.Error.AccessDenied"
374
375 #define DBUS_ERROR_AUTH_FAILED "org.freedesktop.DBus.Error.AuthFailed"
376
377 #define DBUS_ERROR_NO_SERVER "org.freedesktop.DBus.Error.NoServer"
378
383 #define DBUS_ERROR_TIMEOUT "org.freedesktop.DBus.Error.Timeout"
384
385 #define DBUS_ERROR_NO_NETWORK "org.freedesktop.DBus.Error.NoNetwork"
386
387 #define DBUS_ERROR_ADDRESS_IN_USE "org.freedesktop.DBus.Error.AddressInUse"
388
389 #define DBUS_ERROR_DISCONNECTED "org.freedesktop.DBus.Error.Disconnected"
390
391 #define DBUS_ERROR_INVALID_ARGS "org.freedesktop.DBus.Error.InvalidArgs"
392
393 #define DBUS_ERROR_FILE_NOT_FOUND "org.freedesktop.DBus.Error.FileNotFound"
394
395 #define DBUS_ERROR_FILE_EXISTS "org.freedesktop.DBus.Error.FileExists"
396
397 #define DBUS_ERROR_UNKNOWN_METHOD "org.freedesktop.DBus.Error.UnknownMethod"
398
399 #define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject"
400
401 #define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInterface"
402
403 #define DBUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error.UnknownProperty"
404
405 #define DBUS_ERROR_PROPERTY_READ_ONLY "org.freedesktop.DBus.Error.PropertyReadOnly"
406
410 #define DBUS_ERROR_TIMED_OUT "org.freedesktop.DBus.Error.TimedOut"
411
412 #define DBUS_ERROR_MATCH_RULE_NOT_FOUND "org.freedesktop.DBus.Error.MatchRuleNotFound"
413
414 #define DBUS_ERROR_MATCH_RULE_INVALID "org.freedesktop.DBus.Error.MatchRuleInvalid"
415
416 #define DBUS_ERROR_SPAWN_EXEC_FAILED "org.freedesktop.DBus.Error.Spawn.ExecFailed"
417
418 #define DBUS_ERROR_SPAWN_FORK_FAILED "org.freedesktop.DBus.Error.Spawn.ForkFailed"
419
420 #define DBUS_ERROR_SPAWN_CHILD_EXITED "org.freedesktop.DBus.Error.Spawn.ChildExited"
421
422 #define DBUS_ERROR_SPAWN_CHILD_SIGNALED "org.freedesktop.DBus.Error.Spawn.ChildSignaled"
423
424 #define DBUS_ERROR_SPAWN_FAILED "org.freedesktop.DBus.Error.Spawn.Failed"
425
426 #define DBUS_ERROR_SPAWN_SETUP_FAILED "org.freedesktop.DBus.Error.Spawn.FailedToSetup"
427
428 #define DBUS_ERROR_SPAWN_CONFIG_INVALID "org.freedesktop.DBus.Error.Spawn.ConfigInvalid"
429
430 #define DBUS_ERROR_SPAWN_SERVICE_INVALID "org.freedesktop.DBus.Error.Spawn.ServiceNotValid"
431
432 #define DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND "org.freedesktop.DBus.Error.Spawn.ServiceNotFound"
433
434 #define DBUS_ERROR_SPAWN_PERMISSIONS_INVALID "org.freedesktop.DBus.Error.Spawn.PermissionsInvalid"
435
436 #define DBUS_ERROR_SPAWN_FILE_INVALID "org.freedesktop.DBus.Error.Spawn.FileInvalid"
437
438 #define DBUS_ERROR_SPAWN_NO_MEMORY "org.freedesktop.DBus.Error.Spawn.NoMemory"
439
440 #define DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN "org.freedesktop.DBus.Error.UnixProcessIdUnknown"
441
442 #define DBUS_ERROR_INVALID_SIGNATURE "org.freedesktop.DBus.Error.InvalidSignature"
443
444 #define DBUS_ERROR_INVALID_FILE_CONTENT "org.freedesktop.DBus.Error.InvalidFileContent"
445
446 #define DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown"
447
448 #define DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN "org.freedesktop.DBus.Error.AdtAuditDataUnknown"
449
450 #define DBUS_ERROR_OBJECT_PATH_IN_USE "org.freedesktop.DBus.Error.ObjectPathInUse"
451
453 #define DBUS_ERROR_INCONSISTENT_MESSAGE "org.freedesktop.DBus.Error.InconsistentMessage"
454
457 #define DBUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED "org.freedesktop.DBus.Error.InteractiveAuthorizationRequired"
458
459 /* XML introspection format */
460
462 #define DBUS_INTROSPECT_1_0_XML_NAMESPACE "http://www.freedesktop.org/standards/dbus"
463
464 #define DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN"
465
466 #define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"
467
468 #define DBUS_INTROSPECT_1_0_XML_DOCTYPE_DECL_NODE "<!DOCTYPE node PUBLIC \"" DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "\"\n\"" DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "\">\n"
469
472 #ifdef __cplusplus
473 #if 0
474 { /* avoids confusing emacs indentation */
475 #endif
476 }
477 #endif
478
479 #endif /* DBUS_PROTOCOL_H */