summaryrefslogtreecommitdiff
path: root/dbus
diff options
context:
space:
mode:
authorRadoslaw Pajak <r.pajak@samsung.com>2013-12-10 14:35:01 +0100
committerLubomir Rintel <lkundrak@v3.sk>2015-02-11 11:55:11 +0100
commit56fcce739e3590960db5f603b606b74c4e002abe (patch)
treeb82fb1337ac18f5362a9898cef10c2ad3371074a /dbus
parent847a6f9d7b4a234f5cc00b8747c68816d3fdb8e5 (diff)
Kdbus upstream merge in progress
Dbus modifications arised from kdbus upstream changes. Not fully functional! Not working: - org.freedesktop.DBus methods ListNames and ListQueuedOwners - stating services Change-Id: I9720c75d7b51b3343fb9df924cd9bf24f4c409a0 Signed-off-by: Radoslaw Pajak <r.pajak@samsung.com>
Diffstat (limited to 'dbus')
-rw-r--r--dbus/.project20
-rw-r--r--dbus/dbus-transport-kdbus.c26
-rw-r--r--dbus/dbus-transport-kdbus.h1
-rw-r--r--dbus/kdbus-common.h7
4 files changed, 45 insertions, 9 deletions
diff --git a/dbus/.project b/dbus/.project
index 598740dd..b8a675dc 100644
--- a/dbus/.project
+++ b/dbus/.project
@@ -86,4 +86,24 @@
<nature>org.eclipse.cdt.managedbuilder.core.ScannerConfigNature</nature>
<nature>org.tizen.nativecpp.apichecker.core.tizenCppNature</nature>
</natures>
+ <filteredResources>
+ <filter>
+ <id>1386660941020</id>
+ <name></name>
+ <type>6</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*.lo</arguments>
+ </matcher>
+ </filter>
+ <filter>
+ <id>1386660941025</id>
+ <name></name>
+ <type>6</type>
+ <matcher>
+ <id>org.eclipse.ui.ide.multiFilter</id>
+ <arguments>1.0-name-matches-false-false-*.orig</arguments>
+ </matcher>
+ </filter>
+ </filteredResources>
</projectDescription>
diff --git a/dbus/dbus-transport-kdbus.c b/dbus/dbus-transport-kdbus.c
index 6eabd17b..690c32c7 100644
--- a/dbus/dbus-transport-kdbus.c
+++ b/dbus/dbus-transport-kdbus.c
@@ -136,6 +136,17 @@ __u64 dbus_transport_get_bloom_size(DBusTransport* transport)
}
/**
+ * Gets pointer to the memory pool, wher received messages are
+ * placed and some ioctls return their info
+ * @param transport transport
+ * @returns pointer to the pool
+ */
+void* dbus_transport_get_pool_pointer(DBusTransport* transport)
+{
+ return ((DBusTransportKdbus*)transport)->kdbus_mmap_ptr;
+}
+
+/**
* Puts locally generated message into received messages queue
* @param message message that will be added
* @param connection connection to which message will be added
@@ -274,24 +285,24 @@ static struct kdbus_msg* kdbus_init_msg(const char* name, __u64 dst_id, uint64_t
msg_size = sizeof(struct kdbus_msg);
if(use_memfd == TRUE) // bulk data - memfd
- msg_size += KDBUS_ITEM_SIZE(sizeof(struct kdbus_memfd));
+ msg_size += KDBUS_PART_SIZE(sizeof(struct kdbus_memfd));
else
{
- msg_size += KDBUS_ITEM_SIZE(sizeof(struct kdbus_vec)); //header is a must
+ msg_size += KDBUS_PART_SIZE(sizeof(struct kdbus_vec)); //header is a must
while(body_size > KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE)
{
- msg_size += KDBUS_ITEM_SIZE(sizeof(struct kdbus_vec));
+ msg_size += KDBUS_PART_SIZE(sizeof(struct kdbus_vec));
body_size -= KDBUS_MSG_MAX_PAYLOAD_VEC_SIZE;
}
if(body_size)
- msg_size += KDBUS_ITEM_SIZE(sizeof(struct kdbus_vec));
+ msg_size += KDBUS_PART_SIZE(sizeof(struct kdbus_vec));
}
if(fds_count)
- msg_size += KDBUS_ITEM_SIZE(sizeof(int)*fds_count);
+ msg_size += KDBUS_PART_SIZE(sizeof(int)*fds_count);
if (name)
- msg_size += KDBUS_ITEM_SIZE(strlen(name) + 1);
+ msg_size += KDBUS_PART_SIZE(strlen(name) + 1);
else if (dst_id == KDBUS_DST_ID_BROADCAST)
msg_size += KDBUS_PART_HEADER_SIZE + transport->bloom_size;
@@ -567,9 +578,10 @@ static int capture_hello_message(DBusTransport *transport, const char* destinati
strcpy(name, ":1.");
if(!bus_register_kdbus(&name[3], (DBusTransportKdbus*)transport))
goto out;
+#ifdef POLICY_TO_KDBUS
if(!register_kdbus_policy(&name[3], transport, geteuid()))
goto out;
-
+#endif
((DBusTransportKdbus*)transport)->sender = name;
if(!reply_1_data(message, DBUS_TYPE_STRING, &name, transport->connection))
diff --git a/dbus/dbus-transport-kdbus.h b/dbus/dbus-transport-kdbus.h
index 935ad6e8..f070dace 100644
--- a/dbus/dbus-transport-kdbus.h
+++ b/dbus/dbus-transport-kdbus.h
@@ -31,6 +31,7 @@
#include <linux/types.h>
__u64 dbus_transport_get_bloom_size(DBusTransport* transport);
+void* dbus_transport_get_pool_pointer(DBusTransport* transport);
DBusTransportOpenResult _dbus_transport_open_kdbus(DBusAddressEntry *entry, DBusTransport **transport_p, DBusError *error);
#endif
diff --git a/dbus/kdbus-common.h b/dbus/kdbus-common.h
index b7b53c9a..656b25f2 100644
--- a/dbus/kdbus-common.h
+++ b/dbus/kdbus-common.h
@@ -29,15 +29,18 @@
#include <dbus/dbus-types.h>
#include <dbus/dbus-transport.h>
+#include <dbus/kdbus.h>
#define KDBUS_ALIGN8(l) (((l) + 7) & ~7)
#define KDBUS_PART_NEXT(part) \
(typeof(part))(((uint8_t *)part) + KDBUS_ALIGN8((part)->size))
-#define KDBUS_ITEM_SIZE(s) KDBUS_ALIGN8((s) + KDBUS_PART_HEADER_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)
+
+//todo restore if DBus policy will be applied in kdbus somehow
+#define POLICY_TO_KDBUS
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);