diff options
author | Lennart Poettering <lennart@poettering.net> | 2015-02-13 17:32:38 +0100 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2015-02-16 15:03:44 +0100 |
commit | 2ac7c17f9d8eeb403b91ee5a389562edaf47fb87 (patch) | |
tree | 3b55981e7648c1b58aaf6d656e28003c53c3497c /src/libsystemd/sd-bus/bus-protocol.h | |
parent | 38ab096869ad6bb39a9ef9a012abfb42ea62cd93 (diff) |
Revert "Revert "sd-bus: change serialization of kdbus messages to qualify in their entirety as gvariant objects""
This reverts commit 954871d8ba15911d014f76ed2c7a9492953cf39d.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-protocol.h')
-rw-r--r-- | src/libsystemd/sd-bus/bus-protocol.h | 35 |
1 files changed, 26 insertions, 9 deletions
diff --git a/src/libsystemd/sd-bus/bus-protocol.h b/src/libsystemd/sd-bus/bus-protocol.h index 6431dfbff8..183af89a63 100644 --- a/src/libsystemd/sd-bus/bus-protocol.h +++ b/src/libsystemd/sd-bus/bus-protocol.h @@ -23,21 +23,38 @@ #include <endian.h> +#include "macro.h" + /* Packet header */ -struct bus_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; - 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; -} _packed_; + + 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 */ |