chiark / gitweb /
bus: add sd_bus_emit_object_{added/removed}()
[elogind.git] / src / libsystemd / sd-bus / bus-message.h
index 0c90e726dec1f11acb852d5ff6cead8201109094..4dd280dcf04ea25c7e1cc8c15ae949e62f662177 100644 (file)
@@ -52,26 +52,14 @@ struct bus_container {
         char *peeked_signature;
 };
 
-struct bus_header {
-        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_;
-
 struct bus_body_part {
         struct bus_body_part *next;
         void *data;
+        void *mmap_begin;
         size_t size;
         size_t mapped;
         size_t allocated;
+        uint64_t memfd_offset;
         int memfd;
         bool free_this:1;
         bool munmap_this:1;
@@ -84,7 +72,7 @@ struct sd_bus_message {
 
         sd_bus *bus;
 
-        uint32_t reply_cookie;
+        uint64_t reply_cookie;
 
         const char *path;
         const char *interface;
@@ -99,6 +87,8 @@ struct sd_bus_message {
         usec_t monotonic;
         usec_t realtime;
         uint64_t seqnum;
+        int64_t priority;
+        uint64_t verify_destination_id;
 
         bool sealed:1;
         bool dont_send:1;
@@ -142,6 +132,7 @@ struct sd_bus_message {
 
         char sender_buffer[3 + DECIMAL_STR_MAX(uint64_t) + 1];
         char destination_buffer[3 + DECIMAL_STR_MAX(uint64_t) + 1];
+        char *destination_ptr;
 
         size_t header_offsets[_BUS_MESSAGE_HEADER_MAX];
         unsigned n_header_offsets;
@@ -161,7 +152,8 @@ static inline uint64_t BUS_MESSAGE_BSWAP64(sd_bus_message *m, uint64_t u) {
         return BUS_MESSAGE_NEED_BSWAP(m) ? bswap_64(u) : u;
 }
 
-static inline uint32_t BUS_MESSAGE_COOKIE(sd_bus_message *m) {
+static inline uint64_t BUS_MESSAGE_COOKIE(sd_bus_message *m) {
+        /* Note that we return the serial converted to a 64bit value here */
         return BUS_MESSAGE_BSWAP32(m, m->header->serial);
 }
 
@@ -219,7 +211,7 @@ int bus_message_from_malloc(
                 const char *label,
                 sd_bus_message **ret);
 
-const char* bus_message_get_arg(sd_bus_message *m, unsigned i);
+int bus_message_get_arg(sd_bus_message *m, unsigned i, const char **str, char ***strv);
 
 int bus_message_append_ap(sd_bus_message *m, const char *types, va_list ap);