[lib-fix] moved dbus_connection_get_unix_user from daemon to library
[platform/upstream/dbus.git] / dbus / kdbus-common.h
index 9958dd5..4b84a31 100644 (file)
 #define KDBUS_PART_NEXT(part) \
        (typeof(part))(((uint8_t *)part) + KDBUS_ALIGN8((part)->size))
 #define KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE  0x00800000              /* maximum size of message header and items */
-#define KDBUS_PART_HEADER_SIZE          offsetof(struct kdbus_item, data)
-#define KDBUS_PART_SIZE(s) KDBUS_ALIGN8((s) + KDBUS_PART_HEADER_SIZE)
+#define KDBUS_ITEM_HEADER_SIZE          offsetof(struct kdbus_item, data)
+#define KDBUS_ITEM_SIZE(s) KDBUS_ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE)
 
 //todo restore if DBus policy will be applied in kdbus somehow
-#define POLICY_TO_KDBUS
+//#define POLICY_TO_KDBUS
 
-dbus_bool_t register_kdbus_policy(const char* name, DBusTransport *transport, unsigned long int uid);
+struct nameInfo
+{
+  __u64 uniqueId;
+  __u64 userId;
+  __u64 processId;
+  __u32 sec_label_len;
+  char *sec_label;
+};
+int kdbus_NameQuery(const char *name, DBusTransport *transport, struct nameInfo *pInfo);
+dbus_bool_t kdbus_connection_get_unix_user(DBusConnection *connection, const char *name, unsigned long *uid, DBusError *error);
+dbus_bool_t kdbus_connection_get_unix_process_id(DBusConnection *connection, const char *name, unsigned long *uid, DBusError *error);
+
+dbus_bool_t register_kdbus_policy(const char *name, DBusTransport *transport, unsigned long int uid);
 int request_kdbus_name(int fd, const char *name, const __u64 flags, __u64 id);
 int release_kdbus_name(int fd, const char *name, __u64 id);