Commit graph

76 commits

Author SHA1 Message Date
Lennart Poettering 219728b31b bus: synthesize NameLost/NameAcquired from kernel messages on top if NameOwnerChange 2013-11-29 22:03:55 +01:00
Lennart Poettering 51502af33d bus: fix callback index when dispatching kernel messages 2013-11-29 22:03:55 +01:00
Lennart Poettering 7d22c71732 bus: add the ability for backends to queue to input messages at the same time
We need this so that one incoming kernel message can result in two
high-level bus messages, for the case where we synthesize NameAcquired
and NameOwnerChanged in the same instance.
2013-11-29 22:03:55 +01:00
Daniel Mack 98f17eda0f libsystemd-bus: rename sd_bus_kernel_translate_request_name_flags
... to keep the namespace clean.
2013-11-29 22:01:34 +01:00
Daniel Mack 87b522ae19 libsystemd-bus: add sd_bus_translate_attach_flags()
Factor out code from sd_bus_negotiate_attach_creds() to a generic
translate function, so it can be used from other places.
2013-11-29 22:01:34 +01:00
Lennart Poettering 777d7a6123 kdbus: synthesize NameOwnerChange signals from kernel messages and support matches against NameOwnerChange 2013-11-29 20:14:11 +01:00
Daniel Mack ea1edeceb1 libsystemd-bus: follow kdbus renames
kdbus now has more generic names for the items it passes around. That
allows for usage from other contexts.
2013-11-29 18:10:36 +01:00
Daniel Mack c58dea190c libsystemd-bus: copy over kdbus provided 128-bit bus id
kdbus now copies the bus unique id back to userspace in the hello
ioctl(). Use these bytes to set the server id of the sd_bus.
2013-11-29 16:27:30 +01:00
Daniel Mack d21a7bb1a9 libsystemd-bus: catch up with latest kdbus changes
kdbus_cmd_hello now has a new uint64_t flags field for the requested
attachments. Follow that change in libsystemd-bus.
2013-11-29 15:36:40 +01:00
Daniel Mack 0253ddccbb libsystemd-bus: kernel: add sd_bus_kernel_translate_request_name_flags
Flags used to request a name from kdbus are not identical to what DBus
and sd_bus use internally. Introduce a simple function to do the
translation for us. It's factored out to a separate function so the
dbus-driver instance can make use of it as well.
2013-11-29 14:06:50 +01:00
Daniel Mack 9eb34e8225 libsystemd-bus: bring definitions in sync with kdbus
In particular, KDBUS_ITEM_NEXT is now called KDBUS_PART_NEXT, and
KDBUS_ITEM_FOREACH was renamed to KDBUS_PART_FOREACH and takes one more
argument to make it more flexible.
2013-11-29 14:06:49 +01:00
Lukasz Skalski 27df44a2c6 bus: Add KDBUS_MSG_SRC_NAMES to bus_kernel_make_message() function 2013-11-29 11:43:28 +01:00
Lennart Poettering 5b12334d35 bus: add new sd_bus_creds object to encapsulate process credentials
This way we can unify handling of credentials that are attached to
messages, or can be queried for bus name owners or connection peers.

This also adds the ability to extend incomplete credential information
with data from /proc,

