diff options
author | Lennart Poettering <lennart@poettering.net> | 2013-05-19 18:39:08 +0200 |
---|---|---|
committer | Lennart Poettering <lennart@poettering.net> | 2013-05-20 10:13:38 +0200 |
commit | c78196699d3d805b2237896a1d2b8efeec6068d0 (patch) | |
tree | 91a473710b96a395b4c7543d85c08e73bad13cab /src/libsystemd-bus/bus-kernel.h | |
parent | 12f25b6e741bc8394f63778598fc203e3f6d4ae6 (diff) |
bus: calculate bloom filter for match
Yay! Filtering using kernel bloom filter matches works now! Yippieh!
Diffstat (limited to 'src/libsystemd-bus/bus-kernel.h')
-rw-r--r-- | src/libsystemd-bus/bus-kernel.h | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libsystemd-bus/bus-kernel.h b/src/libsystemd-bus/bus-kernel.h index 8cf153ab41..dddecfb210 100644 --- a/src/libsystemd-bus/bus-kernel.h +++ b/src/libsystemd-bus/bus-kernel.h @@ -23,6 +23,17 @@ #include "sd-bus.h" +#define KDBUS_ITEM_NEXT(item) \ + (typeof(item))(((uint8_t *)item) + ALIGN8((item)->size)) + +#define KDBUS_ITEM_FOREACH(item, head) \ + for (item = (head)->items; \ + (uint8_t *)(item) < (uint8_t *)(head) + (head)->size; \ + item = KDBUS_ITEM_NEXT(item)) + +#define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data) +#define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE) + #define MEMFD_CACHE_MAX 32 /* When we cache a memfd block for reuse, we will truncate blocks @@ -55,3 +66,5 @@ int bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *size); void bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t size); void bus_kernel_flush_memfd(sd_bus *bus); + +int bus_kernel_parse_unique_name(const char *s, uint64_t *id); |