chiark / gitweb /
sd-netlink: introduce api for new NL type NLA_FLAG
[elogind.git] / src / systemd / sd-bus-protocol.h
1 /*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
2
3 #ifndef foosdbusprotocolhfoo
4 #define foosdbusprotocolhfoo
5
6 /***
7   This file is part of systemd.
8
9   Copyright 2013 Lennart Poettering
10
11   systemd is free software; you can redistribute it and/or modify it
12   under the terms of the GNU Lesser General Public License as published by
13   the Free Software Foundation; either version 2.1 of the License, or
14   (at your option) any later version.
15
16   systemd is distributed in the hope that it will be useful, but
17   WITHOUT ANY WARRANTY; without even the implied warranty of
18   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19   Lesser General Public License for more details.
20
21   You should have received a copy of the GNU Lesser General Public License
22   along with systemd; If not, see <http://www.gnu.org/licenses/>.
23 ***/
24
25 #include "_sd-common.h"
26
27 _SD_BEGIN_DECLARATIONS;
28
29 /* Types of message */
30
31 enum {
32         _SD_BUS_MESSAGE_TYPE_INVALID = 0,
33         SD_BUS_MESSAGE_METHOD_CALL,
34         SD_BUS_MESSAGE_METHOD_RETURN,
35         SD_BUS_MESSAGE_METHOD_ERROR,
36         SD_BUS_MESSAGE_SIGNAL,
37         _SD_BUS_MESSAGE_TYPE_MAX
38 };
39
40 /* Primitive types */
41
42 enum {
43         _SD_BUS_TYPE_INVALID         = 0,
44         SD_BUS_TYPE_BYTE             = 'y',
45         SD_BUS_TYPE_BOOLEAN          = 'b',
46         SD_BUS_TYPE_INT16            = 'n',
47         SD_BUS_TYPE_UINT16           = 'q',
48         SD_BUS_TYPE_INT32            = 'i',
49         SD_BUS_TYPE_UINT32           = 'u',
50         SD_BUS_TYPE_INT64            = 'x',
51         SD_BUS_TYPE_UINT64           = 't',
52         SD_BUS_TYPE_DOUBLE           = 'd',
53         SD_BUS_TYPE_STRING           = 's',
54         SD_BUS_TYPE_OBJECT_PATH      = 'o',
55         SD_BUS_TYPE_SIGNATURE        = 'g',
56         SD_BUS_TYPE_UNIX_FD          = 'h',
57         SD_BUS_TYPE_ARRAY            = 'a',
58         SD_BUS_TYPE_VARIANT          = 'v',
59         SD_BUS_TYPE_STRUCT           = 'r', /* not actually used in signatures */
60         SD_BUS_TYPE_STRUCT_BEGIN     = '(',
61         SD_BUS_TYPE_STRUCT_END       = ')',
62         SD_BUS_TYPE_DICT_ENTRY       = 'e', /* not actually used in signatures */
63         SD_BUS_TYPE_DICT_ENTRY_BEGIN = '{',
64         SD_BUS_TYPE_DICT_ENTRY_END   = '}',
65 };
66
67 /* Well-known errors. Note that this is only a sanitized subset of the
68  * errors that the reference implementation generates. */
69
70 #define SD_BUS_ERROR_FAILED                     "org.freedesktop.DBus.Error.Failed"
71 #define SD_BUS_ERROR_NO_MEMORY                  "org.freedesktop.DBus.Error.NoMemory"
72 #define SD_BUS_ERROR_SERVICE_UNKNOWN            "org.freedesktop.DBus.Error.ServiceUnknown"
73 #define SD_BUS_ERROR_NAME_HAS_NO_OWNER          "org.freedesktop.DBus.Error.NameHasNoOwner"
74 #define SD_BUS_ERROR_NO_REPLY                   "org.freedesktop.DBus.Error.NoReply"
75 #define SD_BUS_ERROR_IO_ERROR                   "org.freedesktop.DBus.Error.IOError"
76 #define SD_BUS_ERROR_BAD_ADDRESS                "org.freedesktop.DBus.Error.BadAddress"
77 #define SD_BUS_ERROR_NOT_SUPPORTED              "org.freedesktop.DBus.Error.NotSupported"
78 #define SD_BUS_ERROR_LIMITS_EXCEEDED            "org.freedesktop.DBus.Error.LimitsExceeded"
79 #define SD_BUS_ERROR_ACCESS_DENIED              "org.freedesktop.DBus.Error.AccessDenied"
80 #define SD_BUS_ERROR_AUTH_FAILED                "org.freedesktop.DBus.Error.AuthFailed"
81 #define SD_BUS_ERROR_NO_SERVER                  "org.freedesktop.DBus.Error.NoServer"
82 #define SD_BUS_ERROR_TIMEOUT                    "org.freedesktop.DBus.Error.Timeout"
83 #define SD_BUS_ERROR_NO_NETWORK                 "org.freedesktop.DBus.Error.NoNetwork"
84 #define SD_BUS_ERROR_ADDRESS_IN_USE             "org.freedesktop.DBus.Error.AddressInUse"
85 #define SD_BUS_ERROR_DISCONNECTED               "org.freedesktop.DBus.Error.Disconnected"
86 #define SD_BUS_ERROR_INVALID_ARGS               "org.freedesktop.DBus.Error.InvalidArgs"
87 #define SD_BUS_ERROR_FILE_NOT_FOUND             "org.freedesktop.DBus.Error.FileNotFound"
88 #define SD_BUS_ERROR_FILE_EXISTS                "org.freedesktop.DBus.Error.FileExists"
89 #define SD_BUS_ERROR_UNKNOWN_METHOD             "org.freedesktop.DBus.Error.UnknownMethod"
90 #define SD_BUS_ERROR_UNKNOWN_OBJECT             "org.freedesktop.DBus.Error.UnknownObject"
91 #define SD_BUS_ERROR_UNKNOWN_INTERFACE          "org.freedesktop.DBus.Error.UnknownInterface"
92 #define SD_BUS_ERROR_UNKNOWN_PROPERTY           "org.freedesktop.DBus.Error.UnknownProperty"
93 #define SD_BUS_ERROR_PROPERTY_READ_ONLY         "org.freedesktop.DBus.Error.PropertyReadOnly"
94 #define SD_BUS_ERROR_UNIX_PROCESS_ID_UNKNOWN    "org.freedesktop.DBus.Error.UnixProcessIdUnknown"
95 #define SD_BUS_ERROR_INVALID_SIGNATURE          "org.freedesktop.DBus.Error.InvalidSignature"
96 #define SD_BUS_ERROR_INCONSISTENT_MESSAGE       "org.freedesktop.DBus.Error.InconsistentMessage"
97 #define SD_BUS_ERROR_MATCH_RULE_NOT_FOUND       "org.freedesktop.DBus.Error.MatchRuleNotFound"
98 #define SD_BUS_ERROR_MATCH_RULE_INVALID         "org.freedesktop.DBus.Error.MatchRuleInvalid"
99 #define SD_BUS_ERROR_INTERACTIVE_AUTHORIZATION_REQUIRED \
100                                                 "org.freedesktop.DBus.Error.InteractiveAuthorizationRequired"
101
102 _SD_END_DECLARATIONS;
103
104 #endif