bus-kernel.h revision 52cfc0379a9d63f99cdb3d9f63c839bbc8889b4c
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering This file is part of systemd.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Copyright 2013 Lennart Poettering
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is free software; you can redistribute it and/or modify it
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering under the terms of the GNU Lesser General Public License as published by
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering the Free Software Foundation; either version 2.1 of the License, or
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering (at your option) any later version.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering systemd is distributed in the hope that it will be useful, but
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering WITHOUT ANY WARRANTY; without even the implied warranty of
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering Lesser General Public License for more details.
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering You should have received a copy of the GNU Lesser General Public License
1ee306e1248866617c96ed9f4263f375588ad838Lennart Poettering along with systemd; If not, see <http://www.gnu.org/licenses/>.
96aad8d15a324d0e956a4e5653a11a67b209b41aLennart Poettering (typeof(item))(((uint8_t *)item) + ALIGN8((item)->size))
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering#define KDBUS_ITEM_FOREACH(part, head, first) \
c01ff965b48bb9693dcd77cbc748b5d8676766b0Lennart Poettering ((uint8_t *)(part) < (uint8_t *)(head) + (head)->size) && \
003dffde2c1b93afbc9aff24b277276f65424406Lennart Poettering ((uint8_t *) part >= (uint8_t *) head); \
c335068380fe8c9d843cdb2cf8a00f822cfabed3Lennart Poettering#define KDBUS_ITEM_HEADER_SIZE offsetof(struct kdbus_item, data)
003dffde2c1b93afbc9aff24b277276f65424406Lennart Poettering#define KDBUS_ITEM_SIZE(s) ALIGN8((s) + KDBUS_ITEM_HEADER_SIZE)
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering/* When we cache a memfd block for reuse, we will truncate blocks
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering * longer than this in order not to keep too much data around. */
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering#define MEMFD_CACHE_ITEM_SIZE_MAX (128*1024)
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering/* This determines at which minimum size we prefer sending memfds over
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering * sending vectors */
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering/* The size of the per-connection memory pool that we set up and where
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poettering * the kernel places our incoming messages */
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_write_message(sd_bus *bus, sd_bus_message *m, bool hint_sync_call);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_read_message(sd_bus *bus, bool hint_priority, int64_t priority);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_open_bus_fd(const char *bus, char **path);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_make_starter(int fd, const char *name, bool activating, bool accept_fd, BusNamePolicy *policy, BusPolicyAccess world_policy);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_create_bus(const char *name, bool world, char **s);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **path);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_set_endpoint_policy(int fd, uid_t uid, BusEndpoint *ep);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_pop_memfd(sd_bus *bus, void **address, size_t *mapped, size_t *allocated);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringvoid bus_kernel_push_memfd(sd_bus *bus, int fd, void *address, size_t mapped, size_t allocated);
cb81cd8073392936882643af0129934bf67e96c4Lennart Poetteringint bus_kernel_parse_unique_name(const char *s, uint64_t *id);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringuint64_t request_name_flags_to_kdbus(uint64_t sd_bus_flags);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringuint64_t attach_flags_to_kdbus(uint64_t sd_bus_flags);
160e3793adf2da2bd9ae3fe6b8881bb937e6e71bLennart Poetteringint bus_kernel_realize_attach_flags(sd_bus *bus);