chiark / gitweb /
sd-bus: sync kdbus.h (ABI break)
[elogind.git] / src / libsystemd / sd-bus / kdbus.h
index b167c4d00e3523617bdbabe2c726c54fe24476b7..8994b5673dfafd1230c0c62f67ef95ff2ad5bab5 100644 (file)
@@ -4,6 +4,7 @@
  * Copyright (C) 2013-2014 Linux Foundation
  * Copyright (C) 2013-2014 Lennart Poettering
  * Copyright (C) 2013-2014 Daniel Mack <daniel@zonque.org>
+ * Copyright (C) 2013-2014 David Herrmann <dh.herrmann@gmail.com>
  *
  * kdbus is free software; you can redistribute it and/or modify it under
  * the terms of the GNU Lesser General Public License as published by the
@@ -45,8 +46,8 @@ struct kdbus_notify_id_change {
 
 /**
  * struct kdbus_notify_name_change - name registry change message
- * @old:               ID and flags of former owner of a name
- * @now:               ID and flags of new owner of a name
+ * @old_id:            ID and flags of former owner of a name
+ * @new_id:            ID and flags of new owner of a name
  * @name:              Well-known name
  *
  * Sent from kernel to userspace when the owner or activator of
@@ -212,7 +213,6 @@ struct kdbus_policy_access {
  *                             bloom filter
  * @KDBUS_ITEM_DST_NAME:       Destination's well-known name
  * @KDBUS_ITEM_MAKE_NAME:      Name of domain, bus, endpoint
- * @KDBUS_ITEM_MEMFD_NAME:     The human readable name of a memfd (debugging)
  * @KDBUS_ITEM_ATTACH_FLAGS:   Attach-flags, used for updating which metadata
  *                             a connection subscribes to
  * @_KDBUS_ITEM_ATTACH_BASE:   Start of metadata attach items
@@ -253,7 +253,6 @@ enum kdbus_item_type {
        KDBUS_ITEM_BLOOM_MASK,
        KDBUS_ITEM_DST_NAME,
        KDBUS_ITEM_MAKE_NAME,
-       KDBUS_ITEM_MEMFD_NAME,
        KDBUS_ITEM_ATTACH_FLAGS,
 
        _KDBUS_ITEM_ATTACH_BASE = 0x1000,
@@ -444,6 +443,31 @@ struct kdbus_cmd_recv {
        __u64 offset;
 } __attribute__((aligned(8)));
 
+/**
+ * struct kdbus_cmd_cancel - struct to cancel a synchronously pending message
+ * @cookie             The cookie of the pending message
+ * @flags              Flags for the free command. Currently unused.
+ *
+ * This struct is used with the KDBUS_CMD_CANCEL ioctl.
+ */
+struct kdbus_cmd_cancel {
+       __u64 cookie;
+       __u64 flags;
+} __attribute__((aligned(8)));
+
+/**
+ * struct kdbus_cmd_free - struct to free a slice of memory in the pool
+ * @offset             The offset of the memory slice, as returned by other
+ *                     ioctls
+ * @flags              Flags for the free command. Currently unused.
+ *
+ * This struct is used with the KDBUS_CMD_FREE ioctl.
+ */
+struct kdbus_cmd_free {
+       __u64 offset;
+       __u64 flags;
+} __attribute__((aligned(8)));
+
 /**
  * enum kdbus_policy_access_type - permissions of a policy record
  * @_KDBUS_POLICY_ACCESS_NULL: Uninitialized/invalid
@@ -682,7 +706,7 @@ struct kdbus_cmd_conn_info {
        __u64 flags;
        __u64 id;
        __u64 offset;
-       char name[0];
+       struct kdbus_item items[0];
 } __attribute__((aligned(8)));
 
 /**
@@ -711,9 +735,20 @@ struct kdbus_conn_info {
  */
 struct kdbus_cmd_update {
        __u64 size;
+       __u64 flags;
        struct kdbus_item items[0];
 } __attribute__((aligned(8)));
 
+/**
+ * enum kdbus_cmd_match_flags - flags to control the KDBUS_CMD_MATCH_ADD ioctl
+ * @KDBUS_MATCH_REPLACE:       If entries with the supplied cookie already
+ *                             exists, remove them before installing the new
+ *                             matches.
+ */
+enum kdbus_cmd_match_flags {
+       KDBUS_MATCH_REPLACE     = 1ULL <<  0,
+};
+
 /**
  * struct kdbus_cmd_match - struct to add or remove matches
  * @size:              The total size of the struct
@@ -727,6 +762,7 @@ struct kdbus_cmd_update {
 struct kdbus_cmd_match {
        __u64 size;
        __u64 cookie;
+       __u64 flags;
        struct kdbus_item items[0];
 } __attribute__((aligned(8)));
 
@@ -797,8 +833,10 @@ enum kdbus_ioctl_type {
                                              struct kdbus_msg),
        KDBUS_CMD_MSG_RECV =            _IOWR(KDBUS_IOCTL_MAGIC, 0x41,
                                              struct kdbus_cmd_recv),
-       KDBUS_CMD_MSG_CANCEL =          _IOW(KDBUS_IOCTL_MAGIC, 0x42, __u64 *),
-       KDBUS_CMD_FREE =                _IOW(KDBUS_IOCTL_MAGIC, 0x43, __u64 *),
+       KDBUS_CMD_MSG_CANCEL =          _IOW(KDBUS_IOCTL_MAGIC, 0x42,
+                                            struct kdbus_cmd_cancel),
+       KDBUS_CMD_FREE =                _IOW(KDBUS_IOCTL_MAGIC, 0x43,
+                                            struct kdbus_cmd_free),
 
        KDBUS_CMD_NAME_ACQUIRE =        _IOWR(KDBUS_IOCTL_MAGIC, 0x50,
                                              struct kdbus_cmd_name),