chiark / gitweb /
bus: stop using EDEADLOCK
[elogind.git] / src / libsystemd / sd-bus / bus-protocol.h
index 5046d17a103fe217ad1b0cbe2628bb1080c1b321..183af89a63a07fa1892df0e7eb25a77d9f2ffd9c 100644 (file)
   along with systemd; If not, see <http://www.gnu.org/licenses/>.
 ***/
 
+#include <endian.h>
+
+#include "macro.h"
+
+/* Packet header */
+
+struct _packed_ bus_header {
+        /* The first four fields are identical for dbus1, and dbus2 */
+        uint8_t endian;
+        uint8_t type;
+        uint8_t flags;
+        uint8_t version;
+
+        union _packed_ {
+                /* dbus1: Used for SOCK_STREAM connections */
+                struct _packed_ {
+                        uint32_t body_size;
+
+                        /* Note that what the bus spec calls "serial" we'll call
+                           "cookie" instead, because we don't want to imply that the
+                           cookie was in any way monotonically increasing. */
+                        uint32_t serial;
+                        uint32_t fields_size;
+                } dbus1;
+
+                /* dbus2: Used for kdbus connections */
+                struct _packed_ {
+                        uint32_t _reserved;
+                        uint64_t cookie;
+                } dbus2;
+
+                /* Note that both header versions have the same size! */
+        };
+};
 
 /* Endianness */
 
@@ -41,7 +75,8 @@ enum {
 
 enum {
         BUS_MESSAGE_NO_REPLY_EXPECTED = 1,
-        BUS_MESSAGE_NO_AUTO_START = 2
+        BUS_MESSAGE_NO_AUTO_START = 2,
+        BUS_MESSAGE_ALLOW_INTERACTIVE_AUTHORIZATION = 4,
 };
 
 /* Header fields */