D-Bus
1.10.12
|
00001 /* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*- */ 00002 /* dbus-protocol.h D-Bus protocol constants 00003 * 00004 * Copyright (C) 2002, 2003 CodeFactory AB 00005 * Copyright (C) 2004, 2005 Red Hat, Inc. 00006 * 00007 * Licensed under the Academic Free License version 2.1 00008 * 00009 * This program is free software; you can redistribute it and/or modify 00010 * it under the terms of the GNU General Public License as published by 00011 * the Free Software Foundation; either version 2 of the License, or 00012 * (at your option) any later version. 00013 * 00014 * This program is distributed in the hope that it will be useful, 00015 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00016 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00017 * GNU General Public License for more details. 00018 * 00019 * You should have received a copy of the GNU General Public License 00020 * along with this program; if not, write to the Free Software 00021 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 00022 * 00023 */ 00024 00025 #ifndef DBUS_PROTOCOL_H 00026 #define DBUS_PROTOCOL_H 00027 00028 /* Don't include anything in here from anywhere else. It's 00029 * intended for use by any random library. 00030 */ 00031 00032 #ifdef __cplusplus 00033 extern "C" { 00034 #if 0 00035 } /* avoids confusing emacs indentation */ 00036 #endif 00037 #endif 00038 00039 /* Normally docs are in .c files, but there isn't a .c file for this. */ 00052 /* Message byte order */ 00053 #define DBUS_LITTLE_ENDIAN ('l') 00054 #define DBUS_BIG_ENDIAN ('B') 00057 #define DBUS_MAJOR_PROTOCOL_VERSION 1 00058 00060 #define DBUS_TYPE_INVALID ((int) '\0') 00061 00062 #define DBUS_TYPE_INVALID_AS_STRING "\0" 00063 00064 /* Primitive types */ 00066 #define DBUS_TYPE_BYTE ((int) 'y') 00067 00068 #define DBUS_TYPE_BYTE_AS_STRING "y" 00069 00070 #define DBUS_TYPE_BOOLEAN ((int) 'b') 00071 00072 #define DBUS_TYPE_BOOLEAN_AS_STRING "b" 00073 00074 #define DBUS_TYPE_INT16 ((int) 'n') 00075 00076 #define DBUS_TYPE_INT16_AS_STRING "n" 00077 00078 #define DBUS_TYPE_UINT16 ((int) 'q') 00079 00080 #define DBUS_TYPE_UINT16_AS_STRING "q" 00081 00082 #define DBUS_TYPE_INT32 ((int) 'i') 00083 00084 #define DBUS_TYPE_INT32_AS_STRING "i" 00085 00086 #define DBUS_TYPE_UINT32 ((int) 'u') 00087 00088 #define DBUS_TYPE_UINT32_AS_STRING "u" 00089 00090 #define DBUS_TYPE_INT64 ((int) 'x') 00091 00092 #define DBUS_TYPE_INT64_AS_STRING "x" 00093 00094 #define DBUS_TYPE_UINT64 ((int) 't') 00095 00096 #define DBUS_TYPE_UINT64_AS_STRING "t" 00097 00098 #define DBUS_TYPE_DOUBLE ((int) 'd') 00099 00100 #define DBUS_TYPE_DOUBLE_AS_STRING "d" 00101 00102 #define DBUS_TYPE_STRING ((int) 's') 00103 00104 #define DBUS_TYPE_STRING_AS_STRING "s" 00105 00106 #define DBUS_TYPE_OBJECT_PATH ((int) 'o') 00107 00108 #define DBUS_TYPE_OBJECT_PATH_AS_STRING "o" 00109 00110 #define DBUS_TYPE_SIGNATURE ((int) 'g') 00111 00112 #define DBUS_TYPE_SIGNATURE_AS_STRING "g" 00113 00114 #define DBUS_TYPE_UNIX_FD ((int) 'h') 00115 00116 #define DBUS_TYPE_UNIX_FD_AS_STRING "h" 00117 00118 /* Compound types */ 00120 #define DBUS_TYPE_ARRAY ((int) 'a') 00121 00122 #define DBUS_TYPE_ARRAY_AS_STRING "a" 00123 00124 #define DBUS_TYPE_VARIANT ((int) 'v') 00125 00126 #define DBUS_TYPE_VARIANT_AS_STRING "v" 00127 00136 #define DBUS_TYPE_STRUCT ((int) 'r') 00137 00138 #define DBUS_TYPE_STRUCT_AS_STRING "r" 00139 00143 #define DBUS_TYPE_DICT_ENTRY ((int) 'e') 00144 00145 #define DBUS_TYPE_DICT_ENTRY_AS_STRING "e" 00146 00151 #define DBUS_NUMBER_OF_TYPES (16) 00152 00153 /* characters other than typecodes that appear in type signatures */ 00154 00156 #define DBUS_STRUCT_BEGIN_CHAR ((int) '(') 00157 00158 #define DBUS_STRUCT_BEGIN_CHAR_AS_STRING "(" 00159 00160 #define DBUS_STRUCT_END_CHAR ((int) ')') 00161 00162 #define DBUS_STRUCT_END_CHAR_AS_STRING ")" 00163 00164 #define DBUS_DICT_ENTRY_BEGIN_CHAR ((int) '{') 00165 00166 #define DBUS_DICT_ENTRY_BEGIN_CHAR_AS_STRING "{" 00167 00168 #define DBUS_DICT_ENTRY_END_CHAR ((int) '}') 00169 00170 #define DBUS_DICT_ENTRY_END_CHAR_AS_STRING "}" 00171 00178 #define DBUS_MAXIMUM_NAME_LENGTH 255 00179 00181 #define DBUS_MAXIMUM_SIGNATURE_LENGTH 255 00182 00186 #define DBUS_MAXIMUM_MATCH_RULE_LENGTH 1024 00187 00191 #define DBUS_MAXIMUM_MATCH_RULE_ARG_NUMBER 63 00192 00203 #define DBUS_MAXIMUM_ARRAY_LENGTH (67108864) 00204 00205 #define DBUS_MAXIMUM_ARRAY_LENGTH_BITS 26 00206 00210 #define DBUS_MAXIMUM_MESSAGE_LENGTH (DBUS_MAXIMUM_ARRAY_LENGTH * 2) 00211 00212 #define DBUS_MAXIMUM_MESSAGE_LENGTH_BITS 27 00213 00218 #define DBUS_MAXIMUM_MESSAGE_UNIX_FDS (DBUS_MAXIMUM_MESSAGE_LENGTH/4) 00219 00220 #define DBUS_MAXIMUM_MESSAGE_UNIX_FDS_BITS (DBUS_MAXIMUM_MESSAGE_LENGTH_BITS-2) 00221 00227 #define DBUS_MAXIMUM_TYPE_RECURSION_DEPTH 32 00228 00229 /* Types of message */ 00230 00232 #define DBUS_MESSAGE_TYPE_INVALID 0 00233 00234 #define DBUS_MESSAGE_TYPE_METHOD_CALL 1 00235 00236 #define DBUS_MESSAGE_TYPE_METHOD_RETURN 2 00237 00238 #define DBUS_MESSAGE_TYPE_ERROR 3 00239 00240 #define DBUS_MESSAGE_TYPE_SIGNAL 4 00241 00242 #define DBUS_NUM_MESSAGE_TYPES 5 00243 00244 /* Header flags */ 00245 00249 #define DBUS_HEADER_FLAG_NO_REPLY_EXPECTED 0x1 00250 00256 #define DBUS_HEADER_FLAG_NO_AUTO_START 0x2 00257 00261 #define DBUS_HEADER_FLAG_ALLOW_INTERACTIVE_AUTHORIZATION 0x4 00262 00263 /* Header fields */ 00264 00266 #define DBUS_HEADER_FIELD_INVALID 0 00267 00270 #define DBUS_HEADER_FIELD_PATH 1 00271 00274 #define DBUS_HEADER_FIELD_INTERFACE 2 00275 00276 #define DBUS_HEADER_FIELD_MEMBER 3 00277 00280 #define DBUS_HEADER_FIELD_ERROR_NAME 4 00281 00284 #define DBUS_HEADER_FIELD_REPLY_SERIAL 5 00285 00288 #define DBUS_HEADER_FIELD_DESTINATION 6 00289 00293 #define DBUS_HEADER_FIELD_SENDER 7 00294 00297 #define DBUS_HEADER_FIELD_SIGNATURE 8 00298 00302 #define DBUS_HEADER_FIELD_UNIX_FDS 9 00303 00304 00311 #define DBUS_HEADER_FIELD_LAST DBUS_HEADER_FIELD_UNIX_FDS 00312 00326 #define DBUS_HEADER_SIGNATURE \ 00327 DBUS_TYPE_BYTE_AS_STRING \ 00328 DBUS_TYPE_BYTE_AS_STRING \ 00329 DBUS_TYPE_BYTE_AS_STRING \ 00330 DBUS_TYPE_BYTE_AS_STRING \ 00331 DBUS_TYPE_UINT32_AS_STRING \ 00332 DBUS_TYPE_UINT32_AS_STRING \ 00333 DBUS_TYPE_ARRAY_AS_STRING \ 00334 DBUS_STRUCT_BEGIN_CHAR_AS_STRING \ 00335 DBUS_TYPE_BYTE_AS_STRING \ 00336 DBUS_TYPE_VARIANT_AS_STRING \ 00337 DBUS_STRUCT_END_CHAR_AS_STRING 00338 00339 00346 #define DBUS_MINIMUM_HEADER_SIZE 16 00347 00348 /* Errors */ 00349 /* WARNING these get autoconverted to an enum in dbus-glib.h. Thus, 00350 * if you change the order it breaks the ABI. Keep them in order. 00351 * Also, don't change the formatting since that will break the sed 00352 * script. 00353 */ 00355 #define DBUS_ERROR_FAILED "org.freedesktop.DBus.Error.Failed" 00356 00357 #define DBUS_ERROR_NO_MEMORY "org.freedesktop.DBus.Error.NoMemory" 00358 00359 #define DBUS_ERROR_SERVICE_UNKNOWN "org.freedesktop.DBus.Error.ServiceUnknown" 00360 00361 #define DBUS_ERROR_NAME_HAS_NO_OWNER "org.freedesktop.DBus.Error.NameHasNoOwner" 00362 00363 #define DBUS_ERROR_NO_REPLY "org.freedesktop.DBus.Error.NoReply" 00364 00365 #define DBUS_ERROR_IO_ERROR "org.freedesktop.DBus.Error.IOError" 00366 00367 #define DBUS_ERROR_BAD_ADDRESS "org.freedesktop.DBus.Error.BadAddress" 00368 00369 #define DBUS_ERROR_NOT_SUPPORTED "org.freedesktop.DBus.Error.NotSupported" 00370 00371 #define DBUS_ERROR_LIMITS_EXCEEDED "org.freedesktop.DBus.Error.LimitsExceeded" 00372 00373 #define DBUS_ERROR_ACCESS_DENIED "org.freedesktop.DBus.Error.AccessDenied" 00374 00375 #define DBUS_ERROR_AUTH_FAILED "org.freedesktop.DBus.Error.AuthFailed" 00376 00377 #define DBUS_ERROR_NO_SERVER "org.freedesktop.DBus.Error.NoServer" 00378 00383 #define DBUS_ERROR_TIMEOUT "org.freedesktop.DBus.Error.Timeout" 00384 00385 #define DBUS_ERROR_NO_NETWORK "org.freedesktop.DBus.Error.NoNetwork" 00386 00387 #define DBUS_ERROR_ADDRESS_IN_USE "org.freedesktop.DBus.Error.AddressInUse" 00388 00389 #define DBUS_ERROR_DISCONNECTED "org.freedesktop.DBus.Error.Disconnected" 00390 00391 #define DBUS_ERROR_INVALID_ARGS "org.freedesktop.DBus.Error.InvalidArgs" 00392 00393 #define DBUS_ERROR_FILE_NOT_FOUND "org.freedesktop.DBus.Error.FileNotFound" 00394 00395 #define DBUS_ERROR_FILE_EXISTS "org.freedesktop.DBus.Error.FileExists" 00396 00397 #define DBUS_ERROR_UNKNOWN_METHOD "org.freedesktop.DBus.Error.UnknownMethod" 00398 00399 #define DBUS_ERROR_UNKNOWN_OBJECT "org.freedesktop.DBus.Error.UnknownObject" 00400 00401 #define DBUS_ERROR_UNKNOWN_INTERFACE "org.freedesktop.DBus.Error.UnknownInterface" 00402 00403 #define DBUS_ERROR_UNKNOWN_PROPERTY "org.freedesktop.DBus.Error.UnknownProperty" 00404 00405 #define DBUS_ERROR_PROPERTY_READ_ONLY "org.freedesktop.DBus.Error.PropertyReadOnly" 00406 00410 #define DBUS_ERROR_TIMED_OUT "org.freedesktop.DBus.Error.TimedOut" 00411 00412 #define DBUS_ERROR_MATCH_RULE_NOT_FOUND "org.freedesktop.DBus.Error.MatchRuleNotFound" 00413 00414 #define DBUS_ERROR_MATCH_RULE_INVALID "org.freedesktop.DBus.Error.MatchRuleInvalid" 00415 00416 #define DBUS_ERROR_SPAWN_EXEC_FAILED "org.freedesktop.DBus.Error.Spawn.ExecFailed" 00417 00418 #define DBUS_ERROR_SPAWN_FORK_FAILED "org.freedesktop.DBus.Error.Spawn.ForkFailed" 00419 00420 #define DBUS_ERROR_SPAWN_CHILD_EXITED "org.freedesktop.DBus.Error.Spawn.ChildExited" 00421 00422 #define DBUS_ERROR_SPAWN_CHILD_SIGNALED "org.freedesktop.DBus.Error.Spawn.ChildSignaled" 00423 00424 #define DBUS_ERROR_SPAWN_FAILED "org.freedesktop.DBus.Error.Spawn.Failed" 00425 00426 #define DBUS_ERROR_SPAWN_SETUP_FAILED "org.freedesktop.DBus.Error.Spawn.FailedToSetup" 00427 00428 #define DBUS_ERROR_SPAWN_CONFIG_INVALID "org.freedesktop.DBus.Error.Spawn.ConfigInvalid" 00429 00430 #define DBUS_ERROR_SPAWN_SERVICE_INVALID "org.freedesktop.DBus.Error.Spawn.ServiceNotValid" 00431 00432 #define DBUS_ERROR_SPAWN_SERVICE_NOT_FOUND "org.freedesktop.DBus.Error.Spawn.ServiceNotFound" 00433 00434 #define DBUS_ERROR_SPAWN_PERMISSIONS_INVALID "org.freedesktop.DBus.Error.Spawn.PermissionsInvalid" 00435 00436 #define DBUS_ERROR_SPAWN_FILE_INVALID "org.freedesktop.DBus.Error.Spawn.FileInvalid" 00437 00438 #define DBUS_ERROR_SPAWN_NO_MEMORY "org.freedesktop.DBus.Error.Spawn.NoMemory" 00439 00440 #define DBUS_ERROR_UNIX_PROCESS_ID_UNKNOWN "org.freedesktop.DBus.Error.UnixProcessIdUnknown" 00441 00442 #define DBUS_ERROR_INVALID_SIGNATURE "org.freedesktop.DBus.Error.InvalidSignature" 00443 00444 #define DBUS_ERROR_INVALID_FILE_CONTENT "org.freedesktop.DBus.Error.InvalidFileContent" 00445 00446 #define DBUS_ERROR_SELINUX_SECURITY_CONTEXT_UNKNOWN "org.freedesktop.DBus.Error.SELinuxSecurityContextUnknown" 00447 00448 #define DBUS_ERROR_ADT_AUDIT_DATA_UNKNOWN "org.freedesktop.DBus.Error.AdtAuditDataUnknown" 00449 00450 #define DBUS_ERROR_OBJECT_PATH_IN_USE "org.freedesktop.DBus.Error.ObjectPathInUse" 00451 00453 #define DBUS_ERROR_INCONSISTENT_MESSAGE "org.freedesktop.DBus.Error.InconsistentMessage" 00454 00457 #define DBUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED "org.freedesktop.DBus.Error.InteractiveAuthorizationRequired" 00458 00459 /* XML introspection format */ 00460 00462 #define DBUS_INTROSPECT_1_0_XML_NAMESPACE "http://www.freedesktop.org/standards/dbus" 00463 00464 #define DBUS_INTROSPECT_1_0_XML_PUBLIC_IDENTIFIER "-//freedesktop//DTD D-BUS Object Introspection 1.0//EN" 00465 00466 #define DBUS_INTROSPECT_1_0_XML_SYSTEM_IDENTIFIER "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd" 00467 00468 #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" 00469 00472 #ifdef __cplusplus 00473 #if 0 00474 { /* avoids confusing emacs indentation */ 00475 #endif 00476 } 00477 #endif 00478 00479 #endif /* DBUS_PROTOCOL_H */