Also, provide a convenience call that will automatically determine the
most appropriate credential object for an incoming message, by using the
the attached information if possible, the sending name information if
available and otherwise the peer's credentials.
2013-11-28 18:42:18 +01:00
Lennart Poettering df2d202e6e bus: let's simplify things by getting rid of unnecessary bus parameters 2013-11-21 02:07:35 +01:00
Kay Sievers efa3c0af8e bus: update for kdbus changes 2013-07-22 23:00:31 +02:00
Kay Sievers bf30e48fe5 bus: unmap memfd retrieved from the memfd cache 2013-06-04 23:37:57 +02:00
Kay Sievers 62b3e928de bus: update for kdbus changes 2013-05-30 05:35:42 +02:00
Lennart Poettering 76b7742c13 bus: when adding memfds to cache and we shorten them, make sure to unmap the remainder 2013-05-29 17:05:01 +09:00
Lennart Poettering 8f155917bf bus: add benchmark tool to determine the right threshold for copying vs. memfd 2013-05-22 16:04:39 +02:00
Lennart Poettering f11e11e344 bus: add test for bloom filter prefix match 2013-05-20 10:13:38 +02:00
Lennart Poettering c78196699d bus: calculate bloom filter for match
Yay! Filtering using kernel bloom filter matches works now! Yippieh!
2013-05-20 10:13:38 +02:00
Kay Sievers 16af1d3922 bus: do not pass a pointer but a uint64_t address in RECV 2013-05-17 23:26:28 +02:00
Lennart Poettering 264ad849a4 bus: add APIs for negotiating what is attached to messages 2013-05-17 04:26:27 +02:00
Lennart Poettering 45fbe937d7 bus: add minimal locking around the memfd cache
We want to allow clients to process an sd_bus_message on a different
thread than it was received on. Since unreffing a bus message might
readd some of its memfds to the memfd cache add some minimal locking
around the cache.
2013-05-17 04:26:27 +02:00
Lennart Poettering 63edf05ed9 bus: actually unmap kdbus pool after use 2013-05-17 04:26:27 +02:00
Lennart Poettering 66b26c5c9b bus: send memfds as payload only on directed messages and for large parts 2013-05-16 16:26:35 +02:00
Lennart Poettering 1307c3ff9a bus: implement receiving side of memfd hookup 2013-05-16 02:37:42 +02:00
Lennart Poettering a392d36195 bus: put together messages with memfd payload correctly 2013-05-16 02:04:13 +02:00
Lennart Poettering 453a0c2946 bus: add support for adding memfds into message payload 2013-05-15 19:45:45 +02:00
Lennart Poettering c91cb83c4d bus: rework message struct to keep header with fields in same malloc() block
This allows us to guarantee that the first payload_vec we pass to the
kernel for each message is guaranteed to include the full header and all
its field.
2013-05-15 02:56:45 +02:00
Lennart Poettering 9b29bb6853 bus: add macro for iterating through body parts of a message 2013-05-15 01:43:15 +02:00
Lennart Poettering 9b05bc4866 bus: fix allocation of body parts from memfd 2013-05-14 22:52:58 +02:00
Lennart Poettering bc7fd8cdbe bus: properly handle message bodies that are a chain of memory areas rather than a single one 2013-05-14 22:28:45 +02:00
Kay Sievers a3dc35472f bus: add and use UINT64_TO_PTR() 2013-05-14 16:13:52 +02:00
Kay Sievers 18cd014f13 bus: remove KDBUS_MAKE_ACCESS_WORLD, remove (n_payload > 2) check
KDBUS_MAKE_ACCESS_WORLD is no longer needed, the kernel creates the
kdbus device node with the uid/gid of the caller now.
2013-05-12 20:17:47 +02:00
Kay Sievers 13019ef5ea bus: fix test-bus-memfd 2013-05-10 19:58:05 +02:00
Lennart Poettering fd8d62d940 bus: catch up with latest kdbus 2013-05-10 03:38:11 +02:00
Kay Sievers febfd50829 kdbus: update kdbus.h from upstream 2013-05-02 19:02:01 +02:00
Kay Sievers 799e7ea858 kdbus: update kdbus.h from upstream 2013-05-02 17:57:49 +02:00
Kay Sievers 27eda16e98 kdbus: update kdbus.h from upstream 2013-04-30 19:15:35 +02:00
Zbigniew Jędrzejewski-Szmek e0a974b471 bus: avoid gcc warning about casting a pointer to int of different size 2013-04-25 21:50:48 -04:00
Lennart Poettering 102ea8e4f2 bus: parse capability kdbus meta data of messages 2013-04-23 00:14:30 -03:00
Lennart Poettering 120f919e70 bus: parse audit metadata from kdbus messages 2013-04-22 23:38:38 -03:00
Lennart Poettering 9097fe299f bus: implement client logic for fd passing 2013-04-21 22:24:50 -03:00
Kay Sievers a2cef833cf bus: catch up with kernel changes 2013-04-18 18:54:17 +02:00
Lennart Poettering c556fe792d bus: replace aligned_alloc() with memalign() everywhere
aligned_alloc() is C11 and not available everywhere. Also it would
require us to align the size value. So let's just invoke memalign()
instead, which is universally available and doesn't have any alignment
restrictions on the size parameter.
2013-04-17 18:48:31 +02:00
Kay Sievers 6133cee253 bus: copy iteration macro from the kernel 2013-04-16 02:10:55 +02:00
Kay Sievers 68cfd33173 bus: catch up with kernel changes 2013-04-16 01:44:36 +02:00
Kay Sievers 8ad802ec35 bus: fix missing macro argument renaming
<fdo-vcs> systemd kay master * b1454bf src/libsystemd-bus/ bus-kernel.c kdbus.h
<fdo-vcs> systemd bus: catch up with kernel changes
<kmacleod> kay: randomly looked at your commit, it looks like in KDBUS_FOREACH_ITEM
  you missed changing a (d) to an (i) in (uint8_t*) (d) < (uint8_t*) (k) + (k)->size;  ?
<kay> kmacleod: hah, so there *is* a reason for using _foo in macros :)
<kay> kmacleod: thanks!
2013-04-15 23:39:42 +02:00
Kay Sievers b1454bf05c bus: catch up with kernel changes 2013-04-15 23:32:38 +02:00